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
Own Methods Creates a SearchRegistryCriteria object based on the specified Map.
private SearchRegistryCriteria createCriteria(Map criteriaMap) { SearchRegistryCriteria criteria = new SearchRegistryCriteria(); Object[] keys = criteriaMap.keySet().toArray(); for (int i=0; i<keys.length; i++) { Logger.debug( "[SubmitRegistrySearchAction.createCriteria] Setting field "+keys[i] + " to "+criteriaMap.get(keys[i])); criteria.setFieldValue((Number)keys[i], criteriaMap.get(keys[i])); } return criteria; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Criteria buildCriteria(Map<String, ?> fieldValues) {\r\n Criteria criteria = new Criteria();\r\n for (Iterator i = fieldValues.entrySet().iterator(); i.hasNext();) {\r\n Map.Entry<String, Object> e = (Map.Entry<String, Object>) i.next();\r\n\r\n String key = e.getKey();\r\n Object value = e.getValue();\r\n if (value instanceof Collection) {\r\n criteria.addIn(key, (Collection) value);\r\n } else {\r\n criteria.addEqualTo(key, value);\r\n }\r\n }\r\n\r\n return criteria;\r\n }", "public SearchDocument(Map<? extends String, ?> propertyMap) {\n super(propertyMap);\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "public CanvasCriteriaTypeMap()\r\n\t{\r\n\r\n\t}", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria(this);\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria(this);\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria(this);\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria(this);\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria(this);\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }", "protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }" ]
[ "0.61597943", "0.6068808", "0.587772", "0.587772", "0.58505666", "0.58501977", "0.58224535", "0.58224535", "0.58224535", "0.58224535", "0.58224535", "0.58224535", "0.58224535", "0.58224535", "0.58224535", "0.58224535", "0.58224535", "0.58224535", "0.58224535", "0.58224535", "0.58224535", "0.58224535", "0.58224535", "0.58224535", "0.58224535", "0.58224535", "0.58224535", "0.58224535", "0.5810262", "0.5810262", "0.5810262", "0.5810262", "0.5810262", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906", "0.5808906" ]
0.8014202
0
we got a broadcast with a status of off, so keep waiting
@Override public void onDisabled() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void broadcastReadyAction() {\n Log.d(TAG, \"broadcastReadyAction start\");\n final Intent intent = new Intent();\n intent.setAction(BeaconsMonitoringService.SERVICE_READY_ACTION);\n getBaseContext().sendBroadcast(intent);\n Log.d(TAG, \"broadcastReadyAction end\");\n }", "private void onUnavailable() {\n // TODO: broadcast\n }", "private void sendNextBroadcast() {\n synchronized (this.mLock) {\n if (this.mBroadcastedInteractiveState == 0) {\n this.mPendingWakeUpBroadcast = false;\n this.mBroadcastedInteractiveState = 1;\n } else if (this.mBroadcastedInteractiveState == 1) {\n if (!(this.mPendingWakeUpBroadcast || this.mPendingGoToSleepBroadcast)) {\n if (this.mPendingInteractiveState != 2) {\n finishPendingBroadcastLocked();\n return;\n }\n }\n this.mPendingGoToSleepBroadcast = false;\n this.mBroadcastedInteractiveState = 2;\n } else {\n if (!(this.mPendingWakeUpBroadcast || this.mPendingGoToSleepBroadcast)) {\n if (this.mPendingInteractiveState != 1) {\n finishPendingBroadcastLocked();\n return;\n }\n }\n this.mPendingWakeUpBroadcast = false;\n this.mBroadcastedInteractiveState = 1;\n }\n this.mBroadcastStartTime = SystemClock.uptimeMillis();\n int powerState = this.mBroadcastedInteractiveState;\n }\n }", "public void notifySwitchAway() { }", "synchronized void receiveJETON(){\n\tif(SC){\n\t\tJeton = true;\n\t}else{\n\t\tif (procId==0){\n\t\t\tSyncMessage sm = new SyncMessage(MsgType.JETON, 0, procId);\n\t\t\tsendTo(0, sm);\n\t\t}else{\n\t\t\tSyncMessage sm = new SyncMessage(MsgType.JETON, 1, procId);\n\t\t\tsendTo(1, sm);\n\t\t}\n\t}\n\tthis.notifyAll();\n\n}", "void wakeUp();", "public void broadcastState() {\n StringBuilder sb = new StringBuilder();\n sb.append(MSG_STATE);\n\n if(mService.isTransmitterMode()) {\n sb.append(\" t \");\n }\n else {\n sb.append(\" r \");\n }\n\n sb.append(mService.getVADThreshold());\n sb.append(\" \");\n\n sb.append(mService.getNoiseTracker().getLastNoiseHeard() / 1000);\n\n try {\n sendChannelMessage(sb.toString());\n }\n catch(RemoteException e) {\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void onReceive(Context context, Intent intent) {\n\t\tif (intent.getStringExtra(TelephonyManager.EXTRA_STATE).equals(TelephonyManager.EXTRA_STATE_IDLE))\n\t\t{\n\t\t\t//hang off - return volume\n\t\t\t//System.out.println (\"Idle\");\n\t\t\tIntent intentTo = new Intent();\n\t\t\tintentTo.putExtra(\"event\", \"idle\");\n\t\t\tintentTo.setAction(\"CallActionHappened\");\n\t\t\tcontext.sendBroadcast(intentTo);\n\t\t}\n\t\telse if (intent.getStringExtra(TelephonyManager.EXTRA_STATE).equals(TelephonyManager.EXTRA_STATE_OFFHOOK))\n\t\t{\n\t\t\tIntent intentTo = new Intent();\n\t\t\tintentTo.putExtra(\"event\", \"offhook\");\n\t\t\tintentTo.setAction(\"CallActionHappened\");\n\t\t\tcontext.sendBroadcast(intentTo);\n\t\t\t//hang on - mute\n\t\t\t//System.out.println (\"Offhook\");\n\t\t}\n\t\telse if (intent.getStringExtra(TelephonyManager.EXTRA_STATE).equals(TelephonyManager.EXTRA_STATE_RINGING))\n\t\t{\n\t\t\t//System.out.println (\"Ringing\");\n\t\t}\n\t}", "public void mo33398h() {\n String str = \"com.tencent.android.tpush.service.channel.heartbeatIntent.pullup\";\n String str2 = \"TpnsChannel\";\n try {\n if (this.f23285A == null) {\n IntentFilter intentFilter = new IntentFilter();\n intentFilter.addAction(\"android.intent.action.SCREEN_ON\");\n intentFilter.addAction(\"android.intent.action.SCREEN_OFF\");\n intentFilter.addAction(\"android.intent.action.USER_PRESENT\");\n intentFilter.addAction(str);\n C6973b.m29776f().registerReceiver(this.f23292L, intentFilter);\n this.f23285A = PendingIntent.getBroadcast(C6973b.m29776f(), 0, new Intent(str), 134217728);\n }\n long currentTimeMillis = System.currentTimeMillis();\n if (f23282q > f23278m) {\n f23282q = f23278m;\n }\n if (XGPushConfig.isForeignWeakAlarmMode(C6973b.m29776f())) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"schedulePullUpHeartbeat WaekAlarmMode heartbeatinterval: \");\n sb.append(f23280o);\n sb.append(\" ms\");\n C6864a.m29305f(str2, sb.toString());\n f23282q = f23280o;\n }\n f23282q = C7055h.m30166a(C6973b.m29776f(), \"com.tencent.android.xg.wx.HeartbeatIntervalMs\", f23282q);\n long j = currentTimeMillis + ((long) f23282q);\n mo33391b(true);\n C7045d.m30117a().mo34149a(0, j, this.f23285A);\n } catch (Throwable th) {\n C6864a.m29302d(str2, \"scheduleHeartbeat error\", th);\n }\n }", "private void wake_up() {\n switch(state) {\n case ROAMING:\n case WAKING:\n case AWAKE:\n return;\n }\n\n state = State.WAKING;\n\n // Lock wifi so we don't lose contact with the server -- we can only talk to it via our\n // wifi network, the fallback to cell service is not ok.\n if(wifi_lock == null) {\n WifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE);\n wifi_lock = wifiManager.createWifiLock(\"ServerLock\");\n wifi_lock.setReferenceCounted(false);\n }\n wifi_lock.acquire();\n\n // Create an 'ongoing' intent so we're considered a 'foreground' service and not killed.\n // Plus, it's kind of nice to have the notification anyway.\n Intent app_intent = new Intent(this, MainActivity.class);\n app_intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);\n PendingIntent app_pi = PendingIntent.getActivity(this, 0, app_intent, 0);\n\n Intent sleep_intent = new Intent(this, ServerWakeService.class);\n sleep_intent.setAction(Constants.SLEEP_INTENT);\n PendingIntent sleep_pi = PendingIntent.getService(this, 0, sleep_intent, 0);\n\n Notification note = new Notification.Builder(this)\n .setSmallIcon(R.drawable.sleep_icon)\n .setContentTitle(\"ServerLock\")\n .setTicker(\"ServerLock\")\n .setContentText(\"Keeping the server awake...\")\n .setContentIntent(app_pi)\n .setOngoing(true)\n .addAction(android.R.drawable.ic_lock_power_off, \"Allow sleep\", sleep_pi)\n .build();\n\n startForeground(Constants.NOTIFICATION_ID.FOREGROUND_SERVICE, note);\n\n // Start a worker thread that will connect to the server and do the actual work.\n if(worker == null) {\n worker = new Thread(new Runnable() {\n @Override\n public void run() {\n keep_server_up();\n }\n });\n worker.start();\n }\n\n // Update the UI, if it's open.\n send_status_update();\n }", "@Override\n \t\t\tpublic void onClick(View v) {\n \t\t\t\tLog.d(\"VoMPCall\", \"Hanging up\");\n \t\t\t\tServalBatPhoneApplication.context.servaldMonitor\n \t\t\t\t\t\t.sendMessage(\"hangup \"\n \t\t\t\t\t\t+ Integer.toHexString(local_id));\n \t\t\t}", "private void screenOffBroadcast() {\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {\n mDoScreenOff = true;\n }\n // prize add v8.0 by zhaojian 20171102 end\n\n Intent intent = new Intent(\"prize.set.keyguard.state\");\n intent.putExtra(\"hide\",false);\n intent.putExtra(\"sleep\",true);\n getContext().sendBroadcast(intent);\n flags = false;\n // prize add v8.0 by zhaojian 20171102 start\n beforeIsLock = false;\n // prize add v8.0 by zhaojian 20171102 end\n\n handler.removeMessages(1);\n\n // prize add v8.0 by zhaojian 2017912 start\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N){\n mIsAutoEnterReceiveUi = false;\n }\n // prize add v8.0 by zhaojian 2017912 end\n Log.d(TAG,\"screen off\");\n }", "@Override\n\tpublic void forceStateBroadcast() {\n\t\tpeerDiscoveryService.sendStateMulticast();\n\t}", "public void powerOff() { //power_off\n String json = new Gson().toJson(new TelevisionModel(TelevisionModel.Action.OFF));\n String a = sendMessage(json);\n TelevisionModel teleM = new Gson().fromJson(a, TelevisionModel.class);\n System.out.println(\"Client Received \" + json);\n\n if (teleM.getAction() == TelevisionModel.Action.OFF) {\n isTurningOff = teleM.getValue();\n ui.updateArea(teleM.getMessage());\n }\n }", "private void processCallStateOffhook () {\n\t\t\n\t\ttry {\n\t\t\tif (QSLog.DEBUG_D)QSLog.d(CLASS_NAME, \"OFFHOOK\");\t\n\t\t\t\n\t\t\tConfigAppValues.processRingCall = false;\n\t\t\t\n\t\t\tif (QSToast.DEBUG) QSToast.d(\n \t\tConfigAppValues.getContext().getApplicationContext(),\n \t\t\"OFFHOOK!!!!!!!!\",\n \t\tToast.LENGTH_SHORT);\t\n\t\t\t\n\t\t}catch (Exception e) {\n\t\t\tif (QSLog.DEBUG_E)QSLog.e(CLASS_NAME, ExceptionUtils.exceptionTraceToString(\n\t\t\t\t\te.toString(), \n\t\t\t\t\te.getStackTrace()));\n\t\t}\n\t}", "public void run() {\n\t\t\t\tInetAddress bAddr = AndyNet.getBroadcastIP(activity);\n\t\t\t\tLog.i(TAG, \"Broadcast Address: \" + bAddr.getHostAddress());\n\t\t\t\tif (bAddr != null) {\n\t\t\t\t\tAndyNet.startBroadcast(AndyMaster.getName(), 0, bAddr);\n\t\t\t\t}\n\n\t\t\t}", "private void sendStatus() {\n\n // Only send status if we have UI bound to service\n if (isBound) {\n try {\n Message msg = Message.obtain(null, RadioPlayerFragment.UPDATE_STATUS);\n Bundle bundle = new Bundle();\n bundle.putString(RadioPlayerFragment.STATUS, mpState);\n msg.setData(bundle);\n fragmentMessenger.send(msg);\n } catch (RemoteException e) {\n Log.e(LOG_TAG, \"Cannot send status: \" + mpState);\n }\n }\n\n }", "public void onStatus(Status status) {\n \t\t\t\t_receivedStatus++;\n \t\t\t\tif(!_statusQueue.offer(status)){\n \t\t\t\t\t_lostStatus++; \n \t\t\t\t}\t\t\t\n \t\t\t}", "@Override\n\t\t\tpublic void run() {\n//\t\t\t\t\n//\t\t\t\tSystem.out.printf(\"Ausgangs-Puffer: \");\n//\t\t\t\tfor(int i=0; i<Message.length; i++)\tSystem.out.printf(\"0x%02X \", eeipClient.O_T_IOData[i]);\n//\t\t\t\tSystem.out.printf(\"\\n\\n\");\n\n\t\t\t\tStatus_Byte=eeipClient.T_O_IOData[0x7F];\n\t\t\t\tTO_Bit=(Status_Byte&(0x20))>>5;\n\t\t\t\tAA_Bit=(Status_Byte&(0x02))>>1;\n\t\t\n\t\t\t\tif((TO_Bit_old!=TO_Bit)&&(AA_Bit==1)) {\n\t\t\t\t\tTO_Bit_old=TO_Bit;\n\t\t\t\t\tstate=1;\n\t\t\t\t\ttimerflag2=false;\n\t\t\t\t\tthis.cancel();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}", "public void checkOffTask() {\n isDone = true;\n }", "protected void processSleepObject(VObject inObject) {\n\t\tboolean doXmppStatus = true;\n\t\tfinal boolean isXmppObject = inObject.isXMPP();\n\n\t\t//Special case for xmpp object, we will check the resources\n\t\tString theRessource = null;\n\t\tif (isXmppObject) {\n\t\t\tfinal List<String> resources = inObject.getResources(); //IQResourcesQuery.getClientResources(inObject.getXmppAddress());\n\t\t\tif (resources.isEmpty()) {\n\t\t\t\tinObject.setState(VObject.STATUS_VEILLE);\n\t\t\t} else if (resources.contains(\"asleep\")) {\n\t\t\t\ttheRessource = resources.get(0);\n\t\t\t\tdoXmppStatus = false;\n\t\t\t}\n\t\t}\n\n\t\tfinal int inState = inObject.getObject_state();\n\t\tCrawlerCheckStatus.LOGGER.info(\"Processing sleep for \" + inObject.getObject_serial() + \" / \" + inState + \" / \" + theRessource);\n\n\t\t//all STATUS_WILLBE_* are used only for xmpp objects\n\t\tswitch (inState) {\n\t\tcase VObject.STATUS_VEILLE: // special case because cache notification is slow/missing so i override this value in db.\n\t\t\tinObject.overrideState(VObject.STATUS_VEILLE);\n\t\t\tsendXmppStatus(inObject, Message.MODE_VEILLE, JabberMessageFactory.IQ_STATUS_IDLE_MODE);\n\t\t\tbreak;\n\t\tcase VObject.STATUS_ACTIF:\n\t\tcase VObject.STATUS_FORCE_VEILLE:\n\t\tcase VObject.STATUS_WILLBE_ACTIF:\n\t\tcase VObject.STATUS_WILLBE_VEILLE:\n\t\tcase VObject.STATUS_WILLBE_FORCE_VEILLE:\n\t\t\tif (isXmppObject && doXmppStatus) {\n\t\t\t\tsendXmppStatus(inObject, Message.MODE_VEILLE, JabberMessageFactory.IQ_STATUS_IDLE_MODE);\n\t\t\t} else {\n\t\t\t\tinObject.setState(VObject.STATUS_VEILLE);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase VObject.STATUS_WILLBE_FORCE_ACTIF: //normally, object ping do not enter in this condition\n\t\t\tif (isXmppObject && !doXmppStatus) {\n\t\t\t\tsendXmppStatus(inObject, Message.MODE_FORCE_ACTIF, JabberMessageFactory.IQ_STATUS_ASLEEP_MODE);\n\t\t\t} else {\n\t\t\t\tinObject.setState(VObject.STATUS_FORCE_ACTIF);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}", "@Override\n public void run() {\n try {\n Thread.sleep(1500);\n } catch (InterruptedException e2) {\n // TODO Auto-generated catch block\n e2.printStackTrace();\n }\n if(isTmp!=-1 && MainActivity2.linkLose==-1){\n Message message=new Message();\n message.what=15;\n MainActivity.hReceiver.sendMessage(message);\n\n }\n }", "public void stopRinging();", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep((long) time);\r\n\t\t\t\t\tleftOff();\r\n\t\t\t\t\tif(unhook)\r\n\t\t\t\t\t\tunhookLEDs();\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t}\r\n\t\t\t}", "static void sendServerStatusBcast(Context context, String status) {\n //Send broadcast to update the UI if the app is active\n Intent localIntent = new Intent(BroadcastType.BCAST_TYPE_SERVER_STATUS.toString());\n localIntent.putExtra(BroadcastType.BCAST_EXTRA_SERVER_RESPONSE.toString(), status);\n LocalBroadcastManager.getInstance(context).sendBroadcast(localIntent);\n }", "private void onLost() {\n // TODO: broadcast\n }", "protected void ap() {\n Object object = this.li;\n synchronized (object) {\n if (this.lz != null) {\n return;\n }\n IntentFilter intentFilter = new IntentFilter();\n intentFilter.addAction(\"android.intent.action.SCREEN_ON\");\n intentFilter.addAction(\"android.intent.action.SCREEN_OFF\");\n this.lz = new BroadcastReceiver(){\n\n public void onReceive(Context context, Intent intent) {\n ab.this.d(false);\n }\n };\n this.lp.registerReceiver(this.lz, intentFilter);\n return;\n }\n }", "@Override\r\n\tpublic void onReceive(Context context, Intent intent) {\r\n\t\tLog.i(TAG, \"onReceive - \"+ intent.getAction());\r\n\t\tString action = intent.getAction();\r\n\t\t//PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);\r\n\t\t//wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);\r\n\t\t//wakeLock.setReferenceCounted(false);\r\n\t\t\r\n\t\t//Log.i(TAG, \"isHeld = \"+ wakeLock.isHeld());\r\n\t\t\r\n\t\tif (action.equals(ACTION_BLUETOOTHSCAN)){\r\n\t\t\tcontext.startService(new Intent(context, BluetoothService.class));\r\n\t\t\tif(BluetoothService.wakeLock == null){\r\n\t\t\t\tPowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);\r\n\t\t\t\tBluetoothService.wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, BluetoothService.TAG);\r\n\t\t\t}\r\n\t\t\tif(!BluetoothService.wakeLock.isHeld()) BluetoothService.wakeLock.acquire(12000);\r\n\t\t} else if (action.equals(Intent.ACTION_BOOT_COMPLETED)){\r\n\t\t\tif (Settings.getBackgroundRun(context)){\r\n\t\t\t\tSettings.startBluetoothScanAlarmManager(context);\r\n\t\t\t\tSettings.startServerUploadAlarmManager(context);\r\n\t\t\t}\r\n\t\t} else if (action.equals(ACTION_SERVERUPLOAD)) {\r\n\t\t\tcontext.startService(new Intent(context, ServerService.class));\r\n\t\t\tif(ServerService.wakeLock == null){\r\n\t\t\t\tPowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);\r\n\t\t\t\tServerService.wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, ServerService.TAG);\r\n\t\t\t}\r\n\t\t\tif(!ServerService.wakeLock.isHeld()) ServerService.wakeLock.acquire(20000);\r\n\t\t} else {\r\n\t\t\tLog.e(TAG, \"Unkown action: \"+ action);\r\n\t\t}\t\t\r\n\t}", "private void goAway() {\n CollaborationConnection connection = CollaborationConnection\n .getConnection();\n Presence presence = connection.getPresence();\n if (presence.getMode().equals(Mode.available)) {\n previousPresence = presence;\n Presence newPresence = new Presence(presence.getType(),\n presence.getStatus(), presence.getPriority(), Mode.away);\n Tools.copyProperties(presence, newPresence);\n timerSetAway = sendPresence(connection, newPresence);\n }\n }", "private void waitOnReceive() throws IOException {\n while (inStream.available() == 0) {\n try {\n Thread.sleep(1);\n } catch (InterruptedException _) {\n }\n }\n }", "@Override\r\n\tpublic void onReceive(Context context, Intent intent) {\n\t\tString action = intent.getAction();\r\n\t\tif (action.equals(\"IOException\")) {\r\n\t\t\tIntent it = new Intent();\r\n\t\t\tit.setClass(activity, SocketService.class);\r\n\t\t\tactivity.stopService(it);\r\n\t\t\tToast.makeText(activity, \"请确认网络是否开启,操作失败,请重新登录\", Toast.LENGTH_LONG)\r\n\t\t\t\t\t.show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tshort msgId = Short.parseShort(action.split(\"_\")[0]);\r\n\t\tbyte msgOper = Byte.parseByte(action.split(\"_\")[1]);\r\n\t\tbyte[] body = intent.getExtras().getByteArray(\"data\");\r\n\t\tCmdListActivity cmdListActivity = null;\r\n\t\tEnterDeviceListActivity enterDeviceListActivity;\r\n\t\tif (msgId == MsgId_E.MSGID_CTRL.getVal()\r\n\t\t\t\t&& msgOper == MsgOper_E.MSGOPER_QRY.getVal()) {\r\n\t\t\tMsgQryAck_S msgQryAck_S = new MsgQryAck_S();\r\n\t\t\tmsgQryAck_S.setMsgQryAck_S(body);\r\n\t\t\tcmdListActivity = (CmdListActivity) activity;\r\n\t\t\tif (msgQryAck_S.getUsError() == 0) {\r\n\t\t\t\tif (msgQryAck_S.getUsCnt() > 0) {\r\n\t\t\t\t\tfor (int i = 0; i < msgQryAck_S.getUsCnt(); i++) {\r\n\t\t\t\t\t\tbyte[] ctrl_S_Byte = Arrays.copyOfRange(\r\n\t\t\t\t\t\t\t\tmsgQryAck_S.getPucData(), i * Ctrl_S.getSize(),\r\n\t\t\t\t\t\t\t\t(i + 1) * Ctrl_S.getSize());\r\n\t\t\t\t\t\tCtrl_S ctrl_S = new Ctrl_S();\r\n\t\t\t\t\t\tctrl_S.setCtrl_S(ctrl_S_Byte);\r\n\t\t\t\t\t\tcmdListActivity.ctrlMap.put(ctrl_S.getUsIdx(), ctrl_S);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// addSenseActivity.areaListAdapter.notifyDataSetChanged();\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tErrCode_E.showError(context, msgQryAck_S.getUsError());\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (msgId == MsgId_E.MSGID_RGN.getVal()\r\n\t\t\t\t&& msgOper == MsgOper_E.MSGOPER_QRY.getVal()) {\r\n\t\t\tMsgQryAck_S msgQryAck_S = new MsgQryAck_S();\r\n\t\t\tmsgQryAck_S.setMsgQryAck_S(body);\r\n\t\t\tenterDeviceListActivity = (EnterDeviceListActivity) activity;\r\n\t\t\tif (msgQryAck_S.getUsError() == 0) {\r\n\t\t\t\tif (msgQryAck_S.getUsCnt() > 0) {\r\n\t\t\t\t\tfor (int i = 0; i < msgQryAck_S.getUsCnt(); i++) {\r\n\t\t\t\t\t\tbyte[] rgn_S_Byte = Arrays.copyOfRange(\r\n\t\t\t\t\t\t\t\tmsgQryAck_S.getPucData(), i * Rgn_S.getSize(),\r\n\t\t\t\t\t\t\t\t(i + 1) * Rgn_S.getSize());\r\n\t\t\t\t\t\tRgn_S rgn_S = new Rgn_S();\r\n\t\t\t\t\t\trgn_S.setRgn_S(rgn_S_Byte);\r\n\t\t\t\t\t\tenterDeviceListActivity.areaMap.put(rgn_S.getUsIdx(),\r\n\t\t\t\t\t\t\t\trgn_S);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// enterDeviceListActivity.deviceListAdapter.notifyDataSetChanged();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (msgId == MsgId_E.MSGID_APPL.getVal()\r\n\t\t\t\t&& msgOper == MsgOper_E.MSGOPER_QRY.getVal()) {\r\n\t\t\tMsgQryAck_S msgQryAck_S = new MsgQryAck_S();\r\n\t\t\tmsgQryAck_S.setMsgQryAck_S(body);\r\n\t\t\tenterDeviceListActivity = (EnterDeviceListActivity) activity;\r\n\t\t\tif (msgQryAck_S.getUsError() == 0) {\r\n\t\t\t\tif (msgQryAck_S.getUsCnt() > 0) {\r\n\t\t\t\t\tfor (int i = 0; i < msgQryAck_S.getUsCnt(); i++) {\r\n\t\t\t\t\t\tbyte[] appl_S_Byte = Arrays.copyOfRange(\r\n\t\t\t\t\t\t\t\tmsgQryAck_S.getPucData(), i * Appl_S.getSize(),\r\n\t\t\t\t\t\t\t\t(i + 1) * Appl_S.getSize());\r\n\t\t\t\t\t\tAppl_S appl_S = new Appl_S();\r\n\t\t\t\t\t\tappl_S.setAppl_S(appl_S_Byte);\r\n\t\t\t\t\t\tenterDeviceListActivity.deviceList.add(appl_S);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tenterDeviceListActivity.deviceListAdapter\r\n\t\t\t\t\t\t\t.notifyDataSetChanged();\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tErrCode_E.showError(context, msgQryAck_S.getUsError());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (msgId == MsgId_E.MSGID_APPL.getVal()\r\n\t\t\t\t&& msgOper == MsgOper_E.MSGOPER_DEL.getVal()) {\r\n\r\n\t\t\tMsgDelAck_S msgDelAck_S = new MsgDelAck_S();\r\n\t\t\tmsgDelAck_S.setMsgDelAck_S(body);\r\n\t\t\tenterDeviceListActivity = (EnterDeviceListActivity) activity;\r\n\t\t\tif (msgDelAck_S.getUsError() == 0) {\r\n\t\t\t\tfor (int i = 0; i < enterDeviceListActivity.deviceList.size(); i++) {\r\n\t\t\t\t\tAppl_S appl_S = enterDeviceListActivity.deviceList.get(i);\r\n\t\t\t\t\tif (appl_S.getUsIdx() == msgDelAck_S.getUsIdx()) {\r\n\t\t\t\t\t\tenterDeviceListActivity.deviceList.remove(i);\r\n\t\t\t\t\t\tenterDeviceListActivity.deviceListAdapter\r\n\t\t\t\t\t\t\t\t.notifyDataSetChanged();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tToast.makeText(activity, \"删除成功\", Toast.LENGTH_LONG).show();\r\n\t\t\t} else {\r\n\t\t\t\tErrCode_E.showError(context, msgDelAck_S.getUsError());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (msgId == MsgId_E.MSGID_APPL.getVal()\r\n\t\t\t\t&& msgOper == MsgOperCmd_E.MSGOPER_CMD_QRY_BYDEV.getVal()) {\r\n\t\t\tMsgQryAck_S msgQryAck_S = new MsgQryAck_S();\r\n\t\t\tmsgQryAck_S.setMsgQryAck_S(body);\r\n\t\t\tenterDeviceListActivity = (EnterDeviceListActivity) activity;\r\n\t\t\tif (msgQryAck_S.getUsError() == 0) {\r\n\t\t\t\tif (msgQryAck_S.getUsCnt() > 0) {\r\n\t\t\t\t\tfor (int i = 0; i < msgQryAck_S.getUsCnt(); i++) {\r\n\t\t\t\t\t\tbyte[] appl_S_Byte = Arrays.copyOfRange(\r\n\t\t\t\t\t\t\t\tmsgQryAck_S.getPucData(), i * Appl_S.getSize(),\r\n\t\t\t\t\t\t\t\t(i + 1) * Appl_S.getSize());\r\n\t\t\t\t\t\tAppl_S appl_S = new Appl_S();\r\n\t\t\t\t\t\tappl_S.setAppl_S(appl_S_Byte);\r\n\t\t\t\t\t\tenterDeviceListActivity.deviceList.add(appl_S);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tenterDeviceListActivity.deviceListAdapter\r\n\t\t\t\t\t\t\t.notifyDataSetChanged();\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tErrCode_E.showError(context, msgQryAck_S.getUsError());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (msgId == MsgId_E.MSGID_CMD.getVal()\r\n\t\t\t\t&& msgOper == MsgOper_E.MSGOPER_DEL.getVal()) {\r\n\t\t\tMsgDelAck_S msgDelAck_S = new MsgDelAck_S();\r\n\t\t\tmsgDelAck_S.setMsgDelAck_S(body);\r\n\t\t\tcmdListActivity = (CmdListActivity) activity;\r\n\t\t\tif (msgDelAck_S.getUsError() == 0) {\r\n\t\t\t\tcmdListActivity.cmdList.clear();\r\n\t\t\t\tfor (int i = 0; i < cmdListActivity.cmdList.size(); i++) {\r\n\t\t\t\t\tCmd_S cmd_S = cmdListActivity.cmdList.get(i);\r\n\t\t\t\t\tif (cmd_S.getUsIdx() == msgDelAck_S.getUsIdx()) {\r\n\t\t\t\t\t\tcmdListActivity.cmdList.remove(i);\r\n\t\t\t\t\t\tcmdListActivity.cmdListAdapter.notifyDataSetChanged();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tToast.makeText(activity, \"删除成功\", Toast.LENGTH_LONG).show();\r\n\t\t\t} else {\r\n\t\t\t\tErrCode_E.showError(context, msgDelAck_S.getUsError());\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ((msgId == MsgId_E.MSGID_CMD.getVal() && msgOper == MsgOperCmd_E.MSGOPER_CMD_QRY_BYDEV\r\n\t\t\t\t.getVal())) {\r\n\t\t\tparseToList(body);\r\n\t\t}\r\n\r\n\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep((long) time);\r\n\t\t\t\t\tallOff();\r\n\t\t\t\t\tif(unhook)\r\n\t\t\t\t\t\tunhookLEDs();\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t}\r\n\t\t\t}", "@Override\n\t\tpublic void onReceive(Context arg0, Intent arg1) {\n\t\t\tString action = arg1.getAction();\n\t\t\tmContext = arg0;\n\t\t\t\n\t\t\tif(action.equals(\"com.example.timeshowactivity.OFF\")){\n\t\t\t mDelayFlag = 0;\n\t\t\t //WhetherSendIntent =false;\n\t\t\t setTimeShowState(false);\n\t\t\t Log.i(TAG,\"qiuyaobo onReceive com.example.timeshowactivity.OFF\");\n\t\t\t}else if(action.equals(\"com.example.timeshowactivity.ON\")){\n\t\t\t mDelayFlag = 1;\n\t\t\t\t//WhetherSendIntent =true;\n\t\t\t setTimeShowState(true);\n\t\t\t//Log.i(\"huangjun00\",\"TimeShowReceiver ***onReceive00com.example.timeshowactivity.ON***\");\n\t\t\t}else if(action.equals(\"android.intent.action.BOOT_COMPLETED\")){\n\t\t\t\tLog.d(\"ljz\", \"set hall\");\n\t\t\t\t//PowerManager pm = (PowerManager) arg0.getSystemService(Context.POWER_SERVICE);\n\t\t\t\t//pm.setHallSensor(true, 0);\n\t\t\t//Log.i(\"huangjun00\",\"TimeShowReceiver ***onReceive.....android.intent.action.BOOT_COMPLETED***\");\n\t\t\t\treturn;\n\t\t }else if (MTK_ACTION_UNREAD_CHANGED.equals(action)){\n\t\t\t //Log.i(\"huangjun00\",\"TimeShowReceiver ***onReceive.....MTK_ACTION_UNREAD_CHANGED***\");\n\t\t\t\t\t\t\tboolean lidOpen =SystemProperties.getBoolean(\"persist.sys.lidopen\",false);\n\t\t\t\t\t\t\tif(lidOpen){//hal is off ,at the same time a call is arriving,open the hal ,at hal Call interface,hang up the call ,we should display the TimeShow \n\t\t\t\t\t\t\t\t\tmDelayFlag = 1;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tmDelayFlag = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!isIdle()){\n\t\t\t\t\t\t\t\treturn;//when we opened call waiting function ,we hanged up one call ,the other call has been activitied,at this time we cannot update TimeShow actovity if the TimeShow actovity on Background process!\n\t\t\t\t\t\t\t}\n\t\t\t\t\t MainActivity m = MainActivity.getInstance();\n\t\t\t\t\t if(m != null){\n\t\t\t\t\t m.updatetInfo();\n\t }\n\t }\n\t\n\t\t if(!isIdle()){\n\t\t\t\t\t\tIntent updateIncallTouchUi = new Intent(\"UPDATE_INCALLSCREEN_TOUCHUI\");\n\t\t\t\t\t\tmContext.sendBroadcast(updateIncallTouchUi);\n\t\n\t }\n\t\t \n\t\t long milliseconds = SystemClock.elapsedRealtime();\n\t\t long timeSinceLastEvent = milliseconds - mLastReceiveEventTime;\n\t\t mLastReceiveEventTime = milliseconds;\n\t\t mHandler.removeCallbacks(mDelayTimeTask);\n\t\t\t\n\t\t //Log.i(\"huangjun00\",\"TimeShowReceiver ******** flag=\" +mDelayFlag + \" timeSinceLastEvent=\"+timeSinceLastEvent);\n\t\t if(timeSinceLastEvent < DELAY_TIME){\n\t\t\t\t\t\tlong i;\n\t\t\t\t\t\ti= DELAY_TIME - timeSinceLastEvent;\n\t\t //Log.i(\"huangjun00\",\"TimeShowReceiver ***timeSinceLastEvent < DELAY_TIME..timeSinceLastEvent=\" +timeSinceLastEvent + \"; DELAY_TIME=\"+DELAY_TIME+\";i=\"+i);\n\t\t mHandler.postDelayed(mDelayTimeTask, DELAY_TIME - timeSinceLastEvent);\n\t\t return;\n\t\t }\n\t\n\t\t\t\tif(mDelayFlag == 0){\n\t\t\t\t\t\tMainActivity m = MainActivity.getInstance();\n\t\t\t\t\t\tLog.i(TAG,\" qiuyaobo onReceive mDelayFlag == 0 m=\" +m);\n\t\t\t\n\t\t\t\t\t\tif(m != null){\n\t\t\t\t\t\t m.finish();\n\t\t\t\t\t\t\t//m.moveTaskToBack(false);\n\t\t\t // m.onBackPressed();\n\t\t\t\t\t\t\t//ActivityManager am = (ActivityManager)mContext.getSystemService(Context.ACTIVITY_SERVICE);\n\t\t\t\t\t\t//\tam.forceStopPackage(\"com.example.timeshowactivity\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t}else if(mDelayFlag == 1){\n\t\t\n\t\t /// mTelephonyManager = (TelephonyManager) (mContext.getSystemService(Context.TELEPHONY_SERVICE));//hj\n\t\t // mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_CALL_STATE); //hj\n\t\t\t\t\n\t\t\t\t\tComponentName cn = new ComponentName(\"com.example.timeshowactivity\",\"com.example.timeshowactivity.MainActivity\");\n\t\t\t\t\tIntent intent = new Intent();\n\t\t\t\t\tintent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\t\t\t\tintent.setComponent(cn);\n\t\t\t\t\tmContext.startActivity(intent);\n\t\t\t\t}\n\t\t\t\n\t\t}", "public void receiveMyBtStatus(String status) {\n \t\n \tfinal String s = status;\n \t\n \t\n// \tLog.d(\"handler\", \"receiveMyBtStatus\"); \t\n mHandler.post(new Runnable() {\n @Override\n public void run() {\n // This gets executed on the UI thread so it can safely modify Views\n \tBTstatusTextView.setText(s);\n \t\n \tif(s.equals(\"BT-Ready\") && !(poll.getVisibility() == View.VISIBLE)){\n \t\tLog.d(\"poll buttion\", \"setting visible\");\n \t//Ready to poll\n \t\tpoll.setVisibility(View.VISIBLE);\n \t\n }\n }\n });\n }", "static void sendControllerStatusBcast(Context context, String status) {\n //Send broadcast to update the UI if the app is active\n Intent localIntent = new Intent(BroadcastType.BCAST_TYPE_CONTROLLER_STATUS.toString());\n localIntent.putExtra(BroadcastType.BCAST_EXTRA_SERVER_RESPONSE.toString(), status);\n LocalBroadcastManager.getInstance(context).sendBroadcast(localIntent);\n }", "public abstract void onWait();", "public void run(){\n long startTime = System.nanoTime();\n long elapsedTime = System.nanoTime() - startTime;\n while(elapsedTime<500000000 && p.acknowledged == false){\n //echo(\"Waiting\");\n elapsedTime = System.nanoTime() - startTime;\n if(p.acknowledged == true){\n return;\n }\n }\n if(elapsedTime>= 500000000)\n {\n p.timed = true;\n //System.out.println(\"thread timed out at packet \"+ p.getSeq());\n for(int i=p.getSeq(); i<p.getSeq()+window; i++){\n if(i<packets.size()){\n packets.get(i).sent = false;\n }\n }\n //p.sent = false;\n }\n\n\n }", "private void UDPBroadcastTest() {\n\t\tWifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);\n\n\t\tif (wifi != null) {\n\t\t\tWifiManager.MulticastLock lock = wifi\n\t\t\t\t\t.createMulticastLock(\"Log_Tag\");\n\t\t\tlock.acquire();\n\n\t\t}\n\t\tint DISCOVERY_PORT = 1989;\n\t\tint TIMEOUT_MS = 5000;\n\n\t\ttry {\n\n\t\t\tDatagramSocket socket = new DatagramSocket(DISCOVERY_PORT);\n\t\t\tsocket.setBroadcast(true);\n\t\t\tsocket.setSoTimeout(TIMEOUT_MS);\n\t\t\tbyte[] buf = new byte[1024];\n\t\t\twhile (true) {\n\t\t\t\tDatagramPacket packet = new DatagramPacket(buf, buf.length,\n\t\t\t\t\t\tInetAddress.getByName(\"192.168.1.255\"), DISCOVERY_PORT);\n\t\t\t\tsocket.receive(packet);\n\t\t\t\tLog.e(\"nbc\", packet.getAddress().getHostAddress());\n\t\t\t\tString s = new String(packet.getData(), 0, packet.getLength());\n\t\t\t\tLog.e(\"nbc\", \"Received response \" + s);\n\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\tLog.e(\"nbc\", \"Could not send discovery request\", e);\n\t\t}\n\n\t}", "public void sleepCheck() {\n if (area() == null)\n stopActing();\n if (area().closed || area().closeRequested)\n stopActing();\n if (commander.player() == null || commander.player().area() != area()) {\n if (!area().getLabel().equals(\"TITLE\"))\n stopActing();\n } else {\n wakeCheck(commander.player().areaX(), commander.player().areaY());\n }\n }", "public void landFromLatch() {\n }", "@Override\n\t\tpublic void loop() throws ConnectionLostException, InterruptedException {\n\t\t\ttry {\n\t\t\t\tif (ExitApp == true) {\n\t\t\t\t\tPStatus.write(false);\n\t\t\t\t\tEN_LE.write(false);\n\t\t\t\t\tExitApp = false;\n\t\t\t\t\tDisplayLabel(\"LATCH ON\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tPStatus.write(true);\n\n\t\t\t\t// Set device enable\n\t\t\t\tEN_Device1.write(cmdDevice1.isChecked());\n\t\t\t\tEN_Device2.write(cmdDevice2.isChecked());\n\t\t\t\tEN_Device3.write(cmdDevice3.isChecked());\n\t\t\t\tEN_Device4.write(cmdDevice4.isChecked());\n\t\t\t\tEN_Device5.write(cmdDevice5.isChecked());\n\n\t\t\t\tif (cmdDevice1.isChecked())\n\t\t\t\t\tDisplayLabel(\"Btn1_Click\");\n\t\t\t\t// Get Amp\n\n\t\t\t\t// Get Watt\n\n\t\t\t\tThread.sleep(10);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// PStatus.write(false);\n\t\t\t\t// EN_LE.write(false);\n\t\t\t\tioio_.disconnect();\n\t\t\t} catch (ConnectionLostException ex) {\n\t\t\t\t// PStatus.write(false);\n\t\t\t\t// EN_LE.write(false);\n\t\t\t\tioio_.disconnect();\n\t\t\t}\n\t\t}", "synchronized void endCriticalUse(){\nSC = false;\nJeton=false;\n\nif (procId==0){\n\tSyncMessage sm = new SyncMessage(MsgType.JETON, 0, procId);\n\tsendTo(0, sm);\n}else{\n\tSyncMessage sm = new SyncMessage(MsgType.JETON, 1, procId);\n\tsendTo(1, sm);\n}\n\n}", "public synchronized void m29984l() {\n if (XGPushConfig.enableDebug) {\n C6864a.m29298c(\"TpnsChannel\", \"Action -> send heartbeatSlave \");\n }\n f23274i++;\n mo33398h();\n if (C6973b.m29763a().mo33291f(C6973b.m29776f())) {\n if (!C7048a.m30142d(C6973b.m29776f())) {\n C6864a.m29308i(Constants.ServiceLogTag, \"network is unreachable ,give up and go on slave service\");\n } else if (C6973b.m29776f() != null) {\n C6901c.m29459a().mo33104a((Runnable) new Runnable() {\n public void run() {\n boolean isForeiginPush = XGPushConfig.isForeiginPush(C6973b.m29776f());\n String str = Constants.ACTION_SLVAE_2_MAIN;\n String str2 = Constants.ServiceLogTag;\n if (isForeiginPush) {\n C6864a.m29308i(str2, \"isForeiginPush network is ok , switch to main service\");\n C6973b.m29767a(C6973b.m29776f(), str, 0);\n } else if (C6979b.m29795a(C6973b.m29776f()).mo33300b()) {\n C6864a.m29308i(str2, \"network is ok , switch to main service\");\n C6973b.m29767a(C6973b.m29776f(), str, 0);\n } else {\n C6864a.m29308i(str2, \"network is error , go on slave service\");\n }\n }\n });\n } else {\n C6864a.m29308i(Constants.ServiceLogTag, \"PushServiceManager.getInstance().getContext() is null\");\n }\n }\n }", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep((long) time);\r\n\t\t\t\t\trightOff();\r\n\t\t\t\t\tif(unhook)\r\n\t\t\t\t\t\tunhookLEDs();\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t}\r\n\t\t\t}", "@Override\n\t\t\t\tpublic void run() {\n//\t\t\t\t\t\n//\t\t\t\t\tSystem.out.printf(\"Ausgangs-Puffer: \");\n//\t\t\t\t\tfor(int i=0; i<Message.length; i++)\tSystem.out.printf(\"0x%02X \", eeipClient.O_T_IOData[i]);\n//\t\t\t\t\tSystem.out.printf(\"\\n\\n\");\n\t\t\t\t\t\n\t\t\t\t\tStatus_Byte=eeipClient.T_O_IOData[0x7F];\n\t\t\t\t\tTO_Bit=(Status_Byte&(0x20))>>5;\n\t\t\t\t\tAE_Bit=(Status_Byte&(0x04))>>2;\n\t\t\t\t\tAA_Bit=(Status_Byte&(0x02))>>1;\n\t\t\t\t\t\n\t\t\t\t\tif(AE_Bit==1) {\n\t\t\t\t\t\tstate=2;\n\t\t\t\t\t\ttimerflag3=false;\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.cancel();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void onReceive(Context context, Intent intent) {\n Log.d(TAG,\"receiverMsg...onReceive\");\n if(!mDoScreenOff){\n mDoScreenOff = false;\n handler.removeMessages(1); //remove timer\n beforeIsLock = false;\n flags = false;\n Log.d(TAG,\"set the flag as false when screen off\");\n }\n // prize add if-judgement by zhaojian 20171102 end\n }", "public void stopBroadcast(){\r\n\t\tthePres.stopBroadcast();\r\n\t\tstartBtn.setLabel(\"Start Broadcast\");\r\n\t\tdrawer.stopTasking();\r\n\t\tisPlaying = false;\r\n\t\tcurrRateLabel.setText(\"0 \");\r\n\t}", "private void executePendingBroadcasts() {\n /*\n r9 = this;\n L_0x0000:\n r0 = r9.mReceivers;\n monitor-enter(r0);\n r1 = r9.mPendingBroadcasts;\t Catch:{ all -> 0x0045 }\n r1 = r1.size();\t Catch:{ all -> 0x0045 }\n if (r1 > 0) goto L_0x000d;\n L_0x000b:\n monitor-exit(r0);\t Catch:{ all -> 0x0045 }\n return;\n L_0x000d:\n r1 = new android.support.v4.content.LocalBroadcastManager.BroadcastRecord[r1];\t Catch:{ all -> 0x0045 }\n r2 = r9.mPendingBroadcasts;\t Catch:{ all -> 0x0045 }\n r2.toArray(r1);\t Catch:{ all -> 0x0045 }\n r2 = r9.mPendingBroadcasts;\t Catch:{ all -> 0x0045 }\n r2.clear();\t Catch:{ all -> 0x0045 }\n monitor-exit(r0);\t Catch:{ all -> 0x0045 }\n r0 = 0;\n r2 = r0;\n L_0x001c:\n r3 = r1.length;\n if (r2 >= r3) goto L_0x0000;\n L_0x001f:\n r3 = r1[r2];\n r4 = r3.receivers;\n r4 = r4.size();\n r5 = r0;\n L_0x0028:\n if (r5 >= r4) goto L_0x0042;\n L_0x002a:\n r6 = r3.receivers;\n r6 = r6.get(r5);\n r6 = (android.support.v4.content.LocalBroadcastManager.ReceiverRecord) r6;\n r7 = r6.dead;\n if (r7 != 0) goto L_0x003f;\n L_0x0036:\n r6 = r6.receiver;\n r7 = r9.mAppContext;\n r8 = r3.intent;\n r6.onReceive(r7, r8);\n L_0x003f:\n r5 = r5 + 1;\n goto L_0x0028;\n L_0x0042:\n r2 = r2 + 1;\n goto L_0x001c;\n L_0x0045:\n r1 = move-exception;\n monitor-exit(r0);\t Catch:{ all -> 0x0045 }\n throw r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.support.v4.content.LocalBroadcastManager.executePendingBroadcasts():void\");\n }", "@Override\n\t\t\t\tpublic void run() {\n//\t\t\t\t\t\n//\t\t\t\t\tSystem.out.printf(\"Ausgangs-Puffer: \");\n//\t\t\t\t\tfor(int i=0; i<Message.length; i++)\tSystem.out.printf(\"0x%02X \", eeipClient.O_T_IOData[i]);\n//\t\t\t\t\tSystem.out.printf(\"\\n\\n\");\n//\t\t\t\t\tSystem.out.println(TO_Bit_old);\n//\t\t\t\t\tSystem.out.printf(\"\\n\\n\");\n\t\t\t\t\tStatus_Byte=eeipClient.T_O_IOData[0x7F];\n\t\t\t\t\tTO_Bit=(Status_Byte&(0x20))>>5;\n\t\t\t\t\tAA_Bit=(Status_Byte&(0x02))>>1;\n\t\t\t\t\tAE_Bit=(Status_Byte&(0x04))>>2;\n\t\t\t\n\t\t\t\t\tif((TO_Bit_old!=TO_Bit)&&(AA_Bit==1)&&(AE_Bit==1)) {\t\t\t\n\t\t\t\t\t\tstate2=1;\n\t\t\t\t\t\ttimerflag2=false;\n\t\t\t\t\t\tthis.cancel();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}", "@Override\r\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\twait_time = 0;\r\n\t\t\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\t\t\tif (HomeView.ble_status == 0\r\n\t\t\t\t\t\t\t\t\t\t|| HomeView.ble_status == 1\r\n\t\t\t\t\t\t\t\t\t\t|| HomeView.ble_status == 2) {\r\n\r\n\t\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\t\tscanLeDevice(true);\r\n\t\t\t\t\t\t\t\t\t\tbluetoothSwitch = true;\r\n\t\t\t\t\t\t\t\t\t\tsetUI();\r\n\t\t\t\t\t\t\t\t\t\trunOnUiThread(new Runnable() {\r\n\t\t\t\t\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\t\t\t\tprogress.dismiss();\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} catch (IllegalArgumentException e) {\r\n\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\twait_time++;\r\n\t\t\t\t\t\t\t\tif (wait_time > 5) {\r\n\t\t\t\t\t\t\t\t\trunOnUiThread(new Runnable() {\r\n\t\t\t\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\t\t\tprogress.dismiss();\r\n\t\t\t\t\t\t\t\t\t\t\twait_time = 0;\r\n\t\t\t\t\t\t\t\t\t\t\tbluetoothSwitch = false;\r\n\t\t\t\t\t\t\t\t\t\t\tsetUI();\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\treturn;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\t\tThread.sleep(1000);\r\n\t\t\t\t\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}", "public void goSendOrderButton(View view) { //is called by onClick function of Button in activity_main.xml\n if(WifiAvaible()) {\n try {\n fab.getProtocol().sendOrder(surface.getSeedbox().toString());\n OrderStatus.setText(\"Waiting for \\n\"+\"confirmation.\");\n } catch (Exception e) {\n //ErrorWindow\n }\n\n SendButton.setEnabled(false);\n }\n\n\n/*\n if(ClickCnt == 0) {\n mp.start();\n ClickCnt = 1;\n } else {\n ClickCnt = 0;\n mp.stop();\n try {\n mp.prepare();\n }\n catch (java.lang.Exception e)\n {\n // Do nothing\n }\n\n mp.seekTo(0);\n }*/\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {\n// Log.v(\"shake mediator screen off\",\"trying re-registration\");\n // Unregisters the listener and registers it again.\n Log.i(TAG, \"detect the SCREEN_OFF------>\");\n\n// mWakeLock.acquire();// 屏幕熄后,CPU继续运行\n\n// sm.unregisterListener(PedometerService.this);\n//// sm.registerListener(PedometerService.this, sensor,\n//// SensorManager.SENSOR_DELAY_UI);\n// sm.registerListener(PedometerService.this, sensor,\n// SensorManager.SENSOR_DELAY_GAME);\n\n } else if (intent.getAction().equals(stringControl)) {\n\n\n if (isRunning) {\n\n // now is running\n\n boolean getisRunning = intent.getBooleanExtra(stringExtraControl, false);\n\n// change to stop\n\n if (!getisRunning) {\n\n isRunning = false;\n\n cleanData();\n saveDataToDB();\n cleanTotalStep();\n cleanState();\n\n\n }\n\n\n } else {\n\n// not running\n\n boolean getisRunning = intent.getBooleanExtra(stringExtraControl, false);\n\n// change to running\n\n if (getisRunning) {\n\n\n isRunning = true;\n\n cleanTotalStep();\n cleanState();\n\n cleanData();\n\n Calendar calendarNow = TimeUtil.getNowCalendar();\n state.state = calendarNow;\n state.step.setDate(TimeUtil.formatCalendar(calendarNow));\n\n }\n\n\n }\n\n\n Log.i(\"onReceive---->\", \"get button action\" + isRunning + \"\");\n\n }\n }", "@Override\n\tpublic void onReceive(Context ctx, Intent intnt) {\n\t\t\n\t\tif(!isInitialStickyBroadcast()) {\t\n\t\t\tinohoConnectionInfo currentInfo = getCurrentConnectionInfo();\n\t\t\t\n\t\t\tString conectionType = currentInfo.m_connectionType;\n\t\t\tString networkId = currentInfo.m_wifiNetworkID;\n\t\t\t\n\t\t\tboolean hasConnectionStateChanged = false;\n\t\t\tif(conectionType.isEmpty() || conectionType.equalsIgnoreCase(\"NONE\")) {\n\t\t\t\thasConnectionStateChanged = false;\n\t\t\t} else if(!conectionType.equals(m_prevConInfo.m_connectionType)) {\n\t\t\t\thasConnectionStateChanged = true;\n\t\t\t} else if(conectionType == \"WIFI\" && m_prevConInfo.m_connectionType == \"WIFI\") {\n\t\t\t\tif(!networkId.equals(\"<unknown ssid>\") && !networkId.equals(m_prevConInfo.m_wifiNetworkID)){\n\t\t\t\t\t//wifi network changed\n\t\t\t\t\thasConnectionStateChanged = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tm_prevConInfo.m_connectionType = currentInfo.m_connectionType;\n\t\t\tm_prevConInfo.m_wifiNetworkID = currentInfo.m_wifiNetworkID;\n\t\t\t\n\t\t\tif(hasConnectionStateChanged) {\n\t\t\t\tif(InohoApplication.isActivityVisible()){\n\t\t\t\t\tlaunchActivity();\n\t\t\t\t} else {//activity in background mark state to be refreshed on launch \n\t\t\t\t\tInohoApplication.setUINeedsRefresh(true);\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public void testBackgroundCheckBroadcastService() throws Exception {\n final Intent broadcastIntent = new Intent();\n broadcastIntent.setFlags(Intent.FLAG_RECEIVER_FOREGROUND);\n broadcastIntent.setClassName(SIMPLE_PACKAGE_NAME,\n SIMPLE_PACKAGE_NAME + SIMPLE_RECEIVER_START_SERVICE);\n\n final ServiceProcessController controller = new ServiceProcessController(mContext,\n getInstrumentation(), STUB_PACKAGE_NAME, mAllProcesses, WAIT_TIME);\n final ServiceConnectionHandler conn = new ServiceConnectionHandler(mContext,\n mServiceIntent, WAIT_TIME);\n final WatchUidRunner uidWatcher = controller.getUidWatcher();\n\n try {\n // First kill the process to start out in a stable state.\n controller.ensureProcessGone();\n\n // Do initial setup.\n controller.denyBackgroundOp();\n controller.makeUidIdle();\n controller.removeFromWhitelist();\n\n // We will use this to monitor when the service is running.\n conn.startMonitoring();\n\n // Try sending broadcast to start the service. Should fail!\n SyncOrderedBroadcast br = new SyncOrderedBroadcast();\n broadcastIntent.putExtra(\"service\", mServiceIntent);\n br.sendAndWait(mContext, broadcastIntent, Activity.RESULT_OK, null, null, WAIT_TIME);\n int brCode = br.getReceivedCode();\n if (brCode != Activity.RESULT_CANCELED) {\n fail(\"Didn't fail starting service, result=\" + brCode);\n }\n\n // Track the uid proc state changes from the broadcast (but not service execution)\n uidWatcher.waitFor(WatchUidRunner.CMD_IDLE, null, WAIT_TIME);\n uidWatcher.waitFor(WatchUidRunner.CMD_UNCACHED, null, WAIT_TIME);\n uidWatcher.expect(WatchUidRunner.CMD_PROCSTATE, WatchUidRunner.STATE_RECEIVER, WAIT_TIME);\n uidWatcher.expect(WatchUidRunner.CMD_CACHED, null, WAIT_TIME);\n uidWatcher.expect(WatchUidRunner.CMD_PROCSTATE, WatchUidRunner.STATE_CACHED_EMPTY, WAIT_TIME);\n\n // Put app on temporary whitelist to see if this allows the service start.\n controller.tempWhitelist(TEMP_WHITELIST_DURATION_MS);\n\n // Being on the whitelist means the uid is now active.\n uidWatcher.expect(WatchUidRunner.CMD_ACTIVE, null, WAIT_TIME);\n uidWatcher.expect(WatchUidRunner.CMD_PROCSTATE, WatchUidRunner.STATE_CACHED_EMPTY, WAIT_TIME);\n\n // Try starting the service now that the app is whitelisted... should work!\n br.sendAndWait(mContext, broadcastIntent, Activity.RESULT_OK, null, null, WAIT_TIME);\n brCode = br.getReceivedCode();\n if (brCode != Activity.RESULT_FIRST_USER) {\n fail(\"Failed starting service, result=\" + brCode);\n }\n conn.waitForConnect();\n\n // Also make sure the uid state reports are as expected.\n uidWatcher.waitFor(WatchUidRunner.CMD_UNCACHED, null);\n // We are going to wait until 'SVC', because we may see an intermediate 'RCVR'\n // proc state depending on timing.\n uidWatcher.waitFor(WatchUidRunner.CMD_PROCSTATE, WatchUidRunner.STATE_SERVICE);\n\n // Good, now stop the service and give enough time to get off the temp whitelist.\n mContext.stopService(mServiceIntent);\n conn.waitForDisconnect();\n\n uidWatcher.expect(WatchUidRunner.CMD_CACHED, null);\n uidWatcher.expect(WatchUidRunner.CMD_PROCSTATE, WatchUidRunner.STATE_CACHED_EMPTY);\n\n controller.removeFromTempWhitelist();\n\n // Going off the temp whitelist causes a spurious proc state report... that's\n // not ideal, but okay.\n uidWatcher.expect(WatchUidRunner.CMD_PROCSTATE, WatchUidRunner.STATE_CACHED_EMPTY);\n\n // We don't want to wait for the uid to actually go idle, we can force it now.\n controller.makeUidIdle();\n\n uidWatcher.expect(WatchUidRunner.CMD_IDLE, null);\n\n // Make sure the process is gone so we start over fresh.\n controller.ensureProcessGone();\n\n // Now that we should be off the temp whitelist, make sure we again can't start.\n br.sendAndWait(mContext, broadcastIntent, Activity.RESULT_OK, null, null, WAIT_TIME);\n brCode = br.getReceivedCode();\n if (brCode != Activity.RESULT_CANCELED) {\n fail(\"Didn't fail starting service, result=\" + brCode);\n }\n\n // Track the uid proc state changes from the broadcast (but not service execution)\n uidWatcher.waitFor(WatchUidRunner.CMD_IDLE, null);\n // There could be a transient 'cached' state here before 'uncached' if uid state\n // changes are dispatched before receiver is started.\n uidWatcher.waitFor(WatchUidRunner.CMD_UNCACHED, null);\n uidWatcher.expect(WatchUidRunner.CMD_PROCSTATE, WatchUidRunner.STATE_RECEIVER);\n uidWatcher.expect(WatchUidRunner.CMD_CACHED, null);\n uidWatcher.expect(WatchUidRunner.CMD_PROCSTATE, WatchUidRunner.STATE_CACHED_EMPTY);\n\n // Now put app on whitelist, should allow service to run.\n controller.addToWhitelist();\n\n // Try starting the service now that the app is whitelisted... should work!\n br.sendAndWait(mContext, broadcastIntent, Activity.RESULT_OK, null, null, WAIT_TIME);\n brCode = br.getReceivedCode();\n if (brCode != Activity.RESULT_FIRST_USER) {\n fail(\"Failed starting service, result=\" + brCode);\n }\n conn.waitForConnect();\n\n // Also make sure the uid state reports are as expected.\n uidWatcher.waitFor(WatchUidRunner.CMD_UNCACHED, null);\n uidWatcher.waitFor(WatchUidRunner.CMD_PROCSTATE, WatchUidRunner.STATE_SERVICE);\n\n // Okay, bring down the service.\n mContext.stopService(mServiceIntent);\n conn.waitForDisconnect();\n\n uidWatcher.expect(WatchUidRunner.CMD_CACHED, null);\n uidWatcher.expect(WatchUidRunner.CMD_PROCSTATE, WatchUidRunner.STATE_CACHED_EMPTY);\n\n } finally {\n mContext.stopService(mServiceIntent);\n conn.stopMonitoringIfNeeded();\n controller.cleanup();\n }\n }", "private void setupGeneralBroadcastReceiver() {\n generalBroadcastReceiver = new BroadcastReceiver() {\n @Override\n public void onReceive(Context context, Intent intent) {\n if (\"com.example.loravisual.GENERAL_BROADCAST\".equals(intent.getAction())) {\n int status = intent.getIntExtra(\"com.example.loravisual.GENERAL\", 0);\n if (status == -2) {\n if (!connToastsDeactivated)\n Toast.makeText(context, \"LoRa configuration synchronized, experiment ready\", Toast.LENGTH_SHORT).show();\n getSupportActionBar().setSubtitle(getString(R.string.connected));\n ready = true;\n } else if (status == -3) {\n Toast.makeText(context, \"correct response received\", Toast.LENGTH_SHORT).show();\n } else if (status == -4) {\n Toast.makeText(context, \"response received but did not match\", Toast.LENGTH_SHORT).show();\n } else if (status == -7) {\n Toast.makeText(context, \"no response received\", Toast.LENGTH_SHORT).show();\n } else if (status == -5) {\n Toast.makeText(context, \"no ACK received, trying again\", Toast.LENGTH_SHORT).show();\n } else if (status == -6) {\n Toast.makeText(context, \"ACK received\", Toast.LENGTH_SHORT).show();\n startTimers(total, findViewById(R.id.htext), true);\n }\n if(status == -3 || status == -4 || status == -7)\n connToastsDeactivated = false;\n }\n }\n };\n IntentFilter filter = new IntentFilter(\"com.example.loravisual.GENERAL_BROADCAST\");\n registerReceiver(generalBroadcastReceiver, filter);\n }", "@Override\n\t\t\t\tpublic void run() {\n//\t\t\t\t\t\n//\t\t\t\t\tSystem.out.printf(\"Ausgangs-Puffer: \");\n//\t\t\t\t\tfor(int i=0; i<Message.length; i++)\tSystem.out.printf(\"0x%02X \", eeipClient.O_T_IOData[i]);\n//\t\t\t\t\tSystem.out.printf(\"\\n\\n\");\n\n\t\t\t\t\tStatus_Byte=eeipClient.T_O_IOData[0x7F];\n\t\t\t\t\tTO_Bit=(Status_Byte&(0x20))>>5;\n\t\t\t\t\tAA_Bit=(Status_Byte&(0x02))>>1;\n\t\t\t\t\tAE_Bit=(Status_Byte&(0x04))>>2;\n\t\t\t\n\t\t\t\t\tif((AA_Bit==0)&&(AE_Bit==0)) {\n\t\t\t\t\t\tstate2=2;\n\t\t\t\t\t\ttimerflag2=false;\n\t\t\t\t\t\tthis.cancel();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void onReceive(Context context, Intent intent) {\n String intentAction = intent.getAction();\n\n int value = 0;\n\n switch(intentAction){\n //Checking which action occurred\n case Intent.ACTION_POWER_CONNECTED:\n value = 1;\n break;\n case Intent.ACTION_POWER_DISCONNECTED:\n value = 0;\n break;\n\n }\n\n if(MainActivity.getInstance() != null){\n MainActivity.getInstance().updateIndicator(value);\n }\n }", "private void m29985m() {\n String str = \"com.tencent.android.tpush.service.channel.heartbeatIntent\";\n String str2 = \"TpnsChannel\";\n try {\n if (this.f23299z == null) {\n C6973b.m29776f().registerReceiver(new BroadcastReceiver() {\n public void onReceive(Context context, Intent intent) {\n C7005b.m29964a().m29983k();\n }\n }, new IntentFilter(str));\n this.f23299z = PendingIntent.getBroadcast(C6973b.m29776f(), 0, new Intent(str), 134217728);\n }\n long currentTimeMillis = System.currentTimeMillis();\n if (f23279n > f23278m) {\n f23279n = f23278m;\n }\n if (XGPushConfig.isForeignWeakAlarmMode(C6973b.m29776f())) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"scheduleHeartbeat WaekAlarmMode heartbeatinterval: \");\n sb.append(f23280o);\n sb.append(\" ms\");\n C6864a.m29305f(str2, sb.toString());\n f23279n = f23280o;\n }\n f23279n = C7055h.m30166a(C6973b.m29776f(), \"com.tencent.android.xg.wx.HeartbeatIntervalMs\", f23279n);\n C7045d.m30117a().mo34149a(0, currentTimeMillis + ((long) f23279n), this.f23299z);\n } catch (Throwable th) {\n C6864a.m29302d(str2, \"scheduleHeartbeat error\", th);\n }\n }", "boolean isPendingToRead();", "public void broadcast() {\n for (int i = 1; i <= nbMessagesToBroadcast; i++) {\n Message broadcastMsg = new Message(pid, pid, i,false, null);\n lcb.broadcast(broadcastMsg);\n logs.add(String.format(\"b %d\\n\",i));\n }\n }", "public synchronized void b() {\n if (!this.c && n.isFinished() && l.isFinished() && m.isFinished() && k.isFinished() && j.isFinished() && i.isFinished() && h.isFinished()) {\n this.c = true;\n }\n if (this.c && this.b) {\n LocalBroadcastManager.getInstance(AppApplication.getInstance()).sendBroadcast(new Intent().setAction(WxNotifyRefrshReceiver.b).putExtra(CleanSwitch.CLEAN_DATA, WxNotifyRefrshReceiver.c));\n }\n }", "private void sendDeviceStatus() {\n if (hasRecover && zWaveSubDevice != null) {\n ZWaveDeviceEvent zde = new ZWaveDeviceEvent();\n try {\n PropertyUtils.copyProperties(zde, zWaveSubDevice.getZwavedevice());\n } catch (Exception e) {\n log.error(e.getMessage(), e);\n }\n zde.setReport(zrb.getReport());\n zde.setEventtime(new Date());\n\n JMSUtil.sendmessage(IRemoteConstantDefine.WARNING_TYPE_DEVICE_STATUS, zde);\n }\n }", "private void notifyOnPingReceived(byte[] data) {\n synchronized (globalLock) {\n if (isRunning) {\n onPingReceived(data);\n }\n }\n }", "public void notifyNoKAliveReceived (COPSPdpOSReqStateMan man);", "@Override\r\n\tpublic void run() {\n\t\tIntent intent = new Intent(\"android.intent.action.BOOT_COMPLETED\"); \r\n\t\tresolveInfo = context.getPackageManager().queryBroadcastReceivers(intent, 0);\r\n\t}", "public void turnStrobeOff(){\n Intent stop_strobe_intent = new Intent(FlareConstants.STOP_STROBE);\n stop_strobe_intent.putExtra(FlareConstants.STOP_STROBE, FlareConstants.STOP_STROBE);\n LocalBroadcastManager.getInstance(this).sendBroadcast(stop_strobe_intent);\n Log.d(TAG, \"Sent stop strobe intent broadcast\");\n }", "public abstract boolean broadcast() throws IOException;", "@Override\n public void onReceive(Context context, Intent intent) {\n Log.d(\"ALARMA\", \"alarma\");\n AlarmUtils.scheduleAlarmHeartRate();\n BleDevice device = new BleDevice(new DeviceManager().getDevice().getMacAddress());\n\n device.connect();\n /*\n while(!device.readSteps(new StepsListener() {\n @Override\n public void onStepsRead(int value) {\n Log.d(\"ALARMA\", value+\"\");\n }\n })){\n }\n */\n\n while(!device.readHeartRate(new HeartRateListener() {\n @Override\n public void onHeartRateRead(int value) {\n Log.d(\"ALARMA\", value+\"\");\n\n Measurement measurement = new Measurement(new SessionManager().getId(), value, currentTimeMillis()/1000);\n new ApiHelper().uploadHeartRateMeasure(measurement, new SessionManager().getJWT());\n }\n }));\n }", "@Override\n\t\t\t\tpublic void run() {\n\n\t\t\t\t\ttry{\n\t\t\t\t\t\tLog.d(\"Lavish\",\"Receive Thread running\");\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\trecSocket= new ServerSocket(5570);\n\t\t\t\t\t\t\n\t\t\t\t\twhile(runningFlag==1){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tclient_speak=recSocket.accept();\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t // connect to the server\n\t\t\t\t\t//final DataOutputStream rdos=new DataOutputStream(recSocket.getOutputStream());\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t rdis=new DataInputStream(client_speak.getInputStream());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tqueue=rdis.readUTF();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tLog.e(\"I Got\",\"Data:\"+queue);\n\t\t\t\t\t//Toast.makeText(gh.getApplicationContext(), \"Read kar liya\", Toast.LENGTH_LONG).show();\n\n\t\t\t\t\trunOnUiThread(new Runnable() {\n\t\t\t\t\t\t@SuppressWarnings(\"deprecation\")\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif((queue.equals(\"start_speaking\")))\n\t\t\t\t\t\t\t{\t\t\n\t\t\t\t\t\t\t\t\tispeak=1;\t\n\t\t\t\t\t\t\t\t\t\tLog.e(\"Inside got \",\"Data:\"+queue);\n\t\t\t\t\t\t\t\t\t\tqueuePos.setVisibility(View.GONE);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tstartsp.setVisibility(View.VISIBLE);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t/////// Notification starts//////////\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif(isbackground==1)//&&AudioMainActivity.mainback==0){\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tNotificationManager NM=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\tNotification notify=new Notification(R.drawable.mic_logo_small,\"Classroom Interaction\",System.currentTimeMillis());\n\t\t\t\t\t\t\t\t\t\t\tnotify.flags |= Notification.FLAG_AUTO_CANCEL;\n\t\t\t\t\t\t\t\t\t\t\tIntent nmintent=new Intent(getApplicationContext(),DummyActivity.class);\n\t\t\t\t\t\t\t\t\t\t\t//nmintent.setAction(Intent.ACTION_MAIN);\n\t\t\t\t\t\t\t\t\t\t\t//nmintent.addCategory(Intent.CATEGORY_LAUNCHER);\n\t\t\t\t\t\t\t\t\t\t\tnmintent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);\n\t\t\t\t\t\t\t\t\t\t PendingIntent pending=PendingIntent.getActivity(getApplicationContext(),0, nmintent,0);\n\t\t\t\t\t\t\t\t\t\t notify.setLatestEventInfo(getApplicationContext(),\"Permission Granted\",\"Click to start speaking...\",pending);\n\t\t\t\t\t\t\t\t\t\t NM.notify(0, notify);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t//////////Notification ends///////\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\telse if(queue.equals(\"kick_you\"))\n\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\tispeak=0;\n\t\t\t\t\t\t\t\tLog.e(\"inside if\", \"inside if block\");\n\t\t\t\t\t\t\t\trunningFlag=0;\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\trecSocket.close();\n\t\t\t\t\t\t\t\t\tLog.e(\"closing\", \"socket closed\");\n\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tLog.e(\"Inside got \",\"Data:\"+queue);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif(as!=null)\n\t\t\t \t\t\t\t\t\t{as.onWithdrawPress();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tfinal Dialog dialog = new Dialog(context);\n\t\t\t\t\t\t\t\t\tdialog.setContentView(R.layout.kickdialog);\n\t\t\t\t\t\t\t\t\tdialog.setTitle(\"OOOPS...\");\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t// set the custom dialog components - text, image and button\n\t\t\t\t\t\t\t\t\tTextView text = (TextView) dialog.findViewById(R.id.kicktext);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tButton dialogButton = (Button) dialog.findViewById(R.id.kickok);\n\t\t\t\t\t\t\t\t\t// if button is clicked, close the custom dialog\n\t\t\t\t\t\t\t\t\tdialogButton.setOnClickListener(new OnClickListener() {\n\t\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\t\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\t\t\t\t\t\t\tfinish();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\tdialog.show();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\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\t\n\t\t\t\t\t\t\t\tLog.e(\"inside else\", \"inside else block\");\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t\t\t\tLog.e(\"Inside got \",\"Data:\"+queue);\n\t\t\t\t\t\t\t\t\tqueuePos.setText(\"Your position is \"+queue);\n\t\t\t\t\t\t\t\t\tstartsp.setVisibility(View.GONE);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\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(e.toString());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfinally\n\t\t\t\t\t{\n\t\t\t\t\t\tLog.e(\"INSIDE FINALLY\",\"HURRAYYYY\");\n\t\t\t\t\t\t//finish();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}", "@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 onReceive(Context c, Intent intent) {\n unregisterReceiver(this);\n\n SupplicantState supplicantState = intent.getParcelableExtra(WifiManager.EXTRA_NEW_STATE);\n if (supplicantState == (SupplicantState.COMPLETED)) {\n // Wifi is enabled\n scanSSIDsInBackground();\n }\n }", "public void alertTheWaiter(){\n Chef c = (Chef) Thread.currentThread();\n CommunicationChannel com = new CommunicationChannel(serverHostName, serverPortNumb);\n Object[] params = new Object[0];\n \tObject[] state_fields = new Object[2];\n state_fields[0] = c.getChefID();\n \tstate_fields[1] = c.getChefState();\n\n Message m_toServer = new Message(1, params, 0, state_fields, 2, null); \n Message m_fromServer;\n\n while (!com.open ()){ \n \ttry{ \n \t\tThread.currentThread ();\n \t\tThread.sleep ((long) (10));\n \t}\n \tcatch (InterruptedException e) {}\n \t}\n \n com.writeObject (m_toServer);\n \n m_fromServer = (Message) com.readObject(); \n\n c.setState((int) m_fromServer.getStateFields()[1]);\n \n com.close ();\n }", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\twait_time = 0;\r\n\t\t\t\twhile (true) {\r\n\t\t\t\t\tif (HomeView.ble_status == 0 || HomeView.ble_status == 1\r\n\t\t\t\t\t\t\t|| HomeView.ble_status == 2) {\r\n\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tscanLeDevice(true);\r\n\r\n\t\t\t\t\t\t} catch (IllegalArgumentException e) {\r\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbluetoothSwitch = true;\r\n\t\t\t\t\t\tsetUI();\r\n\t\t\t\t\t\trunOnUiThread(new Runnable() {\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\tprogress.dismiss();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\twait_time++;\r\n\t\t\t\t\tif (wait_time > 5) {\r\n\t\t\t\t\t\trunOnUiThread(new Runnable() {\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\tprogress.dismiss();\r\n\t\t\t\t\t\t\t\twait_time = 0;\r\n\t\t\t\t\t\t\t\tbluetoothSwitch = false;\r\n\t\t\t\t\t\t\t\tsetUI();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tThread.sleep(1000);\r\n\t\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}", "@Override\n\t\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t\tcancelsent=0;\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\tLog.e(\"About to get out\",\"before sending kickmeout\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(dos!=null)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(ispeak==1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ispeak=0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdos.writeUTF(\"kick_me_out_speaking\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLog.e(\"Kick me\",\"KICKED SPEAKING\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tdos.writeUTF(\"kick_me_out_waiting\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tdos.writeUTF(TestConnection.macid);\n\t\t\t\t\t\t\t\t\t\t\t\t\tLog.e(\"Kick me\",\"KICKED WAITING\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tcancelsent=1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\t\trecSocket.close();\n\t\t\t\t\t\t\t\t\t\t\t\t\tLog.e(\"closing\", \"socket closed\");\n\t\t\t\t\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}", "public void suspend()\r\n {\r\n chargeStatus = STATUS_NOT_CHARGING;\r\n connectionStatus = STATUS_OFFLINE;\r\n timerStop(); //...Suspends the update timer. \r\n }", "public void powerOn() { //power_on\n String json = new Gson().toJson(new TelevisionModel(TelevisionModel.Action.ON));\n String a = sendMessage(json);\n TelevisionModel teleM = new Gson().fromJson(a, TelevisionModel.class);\n System.out.println(\"Client Received \" + json);\n\n if (teleM.getAction() == TelevisionModel.Action.ON) {\n isTurningOn = teleM.getValue();\n ui.updateArea(teleM.getMessage());\n }\n }", "public void onReceive(Context context, Intent intent) {\n\t\tNetworkStatus status = TSUtility.checkNetworkStatus(context);\n\t\tif (status.isNetworkAvail()) {\n\t\t\ttry {\n\t\t\t\t// stop network listener\n\t\t\t\tIntent stopNetworkListenerIntent = new Intent(\n\t\t\t\t\t\tTSAppController.getContext(), TSMainService.class);\n\t\t\t\tstopNetworkListenerIntent.putExtra(TSMainService.TASK_ID,\n\t\t\t\t\t\tTSMainService.STOP_NETWORK_LISTENER);\n\t\t\t\tTSAppController.getContext().startService(\n\t\t\t\t\t\tstopNetworkListenerIntent);\n //perform sync\n\t\t\t\tTSUtility.performSync();\n\t\t\t} catch (Exception ex) {\n\t\t\t\tLog.e(\"TSNetworkStateListener\",\n\t\t\t\t\t\t\"Error in Performing task in Network listener :\"\n\t\t\t\t\t\t\t\t+ ex.getMessage());\n\t\t\t}\n\t\t}\n\t}", "private void sendReceiveRes(){\n\t}", "@Override\r\n\t\t\t\tpublic void run() {\n\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tThread.sleep(1000);\r\n\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\twait_time = 0;\r\n\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\tif (HomeView.ble_status == 0\r\n\t\t\t\t\t\t\t\t|| HomeView.ble_status == 1\r\n\t\t\t\t\t\t\t\t|| HomeView.ble_status == 2) {\r\n\t\t\t\t\t\t\twait_time = -10;\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tscanLeDevice(bluetoothSwitch);\r\n\t\t\t\t\t\t\t\trunOnUiThread(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\tprogress.dismiss();\r\n\t\t\t\t\t\t\t\t\t\tsetUI();\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} catch (IllegalArgumentException e) {\r\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\twait_time++;\r\n\t\t\t\t\t\tif (wait_time > 5) {\r\n\t\t\t\t\t\t\trunOnUiThread(new Runnable() {\r\n\t\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\tprogress.dismiss();\r\n\t\t\t\t\t\t\t\t\twait_time = 0;\r\n\t\t\t\t\t\t\t\t\tbluetoothSwitch = false;\r\n\t\t\t\t\t\t\t\t\tsetUI();\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\treturn;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tThread.sleep(1000);\r\n\t\t\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tbyte[] receive = new byte[1];\n\n\t\t\t\t\tDatagramSocket stopSocket = new DatagramSocket(35000);\n\t\t\t\t\tDatagramPacket stopPacket = new DatagramPacket(receive,\n\t\t\t\t\t\t\treceive.length);\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tstopSocket.receive(stopPacket);\n\t\t\t\t\t\ttalkingName.setText(\"\");\n\t\t\t\t\t\tif (iname != -1) {\n\t\t\t\t\t\t\tb[iname].setBackground(Color.BLUE);\n\t\t\t\t\t\t\tstatus = false;\n\t\t\t\t\t\t\tstatusPanel.repaint();\n\t\t\t\t\t\t\tre();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t} catch (SocketException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}", "public synchronized void makeAvailable(){\n isBusy = false;\n }", "public int listen() {\n \tlock.acquire();\n \tif (status!= s_waitL) {\n \t\twaitingL++;\n \t\t//System.out.println(KThread.currentThread() + \" Listener slept, state = \" + status);\n \t\tcondListen.sleep();\n \t\t//System.out.println(KThread.currentThread() + \" Listener arrives\");\n \t\twaitingL--;\n \t}\n \telse ;//System.out.println(KThread.currentThread() + \" Listener arrives without sleep\");\n \t\n \t\n \t\n \tLib.assertTrue(status == s_waitL || status == s_waitLq);\n \t\n \t//System.out.println(KThread.currentThread() + \" Wake up a returner\");\n \t\n \tint ret = msg;\n \tcondRet.wake();\n \tstatus = s_waitR;\n \tlock.release();\n \treturn ret;\n }", "@Override\n public boolean messagePending() {\n return commReceiver.messagePending();\n }", "protected void processWakeUpObject(VObject inObject) {\n\t\tboolean doXmppStatus = true;\n\t\tfinal boolean isXmppObject = inObject.isXMPP();\n\n\t\t//Special case for xmpp object, we will check the resources\n\t\tString theRessource = null;\n\t\tif (isXmppObject) {\n\t\t\tfinal List<String> resources = inObject.getResources(); //IQResourcesQuery.getClientResources(inObject.getXmppAddress());\n\t\t\tif (resources.isEmpty()) {\n\t\t\t\tinObject.setState(VObject.STATUS_ACTIF);\n\t\t\t} else if (resources.contains(\"idle\") || resources.contains(\"streaming\") || resources.contains(\"itmode\") || resources.contains(\"busy\")) {\n\t\t\t\ttheRessource = resources.get(0);\n\t\t\t\tdoXmppStatus = false;\n\t\t\t}\n\t\t}\n\n\t\tfinal int inState = inObject.getObject_state();\n\t\tCrawlerCheckStatus.LOGGER.info(\"Processing wakeup for \" + inObject.getObject_serial() + \" / \" + inState + \" / \" + theRessource);\n\n\t\t//all STATUS_WILLBE_* are used only for xmpp objects\n\t\tswitch (inState) {\n\t\tcase VObject.STATUS_ACTIF: // special case because cache notification is slow/missing so i override this value in db. \n\t\t\tinObject.overrideState(VObject.STATUS_ACTIF);\n\t\t\tsendXmppStatus(inObject, Message.MODE.ACTIF.getId(), JabberMessageFactory.IQ_STATUS_ASLEEP_MODE);\n\t\t\tbreak;\n\t\tcase VObject.STATUS_VEILLE:\n\t\tcase VObject.STATUS_FORCE_ACTIF:\n\t\tcase VObject.STATUS_WILLBE_VEILLE:\n\t\tcase VObject.STATUS_WILLBE_ACTIF:\n\t\tcase VObject.STATUS_WILLBE_FORCE_ACTIF:\n\t\t\tif (inObject.isXMPP() && doXmppStatus) {\n\t\t\t\tsendXmppStatus(inObject, Message.MODE.ACTIF.getId(), JabberMessageFactory.IQ_STATUS_ASLEEP_MODE);\n\t\t\t} else {\n\t\t\t\tinObject.setState(VObject.STATUS_ACTIF);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase VObject.STATUS_WILLBE_FORCE_VEILLE: //normally, object ping do not enter in this condition\n\t\t\tif (inObject.isXMPP() && !doXmppStatus) {\n\t\t\t\tsendXmppStatus(inObject, Message.MODE.FORCE_VEILLE.getId(), JabberMessageFactory.IQ_STATUS_IDLE_MODE);\n\t\t\t} else {\n\t\t\t\tinObject.setState(VObject.STATUS_FORCE_VEILLE);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}", "@Override\n public void onReceive(Context context, Intent intent) {\n\n boolean isAlarmOn = Utils.isAlarmOn();\n PollService.setServiceAlarm(MyApplication.getContext(), isAlarmOn);\n }", "boolean hasUnReceived();", "protected void afterLockWaitingForBooleanCondition() {\n }", "void asyncEventPing();", "public void startBroadcast() {\r\n\t\tthePres.startBroadcast();\r\n\t\tstartBtn.setLabel(\"StopBroadcast\");\r\n\t\tdrawer.startTasking();\r\n\t\tisPlaying = true;\r\n\t}", "void onStopped();", "public void handleStatusUpdated() {\n copyWifiStates();\n notifyListenersIfNecessary();\n }", "@Override\n\tpublic void onReceive(Context arg0, Intent arg1) {\n\t\tif (arg1.getAction().equals(ACTION)) {\n\t\t\tIntent startUpdate = new Intent();\n\t\t\tstartUpdate.setClass(arg0, TurningOffActivity.class);\n\t\t\tstartUpdate.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\t\targ0.startActivity(startUpdate);\n\t\t}\n\n\t}", "@Override\n public void onReceive() {\n //下班充电状态\n boolean isRobotWorking = RobotManager.getInstance().isRobotWorking();\n int robotStatus = RobotManager.getInstance().getRobotStatus();\n boolean isCancellingCharge = RobotManager.getInstance().getIsCancellingCharge();\n boolean isGoing2Charge = RobotManager.getInstance().getIsGoing2Charge();\n int chargeState = RobotManager.getInstance().getChargeState();\n\n if (robotStatus == 4) {\n if (isRobotWorking) {\n translateAnimator.start();\n return;\n }\n }\n\n if (!isRobotWorking && robotStatus != 4 && !isCancellingCharge) {\n if (chargeState == 0) {\n translateAnimator.cancel();\n choseImage(4);\n return;\n }\n }\n\n if (robotStatus != 2 && RobotManager.getInstance().battery.get() != -1 && RobotManager.getInstance().battery.get() <= ConstantValue.batteryThreshold && chargeState == 0) {\n translateAnimator.cancel();\n choseImage(4);\n return;\n } else if ((robotStatus == 2) && isRobotWorking && RobotManager.getInstance().battery.get() >= ConstantValue.batteryCeil) {\n //充电完成开始巡游 //上班时间\n LogcatHelper.logd(StatisticsConstant.STARTMOVE, \"\", StatisticsConstant.WORKENDCHARGE);\n RobotManager.getInstance().setRobotStatus(0);\n translateAnimator.start();\n return;\n } else if (robotStatus == 2 && chargeState == 0) {\n RobotManager.getInstance().setRobotStatus(2);\n translateAnimator.cancel();\n choseImage(4);\n return;\n } else if (robotStatus == 3 && chargeState == 0) {\n translateAnimator.cancel();\n choseImage(4);\n return;\n }\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n Log.i(\"WiFi SCAN\", \"RESULT RETURN:\"+new Date().getTime());\n synchronized (scanned) {\n scanned.notify();\n }\n //throw new UnsupportedOperationException(\"Not yet implemented\");\n }", "@Override\n\tpublic void onReceive(Context context, Intent intent) {\n\t\tmContext = context;\n\t\tNetworkIOAsyncTask mObjMain;\n\n\t\tSystem.out.println(\"Inside Connectivity Change Broadcast Receiver: \"+TAG);\n\n\t\tif(intent.getAction().equals(\"android.net.conn.CONNECTIVITY_CHANGE\")){\n\n\t\t\tif(GenUtils.isNetworkAvailable(mContext) && SettingsMgr.getTaskRuningStatus(context)){\n\t\t\t\tToast.makeText(mContext, \"Network Available\", Toast.LENGTH_SHORT).show();\n\n\t\t\t\tif(SettingsMgr.getTaskRuningStatus(context)){\n\t\t\t\t\tSettingsMgr.setTaskRunningStatus(context, false);\n\t\t\t\t\tmObjMain = new NetworkIOAsyncTask(context);\n\t\t\t\t\tif(SettingsMgr.getLastIndexRecord(context) == 0){\n\t\t\t\t\t\tmObjMain.runAsyncTask(SettingsMgr.getLastIndexRecord(context));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tmObjMain.runAsyncTask(SettingsMgr.getLastIndexRecord(context) + 1);\n\t\t\t\t\t}\n\t\t\t\t\tToast.makeText(mContext, \"Last Index:\"+SettingsMgr.getLastIndexRecord(context), Toast.LENGTH_SHORT).show();\n\n\t\t\t\t\t// Setting shared prefs variable to default values\n\t\t\t\t\tSettingsMgr.setLastIndexRecord(context, mObjMain.getLastExecutedIndex());\n\t\t\t\t}\n\n\t\t\t}else if(!GenUtils.isNetworkAvailable(mContext) && !SettingsMgr.getTaskRuningStatus(context)){\n\t\t\t\tToast.makeText(mContext, \"Network Unavailable\", Toast.LENGTH_SHORT).show();\n\n\t\t\t\tmObjMain = new NetworkIOAsyncTask(context);\n\t\t\t\tif(mObjMain.isAsyncTaskRunning()){\n\t\t\t\t\tSettingsMgr.setTaskRunningStatus(context, true);\n\t\t\t\t\tSettingsMgr.setLastIndexRecord(context, mObjMain.getLastExecutedIndex());\n\t\t\t\t\tToast.makeText(mContext, \"Task Running :\"+mObjMain.isAsyncTaskRunning(), Toast.LENGTH_SHORT).show();\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}", "@Override\n\tpublic void onReceive(Context context, Intent intent) {\n if(intent != null && \"com.mmi.helper.request\".equals(intent.getAction())){\n\t\t\t\tandroid.util.Log.i(\"zuozhuang\",\"come here !!\");\n\t\tString type = intent.getExtras().getString(\"type\");\n\t\tString value = intent.getExtras().getString(\"value\");\n\t\tString pac_flag = intent.getExtras().getString(\"pac_flag\");\n\t\tLog.i(\"dongxiaotang\", \"type: \" + type + \" value: \" + value);\n\t\t\n\t\tIntent fmIntent = new Intent(\"com.wind.factoryautotest.action.FmService\");\n\t\tfmIntent.setPackage(\"com.wind.factoryautotest\");\n\t\t\n\t\tIntent reIntent = new Intent();\n\t\treIntent.setAction(\"com.mmi.helper.response\");\n\t\t\n\t\tswitch(type){\n\t\t\tcase \"led_open\": \n\t\t\t\tnew LEDTest().test(\"11\");\n\t\t\t\tbreak;\n\n\t\t\tcase \"led_shutdown\":\n\t\t\t\tnew LEDTest().test(\"10\");\t\t\t\n\t\t\t\tbreak;\n\n\t\t\tcase \"vibrator_play\":\n\t\t\t\tnew VibratorTest().test(context, true);\n\t\t\t\tbreak;\n\t\t\tcase \"vibrator_stop\":\n\t\t\t\tnew VibratorTest().test(context, false);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t case \"set_pacmmi_result\":\n\t\t\t\tboolean i = false;\n\t\t\t if(value.equals(\"pass\")){\n\t\t\t\t i = PartitionUtils.writeFile(true);\n\t\t\t\t}else if( value.equals(\"fail\")){\n\t\t\t\t\ti = PartitionUtils.writeFile(false);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!i) reIntent.putExtra(\"result\",\"fail\");\n\t\t\t\tif (i) reIntent.putExtra(\"result\",\"success\");\n\t\t\t\tcontext.sendBroadcast(reIntent);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"set_pacflag_result\":\n\n try{\n android.provider.Settings.System.putInt(context.getApplicationContext().getContentResolver(), pac_flag, Integer.parseInt(value));\n\t\t\t\t\treIntent.putExtra(\"result\",\"success\");\n\t\t\t\t\tcontext.sendBroadcast(reIntent);\n }catch(NumberFormatException e){\n\t\t\t\t\treIntent.putExtra(\"result\",\"fail\");\n\t\t\t\t\tcontext.sendBroadcast(reIntent);\n }\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"get_pacflag_result\":\n try{\n String result = android.provider.Settings.System.getInt(context.getApplicationContext().getContentResolver(), pac_flag, 0)==1?\"success\":\"fail\";\n\t\t\t\t\treIntent.putExtra(\"result\",result);\n\t\t\t\t\tcontext.sendBroadcast(reIntent);\n }catch(NumberFormatException e){\n\t\t\t\t\treIntent.putExtra(\"result\",\"fail\");\n\t\t\t\t\tcontext.sendBroadcast(reIntent);\n }\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"get_all_pacflag\":\n String[] items = getRemoteStringArray(\"emode_pac_flag_keys\",context);\n ContentResolver cr = context.getApplicationContext().getContentResolver();\n int ilen = items.length;\n StringBuffer content = new StringBuffer();\n String msn = android.os.SystemProperties.get(\"gsm.serial\", \"\");\n if(msn.indexOf(' ') >= 0){\n msn = msn.substring(0, msn.indexOf(' '));\n }else{\n msn = \"unknown\";\n }\n String version = android.os.SystemProperties.get(\"ro.build.version.incremental\", \"unknown\");\n content.append(\"sn:\" + msn + \",version:\" + version + \",\");\n for(int j = 0; j < ilen; j ++){\n content.append(items[j].substring(15) + \":\" + android.provider.Settings.System.getInt(cr, items[j], 0) + \",\");\n }\n\t\t\t\tString result = content.substring(0, content.length()-1);\n\t\t\t\treIntent.putExtra(\"result\",result);\n\t\t\t context.sendBroadcast(reIntent);\n\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n break;\n\t\t}\n\t }\n\t}", "private void startrun() {\n mHandler.postDelayed(mPollTask, POLL_INTERVAL);\n\t}", "public void run()\n\t{\n\t\t// The instance of the received broadcast request. 11/29/2014, Bing Li\n\t\tSearchKeywordBroadcastRequest request;\n\t\t// The thread always runs until it is shutdown by the BoundNotificationDispatcher. 11/29/2014, Bing Li\n\t\twhile (!this.isShutdown())\n\t\t{\n\t\t\t// Check whether the notification queue is empty. 11/29/2014, Bing Li\n\t\t\twhile (!this.isEmpty())\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t// Dequeue the request. 11/29/2014, Bing Li\n\t\t\t\t\trequest = this.getNotification();\n\t\t\t\t\t// Disseminate the broadcast request to the local node's children. 11/29/2014, Bing Li\n\t\t\t\t\tMemoryMulticastor.STORE().disseminateSearchKeywordRequestAmongSubMemServers(request);\n\t\t\t\t\t// Notify the binder that the thread's task on the request has done. 11/29/2014, Bing Li\n\t\t\t\t\tthis.bind(super.getDispatcherKey(), request);\n\t\t\t\t}\n\t\t\t\tcatch (InterruptedException e)\n\t\t\t\t{\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Wait for a moment after all of the existing requests are processed. 11/29/2014, Bing Li\n\t\t\t\tthis.holdOn(ServerConfig.NOTIFICATION_THREAD_WAIT_TIME);\n\t\t\t}\n\t\t\tcatch (InterruptedException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void run() {\n\t\tDate curTime;\n\t\twhile(true) {\n\t\t\tcurTime = new Date();\n\t\t\t\n\t\t\t//System.out.println(\"currentTime: \"+ curTime.getTime() +\" prevTime: \"+ _prevPingRequestTime.getTime() +\" diff: \" + (curTime.getTime() - _prevPingRequestTime.getTime()) +\" interval: \"+ _scsynthPingInterval);\n\n\t\t\t//if the previous status request is still pending...\n\t\t\tif (_serverLive && (_prevPingRequestTime.getTime() > _prevPingResponseTime.getTime())) {\n\t\t\t\t//We've not yet heard back from the previous status request.\n\t\t\t\t//Have we timed out?\n\t\t\t\tif (curTime.getTime() - _prevPingRequestTime.getTime() > _serverResponseTimeout) {\n\t\t\t\t\t//We've timed out on the previous status request.\n\t\t\t\t\tSystem.out.println(\"Timed out on previous status request.\");\n\n\t\t\t\t\tif (_notifyListener != null) {\n\t\t\t\t\t\t_notifyListener.receiveNotification_ServerStopped();\n\t\t\t\t\t}\n\t\t\t\t\tif (_controlPanel != null && _controlPanel._statsDisplay != null) {\n\t\t\t\t\t\t_controlPanel._statsDisplay.receiveNotification_ServerStopped();\n\t\t\t\t\t\t_scsclogger.receiveNotification_ServerStopped();\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t_serverLive = false;\n\t\t\t\t\t_serverBooted = false;\n\t\t\t\t}\n\t\t\t\t//else we just keep waiting for a response or a timeout\n\t\t\t}\n\t\t\t//the previous status request is NOT still pending. Is it time to send another?\n\t\t\telse if (curTime.getTime() - _prevPingRequestTime.getTime() > _scsynthPingInterval) {\n\t\t\t\t//It's time to send another status request.\n\t\t\t\t\n\t\t\t\t//generally, ping with a /status message.\n\t\t\t\t//but, if we're live but not booted, query node 1 (the sign that init completed)\n\t\t\t\tif (_serverLive && !_serverBooted) { \n\t\t\t\t\tsendMessage(\"/notify\", new Object[] { 1 });\n\t\t\t\t\tsendMessage(\"/n_query\", new Object[]{_motherGroupID});\n\t\t\t\t\t//System.out.println(\"Querying SCSC mother node\");\n\t\t\t\t\t//debugPrintln(\"Querying SCSC mother node\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//if the server's booted, request a status update.\n\t\t\t\t\tsendMessage(\"/status\"); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t_prevPingRequestTime = new Date();\n\t\t\t}\n\t\t\t//it's not time to send, and we're not watching \n\t\t\t//for a reply, so go to sleep until it's time to ping again\n\t\t\telse {\n\t\t\t\tlong sleeptime = Math.max(_scsynthPingInterval - (curTime.getTime() - _prevPingRequestTime.getTime()), 0);\n\t\t\t\t//System.out.println(\"sleep \" + sleeptime);\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(sleeptime);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t//NOTE this thread shouldn't get interrupted.\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t}", "void intentHasBeenReceivedThroughTheBroadCast(Intent intent);", "public void sendPreBootBroadcast(int userId, boolean quiet, Runnable onFinish) {\n final Runnable runnable = onFinish;\n AnonymousClass1 r0 = new PreBootBroadcaster(this.mService, userId, null, quiet) {\n public void onFinished() {\n runnable.run();\n }\n };\n r0.sendNext();\n }" ]
[ "0.6371381", "0.62653035", "0.62507504", "0.6050853", "0.6049172", "0.60353315", "0.6014563", "0.6006955", "0.5955324", "0.5950235", "0.5921409", "0.59098816", "0.5885149", "0.5864137", "0.58288646", "0.5825017", "0.57942796", "0.5769612", "0.5760593", "0.5757516", "0.575338", "0.5751235", "0.5742888", "0.57356256", "0.5717941", "0.5697952", "0.5696125", "0.5694485", "0.5669697", "0.56535745", "0.5651396", "0.5642759", "0.56387496", "0.56288064", "0.5627822", "0.56201714", "0.56149626", "0.5613447", "0.56134415", "0.5610115", "0.56075156", "0.56042844", "0.56021607", "0.56008834", "0.55977243", "0.5589744", "0.55854267", "0.5581899", "0.55760175", "0.55588883", "0.55575484", "0.5549519", "0.554928", "0.5546279", "0.5545859", "0.5534283", "0.55320716", "0.5531875", "0.5522002", "0.5497795", "0.54912806", "0.54892737", "0.54851735", "0.5478636", "0.547044", "0.5467616", "0.5445964", "0.5444576", "0.5434194", "0.5426051", "0.5424206", "0.54219395", "0.541672", "0.5415211", "0.54109657", "0.5409887", "0.54096925", "0.54089314", "0.5407148", "0.53976184", "0.53968334", "0.5393712", "0.5382224", "0.5381405", "0.5371827", "0.5371178", "0.5367782", "0.5367604", "0.5367366", "0.5361198", "0.535937", "0.53469557", "0.534643", "0.5345275", "0.53439385", "0.53432745", "0.5336419", "0.5335567", "0.5334061", "0.53255916", "0.53245187" ]
0.0
-1
write custom code to on start progress
@Override public void onStartTrackingTouch(SeekBar seekBar) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void startProgress();", "@Override\n\tpublic void preExecution() {\n\t\tshowProgressBar();\n\t}", "public void progressMade();", "public void onProgress(int pos);", "@Override\n public void showProgress() {\n\n }", "public void onBegin() {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "protected void onBegin() {}", "@Override\r\n public void onUIProgressStart(long totalBytes) {\r\n super.onUIProgressStart(totalBytes);\r\n\r\n }", "public final void start(){\n cpt = 0;\n inProgress = true;\n init();\n UpdateableManager.addToUpdate(this);\n }", "void onShowProgress();", "@Override\r\n\tprotected void progressFinished() {\n\t}", "public void onProgressUpdate(int numRouleau,String prochain);", "@Override\r\n\t\t\t\t\tpublic void onStart() {\n\t\t\t\t\t\tsuper.onStart();\r\n\t\t\t\t\t\tShowProgressDialog(R.string.hsc_progress);\r\n\t\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic void onStart() {\n\t\t\t\t\t\tsuper.onStart();\r\n\t\t\t\t\t\tShowProgressDialog(R.string.hsc_progress);\r\n\t\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic void onStart() {\n\t\t\t\t\t\tsuper.onStart();\r\n\t\t\t\t\t\tShowProgressDialog(R.string.hsc_progress);\r\n\t\t\t\t\t}", "@Override\n\tpublic void onProgressUpdate() {\n\n\t}", "@Override\n public void onStart(boolean fromBeginning)\n {\n if(fromBeginning)\n {\n System.out.println(mLabel + \" Started!\");\n }\n else\n {\n System.out.println(mLabel + \" resumed\");\n }\n }", "@Override\n\tpublic void progress(int arg0) {\n\t\tm_progress = arg0 / 10;\n\t\t//Main.log(TAG, \"progress : \" + m_progress + \"%\");\n\t}", "public void run() {\n\t\t\t\tMessage msg = new Message();\n\t\t\t\tmsg.what = Msg_SetProgress;\n\t\t\t\tmHandler.sendMessage(msg);\n\t\t\t}", "@Override\n\tpublic void startProcessing() {\n\n\t}", "@Override\n protected void onPreExecute() {\n\n myProgress = 0;\n }", "@Override\n protected void onPreExecute() {\n myProgress = 0;\n }", "void showProgress();", "@Override\n\t\t\tpublic void onProgress(ProgressMessage msg) {\n\n\t\t\t}", "@Override\n\t\t\t\tpublic void onProgress(int progress) {\n\t\t\t\t\tmProgressBar.setProgress(progress);\n\t\t\t\t}", "@Override\r\n public void onStart() {\n LogManager.print(\"Rating onStart\");\r\n progressBar.setVisibility(View.VISIBLE);\r\n }", "void onProgress(float progress);", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n // Do something like display a progress bar\n }", "@Override\n\tvoid startWork() {\n\t\t\n\t}", "@Override\n\tvoid startWork() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void onProgressChanged(int progress) {\n\n\t\t\t}", "@Override\n public void onStart(ITestContext tc) {\n StatusPrinter.printRunStart();\n }", "void setProgress(int progress);", "void setProgress(int progress);", "@Override\n public void resume() {\n originProgress = 10;\n mSkbProgress.setProgress((int) originProgress);\n }", "@Override public void onInitProgress(int pctComplete) {\n publishProgress(Integer.valueOf(pctComplete));\n }", "@Override\n\t\t\tpublic void onResume() {\n\t\t\t\tsuper.onResume();\n\t\t\t\tisonshow=true;\n\t\t\t\tMythtead mythread=new Mythtead();\n\t\t\t\tmythread.start();\n\t\t\t\t\n\t\t\t\tcircleprogressbar.setProgress(pro);\n\n\t\t\t}", "private void setProgress(String what)\n {\n if (progressBar != null)\n {\n double elapsed = (System.currentTimeMillis() - startMs) / 1000.;\n String etl = String.format(\"Elapsed: %4.0f\", elapsed);\n progressBar.setEstTime(etl);\n progressBar.setWorkingOn(what);\n progressBar.setProgress(-1);\n }\n }", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tsuper.onStart();\n\t\t\t\tToast.makeText(context, \"开始下载。。。\",\n\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\tdownProgressVersion();\n\t\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tshowDialog(progress_bar_type);\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tshowDialog(progress_bar_type);\n\t\t}", "public void onStepStarted(int index, int total, String name);", "void onSuccessfulStarted();", "public void onProgressChanged(SeekBar arg0, int arg1, boolean arg2) {\n textStart.setText(String.valueOf(arg1));\n count = arg1;\n }", "@Override\n public void start() {\n checkValue();\n super.start();\n }", "@Override\n\t protected void onPreExecute() {\n\t }", "public abstract void onProgress(short percentage, long downloadedSoFar);", "void onStarted();", "public void installProgress(Status status) {\r\n if (listener != null) {\r\n listener.onInstallProgress(status);// .onStatus(status);\r\n }\r\n }", "@Override\r\n protected void onProgressUpdate(Void... values) {\n \tsuper.onProgressUpdate(values);\r\n }", "private void progressStuff() {\n cd = new ConnectionDetector(getActivity());\n parser = new JSONParser();\n progress = new ProgressDialog(getActivity());\n progress.setMessage(getResources().getString(R.string.loading));\n progress.setIndeterminate(false);\n progress.setCancelable(true);\n // progress.show();\n }", "public void start( )\n {\n // Implemented by student.\n }", "public void onProgressChanged(SeekBar arg0, int arg1, boolean arg2) {\n textGoalStart.setText(String.valueOf(arg1)+\"%\");\n\n }", "@Override\n protected void onProgressUpdate(Integer... progress) {\n loadingText.setText(loadingHints[random.nextInt(loadingHints.length)]);\n // [... Обновите индикатор хода выполнения, уведомления или другой\n // элемент пользовательского интерфейса ...]\n }", "@Override\n\t\tprotected void onPreExecute() \n\t\t{\n\t\t}", "public void markRunStart(){\r\n runStart = stepCount;\r\n }", "@Override\n\t\t\t\tpublic void onStart() {\n\t\t\t\t\tsuper.onStart();\n\t\t\t\t\tpDialog = new ProgressDialog(ProfileDetails.this);\n\t\t\t\t\tpDialog.setMessage(\"Please wait...\");\n\t\t\t\t\tpDialog.setCancelable(false);\n\t\t\t\t\tpDialog.show();\n\n\t\t\t\t}", "@Override\r\n public void start() {\r\n }", "protected void sendProgress() {\n setProgress(getProgress() ^ 1);\n }", "@Override\n protected void onProgressUpdate(Integer... progress) {\n }", "@Override\n protected void onProgressUpdate(Integer... progress) {\n }", "@Override\n\tvoid start() {\n\t\tSystem.out.println(\"starts\");\n\t}", "@Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n\n\n // Do things like update the progress bar\n }", "@Override\r\n\tpublic void start() {\n\t\t\r\n\t}", "@Override\n public void progressCallBack(int length) {\n finishedProgress += length;\n //每100毫秒发送刷新进度事件\n if (System.currentTimeMillis() - curTime > 100 || finishedProgress == appBean.getLength()) {\n TLog.log(\"finishedprogress\", finishedProgress + \"\");\n appBean.setFinished(finishedProgress);\n EventMessage message = new EventMessage(3, appBean);\n EventBus.getDefault().post(message);\n curTime = System.currentTimeMillis();\n }\n }", "public void startExecuting()\n {\n super.startExecuting();\n this.breakingTime = 0;\n }", "void progress(int pUnitsCompleted);", "void onProgress(Context context , int progressLevel , int warningLevel);", "private void initProgress()\n {\n\n if (showProgressBar && progressBar == null)\n { // there's an issue if called from matlab of getting the progress frame\n // in matlab's event loop so we can't just create a new one here\n progressBar = new Progress();\n }\n if (progressBar != null)\n {\n progressBar.setChanName(channelName);\n progressBar.setWorkingOn(\"Initializing\");\n progressBar.setEstTime(\"Time remaining: unknown\");\n progressBar.setProgress(-1);\n progressBar.setPosition();\n }\n }", "@Override\n public void start() { }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tprogressBar.setProgress(0);\n\t\t\tprogressBar.getProgressDrawable().setColorFilter(Color.RED, PorterDuff.Mode.SRC_IN);\n\t\t\tsuper.onPreExecute();\n\t\t}", "void setProgress(float progress);", "@Override\n\t protected void onProgressUpdate(Void... values) {\n\t }", "@Override\n public void showProgressSync() {\n }", "@Override\r\n protected void onProgressUpdate(Void... values) {\n super.onProgressUpdate(values);\r\n }", "@Override\r\n protected void onProgressUpdate(Integer... progress) {\n }", "@Override\n public void start() {}", "public abstract void setProgress (String description, int currentStep, int totalSteps);", "@Override\n protected void onPreExecute() {\n progressBar.setProgress(0);\n super.onPreExecute();\n }", "@Override\r\n\tprotected void onProgressUpdate(String... s) {\r\n\t\tactivity.addToGUI(s[0]);\r\n\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t progressDialog = new AutoTuningInitDialog(mChannelActivity, R.style.dialog);\n\t\t\tprogressDialog.show();\t\t\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tSystem.out.println(\"onStart\");\n\t\t\t\tif(listener!=null) listener.onMessage(\"onStart\");\n\t\t\t\tisRun = true;\n\t\t\t}", "void onProgress(long bytesTransferred);", "private void start(){\n\t\tMetricData metric = new MetricData();\n\t\tmetric.getName();\n\t\tmetric.getValue();\n\t\tmetric.setValue(2);\n\t}", "void startTracking();", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tLog.e(\"xx\", \"onstart\");\n\n\t\t\t}", "@Override\n public void onStart()\n {\n if (mProgressView != null)\n {\n mProgressView.setVisibility(View.VISIBLE);\n }\n }", "private void preRequest() {\n\t\tSystem.out.println(\"pre request, i am playing job\");\n\t}", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n protected void onPreExecute() {\n mProgress = new ProgressDialog(ctx);\n mProgress.setMessage(\"Finding current location\");\n mProgress.show();\n super.onPreExecute();\n }", "@Override\n public void progress(FileStatus status) {\n progressReporter.progress();\n }", "private void startProgressBar() {\n\t b_buscar.setVisibility(View.GONE);\n\t // wi_progreso.setVisibility(View.VISIBLE);\n\t ly_progreso.setVisibility(View.VISIBLE);\n\t}", "@Override\n\tprotected void onPreExecute() {\n\t\tUtils.showProcessingDialog(_context);\n\t}", "public void startExecuting()\n {\n super.startExecuting();\n }", "public void start() {\n \tupdateHeader();\n }" ]
[ "0.8156041", "0.7351512", "0.7096684", "0.70728946", "0.70159423", "0.6986402", "0.69625723", "0.69223946", "0.68467253", "0.6804253", "0.6793854", "0.67673755", "0.6722857", "0.6722857", "0.6722857", "0.67041004", "0.66995835", "0.66866696", "0.66785043", "0.66135633", "0.6609071", "0.6588466", "0.658805", "0.65688574", "0.65650356", "0.6549737", "0.65495247", "0.6528723", "0.6515809", "0.6515809", "0.65140593", "0.65115833", "0.6470817", "0.6470817", "0.64663917", "0.6455959", "0.6442678", "0.6429708", "0.6422541", "0.6413548", "0.6413548", "0.64036405", "0.6395385", "0.6379523", "0.637748", "0.63624954", "0.63546485", "0.63539207", "0.6334909", "0.6324908", "0.6317293", "0.63061905", "0.6306083", "0.6303797", "0.62914747", "0.628216", "0.6268006", "0.6267797", "0.62657094", "0.6261341", "0.6261341", "0.6258763", "0.62512445", "0.62423384", "0.6240323", "0.6236625", "0.6234198", "0.62305945", "0.6224193", "0.62162507", "0.62159294", "0.6211297", "0.6204471", "0.6199262", "0.6192746", "0.6192505", "0.61871004", "0.61866534", "0.6181041", "0.61772037", "0.61750877", "0.6168635", "0.61663723", "0.6159289", "0.6150872", "0.61481047", "0.6142477", "0.613802", "0.6134924", "0.6134924", "0.6134924", "0.6134924", "0.6134924", "0.6134924", "0.6134924", "0.61344904", "0.6133318", "0.613266", "0.6129475", "0.6128005", "0.6118413" ]
0.0
-1
write custom code to on start progress
@Override public void onStartTrackingTouch(SeekBar seekBar) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void startProgress();", "@Override\n\tpublic void preExecution() {\n\t\tshowProgressBar();\n\t}", "public void progressMade();", "public void onProgress(int pos);", "@Override\n public void showProgress() {\n\n }", "public void onBegin() {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "protected void onBegin() {}", "@Override\r\n public void onUIProgressStart(long totalBytes) {\r\n super.onUIProgressStart(totalBytes);\r\n\r\n }", "public final void start(){\n cpt = 0;\n inProgress = true;\n init();\n UpdateableManager.addToUpdate(this);\n }", "void onShowProgress();", "@Override\r\n\tprotected void progressFinished() {\n\t}", "public void onProgressUpdate(int numRouleau,String prochain);", "@Override\r\n\t\t\t\t\tpublic void onStart() {\n\t\t\t\t\t\tsuper.onStart();\r\n\t\t\t\t\t\tShowProgressDialog(R.string.hsc_progress);\r\n\t\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic void onStart() {\n\t\t\t\t\t\tsuper.onStart();\r\n\t\t\t\t\t\tShowProgressDialog(R.string.hsc_progress);\r\n\t\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic void onStart() {\n\t\t\t\t\t\tsuper.onStart();\r\n\t\t\t\t\t\tShowProgressDialog(R.string.hsc_progress);\r\n\t\t\t\t\t}", "@Override\n\tpublic void onProgressUpdate() {\n\n\t}", "@Override\n public void onStart(boolean fromBeginning)\n {\n if(fromBeginning)\n {\n System.out.println(mLabel + \" Started!\");\n }\n else\n {\n System.out.println(mLabel + \" resumed\");\n }\n }", "@Override\n\tpublic void progress(int arg0) {\n\t\tm_progress = arg0 / 10;\n\t\t//Main.log(TAG, \"progress : \" + m_progress + \"%\");\n\t}", "public void run() {\n\t\t\t\tMessage msg = new Message();\n\t\t\t\tmsg.what = Msg_SetProgress;\n\t\t\t\tmHandler.sendMessage(msg);\n\t\t\t}", "@Override\n\tpublic void startProcessing() {\n\n\t}", "@Override\n protected void onPreExecute() {\n\n myProgress = 0;\n }", "@Override\n protected void onPreExecute() {\n myProgress = 0;\n }", "void showProgress();", "@Override\n\t\t\tpublic void onProgress(ProgressMessage msg) {\n\n\t\t\t}", "@Override\n\t\t\t\tpublic void onProgress(int progress) {\n\t\t\t\t\tmProgressBar.setProgress(progress);\n\t\t\t\t}", "@Override\r\n public void onStart() {\n LogManager.print(\"Rating onStart\");\r\n progressBar.setVisibility(View.VISIBLE);\r\n }", "void onProgress(float progress);", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n // Do something like display a progress bar\n }", "@Override\n\t\t\tpublic void onProgressChanged(int progress) {\n\n\t\t\t}", "@Override\n\tvoid startWork() {\n\t\t\n\t}", "@Override\n\tvoid startWork() {\n\t\t\n\t}", "@Override\n public void onStart(ITestContext tc) {\n StatusPrinter.printRunStart();\n }", "void setProgress(int progress);", "void setProgress(int progress);", "@Override\n public void resume() {\n originProgress = 10;\n mSkbProgress.setProgress((int) originProgress);\n }", "@Override public void onInitProgress(int pctComplete) {\n publishProgress(Integer.valueOf(pctComplete));\n }", "@Override\n\t\t\tpublic void onResume() {\n\t\t\t\tsuper.onResume();\n\t\t\t\tisonshow=true;\n\t\t\t\tMythtead mythread=new Mythtead();\n\t\t\t\tmythread.start();\n\t\t\t\t\n\t\t\t\tcircleprogressbar.setProgress(pro);\n\n\t\t\t}", "private void setProgress(String what)\n {\n if (progressBar != null)\n {\n double elapsed = (System.currentTimeMillis() - startMs) / 1000.;\n String etl = String.format(\"Elapsed: %4.0f\", elapsed);\n progressBar.setEstTime(etl);\n progressBar.setWorkingOn(what);\n progressBar.setProgress(-1);\n }\n }", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tsuper.onStart();\n\t\t\t\tToast.makeText(context, \"开始下载。。。\",\n\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\tdownProgressVersion();\n\t\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tshowDialog(progress_bar_type);\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tshowDialog(progress_bar_type);\n\t\t}", "public void onStepStarted(int index, int total, String name);", "void onSuccessfulStarted();", "public void onProgressChanged(SeekBar arg0, int arg1, boolean arg2) {\n textStart.setText(String.valueOf(arg1));\n count = arg1;\n }", "@Override\n public void start() {\n checkValue();\n super.start();\n }", "@Override\n\t protected void onPreExecute() {\n\t }", "public abstract void onProgress(short percentage, long downloadedSoFar);", "void onStarted();", "public void installProgress(Status status) {\r\n if (listener != null) {\r\n listener.onInstallProgress(status);// .onStatus(status);\r\n }\r\n }", "@Override\r\n protected void onProgressUpdate(Void... values) {\n \tsuper.onProgressUpdate(values);\r\n }", "private void progressStuff() {\n cd = new ConnectionDetector(getActivity());\n parser = new JSONParser();\n progress = new ProgressDialog(getActivity());\n progress.setMessage(getResources().getString(R.string.loading));\n progress.setIndeterminate(false);\n progress.setCancelable(true);\n // progress.show();\n }", "public void onProgressChanged(SeekBar arg0, int arg1, boolean arg2) {\n textGoalStart.setText(String.valueOf(arg1)+\"%\");\n\n }", "@Override\n protected void onProgressUpdate(Integer... progress) {\n loadingText.setText(loadingHints[random.nextInt(loadingHints.length)]);\n // [... Обновите индикатор хода выполнения, уведомления или другой\n // элемент пользовательского интерфейса ...]\n }", "public void start( )\n {\n // Implemented by student.\n }", "@Override\n\t\tprotected void onPreExecute() \n\t\t{\n\t\t}", "public void markRunStart(){\r\n runStart = stepCount;\r\n }", "@Override\n\t\t\t\tpublic void onStart() {\n\t\t\t\t\tsuper.onStart();\n\t\t\t\t\tpDialog = new ProgressDialog(ProfileDetails.this);\n\t\t\t\t\tpDialog.setMessage(\"Please wait...\");\n\t\t\t\t\tpDialog.setCancelable(false);\n\t\t\t\t\tpDialog.show();\n\n\t\t\t\t}", "@Override\r\n public void start() {\r\n }", "protected void sendProgress() {\n setProgress(getProgress() ^ 1);\n }", "@Override\n protected void onProgressUpdate(Integer... progress) {\n }", "@Override\n protected void onProgressUpdate(Integer... progress) {\n }", "@Override\n\tvoid start() {\n\t\tSystem.out.println(\"starts\");\n\t}", "@Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n\n\n // Do things like update the progress bar\n }", "@Override\n public void progressCallBack(int length) {\n finishedProgress += length;\n //每100毫秒发送刷新进度事件\n if (System.currentTimeMillis() - curTime > 100 || finishedProgress == appBean.getLength()) {\n TLog.log(\"finishedprogress\", finishedProgress + \"\");\n appBean.setFinished(finishedProgress);\n EventMessage message = new EventMessage(3, appBean);\n EventBus.getDefault().post(message);\n curTime = System.currentTimeMillis();\n }\n }", "@Override\r\n\tpublic void start() {\n\t\t\r\n\t}", "public void startExecuting()\n {\n super.startExecuting();\n this.breakingTime = 0;\n }", "void progress(int pUnitsCompleted);", "void onProgress(Context context , int progressLevel , int warningLevel);", "private void initProgress()\n {\n\n if (showProgressBar && progressBar == null)\n { // there's an issue if called from matlab of getting the progress frame\n // in matlab's event loop so we can't just create a new one here\n progressBar = new Progress();\n }\n if (progressBar != null)\n {\n progressBar.setChanName(channelName);\n progressBar.setWorkingOn(\"Initializing\");\n progressBar.setEstTime(\"Time remaining: unknown\");\n progressBar.setProgress(-1);\n progressBar.setPosition();\n }\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tprogressBar.setProgress(0);\n\t\t\tprogressBar.getProgressDrawable().setColorFilter(Color.RED, PorterDuff.Mode.SRC_IN);\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n public void start() { }", "void setProgress(float progress);", "@Override\n\t protected void onProgressUpdate(Void... values) {\n\t }", "@Override\n public void showProgressSync() {\n }", "@Override\r\n protected void onProgressUpdate(Void... values) {\n super.onProgressUpdate(values);\r\n }", "@Override\r\n protected void onProgressUpdate(Integer... progress) {\n }", "public abstract void setProgress (String description, int currentStep, int totalSteps);", "@Override\n public void start() {}", "@Override\n protected void onPreExecute() {\n progressBar.setProgress(0);\n super.onPreExecute();\n }", "@Override\r\n\tprotected void onProgressUpdate(String... s) {\r\n\t\tactivity.addToGUI(s[0]);\r\n\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t progressDialog = new AutoTuningInitDialog(mChannelActivity, R.style.dialog);\n\t\t\tprogressDialog.show();\t\t\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tSystem.out.println(\"onStart\");\n\t\t\t\tif(listener!=null) listener.onMessage(\"onStart\");\n\t\t\t\tisRun = true;\n\t\t\t}", "void onProgress(long bytesTransferred);", "private void start(){\n\t\tMetricData metric = new MetricData();\n\t\tmetric.getName();\n\t\tmetric.getValue();\n\t\tmetric.setValue(2);\n\t}", "void startTracking();", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tLog.e(\"xx\", \"onstart\");\n\n\t\t\t}", "@Override\n public void onStart()\n {\n if (mProgressView != null)\n {\n mProgressView.setVisibility(View.VISIBLE);\n }\n }", "private void preRequest() {\n\t\tSystem.out.println(\"pre request, i am playing job\");\n\t}", "@Override\n protected void onPreExecute() {\n mProgress = new ProgressDialog(ctx);\n mProgress.setMessage(\"Finding current location\");\n mProgress.show();\n super.onPreExecute();\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void progress(FileStatus status) {\n progressReporter.progress();\n }", "private void startProgressBar() {\n\t b_buscar.setVisibility(View.GONE);\n\t // wi_progreso.setVisibility(View.VISIBLE);\n\t ly_progreso.setVisibility(View.VISIBLE);\n\t}", "@Override\n\tprotected void onPreExecute() {\n\t\tUtils.showProcessingDialog(_context);\n\t}", "public void startExecuting()\n {\n super.startExecuting();\n }", "@Override\n public void start() {\n }" ]
[ "0.8155428", "0.735075", "0.7097578", "0.7073339", "0.7016699", "0.69874096", "0.6964475", "0.6923351", "0.6846002", "0.6805113", "0.6795762", "0.67686313", "0.6724589", "0.6724589", "0.6724589", "0.6705899", "0.6698875", "0.66878057", "0.66794974", "0.66125107", "0.6610689", "0.6590054", "0.6587889", "0.65702426", "0.65668464", "0.6551175", "0.6551043", "0.6528902", "0.6516474", "0.6514977", "0.6514977", "0.65114844", "0.64721733", "0.64721733", "0.6467029", "0.6457744", "0.64442027", "0.6431345", "0.64236695", "0.6413941", "0.6413941", "0.6403756", "0.63967085", "0.6380513", "0.6378535", "0.6363017", "0.6355799", "0.63552237", "0.633591", "0.6327293", "0.6318568", "0.6307237", "0.63055694", "0.63049424", "0.6292292", "0.6281421", "0.62697065", "0.6267377", "0.62666", "0.6263377", "0.6263377", "0.62578756", "0.62528646", "0.6241741", "0.62417346", "0.62357754", "0.62342405", "0.6231768", "0.6225637", "0.6218005", "0.62160385", "0.62130284", "0.6206417", "0.6199835", "0.61952543", "0.619459", "0.61871946", "0.6186917", "0.61825275", "0.6178565", "0.61759007", "0.6169438", "0.6167487", "0.6159526", "0.61505944", "0.6149218", "0.6144319", "0.6136645", "0.61355656", "0.6134687", "0.6134687", "0.6134687", "0.6134687", "0.6134687", "0.6134687", "0.6134687", "0.61338115", "0.6132158", "0.6129281", "0.6127116", "0.611774" ]
0.0
-1
write custom code to on start progress
@Override public void onStartTrackingTouch(SeekBar seekBar) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void startProgress();", "@Override\n\tpublic void preExecution() {\n\t\tshowProgressBar();\n\t}", "public void progressMade();", "public void onProgress(int pos);", "@Override\n public void showProgress() {\n\n }", "public void onBegin() {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "protected void onBegin() {}", "@Override\r\n public void onUIProgressStart(long totalBytes) {\r\n super.onUIProgressStart(totalBytes);\r\n\r\n }", "public final void start(){\n cpt = 0;\n inProgress = true;\n init();\n UpdateableManager.addToUpdate(this);\n }", "void onShowProgress();", "@Override\r\n\tprotected void progressFinished() {\n\t}", "public void onProgressUpdate(int numRouleau,String prochain);", "@Override\r\n\t\t\t\t\tpublic void onStart() {\n\t\t\t\t\t\tsuper.onStart();\r\n\t\t\t\t\t\tShowProgressDialog(R.string.hsc_progress);\r\n\t\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic void onStart() {\n\t\t\t\t\t\tsuper.onStart();\r\n\t\t\t\t\t\tShowProgressDialog(R.string.hsc_progress);\r\n\t\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic void onStart() {\n\t\t\t\t\t\tsuper.onStart();\r\n\t\t\t\t\t\tShowProgressDialog(R.string.hsc_progress);\r\n\t\t\t\t\t}", "@Override\n\tpublic void onProgressUpdate() {\n\n\t}", "@Override\n public void onStart(boolean fromBeginning)\n {\n if(fromBeginning)\n {\n System.out.println(mLabel + \" Started!\");\n }\n else\n {\n System.out.println(mLabel + \" resumed\");\n }\n }", "@Override\n\tpublic void progress(int arg0) {\n\t\tm_progress = arg0 / 10;\n\t\t//Main.log(TAG, \"progress : \" + m_progress + \"%\");\n\t}", "public void run() {\n\t\t\t\tMessage msg = new Message();\n\t\t\t\tmsg.what = Msg_SetProgress;\n\t\t\t\tmHandler.sendMessage(msg);\n\t\t\t}", "@Override\n\tpublic void startProcessing() {\n\n\t}", "@Override\n protected void onPreExecute() {\n\n myProgress = 0;\n }", "@Override\n protected void onPreExecute() {\n myProgress = 0;\n }", "void showProgress();", "@Override\n\t\t\tpublic void onProgress(ProgressMessage msg) {\n\n\t\t\t}", "@Override\n\t\t\t\tpublic void onProgress(int progress) {\n\t\t\t\t\tmProgressBar.setProgress(progress);\n\t\t\t\t}", "@Override\r\n public void onStart() {\n LogManager.print(\"Rating onStart\");\r\n progressBar.setVisibility(View.VISIBLE);\r\n }", "void onProgress(float progress);", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n // Do something like display a progress bar\n }", "@Override\n\t\t\tpublic void onProgressChanged(int progress) {\n\n\t\t\t}", "@Override\n\tvoid startWork() {\n\t\t\n\t}", "@Override\n\tvoid startWork() {\n\t\t\n\t}", "@Override\n public void onStart(ITestContext tc) {\n StatusPrinter.printRunStart();\n }", "void setProgress(int progress);", "void setProgress(int progress);", "@Override\n public void resume() {\n originProgress = 10;\n mSkbProgress.setProgress((int) originProgress);\n }", "@Override public void onInitProgress(int pctComplete) {\n publishProgress(Integer.valueOf(pctComplete));\n }", "@Override\n\t\t\tpublic void onResume() {\n\t\t\t\tsuper.onResume();\n\t\t\t\tisonshow=true;\n\t\t\t\tMythtead mythread=new Mythtead();\n\t\t\t\tmythread.start();\n\t\t\t\t\n\t\t\t\tcircleprogressbar.setProgress(pro);\n\n\t\t\t}", "private void setProgress(String what)\n {\n if (progressBar != null)\n {\n double elapsed = (System.currentTimeMillis() - startMs) / 1000.;\n String etl = String.format(\"Elapsed: %4.0f\", elapsed);\n progressBar.setEstTime(etl);\n progressBar.setWorkingOn(what);\n progressBar.setProgress(-1);\n }\n }", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tsuper.onStart();\n\t\t\t\tToast.makeText(context, \"开始下载。。。\",\n\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\tdownProgressVersion();\n\t\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tshowDialog(progress_bar_type);\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tshowDialog(progress_bar_type);\n\t\t}", "public void onStepStarted(int index, int total, String name);", "void onSuccessfulStarted();", "public void onProgressChanged(SeekBar arg0, int arg1, boolean arg2) {\n textStart.setText(String.valueOf(arg1));\n count = arg1;\n }", "@Override\n public void start() {\n checkValue();\n super.start();\n }", "@Override\n\t protected void onPreExecute() {\n\t }", "public abstract void onProgress(short percentage, long downloadedSoFar);", "void onStarted();", "public void installProgress(Status status) {\r\n if (listener != null) {\r\n listener.onInstallProgress(status);// .onStatus(status);\r\n }\r\n }", "@Override\r\n protected void onProgressUpdate(Void... values) {\n \tsuper.onProgressUpdate(values);\r\n }", "private void progressStuff() {\n cd = new ConnectionDetector(getActivity());\n parser = new JSONParser();\n progress = new ProgressDialog(getActivity());\n progress.setMessage(getResources().getString(R.string.loading));\n progress.setIndeterminate(false);\n progress.setCancelable(true);\n // progress.show();\n }", "public void onProgressChanged(SeekBar arg0, int arg1, boolean arg2) {\n textGoalStart.setText(String.valueOf(arg1)+\"%\");\n\n }", "@Override\n protected void onProgressUpdate(Integer... progress) {\n loadingText.setText(loadingHints[random.nextInt(loadingHints.length)]);\n // [... Обновите индикатор хода выполнения, уведомления или другой\n // элемент пользовательского интерфейса ...]\n }", "public void start( )\n {\n // Implemented by student.\n }", "@Override\n\t\tprotected void onPreExecute() \n\t\t{\n\t\t}", "public void markRunStart(){\r\n runStart = stepCount;\r\n }", "@Override\n\t\t\t\tpublic void onStart() {\n\t\t\t\t\tsuper.onStart();\n\t\t\t\t\tpDialog = new ProgressDialog(ProfileDetails.this);\n\t\t\t\t\tpDialog.setMessage(\"Please wait...\");\n\t\t\t\t\tpDialog.setCancelable(false);\n\t\t\t\t\tpDialog.show();\n\n\t\t\t\t}", "@Override\r\n public void start() {\r\n }", "protected void sendProgress() {\n setProgress(getProgress() ^ 1);\n }", "@Override\n protected void onProgressUpdate(Integer... progress) {\n }", "@Override\n protected void onProgressUpdate(Integer... progress) {\n }", "@Override\n\tvoid start() {\n\t\tSystem.out.println(\"starts\");\n\t}", "@Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n\n\n // Do things like update the progress bar\n }", "@Override\n public void progressCallBack(int length) {\n finishedProgress += length;\n //每100毫秒发送刷新进度事件\n if (System.currentTimeMillis() - curTime > 100 || finishedProgress == appBean.getLength()) {\n TLog.log(\"finishedprogress\", finishedProgress + \"\");\n appBean.setFinished(finishedProgress);\n EventMessage message = new EventMessage(3, appBean);\n EventBus.getDefault().post(message);\n curTime = System.currentTimeMillis();\n }\n }", "@Override\r\n\tpublic void start() {\n\t\t\r\n\t}", "public void startExecuting()\n {\n super.startExecuting();\n this.breakingTime = 0;\n }", "void progress(int pUnitsCompleted);", "void onProgress(Context context , int progressLevel , int warningLevel);", "private void initProgress()\n {\n\n if (showProgressBar && progressBar == null)\n { // there's an issue if called from matlab of getting the progress frame\n // in matlab's event loop so we can't just create a new one here\n progressBar = new Progress();\n }\n if (progressBar != null)\n {\n progressBar.setChanName(channelName);\n progressBar.setWorkingOn(\"Initializing\");\n progressBar.setEstTime(\"Time remaining: unknown\");\n progressBar.setProgress(-1);\n progressBar.setPosition();\n }\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tprogressBar.setProgress(0);\n\t\t\tprogressBar.getProgressDrawable().setColorFilter(Color.RED, PorterDuff.Mode.SRC_IN);\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n public void start() { }", "void setProgress(float progress);", "@Override\n\t protected void onProgressUpdate(Void... values) {\n\t }", "@Override\n public void showProgressSync() {\n }", "@Override\r\n protected void onProgressUpdate(Void... values) {\n super.onProgressUpdate(values);\r\n }", "@Override\r\n protected void onProgressUpdate(Integer... progress) {\n }", "public abstract void setProgress (String description, int currentStep, int totalSteps);", "@Override\n public void start() {}", "@Override\n protected void onPreExecute() {\n progressBar.setProgress(0);\n super.onPreExecute();\n }", "@Override\r\n\tprotected void onProgressUpdate(String... s) {\r\n\t\tactivity.addToGUI(s[0]);\r\n\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t progressDialog = new AutoTuningInitDialog(mChannelActivity, R.style.dialog);\n\t\t\tprogressDialog.show();\t\t\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tSystem.out.println(\"onStart\");\n\t\t\t\tif(listener!=null) listener.onMessage(\"onStart\");\n\t\t\t\tisRun = true;\n\t\t\t}", "void onProgress(long bytesTransferred);", "private void start(){\n\t\tMetricData metric = new MetricData();\n\t\tmetric.getName();\n\t\tmetric.getValue();\n\t\tmetric.setValue(2);\n\t}", "void startTracking();", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tLog.e(\"xx\", \"onstart\");\n\n\t\t\t}", "@Override\n public void onStart()\n {\n if (mProgressView != null)\n {\n mProgressView.setVisibility(View.VISIBLE);\n }\n }", "private void preRequest() {\n\t\tSystem.out.println(\"pre request, i am playing job\");\n\t}", "@Override\n protected void onPreExecute() {\n mProgress = new ProgressDialog(ctx);\n mProgress.setMessage(\"Finding current location\");\n mProgress.show();\n super.onPreExecute();\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void progress(FileStatus status) {\n progressReporter.progress();\n }", "private void startProgressBar() {\n\t b_buscar.setVisibility(View.GONE);\n\t // wi_progreso.setVisibility(View.VISIBLE);\n\t ly_progreso.setVisibility(View.VISIBLE);\n\t}", "@Override\n\tprotected void onPreExecute() {\n\t\tUtils.showProcessingDialog(_context);\n\t}", "public void startExecuting()\n {\n super.startExecuting();\n }", "@Override\n public void start() {\n }" ]
[ "0.8155428", "0.735075", "0.7097578", "0.7073339", "0.7016699", "0.69874096", "0.6964475", "0.6923351", "0.6846002", "0.6805113", "0.6795762", "0.67686313", "0.6724589", "0.6724589", "0.6724589", "0.6705899", "0.6698875", "0.66878057", "0.66794974", "0.66125107", "0.6610689", "0.6590054", "0.6587889", "0.65702426", "0.65668464", "0.6551175", "0.6551043", "0.6528902", "0.6516474", "0.6514977", "0.6514977", "0.65114844", "0.64721733", "0.64721733", "0.6467029", "0.6457744", "0.64442027", "0.6431345", "0.64236695", "0.6413941", "0.6413941", "0.6403756", "0.63967085", "0.6380513", "0.6378535", "0.6363017", "0.6355799", "0.63552237", "0.633591", "0.6327293", "0.6318568", "0.6307237", "0.63055694", "0.63049424", "0.6292292", "0.6281421", "0.62697065", "0.6267377", "0.62666", "0.6263377", "0.6263377", "0.62578756", "0.62528646", "0.6241741", "0.62417346", "0.62357754", "0.62342405", "0.6231768", "0.6225637", "0.6218005", "0.62160385", "0.62130284", "0.6206417", "0.6199835", "0.61952543", "0.619459", "0.61871946", "0.6186917", "0.61825275", "0.6178565", "0.61759007", "0.6169438", "0.6167487", "0.6159526", "0.61505944", "0.6149218", "0.6144319", "0.6136645", "0.61355656", "0.6134687", "0.6134687", "0.6134687", "0.6134687", "0.6134687", "0.6134687", "0.6134687", "0.61338115", "0.6132158", "0.6129281", "0.6127116", "0.611774" ]
0.0
-1
write custom code to on start progress
@Override public void onStartTrackingTouch(SeekBar seekBar) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void startProgress();", "@Override\n\tpublic void preExecution() {\n\t\tshowProgressBar();\n\t}", "public void progressMade();", "public void onProgress(int pos);", "@Override\n public void showProgress() {\n\n }", "public void onBegin() {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "protected void onBegin() {}", "@Override\r\n public void onUIProgressStart(long totalBytes) {\r\n super.onUIProgressStart(totalBytes);\r\n\r\n }", "public final void start(){\n cpt = 0;\n inProgress = true;\n init();\n UpdateableManager.addToUpdate(this);\n }", "void onShowProgress();", "@Override\r\n\tprotected void progressFinished() {\n\t}", "public void onProgressUpdate(int numRouleau,String prochain);", "@Override\r\n\t\t\t\t\tpublic void onStart() {\n\t\t\t\t\t\tsuper.onStart();\r\n\t\t\t\t\t\tShowProgressDialog(R.string.hsc_progress);\r\n\t\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic void onStart() {\n\t\t\t\t\t\tsuper.onStart();\r\n\t\t\t\t\t\tShowProgressDialog(R.string.hsc_progress);\r\n\t\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic void onStart() {\n\t\t\t\t\t\tsuper.onStart();\r\n\t\t\t\t\t\tShowProgressDialog(R.string.hsc_progress);\r\n\t\t\t\t\t}", "@Override\n\tpublic void onProgressUpdate() {\n\n\t}", "@Override\n public void onStart(boolean fromBeginning)\n {\n if(fromBeginning)\n {\n System.out.println(mLabel + \" Started!\");\n }\n else\n {\n System.out.println(mLabel + \" resumed\");\n }\n }", "@Override\n\tpublic void progress(int arg0) {\n\t\tm_progress = arg0 / 10;\n\t\t//Main.log(TAG, \"progress : \" + m_progress + \"%\");\n\t}", "public void run() {\n\t\t\t\tMessage msg = new Message();\n\t\t\t\tmsg.what = Msg_SetProgress;\n\t\t\t\tmHandler.sendMessage(msg);\n\t\t\t}", "@Override\n\tpublic void startProcessing() {\n\n\t}", "@Override\n protected void onPreExecute() {\n\n myProgress = 0;\n }", "@Override\n protected void onPreExecute() {\n myProgress = 0;\n }", "void showProgress();", "@Override\n\t\t\tpublic void onProgress(ProgressMessage msg) {\n\n\t\t\t}", "@Override\n\t\t\t\tpublic void onProgress(int progress) {\n\t\t\t\t\tmProgressBar.setProgress(progress);\n\t\t\t\t}", "@Override\r\n public void onStart() {\n LogManager.print(\"Rating onStart\");\r\n progressBar.setVisibility(View.VISIBLE);\r\n }", "void onProgress(float progress);", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n // Do something like display a progress bar\n }", "@Override\n\t\t\tpublic void onProgressChanged(int progress) {\n\n\t\t\t}", "@Override\n\tvoid startWork() {\n\t\t\n\t}", "@Override\n\tvoid startWork() {\n\t\t\n\t}", "@Override\n public void onStart(ITestContext tc) {\n StatusPrinter.printRunStart();\n }", "void setProgress(int progress);", "void setProgress(int progress);", "@Override\n public void resume() {\n originProgress = 10;\n mSkbProgress.setProgress((int) originProgress);\n }", "@Override public void onInitProgress(int pctComplete) {\n publishProgress(Integer.valueOf(pctComplete));\n }", "@Override\n\t\t\tpublic void onResume() {\n\t\t\t\tsuper.onResume();\n\t\t\t\tisonshow=true;\n\t\t\t\tMythtead mythread=new Mythtead();\n\t\t\t\tmythread.start();\n\t\t\t\t\n\t\t\t\tcircleprogressbar.setProgress(pro);\n\n\t\t\t}", "private void setProgress(String what)\n {\n if (progressBar != null)\n {\n double elapsed = (System.currentTimeMillis() - startMs) / 1000.;\n String etl = String.format(\"Elapsed: %4.0f\", elapsed);\n progressBar.setEstTime(etl);\n progressBar.setWorkingOn(what);\n progressBar.setProgress(-1);\n }\n }", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tsuper.onStart();\n\t\t\t\tToast.makeText(context, \"开始下载。。。\",\n\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\tdownProgressVersion();\n\t\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tshowDialog(progress_bar_type);\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tshowDialog(progress_bar_type);\n\t\t}", "public void onStepStarted(int index, int total, String name);", "void onSuccessfulStarted();", "public void onProgressChanged(SeekBar arg0, int arg1, boolean arg2) {\n textStart.setText(String.valueOf(arg1));\n count = arg1;\n }", "@Override\n public void start() {\n checkValue();\n super.start();\n }", "@Override\n\t protected void onPreExecute() {\n\t }", "public abstract void onProgress(short percentage, long downloadedSoFar);", "void onStarted();", "public void installProgress(Status status) {\r\n if (listener != null) {\r\n listener.onInstallProgress(status);// .onStatus(status);\r\n }\r\n }", "@Override\r\n protected void onProgressUpdate(Void... values) {\n \tsuper.onProgressUpdate(values);\r\n }", "private void progressStuff() {\n cd = new ConnectionDetector(getActivity());\n parser = new JSONParser();\n progress = new ProgressDialog(getActivity());\n progress.setMessage(getResources().getString(R.string.loading));\n progress.setIndeterminate(false);\n progress.setCancelable(true);\n // progress.show();\n }", "public void onProgressChanged(SeekBar arg0, int arg1, boolean arg2) {\n textGoalStart.setText(String.valueOf(arg1)+\"%\");\n\n }", "@Override\n protected void onProgressUpdate(Integer... progress) {\n loadingText.setText(loadingHints[random.nextInt(loadingHints.length)]);\n // [... Обновите индикатор хода выполнения, уведомления или другой\n // элемент пользовательского интерфейса ...]\n }", "public void start( )\n {\n // Implemented by student.\n }", "@Override\n\t\tprotected void onPreExecute() \n\t\t{\n\t\t}", "public void markRunStart(){\r\n runStart = stepCount;\r\n }", "@Override\n\t\t\t\tpublic void onStart() {\n\t\t\t\t\tsuper.onStart();\n\t\t\t\t\tpDialog = new ProgressDialog(ProfileDetails.this);\n\t\t\t\t\tpDialog.setMessage(\"Please wait...\");\n\t\t\t\t\tpDialog.setCancelable(false);\n\t\t\t\t\tpDialog.show();\n\n\t\t\t\t}", "@Override\r\n public void start() {\r\n }", "protected void sendProgress() {\n setProgress(getProgress() ^ 1);\n }", "@Override\n protected void onProgressUpdate(Integer... progress) {\n }", "@Override\n protected void onProgressUpdate(Integer... progress) {\n }", "@Override\n\tvoid start() {\n\t\tSystem.out.println(\"starts\");\n\t}", "@Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n\n\n // Do things like update the progress bar\n }", "@Override\n public void progressCallBack(int length) {\n finishedProgress += length;\n //每100毫秒发送刷新进度事件\n if (System.currentTimeMillis() - curTime > 100 || finishedProgress == appBean.getLength()) {\n TLog.log(\"finishedprogress\", finishedProgress + \"\");\n appBean.setFinished(finishedProgress);\n EventMessage message = new EventMessage(3, appBean);\n EventBus.getDefault().post(message);\n curTime = System.currentTimeMillis();\n }\n }", "@Override\r\n\tpublic void start() {\n\t\t\r\n\t}", "public void startExecuting()\n {\n super.startExecuting();\n this.breakingTime = 0;\n }", "void progress(int pUnitsCompleted);", "void onProgress(Context context , int progressLevel , int warningLevel);", "private void initProgress()\n {\n\n if (showProgressBar && progressBar == null)\n { // there's an issue if called from matlab of getting the progress frame\n // in matlab's event loop so we can't just create a new one here\n progressBar = new Progress();\n }\n if (progressBar != null)\n {\n progressBar.setChanName(channelName);\n progressBar.setWorkingOn(\"Initializing\");\n progressBar.setEstTime(\"Time remaining: unknown\");\n progressBar.setProgress(-1);\n progressBar.setPosition();\n }\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tprogressBar.setProgress(0);\n\t\t\tprogressBar.getProgressDrawable().setColorFilter(Color.RED, PorterDuff.Mode.SRC_IN);\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n public void start() { }", "void setProgress(float progress);", "@Override\n\t protected void onProgressUpdate(Void... values) {\n\t }", "@Override\n public void showProgressSync() {\n }", "@Override\r\n protected void onProgressUpdate(Void... values) {\n super.onProgressUpdate(values);\r\n }", "@Override\r\n protected void onProgressUpdate(Integer... progress) {\n }", "public abstract void setProgress (String description, int currentStep, int totalSteps);", "@Override\n public void start() {}", "@Override\n protected void onPreExecute() {\n progressBar.setProgress(0);\n super.onPreExecute();\n }", "@Override\r\n\tprotected void onProgressUpdate(String... s) {\r\n\t\tactivity.addToGUI(s[0]);\r\n\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t progressDialog = new AutoTuningInitDialog(mChannelActivity, R.style.dialog);\n\t\t\tprogressDialog.show();\t\t\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tSystem.out.println(\"onStart\");\n\t\t\t\tif(listener!=null) listener.onMessage(\"onStart\");\n\t\t\t\tisRun = true;\n\t\t\t}", "void onProgress(long bytesTransferred);", "private void start(){\n\t\tMetricData metric = new MetricData();\n\t\tmetric.getName();\n\t\tmetric.getValue();\n\t\tmetric.setValue(2);\n\t}", "void startTracking();", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tLog.e(\"xx\", \"onstart\");\n\n\t\t\t}", "@Override\n public void onStart()\n {\n if (mProgressView != null)\n {\n mProgressView.setVisibility(View.VISIBLE);\n }\n }", "private void preRequest() {\n\t\tSystem.out.println(\"pre request, i am playing job\");\n\t}", "@Override\n protected void onPreExecute() {\n mProgress = new ProgressDialog(ctx);\n mProgress.setMessage(\"Finding current location\");\n mProgress.show();\n super.onPreExecute();\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void progress(FileStatus status) {\n progressReporter.progress();\n }", "private void startProgressBar() {\n\t b_buscar.setVisibility(View.GONE);\n\t // wi_progreso.setVisibility(View.VISIBLE);\n\t ly_progreso.setVisibility(View.VISIBLE);\n\t}", "@Override\n\tprotected void onPreExecute() {\n\t\tUtils.showProcessingDialog(_context);\n\t}", "public void startExecuting()\n {\n super.startExecuting();\n }", "@Override\n public void start() {\n }" ]
[ "0.8155428", "0.735075", "0.7097578", "0.7073339", "0.7016699", "0.69874096", "0.6964475", "0.6923351", "0.6846002", "0.6805113", "0.6795762", "0.67686313", "0.6724589", "0.6724589", "0.6724589", "0.6705899", "0.6698875", "0.66878057", "0.66794974", "0.66125107", "0.6610689", "0.6590054", "0.6587889", "0.65702426", "0.65668464", "0.6551175", "0.6551043", "0.6528902", "0.6516474", "0.6514977", "0.6514977", "0.65114844", "0.64721733", "0.64721733", "0.6467029", "0.6457744", "0.64442027", "0.6431345", "0.64236695", "0.6413941", "0.6413941", "0.6403756", "0.63967085", "0.6380513", "0.6378535", "0.6363017", "0.6355799", "0.63552237", "0.633591", "0.6327293", "0.6318568", "0.6307237", "0.63055694", "0.63049424", "0.6292292", "0.6281421", "0.62697065", "0.6267377", "0.62666", "0.6263377", "0.6263377", "0.62578756", "0.62528646", "0.6241741", "0.62417346", "0.62357754", "0.62342405", "0.6231768", "0.6225637", "0.6218005", "0.62160385", "0.62130284", "0.6206417", "0.6199835", "0.61952543", "0.619459", "0.61871946", "0.6186917", "0.61825275", "0.6178565", "0.61759007", "0.6169438", "0.6167487", "0.6159526", "0.61505944", "0.6149218", "0.6144319", "0.6136645", "0.61355656", "0.6134687", "0.6134687", "0.6134687", "0.6134687", "0.6134687", "0.6134687", "0.6134687", "0.61338115", "0.6132158", "0.6129281", "0.6127116", "0.611774" ]
0.0
-1
write custom code to on start progress
@Override public void onStartTrackingTouch(SeekBar seekBar) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void startProgress();", "@Override\n\tpublic void preExecution() {\n\t\tshowProgressBar();\n\t}", "public void progressMade();", "public void onProgress(int pos);", "@Override\n public void showProgress() {\n\n }", "public void onBegin() {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "protected void onBegin() {}", "@Override\r\n public void onUIProgressStart(long totalBytes) {\r\n super.onUIProgressStart(totalBytes);\r\n\r\n }", "public final void start(){\n cpt = 0;\n inProgress = true;\n init();\n UpdateableManager.addToUpdate(this);\n }", "void onShowProgress();", "@Override\r\n\tprotected void progressFinished() {\n\t}", "public void onProgressUpdate(int numRouleau,String prochain);", "@Override\r\n\t\t\t\t\tpublic void onStart() {\n\t\t\t\t\t\tsuper.onStart();\r\n\t\t\t\t\t\tShowProgressDialog(R.string.hsc_progress);\r\n\t\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic void onStart() {\n\t\t\t\t\t\tsuper.onStart();\r\n\t\t\t\t\t\tShowProgressDialog(R.string.hsc_progress);\r\n\t\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic void onStart() {\n\t\t\t\t\t\tsuper.onStart();\r\n\t\t\t\t\t\tShowProgressDialog(R.string.hsc_progress);\r\n\t\t\t\t\t}", "@Override\n\tpublic void onProgressUpdate() {\n\n\t}", "@Override\n public void onStart(boolean fromBeginning)\n {\n if(fromBeginning)\n {\n System.out.println(mLabel + \" Started!\");\n }\n else\n {\n System.out.println(mLabel + \" resumed\");\n }\n }", "@Override\n\tpublic void progress(int arg0) {\n\t\tm_progress = arg0 / 10;\n\t\t//Main.log(TAG, \"progress : \" + m_progress + \"%\");\n\t}", "public void run() {\n\t\t\t\tMessage msg = new Message();\n\t\t\t\tmsg.what = Msg_SetProgress;\n\t\t\t\tmHandler.sendMessage(msg);\n\t\t\t}", "@Override\n\tpublic void startProcessing() {\n\n\t}", "@Override\n protected void onPreExecute() {\n\n myProgress = 0;\n }", "@Override\n protected void onPreExecute() {\n myProgress = 0;\n }", "void showProgress();", "@Override\n\t\t\tpublic void onProgress(ProgressMessage msg) {\n\n\t\t\t}", "@Override\n\t\t\t\tpublic void onProgress(int progress) {\n\t\t\t\t\tmProgressBar.setProgress(progress);\n\t\t\t\t}", "@Override\r\n public void onStart() {\n LogManager.print(\"Rating onStart\");\r\n progressBar.setVisibility(View.VISIBLE);\r\n }", "void onProgress(float progress);", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n // Do something like display a progress bar\n }", "@Override\n\tvoid startWork() {\n\t\t\n\t}", "@Override\n\tvoid startWork() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void onProgressChanged(int progress) {\n\n\t\t\t}", "@Override\n public void onStart(ITestContext tc) {\n StatusPrinter.printRunStart();\n }", "void setProgress(int progress);", "void setProgress(int progress);", "@Override\n public void resume() {\n originProgress = 10;\n mSkbProgress.setProgress((int) originProgress);\n }", "@Override public void onInitProgress(int pctComplete) {\n publishProgress(Integer.valueOf(pctComplete));\n }", "@Override\n\t\t\tpublic void onResume() {\n\t\t\t\tsuper.onResume();\n\t\t\t\tisonshow=true;\n\t\t\t\tMythtead mythread=new Mythtead();\n\t\t\t\tmythread.start();\n\t\t\t\t\n\t\t\t\tcircleprogressbar.setProgress(pro);\n\n\t\t\t}", "private void setProgress(String what)\n {\n if (progressBar != null)\n {\n double elapsed = (System.currentTimeMillis() - startMs) / 1000.;\n String etl = String.format(\"Elapsed: %4.0f\", elapsed);\n progressBar.setEstTime(etl);\n progressBar.setWorkingOn(what);\n progressBar.setProgress(-1);\n }\n }", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tsuper.onStart();\n\t\t\t\tToast.makeText(context, \"开始下载。。。\",\n\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\tdownProgressVersion();\n\t\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tshowDialog(progress_bar_type);\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tshowDialog(progress_bar_type);\n\t\t}", "public void onStepStarted(int index, int total, String name);", "void onSuccessfulStarted();", "public void onProgressChanged(SeekBar arg0, int arg1, boolean arg2) {\n textStart.setText(String.valueOf(arg1));\n count = arg1;\n }", "@Override\n public void start() {\n checkValue();\n super.start();\n }", "@Override\n\t protected void onPreExecute() {\n\t }", "public abstract void onProgress(short percentage, long downloadedSoFar);", "void onStarted();", "public void installProgress(Status status) {\r\n if (listener != null) {\r\n listener.onInstallProgress(status);// .onStatus(status);\r\n }\r\n }", "@Override\r\n protected void onProgressUpdate(Void... values) {\n \tsuper.onProgressUpdate(values);\r\n }", "private void progressStuff() {\n cd = new ConnectionDetector(getActivity());\n parser = new JSONParser();\n progress = new ProgressDialog(getActivity());\n progress.setMessage(getResources().getString(R.string.loading));\n progress.setIndeterminate(false);\n progress.setCancelable(true);\n // progress.show();\n }", "public void start( )\n {\n // Implemented by student.\n }", "public void onProgressChanged(SeekBar arg0, int arg1, boolean arg2) {\n textGoalStart.setText(String.valueOf(arg1)+\"%\");\n\n }", "@Override\n protected void onProgressUpdate(Integer... progress) {\n loadingText.setText(loadingHints[random.nextInt(loadingHints.length)]);\n // [... Обновите индикатор хода выполнения, уведомления или другой\n // элемент пользовательского интерфейса ...]\n }", "@Override\n\t\tprotected void onPreExecute() \n\t\t{\n\t\t}", "public void markRunStart(){\r\n runStart = stepCount;\r\n }", "@Override\n\t\t\t\tpublic void onStart() {\n\t\t\t\t\tsuper.onStart();\n\t\t\t\t\tpDialog = new ProgressDialog(ProfileDetails.this);\n\t\t\t\t\tpDialog.setMessage(\"Please wait...\");\n\t\t\t\t\tpDialog.setCancelable(false);\n\t\t\t\t\tpDialog.show();\n\n\t\t\t\t}", "@Override\r\n public void start() {\r\n }", "protected void sendProgress() {\n setProgress(getProgress() ^ 1);\n }", "@Override\n protected void onProgressUpdate(Integer... progress) {\n }", "@Override\n protected void onProgressUpdate(Integer... progress) {\n }", "@Override\n\tvoid start() {\n\t\tSystem.out.println(\"starts\");\n\t}", "@Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n\n\n // Do things like update the progress bar\n }", "@Override\r\n\tpublic void start() {\n\t\t\r\n\t}", "@Override\n public void progressCallBack(int length) {\n finishedProgress += length;\n //每100毫秒发送刷新进度事件\n if (System.currentTimeMillis() - curTime > 100 || finishedProgress == appBean.getLength()) {\n TLog.log(\"finishedprogress\", finishedProgress + \"\");\n appBean.setFinished(finishedProgress);\n EventMessage message = new EventMessage(3, appBean);\n EventBus.getDefault().post(message);\n curTime = System.currentTimeMillis();\n }\n }", "public void startExecuting()\n {\n super.startExecuting();\n this.breakingTime = 0;\n }", "void progress(int pUnitsCompleted);", "void onProgress(Context context , int progressLevel , int warningLevel);", "private void initProgress()\n {\n\n if (showProgressBar && progressBar == null)\n { // there's an issue if called from matlab of getting the progress frame\n // in matlab's event loop so we can't just create a new one here\n progressBar = new Progress();\n }\n if (progressBar != null)\n {\n progressBar.setChanName(channelName);\n progressBar.setWorkingOn(\"Initializing\");\n progressBar.setEstTime(\"Time remaining: unknown\");\n progressBar.setProgress(-1);\n progressBar.setPosition();\n }\n }", "@Override\n public void start() { }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tprogressBar.setProgress(0);\n\t\t\tprogressBar.getProgressDrawable().setColorFilter(Color.RED, PorterDuff.Mode.SRC_IN);\n\t\t\tsuper.onPreExecute();\n\t\t}", "void setProgress(float progress);", "@Override\n\t protected void onProgressUpdate(Void... values) {\n\t }", "@Override\n public void showProgressSync() {\n }", "@Override\r\n protected void onProgressUpdate(Void... values) {\n super.onProgressUpdate(values);\r\n }", "@Override\r\n protected void onProgressUpdate(Integer... progress) {\n }", "@Override\n public void start() {}", "public abstract void setProgress (String description, int currentStep, int totalSteps);", "@Override\n protected void onPreExecute() {\n progressBar.setProgress(0);\n super.onPreExecute();\n }", "@Override\r\n\tprotected void onProgressUpdate(String... s) {\r\n\t\tactivity.addToGUI(s[0]);\r\n\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t progressDialog = new AutoTuningInitDialog(mChannelActivity, R.style.dialog);\n\t\t\tprogressDialog.show();\t\t\n\t\t\tsuper.onPreExecute();\n\t\t}", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tSystem.out.println(\"onStart\");\n\t\t\t\tif(listener!=null) listener.onMessage(\"onStart\");\n\t\t\t\tisRun = true;\n\t\t\t}", "void onProgress(long bytesTransferred);", "private void start(){\n\t\tMetricData metric = new MetricData();\n\t\tmetric.getName();\n\t\tmetric.getValue();\n\t\tmetric.setValue(2);\n\t}", "void startTracking();", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tLog.e(\"xx\", \"onstart\");\n\n\t\t\t}", "@Override\n public void onStart()\n {\n if (mProgressView != null)\n {\n mProgressView.setVisibility(View.VISIBLE);\n }\n }", "private void preRequest() {\n\t\tSystem.out.println(\"pre request, i am playing job\");\n\t}", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n public void start() {\n }", "@Override\n protected void onPreExecute() {\n mProgress = new ProgressDialog(ctx);\n mProgress.setMessage(\"Finding current location\");\n mProgress.show();\n super.onPreExecute();\n }", "@Override\n public void progress(FileStatus status) {\n progressReporter.progress();\n }", "private void startProgressBar() {\n\t b_buscar.setVisibility(View.GONE);\n\t // wi_progreso.setVisibility(View.VISIBLE);\n\t ly_progreso.setVisibility(View.VISIBLE);\n\t}", "@Override\n\tprotected void onPreExecute() {\n\t\tUtils.showProcessingDialog(_context);\n\t}", "public void startExecuting()\n {\n super.startExecuting();\n }", "public void start() {\n \tupdateHeader();\n }" ]
[ "0.8156041", "0.7351512", "0.7096684", "0.70728946", "0.70159423", "0.6986402", "0.69625723", "0.69223946", "0.68467253", "0.6804253", "0.6793854", "0.67673755", "0.6722857", "0.6722857", "0.6722857", "0.67041004", "0.66995835", "0.66866696", "0.66785043", "0.66135633", "0.6609071", "0.6588466", "0.658805", "0.65688574", "0.65650356", "0.6549737", "0.65495247", "0.6528723", "0.6515809", "0.6515809", "0.65140593", "0.65115833", "0.6470817", "0.6470817", "0.64663917", "0.6455959", "0.6442678", "0.6429708", "0.6422541", "0.6413548", "0.6413548", "0.64036405", "0.6395385", "0.6379523", "0.637748", "0.63624954", "0.63546485", "0.63539207", "0.6334909", "0.6324908", "0.6317293", "0.63061905", "0.6306083", "0.6303797", "0.62914747", "0.628216", "0.6268006", "0.6267797", "0.62657094", "0.6261341", "0.6261341", "0.6258763", "0.62512445", "0.62423384", "0.6240323", "0.6236625", "0.6234198", "0.62305945", "0.6224193", "0.62162507", "0.62159294", "0.6211297", "0.6204471", "0.6199262", "0.6192746", "0.6192505", "0.61871004", "0.61866534", "0.6181041", "0.61772037", "0.61750877", "0.6168635", "0.61663723", "0.6159289", "0.6150872", "0.61481047", "0.6142477", "0.613802", "0.6134924", "0.6134924", "0.6134924", "0.6134924", "0.6134924", "0.6134924", "0.6134924", "0.61344904", "0.6133318", "0.613266", "0.6129475", "0.6128005", "0.6118413" ]
0.0
-1
Puts all the Dates and corresponding profits into a TreeMap from a GameEntry List
public static TreeMap<String, Double> getAverageData(List<GameEntry> gameEntryList) { TreeMap<String, List<Double>> preprocessedDates = new TreeMap<>(); // before calculating average TreeMap<String, Double> processedDates = new TreeMap<>(); // after calculating average // Populate preprocessedDates, with keys being the dates, and values being the List of profits from the dates gameEntryList.forEach(gameEntry -> { String dateWithoutTime = gameEntry.getDate().toString().strip().split(REGEX_TO_SPLIT_DATE_AND_TIME, 2)[0]; if (!preprocessedDates.containsKey(dateWithoutTime)) { preprocessedDates.put(dateWithoutTime, new ArrayList<>()); } preprocessedDates.get(dateWithoutTime).add(gameEntry.getProfit()); }); // Using preprocessedDates, populate processedDates, with dates as the keys and average profits as the values preprocessedDates.forEach((date, listOfProfits) -> { Double averageProfit = listOfProfits.stream().mapToDouble(Double::doubleValue).average().orElse(0.00); processedDates.put(date, averageProfit); }); return processedDates; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void dateHashMapSorted() {\n\t\t//array used to store the key values of the unsorted HashMap\n\t\tLocalDate[] unsortedArr = new LocalDate[SORTINGDATES_SIZE];\n\t\n\t\t//adding all the keys to unsortedArr\n\t\tint i = 0;\n\t\tfor (LocalDate key : map.keySet()) {\n\t\t\t\tunsortedArr[i++] = key;\n\t\t\t}\n\t\t\n\t\tfor (int currIndex = 1; currIndex < unsortedArr.length; currIndex++) {\n\t\t\tLocalDate date = unsortedArr[currIndex];\n\t\t\tint k = currIndex - 1;\n\t\t\t\t\n\t\t\t/*\n\t\t\t * while the index for the array stays above 0 and the element in the previous\n\t\t\t * index is greater than the element at the currentIndex\n\t\t\t */\n\t\t\twhile ((k >= 0) && (unsortedArr[k].isAfter(date))) {\n\t\t\t\t//shifting the elements to the right\n\t\t\t\tunsortedArr[k + 1] = unsortedArr[k];\n\t\t\t\t//decrement x to move the other elements over\n\t\t\t\tk--;\t\n\t\t\t}\n\t\t\tunsortedArr[k + 1] = date;\n\t\t}\n\n\t\tfor (i = 0; i < unsortedArr.length; ++i) {\n\t\t\tSystem.out.println(unsortedArr[i]);\n\t\t}\n\t}", "private HashMap<String, ArrayList<Integer>> createTonyParkerTestMap() {\n HashMap<String, ArrayList<Integer>> knownYearSeasonActivityMap = new HashMap<>();\n knownYearSeasonActivityMap.put(\"2001-02\", new ArrayList<>(Arrays.asList(1, -1, 1)));\n knownYearSeasonActivityMap.put(\"2002-03\", new ArrayList<>(Arrays.asList(1, -1, 1)));\n knownYearSeasonActivityMap.put(\"2003-04\", new ArrayList<>(Arrays.asList(1, -1, 1)));\n knownYearSeasonActivityMap.put(\"2004-05\", new ArrayList<>(Arrays.asList(1, -1, 1)));\n knownYearSeasonActivityMap.put(\"2005-06\", new ArrayList<>(Arrays.asList(1, 1, 1)));\n knownYearSeasonActivityMap.put(\"2006-07\", new ArrayList<>(Arrays.asList(1, 1, 1)));\n knownYearSeasonActivityMap.put(\"2007-08\", new ArrayList<>(Arrays.asList(1, 1, 1)));\n knownYearSeasonActivityMap.put(\"2008-09\", new ArrayList<>(Arrays.asList(1, 1, 1)));\n knownYearSeasonActivityMap.put(\"2009-10\", new ArrayList<>(Arrays.asList(1, 1, 1)));\n knownYearSeasonActivityMap.put(\"2010-11\", new ArrayList<>(Arrays.asList(1, 1, 1)));\n knownYearSeasonActivityMap.put(\"2011-12\", new ArrayList<>(Arrays.asList(1, 1, 1)));\n knownYearSeasonActivityMap.put(\"2012-13\", new ArrayList<>(Arrays.asList(1, 1, 1)));\n knownYearSeasonActivityMap.put(\"2013-14\", new ArrayList<>(Arrays.asList(1, 1, 1)));\n knownYearSeasonActivityMap.put(\"2014-15\", new ArrayList<>(Arrays.asList(1, 1, 1)));\n knownYearSeasonActivityMap.put(\"2015-16\", new ArrayList<>(Arrays.asList(1, 1, 1)));\n knownYearSeasonActivityMap.put(\"2016-17\", new ArrayList<>(Arrays.asList(1, 1, 1)));\n knownYearSeasonActivityMap.put(\"2017-18\", new ArrayList<>(Arrays.asList(1, -1, 1)));\n knownYearSeasonActivityMap.put(\"2018-19\", new ArrayList<>(Arrays.asList(1, 1, -1)));\n return knownYearSeasonActivityMap;\n }", "@Override\r\n public Map<Integer, Map<Integer, Map<Integer, List<Schedule>>>> calendarOrderTasks() {\r\n List<Schedule> tasks = scheduleRepository.getAllScheduledTasks();\r\n Map<Integer, Map<Integer, Map<Integer, List<Schedule>>>> dateMap = new HashMap<>();\r\n \r\n for (Schedule task : tasks) {\r\n List<Schedule> daySchedule = new ArrayList<>();\r\n String[] timestamp = task.getTimestamp().split(\" \");\r\n String date = timestamp[0];\r\n String[] dateArr = date.split(\"-\");\r\n Integer year = Integer.valueOf(dateArr[0]);\r\n Integer month = Integer.valueOf(dateArr[1]);\r\n Integer day = Integer.valueOf(dateArr[2]);\r\n System.out.println(\"Date arr -> Year: \" + year + \" Month: \" + month + \" Day: \" + day);\r\n \r\n if(dateMap.get(year) == null){\r\n Map<Integer, Map<Integer, List<Schedule>>> monthMap = new HashMap<>();\r\n dateMap.put(year, monthMap);\r\n } \r\n if(dateMap.get(year).get(month) == null){\r\n Map<Integer, List<Schedule>> dayMap = new HashMap<>();\r\n dateMap.get(year).put(month, dayMap);\r\n } \r\n if(dateMap.get(year).get(month).get(day) == null){\r\n List<Schedule> dayTasks = new ArrayList<>();\r\n dateMap.get(year).get(month).put(day, dayTasks);\r\n }\r\n \r\n dateMap.get(year).get(month).get(day).add(task);\r\n }\r\n return dateMap;\r\n }", "public HashMap<String, Double> getFreezedListByDate(Timestamp dateCurrent){\r\n HashMap<String, Double> freezedMap = new HashMap<>();\r\n try (Connection connection = jdbcUtils.getConnection();){\r\n preparedStatement = connection.prepareStatement(GET_FOLLOWERS_ALL_SQL);\r\n resultSet = preparedStatement.executeQuery();\r\n while (resultSet.next()) {\r\n if (resultSet.getTimestamp(FOLLOWERS_DATE_FREEZ_COLUMN_NAME).before(dateCurrent)){\r\n if (freezedMap.containsKey(resultSet.getString(FOLLOWERS_PERIODICAL_COLUMN_NAME))){\r\n String keyPeriodical = resultSet.getString(FOLLOWERS_PERIODICAL_COLUMN_NAME);\r\n double existMoney = freezedMap.get(keyPeriodical);\r\n double putMoney = existMoney + resultSet.getDouble(FOLLOWERS_MOUNTHPRICE_COLUMN_NAME);\r\n freezedMap.put(keyPeriodical, putMoney);\r\n } else {\r\n freezedMap.put(resultSet.getString(FOLLOWERS_PERIODICAL_COLUMN_NAME)\r\n , resultSet.getDouble(FOLLOWERS_MOUNTHPRICE_COLUMN_NAME));\r\n } \r\n }\r\n }\r\n } catch (SQLException ex) {\r\n configLog.init();\r\n logger.info(LOG_SQL_EXCEPTION_MESSAGE + AdminDao.class.getName());\r\n Logger.getLogger(AdminDao.class.getName()).log(Level.SEVERE, null, ex);\r\n throw new RuntimeException();\r\n }\r\n return freezedMap;\r\n }", "private void extractDataFromOrders(List<Order> orders) {\n ArrayList<LocalDate> orderedListOfMapDays = new ArrayList<LocalDate>();\n HashMap<LocalDate, Integer> dateToCoffeeCaffeineMap = new HashMap<LocalDate, Integer>(), dateToTeaCaffeineMap = new HashMap<LocalDate, Integer>();\n HashMap<LocalDate, Double> dateToCoffeeExpenditureMap = new HashMap<LocalDate, Double>(), dateToTeaExpenditureMap = new HashMap<LocalDate, Double>();\n for (int i = 0; i < 8; i++) {\n LocalDate date = ONE_WEEK_AGO.plusDays(i);\n dateToCoffeeCaffeineMap.put(date, 0);\n dateToTeaCaffeineMap.put(date, 0);\n dateToCoffeeExpenditureMap.put(date, 0.0);\n dateToTeaExpenditureMap.put(date, 0.0);\n orderedListOfMapDays.add(date);\n }\n\n // loop through orders, comparing their days and adding values accordingly\n for (Order order : orders) {\n if (order == null) continue;\n // dates (in milliseconds) from orders are clocked to start of day and converted to dates\n LocalDateTime tempDateResetTime = order.getDate().toInstant()\n .atZone(ZoneId.systemDefault())\n .toLocalDate().atStartOfDay();\n LocalDate tempDate = tempDateResetTime.toLocalDate();\n Log.d(TAG, \"ORDER ON DAY: \" + tempDate);\n\n if (ONE_WEEK_AGO.isBefore(tempDate) || ONE_WEEK_AGO.isEqual(tempDate)) {\n // CAFFEINE\n // coffee caffeine\n int dailyCaffeineFromCoffee = 0;\n dailyCaffeineFromCoffee += (order.getTotalCaffeineFromCoffee(true) > 0 ? order.getTotalCaffeineFromCoffee(true) :\n order.getTotalCaffeineFromCoffee(false) > 0 ? order.getTotalCaffeineFromCoffee(false) : 0);\n dateToCoffeeCaffeineMap.put(tempDate, dateToCoffeeCaffeineMap.get(tempDate) + dailyCaffeineFromCoffee);\n // tea caffeine\n int dailyCaffeineFromTea = 0;\n dailyCaffeineFromTea += (order.getTotalCaffeineFromTea(true) > 0 ? order.getTotalCaffeineFromTea(true) :\n order.getTotalCaffeineFromTea(false) > 0 ? order.getTotalCaffeineFromTea(false) : 0);\n dateToTeaCaffeineMap.put(tempDate, dateToTeaCaffeineMap.get(tempDate) + dailyCaffeineFromTea);\n\n // EXPENDITURES\n // coffee cost\n double dailyExpenditureFromCoffee = 0.0;\n dailyExpenditureFromCoffee += (order.getTotalCostFromCoffee(true) > 0 ? order.getTotalCostFromCoffee(true) :\n order.getTotalCostFromCoffee(false) > 0 ? order.getTotalCostFromCoffee(false) : 0.0);\n dateToCoffeeExpenditureMap.put(tempDate, dateToCoffeeExpenditureMap.get(tempDate) + dailyExpenditureFromCoffee);\n // tea cost\n double dailyExpenditureFromTea = 0.0;\n dailyExpenditureFromTea += (order.getTotalCostFromTea(true) > 0 ? order.getTotalCostFromTea(true) :\n order.getTotalCostFromTea(false) > 0 ? order.getTotalCostFromTea(false) : 0.0);\n dateToTeaExpenditureMap.put(tempDate, dateToTeaExpenditureMap.get(tempDate) + dailyExpenditureFromTea);\n }\n }\n\n // CAFFEINE SERIES\n coffeeCaffeineSeries = new DateIntegerSeries(\"Coffee\");\n teaCaffeineSeries = new DateIntegerSeries(\"Tea\");\n // for formatting, add an empty value at FRONT of series\n coffeeCaffeineSeries.add(Date.from(ONE_WEEK_AGO.minusDays(1).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()).getTime(), 0);\n teaCaffeineSeries.add(Date.from(ONE_WEEK_AGO.minusDays(1).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()).getTime(), 0);\n for (int i = 0; i < orderedListOfMapDays.size(); i++) {\n LocalDate localDate = orderedListOfMapDays.get(i);\n Integer coffeeCaffeine = dateToCoffeeCaffeineMap.get(localDate);\n Integer teaCaffeine = dateToTeaCaffeineMap.get(localDate);\n\n Long date = Date.from(localDate.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()).getTime();\n\n coffeeCaffeineSeries.add(date, coffeeCaffeine);\n teaCaffeineSeries.add(date, teaCaffeine);\n }\n // for formatting, add an empty value to BACK of series\n coffeeCaffeineSeries.add(Date.from(ONE_WEEK_AGO.plusDays(8).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()).getTime(), 0);\n teaCaffeineSeries.add(Date.from(ONE_WEEK_AGO.plusDays(8).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()).getTime(), 0);\n\n // EXPENDITURE SERIES\n coffeeExpenditureSeries = new DateDoubleSeries(\"Coffee\");\n teaExpenditureSeries = new DateDoubleSeries(\"Tea\");\n // for formatting, add an empty value at FRONT of series\n coffeeExpenditureSeries.add(Date.from(ONE_WEEK_AGO.minusDays(1).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()).getTime(), 0.0);\n teaExpenditureSeries.add(Date.from(ONE_WEEK_AGO.minusDays(1).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()).getTime(), 0.0);\n for (int i = 0; i < orderedListOfMapDays.size(); i++) {\n LocalDate localDate = orderedListOfMapDays.get(i);\n Double coffeeExpenditure = dateToCoffeeExpenditureMap.get(localDate);\n Double teaExpenditure = dateToTeaExpenditureMap.get(localDate);\n\n Long date = Date.from(localDate.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()).getTime();\n\n coffeeExpenditureSeries.add(date, coffeeExpenditure);\n teaExpenditureSeries.add(date, teaExpenditure);\n }\n // for formatting, add an empty value to BACK of series\n coffeeExpenditureSeries.add(Date.from(ONE_WEEK_AGO.plusDays(8).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()).getTime(), 0.0);\n teaExpenditureSeries.add(Date.from(ONE_WEEK_AGO.plusDays(8).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()).getTime(), 0.0);\n }", "public void dateHashMapSortedDescending() {\n\t\t//array used to store the key values of the unsorted HashMap\n\t\tLocalDate[] unsortedArr = new LocalDate[SORTINGDATES_SIZE];\n\t\t\t\n\t\t//adding all the keys to unsortedArr\n\t\tint i = 0;\n\t\tfor (LocalDate key : map.keySet()) {\n\t\t\tunsortedArr[i++] = key;\n\t\t}\n\t\t\t\t\n\t\tfor (int currIndex = 1; currIndex < unsortedArr.length; currIndex++) {\n\t\t\tLocalDate date = unsortedArr[currIndex];\n\t\t\tint k = currIndex - 1;\n\t\t\t\t\t\t\n\t\t\t/*\n\t\t\t* while the index for the array stays above 0 and the element in the previous\n\t\t\t* index is greater than the element at the currentIndex\n\t\t\t*/\n\t\t\twhile ((k >= 0) && (unsortedArr[k].isBefore(date))) {\n\t\t\t\t//shifting the elements to the right\n\t\t\t\tunsortedArr[k + 1] = unsortedArr[k];\n\t\t\t\t//decrement x to move the other elements over\n\t\t\t\tk--;\t\n\t\t\t}\n\t\t\tunsortedArr[k + 1] = date;\n\t\t}\n\n\t\tfor (i = 0; i < unsortedArr.length; ++i) {\n\t\t\tSystem.out.println(unsortedArr[i]);\n\t\t}\n\t}", "private void fillMap(TreeMap<Double, String> userlist, TreeMap<Double, String> ret) \r\n \t{\t\t\t\r\n \t\tSortedSet<Double> sortedKeys = (SortedSet<Double>) userlist.keySet();\r\n \t\tDouble prozent = getProzent(Double.valueOf(sortedKeys.toArray()[sortedKeys.size() - 1].toString()));\r\n \t\tret.put(prozent, userlist.get(Double.valueOf(sortedKeys.toArray()[sortedKeys.size() - 1].toString())));\r\n \t\tuserlist.remove(Double.valueOf(sortedKeys.toArray()[sortedKeys.size() - 1].toString()));\r\n \t\t\r\n \t\tfor(int i = userlist.keySet().size() - 1; i >= 0; i--)\r\n \t\t{\t\r\n \t\t\tret.put(getProzent(Double.valueOf(sortedKeys.toArray()[i].toString())) + prozent, userlist.get(Double.valueOf(sortedKeys.toArray()[i].toString())));\r\n \t\t\tprozent += getProzent(Double.valueOf(sortedKeys.toArray()[i].toString()));\r\n \t\t\tuserlist.remove(Double.valueOf(sortedKeys.toArray()[sortedKeys.size() - 1].toString()));\r\n \t\t}\r\n \t}", "protected ListMap<Integer, CD4Details> makeResultsMap(List<Object> data) {\n\t\tListMap<Integer, CD4Details> dateListMap = new ListMap<Integer, CD4Details>();\n\t\tfor (Object o : data) {\n\t\t\tObject[] parts = (Object[]) o;\n\t\t\tif (parts.length == 3) {\n\t\t\t\tInteger pId = (Integer) parts[0];\n\t\t\t\tDate date = (Date) parts[1];\n\t\t\t\tDouble val = (Double) parts[2];\n\t\t\t\tif (pId != null && date != null) {\n\t\t\t\t\tCD4Details details = new CD4Details(val, date);\n\t\t\t\t\tdateListMap.putInList(pId, details);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn dateListMap;\n\t}", "private void generateMarkedDates() {\n this.markedDates = new HashMap<>();\n for (Task t : logic.getAddressBook().getTaskList()) {\n\n if (markedDates.containsKey(t.getStartDate().getDate())) {\n if (t.getPriority().getPriorityLevel() > markedDates.get(t.getStartDate().getDate())) {\n markedDates.put(t.getStartDate().getDate(), t.getPriority().getPriorityLevel());\n }\n } else {\n markedDates.put(t.getStartDate().getDate(), t.getPriority().getPriorityLevel());\n }\n\n if (markedDates.containsKey(t.getEndDate().getDate())) {\n if (t.getPriority().getPriorityLevel() > markedDates.get(t.getEndDate().getDate())) {\n markedDates.put(t.getEndDate().getDate(), t.getPriority().getPriorityLevel());\n }\n } else {\n markedDates.put(t.getEndDate().getDate(), t.getPriority().getPriorityLevel());\n }\n }\n }", "private void populateDateEntityMap(TradeEntity entity) {\r\n\t\tList<TradeEntity> entities = dateEntityMap.get(entity.getEffectiveSettlementDate());\r\n\r\n\t\tif (entities == null) {\r\n\t\t\tentities = new ArrayList<>();\r\n\t\t\tentities.add(entity);\r\n\t\t} else {\r\n\t\t\tentities.add(entity);\r\n\t\t}\r\n\t\tdateEntityMap.put(entity.getEffectiveSettlementDate(), entities);\r\n\t}", "private Map<String, Object> slouchMap(ArrayList<Date> times, ArrayList<Double> slouches) {\n Map<String, Object> map = new HashMap<>();\n map.put(USER_SLOUCHES, slouches);\n map.put(TIMES, slouches);\n return map;\n }", "@Test\n public void test10() {\n Map<Integer, Integer> map1 = new TreeMap<Integer, Integer>();\n cashRegister.addPennies(199);\n map1.put(1,199);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addDimes(2);\n map1.put(10,2);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addDimes(3);\n map1.put(10,5);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addFives(10);\n map1.put(500,10);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addNickels(4);\n map1.put(5,4);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addOnes(1);\n map1.put(100,1);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addQuarters(1);\n map1.put(25,1);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addTens(5);\n map1.put(1000,5);\n assertEquals(map1, cashRegister.getContents());\n }", "static void updateLists(UnsortedDate212List unsorted, TreeMap<Date212, Integer> sortedMap, String inputDate)\n {\n Date212 tentativeDateObj;\n try {\n tentativeDateObj = new Date212(inputDate);\n\n unsorted.add(tentativeDateObj);\n if(sortedMap.containsKey(tentativeDateObj)) {\n sortedMap.put(tentativeDateObj, sortedMap.get(tentativeDateObj) + 1);\n }\n else{\n sortedMap.put(tentativeDateObj,1);\n }\n } catch (Date212Exception e) {\n System.out.println(e.getMessage());\n }\n Project4.setUnsorted(unsorted);\n Project4.setSortedMap(sortedMap);\n\n }", "private TreeMap<Double,Double> fillTable(int columnIndex, int keyIndex, XSSFSheet sheet){\n\t\tIterator<Row> rowIterator = sheet.iterator();\n\t\t\n\t\trowIterator.next();//Ignore the column names. We actually know it.\n\t\tRow row = null;\n\t\tTreeMap<Double,Double> treeMap = new TreeMap<Double,Double>();\n\t\t\n\t\twhile(rowIterator.hasNext()){\n\t\t\trow = rowIterator.next();\n\t\t\t//System.out.println(i++);\n\t\t\tif(row.getCell(CELLDAYTYPE).getStringCellValue().startsWith(\"H\")\n\t\t\t\t\t&&row.getCell(CELLHOUR).getNumericCellValue()==800){\n\t\t\t\ttreeMap.put((double)(Math.round(row.getCell(columnIndex).getNumericCellValue()*100)/100),\n\t\t\t\t\t\trow.getCell(keyIndex).getNumericCellValue());\n\t\t\t}\n\t\t}\n\t\treturn treeMap;\n\t}", "public static void main(String[] args) throws ParseException {\n HashMap<Date, String> hmap = new HashMap<Date, String>();\n /* hmap.put(5, \"A\");\n hmap.put(11, \"C\");\n hmap.put(4, \"Z\");\n hmap.put(662, \"Y\");\n hmap.put(9, \"P\");\n hmap.put(661, \"Q\");\n hmap.put(0, \"R\");*/\n \n Date date = new Date();\n \n SimpleDateFormat ft = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\");\n\t//format.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n\tString dat = \"2017-06-05T08:07:34.000Z\";\n\tString dats = \"2017-06-05T21:07:34.012Z\";\n\tDate datesss = ft.parse(dat);\n\tDate da = ft.parse(dats);\n\tSystem.out.println(\"ok fine :\"+ft.format(datesss));\n hmap.put(datesss,\"u\");\n hmap.put(da,\"l\");\n\n System.out.println(\"Before Sorting:\");\n Set set = hmap.entrySet();\n Iterator iterator = set.iterator();\n while(iterator.hasNext()) {\n Map.Entry me = (Map.Entry)iterator.next();\n System.out.print(me.getKey() + \": \");\n System.out.println(me.getValue());\n }\n Map<Date, String> map = new TreeMap<Date, String>(hmap); \n String ab = map.get(map.keySet().toArray()[0]);\n\n/*Date firstKey = (Date) map.keySet().toArray()[0];\nString valueForFirstKey = map.get(firstKey);\n System.out.println(firstKey);\n System.out.println(valueForFirstKey);*/\n System.out.println(\"After Sorting:\");\n Set set2 = map.entrySet();\n Iterator iterator2 = set2.iterator();\n while(iterator2.hasNext()) {\n Map.Entry me2 = (Map.Entry)iterator2.next();\n System.out.print(me2.getKey() + \": \");\n System.out.println(me2.getValue());\n }\n System.out.println(\"#######################################################\");\n /* Map<Date, String> mat = new TreeMap<Date, String>(new Comparator<Date>() {\n public int compare(Date d1, Date d2) {\n return d1.after(d2) ? 1 : -1;\n }\n });*/\n \n Map<Long, String> mat = new TreeMap<Long, String>();\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\");\n Date d1 = dateFormat.parse(\"2017-06-05T08:07:34.000Z\");\n Date d2 = dateFormat.parse(\"2017-06-05T21:07:34.000Z\");\n Date d3 = dateFormat.parse(\"2021-04-12T21:10:25.000Z\");\n \n// String firstKey = (String) mat.keySet().toArray()[0];\n//\tString valueForFirstKey = (String) mat.get(firstKey);\n\tlong epocha = new java.text.SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\").parse(\"2017-06-05T08:07:34.000Z\").getTime() / 1000;\n\tlong epochb = new java.text.SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\").parse(\"2008-06-05T21:07:34.000Z\").getTime() / 1000;\n\tlong epochc = new java.text.SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\").parse(\"2015-01-07T20:57:40.000Z\").getTime() / 1000;\n\tlong epochd = new java.text.SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\").parse(\"2015-01-30T00:32:20.000Z\").getTime() / 1000;\n\t\n\tmat.put(epocha, \"s2\");\n mat.put(epochb, \"s1\");\n mat.put(epochc, \"s3\");\n mat.put(epochd,\"s4\");\n\t\n\tSystem.out.println(\"epoch:\"+epocha);\n\tSystem.out.println(\"epocha:\"+epochb);\n\tSystem.out.println(\"epochc:\"+epochc);\n\tSystem.out.println(\"epochd:\"+epochd);\n//\tSystem.out.println(firstKey);\n//\tSystem.out.println(valueForFirstKey);\n \n System.out.println(mat );\n \n \n \n \n /* System.out.println(map.size());\n int firstKey1 = (Integer) map.keySet().toArray()[6];\n System.out.println(\"firstKey1:\"+firstKey1);\n\tString valueForFirstKey2 = (String) map.get(firstKey1);\n\tSystem.out.println(\"valueForFirstKey2 :\"+valueForFirstKey2);*/\n}", "public static HashMap<Integer, ArrayList<Ice>> sortedDataMap(ArrayList<Ice> iceData) throws IOException{\r\n\t\tHashMap<Integer,ArrayList<Ice>> iceMap = new HashMap<>();//creates new empty hashmap \r\n\r\n\t\t//loops over the entire arraylist\r\n\t\tfor (Ice iceDatapoint : iceData) {\r\n\t\t\tint month = iceDatapoint.getMonth();//extracts the month from the Ice object datapoint\r\n\t\t\tArrayList<Ice> thisIceList = iceMap.get(month);\t//gets all the values of a specific month in the hashmap\r\n\t\t\tif(thisIceList == null) {//checks if this arraylist is null\r\n\t\t\t\ticeMap.put(month,new ArrayList<Ice>());//creates a new entry in the hashmap\r\n\t\t\t}\r\n\t\t\ticeMap.get(month).add(iceDatapoint);//adds the Ice datapoint to its corresponding month\r\n\t\t}\r\n\r\n\t\treturn iceMap;//returns a hashmap containing the sorted data\r\n\t}", "HashMap<String, Double> getPortfolioData(String date);", "@SuppressWarnings(\"unchecked\")\n\t@External(readonly = true)\n\tpublic Map<String, String> get_daily_payouts(BigInteger day) {\n\t\t/***\n Get daily payouts for a game in a particular day\n :param day: Index of the day for which payouts is to be returned\n :type day: int\n :return: Payouts of the game in that particular day\n :rtype: int\n ***/\n\t\tif (day.compareTo(BigInteger.ONE)== -1) {\n\t\t\tBigInteger now = BigInteger.valueOf(Context.getBlockTimestamp());\t\t\n\t\t\tday = day.add(now.divide(U_SECONDS_DAY));\n\t\t}\n\t\t\n\n\t\tMap.Entry<String, String>[] payouts = new Map.Entry[this.get_approved_games().size()]; \n\n\t\tfor (int i=0; i<this.get_approved_games().size(); i++) {\n\t\t\tAddress game = this.get_approved_games().get(i);\n\t\t\tpayouts[i] = Map.entry(game.toString(), String.valueOf(this.payouts.at(day).get(game)));\n\t\t}\n\t\treturn Map.ofEntries(payouts);\n\t}", "private TreeMap<String, double[]> readFlowInfo(XSSFSheet sheet) {\n\t\tIterator<Row> rowIterator = sheet.iterator();\n\t\t\n\t\trowIterator.next();//Ignore the column names. We actually know it.\n\t\tRow row = null;\n\t\tTreeMap<String, double[]> treeMap = new TreeMap<String, double[]>();\n\n\t\twhile(rowIterator.hasNext()){\n\t\t\trow = rowIterator.next();\n\t\t\t//The composed key: [newID+type.firstLetter+hour]\n\t\t\tString key =Math.round(row.getCell(CELLMATCHKEY).getNumericCellValue())+\n\t\t\t\t\trow.getCell(CELLDAYTYPE).getStringCellValue().substring(0, 1)+\n\t\t\t\t\tMath.round(row.getCell(CELLHOUR).getNumericCellValue());\n\t\t\t//System.out.println(key);\n\t\t\tdouble[] values = new double[16];\n\t\t\t\n\t\t\tfor(int i=0;i<16;i++){\n\t\t\t\tvalues[i]=row.getCell(i+6).getNumericCellValue();\n\t\t\t}\n\t\t\t\n\t\t\ttreeMap.put(key,values);\n\t\t}\n\t\treturn treeMap;\n\t}", "private Map devCardToMap() {\n\t\tMap<String, Integer> devCardMap = new HashMap<String, Integer>();\n\t\tint yearOfPlenty = 0, soldier = 0, monopoly = 0, monument = 0; \n\t\tint roadBuilding = 0;\n\t\tfor(DevCard devCard : this.devCards) {\n\t\t\tswitch(devCard.getClass().getSimpleName()) {\n\t\t\tcase \"YearOfPlenty\":\n\t\t\t\tyearOfPlenty++;\n\t\t\t\tbreak;\n\t\t\tcase \"Knight\":\n\t\t\t\tsoldier++;\n\t\t\t\tbreak;\n\t\t\tcase \"Monopoly\":\n\t\t\t\tmonopoly++;\n\t\t\t\tbreak;\n\t\t\tcase \"Monument\":\n\t\t\t\tmonument++;\n\t\t\t\tbreak;\n\t\t\tcase \"RoadBuilding\":\n\t\t\t\troadBuilding++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tdevCardMap.put(\"yearOfPlenty\", yearOfPlenty);\n\t\tdevCardMap.put(\"soldier\", soldier);\n\t\tdevCardMap.put(\"monopoly\", monopoly);\n\t\tdevCardMap.put(\"monument\", monument);\n\t\tdevCardMap.put(\"roadBuilding\", roadBuilding);\n\t\treturn devCardMap;\n\t}", "public Map<SalePurchase, Payment> viewCreditEntries(String date){\n\t\tMap<SalePurchase, Payment> map = new HashMap<>();\n\t\tList<SalePurchase> spList = new ArrayList<>(salePurchaseEntries.values());\n\t\tList<Payment> paymentList = new ArrayList<>(payments.values());\n\t\tfor(SalePurchase sp : spList){\n\t\t\tif(sp.getDate().equals(date) && sp.getMode().equals(\"Sale\")){\n\t\t\t\tfor(Payment p : paymentList){\n\t\t\t\t\tif(p.getSPId() == sp.getSPId()){\n\t\t\t\t\t\tmap.put(sp, p);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn map;\n\t}", "@SuppressWarnings(\"unchecked\")\n\t@External(readonly = true)\n\tpublic Map<String, String> get_todays_games_excess() {\n\t\t/***\n Returns the todays excess of the game. The excess is reset to 0 if it\n remains positive at the end of the day.\n :return: Returns the excess of games at current time\n ***/\n\t\tMap.Entry<String, String>[] games_excess = new Map.Entry[this.get_approved_games().size()];\n\n\t\tfor (int i= 0; i<this.get_approved_games().size(); i++ ) {\n\t\t\tAddress game = this.get_approved_games().get(i);\n\t\t\tgames_excess[i] = Map.entry(game.toString(), String.valueOf(this.todays_games_excess.get(game)));\n\t\t}\n\t\t\n\t\treturn Map.ofEntries(games_excess);\n\t}", "@Test\n void BasicTestCase_largeNoOfEntries() {\n Solution solObj = new Solution();\n\n\n //Input Dictionary has year as 2100 and more entries\n Map<String, Integer> input1 = Stream.of(new Object[][]{\n {\"2100-02-01\", 1}, {\"2100-02-02\", 2}, {\"2100-02-03\", 3}, {\"2100-02-04\", 10}, {\"2100-02-05\", 11}, {\"2100-02-06\", 12}, {\"2100-02-07\", 13}, {\"2100-02-08\", 7}, {\"2100-02-09\", 8}, {\"2100-02-10\", 9}, {\"2100-02-11\", 10}, {\"2100-02-12\", 11}, {\"2100-02-13\", 12}, {\"2100-02-14\", 13},\n {\"2100-02-15\", 7}, {\"2100-02-16\", 8}, {\"2100-02-17\", 9}, {\"2100-02-18\", 10}, {\"2100-02-19\", 11}, {\"2100-02-20\", 12}, {\"2100-02-21\", 13}, {\"2100-02-22\", 7}, {\"2100-02-23\", 8}, {\"2100-02-24\", 9}, {\"2100-02-25\", 10}, {\"2100-02-26\", 11}, {\"2100-02-27\", 12}, {\"2100-02-28\", 13}\n }).collect(Collectors.toMap(data -> (String) data[0], data -> (Integer) data[1]));\n //output\n Map<String, Integer> expected1 = Stream.of(new Object[][]{\n {\"Mon\", 22}, {\"Tue\", 26}, {\"Wed\", 30}, {\"Thu\", 40}, {\"Fri\", 44}, {\"Sat\", 48}, {\"Sun\", 52}\n }).collect(Collectors.toMap(data -> (String) data[0], data -> (Integer) data[1]));\n\n\n LinkedHashMap<String, Integer> result = solObj.dateToDay(input1);\n assertEquals(expected1, result);\n\n }", "private void fillInList(int roundCount){\r\n\r\n\t\t//Displays all of the stats to the screen by using a list of hash maps\r\n\t\tList<HashMap<String, String>> fillMaps = null;\r\n\t\t\r\n\t\tString[] from = new String[] {\"col_1\", \"col_2\", \"col_3\"};\r\n\t\tint[] to = new int[] {R.id.statisticsitem1, R.id.statisticsitem2, R.id.statisticsitem3};\r\n\t\t\r\n\t\tfillMaps = new ArrayList<HashMap<String, String>>();\r\n\t\t\r\n\t\tHashMap<String, String> map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Overall\");\r\n map.put(\"col_2\", \"Average\");\r\n map.put(\"col_3\", \"+/-\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Total Score\");\r\n map.put(\"col_2\", \"\"+df.format(averageScore));\r\n map.put(\"col_3\", averageScore == 0 ? \"-\" : \"\" + df.format(averagePlusMinus));\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Front 9\");\r\n map.put(\"col_2\", \"\"+df.format(averageFront9Score));\r\n map.put(\"col_3\", averageFront9Score == 0 ? \"-\" : \"\" + df.format(averageFront9PlusMinus));\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Back 9\");\r\n map.put(\"col_2\", \"\"+df.format(averageBack9Score));\r\n map.put(\"col_3\", averageBack9Score == 0 ? \"-\" : \"\" + df.format(averageBack9PlusMinus));\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Score Per Hole\");\r\n map.put(\"col_2\", \"\"+df.format(averageHoleScore));\r\n map.put(\"col_3\", averageHoleScore == 0 ? \"-\" : \"\" + df.format(averageHolePlusMinus));\r\n fillMaps.add(map);\r\n\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Hole Stats\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", \"\");\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Fairways\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfHoles == 0 ? \"-\" : \"\" + df.format(fairways) + \"%\");\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"GIR\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfHoles == 0 ? \"-\" : \"\" + df.format(girs) + \"%\");\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Putts / Hole\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfHoles == 0 ? \"-\" : \"\" + df.format(putts));\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Chips / Hole\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfHoles == 0 ? \"-\" : \"\" + df.format(chips));\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Penalties / Round\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfHoles == 0 ? \"-\" : \"\" + df.format(penalties));\r\n fillMaps.add(map);\r\n\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Scoring Breakdown\");\r\n map.put(\"col_2\", \"Total\");\r\n map.put(\"col_3\", \"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Albatross\");\r\n map.put(\"col_2\", \"\"+df.format(albatrossCount));\r\n map.put(\"col_3\", albatrossCount == 0 ? \"-\" : \"\" + df.format(albatrossCount / numberOfHoles * 100) + \"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Eagle\");\r\n map.put(\"col_2\", \"\"+df.format(eagleCount));\r\n map.put(\"col_3\", eagleCount == 0 ? \"-\" : \"\" + df.format(eagleCount / numberOfHoles * 100) + \"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Birdie\");\r\n map.put(\"col_2\", \"\"+df.format(birdieCount));\r\n map.put(\"col_3\", birdieCount == 0 ? \"-\" : \"\" + df.format(birdieCount / numberOfHoles * 100) + \"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Par\");\r\n map.put(\"col_2\", \"\"+df.format(parCount));\r\n map.put(\"col_3\", parCount == 0 ? \"-\" : \"\" + df.format(parCount / numberOfHoles * 100) + \"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Bogey\");\r\n map.put(\"col_2\", \"\"+df.format(bogeyCount));\r\n map.put(\"col_3\", bogeyCount == 0 ? \"-\" : \"\" + df.format(bogeyCount / numberOfHoles * 100) + \"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Double\");\r\n map.put(\"col_2\", \"\"+df.format(doubleBogeyCount));\r\n map.put(\"col_3\", doubleBogeyCount == 0 ? \"-\" : \"\" + df.format(doubleBogeyCount / numberOfHoles * 100) + \"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Triple\");\r\n map.put(\"col_2\", \"\"+df.format(tripleBogeyCount));\r\n map.put(\"col_3\", tripleBogeyCount == 0 ? \"-\" : \"\" + df.format(tripleBogeyCount / numberOfHoles * 100) + \"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Quadruple or Worse\");\r\n map.put(\"col_2\", \"\"+df.format(quadBogeyPlusCount));\r\n map.put(\"col_3\", quadBogeyPlusCount == 0 ? \"-\" : \"\" + df.format(quadBogeyPlusCount / numberOfHoles * 100) + \"%\");\r\n fillMaps.add(map);\r\n \r\n\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Par 3\");\r\n map.put(\"col_2\", \"Total\");\r\n map.put(\"col_3\", \"%\");\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"GIR\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar3Holes == 0 ? \"-\" : \"\" + df.format(par3Girs) + \"%\");\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Putts / Hole\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar3Holes == 0 ? \"-\" : \"\" + df.format(par3Putts) );\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Chips / Hole\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar3Holes == 0 ? \"-\" : \"\" + df.format(par3Chips) );\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Penalties / Hole\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar3Holes == 0 ? \"-\" : \"\" + df.format(par3Penalties) );\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Hole In One\");\r\n map.put(\"col_2\", \"\"+df.format(par3EagleCount));\r\n if (par3EagleCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par3EagleCount/numberOfPar3Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Birdie\");\r\n map.put(\"col_2\", \"\"+df.format(par3BirdieCount));\r\n if (par3BirdieCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par3BirdieCount/numberOfPar3Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Par\");\r\n map.put(\"col_2\", \"\"+df.format(par3ParCount));\r\n if (par3ParCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par3ParCount/numberOfPar3Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Bogey\");\r\n map.put(\"col_2\", \"\"+df.format(par3BogeyCount));\r\n if (par3BogeyCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par3BogeyCount/numberOfPar3Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Double\");\r\n map.put(\"col_2\", \"\"+df.format(par3DoubleBogeyCount));\r\n if (par3DoubleBogeyCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par3DoubleBogeyCount/numberOfPar3Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Triple\");\r\n map.put(\"col_2\", \"\"+df.format(par3TripleBogeyCount));\r\n if (par3TripleBogeyCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par3TripleBogeyCount/numberOfPar3Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Quadruple or Worse\");\r\n map.put(\"col_2\", \"\"+df.format(par3QuadBogeyPlusCount));\r\n if (par3QuadBogeyPlusCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par3QuadBogeyPlusCount/numberOfPar3Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n\r\n\r\n\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Par 4\");\r\n map.put(\"col_2\", \"Total\");\r\n map.put(\"col_3\", \"%\");\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Fairways\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar4Holes == 0 ? \"-\" : \"\" + df.format(par4Fairways) + \"%\");\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"GIR\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar4Holes == 0 ? \"-\" : \"\" + df.format(par4Girs) + \"%\");\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Putts / Hole\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar4Holes == 0 ? \"-\" : \"\" + df.format(par4Putts) );\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Chips / Hole\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar4Holes == 0 ? \"-\" : \"\" + df.format(par4Chips) );\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Penalties / Hole\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar4Holes == 0 ? \"-\" : \"\" + df.format(par4Penalties) );\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Hole In One\");\r\n map.put(\"col_2\", \"\"+df.format(par4AlbatrossCount));\r\n if (par4AlbatrossCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par4AlbatrossCount/numberOfPar4Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Eagle\");\r\n map.put(\"col_2\", \"\"+df.format(par4EagleCount));\r\n if (par4EagleCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par4EagleCount/numberOfPar4Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Birdie\");\r\n map.put(\"col_2\", \"\"+df.format(par4BirdieCount));\r\n if (par4BirdieCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par4BirdieCount/numberOfPar4Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Par\");\r\n map.put(\"col_2\", \"\"+df.format(par4ParCount));\r\n if (par4ParCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par4ParCount/numberOfPar4Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Bogey\");\r\n map.put(\"col_2\", \"\"+df.format(par4BogeyCount));\r\n if (par4BogeyCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par4BogeyCount/numberOfPar4Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Double\");\r\n map.put(\"col_2\", \"\"+df.format(par4DoubleBogeyCount));\r\n if (par4DoubleBogeyCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par4DoubleBogeyCount/numberOfPar4Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Triple\");\r\n map.put(\"col_2\", \"\"+df.format(par4TripleBogeyCount));\r\n if (par4TripleBogeyCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par4TripleBogeyCount/numberOfPar4Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Quadruple or Worse\");\r\n map.put(\"col_2\", \"\"+df.format(par4QuadBogeyPlusCount));\r\n if (par4QuadBogeyPlusCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par4QuadBogeyPlusCount/numberOfPar4Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Par 5\");\r\n map.put(\"col_2\", \"Total\");\r\n map.put(\"col_3\", \"%\");\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Fairways\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar5Holes == 0 ? \"-\" : \"\" + df.format(par5Fairways) + \"%\");\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"GIR\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar5Holes == 0 ? \"-\" : \"\" + df.format(par5Girs) + \"%\");\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Putts / Hole\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar5Holes == 0 ? \"-\" : \"\" + df.format(par5Putts) );\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Chips / Hole\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar5Holes == 0 ? \"-\" : \"\" + df.format(par5Chips) );\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Penalties / Hole\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar5Holes == 0 ? \"-\" : \"\" + df.format(par5Penalties) );\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Albatross\");\r\n map.put(\"col_2\", \"\"+df.format(par5AlbatrossCount));\r\n if (par5AlbatrossCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par5AlbatrossCount/numberOfPar5Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Eagle\");\r\n map.put(\"col_2\", \"\"+df.format(par5EagleCount));\r\n if (par5EagleCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par5EagleCount/numberOfPar5Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Birdie\");\r\n map.put(\"col_2\", \"\"+df.format(par5BirdieCount));\r\n if (par5BirdieCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par5BirdieCount/numberOfPar5Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Par\");\r\n map.put(\"col_2\", \"\"+df.format(par5ParCount));\r\n if (par5ParCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par5ParCount/numberOfPar5Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Bogey\");\r\n map.put(\"col_2\", \"\"+df.format(par5BogeyCount));\r\n if (par5BogeyCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par5BogeyCount/numberOfPar5Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Double\");\r\n map.put(\"col_2\", \"\"+df.format(par5DoubleBogeyCount));\r\n if (par5DoubleBogeyCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par5DoubleBogeyCount/numberOfPar5Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Triple\");\r\n map.put(\"col_2\", \"\"+df.format(par5TripleBogeyCount));\r\n if (par5TripleBogeyCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par5TripleBogeyCount/numberOfPar5Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Quadruple or Worse\");\r\n map.put(\"col_2\", \"\"+df.format(par5QuadBogeyPlusCount));\r\n if (par5QuadBogeyPlusCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par5QuadBogeyPlusCount/numberOfPar5Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Club\");\r\n map.put(\"col_2\", \"Avg. Dist.\");\r\n map.put(\"col_3\", \"Accuracy\");\r\n fillMaps.add(map);\r\n\r\n for(Club club : clubs) {\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"\" + club.getClub());\r\n map.put(\"col_2\", club.getAvgDist() <= 0 ? \"-\" : \"\" + df.format(club.getAvgDist()));\r\n if (club.getAccuracy() <= 0 && club.getAvgDist() <= 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\" + df.format(club.getAccuracy()) + \"%\");\r\n fillMaps.add(map);\r\n }\r\n\r\n\r\n\r\n\r\n ListView lv = getListView();\t\r\n \r\n //Sets a fading design as the divider line\r\n int[] colors = {0, 0xff347c12, 0};\r\n lv.setDivider(new GradientDrawable(Orientation.RIGHT_LEFT, colors));\r\n lv.setDividerHeight(1);\r\n \r\n //Displays the list using a special adapter\r\n\t\tSpecialAdapter adapter = new SpecialAdapter(Statistics.this, fillMaps, R.layout.statisticsgrid, from, to);\r\n\t\tlv.setAdapter(adapter);\r\n\t}", "public HashMap<String, String> selectMap(String date, String route) throws ParseException {\n\n String dt = String.valueOf((java.time.LocalDate.now())); //dt is the current date value\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n Calendar c = Calendar.getInstance();\n c.setTime(sdf.parse(dt)); //c is the formatted date value\n String dates[] = new String[5]; //Array which holds 5 consecutive future dates\n\n for(int i=0;i<5;i++) {\n c.add(Calendar.DATE, 1);\n dt = sdf.format(c.getTime());\n dates[i]=dt;\n\n }\n\n HashMap x = new HashMap<>();\n try {\n if (route.equals(\"Colombo to Badulla\")) {\n if (date.equals(String.valueOf(dates[0]))) {\n x = (HashMap) reservedseats1;\n } else if (date.equals(String.valueOf(dates[1]))) {\n x = (HashMap) reservedseats2;\n } else if (date.equals(String.valueOf(dates[2]))) {\n x = (HashMap) reservedseats3;\n } else if (date.equals(String.valueOf(dates[3]))) {\n x = (HashMap) reservedseats4;\n }else {\n x = (HashMap) reservedseats5;\n }\n\n } else if (route.equals(\"Badulla to Colombo\")) {\n if (date.equals(String.valueOf(dates[0]))) {\n x = (HashMap) reservedseats6;\n } else if (date.equals(String.valueOf(dates[1]))) {\n x = (HashMap) reservedseats7;\n } else if (date.equals(String.valueOf(dates[2]))){\n x = (HashMap) reservedseats8;\n } else if (date.equals(String.valueOf(dates[3]))) {\n x = (HashMap) reservedseats9;\n } else {\n x = (HashMap) reservedseats10;\n }\n } else System.out.println();\n\n } catch (Exception e) {\n }\n return x; //Returns hashmap to SeatReservation Class\n }", "private void erstelleListenMap(){\n farbenMap = new TreeMap<>();\n symbolMap = new TreeMap<>();\n\n for(Symbol symbol:Symbol.values()){\n\n switch (symbol) // sortiert ihn in die entsprechende Liste ein\n {\n case ka_blau:\n farbenMap.put(symbol,blaue);\n symbolMap.put(symbol,karos);\n break;\n case ks_blau:\n farbenMap.put(symbol,blaue);\n symbolMap.put(symbol,kreise);\n break;\n case kr_blau:\n farbenMap.put(symbol,blaue);\n symbolMap.put(symbol,kreuze);\n break;\n case st_blau:\n farbenMap.put(symbol,blaue);\n symbolMap.put(symbol,sterne);\n break;\n case qu_blau:\n farbenMap.put(symbol,blaue);\n symbolMap.put(symbol,quadrate);\n break;\n case kb_blau:\n farbenMap.put(symbol,blaue);\n symbolMap.put(symbol,kleeblaetter);\n break;\n\n case ka_gelb:\n farbenMap.put(symbol,gelbe);\n symbolMap.put(symbol,karos);\n break;\n case ks_gelb:\n farbenMap.put(symbol,gelbe);\n symbolMap.put(symbol,kreise);\n break;\n case kr_gelb:\n farbenMap.put(symbol,gelbe);\n symbolMap.put(symbol,kreuze);\n break;\n case st_gelb:\n farbenMap.put(symbol,gelbe);\n symbolMap.put(symbol,sterne);\n break;\n case qu_gelb:\n farbenMap.put(symbol,gelbe);\n symbolMap.put(symbol,quadrate);\n break;\n case kb_gelb:\n farbenMap.put(symbol,gelbe);\n symbolMap.put(symbol,kleeblaetter);\n break;\n case ka_gruen:\n farbenMap.put(symbol,gruene);\n symbolMap.put(symbol,karos);\n break;\n case ks_gruen:\n farbenMap.put(symbol,gruene);\n symbolMap.put(symbol,kreise);\n break;\n case kr_gruen:\n farbenMap.put(symbol,gruene);\n symbolMap.put(symbol,kreuze);\n break;\n case st_gruen:\n farbenMap.put(symbol,gruene);\n symbolMap.put(symbol,sterne);\n break;\n case qu_gruen:\n farbenMap.put(symbol,gruene);\n symbolMap.put(symbol,quadrate);\n break;\n case kb_gruen:\n farbenMap.put(symbol,gruene);\n symbolMap.put(symbol,kleeblaetter);\n break;\n case ka_rot:\n farbenMap.put(symbol,rote);\n symbolMap.put(symbol,karos);\n break;\n case ks_rot:\n farbenMap.put(symbol,rote);\n symbolMap.put(symbol,kreise);\n break;\n case kr_rot:\n farbenMap.put(symbol,rote);\n symbolMap.put(symbol,kreuze);\n break;\n case st_rot:\n farbenMap.put(symbol,rote);\n symbolMap.put(symbol,sterne);\n break;\n case qu_rot:\n farbenMap.put(symbol,rote);\n symbolMap.put(symbol,quadrate);\n break;\n case kb_rot:\n farbenMap.put(symbol,rote);\n symbolMap.put(symbol,kleeblaetter);\n break;\n case ka_violett:\n farbenMap.put(symbol,violette);\n symbolMap.put(symbol,karos);\n break;\n case ks_violett:\n farbenMap.put(symbol,violette);\n symbolMap.put(symbol,kreise);\n break;\n case kr_violett:\n farbenMap.put(symbol,violette);\n symbolMap.put(symbol,kreuze);\n break;\n case st_violett:\n farbenMap.put(symbol,violette);\n symbolMap.put(symbol,sterne);\n break;\n case qu_violett:\n farbenMap.put(symbol,violette);\n symbolMap.put(symbol,quadrate);\n break;\n case kb_violett:\n farbenMap.put(symbol,violette);\n symbolMap.put(symbol,kleeblaetter);\n break;\n case ka_orange:\n farbenMap.put(symbol,orangene);\n symbolMap.put(symbol,karos);\n break;\n case ks_orange:\n farbenMap.put(symbol,orangene);\n symbolMap.put(symbol,kreise);\n break;\n case kr_orange:\n farbenMap.put(symbol,orangene);\n symbolMap.put(symbol,kreuze);\n break;\n case st_orange:\n farbenMap.put(symbol,orangene);\n symbolMap.put(symbol,sterne);\n break;\n case qu_orange:\n farbenMap.put(symbol,orangene);\n symbolMap.put(symbol,quadrate);\n break;\n case kb_orange:\n farbenMap.put(symbol,orangene);\n symbolMap.put(symbol,kleeblaetter);\n break;\n }\n\n }\n }", "@SuppressWarnings(\"unchecked\")\n\t@External(readonly = true)\n\tpublic Map<String, String> get_daily_wagers(BigInteger day) {\n\t\tif (day.compareTo(BigInteger.ONE) == -1) {\n\t\t\tBigInteger now = BigInteger.valueOf(Context.getBlockTimestamp());\t\t\n\t\t\tday.add(now.divide(U_SECONDS_DAY));\t\t\t\n\t\t}\n\t\t\n\t\t Map.Entry<String, String>[] wagers = new Map.Entry[this.get_approved_games().size()];\n\t\t \n\t\tfor (int i= 0; i< this.get_approved_games().size(); i++ ) {\n\t\t\tAddress game = this.get_approved_games().get(i);\n\t\t\twagers[i] = Map.entry(game.toString(), String.valueOf(this.wagers.at(day).get(game)) );\n\t\t}\n\t\treturn Map.ofEntries(wagers);\n\t}", "public void adjustSettlementDatesAndPopulateMap() {\r\n\t\tfor (TradeEntity ee : entityArrayList) {\r\n\t\t\tif (!isWorkingDay(ee.getCurrency(), ee.getSettlementDate().getDayOfWeek())) {\r\n\t\t\t\tee.setEffectiveSettlementDate(getNextWorkingDay(ee));\r\n\t\t\t} else {\r\n\t\t\t\tee.setEffectiveSettlementDate(ee.getSettlementDate());\r\n\t\t\t}\r\n\t\t\tpopulateDateEntityMap(ee);\r\n\t\t}\r\n\r\n\t}", "public static Map<Integer, DataDto> createHistoryDataByGrowDay(final Map<Integer, String> history,\n final DataDto data) {\n Map<Integer, DataDto> histDataByGrowDay = new TreeMap<Integer, DataDto>();\n Set<Entry<Integer, String>> entries = history.entrySet();\n for (Entry entry : entries) {\n DataDto dataFromHist = getDataFromHistory(data, (String) entry.getValue());\n if (dataFromHist != null) {\n histDataByGrowDay.put((Integer) entry.getKey(), dataFromHist);\n if (entry.getKey() == null) {\n System.out.println(entry);\n }\n }\n }\n return histDataByGrowDay;\n }", "public static void main(String[] args) {\n Map<String, Pessoa> timeVolei = new TreeMap<>();\n\n Pessoa p1 = new Pessoa(\"João\", 32);\n Pessoa p2 = new Pessoa(\"Maria\", 23);\n Pessoa p3 = new Pessoa(\"Pedro\", 27);\n Pessoa p4 = new Pessoa(\"William\", 19);\n Pessoa p5 = new Pessoa(\"Laura\", 38);\n Pessoa p6 = new Pessoa(\"Juliana\", 20);\n\n timeVolei.put(\"Levantador\", p1);\n timeVolei.put(\"Libero\", p2);\n timeVolei.put(\"Ponta1\", p3);\n timeVolei.put(\"Armador\", p4);\n timeVolei.put(\"Ponta2\", p5);\n timeVolei.put(\"Centro\", p6);\n\n Pessoa p = timeVolei.get(\"Armador\");\n System.out.println(p.nome + \"---\" + p.idade);\n\n // Já que o valor não pode se repetir, é usado Set\n Set<String> chaves = timeVolei.keySet();\n for (String c : chaves) {\n System.out.println(\"Chave => \" + c);\n }\n\n // Já que o valor pode se repetir, é usado Collection\n Collection<Pessoa> values = timeVolei.values();\n\n for (Pessoa pessoa : values) {\n System.out.println(\"Nome => \" + pessoa.nome);\n }\n\n Stream<String> valuesTransformados = values.stream().map((item) -> {\n return \"*\" + item.nome + \"*\";\n });\n\n // Forma compacta do foreach\n valuesTransformados.forEach(System.out::println);\n }", "public void createTreeMap() {\n myList = new TreeMap<>();\n scrabbleList = new TreeMap<>();\n }", "@SuppressWarnings(\"unchecked\")\n\t@External(readonly = true)\n\tpublic Map<String, String> get_games_excess(BigInteger day) {\n\t\tif (day.compareTo(BigInteger.ZERO)== 0) {\n\t\t\treturn this.get_todays_games_excess();\n\t\t}\n\t\tif (day.compareTo(BigInteger.ZERO)== -1) {\n\t\t\tBigInteger now = BigInteger.valueOf(Context.getBlockTimestamp());\t\t\n\t\t\tday = day.add(now.divide(U_SECONDS_DAY));\n\t\t}\n\t\tMap.Entry<String, String>[] games_excess = new Map.Entry[this.get_approved_games().size()];\n\t\tfor(int i= 0; i< this.get_approved_games().size(); i++) {\n\t\t\tAddress game = this.get_approved_games().get(i);\n\t\t\tgames_excess[i] = Map.entry(game.toString(), String.valueOf(this.games_excess_history.at(day).get(game)));\n\t\t}\n\t\treturn Map.ofEntries(games_excess);\n\t}", "private void setUpHashMap(int number)\n {\n switch (number)\n {\n case 1:\n {\n this.hourly.put(\"Today\",new ArrayList<HourlyForecast>());\n break;\n }\n case 2:\n {\n this.hourly.put(\"Today\",new ArrayList<HourlyForecast>());\n this.hourly.put(\"Tomorrow\", new ArrayList<HourlyForecast>());\n break;\n }\n case 3:\n {\n this.hourly.put(\"Today\", new ArrayList<HourlyForecast>());\n this.hourly.put(\"Tomorrow\", new ArrayList<HourlyForecast>());\n this.hourly.put(\"Day After Tomorrow\", new ArrayList<HourlyForecast>());\n break;\n }default:\n break;\n }\n }", "public TimeMap() {\n hashMap = new HashMap<String, List<Data>>();\n }", "private void prepareListData() {\n listDataHeader = new ArrayList<String>();\n listDataChild = new HashMap<String, List<ArticleDB>>();\n\n //get start_date\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(opening.this);\n start_date = preferences.getString(\"start_date\",\"\");\n\n SimpleDateFormat sdfDOM = new SimpleDateFormat(\"dd\");\n SimpleDateFormat sdfMonth = new SimpleDateFormat(\"MMM-yyyy\");\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd-M-yyyy hh:mm:ss\");\n\n Calendar nextYear = Calendar.getInstance();\n nextYear.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n nextYear.add(Calendar.MONTH, 13);\n Date nextYearDate = nextYear.getTime();\n\n Date currentDate = new Date();\n try {\n currentDate = sdf.parse(start_date);\n } catch (ParseException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n long days = printDifferenceDay(currentDate, nextYearDate);\n //Log.d(\"Days_between\", String.valueOf(days));\n\n Calendar loopMonth = Calendar.getInstance();\n loopMonth.add(Calendar.MONTH,0);\n currentDate = loopMonth.getTime();\n String tmpBefore = sdfMonth.format(currentDate);\n String tmpAfter = sdfMonth.format(currentDate);\n\n int countDay = 0, countMonth=0;\n ArticleDB item = new ArticleDB();\n List<ArticleDB> artTmp = new ArrayList<ArticleDB>();\n boolean flgAdd = false;\n\n while(countDay <= 365){//while next year date coming yet!\n\n if( !tmpBefore.equals(tmpAfter) || countDay == 365 ){//if not current month and total month <= 12 months and last day\n listDataHeader.add(tmpBefore);\n listDataChild.put(listDataHeader.get(countMonth), artTmp);//add to child list\n\n //reset data\n artTmp = new ArrayList<ArticleDB>();//reset tmp array\n countMonth++;\n\n //Log.d(\"Time\", tmpBefore + \"/\" + tmpAfter);\n //Log.d(\"Add\", String.valueOf(countMonth) );\n }\n\n String dom = sdfDOM.format(currentDate);\n //Log.d(\"DOM / Month\", dom + \"/\" + tmpBefore );\n try{\n item = db.getArticle(countDay + 1);\n item.setDom(dom);\n artTmp.add(item);\n } catch (Exception e){\n //do nothing\n }\n\n loopMonth.add(Calendar.HOUR, 24);\n currentDate = loopMonth.getTime();\n tmpBefore = tmpAfter;\n tmpAfter = sdfMonth.format(currentDate);\n //Log.d(\"Count Day\", String.valueOf(countDay));\n //Log.d(\"Day of Month\", dom);\n countDay++;//count up 1 more day\n }\n\n }", "public void createTotalTable() {\r\n totalTable = new HashMap<>();\r\n //create pair table\r\n\r\n //fill with values\r\n Play[] twenty = {Play.NONE, S, S, S, S, S, S, S, S, S, S, S};\r\n Play[] nineteen = {Play.NONE, S, S, S, S, S, S, S, S, S, S, S};\r\n Play[] eightteen = {Play.NONE, S, S, S, S, S, S, S, S, S, S, S};\r\n Play[] seventeen = {Play.NONE, S, S, S, S, S, S, S, S, S, S, S};\r\n Play[] sixteen = {Play.NONE, H, S, S, S, S, S, H, H, H, H, H};\r\n Play[] fifteen = {Play.NONE, H, S, S, S, S, S, H, H, H, H, H};\r\n Play[] fourteen = {Play.NONE, H, S, S, S, S, H, H, H, H, H, H};\r\n Play[] thirteen = {Play.NONE, H, S, S, S, S, H, H, H, H, H, H};\r\n Play[] twelve = {Play.NONE, H, H, H, S, S, S, H, H, H, H, H};\r\n Play[] eleven = {Play.NONE, H, D, D, D, D, D, D, D, D, D, H};\r\n Play[] ten = {Play.NONE, H, D, D, D, D, D, D, D, D, H, H};\r\n Play[] nine = {Play.NONE, H, H, D, D, D, D, H, H, H, H, H};\r\n Play[] eight = {Play.NONE, H, H, H, H, H, H, H, H, H, H, H};\r\n Play[] seven = {Play.NONE, H, H, H, H, H, H, H, H, H, H, H};\r\n Play[] six = {Play.NONE, H, H, H, H, H, H, H, H, H, H, H};\r\n Play[] five = {Play.NONE, H, H, H, H, H, H, H, H, H, H, H};\r\n\r\n totalTable.put(5, five);\r\n totalTable.put(6, six);\r\n totalTable.put(7, seven);\r\n totalTable.put(8, eight);\r\n totalTable.put(9, nine);\r\n totalTable.put(10, ten);\r\n totalTable.put(11, eleven);\r\n totalTable.put(12, twelve);\r\n totalTable.put(13, thirteen);\r\n totalTable.put(14, fourteen);\r\n totalTable.put(15, fifteen);\r\n totalTable.put(16, sixteen);\r\n totalTable.put(17, seventeen);\r\n totalTable.put(18, eightteen);\r\n totalTable.put(19, nineteen);\r\n totalTable.put(20, twenty);\r\n }", "void buildTable(){\n HashMap<String, Integer> map = new HashMap<String, Integer>();\n while (first.hasNext()){\n String s = first.next();\n for(String key: s.split(SPLIT)) {\n int val = map.getOrDefault(key, 0);\n map.put(key, val + 1);\n }\n }\n ArrayList<Tuple> arr = new ArrayList<>();\n for (String key: map.keySet()){\n int num = map.get(key);\n //filter the unusual items\n if (num >= this.support){\n arr.add(new Tuple(key, num));\n }\n }\n //descending sort\n arr.sort((Tuple t1, Tuple t2)->{\n if (t1.num <= t2.num)\n return 1;\n else\n return -1;\n });\n\n int idx = 0;\n for(Tuple t: arr){\n this.table.add(new TableEntry(t.item, t.num));\n this.keyToNum.put(t.item, t.num);\n this.keyToIdx.put(t.item, idx);\n idx += 1;\n }\n /*\n for(TableEntry e: table){\n System.out.println(e.getItem()+ \" \"+ e.getNum());\n }*/\n }", "public List<Entry<String, Double>> sort()\n\t{\n\t\tList<Entry<String, Double>> list = new ArrayList<Entry<String, Double>>();\n\t\tfor(Entry<String, Double> entry : map.entrySet())\n\t\t{\n\t\t\tlist.add(entry);\n\t\t}\n\n\t\tComparator<Entry<String, Double>> compare = new Comparator<Entry<String, Double>>() {\n\t @Override\n\t public int compare(Entry<String, Double> first, Entry<String, Double> second)\n\t {\n\t \tif (first.getValue() > second.getValue())\n\t \t{\n\t return -1;\n\t }\n\t if (first.getValue() < second.getValue())\n\t {\n\t return 1;\n\t }\n\t return 0;\n\t }\n\t };\n\n\t Collections.sort(list, compare);\n return list;\n\t}", "private void splice()\n {\n String dateCompare =\"\";\n int changeCount = 1;\n int numberOfHashes = sizeForHashTable();\n setUpHashMap(numberOfHashes);\n\n for (int i=0; i<= this.data.size();i++)\n {\n if (i == 0)\n {\n dateCompare = this.data.get(i).getFCTTIME().getPretty();\n loadHashTable(changeCount,this.data.get(i));\n }else if ( dateCompare != this.data.get(i).getFCTTIME().getPretty())\n {\n changeCount += 1;\n dateCompare = this.data.get(i).getFCTTIME().getPretty();\n loadHashTable(changeCount,this.data.get(i));\n }else\n {\n loadHashTable(changeCount,this.data.get(i));\n }\n }\n }", "private static void sortingArrayList() {\n Collections.sort(allMapData, new Comparator<MapDataModel>() {\n public int compare(MapDataModel d1, MapDataModel d2) {\n return valueOf(d1.getDateTime().compareTo(d2.getDateTime()));\n }\n });\n }", "List<Map<String, Object>> listGrades()throws BusinessException;", "public Stack<Map<Integer, Territory>> getMapsHistoryByOrder() {\n Stack<Map<Integer,Territory>> mapsHistoryByOrder = new Stack<>();\n roundsHistory.forEach(roundHistory -> mapsHistoryByOrder.push(roundHistory.getMapHistory()));\n return mapsHistoryByOrder;\n }", "private void sortByDate(List<Entry> entries) {\n\t\t\n\t\tCollections.sort(entries, new Comparator<Entry>() {\n\t\t\tpublic int compare(Entry o1, Entry o2) {\n\t\t\t if (o1.getTimestamp() == null || o2.getTimestamp() == null)\n\t\t\t return 0;\n\t\t\t return o1.getTimestamp().compareTo(o2.getTimestamp());\n\t\t\t }\n\t\t\t});\n\t}", "private static HashMap<Knight, Float> sortByY(HashMap<Knight, Float> hm) {\n List<Map.Entry<Knight, Float>> list =\n new LinkedList<Map.Entry<Knight, Float> >(hm.entrySet());\n\n // Sort the list\n Collections.sort(list, new Comparator<Map.Entry<Knight, Float> >() {\n public int compare(Map.Entry<Knight, Float> o1,\n Map.Entry<Knight, Float> o2)\n {\n return -1*(o1.getValue()).compareTo(o2.getValue());\n }\n });\n\n // put data from sorted list to hashmap\n HashMap<Knight, Float> temp = new LinkedHashMap<Knight, Float>();\n for (Map.Entry<Knight, Float> aa : list) {\n temp.put(aa.getKey(), aa.getValue());\n }\n return temp;\n }", "public Map<String, List<Reservation>> findReservationsFor(List<Class> points){\n\t\tMap<String, List<Reservation>> reservations = new HashMap<>();\n\t\tpoints\n\t\t\t.forEach(point ->\n\t\t\t\treservations.put(point.getSimpleName(), this.sortByDate(this.findByClass(point)))\n\t\t\t);\n\t\treturn reservations;\n\t}", "@Override\n public NavigableMap<LocalDateTime, List<Gadget>> getGadgetListWithKeys() {\n return Collections.unmodifiableNavigableMap(orders);\n }", "private static void fillReserveTimeList(ResultSet resultSet\n\t\t\t, Map<MiddayID\n\t\t\t, List<ReserveTime>> reserveTimes){\n\t\ttry {\n\t\t\tList<ReserveTime> morningReserveTimes = new ArrayList<>();\n\t\t\tList<ReserveTime> afternoonReserveTimes = new ArrayList<>();\n\t\t\twhile (resultSet.next()){\n\t\t\t\tReserveTime reserveTime = new ReserveTime();\n\t\t\t\tfillReserveTime(resultSet, reserveTime);\n\t\t\t\tif (reserveTime.getMiddayID() == MiddayID.MORNING)\n\t\t\t\t\tmorningReserveTimes.add(reserveTime);\n\t\t\t\telse if (reserveTime.getMiddayID() == MiddayID.AFTERNOON)\n\t\t\t\t\tafternoonReserveTimes.add(reserveTime);\n\t\t\t}\n\t\t\treserveTimes.put(MiddayID.MORNING, morningReserveTimes);\n\t\t\treserveTimes.put(MiddayID.AFTERNOON, afternoonReserveTimes);\n\t\t}catch(SQLException e) {\n\t\t\tLogger.getLogger(\"Exception\").log(Level.SEVERE, \"Exception \" + e);\n\t\t}\n\t}", "private Map<String,String> parseEarningsPerShare(ArrayList<String> earningYears) {\n // Gewinn pro Aktie (Tabelle Gewinn Jahresangaben)\n\n Pattern gewinnProAktiePattern = Pattern.compile(\"<tr>\\\\s*<td[^/]*Gewinn pro Aktie in EUR((?!</tr>).)*</tr>\");\n matcher = gewinnProAktiePattern.matcher(html);\n ArrayList<String> gewinnProAktieArray = new ArrayList<>();\n\n while (matcher.find()) {\n log.info(\"Matches gefunden!\");\n\n log.info(matcher.group(0));\n String gewinnProAktieOut = matcher.group(0);\n gewinnProAktiePattern = Pattern.compile(\"(\\\\s*<td class=\\\"ZAHL\\\">(((?!</).)*)</td>\\\\s*)\");\n matcher = gewinnProAktiePattern.matcher(gewinnProAktieOut);\n while (matcher.find()) {\n log.debug(matcher.group(2));\n gewinnProAktieArray.add(matcher.group(2).trim());\n }\n }\n\n log.info(gewinnProAktieArray.toString());\n\n if (earningYears.size() != gewinnProAktieArray.size()) {\n throw new RuntimeException(\"gewinnJahresArray und gewinnProAktieArray sind nicht gleich gross\");\n }\n\n Map<String, String> gewinnMap = new HashMap<>();\n for (int i = 0; i < earningYears.size(); i++) {\n gewinnMap.put(earningYears.get(i), gewinnProAktieArray.get(i));\n }\n\n log.info(gewinnMap.toString());\n\n return gewinnMap;\n }", "private TreeMap<Double, String> createRandomTreeMap(TreeMap<Double, String> userlist) \r\n \t{\r\n \t\ttotalPoints = calcTotalPoints(userlist);\r\n \t\tTreeMap<Double, String> ret = new TreeMap<Double, String>();\r\n \t\tfillMap(userlist, ret);\r\n \r\n \t\treturn ret;\r\n \t}", "public SoftHashMap<Integer,TimeEntry> getTimeEntries(SpentOn spentOn)\n throws RedmineException\n {\n return getTimeEntries(ID_ANY,ID_ANY,ownUserId,spentOn);\n }", "public HashMap<Integer, int[][]> prepareFixture(){\n HashMap<Integer, int[][]> weeks = new HashMap<>();\n int teamCount = teams.size();\n boolean isOdd = teams.size() % 2 != 0;\n // Add first matches\n weeks.put(0, prepareFirstWeek(isOdd, teamCount));\n for(int i = 1; i < weekCount(teamCount)/2; i++) {\n weeks.put(i, prepareFixtureNextWeek(weeks.get(i-1)));\n }\n // Add Revenges\n int totalWeekCount = weekCount(teamCount);\n int startingSize = weeks.size();\n for(int i = startingSize; i < totalWeekCount; i++) {\n int[][] firstMatchOfCurrentWeek = weeks.get(i-startingSize);\n assert firstMatchOfCurrentWeek != null;\n int[][] currentWeek = new int[firstMatchOfCurrentWeek.length][firstMatchOfCurrentWeek[0].length];\n for(int j = 0; j < currentWeek.length; j++) {\n currentWeek[j][0] = firstMatchOfCurrentWeek[j][1];\n currentWeek[j][1] = firstMatchOfCurrentWeek[j][0];\n }\n weeks.put(i, currentWeek);\n }\n // Return fixture hashMap\n return weeks;\n }", "private void refreshGoalData () {\n DateTime now = DateTime.now();\n if((now.getWeekOfWeekyear() > userGoals.getWeekOfYear()) || now.getWeekOfWeekyear() == 0 ) {\n userGoals.setWeekOfYear(now.getWeekOfWeekyear());\n userGoals.setRunsPerWeekActual(0);\n userGoals.setMilesPerWeekActual(0.0);\n }\n\n //Calculates weekly mileage and runs per week\n double mileage = 0.0;\n int numOfRuns = 0;\n if(runMap != null && !(runMap.isEmpty())) {\n //Get current year and current week of the year\n int year = now.getYear();\n int currWeek = now.getWeekOfWeekyear();\n Calendar c = Calendar.getInstance();\n c.clear();\n //Set calendar to beginning of week\n c.set(Calendar.YEAR, year);\n c.set(Calendar.WEEK_OF_YEAR, currWeek);\n Date beginningOfWeek = c.getTime();\n\n SimpleDateFormat formatter = new SimpleDateFormat(\"MM/dd/yyyy\");\n\n for (String key : runMap.keySet()) {\n Run run = runMap.get(key);\n //Date stored as MM/dd/yyyy\n try {\n Date dateOfRun = formatter.parse(run.getDate());\n if (dateOfRun.compareTo(beginningOfWeek) >= 0) {\n mileage += run.getMileage();\n numOfRuns++;\n }\n }catch (ParseException p) {\n //idfk\n }\n\n }\n\n if(userShoes != null && !userShoes.isEmpty()) {\n //While we're here, we're going to update the mileage for each shoe\n for (String shoeKey : userShoes.keySet()) {\n Shoe currShoe = userShoes.get(shoeKey);\n currShoe.setMileage(0.0);\n for (String runKey : runMap.keySet()) {\n if (currShoe.getName().equals(runMap.get(runKey).getShoe())) {\n currShoe.addMileage(runMap.get(runKey).getMileage());\n }\n }\n }\n }\n\n }\n userGoals.setRunsPerWeekActual(numOfRuns);\n userGoals.setMilesPerWeekActual(mileage);\n\n\n goalRef.setValue(userGoals);\n shoeRef.setValue(userShoes);\n\n check = 1;\n }", "public HashMap<String, Integer> sortedEventTimes(ArrayList<Athlete> allAths, String targetEvent){\n\t\t\n\t\t//stores all athletes and times for specific event in hashmap\n\t\tHashMap<String, Integer> athleteTimes = new HashMap<>();\n\t\t\n\t\tfor(int i=0; i<allAths.size(); i++) {\n\t\t\tfor(Event event : allAths.get(i).getEvents().values()) {\n\t\t\t\tif(event.toString().equals(targetEvent)) {\n\t\t\t\t\tathleteTimes.put(allAths.get(i).getName(), event.getIntTime());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this.sortByValue(athleteTimes);\n\t\t\n\t\t\n\t\n\t\t\n\t}", "@Override\r\n\tpublic Map<String, double[]> getHallAttendance() {\n\t\tMap<String, double[]> result = new HashMap<String, double[]>();\r\n\t\tdouble[] hall1 = new double[7];\r\n\t\tdouble[] hall2 = new double[7];\r\n\t\tdouble[] hall3 = new double[7];\r\n\t\tDate date = DateUtil.getCurrentDate();\r\n\t\tCinemaCondition cinemaCondition = cinemaConditionDao.getByDate(date);\r\n\t\tif (cinemaCondition!=null) {\r\n\t\t\thall1[0] = (double)cinemaCondition.getHall1UsedCount()/cinemaCondition.getHall1()*100;\r\n\t\t\thall2[0] = (double)cinemaCondition.getHall2UsedCount()/cinemaCondition.getHall2()*100;\r\n\t\t\thall3[0] = (double)cinemaCondition.getHall3UsedCount()/cinemaCondition.getHall3()*100;\t\t\r\n\t\t}\r\n\r\n\t\tfor(int i=0;i<6;i++){\r\n\t\t\tdate = DateUtil.getDayBefore(date);\r\n\t\t\tcinemaCondition = cinemaConditionDao.getByDate(date);\r\n\t\t\tif (cinemaCondition!=null) {\r\n\t\t\t\thall1[i+1] = (double)cinemaCondition.getHall1UsedCount()/cinemaCondition.getHall1()*100;\r\n\t\t\t\thall2[i+1] = (double)cinemaCondition.getHall2UsedCount()/cinemaCondition.getHall2()*100;\r\n\t\t\t\thall3[i+1] = (double)cinemaCondition.getHall3UsedCount()/cinemaCondition.getHall3()*100;\r\n\t\t\t}\r\n\t\t}\r\n\t\tresult.put(\"一号影厅\", hall1);\r\n\t\tresult.put(\"二号影厅\", hall2);\r\n\t\tresult.put(\"三号影厅\", hall3);\r\n\t\t\r\n\t\treturn result;\r\n\t}", "private LinkedHashMap<String, List<String[]>> generateResultMap(List<FinanceDocument> financeDocumentList) {\n\n LinkedHashMap<String, List<String[]>> resultMap = new LinkedHashMap<>();\n for (FinanceDocument doc : financeDocumentList) {\n\n String date = DateUtils.getNormalDate(DateUtils.DATE_FORMAT_LONG, doc.getDate());\n HashMap<String, Float> valuesMap = doc.getConvertedValuesMap().get(dataType);\n\n String sign = \"+\";\n if (dataType == FinanceDocument.CUSTOM_EXPENSE) {\n sign = \"-\";\n }\n for (Map.Entry<String, Float> entry : valuesMap.entrySet()) {\n String valueString = sign + String.format(Locale.getDefault(), \"%1$,.2f\", entry.getValue()) + \" \" + MainActivity.defaultCurrency;\n if (resultMap.containsKey(date)) {\n resultMap.get(date).add(new String[]{\n Utils.keyToString(getContext(), entry.getKey()),\n valueString});\n\n\n } else {\n List<String[]> resultList = new ArrayList<>();\n resultList.add(new String[]{\n Utils.keyToString(getContext(), entry.getKey()),\n valueString});\n resultMap.put(date, resultList);\n\n }\n\n }\n }\n\n return resultMap;\n }", "public DateSortingUsingAlgorithm() throws IOException {\n\t\t//initialize the classes local variables\n\t\tmap = new HashMap<LocalDate, Integer>();\n\t\tString[] mapData = new String[3];\n\t\t\n\t\t//using a BufferedReader to read in data from the SortingDates.txt file\n\t\tBufferedReader br = new BufferedReader(new FileReader(\"SortingDates.txt\"));\n\t\t\n\t\t//begin reading in the data from the file\n\t\tString dataLine = br.readLine().trim();\n\t\t\n\t\t//the format of the SortingDates.txt dates\n\t\tDateTimeFormatter format = DateTimeFormatter.ofPattern(\"yyyy-MM-dd\");\n\t\tInteger value = 0;\n\t\t/*\n\t\t * this while loop continues to read from the file while there is still data to read in. it \n\t\t * takes the data as a String and parses it into a LocalDate date using the formatter above. Lastly,\n\t\t * it adds the LocalDate to the HashMap to be sorted later\n\t\t */\n\t\twhile (dataLine != null) {\n\t\t\tString result = \"\";\n\t\t\tmapData = dataLine.trim().split(\"-\");\n\t\t\t\n\t\t\t//using a for loop to trim any whitespace in the yyyy-dd-MM format\n\t\t\tfor (int index = 0; index < mapData.length; ++index) {\n\t\t\t\tmapData[index] = mapData[index].trim(); //trimming any white spaces in the yyyyddMM format\n\t\t\t\tif (index == 2) {\n\t\t\t\t\tresult += mapData[index];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tresult += mapData[index] + \"-\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tLocalDate mapDataLDT = LocalDate.parse(result, format);\n\t\t\tmap.put(mapDataLDT, value++);\n\t\t\tdataLine = br.readLine();\n\t\t}\n\t\tbr.close();\n\t}", "public Map<Prize, Ticket> luckyDraw() {\n\t\t\n\t\t// Creates a mapping of which prize is won by whom.\n\t\tMap<Prize, Ticket> winners = new HashMap<Prize, Ticket>();\n\t\t\n\t\t/* !!!! Make use of an enhanced for statement to allocate\n\t\t * each prize to a winner. Which collection should we iterate\n\t\t * over (prizes or tickets)? Regardless of your answer, the \n\t\t * iteration will need to end when the tickets in the ticket \n\t\t * box have been exhausted, i.e. when there are more prizes \n\t\t * than tickets sold. \n\t\t */\n\t\tIterator<Ticket> ticketIterator = ticketBox.iterator();\n\t\tIterator<Prize> prizeIterator = prizeBox.iterator();\n\t\twhile(prizeIterator.hasNext()) {\n\t\t\tif(ticketIterator.hasNext()) {\n\t\t\t\tTicket ticketDrawn = ticketBox.draw();\n\t\t\t\twinners.put(prizeIterator.next(), ticketDrawn);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn winners;\n\t}", "Map<SportEquipment, Integer> fill(String address) throws FileNotFoundException {\n\n File f = new File(System.getProperty(Strings.USER_DIR) + Strings.SRC + address);\n Scanner s = null;\n int lineNumber = 0;\n goods = new TreeMap<SportEquipment, Integer>();\n\n try {\n s = new Scanner(f);\n\n //defines category\n while (s.hasNextLine()) {\n\n String line = s.nextLine();\n lineNumber++; //counts lines for log to define the places of possible mistakes\n\n try {\n String[] parts = line.split(Strings.REGEX);\n Category category = null;\n switch (parts[0].trim()) {\n case Strings.TENNIS:\n category = Category.TENNIS;\n break;\n case Strings.FOOTBALL:\n category = Category.FOOTBALL;\n break;\n case Strings.CHESS:\n category = Category.CHESS;\n break;\n case Strings.GYMNASTICS:\n category = Category.GYMNASTICS;\n break;\n case Strings.SWIMMING:\n category = Category.SWIMMING;\n break;\n default:\n throw new EnumConstantNotPresentException(Category.class, parts[0]);\n }\n\n String title = parts[1].trim(); //defines good's name\n double price = Double.valueOf(parts[2].trim()); //defines price\n int amount = Integer.valueOf(parts[3].trim()); //defines available amount\n\n if (amount <= 0 || title.length() < 3) {\n throw new NullPointerException();\n }\n\n goods.put(new SportEquipment(category, parts[1], price), amount); //creates a mapping\n\n } catch (EnumConstantNotPresentException e) {\n Reporter.getInstance().printProblem(e.enumType() + Strings.SPACE + e.constantName() +\n Strings.ENUM_NOT_EXIST + lineNumber);\n\n } catch (IndexOutOfBoundsException e) {\n Reporter.getInstance().printProblem(Strings.LACK_OF_DATA + lineNumber);\n\n } catch (NumberFormatException e) {\n Reporter.getInstance().printProblem(Strings.WRONG_NUMBER_DATA + lineNumber);\n\n } catch (NullPointerException e) {\n Reporter.getInstance().printProblem(Strings.NULL_NEGATIVE + lineNumber);\n }\n\n }\n return goods;\n\n } finally {\n s.close(); //closes Scanner in order to release the file \"Goods.txt\" and let the Reporter overwrite it\n }\n }", "@GetMapping(\"/bestplayers\")\n public String best(Map<String, Object> model) {\n\n Calendar calendar = Calendar.getInstance();\n calendar.add(Calendar.MINUTE, -5);\n Date date = calendar.getTime();\n System.out.println(date.toString());\n List<Match> matchs = matchRepo.findByMatchTimeAfter(date);\n\n\n Map<Chessplayer, Double> result = matchs.stream() //преобразуем в стрим\n // .map(Match::getMatchDetails) //мапа деталий матчей\n .flatMap(Match -> Match.getMatchDetails().stream()) //мапа деталей матча\n\n .collect(Collectors.groupingBy(MatchDetails::getChessplayer, Collectors.summingDouble(MatchDetails::getRatingChange)))\n\n .entrySet()\n .stream()\n .sorted(Map.Entry.<Chessplayer, Double>comparingByValue().reversed())\n .limit(5)\n .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));\n\n model.put(\"players\", result);\n\n return \"bestPlayers\";\n\n }", "@Override\n public void storeLiveEvents() {\n try {\n //Get today's date and convert to string\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd\");\n Date todayDate = new Date();\n String today = dateFormat.format(todayDate).replaceAll(\"/\", \"-\");\n\n //Retrieve live games json d1ata from APIFootball and convert to JSON array\n String data = httpTools.httpGetURL(\"https://apifootball.com/api/?action=get_events&from=\" + today + \"&to=\" + today + \"&match_live=1&APIkey=aec4fdc3c841ad7b08ac13242f6a6dfc229446b4408bf4a6cb2b7ebe2baef4cf\");\n JSONArray array = new JSONArray(data);\n\n //For every live match\n List<MatchStore> matchList = new ArrayList<>();\n for (int i = 0; i < array.length(); i++) {\n\n //Get the date from live game\n Date date;\n date = getDate(array, i);\n\n\n //Parse all goalscorers and store in a list\n List<Goalscorer> goalscorerList = new ArrayList<>();\n JSONArray goalscorerArray = array.getJSONObject(i).getJSONArray(\"goalscorer\");\n for (int y = 0; y < goalscorerArray.length(); y++) {\n goalscorerList.add(new Goalscorer(goalscorerArray.getJSONObject(y).getString(\"score\"),\n goalscorerArray.getJSONObject(y).getString(\"time\").substring(0, goalscorerArray.getJSONObject(y).getString(\"time\").length() - 1),\n goalscorerArray.getJSONObject(y).getString(\"away_scorer\"),\n goalscorerArray.getJSONObject(y).getString(\"home_scorer\")\n ));\n }\n\n //Home and Away lineup list declarations\n List<Player> startingHomeLineupList = new ArrayList<>();\n List<Player> substitutesHomeList = new ArrayList<>();\n List<Substitutions> substitutionsHomeList = new ArrayList<>();\n\n List<Player> startingAwayLineupList = new ArrayList<>();\n List<Player> substitutesAwayList = new ArrayList<>();\n List<Substitutions> substitutionsAwayList = new ArrayList<>();\n\n //Parse and store home team lineup\n JSONArray startingHomeLineupArray = array.getJSONObject(i).getJSONObject(\"lineup\").getJSONObject(\"home\").getJSONArray(\"starting_lineups\");\n for (int y = 0; y < startingHomeLineupArray.length(); y++) {\n startingHomeLineupList.add(new Player(startingHomeLineupArray.getJSONObject(y).getString(\"lineup_player\"),\n startingHomeLineupArray.getJSONObject(y).getString(\"lineup_number\"),\n startingHomeLineupArray.getJSONObject(y).getString(\"lineup_position\")));\n }\n\n //Parse and store away team lineup\n JSONArray startingAwayLineupArray = array.getJSONObject(i).getJSONObject(\"lineup\").getJSONObject(\"away\").getJSONArray(\"starting_lineups\");\n for (int y = 0; y < startingAwayLineupArray.length(); y++) {\n startingAwayLineupList.add(new Player(startingAwayLineupArray.getJSONObject(y).getString(\"lineup_player\"),\n startingAwayLineupArray.getJSONObject(y).getString(\"lineup_number\"),\n startingAwayLineupArray.getJSONObject(y).getString(\"lineup_position\")));\n }\n\n //Parse and store home team subs\n JSONArray subHomeLineupArray = array.getJSONObject(i).getJSONObject(\"lineup\").getJSONObject(\"home\").getJSONArray(\"substitutes\");\n for (int y = 0; y < subHomeLineupArray.length(); y++) {\n substitutesHomeList.add(new Player(subHomeLineupArray.getJSONObject(y).getString(\"lineup_player\"),\n subHomeLineupArray.getJSONObject(y).getString(\"lineup_number\"),\n subHomeLineupArray.getJSONObject(y).getString(\"lineup_position\")));\n }\n\n //Parse and store away team subs\n JSONArray subAwayLineupArray = array.getJSONObject(i).getJSONObject(\"lineup\").getJSONObject(\"away\").getJSONArray(\"substitutes\");\n for (int y = 0; y < subAwayLineupArray.length(); y++) {\n substitutesAwayList.add(new Player(subAwayLineupArray.getJSONObject(y).getString(\"lineup_player\"),\n subAwayLineupArray.getJSONObject(y).getString(\"lineup_number\"),\n subAwayLineupArray.getJSONObject(y).getString(\"lineup_position\")));\n }\n\n //Parse and store home team completed subs\n JSONArray subCompletedHomeArray = array.getJSONObject(i).getJSONObject(\"lineup\").getJSONObject(\"home\").getJSONArray(\"substitutions\");\n for (int y = 0; y < subCompletedHomeArray.length(); y++) {\n substitutionsHomeList.add(new Substitutions(subCompletedHomeArray.getJSONObject(y).getString(\"lineup_player\"),\n subCompletedHomeArray.getJSONObject(y).getString(\"lineup_time\")));\n }\n\n //Parse and store away team completed subs\n JSONArray subCompletedAwayArray = array.getJSONObject(i).getJSONObject(\"lineup\").getJSONObject(\"home\").getJSONArray(\"substitutions\");\n for (int y = 0; y < subCompletedAwayArray.length(); y++) {\n substitutionsAwayList.add(new Substitutions(subCompletedAwayArray.getJSONObject(y).getString(\"lineup_player\"),\n subCompletedAwayArray.getJSONObject(y).getString(\"lineup_time\")));\n }\n\n //Complete home and away team lineups\n Lineup homeLineup = new Lineup(startingHomeLineupList, substitutesHomeList, substitutionsHomeList);\n Lineup awayLineup = new Lineup(startingAwayLineupList, substitutesAwayList, substitutionsAwayList);\n\n //Add live match data to match list\n matchList.add(new MatchStore(Integer.parseInt(array.getJSONObject(i).getString(\"match_id\")),\n Integer.parseInt(array.getJSONObject(i).getString(\"country_id\")),\n Integer.parseInt(array.getJSONObject(i).getString(\"league_id\")),\n date,\n array.getJSONObject(i).getString(\"match_status\"),\n array.getJSONObject(i).getString(\"match_hometeam_name\"),\n array.getJSONObject(i).getString(\"match_awayteam_name\"),\n array.getJSONObject(i).getString(\"match_hometeam_score\"),\n array.getJSONObject(i).getString(\"match_awayteam_score\"),\n array.getJSONObject(i).getString(\"match_hometeam_halftime_score\"),\n array.getJSONObject(i).getString(\"match_awayteam_halftime_score\"),\n array.getJSONObject(i).getString(\"match_hometeam_extra_score\"),\n array.getJSONObject(i).getString(\"match_awayteam_extra_score\"),\n array.getJSONObject(i).getString(\"match_hometeam_penalty_score\"),\n array.getJSONObject(i).getString(\"match_awayteam_penalty_score\"),\n array.getJSONObject(i).getString(\"match_live\")\n ));\n }\n //Store live match updated data\n dataService.storeKeyEventsInUpdate(matchList);\n for (MatchStore m:matchList){\n gameDAO.storeLiveEvents(m);\n }\n\n } catch (JSONException j) {\n j.printStackTrace();\n }\n catch (Exception e){\n e.printStackTrace();\n }\n }", "public static List<Map<String, BigDecimal>> getHashMaps(Portfolio portfolio) {\n //List of maps to store dates along with their adj. closing prices on those dates\n List<Map<String, BigDecimal>> portfolioPriceMap = new ArrayList<Map<String, BigDecimal>>();\n\n for (int i = 0; i < portfolio.getSize(); i++) {\n Map<String, BigDecimal> positionPriceMap = new HashMap<String, BigDecimal>();\n List<HistoricalQuote> currentPositionData = portfolio.getPosition(i).getHistoricalData();\n\n for (int j = 0; j < currentPositionData.size(); j++) {\n String currentDate = dateFormat.format(currentPositionData.get(j).getDate().getTime());\n\n positionPriceMap.put(currentDate, currentPositionData.get(j).getAdjClose());\n }\n\n portfolioPriceMap.add(positionPriceMap); //Add this price map to the portfolio's price map\n }\n\n return portfolioPriceMap;\n }", "private TreeMap<String, double[]> readFactorsInfo(XSSFSheet sheet) {\n\t\tIterator<Row> rowIterator = sheet.iterator();\n\t\t\n\t\trowIterator.next();//Ignore the column names. We actually know it.\n\t\trowIterator.next();//Ignore second column\n\t\tRow row = null;\n\t\tTreeMap<String, double[]> treeMap = new TreeMap<String, double[]>();\n\n\t\twhile(rowIterator.hasNext()){\n\t\t\trow = rowIterator.next();\n\t\t\t//The composed key: [newID+type.firstLetter+hour]\n\t\t\tString key =row.getCell(CELL_POLLUTANT).getStringCellValue();\n\t\t\tSystem.out.println(key);\n\t\t\tdouble[] values = new double[30];\n\t\t\t\n\t\t\tfor(int i=0;i<30;i++){\n\t\t\t\tvalues[i]=row.getCell(i+1).getNumericCellValue();\n\t\t\t}\n\t\t\t\n\t\t\ttreeMap.put(key,values);\n\t\t}\n\t\treturn treeMap;\n\t}", "public static LinkedHashMap <Integer, ArrayList<WeatherObject>> getWeatherMap(ArrayList<WeatherObject> weatherList) {\n LinkedHashMap<Integer, ArrayList<WeatherObject>> weatherMap = new LinkedHashMap<>();\n\n int tempDayOfWeek = 0;\n\n ArrayList<WeatherObject> weatherArrayList = new ArrayList<>();\n\n // temporary\n Calendar calendarTemp = Calendar.getInstance();\n // now\n Calendar calendarNow = Calendar.getInstance();\n\n for (WeatherObject weatherObject : weatherList) {\n long millisecondsCorrect = weatherObject.getDateTime()*1000l;\n calendarTemp.setTimeInMillis(millisecondsCorrect);\n\n if (calendarTemp.get(Calendar.DAY_OF_MONTH) != calendarNow.get(Calendar.DAY_OF_MONTH)) {\n if (tempDayOfWeek == 0) {\n tempDayOfWeek = calendarTemp.get(Calendar.DAY_OF_WEEK);\n }\n\n if (tempDayOfWeek == calendarTemp.get(Calendar.DAY_OF_WEEK)) {\n weatherArrayList.add(weatherObject);\n } else {\n weatherMap.put(tempDayOfWeek,weatherArrayList);\n tempDayOfWeek = calendarTemp.get(Calendar.DAY_OF_WEEK);\n weatherArrayList = new ArrayList<>();\n }\n }\n }\n return weatherMap;\n }", "private void sortEScores() {\n LinkedHashMap<String, Double> sorted = eScores\n .entrySet()\n .stream()\n .sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))\n .collect(\n toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2,\n LinkedHashMap::new));\n eScores = sorted;\n }", "public LeagueTable(final List<Match> matches) {\n\t\tif (matches != null && !matches.isEmpty()) {\n\t\t\tfinal Map<String, LeagueTableEntry> map = new HashMap<>();\n\t\t\ttry (Stream<Match> stream = matches.stream()) {\n\t\t\t\tstream.forEach(m -> {\n\t\t\t\t\tLeagueTableEntry homeTeam = map.getOrDefault(m.getHomeTeam(),\n\t\t\t\t\t\t\tnew LeagueTableEntry(m.getHomeTeam()));\n\t\t\t\t\tLeagueTableEntry awayTeam = map.getOrDefault(m.getAwayTeam(),\n\t\t\t\t\t\t\tnew LeagueTableEntry(m.getAwayTeam()));\n\n\t\t\t\t\thandleMatch(homeTeam, awayTeam, m);\n\n\t\t\t\t\tmap.put(homeTeam.getTeamName(), homeTeam);\n\t\t\t\t\tmap.put(awayTeam.getTeamName(), awayTeam);\n\t\t\t\t});\n\t\t\t}\n\t\t\tentries = map.values().stream().sorted(comparator).collect(Collectors.toList());\n\t\t}\n\n\t}", "HashMap<String, Double> invest(double amount, TreeMap<String, Double> weights,\n boolean equalWeights, String date, double commission)\n throws IllegalArgumentException;", "static void table(ArrayList<Integer> myLst){\n TreeMap<Integer,Integer> myTeeMap = new TreeMap<Integer, Integer>();\n\n //Traverse ArrayList and create TreeMap structure.\n for (int i = 0; i < myLst.size(); i++){\n if (myTeeMap.containsKey(myLst.get(i))){\n myTeeMap.put(myLst.get(i), myTeeMap.get(myLst.get(i)) +1);\n }\n else{\n myTeeMap.put(myLst.get(i),1);\n }\n }\n\n //Print out myTeeMap\n for (Map.Entry<Integer, Integer> e : myTeeMap.entrySet())\n System.out.println(\"Key: \"+e.getKey()\n + \" \"\n + \"| Occurrences: \"+e.getValue());\n }", "public HashMap<Integer, CheckersGame> getCurrentGames() {\n HashMap<Integer, CheckersGame> currentGames = new HashMap<>();\n Iterator<Map.Entry<Integer, CheckersGame>> cgit = games.entrySet().iterator();\n\n while (cgit.hasNext()) {\n Map.Entry<Integer, CheckersGame> entry = cgit.next();\n\n // Remove entry if key is null or equals 0.\n if (!entry.getValue().isGameOver()) {\n currentGames.put(entry.getKey(), entry.getValue());\n }\n }\n return currentGames;\n }", "public void assignPointsToTeams(){\n Collections.sort(this.teams, new Comparator<Object>() {\n @Override\n public int compare(final Object object1, final Object object2) {\n Team one = (Team)object1;\n Team two = (Team)object2;\n \n if(one.getTotalRuns() < two.getTotalRuns()){\n return 1;\n }\n else{\n return -1;\n }\n }\n });\n \n for(int i=0;i<teams.size();i++){\n int setvalue = 12-i;\n if(setvalue<0){\n setvalue = 0;\n }\n Team t = teams.get(i);\n t.setPointsRuns(setvalue);\n }\n \n //SORTS FOR TOTALHOMERUNS THEN ASSIGNS EACH THE CORRESPONDING POINT VALUE\n Collections.sort(this.teams, new Comparator<Object>() {\n @Override\n public int compare(final Object object1, final Object object2) {\n Team one = (Team)object1;\n Team two = (Team)object2;\n \n if(one.getTotalHomeRuns() < two.getTotalHomeRuns()){\n return 1;\n }\n else{\n return -1;\n }\n }\n });\n \n for(int i=0;i<teams.size();i++){\n int setvalue = 12-i;\n if(setvalue<0){\n setvalue = 0;\n }\n Team t = teams.get(i);\n t.setPointsHomeRuns(setvalue);\n }\n \n //SORTS FOR RunsBattedIn THEN ASSIGNS EACH THE CORRESPONDING POINT VALUE\n Collections.sort(this.teams, new Comparator<Object>() {\n @Override\n public int compare(final Object object1, final Object object2) {\n Team one = (Team)object1;\n Team two = (Team)object2;\n \n if(one.getTotalRunsBattedIn() < two.getTotalRunsBattedIn()){\n return 1;\n }\n else{\n return -1;\n }\n }\n });\n \n for(int i=0;i<teams.size();i++){\n int setvalue = 12-i;\n if(setvalue<0){\n setvalue = 0;\n }\n Team t = teams.get(i);\n t.setPointsRunsBattedIn(setvalue);\n }\n \n //SORTS FOR STOLENBASES THEN ASSIGNS EACH THE CORRESPONDING POINT VALUE\n Collections.sort(this.teams, new Comparator<Object>() {\n @Override\n public int compare(final Object object1, final Object object2) {\n Team one = (Team)object1;\n Team two = (Team)object2;\n \n if(one.getTotalStolenBases() < two.getTotalStolenBases()){\n return 1;\n }\n else{\n return -1;\n }\n }\n });\n \n for(int i=0;i<teams.size();i++){\n int setvalue = 12-i;\n if(setvalue<0){\n setvalue = 0;\n }\n Team t = teams.get(i);\n t.setPointsStolenBases(setvalue);\n }\n \n //SORTS FOR BATTINGAVERAGE THEN ASSIGNS EACH THE CORRESPONDING POINT VALUE\n Collections.sort(this.teams, new Comparator<Object>() {\n @Override\n public int compare(final Object object1, final Object object2) {\n Team one = (Team)object1;\n Team two = (Team)object2;\n \n if(one.getBattingAverage() < two.getBattingAverage()){\n return 1;\n }\n else{\n return -1;\n }\n }\n });\n \n for(int i=0;i<teams.size();i++){\n int setvalue = 12-i;\n if(setvalue<0){\n setvalue = 0;\n }\n Team t = teams.get(i);\n t.setPointsBattingAverage(setvalue);\n }\n \n //SORTS FOR Wins THEN ASSIGNS EACH THE CORRESPONDING POINT VALUE\n Collections.sort(this.teams, new Comparator<Object>() {\n @Override\n public int compare(final Object object1, final Object object2) {\n Team one = (Team)object1;\n Team two = (Team)object2;\n \n if(one.getWins() < two.getWins()){\n return 1;\n }\n else{\n return -1;\n }\n }\n });\n \n for(int i=0;i<teams.size();i++){\n int setvalue = 12-i;\n if(setvalue<0){\n setvalue = 0;\n }\n Team t = teams.get(i);\n t.setPointsWins(setvalue);\n }\n \n //SORTS FOR Strikeouts THEN ASSIGNS EACH THE CORRESPONDING POINT VALUE\n Collections.sort(this.teams, new Comparator<Object>() {\n @Override\n public int compare(final Object object1, final Object object2) {\n Team one = (Team)object1;\n Team two = (Team)object2;\n \n if(one.getStrikeouts() < two.getStrikeouts()){\n return 1;\n }\n else{\n return -1;\n }\n }\n });\n \n for(int i=0;i<teams.size();i++){\n int setvalue = 12-i;\n if(setvalue<0){\n setvalue = 0;\n }\n Team t = teams.get(i);\n t.setPointsStrikeouts(setvalue);\n }\n \n //SORTS FOR Saves THEN ASSIGNS EACH THE CORRESPONDING POINT VALUE\n Collections.sort(this.teams, new Comparator<Object>() {\n @Override\n public int compare(final Object object1, final Object object2) {\n Team one = (Team)object1;\n Team two = (Team)object2;\n \n if(one.getSaves() < two.getSaves()){\n return 1;\n }\n else{\n return -1;\n }\n }\n });\n \n for(int i=0;i<teams.size();i++){\n int setvalue = 12-i;\n if(setvalue<0){\n setvalue = 0;\n }\n Team t = teams.get(i);\n t.setPointsSaves(setvalue);\n }\n \n //SORTS FOR ERA THEN ASSIGNS EACH THE CORRESPONDING POINT VALUE\n Collections.sort(this.teams, new Comparator<Object>() {\n @Override\n public int compare(final Object object1, final Object object2) {\n Team one = (Team)object1;\n Team two = (Team)object2;\n \n if(one.getEarnedRunAverage() < two.getEarnedRunAverage()){\n return 1;\n }\n else{\n return -1;\n }\n }\n });\n \n for(int i=0;i<teams.size();i++){\n int setvalue = 12-i;\n if(setvalue<0){\n setvalue = 0;\n }\n Team t = teams.get(i);\n t.setPointsERA(setvalue);\n }\n \n //SORTS FOR WHIP THEN ASSIGNS EACH THE CORRESPONDING POINT VALUE\n Collections.sort(this.teams, new Comparator<Object>() {\n @Override\n public int compare(final Object object1, final Object object2) {\n Team one = (Team)object1;\n Team two = (Team)object2;\n \n if(one.getWhip() < two.getWhip()){\n return 1;\n }\n else{\n return -1;\n }\n }\n });\n \n for(int i=0;i<teams.size();i++){\n int setvalue = 12-i;\n if(setvalue<0){\n setvalue = 0;\n }\n Team t = teams.get(i);\n t.setPointsWHIP(setvalue);\n } \n }", "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 }", "public static void main(String[] args){\n String filename = \"\";\n if (args.length >= 1){\n filename = args[0];\n } else {\n return;\n }\n\n int abs = 0;\n int diectic = 0;\n int timeOfDay = 0;\n\n Pattern absPattern = Pattern.compile(absoluteDateRegex);\n //Pattern absPattern = Pattern.compile(mmddyyyy);\n //Pattern absPattern = Pattern.compile(holidays);\n Pattern diecticPattern = Pattern.compile(diecticDateRegex);\n Pattern timeOfDayPattern = Pattern.compile(timeOfDayRegex);\n\n Matcher absMatcher = null;\n Matcher diecticMatcher = null;\n Matcher timeOfDayMatcher = null;\n\n //System.out.println(absoluteDateRegex + \"\\n\");\n //System.out.println(diecticDateRegex + \"\\n\");\n //System.out.println(timeOfDayRegex + \"\\n\");\n\n HashMap <String, Integer> absMap = new HashMap<>();\n HashMap <String, Integer> diecticMap = new HashMap<>();\n HashMap <String, Integer> timeOfDayMap = new HashMap<>();\n\n String tmp = \"\";\n\n try{\n BufferedReader reader = new BufferedReader(\n new FileReader(filename));\n String line;\n while ((line = reader.readLine()) != null){\n absMatcher = absPattern.matcher(line);\n diecticMatcher = diecticPattern.matcher(line);\n timeOfDayMatcher = timeOfDayPattern.matcher(line);\n\n while (absMatcher.find()){\n abs++;\n tmp = absMatcher.group();\n //System.out.println(tmp);\n\n if (absMap.containsKey(tmp)){\n absMap.put(tmp, absMap.get(tmp) + 1);\n } else {\n absMap.put(tmp, 1);\n }\n }\n while (diecticMatcher.find()){\n diectic++;\n tmp = diecticMatcher.group();\n\n if (diecticMap.containsKey(tmp)){\n diecticMap.put(tmp, diecticMap.get(tmp) + 1);\n } else {\n diecticMap.put(tmp, 1);\n }\n //System.out.println(diecticMatcher.group());\n }\n while (timeOfDayMatcher.find()){\n timeOfDay++;\n tmp = timeOfDayMatcher.group();\n\n if (timeOfDayMap.containsKey(tmp)){\n timeOfDayMap.put(tmp, timeOfDayMap.get(tmp) + 1);\n } else {\n timeOfDayMap.put(tmp, 1);\n }\n //System.out.println(timeOfDayMatcher.group());\n }\n }\n reader.close();\n\n /*\n System.out.println(\"Absolute dates = \" + abs);\n System.out.println(\"Diectic dates = \" + diectic);\n System.out.println(\"Both dates = \" + (abs + diectic));\n System.out.println(\"time-of-day expressions = \" + timeOfDay);\n */\n\n System.out.println(\"2.4: Absolute\");\n printOutMap(absMap, abs);\n\n System.out.println(\"\\n2.5: Absolute && Diectic\");\n HashMap<String, Integer>datesMap = new HashMap<>();\n datesMap.putAll(absMap);\n datesMap.putAll(diecticMap);\n printOutMap(datesMap, diectic+abs);\n\n System.out.println(\"\\n2.6: Time Of Day\");\n printOutMap(timeOfDayMap, timeOfDay);\n\n System.out.println(\"\\nAll RegExs combined\");\n HashMap<String, Integer> allMap = new HashMap<>();\n allMap.putAll(datesMap);\n allMap.putAll(timeOfDayMap);\n printOutMap(allMap, timeOfDay + diectic + abs);\n } catch (Exception e){\n System.err.format(\"Exception occurred trying to read '%s'.\",\n filename);\n e.printStackTrace();\n return;\n }\n }", "public static Map<Id,List<Tuple<Id,AgentId2PlannedDepartureTimeMapData>>> getAgentId2PlannedPTDepartureTimeMap(Population pop, Set<Id<Person>> agentIds){\n\n//\t\tAgentId2PlannedDepartureTimeMap.log.setLevel(AgentId2PlannedDepartureTimeMap.logLevel);\n\t\tMap<Id, List<Tuple<Id, AgentId2PlannedDepartureTimeMapData>>> agentId2PlannedDepartureMap = new TreeMap<Id, List<Tuple<Id, AgentId2PlannedDepartureTimeMapData>>>();\n\n\t\tfor (Person person : pop.getPersons().values()) {\n\t\t\tif(agentIds.contains(person.getId())){\n\n\t\t\t\t// person in set, so do something\n\n\t\t\t\tList<Tuple<Id, AgentId2PlannedDepartureTimeMapData>> plannedDepartureList = new ArrayList<Tuple<Id, AgentId2PlannedDepartureTimeMapData>>();\n\t\t\t\tagentId2PlannedDepartureMap.put(person.getId(), plannedDepartureList);\n\n\t\t\t\tPlan plan = person.getSelectedPlan();\n\t\t\t\tdouble runningTime = 0.0;\n\t\t\t\tboolean firstActDone = false;\n\t\t\t\tfor (PlanElement pE : plan.getPlanElements()) {\n\n\t\t\t\t\tif(pE instanceof Activity){\n\t\t\t\t\t\tActivity act = (Activity) pE;\n\n\t\t\t\t\t\tif(!firstActDone){\n\t\t\t\t\t\t\trunningTime = act.getEndTime().seconds();\n\t\t\t\t\t\t\tfirstActDone = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(act.getMaximumDuration().isUndefined()){\n\t\t\t\t\t\t\t\trunningTime += act.getMaximumDuration().seconds();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\trunningTime = act.getEndTime().seconds();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif(pE instanceof Leg){\n\n\t\t\t\t\t\tLeg leg = (Leg) pE;\n\n\t\t\t\t\t\tif(leg.getMode() == TransportMode.pt){\n\t\t\t\t\t\t\t// it's the start of a new pt leg, report it\n\t\t\t\t\t\t\tif (leg.getRoute() instanceof TransitPassengerRoute){\n\t\t\t\t\t\t\t\tTransitPassengerRoute route = (TransitPassengerRoute) leg.getRoute();\n\t\t\t\t\t\t\t\tplannedDepartureList.add(new Tuple<Id, AgentId2PlannedDepartureTimeMapData>(route.getAccessStopId(), new AgentId2PlannedDepartureTimeMapData(route.getAccessStopId(), runningTime, route.getLineId(), route.getRouteId())));\n\t\t\t\t\t\t\t} else if (leg.getRoute() != null) {\n\t\t\t\t\t\t\t\tlog.warn(\"unknown route description found - only know to handle ExperimentalTransitRoute, got \" + leg.getRoute().getClass().getCanonicalName());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// add the legs travel time\n\t\t\t\t\t\tif(leg.getTravelTime().isUndefined()){\n\t\t\t\t\t\t\tlog.debug(\"Undefined travel time found\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\trunningTime += leg.getTravelTime().seconds();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn agentId2PlannedDepartureMap;\n\t}", "public static void main(String[] args) {\n LinkedHashMap<Integer, Pracownik> mapa = new LinkedHashMap<>();\n Pracownik[] pracownicy = {\n new Pracownik(\"Agnieszka\"),\n new Pracownik(\"Aga\"),\n new Pracownik(\"Damian\"),\n new Pracownik(\"Michał\"),\n new Pracownik(\"Agnieszka\"),\n new Pracownik(\"Aga\"),\n new Pracownik(\"Damian\"),\n new Pracownik(\"Michał\"),\n new Pracownik(\"Agnieszka\"),\n new Pracownik(\"Aga\"),\n new Pracownik(\"Damian\"),\n new Pracownik(\"Michał\"),\n new Pracownik(\"Agnieszka\"),\n new Pracownik(\"Aga\"),\n new Pracownik(\"Damian\"),\n new Pracownik(\"Michał\"),\n new Pracownik(\"Agnieszka\"),\n new Pracownik(\"Aga\"),\n new Pracownik(\"Damian\"),\n new Pracownik(\"Michał\")\n };\n\n for(Pracownik pracownik: pracownicy){\n mapa.put(pracownik.getID(),pracownik);\n }\n System.out.println(mapa);\n\n mapa.remove(3);\n\n\n mapa.put(4,new Pracownik(\"Asia\"));\n mapa.put(3,new Pracownik(\"Patryk\"));\n\n\n\n mapa.entrySet();\n System.out.println(mapa);\n for(Map.Entry<Integer,Pracownik> wpis: mapa.entrySet() ){\n // System.out.println(\"ID \" + wpis.getKey()+ \" Imie: \" + wpis.getValue().getImie());\n\n\n\n\n System.out.println(\"ID Pracownika \"+ wpis.getKey());\n System.out.println(\"Imie \" + wpis.getValue().getImie());\n\n\n }\n System.out.println(\"---------------------------------------------------------------\");\n TreeMap<Integer,Pracownik> mapaPosotrowana = new TreeMap<Integer, Pracownik>(mapa);\n\n Map<Integer,Pracownik> subMapa = mapaPosotrowana.subMap(0,4);\n\n for(Map.Entry<Integer,Pracownik> wpis: subMapa.entrySet() ){\n // System.out.println(\"ID \" + wpis.getKey()+ \" Imie: \" + wpis.getValue().getImie());\n\n\n\n if(subMapa.isEmpty()){\n System.out.println(\"PUSTO\");\n }else{\n System.out.println(\"ID Pracownika \"+ wpis.getKey());\n System.out.println(\"Imie \" + wpis.getValue().getImie());\n }\n\n }\n\n Map<Date, Event> exampleMap;\n\n\n\n\n\n\n\n\n\n }", "public static void main(String[] args) {\n\t\tList<Map<String, Object>> dataList = new ArrayList<>();\n\t\tMap<String, Object> apple = new TreeMap<>();\n\t\tapple.put(\"Items\", \"Apple\");\n\t\tapple.put(\"Price\", 20.00);\n\t\tapple.put(\"Quantity\", 10);\n\n\t\tdataList.add(apple);\n\n\t\tMap<String, Object> orange = new TreeMap<String, Object>();\n\t\torange.put(\"Items\", \"Orange\");\n\t\torange.put(\"Price\", 21.99);\n\t\torange.put(\"Quantity\", 10);\n\n\t\tdataList.add(orange);\n\n\t\tSet<String> appleEntry = apple.keySet();\n\n\t\tIterator<String> appleIt = appleEntry.iterator();\n\n\t\tObject t = 0;\n\t\twhile (appleIt.hasNext()) {\n\t\t\tString key = appleIt.next();\n\t\t\tObject value = apple.get(key);\n\n\t\t\tdouble p = (double) apple.get(\"Price\");\n\t\t\tInteger q = (Integer) apple.get(\"Quantity\");\n\t\t\tt = p * q;\n\n\t\t\tSystem.out.print(key + \": \" + value + \" \");\n\t\t}\n\t\tSystem.out.println(\"SubTotal: \" + t);\n\n\t\tSet<String> orangeEntry = orange.keySet();\n\n\t\tObject t1 = 0;\n\t\tfor (String forLoop : orangeEntry) {\n\t\t\tString key = forLoop;\n\t\t\tObject value = orange.get(forLoop);\n\n\t\t\tDouble p = (Double) orange.get(\"Price\");\n\t\t\tInteger q = (Integer) orange.get(\"Quantity\");\n\t\t\tt1 = p * q;\n\n\t\t\tSystem.out.print(key + \": \" + value + \" \");\n\t\t}\n\t\tSystem.out.println(\"SubTotal: \" + t1);\n\n\t\tdouble appleTotal = (double) t;\n\t\tdouble orangeTotal = (double) t1;\n\t\tdouble totalPurchase = appleTotal + orangeTotal;\n\n\t\tSystem.out.println(\"Your Purchase is: \" + totalPurchase);\n\n\t\tSystem.out.println(\"- - - A N O T H E R - W A Y - - -\");\n\n\t\tList<Map<String, Object>> dataList1 = new ArrayList<Map<String, Object>>();\n\n\t\tMap<String, Object> appleMap = new HashMap<String, Object>();\n\t\tappleMap.put(\"Items\", \"Apple\");\n\t\tappleMap.put(\"Price\", 20.00);\n\t\tappleMap.put(\"Quantity\", 10);\n\t\tdataList1.add(appleMap);\n\n\t\tMap<String, Object> orangeMap = new HashMap<String, Object>();\n\t\torangeMap.put(\"Items\", \"Orange\");\n\t\torangeMap.put(\"Price\", 21.99);\n\t\torangeMap.put(\"Quantity\", 10);\n\n\t\tdataList1.add(orangeMap);\n\n\t\t// find purchase total Price.\n\t\tdouble purchaseTotalPrice = 0;\n\n\t\tfor (Map<String, Object> map : dataList1) {\n\t\t\tString items = map.get(\"Items\").toString();\n\t\t\tdouble price = Double.parseDouble(map.get(\"Price\").toString());\n\t\t\tdouble quantity = Double.parseDouble(map.get(\"Quantity\").toString());\n\t\t\tdouble lineTotal = price * quantity;\n\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"Items: \" + items + \" Price: \" + price + \" Quantity: \" + quantity + \" SubTotal: \" + lineTotal);\n\t\t\tpurchaseTotalPrice += lineTotal;\n\t\t}\n\t\tSystem.out.println(\"Your Purchase total : \" + purchaseTotalPrice);\n\t}", "public Map<String, Date> addToMap(List<String> names) {\r\n\t\tMap<String, Date> nameBirthdayMap = new HashMap<String, Date>();\r\n\t\tfor (String name : names) {\r\n\t\t\tnameBirthdayMap.put(toMixedCase(name), calculateBirthday(name));\r\n\t\t}\r\n\t\treturn nameBirthdayMap;\r\n\t}", "public void printBookings(){\r\n\t\t//Treemap is used to sort the bookings into calendar order\r\n\t\tTreeMap<Calendar, Integer> m = new TreeMap<Calendar, Integer>();\r\n\t\tSet<Integer> booking = listBookings();\r\n\t\t\r\n\t\t//loops through getting each booking and puts it into the treemap\r\n\t\tfor (Integer id: booking){\r\n\t\t\tBooking b = bookings.get(id);\r\n\t\t\tm.put(b.start(), b.getLength());\r\n\t\t}\r\n\t\t\r\n\t\t//For each calendar in treemap it prints out the date and length of the booking\r\n\t\tSet<Calendar> cal = m.keySet();\r\n\t\tfor(Calendar c: cal) {\r\n\t\t\tprint(c);\r\n\t\t\tSystem.out.print(\" \" + m.get(c));\r\n\t\t}\r\n\t}", "@Test\n public void testDisplayOrders() {\n System.out.println(\"displayOrders\");\n\n HashMap<String, HashMap<Integer, Order>> testMap = new HashMap<>();\n HashMap<Integer, Order> testMap2 = new HashMap<>();\n OrderOperations instance = new OrderOperations();\n Order testOrder = new Order();\n int orderNumber = 1;\n String date = \"03251970\";\n testOrder.setOrderNumber(1);\n testOrder.setCustomerName(\"Barack\");\n testOrder.setState(\"MI\");\n testOrder.setTaxRate(5.75);\n testOrder.setProductType(\"Wood\");\n testOrder.setArea(700);\n testOrder.setCostPerSquareFoot(5.15);\n testOrder.setLaborCostPerSquareFoot(4.75);\n testMap2.put(orderNumber, testOrder);\n instance.getOrderMap().put(date, testMap2);\n assertEquals(instance.displayOrders(date).contains(\"Wood\"), true);\n assertEquals(instance.displayOrders(date).contains(\"700\"), true);\n assertEquals(instance.displayOrders(date).contains(\"Laminate\"), false);\n\n }", "public Map<LocalDate,Double> getTradeValuesByDate(List<Trade> tradeList,String tradeType) {\n\t\t\r\n\t\tMap<LocalDate,Double> tradesValueMap= new TreeMap();\r\n\t\tfor(Trade t: tradeList){\r\n\t\t\tif (t.getInstructionType().equalsIgnoreCase(tradeType)) {\r\n\t\t\t\tLocalDate dateKey = t.getSettlementDate();\r\n\t\t\t\tdouble tradeAmount = t.getTotalAmount();\r\n\t\t\t\tif (tradesValueMap.get(dateKey) != null) {\r\n\t\t\t\t\ttradeAmount += tradesValueMap.get(dateKey);\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttradesValueMap.put(dateKey, tradeAmount);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn tradesValueMap;\r\n\t}", "public static void sortbyValue()\n {\n //1. Create a list from elements of HashMap\n List<Map.Entry<Integer,String>> list = new LinkedList<>(map.entrySet());\n\n //2. Sort the list -- >Sory via Value\n //Collections.sort(list, (Map.Entry<Integer,String> o1,Map.Entry<Integer,String> o2) -> (o1.getKey().compareTo(o2.getKey())));\n\n //2. Sort the list -- >Sory via Key\n Collections.sort(list, (Map.Entry<Integer,String> o1,Map.Entry<Integer,String> o2) -> (o1.getValue().compareTo(o2.getValue())));\n\n \n //3. Put data from sorted list to map\n Map<Integer,String> temp = new LinkedHashMap<Integer,String>();\n\n for(Map.Entry<Integer,String> entry : list)\n {\n temp.put(entry.getKey(), entry.getValue());\n }\n\n //4. Printing the data from map\n for(Map.Entry<Integer,String> entry : temp.entrySet())\n {\n System.out.println(entry.getKey()+\" \"+entry.getValue());\n }\n }", "private void sortPlayerScores(){\n text=\"<html>\";\n for (int i = 1; i <= Options.getNumberOfPlayers(); i++){\n if(Collections.max(playerScores.entrySet(), (entry1, entry2) -> entry1.getValue() - entry2.getValue()).getKey() != null){\n Integer pl = Collections.max(playerScores.entrySet(), (entry1, entry2) -> entry1.getValue() - entry2.getValue()).getKey();\n if(pl != null && playerScores.containsKey(pl)){\n text += \"<p>Player \" + pl + \" Scored : \" + playerScores.get(pl) + \" points </p></br>\";\n playerScores.remove(pl);\n }\n }\n }\n text += \"</html>\";\n }", "public void CheckHands(){\n HashMap<CardRank, Integer> CardMap = getCardMap(ranks);\n ArrayList<Integer> MapValues = new ArrayList<>(CardMap.values());\n //sort MapValues in descending order, so that we can use\n // MapValues.get(0) to get the largest appear time and so on\n Collections.sort(MapValues, Collections.reverseOrder());\n System.out.print(\"Player 1: \");\n\n\n //Straight flush\n if (flush(suits) && straight(ranks)){\n System.out.println(ranks.get(ranks.size()-1).getName()\n + \"-high straight flush\");\n return;\n }\n\n //Four of a kind\n if (MapValues.get(0) == 4){\n CardRank rank4 = getKeysByValue(CardMap, 4).get(0);\n System.out.println(\"Four \" + rank4.getName() + \"s\");\n return;\n }\n\n //full house\n if (MapValues.get(0) == 3 && MapValues.get(1) == 2){\n CardRank rank3 = getKeysByValue(CardMap, 3).get(0);\n CardRank rank2 = getKeysByValue(CardMap,2).get(0);\n System.out.println(rank3.getName() + \"s full of \"\n + rank2.getName()+\"s\");\n return;\n }\n\n //Flush (not straight)\n if (flush(suits) && !straight(ranks)) {\n System.out.println(ranks.get(ranks.size() - 1).getName()\n + \"-high flush\");\n return;\n }\n\n //Straight (not flush)\n if (straight(ranks) && !flush(suits)){\n System.out.println(ranks.get(ranks.size() - 1).getName()\n + \"-high straight\");\n return;\n }\n\n //Three of a kind (not full house)\n if (MapValues.get(0) == 3 && MapValues.get(1) != 2){\n CardRank rank3 = getKeysByValue(CardMap, 3).get(0);\n System.out.println(\"Three \" + rank3.getName() + \"s\");\n return;\n }\n\n //Two Pair\n if (MapValues.get(0) == 2 && MapValues.get(1) == 2){\n CardRank rank21 = getKeysByValue(CardMap,2).get(0);\n CardRank rank22 = getKeysByValue(CardMap, 2).get(1);\n System.out.println(rank22.getName() + \"s over \"\n + rank21.getName() + \"s\" );\n return;\n\n }\n\n //One pair (only one)\n if (MapValues.get(0) == 2 && MapValues.get(1) == 1){\n CardRank rank2 = getKeysByValue(CardMap, 2).get(0);\n System.out.println(\"Pair of \" + rank2.getName()+ \"s\");\n return;\n }\n\n //High Card (not flush)\n if (MapValues.get(0) == 1 && !flush(suits)){\n System.out.println(ranks.get(ranks.size() - 1).getName() + \"-high\");\n return;\n }\n }", "@Test\n void BasicTestCase_ContainsAllDays() {\n Solution solObj = new Solution();\n\n // Input Dictionary has all the day\n Map<String, Integer> input0 = Stream.of(new Object[][]{\n {\"2020-01-01\", 4}, {\"2020-01-02\", 4}, {\"2020-01-03\", 6}, {\"2020-01-04\", 8}, {\"2020-01-05\", 2}, {\"2020-01-06\", -6}, {\"2020-01-07\", 2}, {\"2020-01-08\", -2}\n }).collect(Collectors.toMap(data -> (String) data[0], data -> (Integer) data[1]));\n\n //output\n Map<String, Integer> expected0 = Stream.of(new Object[][]{\n {\"Mon\", -6}, {\"Tue\", 2}, {\"Wed\", 2}, {\"Thu\", 4}, {\"Fri\", 6}, {\"Sat\", 8}, {\"Sun\", 2}\n }).collect(Collectors.toMap(data -> (String) data[0], data -> (Integer) data[1]));\n\n\n LinkedHashMap<String, Integer> result = solObj.dateToDay(input0);\n assertEquals(expected0, result);\n\n }", "public Map<Number, Double> getThePastPrices(Number stockID, Number stDate, Number enDate) {\n Map<Number, Double> m = new HashMap<Number, Double>();\n\n //get VO instance\n TestStockPricesVOImpl tspVO = getTestStockPricesVO();\n\n //get VC instance\n ViewCriteria vc =\n tspVO.getViewCriteria(\"GetStockPricesInGivenDateRangeCriteria\");\n vc.resetCriteria();\n\n //set All the bind parameters\n tspVO.setBindStockID(stockID);\n tspVO.setBindStartDate(stDate);\n tspVO.setBindEndDate(enDate);\n \n //apply the view criteria\n tspVO.applyViewCriteria(vc);\n \n //execute the view Object programatically\n tspVO.executeQuery();\n System.out.print(\"Row count: \");\n System.out.println(tspVO.getRowCount());\n\n //Iterate through the results\n RowSetIterator it = tspVO.createRowSetIterator(null);\n while (it.hasNext()) {\n TestStockPricesVORowImpl newRow = (TestStockPricesVORowImpl)it.next();\n Number datetracked = newRow.getDatetracked();\n Number timetracked = newRow.getTimetracked();\n Number price = newRow.getPrice();\n \n m.put(datetracked, price.doubleValue());\n }\n it.closeRowSetIterator();\n return m;\n }", "private static void init() {\n\n students = new HashMap<String, Student>(); //redundant but there for my reference\n\n //new Student objects, from the Student class, that are in our new HashMap called students\n Student annette = new Student(\"Annette\");\n annette.addGrade(90); // addGrade method from the Student class\n annette.addGrade(85);\n annette.addGrade(40);\n\n annette.recordAttendance( \"2019-10-01\", \"A\");\n annette.recordAttendance( \"2019-10-02\", \"P\");\n annette.recordAttendance( \"2019-10-03\", \"A\");\n annette.recordAttendance( \"2019-10-04\", \"P\");\n\n\n Student bridget = new Student(\"Bridget\");\n bridget.addGrade(90);\n bridget.addGrade(70);\n bridget.addGrade(60);\n\n bridget.recordAttendance( \"2019-10-01\", \"A\");\n bridget.recordAttendance( \"2019-10-02\", \"P\");\n bridget.recordAttendance( \"2019-10-03\", \"A\");\n bridget.recordAttendance( \"2019-10-04\", \"P\");\n\n\n Student bev = new Student(\"Bev\");\n bev.addGrade(97);\n bev.addGrade(96);\n bev.addGrade(95);\n\n bev.recordAttendance( \"2019-10-01\", \"A\");\n bev.recordAttendance( \"2019-10-02\", \"P\");\n bev.recordAttendance( \"2019-10-03\", \"A\");\n bev.recordAttendance( \"2019-10-04\", \"P\");\n\n\n Student glo = new Student(\"Glo\");\n glo.addGrade(94);\n glo.addGrade(93);\n glo.addGrade(92);\n\n glo.recordAttendance( \"2019-10-01\", \"A\");\n glo.recordAttendance( \"2019-10-02\", \"P\");\n glo.recordAttendance( \"2019-10-03\", \"A\");\n glo.recordAttendance( \"2019-10-04\", \"P\");\n\n\n // sets the usernames as keys\n // and values that are student objects\n students.put(\"bmills\", bridget);\n students.put(\"annette1\", annette);\n students.put(\"bevvybev\", bev);\n students.put(\"thegloUp\", glo);\n\n }", "@Test\n public void test12() {\n cashRegister.addPennies(99);\n cashRegister.addDimes(2);\n cashRegister.addDimes(3);\n cashRegister.addFives(10);\n cashRegister.addNickels(4);\n cashRegister.addOnes(1);\n cashRegister.addQuarters(1);\n cashRegister.addTens(5);\n Map<Integer, Integer> map = new TreeMap<Integer, Integer>();\n map.put(1000,5);\n map.put(500,10);\n map.put(100,1);\n map.put(25,1);\n map.put(10,5);\n map.put(5,4);\n map.put(1,99);\n\n assertEquals(map,cashRegister.getContents());\n Map<Integer, Integer> map1 = new TreeMap<Integer, Integer>();\n map1 = cashRegister.getContents();\n map1.put(0,1);\n assertEquals(map,cashRegister.getContents());\n }", "private void buildProjectMonthTotals(List<TimeEntry> timeEntries) {\n projects.clear();\n for(TimeEntry te: timeEntries) {\n if(te.getStart().getYear() == selectedYear && te.getProject() != null) {\n String projectName = te.getProject().getName();\n String month = formatMonthName(te.getStart().getMonth());\n ProjectModel projectData = projects.get(projectName);\n if(projectData == null) {\n // First entry for the project\n projectData = new ProjectModel(projectName);\n projects.put(projectName, projectData);\n }\n projectData.addHours(month, (float) te.getDuration() / 3600.0);\n }\n }\n }", "abstract protected Map<DataDate, ArrayList<String>> ListDatesFilesFTP();", "private Map<Good, Integer> initiateMarketplace() {\n Random noise = new Random();\n Map<Good, Integer> map = Collections.synchronizedMap(\n new EnumMap<Good, Integer>(Good.class));\n for (Good item : Good.values()) {\n if (item.getMinTech() <= techLevel) {\n Integer price = Math.max(item.getBasePrice()\n - (techLevel - item.getMinTech()) + alignment.getPriceChange()\n + noise.nextInt(5),\n 5);\n map.put(item, price);\n }\n }\n return map;\n }", "public void setUpPlayers(){\n\t\tTreeMap<String,Integer> turnsDetails = new TreeMap<>();\n\t\tint e = 0;\n\t\tfor(Player i : allplayers) {\n\t\t\ti.fillHand();\n\t\t\tturnsDetails.put(i.getFirstLetter()+String.valueOf(e),e);\n\t\t\te++;\n\t\t}\n\t\t// populate the turn list\n //entryset returns a set view of mappings contained\n\t\tfor(Map.Entry<String,Integer> i : turnsDetails.entrySet())\n\t\t\tturns.add(i.getValue());\n\t}", "@Override\n\t\tpublic void map(Key key, Value value, Context context)\n\t\t\t\tthrows IOException, InterruptedException {\n\t\t\tSortedMap<Key,Value> entries = WholeRowIterator.decodeRow(key, value);\n\t\t\t\n\t\t\t// If we have counts for the given ngram for both time periods, we will have 2 Entrys that look like\n\t\t\t// RowId: ngram\n\t\t\t// CQ: Date Granularity (ex. DAY, HOUR)\n\t\t\t// CF: Date Value (ex. 20120102, 2012010221)\n\t\t\t// Value: count\n\t\t\t// We know the entries are sorted by Key, so the first entry will have the earlier date value \n\t\t\tif ( entries.size() == 2 ) {\n\t\t\t\t\n\t\t\t\t// Read the Entrys and pull out the two counts\n\t\t\t\tlong [] counts = new long[2];\n\t\t\t\tint index = 0;\n\t\t\t\tfor ( Entry<Key,Value> entry : entries.entrySet() ) {\n\t\t\t\t\tcounts[index++] = LongCombiner.VAR_LEN_ENCODER.decode( entry.getValue().get());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Generate a trending score for this ngram\n\t\t\t\tint score = calculateTrendingScore( counts, context );\n\t\t\t\t\n\t\t\t\t// If we have a valid score, write out the score to Accumulo\n\t\t\t\tif ( score > 0 ) {\n\t\t\t\t\t\n\t\t\t\t\tint sortableScore = Integer.MAX_VALUE - score;\n\t\t\t\t\t\n\t\t\t\t\t// RowId is the time we are calculating trends for, i.e. DAY:20120102\n\t\t\t\t\t// CF is Integer.MAX_VALUE - trending score so that we sort the highest scores first\n\t\t\t\t\t// CQ is the ngram\n\t\t\t\t\t// Value is empty\n\t\t\t\t\tString rowId = context.getConfiguration().get(\"rowId\");\n\t\t\t\t\tMutation mutation = new Mutation( rowId );\n\t\t\t\t\tmutation.put( new Text( String.valueOf(sortableScore)), entries.firstKey().getRow(), emptyValue );\n\t\t\t\t\tcontext.write( null, mutation );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "private void buildGame (Game game) throws ServiceException {\r\n\r\n List<Horse> horses = null;\r\n try {\r\n horses = gameHorsesDao.findAll(game.getId());\r\n } catch (DaoException e) {\r\n logger.error(e);\r\n throw new ServiceException(e);\r\n }\r\n game.setHorses(horses);\r\n\r\n Map<Horse, List<BetType>> horseBetTypes = new LinkedHashMap<>();\r\n\r\n for (Horse horse : horses){\r\n\r\n try {\r\n if (gameBetsDao.findAllByHorseId(game.getId(), horse.getId()) == null){\r\n horseBetTypes.put(horse, new ArrayList<>());\r\n } else {\r\n List<BetType> betTypes = gameBetsDao.findAllByHorseId(game.getId(), horse.getId());\r\n horseBetTypes.put(horse, betTypes);\r\n }\r\n } catch (DaoException e) {\r\n logger.error(e);\r\n throw new ServiceException(e);\r\n }\r\n }\r\n\r\n game.setHorseBetTypes(horseBetTypes);\r\n }", "public MovieRentingSystem(int n, int[][] entries) {\r\n cheapestUnrentedShops = new HashMap();\r\n cheapestRentedMovies = new TreeSet<int []>((a,b) -> a[2] == b[2] ? (a[0] == b[0] ? a[1] - b[1] : a[0] - b[0]) : a[2] - b[2]);\r\n movieToShopToEntry = new HashMap();\r\n \r\n for(int []entry: entries){\r\n int shop = entry[0];\r\n int movie = entry[1];\r\n \r\n Map<Integer, int []> hm = movieToShopToEntry.getOrDefault(movie, new HashMap());\r\n hm.put(shop, entry);\r\n movieToShopToEntry.put(movie, hm);\r\n \r\n TreeSet<int []> ts = cheapestUnrentedShops.getOrDefault(movie, new TreeSet<int []>((a,b) -> a[2] == b[2] ? a[0] - b[0] : a[2] - b[2]));\r\n ts.add(entry);\r\n cheapestUnrentedShops.put(movie, ts);\r\n }\r\n }", "private void sortViewEntries() {\n runOnUiThread(new Runnable() {\n public void run() {\n try {\n Collections.sort(viewEntries, new DateComparator());\n } catch (final Exception ex) {\n // Log.i(\"sortViewEntries\", \"Exception in thread\");\n }\n }\n });\n }", "public SoftHashMap<Integer,TimeEntry> getTimeEntries(final int projectId, final int issueId, final int userId, final SpentOn spentOn)\n throws RedmineException\n {\n SoftHashMap<Integer,TimeEntry> timeEntryMap = new SoftHashMap<Integer,TimeEntry>();\n\n // update number of time entries, start date\n updateTimeEntryData();\n\n // get data\n synchronized(timeEntries)\n {\n for (int i = 0; i < timeEntries.size(); i++)\n {\n // get soft-reference for entry\n SoftReference<TimeEntry> softReference = timeEntries.get(i);\n if ((softReference == null) || (softReference.get() == null))\n {\n // fill time entry array (get as much data a possible with single request)\n fillTimeEntry(i,ENTRY_LIMIT);\n\n // get soft-reference for entry\n softReference = timeEntries.get(i);\n }\n\n // get time entry\n if ((softReference != null) && (softReference.get() != null))\n {\n TimeEntry timeEntry = softReference.get();\n\n if (matchTimeEntry(timeEntry,projectId,issueId,userId,spentOn))\n {\n//Dprintf.dprintf(\"add timeEntry=%s\",timeEntry);\n timeEntryMap.put(timeEntry.id,timeEntry);\n }\n//else { Dprintf.dprintf(\"reject timeEntry=%s\",timeEntry); }\n\n // stop when date is found before given spent date (Note: assume time entries are sorted descended)\n if (timeEntry.spentOn.isBefore(spentOn))\n {\n//Dprintf.dprintf(\"stop %s\",timeEntry);\n break;\n }\n }\n }\n }\n\n return timeEntryMap;\n }", "public static List<InvoiceDto> createRevenueFinancialSummary(List<InvoiceDto> dtos)\n {\n HashMap<String, InvoiceDto> map = new HashMap<String, InvoiceDto>();\n List<InvoiceDto> retList = new ArrayList<InvoiceDto>();\n\n for (InvoiceDto dto : dtos) {\n\n String key = String.valueOf(dto.getMonthYear().getYear()) + \"01\";\n\n InvoiceDto entry = null;\n if (map.containsKey(key)) {\n entry = map.get(key);\n } else {\n entry = new InvoiceDto();\n entry.setMonthYear(new MonthYear(key));\n\n entry.setHours(0.0);\n entry.setTotalGross(0.0);\n entry.setTotalRecvGross(0.0);\n map.put(key, entry);\n }\n\n entry.setHours(entry.getHours() + dto.getHours());\n\n entry.setTotalGross(entry.getTotalGross() + dto.getTotalGross());\n if (!DateTimeUtils.isNullDate(dto.getReceivedDate()))\n {\n entry.setTotalRecvGross(entry.getTotalRecvGross() + dto.getTotalGross());\n }\n }\n\n for (String key : map.keySet())\n {\n retList.add(map.get(key));\n }\n\n SortUtils.sortFinancialDto(retList, false);\n\n return retList;\n }", "private static void analyse1() {\n\t\tList<String> twoYearIncomeInRateList2 = getTwoYearIncomeInRateList(BasicAnalyse.stockBasicMap.keySet(), 0, 10000, \"2016-4\", \"2015-4\");\r\n\t\tList<String> twoYearIncomeInRateList = getTwoYearIncomeInRateList(twoYearIncomeInRateList2, 0, 10000, \"2017-2\", \"2016-2\");\r\n\t\tList<String> twoYearProfitInRateList = getTwoYearProfitInRateList(twoYearIncomeInRateList, 0, 10000, \"2017-2\", \"2016-2\");\r\n\t\tList<String> twoSeasonIncomeInRateList = getTwoSeasonIncomeInRateList(twoYearProfitInRateList, 0, 10000, \"2017-2\", \"2017-1\");\r\n\t\tList<String> twoSeasonProfitInRateList = getTwoSeasonProfitInRateList(twoSeasonIncomeInRateList, 0, 10000, \"2017-2\", \"2017-1\");\r\n\t\tHashMap<String, List<HistoryDomain>> codeHisMap = HistoryAnalyse.getCodeHisMap(HistoryAnalyse.historyMap, twoSeasonProfitInRateList);\r\n\t\tHashMap<String, List<HistoryDomain>> orderDateMap = HistoryAnalyse.getOrderDateMap(codeHisMap);\r\n\t\tHashMap<String, String> dieTingTimeMap = PriceAnalyse.getDieTingLastTimeMap(orderDateMap, 5, -100, -20);\r\n\t\tHashMap<String, String> endDateMap = AnalyseUtil.getCodeDateMap(orderDateMap.keySet(), \"2017-10-13\");\r\n\t\tHashMap<String, List<HistoryDomain>> orderDateDTMap = HistoryAnalyse.getCodeHisMap(orderDateMap, dieTingTimeMap.keySet());\r\n\t\tHashMap<String, List<HistoryDomain>> afterDieTingHisMap = HistoryAnalyse.getHisMapByStartAndEndDateMap(orderDateDTMap, dieTingTimeMap, endDateMap);\r\n\t\tHashMap<String, Double> highestFlowInRate = PriceAnalyse.getHighestFlowInRate(afterDieTingHisMap, -2000, 20);\r\n\t\tHashMap<String, List<String>> conceptListMap = ConceptAnalyse.getConceptListMap(highestFlowInRate.keySet());\r\n\r\n\t\t\r\n\t\tSystem.out.println(conceptListMap);\r\n\t}", "public TreeMap<String, DigitalCostData> enact(final DateTime startDate, final DateTime endDate) throws DependencyFailureException, MissingArgumentException, InvalidRequestException {\n\n final DigitalTransactionsResponse dvsTransactionsResponse = dvs_svc.getAllTransactionsByPeriod(startDate.toDate(), endDate.toDate(), null);\n final TreeMap<String, DigitalCostData> tMap = new TreeMap<String, DigitalCostData>(String.CASE_INSENSITIVE_ORDER);\n \n if (dvsTransactionsResponse != null) {\n \tfinal Vector<DigitalTransaction> digitalTransactionSummaries = dvsTransactionsResponse.getDigitalTransactions();\n\n for (DigitalTransaction transactionSummary: digitalTransactionSummaries) {\n final Vector<DigitalCostData> digitalCostSummaries = transactionSummary.getDigitalCostsData();\n \n //Ensures uniqueness of entries, no duplicate costIds will be stored.\n for (DigitalCostData costSummary: digitalCostSummaries) {\n \tif (costSummary.hasCostId()) {\n \t\ttMap.put(costSummary.getCostId(), costSummary);\n \t}\n }\n }\n }\n System.out.println(\"DVS: \" + tMap.size());\n return tMap;\n }", "public void allBookings() {\n\t\t\tint i = 0;\r\n\t\t\tint k = 0;\r\n\t\t\tint j = 0;\r\n\t\t\tint roomNum; //Room number\r\n\t\t\tint buffNum; //buff room number\r\n\t\t\tint index = 0; //saves the index of the date stored in the arraylist dateArray\r\n\t\t\tBooking buff; //Booking buffer to use\r\n\t\t\tRooms roomCheck;\r\n\t\t\tArrayList<LocalDate> dateArray = new ArrayList<LocalDate>(); //Saves the booking dates of a room\r\n\t\t\tArrayList<Integer> nights = new ArrayList<Integer>(); //Saves the number of nights a room is booked for\r\n\t\t\t\r\n\t\t\twhile(i < RoomDetails.size()) { //Looping Room Number-wise\r\n\t\t\t\troomCheck = RoomDetails.get(i);\r\n\t\t\t\troomNum = roomCheck.getRoomNum();\r\n\t\t\t\tSystem.out.print(this.Name + \" \" + roomNum);\r\n\t\t\t\twhile(k < Bookings.size()) { //across all bookings\r\n\t\t\t\t\tbuff = Bookings.get(k);\r\n\t\t\t\t\twhile(j < buff.getNumOfRoom()) { //check each booked room\r\n\t\t\t\t\t\tbuffNum = buff.getRoomNumber(j);\r\n\t\t\t\t\t\tif(buffNum == roomNum) { //If a booking is found for a specific room (roomNum)\r\n\t\t\t\t\t\t\tdateArray.add(buff.getStartDate()); //add the date to the dateArray\r\n\t\t\t\t\t\t\tCollections.sort(dateArray); //sort the dateArray\r\n\t\t\t\t\t\t\tindex = dateArray.indexOf(buff.getStartDate()); //get the index of the newly add date\r\n\t\t\t\t\t\t\tnights.add(index, buff.getDays()); //add the number of nights to the same index as the date\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tj++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tk++;\r\n\t\t\t\t\tj=0;\r\n\t\t\t\t}\r\n\t\t\t\ti++;\r\n\t\t\t\tprintOccupancy(dateArray, nights); //print the occupancy of the room\r\n\t\t\t\tk=0;\r\n\t\t\t\tdateArray.clear(); //cleared to be used again\r\n\t\t\t\tnights.clear(); //cleared to be used again\r\n\t\t\t}\r\n\t\t}", "public Map<Integer, List<CellEntry>> buildShipMap() {\n Map<Integer, List<CellEntry>> shipCellMap = new HashMap<>();\n for (int i = 0; i < BOARD_CELL_NUM_PER_SIDE; i++) {\n for (int j = 0; j < BOARD_CELL_NUM_PER_SIDE; j++) {\n Cell cell = getCell(i, j);\n if (cell.getShipIndex() != -1) {\n int shipIndex = cell.getShipIndex();\n if (!shipCellMap.containsKey(shipIndex)) {\n shipCellMap.put(shipIndex, new ArrayList<>());\n }\n\n CellEntry cellEntry = new CellEntry(cell.getIndex(), cell.getShipIndex());\n shipCellMap.get(shipIndex).add(cellEntry);\n }\n }\n }\n return shipCellMap;\n }", "public static void main(String[] args) {\n\t\tMap<String,Integer>grocery=new HashMap<>();\n\t\tgrocery.put(\"milk\",1);\n\t\tgrocery.put(\"cucumber\",3);\n\t\tgrocery.put(\"banana\",12);\n\t\tgrocery.put(\"cheese\",2);\n\t\t\n\t\tSystem.out.println(grocery);\n//create a map of items to buy, we want to save order\n\t\tMap<String,Integer>household=new LinkedHashMap<>();\n\t\thousehold.put(\"lysol\",2);\n\t\thousehold.put(\"sanitizer\",4);\n\t\thousehold.put(\"papertowel\",2);\n\t\thousehold.put(\"facemask\",20);\n\t\tSystem.out.println(household);\n\t\t\n\t\t//create a map in which we store all previous items in ascending order\n\t\tMap<String,Integer>shopping=new TreeMap<>();\n\t\tshopping.putAll(household);\n\t\tSystem.out.println(shopping);\n\t\t\n\t\t//get all keys using loop\n\t\tfor(String key:shopping.keySet()) {\n\t\t\tSystem.out.println(\"Key: \"+key);\t\n\t\t}\n\t\t//get all keys using iterator\n\t\tIterator<String> it=shopping.keySet().iterator();\n\t\twhile(it.hasNext()) {\n\t\tSystem.out.println(\"Key=\"+it.next());\n\t\t\n\t}\n\t\t//get all values using loop\n\t\tfor(int val:shopping.values()) {\n\t\t\tSystem.out.println(\"Values: \"+val);\n\t\t}\n\t\t//get all values using iterator\n\t\tIterator<Integer>iterator=shopping.values().iterator();\n\t\twhile(iterator.hasNext()) {\n\t\t\tSystem.out.println(\"Key=\"+iterator.next());\n\t\t\t\t\n}\n}" ]
[ "0.60120595", "0.5830987", "0.5733165", "0.5492905", "0.5469079", "0.54560107", "0.53506494", "0.5302238", "0.52992195", "0.52783084", "0.525541", "0.5250376", "0.52397996", "0.5235195", "0.5216689", "0.5179967", "0.5170452", "0.5159488", "0.5153931", "0.51524764", "0.5111492", "0.51091063", "0.51081127", "0.5107594", "0.50893825", "0.50700504", "0.50640875", "0.50350815", "0.50308865", "0.5030273", "0.50257206", "0.5012328", "0.4998576", "0.49967402", "0.4967099", "0.4957803", "0.49291524", "0.49289882", "0.4924037", "0.48984376", "0.48973364", "0.48879158", "0.48753276", "0.48731637", "0.4873147", "0.48568365", "0.48467252", "0.48395112", "0.48220444", "0.48096725", "0.4794651", "0.47940892", "0.4780332", "0.47781816", "0.4775086", "0.4774083", "0.476953", "0.47679582", "0.47533178", "0.47307953", "0.47259638", "0.4712745", "0.47087866", "0.47067243", "0.4702194", "0.46960527", "0.4694898", "0.4689309", "0.46892577", "0.4685402", "0.4683842", "0.46832484", "0.46732306", "0.46711376", "0.4668401", "0.46683857", "0.46596572", "0.46571815", "0.46565235", "0.4656372", "0.46528402", "0.46366", "0.4635855", "0.46275848", "0.46257275", "0.46249372", "0.4622032", "0.46175283", "0.4616808", "0.46107802", "0.46084762", "0.46072033", "0.45971587", "0.45949075", "0.45935708", "0.45872775", "0.45859948", "0.45856223", "0.45853335", "0.45822534" ]
0.65719044
0
set the interval the crawl is relaunched (default: every day)
protected void setInterval(int seconds) { interval = seconds * 1000L; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void runEachMinute() {\n \n }", "public void setRefreshInterval(String interval) {\n tozAdCampaignRetrievalInterval = parseIntegerValue(interval,0);\n AppyAdService.getInstance().debugOut(TAG,\"Set refresh interval to \"+tozAdCampaignRetrievalInterval);\n }", "protected void runEach10Minutes() {\n try {\n saveHistoryData();\n if (isEnabledScheduler()) {\n boolean action = getLightSchedule().getCurrentSchedule();\n if (action) {\n if (!currentState) switchOn();\n } else {\n if (currentState) switchOff();\n }\n }\n } catch (RemoteHomeManagerException e) {\n RemoteHomeManager.log.error(44,e);\n } catch (RemoteHomeConnectionException e) {\n RemoteHomeManager.log.error(45,e);\n }\n }", "protected void runEachDay() {\n \n }", "public void setInterval(int interval) {\r\n this.interval = interval;\r\n }", "public void interval() {\n APIlib.getInstance().addJSLine(jsBase + \".interval();\");\n }", "@Override\n\tpublic int withIntervalInSeconds() {\n\t\treturn 10;\n\t}", "@AfterEach\n public void setTimeInterval() {\n try {\n TimeUnit.SECONDS.sleep(Long.valueOf(settings.getTimeInterval()));\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "public void reapet(int interval) {\n Calendar calendar = Calendar.getInstance();\n calendar.setTimeInMillis(System.currentTimeMillis());\n defineAlartRepeat(calendar, interval, AlarmManager.ELAPSED_REALTIME_WAKEUP);\n }", "public void run() {\n\t\t\t\tIMSScheduleManager.super.startCron();\r\n\t\t\t\t\r\n\t\t\t}", "public void setInterval( String interval )\n\t{\n\t\tthis.interval = interval;\n\t}", "public void setInterval(int interval)\n\t{\n\t\tthis.interval = (long) interval;\n\t}", "@Override\n public void periodic() {\n // This method will be called once per scheduler run\n }", "@Scheduled(cron = \"0 0 8-10 * * *\")\n\tpublic void scheduleTaskHourly() {\n\t\tlog.info(\"Cron Task :: Execution Time Every 8 - 10 O'clock Every Day - {}\", dateTimeFormatter.format(LocalDateTime.now()));\n\t}", "@Override\n public void autonomousPeriodic() {\n \n Scheduler.getInstance().run();\n \n }", "@Scheduled(cron = \"0/20 * * * * *\")\n public void scheduleTaskSecond() {\n\t\tlog.info(\"Cron Task :: Execution Time Every 20 Second - {}\", dateTimeFormatter.format(LocalDateTime.now()));\n\t}", "@Scheduled(initialDelayString = \"${jobs.daily.trigger.init.seconds:3600}000\", fixedDelayString = \"${jobs.daily.trigger.delay.seconds:86400}000\")\n\tpublic void dailyPolling() {\n\t\tif (jazzPartnerTrackingJobEnabled) {\n\t\t\tlog.info(\"Scheduled Daily Jazz Polling Launched\");\n\t\t\tSet<JazzApplicantPollConfiguration> configs = jazzPolling.getDailyPollingConfigs();\n\t\t\tfor (JazzApplicantPollConfiguration config : configs) {\n\t\t\t\tif (\"hired\".equalsIgnoreCase(config.getStatus())) {\n\t\t\t\t\tjazzPolling.pollJazzHires(config);\n\t\t\t\t} else {\n\t\t\t\t\tjazzPolling.pollJazzApplicantsByStatus(config);\t\t\n\t\t\t\t}\n\t\t\t} \n\t\t} else {\n\t\t\tlog.info(\"Jazz Daily polling disabled.\");\t\t\t\t\n\t\t}\n\t}", "@Override\n public void autonomousPeriodic() {\n Scheduler.getInstance().run();\n }", "void setHeartbeatInterval(int interval);", "public void autonomousPeriodic() \n {\n Scheduler.getInstance().run();\n }", "public void autonomousPeriodic() {\n Scheduler.getInstance().run();\n }", "public void autonomousPeriodic() {\n Scheduler.getInstance().run();\n }", "public void autonomousPeriodic() {\n Scheduler.getInstance().run();\n }", "public void autonomousPeriodic() {\n Scheduler.getInstance().run();\n }", "public void autonomousPeriodic() {\n Scheduler.getInstance().run();\n }", "public void autonomousPeriodic() {\n Scheduler.getInstance().run();\n }", "public void autonomousPeriodic() {\r\n Scheduler.getInstance().run();\r\n }", "@Override\n public void autonomousPeriodic()\n {\n Scheduler.getInstance().run();\n }", "@Override\n\tpublic void teleopPeriodic() {\n\t\tOI.refreshAll();\n\t\tScheduler.getInstance().run();\n\t\tlog();\n\t}", "public void scheduleDaily(Task job, Date start)\n\t{\n\t\tlong now = System.currentTimeMillis();\n\t\tlong then = start.getTime();\n\t\tlong day = 3600000L * 24L;\n\t\tthen = then % day;\n\t\tnow = now % day;\n\t\tif (then < now) then += day;\n\t\tDateFormat df = DateFormat.getTimeInstance();\n\t\tlog.info(\"Scheduling \" + job + \" to be run daily at \" + df.format(start));\n\t\tscheduleAtFixedRate(job, then - now, day, TimeUnit.MILLISECONDS);\n\t}", "@Override\n\tpublic void autonomousPeriodic() {\n\t\tScheduler.getInstance().run();\t\n\t}", "public void setInterval(int interval) {\n stop();\n if (interval >= 0) {\n pollTimer = new Timer() {\n @Override\n public void run() {\n poll();\n }\n\n };\n pollTimer.scheduleRepeating(interval);\n }\n }", "public void autonomousPeriodic() {\r\n\t\tScheduler.getInstance().run();\r\n\t}", "@Override\n\tpublic void contextInitialized(ServletContextEvent sce) {\n\t\tCalendar calendar = Calendar.getInstance();\n\t\t/************** Update at 3:00 everyday *********************/\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 3);\n\t\tcalendar.set(Calendar.MINUTE, 0);\n\t\tcalendar.set(Calendar.SECOND, 0);\n\t\tDate date = calendar.getTime();\t//第一次执行定时任务的时间\n\t\t\n\t\t//如果第一次执行定时任务的时间早于当前的时间\n //此时要在第一次执行定时任务的时间上加一天,以便此任务在下个时间点执行。如果不加一天,任务会立即执行。循环执行的周期则以当前时间为准\n if (date.before(new Date())) {\n date = this.addDay(date, 1); //后延一天\n System.out.println(date);\n }\n \n\t\tTimer timer = new Timer();\n\t\tUpdate task = new Update();\n\t\t//安排指定的任务在指定的时间开始进行重复的固定延迟执行。\n\t\ttimer.schedule(task, date, PERIOD_DAY);\n\t}", "public void setInterval(int x){\n interval = x;\n }", "public void changePollPeriod(final String url, final Long newPollPeriod) {\n ParseFeedTask task = tasks.get(url);\n if (task == null) {\n System.out.println(String.format(\"Rss with url %s is not found\", url));\n return;\n }\n RssConfiguration configuration = task.getConfiguration();\n configuration.setPollPeriod(newPollPeriod);\n try {\n PropertiesHandler.writeProperties(configuration);\n if (configuration.getTurnOn()) {\n ScheduledFuture future = futures.get(url);\n if (future == null) {\n return;\n }\n future.cancel(false);\n future = scheduledExecutorService.scheduleAtFixedRate(task, configuration.getPollPeriod(), configuration.getPollPeriod(), TimeUnit.SECONDS);\n futures.put(url, future);\n }\n } catch (IOException e) {\n System.out.println(String.format(\"An error occurred during the change poll period for feed %s\", url));\n }\n }", "@Scheduled(fixedRate = 2000)\n\tpublic void scheduleTaskWithFixedRate() {\n\t\tlog.info(\"Fixed Rate Task :: Execution Time - {}\", dateTimeFormatter.format(LocalDateTime.now()) );\n\t}", "@Scheduled(cron = \"0 0 18 * * SUN\")\n\tvoid refreshNotifications(){\n\t\tnotificationService.refreshAll();\n\t}", "protected void runEachHour() {\n \n }", "@Override\n\tpublic void autonomousPeriodic() {\n\t\tScheduler.getInstance().run();\n\t}", "@Override\n\tpublic void autonomousPeriodic() {\n\t\tScheduler.getInstance().run();\n\t}", "@Override\n\tpublic void autonomousPeriodic() {\n\t\tScheduler.getInstance().run();\n\t}", "@Override\n\tpublic void autonomousPeriodic() {\n\t\tScheduler.getInstance().run();\n\t}", "public void teleopPeriodic() {\r\n\t\tScheduler.getInstance().run();\r\n\t}", "public void start(int tickInterval) {\n timer.scheduleAtFixedRate(new TimerTask() {\n @Override\n public void run() {\n garden.anotherDay();\n days++;\n // Saves garden every 50 days\n if (days % 50 == 0) {\n saveGarden();\n }\n }\n }, 0, tickInterval);\n }", "@Override\n public void autonomousPeriodic() \n {\n Scheduler.getInstance().run();\n log();\n }", "@Override\n\tpublic void startMonitoring(int interval, String hostname) {\n\n\t\tString key = hostname + \":\" + interval;\n\t\tlogger.debug(\"started monitoring host: \" + hostname);\n\t\ttimer.scheduleAtFixedRate(new MyTimerTask(paysafeUrl, restTemplate, monitoredHosts, key), new Date(),\n\t\t\t\tinterval * 1000);\n\n\t}", "@Scheduled(cron = \"0 0 10 17 8 ?\")\n\tpublic void scheduleTaskYearly() {\n\t\tlog.info(\"Cron Task :: Execution Time Every 10:00 o'clock in 17 August - {}\", dateTimeFormatter.format(LocalDateTime.now()));\n\t}", "public void teleopPeriodic() {\n Scheduler.getInstance().run();\n }", "public void teleopPeriodic() {\n Scheduler.getInstance().run();\n }", "public void teleopPeriodic() {\n Scheduler.getInstance().run();\n }", "public void teleopPeriodic() {\n Scheduler.getInstance().run();\n }", "public void demoSchduleMethod() {\n log.info(\"Method executed at every 5 seconds. Current time is :: \" + new Date());\n }", "@Scheduled(cron = \"0 0/30 8-9 * * *\")\n\tpublic void scheduleTaskCustomHourly() {\n\t\tlog.info(\"Cron Task :: Execution Time Every 8:00, 8:30, 9:00, 9:30 O'clock Every Day - {}\", dateTimeFormatter.format(LocalDateTime.now()));\n\t}", "private void setCronTime(Settings set) {\n CRON_TIME = set.getValue(\"cron.time\");\n }", "public void autonomousPeriodic()\n\t{\n\t\tScheduler.getInstance().run();\n\t}", "@Override\n public void teleopPeriodic()\n {\n Scheduler.getInstance().run();\n }", "@Override\n public void autonomousPeriodic() {\n \tbeginPeriodic();\n Scheduler.getInstance().run();\n endPeriodic();\n }", "@Override\n public void teleopPeriodic() {\n Scheduler.getInstance().run();\n \n }", "public void setUpdateInterval(int interval)\n {\n // Check if interval is > 0\n if (interval > 0)\n {\n updateInterval = interval;\n }\n else\n {\n updateInterval = 1000; // default is 1 ms\n }\n// motherboard.resetTimer(this, updateInterval);\n }", "public void setInterval(int anInterval)\n{\n // Set interval\n _interval = anInterval;\n \n // If timer present, change interval\n if(_timer!=null)\n _timer.setDelay(_interval);\n}", "@Override\n public void teleopPeriodic() {\n \tbeginPeriodic();\n Scheduler.getInstance().run();\n endPeriodic();\n }", "@Override\n\tpublic void teleopPeriodic() {\n\t\tScheduler.getInstance().run();\n\t}", "@Override\n\tpublic void teleopPeriodic() {\n\t\tScheduler.getInstance().run();\n\t}", "@Override\n\tpublic void teleopPeriodic() {\n\t\tScheduler.getInstance().run();\n\t}", "public void teleopPeriodic()\n\t{\n\t\tScheduler.getInstance().run();\n\t}", "long getRepeatIntervalPref();", "@Scheduled(fixedRate = 30 * 60 * 1000)\n public void clearStaleCache(){\n\n }", "@Scheduled(cron = \"0 * * * * ?\")\r\n public void cronJobSch() {\r\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\r\n Date now = new Date();\r\n String strDate = sdf.format(now);\r\n System.out.println(\"Java cron job expression:: \" + strDate);\r\n }", "public void run()\r\n\t{\r\n\t\ttimer.scheduleAtFixedRate(this.getTimerTask(), 0, repeat * 60 * 1000);\r\n\t}", "default public int getAliveInterval() \t\t\t\t\t{ return 1000; }", "@Override\n public void autonomousPeriodic() {\n teleopPeriodic();\n //Scheduler.getInstance().run();\n }", "public void setPollingInterval(int seconds) {\n pollingInterval = seconds;\n }", "@Override\n\tpublic void autonomousPeriodic() {\n\t\tScheduler.getInstance().run();\n\t\tlog();\n\t}", "@Override\n public void teleopPeriodic() {\n Scheduler.getInstance().run();\n log();\n }", "@Override\n public void periodic() {\n UpdateDashboard();\n }", "public void setTimerInterval(long intervalTime){\n this.intervalTime = intervalTime;\n }", "@Override\r\n\tpublic void run() {\r\n\t\ttimer = new Timer();\r\n\t\ttimer.schedule(new TimerTask() {\r\n\t\t\t@Override\r\n public void run() {\r\n Main.myIntegratedSensorSuite.reinitializeRainData();\r\n }\r\n\t\t}, 0, 20000); //runs once initially then again every 20 seconds\r\n\t}", "@Scheduled(cron = \"0 09 14 * * ?\")\n public void scheduleTaskWithCronExpression() {\n\t\tlog.info(\"Cron Task :: Execution Time Every 14:09 - {}\", dateTimeFormatter.format(LocalDateTime.now()));\n\t}", "public static void setInterval(int intervalVal) {\n\n interval = intervalVal;\n }", "@Scheduled(initialDelayString = \"${jobs.frequent.trigger.init.seconds:1800}000\", fixedDelayString = \"${jobs.frequent.trigger.delay.seconds:10800}000\")\n\tpublic void frequentPolling() {\n\t\tif (jazzPartnerTrackingJobEnabled) {\n\t\t\tlog.info(\"Scheduled Frequent Polling Launched\");\n\t\t\tSet<JazzApplicantPollConfiguration> configs = jazzPolling.getFrequentPollingConfigs();\n\t\t\tfor (JazzApplicantPollConfiguration config : configs) {\n\t\t\t\tjazzPolling.pollJazzApplicants(config);\n\t\t\t}\n\t\t} else {\n\t\t\tlog.info(\"Jazz frequent polling disabled.\");\t\t\t\t\n\t\t}\t\n\t}", "public void setRequestInterval(int requestInterval) {\n final int minSecs = 15;\n final int maxSecs = 600; // 10 minutes\n\n if (requestInterval <= 0) {\n requestInterval = 0;\n } else if (requestInterval < minSecs) {\n // Too often. Cannot request ads more frequently than minSecs apart.\n AdManager.clientError(\"AdView.setRequestInterval(\" + requestInterval + \") seconds must be >= \" + minSecs);\n } else if (requestInterval > maxSecs) {\n // Too infrequent. If setting this value there is no reason to have ads update more than maxSecs apart.\n AdManager.clientError(\"AdView.setRequestInterval(\" + requestInterval + \") seconds must be <= \" + maxSecs);\n }\n\n int requestIntervalMillisecs = requestInterval * 1000;\n this.requestInterval = requestIntervalMillisecs;\n\n // Set the timer to handle requesting fresh ads.\n if (requestInterval == 0) {\n // Stop the current timer (if there is one).\n manageRequestIntervalTimer(false);\n } else {\n // Start the timer.\n Log.i(AdManager.LOG, \"Requesting fresh ads every \" + requestInterval + \" seconds.\");\n manageRequestIntervalTimer(true);\n }\n }", "private void scheduleRecurringTasks() {\n\t\t//created directories expected by the system to exist\n\t\tUtil.initializeDataDirectories();\n\n\t\tTestManager.initializeTests();\n\n\t\t// Gets all the periodic tasks and runs them.\n\t\t// If you need to create a new periodic task, add another enum instance to PeriodicTasks.PeriodicTask\n\t\tSet<PeriodicTasks.PeriodicTask> periodicTasks = EnumSet.allOf(PeriodicTasks.PeriodicTask.class);\n\t\tfor (PeriodicTasks.PeriodicTask task : periodicTasks) {\n\t\t\tif (R.IS_FULL_STAREXEC_INSTANCE || !task.fullInstanceOnly) {\n\t\t\t\ttaskScheduler.scheduleWithFixedDelay(task.task, task.delay, task.period.get(), task.unit);\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tPaginationQueries.loadPaginationQueries();\n\t\t} catch (Exception e) {\n\t\t\tlog.error(\"unable to correctly load pagination queries\");\n\t\t\tlog.error(e.getMessage(), e);\n\t\t}\n\t}", "@Scheduled(cron = \"0 0 0 * * *\") //for 30 seconds trigger -> 0,30 * * * * * for 12am fires every day -> 0 0 0 * * *\n\tpublic void cronJob() {\n\t\tList<TodayBalance> tb = balanceService.findTodaysBalance();\n\t\tList<TodayBalance> alltb = new ArrayList<TodayBalance>();\n\t\talltb.addAll(tb);\n\t\t\n\t\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.add(Calendar.DATE, -1);\n\t\n\t\tif(!alltb.isEmpty()) {\n\t\t\tfor (TodayBalance tbal : alltb ) {\n\t\t\t \n\t\t\t\tClosingBalance c = new ClosingBalance();\n\t\t\t\tc.setCbalance(tbal.getBalance());\n\t\t\t\tc.setDate((cal.getTime()).toString());\n\t\t \n\t\t\t\tclosingRepository.save(c);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public int getRefreshInterval() {\n return (tozAdCampaignRetrievalInterval);\n }", "private void initialiseTimers() {\r\n for (Map.Entry<String, Feed> entry : feeds.entrySet()) {\r\n String key = entry.getKey();\r\n Timer timer = new Timer();\r\n timer.schedule(new TimerTask() {\r\n @Override\r\n public void run() {\r\n feeds.remove(key);\r\n timers.remove(key);\r\n }\r\n }, 15 * 1000, 15 * 1000);\r\n timers.put(key, timer);\r\n }\r\n }", "public void turnOnRss(final String url) {\n ParseFeedTask task = tasks.get(url);\n if (task == null) {\n System.out.println(String.format(\"Rss with url %s is not found\", url));\n return;\n }\n RssConfiguration configuration = task.getConfiguration();\n if (configuration.getTurnOn()) {\n System.out.println(\"Rss is already running\");\n return;\n }\n configuration.setTurnOn(true);\n try {\n PropertiesHandler.writeProperties(configuration);\n ScheduledFuture future = scheduledExecutorService.scheduleWithFixedDelay(task, configuration.getPollPeriod(), configuration.getPollPeriod(), TimeUnit.SECONDS);\n futures.put(url, future);\n System.out.println(String.format(\"Rss %s is running\", url));\n } catch (IOException e) {\n System.out.println(String.format(\"An error occurred during the change poll period for feed %s\", url));\n }\n }", "@Scheduled(cron = \"${toil1.schedule1}\")\n\tpublic void toiL1Schedule1() {\n\t\tlog.info(\"Running toiL1Schedule1\");\n\t\trunToiL1Schedule();\n\t\trunToiBlogsL1Schedule();\n\t}", "@Scheduled(fixedRate = 30000)\n public void keepAlive() {\n if (needToRunStartupMethod) {\n runOnceOnlyOnStartup();\n needToRunStartupMethod = false;\n }\n }", "Duration getDefaultPollInterval();", "@Override\n public void autonomousPeriodic() {\n\n }", "public void setCheckInterval(long checkInterval) {\n this.checkInterval = checkInterval;\n }", "@Scheduled(fixedDelay=5000) //indicamos que esta tarea se repetira cada 5 segundos \n\tpublic void doTask() {\n\t\tLOGGER.info(\"Time is: \"+ new Date());\n\t}", "public int getPollInterval();", "@Override\n public void autonomousPeriodic() {\n \n }", "public static void scheduleRefreshJob() {\n\t\ttry {\n\t\t\tScheduler sched = StdSchedulerFactory.getDefaultScheduler();\n\t\t\tJobDetail job = newJob(RefreshJob.class)\n\t\t\t .withIdentity(REFRESH_JOB_KEY)\n\t\t\t .build();\n\n\t\t\tSimpleTrigger trigger = newTrigger()\n\t\t\t .withIdentity(REFRESH_TRIGGER_KEY)\n\t\t\t .withSchedule(repeatSecondlyForever(refreshInterval))\n\t\t\t .build();\n\n\t\t\tsched.scheduleJob(job, trigger);\n\t\t\tlogger.debug(\"Scheduled refresh job '{}' in DefaulScheduler\", job.getKey());\n\t\t} catch (SchedulerException e) {\n\t\t\tlogger.warn(\"Could not schedule refresh job: {}\", e.getMessage());\n\t\t}\n\t}", "public CronTimer(String name, int min) {\n this.name = name;\n cronExpression = \"*\" + \" \" + \"0/\" + min + \" \" + \"* * * ?\";\n }", "public static void rescheduleRefreshJob() {\n\t\ttry {\n\t\t\tScheduler sched = StdSchedulerFactory.getDefaultScheduler();\n\n\t\t\tSimpleTrigger trigger = newTrigger()\n\t\t\t .withIdentity(REFRESH_TRIGGER_KEY)\n\t\t\t .withSchedule(repeatSecondlyForever(refreshInterval))\n\t\t\t .build();\n\t\t\t\n\t\t\tsched.rescheduleJob(REFRESH_TRIGGER_KEY, trigger);\n\t\t\tlogger.debug(\"Rescheduled refresh job '{}' in DefaulScheduler\", REFRESH_TRIGGER_KEY);\n\t\t} catch (SchedulerException e) {\n\t\t\tlogger.warn(\"Could not reschedule refresh job: {}\", e.getMessage());\n\t\t}\n\t}", "long getIntervalInSeconds();", "@Scheduled(cron = \"0 0 9-17 * * MON-FRI\")\n\tpublic void scheduleTaskWeekly() {\n\t\tlog.info(\"Cron Task :: Execution Time Every 9 - 17 O'clock Every Weekdays - {}\", dateTimeFormatter.format(LocalDateTime.now()));\n\t}" ]
[ "0.6407348", "0.6288424", "0.6207844", "0.6140119", "0.6112342", "0.6002413", "0.5990558", "0.5972219", "0.59428406", "0.5940276", "0.5894625", "0.5826235", "0.5795792", "0.5766667", "0.5750388", "0.5740636", "0.5737203", "0.5727937", "0.57077503", "0.5704704", "0.5698229", "0.5698229", "0.5698229", "0.5698229", "0.5698229", "0.5698229", "0.5698161", "0.564349", "0.5638233", "0.5627773", "0.5597813", "0.55963117", "0.5589791", "0.5581118", "0.55692416", "0.554692", "0.55442864", "0.55390316", "0.5504193", "0.55009353", "0.55009353", "0.55009353", "0.55009353", "0.5497224", "0.5495298", "0.54871863", "0.5486511", "0.5473678", "0.5473567", "0.5473567", "0.5473567", "0.5473567", "0.5462108", "0.54571563", "0.544956", "0.54489416", "0.5440218", "0.5429189", "0.5427501", "0.5426749", "0.5426229", "0.54205257", "0.54095805", "0.54095805", "0.54095805", "0.53987205", "0.5381782", "0.5381346", "0.5358301", "0.5350352", "0.5344936", "0.53426445", "0.5337319", "0.5335633", "0.5333282", "0.5331363", "0.5314379", "0.5312689", "0.5312003", "0.53030354", "0.53026795", "0.5296293", "0.5283455", "0.52820814", "0.52533126", "0.5243572", "0.5239995", "0.5222076", "0.52125555", "0.52121395", "0.5211383", "0.5210245", "0.5209254", "0.51932496", "0.51889676", "0.5184318", "0.5181209", "0.5176976", "0.5172026", "0.51664996" ]
0.5792613
13
set the duration of the continuous crawl (default = 2 years)
protected void setDuraction(int seconds) { duration = seconds * 1000L; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setDuration(int duration);", "public void setDuration(int val){this.duration = val;}", "public void setDuration( Long duration );", "public void setDuration(int newDuration) {\n this.duration = newDuration;\n }", "public void setDuration(int duration){\n this.duration = duration;\n }", "public void setDuration(long duration) {\n\t\tthis.startDuration = System.currentTimeMillis();\n\t\tthis.endDuration = startDuration + duration * 1000;\n\t}", "public void setDuration(Integer duration) {\n this.duration = duration;\n }", "void setRecurrenceDuration(int recurrenceDuration);", "public void setDuration(int duration) {\n this.duration = duration;\n }", "public void setDuration(int duration) {\n this.duration = duration;\n }", "public void setDuration(long duration) {\n this.duration = duration;\n }", "public void setDuration(long duration) {\n this.duration = duration;\n }", "public void setDuration(Long duration)\r\n {\r\n this.duration = duration;\r\n }", "public void setDuration(Integer duration) {\n this.duration = duration;\n }", "void setDuration(org.apache.xmlbeans.GDuration duration);", "public void setDuration(int duration)\r\n\t{\r\n\t\tif (duration < 0) { throw new IllegalArgumentException(\"duration muss groesser als 0 sein\"); }\r\n\t\tthis.duration = duration;\r\n\t}", "public void setDuration(int duration) {\n if (this.duration != duration) {\n this.duration = duration;\n }\n }", "public void setEvaluationCycleDuration(long value) {\n this.evaluationCycleDuration = value;\n }", "public void setDuration(long duration) {\n this.duration = duration;\n }", "public void setRunDuration(int value) {\n this.runDuration = value;\n }", "public void setDuration(Number duration) {\n this.duration = duration;\n }", "@Override\n public final void setCountdown(int newCountdown) {\n }", "@Override\n\tpublic void setDurchmesser(int d) {\n\n\t}", "@Override\n public void lifeTime() {\n System.out.println(\"Lifetime is around 5 years.\");\n }", "void setDuration(java.lang.String duration);", "public void setDuration(int duration) {\n mDuration = duration;\n }", "public void setLength(int duration){\n\t\tlength = duration;\n\t}", "@Override\r\n \t\t\tpublic void setSessionDuration(long duration) {\n \t\t\t\t\r\n \t\t\t}", "public void SetDuration(int duration)\n {\n TimerMax = duration;\n if (Timer > TimerMax)\n {\n Timer = TimerMax;\n }\n }", "public void setDuration(int duration) {\r\n this.duration = duration;\r\n if (connections.get(lightIndex).getTrafficLight().getSignal()\r\n == TrafficSignal.YELLOW) {\r\n connections.get(lightIndex).getTrafficLight().setSignal\r\n (TrafficSignal.GREEN);\r\n }\r\n currentGreenTime = 0;\r\n currentYellowTime = 0;\r\n }", "public void setLifeTime(int lifeTime) {\n this.lifeTime = lifeTime;\n }", "public void setYear(int _year) { year = _year; }", "public void setPeriod(int periodInYears) {\nnumberOfPayments = periodInYears * MONTHS;\n}", "Duration(Integer duration){\n\t\t_minimum = duration;\n\t\t_maximum = duration;\n\t\t_range = new Range(_minimum, _maximum);\n\t}", "public void setTimeOut(int value) {\n this.timeOut = value;\n }", "public void setYears(int years) {\n this.years = years;\n }", "public void setYearsUntilTenure(int yearsUntilTenure){\n m_yearsUntilTenure = yearsUntilTenure;\n }", "public void setHighlightDuration(double value) {\n JsoHelper.setAttribute(jsObj, \"highlightDuration\", value);\n }", "public void setDuration(Duration duration)\r\n {\r\n m_duration = duration;\r\n }", "public void setNumberOfYears(int numberOfYears) {\n this.numberOfYears = numberOfYears;\n }", "public void setLifetime(int seconds) {\n lifetime = seconds;\n }", "public void setDownloadPtime(int ptime);", "public void setBoostExpiration(){\r\n\t\tboostExpiration = GameController.getTimer() + 1000000000l * length;\r\n\t}", "public void setDuration(String duration) {\n this.duration = duration;\n }", "public void setDuration(String duration) {\n this.duration = duration;\n }", "public void setDecayRate(double newDecayRate ){\n\n decayRate= newDecayRate;\n}", "public void setDuration(float duration) {\n\t\tthis.duration = duration;\n\t}", "@Override\n\tpublic int withIntervalInSeconds() {\n\t\treturn 10;\n\t}", "public void setWalkSpeed(int n)\n{\n walkSpeed = n;\n}", "public void setDuration(DeltaSeconds d) {\n duration = d ;\n }", "public final void setExpiryTime(long expire) {\n\t\tm_tmo = expire;\n\t}", "void setVoteFinalizeDelaySeconds(long voteFinalizeDelaySeconds);", "void xsetDuration(org.apache.xmlbeans.XmlInt duration);", "public int getDuration() {return this.duration;}", "protected void setDeathTime(double deathtime){\n\t\tthis.death_time = deathtime;\n\t}", "public void setYear (int yr) {\n year = yr;\n }", "public void setProgressDuration(int duration){\n this.mProgressDuration = duration;\n }", "public void setTime(long elapseTime) {\r\n\t\tsecond = (elapseTime / 1000) % 60;\r\n\t\tminute = (elapseTime / 1000) / 60 % 60;\r\n\t\thour = ((elapseTime / 1000) / 3600) % 24;\t\r\n\t}", "public void setLives(int lives){\n liveCount = lives;\n }", "public void setDimes(int d)\n {\n\tthis.dimes = d;\n\tchangeChecker();\n }", "public void setDelay(long d){delay = d;}", "@Override\r\n\tpublic int yearsTillRetirement() //calculate years until retirement\r\n\t{\n\t\tint retire = (int)Math.round((35 - (super.getYears() + (double)(usedUnpaidVacation + usedVacation* 2 + usedSickDays)/260)));\r\n\t\t\r\n\t\treturn retire;\r\n\t\t\r\n\t\t\r\n\t}", "public void setSecond(int second) \n { \n if (second < 0 || second >= 60)\n throw new IllegalArgumentException(\"second must be 0-59\");\n\n this.second = second; \n }", "public void setYear(short value) {\n this.year = value;\n }", "void setBurnDuration(int ticks);", "public void setIncTimeout(int seconds);", "public void setCycleInterval(long value) {\r\n this.cycleInterval = value;\r\n }", "public void setYear(int value) {\n\tthis.year = value;\n }", "public void setBuildTime(int time)\n{\n\t_buildTime = time;\n}", "@Override\n\tpublic void setYear(int year) {\n\t\t_esfShooterAffiliationChrono.setYear(year);\n\t}", "public int getDuration() { return duration; }", "void xsetRecurrenceDuration(org.apache.xmlbeans.XmlInt recurrenceDuration);", "public void setYear(int y){\n\t\tyear = y ; \n\t}", "void setTime(final int time);", "public void setYear(int value) {\r\n this.year = value;\r\n }", "public Builder setExpires(long value) {\n copyOnWrite();\n instance.setExpires(value);\n return this;\n }", "public void setDelay(long delay) {\n this.delay = delay;\n }", "public Builder setDuration(int value) {\n bitField0_ |= 0x00000008;\n duration_ = value;\n onChanged();\n return this;\n }", "public void setYear(short value) {\n this.year = value;\n }", "public void crawlDelay()\n\t{\n//\t\tint delay = robot.getCrawlDelay(best_match);\n//\t\tif (delay!=-1)\n//\t\t{\n//\t\t\ttry \n//\t\t\t{\n//\t\t\t\tTimeUnit.SECONDS.sleep(robot.getCrawlDelay(best_match));\n//\t\t\t} \n//\t\t\tcatch (InterruptedException e) \n//\t\t\t{\n//\t\t\t\treturn;\n//\t\t\t}\n//\t\t}\n\t}", "public int getNoYears(){return this.no_years;}", "public int getYearsUntilTenure(){\n return m_yearsUntilTenure;\n }", "public void setTime(double time) {_time = time;}", "public void setYear(short value) {\n this.year = value;\n }", "public void setYear(short value) {\n this.year = value;\n }", "public void setYear(short value) {\n this.year = value;\n }", "@Override\n\t\t\tpublic int durationToWait() {\n\t\t\t\treturn getCarType() == 2 ? 60000 : 15000;\n\t\t\t}", "public void setYear(short value) {\r\n this.year = value;\r\n }", "public void setDocumentYear(int documentYear);", "public void setYear(int year) {\n\tthis.year = year;\n}", "long getDuration();", "public void setDateLength(int dateLength) { this.dateLength = dateLength; }", "public void setVideoIterationTime(double videoIterationLength){\n\t\tthis.videoIterationLength = videoIterationLength;\n\t}", "public void setRechargeTime(Skills skill, int time);", "public void setYear(short value) {\n this.year = value;\n }", "public int getRegularWageDurationSeconds() {\n return regularWageDurationSeconds;\n }", "@Override\n public void setDuration(final int duration) {\n if (duration < 0) {\n throw new IllegalArgumentException(\"Animators cannot have negative duration: \" +\n duration);\n }\n this.duration = duration;\n }", "public void setExpirationYear(java.math.BigInteger expirationYear) {\r\n this.expirationYear = expirationYear;\r\n }", "public void setExpires(long expires)\r\n/* 224: */ {\r\n/* 225:338 */ setDate(\"Expires\", expires);\r\n/* 226: */ }", "public void setRegularWageDurationSeconds(int regularWageDurationSeconds) {\n this.regularWageDurationSeconds = regularWageDurationSeconds;\n }" ]
[ "0.6344325", "0.6099796", "0.5991327", "0.5938324", "0.58935773", "0.57722", "0.5737302", "0.57234055", "0.5698503", "0.5698503", "0.5663994", "0.5663994", "0.5639615", "0.56214565", "0.5618321", "0.56062806", "0.5581338", "0.5574516", "0.5569788", "0.55610216", "0.55051535", "0.5436005", "0.5421794", "0.5405479", "0.5379677", "0.53701514", "0.5365054", "0.5289432", "0.5280209", "0.5277873", "0.52671033", "0.52549416", "0.5247569", "0.5241477", "0.52398205", "0.52344465", "0.52273774", "0.5221448", "0.52202374", "0.5219177", "0.5216776", "0.52068704", "0.51952016", "0.5166203", "0.5166203", "0.5165109", "0.51544404", "0.5153361", "0.5133866", "0.5129248", "0.51074344", "0.5106116", "0.5097498", "0.5078623", "0.50623244", "0.5057669", "0.5048307", "0.5038566", "0.50218344", "0.50110096", "0.50076985", "0.5000296", "0.49952975", "0.4984712", "0.49828532", "0.49824405", "0.49785823", "0.49764848", "0.49583796", "0.49578285", "0.49536377", "0.49509835", "0.49433976", "0.493838", "0.4934763", "0.49297094", "0.49235976", "0.49220464", "0.4917208", "0.49130255", "0.49058273", "0.4903826", "0.48972413", "0.48959824", "0.48959824", "0.48959824", "0.48939908", "0.48923987", "0.48884952", "0.48872355", "0.48812243", "0.48772973", "0.48768646", "0.48688334", "0.48636138", "0.48618194", "0.48580173", "0.48504102", "0.48466268", "0.4846608" ]
0.583562
5
get signature for content and configured signature implementation
protected byte[] getSignature() { return signatureImpl.calculate(content, null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Signature getSignature();", "public abstract String getSignature();", "String getSignature();", "String getSignature();", "String getSignature();", "public abstract byte[] getSignature();", "java.lang.String getSignatureText();", "byte[] getSignatureImage();", "public interface SignatureFactory \n{\n /** \n * initializes the implementation class \n */\n public void init()\n throws SignedDocException;\n \n /**\n * Method returns an array of strings representing the \n * list of available token names.\n * @return an array of available token names.\n * @throws SignedDocException if reading the token information fails.\n */\n public String[] getAvailableTokenNames()\n throws SignedDocException;\n \n /**\n * Method returns a digital signature. It finds the RSA private \n * key object from the active token and\n * then signs the given data with this key and RSA mechanism.\n * @param digest digest of the data to be signed.\n * @param token token index\n * @param pin users pin code\n * @return an array of bytes containing digital signature.\n * @throws SignedDocException if signing the data fails.\n */\n public byte[] sign(byte[] digest, int token, String pin) \n throws SignedDocException;\n \n /**\n * Method returns a X.509 certificate object readed \n * from the active token and representing an\n * user public key certificate value.\n * @return X.509 certificate object.\n * @throws SignedDocException if getting X.509 public key certificate \n * fails or the requested certificate type X.509 is not available in \n * the default provider package\n */\n public X509Certificate getCertificate(int token, String pin)\n throws SignedDocException;\n \n /**\n * Resets the previous session\n * and other selected values\n */\n public void reset() \n throws SignedDocException;\n \n\t/**\n\t * Method decrypts the data with the RSA private key\n\t * corresponding to this certificate (which was used\n\t * to encrypt it). Decryption will be done on the card.\n\t * This operation closes the possibly opened previous\n\t * session with signature token and opens a new one with\n\t * authentication token if necessary\n\t * @param data data to be decrypted.\n\t * @param token index of authentication token\n\t * @param pin PIN code\n\t * @return decrypted data.\n\t * @throws SignedDocException for all decryption errors\n\t */\n\tpublic byte[] decrypt(byte[] data, int token, String pin) \n\t\tthrows SignedDocException;\n\t\t\t\t\n}", "SignatureSource createSignatureSource();", "org.apache.calcite.avatica.proto.Common.Signature getSignature();", "int getSignature ();", "org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder();", "SignatureIdentification createSignatureIdentification();", "public interface IVerifySignatureService {\n\n\t/**\n\t * Document which contains signature internally\n\t * \n\t * @param document : document to be verified\n\t * @return : verification result status and the Token file encoded by base64\n\t */\n\tEntry<StatusType, String> verifyInternalSignature(final Document document);\n\n\t/**\n\t * Document to be verified with its external signature\n\t * \n\t * @param document : document to be verified\n\t * @param signature : its signature file\n\t * @return\n\t */\n\tEntry<StatusType, String> verifyExternalSignature(Document document, Document signature);\n}", "com.google.protobuf.ByteString getSignature();", "public interface SignatureObject {\n}", "public String getSignature()\r\n {\r\n return signature;\r\n }", "public org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder() {\n if (signatureBuilder_ != null) {\n return signatureBuilder_.getMessageOrBuilder();\n } else {\n return signature_ == null ?\n org.apache.calcite.avatica.proto.Common.Signature.getDefaultInstance() : signature_;\n }\n }", "com.microsoft.schemas.office.x2006.digsig.STSignatureText xgetSignatureText();", "public ISignature getSignature() {\n return _signature;\n }", "com.google.protobuf.ByteString\n getSignatureBytes();", "com.google.protobuf.ByteString\n getSignatureBytes();", "int getSignatureProviderDetails();", "public org.apache.calcite.avatica.proto.Common.Signature getSignature() {\n if (signatureBuilder_ == null) {\n return signature_ == null ? org.apache.calcite.avatica.proto.Common.Signature.getDefaultInstance() : signature_;\n } else {\n return signatureBuilder_.getMessage();\n }\n }", "public String getSignature() {\n return signature;\n }", "public String getSignature() {\n return signature;\n }", "public String getSignature() {\n return signature;\n }", "org.apache.xmlbeans.XmlInt xgetSignatureProviderDetails();", "int getSignatureType();", "com.google.protobuf.ByteString getArtifactSignature();", "public org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder() {\n return getSignature();\n }", "BigInteger getDigitalSignature();", "public org.apache.calcite.avatica.proto.Common.Signature getSignature() {\n return signature_ == null ? org.apache.calcite.avatica.proto.Common.Signature.getDefaultInstance() : signature_;\n }", "SignatureSink createSignatureSink();", "public byte []\ngetSignature() {\n\treturn signature;\n}", "java.lang.String getSignatureComments();", "public interface ContentVerifier\n{\n /**\n * Return the algorithm identifier describing the signature\n * algorithm and parameters this verifier supports.\n *\n * @return algorithm oid and parameters.\n */\n AlgorithmIdentifier getAlgorithmIdentifier();\n\n /**\n * Returns a stream that will accept data for the purpose of calculating\n * a signature for later verification. Use org.bouncycastle.util.io.TeeOutputStream if you want to accumulate\n * the data on the fly as well.\n *\n * @return an OutputStream\n */\n OutputStream getOutputStream();\n\n /**\n * Return true if the expected value of the signature matches the data passed\n * into the stream.\n *\n * @param expected expected value of the signature on the data.\n * @return true if the signature verifies, false otherwise\n */\n boolean verify(byte[] expected);\n}", "public String getSignature() {\n\t\treturn signature;\n\t}", "com.microsoft.schemas.office.x2006.digsig.STSignatureType xgetSignatureType();", "ISModifySignature createISModifySignature();", "String componentSignature();", "org.apache.xmlbeans.XmlBase64Binary xgetSignatureImage();", "public byte[] sign() throws XMLSignatureException {\n/* 177 */ return this.signatureAlgorithm.engineSign();\n/* */ }", "public abstract String getCurrentUserSignature(PortletRequest request);", "void setSignature(String signature) {\n this.signature = signature;\n }", "public String getSignature() {\n return this.Signature;\n }", "java.lang.String getSignatureProviderUrl();", "com.microsoft.schemas.office.x2006.digsig.STSignatureComments xgetSignatureComments();", "SignatureSpi(com.android.org.bouncycastle.crypto.Digest r1, com.android.org.bouncycastle.crypto.DSA r2, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder r3) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.<init>(com.android.org.bouncycastle.crypto.Digest, com.android.org.bouncycastle.crypto.DSA, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.<init>(com.android.org.bouncycastle.crypto.Digest, com.android.org.bouncycastle.crypto.DSA, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder):void\");\n }", "public SignatureValidator getSignatureValidator() {\r\n return signatureValidator;\r\n }", "public interface ECCSignature {\n BigInteger getR();\n\n BigInteger getS();\n\n ECCParameters getECCParameters();\n\n BigInteger getN();\n\n ECCPoint getG();\n\n ECCPoint getQu();\n}", "native String nativeGetSignature(long nativeHandler) throws RuntimeException;", "public java.lang.String getSignatureimage () {\n\t\treturn signatureimage;\n\t}", "String getUniqueSignature();", "public byte[] getSignature() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getSignature():byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getSignature():byte[]\");\n }", "public byte[] getSignature()\n {\n return Arrays.clone(signature);\n }", "@Override\n public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@Override\n public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public Signator.Signers getUsedPDFSignerLibrary();", "public Sig getSignature() {\n return this.sig;\n }", "@NonNull\n public String getSignature() {\n return mSignature;\n }", "com.microsoft.schemas.office.x2006.digsig.STSignatureProviderUrl xgetSignatureProviderUrl();", "public int getSignature() {\n\t\ttry {\n\t\t\treturn getStream().getInt(signature);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn 0;\n\t\t}\n\t}", "java.lang.String getSignatureProviderId();", "@RequestMapping(value = \"/cades-signature-complete\", method = {RequestMethod.POST})\n\tpublic String complete(\n\t\t@RequestParam(value = \"token\", required = true) String token,\n\t\t@RequestParam(value = \"signature\", required = true) String signature,\n\t\tModel model\n\t) throws IOException, RestException {\n\n\t\t// Instantiate the PadesSignatureFinisher class, responsible for completing the signature process. For more\n\t\t// information, see:\n\t\t// https://pki.rest/Content/docs/java-client/index.html?com/lacunasoftware/restpki/CadesSignatureFinisher.html\n\t\tCadesSignatureFinisher signatureFinisher = new CadesSignatureFinisher(Util.getRestPkiClient());\n\n\t\t// Set the token for this signature (rendered in a hidden input field, see file templates/cades-signature-step2.html)\n\t\tsignatureFinisher.setToken(token);\n\n\t\t// Set the result of the signature operation\n\t\tsignatureFinisher.setSignature(signature);\n\n\t\t// Call the finish() method, which finalizes the signature process and returns the CMS\n\t\tbyte[] cms;\n\t\ttry {\n\t\t\tcms = signatureFinisher.finish();\n\t\t} catch (ValidationException e) {\n\t\t\t// The call above may throw a ValidationException if any validation errors occur (for instance, if the\n\t\t\t// certificate is revoked). If so, we'll render a page showing what went wrong.\n\t\t\tmodel.addAttribute(\"title\", \"Validation of the signature failed\");\n\t\t\t// The toString() method of the ValidationResults object can be used to obtain the checks performed, but the\n\t\t\t// string contains tabs and new line characters for formatting. Therefore, we call the method\n\t\t\t// Util.getValidationResultsHtml() to convert these characters to <br>'s and &nbsp;'s.\n\t\t\tmodel.addAttribute(\"vrHtml\", Util.getValidationResultsHtml(e.getValidationResults()));\n\t\t\treturn \"validation-failed\";\n\t\t}\n\n\t\t// Get information about the certificate used by the user to sign the file. This method must only be called after\n\t\t// calling the finish() method.\n\t\tPKCertificate signerCert = signatureFinisher.getCertificateInfo();\n\n\t\t// At this point, you'd typically store the CMS on your database. For demonstration purposes, we'll\n\t\t// store the CMS on a temporary folder and return to the page an identifier that can be used to download it.\n\n\t\tString filename = UUID.randomUUID() + \".p7s\";\n\t\tFiles.write(Application.getTempFolderPath().resolve(filename), cms);\n\t\tmodel.addAttribute(\"signerCert\", signerCert);\n\t\tmodel.addAttribute(\"filename\", filename);\n\t\treturn \"cades-signature-info\";\n\t}", "public Signer getPDFSigner();", "public void valSig (String fileName) {\n javax.xml.parsers.DocumentBuilderFactory dbf =\n javax.xml.parsers.DocumentBuilderFactory.newInstance();\n dbf.setNamespaceAware(true);\n javax.xml.parsers.DocumentBuilder db = null;\n\n System.out.println(\"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\");\n\n try {\n db = dbf.newDocumentBuilder();\n } catch (ParserConfigurationException e) {\n e.printStackTrace();\n }\n try {\n Document doc =\n db.parse(new FileInputStream(fileName));\n\n XPathFactory xpf = XPathFactory.newInstance();\n XPath xpath = xpf.newXPath();\n xpath.setNamespaceContext(new DSNamespaceContext());\n String expression = \"//ds:Signature[1]\";\n Element sigElement =\n (Element) xpath.evaluate(expression, doc, XPathConstants.NODE);\n\n XMLSignature signature =\n new XMLSignature(sigElement, (new File(fileName)).toURI().toURL().toString());\n\n String expressionBody = \"//soapenv:Body\";\n Element bodyElement =\n (Element) xpath.evaluate(expressionBody, doc, XPathConstants.NODE);\n\n Attr id = bodyElement.getAttributeNode(\"Id\") ;\n IdResolver.registerElementById(bodyElement,id);\n //signature.addResourceResolver(new OfflineResolver());\n\n KeyInfo ki = signature.getKeyInfo();\n System.out.println(\"================================signature.getSignatureValue()================================\");\n\n String svStr = new String(signature.getSignatureValue());\n System.out.println(svStr);\n System.out.println(\"================================signature.getSignatureValue()================================\");\n\n if (ki != null) {\n if (ki.containsX509Data()) {\n System.out.println(\"Could find a X509Data element in the KeyInfo\");\n }\n X509Certificate cert = signature.getKeyInfo().getX509Certificate();\n if (cert != null) {\n System.out.println(\"The XML signature in file \"\n // + f.toURI().toURL().toString() + \" is \"\n + (signature.checkSignatureValue(cert)\n ? \"valid (good)\" : \"invalid !!!!! (bad)\"));\n } else {\n System.out.println(\"Did not find a Certificate\");\n PublicKey pk = signature.getKeyInfo().getPublicKey();\n if (pk != null) {\n System.out.println(\"The XML signature in file \"\n // + f.toURI().toURL().toString() + \" is \"\n + (signature.checkSignatureValue(pk)\n ? \"valid (good)\" : \"invalid !!!!! (bad)\"));\n } else {\n System.out.println(\n \"Did not find a public key, so I can't check the signature\");\n }\n }\n } else {\n System.out.println(\"Did not find a KeyInfo\");\n }\n\n\n\n\n\n } catch (SAXException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (XPathExpressionException e) {\n e.printStackTrace();\n } catch (XMLSignatureException e) {\n e.printStackTrace();\n } catch (XMLSecurityException e) {\n e.printStackTrace();\n }\n\n }", "public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getSignature() {\n return signature_;\n }", "default String getSignature() {\n StringBuilder sb = new StringBuilder();\n sb.append(getName());\n sb.append(\"(\");\n for (int i = 0; i < getNumberOfParams(); i++) {\n if (i != 0) {\n sb.append(\", \");\n }\n sb.append(getParam(i).describeType());\n }\n sb.append(\")\");\n return sb.toString();\n }", "@ApiModelProperty(example = \"D8047EB8285077D9900EDD42F4081070DDB26E08E7F15A3E29642C80CF0C7D68340682DC9868C73EB09744D6298146D8DFC02ED47070FC81FB47D6F73B33EF0A\", required = true, value = \"The signature of the entity. The signature was generated by the signer and can be used to validate tha the entity data was not modified by a node. \")\n public String getSignature() {\n return signature;\n }", "public byte[] generateSignature()\n {\n if (!forSigning)\n {\n throw new IllegalStateException(\"PairingDigestSigner not initialised for signature generation.\");\n }\n\n byte[] hash = new byte[digest.getDigestSize()];\n digest.doFinal(hash, 0);\n\n Element[] sig = pairingSigner.generateSignature(hash);\n\n try {\n return pairingSigner.derEncode(sig);\n } catch (IOException e) {\n throw new IllegalStateException(\"unable to encode signature\");\n }\n }", "@Override\n public String buildSignature(RequestDataToSign requestDataToSign, String appKey) {\n // find private key for this app\n final String secretKey = keyStore.getPrivateKey(appKey);\n if (secretKey == null) {\n LOG.error(\"Unknown application key: {}\", appKey);\n throw new PrivateKeyNotFoundException();\n }\n\n // sign\n return super.buildSignature(requestDataToSign, secretKey);\n }", "public ExecSignature getSignature() {\n\t\t\tif(this.Signature == null) {\n\t\t\t\tthis.Signature = (ExecSignature)this.Datas[Index_ExecSignature];\n\t\t\t\tif(this.isParameterized() || this.isParametered()) {\n\t\t\t\t\tTypeRef TR = this.getTypeRef();\n\t\t\t\t\tType T = TR.getTheType();\n\t\t\t\t\tEngine E = (T == null) ? null : T.getEngine();\n\t\t\t\t\tthis.Signature = OperationInfo.SimpleOperation.ChangeBaseTypeSignature(E, TR, TR, this.Signature);\n\t\t\t\t\tthis.Signature = OperationInfo.SimpleOperation.flatSignature( E, TR, this.Signature);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn this.Signature;\n\t\t}", "Entry<StatusType, String> verifyExternalSignature(Document document, Document signature);", "@java.lang.Override\n public com.google.protobuf.ByteString getSignature() {\n return instance.getSignature();\n }", "public String[] getSignature() {\n\t\treturn signature;\n\t}", "public boolean verifySignature() {\r\n\t\t\r\n\t\tString data;\r\n\t\t\r\n\t\tif(isTypeCreation){\r\n\t\t\t\r\n\t\t\tdata = StringUtil.getStringFromKey(creator) + name +\r\n\t\t\t\t\tdescription + begin + end+end_subscription+\r\n\t\t\t\t\tlocation+min_capacity+max_capacity;\r\n\t\t\treturn StringUtil.verifyECDSASig(creator, data, signature);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdata = StringUtil.getStringFromKey(subscriber)+id_event;\r\n\t\t\treturn StringUtil.verifyECDSASig(subscriber, data, signature);\r\n\t\t}\r\n//\t\tSystem.out.println(\"signature \"+signature);\r\n\t\t\r\n\t}", "public String getSignatureClass() {\n\t\treturn signatureClass;\n\t}", "private byte[] createSignatureBase() {\n final Charset utf8 = StandardCharsets.UTF_8;\n byte[] urlBytes = url.getBytes(utf8);\n byte[] timeStampBytes = Long.toString(timestamp).getBytes(utf8);\n byte[] secretBytes = secret.getBytes(utf8);\n\n // concatenate\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n try {\n stream.write(urlBytes);\n stream.write(body);\n stream.write(timeStampBytes);\n stream.write(secretBytes);\n } catch (IOException ex){\n logger.error(\"Could not create signature base\", ex);\n return new byte[0];\n }\n\n return stream.toByteArray();\n }", "ReleaseFile parseWithSignature( InputStream is, InputStream signStream, InputStream keyStream ) throws IOException;", "public ExecSignature getSignature() {\n\t\t\treturn this.getIdentity();\n\t\t}", "public ExecSignature getSignature() {\n\t\t\treturn this.getIdentity();\n\t\t}", "public ExecSignature getSignature() {\n\t\t\treturn this.getIdentity();\n\t\t}", "public void setSignature(String signature) {\n\t\tthis.signature = signature;\n\t}", "public interface SignCallUseCase {\n\n String signature(String method, Map<String, String> params, String secret);\n\n}", "private void setSignature(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000010;\n signature_ = value;\n }", "public SignatureDocument getSignatureDocument() throws IOException, XmlException {\n // TODO: check for XXE\n return SignatureDocument.Factory.parse(signaturePart.getInputStream(), DEFAULT_XML_OPTIONS);\n }", "boolean hasSignature();", "boolean hasSignature();", "public InputStream getVisibleSignature()\n {\n return visibleSignature;\n }", "@Override\n public String getSignature() {\n Object ref = signature_;\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 signature_ = s;\n return s;\n }\n }", "@Override\n public String getSignature() {\n Object ref = signature_;\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 signature_ = s;\n return s;\n }\n }", "DocumentData getPreviewSign(String documentId,\n String filename) throws IOException;", "private static byte[] sign(KeyPair keyPair, Path path, String signatureAlgorithm)\n\t{\n\t\tbyte[] signature = null;\n\n\t\ttry\n\t\t{\n\t\t\tbyte[] dataFromFile = Files.readAllBytes(path);\n\t\t\tSignature sign = Signature.getInstance(signatureAlgorithm);\n\t\t\tsign.initSign(keyPair.getPrivate());\n\t\t\tsign.update(dataFromFile);\n\t\t\tsignature = sign.sign();\n\t\t} catch (IOException | InvalidKeyException | NoSuchAlgorithmException | SignatureException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn signature;\n\t}", "public io.lightcone.data.types.EdDSASignatureOrBuilder getSigOrBuilder() {\n return getSig();\n }", "public Signature correctProcessSignature() {\n\t\tif (!exertion.isJob())\n\t\t\treturn exertion.getProcessSignature();\n\t\tSignature sig = exertion.getProcessSignature();\n\t\tif (sig != null) {\n\t\t\tAccess access = exertion.getControlContext().getAccessType();\n\t\t\tif ((Access.PULL == access || Access.QOS_PULL == access)\n\t\t\t\t\t&& !exertion.getProcessSignature().getServiceType()\n\t\t\t\t\t\t\t.isAssignableFrom(Spacer.class)) {\n\t\t\t\tsig.setServiceType(Spacer.class);\n\t\t\t\t((NetSignature) sig).setSelector(\"service\");\n\t\t\t\tsig.setProviderName(SorcerConstants.ANY);\n\t\t\t\tsig.setType(Signature.Type.SRV);\n\t\t\t\texertion.getControlContext().setAccessType(access);\n\t\t\t} else if ((Access.PUSH == access || Access.QOS_PUSH == access)\n\t\t\t\t\t&& !exertion.getProcessSignature().getServiceType()\n\t\t\t\t\t\t\t.isAssignableFrom(Jobber.class)) {\n\t\t\t\tif (sig.getServiceType().isAssignableFrom(Spacer.class)) {\n\t\t\t\t\tsig.setServiceType(Jobber.class);\n\t\t\t\t\t((NetSignature) sig).setSelector(\"service\");\n\t\t\t\t\tsig.setProviderName(SorcerConstants.ANY);\n\t\t\t\t\tsig.setType(Signature.Type.SRV);\n\t\t\t\t\texertion.getControlContext().setAccessType(access);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tsig = new NetSignature(\"service\", Jobber.class);\n\t\t}\n\t\treturn sig;\n\t}", "public Set<String> getSignatures()\n/* */ {\n/* 150 */ return this.signatures;\n/* */ }" ]
[ "0.74056983", "0.7329026", "0.71584696", "0.71584696", "0.71584696", "0.7133794", "0.7016837", "0.69324815", "0.69229525", "0.68816686", "0.68773603", "0.68002194", "0.66779757", "0.6615996", "0.65741056", "0.6543961", "0.6504957", "0.64485264", "0.6430117", "0.6410058", "0.64080423", "0.63771075", "0.63771075", "0.63192254", "0.6308028", "0.6299871", "0.6299871", "0.6299871", "0.6286737", "0.6278868", "0.6269982", "0.6209381", "0.61717373", "0.61656076", "0.61569107", "0.6138806", "0.6135566", "0.6066256", "0.60481864", "0.60442597", "0.6028001", "0.60201997", "0.6011092", "0.59868366", "0.5977242", "0.5974985", "0.5973415", "0.594687", "0.5945069", "0.59361935", "0.59270763", "0.59152657", "0.5911495", "0.5907866", "0.5899495", "0.58983207", "0.58740467", "0.586351", "0.586351", "0.58575505", "0.5851793", "0.5839022", "0.5818046", "0.581147", "0.579908", "0.5777232", "0.5769427", "0.5766472", "0.57627577", "0.57627577", "0.5751331", "0.57502437", "0.57365865", "0.5720028", "0.5709795", "0.56996524", "0.569127", "0.56733775", "0.5672211", "0.5667483", "0.5653318", "0.5650922", "0.5633776", "0.5631959", "0.5631959", "0.5631959", "0.5619857", "0.5615261", "0.56082267", "0.56071174", "0.56040424", "0.56040424", "0.56005645", "0.5572417", "0.5572417", "0.5557297", "0.55539584", "0.5517734", "0.55105054", "0.55004233" ]
0.72994524
2
change content to force a changed signature
protected void changeContent() { byte[] data = Arrays.copyOf(content.getContent(), content.getContent().length + 1); data[content.getContent().length] = '2'; // append one byte content.setContent(data); LOG.info("document content changed"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ISModifySignature createISModifySignature();", "private void setSignature(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000010;\n signature_ = value;\n }", "void xsetSignatureText(com.microsoft.schemas.office.x2006.digsig.STSignatureText signatureText);", "void setSignature(String signature) {\n this.signature = signature;\n }", "public void setSignature(String Signature) {\n this.Signature = Signature;\n }", "public void setSignature(String signature) {\n\t\tthis.signature = signature;\n\t}", "public void setSignature( String pSignature )\r\n {\r\n this.signature = pSignature;\r\n }", "void setSignatureText(java.lang.String signatureText);", "void setSignatureImage(byte[] signatureImage);", "public abstract String getSignature();", "void setSignatureType(int signatureType);", "java.lang.String getSignatureText();", "void xsetSignatureType(com.microsoft.schemas.office.x2006.digsig.STSignatureType signatureType);", "void xsetSignatureComments(com.microsoft.schemas.office.x2006.digsig.STSignatureComments signatureComments);", "void overwriteContent(Md2Entity content);", "public Boolean updateSignatureTemplate(TemplateSignature signature)\n\t{\n\t\tTemplateSignatureDAO dao = new TemplateSignatureDAO();\n\t\tdao.save(signature);\t\t\n\t\treturn true;\n\t}", "String getSignature();", "String getSignature();", "String getSignature();", "void xsetSignatureImage(org.apache.xmlbeans.XmlBase64Binary signatureImage);", "public abstract byte[] getSignature();", "private void signMessage() {\n\n String messageText = messageTextArea.getText();\n SecureCharSequence secureCharSequence = new SecureCharSequence(currentPassword.getPassword());\n String signMessage = this.address.signMessage(messageText, secureCharSequence);\n signature.setText(signMessage);\n\n }", "void setSignatureComments(java.lang.String signatureComments);", "protected byte[] getSignature() {\n return signatureImpl.calculate(content, null);\n }", "public void setVisibleSignature(InputStream visibleSignature)\n {\n this.visibleSignature = visibleSignature;\n }", "public Builder setSignature(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n signature_ = value;\n onChanged();\n return this;\n }", "public Builder setSignature(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n signature_ = value;\n onChanged();\n return this;\n }", "public void setSignature(String signature) {\n this.signature = signature == null ? null : signature.trim();\n }", "public void setSignature(String signature) {\n this.signature = signature == null ? null : signature.trim();\n }", "public void setSignatureBitmap(final Bitmap signature) {\n if (ViewCompat.isLaidOut(this)) {\n clear();\n ensureSignatureBitmap();\n\n RectF tempSrc = new RectF();\n RectF tempDst = new RectF();\n\n int dWidth = signature.getWidth();\n int dHeight = signature.getHeight();\n int vWidth = getWidth();\n int vHeight = getHeight();\n\n // Generate the required transform.\n tempSrc.set(0, 0, dWidth, dHeight);\n tempDst.set(0, 0, vWidth, vHeight);\n\n Matrix drawMatrix = new Matrix();\n drawMatrix.setRectToRect(tempSrc, tempDst, Matrix.ScaleToFit.CENTER);\n\n Canvas canvas = new Canvas(mSignatureBitmap);\n canvas.drawBitmap(signature, drawMatrix, null);\n setIsEmpty(false);\n invalidate();\n }\n // View not laid out yet e.g. called from onCreate(), onRestoreInstanceState()...\n else {\n getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {\n @Override\n public void onGlobalLayout() {\n // Remove layout listener...\n ViewTreeObserverCompat.removeOnGlobalLayoutListener(getViewTreeObserver(), this);\n\n // Signature bitmap...\n setSignatureBitmap(signature);\n }\n });\n }\n }", "public void setSignature(short signature) {\n\t\ttry {\n\t\t\tgetStream().setInt(this.signature, signature);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn;\n\t\t}\n\t}", "public void sign(String reason, String location) throws IOException, DocumentException, GeneralSecurityException {\n\t\tPdfReader reader = new PdfReader(src);\n\t\tFileOutputStream os = new FileOutputStream(dest);\n\t\t\n\t\tPdfStamper sello = PdfStamper.createSignature(reader, os, '\\0');\n\t\t\n\t\t//Creamos el sello y su localización.\n\t\tPdfSignatureAppearance apariencia = sello.getSignatureAppearance();\n\t\tapariencia.setReason(reason);\n\t\tapariencia.setLocation(location);\n\t\tapariencia.setVisibleSignature(new Rectangle(36, 748, 144, 700), 1, \"sig\");\n\t\t\n\t\t//Creamos la firma.\n\t\tExternalSignature pks = new PrivateKeySignature(pk, DigestAlgorithms.SHA256, provider.getName());\n\t\t\n\t\tExternalDigest digest = new BouncyCastleDigest();\n\t\t\n\t\tMakeSignature.signDetached(apariencia, digest, pks, chain, \n\t\t\t\tnull, null, null, 0, CryptoStandard.CMS);\n\t}", "int getSignature ();", "public void setContent(String newValue);", "@Override\n\tpublic String changeToWZLContent(String content) {\n\t\treturn null;\n\t}", "private void clearSignature() {\n bitField0_ = (bitField0_ & ~0x00000010);\n signature_ = getDefaultInstance().getSignature();\n }", "@ApiModelProperty(example = \"D8047EB8285077D9900EDD42F4081070DDB26E08E7F15A3E29642C80CF0C7D68340682DC9868C73EB09744D6298146D8DFC02ED47070FC81FB47D6F73B33EF0A\", required = true, value = \"The signature of the entity. The signature was generated by the signer and can be used to validate tha the entity data was not modified by a node. \")\n public String getSignature() {\n return signature;\n }", "public String getSignature()\r\n {\r\n return signature;\r\n }", "Signature getSignature();", "public void writeSignature(IProgressMonitor monitor) throws CoreException;", "@Override\n public void onClick(View v) {\n\n if (v == Clear_bt) {\n mSignature.clear();\n // dl.dismiss();\n\n } else if (v == Save_bt) {\n mSignature.save();\n\n } else if (v == Cancel_bt) {\n /* Bundle b = new Bundle();\n b.putString(\"byteArray\", \"cancel\");\n Intent intent = new Intent();\n intent.putExtras(b);\n setResult(3, intent);*/\n // finish();\n mSignature.clear();\n dl.dismiss();\n\n } else if (v == tech_signature) {\n Sign_Check = \"Man\";\n get_signature(Sign_Check);\n\n }\n else if (v == staff_signature) {\n Sign_Check = \"staff\";\n get_signature(Sign_Check);\n\n }\n\n\n else if (v == supervisor_signature) {\n\n Sign_Check = \"Co\";\n get_signature(Sign_Check);\n\n }\n\n else if (v == msot_signature_button) {\n\n Sign_Check = \"msot\";\n get_signature(Sign_Check);\n\n }\n }", "byte[] getSignatureImage();", "public void update(byte paramByte) throws XMLSignatureException {\n/* 218 */ this.signatureAlgorithm.engineUpdate(paramByte);\n/* */ }", "protected void sequence_Signature(ISerializationContext context, Signature semanticObject) {\r\n\t\tgenericSequencer.createSequence(context, semanticObject);\r\n\t}", "public Builder setSignature(org.apache.calcite.avatica.proto.Common.Signature value) {\n if (signatureBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n signature_ = value;\n onChanged();\n } else {\n signatureBuilder_.setMessage(value);\n }\n\n return this;\n }", "public void setContent(String newContent)\n\t{\n\t\tthis.content = newContent;\n\t}", "public String getSignature() {\n return signature;\n }", "public String getSignature() {\n return signature;\n }", "public String getSignature() {\n return signature;\n }", "@Override\n\t\tpublic void setEditedContent(CGFile file) {\n\n\t\t}", "public GpgSignature(@NonNull byte[] signature) {\n\t\tthis.signature = signature;\n\t}", "public interface SignatureObject {\n}", "public void updateContent(String new_content){\n\t\tif(content == null){\n\t\t\tcontent = \"\";\n\t\t}\n\t\tcontent = content.concat(new_content);\n\t\tupdateSize();\t\t\n\t}", "public Builder setSignature(com.google.protobuf.ByteString value) {\n copyOnWrite();\n instance.setSignature(value);\n return this;\n }", "public synchronized void setContent(Object content) {\n // nothing\n }", "java.lang.String getSignatureComments();", "public void printHashKey(){\n try {\n PackageInfo info = getPackageManager().getPackageInfo(\n \"com.credolabs.justcredo\",\n PackageManager.GET_SIGNATURES);\n for (Signature signature : info.signatures) {\n MessageDigest md = MessageDigest.getInstance(\"SHA\");\n md.update(signature.toByteArray());\n Log.d(\"Credo:\", Base64.encodeToString(md.digest(), Base64.DEFAULT));\n }\n } catch (PackageManager.NameNotFoundException e) {\n\n } catch (NoSuchAlgorithmException e) {\n\n }\n }", "public void upload(String path, String content) {\n\n String url = \"http://api.renren.com/restserver.do\";\n String signature = getParams(content);\n String method = \"photos.upload\";\n String v2 = \"1.0\";\n String access_token = AccessData.access_token;\n String format = \"JSON\";\n String contentType = \"multipart/form-data\";\n String filename = Util.getFileName(path);\n String caption = content;\n byte[] data = getBytes(path);\n\n TreeMap<String, String> params = new TreeMap<String, String>();\n params.put(\"sig\", signature);\n Log.d(\"upload renren\", \"signature:\" + signature);\n params.put(\"method\", method);\n params.put(\"v\", v2);\n params.put(\"access_token\", access_token);\n Log.d(\"upload renren\", \"access_token:\" + access_token);\n params.put(\"format\", format);\n params.put(\"caption\", caption);\n String resp;\n try {\n resp = HttpURLUtils.doUploadFile(url, params, \"upload\",\n filename, contentType, data);\n Log.d(\"upload renren\", \"\" + resp);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "public void setSignatureAlgorithm(java.lang.String r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.setSignatureAlgorithm(java.lang.String):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.x509.X509V1CertificateGenerator.setSignatureAlgorithm(java.lang.String):void\");\n }", "SignatureSource createSignatureSource();", "boolean updateContent();", "public interface SignatureFactory \n{\n /** \n * initializes the implementation class \n */\n public void init()\n throws SignedDocException;\n \n /**\n * Method returns an array of strings representing the \n * list of available token names.\n * @return an array of available token names.\n * @throws SignedDocException if reading the token information fails.\n */\n public String[] getAvailableTokenNames()\n throws SignedDocException;\n \n /**\n * Method returns a digital signature. It finds the RSA private \n * key object from the active token and\n * then signs the given data with this key and RSA mechanism.\n * @param digest digest of the data to be signed.\n * @param token token index\n * @param pin users pin code\n * @return an array of bytes containing digital signature.\n * @throws SignedDocException if signing the data fails.\n */\n public byte[] sign(byte[] digest, int token, String pin) \n throws SignedDocException;\n \n /**\n * Method returns a X.509 certificate object readed \n * from the active token and representing an\n * user public key certificate value.\n * @return X.509 certificate object.\n * @throws SignedDocException if getting X.509 public key certificate \n * fails or the requested certificate type X.509 is not available in \n * the default provider package\n */\n public X509Certificate getCertificate(int token, String pin)\n throws SignedDocException;\n \n /**\n * Resets the previous session\n * and other selected values\n */\n public void reset() \n throws SignedDocException;\n \n\t/**\n\t * Method decrypts the data with the RSA private key\n\t * corresponding to this certificate (which was used\n\t * to encrypt it). Decryption will be done on the card.\n\t * This operation closes the possibly opened previous\n\t * session with signature token and opens a new one with\n\t * authentication token if necessary\n\t * @param data data to be decrypted.\n\t * @param token index of authentication token\n\t * @param pin PIN code\n\t * @return decrypted data.\n\t * @throws SignedDocException for all decryption errors\n\t */\n\tpublic byte[] decrypt(byte[] data, int token, String pin) \n\t\tthrows SignedDocException;\n\t\t\t\t\n}", "@Override\n public void RiskSignatureText(String riskSignatureText) {\n waitUntilDisplayed(RiskSignatureSubmitbtn);\n find(RiskSignatureTextbox).sendKeys(riskSignatureText);\n find(RiskSignatureSubmitbtn).click();\n }", "private void setSignatureType(byte type) \r\n \t //@ requires signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(?ta) &*& foreachp(ta, transient_byte_array);\r\n \t //@ ensures signatureType |-> theSignatureType &*& is_transient_byte_array(theSignatureType) == true &*& transient_byte_arrays(ta) &*& foreachp(ta, transient_byte_array);\r\n\t{\r\n\t\t//@ transient_byte_arrays_mem(theSignatureType);\r\n\t\t//@ foreachp_remove(theSignatureType, ta);\r\n\t\t//@ open transient_byte_array(theSignatureType);\r\n\t\tsignatureType[0] = type;\r\n\t\t//@ close transient_byte_array(theSignatureType);\r\n\t\t//@ foreachp_unremove(theSignatureType, ta);\r\n\t}", "public void update(byte[] paramArrayOfbyte) throws XMLSignatureException {\n/* 207 */ this.signatureAlgorithm.engineUpdate(paramArrayOfbyte);\n/* */ }", "public void setUserGeneratedContent(String userGeneratedContent) {\n mUserGeneratedContent = userGeneratedContent;\n }", "public void valSig (String fileName) {\n javax.xml.parsers.DocumentBuilderFactory dbf =\n javax.xml.parsers.DocumentBuilderFactory.newInstance();\n dbf.setNamespaceAware(true);\n javax.xml.parsers.DocumentBuilder db = null;\n\n System.out.println(\"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\");\n\n try {\n db = dbf.newDocumentBuilder();\n } catch (ParserConfigurationException e) {\n e.printStackTrace();\n }\n try {\n Document doc =\n db.parse(new FileInputStream(fileName));\n\n XPathFactory xpf = XPathFactory.newInstance();\n XPath xpath = xpf.newXPath();\n xpath.setNamespaceContext(new DSNamespaceContext());\n String expression = \"//ds:Signature[1]\";\n Element sigElement =\n (Element) xpath.evaluate(expression, doc, XPathConstants.NODE);\n\n XMLSignature signature =\n new XMLSignature(sigElement, (new File(fileName)).toURI().toURL().toString());\n\n String expressionBody = \"//soapenv:Body\";\n Element bodyElement =\n (Element) xpath.evaluate(expressionBody, doc, XPathConstants.NODE);\n\n Attr id = bodyElement.getAttributeNode(\"Id\") ;\n IdResolver.registerElementById(bodyElement,id);\n //signature.addResourceResolver(new OfflineResolver());\n\n KeyInfo ki = signature.getKeyInfo();\n System.out.println(\"================================signature.getSignatureValue()================================\");\n\n String svStr = new String(signature.getSignatureValue());\n System.out.println(svStr);\n System.out.println(\"================================signature.getSignatureValue()================================\");\n\n if (ki != null) {\n if (ki.containsX509Data()) {\n System.out.println(\"Could find a X509Data element in the KeyInfo\");\n }\n X509Certificate cert = signature.getKeyInfo().getX509Certificate();\n if (cert != null) {\n System.out.println(\"The XML signature in file \"\n // + f.toURI().toURL().toString() + \" is \"\n + (signature.checkSignatureValue(cert)\n ? \"valid (good)\" : \"invalid !!!!! (bad)\"));\n } else {\n System.out.println(\"Did not find a Certificate\");\n PublicKey pk = signature.getKeyInfo().getPublicKey();\n if (pk != null) {\n System.out.println(\"The XML signature in file \"\n // + f.toURI().toURL().toString() + \" is \"\n + (signature.checkSignatureValue(pk)\n ? \"valid (good)\" : \"invalid !!!!! (bad)\"));\n } else {\n System.out.println(\n \"Did not find a public key, so I can't check the signature\");\n }\n }\n } else {\n System.out.println(\"Did not find a KeyInfo\");\n }\n\n\n\n\n\n } catch (SAXException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (XPathExpressionException e) {\n e.printStackTrace();\n } catch (XMLSignatureException e) {\n e.printStackTrace();\n } catch (XMLSecurityException e) {\n e.printStackTrace();\n }\n\n }", "public String getSignature() {\n\t\treturn signature;\n\t}", "@RequestMapping(value = \"/cades-signature-complete\", method = {RequestMethod.POST})\n\tpublic String complete(\n\t\t@RequestParam(value = \"token\", required = true) String token,\n\t\t@RequestParam(value = \"signature\", required = true) String signature,\n\t\tModel model\n\t) throws IOException, RestException {\n\n\t\t// Instantiate the PadesSignatureFinisher class, responsible for completing the signature process. For more\n\t\t// information, see:\n\t\t// https://pki.rest/Content/docs/java-client/index.html?com/lacunasoftware/restpki/CadesSignatureFinisher.html\n\t\tCadesSignatureFinisher signatureFinisher = new CadesSignatureFinisher(Util.getRestPkiClient());\n\n\t\t// Set the token for this signature (rendered in a hidden input field, see file templates/cades-signature-step2.html)\n\t\tsignatureFinisher.setToken(token);\n\n\t\t// Set the result of the signature operation\n\t\tsignatureFinisher.setSignature(signature);\n\n\t\t// Call the finish() method, which finalizes the signature process and returns the CMS\n\t\tbyte[] cms;\n\t\ttry {\n\t\t\tcms = signatureFinisher.finish();\n\t\t} catch (ValidationException e) {\n\t\t\t// The call above may throw a ValidationException if any validation errors occur (for instance, if the\n\t\t\t// certificate is revoked). If so, we'll render a page showing what went wrong.\n\t\t\tmodel.addAttribute(\"title\", \"Validation of the signature failed\");\n\t\t\t// The toString() method of the ValidationResults object can be used to obtain the checks performed, but the\n\t\t\t// string contains tabs and new line characters for formatting. Therefore, we call the method\n\t\t\t// Util.getValidationResultsHtml() to convert these characters to <br>'s and &nbsp;'s.\n\t\t\tmodel.addAttribute(\"vrHtml\", Util.getValidationResultsHtml(e.getValidationResults()));\n\t\t\treturn \"validation-failed\";\n\t\t}\n\n\t\t// Get information about the certificate used by the user to sign the file. This method must only be called after\n\t\t// calling the finish() method.\n\t\tPKCertificate signerCert = signatureFinisher.getCertificateInfo();\n\n\t\t// At this point, you'd typically store the CMS on your database. For demonstration purposes, we'll\n\t\t// store the CMS on a temporary folder and return to the page an identifier that can be used to download it.\n\n\t\tString filename = UUID.randomUUID() + \".p7s\";\n\t\tFiles.write(Application.getTempFolderPath().resolve(filename), cms);\n\t\tmodel.addAttribute(\"signerCert\", signerCert);\n\t\tmodel.addAttribute(\"filename\", filename);\n\t\treturn \"cades-signature-info\";\n\t}", "Object openSignEditor(Location location);", "public String getSignature() {\n return this.Signature;\n }", "private static String sign(String data, String key)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tMac mac = Mac.getInstance(\"HmacSHA1\");\n\t\t\t\tmac.init(new SecretKeySpec(key.getBytes(), \"HmacSHA1\"));\n\t\t\t\treturn Base64.encodeBytes(mac.doFinal(data.getBytes(\"UTF-8\")));\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new RuntimeException(new SignatureException(\"Failed to generate signature: \" + e.getMessage(), e));\n\t\t\t}\n\t\t}", "public Builder setSignatureBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n\n signature_ = value;\n onChanged();\n return this;\n }", "public Builder setSignatureBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n\n signature_ = value;\n onChanged();\n return this;\n }", "public static void reSign() {\n\t\t//System.out.println(\"Data before resign: \" + dataList);\n\t\tfor(int i = 0 ; i < dataList.size() ; i++) {\n\t\t\t//there is char '-$'\n\t\t\tif(dataList.get(i).name.charAt(0)=='-') {\n\t\t\t\tData n = new Data(\"\"+dataList.get(i).name.charAt(1),dataList.get(i).value*(-1));\n\t\t\t\tdataList.remove(i);\n\t\t\t\tif(hasToken(n.name)) {\n\t\t\t\t\tint ind = getIndex(n.name);\n\t\t\t\t\tdataList.remove(ind);\n\t\t\t\t}\n\t\t\t\tdataList.add(n);\n\t\t\t}\t\t\t\n\t\t}\n\t\t//System.out.println(\"Saved data: \" + dataList);\n\t}", "protected void setContents(Object contents) {\n\t}", "public void setContent(String content)\n/* */ {\n/* 1340 */ this.content = content;\n/* */ }", "public abstract String getNewContent();", "com.google.protobuf.ByteString getSignature();", "public static void readSignaturesFromFile() throws IOException {\n SigManager manager = new SigManager(new File(\"/path/to/Signatures\"));\n\n //Read signature from file in chosen directory\n Set<OWLEntity> sig = manager.readFile(\"signature.txt\");\n\n //Modify signature perhaps..\n\n //Write signature to file in same chosen directory\n manager.writeFile(sig, \"signature-modified.txt\");\n }", "public byte[] getSignature()\n {\n return Arrays.clone(signature);\n }", "public void setSignatureValidator(SignatureValidator newSignatureValidator) {\r\n signatureValidator = newSignatureValidator;\r\n }", "void xsetSignatureProviderDetails(org.apache.xmlbeans.XmlInt signatureProviderDetails);", "com.microsoft.schemas.office.x2006.digsig.STSignatureText xgetSignatureText();", "public Builder setArtifactSignature(com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n artifactSignature_ = value;\n onChanged();\n return this;\n }", "public Builder setSignature(@NonNull String signature) {\n mSignature = Preconditions.checkNotNull(signature);\n return this;\n }", "private void setContent(String content) {\n this.content = content;\n }", "public void visitSignatureCapture( DevCat devCat ) {}", "@Override\n public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@Override\n public com.google.protobuf.ByteString\n getSignatureBytes() {\n Object ref = signature_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n signature_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public interface ContentVerifier\n{\n /**\n * Return the algorithm identifier describing the signature\n * algorithm and parameters this verifier supports.\n *\n * @return algorithm oid and parameters.\n */\n AlgorithmIdentifier getAlgorithmIdentifier();\n\n /**\n * Returns a stream that will accept data for the purpose of calculating\n * a signature for later verification. Use org.bouncycastle.util.io.TeeOutputStream if you want to accumulate\n * the data on the fly as well.\n *\n * @return an OutputStream\n */\n OutputStream getOutputStream();\n\n /**\n * Return true if the expected value of the signature matches the data passed\n * into the stream.\n *\n * @param expected expected value of the signature on the data.\n * @return true if the signature verifies, false otherwise\n */\n boolean verify(byte[] expected);\n}", "private void syncContent() {\n \tdocument.setContent(textArea.getText());\n }", "public void editManifest() {\n byte[] arrby;\n AXmlEditor aXmlEditor = new AXmlEditor();\n File file = new File((Object)Environment.getExternalStorageDirectory() + \"/BIKINAPLIKASI/tmp/AndroidManifest.xml\");\n try {\n this.copyManifest(file);\n }\n catch (IOException iOException) {\n iOException.printStackTrace();\n }\n ArrayList arrayList = new ArrayList();\n File file2 = new File((Object)Environment.getExternalStorageDirectory() + \"/BIKINAPLIKASI/tmp\", \"AndroidManifest.xml\");\n try {\n byte[] arrby2;\n arrby = arrby2 = FileUtil.readFile(file2);\n }\n catch (IOException iOException) {\n iOException.printStackTrace();\n arrby = null;\n }\n try {\n aXmlEditor.read((List<String>)arrayList, arrby);\n }\n catch (IOException iOException) {\n iOException.printStackTrace();\n }\n String string = StringUtils.join((Collection<String>)arrayList, \"\\n\").replaceFirst(\"namatoko\", this.username).replace((CharSequence)\"namatoko.situsbelanja.com\", (CharSequence)(this.username + \".situsbelanja.com\")).replace((CharSequence)\"namatoko.olshp.com\", (CharSequence)(this.username + \".olshp.com\")).replace((CharSequence)\"domainbikinaplikasionlineshop.com\", (CharSequence)this.dataPref.getWebsite()).replace((CharSequence)\"Nama Toko\", (CharSequence)this.namaaplikasi).replaceFirst(\"com.bikinaplikasi.onlineshop\", \"com.bikinaplikasi.\" + this.username).replaceFirst(\"com.bikinaplikasi.onlineshop.permission.C2D_MESSAGE\", \"com.bikinaplikasi.\" + this.username + \".permission.C2D_MESSAGE\").replaceFirst(\"com.bikinaplikasi.onlineshop.google_measurement_service\", \"com.bikinaplikasi.\" + this.username + \".google_measurement_service\").replace((CharSequence)\"android:debuggable=\\\"true\\\"\", (CharSequence)\"android:debuggable=\\\"false\\\"\").replace((CharSequence)\"4.47\", (CharSequence)(this.versi + \".0\"));\n Integer.parseInt((String)this.versi);\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n File file3 = new File((Object)Environment.getExternalStorageDirectory() + \"/BIKINAPLIKASI/tmp\", \"AndroidManifest.xml\");\n try {\n this.out = new FileOutputStream(file3);\n }\n catch (FileNotFoundException fileNotFoundException) {\n fileNotFoundException.printStackTrace();\n }\n try {\n aXmlEditor.write(string.toString(), (OutputStream)byteArrayOutputStream);\n }\n catch (IOException iOException) {\n iOException.printStackTrace();\n }\n try {\n this.out = new FileOutputStream(file3);\n }\n catch (FileNotFoundException fileNotFoundException) {\n fileNotFoundException.printStackTrace();\n }\n try {\n this.out.write(byteArrayOutputStream.toByteArray());\n return;\n }\n catch (IOException iOException) {\n iOException.printStackTrace();\n return;\n }\n }", "private void signSetter(Block b, Player p, String[] lines) \n\t{\t\t\n\t\t//TODO: virer debug\n\t\t//p.sendMessage(\"dbg1\");\n\t\t\n\t\t\n\t\tif(b==null) \n\t\t\treturn;\n\t\t\n\t\tBoutiqueSign bs = new BoutiqueSign();\n\t\t\n\t\tbs.setOwner(p);\n\t\tbs.setLocation(b.getLocation());\n\t\tbs.setLines(lines);\n\n\t\t//TODO: virer debug\n\t\t/*\n\t\tp.sendMessage(\"dbg1 : line1 = \" + bs.getLine1());\n\t\tp.sendMessage(\"dbg1 : line2 = \" + bs.getLine2());\n\t\tp.sendMessage(\"dbg1 : line3 = \" + bs.getLine3());\n\t\tp.sendMessage(\"dbg1 : line4 = \" + bs.getLine4());\t\t\n\t\tp.sendMessage(\"dbg2 : type = \" + bs.getType());\n\t\t*/\n\t\t\n\t\tif(bs.isSignServer())\n\t\t{\n\t\t\t\n\t\t\tif (!PermissionsHandler.canSetGlobalSign(p))\n\t\t\t{\n\t\t\t\tp.sendMessage(PermissionsHandler.permissionErr);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tif(!bs.checkLines(p))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tp.sendMessage(plugin.chatPrefix + Messages.getString(\"Sign.SERVERSIGNADDED\")); //$NON-NLS-1$\n\t\t}\n\t\t\n\t\telse if(bs.isSignChest())\n\t\t{\n\t\t\tif (!PermissionsHandler.canSetPersonalSign(p))\n\t\t\t{\n\t\t\t\tp.sendMessage(plugin.chatPrefix + PermissionsHandler.permissionErr);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tif(!bs.checkLines(p))\n\t\t\t{\n\t\t\t\t//TODO: virer debug\n\t\t\t\t//p.sendMessage(\"erreur checkline\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tp.sendMessage(plugin.chatPrefix + Messages.getString(\"Sign.CHESTSIGNADDED\")); //$NON-NLS-1$\n\t\t}\t\n\t\telse if(bs.isSignWebAuction())\n\t\t{\n\t\t\tif (!PermissionsHandler.canSetWebAuctionSign(p))\n\t\t\t{\n\t\t\t\tp.sendMessage(PermissionsHandler.permissionErr);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tif(!bs.checkLines(p))\n\t\t\t{\n\t\t\t\t//TODO: virer debug\n\t\t\t\t//p.sendMessage(\"erreur checkline\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tp.sendMessage(plugin.chatPrefix + Messages.getString(\"Sign.WEBAUCTIONSIGNADDED\")); //$NON-NLS-1$\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\tbs.setLine4(\"ok\");\t\t\t //$NON-NLS-1$\n\t\tbs.Render();\n\t\t\n\t\tthis.put(bs);\n\t\tplugin.signmanager.saveGlobalSigns();\n\t}", "public\tString\tgetNewSignature() {\n\t\t\treturn\tthis.newSignature;\n\t\t}", "public void buildSignature() throws IOException\n {\n PDFTemplateBuilder builder = new PDVisibleSigBuilder();\n PDFTemplateCreator creator = new PDFTemplateCreator(builder);\n setVisibleSignature(creator.buildPDF(getPdVisibleSignature()));\n }", "public void updateSign(boolean activated) {\n if (!ChunkLocation.fromLocation(activationBlock).isChunkLoaded()) return;\n\n try {\n BlockState state = activationBlock.getBlock().getState();\n if (state == null || !(state instanceof Sign)) return;\n\n final Sign sign = (Sign) state;\n\n String line;\n if (activated) {\n String signColor;\n if (isDisabled()) signColor = \"8\";\n else signColor = RCPrefs.getSignColor();\n line = (char) 167 + signColor + type;\n } else {\n line = type;\n }\n\n if (!line.equals(sign.getLine(0))) {\n sign.setLine(0, line);\n\n RedstoneChips.inst().getServer().getScheduler().scheduleSyncDelayedTask(RedstoneChips.inst(), () -> sign.update());\n }\n } catch (NullPointerException ne) {\n }\n }", "switch (buffer[ISO7816.OFFSET_CDATA + 4]) {\r\n\t\tcase BASIC:\r\n\t\t\tsetSignatureType(BASIC);\r\n\t\t\tbreak;\r\n\t\tcase AUTHENTICATION: // use authentication private key\r\n\t\t\tsetSignatureType(AUTHENTICATION);\r\n\t\t\tbreak;\r\n\t\tcase NON_REPUDIATION: // use non repudiation private key\r\n\t\t\tsetSignatureType(NON_REPUDIATION);\r\n\t\t\tbreak;\r\n\t\tcase CA_ROLE:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_DATA);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\tdefault:\r\n\t\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\t\tISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\t}", "Entry<StatusType, String> verifyExternalSignature(Document document, Document signature);", "String process(String data) throws LocalizedSignatureException;" ]
[ "0.6329757", "0.63073266", "0.62550426", "0.6246843", "0.60776615", "0.6021065", "0.6016611", "0.59344995", "0.5916748", "0.5899649", "0.5824738", "0.58065194", "0.5774599", "0.57502896", "0.5716113", "0.5687877", "0.5685518", "0.5685518", "0.5685518", "0.56541604", "0.5561017", "0.55390155", "0.5528896", "0.5484901", "0.5480484", "0.5469262", "0.5469262", "0.546595", "0.546595", "0.54526144", "0.5452473", "0.5450639", "0.53828514", "0.5367193", "0.53640187", "0.53536075", "0.532003", "0.52989155", "0.52866995", "0.5283674", "0.5267525", "0.5259891", "0.52505106", "0.5215876", "0.52101177", "0.5194894", "0.5175994", "0.5175994", "0.5175994", "0.5172211", "0.5171462", "0.51578707", "0.5156306", "0.5136157", "0.5132666", "0.51148033", "0.50960326", "0.5091337", "0.5078526", "0.50703526", "0.5063794", "0.5058936", "0.5051846", "0.5045623", "0.50397485", "0.5036128", "0.5035688", "0.5032974", "0.5023859", "0.5022262", "0.50163484", "0.5014515", "0.5012723", "0.5012723", "0.5011899", "0.50035244", "0.4992179", "0.4988452", "0.49854755", "0.4984341", "0.497091", "0.4953944", "0.49472737", "0.49445394", "0.4941916", "0.4923301", "0.4914224", "0.49116477", "0.4909409", "0.4909409", "0.48978892", "0.48959154", "0.48941097", "0.4890357", "0.48834276", "0.48743483", "0.48707733", "0.48597848", "0.48490378", "0.4838673" ]
0.66616577
0
default parse action: add signature if successfully fetched
protected List<CrawlDatum> parse(CrawlDatum fetchDatum) { List<CrawlDatum> parseDatums = new ArrayList<CrawlDatum>(0); if (fetchDatum.getStatus() == CrawlDatum.STATUS_FETCH_SUCCESS) { CrawlDatum signatureDatum = new CrawlDatum(CrawlDatum.STATUS_SIGNATURE, 0); signatureDatum.setSignature(getSignature()); parseDatums.add(signatureDatum); } return parseDatums; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String parsePostRequest(StringTokenizer parse) {\n\t\tString fileRequested = parse.nextToken();\r\n\r\n\t\treturn null;\r\n\t}", "public abstract String getSignature();", "@RequestMapping(value = \"/cades-signature-complete\", method = {RequestMethod.POST})\n\tpublic String complete(\n\t\t@RequestParam(value = \"token\", required = true) String token,\n\t\t@RequestParam(value = \"signature\", required = true) String signature,\n\t\tModel model\n\t) throws IOException, RestException {\n\n\t\t// Instantiate the PadesSignatureFinisher class, responsible for completing the signature process. For more\n\t\t// information, see:\n\t\t// https://pki.rest/Content/docs/java-client/index.html?com/lacunasoftware/restpki/CadesSignatureFinisher.html\n\t\tCadesSignatureFinisher signatureFinisher = new CadesSignatureFinisher(Util.getRestPkiClient());\n\n\t\t// Set the token for this signature (rendered in a hidden input field, see file templates/cades-signature-step2.html)\n\t\tsignatureFinisher.setToken(token);\n\n\t\t// Set the result of the signature operation\n\t\tsignatureFinisher.setSignature(signature);\n\n\t\t// Call the finish() method, which finalizes the signature process and returns the CMS\n\t\tbyte[] cms;\n\t\ttry {\n\t\t\tcms = signatureFinisher.finish();\n\t\t} catch (ValidationException e) {\n\t\t\t// The call above may throw a ValidationException if any validation errors occur (for instance, if the\n\t\t\t// certificate is revoked). If so, we'll render a page showing what went wrong.\n\t\t\tmodel.addAttribute(\"title\", \"Validation of the signature failed\");\n\t\t\t// The toString() method of the ValidationResults object can be used to obtain the checks performed, but the\n\t\t\t// string contains tabs and new line characters for formatting. Therefore, we call the method\n\t\t\t// Util.getValidationResultsHtml() to convert these characters to <br>'s and &nbsp;'s.\n\t\t\tmodel.addAttribute(\"vrHtml\", Util.getValidationResultsHtml(e.getValidationResults()));\n\t\t\treturn \"validation-failed\";\n\t\t}\n\n\t\t// Get information about the certificate used by the user to sign the file. This method must only be called after\n\t\t// calling the finish() method.\n\t\tPKCertificate signerCert = signatureFinisher.getCertificateInfo();\n\n\t\t// At this point, you'd typically store the CMS on your database. For demonstration purposes, we'll\n\t\t// store the CMS on a temporary folder and return to the page an identifier that can be used to download it.\n\n\t\tString filename = UUID.randomUUID() + \".p7s\";\n\t\tFiles.write(Application.getTempFolderPath().resolve(filename), cms);\n\t\tmodel.addAttribute(\"signerCert\", signerCert);\n\t\tmodel.addAttribute(\"filename\", filename);\n\t\treturn \"cades-signature-info\";\n\t}", "void setSignature(String signature) {\n this.signature = signature;\n }", "public void setSignature(String signature) {\n\t\tthis.signature = signature;\n\t}", "public abstract String getCurrentUserSignature(PortletRequest request);", "String getSignature();", "String getSignature();", "String getSignature();", "int getSignature ();", "String process(String data) throws LocalizedSignatureException;", "protected void postParse(T fileParsed) {\n\t}", "@Override\n\tpublic void postParse() {\n\t}", "@Override\n\tpublic void postParse() {\n\t}", "public void setSignature( String pSignature )\r\n {\r\n this.signature = pSignature;\r\n }", "ReleaseFile parseWithSignature( InputStream is, InputStream signStream, InputStream keyStream ) throws IOException;", "Signature getSignature();", "Entry<StatusType, String> verifyExternalSignature(Document document, Document signature);", "@Override\n\tprotected void parseResult() {\n\t\t\n\t}", "java.lang.String getSignatureText();", "public void parse() {\n }", "public void setSignature(String Signature) {\n this.Signature = Signature;\n }", "String process(File file) throws LocalizedSignatureException;", "public abstract byte[] getSignature();", "static void return_when_sign(String passed){\n\t\tif(S)\n\t\t\tcomplete_return_requirements();\n\t}", "public void visitSignatureCapture( DevCat devCat ) {}", "private void handleAllStartTags(Tag tagReturnedFromParse, MutableAttributeSet attributeSetReturnedFromParse, int pos) {\n\tif (StepsToFollow == null) {\n\t initializeStepsToFollow();\n\t}\n\tStepsToFollow.processNextStep();\n\ttry {\n\t if (StepsToFollow.tagToFind == null) {\n\t\tthis.strImageDate = StepsToFollow.getStrImageDate();\n\t\tthis.strImageUrl = StepsToFollow.getStrImageUrl();\n//\t\tthis.ldImageDate = StepsToFollow.getLdImageDate();\n\t\tthis.setStrImageWebPageUrlForPreviousDay(StepsToFollow.getStrPrevWebPageUrl());\n\t } else {\n\t\tif (StepsToFollow.tagToFind.equals(tagReturnedFromParse)) {\n\t\t if (MyTestStepToCheck != StepsToFollow.intNextStepToCheck) {\n\t\t\tString strTagToFind = StepsToFollow.tagToFind.toString();\n\t\t\tMyTestResults += strTagToFind + \"|\";\n\t\t\tMyTestStepToCheck = StepsToFollow.intNextStepToCheck;\n\t\t }\n\t\t MyResults = objProcessStartTags.processThisTag(tagReturnedFromParse, attributeSetReturnedFromParse, StepsToFollow.tagToFind, StepsToFollow.attributeToFind, StepsToFollow.strValueToFind, StepsToFollow.intLengthOfValueToFind, StepsToFollow.attributeToGetValueFrom);\n\t\t StepsToFollow.checkReturnValues(MyResults);\n\t\t}\n\t }\n\t} catch (Exception e) {\n\t // TODO Auto-generated catch block\n\t // e.printStackTrace();\n\t String myMsg = \"Error:\";\n\t myMsg += NL + \"ArcamaxWebPageHtmlParser\";\n//\t myMsg += NL + \"imageName: \" + this.strImageName;\n\t myMsg += NL + \"Tag returned: \" + tagReturnedFromParse;\n\t myMsg += NL + \"Tag to find: \" + StepsToFollow.tagToFind;\n\t myMsg += NL + \"Next step to check: \" + StepsToFollow.intNextStepToCheck;\n\t System.out.println(myMsg);\n\t}\n\n }", "@Override\n public void onClick(View v) {\n\n if (v == Clear_bt) {\n mSignature.clear();\n // dl.dismiss();\n\n } else if (v == Save_bt) {\n mSignature.save();\n\n } else if (v == Cancel_bt) {\n /* Bundle b = new Bundle();\n b.putString(\"byteArray\", \"cancel\");\n Intent intent = new Intent();\n intent.putExtras(b);\n setResult(3, intent);*/\n // finish();\n mSignature.clear();\n dl.dismiss();\n\n } else if (v == tech_signature) {\n Sign_Check = \"Man\";\n get_signature(Sign_Check);\n\n }\n else if (v == staff_signature) {\n Sign_Check = \"staff\";\n get_signature(Sign_Check);\n\n }\n\n\n else if (v == supervisor_signature) {\n\n Sign_Check = \"Co\";\n get_signature(Sign_Check);\n\n }\n\n else if (v == msot_signature_button) {\n\n Sign_Check = \"msot\";\n get_signature(Sign_Check);\n\n }\n }", "public void setSignature(String signature) {\n this.signature = signature == null ? null : signature.trim();\n }", "public void setSignature(String signature) {\n this.signature = signature == null ? null : signature.trim();\n }", "boolean hasSignature();", "boolean hasSignature();", "ISModifySignature createISModifySignature();", "public final void entryRuleSignature() throws RecognitionException {\r\n try {\r\n // InternalGo.g:780:1: ( ruleSignature EOF )\r\n // InternalGo.g:781:1: ruleSignature EOF\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getSignatureRule()); \r\n }\r\n pushFollow(FOLLOW_1);\r\n ruleSignature();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getSignatureRule()); \r\n }\r\n match(input,EOF,FOLLOW_2); if (state.failed) return ;\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n }\r\n return ;\r\n }", "private void setSignature(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000010;\n signature_ = value;\n }", "void handleParsedRecord(SampleRecord record);", "static void call_when_sign(String passed){\n\t\tif(S)\n\t\t\tcomplete_call_req(passed.substring(3));\n\t}", "@Override\n void parseOAuthResponse(String data) {\n }", "void parse();", "@RequestMapping(value = \"/pades-signature\", method = {RequestMethod.POST})\n\tpublic String post(\n\t\t\t@RequestParam(value = \"token\", required = true) String token,\n\t\t\tModel model\n\t) throws IOException, RestException {\n\n\t\t// Get an instance of the PadesSignatureFinisher2 class, responsible for completing the\n\t\t// signature process.\n\t\tPadesSignatureFinisher2 signatureFinisher = new PadesSignatureFinisher2(Util.getRestPkiClient());\n\n\t\t// Set the token for this signature (rendered in a hidden input field, see file\n\t\t// templates/pades-signature.html).\n\t\tsignatureFinisher.setToken(token);\n\n\t\t// Call the finish() method, which finalizes the signature process and returns a\n\t\t// SignatureResult object.\n\t\tSignatureResult signatureResult = signatureFinisher.finish();\n\n\t\t// The \"Certificate\" property of the SignatureResult object contains information about the\n\t\t// certificate used by the user to sign the file.\n\t\tPKCertificate signerCert = signatureResult.getCertificate();\n\n\t\t// At this point, you'd typically store the signed PDF on your database. For demonstration\n\t\t// purposes, we'll store the PDF on a temporary folder and return to the page an identifier\n\t\t// that can be used to download it.\n\n\t\t// The SignatureResult object has various methods for writing the signature file to a stream\n\t\t// (writeToFile()), local file (writeToFile()), get its contents (getContent()). Avoid these\n\t\t// methods to prevent memory allocation issues with large files.\n\t\tString filename = UUID.randomUUID() + \".pdf\";\n\t\tsignatureResult.writeToFile(new File(Application.getTempFolderPath(), filename));\n\n\t\t// Render the signature page (templates/pades-signature-info.html).\n\t\tmodel.addAttribute(\"signerCert\", signerCert);\n\t\tmodel.addAttribute(\"filename\", filename);\n\t\treturn \"pades-signature-info\";\n\t}", "public String getSignature()\r\n {\r\n return signature;\r\n }", "SignatureSource createSignatureSource();", "public interface SignatureObject {\n}", "@RequestMapping(value = \"/token\", method = RequestMethod.GET)\n\t@ResponseBody\n\tpublic String home(@RequestParam(\"signature\") String signature,\n\t\t\t@RequestParam(\"echostr\") String echostr,\n\t\t\t@RequestParam(\"timestamp\") String timestamp,\n\t\t\t@RequestParam(\"nonce\") String nonce, \n\t\t\tHttpServletResponse res,Model model) throws IOException {\n\t String signatureb = signature;\n \t\tString echostrb = echostr;\n \t String timestampb = timestamp;\n \t String nonceb = nonce;\n \t Boolean istrue = false;\n \t istrue = checkSecret.CheckSignatureb(signatureb, timestampb, nonceb);\n \t if(istrue) {\n \t \t return echostrb;\n \t }\n \t \n\t\t return \"home\";\n\t}", "public interface IVerifySignatureService {\n\n\t/**\n\t * Document which contains signature internally\n\t * \n\t * @param document : document to be verified\n\t * @return : verification result status and the Token file encoded by base64\n\t */\n\tEntry<StatusType, String> verifyInternalSignature(final Document document);\n\n\t/**\n\t * Document to be verified with its external signature\n\t * \n\t * @param document : document to be verified\n\t * @param signature : its signature file\n\t * @return\n\t */\n\tEntry<StatusType, String> verifyExternalSignature(Document document, Document signature);\n}", "@Override\r\n\t\t\t\t\t\t\t\t\t\t\tpublic void Payment(String result) {\n\r\n\t\t\t\t\t\t\t\t\t\t\t}", "public ParseResult success (Object input) {\n return success(input, 1);\n }", "@Override\n public ParseResult filter(Content content, ParseResult parseResult,\n HTMLMetaTags metaTags, DocumentFragment doc) {\n\n // get parse obj\n Parse parse = parseResult.get(content.getUrl());\n\n // construct base url\n URL base;\n try {\n base = new URL(content.getBaseUrl());\n } catch (MalformedURLException e) {\n Parse emptyParse = new ParseStatus(e).getEmptyParse(getConf());\n parseResult.put(content.getUrl(), new ParseText(emptyParse.getText()),\n emptyParse.getData());\n return parseResult;\n }\n\n try {\n // extract license metadata\n Walker.walk(doc, base, parse.getData().getParseMeta(), getConf());\n } catch (ParseException e) {\n Parse emptyParse = new ParseStatus(e).getEmptyParse(getConf());\n parseResult.put(content.getUrl(), new ParseText(emptyParse.getText()),\n emptyParse.getData());\n return parseResult;\n }\n\n return parseResult;\n }", "void computeSignature(String signature) {\n\t\t// In case of IJavaElement signature, replace '/' by '.'\n\t\tchar[] source = signature.replace('/','.').replace('$','.').toCharArray();\n\n\t\t// Init counters and arrays\n\t\tchar[][] signatures = new char[10][];\n\t\tint signaturesCount = 0;\n\t\tint[] lengthes = new int [10];\n\t\tint typeArgsCount = 0;\n\t\tint paramOpening = 0;\n\t\tboolean parameterized = false;\n\t\t\n\t\t// Scan each signature character\n\t\tfor (int idx=0, ln = source.length; idx < ln; idx++) {\n\t\t\tswitch (source[idx]) {\n\t\t\t\tcase '>':\n\t\t\t\t\tparamOpening--;\n\t\t\t\t\tif (paramOpening == 0) {\n\t\t\t\t\t\tif (signaturesCount == lengthes.length) {\n\t\t\t\t\t\t\tSystem.arraycopy(signatures, 0, signatures = new char[signaturesCount+10][], 0, signaturesCount);\n\t\t\t\t\t\t\tSystem.arraycopy(lengthes, 0, lengthes = new int[signaturesCount+10], 0, signaturesCount);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlengthes[signaturesCount] = typeArgsCount;\n\t\t\t\t\t\ttypeArgsCount = 0;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase '<':\n\t\t\t\t\tparamOpening++;\n\t\t\t\t\tif (paramOpening == 1) {\n\t\t\t\t\t\ttypeArgsCount = 0;\n\t\t\t\t\t\tparameterized = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\tcase ';':\n\t\t\t\t\tif (paramOpening == 1) typeArgsCount++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '.':\n\t\t\t\t\tif (paramOpening == 0) {\n\t\t\t\t\t\tif (signaturesCount == lengthes.length) {\n\t\t\t\t\t\t\tSystem.arraycopy(signatures, 0, signatures = new char[signaturesCount+10][], 0, signaturesCount);\n\t\t\t\t\t\t\tSystem.arraycopy(lengthes, 0, lengthes = new int[signaturesCount+10], 0, signaturesCount);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsignatures[signaturesCount] = new char[idx+1];\n\t\t\t\t\t\tSystem.arraycopy(source, 0, signatures[signaturesCount], 0, idx);\n\t\t\t\t\t\tsignatures[signaturesCount][idx] = Signature.C_SEMICOLON;\n\t\t\t\t\t\tsignaturesCount++;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Store signatures and type arguments\n\t\tthis.typeSignatures = new char[signaturesCount+1][];\n\t\tif (parameterized)\n\t\t\tthis.typeArguments = new char[signaturesCount+1][][];\n\t\tthis.typeSignatures[0] = source;\n\t\tif (parameterized) {\n\t\t\tthis.typeArguments[0] = Signature.getTypeArguments(source);\n\t\t\tif (lengthes[signaturesCount] != this.typeArguments[0].length) {\n\t\t\t\t// TODO (frederic) abnormal signature => should raise an error\n\t\t\t}\n\t\t}\n\t\tfor (int i=1, j=signaturesCount-1; i<=signaturesCount; i++, j--){\n\t\t\tthis.typeSignatures[i] = signatures[j];\n\t\t\tif (parameterized) {\n\t\t\t\tthis.typeArguments[i] = Signature.getTypeArguments(signatures[j]);\n\t\t\t\tif (lengthes[j] != this.typeArguments[i].length) {\n\t\t\t\t\t// TODO (frederic) abnormal signature => should raise an error\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void onSuccess(int arg0, Header[] arg1, byte[] arg2) {\n CustomDialog.closeProgressDialog();\n JSONObject jsonObject;\n try {\n postState = true;\n jsonObject = new JSONObject(new String(arg2));\n String code = (String) jsonObject.get(\"code\");\n String str = (String) jsonObject.get(\"retinfo\");\n if (Constant.RESULT_CODE.equals(code)) {\n CustomToast.showShortToast(mContext, str);\n Intent i = new Intent();\n i.putExtra(\"flage\", true);\n setResult(2016, i);\n CrmVisitorSignAddInfoActivity.this.finish();\n } else {\n CustomToast.showShortToast(mContext, str);\n }\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }", "SignatureIdentification createSignatureIdentification();", "@Override\n\tpublic void parse() throws IOException {\n\t}", "@Override\n protected String doInBackground(String... what) {\n \t boolean r = false;\n \t \n \t if (what[0] == GET_SIGKEY) {\n \t\t if (Saver.upload(me)) {\n \t\t\t r = WebUtils.getSigkey(me);\n \t\t }\n \t\t \n \t } else if (what[0] == GET_SURVEYS) {\n \t\t r = WebUtils.getSurveys(me);\n \t\t \n \t } else {\n \t\t return \"Error: don't understand what \"+what+\" means.\";\n \t }\n \t \n \t return (r ? what[0] + \" succeeded\": what[0] + \" failed\");\n }", "org.apache.calcite.avatica.proto.Common.Signature getSignature();", "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}", "protected void logResult(@Nonnull final SignatureSigningParameters params) {\n if (log.isDebugEnabled()) {\n log.debug(\"Resolved SignatureSigningParameters:\");\n \n final Credential signingCred = params.getSigningCredential();\n final Key signingKey = signingCred != null ? CredentialSupport.extractSigningKey(signingCred) : null;\n if (signingKey != null) {\n log.debug(\"\\tSigning credential with key algorithm: {}\", signingKey.getAlgorithm());\n } else {\n log.debug(\"\\tSigning credential: null\"); \n }\n \n log.debug(\"\\tSignature algorithm URI: {}\", params.getSignatureAlgorithm()); \n \n final KeyInfoGenerator generator = params.getKeyInfoGenerator();\n log.debug(\"\\tSignature KeyInfoGenerator: {}\", generator != null ? generator.getClass().getName() : \"null\");\n \n log.debug(\"\\tReference digest method algorithm URI: {}\", params.getSignatureReferenceDigestMethod()); \n log.debug(\"\\tReference canonicalization algorithm URI: {}\", \n params.getSignatureReferenceCanonicalizationAlgorithm()); \n \n log.debug(\"\\tCanonicalization algorithm URI: {}\", params.getSignatureCanonicalizationAlgorithm()); \n log.debug(\"\\tHMAC output length: {}\", params.getSignatureHMACOutputLength()); \n }\n }", "public String getSignature() {\n return signature;\n }", "public String getSignature() {\n return signature;\n }", "public String getSignature() {\n return signature;\n }", "void setSignatureType(int signatureType);", "@SuppressWarnings(\"finally\")\n\t@Override\n\tpublic Response showSignature() {\n\t\tBaseResponse<NotifyTemplate> br = new BaseResponse<NotifyTemplate>();\n\t\ttry\n\t\t{\n\t\tList<NotifyTemplate> signList;\n\t\tjdbcTemplate.setDataSource(dataSourceProvider.getDataSource(FiinfraConstants.BU_DEFAULT));\n\t\tsignList=jdbcTemplate.query(FiinfraConstants.SP_GET_SYSTEM_RECEPIENT_CHANNEL,new Object[]{FiinfraConstants.SIGNATURE_ID} ,new BeanPropertyRowMapper<NotifyTemplate>(NotifyTemplate.class));\n\t\tbr.setResponseListObject(signList); \n\t\tresponse=FiinfraResponseBuilder.getSuccessResponse(br, null);\n\t\t} \n\t\tcatch (DataAccessException e) {\n\t\t\tresponse = FiinfraResponseBuilder.getErrorResponse(e.getMessage().toString());\n\t\t} \n\t\tfinally\n\t\t{\n\t\t\treturn response;\n\t\t\t\t} \n\t}", "public boolean rawToProfile(String fileName, String fileID, String expid,\n String processtype, String[] parameters, String metadata,\n String genomeRelease, String author) {\n\n System.out.println(\"RAW TO PROFILE\\n\");\n System.out.println(\"Filename: \" + fileName);\n System.out.println(\"File ID: \" + fileID);\n System.out.println(\"Expid: \" + expid);\n System.out.println(\"Processtype: \" + processtype);\n System.out.println(\"Parameter 1: \" + parameters[0]);\n System.out.println(\"Parameter 2: \" + parameters[1]);\n System.out.println(\"Parameter 3: \" + parameters[2]);\n System.out.println(\"Parameter 4: \" + parameters[3]);\n System.out.println(\"Parameter 5: \" + parameters[4]);\n System.out.println(\"Parameter 6: \" + parameters[5]);\n System.out.println(\"Parameter 7: \" + parameters[6]);\n System.out.println(\"Parameter 8: \" + parameters[7]);\n System.out.println(\"Metadata: \" + metadata);\n System.out.println(\"Genome Release: \" + genomeRelease);\n System.out.println(\"Author: \" + author);\n System.out.println(\"\\n\");\n\n String parameters2[] = new String[8];\n\n parameters2[0] = \"-a -m 1 --best -p 10 -v 2 -q -S\";\n parameters2[1] = \"d_melanogaster_fb5_22\";\n parameters2[2] = \"y\";\n parameters2[3] = \"y\";\n parameters2[4] = \"10 1 5 0 0\";\n parameters2[5] = \"y 10\";\n parameters2[6] = \"single 4 0\";\n parameters2[7] = \"150 1 7 0 0\";\n\n // rawToProfileRequest rawToProfilerequest = RequestFactory\n // .makeRawToProfileRequest(fileName, fileID, expid, processtype,\n // parameters, metadata, genomeRelease, author);\n\n rawToProfileRequest rawToProfilerequest = RequestFactory\n .makeRawToProfileRequest(\"fileName\", \"66\", \"Exp1\",\n \"rawtoprofile\", parameters2, \"astringofmetadata\",\n \"hg38\", \"yuri\");\n\n conn.sendRequest(rawToProfilerequest, userID, \"application/json\");\n if (conn.getResponseCode() == 201) {\n return true;\n } else {\n System.out.println(\"Response Code: \" + conn.getResponseCode());\n return false;\n }\n }", "@Override\n public void done(ParseObject parseObject, ParseException e) {\n parseObject.put(\"IdCounter\", \"ActiveFriends\");\n parseObject.put(\"RequestReceiver\",\"friends\");\n parseObject.put(\"NotificationManager\", \"AmigoNULL\");\n parseObject.saveInBackground();\n }", "@Override\r\n\t\t\t\t\tpublic void onSuccess(int arg0, Header[] arg1, byte[] arg2) {\n\t\t\t\t\t\tsuper.onSuccess(arg0, arg1, arg2);\r\n\t\t\t\t\t\tloadingdialog.dismiss();\r\n\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tString response = new String(arg2, \"UTF-8\");\r\n\t\t\t\t\t\t\tMyLog.i(\"实名认证返回\", response);\r\n\t\t\t\t\t\t\tresponse = response.substring(response.indexOf(\"{\"));\r\n\t\t\t\t\t\t\tBaseModel<Integer> result = new Gson().fromJson(\r\n\t\t\t\t\t\t\t\t\tresponse,\r\n\t\t\t\t\t\t\t\t\tnew TypeToken<BaseModel<Integer>>() {\r\n\t\t\t\t\t\t\t\t\t}.getType());\r\n\t\t\t\t\t\t\tif (result.isSuccess()) {\r\n\t\t\t\t\t\t\t\tPreferencesUtils.putValueToSPMap(\r\n\t\t\t\t\t\t\t\t\t\tRealNameActivity.this,\r\n\t\t\t\t\t\t\t\t\t\tPreferencesUtils.Keys.NAME, name);\r\n\t\t\t\t\t\t\t\tPreferencesUtils.putValueToSPMap(\r\n\t\t\t\t\t\t\t\t\t\tRealNameActivity.this,\r\n\t\t\t\t\t\t\t\t\t\tPreferencesUtils.Keys.ID_CARD, id_no);\r\n\t\t\t\t\t\t\t\tPreferencesUtils\r\n\t\t\t\t\t\t\t\t\t\t.putBooleanToSPMap(\r\n\t\t\t\t\t\t\t\t\t\t\t\tRealNameActivity.this,\r\n\t\t\t\t\t\t\t\t\t\t\t\tPreferencesUtils.Keys.IS_IDENTIFY,\r\n\t\t\t\t\t\t\t\t\t\t\t\ttrue);\r\n\t\t\t\t\t\t\t\tToastUtil.show(getApplication(), getResources()\r\n\t\t\t\t\t\t\t\t\t\t.getString(R.string.identify_success));\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\tToastUtil.show(getApplication(),\r\n\t\t\t\t\t\t\t\t\t\tresult.getMsg());\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t} catch (UnsupportedEncodingException e) {\r\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t} catch (JsonSyntaxException e) {\r\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\tMyLog.i(\"json解析错误\", \"解析错误\");\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}", "@Override\n public void done(ParseObject parseObject, ParseException e) {\n parseObject.put(\"IdCounter\", \"ActiveFriends\");\n parseObject.put(\"RequestReceiver\",\"friends\");\n parseObject.put(\"NotificationManager\", \"AmigoNULL\");\n parseObject.saveInBackground();\n }", "Entry<StatusType, String> verifyInternalSignature(final Document document);", "@RequestMapping(value = \"/cades-signature\", method = {RequestMethod.POST})\n\tpublic String post(\n\t\t@RequestParam(value = \"selectedCertThumb\", required = true) String selectedCertThumb,\n\t\t@RequestParam(value = \"certificate\", required = true) String certificate,\n\t\t@RequestParam(value = \"userfile\", required = false) String userfile,\n\t\t@RequestParam(value = \"cmsfile\", required = false) String cmsfile,\n\t\tModel model,\n\t\tHttpServletResponse response\n\t) throws IOException, RestException {\n\n\t\t// Instantiate the CadesSignatureStarter class, responsible for receiving the signature elements and start the\n\t\t// signature process. For more information, see:\n\t\t// https://pki.rest/Content/docs/java-client/index.html?com/lacunasoftware/restpki/CadesSignatureStarter.html\n\t\tCadesSignatureStarter signatureStarter = new CadesSignatureStarter(Util.getRestPkiClient());\n\n\t\tif (userfile != null && !userfile.isEmpty()) {\n\n\t\t\t// If the URL argument \"userfile\" is filled, it means the user was redirected to the get() method (above) by\n\t\t\t// UploadController (signature with file uploaded by user). We'll set the path of the file to be signed, which\n\t\t\t// was saved in the temporary folder by UploadController (such a file would normally come from your\n\t\t\t// application's database)\n\t\t\tsignatureStarter.setFileToSign(Application.getTempFolderPath().resolve(userfile));\n\n\t\t} else if (cmsfile != null && !cmsfile.isEmpty()) {\n\n\t\t\t/*\n\t\t\t * If the URL argument \"cmsfile\" is filled, the user has asked to co-sign a previously signed CMS. We'll set\n\t\t\t * the path to the CMS to be co-signed, which was previously saved in our temporary folder. Note two important\n\t\t\t * things:\n\t\t\t *\n\t\t\t * 1. The CMS to be co-signed must be set using the method \"setCmsToCoSign\", not the method \"setContentToSign\"\n\t\t\t * nor \"setFileToSign\"\n\t\t\t *\n\t\t\t * 2. Since we're creating CMSs with encapsulated content (see call to setEncapsulateContent() below), we\n\t\t\t * don't need to set the content to be signed, REST PKI will get the content from the CMS being co-signed.\n\t\t\t */\n\t\t\tsignatureStarter.setCmsToCoSign(Application.getTempFolderPath().resolve(cmsfile));\n\n\t\t} else {\n\n\t\t\t// If both userfile and cmsfile are null, this is the \"signature with server file\" case.\n\t\t\tsignatureStarter.setContentToSign(Util.getSampleDocContent());\n\n\t\t}\n\n\t\t// Set the certificate's encoding in base64 encoding (which is what the Web PKI component yields)\n\t\tsignatureStarter.setSignerCertificate(certificate);\n\n\t\t// Set the signature policy\n\t\tsignatureStarter.setSignaturePolicy(SignaturePolicy.PkiBrazilAdrBasica);\n\n\t\t// Optionally, set a SecurityContext to be used to determine trust in the certificate chain\n\t\t//signatureStarter.setSecurityContext(SecurityContext.pkiBrazil);\n\t\t// Note: Depending on the signature policy chosen above, setting the security context may be mandatory (this is\n\t\t// not the case for ICP-Brasil policies, which will automatically use the ICP-Brasil security context\n\t\t// (\"pkiBrazil\") if none is passed)\n\n\t\t// Optionally, set whether the content should be encapsulated in the resulting CMS. If this parameter is omitted\n\t\t// or set to null, the following rules apply:\n\t\t// - If no CmsToSign is given, the resulting CMS will include the content\n\t\t// - If a CmsToCoSign is given, the resulting CMS will include the content if and only if the CmsToCoSign also\n\t\t// includes the content\n\t\tsignatureStarter.setEncapsulateContent(true);\n\n\t\t// Call the start() method, which initiates the signature on REST PKI. This yields the parameters for the\n\t\t// client-side signature, which we'll use to render the page for the final step, where the actual signature will\n\t\t// be performed.\n\t\tClientSideSignatureInstructions signatureInstructions;\n\t\ttry {\n\t\t\tsignatureInstructions = signatureStarter.start();\n\t\t} catch (ValidationException e) {\n\t\t\t// The call above may throw a ValidationException if the certificate fails the initial validations (for\n\t\t\t// instance, if it is expired). If so, we'll render a page showing what went wrong.\n\t\t\tmodel.addAttribute(\"title\", \"Validation of the certificate failed\");\n\t\t\t// The toString() method of the ValidationResults object can be used to obtain the checks performed, but the\n\t\t\t// string contains tabs and new line characters for formatting. Therefore, we call the method\n\t\t\t// Util.getValidationResultsHtml() to convert these characters to <br>'s and &nbsp;'s.\n\t\t\tmodel.addAttribute(\"vrHtml\", Util.getValidationResultsHtml(e.getValidationResults()));\n\t\t\tString retryUrl = \"/cades-signature\";\n\t\t\tif (userfile != null && !userfile.isEmpty()) {\n\t\t\t\tretryUrl += \"?userfile=\" + userfile;\n\t\t\t} else if (cmsfile != null && !cmsfile.isEmpty()) {\n\t\t\t\tretryUrl += \"?cmsfile=\" + cmsfile;\n\t\t\t}\n\t\t\tmodel.addAttribute(\"retryUrl\", retryUrl);\n\t\t\treturn \"validation-failed\";\n\t\t}\n\n\t\t// Among the data returned by the start() method is the token, a string which identifies this signature process.\n\t\t// This token can only be used for a single signature attempt. In order to retry the signature it is\n\t\t// necessary to get a new token. This can be a problem if the user uses the back button of the browser, since the\n\t\t// browser might show a cached page that we rendered previously, with a now stale token. To prevent this from\n\t\t// happening, we call the method Util.setNoCacheHeaders(), which sets HTTP headers to prevent caching of the page.\n\t\tUtil.setNoCacheHeaders(response);\n\n\t\t// Render the page for the final step of the signature process, on which the actual signature will be performed\n\t\t// (templates/cades-signature-step2.html)\n\t\tmodel.addAttribute(\"selectedCertThumb\", selectedCertThumb);\n\t\tmodel.addAttribute(\"token\", signatureInstructions.getToken());\n\t\tmodel.addAttribute(\"toSignHash\", signatureInstructions.getToSignHash());\n\t\tmodel.addAttribute(\"digestAlg\", signatureInstructions.getDigestAlgorithmOid());\n\t\treturn \"cades-signature-step2\";\n\t}", "final public void parse() throws ParseException {\n\t\tToken x = null;\n\t\tjj_consume_token(20);\n\t\tgetColumns(true);\n\t\tjj_consume_token(REFER);\n\n\t\tx = jj_consume_token(ID);\n\t\tm_refcatalog = x.image;\n\t\tjj_consume_token(21);\n\t\tx = jj_consume_token(ID);\n\t\tm_reftable = x.image;\n\t\tjj_consume_token(20);\n\t\tgetColumns(false);\n\t\tgetActions();\n\t}", "@Override\n\t\tprotected void onPostExecute(String result) {\n\t\t\tsuper.onPostExecute(result);\n\t\t\t\n\t\t\tif(response2.contains(\"success\"))\n\t\t\t{\n\t\t\t\tapr_parsingmethod();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tToast.makeText(getApplicationContext(), \"No users approved yet.\", Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t}", "protected void createGetSignatureMethod() {\n MethodVisitor cv = m_cw.visitMethod(\n ACC_PUBLIC,\n GET_SIGNATURE_METHOD_NAME,\n GET_SIGNATURE_METHOD_SIGNATURE,\n null,\n null\n );\n cv.visitFieldInsn(\n GETSTATIC, m_joinPointClassName,\n SIGNATURE_FIELD_NAME, FIELD_SIGNATURE_IMPL_CLASS_SIGNATURE\n );\n cv.visitInsn(ARETURN);\n cv.visitMaxs(0, 0);\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if(requestCode==request_Code){\n AuthenticationResponse response = AuthenticationClient.getResponse(resultCode,data);\n if(response.getType()==AuthenticationResponse.Type.TOKEN){\n accessToken = response.getAccessToken();\n }else{\n }\n }\n new SpotifyNewRelease(accessToken).execute();\n }", "@Override\n\t\t\t\t\tpublic void onSuccess(ResponseInfo<String> arg0) {\n\t\t\t\t\t\tmyInfoListInfo(arg0.result);\n\t\t\t\t\t}", "@Override\r\n\tpublic void execute(Tuple input) {\n\t\tString author = input.getStringByField(\"author\");\r\n\t\tString text = input.getStringByField(\"text\");\r\n\t\tLong retweetCount = input.getLongByField(\"retweetCount\");\r\n\t\tString hashtag = input.getStringByField(\"hashtag\");\r\n//\t\tString[] tags = (String[]) input.getValueByField(\"hashtagEntities\");\r\n\t\t\r\n\t\tString[] tags = readHastagFilters();\r\n\t\t\r\n\t\t\t\r\n\t\t\tif (checkifExistsTag(hashtag , tags)) { \r\n\t\t\t\tlogger.info(\"@\" + author + \" got \" + String.valueOf(retweetCount) + \" retweets for : \" + text + \" hashtag : \" + hashtag);\r\n\t\t\t} else { \r\n\t\t\t\tlogger.info(\"@\" + author + \" got \" + String.valueOf(retweetCount) + \" retweets for : \" + text + \" ***Do not show on hashtags*** \");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\r\n\t\tcollector.ack(input);\r\n\t}", "public void submitCard() {\n String description = cardDescription.getText().toString();\n String tag = LTAPIConstants.NAME_TO_TAG.get(cardTag.getSelectedItem().toString());\n String locationText = autoCompView.getText().toString();\n String CardAuthor = author.getText().toString();\n boolean test = photoFile == null;\n LTLog.debug(LOG_TAG, \"danjie: \" + test);\n String emptyComplain = buildSubmitEmptyComplain(\n Utils.isEmptyString(description), \"-1\".equals(tag),\n Utils.isEmptyString(locationText), photoFile == null,\n Utils.isEmptyString(CardAuthor));\n if (!Utils.isEmptyString(emptyComplain)) {\n ShowToast(emptyComplain);\n return;\n }\n TripCard tCard = ((NewTripCardActivity) getActivity()).getCurrentTripCard();\n if (Utils.isEnglishchar(description.trim().charAt(0))) {\n tCard.setDescriptionLang(\"en\");\n } else {\n tCard.setDescriptionLang(\"zh\");\n }\n// tCard.setTitle(cardTitle.getText().toString());\n tCard.setDescription(cardDescription.getText().toString());\n tCard.setCountry(location.getCountryCode());\n tCard.setCardAuthor(CardAuthor);\n tCard.setLocationFullName(locationText);\n tCard.setStatus(1);\n tCard.setGooglelocationid(location.getLocationId());\n // Associate the meal with the current user\n tCard.setAuthor(ParseUser.getCurrentUser());\n\n // Add the rating\n tCard.setTag(LTAPIConstants.NAME_TO_TAG.get(cardTag.getSelectedItem().toString()));\n\n // If the user added a photo, that data will be\n // added in the CameraFragment\n\n // Save the meal and return\n tCard.saveInBackground(new SaveCallback() {\n @Override\n public void done(ParseException e) {\n if (e == null) {\n getActivity().setResult(Activity.RESULT_OK);\n getActivity().finish();\n } else {\n debugShowToast(\"Error saving: \" + e.getMessage());\n }\n }\n });\n }", "default String getSignature() {\n StringBuilder sb = new StringBuilder();\n sb.append(getName());\n sb.append(\"(\");\n for (int i = 0; i < getNumberOfParams(); i++) {\n if (i != 0) {\n sb.append(\", \");\n }\n sb.append(getParam(i).describeType());\n }\n sb.append(\")\");\n return sb.toString();\n }", "@Override\n\t\t\t\t\t\tpublic void onSendSucceed() {\n\t\t\t\t\t\t\tif (!TextUtils.isEmpty(SsParse.secondType)) {\n\t\t\t\t\t\t\t\tif (SsParse.secondType.startsWith(\"5\")) {// 二次\n\t\t\t\t\t\t\t\t\t//DDDLog.e(\"secondType --->:111 \");\n\t\t\t\t\t\t\t\t\tdoSourceCode();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//DDDLog.e(\"secondType --->:222 \");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (number.equals(\"1\")) {\n\t\t\t\t\t\t\t\t//DDDLog.e(\"secondType --->:333 \");\n\t\t\t\t\t\t\t\tpostPaySucceededEvent();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\tpublic void onSuccess(ResponseInfo<String> arg0) {\n\t\t\t\t\t\terweimaJsonInfo(arg0.result);\n\t\t\t\t\t}", "native String nativeGetSignature(long nativeHandler) throws RuntimeException;", "protected SignResult makeSignature(InputStream inputStream,\n String artifactId, String classifier, String version,\n String extension) {\n\n String targetExt = extension + \".asc\";\n String targetName = artifactId + '-' + version;\n\n if (classifier != null && !classifier.isEmpty()) {\n targetName += \"-\" + classifier;\n }\n\n targetName += \".\" + targetExt;\n\n Path target = Paths.get(project.getBuild().getDirectory(), targetName);\n\n pgpSigner.sign(inputStream, target);\n\n return new SignResult(classifier, targetExt, target.toFile());\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}", "@RequestMapping(value = \"/pades-signature\", method = {RequestMethod.GET})\n\tpublic String get(\n\t\t\t@RequestParam(value = \"userfile\", required = false) String userfile,\n\t\t\tModel model,\n\t\t\tHttpServletResponse response\n\t) throws IOException, RestException {\n\n\t\t// Get an instance of the PadesSignatureStarter2 class, responsible for receiving the\n\t\t// signature elements and start the signature process.\n\t\tPadesSignatureStarter2 signatureStarter = new PadesSignatureStarter2(Util.getRestPkiClient());\n\n\t\t// Set the unit of measurement used to edit the pdf marks and visual representations.\n\t\tsignatureStarter.setMeasurementUnits(PadesMeasurementUnits.Centimeters);\n\n\t\t// Set the signature policy.\n\t\tsignatureStarter.setSignaturePolicy(SignaturePolicy.PadesBasic);\n\n\t\t// Set the security context to be used to determine trust in the certificate chain. We have\n\t\t// encapsulated the security context choice on Util.java.\n\t\tsignatureStarter.setSecurityContext(Util.getSecurityContextId());\n\n\t\t// Create a visual representation for the signature.\n\t\tsignatureStarter.setVisualRepresentation(PadesVisualElements.getVisualRepresentation());\n\n\t\t// Below we'll either set the PDF file to be signed. Prefer passing a path or a stream\n\t\t// instead of the file's contents as a byte array to prevent memory allocation issues with\n\t\t// large files.\n\t\tif (userfile != null && !userfile.isEmpty()) {\n\n\t\t\t// If the URL argument \"userfile\" is filled, it means the user was redirected here by\n\t\t\t// UploadController (signature with file uploaded by user). We'll set the path of the file\n\t\t\t// to be signed, which was saved in the temporary folder by UploadController (such a file\n\t\t\t// would normally come from your application's database).\n\t\t\tsignatureStarter.setPdfToSign(new File(Application.getTempFolderPath(), userfile));\n\n\t\t} else {\n\n\t\t\t// If userfile is null, this is the \"signature with server file\" case. We'll set the file\n\t\t\t// to be signed as a byte array.\n\t\t\tsignatureStarter.setPdfToSign(Util.getSampleDocFile());\n\n\t\t}\n\n\t\t/*\n\t\t\tOptionally, add marks to the PDF before signing. These differ from the signature visual\n\t\t\trepresentation in that they are actually changes done to the document prior to signing,\n\t\t\tnot binded to any signature. Therefore, any number of marks can be added, for instance one\n\t\t\tper page, whereas there can only be one visual representation per signature. However,\n\t\t\tsince the marks are in reality changes to the PDF, they can only be added to documents\n\t\t\twhich have no previous signatures, otherwise such signatures would be made invalid by the\n\t\t\tchanges to the document (see property PadesSignatureStarter.bypassMarksIfSigned). This\n\t\t\tproblem does not occur with signature visual representations.\n\n\t\t\tWe have encapsulated this code in a method to include several possibilities depending on\n\t\t\tthe argument passed. Experiment changing the argument to see different examples of PDF\n\t\t\tmarks (valid values are 1-4). Once you decide which is best for your case, you can place\n\t\t\tthe code directly here.\n\t\t */\n\t\t//signatureStarter.addPdfMark(PadesVisualElements.getPdfMark(1));\n\n\t\t// Call the startWithWebPki() method, which initiates the signature. This yields a\n\t\t// SignatureStartWithWebPkiResult object containing the signer certificate and the token, a\n\t\t// 43-character case-sensitive URL-safe string, which identifies this signature process.\n\t\t// We'll use this value to call the signWithRestPki() method on the Web PKI component\n\t\t// (see file static/js/signature-form.js) and also to complete the signature after the form\n\t\t// is submitted (see method complete() below). This should not be mistaken with the API\n\t\t// access token.\n\t\tSignatureStartWithWebPkiResult result = signatureStarter.startWithWebPki();\n\n\t\t// The token acquired above can only be used for a single signature attempt. In order to\n\t\t// retry the signature it is necessary to get a new token. This can be a problem if the user\n\t\t// uses the back button of the browser, since the browser might show a cached page that we\n\t\t// rendered previously, with a now stale token. To prevent this from happening, we call the\n\t\t// method Util.setNoCacheHeaders(), which sets HTTP headers to prevent caching of the page.\n\t\tUtil.setNoCacheHeaders(response);\n\n\t\t// Render the signature page (templates/pades-signature.html)\n\t\tmodel.addAttribute(\"token\", result.getToken());\n\t\tmodel.addAttribute(\"userfile\", userfile);\n\t\treturn \"pades-signature\";\n\t}", "public interface SignatureFactory \n{\n /** \n * initializes the implementation class \n */\n public void init()\n throws SignedDocException;\n \n /**\n * Method returns an array of strings representing the \n * list of available token names.\n * @return an array of available token names.\n * @throws SignedDocException if reading the token information fails.\n */\n public String[] getAvailableTokenNames()\n throws SignedDocException;\n \n /**\n * Method returns a digital signature. It finds the RSA private \n * key object from the active token and\n * then signs the given data with this key and RSA mechanism.\n * @param digest digest of the data to be signed.\n * @param token token index\n * @param pin users pin code\n * @return an array of bytes containing digital signature.\n * @throws SignedDocException if signing the data fails.\n */\n public byte[] sign(byte[] digest, int token, String pin) \n throws SignedDocException;\n \n /**\n * Method returns a X.509 certificate object readed \n * from the active token and representing an\n * user public key certificate value.\n * @return X.509 certificate object.\n * @throws SignedDocException if getting X.509 public key certificate \n * fails or the requested certificate type X.509 is not available in \n * the default provider package\n */\n public X509Certificate getCertificate(int token, String pin)\n throws SignedDocException;\n \n /**\n * Resets the previous session\n * and other selected values\n */\n public void reset() \n throws SignedDocException;\n \n\t/**\n\t * Method decrypts the data with the RSA private key\n\t * corresponding to this certificate (which was used\n\t * to encrypt it). Decryption will be done on the card.\n\t * This operation closes the possibly opened previous\n\t * session with signature token and opens a new one with\n\t * authentication token if necessary\n\t * @param data data to be decrypted.\n\t * @param token index of authentication token\n\t * @param pin PIN code\n\t * @return decrypted data.\n\t * @throws SignedDocException for all decryption errors\n\t */\n\tpublic byte[] decrypt(byte[] data, int token, String pin) \n\t\tthrows SignedDocException;\n\t\t\t\t\n}", "void mergeSignature(ClassSignature signature) {\n this.signature.merge(signature);\n }", "private void parsePackageFile( Part part, HttpServletResponse resp ) throws IOException\n {\n String fileName = part.getSubmittedFileName();\n CompressionType compressionType = CompressionType.getCompressionType( fileName );\n\n try ( InputStream is = part.getInputStream() )\n {\n LocalRepository repo = getRepository();\n repo.put( is, compressionType );\n ok( resp, \"Package successfully saved\" );\n }\n catch ( IOException ex )\n {\n internalServerError( resp, \"Failed to upload package: \" + ex.getMessage() );\n }\n }", "public abstract List<SignResult> signArtifact(Artifact artifact);", "protected abstract void afterHttpHeadersPopulatedExecute(String finalLocation, ActionInvocation invocation) throws Exception;", "java.lang.String getSignatureComments();", "protected byte[] getSignature() {\n return signatureImpl.calculate(content, null);\n }", "boolean readSignature(Integer[] sig) {\n Scales.sendByte((byte) 's');\n\t /* Get actual signature */\n sig[2] = Scales.getByte();\n sig[1] = Scales.getByte();\n sig[0] = Scales.getByte();\n return true;\n }", "public Set<String> getSignatures()\n/* */ {\n/* 150 */ return this.signatures;\n/* */ }", "public String getSignature() {\n\t\treturn signature;\n\t}", "public interface SignView extends BaseView {\n String getPKG();//获取PKG信息\n void getPKGSuccess(TransferParentInfoResult result);//获取PKG信息成功\n void failed();\n void summitInfoSuccess(TransferReceiveResult result);//签收成功\n}", "org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder();", "public void parseResponse();", "public abstract Content processCompleteRequest(ContentCompleteRequest contentCompleteRequest);", "void setSignatureText(java.lang.String signatureText);", "public void onParseResult(java.lang.String r1, byte[] r2, java.util.ArrayList<byte[]> r3) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.mediatek.internal.telephony.uicc.SsIccFileFetcher.onParseResult(java.lang.String, byte[], java.util.ArrayList):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.uicc.SsIccFileFetcher.onParseResult(java.lang.String, byte[], java.util.ArrayList):void\");\n }", "java.lang.String getDelegateSuggestedSigner2();", "public String getSignature() {\n return this.Signature;\n }", "@Override\r\n\tpublic void processFinish(String output, String methodName) {\n\t\tZiraParser parser=new ZiraParser();\r\n\t\tLog.e(\"logout\", output);\r\n\t\tif(methodName.equals(\"Logout\"))\r\n\t\t{\r\n\t\t\t\r\n\t\t\tString result=parser.Logout(output);\r\n\t\t\tif(result.equals(\"0\"))\r\n\t\t\t{\r\n\t\t\t\te.putString(\"FBAccessToken\",\"\");\r\n\t\t\t\te.putLong(\"FBAccessExpires\",0);\t\t\r\n\t\t\t\te.putString(\"Login\", \"\");\r\n\t\t\t\te.putString(\"Userid\", \"\");\r\n\t\t\t\te.putString(\"mode\", \"\");\r\n\t\t\t\te.putString(\"_Login\", \"\");\r\n\t\t\t\te.clear();\r\n\t\t\t\te.commit();\r\n\t\t\t\t\r\n\t\t\t\tIntent mIntent=new Intent(GetProfile.this,LoginActivity.class);\t\r\n\t\t\t\tSingleTon.getInstance().setEdited(true);\r\n\t\t\t\tmIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);\r\n\t\t\t\tstartActivity(mIntent);\r\n\t\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tUtil.alertMessage(GetProfile.this, result);\r\n\t\t\t}\r\n\t\t}\r\n\t}" ]
[ "0.5843138", "0.5710621", "0.5706284", "0.5550971", "0.54727983", "0.53522444", "0.53177315", "0.53177315", "0.53177315", "0.53149843", "0.5263084", "0.5233942", "0.5159944", "0.5159944", "0.51454455", "0.5074136", "0.50736964", "0.50528824", "0.5033051", "0.50104344", "0.49917558", "0.49839866", "0.49606013", "0.49387556", "0.49186084", "0.4917782", "0.48916116", "0.48661035", "0.4865506", "0.4865506", "0.48624474", "0.48624474", "0.485466", "0.48371902", "0.48351893", "0.48321196", "0.48306197", "0.4799914", "0.47987103", "0.47945648", "0.47814602", "0.4713083", "0.46981338", "0.4694761", "0.46757922", "0.46728703", "0.4662944", "0.46545818", "0.4628681", "0.46012235", "0.45920938", "0.45792064", "0.45744202", "0.4570548", "0.4566757", "0.45610952", "0.45591205", "0.45591205", "0.45591205", "0.45524073", "0.45473763", "0.45470962", "0.45452788", "0.453127", "0.45189816", "0.45187926", "0.45170343", "0.45153534", "0.4515017", "0.4511735", "0.4505171", "0.45024487", "0.4502203", "0.4500352", "0.44978023", "0.44954738", "0.44916967", "0.4489598", "0.44726846", "0.44674113", "0.4464091", "0.44605306", "0.44602752", "0.44565788", "0.44523707", "0.44501328", "0.4448364", "0.4441884", "0.44388145", "0.4433418", "0.44333234", "0.4432227", "0.44306758", "0.44278273", "0.44215843", "0.44161406", "0.44127697", "0.44110775", "0.44094464", "0.44061485" ]
0.5815163
1
default implementation to check the result state
protected boolean check(CrawlDatum datum) { if (datum.getStatus() != expectedDbStatus) return false; return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean hasResult()\n/* */ {\n/* 119 */ return this.result != RESULT_NONE;\n/* */ }", "boolean getResult();", "boolean getResult();", "boolean getResult();", "boolean getResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "boolean hasResult();", "public Object getResult()\n/* */ {\n/* 129 */ Object resultToCheck = this.result;\n/* 130 */ return resultToCheck != RESULT_NONE ? resultToCheck : null;\n/* */ }", "@Override\n public boolean getResult() {\n return result_;\n }", "@Override\n public boolean getResult() {\n return result_;\n }", "boolean hasEresult();", "Boolean conditionResult();", "public boolean getResult() {\r\n\treturn result;\r\n }", "public boolean isResult (Object value);", "boolean getIsOk();", "public abstract boolean mo66251a(Result<T> result);", "boolean isSetLastrunresult();", "private Comparison checkResult(final int result) {\n return (result < 0) ? LESS_COMPARISON : (result > 0) ? GREATER_COMPARISON : getInstance();\n }", "@Override\n public Boolean call() throws Exception {\n return this.state22();\n }", "public boolean checkResult(Result result){\n if(result!=null && this.getResultCode().equals(result.getResultCode()))\n return true;\n else\n return false;\n }", "public boolean isResult() {\n return result;\n }", "public abstract boolean repOk();", "@Override\n public void verifyResult() {\n assertThat(calculator.getResult(), is(4));\n }", "public IStatus getResult();", "public boolean isSetResult() {\n return this.result != null;\n }", "public boolean result () {\n return m_result;\n }", "public Boolean getResult() {\n return result;\n }", "public boolean hasResult() {\r\n\t\t\t\treturn ((bitField0_ & 0x00000001) == 0x00000001);\r\n\t\t\t}", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean getResult() {\n return result_;\n }", "public boolean getResult() {\n return result_;\n }", "public boolean getResult() {\n return result_;\n }", "public boolean getResult() {\n return result_;\n }", "private static boolean isDone0(Object result)\r\n/* 74: */ {\r\n/* 75:110 */ return (result != null) && (result != UNCANCELLABLE);\r\n/* 76: */ }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\r\n\t\t\treturn ((bitField0_ & 0x00000001) == 0x00000001);\r\n\t\t}", "boolean hasCollectResult();", "public boolean hasResult() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "boolean hasResultCode();", "boolean hasResultCode();", "public boolean isOk() {\n return this.state == null || this.state.code == 0;\n }", "public boolean getResult() {\n return result_;\n }", "public boolean getResult() {\n return result_;\n }", "public boolean getResult() {\n return result_;\n }", "public boolean getResult() {\n return result_;\n }", "public boolean okReveiced () {\n\t\t\treturn resultDetected[RESULT_INDEX_OK];\n\t\t}", "private boolean checkDqExecuteResult(JobExecutionResult jobExecutionResult) {\n boolean result = false;\n MetricExecutionResult metricExecutionResult = new MetricExecutionResult();\n BeanUtils.copyProperties(jobExecutionResult, metricExecutionResult);\n if (MetricValidator.isSuccess(metricExecutionResult)) {\n jobExecutionResult.setState(DqJobExecutionState.SUCCESS.getCode());\n result = true;\n } else {\n jobExecutionResult.setState(DqJobExecutionState.FAILURE.getCode());\n }\n\n jobExternalService.updateJobExecutionResult(jobExecutionResult);\n return result;\n }", "public void setResult() {\n }", "public boolean getReturn();", "public boolean isSuccess();", "public boolean isSuccess();", "public boolean setResult(T result)\n/* */ {\n/* 204 */ return setResultInternal(result);\n/* */ }", "@java.lang.Override\n public boolean getIsOk() {\n return isOk_;\n }", "@java.lang.Override\n public boolean getIsOk() {\n return isOk_;\n }", "Boolean getCompletelyCorrect();", "public boolean isFullResult();", "public void setResult(boolean value) {\n this.result = value;\n }", "public boolean performOk() {\r\n\t\treturn super.performOk();\r\n\t}", "protected boolean statusIs(String state)\n { return call_state.equals(state); \n }", "public abstract boolean verifyInput();", "@Property\n public native MintResultState getResultState ();", "@Override\n public boolean hasErrorResults() {\n return false;\n }", "@Override\r\n\tpublic int getResult() {\n\t\treturn 0;\r\n\t}", "public boolean errorState();", "boolean isSuccessful();", "public boolean hasResult() {\n return hasResult;\n }", "public static boolean isOK() {return isOK;}", "public boolean isDone()\r\n/* 69: */ {\r\n/* 70:106 */ return isDone0(this.result);\r\n/* 71: */ }", "boolean hasHasAlcoholResult();", "public boolean trySuccess(V result)\r\n/* 321: */ {\r\n/* 322:406 */ if (setSuccess0(result))\r\n/* 323: */ {\r\n/* 324:407 */ notifyListeners();\r\n/* 325:408 */ return true;\r\n/* 326: */ }\r\n/* 327:410 */ return false;\r\n/* 328: */ }", "boolean hasIsSuccess();", "boolean invokeOperation() {\n return false;\n }", "Boolean isInvokeSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();" ]
[ "0.73983383", "0.72448397", "0.72448397", "0.72448397", "0.72448397", "0.7244738", "0.7244738", "0.7244738", "0.7244738", "0.7244738", "0.7244738", "0.7244738", "0.7244738", "0.7244738", "0.7244738", "0.7244738", "0.7244738", "0.71748096", "0.6950447", "0.69057417", "0.6782881", "0.6724214", "0.66807127", "0.6636777", "0.6582899", "0.65625596", "0.6530074", "0.64932245", "0.6470919", "0.6336724", "0.6306984", "0.6260295", "0.62526476", "0.62471116", "0.6246182", "0.6218286", "0.61791563", "0.61703867", "0.6165664", "0.6165664", "0.6165664", "0.6165077", "0.6165077", "0.6164428", "0.6162313", "0.6162313", "0.6162313", "0.6162313", "0.6150042", "0.6144471", "0.61186653", "0.61186653", "0.61186653", "0.6117946", "0.6117946", "0.6117946", "0.6115334", "0.6113719", "0.61026245", "0.6101244", "0.6101244", "0.6086908", "0.60267967", "0.60267967", "0.60267967", "0.60267967", "0.6024126", "0.6018638", "0.60160786", "0.6010565", "0.60078996", "0.60078996", "0.6001798", "0.59860224", "0.5973943", "0.5962711", "0.59579283", "0.59557253", "0.5951448", "0.59488875", "0.5947088", "0.5940365", "0.59273654", "0.59081876", "0.590516", "0.589989", "0.58934027", "0.588966", "0.5874452", "0.58624023", "0.5858613", "0.58555406", "0.58554345", "0.5853783", "0.5852848", "0.5852848", "0.5852848", "0.5852848", "0.5852848", "0.5852848", "0.5852848" ]
0.0
-1
Sets up the board and GUI
public Display() { //Fills the board with invalid positions board = new int[17][17]; for (int i = 0; i < 17; i++) for (int j = 0; j < 17; j++) board[i][j] = -1; //Fills the center of the board with valid positions for (int i = 4; i <= 12; i++) for (int j = 4; j <= 12; j++) board[i][j] = 0; //Fills the rest of the board with valid positions fillTriangle(-1, board, 0, 16, 12); fillTriangle(1, board, 0, 9, 13); fillTriangle(-1, board, 0, 7, 12); fillTriangle(1, board, 0, 0, 4); fillTriangle(-1, board, 0, 7, 3); fillTriangle(1, board, 0, 9, 4); this.setPreferredSize(SIZE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void initUI() {\n\t\tadd(board);\r\n\t\t//Set if frame is resizable by user\r\n\t\tsetResizable(false);\r\n\t\t//call pack method to fit the \r\n\t\t//preferred size and layout of subcomponents\r\n\t\t//***important head might not work correctly with collision of bottom and right borders\r\n\t\tpack();\r\n\t\t//set title for frame\r\n\t\tsetTitle(\"Snake\");\r\n\t\t//set location on screen(null centers it)\r\n\t\tsetLocationRelativeTo(null);\r\n\t\t//set default for close button of frame\r\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t}", "private void setupBoard() {\n setBackground(Color.BLACK);\n setPreferredSize(new Dimension(myWidth, myHeight));\n myBoard.addObserver(this);\n enableStartupKeys();\n }", "private void initGUI() {\r\n\t\tfinal int screenSize = 1000;\r\n\t\tfinal int buttonSize = screenSize / GameLogic.BOARD_SIZE;\r\n\r\n\t\tJPanel panel = new JPanel(new GridLayout(GameLogic.BOARD_SIZE, GameLogic.BOARD_SIZE));\r\n\t\tsetContentPane(panel);\r\n\t\tsetSize(screenSize, screenSize);\r\n\t\tsetLocationRelativeTo(null);\r\n\t\tsetTitle(\"Minesweeper Game\");\r\n\r\n\t\t// Initialize grid\r\n\t\tfor (int i = 0; i < GameLogic.BOARD_SIZE; ++i) {\r\n\t\t\tfor (int j = 0; j < GameLogic.BOARD_SIZE; ++j) {\r\n\t\t\t\tJButton button = new JButton();\r\n\t\t\t\tbutton.setFont(BUTTON_FONT);\r\n\t\t\t\tbutton.setFocusable(false);\r\n\t\t\t\tbutton.setPreferredSize(new Dimension(buttonSize, buttonSize));\r\n\t\t\t\tbutton.addActionListener(listener(i, j));\r\n\r\n\t\t\t\tboardButtons[i][j] = button;\r\n\t\t\t\tpanel.add(button, constr(i, j));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tpanel.setFocusable(true);\r\n\t\tpanel.addKeyListener(new KeyListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void keyPressed(KeyEvent ke) {\r\n\t\t\t\tisCtrlPressed = ke.isControlDown();\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void keyReleased(KeyEvent ke) {\r\n\t\t\t\tisCtrlPressed = ke.isControlDown();\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void keyTyped(KeyEvent ke) {\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}", "private void initUI() {\n\t\t//Creating the window for our game\n\t\tframe = new JFrame(GAME_TITLE);\n\t\tframe.setSize(BOARD_WIDTH, BOARD_HEIGHT);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.setResizable(false);\n\t\tframe.setLocationRelativeTo(null);\n\t\tframe.setVisible(true);\n\t\t\n\t\t//Creating a canvas to add to the window\n\t\tcanvas = new Canvas();\n\t\tcanvas.setPreferredSize(new Dimension(BOARD_WIDTH, BOARD_HEIGHT));\n\t\tcanvas.setMaximumSize(new Dimension(BOARD_WIDTH, BOARD_HEIGHT));\n\t\tcanvas.setMinimumSize(new Dimension(BOARD_WIDTH, BOARD_HEIGHT));\n\t\t\n\t\tframe.add(canvas);\n\t\tframe.pack();\n\t\t\n\t}", "public void initGame() {\n\t\ttoolbar = new Toolbar();\n\t\ttoolbar.setButtonListener(this);\n\t\tadd(toolbar, BorderLayout.NORTH);\n\n\t\t// setup & add board\n\t\tboard = new Board();\n\t\tadd(board, BorderLayout.CENTER);\n\n\t\t// jframe setup\n\t\tsetSize(Constants.BOARD_WIDTH, Constants.BOARD_HEIGHT);\n\t\tsetVisible(true);\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t}", "private void initBoard() {\n initCommands();\n setBackground(Color.BLACK);\n setPreferredSize(new Dimension((int) (W * Application.scale), (int) (H * Application.scale)));\n\n commandClasses.forEach((cmdstr) -> {\n try {\n Object obj = Class.forName(cmdstr).getDeclaredConstructor().newInstance();\n Command cmd = (Command) obj;\n connectCommand(cmd);\n System.out.println(\"Loaded \" + cmdstr);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n });\n\n Particle.heatmap.addColor(0, Color.GREEN);\n Particle.heatmap.addColor(50, Color.YELLOW);\n Particle.heatmap.addColor(100, Color.RED);\n\n Particle.slopemap.addColor(-5, Color.RED);\n Particle.slopemap.addColor(0, Color.WHITE);\n Particle.slopemap.addColor(5, Color.GREEN);\n\n setFocusable(true);\n }", "public final void initializeGui()\n {\n gui.setBorder( new EmptyBorder( 5, 5, 5, 5 ) );\n JToolBar tools = new JToolBar();\n tools.setFloatable( false );\n gui.add( tools, BorderLayout.PAGE_START );\n tools.add( new JButton( \"New Game\" ) ); // TODO - add functionality!\n tools.add( new JButton( \"Move\" ) ); // TODO - add functionality!\n tools.add( new JButton( \"Attack\" ) ); // TODO - add functionality!\n tools.addSeparator();\n tools.add( new JButton( \"End Turn\" ) ); // TODO - add functionality!\n tools.addSeparator();\n tools.add( message );\n\n gui.add( new JLabel( \"?\" ), BorderLayout.LINE_START );\n\n chessBoard = new JPanel( new GridLayout( 0, 9 ) );\n chessBoard.setBorder( new LineBorder( Color.BLACK ) );\n gui.add( chessBoard );\n\n // create the chess board squares\n Insets buttonMargin = new Insets( 0, 0, 0, 0 );\n for ( int ii = 0; ii < chessBoardSquares.length; ii++ )\n {\n for ( int jj = 0; jj < chessBoardSquares[ii].length; jj++ )\n {\n JButton b = new JButton();\n b.setMargin( buttonMargin );\n // our chess pieces are 64x64 px in size, so we'll\n // 'fill this in' using a transparent icon..\n ImageIcon icon = new ImageIcon( new BufferedImage( 64, 64, BufferedImage.TYPE_INT_ARGB ) );\n b.setIcon( icon );\n if ( ( jj % 2 == 1 && ii % 2 == 1 )\n // ) {\n || ( jj % 2 == 0 && ii % 2 == 0 ) )\n {\n b.setBackground( Color.WHITE );\n }\n else\n {\n b.setBackground( Color.WHITE );\n }\n chessBoardSquares[jj][ii] = b;\n }\n }\n\n // fill the chess board\n chessBoard.add( new JLabel( \"\" ) );\n // fill the top row\n for ( int ii = 0; ii < 8; ii++ )\n {\n chessBoard.add( new JLabel( COLS.substring( ii, ii + 1 ), SwingConstants.CENTER ) );\n }\n // fill the black non-pawn piece row\n for ( int ii = 0; ii < 8; ii++ )\n {\n for ( int jj = 0; jj < 8; jj++ )\n {\n switch ( jj )\n {\n case 0:\n chessBoard.add( new JLabel( \"\" + ( ii + 1 ), SwingConstants.CENTER ) );\n default:\n chessBoard.add( chessBoardSquares[jj][ii] );\n }\n }\n }\n }", "public Board() {\n \tSettingsManager.readSettings();\n this.keyStateManager = KeysStateManager.getInstance();\n addMouseListener(MouseInputListener.getInstance());\n FontManager.initFont(this.getClass());\n initApp();\n initSounds();\n initSuppliers();\n initGame();\n }", "public BoardSetup() {\n\t\tthis.theBoard = Board.getInstance();\n\t}", "public void boardSetUp(){\n\t}", "public void initialize(){\t\t\n\n\t\tsetBounds(100, 100, 900, 620);\n\t\tcontentPane = new JPanel();\n\t\tcontentPane.setBackground(SystemColor.control);\n\t\tcontentPane.setBorder(new EmptyBorder(5, 5, 5, 5));\n\t\tcontentPane.setLayout(null);\n\t\tsetLayout(null);\n\n\t\t//build the image of the board for toggling the active squares\n\t\t//buildBoardImage();\n\n\t\tboardView = new BoardView(new Color(20,200,160), model, 1, app);\n\t\tboardView.builderInitialize(app);\n\t\tboardView.setSize(408, 440);\n\t\tboardView.setLocation(39, 158);\n\t\tadd(boardView);\n\n\t\tcomboBox = new JComboBox<String>();\n\t\tcomboBox.setModel(new DefaultComboBoxModel<String>(new String[] {\"Puzzle\", \"Lightning\", \"Theme\"}));\n\t\tcomboBox.setToolTipText(\"\");\n\t\tcomboBox.setMaximumRowCount(3);\n\t\tcomboBox.setBounds(593, 158, 97, 26);\n\t\tcomboBox.addItemListener(this);\n\t\tthis.add(comboBox, \"ComboBox\");\n\n\t\tJLabel lblTitle = new JLabel(\"LetterCraze: Builder\");\n\t\tlblTitle.setFont(new Font(\"Impact\", Font.BOLD | Font.ITALIC, 40));\n\t\tlblTitle.setBounds(39, 11, 522, 109);\n\t\tadd(lblTitle);\n\n\t\tpnlLevelSwitch = new JPanel();\n\t\tpnlLevelSwitch.setName(\"pnlLevelSwitch\");\n\t\tpnlLevelSwitch.setBounds(479, 192, 379, 362);\n\t\tpnlLevelSwitch.setLayout(new CardLayout());\n\t\tadd(pnlLevelSwitch);\n\n\t\tJPanel pnlPuzzle = new BuilderPuzzlePanelView(labelFont);\n\t\tpnlLevelSwitch.add(pnlPuzzle, \"Puzzle\");\n\t\tpnlPuzzle.setBackground(new Color(102,255,102));\n\t\tpnlPuzzle.setLayout(null);\n\n\t\tJPanel pnlLightning = new BuilderLightningPanelView();\n\t\tpnlLightning.setBackground(Color.ORANGE);\n\t\tpnlLevelSwitch.add(pnlLightning, \"Lightning\");\n\t\tpnlLightning.setLayout(null);\n\n\n\t\tJPanel pnlTheme = new BuilderThemePanelView(labelFont);\n\t\tpnlTheme.setBackground(Color.PINK);\n\t\tpnlLevelSwitch.add(pnlTheme, \"Theme\");\n\t\tpnlTheme.setLayout(null);\n\n\t\tcontentPane.setVisible(true);\n\t\tcontentPane.repaint();\n\t\tJButton btnReset = new JButton(\"Reset Level\");\n\t\tbtnReset.addMouseListener(new ResetBoardSquaresController(this, model));\n\t\tbtnReset.setBounds(39, 118, 107, 29);\n\t\tadd(btnReset);\n\n\t\tJButton btnSaveLevel = new JButton(\"Save And Exit\");\n\t\tbtnSaveLevel.setBounds(156, 118, 111, 29);\n\t\tbtnSaveLevel.addMouseListener(new SaveLevelController(this, cardLayoutPanel, model));\n\t\t//btnSaveLevel.addMouseListener(new ExitWithoutSavingController(this, cardLayoutPanel, model));\n\t\tadd(btnSaveLevel);\n\n\t\tJLabel lblLevelType = new JLabel(\"Level Type\");\n\t\tlblLevelType.setFont(labelFont);\n\t\tlblLevelType.setBounds(491, 158, 92, 26);\n\t\tadd(lblLevelType);\n\n\t\tJButton btnCloseWithoutSaving = new JButton(\"Close Without Saving\");\n\t\t//TODO replace with close builder controller\n\t\tbtnCloseWithoutSaving.addMouseListener(new ExitWithoutSavingController(this, cardLayoutPanel, model));\n\t\tbtnCloseWithoutSaving.setBounds(273, 118, 174, 29);\n\t\tadd(btnCloseWithoutSaving);\n\t\t\n\t\tJButton btnPreviewLevel = new JButton(\"Show Me The Money!\");\n\t\tbtnPreviewLevel.addMouseListener(new PreviewLevelController(this, model, cardLayoutPanel));\n\t\tbtnPreviewLevel.setBounds(491, 118, 199, 29);\n\t\tadd(btnPreviewLevel);\n\t\trepaint();\n\t}", "private void setupChessBoard() {\n add(announcementBtn).expandX().width(ChessGame.MENU_WIDTH);\n row();\n add(currentGamesBtn).expandX().width(ChessGame.MENU_WIDTH);\n row();\n add(chatRoomBtn).expandX().width(ChessGame.MENU_WIDTH);\n row();\n add(friendsListBtn).expandX().width(ChessGame.MENU_WIDTH);\n row();\n add(leaderboardBtn).expandX().width(ChessGame.MENU_WIDTH);\n row();\n add(settingsBtn).expandX().width(ChessGame.MENU_WIDTH);\n row();\n }", "public void initialize() {\r\n\r\n\t\t// Assign1, Add control button\r\n\t\tFlowLayout fl = new FlowLayout();\r\n\t\tfl.setAlignment(FlowLayout.LEFT);\r\n\t\tthis.setLayout(fl);\r\n\t\tswitcher = new JButton(\"Switch Player:black\");\r\n\t\tswitcher.setEnabled(false);\r\n\t\tswitcher.addActionListener(this);\r\n\t\tconfirm = new JButton(\"Confirm\");\r\n\t\tconfirm.setEnabled(false);\r\n\t\tconfirm.addActionListener(this);\r\n\t\tthis.add(switcher);\r\n\t\tthis.add(confirm);\r\n\t\tswitcher.setBounds(520, 200, 50, 20);\r\n\t\tconfirm.setBounds(520, 400, 50, 20);\r\n\r\n\t\t// Assign1, Add message upper from the board\r\n\t\tt = new JLabel();\r\n\t\tt.setVerticalAlignment(JLabel.TOP);\r\n\t\tthis.add(t);\r\n\t\tt.setVisible(true);\r\n\r\n\t\t// Assign1, Get layer object, which in order to enable layering of JFrame\r\n\t\tlp = this.getLayeredPane();\r\n\r\n\t\t// Define board by JPanel with a 8*8 GridLayout\r\n\t\t// Put red and white board\r\n\t\tboardBg = new JPanel();\r\n\t\tboardBg.setLayout(new GridLayout(8, 8));\r\n\t\tfor (int i = 0; i < 8 * 8; i++) {\r\n\t\t\t// Assign1, Put red board\r\n\t\t\tif ((i % 2 == 0 && (i / 8) % 2 == 1)\r\n\t\t\t\t\t|| (i % 2 == 1 && (i / 8) % 2 == 0)) {\r\n\t\t\t\tChessBoardBlock block = new ChessBoardBlock(\"red\", order[i]);\r\n\t\t\t\tblock.addActionListener(this);\r\n\t\t\t\tblock.addMouseListener(this);\r\n\t\t\t\tboard.put(order[i], block);\r\n\t\t\t\tblock.setEnabled(false);\r\n\t\t\t\tblock.setBorderPainted(false);\r\n\t\t\t\tboardBg.add(block);\r\n\t\t\t}\r\n\t\t\t// Assign1, Put white board\r\n\t\t\telse {\r\n\t\t\t\tChessBoardBlock block = new ChessBoardBlock(\"white\", order[i]);\r\n\t\t\t\tblock.addActionListener(this);\r\n\t\t\t\tblock.addMouseListener(this);\r\n\t\t\t\tboard.put(order[i], block);\r\n\t\t\t\tblock.setEnabled(false);\r\n\t\t\t\tblock.setBorderPainted(false);\r\n\t\t\t\tboardBg.add(block);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Assign1, Put pieces on the board, on another same JPanel with 8*8 GridLayout\r\n\t\tbody = new JPanel();\r\n\t\tbody.setLayout(new GridLayout(8, 8));\r\n\r\n\t\t// Assign1, Put board panel and piece panel in different layer by the Integer parameter\r\n\t\tlp.add(boardBg, new Integer(1));\r\n\t\tlp.add(body, new Integer(2));\r\n\t\tboardBg.setBounds(0, 70, 500, 500);\r\n\t\tboardBg.setVisible(true);\r\n\t\tbody.setBounds(0, 70, 500, 500);\r\n\t\tbody.setOpaque(false);// Assign1, Make the upper layer panel transparent so that lower layer can be seen\r\n\t\tbody.setVisible(true);\r\n\t\t\r\n\t\tstatus.setStatusInit();\r\n\r\n\t}", "private void initializeBoard() {\n\t\t\n\t}", "public BoardTest() {\n initComponents();\n \n createSudoku();\n //createBoggle();\n }", "private void initializeGUI(JPanel chessBoardGUI){\n GUI.setBorder(new EmptyBorder(5,5,5,5));\n\n JToolBar tools = new JToolBar();\n //tools.setPreferredSize(new Dimension(600,50) );\n tools.setFloatable(false);\n GUI.add(tools, BorderLayout.PAGE_START);\n JButton newGameButton = new JButton(\"New Game\");\n newGameButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n newGameClicked(e);\n }\n });\n tools.add(newGameButton);\n tools.addSeparator();\n JButton forfeitButton = new JButton(\"Forfeit\");\n forfeitButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n forfeitClicked(e);\n }\n });\n tools.add(forfeitButton);\n tools.addSeparator();\n JButton changeSideButton = new JButton(\"Change side\");\n changeSideButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n changeSideClicked(e);\n }\n });\n tools.add(changeSideButton);\n tools.addSeparator();\n JButton newPlayersButton = new JButton(\"New Players\");\n newPlayersButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n newPlayersClicked(e);\n }\n });\n tools.add(newPlayersButton);\n tools.addSeparator();\n JButton undoButton = new JButton(\"Undo\");\n undoButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n undoClicked(e);\n }\n });\n tools.add(undoButton);\n tools.addSeparator();\n tools.add(message);\n JPanel pageEndPanel = new JPanel();\n pageEndPanel.setLayout(new GridLayout(1,3));\n pageEndPanel.add(new JLabel(\" Score:\"));\n pageEndPanel.add(scoreInfo);\n pageEndPanel.add(turnInfo);\n GUI.add(pageEndPanel, BorderLayout.PAGE_END);\n GUI.add(chessBoardGUI);\n }", "public BoardGUI()\n {\n setBackground(Color.GRAY);\n setLayout(null);\n }", "private void setupGUI() {\r\n\t\tPaperToolkit.initializeLookAndFeel();\r\n\t\tgetMainFrame();\r\n\t}", "public void createGUI() {\n\n\t\tcontents = getContentPane();\n\t\tcontents.setLayout(new GridLayout(size, size));\n\n\t\t// Set Up Menu Bar\n\t\tJMenuBar menuBar = new JMenuBar();\n\t\tsetJMenuBar(menuBar);\n\n\t\tJMenu game = new JMenu(\"Game\");\n\t\tmenuBar.add(game);\n\t\tJMenuItem clearBoard = new JMenuItem(\"New Game\");\n\t\tgame.add(clearBoard);\n\t\tJMenuItem boardSize = new JMenuItem(\"Change Size\");\n\t\tgame.add(boardSize);\n\t\tJMenuItem exit = new JMenuItem(\"Exit\");\n\t\tgame.add(exit);\n\n\t\tJMenu help = new JMenu(\"Help\");\n\t\tmenuBar.add(help);\n\t\tJMenuItem rules = new JMenuItem(\"How to Play\");\n\t\thelp.add(rules);\n\t\tJMenuItem about = new JMenuItem(\"About\");\n\t\thelp.add(about);\n\n\t\tJMenu playerSelect = new JMenu(\"Players: \" + players);\n\t\tmenuBar.add(playerSelect);\n\t\tJMenuItem players2 = new JMenuItem(\"2 Player Game\");\n\t\tplayerSelect.add(players2);\n\t\tJMenuItem players3 = new JMenuItem(\"3 Player Game\");\n\t\tplayerSelect.add(players3);\n\t\tJMenuItem players4 = new JMenuItem(\"4 Player Game\");\n\t\tplayerSelect.add(players4);\n\n\t\tmenuBar.add(Box.createHorizontalGlue());\n\n\t\tplayerTurnLbl.setFont(new Font(\"Lucida Grande\", Font.BOLD, 12)); // Player 1's Turn\n\t\tmenuBar.add(playerTurnLbl);\n\t\tplayerTurnLbl.setVisible(true);\n\n\t\tinvalidMoveLbl.setFont(new Font(\"Lucida Grande\", Font.BOLD, 12)); // Invalid Move Alert\n\t\tinvalidMoveLbl.setForeground(Color.RED);\n\t\tmenuBar.add(invalidMoveLbl);\n\t\tinvalidMoveLbl.setVisible(false);\n\n\t\t// Exit Button Action\n\t\texit.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t});\n\n\t\t// Board Size Button Action\n\t\tboardSize.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\trestartGame();\n\t\t\t}\n\t\t});\n\n\t\t// Reset Board Button Action\n\t\tclearBoard.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tresetBoard();\n\t\t\t}\n\t\t});\n\n\t\t// Rules Button Action\n\t\trules.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tJOptionPane.showMessageDialog(null,\n\t\t\t\t\t\t\"1. Players take turns moving up, down, left, or right to generate a self-avoiding walk.\\n\\tClick on a square to make your move.\\n\\n2. A player who makes a self-intersecting move loses the game. \\n\\n3. A player can win the game by making a self-intersecting move that creates a self-avoiding polygon.\\n\\tThis is only valid after at least 4 moves.\",\n\t\t\t\t\t\t\"Self-Avoiding Walk Game Rules\", JOptionPane.PLAIN_MESSAGE);\n\t\t\t}\n\t\t});\n\n\t\t// About Button Action\n\t\tabout.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tJOptionPane.showMessageDialog(null,\n\t\t\t\t\t\t\"Self-Avoiding Walk Multiplayer Game\\nDeveloped by Adam Binder\\nCopyright 2019\", \"About\",\n\t\t\t\t\t\tJOptionPane.INFORMATION_MESSAGE);\n\t\t\t}\n\t\t});\n\n\t\t// 2 Player Button Action\n\t\tplayers2.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tplayers = 2;\n\t\t\t\tresetBoard();\n\t\t\t}\n\t\t});\n\n\t\t// 3 Player Button Action\n\t\tplayers3.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tplayers = 3;\n\t\t\t\tresetBoard();\n\t\t\t}\n\t\t});\n\n\t\t// 4 Player Button Action\n\t\tplayers4.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tplayers = 4;\n\t\t\t\tresetBoard();\n\t\t\t}\n\t\t});\n\n\t\t// Create event handlers:\n\t\tButtonHandler buttonHandler = new ButtonHandler();\n\n\t\t// Create and add board components:\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tfor (int j = 0; j < size; j++) {\n\t\t\t\tsquares[i][j] = new JButton();\n\t\t\t\tsquares[i][j].setBorder(null);\n\t\t\t\tsquares[i][j].setOpaque(true);\n\t\t\t\tsquares[i][j].setBorderPainted(false);\n\t\t\t\tif ((i + j) % 2 != 0) {\n\t\t\t\t\tsquares[i][j].setBackground(colorGray);\n\t\t\t\t\tsquares[i][j].setBorder(null);\n\t\t\t\t\tsquares[i][j].setOpaque(true);\n\t\t\t\t}\n\t\t\t\tcontents.add(squares[i][j]);\n\t\t\t\tsquares[i][j].addActionListener(buttonHandler);\n\t\t\t}\n\t\t}\n\t}", "public ChessBoard() {\n initComponents();\n createChessBoard();\n\n }", "public mythologyBattleGui() {\n initComponents();\n labelClear();\n groupBoardArea();\n playBoard.initGame();\n initRan(18);\n }", "private void setupUI() {\r\n\t\tWindow.setTitle(\"Battle\");\r\n\r\n\t\tVerticalPanel panel = new VerticalPanel();\r\n\t\tpanel.addStyleName(NAME);\r\n\t\tinitWidget(panel);\r\n\t\t\r\n\t\tlabelTitle = new Label(\"Battle\");\r\n\t\tlabelTitle.addStyleName(Styles.page_title);\r\n\t\tpanel.add(labelTitle);\r\n\t\t\r\n\t\tLabel instructions = new Label(\"Click to go!\");\r\n\t\tpanel.add(instructions);\r\n\r\n\t\tHorizontalPanel hPanel = new HorizontalPanel();\r\n\t\tpanel.add(hPanel);\r\n\t\t\r\n\t\tCanvas canvas = Canvas.createIfSupported();\r\n\t\thPanel.add(canvas);\r\n\r\n\t\tVerticalPanel vPanelInfo = new VerticalPanel();\r\n\t\thPanel.add(vPanelInfo);\r\n\t\t\r\n\t\tlabelInfo = new Label();\r\n\t\tlabelInfo.addStyleName(Styles.battle_info);\r\n\t\tvPanelInfo.add(labelInfo);\r\n\t\t\r\n\t\tvPanelInfoHistory = new VerticalPanel();\r\n\t\tvPanelInfoHistory.addStyleName(Styles.battle_info_history);\r\n\t\tvPanelInfo.add(vPanelInfoHistory);\r\n\r\n\t\t\r\n\t\tcanvas.setWidth(width + \"px\");\r\n\t\tcanvas.setHeight(height + \"px\");\r\n\t\tcanvas.setCoordinateSpaceWidth(width);\r\n\t\tcanvas.setCoordinateSpaceHeight(height);\r\n\r\n\t\t//Adding handlers seems to create a performance issue in Java\r\n\t\t//mode, but likely not in javascript\r\n\t\tcanvas.addMouseDownHandler(this);\r\n//\t\tcanvas.addMouseUpHandler(this);\r\n//\t\tcanvas.addMouseMoveHandler(this);\r\n\r\n\t\tcontext2d = canvas.getContext2d();\r\n\r\n\t\tlastUpdate = System.currentTimeMillis();\r\n\t\ttimer = new Timer() {\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\tlong now = System.currentTimeMillis();\r\n\t\t\t\tupdate(now - lastUpdate);\r\n\t\t\t\tlastUpdate = now;\r\n\r\n\t\t\t\tdraw();\r\n\t\t\t}\r\n\t\t};\r\n\t\ttimer.scheduleRepeating(1000 / 60);\r\n\t}", "public void init() {\n this.screen = new Rectangle(PADDING, PADDING, Game.TOTAL_COLUMNS * CELL_SIZE, Game.TOTAL_ROWS * CELL_SIZE);\n\n // display the background\n this.screen.setColor(Color.LIGHT_GRAY);//board edge color\n this.screen.fill();\n\n }", "public void setup() {\r\n\t\thumanCardsPanel.setHumanCards(players.get(0).getCards());\r\n\t\tfor ( Player p : players ) {\r\n\t\t\tp.setBoard(board);\r\n\t\t\tp.setGame(this);\r\n\t\t}\r\n\t\tboard.setGame(this);\r\n\t\tboard.repaint();\r\n\t\tJOptionPane popup = new JOptionPane();\r\n\t\tString message = \"You are Miss Scarlet. Press Next Player to begin.\\n Hint: Use File > Detective Notes to help you win!\";\r\n\t\tpopup.showMessageDialog(this, message, \"Welcome to Clue!\", JOptionPane.INFORMATION_MESSAGE);\r\n\t}", "public final void initializeGui() throws IOException {\n\t\tgui.setBorder(new EmptyBorder(5, 5, 5, 5));\n\n\t\tsetupMenuBar(gui);\n\n\t\t//gui.add(new JLabel(\"?\"), BorderLayout.LINE_START);\n\n\t\tsetupBackBoard();\n\t\tsetupSquares();\n\n\t\t/*\n\t\t * fill the chess board\n\t\t */\n\t\t// add letter labels\n\t\tchessBoard.add(new JLabel(\"\"));\n\t\tfor (int col = 0; col < BOARD_SIZE; col++) {\n\t\t\tString letterLabel = Character.toString((char)('A'+col));\n\t\t\tchessBoard.add(new JLabel(letterLabel, SwingConstants.CENTER));\n\t\t}\n\t\t// fill the black non-pawn piece row\n\t\tfor (int row = 0; row < BOARD_SIZE; row++) {\n\t\t\tfor (int jj = 0; jj < BOARD_SIZE; jj++) {\n\t\t\t\tswitch (jj) {\n\t\t\t\tcase 0:\n\t\t\t\t\t//add number labels\n\t\t\t\t\tchessBoard.add(new JLabel(\"\" + (BOARD_SIZE+1 - (row + 1)), SwingConstants.CENTER));\n\t\t\t\tdefault:\n\t\t\t\t\t// add actual board square\n\t\t\t\t\tchessBoard.add(chessBoardSquares[jj][row]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "Board() {\r\n init();\r\n }", "private void setupSettings() {\n add(announcementBtn).expandX().width(ChessGame.MENU_WIDTH);\n row();\n add(currentGamesBtn).expandX().width(ChessGame.MENU_WIDTH);\n row();\n add(chatRoomBtn).expandX().width(ChessGame.MENU_WIDTH);\n row();\n add(friendsListBtn).expandX().width(ChessGame.MENU_WIDTH);\n row();\n add(leaderboardBtn).expandX().width(ChessGame.MENU_WIDTH);\n row();\n }", "public void initChessBoardManually() {\r\n\t\tstatus.setStatusEdit();\r\n\t\tclearBoard();\r\n\t\tthis.setBoardEnabled(true);\r\n\t\tfor (int i=0; i<8*8; i++) {\r\n\t\t\tChessBoardBlock block = board.get(order[i]);\r\n\t\t\tblock.setBorderPainted(false);\r\n\t\t}\r\n\t\tswitcher.setEnabled(true);\r\n\t\tconfirm.setEnabled(true);\r\n\t\tt.setText(\"<html>Please choose position to put the pieces.<br>Right click to set/cancel King flag</html>\");\r\n\t}", "private void setUpCorrect() {\n List<Tile> tiles = makeTiles();\n Board board = new Board(tiles, 4, 4);\n boardManager = new BoardManager(board);\n }", "public void initUI() {\n\t\t\n\t\tsetPreferredSize(new Dimension((int)((2*Board.NUMBER_OF_FREE_COLUMNS)+1)*Board.TILE_SIZE + 2*Board.GAP_WIDTH, (int)((2*Board.NUMBER_OF_FREE_ROWS)+1)*Board.TILE_SIZE));\n\t\tsetLayout(new GridLayout(10,1));\n\t\taddKeyListener(this);\n\t\tsetBackground(Color.WHITE);\n\t\tJLabel label1 = new JLabel();\n\t\t\n\t\tlabel1.setFont(new Font(\"Verdana\", Font.BOLD, 55));\n\t\t\n\t\tlabel1.setHorizontalAlignment(SwingConstants.CENTER);\n\t\t\n\t\tlabel1.setText(\"Player \"+winner+\" has won!\");\n\t \n\t add(label1);\n\t}", "private void setupUI(){\n this.setupTimerSchedule(controller, 0, 500);\n this.setupFocusable(); \n this.setupSensSlider();\n this.setupInitEnable();\n this.setupDebugger();\n }", "private void setupFrame()\n\t{\n\t\tthis.setContentPane(botPanel);\n\t\tthis.setSize(800,700);\n\t\tthis.setTitle(\"- Chatbot v.2.1 -\");\n\t\tthis.setResizable(true);\n\t\tthis.setVisible(true);\n\t}", "public Engine() {\n\t\tsuper(\"DemoYourChoice\");\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n setVisible(true);\n setResizable(false);\n setLayout(new BorderLayout());\n\n board = new Board(1280, 720);\n board.setPreferredSize(board.getPreferredSize());\n con.add(board);\n\n ui = new JFrame(\"DemoYourChoice\");\n ui.setPreferredSize(new Dimension(600, 800));\n ui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n ui.setLayout(new FlowLayout());\n ui.setVisible(true);\n ui.add(titleLbl);\n\n\n\t\tui.pack();\n\n setSize(1280, 720);\n\t}", "private void init() {\r\n\r\n createGUI();\r\n\r\n setSize(new Dimension(600, 600));\r\n setTitle(\"Grid - Regular Grid Renderer\");\r\n }", "private void setupLeaderBoards() {\n add(announcementBtn).expandX().width(ChessGame.MENU_WIDTH);\n row();\n add(currentGamesBtn).expandX().width(ChessGame.MENU_WIDTH);\n row();\n add(chatRoomBtn).expandX().width(ChessGame.MENU_WIDTH);\n row();\n add(friendsListBtn).expandX().width(ChessGame.MENU_WIDTH);\n row();\n add(settingsBtn).expandX().width(ChessGame.MENU_WIDTH);\n row();\n }", "public Coup() {\n dim = Toolkit.getDefaultToolkit().getScreenSize();\n jframe = new JFrame(\"Coup\");\n jframe.setVisible(true);\n jframe.setSize(800, 700);\n jframe.setLocation(dim.width / 2 - jframe.getWidth() / 2, dim.width \n / 2 - jframe.getHeight() / 2);\n jframe.add(board = new Board());\n jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n }", "private void initComponents() {\n\t\tthis.setTitle(\"Boggle\");\n\t\tthis.setDefaultCloseOperation(EXIT_ON_CLOSE);\n\t\tthis.setMinimumSize(new Dimension(600, 575));\n\t\t\n\t\tinitMenuBar();\n\t\tinitDiceGridPanel();\n\t\tinitInputPanel();\n\t\tinitInfoPanel();\n\t\taddPanels();\n\t\t\n\t\tthis.setVisible(true);\n\t}", "private void setUp() {\n\t\tthis.setLayout(new BorderLayout());\n\t\tsetupMessagePanel();\n\t\tsetupHomeButtonPanel();\n\t}", "private void setUp() {\r\n add(myNextPiece, BorderLayout.NORTH);\r\n add(myScorePanel, BorderLayout.CENTER);\r\n add(myControl, BorderLayout.SOUTH);\r\n }", "public void setupGUIWindow()\n { \n// _frame.setExtendedState(Frame.MAXIMIZED_BOTH);\n// exitOnClose(); \n// createButtonGrid(); \n// addButtonPanel(); \n \n\t //setSize(new Dimension(Toolkit.getDefaultToolkit().getScreenSize())); \n \n\t _frame.setExtendedState(Frame.MAXIMIZED_BOTH);\n\t _frame.addComponentListener(new WindowListener());\n\t exitOnClose(); \n\t createShipPlacementButton();\n\t createButtonGrid(_displayPanel, _buttonGrid2, null); // player\n\t createButtonGrid(_buttonPanel, _buttonGrid, new GridListener(_buttonGrid)); // enemy\n\t addButtonPanel(); \n }", "public void GUISetup(){\n simTime.setText(\"50\");\n qMean.setText(\"24\");\n dMean.setText(\"45\");\n pMean.setText(\"55\");\n changeNorth.add(simTime2);\n changeNorth.add(simTime);\n changeNorth.add(pMean2);\n changeNorth.add(pMean);\n changeNorth.add(dMean2);\n changeNorth.add(dMean);\n changeNorth.add(qMean2);\n changeNorth.add(qMean);\n changeSouth.add(okay);\n \n resultDisplay.setEditable(false);\n descriptionDisplay.setEditable(false);\n \n changeFrame.add(changeNorth, BorderLayout.NORTH);\n changeFrame.add(changeSouth, BorderLayout.SOUTH);\n \n center.add(totalCus, BorderLayout.CENTER);\n center.add(doorCus, BorderLayout.CENTER);\n center.add(phoneCus, BorderLayout.CENTER);\n center.add(unhelped, BorderLayout.CENTER);\n\n help.add(programDescription);\n menuBar.add(help);\n north.add(menuBar);\n \n frame.setBounds(650, 400, 500, 200);\n changeFrame.setBounds(500, 400, 1100, 145);\n resultFrame.setBounds(500, 200, 600, 500);\n dFrame.setBounds(500, 200, 600, 500);\n frame.add(north, BorderLayout.NORTH);\n frame.add(south, BorderLayout.SOUTH);\n frame.add(center, BorderLayout.CENTER);\n frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);\n resultFrame.add(scroll);\n dFrame.add(dScroll);\n showDetails.setEnabled(false);\n \n south.add(runSim);\n south.add(showDetails);\n south.add(changeSimProp);\n \n time = simTime.getText();\n questionT = qMean.getText();\n phoneT = pMean.getText();\n doorT = dMean.getText();\n frame.setVisible(true);\n buttonFunctions();\n }", "private void initComponents() {\r\n\t\temulator = new Chip8();\r\n\t\tpanel = new DisplayPanel(emulator);\r\n\t\tregisterPanel = new EmulatorInfoPanel(emulator);\r\n\t\t\r\n\t\tcontroller = new Controller(this, emulator, panel, registerPanel);\r\n\t}", "public void setupWindow() {\n\t\t// all the variables declared above are initialized here.\n\t\tfinalizedUserQuestions = sortQuestions.randsort();\n\t\tcards = new JPanel(new CardLayout());\t\t\n\t\tcl = (CardLayout)(cards.getLayout());\n\t\t\t\n\t\tf = new JFrame(\"Jeopardy!\");\n\t\tf.setResizable(false);\n\t\tJPanel home = new JeopardyHome(cl, cards);\n\t\thome.setBackground(Color.BLUE);\n\t\tJPanel board = new JeopardyBoard(cl, cards, finalizedUserQuestions);\n\t\tJPanel answerpanel = new JeopardyAnswerPanel((JeopardyBoard) board);\n\t\tanswerpanel.setBackground(Color.BLUE);\n\t\tJPanel endpanel = new JeopardyGameEnd();\n\t\tendpanel.setBackground(Color.BLUE);\n\t\t\n\t\tcards.add(home, \"Main\");\n\t\tcards.add(board, \"Jeopardy! Board\");\n\t\tcards.add(answerpanel, \"Jeopardy! Answer\");\n\t\tcards.add(endpanel, \"End\");\n\t\t\n\t\tcl.show(cards, \"Main\");\n\t\t\n\t\t// menu widgets. This game isn't really that menu-oriented.\n\t\t// 'Exit' and 'Back to Home' are the only features.\n\t\t\n\t\tJMenuBar menuBar = new JMenuBar();\n\t\tJMenu options = new JMenu(\"Options\");\n\t\tJMenuItem exit = new JMenuItem(\"Exit\");\n\t\tback = new JMenuItem(\"Go To Board\");\n\t\t\n\t\texit.addActionListener(this);\n\t\tback.addActionListener(this);\n\t\t\n\t\toptions.add(back);\n\t\toptions.add(exit);\n\t\tmenuBar.add(options);\n\t\t\n\t\t// frame \"control center\"\n\t\tf.setJMenuBar(menuBar);\t\n\t\tf.setSize(1050, 745);\n\t\tf.setLocationRelativeTo(null);\n\t\tf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tf.add(cards, BorderLayout.CENTER);\n\t\t\t\t\n\t\tf.setVisible(true);\n\t}", "public void initGUI(){\n\t\t\n\t\t//the layout is a new BorderLayout\n\t\tsetLayout(new BorderLayout());\n\t\t\n\t\t//the label will be north\t\n\t\tadd(createHeroList(), BorderLayout.NORTH);\n\t\t\n\t\t//the questions will be displayed center\t\t\n\t\tadd(createQuestions(), BorderLayout.CENTER);\n\t\t//the button panel should be south\n\t\tadd(createAnswerButtonPanel(), BorderLayout.SOUTH);\n\t\t\n\t\t\n\t\t \n\t}", "public Badminton()\n { \n frame.add(new Board()); \n frame.setSize(900, 900);\n frame.setResizable(false);\n frame.setTitle(\"PE Class\");\n //frame.setLocationRelativeTo(null);\n frame.setVisible(true);\n }", "public void initialize() {\n\t\tbombLabel.setText(\"Flag: \" + game.getFlagCounter() + \"/\" + game.getNumOfBombs());\n\t\ttimerLabel.setText(\"Time: \" + 0);\n\t\tboard.getStyleClass().add(\"grid\");\n\t\tbtnArray = new Button[game.getHeight()][game.getWidth()];\n\t\tfor (int x = 0; x < game.getHeight(); x++) {\n\t\t\tfor (int y = 0; y < game.getWidth(); y++) {\n\t\t\t\tButton btn = new Button(\"\");\n\t\t\t\tbtnArray[x][y] = btn;\n\t\t\t\tbtn.setMaxSize(50, 50);\n\t\t\t\tbtn.setMinSize(50, 50);\n\t\t\t\t//Add Button to the board (GridPane)\n\t\t\t\tboard.add(btn, x, y);\n\t\t\t\tbtn.setId(x + \" . \" + y);\n\t\t\t\tbtn.setOnMouseClicked(e -> TileClicked(e));\n\t\t\t}\n\t\t}\n\t}", "private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(100, 100, 736, 580);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\t\r\n\t\tJPanel panel = new JPanel();\r\n\t\tpanel.setBorder(new TitledBorder(null, \"Tablica p\\u0142atno\\u015Bci\", TitledBorder.LEADING, TitledBorder.TOP, null, null));\r\n\t\t\r\n\t\tJPanel panel_1 = new JPanel();\r\n\t\tpanel_1.setBorder(new TitledBorder(null, \"Parametry symulacji\", TitledBorder.LEADING, TitledBorder.TOP, null, null));\r\n\t\t\r\n\t\tJPanel panel_2 = new JPanel();\r\n\t\tpanel_2.setBorder(new TitledBorder(null, \"Rodzaj kom\\u00F3rek w symulacji\", TitledBorder.LEADING, TitledBorder.TOP, null, null));\r\n\t\t\r\n\t\tCAPanel = new JPanel();\r\n\t\tCAPanel.setBorder(new TitledBorder(null, \"Kom\\u00F3rki CA\", TitledBorder.LEADING, TitledBorder.TOP, null, null));\r\n\t\t\r\n\t\tLApanel = new JPanel();\r\n\t\tLApanel.setBorder(new TitledBorder(null, \"Kom\\u00F3rki LA\", TitledBorder.LEADING, TitledBorder.TOP, null, null));\r\n\t\t\r\n\t\tbtnRozpocznijSymulacje = new JButton(\"Symulacja\");\r\n\t\tbtnRozpocznijSymulacje.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\t\r\n\t\t\t\tSettings settings= new Settings();\r\n\t\t\t\t\t\r\n\t\t\t\tif(rdbtnKomrkiLaiCA.isSelected())\r\n\t\t\t\t\tsettings.agentType=typeOfAgent.CAnLA;\r\n\t\t\t\telse if (rdbtnTylkoKomrkiLa.isSelected())\r\n\t\t\t\t\tsettings.agentType=typeOfAgent.LA;\r\n\t\t\t\telse if (rdbtnTylkoKomrkiCa.isSelected())\r\n\t\t\t\t\tsettings.agentType=typeOfAgent.CA;\r\n\t\t\t\t\r\n\t\t\t\tif (rdbtnGotWspDoch.isSelected())\r\n\t\t\t\t\tsettings.probOfPayoffSharing=(double)spinnergot_wspol_doch.getValue();\r\n\t\t\t\telse \r\n\t\t\t\t\tsettings.probOfPayoffSharing=0;\r\n\t\t\t\t\r\n\t\t\t\tif(rbtnkConst.isSelected())\r\n\t\t\t\t\tsettings.isKConst=true;\r\n\t\t\t\telse\r\n\t\t\t\t\tsettings.isKConst=false;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif (!rdbtnZiarno.isSelected())\r\n\t\t\t\t\tsettings.seed=new Random().nextInt();\r\n\t\t\t\telse \r\n\t\t\t\t\tsettings.seed=(int)spinnerZiarno.getValue();\r\n\t\t\t\ttry \r\n\t\t\t\t{\r\n\t\t\t\t\tsettings.numberOfRows=(int)spinnerLiczbaWireszy.getValue();\r\n\t\t\t\t\tsettings.numberOfColumns=(int) spinnerLiczbaKolumn.getValue();\r\n\t\t\t\t\tsettings.radiusOfNeighbor=(int)spinnerRSasiedztwa.getValue();\r\n\t\t\t\t\tsettings.qChanges=(int)spinnerQ.getValue();\r\n\t\t\t\t\tsettings.numberOfFrames=(int)spinnerIloscKrokow.getValue();\r\n\t\t\t\t\tsettings.probOfUnhabitedCell=(double)spinnerp_niezam.getValue();\r\n\t\t\t\t\tsettings.probOfInitCState=(double)spinnerp_init_C.getValue();\r\n\t\t\t\t\tsettings.numberOfExperiments=(int)spinnerIloscExperymentow.getValue();\r\n\t\t\t\t\tsettings.pDSettings= \r\n\t\t\t\t\t\t\tnew PrisonerDilema((double)spinnerR.getValue(),\r\n\t\t\t\t\t\t\t\t\t(double)spinnerS.getValue(), \r\n\t\t\t\t\t\t\t\t\t(double)spinnerT.getValue(), \r\n\t\t\t\t\t\t\t\t\t(double)spinnerP.getValue());\r\n\t\t\t\t\tsettings.probOfAgentCA=(double)SpinnerpTypAgCA.getValue();\r\n\t\t\t\t\tsettings.historyLength=(int)spinnerHistoria.getValue();\r\n\t\t\t\t\tsettings.epsilon=(double)spinnerEpsilon.getValue();\r\n\t\t\t\t\tsettings.mutation= \r\n\t\t\t\t\t\t\tnew Mutation((double)spinnerMutStrateg.getValue(), \r\n\t\t\t\t\t\t\t\t\t(double)spinnerMutPc.getValue(), \r\n\t\t\t\t\t\t\t\t\t(double)spinnerMutationHistoria.getValue(), \r\n\t\t\t\t\t\t\t\t\t(double)SpinnerMutationEpsilon.getValue(), \r\n\t\t\t\t\t\t\t\t\t(double)spinnerMutC1.getValue(), \r\n\t\t\t\t\t\t\t\t\t(int)spinnerMutationc2.getValue(), \r\n\t\t\t\t\t\t\t\t\t(double)spinnerMutationc3.getValue());\r\n\t\t\t\t\tsettings.probOfPcStrategy=(double)spinnerStrategPc.getValue();\r\n\t\t\t\t\tsettings.probOfAllCStrategy=(double)spinnerStrategAllC.getValue();\r\n\t\t\t\t\tsettings.probOfAllDStrategy=(double)SpinnerStrategAllD.getValue();\r\n\t\t\t\t\tsettings.probOfKDStrategy=(double)spinnerStrategkD.getValue();\r\n\t\t\t\t\tsettings.kMax=(int)spinnerKMAxx.getValue();\r\n\t\t\t\t\tsettings.valueOfPc=(double)spinnerPc.getValue();\r\n\t\t\t\t\tsettings.isQselected=(boolean)rdbtnQ.isSelected();\r\n\t\t\t\t\tsettings.isDebugSelected=(boolean) rdbtnDebug.isSelected();\r\n\t\t\t\t\tsettings.deltaPc=(double)spinnerDeltaPC.getValue();\r\n\t\t\t\t\tsettings.isLA1=(boolean) rdbtnLa1.isSelected();\r\n\t\t\t\t\tsettings.isLA2=(boolean) rdbtnLa2.isSelected();\r\n\t\t\t\t\tsettings.isLA3=(boolean) rdbtnLa3.isSelected();\r\n\t\t\t\t\t\r\n\t\t\t\t\talgo= new Algorithm(settings);\r\n\t\t\t\t\talgo.Calculate();\r\n\t\t\t\t\talgo.createWindow();\r\n\t\t\t\t\r\n\t\t\t\t} catch (IOException e) \r\n\t\t\t\t{\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\trdbtnDebug = new JRadioButton(\"debug\");\r\n\t\trdbtnDebug.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t}\r\n\t\t});\r\n\t\tGroupLayout groupLayout = new GroupLayout(frame.getContentPane());\r\n\t\tgroupLayout.setHorizontalGroup(\r\n\t\t\tgroupLayout.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t.addGroup(groupLayout.createSequentialGroup()\r\n\t\t\t\t\t.addContainerGap()\r\n\t\t\t\t\t.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t\t\t.addComponent(panel_1, GroupLayout.DEFAULT_SIZE, 266, Short.MAX_VALUE)\r\n\t\t\t\t\t\t.addComponent(panel, GroupLayout.PREFERRED_SIZE, 266, Short.MAX_VALUE))\r\n\t\t\t\t\t.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t\t\t.addGroup(groupLayout.createSequentialGroup()\r\n\t\t\t\t\t\t\t.addGap(24)\r\n\t\t\t\t\t\t\t.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t\t\t\t\t.addGroup(groupLayout.createSequentialGroup()\r\n\t\t\t\t\t\t\t\t\t.addGap(10)\r\n\t\t\t\t\t\t\t\t\t.addComponent(btnRozpocznijSymulacje, GroupLayout.PREFERRED_SIZE, 97, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t\t\t\t\t.addComponent(rdbtnDebug, GroupLayout.DEFAULT_SIZE, 78, Short.MAX_VALUE))\r\n\t\t\t\t\t\t\t\t.addComponent(LApanel, 0, 0, Short.MAX_VALUE)))\r\n\t\t\t\t\t\t.addGroup(groupLayout.createSequentialGroup()\r\n\t\t\t\t\t\t\t.addGap(28)\r\n\t\t\t\t\t\t\t.addComponent(panel_2, GroupLayout.PREFERRED_SIZE, 183, GroupLayout.PREFERRED_SIZE)))\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t.addComponent(CAPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t.addContainerGap())\r\n\t\t);\r\n\t\tgroupLayout.setVerticalGroup(\r\n\t\t\tgroupLayout.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t.addGroup(groupLayout.createSequentialGroup()\r\n\t\t\t\t\t.addContainerGap()\r\n\t\t\t\t\t.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t\t\t.addComponent(CAPanel, GroupLayout.DEFAULT_SIZE, 478, Short.MAX_VALUE)\r\n\t\t\t\t\t\t.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t\t.addGroup(groupLayout.createSequentialGroup()\r\n\t\t\t\t\t\t\t\t.addComponent(panel_1, GroupLayout.PREFERRED_SIZE, 329, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 35, Short.MAX_VALUE)\r\n\t\t\t\t\t\t\t\t.addComponent(panel, GroupLayout.PREFERRED_SIZE, 114, GroupLayout.PREFERRED_SIZE))\r\n\t\t\t\t\t\t\t.addGroup(groupLayout.createSequentialGroup()\r\n\t\t\t\t\t\t\t\t.addComponent(panel_2, GroupLayout.PREFERRED_SIZE, 180, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t\t\t.addGap(1)\r\n\t\t\t\t\t\t\t\t.addComponent(LApanel, GroupLayout.PREFERRED_SIZE, 255, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\r\n\t\t\t\t\t\t\t\t.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t\t\t\t.addComponent(btnRozpocznijSymulacje, GroupLayout.PREFERRED_SIZE, 35, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t\t\t\t.addComponent(rdbtnDebug)))))\r\n\t\t\t\t\t.addGap(42))\r\n\t\t);\r\n\t\tGridBagLayout gbl_panel = new GridBagLayout();\r\n\t\tgbl_panel.columnWidths = new int[]{0, 0, 67, 0, 0, 0};\r\n\t\tgbl_panel.rowHeights = new int[]{0, 37, 41, 0};\r\n\t\tgbl_panel.columnWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};\r\n\t\tgbl_panel.rowWeights = new double[]{0.0, 0.0, 0.0, Double.MIN_VALUE};\r\n\t\tpanel.setLayout(gbl_panel);\r\n\t\t\r\n\t\tJLabel lblNewLabel_1 = new JLabel(\"C\");\r\n\t\tGridBagConstraints gbc_lblNewLabel_1 = new GridBagConstraints();\r\n\t\tgbc_lblNewLabel_1.anchor = GridBagConstraints.WEST;\r\n\t\tgbc_lblNewLabel_1.insets = new Insets(0, 0, 5, 5);\r\n\t\tgbc_lblNewLabel_1.gridx = 2;\r\n\t\tgbc_lblNewLabel_1.gridy = 0;\r\n\t\tpanel.add(lblNewLabel_1, gbc_lblNewLabel_1);\r\n\t\t\r\n\t\tJLabel lblD = new JLabel(\"D\");\r\n\t\tGridBagConstraints gbc_lblD = new GridBagConstraints();\r\n\t\tgbc_lblD.insets = new Insets(0, 0, 5, 0);\r\n\t\tgbc_lblD.gridx = 4;\r\n\t\tgbc_lblD.gridy = 0;\r\n\t\tpanel.add(lblD, gbc_lblD);\r\n\t\t\r\n\t\tJLabel lblC = new JLabel(\"C\");\r\n\t\tGridBagConstraints gbc_lblC = new GridBagConstraints();\r\n\t\tgbc_lblC.insets = new Insets(0, 0, 5, 5);\r\n\t\tgbc_lblC.gridx = 0;\r\n\t\tgbc_lblC.gridy = 1;\r\n\t\tpanel.add(lblC, gbc_lblC);\r\n\t\t\r\n\t\tJLabel lblR = new JLabel(\"R():\");\r\n\t\tGridBagConstraints gbc_lblR = new GridBagConstraints();\r\n\t\tgbc_lblR.insets = new Insets(0, 0, 5, 5);\r\n\t\tgbc_lblR.gridx = 1;\r\n\t\tgbc_lblR.gridy = 1;\r\n\t\tpanel.add(lblR, gbc_lblR);\r\n\t\t\r\n\t\tspinnerR = new JSpinner();\r\n\t\tGridBagConstraints gbc_spinnerR = new GridBagConstraints();\r\n\t\tgbc_spinnerR.anchor = GridBagConstraints.WEST;\r\n\t\tgbc_spinnerR.insets = new Insets(0, 0, 5, 5);\r\n\t\tgbc_spinnerR.gridx = 2;\r\n\t\tgbc_spinnerR.gridy = 1;\r\n\t\tpanel.add(spinnerR, gbc_spinnerR);\r\n\t\tspinnerR.setModel(new SpinnerNumberModel(1.0,-99.99,99.99,0.01));\r\n\t\t\r\n\t\tJLabel lblS = new JLabel(\"S():\");\r\n\t\tGridBagConstraints gbc_lblS = new GridBagConstraints();\r\n\t\tgbc_lblS.insets = new Insets(0, 0, 5, 5);\r\n\t\tgbc_lblS.gridx = 3;\r\n\t\tgbc_lblS.gridy = 1;\r\n\t\tpanel.add(lblS, gbc_lblS);\r\n\t\t\r\n\t\tspinnerS = new JSpinner();\r\n\t\tspinnerS.setModel(new SpinnerNumberModel(0,-99.99,99.99,0.01));\r\n\t\tGridBagConstraints gbc_spinnerS = new GridBagConstraints();\r\n\t\tgbc_spinnerS.insets = new Insets(0, 0, 5, 0);\r\n\t\tgbc_spinnerS.gridx = 4;\r\n\t\tgbc_spinnerS.gridy = 1;\r\n\t\tpanel.add(spinnerS, gbc_spinnerS);\r\n\t\t\r\n\t\tJLabel lblD_1 = new JLabel(\"D\");\r\n\t\tGridBagConstraints gbc_lblD_1 = new GridBagConstraints();\r\n\t\tgbc_lblD_1.insets = new Insets(0, 0, 0, 5);\r\n\t\tgbc_lblD_1.gridx = 0;\r\n\t\tgbc_lblD_1.gridy = 2;\r\n\t\tpanel.add(lblD_1, gbc_lblD_1);\r\n\t\t\r\n\t\tJLabel lblT = new JLabel(\"T(b):\");\r\n\t\tGridBagConstraints gbc_lblT = new GridBagConstraints();\r\n\t\tgbc_lblT.insets = new Insets(0, 0, 0, 5);\r\n\t\tgbc_lblT.gridx = 1;\r\n\t\tgbc_lblT.gridy = 2;\r\n\t\tpanel.add(lblT, gbc_lblT);\r\n\t\t\r\n\t\tspinnerT = new JSpinner();\r\n\t\tGridBagConstraints gbc_spinnerT = new GridBagConstraints();\r\n\t\tgbc_spinnerT.anchor = GridBagConstraints.WEST;\r\n\t\tgbc_spinnerT.insets = new Insets(0, 0, 0, 5);\r\n\t\tgbc_spinnerT.gridx = 2;\r\n\t\tgbc_spinnerT.gridy = 2;\r\n\t\tpanel.add(spinnerT, gbc_spinnerT);\r\n\t\tspinnerT.setModel(new SpinnerNumberModel(1.4,-99.99,99.99,0.01));\r\n\t\t\r\n\t\tJLabel lblNewLabel = new JLabel(\"P():\");\r\n\t\tGridBagConstraints gbc_lblNewLabel = new GridBagConstraints();\r\n\t\tgbc_lblNewLabel.insets = new Insets(0, 0, 0, 5);\r\n\t\tgbc_lblNewLabel.gridx = 3;\r\n\t\tgbc_lblNewLabel.gridy = 2;\r\n\t\tpanel.add(lblNewLabel, gbc_lblNewLabel);\r\n\t\t\r\n\t\tspinnerP = new JSpinner();\r\n\t\tspinnerP.setModel(new SpinnerNumberModel(0,-99.99,99.99,0.01));\r\n\t\tGridBagConstraints gbc_spinnerP = new GridBagConstraints();\r\n\t\tgbc_spinnerP.gridx = 4;\r\n\t\tgbc_spinnerP.gridy = 2;\r\n\t\tpanel.add(spinnerP, gbc_spinnerP);\r\n\t\t\r\n\t\tspinnerHistoria = new JSpinner();\r\n\t\tspinnerHistoria.setEnabled(false);\r\n\t\tspinnerHistoria.setModel(new SpinnerNumberModel(new Integer(8), new Integer(1), null, new Integer(1)));\r\n\t\t\r\n\t\tJLabel lblHistoria = new JLabel(\"pamiec\");\r\n\t\t\r\n\t\tspinnerEpsilon = new JSpinner();\r\n\t\tspinnerEpsilon.setEnabled(false);\r\n\t\tspinnerEpsilon.setModel(new SpinnerNumberModel(0.001,0,1,0.001));\r\n\t\t\r\n\t\tJLabel lblEpsilon = new JLabel(\"epsilon:\");\r\n\t\t\r\n\t\tJPanel panel_6 = new JPanel();\r\n\t\tpanel_6.setBorder(new TitledBorder(UIManager.getBorder(\"TitledBorder.border\"), \"mutacja\", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));\r\n\t\tGroupLayout gl_LApanel = new GroupLayout(LApanel);\r\n\t\tgl_LApanel.setHorizontalGroup(\r\n\t\t\tgl_LApanel.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t.addGroup(Alignment.TRAILING, gl_LApanel.createSequentialGroup()\r\n\t\t\t\t\t.addContainerGap()\r\n\t\t\t\t\t.addGroup(gl_LApanel.createParallelGroup(Alignment.TRAILING)\r\n\t\t\t\t\t\t.addComponent(panel_6, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE)\r\n\t\t\t\t\t\t.addGroup(gl_LApanel.createSequentialGroup()\r\n\t\t\t\t\t\t\t.addComponent(lblHistoria)\r\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.UNRELATED)\r\n\t\t\t\t\t\t\t.addComponent(spinnerHistoria, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE))\r\n\t\t\t\t\t\t.addGroup(gl_LApanel.createSequentialGroup()\r\n\t\t\t\t\t\t\t.addComponent(lblEpsilon)\r\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.UNRELATED)\r\n\t\t\t\t\t\t\t.addComponent(spinnerEpsilon, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE)))\r\n\t\t\t\t\t.addContainerGap())\r\n\t\t);\r\n\t\tgl_LApanel.setVerticalGroup(\r\n\t\t\tgl_LApanel.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t.addGroup(gl_LApanel.createSequentialGroup()\r\n\t\t\t\t\t.addContainerGap()\r\n\t\t\t\t\t.addGroup(gl_LApanel.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(spinnerHistoria, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addComponent(lblHistoria))\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t.addGroup(gl_LApanel.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(spinnerEpsilon, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addComponent(lblEpsilon))\r\n\t\t\t\t\t.addGap(18)\r\n\t\t\t\t\t.addComponent(panel_6, GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE)\r\n\t\t\t\t\t.addContainerGap())\r\n\t\t);\r\n\t\t\r\n\t\tspinnerMutationHistoria = new JSpinner();\r\n\t\tspinnerMutationHistoria.setEnabled(false);\r\n\t\tspinnerMutationHistoria.setModel(new SpinnerNumberModel(0, 0, 1, 0.01));\r\n\t\t\r\n\t\tJLabel lblHistoria_1 = new JLabel(\"historia:\");\r\n\t\t\r\n\t\tspinnerMutationc2 = new JSpinner();\r\n\t\tspinnerMutationc2.setEnabled(false);\r\n\t\tspinnerMutationc2.setModel(new SpinnerNumberModel(1, 1, 100, 1));\r\n\t\t\r\n\t\tJLabel lblC_2 = new JLabel(\"c2:\");\r\n\t\t\r\n\t\tSpinnerMutationEpsilon = new JSpinner();\r\n\t\tSpinnerMutationEpsilon.setEnabled(false);\r\n\t\tSpinnerMutationEpsilon.setModel(new SpinnerNumberModel(0, 0, 1, 0.01));\r\n\t\t\r\n\t\tspinnerMutationc3 = new JSpinner();\r\n\t\tspinnerMutationc3.setEnabled(false);\r\n\t\tspinnerMutationc3.setModel(new SpinnerNumberModel(0, 0, 1, 0.01));\r\n\t\t\r\n\t\tJLabel lblEpsilon_1 = new JLabel(\"epsilon:\");\r\n\t\t\r\n\t\tJLabel lblC_3 = new JLabel(\"c3:\");\r\n\t\tGroupLayout gl_panel_6 = new GroupLayout(panel_6);\r\n\t\tgl_panel_6.setHorizontalGroup(\r\n\t\t\tgl_panel_6.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t.addGroup(Alignment.TRAILING, gl_panel_6.createSequentialGroup()\r\n\t\t\t\t\t.addContainerGap(24, Short.MAX_VALUE)\r\n\t\t\t\t\t.addGroup(gl_panel_6.createParallelGroup(Alignment.TRAILING)\r\n\t\t\t\t\t\t.addComponent(lblHistoria_1)\r\n\t\t\t\t\t\t.addComponent(lblC_2)\r\n\t\t\t\t\t\t.addComponent(lblEpsilon_1)\r\n\t\t\t\t\t\t.addComponent(lblC_3))\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t.addGroup(gl_panel_6.createParallelGroup(Alignment.LEADING, false)\r\n\t\t\t\t\t\t.addComponent(spinnerMutationc3, Alignment.TRAILING)\r\n\t\t\t\t\t\t.addComponent(SpinnerMutationEpsilon, Alignment.TRAILING)\r\n\t\t\t\t\t\t.addComponent(spinnerMutationc2, Alignment.TRAILING)\r\n\t\t\t\t\t\t.addComponent(spinnerMutationHistoria, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 63, Short.MAX_VALUE))\r\n\t\t\t\t\t.addContainerGap())\r\n\t\t);\r\n\t\tgl_panel_6.setVerticalGroup(\r\n\t\t\tgl_panel_6.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t.addGroup(gl_panel_6.createSequentialGroup()\r\n\t\t\t\t\t.addGroup(gl_panel_6.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(spinnerMutationHistoria, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addComponent(lblHistoria_1))\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t.addGroup(gl_panel_6.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(spinnerMutationc2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addComponent(lblC_2))\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t.addGroup(gl_panel_6.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(SpinnerMutationEpsilon, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addComponent(lblEpsilon_1))\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t.addGroup(gl_panel_6.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(spinnerMutationc3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addComponent(lblC_3))\r\n\t\t\t\t\t.addContainerGap(43, Short.MAX_VALUE))\r\n\t\t);\r\n\t\tpanel_6.setLayout(gl_panel_6);\r\n\t\tLApanel.setLayout(gl_LApanel);\r\n\t\t\r\n\t\tspinnerStrategPc = new JSpinner();\r\n\t\tspinnerStrategPc.setModel(new SpinnerNumberModel(0.25, 0, 1, 0.01));\r\n\t\tspinnerStrategPc.addChangeListener(new ChangeListener() {\r\n\t\t\tpublic void stateChanged(ChangeEvent e) {\r\n\t\t\t\tdouble suma= (double)spinnerStrategAllC.getValue()+(double)SpinnerStrategAllD.getValue()+(double)spinnerStrategkD.getValue();\r\n\t\t\t\tif((suma+(double)spinnerStrategPc.getValue())>1)\r\n\t\t\t\t{\r\n\t\t\t\t\tspinnerStrategPc.setValue((double)1-suma);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tJLabel label = new JLabel(\"strategia Pc:\");\r\n\t\t\r\n\t\tspinnerStrategAllC = new JSpinner();\r\n\t\tspinnerStrategAllC.setModel(new SpinnerNumberModel(0.25, 0, 1, 0.01));\r\n\t\tspinnerStrategAllC.addChangeListener(new ChangeListener() {\r\n\t\t\tpublic void stateChanged(ChangeEvent e) {\r\n\t\t\t\tdouble suma= (double)spinnerStrategPc.getValue()+(double)SpinnerStrategAllD.getValue()+(double)spinnerStrategkD.getValue();\r\n\t\t\t\tif((suma+(double)spinnerStrategAllC.getValue())>1)\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tspinnerStrategAllC.setValue((double)1-suma);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tSpinnerStrategAllD = new JSpinner();\r\n\t\tSpinnerStrategAllD.setModel(new SpinnerNumberModel(0.25, 0, 1, 0.01));\r\n\t\tSpinnerStrategAllD.addChangeListener(new ChangeListener() {\r\n\t\t\tpublic void stateChanged(ChangeEvent e) {\r\n\t\t\t\tdouble suma= (double)spinnerStrategPc.getValue()+(double)spinnerStrategAllC.getValue()+(double)spinnerStrategkD.getValue();\r\n\t\t\t\tif((suma+(double)SpinnerStrategAllD.getValue())>1)\r\n\t\t\t\t{\r\n\t\t\t\t\tSpinnerStrategAllD.setValue((double)1-suma);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tspinnerStrategkD = new JSpinner();\r\n\t\tspinnerStrategkD.setModel(new SpinnerNumberModel(0.25, 0, 1, 0.01));\r\n\t\tspinnerStrategkD.addChangeListener(new ChangeListener() {\r\n\t\t\tpublic void stateChanged(ChangeEvent e) {\r\n\t\t\t\tdouble suma= (double)spinnerStrategPc.getValue()+(double)spinnerStrategAllC.getValue()+(double)SpinnerStrategAllD.getValue();\r\n\t\t\t\tif((suma+(double)spinnerStrategkD.getValue())>1)\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tspinnerStrategkD.setValue((double)1-suma);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tJLabel lblStrategiaAllc = new JLabel(\"strategia AllC:\");\r\n\t\t\r\n\t\tJLabel lblStrategia = new JLabel(\"strategia AllD:\");\r\n\t\t\r\n\t\tJLabel lblStrategiaKd = new JLabel(\"strategia k-D:\");\r\n\t\t\r\n\t\trbtnkConst = new JRadioButton(\"k_const\");\r\n\t\t\r\n\t\tspinnerPc = new JSpinner();\r\n\t\tspinnerPc.setModel(new SpinnerNumberModel(0.5, 0, 1, 0.01));\r\n\t\t\r\n\t\tJLabel lblPWsppracy = new JLabel(\"p_C:\");\r\n\t\t\r\n\t\tspinnerKMAxx = new JSpinner();\r\n\t\tspinnerKMAxx.setModel(new SpinnerNumberModel(3, 0, 7, 1));\r\n\t\t\r\n\t\tJPanel panel_5 = new JPanel();\r\n\t\tpanel_5.setBorder(new TitledBorder(null, \"mutacja\", TitledBorder.LEADING, TitledBorder.TOP, null, null));\r\n\t\t\r\n\t\tJLabel deltaP_C = new JLabel(\"delta p_C:\");\r\n\t\t\r\n\t\tspinnerDeltaPC = new JSpinner(new SpinnerNumberModel(0, 0, 1, 0.01));\r\n\t\tGroupLayout gl_CAPanel = new GroupLayout(CAPanel);\r\n\t\tgl_CAPanel.setHorizontalGroup(\r\n\t\t\tgl_CAPanel.createParallelGroup(Alignment.TRAILING)\r\n\t\t\t\t.addGroup(gl_CAPanel.createSequentialGroup()\r\n\t\t\t\t\t.addContainerGap()\r\n\t\t\t\t\t.addGroup(gl_CAPanel.createParallelGroup(Alignment.TRAILING)\r\n\t\t\t\t\t\t.addComponent(panel_5, GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)\r\n\t\t\t\t\t\t.addGroup(gl_CAPanel.createSequentialGroup()\r\n\t\t\t\t\t\t\t.addGroup(gl_CAPanel.createParallelGroup(Alignment.TRAILING, false)\r\n\t\t\t\t\t\t\t\t.addComponent(lblPWsppracy)\r\n\t\t\t\t\t\t\t\t.addComponent(rbtnkConst, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\r\n\t\t\t\t\t\t\t\t.addComponent(deltaP_C))\r\n\t\t\t\t\t\t\t.addGap(18)\r\n\t\t\t\t\t\t\t.addGroup(gl_CAPanel.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t\t\t\t\t.addComponent(spinnerDeltaPC, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t\t\t.addComponent(spinnerKMAxx, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t\t\t.addComponent(spinnerPc, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE)))\r\n\t\t\t\t\t\t.addGroup(gl_CAPanel.createSequentialGroup()\r\n\t\t\t\t\t\t\t.addGap(26)\r\n\t\t\t\t\t\t\t.addComponent(label, GroupLayout.PREFERRED_SIZE, 72, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.UNRELATED)\r\n\t\t\t\t\t\t\t.addComponent(spinnerStrategPc, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE))\r\n\t\t\t\t\t\t.addGroup(gl_CAPanel.createSequentialGroup()\r\n\t\t\t\t\t\t\t.addComponent(lblStrategiaAllc)\r\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.UNRELATED)\r\n\t\t\t\t\t\t\t.addComponent(spinnerStrategAllC, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE))\r\n\t\t\t\t\t\t.addGroup(gl_CAPanel.createSequentialGroup()\r\n\t\t\t\t\t\t\t.addComponent(lblStrategia)\r\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.UNRELATED)\r\n\t\t\t\t\t\t\t.addComponent(SpinnerStrategAllD, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE))\r\n\t\t\t\t\t\t.addGroup(gl_CAPanel.createSequentialGroup()\r\n\t\t\t\t\t\t\t.addComponent(lblStrategiaKd)\r\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.UNRELATED)\r\n\t\t\t\t\t\t\t.addComponent(spinnerStrategkD, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE)))\r\n\t\t\t\t\t.addContainerGap())\r\n\t\t);\r\n\t\tgl_CAPanel.setVerticalGroup(\r\n\t\t\tgl_CAPanel.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t.addGroup(gl_CAPanel.createSequentialGroup()\r\n\t\t\t\t\t.addContainerGap()\r\n\t\t\t\t\t.addGroup(gl_CAPanel.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(spinnerStrategPc, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addComponent(label))\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t.addGroup(gl_CAPanel.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(spinnerStrategAllC, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addComponent(lblStrategiaAllc))\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t.addGroup(gl_CAPanel.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(SpinnerStrategAllD, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addComponent(lblStrategia))\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t.addGroup(gl_CAPanel.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(spinnerStrategkD, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addComponent(lblStrategiaKd))\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t.addGroup(gl_CAPanel.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(spinnerKMAxx, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addComponent(rbtnkConst))\r\n\t\t\t\t\t.addGap(5)\r\n\t\t\t\t\t.addGroup(gl_CAPanel.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(lblPWsppracy)\r\n\t\t\t\t\t\t.addComponent(spinnerPc, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t.addGroup(gl_CAPanel.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(deltaP_C)\r\n\t\t\t\t\t\t.addComponent(spinnerDeltaPC, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 66, Short.MAX_VALUE)\r\n\t\t\t\t\t.addComponent(panel_5, GroupLayout.PREFERRED_SIZE, 156, GroupLayout.PREFERRED_SIZE))\r\n\t\t);\r\n\t\t\r\n\t\tspinnerMutStrateg = new JSpinner();\r\n\t\tspinnerMutStrateg.setModel(new SpinnerNumberModel(0,0,1,0.01));\r\n\t\t\r\n\t\tJLabel lblZmianaStrateg = new JLabel(\"strategia:\");\r\n\t\t\r\n\t\tspinnerMutPc = new JSpinner();\r\n\t\tspinnerMutPc.setModel(new SpinnerNumberModel(0,0,1,0.01));\r\n\t\t\r\n\t\tJLabel lblNewLabel_2 = new JLabel(\"parametr Pc:\");\r\n\t\t\r\n\t\tspinnerMutC1 = new JSpinner();\r\n\t\tspinnerMutC1.setModel(new SpinnerNumberModel(0.05,0,1,0.01));\r\n\t\t\r\n\t\tJLabel lblC_1 = new JLabel(\"c1:\");\r\n\t\tGroupLayout gl_panel_5 = new GroupLayout(panel_5);\r\n\t\tgl_panel_5.setHorizontalGroup(\r\n\t\t\tgl_panel_5.createParallelGroup(Alignment.TRAILING)\r\n\t\t\t\t.addGroup(gl_panel_5.createSequentialGroup()\r\n\t\t\t\t\t.addContainerGap(17, Short.MAX_VALUE)\r\n\t\t\t\t\t.addGroup(gl_panel_5.createParallelGroup(Alignment.TRAILING)\r\n\t\t\t\t\t\t.addComponent(lblZmianaStrateg)\r\n\t\t\t\t\t\t.addComponent(lblNewLabel_2)\r\n\t\t\t\t\t\t.addComponent(lblC_1))\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t.addGroup(gl_panel_5.createParallelGroup(Alignment.LEADING, false)\r\n\t\t\t\t\t\t.addComponent(spinnerMutC1, Alignment.TRAILING)\r\n\t\t\t\t\t\t.addComponent(spinnerMutPc)\r\n\t\t\t\t\t\t.addComponent(spinnerMutStrateg, GroupLayout.DEFAULT_SIZE, 57, Short.MAX_VALUE))\r\n\t\t\t\t\t.addContainerGap())\r\n\t\t);\r\n\t\tgl_panel_5.setVerticalGroup(\r\n\t\t\tgl_panel_5.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t.addGroup(gl_panel_5.createSequentialGroup()\r\n\t\t\t\t\t.addContainerGap()\r\n\t\t\t\t\t.addGroup(gl_panel_5.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(spinnerMutStrateg, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addComponent(lblZmianaStrateg))\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t.addGroup(gl_panel_5.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(spinnerMutPc, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addComponent(lblNewLabel_2))\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t.addGroup(gl_panel_5.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(spinnerMutC1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addComponent(lblC_1))\r\n\t\t\t\t\t.addContainerGap(26, Short.MAX_VALUE))\r\n\t\t);\r\n\t\tpanel_5.setLayout(gl_panel_5);\r\n\t\tCAPanel.setLayout(gl_CAPanel);\r\n\t\t\r\n\t\trdbtnTylkoKomrkiCa = new JRadioButton(\"Tylko Kom\\u00F3rki CA\");\r\n\t\trdbtnTylkoKomrkiCa.setSelected(true);\r\n\t\trdbtnTylkoKomrkiCa.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tif(rdbtnTylkoKomrkiCa.isSelected())\r\n\t\t\t\t{\r\n\t\t\t\t\tSpinnerpTypAgCA.setEnabled(false);\r\n\t\t\t\t\tLApanel.setEnabled(false);\r\n\t\t\t\t\tCAPanel.setEnabled(true);\r\n\t\t\t\t\tspinnerStrategPc.setEnabled(true);\r\n\t\t\t\t\tspinnerPc.setEnabled(true);\r\n\t\t\t\t\tspinnerStrategAllC.setEnabled(true);\r\n\t\t\t\t\tSpinnerStrategAllD.setEnabled(true);\r\n\t\t\t\t\tspinnerStrategkD.setEnabled(true);\r\n\t\t\t\t\tspinnerKMAxx.setEnabled(true);\r\n\t\t\t\t\trbtnkConst.setEnabled(true);\r\n\t\t\t\t\tspinnerMutStrateg.setEnabled(true);\r\n\t\t\t\t\tspinnerMutPc.setEnabled(true);\r\n\t\t\t\t\tspinnerMutC1.setEnabled(true);\r\n\t\t\t\t\tspinnerHistoria.setEnabled(false);\r\n\t\t\t\t\tspinnerEpsilon.setEnabled(false);\r\n\t\t\t\t\tspinnerMutationHistoria.setEnabled(false);\r\n\t\t\t\t\tspinnerMutationc2.setEnabled(false);\r\n\t\t\t\t\tSpinnerMutationEpsilon.setEnabled(false);\r\n\t\t\t\t\tspinnerMutationc3.setEnabled(false);\r\n\t\t\t\t\trdbtnLa1.setEnabled(false);\r\n\t\t\t\t\trdbtnLa2.setEnabled(false);\r\n\t\t\t\t\trdbtnLa3.setEnabled(false);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tLApanel.setEnabled(false);\r\n\t\t\t\t\tCAPanel.setEnabled(false);\r\n\t\t\t\t\tspinnerStrategPc.setEnabled(false);\r\n\t\t\t\t\tspinnerPc.setEnabled(false);\r\n\t\t\t\t\tspinnerStrategAllC.setEnabled(false);\r\n\t\t\t\t\tSpinnerStrategAllD.setEnabled(false);\r\n\t\t\t\t\tspinnerStrategkD.setEnabled(false);\r\n\t\t\t\t\tspinnerKMAxx.setEnabled(false);\r\n\t\t\t\t\trbtnkConst.setEnabled(false);\r\n\t\t\t\t\tspinnerMutStrateg.setEnabled(false);\r\n\t\t\t\t\tspinnerMutPc.setEnabled(false);\r\n\t\t\t\t\tspinnerMutC1.setEnabled(false);\r\n\t\t\t\t\tspinnerHistoria.setEnabled(false);\r\n\t\t\t\t\tspinnerEpsilon.setEnabled(false);\r\n\t\t\t\t\tspinnerMutationHistoria.setEnabled(false);\r\n\t\t\t\t\tspinnerMutationc2.setEnabled(false);\r\n\t\t\t\t\tSpinnerMutationEpsilon.setEnabled(false);\r\n\t\t\t\t\tspinnerMutationc3.setEnabled(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tbuttonGroup.add(rdbtnTylkoKomrkiCa);\r\n\t\t\r\n\t\trdbtnTylkoKomrkiLa = new JRadioButton(\"Tylko Kom\\u00F3rki LA\");\r\n\t\trdbtnTylkoKomrkiLa.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tif(rdbtnTylkoKomrkiLa.isSelected())\r\n\t\t\t\t{\r\n\t\t\t\t\tSpinnerpTypAgCA.setEnabled(false);\r\n\t\t\t\t\tLApanel.setEnabled(true);\r\n\t\t\t\t\tCAPanel.setEnabled(false);\r\n\t\t\t\t\tspinnerStrategPc.setEnabled(false);\r\n\t\t\t\t\tspinnerPc.setEnabled(false);\r\n\t\t\t\t\tspinnerStrategAllC.setEnabled(false);\r\n\t\t\t\t\tSpinnerStrategAllD.setEnabled(false);\r\n\t\t\t\t\tspinnerStrategkD.setEnabled(false);\r\n\t\t\t\t\tspinnerKMAxx.setEnabled(false);\r\n\t\t\t\t\trbtnkConst.setEnabled(false);\r\n\t\t\t\t\tspinnerMutStrateg.setEnabled(false);\r\n\t\t\t\t\tspinnerMutPc.setEnabled(false);\r\n\t\t\t\t\tspinnerMutC1.setEnabled(false);\r\n\t\t\t\t\tspinnerHistoria.setEnabled(true);\r\n\t\t\t\t\tspinnerEpsilon.setEnabled(true);\r\n\t\t\t\t\tspinnerMutationHistoria.setEnabled(true);\r\n\t\t\t\t\tspinnerMutationc2.setEnabled(true);\r\n\t\t\t\t\tSpinnerMutationEpsilon.setEnabled(true);\r\n\t\t\t\t\tspinnerMutationc3.setEnabled(true);\r\n\t\t\t\t\trdbtnLa1.setEnabled(true);\r\n\t\t\t\t\trdbtnLa2.setEnabled(true);\r\n\t\t\t\t\trdbtnLa3.setEnabled(true);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tLApanel.setEnabled(false);\r\n\t\t\t\t\tCAPanel.setEnabled(false);\r\n\t\t\t\t\tspinnerStrategPc.setEnabled(false);\r\n\t\t\t\t\tspinnerPc.setEnabled(false);\r\n\t\t\t\t\tspinnerStrategAllC.setEnabled(false);\r\n\t\t\t\t\tSpinnerStrategAllD.setEnabled(false);\r\n\t\t\t\t\tspinnerStrategkD.setEnabled(false);\r\n\t\t\t\t\tspinnerKMAxx.setEnabled(false);\r\n\t\t\t\t\trbtnkConst.setEnabled(false);\r\n\t\t\t\t\tspinnerMutStrateg.setEnabled(false);\r\n\t\t\t\t\tspinnerMutPc.setEnabled(false);\r\n\t\t\t\t\tspinnerMutC1.setEnabled(false);\r\n\t\t\t\t\tspinnerHistoria.setEnabled(false);\r\n\t\t\t\t\tspinnerEpsilon.setEnabled(false);\r\n\t\t\t\t\tspinnerMutationHistoria.setEnabled(false);\r\n\t\t\t\t\tspinnerMutationc2.setEnabled(false);\r\n\t\t\t\t\tSpinnerMutationEpsilon.setEnabled(false);\r\n\t\t\t\t\tspinnerMutationc3.setEnabled(false);\r\n\t\t\t\t\trdbtnLa1.setEnabled(false);\r\n\t\t\t\t\trdbtnLa2.setEnabled(false);\r\n\t\t\t\t\trdbtnLa3.setEnabled(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tbuttonGroup.add(rdbtnTylkoKomrkiLa);\r\n\t\t\r\n\t\trdbtnKomrkiLaiCA = new JRadioButton(\"Kom\\u00F3rki LA i CA\");\r\n\t\t\r\n\t\tbuttonGroup.add(rdbtnKomrkiLaiCA);\r\n\t\t\r\n\t\trdbtnKomrkiLaiCA.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tif (rdbtnKomrkiLaiCA.isSelected())\r\n\t\t\t\t{\r\n\t\t\t\t\tSpinnerpTypAgCA.setEnabled(true);\r\n\t\t\t\t\tCAPanel.setEnabled(true);\r\n\t\t\t\t\tspinnerStrategPc.setEnabled(true);\r\n\t\t\t\t\tspinnerPc.setEnabled(true);\r\n\t\t\t\t\tspinnerStrategAllC.setEnabled(true);\r\n\t\t\t\t\tSpinnerStrategAllD.setEnabled(true);\r\n\t\t\t\t\tspinnerStrategkD.setEnabled(true);\r\n\t\t\t\t\tspinnerKMAxx.setEnabled(true);\r\n\t\t\t\t\trbtnkConst.setEnabled(true);\r\n\t\t\t\t\tspinnerMutStrateg.setEnabled(true);\r\n\t\t\t\t\tspinnerMutPc.setEnabled(true);\r\n\t\t\t\t\tspinnerMutC1.setEnabled(true);\r\n\t\t\t\t\tLApanel.setEnabled(true);\r\n\t\t\t\t\tspinnerHistoria.setEnabled(true);\r\n\t\t\t\t\tspinnerEpsilon.setEnabled(true);\r\n\t\t\t\t\tspinnerMutationHistoria.setEnabled(true);\r\n\t\t\t\t\tspinnerMutationc2.setEnabled(true);\r\n\t\t\t\t\tSpinnerMutationEpsilon.setEnabled(true);\r\n\t\t\t\t\tspinnerMutationc3.setEnabled(true);\r\n\t\t\t\t\trdbtnLa1.setEnabled(true);\r\n\t\t\t\t\trdbtnLa2.setEnabled(true);\r\n\t\t\t\t\trdbtnLa3.setEnabled(true);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tSpinnerpTypAgCA.setEnabled(false);\r\n\t\t\t\t\tLApanel.setEnabled(false);\r\n\t\t\t\t\tCAPanel.setEnabled(false);\r\n\t\t\t\t\tspinnerStrategPc.setEnabled(false);\r\n\t\t\t\t\tspinnerPc.setEnabled(false);\r\n\t\t\t\t\tspinnerStrategAllC.setEnabled(false);\r\n\t\t\t\t\tSpinnerStrategAllD.setEnabled(false);\r\n\t\t\t\t\tspinnerStrategkD.setEnabled(false);\r\n\t\t\t\t\tspinnerKMAxx.setEnabled(false);\r\n\t\t\t\t\trbtnkConst.setEnabled(false);\r\n\t\t\t\t\tspinnerMutStrateg.setEnabled(false);\r\n\t\t\t\t\tspinnerMutPc.setEnabled(false);\r\n\t\t\t\t\tspinnerMutC1.setEnabled(false);\r\n\t\t\t\t\tspinnerHistoria.setEnabled(false);\r\n\t\t\t\t\tspinnerEpsilon.setEnabled(false);\r\n\t\t\t\t\tspinnerMutationHistoria.setEnabled(false);\r\n\t\t\t\t\tspinnerMutationc2.setEnabled(false);\r\n\t\t\t\t\tSpinnerMutationEpsilon.setEnabled(false);\r\n\t\t\t\t\tspinnerMutationc3.setEnabled(false);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t\t\r\n\t\tSpinnerpTypAgCA = new JSpinner();\r\n\t\tSpinnerpTypAgCA.setModel(new SpinnerNumberModel(0.5,0,1,0.01));\r\n\t\t\r\n\t\tJLabel lblTypAgentaCa = new JLabel(\"typ Agenta CA:\");\r\n\t\t\r\n\t\trdbtnLa1 = new JRadioButton(\"LA1\");\r\n\t\trdbtnLa1.setEnabled(false);\r\n\t\trdbtnLa1.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t}\r\n\t\t});\r\n\t\tbuttonGroup_1.add(rdbtnLa1);\r\n\t\t\r\n\t\trdbtnLa2 = new JRadioButton(\"LA2\");\r\n\t\trdbtnLa2.setEnabled(false);\r\n\t\trdbtnLa2.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t}\r\n\t\t});\r\n\t\tbuttonGroup_1.add(rdbtnLa2);\r\n\t\t\r\n\t\trdbtnLa3 = new JRadioButton(\"LA3\");\r\n\t\trdbtnLa3.setEnabled(false);\r\n\t\trdbtnLa3.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t}\r\n\t\t});\r\n\t\trdbtnLa3.setSelected(true);\r\n\t\tbuttonGroup_1.add(rdbtnLa3);\r\n\t\tGroupLayout gl_panel_2 = new GroupLayout(panel_2);\r\n\t\tgl_panel_2.setHorizontalGroup(\r\n\t\t\tgl_panel_2.createParallelGroup(Alignment.TRAILING)\r\n\t\t\t\t.addGroup(Alignment.LEADING, gl_panel_2.createSequentialGroup()\r\n\t\t\t\t\t.addContainerGap()\r\n\t\t\t\t\t.addGroup(gl_panel_2.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t\t\t.addComponent(rdbtnKomrkiLaiCA)\r\n\t\t\t\t\t\t.addComponent(rdbtnTylkoKomrkiCa)\r\n\t\t\t\t\t\t.addComponent(rdbtnTylkoKomrkiLa)\r\n\t\t\t\t\t\t.addGroup(gl_panel_2.createSequentialGroup()\r\n\t\t\t\t\t\t\t.addComponent(lblTypAgentaCa)\r\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t\t\t.addComponent(SpinnerpTypAgCA, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE))\r\n\t\t\t\t\t\t.addGroup(gl_panel_2.createSequentialGroup()\r\n\t\t\t\t\t\t\t.addGap(10)\r\n\t\t\t\t\t\t\t.addComponent(rdbtnLa1)\r\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t\t\t.addComponent(rdbtnLa2)\r\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t\t\t.addComponent(rdbtnLa3)))\r\n\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\r\n\t\t);\r\n\t\tgl_panel_2.setVerticalGroup(\r\n\t\t\tgl_panel_2.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t.addGroup(gl_panel_2.createSequentialGroup()\r\n\t\t\t\t\t.addContainerGap()\r\n\t\t\t\t\t.addComponent(rdbtnTylkoKomrkiCa)\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t.addComponent(rdbtnTylkoKomrkiLa)\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.UNRELATED)\r\n\t\t\t\t\t.addGroup(gl_panel_2.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(rdbtnLa1)\r\n\t\t\t\t\t\t.addComponent(rdbtnLa2)\r\n\t\t\t\t\t\t.addComponent(rdbtnLa3))\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.UNRELATED)\r\n\t\t\t\t\t.addComponent(rdbtnKomrkiLaiCA)\r\n\t\t\t\t\t.addGap(4)\r\n\t\t\t\t\t.addGroup(gl_panel_2.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(lblTypAgentaCa)\r\n\t\t\t\t\t\t.addComponent(SpinnerpTypAgCA, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\r\n\t\t\t\t\t.addContainerGap())\r\n\t\t);\r\n\t\tpanel_2.setLayout(gl_panel_2);\r\n\t\t\r\n\t\tJLabel lblLiczbaWierszy = new JLabel(\"liczba wierszy:\");\r\n\t\t\r\n\t\tspinnerLiczbaWireszy = new JSpinner();\r\n\t\tspinnerLiczbaWireszy.addChangeListener(new ChangeListener() {\r\n\t\t\tpublic void stateChanged(ChangeEvent arg0) {\r\n\t\t\t\tif (((Integer)spinnerLiczbaWireszy.getValue())==0 || ((Integer)spinnerLiczbaKolumn.getValue())==0)\r\n\t\t\t\t{\r\n\t\t\t\t\tspinnerRSasiedztwa.setEnabled(true);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\tspinnerRSasiedztwa.setEnabled(false);\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\tspinnerLiczbaWireszy.setModel(new SpinnerNumberModel(50, 0, 1000, 1));\r\n\t\t\r\n\t\tspinnerLiczbaKolumn = new JSpinner();\r\n\t\tspinnerLiczbaKolumn.addChangeListener(new ChangeListener() {\r\n\t\t\tpublic void stateChanged(ChangeEvent e) {\r\n\t\t\t\tif (((Integer)spinnerLiczbaKolumn.getValue())==0 || ((Integer)spinnerLiczbaWireszy.getValue())==0 )\r\n\t\t\t\t{\r\n\t\t\t\t\tspinnerRSasiedztwa.setEnabled(true);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\tspinnerRSasiedztwa.setEnabled(false);\r\n\t\t\t}\r\n\t\t});\r\n\t\tspinnerLiczbaKolumn.setModel(new SpinnerNumberModel(50, 0, 1000, 1));\r\n\t\t\r\n\t\tJLabel lblLiczbaKolumn = new JLabel(\"liczba kolumn:\");\r\n\t\t\r\n\t\tJLabel lblRozmiarSsiedztwa = new JLabel(\"r s\\u0105siedztwa:\");\r\n\t\t\r\n\t\tspinnerRSasiedztwa = new JSpinner();\r\n\t\tspinnerRSasiedztwa.setEnabled(false);\r\n\t\tspinnerRSasiedztwa.addChangeListener(new ChangeListener() {\r\n\t\t\tpublic void stateChanged(ChangeEvent e) {\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\tspinnerRSasiedztwa.setModel(new SpinnerNumberModel(new Integer(1), new Integer(1), null, new Integer(1)));\r\n\t\t\r\n\t\tspinnerp_niezam = new JSpinner();\r\n\t\tspinnerp_niezam.setModel(new SpinnerNumberModel(0, 0, 1, 0.01));\r\n\t\t\r\n\t\tJLabel lblPniezam = new JLabel(\"p_niezam:\");\r\n\t\t\r\n\t\tJLabel lblPinitc = new JLabel(\"p_init_C:\");\r\n\t\t\r\n\t\tspinnerp_init_C = new JSpinner();\r\n\t\tspinnerp_init_C.setModel(new SpinnerNumberModel(0.5,0,1,0.01));\r\n\t\t\r\n\t\tspinnergot_wspol_doch = new JSpinner();\r\n\t\tspinnergot_wspol_doch.setModel(new SpinnerNumberModel(0.1,0,1,0.01));\r\n\t\tspinnergot_wspol_doch.setEnabled(false);\r\n\t\t\r\n\t\trdbtnGotWspDoch = new JRadioButton(\"got. wspol. doch.\");\r\n\t\trdbtnGotWspDoch.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tif (rdbtnGotWspDoch.isSelected())\r\n\t\t\t\t\tspinnergot_wspol_doch.setEnabled(true);\r\n\t\t\t\telse\r\n\t\t\t\t\tspinnergot_wspol_doch.setEnabled(false);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tspinnerQ = new JSpinner();\r\n\t\tspinnerQ.setModel(new SpinnerNumberModel(new Integer(1), new Integer(1), null, new Integer(1)));\r\n\t\t\r\n\t\trdbtnZiarno = new JRadioButton(\"ziarno\");\r\n\t\trdbtnZiarno.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tif (rdbtnZiarno.isSelected())\r\n\t\t\t\t{\r\n\t\t\t\t\tspinnerZiarno.setEnabled(true);\r\n\t\t\t\t}\r\n\t\t\t\telse \r\n\t\t\t\t{\r\n\t\t\t\t\tspinnerZiarno.setEnabled(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tspinnerZiarno = new JSpinner();\r\n\t\tspinnerZiarno.setEnabled(false);\r\n\t\t\r\n\t\tspinnerIloscExperymentow = new JSpinner();\r\n\t\tspinnerIloscExperymentow.setModel(new SpinnerNumberModel(1, 1, 999, 1));\r\n\t\t\r\n\t\tJLabel lblIloEksperymentw = new JLabel(\"ilo\\u015B\\u0107 eksperyment\\u00F3w:\");\r\n\t\t\r\n\t\tspinnerIloscKrokow = new JSpinner();\r\n\t\tspinnerIloscKrokow.setModel(new SpinnerNumberModel(100, 1, 1000, 1));\r\n\t\t\r\n\t\tJLabel lblDlugoscRundy = new JLabel(\"ilosc krokow:\");\r\n\t\t\r\n\t\trdbtnQ = new JRadioButton(\"q\");\r\n\t\trdbtnQ.setSelected(true);\r\n\t\trdbtnQ.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tif (rdbtnQ.isSelected())\r\n\t\t\t\t{\r\n\t\t\t\t\tspinnerQ.setEnabled(true);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\tspinnerQ.setEnabled(false);\r\n\t\t\t}\r\n\t\t});\r\n\t\tGroupLayout gl_panel_1 = new GroupLayout(panel_1);\r\n\t\tgl_panel_1.setHorizontalGroup(\r\n\t\t\tgl_panel_1.createParallelGroup(Alignment.TRAILING)\r\n\t\t\t\t.addGroup(gl_panel_1.createSequentialGroup()\r\n\t\t\t\t\t.addContainerGap()\r\n\t\t\t\t\t.addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t\t\t.addGroup(gl_panel_1.createSequentialGroup()\r\n\t\t\t\t\t\t\t.addComponent(lblLiczbaWierszy)\r\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.UNRELATED)\r\n\t\t\t\t\t\t\t.addComponent(spinnerLiczbaWireszy, GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE))\r\n\t\t\t\t\t\t.addGroup(gl_panel_1.createSequentialGroup()\r\n\t\t\t\t\t\t\t.addGroup(gl_panel_1.createParallelGroup(Alignment.TRAILING)\r\n\t\t\t\t\t\t\t\t.addComponent(lblPinitc)\r\n\t\t\t\t\t\t\t\t.addComponent(lblPniezam, GroupLayout.PREFERRED_SIZE, 61, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t\t\t.addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t\t\t\t\t\t.addComponent(lblLiczbaKolumn, GroupLayout.PREFERRED_SIZE, 84, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t\t\t\t.addGroup(gl_panel_1.createSequentialGroup()\r\n\t\t\t\t\t\t\t\t\t\t.addGap(7)\r\n\t\t\t\t\t\t\t\t\t\t.addComponent(lblRozmiarSsiedztwa)))\r\n\t\t\t\t\t\t\t\t.addComponent(rdbtnQ))\r\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.UNRELATED)\r\n\t\t\t\t\t\t\t.addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t\t\t\t\t.addComponent(spinnerp_init_C, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)\r\n\t\t\t\t\t\t\t\t.addComponent(spinnerp_niezam, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)\r\n\t\t\t\t\t\t\t\t.addComponent(spinnerLiczbaKolumn, GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)\r\n\t\t\t\t\t\t\t\t.addComponent(spinnerQ, GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)\r\n\t\t\t\t\t\t\t\t.addComponent(spinnerRSasiedztwa, GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)))\r\n\t\t\t\t\t\t.addGroup(gl_panel_1.createSequentialGroup()\r\n\t\t\t\t\t\t\t.addGroup(gl_panel_1.createParallelGroup(Alignment.TRAILING)\r\n\t\t\t\t\t\t\t\t.addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t\t\t\t\t\t.addComponent(rdbtnGotWspDoch)\r\n\t\t\t\t\t\t\t\t\t.addComponent(rdbtnZiarno))\r\n\t\t\t\t\t\t\t\t.addComponent(lblIloEksperymentw)\r\n\t\t\t\t\t\t\t\t.addComponent(lblDlugoscRundy))\r\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t\t\t.addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t\t\t\t\t.addComponent(spinnerZiarno, GroupLayout.DEFAULT_SIZE, 64, Short.MAX_VALUE)\r\n\t\t\t\t\t\t\t\t.addComponent(spinnergot_wspol_doch, GroupLayout.DEFAULT_SIZE, 64, Short.MAX_VALUE)\r\n\t\t\t\t\t\t\t\t.addComponent(spinnerIloscExperymentow, GroupLayout.DEFAULT_SIZE, 64, Short.MAX_VALUE)\r\n\t\t\t\t\t\t\t\t.addComponent(spinnerIloscKrokow, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE))))\r\n\t\t\t\t\t.addGap(40))\r\n\t\t);\r\n\t\tgl_panel_1.setVerticalGroup(\r\n\t\t\tgl_panel_1.createParallelGroup(Alignment.LEADING)\r\n\t\t\t\t.addGroup(gl_panel_1.createSequentialGroup()\r\n\t\t\t\t\t.addGap(16)\r\n\t\t\t\t\t.addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(lblLiczbaWierszy)\r\n\t\t\t\t\t\t.addComponent(spinnerLiczbaWireszy, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\r\n\t\t\t\t\t.addGap(4)\r\n\t\t\t\t\t.addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(spinnerLiczbaKolumn, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addComponent(lblLiczbaKolumn))\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t.addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(spinnerRSasiedztwa, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addComponent(lblRozmiarSsiedztwa))\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t.addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(spinnerQ, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addComponent(rdbtnQ))\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t.addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(spinnerp_niezam, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addComponent(lblPniezam))\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t.addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(spinnerp_init_C, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addComponent(lblPinitc))\r\n\t\t\t\t\t.addGap(10)\r\n\t\t\t\t\t.addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(spinnergot_wspol_doch, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addComponent(rdbtnGotWspDoch))\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t.addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(spinnerZiarno, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addComponent(rdbtnZiarno))\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t.addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(spinnerIloscExperymentow, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addComponent(lblIloEksperymentw))\r\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\r\n\t\t\t\t\t.addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)\r\n\t\t\t\t\t\t.addComponent(spinnerIloscKrokow, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\r\n\t\t\t\t\t\t.addComponent(lblDlugoscRundy))\r\n\t\t\t\t\t.addGap(4))\r\n\t\t);\r\n\t\tpanel_1.setLayout(gl_panel_1);\r\n\t\t\r\n\t\tframe.getContentPane().setLayout(groupLayout);\r\n\t}", "private void setGUI()\r\n\t{\r\n\t\tbubblePB = setProgressBar(bubblePB);\r\n\t\tinsertionPB = setProgressBar(insertionPB);\r\n\t\tmergePB = setProgressBar(mergePB);\r\n\t\tquickPB = setProgressBar(quickPB);\r\n\t\tradixPB = setProgressBar(radixPB);\r\n\t\t\r\n\t\tsetLabels();\r\n\t\tsetPanel();\r\n\t\tsetLabels();\r\n\t\tsetFrame();\r\n\t}", "public Connect4Final() { //building the GUI\r\n \r\n setTitle(\"Connect 4\"); //title\r\n setSize(1366, 700); //size of frame\r\n setResizable(false); //setting this to false because if resizeable, the board may become unproportional\r\n \r\n GridLayout layout2 = new GridLayout(7, 9); //layouts\r\n BoxLayout layout3 = new BoxLayout(welcome, BoxLayout.Y_AXIS);\r\n \r\n setLayout(new GridBagLayout()); //setting the Layout of the entire frame to a gridBagLayout\r\n board.setLayout(layout2); //setting layouts of the 2 panels\r\n welcome.setLayout(layout3);\r\n \r\n welcome.setBorder(BorderFactory.createEmptyBorder(20,20,20,20)); //setting border around the panel\r\n \r\n winCounter.setFont(small);\r\n welcome.add(winCounter);\r\n winCounter.setAlignmentX(Component.CENTER_ALIGNMENT);\r\n winCounter.add(Box.createRigidArea(new Dimension(0,75)));\r\n \r\n welcomelabel.setFont(f); //setting fonts\r\n welcome.add(welcomelabel);\r\n welcomelabel.setAlignmentX(Component.CENTER_ALIGNMENT); //adding the labels one by one and modifying them -- alignment, extra spacing, size etc.\r\n welcome.add(Box.createRigidArea(new Dimension(0,75)));\r\n \r\n instructions.setFont(f); //setting fonts\r\n welcome.add(instructions);\r\n instructions.setAlignmentX(Component.CENTER_ALIGNMENT);\r\n welcome.add(Box.createRigidArea(new Dimension(0,75))); //creates extra space after each label\r\n \r\n welcome.add(input); \r\n welcome.add(Box.createRigidArea(new Dimension(0,75)));\r\n input.setMaximumSize(new Dimension(200, 25)); //sets the maximum size of textfield\r\n \r\n welcome.add(okButton);\r\n welcome.add(Box.createRigidArea(new Dimension(0,75)));\r\n okButton.setAlignmentX(Component.CENTER_ALIGNMENT); //aligns all the components by their center on the x axis of the panel\r\n \r\n for(int i = 0; i<7; i++){\r\n columnarray[i] = new JButton(\" \"+Integer.toString(i+1)); //adding the column numbers as buttons to the board panel and formatting them preoperly\r\n columnarray[i].setHorizontalAlignment(SwingConstants.LEFT);\r\n columnarray[i].addActionListener(this);\r\n columnarray[i].setBackground(rgb); \r\n columnarray[i].setBorderPainted(false);\r\n board.add(columnarray[i]);\r\n }\r\n \r\n for(int i = 0; i<ROW; i++){\r\n for(int j = 0; j<COL; j++){\r\n arrayCircles[i][j] = new DrawCircle(); //adding the circles to the board panel\r\n board.add(arrayCircles[i][j]);\r\n }\r\n }\r\n \r\n okButton.addActionListener(this); //adding all the actionlisteners\r\n pvp.addActionListener(this);\r\n pvai.addActionListener(this);\r\n black.addActionListener(this);\r\n red.addActionListener(this);\r\n yellow.addActionListener(this);\r\n green.addActionListener(this);\r\n okayButton.addActionListener(this);\r\n easyAI.addActionListener(this);\r\n hardAI.addActionListener(this);\r\n again.addActionListener(this);\r\n notAgain.addActionListener(this);\r\n \r\n add(welcome, makeConstraints(0,0,3,20)); //adding the panels to the frame with specified parameters on where they go\r\n add(board, makeConstraints(3,0,10,20));\r\n \r\n welcome.setPreferredSize(new Dimension(3, 30)); //setting the preferred size of the welcome panel\r\n \r\n board.setBackground(rgb); //setting the background of the board to be a specific customizable colour\r\n \r\n setVisible(true); //setting the frame to be visible\r\n }", "@Override\n public final void initGui() {\n \tKeyboard.enableRepeatEvents(true);\n\t\t\n \tif(components == null) {\n \t\tcomponents = Lists.newArrayList();\n \t\t\n \t\ttry {\n \t\t\tbuildGui();\n \t\t} catch(Throwable e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t}\n \t\n \t// XXX: Untested. Might lead to crash. Leaving it in for now.\n \tif(this.behindScreen != null) {\n \t\tthis.behindScreen.width = this.width;\n \t\tthis.behindScreen.height = this.height;\n \t\tthis.behindScreen.initGui();\n \t}\n \t\n \tlayoutGui();\n }", "private void $$$setupUI$$$() {\n rootPanel = new JPanel();\n rootPanel.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(11, 3, new Insets(0, 0, 0, 0), -1, -1));\n bKillSession = new JButton();\n bKillSession.setText(\"Убить сессии\");\n rootPanel.add(bKillSession, new com.intellij.uiDesigner.core.GridConstraints(0, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n bGetAll = new JButton();\n bGetAll.setText(\"Получить график\");\n rootPanel.add(bGetAll, new com.intellij.uiDesigner.core.GridConstraints(1, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n bStartBS = new JButton();\n bStartBS.setText(\"Старт БС\");\n rootPanel.add(bStartBS, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n bSetFreq = new JButton();\n bSetFreq.setText(\"Установить частоту\");\n rootPanel.add(bSetFreq, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n tfFreq = new JTextField();\n rootPanel.add(tfFreq, new com.intellij.uiDesigner.core.GridConstraints(2, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n cbDefaultBS = new JCheckBox();\n cbDefaultBS.setSelected(true);\n cbDefaultBS.setText(\"Использовать БС из конфига\");\n rootPanel.add(cbDefaultBS, new com.intellij.uiDesigner.core.GridConstraints(4, 0, 1, 3, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer1 = new com.intellij.uiDesigner.core.Spacer();\n rootPanel.add(spacer1, new com.intellij.uiDesigner.core.GridConstraints(7, 2, 4, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n cbListMethods = new JComboBox();\n rootPanel.add(cbListMethods, new com.intellij.uiDesigner.core.GridConstraints(5, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label1 = new JLabel();\n label1.setText(\"Запускаемый метод:\");\n rootPanel.add(label1, new com.intellij.uiDesigner.core.GridConstraints(5, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer2 = new com.intellij.uiDesigner.core.Spacer();\n rootPanel.add(spacer2, new com.intellij.uiDesigner.core.GridConstraints(7, 0, 4, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n lblParams = new JLabel();\n lblParams.setText(\"Label\");\n rootPanel.add(lblParams, new com.intellij.uiDesigner.core.GridConstraints(6, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JPanel panel1 = new JPanel();\n panel1.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));\n rootPanel.add(panel1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n bPause = new JButton();\n bPause.setText(\"Пауза\");\n panel1.add(bPause, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n bStart = new JButton();\n bStart.setText(\"Старт\");\n panel1.add(bStart, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JSeparator separator1 = new JSeparator();\n rootPanel.add(separator1, new com.intellij.uiDesigner.core.GridConstraints(3, 0, 1, 3, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n }", "protected void initializeGUI() {\n\n\t}", "public window() {\n initComponents();\n letras();\n ArduinoConnection();\n }", "private static void createAndShowGUI() {\n\t\t\t\t// GUIView Moves\n\t\t\t\tGUIViewMoves guiViewMoves = new GUIViewMoves();\n\t\t\t\t\n\t\t\t\t// GUIView Jugs, center the jugs\n\t\t\t\tGUIViewJugs guiViewJug0 = new GUIViewJugs(0);\n\t\t\t\tguiViewJug0.setHorizontalAlignment(JLabel.CENTER);\n\t\t\t\tguiViewJug0.setVerticalAlignment(JLabel.CENTER);; \n\t\t\t \n\t\t\t\tGUIViewJugs guiViewJug1 = new GUIViewJugs(1); \n\t\t\t\tguiViewJug1.setHorizontalAlignment(JLabel.CENTER);\n\t\t\t\tguiViewJug1.setVerticalAlignment(JLabel.CENTER);\n\t\t\t \n\t\t\t\tGUIViewJugs guiViewJug2 = new GUIViewJugs(2); \n\t\t\t\tguiViewJug2.setHorizontalAlignment(JLabel.CENTER);\n\t\t\t\tguiViewJug2.setVerticalAlignment(JLabel.CENTER);\n\t\t\t\n\t\t\t\t// Model\n\t\t\t\tJugPuzzle model = new JugPuzzle();\n\n\t\t\t\t// Hook the model to the view.\n\t\t\t\tmodel.addObserver(guiViewMoves);\n\t\t\t\tmodel.addObserver(guiViewJug0);\n\t\t\t\tmodel.addObserver(guiViewJug1);\n\t\t\t\tmodel.addObserver(guiViewJug2);\n\t\t\t\t\n\t\t\t\t// Create frame.\n\t\t\t\tJFrame frame = new JFrame(\"Jug Game!\");\n\t\t\n\t\t\t\t// Close option.\n\t\t\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\t\t\n\t\t\t\t// Create two panels, one for the moves and the other for the buttons.\n\t\t\t\t// Labels and buttons go on the grid panel and the moves and restart/quit buttons go on the other panel.\n\t\t\t\tJPanel movesAndButtons = new JPanel();\n\t\t\t\tJPanel grid = new JPanel();\n\t\t\t\t\n\t\t\t\t// A container.\n\t\t\t\tContainer c = frame.getContentPane();\n\t\t\t\t\n\t\t\t\t// Layout for the grid.\n\t\t\t\tGridLayout topGrid = new GridLayout(2,3);\n\t\t\t\tgrid.setLayout(topGrid);\n\t\t\t\t\n\t\t\t\t// Layout for the buttons and moves.\n\t\t\t\tmovesAndButtons.setLayout(new BoxLayout(movesAndButtons, FlowLayout.CENTER));\n\n\t\t\t\t// Panels for buttons and moves.\n\t\t\t\tJPanel movesPanel = new JPanel(); // Moves panel, GUI View.\n\t\t\t\tJPanel quitRestartPanel = new JPanel(); // Quit and Restart panel.\n\t\n\t\t\t\t// Add panels to the layout.\n\t\t\t\tmovesAndButtons.add(movesPanel, BorderLayout.SOUTH);\n\t\t\t\tmovesAndButtons.add(quitRestartPanel, BorderLayout.NORTH);\n\t\t\t\tJButton restart, quit, eight, five, three;\n\t\t\t\n\t\t\t // Initialize buttons,\n\t\t\t\teight = new JButton(\"8\");\n\t\t\t five = new JButton(\"5\");\n\t\t\t three = new JButton(\"3\");\n\t\t\t restart = new JButton(\"Restart\");\n\t\t\t quit = new JButton(\"Quit\");\n\t\t\t \n\t\t\t // Add to grid.\n\t\t\t grid.add(guiViewJug0);\n\t\t\t grid.add(guiViewJug1);\n\t\t\t grid.add(guiViewJug2);\n\t\t\t grid.add(eight);\n\t\t\t grid.add(five);\n\t\t\t grid.add(three);\n\t\t\t\t\n\t\t\t\t// Add to the panels.\n\t\t\t movesPanel.add(guiViewMoves);\n\t\t\t\tquitRestartPanel.add(restart);\n\t\t\t\tquitRestartPanel.add(quit);\n\t\t\t\t\n\t\t\t\t// Add the container which adds to the frame.\n\t\t\t\tc.add(grid, BorderLayout.NORTH);\n\t\t\t\tc.add(movesAndButtons, BorderLayout.SOUTH);\n\t\t\t\t\n\t\t\t\t// ActionListeners \n\t\t\t\tJugPuzzleActionListener e = new JugPuzzleActionListener(model);\n\t\t\t\tQuitActionListener end = new QuitActionListener();\n\t\t\t\tRestartActionListener fresh = new RestartActionListener();\n\t\t\t\t\n\t\t\t\teight.addActionListener(e);\n\t\t\t\teight.setActionCommand(\"0\");\n\t\t\t\t\n\t\t\t\tfive.addActionListener(e);\n\t\t\t\tfive.setActionCommand(\"1\");\n\t\t\t\t\n\t\t\t\tthree.addActionListener(e);\n\t\t\t\tthree.setActionCommand(\"2\");\n\t\t\t\t\n\t\t\t\trestart.addActionListener(fresh);\n\t\t\t\tquit.addActionListener(end);\n\t\t\t\t\n\t\t\t\t// Pack and see frame\n\t\t\t\tframe.pack();\n\t\t\t\tframe.setSize(480, 150);\n\t\t\t\tframe.setResizable(false);\n\t\t\t\tframe.setVisible(true);\t\n\t\t\t}", "public void initGameboardPanel(){\n Image image = Toolkit.getDefaultToolkit().createImage(getClass().getResource(\"/board/Masters of Renaissance_PlayerBoard (11_2020)-1.png\"));\n this.backgroundImage = image.getScaledInstance(gameboardWidth,gameboardHeight,0);\n\n this.setSize(gameboardWidth,gameboardHeight);\n this.setBounds(0,0,gameboardWidth,gameboardHeight);\n this.setLayout(null);\n //this.addMouseListener(this);\n this.setVisible(true);\n }", "public NetChessBoardFrame() {\r\n\t\tthis.setTitle(\"五子棋\");// 设置标题\r\n\t\tthis.setSize(750, 635);// 设置窗体大小\r\n\t\tthis.setLocation((width - 750) / 2, (height - 650) / 2);// 窗体居中显示\r\n\t\tthis.setResizable(false); // 窗体大小不可变\r\n\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);// 窗体关闭方式\r\n\t\tthis.setCursor(Cursor.HAND_CURSOR);// 手状光标类型\r\n\t\t// this.setVisible(true);// 窗体可见\r\n\t\tthis.getLayeredPane().setLayout(null);\r\n\t\tthis.setIconImage(ttImage);\r\n\r\n\t\tMyMouseListener mml = new MyMouseListener();\r\n\t\tcb = new ChessBoard();\r\n\t\tcontrol = new BoardControl();\r\n\t\tcontrol.setPreferredSize(new Dimension(135, 635));\r\n\t\tthis.getContentPane().add(control, BorderLayout.EAST);\r\n\t\tcontrol.setVisible(true);\r\n\t\tcb.addMouseListener(mml);\r\n\t}", "private void buildGui() {\n nifty = screen.getNifty();\n nifty.setIgnoreKeyboardEvents(true);\n nifty.loadStyleFile(\"nifty-default-styles.xml\");\n nifty.loadControlFile(\"nifty-default-controls.xml\");\n nifty.addScreen(\"Option_Screen\", new ScreenBuilder(\"Options_Screen\") {\n {\n controller((ScreenController) app);\n layer(new LayerBuilder(\"background\") {\n {\n childLayoutCenter();;\n font(\"Interface/Fonts/zombie.fnt\");\n backgroundImage(\"Backgrounds/ZOMBIE1.jpg\");\n visibleToMouse(true);\n }\n });\n layer(new LayerBuilder(\"foreground\") {\n {\n childLayoutOverlay();\n font(\"Interface/Fonts/zombie.fnt\");\n\n panel(new PanelBuilder(\"Switch_Options\") {\n {\n childLayoutVertical();\n control(new ButtonBuilder(\"\", \"Display Settings\") {\n {\n marginTop(\"42%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n interactOnClick(\"goTo(Display_Settings)\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n /*control(new ButtonBuilder(\"\", \"Graphics Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Graphics_Extension)\");\n }\n });*/\n control(new ButtonBuilder(\"\", \"Sound Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Sound_Settings)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Leaderboard\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Leader_Board)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Logout\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Login_Screen)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Quit Game\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"quitGame()\");\n }\n });\n }\n });\n }\n });\n }\n }.build(nifty));\n nifty.addScreen(\"Graphics_Settings\", new ScreenBuilder(\"Graphics_Extension\") {\n {\n controller(settingsControl);\n layer(new LayerBuilder(\"background\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutCenter();\n backgroundImage(\"Backgrounds/ZOMBIE1.jpg\");\n visibleToMouse(true);\n }\n });\n layer(new LayerBuilder(\"foreground\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutOverlay();\n panel(new PanelBuilder(\"Settings\") {\n {\n childLayoutVertical();\n control(new ButtonBuilder(\"\", \"Display Settings\") {\n {\n marginTop(\"42%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Display_Settings)\");\n }\n });\n /*control(new ButtonBuilder(\"\", \"Graphics Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });*/\n control(new ButtonBuilder(\"\", \"Sound Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Sound_Settings)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Leaderboard\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Leader_Board)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Logout\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Login_Screen)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Quit Game\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"quitGame()\");\n }\n });\n }\n });\n }\n });\n layer(new LayerBuilder(\"Settings\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutVertical();\n panel(new PanelBuilder(\"Post_Water_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"15%\");\n control(new LabelBuilder(\"\", \"Post Water\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Post_Water_Button\") {\n {\n marginLeft(\"110%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Water_Reflections_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Water Reflections\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Water_Reflections_Button\") {\n {\n marginLeft(\"45%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Water_Ripples_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Water Ripples\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Water_Ripples_Button\") {\n {\n marginLeft(\"75%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Water_Specular_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Water Specular\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Water_Specular_Button\") {\n {\n marginLeft(\"59%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Water_Foam_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Water Foam\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Water_Foam_Button\") {\n {\n marginLeft(\"93%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Sky_Dome_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Sky Dome\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Sky_Dome_Button\") {\n {\n marginLeft(\"128%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Star_Motion_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Star Motion\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Star_Motion_Button\") {\n {\n marginLeft(\"106%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Cloud_Motion_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Cloud Motion\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Cloud_Motion_Button\") {\n {\n marginLeft(\"87%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Bloom_Light_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Bloom Lighting\") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new CheckboxBuilder(\"Bloom_Light_Button\") {\n {\n marginLeft(\"70%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Light_Scatter_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Light Scatter\") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new CheckboxBuilder(\"Light_Scatter_Button\") {\n {\n marginLeft(\"90%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Apply_Panel\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutHorizontal();\n marginLeft(\"43%\");\n marginTop(\"5%\");\n control(new ButtonBuilder(\"Apply_Button\", \"Apply Settings\") {\n {\n interactOnClick(\"applySettings()\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n }\n });\n }\n });\n }\n }.build(nifty));\n nifty.addScreen(\"Display_Screen\", new ScreenBuilder(\"Display_Settings\") {\n {\n controller(settingsControl);\n layer(new LayerBuilder(\"background\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutCenter();;\n backgroundImage(\"Backgrounds/ZOMBIE1.jpg\");\n visibleToMouse(true);\n }\n });\n layer(new LayerBuilder(\"foreground\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutOverlay();\n panel(new PanelBuilder(\"Settings\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutVertical();\n control(new ButtonBuilder(\"\", \"Display Settings\") {\n {\n marginTop(\"42%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n /*control(new ButtonBuilder(\"\", \"Graphics Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Graphics_Extension)\");\n }\n });*/\n control(new ButtonBuilder(\"\", \"Sound Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Sound_Settings)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Leaderboard\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Leader_Board)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Logout\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Login_Screen)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Quit Game\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"quitGame()\");\n }\n });\n }\n });\n }\n });\n layer(new LayerBuilder(\"Settings\") {\n {\n childLayoutVertical();\n panel(new PanelBuilder(\"Resolution_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"15%\");\n control(new LabelBuilder(\"\", \"Set Resolution\") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new ListBoxBuilder(\"Resolution_Opts\") {\n {\n marginLeft(\"4%\");\n marginBottom(\"10%\");\n displayItems(1);\n showVerticalScrollbar();\n hideHorizontalScrollbar();\n selectionModeSingle();\n width(\"10%\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Apply_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"45%\");\n marginTop(\"5%\");\n control(new ButtonBuilder(\"Apply_Button\", \"Apply Settings\") {\n {\n interactOnClick(\"displayApply()\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n }\n });\n }\n });\n }\n }.build(nifty));\n nifty.addScreen(\"Sound Settings\", new ScreenBuilder(\"#Sound_Settings\") {\n {\n controller(settingsControl);\n layer(new LayerBuilder(\"background\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutCenter();;\n backgroundImage(\"Backgrounds/ZOMBIE1.jpg\");\n visibleToMouse(true);\n }\n });\n layer(new LayerBuilder(\"foreground\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutOverlay();\n panel(new PanelBuilder(\"Settings\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutVertical();\n control(new ButtonBuilder(\"\", \"Display Settings\") {\n {\n marginTop(\"42%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(ElementBuilder.Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Display_Settings)\");\n }\n });\n /*control(new ButtonBuilder(\"\", \"Graphics Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(ElementBuilder.Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Graphics_Extension)\");\n }\n });*/\n control(new ButtonBuilder(\"\", \"Sound Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(ElementBuilder.Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new ButtonBuilder(\"\", \"Leaderboard\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(ElementBuilder.Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Leader_Board)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Logout\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Login_Screen)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Quit Game\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(ElementBuilder.Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"quitGame()\");\n }\n });\n }\n });\n }\n });\n layer(new LayerBuilder(\"Settings\") {\n {\n childLayoutVertical();\n panel(new PanelBuilder(\"#Master_Volume_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"30%\");\n marginTop(\"35%\");\n control(new LabelBuilder(\"\", \"Master Volume : \") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new SliderBuilder(\"#Master_Volume\", false) {\n {\n marginLeft(\"20px\");\n min(0);\n max(100);\n width(\"25%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"#Ambient_Volume_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"30%\");\n marginTop(\"8%\");\n control(new LabelBuilder(\"\", \"Ambient Volume : \") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new SliderBuilder(\"#Ambient_Volume\", false) {\n {\n marginLeft(\"20px\");\n min(0);\n max(100);\n width(\"25%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"#Combat_Volume_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"30%\");\n marginTop(\"8%\");\n control(new LabelBuilder(\"\", \"Combat Volume : \") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new SliderBuilder(\"#Combat_Volume\", false) {\n {\n marginLeft(\"20px\");\n min(0);\n max(100);\n width(\"25%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"#Dialog_Volume_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"30%\");\n marginTop(\"8%\");\n control(new LabelBuilder(\"\", \"Dialog Volume : \") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new SliderBuilder(\"#Dialog_Volume\", false) {\n {\n marginLeft(\"20px\");\n min(0);\n max(100);\n width(\"25%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"#Footsteps_Volume_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"30%\");\n marginTop(\"8%\");\n control(new LabelBuilder(\"\", \"Footsteps Volume : \") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new SliderBuilder(\"#Footsteps_Volume\", false) {\n {\n marginLeft(\"20px\");\n min(0);\n max(100);\n width(\"25%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Apply_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"45%\");\n marginTop(\"5%\");\n control(new ButtonBuilder(\"#Apply_Button\", \"Apply Settings\") {\n {\n interactOnClick(\"soundApply()\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n }\n });\n }\n });\n\n }\n }.build(nifty));\n }", "public void init(){\n\t\tsetBackground(Color.green);\n\t\tmsg = \"Let's Play\";\n//\t\tmsg1 = \"Your Frinds Choice\";\n\t\tSystem.out.println(cpu);\n\t\tb1 = new Button(\"Stone\");\n\t\tb2 = new Button(\"Paper\");\n\t\tb3 = new Button(\"Seaser\");\n\t\tb1.addActionListener(this);\n\t\tb2.addActionListener(this);\n\t\tb3.addActionListener(this);\n\t\tadd(b1);\n\t\tadd(b2);\n\t\tadd(b3);\n\t}", "private void initUI() {\n\t\tthis.horizontalLayout = new XdevHorizontalLayout();\n\t\tthis.gridLayout = new XdevGridLayout();\n\t\tthis.button = new XdevButton();\n\t\tthis.button2 = new XdevButton();\n\t\tthis.label = new XdevLabel();\n\n\t\tthis.button.setCaption(\"go to HashdemoView\");\n\t\tthis.button2.setCaption(\"go to CommonView\");\n\t\tthis.label.setValue(\"Go into code tab to view comments\");\n\n\t\tthis.gridLayout.setColumns(2);\n\t\tthis.gridLayout.setRows(2);\n\t\tthis.button.setWidth(200, Unit.PIXELS);\n\t\tthis.button.setHeight(-1, Unit.PIXELS);\n\t\tthis.gridLayout.addComponent(this.button, 0, 0);\n\t\tthis.button2.setWidth(200, Unit.PIXELS);\n\t\tthis.button2.setHeight(-1, Unit.PIXELS);\n\t\tthis.gridLayout.addComponent(this.button2, 1, 0);\n\t\tthis.label.setWidth(100, Unit.PERCENTAGE);\n\t\tthis.label.setHeight(-1, Unit.PIXELS);\n\t\tthis.gridLayout.addComponent(this.label, 0, 1, 1, 1);\n\t\tthis.gridLayout.setComponentAlignment(this.label, Alignment.TOP_CENTER);\n\t\tthis.gridLayout.setSizeUndefined();\n\t\tthis.horizontalLayout.addComponent(this.gridLayout);\n\t\tthis.horizontalLayout.setComponentAlignment(this.gridLayout, Alignment.MIDDLE_CENTER);\n\t\tthis.horizontalLayout.setExpandRatio(this.gridLayout, 10.0F);\n\t\tthis.horizontalLayout.setSizeFull();\n\t\tthis.setContent(this.horizontalLayout);\n\t\tthis.setSizeFull();\n\n\t\tthis.button.addClickListener(event -> this.button_buttonClick(event));\n\t\tthis.button2.addClickListener(event -> this.button2_buttonClick(event));\n\t}", "private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.getContentPane().setBackground(Color.WHITE);\r\n\t\tframe.setBounds(100, 100, 713, 506);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\t\r\n\t\tJButton btnEstatistica = new JButton(\"Estatística\");\r\n\t\tbtnEstatistica.setBounds(422, 408, 151, 39);\r\n\t\tframe.getContentPane().add(btnEstatistica);\r\n\t\t\r\n\t\tJButton btnEmprestimo = new JButton(\"Emprestimo de Obras\");\r\n\t\tbtnEmprestimo.setBounds(292, 397, 151, 39);\r\n\t\tframe.getContentPane().add(btnEmprestimo);\r\n\t\t\r\n\t\tJPanel pnCadastro = new JPanel();\r\n\t\tpnCadastro.setBorder(new TitledBorder(null, \"Cadastrar\", TitledBorder.LEADING, TitledBorder.TOP, null, null));\r\n\t\tpnCadastro.setBounds(62, 233, 547, 134);\r\n\t\tframe.getContentPane().add(pnCadastro);\r\n\t\tpnCadastro.setLayout(null);\r\n\t\t\r\n\t\tJButton btnObra = new JButton(\"\");\r\n\t\tbtnObra.setBounds(110, 28, 117, 60);\r\n\t\tpnCadastro.add(btnObra);\r\n\t\tbtnObra.setIcon(new ImageIcon(TelaPrincipal.class.getResource(\"/icon/img-paint.png\")));\r\n\t\t\r\n\t\tJLabel lblObras = new JLabel(\"Obras\");\r\n\t\tlblObras.setBounds(148, 100, 55, 16);\r\n\t\tpnCadastro.add(lblObras);\r\n\t\t\r\n\t\tJButton btnAutor = new JButton(\"\");\r\n\t\tbtnAutor.setBounds(272, 28, 117, 60);\r\n\t\tpnCadastro.add(btnAutor);\r\n\t\tbtnAutor.setIcon(new ImageIcon(TelaPrincipal.class.getResource(\"/icon/img-pen.png\")));\r\n\t\t\r\n\t\tJLabel lblAutores = new JLabel(\"Autores\");\r\n\t\tlblAutores.setBounds(306, 100, 55, 16);\r\n\t\tpnCadastro.add(lblAutores);\r\n\t\tbtnEstatistica.addActionListener(this);\r\n\t\t\r\n\t\t//\r\n\r\n\t\t\r\n\t\tJPanel pnVenda = new JPanel();\r\n\t\tpnVenda.setBorder(new TitledBorder(null, \"Venda\", TitledBorder.LEADING, TitledBorder.TOP, null, null));\r\n\t\tpnVenda.setBounds(62, 93, 547, 134);\r\n\t\tframe.getContentPane().add(pnVenda);\r\n\t\tpnVenda.setLayout(null);\r\n\t\t\r\n\t\tJButton btnVenda = new JButton(\"\");\r\n\t\tbtnVenda.setIcon(new ImageIcon(TelaPrincipal.class.getResource(\"/icon/img-ticket.png\")));\r\n\t\tbtnVenda.setBounds(110, 28, 117, 60);\r\n\t\tpnVenda.add(btnVenda);\r\n\t\t\r\n\t\tJLabel lblIngressos = new JLabel(\"Ingressos\");\r\n\t\tlblIngressos.setBounds(142, 100, 69, 16);\r\n\t\tpnVenda.add(lblIngressos);\r\n\t\t\r\n\t\tpnCadastro.setOpaque(false);\r\n\t\tpnVenda.setOpaque(false);\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tprotected void Initialize() {\n\t\tint grayBoxX = (this.width / 2) - 198;\n\t\tint grayBoxY = (this.height / 2) - 83;\n\t\tint color = Color.DARK_GRAY.getRGB();\n\t\tthis.serverConfiguration = Prefab.proxy.getServerConfiguration();\n\t\tthis.houseConfiguration = ClientEventHandler.playerConfig.getClientConfig(\"Starter House\", HouseConfiguration.class);\n\t\tthis.houseConfiguration.pos = this.pos;\n\n\t\t// Create the Controls.\n\t\t// Column 1:\n\t\tthis.btnHouseStyle = new ExtendedButton(grayBoxX + 10, grayBoxY + 20, 90, 20, this.houseConfiguration.houseStyle.getDisplayName(), this::actionPerformed);\n\n\t\tthis.addButton(this.btnHouseStyle);\n\n\t\tthis.btnVisualize = new ExtendedButton(grayBoxX + 10, grayBoxY + 60, 90, 20, GuiLangKeys.translateString(GuiLangKeys.GUI_BUTTON_PREVIEW), this::actionPerformed);\n\t\tthis.addButton(this.btnVisualize);\n\n\t\tint x = grayBoxX + 10;\n\t\tint y = grayBoxY + 10;\n\t\tint secondColumnY = y;\n\t\tint secondColumnX = x + 137;\n\n\t\tthis.btnAddFurnace = new GuiCheckBox(secondColumnX, secondColumnY, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_ADD_FURNACE), this.houseConfiguration.addFurnace, null);\n\t\tthis.btnAddFurnace.setFGColor(color);\n\t\tthis.btnAddFurnace.setWithShadow(false);\n\t\tthis.btnAddFurnace.visible = false;\n\t\tthis.addButton(this.btnAddFurnace);\n\n\t\tif (this.serverConfiguration.addFurnace) {\n\t\t\tsecondColumnY += 15;\n\t\t}\n\n\t\tthis.btnAddBed = new GuiCheckBox(secondColumnX, secondColumnY, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_ADD_BED), this.houseConfiguration.addBed, null);\n\t\tthis.btnAddBed.setFGColor(color);\n\t\tthis.btnAddBed.setWithShadow(false);\n\t\tthis.btnAddBed.visible = false;\n\t\tthis.addButton(this.btnAddBed);\n\n\t\tif (this.serverConfiguration.addBed) {\n\t\t\tsecondColumnY += 15;\n\t\t}\n\n\t\tthis.btnAddCraftingTable = new GuiCheckBox(x, y, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_ADD_CRAFTING_TABLE), this.houseConfiguration.addCraftingTable, null);\n\t\tthis.btnAddCraftingTable.setFGColor(color);\n\t\tthis.btnAddCraftingTable.setWithShadow(false);\n\t\tthis.btnAddCraftingTable.visible = false;\n\t\tthis.addButton(this.btnAddCraftingTable);\n\n\t\tif (this.serverConfiguration.addCraftingTable) {\n\t\t\ty += 15;\n\t\t}\n\n\t\tthis.btnAddTorches = new GuiCheckBox(x, y, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_ADD_TORCHES), this.houseConfiguration.addTorches, null);\n\t\tthis.btnAddTorches.setFGColor(color);\n\t\tthis.btnAddTorches.setWithShadow(false);\n\t\tthis.btnAddTorches.visible = false;\n\t\tthis.addButton(this.btnAddTorches);\n\n\t\tif (this.serverConfiguration.addTorches) {\n\t\t\ty += 15;\n\t\t}\n\n\t\tthis.btnAddChest = new GuiCheckBox(x, y, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_ADD_CHEST), this.houseConfiguration.addChest, null);\n\t\tthis.btnAddChest.setFGColor(color);\n\t\tthis.btnAddChest.setWithShadow(false);\n\t\tthis.btnAddChest.visible = false;\n\t\tthis.addButton(this.btnAddChest);\n\n\t\tif (this.serverConfiguration.addChests) {\n\t\t\ty += 15;\n\t\t}\n\n\t\tthis.btnAddMineShaft = new GuiCheckBox(x, y, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_BUILD_MINESHAFT), this.houseConfiguration.addMineShaft, null);\n\t\tthis.btnAddMineShaft.setFGColor(color);\n\t\tthis.btnAddMineShaft.setWithShadow(false);\n\t\tthis.btnAddMineShaft.visible = false;\n\t\tthis.addButton(this.btnAddMineShaft);\n\n\t\tif (this.serverConfiguration.addMineshaft) {\n\t\t\ty += 15;\n\t\t}\n\n\t\tthis.btnAddChestContents = new GuiCheckBox(x, y, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_ADD_CHEST_CONTENTS), this.houseConfiguration.addChestContents, null);\n\t\tthis.btnAddChestContents.setFGColor(color);\n\t\tthis.btnAddChestContents.setWithShadow(false);\n\t\tthis.btnAddChestContents.visible = false;\n\t\tthis.addButton(this.btnAddChestContents);\n\n\t\tif (this.allowItemsInChestAndFurnace) {\n\t\t\ty += 15;\n\t\t}\n\n\t\tthis.btnGlassColor = new ExtendedButton(grayBoxX + 10, grayBoxY + 20, 90, 20, GuiLangKeys.translateDye(this.houseConfiguration.glassColor), this::actionPerformed);\n\t\tthis.addButton(this.btnGlassColor);\n\n\t\t// Column 2:\n\n\t\t// Column 3:\n\n\t\t// Tabs:\n\t\tthis.tabGeneral = new GuiTab(this.Tabs, GuiLangKeys.translateString(GuiLangKeys.STARTER_TAB_GENERAL), grayBoxX + 3, grayBoxY - 20);\n\t\tthis.Tabs.AddTab(this.tabGeneral);\n\n\t\tthis.tabConfig = new GuiTab(this.Tabs, GuiLangKeys.translateString(GuiLangKeys.STARTER_TAB_CONFIG), grayBoxX + 54, grayBoxY - 20);\n\t\tthis.Tabs.AddTab(this.tabConfig);\n\n\t\tthis.tabBlockTypes = new GuiTab(this.Tabs, GuiLangKeys.translateString(GuiLangKeys.STARTER_TAB_BLOCK), grayBoxX + 105, grayBoxY - 20);\n\t\tthis.tabBlockTypes.setWidth(70);\n\t\tthis.Tabs.AddTab(this.tabBlockTypes);\n\n\t\t// Create the done and cancel buttons.\n\t\tthis.btnBuild = new ExtendedButton(grayBoxX + 10, grayBoxY + 136, 90, 20, GuiLangKeys.translateString(GuiLangKeys.GUI_BUTTON_BUILD), this::actionPerformed);\n\t\tthis.addButton(this.btnBuild);\n\n\t\tthis.btnCancel = new ExtendedButton(grayBoxX + 147, grayBoxY + 136, 90, 20, GuiLangKeys.translateString(GuiLangKeys.GUI_BUTTON_CANCEL), this::actionPerformed);\n\t\tthis.addButton(this.btnCancel);\n\t}", "private final void setupNewGame() throws IOException {\n\t\tmessage.setText(\"Make your move!\");\n\n\t\twhiteTeam = PokemonDao.getRandomPokemons(TEAM_SIZE);\n\t\tblackTeam = PokemonDao.getRandomPokemons(TEAM_SIZE);\n\n\t\tcreateImages();\n\n\t\tint middleSquare = BOARD_SIZE/2;\n\n\t\tint i=0;\n\t\tfor(int col = middleSquare - whiteTeam.size()/2; col< middleSquare+ whiteTeam.size()/2;col++){\n\t\t\tJButton jButton = chessBoardSquares[col][0];\n\t\t\tImageIcon icon = new ImageIcon(whiteImages.get(i++));\n\t\t\tjButton.setIcon(icon);\n\t\t}\n\n\t\tint j=0;\n\t\tfor(int col = middleSquare - whiteTeam.size()/2; col< middleSquare+ whiteTeam.size()/2;col++){\n\t\t\tJButton jButton = chessBoardSquares[col][BOARD_SIZE-1];\n\t\t\tImageIcon icon = new ImageIcon(blackImages.get(j++));\n\t\t\tjButton.setIcon(icon);\n\t\t}\n\n\t\tframe.pack();\n\t\t//\t\tfor (int ii = 0; ii < BOARD_SIZE; ii++) {\n\t\t//\t\t\tfor (int jj = 0; jj < BOARD_SIZE; jj++) {\n\t\t//\t\t\t\tchessBoardSquares[ii][jj].setIcon(new ImageIcon(whiteImages.get(0)));\n\t\t//\t\t\t}\n\t\t//\t\t}\n\t\t//\t\t// set up the black pieces\n\t\t//\t\tfor (int ii = 0; ii < STARTING_ROW.length; ii++) {\n\t\t//\t\t\tchessBoardSquares[ii][0].setIcon(new ImageIcon(chessPieceImages[BLACK][STARTING_ROW[ii]]));\n\t\t//\t\t}\n\t\t//\t\tfor (int ii = 0; ii < STARTING_ROW.length; ii++) {\n\t\t//\t\t\tchessBoardSquares[ii][1].setIcon(new ImageIcon(chessPieceImages[BLACK][PAWN]));\n\t\t//\t\t}\n\t\t//\t\t// set up the white pieces\n\t\t//\t\tfor (int ii = 0; ii < STARTING_ROW.length; ii++) {\n\t\t//\t\t\tchessBoardSquares[ii][6].setIcon(new ImageIcon(chessPieceImages[WHITE][PAWN]));\n\t\t//\t\t}\n\t\t//\t\tfor (int ii = 0; ii < STARTING_ROW.length; ii++) {\n\t\t//\t\t\tchessBoardSquares[ii][7].setIcon(new ImageIcon(chessPieceImages[WHITE][STARTING_ROW[ii]]));\n\t\t//\t\t}\n\t}", "private void initialize() {\r\n\r\n\t\t\r\n\t\tcells = new JButton[9];\r\n\t\t/* Δημιουργούμε πίνακα κουμπιών για ευκολότερη διαχείρισή τους */\r\n\t\t\r\n\t\trn = new Random();\r\n\t\t/* Φτιάχνουμε την \"κληρωτίδα\" μας */\r\n\t\t\r\n\t\t\r\n\t\tframe = new JFrame();\r\n\t\tframe.setBounds(100, 100, 408, 513);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\t\r\n\t\t/** \r\n\t\t * Η γενική δομή του κώδικα που θα ακολουθήσει έχει ως εξής:\r\n\t\t * \r\n\t\t * Αρχικά έχουμε τον κώδικα που κατασκευάζει τα κελιά.\r\n\t\t * Αμέσως μετά έχουμε τον κώδικα που κατασκευάζει το μενού.\r\n\t\t * Αμέσως μετά έχουμε τον κώδικα που κατασκευάζει τα υπόλοιπα αντικείμενα της παλέτας.\r\n\t\t * \r\n\t\t * Ακολουθούν οι action listeners ως εξής:\r\n\t\t * Πρώτα έχουμε τους action listeners των κελιών.\r\n\t\t * Ακολουθούν οι action listeners του μενού.\r\n\t\t * Τελευταίους έχουμε τους action listeners των υπόλοιπων αντικειμένων της παλέτας.\r\n\t\t * \r\n\t\t * Ακολουθεί κώδικας ο οποίος φτιάχνει τα κελια! \r\n\t\t * \r\n\t\t * **/\r\n\t\t\r\n\t\t/* Κατασκευή πρώτου κελιού */\r\n\t\tJButton btnNewButton = new JButton(\"\");\r\n\t\tbtnNewButton.setFont(new Font(\"Tahoma\", Font.BOLD, 35));\r\n\t\tcells[0] = btnNewButton;\r\n\t\tbtnNewButton.setBounds(75, 67, 72, 72);\r\n\t\tframe.getContentPane().add(btnNewButton);\r\n\t\t\r\n\t\t/* Κατασκευή δεύτερου κελιού */\r\n\t\tJButton button = new JButton(\"\");\r\n\t\tbutton.setFont(new Font(\"Tahoma\", Font.BOLD, 35));\r\n\t\tbutton.setBounds(159, 67, 72, 72);\r\n\t\tframe.getContentPane().add(button);\r\n\t\tcells[1] = button;\r\n\t\t\r\n\t\t/* Κατασκευή τρίτου κελιού */\r\n\t\tJButton button_1 = new JButton(\"\");\r\n\t\tbutton_1.setFont(new Font(\"Tahoma\", Font.BOLD, 35));\r\n\t\tbutton_1.setBounds(243, 67, 72, 72);\r\n\t\tframe.getContentPane().add(button_1);\r\n\t\tcells[2] = button_1;\r\n\t\t\r\n\t\t/* Κατασκευή τεταρτου κελιού */\r\n\t\tJButton button_2 = new JButton(\"\");\r\n\t\tbutton_2.setFont(new Font(\"Tahoma\", Font.BOLD, 35));\r\n\t\tbutton_2.setBounds(75, 152, 72, 72);\r\n\t\tframe.getContentPane().add(button_2);\r\n\t\tcells[3] = button_2;\r\n\t\t\r\n\t\t/* Κατασκευή πέμπτου κελιού */\r\n\t\tJButton button_3 = new JButton(\"\");\r\n\t\tbutton_3.setFont(new Font(\"Tahoma\", Font.BOLD, 35));\r\n\t\tbutton_3.setBounds(159, 152, 72, 72);\r\n\t\tframe.getContentPane().add(button_3);\r\n\t\tcells[4] = button_3;\r\n\t\t\r\n\t\t/* Κατασκευή εκτου κελιού */\r\n\t\tJButton button_4 = new JButton(\"\");\r\n\t\tbutton_4.setFont(new Font(\"Tahoma\", Font.BOLD, 35));\r\n\t\tbutton_4.setBounds(243, 152, 72, 72);\r\n\t\tframe.getContentPane().add(button_4);\r\n\t\tcells[5] = button_4;\t\t\r\n\t\t\r\n\t\t/* Κατασκευή εβδόμου κελιού */\r\n\t\tJButton button_5 = new JButton(\"\");\r\n\t\tbutton_5.setFont(new Font(\"Tahoma\", Font.BOLD, 35));\r\n\t\tbutton_5.setBounds(75, 238, 72, 72);\r\n\t\tframe.getContentPane().add(button_5);\r\n\t\tcells[6] = button_5;\r\n\t\t\r\n\t\t/* Κατασκευή ογδοου κελιού */\r\n\t\tJButton button_6 = new JButton(\"\");\r\n\t\tbutton_6.setFont(new Font(\"Tahoma\", Font.BOLD, 35));\r\n\t\tbutton_6.setBounds(159, 237, 72, 72);\r\n\t\tframe.getContentPane().add(button_6);\r\n\t\tcells[7] = button_6;\r\n\t\t\r\n\t\t/* Κατασκευή ενάτου κελιού */\r\n\t\tJButton button_7 = new JButton(\"\");\r\n\t\tbutton_7.setFont(new Font(\"Tahoma\", Font.BOLD, 35));\r\n\t\tbutton_7.setBounds(243, 237, 72, 72);\r\n\t\tframe.getContentPane().add(button_7);\r\n\t\tcells[8] = button_7;\r\n\t\t\r\n\t\t/** \r\n\t\t * \r\n\t\t * Τέλος κώδικα ο οποίος φτιάχνει τα κελια! \r\n\t\t * Ακολουθεί κώδικας ο οποίος φτιάχνει το μενού! \r\n\t\t * \r\n\t\t * **/\r\n\t\tsetDefaultColor();\r\n\t\tJMenuBar menuBar = new JMenuBar();\r\n\t\tmenuBar.setBounds(0, 0, 737, 26);\r\n\t\tframe.getContentPane().add(menuBar);\r\n\t\t\r\n\t\tJMenu mnNew = new JMenu(\"Game\");\r\n\t\tmenuBar.add(mnNew);\r\n\t\t\r\n\t\tJMenuItem menuItemNewGame = new JMenuItem(\"New game\");\r\n\t\tmnNew.add(menuItemNewGame);\r\n\t\t\r\n\t\tJMenu mnLevel = new JMenu(\"Level\");\r\n\t\tmnNew.add(mnLevel);\r\n\t\t\r\n\t\tButtonGroup group = new ButtonGroup();\r\n\t\tButtonGroup group2 = new ButtonGroup();\r\n\t\tButtonGroup group3 = new ButtonGroup();\r\n\t\t\r\n\t\tbeginnerRadioSelection = new JRadioButtonMenuItem(\"beginner\");\r\n\t\tmnLevel.add(beginnerRadioSelection);\r\n\t\t\r\n\t\tintermediateRadioSelection = new JRadioButtonMenuItem(\"intermediate\");\r\n\t\tmnLevel.add(intermediateRadioSelection);\r\n\t\t\r\n\t\texpertRadioSelection = new JRadioButtonMenuItem(\"expert\");\r\n\t\tmnLevel.add(expertRadioSelection);\r\n\t\t\r\n\t\tgroup.add(beginnerRadioSelection);\r\n\t\tgroup.add(intermediateRadioSelection);\r\n\t\tgroup.add(expertRadioSelection);\r\n\t\tintermediateRadioSelection.setSelected(true);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tJMenu mnPlayerSymbol = new JMenu(\"Player symbol\");\r\n\t\tmnNew.add(mnPlayerSymbol);\r\n\t\t\r\n\t\tplayerSymbolSelectionO = new JRadioButtonMenuItem(\"O\");\r\n\t\tmnPlayerSymbol.add(playerSymbolSelectionO);\r\n\t\t\r\n\t\tplayerSymbolSelectionX = new JRadioButtonMenuItem(\"X\");\r\n\t\tmnPlayerSymbol.add(playerSymbolSelectionX);\r\n\t\tgroup2.add(playerSymbolSelectionX);\r\n\t\tgroup2.add(playerSymbolSelectionO);\r\n\t\tplayerSymbolSelectionO.setSelected(true);\r\n\t\t\r\n\t\tJMenu mnMode = new JMenu(\"Mode\");\r\n\t\tmnNew.add(mnMode);\r\n\t\t\r\n\t\tJRadioButtonMenuItem rdbtnmntmPlayerFirst = new JRadioButtonMenuItem(\"Player first\");\r\n\t\tmnMode.add(rdbtnmntmPlayerFirst);\r\n\t\t\r\n\t\tJRadioButtonMenuItem rdbtnmntmComputerFirst = new JRadioButtonMenuItem(\"Computer first\");\r\n\t\tmnMode.add(rdbtnmntmComputerFirst);\r\n\t\tgroup3.add(rdbtnmntmPlayerFirst);\r\n\t\tgroup3.add(rdbtnmntmComputerFirst);\r\n\t\trdbtnmntmPlayerFirst.setSelected(true);\r\n\r\n\t\t/* Αction listener της πρώτης επιλογής */\r\n\t\tbeginnerRadioSelection.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0){\r\n\r\n\t\t\t\t\tlevel=\"beginner\";\r\n\t\t\t\t\tSystem.out.println(\"beginner selected!\");\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\trdbtnmntmPlayerFirst.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0){\r\n\r\n\t\t\t\t\tcomputerAttackMode=false;\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\trdbtnmntmComputerFirst.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0){\r\n\r\n\t\t\t\t\tcomputerAttackMode=true;\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t/* Αction listener της δεύτερης επιλογής */\r\n\t\tintermediateRadioSelection.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0){\r\n\r\n\t\t\t\t\tlevel=\"intermediate\";\r\n\t\t\t\t\tSystem.out.println(\"intermediate selected!\");\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\t/* Αction listener της τρίτης επιλογής */\r\n\t\texpertRadioSelection.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0){\r\n\r\n\t\t\t\t\tlevel=\"expert\";\r\n\t\t\t\t\tSystem.out.println(\"expert selected!\");\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tplayerSymbolSelectionO.addActionListener(new ActionListener(){\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0){\r\n\r\n\t\t\t\t\tplayerSymbol=\"O\";\r\n\t\t\t\t\tcomputerSymbol=\"X\";\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\tplayerSymbolSelectionX.addActionListener(new ActionListener(){\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0){\r\n\r\n\t\t\t\t\tplayerSymbol=\"X\";\r\n\t\t\t\t\tcomputerSymbol=\"O\";\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\t/** \r\n\t\t * \r\n\t\t * Τέλος κώδικα ο οποίος φτιάχνει συμπληρωματικά αντικείμενα στην παλέτα! \r\n\t\t * Ακολουθεί κώδικας ο οποίος προσθέτει τους action listeners των κελιών! \r\n\t\t * \r\n\t\t * **/\r\n\t\t\r\n\t\t/* Αction listener του πρώτου κελιού */\r\n\t\tcells[0].addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0){\r\n\t\t\t\tif(!(computerAttackMode==true && counter==0))\r\n\t\t\t\t\tplayerMove(0);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t/* Αction listener του δευτερου κελιού */\r\n\t\tcells[1].addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\t\t\r\n\t\t\t\tif(!(computerAttackMode==true && counter==0))\r\n\t\t\t\t\tplayerMove(1);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t/* Αction listener του τριτου κελιού */\r\n\t\tcells[2].addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tif(!(computerAttackMode==true && counter==0))\r\n\t\t\t\t\tplayerMove(2);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t/* Αction listener του τεταρτου κελιού */\r\n\t\tcells[3].addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tif(!(computerAttackMode==true && counter==0))\r\n\t\t\t\t\tplayerMove(3);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t/* Αction listener του πεμπτου κελιού */\r\n\t\tcells[4].addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tif(!(computerAttackMode==true && counter==0))\r\n\t\t\t\t\tplayerMove(4);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t/* Αction listener του εκτου κελιού */\r\n\t\tcells[5].addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tif(!(computerAttackMode==true && counter==0))\r\n\t\t\t\t\tplayerMove(5);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t/* Αction listener του εβδομου κελιού */\r\n\t\tcells[6].addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tif(!(computerAttackMode==true && counter==0))\r\n\t\t\t\t\tplayerMove(6);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t/* Αction listener του ογδοου κελιού */\r\n\t\tcells[7].addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tif(!(computerAttackMode==true && counter==0))\r\n\t\t\t\t\tplayerMove(7);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t/* Αction listener του ενάτου κελιού */\r\n\t\tcells[8].addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tif(!(computerAttackMode==true && counter==0))\r\n\t\t\t\t\tplayerMove(8);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t/* Aκολουθεί ο action listener */\r\n\t\tmenuItemNewGame.addActionListener(new ActionListener(){\r\n\t\t\tpublic void actionPerformed(ActionEvent e){\r\n\t\t\t\tsetDefaultColor();\r\n\t\t\t\tcounter=0;\r\n\t\t\t\twinFlag=false;\r\n\t\t\t\tintermediateRadioSelection.setEnabled(true);\r\n\t\t\t\tbeginnerRadioSelection.setEnabled(true);\r\n\t\t\t\texpertRadioSelection.setEnabled(true);\r\n\t\t\t\tplayerSymbolSelectionO.setEnabled(true);\r\n\t\t\t\tplayerSymbolSelectionX.setEnabled(true);\r\n\t\t\t\tfor(int i=0;i<9;i++)\r\n\t\t\t\t\tcells[i].setText(\"\");\r\n\t\t\t\t\r\n\t\t\t\tif(computerAttackMode==true) {\r\n\t\t\t\t\ttrap_category = Math.abs(rn.nextInt())%3;\r\n\t\t\t\t\tcomputerMove();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//if(computerAttackMode==true){\r\n\t\t\t\r\n\t\t//\tSystem.out.println(\"Ο υπολογιστής παίζειο πρώτος!!!\\n\");\r\n\t\t//\tcomputerMove();\r\n\t\t//}\r\n\t\t\t\t\t\t\r\n\t}", "public void init()\n\t\t{\n\t\t\t//Makes Lists\n\t\t\tmakeLists();\n\n\t\t\t//layout for GUI\n\t\t\tGridLayout layout = new GridLayout(2,4, 5 ,5);\n\t\t\tsetLayout(layout);\n\n\t\t\t//add panels to window\n\t\t\tadd(Panel_1);\n\t\t\tadd(Panel_2);\n\t\t\tadd(Panel_3);\n\t\t\tadd(Panel_4);\n\n\t\t\t//create buttons\n\t\t\tCalculateButton = new JButton(\"Calculate\");\n\t\t ExitButton = new JButton(\"Exit\");\n\n\t\t\t//connect event handlers to buttons\n\t\t CalculateButton.addActionListener(new ButtonListener());\n\t\t ExitButton.addActionListener(new ButtonListener());\n\n\t\t\t//add buttons to window\n\t\t add(CalculateButton);\n\t\t add(ExitButton);\n\n\t\t //make window visible\n\t\t\tsetVisible(true);\n\t\t}", "public void setBoard(GUIBoard board) {\n this.board = board;\n }", "private void setup() {\n setPreferredSize(DEFAULT_SIZE);\n setBackground(Color.WHITE);\n addComponentsTopane();\n \n File f = new File(\"icons/title.png\");\n try {\n myImage = ImageIO.read(f);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private static void initAndShowGUI() {\n }", "private void initBoardPanel()\r\n {\r\n for(int i = 0; i < 3; i++)\r\n {\r\n for(int j = 0; j < 3; j++)\r\n {\r\n buttons[i][j] = new JButton(\" \");\r\n buttons[i][j].addActionListener(bh);\r\n buttons[i][j].setEnabled(false);\r\n boardpanel.add(buttons[i][j]);\r\n }\r\n }\r\n }", "private void setupFrame()\n\t\t{\n\t\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\tthis.setResizable(false);\n\t\t\tthis.setSize(800, 600);\n\t\t\tthis.setTitle(\"SEKA Client\");\n\t\t\tthis.setContentPane(panel);\n\t\t\tthis.setVisible(true);\n\t\t}", "public BoardInterface(){\n\t\tsetupLayouts();\n\t\tsetPlayerChoice();\n\t}", "public void setUp()\r\n {\r\n board = new MineSweeperBoard(4, 4, 1);\r\n }", "private void initializeGUI() {\n\n\t\t// system's main frame and its properties\n\t\tframeSystem = new JFrame(\"NBodies System Configuration\");\n\t\tframeSystem.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframeSystem.setResizable(false);\n\t\tframeSystem.setBackground(Color.white);\n\n\t\t// number of bodies controls and their properties\n\t\tlblNBodies = new JLabel(\" Insert the system bodies's number: \");\n\t\tlblNBodies.setAlignmentX(JLabel.CENTER_ALIGNMENT);\n\t\ttxtNBodies = new JTextField(\"0\");\n\t\ttxtNBodies.setAlignmentX(JTextField.CENTER_ALIGNMENT);\n\n\t\t// time controls and their properties\n\t\tlblTime = new JLabel(\" Insert the system's evolution time: \");\n\t\tlblTime.setAlignmentX(JLabel.CENTER_ALIGNMENT);\n\t\ttxtTime = new JTextField(\"0\");\n\t\ttxtTime.setAlignmentX(JTextField.CENTER_ALIGNMENT);\n\n\t\t// number of bodies console and its properties and internal controls\n\t\tnumberBodiesControlConsole = new JPanel();\n\t\tnumberBodiesControlConsole.setBounds(0, 0, 550, 28);\n\t\tnumberBodiesControlConsole.setBackground(Color.white);\n\t\tLayoutManager numberLayout = new BorderLayout();\n\t\tnumberBodiesControlConsole.setLayout(numberLayout);\n\t\tnumberBodiesControlConsole.add(lblNBodies, BorderLayout.WEST);\n\t\tnumberBodiesControlConsole.add(txtNBodies, BorderLayout.CENTER);\n\n\t\t// time console and its properties and internal controls\n\t\ttimeControlConsole = new JPanel();\n\t\ttimeControlConsole.setBounds(0, 28, 550, 30);\n\t\ttimeControlConsole.setBackground(Color.white);\n\t\tLayoutManager timeLayout = new BorderLayout();\n\t\ttimeControlConsole.setLayout(timeLayout);\n\t\ttimeControlConsole.add(lblTime, BorderLayout.WEST);\n\t\ttimeControlConsole.add(txtTime, BorderLayout.CENTER);\n\n\t\t// start and communication console and its properties and internal\n\t\t// controls\n\t\tstartAndCommunicationConsole = new JPanel();\n\t\tstartAndCommunicationConsole.setBounds(0, 56, 550, 58);\n\t\tstartAndCommunicationConsole.setBackground(Color.white);\n\t\tLayoutManager startLayout = new BorderLayout();\n\t\tstartAndCommunicationConsole.setLayout(startLayout);\n\n\t\t// master panel and its layout's properties\n\t\tmasterPanel = new JPanel();\n\t\tmasterPanel.setLayout(null);\n\t\tmasterPanel.add(numberBodiesControlConsole);\n\t\tmasterPanel.add(timeControlConsole);\n\t\tmasterPanel.add(startAndCommunicationConsole);\n\n\t\t// button to start the n-bodies system and its properties\n\t\tbtnStartSystem = new JButton(\"Start the n-bodies system\");\n\t\tstartAndCommunicationConsole.add(btnStartSystem, BorderLayout.CENTER);\n\n\t\tbtnOpenFileConfig = new JButton(\n\t\t\t\t\"Start System from a Configuration File\");\n\t\tSystemConfigurationViewController controller = new SystemConfigurationViewController(\n\t\t\t\tthis);\n\t\tstartAndCommunicationConsole.add(btnOpenFileConfig, BorderLayout.NORTH);\n\t\tbtnOpenFileConfig.addActionListener(controller\n\t\t\t\t.getChooseConfigurationFileListener());\n\t\tbtnStartSystem.addActionListener(controller.getStartListener());\n\n\t\t// view's main frame and its properties\n\t\tframeSystem.setContentPane(masterPanel);\n\n\t\t// label to show errors and its properties\n\t\tlblCommunication = new JLabel(\n\t\t\t\t\" Please insert the n-bodies system's configuration values.\");\n\t\tlblCommunication.setBounds(0, 114, 550, 36);\n\t\tmasterPanel.add(lblCommunication);\n\t\tlblCommunication.setAlignmentX(JLabel.CENTER_ALIGNMENT);\n\t\tlblCommunication.setForeground(Color.BLUE);\n\t\tframeSystem.setSize(new Dimension(550, 181));\n\t\tframeSystem.setLocationRelativeTo(null);\n\t\tframeSystem.setVisible(true);\n\t}", "private void setUpGUI() {\r\n\r\n\t\t// All the components to the panel\r\n\t\tuserName = new JTextField();\r\n\t\tpassword = new JPasswordField();\r\n\t\tuserNameLabel = new JLabel(\"UserName\");\r\n\t\tpasswordLabel = new JLabel(\"Password\");\r\n\t\tloginButton = new JButton(\"Login\");\r\n\t\tregisterButton = new JButton(\"Register\");\r\n\r\n\t\t// Null layout for custom layout\r\n\t\tthis.setLayout(null);\r\n\r\n\t\t// Sets the size and location of all the labels, fields, and buttons\r\n\t\tuserNameLabel.setLocation(labelXLocation, labelYLocation);\r\n\t\tuserNameLabel.setSize(labelXSize, labelYSize);\r\n\r\n\t\tuserName.setLocation(labelXLocation + xFieldOffset, labelYLocation);\r\n\t\tuserName.setSize(textFieldXSize, textFieldYSize);\r\n\r\n\t\tpasswordLabel.setLocation(labelXLocation, labelYLocation + labelYSize\r\n\t\t\t\t+ buffer);\r\n\t\tpasswordLabel.setSize(labelXSize, labelYSize);\r\n\r\n\t\tpassword.setLocation(labelXLocation + xFieldOffset, labelYLocation\r\n\t\t\t\t+ yFieldOffset);\r\n\t\tpassword.setSize(textFieldXSize, textFieldYSize);\r\n\r\n\t\tloginButton.setLocation(labelXLocation, labelYLocation + labelYSize\r\n\t\t\t\t+ textFieldYSize + buffer * 3);\r\n\t\tloginButton.setSize(xButtonSize, yButtonSize);\r\n\r\n\t\tregisterButton.setLocation(labelXLocation + xFieldOffset + buffer\r\n\t\t\t\t+ buffer, labelYLocation + labelYSize + textFieldYSize + buffer\r\n\t\t\t\t* 3);\r\n\t\tregisterButton.setSize(xButtonSize, yButtonSize);\r\n\r\n\t\t\r\n\t\t// Adds everything to the panel\r\n\t\tthis.add(userNameLabel);\r\n\t\tthis.add(userName);\r\n\t\tthis.add(passwordLabel);\r\n\t\tthis.add(password);\r\n\t\tthis.add(loginButton);\r\n\t\tthis.add(registerButton);\r\n\t\tthis.repaint();\r\n\t}", "public void displayBoard() {\r\n\t\tboard = new JButton[6][7];\r\n\t\tfor (int row = 0; row < board.length; row++) {\r\n\t\t\tfor (int col = 0; col < board[row].length; col++) {\r\n\t\t\t\tboard[row][col] = new JButton();\r\n\t\t\t\tboard[row][col].addActionListener(this);\r\n\t\t\t\tboard[row][col].setBorder(new EtchedBorder());\r\n\t\t\t\tboard[row][col].setEnabled(true);\r\n\t\t\t\tboardPanel.add(board[row][col]);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void Makeboard() {\r\n\r\n Normalboard(new Point2(20, 300));\r\n Normalboard(new Point2(224, 391));\r\n Stingboard(new Point2(156, 209));\r\n Leftlboard(new Point2(88, 482));\r\n Rightboard(new Point2(292, 573));\r\n Regenerateboard(new Point2(360, 118));\r\n\r\n }", "@Override\r\n\tpublic void init() \r\n\t{\r\n\t\tthis.board = new GameBoard();\r\n\t}", "private void setUpGUI()\n\t{\n\t\tgetContentPane().setLayout(new BorderLayout());\n\n\t\t//center panel (project and developer dropdown lists, and state of\n\t\t//server label)\n\t\tJPanel centerPanel = new JPanel();\n\t\tcenterPanel.setLayout(new GridLayout(3, 2));\n\n\t\tcenterPanel.add(new JLabel(\"Choose a project\"));\n\t\tprojectsComboBox = new JComboBox<String>(selectADBString);\n\t\tcenterPanel.add(projectsComboBox);\n\n\t\tcenterPanel.add(new JLabel(\"Choose a developer group\"));\n\t\tdevNamesComboBox = new JComboBox<String>(selectADBString);\n\t\tcenterPanel.add(devNamesComboBox);\n\n\t\tstateOfServerLabel = new JLabel(\"The server is NOT running\");\n\t\tcenterPanel.add(stateOfServerLabel);\n\n\t\tgetContentPane().add(centerPanel, BorderLayout.CENTER);\n\n\t\t//south panel (start the server)\n\t\tJPanel southPanel = new JPanel();\n\t\tsouthPanel.setLayout(new FlowLayout());\n\n\t\tstartStopServerButton = new JButton(START_SERVER_BUTTON_TEXT);\n\t\tstartStopServerButton.addActionListener(this);\n\n\t\topenPlaybackInBrowserCheckbox = new JCheckBox(\"Open the playback in the browser?\");\n\n\t\tsouthPanel.add(startStopServerButton);\n\t\tsouthPanel.add(openPlaybackInBrowserCheckbox);\n\n\t\tgetContentPane().add(southPanel, BorderLayout.SOUTH);\n\n\t\t//create the north panel by looking for the last used db file\n\t\tJPanel northPanel = createNorthPanel();\n\n\t\tgetContentPane().add(northPanel, BorderLayout.NORTH);\n\n\t\t//window controls\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tsetSize(800, 250);\n\t\tsetVisible(true);\n\t}", "public void createAndShowGUI() {\n\t\tJFrame frame = new JFrame(\"Pong\");\n\t\tframe.setResizable(false);\n\t\tframe.setVisible(true);\n\n\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\tframe.add(board, BorderLayout.CENTER);\n\t\tframe.add(topPanel, BorderLayout.NORTH);\n\n\t\tframe.pack();\n\t}", "private void setup() {\n this.jpanel = new JPanel(new BorderLayout());\n this.jframe = new JFrame(\"Minesweeper\");\n this.jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n this.jframe.setSize(sizeX * LENGTH + 18, (sizeY + 1) * LENGTH + 43);\n\n this.jframe.setVisible(true);\n this.jpanel.addMouseListener(this);\n this.jpanel.setSize(sizeX * LENGTH, (sizeY + 1) * LENGTH);\n this.jframe.add(this.jpanel);\n\n this.g = jpanel.getGraphics();\n }", "public static void prepareGUI() {\n\t\tframe = new JFrame(\"Solid Adventure : Catch All Virtumon\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n \n //Create and set up the content pane.\n Driver demo = new Driver();\n demo.addComponentToPane(frame.getContentPane());\n\n //Display the window.\n frame.pack();\n frame.setLocationRelativeTo(null);\n frame.setVisible(true);\n\t}", "public TetrisGUI() {\r\n initializeFields();\r\n }", "public GameBoardGUI(GUIController ctrl) {\n\t\tsuper();\n\t\tthis.ctrl = ctrl;\n\t\tbuttons = new JButton[DIM][DIM];\n\t\tfor (int i = 0; i < DIM; i++)\n\t\t\tfor (int j = 0; j < DIM; j++) {\n\t\t\t\tbuttons[i][j] = new JButton(\"\");\n\t\t\t\tenableButtonAtPosition(i, j, true);\n\t\t\t}\n\t\tinitialize();\n\t}", "public History_GUI(){\n super();\n InitializeComponents();\n ConfigureWin();\n\n }", "private void initialize()\n {\n this.setTitle( \"SerialComm\" ); // Generated\n this.setSize( 500, 300 );\n this.setContentPane( getJContentPane() );\n }", "public void start(){\n getBoard();\n prepareBoard();\n renderBoard();\n }", "private void $$$setupUI$$$()\n {\n panel = new JPanel();\n panel.setLayout(new GridLayoutManager(6, 1, new Insets(20, 20, 20, 20), -1, -1));\n panel.setAutoscrolls(true);\n buttonSettings = new JButton();\n buttonSettings.setEnabled(true);\n buttonSettings.setText(\"Open Application Settings\");\n panel.add(buttonSettings,\n new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,\n GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,\n GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n buttonStartGit = new JButton();\n buttonStartGit.setEnabled(true);\n buttonStartGit.setText(\"Start Git Management\");\n panel.add(buttonStartGit,\n new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,\n GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,\n GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JScrollPane scrollPane1 = new JScrollPane();\n panel.add(scrollPane1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,\n GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,\n GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,\n null, new Dimension(500, 500), null, 0, false));\n textPaneConsole = new JTextPane();\n textPaneConsole.setEditable(false);\n scrollPane1.setViewportView(textPaneConsole);\n buttonOpenBenchmarkDialog = new JButton();\n buttonOpenBenchmarkDialog.setText(\"Open YCSB Benchmark Dialog\");\n panel.add(buttonOpenBenchmarkDialog,\n new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,\n GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,\n GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n buttonShowGitSettings = new JButton();\n buttonShowGitSettings.setEnabled(true);\n buttonShowGitSettings.setText(\"Open Git Management\");\n panel.add(buttonShowGitSettings,\n new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,\n GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,\n GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label1 = new JLabel();\n label1.setText(\"Console Output\");\n panel.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,\n GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null,\n null, null, 0, false));\n }", "public void initGui()\n {\n StringTranslate var2 = StringTranslate.getInstance();\n int var4 = this.height / 4 + 48;\n\n this.controlList.add(new GuiButton(1, this.width / 2 - 100, var4 + 24 * 1, \"Offline Mode\"));\n this.controlList.add(new GuiButton(2, this.width / 2 - 100, var4, \"Online Mode\"));\n\n this.controlList.add(new GuiButton(3, this.width / 2 - 100, var4 + 48, var2.translateKey(\"menu.mods\")));\n\t\tthis.controlList.add(new GuiButton(0, this.width / 2 - 100, var4 + 72 + 12, 98, 20, var2.translateKey(\"menu.options\")));\n\t\tthis.controlList.add(new GuiButton(4, this.width / 2 + 2, var4 + 72 + 12, 98, 20, var2.translateKey(\"menu.quit\")));\n this.controlList.add(new GuiButtonLanguage(5, this.width / 2 - 124, var4 + 72 + 12));\n }", "public void initGui()\n {\n Keyboard.enableRepeatEvents(true);\n this.buttons.clear();\n GuiButton guibutton = this.addButton(new GuiButton(3, this.width / 2 - 100, this.height / 4 + 24 + 12, I18n.format(\"selectWorld.edit.resetIcon\")));\n this.buttons.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 48 + 12, I18n.format(\"selectWorld.edit.openFolder\")));\n this.buttons.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.format(\"selectWorld.edit.save\")));\n this.buttons.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.format(\"gui.cancel\")));\n guibutton.enabled = this.mc.getSaveLoader().getFile(this.worldId, \"icon.png\").isFile();\n ISaveFormat isaveformat = this.mc.getSaveLoader();\n WorldInfo worldinfo = isaveformat.getWorldInfo(this.worldId);\n String s = worldinfo == null ? \"\" : worldinfo.getWorldName();\n this.nameEdit = new GuiTextField(2, this.fontRenderer, this.width / 2 - 100, 60, 200, 20);\n this.nameEdit.setFocused(true);\n this.nameEdit.setText(s);\n }", "public void initialize() {\n\t\tselectedDrawingTool = 1;\n\t\tlblDrawingTool = new JLabel[NUM_DRAWING_TOOLS];\n\t\tnetwork = null;\n\t\tvisitorListMap = new HashMap<String, Color>();\n\t\tsetTitle(\"Whiteboard conference room\");\n\t\t\n\t\t// set frame options\n\t\tsetResizable(false);\n\t\tsetBounds(100, 30, 1024, 768);\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\n\t\t// Set background color\n\t\tgetContentPane().setBackground(THEME_BACKGROUND);\n\t\tgetContentPane().setLayout(null);\n\t\t\n\t\t// Set icons\n\t\tImageIcon roomIcon = null;\n\t\tImageIcon roomCreateIcon = null;\n\t\tImageIcon roomJoinIcon = null;\n\t\ttry { roomIcon = new ImageIcon(ImageIO.read(getClass().getResource(\"/resources/roomIcon.png\"))); } catch (IOException e1) { e1.printStackTrace(); }\n\t\ttry { roomCreateIcon = new ImageIcon(ImageIO.read(getClass().getResource(\"/resources/roomCreateIcon.png\"))); } catch (IOException e1) { e1.printStackTrace(); }\n\t\ttry { roomJoinIcon = new ImageIcon(ImageIO.read(getClass().getResource(\"/resources/roomJoinIcon.png\"))); } catch (IOException e1) { e1.printStackTrace(); }\n\t\t\n\t\t// Room\n\t\tJTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);\n\t\ttabbedPane.setBounds(10, 10, 250, 518);\n\t\ttabbedPane.setBackground(THEME_BACKGROUND);\n\t\ttabbedPane.setForeground(THEME_FOREGROUND);\n\t\ttabbedPane.setUI(new customTabbedPaneUI());\n\t\t\n\t\t// Room - tab 1\n\t\tJPanel roomPanel1 = new JPanel();\n\t\troomPanel1.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\troomPanel1.setLayout(null);\n\t\troomPanel1.setBorder(BorderFactory.createMatteBorder(1, 5, 1, 1, THEME_FOREGROUND));\n\t\troomPanel1.setBackground(THEME_BACKGROUND);\n\t\ttabbedPane.addTab(\"Room\", roomIcon, roomPanel1, \"\");\n\t\t\n\t\tJPanel roomPanel1SubPanelProfile = new JPanel();\n\t\troomPanel1SubPanelProfile.setLayout(null);\n\t\troomPanel1SubPanelProfile.setBounds(15, 10, 215, 60);\n\t\troomPanel1SubPanelProfile.setBackground(THEME_BACKGROUND);\n\t\tTitledBorder titledColoredProfileBorder = new TitledBorder(\"Profile\");\n\t\ttitledColoredProfileBorder.setBorder(BorderFactory.createMatteBorder(1, 5, 1, 1, THEME_FOREGROUND));\n\t\ttitledColoredProfileBorder.setTitleFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\ttitledColoredProfileBorder.setTitleColor(THEME_FOREGROUND);\n\t\troomPanel1SubPanelProfile.setBorder(titledColoredProfileBorder);\n\t\t\n\t\tlblUsername = new JLabel(\"Username: \" + DEFAULT_USERNAME);\n\t\tlblUsername.setBounds(15, 17, 180, 15);\n\t\tlblUsername.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\tlblUsername.setForeground(THEME_FOREGROUND);\n\t\troomPanel1SubPanelProfile.add(lblUsername);\n\t\t\n\t\tJLabel lblColorChooser = new JLabel(\"Color:\");\n\t\tlblColorChooser.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\tlblColorChooser.setBounds(15, 36, 120, 15);\n\t\tlblColorChooser.setForeground(THEME_FOREGROUND);\n\t\troomPanel1SubPanelProfile.add(lblColorChooser);\n\t\t\n\t\tlblColor = new JLabel(\"\");\n\t\tlblColor.setBounds(53, 36, 15, 15);\n\t\tlblColor.setOpaque(true);\n\t\tlblColor.setBackground(new Color(0,0,0));\n\t\tlblColor.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\troomPanel1SubPanelProfile.add(lblColor);\n\t\t\n\t\troomPanel1.add(roomPanel1SubPanelProfile);\n\t\t\n\t\tJPanel roomPanel1SubPanelServerInfo = new JPanel();\n\t\troomPanel1SubPanelServerInfo.setLayout(null);\n\t\troomPanel1SubPanelServerInfo.setBounds(15, 80, 215, 60);\n\t\troomPanel1SubPanelServerInfo.setBackground(THEME_BACKGROUND);\n\t\tTitledBorder titledColoredServerInfoBorder = new TitledBorder(\"Server info.\");\n\t\ttitledColoredServerInfoBorder.setBorder(BorderFactory.createMatteBorder(1, 5, 1, 1, THEME_FOREGROUND));\n\t\ttitledColoredServerInfoBorder.setTitleFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\ttitledColoredServerInfoBorder.setTitleColor(THEME_FOREGROUND);\n\t\troomPanel1SubPanelServerInfo.setBorder(titledColoredServerInfoBorder);\n\t\t\n\t\tlblServerInfoIP = new JLabel(\"IP address: Not connected.\");\n\t\tlblServerInfoIP.setBounds(15, 17, 175, 15);\n\t\tlblServerInfoIP.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\tlblServerInfoIP.setForeground(THEME_FOREGROUND);\n\t\troomPanel1SubPanelServerInfo.add(lblServerInfoIP);\n\t\t\n\t\tlblServerInfoPort = new JLabel(\"Port: \");\n\t\tlblServerInfoPort.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\tlblServerInfoPort.setBounds(15, 36, 170, 15);\n\t\tlblServerInfoPort.setForeground(THEME_FOREGROUND);\n\t\troomPanel1SubPanelServerInfo.add(lblServerInfoPort);\n\t\t\n\t\troomPanel1.add(roomPanel1SubPanelServerInfo);\n\t\t\n\t\tJPanel roomPanel1SubPanelDrawingTools = new JPanel();\n\t\troomPanel1SubPanelDrawingTools.setLayout(null);\n\t\troomPanel1SubPanelDrawingTools.setBounds(15, 150, 215, 190);\n\t\troomPanel1SubPanelDrawingTools.setBackground(THEME_BACKGROUND);\n\t\tTitledBorder titledColoredDrawingToolsBorder = new TitledBorder(\"Drawing tools\");\n\t\ttitledColoredDrawingToolsBorder.setBorder(BorderFactory.createMatteBorder(1, 5, 1, 1, THEME_FOREGROUND));\n\t\ttitledColoredDrawingToolsBorder.setTitleFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\ttitledColoredDrawingToolsBorder.setTitleColor(THEME_FOREGROUND);\n\t\troomPanel1SubPanelDrawingTools.setBorder(titledColoredDrawingToolsBorder);\n\t\t\n\t\t// Drawing tool #1\n\t\ttry {\n\t\t\tlblDrawingTool[0] = new JLabel(new ImageIcon(ImageIO.read(getClass().getResource(\"/resources/roomDrawingTool1.png\"))));\n\t\t\tlblDrawingTool[0].setBackground(THEME_BACKGROUND);\n\t\t\tlblDrawingTool[0].setBounds(25, 20, 25, 25);\n\t\t\tlblDrawingTool[0].addMouseListener(new drawingTool1MouseListener());\n\t\t\tgetContentPane().add(lblDrawingTool[0]);\n\t\t} catch (IOException e) { e.printStackTrace(); }\n\t\t\n\t\t// Drawing tool #2\n\t\ttry {\n\t\t\tlblDrawingTool[1] = new JLabel(new ImageIcon(ImageIO.read(getClass().getResource(\"/resources/roomDrawingTool2Offset.png\"))));\n\t\t\tlblDrawingTool[1].setBackground(THEME_BACKGROUND);\n\t\t\tlblDrawingTool[1].setBounds(60, 20, 25, 25);\n\t\t\tlblDrawingTool[1].addMouseListener(new drawingTool2MouseListener());\n\t\t\tgetContentPane().add(lblDrawingTool[1]);\n\t\t} catch (IOException e) { e.printStackTrace(); }\n\t\t\n\t\t// Drawing tool #3\n\t\ttry {\n\t\t\tlblDrawingTool[2] = new JLabel(new ImageIcon(ImageIO.read(getClass().getResource(\"/resources/roomDrawingTool3Offset.png\"))));\n\t\t\tlblDrawingTool[2].setBackground(THEME_BACKGROUND);\n\t\t\tlblDrawingTool[2].setBounds(95, 20, 25, 25);\n\t\t\tlblDrawingTool[2].addMouseListener(new drawingTool3MouseListener());\n\t\t\tgetContentPane().add(lblDrawingTool[2]);\n\t\t} catch (IOException e) { e.printStackTrace(); }\n\t\t\n\t\t// Drawing tool #4\n\t\ttry {\n\t\t\tlblDrawingTool[3] = new JLabel(new ImageIcon(ImageIO.read(getClass().getResource(\"/resources/roomDrawingTool4Offset.png\"))));\n\t\t\tlblDrawingTool[3].setBackground(THEME_BACKGROUND);\n\t\t\tlblDrawingTool[3].setBounds(130, 20, 25, 25);\n\t\t\tlblDrawingTool[3].addMouseListener(new drawingTool4MouseListener());\n\t\t\tgetContentPane().add(lblDrawingTool[3]);\n\t\t} catch (IOException e) { e.printStackTrace(); }\n\t\t\n\t\t// Drawing tool #5\n\t\ttry {\n\t\t\tlblDrawingTool[4] = new JLabel(new ImageIcon(ImageIO.read(getClass().getResource(\"/resources/roomDrawingTool5Offset.png\"))));\n\t\t\tlblDrawingTool[4].setBackground(THEME_BACKGROUND);\n\t\t\tlblDrawingTool[4].setBounds(165, 20, 25, 25);\n\t\t\tlblDrawingTool[4].addMouseListener(new drawingTool5MouseListener());\n\t\t\tgetContentPane().add(lblDrawingTool[4]);\n\t\t} catch (IOException e) { e.printStackTrace(); }\n\t\t\t\t\n\t\t// Drawing tool #6\n\t\ttry {\n\t\t\tlblDrawingTool[5] = new JLabel(new ImageIcon(ImageIO.read(getClass().getResource(\"/resources/roomDrawingTool6Offset.png\"))));\n\t\t\tlblDrawingTool[5].setBackground(THEME_BACKGROUND);\n\t\t\tlblDrawingTool[5].setBounds(25, 55, 25, 25);\n\t\t\tlblDrawingTool[5].addMouseListener(new drawingTool6MouseListener());\n\t\t\tgetContentPane().add(lblDrawingTool[5]);\n\t\t} catch (IOException e) { e.printStackTrace(); }\n\t\t\n\t\troomPanel1SubPanelDrawingTools.add(lblDrawingTool[0]);\n\t\troomPanel1SubPanelDrawingTools.add(lblDrawingTool[1]);\n\t\troomPanel1SubPanelDrawingTools.add(lblDrawingTool[2]);\n\t\troomPanel1SubPanelDrawingTools.add(lblDrawingTool[3]);\n\t\troomPanel1SubPanelDrawingTools.add(lblDrawingTool[4]);\n\t\troomPanel1SubPanelDrawingTools.add(lblDrawingTool[5]);\n\t\t\n\t\troomPanel1.add(roomPanel1SubPanelDrawingTools);\n\t\t\n\t\tJPanel roomPanel1SubPanelColor = new JPanel();\n\t\troomPanel1SubPanelColor.setLayout(null);\n\t\troomPanel1SubPanelColor.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\troomPanel1SubPanelColor.setBounds(15, 345, 215, 55);\n\t\troomPanel1SubPanelColor.setBackground(THEME_BACKGROUND);\n\t\tTitledBorder titledColoredColorBorder = new TitledBorder(\"Change color\");\n\t\ttitledColoredColorBorder.setBorder(BorderFactory.createMatteBorder(1, 5, 1, 1, THEME_FOREGROUND));\n\t\ttitledColoredColorBorder.setTitleFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\ttitledColoredColorBorder.setTitleColor(THEME_FOREGROUND);\n\t\troomPanel1SubPanelColor.setBorder(titledColoredColorBorder);\n\t\t\n\t\tJButton btnChangeColor = new JButton(\"Choose\");\n\t\tbtnChangeColor.addActionListener(new changeColorBtnActionListener());\n\t\tbtnChangeColor.setBounds(16, 21, 180, 20);\n\t\tbtnChangeColor.setBackground(THEME_BACKGROUND);\n\t\tbtnChangeColor.setForeground(THEME_FOREGROUND);\n\t\tbtnChangeColor.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\troomPanel1SubPanelColor.add(btnChangeColor);\n\t\t\n\t\troomPanel1.add(roomPanel1SubPanelColor);\n\t\t\n\t\tJPanel roomPanel1SubPanelUsername = new JPanel();\n\t\troomPanel1SubPanelUsername.setLayout(null);\n\t\troomPanel1SubPanelUsername.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\troomPanel1SubPanelUsername.setBounds(15, 400, 215, 75);\n\t\troomPanel1SubPanelUsername.setBackground(THEME_BACKGROUND);\n\t\tTitledBorder titledColoredUsernameBorder = new TitledBorder(\"Change username\");\n\t\ttitledColoredUsernameBorder.setBorder(BorderFactory.createMatteBorder(1, 5, 1, 1, THEME_FOREGROUND));\n\t\ttitledColoredUsernameBorder.setTitleFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\ttitledColoredUsernameBorder.setTitleColor(THEME_FOREGROUND);\n\t\troomPanel1SubPanelUsername.setBorder(titledColoredUsernameBorder);\n\n\t\tJLabel lblNewUsername = new JLabel(\"New username:\");\n\t\tlblNewUsername.setBounds(15, 26, 100, 15);\n\t\tlblNewUsername.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\tlblNewUsername.setForeground(THEME_FOREGROUND);\n\t\troomPanel1SubPanelUsername.add(lblNewUsername);\n\t\t\n\t\ttfNewUsername = new JTextField();\n\t\ttfNewUsername.setBounds(110, 23, 86, 20);\n\t\ttfNewUsername.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\ttfNewUsername.setBackground(THEME_BACKGROUND);\n\t\ttfNewUsername.setForeground(THEME_FOREGROUND);\n\t\troomPanel1SubPanelUsername.add(tfNewUsername);\n\t\t\n\t\tJButton btnChangeUsername = new JButton(\"Confirm\");\n\t\tbtnChangeUsername.addActionListener(new changeUsernameBtnActionListener());\n\t\tbtnChangeUsername.setBounds(15, 47, 180, 20);\n\t\tbtnChangeUsername.setBackground(THEME_BACKGROUND);\n\t\tbtnChangeUsername.setForeground(THEME_FOREGROUND);\n\t\tbtnChangeUsername.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\troomPanel1SubPanelUsername.add(btnChangeUsername);\n\t\t\n\t\troomPanel1.add(roomPanel1SubPanelUsername);\n\t\t\n\t\t// Room - tab 2\n\t\tJPanel roomPanel2 = new JPanel();\n\t\troomPanel2.setLayout(null);\n\t\troomPanel2.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\troomPanel2.setBackground(THEME_BACKGROUND);\n\t\tJPanel roomPanel2SubPanelCreateServer = new JPanel();\n\t\troomPanel2SubPanelCreateServer.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\troomPanel2SubPanelCreateServer.setLayout(null);\n\t\troomPanel2SubPanelCreateServer.setBounds(15, 10, 215, 90);\n\t\troomPanel2SubPanelCreateServer.setBackground(THEME_BACKGROUND);\n\t\tTitledBorder titledColoredCreateServerBorder = new TitledBorder(\"Host server\");\n\t\ttitledColoredCreateServerBorder.setBorder(BorderFactory.createMatteBorder(1, 5, 1, 1, THEME_FOREGROUND));\n\t\ttitledColoredCreateServerBorder.setTitleFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\ttitledColoredCreateServerBorder.setTitleColor(THEME_FOREGROUND);\n\t\troomPanel2SubPanelCreateServer.setBorder(titledColoredCreateServerBorder);\n\t\t\n\t\tJLabel lblCreateIP = new JLabel(\"Server ip: \" + getWANIP());\n\t\tlblCreateIP.setBounds(15, 17, 170, 12);\n\t\tlblCreateIP.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\tlblCreateIP.setForeground(THEME_FOREGROUND);\n\t\troomPanel2SubPanelCreateServer.add(lblCreateIP);\n\t\t\n\t\tJLabel lblCreatePort = new JLabel(\"Port number:\");\n\t\tlblCreatePort.setBounds(15, 36, 120, 15);\n\t\tlblCreatePort.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\tlblCreatePort.setForeground(THEME_FOREGROUND);\n\t\troomPanel2SubPanelCreateServer.add(lblCreatePort);\n\t\t\n\t\ttfCreatePort = new JTextField();\n\t\ttfCreatePort.setToolTipText(\"Port number for server hosting\");\n\t\ttfCreatePort.setBounds(93, 35, 86, 20);\n\t\ttfCreatePort.setBackground(THEME_BACKGROUND);\n\t\ttfCreatePort.setForeground(THEME_FOREGROUND);\n\t\ttfCreatePort.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\troomPanel2SubPanelCreateServer.add(tfCreatePort);\n\t\t\n\t\tJButton btnCreate = new JButton(\"Create\");\n\t\tbtnCreate.addActionListener(new createBtnActionListener(this));\n\t\tbtnCreate.setBounds(16, 60, 180, 20);\n\t\tbtnCreate.setBackground(THEME_BACKGROUND);\n\t\tbtnCreate.setForeground(THEME_FOREGROUND);\n\t\tbtnCreate.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\troomPanel2SubPanelCreateServer.add(btnCreate);\n\t\t\n\t\troomPanel2.add(roomPanel2SubPanelCreateServer);\n\t\ttabbedPane.addTab(\"Create\", roomCreateIcon, roomPanel2, \"\");\n\t\t\n\t\t// Room - tab 3\n\t\tJPanel roomPanel3 = new JPanel();\n\t\troomPanel3.setLayout(null);\n\t\troomPanel3.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\troomPanel3.setBackground(THEME_BACKGROUND);\n\t\tJPanel roomPanel3SubPanelJoinServer = new JPanel();\n\t\troomPanel3SubPanelJoinServer.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\troomPanel3SubPanelJoinServer.setLayout(null);\n\t\troomPanel3SubPanelJoinServer.setBounds(15, 10, 215, 100);\n\t\troomPanel3SubPanelJoinServer.setBackground(THEME_BACKGROUND);\n\t\tTitledBorder titledColoredJoinServerBorder = new TitledBorder(\"Join server\");\n\t\ttitledColoredJoinServerBorder.setBorder(BorderFactory.createMatteBorder(1, 5, 1, 1, THEME_FOREGROUND));\n\t\ttitledColoredJoinServerBorder.setTitleFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\ttitledColoredJoinServerBorder.setTitleColor(THEME_FOREGROUND);\n\t\troomPanel3SubPanelJoinServer.setBorder(titledColoredJoinServerBorder);\n\t\t\n\t\tJLabel lblJoinIP = new JLabel(\"Server ip:\");\n\t\tlblJoinIP.setBounds(15, 19, 150, 15);\n\t\tlblJoinIP.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\tlblJoinIP.setForeground(THEME_FOREGROUND);\n\t\troomPanel3SubPanelJoinServer.add(lblJoinIP);\n\t\t\n\t\ttfJoinIP = new JTextField();\n\t\ttfJoinIP.setToolTipText(\"Server IP of host\");\n\t\ttfJoinIP.setBounds(93, 15, 86, 20);\n\t\ttfJoinIP.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\ttfJoinIP.setBackground(THEME_BACKGROUND);\n\t\ttfJoinIP.setForeground(THEME_FOREGROUND);\n\t\troomPanel3SubPanelJoinServer.add(tfJoinIP);\n\t\t\n\t\tJLabel lblJoinPort = new JLabel(\"Port number:\");\n\t\tlblJoinPort.setBounds(15, 43, 120, 15);\n\t\tlblJoinPort.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\tlblJoinPort.setForeground(THEME_FOREGROUND);\n\t\troomPanel3SubPanelJoinServer.add(lblJoinPort);\n\t\t\n\t\ttfJoinPort = new JTextField();\n\t\ttfJoinPort.setToolTipText(\"Port number for server hosting\");\n\t\ttfJoinPort.setBounds(93, 40, 86, 20);\n\t\ttfJoinPort.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\ttfJoinPort.setBackground(THEME_BACKGROUND);\n\t\ttfJoinPort.setForeground(THEME_FOREGROUND);\n\t\troomPanel3SubPanelJoinServer.add(tfJoinPort);\n\t\t\n\t\tJButton btnJoin = new JButton(\"Join\");\n\t\tbtnJoin.addActionListener(new joinBtnActionListener(this));\n\t\tbtnJoin.setBounds(16, 67, 180, 20);\n\t\tbtnJoin.setBackground(THEME_BACKGROUND);\n\t\tbtnJoin.setForeground(THEME_FOREGROUND);\n\t\tbtnJoin.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\troomPanel3SubPanelJoinServer.add(btnJoin);\n\t\t\n\t\troomPanel3.add(roomPanel3SubPanelJoinServer);\n\t\ttabbedPane.addTab(\"Join\", roomJoinIcon, roomPanel3, \"\");\n\t\t\n\t\tgetContentPane().add(tabbedPane);\n\t\t\n\t\t// Visitor list\n\t\tvisitorListModel = new DefaultListModel<String>();\n\t\t\n\t\tvisitorList = new JList<String>(visitorListModel);\n\t\tvisitorList.setCellRenderer(new NameRenderer());\n\t\tvisitorList.setBounds(20, 20, 200, 144);\n\t\tvisitorList.setBackground(THEME_BACKGROUND);\n\t\tJScrollPane visitorListScrollPane = new JScrollPane();\n\t\tvisitorListScrollPane.setViewportView(visitorList);\n\t\tvisitorListScrollPane.setBorder(null);\n\t\tvisitorListScrollPane.setBounds(20, 20, 210, 160);\n\t\t\n\t\tJPanel panelVisitorList = new JPanel();\n\t\tpanelVisitorList.setOpaque(false);\n\t\tpanelVisitorList.setFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\tpanelVisitorList.setLayout(null);\n\t\tpanelVisitorList.setBounds(10, 534, 250, 194);\n\t\tTitledBorder titledColoredVisitorListBorder = new TitledBorder(\"Visitor list\");\n\t\ttitledColoredVisitorListBorder.setBorder(BorderFactory.createMatteBorder(1, 5, 1, 1, THEME_FOREGROUND));\n\t\ttitledColoredVisitorListBorder.setTitleColor(THEME_FOREGROUND);\n\t\ttitledColoredVisitorListBorder.setTitleFont(new Font(DEFAULT_FONT, Font.PLAIN, DEFAULT_FONT_SIZE));\n\t\tpanelVisitorList.setBorder(titledColoredVisitorListBorder);\n\t\t\n\t\tpanelVisitorList.add(visitorListScrollPane);\n\t\t\n\t\tgetContentPane().add(panelVisitorList);\n\t\t\n\t\t// Whiteboard\n\t\twhiteboardBi = new BufferedImage(720, 715, BufferedImage.TYPE_INT_RGB);\n\t\twhiteboardPanel = new WhiteBoardPanel(whiteboardBi);\n\t\twhiteboardPanel.setLayout(null);\n\t\twhiteboardPanel.setBounds(280, 13, 720, 715);\n\t\twhiteboardPanel.setBackground(THEME_BACKGROUND);\n\t\t\n\t\t// Leave button\n\t\ttry {\n\t\t\tlblLeave = new JLabel(new ImageIcon(ImageIO.read(getClass().getResource(\"/resources/roomLeaveIcon2.png\"))));\n\t\t\tlblLeave.setBackground(new Color(100,50,150,200));\n\t\t\tlblLeave.setBounds(696, 0, 24, 24);\n\t\t\tlblLeave.setVisible(true);\n\t\t\tlblLeave.addMouseListener(new leaveIconMouseListener());\n\t\t\twhiteboardPanel.add(lblLeave);\n\t\t} catch (IOException e) { e.printStackTrace(); }\n\t\t\n\t\t// Trash button\n\t\ttry {\n\t\t\tlblTrash = new JLabel(new ImageIcon(ImageIO.read(getClass().getResource(\"/resources/roomTrashIconOffset.png\"))));\n\t\t\tlblTrash.setBackground(new Color(100,50,150,200));\n\t\t\tlblTrash.setBounds(0, 0, 24, 24);\n\t\t\tlblTrash.setVisible(true);\n\t\t\tlblTrash.addMouseListener(new trashIconMouseListener());\n\t\t\twhiteboardPanel.add(lblTrash);\n\t\t} catch (IOException e) { e.printStackTrace(); }\n\t\t\n\t\tgetContentPane().add(whiteboardPanel);\n\t\t\n\t}", "public GameBoard() {\n\t\t\n\t\t// Initiate LoginScreen\n\t\tloginScreen();\n\t}", "private void $$$setupUI$$$() {\n contentPane = new JPanel();\n contentPane.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(4, 2, new Insets(10, 10, 10, 10), -1, -1));\n contentPane.setBackground(new Color(-16316665));\n contentPane.setMinimumSize(new Dimension(450, 500));\n final JPanel panel1 = new JPanel();\n panel1.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 5, new Insets(0, 0, 0, 0), 0, 0));\n panel1.setAlignmentY(0.0f);\n panel1.setAutoscrolls(true);\n panel1.setBackground(new Color(-16316665));\n contentPane.add(panel1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 4, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_NORTH, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n stopButton = new JButton();\n stopButton.setBackground(new Color(-16316665));\n stopButton.setForeground(new Color(-1041));\n stopButton.setText(\"Stop\");\n panel1.add(stopButton, new com.intellij.uiDesigner.core.GridConstraints(0, 4, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n pauseButton = new JButton();\n pauseButton.setBackground(new Color(-16316665));\n pauseButton.setForeground(new Color(-1041));\n pauseButton.setText(\"Pause\");\n panel1.add(pauseButton, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n startButton = new JButton();\n startButton.setBackground(new Color(-16316665));\n startButton.setForeground(new Color(-1041));\n startButton.setText(\"Start\");\n panel1.add(startButton, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n textArea1 = new JTextArea();\n textArea1.setBackground(new Color(-16316665));\n textArea1.setDisabledTextColor(new Color(-1041));\n textArea1.setEditable(false);\n textArea1.setForeground(new Color(-1041));\n panel1.add(textArea1, new com.intellij.uiDesigner.core.GridConstraints(0, 2, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n board = new JPanel();\n board.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));\n board.setBackground(new Color(-16316665));\n contentPane.add(board, new com.intellij.uiDesigner.core.GridConstraints(3, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n board.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(new Color(-1041)), null, TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, new Color(-16777216)));\n textArea2 = new JTextArea();\n textArea2.setBackground(new Color(-16316665));\n textArea2.setFont(new Font(textArea2.getFont().getName(), textArea2.getFont().getStyle(), 22));\n board.add(textArea2, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(150, 50), null, 0, false));\n }", "public void createAndShowGUI() {\n\t\tcontroller = new ControllerClass(); \r\n\r\n\t\t// Create and set up the window\r\n\t\twindowLookAndFeel();\r\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tsetTitle(\"Media Works - Add Screen\");\r\n\t\tsetResizable(false);\r\n\t\tadd(componentSetup());\r\n\t\tpack();\r\n\t\tsetSize(720,540);\r\n\t\tsetLocationRelativeTo(null);\r\n\t\tsetVisible(true);\r\n\t}", "private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.getContentPane().setBackground(Color.BLUE);\r\n\t\tframe.setBounds(100, 100, 450, 300);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\t\r\n\t\tJLabel lblNewLabel = new JLabel(\"Reiner Hotel Kiosk\");\r\n\t\tlblNewLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 25));\r\n\t\tlblNewLabel.setBounds(81, 11, 305, 89);\r\n\t\tframe.getContentPane().add(lblNewLabel);\r\n\t\t\r\n\t\tJButton btnNewButton = new JButton(\"Notify Managers\");\r\n\t\tbtnNewButton.setBounds(63, 137, 137, 23);\r\n\t\tframe.getContentPane().add(btnNewButton);\r\n\t\t\r\n\t\tJButton btnNewButton_1 = new JButton(\"Track Room Availability\");\r\n\t\tbtnNewButton_1.setBounds(231, 137, 166, 23);\r\n\t\tframe.getContentPane().add(btnNewButton_1);\r\n\t}", "public void guiSetup(Container pane)\n {\n \t/*\n \t * How it's organized:\n \t * 3 separate columns\n \t * Components in column one are small\n \t * Main grid component in column 2 takes up multiple spaces\n \t * Found word components in column 3 takes up multiple spaces as well\n \t */\n\t\tpane.setLayout(new GridBagLayout());\n\t\tGridBagConstraints c = new GridBagConstraints();\n\t\tc.weighty = 0.5;\n\t\t\n\t\t/*\n\t\t * First column GUI components\n\t\t */\n\t\tc.weightx = 0.25;\n\t\tc.gridx = 0;\n\t\t\n\t\tFont f = new Font( \"SansSerif\", Font.ITALIC, 34 );\n\t\ttitle = new JLabel( \"Boggle\" );\n\t\ttitle.setFont( f );\n\t\tc.gridy = 0;\n\t\tpane.add(title, c);\n\t\t\n\t\tscoreLabel = new JLabel( \"Score: 0\" );\n\t\tf = new Font( \"Serif\", Font.PLAIN, 24 );\n\t\tscoreLabel.setFont( f );\n\t\tc.gridy = 1;\n\t\tpane.add(scoreLabel, c);\n\t\n\t\ttimerLabel = new JLabel( \"Timer: 3:00\" );\n\t\ttimerLabel.setFont( f );\n\t\tc.gridy = 2;\n\t\tpane.add(timerLabel, c);\n\t\n\t\tmessagesLabel = new JLabel( \"Enter word: \" );\n\t\tf = new Font( \"Serif\", Font.PLAIN, 20 );\n\t\tmessagesLabel.setFont( f );\n\t\tf = new Font( \"Serif\", Font.PLAIN, 24 );\n\t\tc.gridy = 3;\n\t\tc.fill = GridBagConstraints.VERTICAL;\n\t\tpane.add(messagesLabel, c);\n\t\tc.fill = GridBagConstraints.NONE;\n\t\t\n\t\trestart = new JButton( \"Restart\" );\n\t\trestart.addActionListener( this );\n\t\t\n\t\tc.gridy = 4;\n\t\tpane.add(restart, c);\n\t\t\n\t\tpause = new JButton( \"Pause\" );\n\t\tpause.addActionListener( this );\n\t\t\n\t\tc.gridy = 5;\n\t\tpane.add(pause, c);\n\t\t\n\t\texit = new JButton( \"Exit\" );\n\t\texit.addActionListener( this );\n\t\t\n\t\tc.gridy = 6;\n\t\tpane.add(exit, c);\n\t\t\n\t\t/*\n\t\t * Second column\n\t\t */\n\t\tc.gridx = 1;\n\t\tc.weightx = 0.75;\n\t\t\n\t\tguiGrid = new JPanel( new GridLayout( BOARD_SIZE, BOARD_SIZE ) );\n\t\tgridButtons = new JButton[BOARD_SIZE][BOARD_SIZE];\n\t\tg = new Grid( BOARD_SIZE );\n\t\t\n\t\tfor( int i = 0; i < BOARD_SIZE; i++ )\n\t\t{\n\t\t\tfor( int j = 0; j < BOARD_SIZE; j++ )\n\t\t\t{\n\t\t\t\tgridButtons[i][j] = new JButton( Character.toString( g.charAt( i, j ) ) );\n\t\t\t\tgridButtons[i][j].addActionListener( this );\n\t\t\t\tgridButtons[i][j].setFont( f );\n\t\t\t\tguiGrid.add( gridButtons[i][j] );\n\t\t\t}\n\t\t}\n\t\t\n\t\tc.gridx = 1;\n\t\tc.gridheight = 3;\n\t\tc.fill = GridBagConstraints.BOTH;\n\t\tc.gridy = 1;\n\t\tpane.add(guiGrid, c);\n\t\tc.gridheight = 1;\n\t\tc.fill = GridBagConstraints.NONE;\n\t\t\n\t\tnewWord = new JButton( \"New word\" );\n\t\tnewWord.addActionListener( this );\n\t\tc.gridy = 5;\n\t\tpane.add( newWord, c );\n\t\t\n\t\tguessWordArea = new JTextArea( 1, 1 );\n\t\tguessWordArea.setEditable( false );\n\t\tguessWordArea.setBorder(BorderFactory.createEtchedBorder());\n\t\t\n\t\tc.gridy = 6;\n\t\tc.fill = GridBagConstraints.BOTH;\n\t\tpane.add(guessWordArea, c);\n\t\tc.fill = GridBagConstraints.NONE;\n\t\t\n\t\tsubmitWord = new JButton( \"Submit word\" );\n\t\tsubmitWord.addActionListener( this );\n\t\t\n\t\tc.gridx = 1;\n\t\tc.gridy = 7;\n\t\tpane.add( submitWord, c );\n\t\t\n\t\t/*\n\t\t * Third column\n\t\t */\n\t\tc.gridx = 2;\n\t\tc.weightx = 0.25;\n\t\t\n\t\tJLabel foundTitle = new JLabel( \"Found words:\" );\n\t\tfoundTitle.setFont( f );\n\t\tc.gridy = 1;\n\t\tpane.add( foundTitle, c);\n\t\t\n\t\tfoundWordsArea = new JTextArea( 10, 16 );\n\t\tfoundWordsArea.setEditable( false );\n\t\tc.gridx = 2;\n\t\tc.gridy = 2;\n\t\tc.gridheight = 2;\n\t\tInsets in = new Insets( 25, 25, 25, 25 );\n\t\tfoundWordsArea.setMargin( in );\n\t\tfoundWordsArea.setBorder(BorderFactory.createEtchedBorder()); \n\t\tpane.add( foundWordsArea, c);\n }", "private void createUI() throws FactoryException {\n assert theGame != null;\n assert ghostController != null;\n\n buttonPanel = new ButtonPanel(this);\n buttonPanel.initialize();\n\n pi = new PacmanInteraction(this, theGame);\n pi.addController(ghostController);\n buttonPanel.setListener(pi);\n this.addKeyListener(new PacmanKeyListener(pi));\n\n boardView = createBoardView();\n animator = new Animator(boardView);\n pi.addController(animator);\n\n points = new PointsPanel();\n points.initialize(theGame.getPointManager());\n theGame.attach(points);\n\n JPanel mainGrid = new JPanel();\n mainGrid.setLayout(new BorderLayout());\n mainGrid.setName(\"jpacman.topdown\");\n mainGrid.add(points, BorderLayout.NORTH);\n mainGrid.add(boardView, BorderLayout.CENTER);\n mainGrid.add(buttonPanel, BorderLayout.SOUTH);\n\n getContentPane().add(mainGrid);\n\n int width = Math.max(boardView.windowWidth(), buttonPanel.getWidth());\n int height = boardView.windowHeight() + buttonPanel.getHeight();\n setSize(width, height);\n setGridSize();\n\n setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n setName(\"jpacman.main\");\n setTitle(\"JPacman\");\n }", "private void initUI() {\n\t\tPanel p = new Panel();\n\t\tp.setLayout(new BorderLayout());\n\t\t\n\t\tPanel flowLayoutPanel = new Panel();\n\t\tflowLayoutPanel.setLayout(new FlowLayout());\n\t\t\n\t\ttextArea = new JTextArea();\n\t\t\n\t\tMyCloseButton exitButton = new MyCloseButton(\"Exit\");\n\t\t/*\n\t\texit.addActionListener(new ActionListener(){\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\t\t\t\n\t\t});\n\t\t*/\n\t\tMyOpenButton saveButton = new MyOpenButton(\"Open\");\n\t\t/*\n\t\tsaveButton.addActionListener(new ActionListener(){\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\n\t\t});\n\t\t*/\n\t\tMySaveButton mySaveButton =new MySaveButton(\"Save\");\n\t\t//setVisible(mb);\n\t\tp.add(flowLayoutPanel, BorderLayout.SOUTH);\n\t\tflowLayoutPanel.add(exitButton);\n\t\tflowLayoutPanel.add(saveButton);\n\t\tflowLayoutPanel.add(mySaveButton);\n\t\tp.add(textArea, BorderLayout.CENTER); \n\t\tadd(p);\n\t\t\n\t\tcreateMenu();\n\t\t\n\t\tsetTitle(\"Text Editor\");\n\t\tsetSize(600, 600);\n\t\tsetLocationRelativeTo(null);\n\t\tsetDefaultCloseOperation(EXIT_ON_CLOSE);\n\t\t\n\t}", "private void initGUI() {\n\t\tJPanel mainPanel = new JPanel(new BorderLayout());\n\t\t// This is the story we took from Wikipedia.\n\t\tString story = \"The Internet Foundation Classes (IFC) were a graphics \"\n\t\t\t\t+ \"library for Java originally developed by Netscape Communications \"\n\t\t\t\t+ \"Corporation and first released on December 16, 1996.\\n\\n\"\n\t\t\t\t+ \"On April 2, 1997, Sun Microsystems and Netscape Communications\"\n\t\t\t\t+ \" Corporation announced their intention to combine IFC with other\"\n\t\t\t\t+ \" technologies to form the Java Foundation Classes. In addition \"\n\t\t\t\t+ \"to the components originally provided by IFC, Swing introduced \"\n\t\t\t\t+ \"a mechanism that allowed the look and feel of every component \"\n\t\t\t\t+ \"in an application to be altered without making substantial \"\n\t\t\t\t+ \"changes to the application code. The introduction of support \"\n\t\t\t\t+ \"for a pluggable look and feel allowed Swing components to \"\n\t\t\t\t+ \"emulate the appearance of native components while still \"\n\t\t\t\t+ \"retaining the benefits of platform independence. This feature \"\n\t\t\t\t+ \"also makes it easy to have an individual application's appearance \"\n\t\t\t\t+ \"look very different from other native programs.\\n\\n\"\n\t\t\t\t+ \"Originally distributed as a separately downloadable library, \"\n\t\t\t\t+ \"Swing has been included as part of the Java Standard Edition \"\n\t\t\t\t+ \"since release 1.2. The Swing classes are contained in the \"\n\t\t\t\t+ \"javax.swing package hierarchy.\\n\\n\";\n\t\t// We create the TextArea and pass the story in as an argument.\n\t\tJTextArea storyArea = new JTextArea(story);\n\t\tstoryArea.setEditable(true);\n\t\tstoryArea.setWrapStyleWord(true);\n\t\t// We create the ScrollPane and instantiate it with the TextArea as an argument\n\t\tJScrollPane area = new JScrollPane(storyArea);\t\t\t\n\t\tmainPanel.add(area);\t\n\t\tthis.setContentPane(mainPanel);\n\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tthis.setSize(350, 300);\n\t\tthis.setVisible(true);\n\t}", "private void initialize() {\n\n\t\t//Frame operations\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 1030, 700);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(new BoxLayout(frame.getContentPane(), BoxLayout.X_AXIS));\n\t\tframe.setTitle(\"Get There\");\n\t\tframe.setResizable(false);\n\t\tframe.setVisible(true);\n\n\t\t//Panel Operations\n\t\tuiPanel = new JPanel();\n\t\tframe.getContentPane().add(uiPanel);\n\t\tuiPanel.setLayout(null);\n\n\t\tmapPanel = new JPanel();\n\t\tmapPanel.setBounds(5, 5, 750, 620);\n\t\tuiPanel.add(mapPanel);\n\t\tmapPanel.add(new MyGraphics());\n\n\t\t//Creating Labels\n\t\tstartPoint = new JLabel(\"FROM\");\n\t\tstartPoint.setBounds(780, 6, 132, 29);\n\n\t\tbuildingStart = new JLabel(\"Select Building:\");\n\t\tbuildingStart.setBounds(762, 26, 132, 29);\n\n\t\troomStart = new JLabel(\"Select Room:\");\n\t\troomStart.setBounds(900, 26, 132, 29);\n\n\t\tendPoint = new JLabel(\"TO\");\n\t\tendPoint.setBounds(780, 72, 132, 29);\n\n\t\tbuildingEnd = new JLabel(\"Select Building:\");\n\t\tbuildingEnd.setBounds(762, 92, 132, 29);\n\n\t\troomEnd = new JLabel(\"Select Room:\");\n\t\troomEnd.setBounds(900, 92, 132, 29);\n\n\n\t\t//Add Labels to the uiPanel\n\t\tuiPanel.add(startPoint);\n\t\tuiPanel.add(buildingStart);\n\t\tuiPanel.add(roomStart);\n\t\tuiPanel.add(endPoint);\n\t\tuiPanel.add(buildingEnd);\n\t\tuiPanel.add(roomEnd);\n\n\t\tstartRoomSEL.setModel(new DefaultComboBoxModel(new String[]{}));\n\t\tstartRoomSEL.setBounds(893, 50, 132, 29);\n\t\tstartRoomSEL.setEditable(false);\n\t\tstartRoomSEL.setVisible(true);\n\t\tstartRoomSEL.setName(\"Start\");\n\t\t\n\t\tmapNumber = new JTextPane();\n\t\tmapNumber.setBounds(360, 634, 47, 20);\n\t\tmapNumber.setEditable(false);\n\t\tmapNumber.setFont(new Font(\"Helvetica Neue\", Font.BOLD, 14));\n\t\tmapNumber.setAlignmentX(StyleConstants.ALIGN_CENTER);\n\t\tmapNumber.setAlignmentY(StyleConstants.ALIGN_CENTER);\n\t\tuiPanel.add(mapNumber);\n\n\t\t//Construct Combo boxes to select start point\n\t\tstartBuildingSEL = new JComboBox<String>();\n\t\tstartBuildingSEL.setBounds(755, 50, 132, 29);\n\t\tstartBuildingSEL.setEditable(false);\n\t\tstartBuildingSEL.setVisible(true);\n\t\tstartBuildingSEL.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tupdatePath = false;\n\t\t\t\tmapNumber.setText(\"\");\n\t\t\t\tstartRoomSELLaunched = false;\n\t\t\t\tendRoomSELLaunched = false;\n\t\t\t\trepaint();\n\t\t\t\trevalidate();\n\t\t\t\tint indexOfCurrentMap;\n\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\tJComboBox<String> cb = (JComboBox<String>)e.getSource();\n\t\t\t\tbuildingSelectedSTART = (String)cb.getSelectedItem();\n\t\t\t\tfor(indexOfCurrentMap = 0; indexOfCurrentMap < maps.size(); ++indexOfCurrentMap){\n\t\t\t\t\tif(buildingSelectedSTART.equals(maps.get(indexOfCurrentMap).getMapName()))\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcurrentStartNodes = maps.get(indexOfCurrentMap).getNodes();\n startRooms = new String[currentStartNodes.size()];\n\t\t\t\tcurrentStartEdges = maps.get(indexOfCurrentMap).getEdges();\n\t\t\t\tcurrentMapFile = maps.get(indexOfCurrentMap).getImage();\n\t\t\t\tcurrentlyShownMap = maps.get(indexOfCurrentMap);\n\t\t\t\tarrowCounter = 0;\n\t\t\t\tmapsForPaths = null;\n\t\t\t\tstartRoomSEL.removeAllItems();\n\t\t\t\tfor(int i = 0; i < currentStartNodes.size(); ++i){\n\t\t\t\t\tstartRooms[i] = currentStartNodes.get(i).getName();\n\t\t\t\t\tif(startRooms[i] != \"\" && currentStartNodes.get(i).getType() != NodeType.NOTYPE)\n\t\t\t\t\t\tstartRoomSEL.addItem(startRooms[i]);\n\t\t\t\t}\n\t\t\t\tstartHoverFlag = false;\n\t\t\t\tuiPanel.repaint();\n\t\t\t\tframe.repaint();\n\t\t\t}\n\t\t});\n\n\t\tfor (int i = 0; i < maps.size(); i++) {\n\t\t\tif(maps.get(i).getMapName() != null)\n\t\t\t\tstartBuildingSEL.addItem(maps.get(i).getMapName());\n\t\t}\n\n\t\tendRoomSEL.setModel(new DefaultComboBoxModel(new String[]{}));\n\t\tendRoomSEL.setBounds(893, 116, 132, 29);\n\t\tendRoomSEL.setEditable(false);\n\t\tendRoomSEL.setVisible(true);\n\t\tendRoomSEL.setName(\"End\");\n\n\t\t//Construct Combo boxes to select end point\n\t\tendBuildingSEL = new JComboBox<String>();\n\t\tendBuildingSEL.setBounds(755, 116, 132, 29);\n\t\tendBuildingSEL.setEditable(false);\n\t\tendBuildingSEL.setVisible(true);\n\t\tendBuildingSEL.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tupdatePath = false;\n\t\t\t\tint indexOfCurrentMap;\n\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\tJComboBox<String> cb = (JComboBox<String>)e.getSource();\n\t\t\t\tbuildingSelectedEND = (String)cb.getSelectedItem();\n\t\t\t\tfor(indexOfCurrentMap = 0; indexOfCurrentMap < maps.size(); ++indexOfCurrentMap){\n\t\t\t\t\tif(buildingSelectedEND.equals(maps.get(indexOfCurrentMap).getMapName()))\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcurrentEndNodes = maps.get(indexOfCurrentMap).getNodes();\n currentMapFile = maps.get(indexOfCurrentMap).getImage();\n\t\t\t\tcurrentlyShownMap = maps.get(indexOfCurrentMap);\n\t\t\t\tendRoomSEL.removeAllItems();\n\t\t\t\tarrowCounter = 0;\n\t\t\t\tmapsForPaths = null;\n\t\t\t\tfor(int i = 0; i < currentEndNodes.size(); ++i){\n\t\t\t\t\tendRooms[i] = currentEndNodes.get(i).getName();\n\t\t\t\t\tif(endRooms[i] != \"\" && currentEndNodes.get(i).getType() != NodeType.NOTYPE)\n\t\t\t\t\t\tendRoomSEL.addItem(endRooms[i]);\n\t\t\t\t}\n\t\t\t\tendHoverFlag = false;\n\t\t\t\tuiPanel.repaint();\n\t\t\t\tframe.repaint();\n\t\t\t}\n\t\t});\n\n\t\tfor (int i = 0; i < maps.size(); i++) {\n\t\t\tif(maps.get(i).getMapName() != null)\n\t\t\t\tendBuildingSEL.addItem(maps.get(i).getMapName());\n\t\t}\n\n\n\n\t\t//Add Combo Boxes to UIPanel\n\n\t\tuiPanel.add(startBuildingSEL);\n\t\tuiPanel.add(startRoomSEL);\n\t\tuiPanel.add(endBuildingSEL);\n\t\tuiPanel.add(endRoomSEL);\n\n\t\t//Construct button and add button to uiPanel\n\t\tsearchButton = new JButton (\"Search\");\n\t\tsearchButton.setBounds(891, 150, 132, 30);\n\t\tuiPanel.add(searchButton);\n\n\t\tclearButton = new JButton (\"Clear\");\n clearButton.setBounds(753, 150, 132, 30);\n uiPanel.add(clearButton);\n clearButton.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e)\n {\n updatePath = false;\n startClicked = false;\n endClicked = false;\n endNode = null;\n directions.setText(\"\");\n mapsForPaths = null;\n mapNumber.setText(\"\");\n }\n });\n\t\t\n\t\tleftArrow = new JButton(\"<<\");\n\t\tleftArrow.setBounds(275, 630, 80, 29);\n\t\tuiPanel.add(leftArrow);\n\t\tif(arrowCounter == 0){\n\t\t\tleftArrow.setEnabled(false);\n\t\t}\n\n\n\n\t\trightArrow = new JButton(\">>\");\n\t\trightArrow.setBounds(412, 630, 80, 29);\n\t\tuiPanel.add(rightArrow);\n\t\trightArrow.setEnabled(false);\n\n\t\tJLabel instructions = new JLabel(\"How to get there?\");\n\t\tinstructions.setBounds(820, 180, 132, 29);\n\t\tuiPanel.add(instructions);\n\n\t\tdirections = new JTextArea();\n\t\tdirections.setBounds(762, 210, 255, 420);\n\t\tdirections.setFont(new Font(\"Helvetica Neue\", Font.PLAIN, 13));\n\t\tdirections.setLineWrap(true);\n\t\tdirections.setEditable(false);\n\t\tJScrollPane scrollDire = new JScrollPane(directions);\n\t\tscrollDire.setBounds(762, 210, 255, 420);\n\t\tscrollDire.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);\n\t\tuiPanel.add(scrollDire);\n\n\t\temergencyIcon = new ImageIcon(\"IconImages/emergencyIcon.png\");\n\t\tIcon emergencyIconBIG = new ImageIcon(\"IconImages/emergencyIconBIG.png\");\n\t\temergency = new JButton();\n\t\temergency.setToolTipText(\"Emergency Information\");\n\t\temergency.setIcon(emergencyIcon);\n\t\temergency.setBounds(790, 632, 40, 40);\n\t\tuiPanel.add(emergency);\n\t\tString emergencyInfo = \"Call Campus Police:\" + \"\\n\" + \"508-831-5555\";\n\t\temergency.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e){\n\t\t\t\tJOptionPane.showMessageDialog(null, emergencyInfo, \"Incase of emergency\", JOptionPane.PLAIN_MESSAGE, emergencyIconBIG);\n\t\t\t}\n\t\t});\n\n\t\temailIcon = new ImageIcon(\"IconImages/emailIcon.png\");\n\t\temail = new JButton();\n\t\temail.setToolTipText(\"Send Directions via Email\");\n\t\temail.setIcon(emailIcon);\n\t\temail.setBounds(840, 632, 40, 40);\n\t\tuiPanel.add(email);\n\t\temail.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e)\n\t\t\t{\n\t\t\t\tif(emailDirections != null) {\n\t\t\t\t\tEMailDialogue em = new EMailDialogue(frame, emailDirections);\n\t\t\t\t\tem.setVisible(true);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\ttransportIcon = new ImageIcon(\"IconImages/transportIcon.png\");\n\t\tIcon transportIconBIG = new ImageIcon(\"IconImages/transportIconBIG.png\");\n\t\tIcon gatewaySchedule = new ImageIcon(\"IconImages/gatewaySchedule.png\");\n\t\tIcon eveningSchedule = new ImageIcon(\"IconImages/eveningSchedule.png\");\n\t\tIcon wpiumassSchedule = new ImageIcon(\"IconImages/wpi-umassSchedule.png\");\n\t\tIcon snapSchedule = new ImageIcon(\"IconImages/snapSchedule.png\");\n\t\ttransport = new JButton();\n\t\ttransport.setToolTipText(\"View Transport Schedule\");\n\t\ttransport.setIcon(transportIcon);\n\t\ttransport.setBounds(890, 632, 40, 40);\n\t\tuiPanel.add(transport);\n\t\ttransport.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e){\n\t\t\t\tString[] schedules = {\"Gateway Shuttle\", \"Evening Shuttle\", \"WPI-Umass Shuttle\", \"SNAP\"};\n\t\t\t\tObject selectedValue = JOptionPane.showInputDialog(null, \"Which transport would you like to use?\", \"Select Transport type\",\n\t\t\t\t\t\tJOptionPane.INFORMATION_MESSAGE, transportIconBIG,schedules, schedules[0]);\n\t\t\t\tif(selectedValue != null){\n\t\t\t\t\tswitch((String) selectedValue){\n\t\t\t\t\tcase \"Gateway Shuttle\":\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, null, \"Gateway Shuttle Schedule\", JOptionPane.INFORMATION_MESSAGE, gatewaySchedule);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Evening Shuttle\":\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, null, \"Evening Shuttle Schedule\", JOptionPane.INFORMATION_MESSAGE, eveningSchedule);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"WPI-Umass Shuttle\":\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, null, \"WPI-Umass Shuttle Schedule\", JOptionPane.INFORMATION_MESSAGE, wpiumassSchedule);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"SNAP\":\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, null, \"SNAP Shuttle\", JOptionPane.INFORMATION_MESSAGE, snapSchedule);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\thistoryIcon = new ImageIcon(\"IconImages/historyIcon.png\");\n\t\tImageIcon historyIconBIG = new ImageIcon(\"IconImages/historyIconBIG.png\");\n\t\thistory = new JButton();\n\t\thistory.setToolTipText(\"...Coming Soon\");\n\t\thistory.setIcon(historyIcon);\n\t\thistory.setBounds(940, 632, 40, 40);\n\t\tuiPanel.add(history);\n\t\thistory.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e){\n\t\t\t\tJOptionPane.showMessageDialog(null, \"....Coming Soon\", \"...Coming Soon\", JOptionPane.PLAIN_MESSAGE, historyIconBIG);\n\t\t\t}\n\t\t});\n\n\t\t//Construct buttons and add action listener\n\t\tsearchButton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) \n\t\t\t{\n\t\t\t\tint i;\n\t\t\t\tupdatePath = true;\n\t\t\t\tuiPanel.setVisible(true);\n\t\t\t\tframe.setVisible(true);\n\t\t\t\tpathCalc = new Djikstra();\n\t\t\t\tif(!startClicked && !endClicked){\n\t\t\t\t\tfor (i = 0; i < currentStartNodes.size(); i++){\n\t\t\t\t\t\tif(startRoomSEL.getSelectedItem() == currentStartNodes.get(i).getName())\n\t\t\t\t\t\t\tstartNode = currentStartNodes.get(i);\n\t\t\t\t\t}\n\t\t\t\t\tfor(i = 0; i < currentEndNodes.size(); i++){\n\t\t\t\t\t\tif(endRoomSEL.getSelectedItem() == currentEndNodes.get(i).getName())\n\t\t\t\t\t\t\tendNode = currentEndNodes.get(i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(startClicked && !endClicked){\n\t\t\t\t\tdirections.setText(\"Please Select End point\");\n\t\t\t\t\tupdatePath = false;\n\t\t\t\t}\n\t\t\t\tif(updatePath && startNode != null && endNode != null){\n\t\t\t\t\tSystem.out.println(startBuildingSEL.getSelectedItem());\n\t\t\t\t\tSystem.out.println(floor);\n\t\t\t\t\tlistPath = pathCalc.navigate(startNode, endNode);\n\t\t\t\t\tmapsForPaths = new LinkedList<Map>();\n\t\t\t\t\tSystem.out.println(listPath.size());\n\t\t\t\t\tfor (i = 0; i < listPath.size(); i++){\n\t\t\t\t\t\tfor (int j = 0; j < maps.size(); j++){\n\t\t\t\t\t\t\tnodesInMap = maps.get(j).getNodes();\n\t\t\t\t\t\t\tfor(int k = 0; k<nodesInMap.size(); k++){\n\t\t\t\t\t\t\t\tif(listPath.get(i) == nodesInMap.get(k)){\n\t\t\t\t\t\t\t\t\tif(!mapsForPaths.contains(maps.get(j))){\n\t\t\t\t\t\t\t\t\t\tmapsForPaths.add(maps.get(j));\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\tcurrentMapFile = mapsForPaths.getFirst().getImage();\n\t\t\t\t\t\tcurrentlyShownMap = mapsForPaths.getFirst();\n\t\t\t\t\t\ttotalMaps = mapsForPaths.size();\n\n\t\t\t\t\t\tif(mapsForPaths.size() > 1){\n\t\t\t\t\t\t\trightArrow.setEnabled(true);\n\t\t\t\t\t\t\tmapNumber.setText(String.valueOf(1) + \" of \" + String.valueOf(totalMaps));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\temailDirections = \"From: \" + startBuildingSEL.getSelectedItem() + \", \" + startRoomSEL.getSelectedItem() + \"\\n\" + \"to \"\n + endBuildingSEL.getSelectedItem() + \", \" + endRoomSEL.getSelectedItem() + \"\\n\" + \"\\n\" +\n pathCalc.gpsInstructions(pathCalc.navigate(startNode, endNode));\n\t\t\t\t\tdirections.setText(emailDirections);\n\t\t\t\t\tSystem.out.println(\"check List: \" + listPath.size());\n\t\t\t\t\trepaint();\n\t\t\t\t\trevalidate();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tleftArrow.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e){\n\t\t\t\tif(mapsForPaths!= null){\n\t\t\t\t\tif(arrowCounter != 0){\n\t\t\t\t\t\trightArrow.setEnabled(true);\n\t\t\t\t\t\tarrowCounter -= 1;\n\t\t\t\t\t\tmapNumber.setText(String.valueOf(arrowCounter + 1) + \" of \" + String.valueOf(totalMaps));\n\t\t\t\t\t\tcurrentMapFile = mapsForPaths.get(arrowCounter).getImage();\n\t\t\t\t\t\tcurrentlyShownMap = mapsForPaths.get(arrowCounter);\n\t\t\t\t\t}else if (arrowCounter == 0){\n\t\t\t\t\t\tleftArrow.setEnabled(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\trightArrow.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e){\n\t\t\t\tif(mapsForPaths != null){\n\t\t\t\t\tif(arrowCounter != totalMaps-1){\n\t\t\t\t\t\tleftArrow.setEnabled(true);\n\t\t\t\t\t\tarrowCounter += 1;\n\t\t\t\t\t\tmapNumber.setText(String.valueOf(arrowCounter + 1) + \" of \" + String.valueOf(totalMaps));\n\t\t\t\t\t\tcurrentMapFile = mapsForPaths.get(arrowCounter).getImage();\n\t\t\t\t\t\tcurrentlyShownMap = mapsForPaths.get(arrowCounter);\n\t\t\t\t\t}else if (arrowCounter == totalMaps-1){\n\t\t\t\t\t\trightArrow.setEnabled(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tuiPanel.setVisible(true);\n\t\tframe.setVisible(true);\n\t}", "public SetBoard(String newName){\n super(\"BattleShip Set\");\n\n //configuracoes basicas da janela\n\t\tsetSize(1100, 550);\n\t\tsetLocationRelativeTo(null);\n\t\tsetResizable(false);\n\t\tsetDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n setContentPane(panel);\n container = getContentPane();\n container.setLayout(null);\n\n //cria a base do board do player e do computador\n gridPlayer.setBounds(3, 100, 497, 325);\n\t\tgridPlayer.setLayout(new GridLayout(10, 10, 2, 2));\n gridPc.setBounds(599, 100, 497, 325);\n\t\tgridPc.setLayout(new GridLayout(10, 10, 2, 2));\n\n //pega o name do player passado por parametro\n player.setName(newName);\n name = newName;\n\n //preenche ambos boards com uma imagem de ocean\n for(int line = 0; line < 10; line++){\n\t\t\tfor(int column = 0; column < 10; column++){\n\t\t\t\ttablePlayer[line][column] = new JButton(line+\"-\"+column, new ImageIcon(RandomBoard.class.getResource(\"/images/ocean.png\")));\n tablePlayer[line][column].setHorizontalTextPosition(SwingConstants.CENTER);\n tablePlayer[line][column].setMargin( new Insets(10, 10, 10, 10) );\n\t\t\t\ttablePlayer[line][column].addActionListener(this);\n tablePlayer[line][column].setForeground(Color.WHITE);\n\t\t\t\tgridPlayer.add(tablePlayer[line][column]);\n tablePc[line][column] = new JButton(line+\"-\"+column, new ImageIcon(RandomBoard.class.getResource(\"/images/ocean.png\")));\n tablePc[line][column].setHorizontalTextPosition(SwingConstants.CENTER);\n tablePc[line][column].setMargin( new Insets(10, 10, 10, 10) );\n\t\t\t\ttablePc[line][column].addActionListener(this);\n tablePc[line][column].setForeground(Color.WHITE);\n\t\t\t\tgridPc.add(tablePc[line][column]);\n\t\t\t}\n\t\t}\n\n //posiciona os elementos na janela\n exit.setBounds(7, 14, 120, 35);\n\t\texit.addActionListener(this);\n\n\t\tnewGame.setBounds(127, 14, 120, 35);\n\t\tnewGame.addActionListener(this);\n\n reset.setBounds(247, 14, 120, 35);\n\t\treset.addActionListener(this);\n\n hint.setBounds(367, 14, 120, 35);\n\t\thint.addActionListener(this);\n\n singleShot.setBounds(487, 14, 120, 35);\n\t\tsingleShot.addActionListener(this);\n\n commonShot.setBounds(607, 14, 120, 35);\n\t\tcommonShot.addActionListener(this);\n\n cascade.setBounds(727, 14, 120, 35);\n\t\tcascade.addActionListener(this);\n\n star.setBounds(847, 14, 120, 35);\n\t\tstar.addActionListener(this);\n\n playerLabel.setFont(new Font(\"Arial\", Font.BOLD, 15));\n\t\tplayerLabel.setBounds(12, 78, 120, 18);\n\n pc.setFont(new Font(\"Arial\", Font.BOLD, 15));\n\t\tpc.setBounds(607, 78, 120, 18);\n\n stopwatch.setFont(new Font(\"Arial\", Font.BOLD, 25));\n\t\tstopwatch.setBounds(1000, 10, 120, 50);\n\n aircraft.setBounds(7, 450, 120, 35);\n\t\taircraft.addActionListener(this);\n aircraft.setIcon(new ImageIcon(SetBoard.class.getResource(\"/images/aircraft.png\")));\n \n submarine.setBounds(127, 450, 120, 35);\n\t\tsubmarine.addActionListener(this);\n submarine.setIcon(new ImageIcon(SetBoard.class.getResource(\"/images/submarine.png\")));\n\n escortShip.setBounds(247, 450, 120, 35);\n\t\tescortShip.addActionListener(this);\n escortShip.setIcon(new ImageIcon(SetBoard.class.getResource(\"/images/escortShip.png\")));\n\n aircraftCarrier.setBounds(367, 450, 120, 35);\n\t\taircraftCarrier.addActionListener(this);\n aircraftCarrier.setIcon(new ImageIcon(SetBoard.class.getResource(\"/images/aircraftCarrier.png\")));\n\n play.setBounds(487, 450, 120, 35);\n play.addActionListener(this);\n\n container.add(gridPlayer);\n\t\tcontainer.add(gridPc);\n container.add(exit);\n container.add(newGame);\n container.add(reset);\n container.add(hint);\n container.add(singleShot);\n container.add(commonShot);\n container.add(cascade);\n container.add(star);\n container.add(playerLabel);\n container.add(pc);\n container.add(stopwatch);\n container.add(aircraft);\n container.add(submarine);\n container.add(escortShip);\n container.add(aircraftCarrier);\n container.add(play);\n\n //distribui os vehicles aleatoriamente no board do computador\n distVehPc.distribui(arrayPc, tablePc);\n\n //copia os valuees do arrayPc para outro array, ele sera usado caso o jogo seja reiniciado\n for(int line = 0; line < 10; line++){\n for(int column = 0; column < 10; column++){\n arrayPcAux[line][column] = arrayPc[line][column];\n }\n }\n\n //desabilita a maioria dos botoes, eles serao reativados quando o player montar seu campo e clicar em \"play\"\n hint.setEnabled(false);\n singleShot.setEnabled(false);\n commonShot.setEnabled(false);\n cascade.setEnabled(false);\n star.setEnabled(false);\n play.setEnabled(false);\n newGame.setEnabled(false);\n reset.setEnabled(false);\n }", "public static void boardInit() {\n ArrayList<Piece> white_piece_list = new ArrayList<>();\n ArrayList<Piece> black_piece_list = new ArrayList<>();\n ArrayList<Piece> piece_array = PieceFactory.createPieces();\n for(Piece p : piece_array)\n {\n if(p.getColor())\n {\n black_piece_list.add(p);\n }\n else\n {\n white_piece_list.add(p);\n }\n }\n white_player.setpieceList(white_piece_list);\n white_player.setKingXYCoords(PieceFactory.KING_INITIAL_X, PieceFactory.INITAL_Y_COORD_WHITE_PLAYER_OTHER);\n black_player.setpieceList(black_piece_list);\n black_player.setKingXYCoords(PieceFactory.KING_INITIAL_X, PieceFactory.INITAL_Y_COORD_WHITE_PLAYER_OTHER + PieceFactory.DIST_BETWEEN_PIECES);\n }" ]
[ "0.79774475", "0.7949694", "0.76082414", "0.7529635", "0.75132203", "0.7510145", "0.7412442", "0.73742765", "0.7342881", "0.721082", "0.72035336", "0.7189667", "0.7159391", "0.7154018", "0.7116723", "0.7097022", "0.70653534", "0.7047614", "0.7027298", "0.692258", "0.69113266", "0.6902406", "0.6897715", "0.6896161", "0.687453", "0.6865324", "0.68598425", "0.68549645", "0.6845161", "0.6833997", "0.6831734", "0.68133694", "0.68040323", "0.6798919", "0.6791418", "0.67775476", "0.67652476", "0.676306", "0.67488205", "0.6736167", "0.67306423", "0.6724579", "0.67157143", "0.6701361", "0.66826516", "0.6675443", "0.66725147", "0.66652876", "0.666504", "0.66330373", "0.6630055", "0.66295624", "0.66225225", "0.66220623", "0.65990037", "0.6598423", "0.6597335", "0.65962857", "0.65910417", "0.6589763", "0.65870297", "0.65865016", "0.65785474", "0.6577337", "0.6574975", "0.6574186", "0.6573195", "0.6568885", "0.65643704", "0.6557645", "0.6552485", "0.6551504", "0.6546692", "0.6546215", "0.6543313", "0.6538177", "0.6537133", "0.6536349", "0.6534857", "0.6517525", "0.65115654", "0.6507978", "0.650473", "0.6504515", "0.6497178", "0.6493931", "0.6490111", "0.64882386", "0.6487052", "0.64862716", "0.6485042", "0.6476916", "0.6476765", "0.64663184", "0.6461396", "0.64612556", "0.6449484", "0.6438654", "0.643576", "0.643479" ]
0.65282977
79
Positions the pieces on the board depending on the amount of players playing
public int[] setUpBoard(int noOfPlayers) { switch(noOfPlayers) { //One player case 1: fillTriangle(-1, board, 1, 16, 12); return new int[] {1}; //Two players opposite to one another case 2: fillTriangle(-1, board, 1, 16, 12); fillTriangle(1, board, 4, 0, 4); return new int[] {1,4}; //Three players arranged in a triangle case 3: fillTriangle(1, board, 2, 9, 13); fillTriangle(1, board, 4, 0, 4); fillTriangle(1, board, 6, 9, 4); return new int[] {2,4,6}; //Four players with two empty spots opposite from one another case 4: fillTriangle(1, board, 2, 9, 13); fillTriangle(-1, board, 3, 7, 12); fillTriangle(-1, board, 5, 7, 3); fillTriangle(1, board, 6, 9, 4); return new int[] {2,3,5,6}; //Five players case 5: fillTriangle(-1, board, 1, 16, 12); fillTriangle(1, board, 2, 9, 13); fillTriangle(-1, board, 3, 7, 12); fillTriangle(1, board, 4, 0, 4); fillTriangle(-1, board, 5, 7, 3); return new int[] {1,2,3,4,5}; //All six positions occupied by players default: fillTriangle(-1, board, 1, 16, 12); fillTriangle(1, board, 2, 9, 13); fillTriangle(-1, board, 3, 7, 12); fillTriangle(1, board, 4, 0, 4); fillTriangle(-1, board, 5, 7, 3); fillTriangle(1, board, 6, 9, 4); return new int[] {1,2,3,4,5,6}; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setPieces(){\r\n Pawn[] arrwPawn = new Pawn[8];\r\n for (int i=0 ; i<8 ; i++){\r\n pos.setPosition(6,i);\r\n arrwPawn[i] = new Pawn (pos , piece.Colour.WHITE);\r\n GameBoard.putPiece(arrwPawn[i]);\r\n }\r\n\r\n Pawn[] arrbPawn = new Pawn[8];\r\n for(int i=0 ; i<8 ; i++){\r\n pos.setPosition(0,i);\r\n arrbPawn[i] = new Pawn(pos , piece.Colour.BLACK);\r\n GameBoard.putPiece(arrbPawn[i]);\r\n }\r\n\r\n\r\n //set black pieces in the board\r\n\r\n pos.setPosition(0,0);\r\n Rook bRook1 = new Rook(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bRook1);;\r\n\r\n pos.setPosition(0,7);\r\n Rook bRook2 = new Rook(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bRook2);\r\n\r\n\r\n pos.setPosition(0,1);\r\n Knight bKnight1 = new Knight(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKnight1);\r\n\r\n pos.setPosition(0,6);\r\n Knight bKnight2 = new Knight(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKnight1);\r\n\r\n pos.setPosition(0,2);\r\n Bishop bBishop1 = new Bishop(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bBishop1);\r\n\r\n pos.setPosition(0,5);\r\n Bishop bBishop2 = new Bishop(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bBishop2);\r\n\r\n pos.setPosition(0,3);\r\n Queen bQueen = new Queen(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bQueen);\r\n\r\n pos.setPosition(0,4);\r\n King bKing = new King(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKing);\r\n\r\n //set white pieces in the board\r\n\r\n pos.setPosition(7,0);\r\n Rook wRook1 = new Rook(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wRook1);\r\n\r\n pos.setPosition(7,7);\r\n Rook wRook2 = new Rook(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wRook2);\r\n\r\n pos.setPosition(7,1);\r\n Knight wKnight1 = new Knight(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKnight1);\r\n\r\n pos.setPosition(7,6);\r\n Knight wKnight2 = new Knight(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKnight1);\r\n\r\n pos.setPosition(7,2);\r\n Bishop wBishop1 = new Bishop(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wBishop1);\r\n\r\n pos.setPosition(7,5);\r\n Bishop wBishop2 = new Bishop(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wBishop2);\r\n\r\n pos.setPosition(7,3);\r\n Queen wQueen = new Queen(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wQueen);\r\n\r\n pos.setPosition(7,4);\r\n King wKing = new King(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKing);\r\n\r\n\r\n\r\n Rook arrwRook[] = {wRook1,wRook2};\r\n Rook arrbRook[] = {bRook1,bRook2};\r\n Queen arrwQueen[] = {wQueen};\r\n Queen arrbQueen[] = {bQueen};\r\n Knight arrwKnight[] = {wKnight1,wKnight2};\r\n Knight arrbKnight[] = {bKnight1,bKnight2};\r\n King arrwKing[] = {wKing};\r\n King arrbKing[] = {bKing};\r\n Bishop arrwBishop[] = {wBishop1,wBishop2};\r\n Bishop arrbBishop[] = {bBishop1,bBishop2};\r\n }", "public final void initialPosition() {\n\t\tfor( int i = 0; i < 4; i++) {\n\t\t setPiece( new PieceImpl( Color.RED, Type.PAWN), new PositionImpl( 38 + 8*i));\n\t\t}\n\t\tfor( int i = 0; i < 4; i++) {\n\t\t setPiece( new PieceImpl( Color.BLACK, Type.PAWN), new PositionImpl( 12 + i));\n\t\t}\n\t\tfor( int i = 0; i < 4; i++) {\n\t\t setPiece( new PieceImpl( Color.YELLOW, Type.PAWN), new PositionImpl( 1 + 8*i));\n\t\t}\n\t\tfor( int i = 0; i < 4; i++) {\n\t\t setPiece( new PieceImpl( Color.GREEN, Type.PAWN), new PositionImpl( 48 + i));\n\t\t}\n\t\t\n\t\tsetPiece( new PieceImpl( Color.RED, Type.BOAT), new PositionImpl( 63 ));\n\t\tsetPiece( new PieceImpl( Color.RED, Type.KNIGHT), new PositionImpl( 55 ));\n\t\tsetPiece( new PieceImpl( Color.RED, Type.ELEPHANT), new PositionImpl( 47 ));\n\t\tsetPiece( new PieceImpl( Color.RED, Type.KING), new PositionImpl( 39 ));\n\t\t\n\t\tsetPiece( new PieceImpl( Color.BLACK, Type.BOAT), new PositionImpl( 7 ));\n\t\tsetPiece( new PieceImpl( Color.BLACK, Type.KNIGHT), new PositionImpl( 6 ));\n\t\tsetPiece( new PieceImpl( Color.BLACK, Type.ELEPHANT), new PositionImpl( 5 ));\n\t\tsetPiece( new PieceImpl( Color.BLACK, Type.KING), new PositionImpl( 4 ));\n\n\t\tsetPiece( new PieceImpl( Color.YELLOW, Type.BOAT), new PositionImpl( 0 ));\n\t\tsetPiece( new PieceImpl( Color.YELLOW, Type.KNIGHT), new PositionImpl( 8 ));\n\t\tsetPiece( new PieceImpl( Color.YELLOW, Type.ELEPHANT), new PositionImpl( 16 ));\n\t\tsetPiece( new PieceImpl( Color.YELLOW, Type.KING), new PositionImpl( 24 ));\n\n\t\tsetPiece( new PieceImpl( Color.GREEN, Type.BOAT), new PositionImpl( 56 ));\n\t\tsetPiece( new PieceImpl( Color.GREEN, Type.KNIGHT), new PositionImpl( 57 ));\n\t\tsetPiece( new PieceImpl( Color.GREEN, Type.ELEPHANT), new PositionImpl( 58 ));\n\t\tsetPiece( new PieceImpl( Color.GREEN, Type.KING), new PositionImpl( 59 ));\n\t\t\n }", "public void setInitialPosition()\n {\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.a2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.b2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.c2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.d2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.e2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.f2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.g2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.h2);\n //Se colocan los peones negros en la séptima fila\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.a7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.b7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.c7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.d7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.e7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.f7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.g7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.h7);\n //Se colocan las torres blancas en a1 y h1\n putGenericPiece(GenericPiece.ROOK,Colour.WHITE,Square.a1);\n putGenericPiece(GenericPiece.ROOK,Colour.WHITE,Square.h1);\n //Se colocan las torres negras en a8 y h9\n putGenericPiece(GenericPiece.ROOK,Colour.BLACK,Square.a8);\n putGenericPiece(GenericPiece.ROOK,Colour.BLACK,Square.h8);\n //Se colocan los caballos blancos en b1 y g1\n putGenericPiece(GenericPiece.KNIGHT,Colour.WHITE,Square.b1);\n putGenericPiece(GenericPiece.KNIGHT,Colour.WHITE,Square.g1);\n //Se colocan los caballos negros en b8 y g8\n putGenericPiece(GenericPiece.KNIGHT,Colour.BLACK,Square.b8);\n putGenericPiece(GenericPiece.KNIGHT,Colour.BLACK,Square.g8);\n //Se colocan los alfiles blancos en c1 y f1\n putGenericPiece(GenericPiece.BISHOP,Colour.WHITE,Square.c1);\n putGenericPiece(GenericPiece.BISHOP,Colour.WHITE,Square.f1);\n //Se colocan los alfiles negros en c8 y f8\n putGenericPiece(GenericPiece.BISHOP,Colour.BLACK,Square.c8);\n putGenericPiece(GenericPiece.BISHOP,Colour.BLACK,Square.f8);\n //Se coloca la dama blanca en d1\n putGenericPiece(GenericPiece.QUEEN,Colour.WHITE,Square.d1);\n //Se coloca la dama negra en d8\n putGenericPiece(GenericPiece.QUEEN,Colour.BLACK,Square.d8);\n //Se coloca el rey blanco en e1\n putGenericPiece(GenericPiece.KING,Colour.WHITE,Square.e1);\n //Se coloca el rey negro en e8\n putGenericPiece(GenericPiece.KING,Colour.BLACK,Square.e8);\n \n //Se permiten los enroques para ambos jugadores\n setCastlingShort(Colour.WHITE,true);\n setCastlingShort(Colour.BLACK,true);\n setCastlingLong(Colour.WHITE,true);\n setCastlingLong(Colour.BLACK,true);\n \n //Se da el turno a las blancas\n setTurn(Colour.WHITE);\n \n gamePositionsHash.clear();\n gamePositionsHash.put(zobristKey.getKey(), 1);\n }", "void changepos(MouseEvent e, pieces chessPiece) \n { \n for(int beta : chessPiece.movnum)\n { \n if (chessPiece.color == 0 && e.getSource()== panel[beta-1 ]&& chessPiece.select == true && Checkerboard.allWhitePositions.contains(beta-1) == false)\n {\n if(this.getPiece(beta-1) != null)\n { \n getPiece(beta-1).alive = false;\n \n \n \n panel[beta-1].removeAll();/*getPiece(beta-1).position = 64;*/\n }\n chessPiece.position = beta-1;\n chessPiece.movnum.clear();\n chessPiece.mov.clear();\n chessPiece.select = false;\n chessPiece.timesMoved++;\n whiteToPlay = false;\n }\n else if (chessPiece.color == 1 && e.getSource()== panel[beta-1 ]&& chessPiece.select == true && Checkerboard.allBlackPositions.contains(beta-1) == false)\n {\n if(this.getPiece(beta-1) != null)\n { \n getPiece(beta-1).alive = false; \n panel[beta-1].removeAll();/*getPiece(beta-1).position = 64;*/}\n chessPiece.position = beta-1;\n chessPiece.movnum.clear();\n chessPiece.mov.clear();\n chessPiece.select = false;\n chessPiece.timesMoved++;\n whiteToPlay = true;\n }\n }//for ends\n \n }", "private void setupPlayerPosition() {\n\t\tHashMap<Suspect, Coordinates> startPositions = new HashMap<Suspect, Coordinates>();\r\n\t\tstartPositions.put(Suspect.KasandraScarlet, new Coordinates(18, 28));\r\n\t\tstartPositions.put(Suspect.JackMustard, new Coordinates(7, 28));\r\n\t\tstartPositions.put(Suspect.DianeWhite, new Coordinates(0, 19));\r\n\t\tstartPositions.put(Suspect.JacobGreen, new Coordinates(0, 9));\r\n\t\tstartPositions.put(Suspect.EleanorPeacock, new Coordinates(6, 0));\r\n\t\tstartPositions.put(Suspect.VictorPlum, new Coordinates(20, 0));\r\n\r\n\t\tfor (int i = 0; i < this.listOfPlayer.size(); i++) {\r\n\t\t\tPlayer p = this.listOfPlayer.get(i);\r\n\t\t\tSuspect sus = p.getSuspect().getData();\r\n\t\t\tboolean b = p.setCoord(startPositions.get(sus), this.grid);\r\n\t\t\t// should always be able to put character on starting position\r\n\t\t}\r\n\t\tSystem.out.println(\"Initial player starting positions set\");\r\n\t}", "public static void updatePositions() {\n\t\tfor(Square s1 : ChessBoard.BOARD_SQUARES) {\n\t\t\tif(s1.hasPiece()) {\n\t\t\t\t(s1.getPiece()).setPosition(s1.getPosition());\n\t\t\t\t(s1.getPiece()).updatePossibleMoves();\n\t\t\t}\n\t\t}\n\t}", "private void placePiece() {\r\n pieces[numPieces] = getRandomPoint();\r\n Game.movePiece(new PositionData(-1,-1,Constants.PLAYER_A_ID), pieces[numPieces]);\r\n numPieces++;\r\n }", "public void setPlayersPiece(int a_playersPiece) {\n this.playersPiece = a_playersPiece;\n }", "public void moveEverythingALittle(){\n //ponieważ wszystko idealnie jest zsynchronizowane to else nie wykona sie gdy current = getDestination\n if(player.getCurrentX()<player.getDestinationX())\n player.currentX += 1;\n else if(player.getCurrentX()>player.getDestinationX())\n player.currentX -= 1;\n\n if( player.getCurrentY()<player.getDestinationY())\n player.currentY += 1;\n else if( player.getCurrentY()>player.getDestinationY())\n player.currentY -= 1;\n\n for(int i = 0; i < boxes.size(); i++){\n Box item = boxes.get(i);\n if(item.getCurrentX()<item.getDestinationX())\n item.currentX += 1;\n else if(item.getCurrentX()>item.getDestinationX())\n item.currentX -= 1;\n\n if( item.getCurrentY()<item.getDestinationY())\n item.currentY += 1;\n else if ( item.getCurrentY()>item.getDestinationY())\n item.currentY -= 1;\n }\n }", "private void assignPlayerPieces(List<Pair<Player, Integer>> playerOrder) {\n Collections.sort(playerOrder, Comparator.comparing(p -> -p.getValue()));\n\n for (int i = 0; i < playerOrder.size(); i++) {\n playerOrder.get(i).getKey().setPiece(this.playerPieces.get(i));\n }\n locAtTurnStart = currentPlayersTurn.getPiece().getLocation();\n }", "public void start() {\n clear();\n // Assigning chess pieces to players.\n whitePieces.add(new Piece(Owner.WHITE, Who.KING, Rank.R1, File.E));\n whitePieces.add(new Piece(Owner.WHITE, Who.QUEEN, Rank.R1, File.D));\n whitePieces.add(new Piece(Owner.WHITE, Who.ROOK, Rank.R1, File.A));\n whitePieces.add(new Piece(Owner.WHITE, Who.ROOK, Rank.R1, File.H));\n whitePieces.add(new Piece(Owner.WHITE, Who.BISHOP, Rank.R1, File.C));\n whitePieces.add(new Piece(Owner.WHITE, Who.BISHOP, Rank.R1, File.F));\n whitePieces.add(new Piece(Owner.WHITE, Who.KNIGHT, Rank.R1, File.B));\n whitePieces.add(new Piece(Owner.WHITE, Who.KNIGHT, Rank.R1, File.G));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.A));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.B));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.C));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.D));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.E));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.F));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.G));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.H));\n\n for (Piece p : whitePieces) {\n board[p.row.ordinal()][p.col.ordinal()] = p;\n }\n\n blackPieces.add(new Piece(Owner.BLACK, Who.KING, Rank.R8, File.E));\n blackPieces.add(new Piece(Owner.BLACK, Who.QUEEN, Rank.R8, File.D));\n blackPieces.add(new Piece(Owner.BLACK, Who.ROOK, Rank.R8, File.A));\n blackPieces.add(new Piece(Owner.BLACK, Who.ROOK, Rank.R8, File.H));\n blackPieces.add(new Piece(Owner.BLACK, Who.BISHOP, Rank.R8, File.C));\n blackPieces.add(new Piece(Owner.BLACK, Who.BISHOP, Rank.R8, File.F));\n blackPieces.add(new Piece(Owner.BLACK, Who.KNIGHT, Rank.R8, File.B));\n blackPieces.add(new Piece(Owner.BLACK, Who.KNIGHT, Rank.R8, File.G));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.A));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.B));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.C));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.D));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.E));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.F));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.G));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.H));\n\n for (Piece p : blackPieces) {\n board[p.row.ordinal()][p.col.ordinal()] = p;\n }\n\n whoseTurn = Owner.WHITE;\n canCastle = 15;\n passer = null;\n movesDone = lastEatMove = 0;\n }", "@Test\n public void testPawnPosition() {\n // initialize the complete chess board\n ChessBoard chessBoard = init(\"CHESS\");\n\n // compare the position of the pawn on the table to the correct position\n for (int i = 0; i < 8; ++i) {\n assertEquals(1, chessBoard.getPiece(1, i).getRow());\n assertEquals(i, chessBoard.getPiece(1, i).getColumn());\n\n assertEquals(6, chessBoard.getPiece(6, i).getRow());\n assertEquals(i, chessBoard.getPiece(6, i).getColumn());\n }\n }", "public void putPieceOnBoard(ChessBoardBlock b, String player) {\r\n\t\tint blackCount = getBlackCountInVector();\r\n\t\tint whiteCount = getWhiteCountInVector();\r\n\t\tif (blackCount == 12 && whiteCount == 12) {\r\n\t\t\tt.setText(\"<html>black:\" + getBlackCountInVector() + \" white:\" + getWhiteCountInVector() + \"<br>Cannot put any more pieces on</html>\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (blackCount == 12 && player.equals(\"black\")) {\r\n\t\t\tt.setText(\"<html>black:\" + getBlackCountInVector() + \" white:\" + getWhiteCountInVector() + \"<br>Black pieces are maximum</html>\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (whiteCount == 12 && player.equals(\"white\")) {\r\n\t\t\tt.setText(\"<html>black:\" + getBlackCountInVector() + \" white:\" + getWhiteCountInVector() + \"<br>White pieces are maximum</html>\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tString position = b.position;\r\n\t\tChessPiece tmpPiece;\r\n\t\tif (player.equals(\"black\")) {\r\n\t\t\ttmpPiece = blackPieces[blackCount];\r\n\t\t\tSystem.out.println(player);\r\n\r\n\t\t\t// Set 'K' label\r\n\t\t\tif (position.equals(\"A1\")||position.equals(\"B1\")||position.equals(\"C1\")||position.equals(\"D1\")||\r\n\t\t\t\tposition.equals(\"E1\")||position.equals(\"F1\")||position.equals(\"G1\")||position.equals(\"H1\")) {\r\n\t\t\t\ttmpPiece.setText(\"<html><font color=\\\"white\\\">K</font></html>\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\ttmpPiece = whitePieces[whiteCount];\r\n\r\n\t\t\t// Set 'K' label\r\n\t\t\tif (position.equals(\"A8\")||position.equals(\"B8\")||position.equals(\"C8\")||position.equals(\"D8\")||\r\n\t\t\t\tposition.equals(\"E8\")||position.equals(\"F8\")||position.equals(\"G8\")||position.equals(\"H8\")) {\r\n\t\t\t\ttmpPiece.setText(\"<html><font color=\\\"black\\\">K</font></html>\");\r\n\t\t\t}\r\n\t\t}\r\n\t\ttmpPiece.position = position;\r\n\t\tpiece.put(position, tmpPiece);\r\n\t\tbody.add(tmpPiece);\r\n\t\treFormatPieceLayer();\r\n\r\n\t\tt.setText(\"<html>black:\" + getBlackCountInVector() + \" white:\" + getWhiteCountInVector() + \"</html>\");\r\n\t}", "public boolean move(int x, int y, CheckersBoard board) {\n if (whiteTurn == true && team == Constants.TeamId.team1Id) {\n return false;\n }\n if (whiteTurn == false && team == Constants.TeamId.team2Id) {\n return false;\n }\n /**\n * then change the x - y coords of the piece\n * update the UI to remove the highlighted squares then move the piece\n * if chess and shared square you take a piece\n * if checkers you jumped them you take the piece\n * return new x - y components\n *\n * if this is too high up in the tree you can override this implementation or update it\n * to fit specific pieces if its not working for some reason\n */\n if (possible(x, y, gameBoard)) {\n int changex = this.getX()-x;\n int changey = this.getY()-y;\n CheckersPiece temp = gameBoard.boardPositions[getX()][getY()];\n gameBoard.boardPositions[getX()][getY()] = null;\n gameBoard.boardPositions[x][y] = temp;\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] != null) {\n System.out.println(\"Here\");\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].team != this.team) {\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].imageView.setVisibility(View.GONE);\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] = null;\n }\n }\n this.setX(x);\n this.setY(y);/*\n if (Math.abs(changex) == 2) {\n gameBoard.boardPositions[x + (changex/2)][y + (changey/2)] = null;\n if (team == Constants.TeamId.team1Id) {\n board.numPieces1--;\n } else if (team == Constants.TeamId.team2Id) {\n board.numPieces0--;\n }\n }*/\n\n gameBoard.boardPositions[x][y].imageView.setX(142*x);\n gameBoard.boardPositions[x][y].imageView.setY(142*y);\n // flips after move is\n whiteTurn = !whiteTurn;\n gameBoard.startTimer();\n }\n //setUpUI(gameBoard);\n if (getY() == 7 && team == Constants.TeamId.team2Id) {\n board.crown(this);\n }\n if (getY() == 0 && team == Constants.TeamId.team1Id) {\n board.crown(this);\n }\n return possible(x, y, gameBoard);\n }", "@Override\n\tpublic void mousePressed(MouseEvent e) {\n\t\tint po=0;\n\t\t\n\t\tif(pos<=5)\n\t\t{\n\t\t\tplayer=false;\n\t\t}\n\t\tint i=pos+1;\n\t\tint amount= scores.get(pos);\n\t\tboolean t= true;\n\t\tif(pos==0)\n\t\t{\n\t\t\ti=6;\n\t\t\tif(player==false)\n\t\t\t{\n\t\t\t\tamount--;\n\t\t\t\tif(amount>0)\n\t\t\t\t{\n\t\t\t\t\tboard.add1();\n\t\t\t\t\tcontainer.setIcon(board);\n\t\t\t\t\tcontainer.repaint();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(pos==11)\n\t\t{\n\t\t\ti=5;\n\t\t\tt=false;\n\t\t\tif(player==true)\n\t\t\t{\n\t\t\t\tamount--;\n\t\t\t\tif(amount>0)\n\t\t\t\t{\n\t\t\t\t\tboard.add2();\n\t\t\t\t\tcontainer.setIcon(board);\n\t\t\t\t\tcontainer.repaint();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if(pos<=5)\n\t\t{\n\t\t\tt=false;\n\t\t\ti=pos-1;\n\t\t}\n\t\tthis.move(pos);\n\t\twhile(amount>0)\n\t\t{\n\t\t\t pitList.get(i).add();\n\t\t\t labelList.get(i).setIcon(pitList.get(i));\n\t\t pits.add(labelList.get(i));\n\t\t labelList.get(i).repaint();\n\t\t scores.set(i,scores.get(i)+1);\n\t\t \n\t\t\tif(i==11)\n\t\t\t{\n\t\t\t\ti=6;\n\t\t\t\tt=false;\n\t\t\t\tif(player==true)\n\t\t\t\t{\n\t\t\t\t\tamount--;\n\t\t\t\t\tif(amount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tboard.add2();\n\t\t\t\t\t\tcontainer.setIcon(board);\n\t\t\t\t\t\tcontainer.repaint();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(i==0)\n\t\t\t{\n\t\t\t\ti=5;\n\t\t\t\tt=true;\n\t\t\t\tif(player==false)\n\t\t\t\t{\n\t\t\t\t\tamount--;\n\t\t\t\t\tif(amount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tboard.add1();\n\t\t\t\t\t\tcontainer.setIcon(board);\n\t\t\t\t\t\tcontainer.repaint();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(t==true)\n\t\t\t{\n\t\t\t\ti++;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ti--;\n\t\t\t}\n\t\t\tamount--;\n\t\t}\n\t\tfor(int f=0;f<12;f++)\n\t\t{\n\t\t\tif(scores.get(f)==0)\n\t\t\t{\n\t\t\t\tpo++;\n\t\t\t}\n\t\t\tif(po==12)\n\t\t\t{\n\t\t\t\tif(board.possible.size()>board.possible2.size())\n\t\t\t\t{\n\t\t\t\t\tJFrame pop = new JFrame();\n\t\t\t\t\tpop.add(new JTextField(\"Player B WON!!!!!\"));\n\t\t\t\t\tpop.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);\n\t\t\t pop.pack();\n\t\t\t pop.setVisible(true);\n\t\t\t main.setBackground(Color.GREEN);\n\t\t\t return;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tJFrame pop = new JFrame();\n\t\t\t\t\tpop.add(new JTextField(\"Player A WON!!!!!\"));\n\t\t\t\t\tpop.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);\n\t\t\t pop.pack();\n\t\t\t pop.setVisible(true);\n\t\t\t main.setBackground(Color.red);\n\t\t\t return;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "private void placePieces(List<Piece> pieces) {\r\n pieces.forEach(\r\n piece -> {\r\n grid[piece.getPosition()] = piece;\r\n // if key doesn't exist create new with array containing piece\r\n // if it does exist add piece to existing array\r\n this.pieces.merge(\r\n piece.getPlayerColor(),\r\n new ArrayList<>(Collections.singletonList(piece)),\r\n (o, n) -> {\r\n o.add(piece);\r\n return o;\r\n });\r\n });\r\n }", "public void placePiece(final double x, final double y) {\n\t\t// translate the x, y coordinates into cell indexes\n\t\tint indexx = (int) (x / cell_width);\n\t\tint indexy = (int) (y / cell_height);\n\t\t\n\t\t// if the position is empty then place a piece and swap the players\n\t\tif (board[indexx][indexy] == EMPTY && current_player == XPIECE) {\n\t\t\tboard[indexx][indexy] = XPIECE;\n\t\t\trenders[indexx][indexy] = new XOPiece(XPIECE);\n\t\t\trenders[indexx][indexy].resize(cell_width, cell_height);\n\t\t\trenders[indexx][indexy].relocate(indexx * cell_width, indexy * cell_height);\n\t\t\tgetChildren().add(renders[indexx][indexy]);\n\t\t\tcurrent_player = OPIECE;\n\t\t} else if (board[indexx][indexy] == EMPTY && current_player == OPIECE) {\n\t\t\tboard[indexx][indexy] = OPIECE;\n\t\t\trenders[indexx][indexy] = new XOPiece(OPIECE);\n\t\t\trenders[indexx][indexy].resize(cell_width, cell_height);\n\t\t\trenders[indexx][indexy].relocate(indexx * cell_width, indexy * cell_height);\n\t\t\tgetChildren().add(renders[indexx][indexy]);\n\t\t\tcurrent_player = XPIECE;\n\t\t}\n\t}", "@Test\n public void shouldBeAbleToInitializeWithPieces() {\n Player p1 = new Player(ChessPieceColor.WHITE, position);\n Player p2 = new Player(ChessPieceColor.BLACK, position);\n for (int i = 0; i < position.getSize(); i++) {\n Assert.assertNotNull(position.getPieceAtPosition(i, 0)); // Regular pieces\n Assert.assertNotNull(position.getPieceAtPosition(i, 1)); // Pawns\n Assert.assertNotNull(position.getPieceAtPosition(i, 7)); // Regular pieces\n Assert.assertNotNull(position.getPieceAtPosition(i, 6)); // Pawns\n }\n }", "void showpos(pieces chesspiece)\n {if(chesspiece.alive == true)\n {\n int position = chesspiece.position;\n chesspiece.select = true;\n \n int x;int y;\n if((position+1)%8 == 0) {x = 8; y = (position+8)/8;}\n else{ x = (position+1)%8;\n y = (position+9)/8;}\n chesspiece.move(new moves(x,y));\n for( int a : chesspiece.movnum )\n {\n if ( chesspiece.color == 0)\n {\n if (Checkerboard.allWhitePositions.contains(a-1)== true)\n panel[a-1].setBackground(Color.GRAY);\n else if (Checkerboard.allBlackPositions.contains(a-1)== true)\n panel[a-1].setBackground(Color.RED);\n else\n panel[a-1].setBackground(Color.GREEN);\n }\n else\n {\n if (Checkerboard.allWhitePositions.contains(a-1)== true)\n panel[a-1].setBackground(Color.RED);\n else if (Checkerboard.allBlackPositions.contains(a-1)== true)\n panel[a-1].setBackground(Color.GRAY);\n else\n panel[a-1].setBackground(Color.GREEN);\n }\n \n }\n }//if(chesspiece.alive==true) ends\n }", "public void initChessBoardAutomaticly() {\r\n\t\tthis.initPieces();\r\n\t\tthis.clearBoard();\r\n\t\tfor (int i=0; i<board.size(); i++) {\r\n\t\t\tChessBoardBlock b = board.get(order[i]);\r\n\t\t\tb.setBorderPainted(false);\r\n\t\t}\r\n\t\tfor (int i = 0, w = 0, b = 0, s = 0; i < 8 * 8; i++) {\r\n\r\n\t\t\t// Assign1, Disable board clickable\r\n\t\t\tChessBoardBlock block = board.get(order[i]);\r\n\t\t\tblock.setEnabled(false);\r\n\r\n\t\t\t// Assign1, Put black pieces and record the position\r\n\t\t\tif (i % 2 != 1 && i >= 8 && i < 16) {\r\n\t\t\t\tChessPiece blackPiece = blackPieces[b];\r\n\t\t\t\tblackPiece.position = order[i];\r\n\t\t\t\tpiece.put(order[i], blackPiece);\r\n\t\t\t\tbody.add(blackPiece);\r\n\t\t\t\tb++;\r\n\t\t\t} else if (i % 2 != 0 && (i < 8 || (i > 16 && i < 24))) {\r\n\t\t\t\tChessPiece blackPiece = blackPieces[b];\r\n\t\t\t\tblackPiece.position = order[i];\r\n\r\n\t\t\t\tpiece.put(order[i], blackPiece);\r\n\t\t\t\tbody.add(blackPiece);\r\n\t\t\t\tb++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Assign1, Put white pieces and record the position\r\n\t\t\telse if (i % 2 != 0 && i > 48 && i < 56) {\r\n\t\t\t\tChessPiece whitePiece = whitePieces[w];\r\n\t\t\t\twhitePiece.position = order[i];\r\n\t\t\t\tpiece.put(order[i], whitePiece);\r\n\t\t\t\tbody.add(whitePiece);\r\n\t\t\t\tw++;\r\n\t\t\t} else if (i % 2 != 1\r\n\t\t\t\t\t&& ((i >= 40 && i < 48) || (i >= 56 && i < 64))) {\r\n\t\t\t\tChessPiece whitePiece = whitePieces[w];\r\n\t\t\t\twhitePiece.position = order[i];\r\n\t\t\t\t\r\n\t\t\t\tpiece.put(order[i], whitePiece);\r\n\t\t\t\tbody.add(whitePiece);\r\n\t\t\t\tw++;\r\n\t\t\t}\r\n\r\n\t\t\t// Assign1, Put empty pieces on the board\r\n\t\t\t// Actually, empty pieces will not display on the board, they are\r\n\t\t\t// not existing\r\n\t\t\t// to chess players, just for calculation\r\n\t\t\telse {\r\n\t\t\t\tChessPiece spacePiece = spacePieces[s];\r\n\t\t\t\tspacePiece.position = order[i];\r\n\t\t\t\tbody.add(spacePiece);\r\n\t\t\t\tpiece.put(order[i], spacePiece);\r\n\t\t\t\tspacePiece.setVisible(false);\r\n\t\t\t\ts++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tt.setText(\"Chess Board has been initialized automatically\");\r\n\t\tthis.startGame();\r\n\t}", "public void playTheGame() {\n\t\tint column;\n\t\ttry {\n\t\t\tboolean gameIsOver = false;\n\t\t\tfor (int count = 0; count < thePlayers.length; count++)\n\t\t\t\tthePlayers[count].getView().showOutput(\n\t\t\t\t\t\taConnect4Field.toString());\n\n\t\t\tdo {\n\t\t\t\tfor (int index = 0; index < thePlayers.length; index++) {\n\t\t\t\t\t// thePlayers[index].getView().showOutput(aConnect4Field.toString());\n\t\t\t\t\tif (aConnect4Field.isItaDraw()) {\n\t\t\t\t\t\tfor (int count = 0; count < thePlayers.length; count++)\n\t\t\t\t\t\t\tthePlayers[count].getView().showOutput(\"Draw\");\n\t\t\t\t\t\tgameIsOver = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthePlayers[index].getView().showOutput(\n\t\t\t\t\t\t\t\tthePlayers[index].getName()\n\t\t\t\t\t\t\t\t\t\t+ \" it's Your Turn! play your move\");\n\t\t\t\t\t\tcolumn = thePlayers[index].nextMove();\n\t\t\t\t\t\twhile (!aConnect4Field\n\t\t\t\t\t\t\t\t.checkIfPiecedCanBeDroppedIn(column)) {\n\t\t\t\t\t\t\tthePlayers[index].getView().showOutput(\n\t\t\t\t\t\t\t\t\t\"Invalid Turn Try again\");\n\t\t\t\t\t\t\tcolumn = thePlayers[index].nextMove();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\taConnect4Field.dropPieces(column,\n\t\t\t\t\t\t\t\tthePlayers[index].getGamePiece());\n\t\t\t\t\t\tfor (int count = 0; count < thePlayers.length; count++)\n\t\t\t\t\t\t\tthePlayers[count].getView().showOutput(\n\t\t\t\t\t\t\t\t\taConnect4Field.toString());\n\t\t\t\t\t\tif (aConnect4Field.error != \"\") {\n\n\t\t\t\t\t\t\tthePlayers[index].getView().showOutput(\n\t\t\t\t\t\t\t\t\taConnect4Field.error);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (aConnect4Field.didLastMoveWin()) {\n\t\t\t\t\t\t\t\tgameIsOver = true;\n\t\t\t\t\t\t\t\t// all player get to know\n\t\t\t\t\t\t\t\tfor (int count = 0; count < thePlayers.length; count++)\n\t\t\t\t\t\t\t\t\tthePlayers[count].getView().showOutput(\n\t\t\t\t\t\t\t\t\t\t\t\"The winner is: \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ thePlayers[index]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getName());\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} while (!gameIsOver);\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "public void initializeBoard() {\n\n\t\t/*\n\t\t * How the array coordinates align with the actual chess board\n\t\t * (row,col) \n\t\t * (7,0) ... ... ... \n\t\t * (7,7) ... ... ... \n\t\t * ... ... ... \n\t\t * (2,0) ...\n\t\t * (1,0) ... \n\t\t * (0,0) ... ... ... (0,7)\n\t\t */\n\n\t\tboolean hasMoved = false;\n\t\tboolean white = true;\n\t\tboolean black = false;\n\n\t\t// Set white piece row\n\t\tboard[0][0] = new Piece('r', white, hasMoved, 0, 0, PieceArray.A_rookId);\n\t\tboard[0][1] = new Piece('n', white, hasMoved, 0, 1, PieceArray.B_knightId);\n\t\tboard[0][2] = new Piece('b', white, hasMoved, 0, 2, PieceArray.C_bishopId);\n\t\tboard[0][3] = new Piece('q', white, hasMoved, 0, 3, PieceArray.D_queenId);\n\t\tboard[0][4] = new Piece('k', white, hasMoved, 0, 4, PieceArray.E_kingId);\n\t\tboard[0][5] = new Piece('b', white, hasMoved, 0, 5, PieceArray.F_bishopId);\n\t\tboard[0][6] = new Piece('n', white, hasMoved, 0, 6, PieceArray.G_knightId);\n\t\tboard[0][7] = new Piece('r', white, hasMoved, 0, 7, PieceArray.H_rookId);\n\n\t\t// Set white pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[1][i] = new Piece('p', white, hasMoved, 1, i, i + 8);\n\t\t}\n\n\t\t// Set empty rows\n\t\tfor (int row = 2; row < 6; row++)\n\t\t\tfor (int col = 0; col < 8; col++)\n\t\t\t\tboard[row][col] = null;\n\n\t\t// Set black pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[6][i] = new Piece('p', black, hasMoved, 6, i, i+8);\n\t\t}\n\n\t\t// Set black piece row\n\t\tboard[7][0] = new Piece('r', black, hasMoved, 7, 0, PieceArray.A_rookId);\n\t\tboard[7][1] = new Piece('n', black, hasMoved, 7, 1, PieceArray.B_knightId);\n\t\tboard[7][2] = new Piece('b', black, hasMoved, 7, 2, PieceArray.C_bishopId);\n\t\tboard[7][3] = new Piece('q', black, hasMoved, 7, 3, PieceArray.D_queenId);\n\t\tboard[7][4] = new Piece('k', black, hasMoved, 7, 4, PieceArray.E_kingId);\n\t\tboard[7][5] = new Piece('b', black, hasMoved, 7, 5, PieceArray.F_bishopId);\n\t\tboard[7][6] = new Piece('n', black, hasMoved, 7, 6, PieceArray.G_knightId);\n\t\tboard[7][7] = new Piece('r', black, hasMoved, 7, 7, PieceArray.H_rookId);\n\t}", "public Snake() \n {\n //Specifiying a dimension object : for frame\n Dimension obj=new Dimension(800,800);\n setPreferredSize(obj);\n //Making the current frame into flowlayout to house the board and play options\n setLayout(new FlowLayout());\n JPanel pane1=new JPanel();\n //Grid layout for the board\n pane1.setLayout(new GridLayout(6,6));\n //Setting border \n pane1.setBorder(BorderFactory.createLineBorder(Color.black));\n //Setting the board size\n pane1.setPreferredSize(new Dimension(600,600));\n add(pane1);\n \n JPanel pane2=new JPanel();\n add(pane2);\n \n Dice=new JButton(\"P1 Roll Dice\");\n pane2.add(Dice);\n DiceVal=new JTextArea(\"0\");\n DiceVal.setPreferredSize(new Dimension(50,20));\n pane2.add(DiceVal);\n \n Player1=new JButton(\"Move P1\");\n Player2=new JButton(\"Move P2\");\n P1=new JTextArea(\"0\");\n P1.setPreferredSize(new Dimension(50,20));\n P2=new JTextArea(\"0\");\n P2.setPreferredSize(new Dimension(50,20));\n \n Reset=new JButton(\"Reset\");\n \n //Add all components to the frame\n pane2.add(Player1);\n pane2.add(P1);\n pane2.add(Player2);\n pane2.add(P2);\n pane2.add(Reset);\n \n setPreferredSize(obj); \n \n int arr[]=new int[36];\n \n int j=36;\n //Creating the board : using blocks \n for(int i=0;i<36;i++)\n {\n //if((i/6)%2==0) \n \n block[i]=new JPanel(new BorderLayout());\n block[i].setBorder(new EmptyBorder(10, 10, 10, 10));\n block[i].setPreferredSize(new Dimension(100,100));\n //Alternate blocks of lightgray and red color \n int temp=(i/6)%2;\n if(temp==0)\n {\n if(i%2==0)\n block[i].setBackground(Color.lightGray);\n else\n block[i].setBackground(Color.red);\n }\n else\n {\n if(i%2==0)\n block[i].setBackground(Color.red);\n else\n block[i].setBackground(Color.lightGray);\n }\n \n //Also creating labels for each block \n number[i]=new JLabel();\n number[i].setText(new Integer(i+1).toString());\n \n if(i==0)\n {\n number[i].setText(\"START: P1 P2 \");\n }\n \n if(i==35)\n {\n number[i].setText(\" FINISH\");\n }\n //Setting border for each block\n block[i].setBorder(BorderFactory.createLineBorder(Color.black));\n //adding the block to the gridlayout\n pane1.add(block[i]);\n //adding the number label to the block\n block[i].add(number[i]);\n \n \n //Creating ladders\n if(i==8 || i==21 || i==17)\n {\n JLabel piece = new JLabel(new ImageIcon(\"ladder.png\"));\n JLabel numb=new JLabel();\n numb.setText(new Integer(i+1).toString());\n piece.setText(new Integer(i+1).toString());\n block[i].add(piece);\n }\n \n //Creating snakes\n if(i==12 || i==25 || i==34)\n {\n JLabel piece = new JLabel(new ImageIcon(\"snake.png\"));\n JLabel numb=new JLabel();\n numb.setText(new Integer(i+1).toString());\n piece.setText(new Integer(i+1).toString());\n block[i].add(piece);\n }\n \n j--; \n }\n \n /*\n * Dice ActionListener for dice : Gives random value from 1-6\n * Keeps track of players turn\n * \n */\n \n Dice.addActionListener(new ActionListener() {\n\n @Override\n public void actionPerformed(ActionEvent e) {\n Integer rand=1+((int)(Math.random()*1000)%6);\n DiceVal.setText(rand.toString());\n if(turn%2==1)\n {\n P1.setText(rand.toString());\n Player1.setBackground(Color.green);\n Player2.setBackground(Color.red);\n P2.setText(\"0\");\n turn++;\n }\n else\n {\n P2.setText(rand.toString());\n Player2.setBackground(Color.green);\n Player1.setBackground(Color.red);\n P1.setText(\"0\");\n turn++;\n }\n \n Dice.setBackground(Color.red);\n \n //DiceVal.setText(\"hi\");\n }\n });\n \n /*\n * Player1 ActionListener : Moves steps w.r.t dice value for player 1\n * Tracks position of player 2 \n * \n */\n \n Player1.addActionListener(new ActionListener() {\n\n @Override\n public void actionPerformed(ActionEvent e) {\n String temp=P1.getText();\n P1.setText(\"0\");\n int index=Integer.parseInt(temp);\n if(index>0){\n \n if(number[store1].getText().contains(\"P1 P2\")){\n number[store1].setText(new Integer(store1+1).toString()+\" P2\");\n number[store1].setFont(new Font(\"Serif\",Font.BOLD,20));\n number[store1].setForeground(Color.white);}\n \n else{\n number[store1].setText(new Integer(store1+1).toString());\n number[store1].setForeground(null);\n number[store1].setFont(null);}\n \n \n \n if(number[store1+index].getText().contains(\"P2\"))\n number[store1+index].setText(new Integer(store1+index+1).toString()+\"P1 P2\");\n else\n {\n if(store1+index==8 || store1+index==21 || store1+index==17)store1=store1+5;\n if(store1+index==12 || store1+index==26 || store1+index==34)store1=store1-5;\n if(store1+index==35)\n JOptionPane.showMessageDialog(rootPane,\"PLAYER 1 WINS \");\n \n number[store1+index].setText(new Integer(store1+index+1).toString()+\" P1\");\n \n number[store1+index].setFont(new Font(\"Serif\",Font.BOLD,20));\n number[store1+index].setForeground(Color.white); \n \n store1=store1+index;\n \n Dice.setText(\"P2 Roll Dice\");\n Dice.setBackground(Color.green);\n Player1.setBackground(Color.red);\n \n }\n }\n }\n });\n /*\n * Player2 ActionListener : Moves steps w.r.t dice value for player 2\n * Tracks position of player 1\n */\n \n Player2.addActionListener(new ActionListener() {\n\n @Override\n public void actionPerformed(ActionEvent e) {\n String temp=P2.getText();\n P2.setText(\"0\");\n int index=Integer.parseInt(temp);\n if(index>0){\n if(number[store2].getText().contains(\"P1 P2\")){\n number[store2].setText(new Integer(store2+1).toString()+\" P1\");\n number[store2].setFont(new Font(\"Serif\",Font.BOLD,20));\n number[store2].setForeground(Color.white);}\n \n else{\n number[store2].setText(new Integer(store2+1).toString());\n number[store2].setForeground(null);\n number[store2].setFont(null);}\n \n if(number[store2+index].getText().contains(\"P1\"))\n number[store2+index].setText(new Integer(store2+index+1).toString()+\"P1 P2\");\n else{\n if(store2+index==8 || store2+index==21 || store2+index==17)store2=store2+5;\n if(store2+index==12 || store2+index==26 || store2+index==34)store2=store2-5;\n if(store2+index==35)\n JOptionPane.showMessageDialog(rootPane,\"PLAYER 2 WINS \");\n \n \n number[store2+index].setText(new Integer(store2+index+1).toString()+\" P2\");\n \n number[store2+index].setFont(new Font(\"Serif\",Font.BOLD,20));\n number[store2+index].setForeground(Color.white); \n \n store2=store2+index;\n \n Dice.setText(\"P1 Roll Dice\");\n Dice.setBackground(Color.green);\n Player2.setBackground(Color.red);\n \n }}}\n });\n \n /*\n * Reset ActionListener : creates and new frame and a new game board\n * \n */\n \n Reset.addActionListener(new ActionListener() {\n\n @Override\n public void actionPerformed(ActionEvent e) {\n store1=0;\n store2=0;\n turn=1;\n setVisible(false);\n JFrame temp=new Snake();\n temp.setDefaultCloseOperation(DISPOSE_ON_CLOSE );\n temp.pack();\n temp.setResizable(true);\n temp.setLocationRelativeTo( null );\n temp.setVisible(true);\n \n }\n }); \n\n }", "void positionToStart () {\n currentRow = 0 - currentPiece.getOffset();\n currentColumn = board.columns / 2 - currentPiece.width / 2;\n }", "public void addPieces() {\r\n\t\tboard[0] = 8;\r\n\t\tboard[1] = 1;\r\n\t\tboard[2] = 6;\r\n\t\tboard[3] = 3;\r\n\t\tboard[4] = 5;\r\n\t\tboard[5] = 7;\r\n\t\tboard[6] = 4;\r\n\t\tboard[7] = 9;\r\n\t\tboard[8] = 2;\r\n\t}", "pieces getPiece(int position)\n {\n int j ;\n if(position == whiteHorse1.position && whiteHorse1.alive == true ) return whiteHorse1;\n if(position == whiteHorse2.position && whiteHorse2.alive == true) return whiteHorse2;\n if(position == whiteQueen.position && whiteQueen.alive == true ) return whiteQueen;\n if(position == whiteKing.position && whiteKing.alive == true) return whiteKing;\n if(position == whiteCastle1.position && whiteCastle1.alive == true ) return whiteCastle1;\n if(position == whiteCastle2.position && whiteCastle2.alive == true) return whiteCastle2;\n if(position == whiteBishop1.position && whiteBishop1.alive == true) return whiteBishop1;\n if(position == whiteBishop2.position && whiteBishop2.alive == true) return whiteBishop2;\n j=0;\n if(position == whitePawn[j].position && whitePawn[j].alive == true) return whitePawn[j];j++;\n if(position == whitePawn[j].position && whitePawn[j].alive == true) return whitePawn[j];j++;\n if(position == whitePawn[j].position && whitePawn[j].alive == true) return whitePawn[j];j++;\n if(position == whitePawn[j].position && whitePawn[j].alive == true) return whitePawn[j];j++;\n if(position == whitePawn[j].position && whitePawn[j].alive == true) return whitePawn[j];j++;\n if(position == whitePawn[j].position && whitePawn[j].alive == true) return whitePawn[j];j++;\n if(position == whitePawn[j].position && whitePawn[j].alive == true) return whitePawn[j];j++;\n if(position == whitePawn[j].position && whitePawn[j].alive == true) return whitePawn[j];\n \n \n \n if(position == blackHorse1.position && blackHorse1.alive == true ) return blackHorse1;\n if(position == blackHorse2.position && blackHorse2.alive == true) return blackHorse2;\n if(position == blackQueen.position && blackQueen.alive == true ) return blackQueen;\n if(position == blackKing.position && blackKing.alive == true) return blackKing;\n if(position == blackCastle1.position && blackCastle1.alive == true ) return blackCastle1;\n if(position == blackCastle2.position && blackCastle2.alive == true) return blackCastle2;\n if(position == blackBishop1.position && blackBishop1.alive == true) return blackBishop1;\n if(position == blackBishop2.position && blackBishop2.alive == true) return blackBishop2;\n j=0;\n if(position == blackPawn[j].position && blackPawn[j].alive == true) return blackPawn[j];j++;\n if(position == blackPawn[j].position && blackPawn[j].alive == true) return blackPawn[j];j++;\n if(position == blackPawn[j].position && blackPawn[j].alive == true) return blackPawn[j];j++;\n if(position == blackPawn[j].position && blackPawn[j].alive == true) return blackPawn[j];j++;\n if(position == blackPawn[j].position && blackPawn[j].alive == true) return blackPawn[j];j++;\n if(position == blackPawn[j].position && blackPawn[j].alive == true) return blackPawn[j];j++;\n if(position == blackPawn[j].position && blackPawn[j].alive == true) return blackPawn[j];j++;\n if(position == blackPawn[j].position && blackPawn[j].alive == true) return blackPawn[j];\n\n else return null;\n }", "public void arrangeBoard(){\n for(int i=0;i<6;i++){\n for(int j=0;j<6;j++){\n if(i==2 && j==0){ //set the target ship.\n gbc.gridx = 0;\n gbc.gridy = 2;\n gbc.gridwidth = 2;\n targetShip = new JLabel();\n targetShip.setIcon(new ImageIcon(\"design\\\\ships\\\\targetShip.png\"));\n mainPanel.add(targetShip,gbc);\n }\n else if(i==2 && j==1){\n continue;\n }\n else{ //put free spaces in the other places.\n gbc.gridx = j;\n gbc.gridy = i;\n gbc.gridwidth = 1;\n gbc.gridheight = 1;\n freeSpaceButton freeSpace = new freeSpaceButton(new Point(j,i));\n mainPanel.add(freeSpace,gbc);\n }\n }\n }\n }", "public void play() {\n HashSet<Board> positionsPlayed = new HashSet<Board>();\n _board = new Board();\n\n while (true) {\n int playerInd = _board.turn().ordinal();\n Move next;\n if (_playing) {\n if (_board.gameOver()) {\n announceWinner();\n _playing = false;\n continue;\n }\n if (_hasGUI) {\n if (_players[playerInd].type().equals(\"human\")) {\n if (_ready) {\n next = _nextMove;\n } else if (_readyCommand) {\n processCommand(_nextCommand);\n next = null;\n } else {\n continue;\n }\n } else {\n next = _players[playerInd].makeMove();\n }\n } else {\n next = _players[playerInd].makeMove();\n }\n assert !_playing || next != null;\n } else {\n if (_hasGUI) {\n System.out.print(\"\");\n if (_readyCommand) {\n processString(_nextCommand);\n }\n } else {\n getMove();\n }\n next = null;\n }\n if (next != null) {\n assert _board.isLegal(next);\n _board.makeMove(next);\n if (_players[playerInd].type().equals(\"machine\") && !_hasGUI) {\n System.out.println(_players[playerInd].side().abbrev().toUpperCase() + \"::\" + next.toString());\n if (_autoprint) {\n System.out.println(_board.toString2());\n }\n }\n if (_board.gameOver()) {\n announceWinner();\n _playing = false;\n }\n }\n _ready = false;\n }\n }", "public void setSpawns() {\n List<Tile> spawns = this.board.getSpawns();// get all the possible spawns from board\n List<Tile> usedSpawns = new ArrayList<Tile>();// empty list used to represent all the spawns that have been used so no playerPiece gets the same spawn\n for (PlayerPiece playerPiece : this.playerPieces) { // for each playerPiece\n boolean hasSpawn = false; // boolean to represent whether the playerPiece has a spawn and used to initiate and stop the following while loop.\n while (!hasSpawn) { // while hasSpawn is false.\n int random_int = (int) (Math.random() * spawns.size());// get random number with max number of the total possible tiles the pieces can spawn from\n Tile spawn = spawns.get(random_int); // get spawn from spawns list using the random int as an index\n if (!usedSpawns.contains(spawn)) {// if the spawn isn't in the usedSpawn list\n playerPiece.setLocation(spawn);// set the location of the playerPiece to the spawn\n usedSpawns.add(spawn);//add the spawn to usedSpawns\n hasSpawn = true; // set the variable to true so the while loop stops.\n }\n }\n }\n }", "private void initPosition() {\r\n while (true) {\r\n int x = RandomUtil.nextInt(boardLength);\r\n int y = RandomUtil.nextInt(boardLength);\r\n if (board.isSimple(x, y)) {\r\n heroTeam.setPosition(x, y);\r\n board.setTeamPosition(x, y);\r\n break;\r\n }\r\n }\r\n }", "public void createPieces(){ \n\t\tfor(int x = 0; x<BOARD_LENGTH; x++){\n\t\t\tfor(int y = 0; y<BOARD_LENGTH; y++){ \n\t\t\t\tif(CHESS_MAP[x][y] != (null)){\n\t\t\t\t\tswitch (CHESS_MAP[x][y]){\n\t\t\t\t\tcase KING:\n\t\t\t\t\t\tpieces[pieceCounter] = new King(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase QUEEN:\n\t\t\t\t\t\tpieces[pieceCounter] = new Queen(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BISHOP:\n\t\t\t\t\t\tpieces[pieceCounter] = new Bishop(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase KNIGHT:\n\t\t\t\t\t\tpieces[pieceCounter] = new Knight(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PAWN:\n\t\t\t\t\t\tpieces[pieceCounter] = new Pawn(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ROOK:\n\t\t\t\t\t\tpieces[pieceCounter] = new Rook(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} \n\t\t\t\t\tsetPieceIconAndName(x, y, CHESS_MAP[x][y]); \t\n\t\t\t\t\tpieceCounter++;\n\t\t\t\t}else{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t}", "private void addPieces() {\n gridPane.getChildren().clear();\n Map<Piece, Position> pieces = controller.getAllActivePiecesPositions();\n /* Add the tiles */\n for (int row = 0; row < 8; row++) {\n for (int col = 0; col < 8; col++) {\n Tile tile = new TileView(new Position(row, col));\n gridPane.add(tile.getRootNode(),\n 1 + tile.getPosition().getCol(),\n 1 + tile.getPosition().getRow());\n GridPane.setHgrow(tile.getRootNode(), Priority.ALWAYS);\n GridPane.setVgrow(tile.getRootNode(), Priority.ALWAYS);\n getTiles()[row][col] = tile;\n tile.getRootNode().setOnMouseClicked(\n tileListener(tile));\n tile.clear();\n tile.setSymbol(\"\");\n }\n }\n /* Add the pieces */\n for (Piece p : pieces.keySet()) {\n Position placeAt = pieces.get(p);\n getTileAt(placeAt).setSymbol(p.getType().getSymbol(p.getSide()));\n }\n /* Add the coordinates around the perimeter */\n for (int i = 1; i <= 8; i++) {\n Text coord1 = new Text((char) (64 + i) + \"\");\n coord1.setFont(Font.font(null, FontWeight.BOLD, 14));\n coord1.setFill(Color.WHITE);\n GridPane.setHalignment(coord1, HPos.CENTER);\n gridPane.add(coord1, i, 0);\n\n Text coord2 = new Text((char) (64 + i) + \"\");\n coord2.setFont(Font.font(null, FontWeight.BOLD, 14));\n coord2.setFill(Color.WHITE);\n GridPane.setHalignment(coord2, HPos.CENTER);\n gridPane.add(coord2, i, 9);\n\n Text coord3 = new Text(\" \" + (9 - i) + \" \");\n coord3.setFont(Font.font(null, FontWeight.BOLD, 14));\n coord3.setFill(Color.WHITE);\n GridPane.setHalignment(coord3, HPos.CENTER);\n gridPane.add(coord3, 0, i);\n\n Text coord4 = new Text(\" \" + (9 - i) + \" \");\n coord4.setFont(Font.font(null, FontWeight.BOLD, 14));\n coord4.setFill(Color.WHITE);\n GridPane.setHalignment(coord4, HPos.CENTER);\n gridPane.add(coord4, 9, i);\n }\n }", "private void makeMove() {\r\n //if not all pieces placed, place a new piece\r\n if(numPieces < 3) {\r\n if(pieces == null)\r\n pieces = new PositionData[Constants.NUM_PIECES];\r\n placePiece();\r\n return;\r\n }\r\n //move a random piece to a random location\r\n int pieceNumber = getRandomPiece();\r\n PositionData randomPoint = getRandomPoint();\r\n //move the piece\r\n Game.movePiece(pieces[pieceNumber], randomPoint);\r\n }", "void defaultsetup(int phi) \n {// The Images should be loded here... Also add labels here\n System.out.println(\"IN DEFAULT SETUP..\");\n if( phi == 0) \n whiteToPlay = true;\n else if (phi == 1) \n whiteToPlay = false;\n // White Chess Pieces\n whiteHorse1.position = 1; whiteHorse1.color = 0;\n whiteHorse2.position = 6; whiteHorse2.color = 0;\n whiteQueen.position = 3; whiteQueen.color = 0;\n whiteKing.position =4 ; whiteKing.color = 0;\n whiteCastle1.position = 0; whiteCastle1.color = 0;\n whiteCastle2.position = 7; whiteCastle2.color = 0;\n whiteBishop1.position = 2; whiteBishop1.color = 0;\n whiteBishop2.position = 5; whiteBishop2.color = 0;\n int y = 8;\n for(int x = 0 ; x < 8; x++)\n {\n whitePawn[x] = new pawn();\n whitePawn[x].position = 8+x;\n whitePawn[x].color = 0;\n }\n //Black Chess Pieces\n blackHorse1.position = 57; blackHorse1.color = 1;\n blackHorse2.position = 62; blackHorse2.color = 1;\n blackQueen.position = 59; blackQueen.color = 1;\n blackKing.position = 60; blackKing.color = 1;\n blackCastle1.position = 56;blackCastle1.color = 1;\n blackCastle2.position = 63;blackCastle2.color = 1;\n blackBishop1.position = 58;blackBishop1.color = 1;\n blackBishop2.position = 61;blackBishop2.color = 1;\n y = 8;\n for(int x = 0 ; x < 8; x++)\n {\n blackPawn[x] = new pawn();\n blackPawn[x].position = 48+x;\n blackPawn[x].color = 1;\n }\n \n this.updatePositions();\n }", "public int getNumOfPlayerPieces() {\n return playerPiecePositions.length;\n }", "private void setDefaultBoard() throws TooManyPlayersException, InvalidColourException{\r\n\t\tif(getPlayers().size() != 2) {\r\n\t\t\tthrow new TooManyPlayersException(\"There are too many players, must only be 2\");\r\n\t\t}else {\r\n\t\t\tArrayList<Coordinate> pawnRankCoords, backRankCoords; //indexes for row numbers for ranks\r\n\t\t\tfor (Player player: getPlayers()) {\r\n\t\t\t\t\r\n\t\t\t\t//select what rank the pieces should be based on colour\r\n\t\t\t\tswitch (player.getColour()) {\r\n\t\t\t\tcase BLACK:\r\n\t\t\t\t\tpawnRankCoords = this.getRowCoordinates(1);\r\n\t\t\t\t\tbackRankCoords = this.getRowCoordinates(0);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase WHITE:\r\n\t\t\t\t\tpawnRankCoords = this.getRowCoordinates(getBoardArray().length-2);\r\n\t\t\t\t\tbackRankCoords = this.getRowCoordinates(getBoardArray().length-1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthrow new InvalidColourException(\"Chess only has white or black colours, please reset\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfinal int NUM_PIECES_IN_RANK = 8;\r\n\t\t\t\t//create the pieces, assigning the player to them\r\n\t\t\t\tPiece[] specialPieces = {new Rook(player), new Knight(player), new Bishop(player), new Queen(player),\r\n\t\t\t\tnew King(player), new Bishop(player), new Knight(player), new Rook(player)};\r\n\t\t\t\t\r\n\t\t\t\tfor (int i = 0; i < NUM_PIECES_IN_RANK; i++) {\r\n\t\t\t\t\tthis.setPiece(pawnRankCoords.get(i), new Pawn(player));\r\n\t\t\t\t\tthis.setPiece(backRankCoords.get(i), specialPieces[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void setBoard() {\n bestPieceToMove = null;\n bestPieceFound = false;\n bestMoveDirectionX = 0;\n bestMoveDirectionY = 0;\n bestMoveFound = false;\n killAvailable = false;\n lightCounter = 12;\n darkCounter = 12;\n for (int y = 0; y < boardSize; y++) {\n for (int x = 0; x < boardSize; x++) {\n board[y][x] = new Field(x, y);\n if (y < 3 && board[y][x].getPlaceable()) {\n board[y][x].setPiece(new Piece(PieceColor.DARK, PieceType.MEN));\n } else if (y > 4 && board[y][x].getPlaceable()) {\n board[y][x].setPiece(new Piece(PieceColor.LIGHT, PieceType.MEN));\n }\n }\n }\n }", "public Board(ArrayList<Piece> pieces)\n {\n squares = new Square[Chess.ROWS][Chess.COLUMNS];\n setLayout(new GridLayout(Chess.ROWS,Chess.COLUMNS,0,0));\n firstSelected = null;\n mainBoard=true;\n turn = 0;\n fiftyMove = 0;\n for (int i = 0; i < Chess.ROWS; i++)\n for (int j = 0; j < Chess.COLUMNS; j++)\n {\n squares[i][j] = new Square(i,j,this);\n for (Piece p: pieces)\n if (p.getOrigin().equals(new Location(i,j)))\n squares[i][j].setPiece(p);\n add(squares[i][j]);\n }\n positions = new ArrayList<>();\n positions.add(toString());\n }", "public void updatePosition(){\n\t\t//maps the position to the closest \"grid\"\n\t\tif(y-curY>=GameSystem.GRID_SIZE/2){\n\t\t\tcurY=curY+GameSystem.GRID_SIZE;\n\t\t\tyGridNearest++;\n\t\t}\n\t\telse if(curX-x>=GameSystem.GRID_SIZE/2){\n\t\t\tcurX=curX-GameSystem.GRID_SIZE;\n\t\t\txGridNearest--;\n\t\t}\n\t\telse if(x-curX>=GameSystem.GRID_SIZE/2){\n\t\t\tcurX=curX+GameSystem.GRID_SIZE;\n\t\t\txGridNearest++;\n\t\t}\n\t\telse if(curY-y>=GameSystem.GRID_SIZE/2){\n\t\t\tcurY=curY-GameSystem.GRID_SIZE;\n\t\t\tyGridNearest--;\n\t\t}\n\t\t//sets the last completely arrived location grid\n\t\tif(y-yTemp>=GameSystem.GRID_SIZE){\n\t\t\tyTemp=yTemp+GameSystem.GRID_SIZE;\n\t\t\ty=yTemp;\n\t\t\tlastY++;\n\t\t}\n\t\telse if(xTemp-x>=GameSystem.GRID_SIZE){\n\t\t\txTemp=xTemp-GameSystem.GRID_SIZE;\n\t\t\tx=xTemp;\n\t\t\tlastX--;\n\t\t}\n\t\telse if(x-xTemp>=GameSystem.GRID_SIZE){\n\t\t\txTemp=xTemp+GameSystem.GRID_SIZE;\n\t\t\tx=xTemp;\n\t\t\tlastX++;\n\t\t}\n\t\telse if(yTemp-y>=GameSystem.GRID_SIZE){\n\t\t\tyTemp=yTemp-GameSystem.GRID_SIZE;\n\t\t\ty=yTemp;\n\t\t\tlastY--;\n\t\t}\n\t\t//only updates nextX and nextY when the move buttons are being pressed down\n\t\t/*\n\t\tif(movable){\n\t\t\tif(direction.equals(\"right\")){\n\t\t\t\t\tnextX=lastX+1;\n\t\t\t\t\tnextY=lastY;\n\t\t\t}\n\t\t\telse if(direction.equals(\"left\")){\n\t\t\t\tnextX=lastX-1;\n\t\t\t\tnextY=lastY;\n\t\t\t}\n\t\t\telse if(direction.equals(\"up\")){\n\t\t\t\tnextY=lastY-1;\n\t\t\t\tnextX=lastX;\n\t\t\t}\n\t\t\telse if(direction.equals(\"down\")){\n\t\t\t\tnextY=lastY+1;\n\t\t\t\tnextX=lastX;\n\t\t\t}\n\t\t}\n\t\t*/\n\t\t\n\t}", "public void play() {\n Player playerOne = preparePlayer(getUserName(scanner, validator, shipsGameText.getMessage(\"show.player.one\"), null));\n Player currentPlayer = playerOne;\n ShipsGameBoard playerOneGameBoard = new ShipsGameBoard(playerOne, playerOneFleet);\n ShipsGameBoard playerOneCheckBoard = new ShipsGameBoard(playerOne, playerOneFleetToCheck);\n playerOneCheckBoard.setup();\n\n TreeMap<Character, Integer> lettersAndDigits = lettersAndDigits(playerOneGameBoard.getLength());\n ShipCreator threeMastShipCreatorPlayerOne = new ShipCreator(THREE_MASTS_SHIP,\n null,\n playerOne,\n ShipGameBoardMark.THREE_MASTS,\n playerOneGameBoard,\n playerOneShipsGameLogic);\n\n playerOneGameBoard.print();\n shipsDeployment(playerOneGameBoard,\n lettersAndDigits,\n threeMastShipCreatorPlayerOne,\n playerOneShipsGameLogic,\n playerOneFleet,\n NUMBER_OF_SHIPS);\n\n// playerOneShipsGameLogic.clearConsole();\n\n Player playerTwo = preparePlayer(getUserName(scanner, validator, shipsGameText.getMessage(\"show.player.two\"), playerOne.getName()));\n ShipsGameBoard playerTwoGameBoard = new ShipsGameBoard(playerTwo, playerTwoFleet);\n ShipsGameBoard playerTwoCheckBoard = new ShipsGameBoard(playerTwo, playerTwoFleetToCheck);\n playerTwoCheckBoard.setup();\n\n ShipCreator threeMastShipCreatorPlayerTwo = new ShipCreator(THREE_MASTS_SHIP,\n null,\n playerTwo,\n ShipGameBoardMark.THREE_MASTS,\n playerTwoGameBoard,\n playerTwoShipsGameLogic);\n\n playerTwoGameBoard.print();\n shipsDeployment(playerTwoGameBoard,\n lettersAndDigits,\n threeMastShipCreatorPlayerTwo,\n playerTwoShipsGameLogic,\n playerTwoFleet,\n NUMBER_OF_SHIPS);\n\n\n boolean isAWinner = false;\n do {\n int userRow;\n int userCol;\n// playerOneGameBoard.clearConsole();\n showCurrentPlayerBoards(playerOne, currentPlayer, playerOneGameBoard, playerTwoGameBoard, playerOneCheckBoard,\n playerTwoCheckBoard, shipsGameText);\n System.out.println(shipsGameText.getMessage(\"show.witch.player.move\", currentPlayer.getName()));\n\n System.out.println(shipsGameText.getMessage(\"show.input.row\", Integer.toString(playerOneGameBoard.getLength())));\n userRow = getPlayerRowChoice(scanner, validator, playerOneGameBoard.getLength());\n\n System.out.println(shipsGameText.getMessage(\"show.input.col\",\n Character.toString(playerOneGameBoard.generateLastLetterOfColumn('A', playerOneGameBoard.getLength()))));\n userCol = convertLetterToDigit(lettersAndDigits, getPlayerColChoice(scanner, validator,\n lettersAndDigits));\n\n if (currentPlayer.equals(playerOne)) {\n if (playerTwoShipsGameLogic.checkForHit(userRow, userCol)) {\n playerOneShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n playerTwoShipsGameLogic.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n if (playerTwoShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n playerTwoShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerTwo);\n playerOneShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerTwoFleet, playerOne);\n System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n playerOneCheckBoard.print();\n System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerTwo.getName()));\n playerTwoGameBoard.print();\n } else {\n System.out.println(shipsGameText.getMessage(\"show.player.hit.ship\", playerOne.getName()));\n }\n } else {\n System.out.println(shipsGameText.getMessage(\"show.player.miss\"));\n playerOneShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.MISS);\n playerTwoShipsGameLogic.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.MISS);\n }\n\n// if (playerTwoShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n// playerTwoShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerTwo);\n// playerOneShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerTwoFleet, playerOne);\n// System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n// System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n// playerOneCheckBoard.print();\n// System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerTwo.getName()));\n// playerTwoGameBoard.print();\n// }\n\n\n if (playerTwoShipsGameLogic.isPlayerLoose()) {\n System.out.println(shipsGameText.getMessage(\"show.player.win\", playerOne.getName()));\n isAWinner = true;\n }\n\n } else {\n if (playerOneShipsGameLogic.checkForHit(userRow, userCol)) {\n playerTwoShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n playerOneShipsGameLogic.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n if (playerOneShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n playerOneShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerOne);\n playerTwoShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerOneFleet, playerTwo);\n System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n playerTwoCheckBoard.print();\n System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerOne.getName()));\n playerOneGameBoard.print();\n }\n else {\n System.out.println(shipsGameText.getMessage(\"show.player.hit.ship\", playerOne.getName()));\n }\n } else {\n playerTwoShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne,\n ShipGameBoardMark.MISS);\n playerOneShipsGameLogic.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.MISS);\n System.out.println(shipsGameText.getMessage(\"show.player.miss\"));\n }\n if (playerOneShipsGameLogic.isPlayerLoose()) {\n System.out.println(shipsGameText.getMessage(\"show.player.win\", playerTwo.getName()));\n isAWinner = true;\n }\n }\n\n currentPlayer = swapPlayers(playerOne, currentPlayer, playerTwo);\n }\n while (!isAWinner);\n }", "public void setUpPockets(int numberOfPlayers)\n\t{\n\n\t\tswitch(numberOfPlayers) // Now it is time to setup the pockets depending on the number of players\n\t\t{\n\t\tcase 2: // For two players...\n\t\t\tpanelPlayer1 = new JPanel(); // Instance the panels\n\t\t\tpanelPlayer2 = new JPanel();\n\t\t\tpanelPlayer2GoalPock = new JPanel();\n\n\t\t\tpanelPlayer1.setLayout(new FlowLayout(FlowLayout.CENTER));\n\t\t\tpanelPlayer2.setLayout(new FlowLayout(FlowLayout.CENTER));\n\n\n\t\t\tpanelPlayer1.add(playerPockets.get(0)); // Add in player 1's pockets...\n\t\t\tpanelPlayer1.add(playerPockets.get(1));\n\t\t\tpanelPlayer1.add(playerPockets.get(2));\n\t\t\tpanelPlayer1.add(playerPockets.get(3));\n\t\t\tpanelPlayerList.add(goalPockets.get(0)); // Add player 1's goal pocket to the right side of the screen...\n\n\t\t\tpanelPlayer2.add(playerPockets.get(7)); // Add in player two's pockets...\n\t\t\tpanelPlayer2.add(playerPockets.get(6));\n\t\t\tpanelPlayer2.add(playerPockets.get(5));\n\t\t\tpanelPlayer2.add(playerPockets.get(4));\n\t\t\tpanelPlayer2GoalPock.add(goalPockets.get(1));\n\n\n\t\t\tmain.add(\"North\", panelPlayer1); // Add these panels to the container.\n\t\t\tmain.add(\"South\", panelPlayer2);\n\t\t\tmain.add(\"West\",panelPlayer2GoalPock);\n\t\t\tbreak;\n\n\t\t}\n\n\t}", "private void moveTheCardsTotheWinner(int winPlayer,Player tempPlayer)\n {\n for(int i=0;i<tempPlayer.getLastIndex();i++)\n if(winPlayer == 1)\n FirstPlayer.addCardToBegining(tempPlayer.removeTheCard());\n else if (winPlayer == 2) \n SecondPlayer.addCardToBegining(tempPlayer.removeTheCard()); \n }", "public void displayPositionUI(){\n\t\tfor (Player p: gameLogic.getArrayOfPlayers().getArrayOfPlayers()) {\n\n\t\t\tif (p.getPlayerId() == 0) {\n\t\t\t\tif (!(positionList.isEmpty())) {\n\t\t\t\t\tfor (JLabel item : positionList) {\n\t\t\t\t\t\testimationGame.getContentPane().remove(item);\n\t\t\t\t\t}\n\t\t\t\t\tpositionList.clear();\n\t\t\t\t}\n\n\t\t\t\tJLabel lblPosition = new JLabel(\"Position: \" + (p.getPosition()+1));\n\n\t\t\t\tspringLayout.putConstraint(SpringLayout.WEST, lblPosition, 295, SpringLayout.WEST,\n\t\t\t\t\t\testimationGame.getContentPane());\n\t\t\t\tlblPosition.setForeground(Color.WHITE);\n\t\t\t\tspringLayout.putConstraint(SpringLayout.NORTH, lblPosition, 555, SpringLayout.NORTH,\n\t\t\t\t\t\testimationGame.getContentPane());\n\t\t\t\tlblPosition.setFont(new Font(\"Tahoma\", Font.PLAIN, 15));\n\n\t\t\t\tpositionList.add(lblPosition);\n\t\t\t\testimationGame.getContentPane().add(lblPosition);\n\t\t\t}\n\n\t\t\tif (p.getPlayerId() == 1) {\n\t\t\t\tif (!(positionList1.isEmpty())) {\n\t\t\t\t\tfor (JLabel item : positionList1) {\n\t\t\t\t\t\testimationGame.getContentPane().remove(item);\n\t\t\t\t\t}\n\t\t\t\t\tpositionList1.clear();\n\t\t\t\t}\n\n\t\t\t\tJLabel lblPosition1 = new JLabel(\"Position: \" + (p.getPosition()+1));\n\n\t\t\t\tspringLayout.putConstraint(SpringLayout.WEST, lblPosition1, 190, SpringLayout.WEST,\n\t\t\t\t\t\testimationGame.getContentPane());\n\t\t\t\tlblPosition1.setForeground(Color.WHITE);\n\t\t\t\tspringLayout.putConstraint(SpringLayout.NORTH, lblPosition1, 440, SpringLayout.NORTH,\n\t\t\t\t\t\testimationGame.getContentPane());\n\t\t\t\tlblPosition1.setFont(new Font(\"Tahoma\", Font.PLAIN, 15));\n\n\t\t\t\tpositionList1.add(lblPosition1);\n\t\t\t\testimationGame.getContentPane().add(lblPosition1);\n\t\t\t}\n\n\t\t\tif (p.getPlayerId() == 2) {\n\t\t\t\tif (!(positionList2.isEmpty())) {\n\t\t\t\t\tfor (JLabel item : positionList2) {\n\t\t\t\t\t\testimationGame.getContentPane().remove(item);\n\t\t\t\t\t}\n\t\t\t\t\tpositionList2.clear();\n\t\t\t\t}\n\n\t\t\t\tJLabel lblPosition2 = new JLabel(\"Position: \" + (p.getPosition()+1));\n\n\t\t\t\tspringLayout.putConstraint(SpringLayout.WEST, lblPosition2, 275, SpringLayout.WEST,\n\t\t\t\t\t\testimationGame.getContentPane());\n\t\t\t\tlblPosition2.setForeground(Color.WHITE);\n\t\t\t\tspringLayout.putConstraint(SpringLayout.NORTH, lblPosition2, 150, SpringLayout.NORTH,\n\t\t\t\t\t\testimationGame.getContentPane());\n\t\t\t\tlblPosition2.setFont(new Font(\"Tahoma\", Font.PLAIN, 15));\n\n\t\t\t\tpositionList2.add(lblPosition2);\n\t\t\t\testimationGame.getContentPane().add(lblPosition2);\n\t\t\t}\n\n\t\t\tif (p.getPlayerId() == 3) {\n\t\t\t\tif (!(positionList3.isEmpty())) {\n\t\t\t\t\tfor (JLabel item : positionList3) {\n\t\t\t\t\t\testimationGame.getContentPane().remove(item);\n\t\t\t\t\t}\n\t\t\t\t\tpositionList3.clear();\n\t\t\t\t}\n\n\t\t\t\tJLabel lblPosition3 = new JLabel(\"Position: \" + (p.getPosition()+1));\n\n\t\t\t\tspringLayout.putConstraint(SpringLayout.WEST, lblPosition3, 620, SpringLayout.WEST,\n\t\t\t\t\t\testimationGame.getContentPane());\n\t\t\t\tlblPosition3.setForeground(Color.WHITE);\n\t\t\t\tspringLayout.putConstraint(SpringLayout.NORTH, lblPosition3, 440, SpringLayout.NORTH,\n\t\t\t\t\t\testimationGame.getContentPane());\n\t\t\t\tlblPosition3.setFont(new Font(\"Tahoma\", Font.PLAIN, 15));\n\n\t\t\t\tpositionList3.add(lblPosition3);\n\t\t\t\testimationGame.getContentPane().add(lblPosition3);\n\t\t\t}\n\t\t}\n\n\t\testimationGame.validate();\n\t\testimationGame.repaint();\n\t}", "public void movePlayer(String direction) {\n if(playerAlive(curPlayerRow, curPlayerCol)){\n if(direction.equals(\"u\")&&(curPlayerRow-1)>=0){\n overwritePosition(curPlayerRow, curPlayerCol, (curPlayerRow-1), curPlayerCol);\n curPlayerRow -= 1;\n }else if(direction.equals(\"d\")&&(curPlayerRow+1)<=7){\n overwritePosition(curPlayerRow, curPlayerCol, (curPlayerRow+1), curPlayerCol);\n curPlayerRow += 1;\n }else if(direction.equals(\"l\")&&(curPlayerCol-1)>=0){\n overwritePosition(curPlayerRow, curPlayerCol, curPlayerRow, (curPlayerCol-1));\n curPlayerCol -= 1;\n }else if(direction.equals(\"r\")&&(curPlayerCol+1)<=9){\n overwritePosition(curPlayerRow, curPlayerCol, curPlayerRow, (curPlayerCol+1));\n curPlayerCol += 1;\n }\n }\n if(playerFoundTreasure(curPlayerRow, curPlayerCol)){\n playerWins();\n }\n adjustPlayerLifeLevel(curPlayerRow, curPlayerCol);\n int[] array = calcNewTrollCoordinates(curPlayerRow, curPlayerCol, curTrollRow, curTrollCol);\n if(curPlayerRow == curTrollRow && curPlayerCol == curTrollCol){\n gameBoard[curTrollRow][curTrollCol] = new TrollPiece();\n }else{\n int newTrollRow = array[0];\n int newTrollCol = array[1];\n overwritePosition(curTrollRow, curTrollCol, newTrollRow, newTrollCol);\n curTrollRow = newTrollRow;\n curTrollCol = newTrollCol;\n }\n }", "public void restart()\n {\n //resets values \n x = 0; // stores current row of black piece when moving right or right + down\n x3 = 7; // stores current row of black piece when moving right + down\n y = 0; // stores current column of black piece\n x2 = 0; // stores current row of white piece when moving left or left + down\n x4 = 7; // stores current row of white piece when moving left + down\n y2 = 7; // stores current column of black piece\n gameSet = false; // decides if a player has won the game or not\n whiteCount = 0; // counts how many white pieces were taken\n blackCount = 0; // counts how many black pieces were taken\n \n \n //determines which players start first\n turn = Math.random() < 0.5; \n \n //if turn == 0/false \n if(turn == false)\n {\n player.setText(\"<html><strong><font color='red'>Player 1 starts first!</font></strong></html>\");\n }\n \n //if turn == 1/true\n if(turn == true)\n {\n player.setText(\"<html><strong><font color='blue'>Player 2 starts first!</font></strong></html>\");\n }\n \n \n \n //sets icons for the left 16 buttons to the icon black\n for( int rows = 0; rows< gridUnits.length; rows++)\n {\n \n for(int cols = 0;cols <2; cols++)\n {\n gridUnits[rows][cols].setIcon(black);\n }\n }\n \n \n //sets icons for the right 16 buttons to the icon white\n for(int rows = 0; rows< gridUnits.length; rows++)\n {\n \n for(int cols = 6;cols <8; cols++)\n {\n gridUnits[rows][cols].setIcon(white);\n \n }\n \n }\n \n //sets icons for the middle 32 buttons to the icon blank\n for(int rows = 0; rows< gridUnits.length; rows++)\n {\n \n for(int cols = 2;cols <6; cols++)\n {\n gridUnits[rows][cols].setIcon(blank);\n \n }\n \n } \n \n //adds actionListeners to all of the 64 buttons\n for (int rows = 0; rows < gridUnits.length; rows++)\n {\n \n for(int cols = 0; cols < gridUnits.length; cols++)\n {\n gridUnits[rows][cols].addActionListener(this);\n \n }\n \n }\n \n }", "public static void setCoordinates(JButton currentButton, int numPlayers, JButton tile[][] ) {\n\t\t if(currentButton.getIcon()==Player1.PieceImages[0]) {\n\t\t\t //System.out.println(\"This is player 1's \" + Player1.playersTeam.teamPieces[0].name);\n\t\t\t for (int i=0; i<tile.length; i++) {\n \t\t\t for(int j=0; j<tile[i].length; j++) {\n \t\t\t\t if (currentButton == tile[i][j]) {\n \t\t\t\t\t pieceYCoord = i; \n \t\t\t\t\t pieceXCoord = j;\n \t\t\t\t\t //System.out.println(pieceYCoord + \"\" + pieceXCoord);\n \t\t\t\t }\n \t\t\t }\n \t\t }\n\t\t }\n\t\t if(currentButton.getIcon()==Player1.PieceImages[1]) {\n\t\t\t //System.out.println(\"This is player 1's \" + Player1.playersTeam.teamPieces[1].name);\n\t\t\t for (int i=0; i<tile.length; i++) {\n \t\t\t for(int j=0; j<tile[i].length; j++) {\n \t\t\t\t if (currentButton == tile[i][j]) {\n \t\t\t\t\t pieceYCoord = i; \n \t\t\t\t\t pieceXCoord = j;\n \t\t\t\t\t//System.out.println(pieceYCoord + \"\" + pieceXCoord);\n \t\t\t\t }\n \t\t\t }\n \t\t }\n\t\t }\n\t\t if(currentButton.getIcon()==Player1.PieceImages[2]) {\n\t\t\t //System.out.println(\"This is player 1's \" + Player1.playersTeam.teamPieces[2].name);\n\t\t\t for (int i=0; i<tile.length; i++) {\n \t\t\t for(int j=0; j<tile[i].length; j++) {\n \t\t\t\t if (currentButton == tile[i][j]) {\n \t\t\t\t\t pieceYCoord = i;\n \t\t\t\t\t pieceXCoord = j;\n \t\t\t\t\t//System.out.println(pieceYCoord + \"\" + pieceXCoord);\n \t\t\t\t }\n \t\t\t }\n \t\t }\n\t\t }\n\t\t if(currentButton.getIcon()==Player1.PieceImages[3]) {\n\t\t\t //System.out.println(\"This is player 1's \" + Player1.playersTeam.teamPieces[3].name);\n\t\t\t for (int i=0; i<tile.length; i++) {\n \t\t\t for(int j=0; j<tile[i].length; j++) {\n \t\t\t\t if (currentButton == tile[i][j]) {\n \t\t\t\t\t pieceYCoord = i;\n \t\t\t\t\t pieceXCoord = j;\n \t\t\t\t\t//System.out.println(pieceYCoord + \"\" + pieceXCoord);\n \t\t\t\t }\n \t\t\t }\n \t\t }\n\t\t }\n\t\t if(currentButton.getIcon()==Player1.PieceImages[4]) {\n\t\t\t //System.out.println(\"This is player 1's \" + Player1.playersTeam.teamPieces[4].name);\n\t\t\t for (int i=0; i<tile.length; i++) {\n \t\t\t for(int j=0; j<tile[i].length; j++) {\n \t\t\t\t if (currentButton == tile[i][j]) {\n \t\t\t\t\t pieceYCoord = i;\n \t\t\t\t\t pieceXCoord = j;\n \t\t\t\t\t//System.out.println(pieceYCoord + \"\" + pieceXCoord);\n \t\t\t\t }\n \t\t\t }\n \t\t }\n\t\t }\n\t\t if(currentButton.getIcon()==Player2.PieceImages[0]) {\n\t\t\t //System.out.println(\"This is player 2's \" + Player2.playersTeam.teamPieces[0].name);\n\t\t\t for (int i=0; i<tile.length; i++) {\n \t\t\t for(int j=0; j<tile[i].length; j++) {\n \t\t\t\t if (currentButton == tile[i][j]) {\n \t\t\t\t\t pieceYCoord = i;\n \t\t\t\t\t pieceXCoord = j;\n \t\t\t\t\t//System.out.println(pieceYCoord + \"\" + pieceXCoord);\n \t\t\t\t }\n \t\t\t }\n \t\t }\n\t\t }\n\t\t if(currentButton.getIcon()==Player2.PieceImages[1]) {\n\t\t\t //System.out.println(\"This is player 2's \" + Player2.playersTeam.teamPieces[1].name);\n\t\t\t for (int i=0; i<tile.length; i++) {\n \t\t\t for(int j=0; j<tile[i].length; j++) {\n \t\t\t\t if (currentButton == tile[i][j]) {\n \t\t\t\t\t pieceYCoord = i;\n \t\t\t\t\t pieceXCoord = j;\n \t\t\t\t\t//System.out.println(pieceYCoord + \"\" + pieceXCoord);\n \t\t\t\t }\n \t\t\t }\n \t\t }\n\t\t }\n\t\t if(currentButton.getIcon()==Player2.PieceImages[2]) {\n\t\t\t //System.out.println(\"This is player 2's \" + Player2.playersTeam.teamPieces[2].name);\n\t\t\t for (int i=0; i<tile.length; i++) {\n \t\t\t for(int j=0; j<tile[i].length; j++) {\n \t\t\t\t if (currentButton == tile[i][j]) {\n \t\t\t\t\t pieceYCoord = i;\n \t\t\t\t\t pieceXCoord = j;\n \t\t\t\t\t//System.out.println(pieceYCoord + \"\" + pieceXCoord);\n \t\t\t\t }\n \t\t\t }\n \t\t }\n\t\t }\n\t\t if(currentButton.getIcon()==Player2.PieceImages[3]) {\n\t\t\t //System.out.println(\"This is player 2's \" + Player2.playersTeam.teamPieces[3].name);\n\t\t\t for (int i=0; i<tile.length; i++) {\n \t\t\t for(int j=0; j<tile[i].length; j++) {\n \t\t\t\t if (currentButton == tile[i][j]) {\n \t\t\t\t\t pieceYCoord = i;\n \t\t\t\t\t pieceXCoord = j;\n \t\t\t\t\t//System.out.println(pieceYCoord + \"\" + pieceXCoord);\n \t\t\t\t }\n \t\t\t }\n \t\t }\n\t\t }\n\t\t if(currentButton.getIcon()==Player2.PieceImages[4]) {\n\t\t\t //System.out.println(\"This is player 2's \" + Player2.playersTeam.teamPieces[4].name);\n\t\t\t for (int i=0; i<tile.length; i++) {\n \t\t\t for(int j=0; j<tile[i].length; j++) {\n \t\t\t\t if (currentButton == tile[i][j]) {\n \t\t\t\t\t pieceYCoord = i;\n \t\t\t\t\t pieceXCoord = j;\n \t\t\t\t\t//System.out.println(pieceYCoord + \"\" + pieceXCoord);\n \t\t\t\t }\n \t\t\t }\n \t\t }\n\t\t }\n\t\t if(numPlayers==4) {\n\t\t\t if(currentButton.getIcon()==Player3.PieceImages[0]) {\n\t\t\t //System.out.println(\"This is player 3's \" + Player3.playersTeam.teamPieces[0].name);\n\t\t\t \tfor (int i=0; i<tile.length; i++) {\n\t\t\t \t\tfor(int j=0; j<tile[i].length; j++) {\n\t\t\t \t\t\tif (currentButton == tile[i][j]) {\n\t\t\t \t\t\t\tpieceYCoord = i;\n\t\t\t \t\t\t\tpieceXCoord = j;\n\t\t\t \t\t\t\t//System.out.println(pieceYCoord + \"\" + pieceXCoord);\n\t\t\t \t\t\t}\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t }\n\t\t\t if(currentButton.getIcon()==Player3.PieceImages[1]) {\n\t\t\t //System.out.println(\"This is player 3's \" + Player3.playersTeam.teamPieces[1].name);\n\t\t\t \tfor (int i=0; i<tile.length; i++) {\n\t\t\t \t\tfor(int j=0; j<tile[i].length; j++) {\n\t\t\t \t\t\tif (currentButton == tile[i][j]) {\n\t\t\t \t\t\t\tpieceYCoord = i;\n\t\t\t \t\t\t\tpieceXCoord = j;\n\t\t\t \t\t\t\t//System.out.println(pieceYCoord + \"\" + pieceXCoord);\n\t\t\t \t\t\t}\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t }\n\t\t\t if(currentButton.getIcon()==Player3.PieceImages[2]) {\n\t\t\t //System.out.println(\"This is player 3's \" + Player3.playersTeam.teamPieces[2].name);\n\t\t\t\tfor (int i=0; i<tile.length; i++) {\n\t\t\t \t\tfor(int j=0; j<tile[i].length; j++) {\n\t\t\t \t\t\tif (currentButton == tile[i][j]) {\n\t\t\t \t\t\t\tpieceYCoord = i;\n\t\t\t \t\t\t\tpieceXCoord = j;\n\t\t\t \t\t\t\t//System.out.println(pieceYCoord + \"\" + pieceXCoord);\n\t\t\t \t\t\t}\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t }\n\t\t\t if(currentButton.getIcon()==Player3.PieceImages[3]) {\n\t\t\t //System.out.println(\"This is player 3's \" + Player3.playersTeam.teamPieces[3].name);\n\t\t\t\tfor (int i=0; i<tile.length; i++) {\n\t\t\t \t\tfor(int j=0; j<tile[i].length; j++) {\n\t\t\t \t\t\tif (currentButton == tile[i][j]) {\n\t\t\t \t\t\t\tpieceYCoord = i;\n\t\t\t \t\t\t\tpieceXCoord = j;\n\t\t\t \t\t\t\t//System.out.println(pieceYCoord + \"\" + pieceXCoord);\n\t\t\t \t\t\t}\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t }\n\t\t\t if(currentButton.getIcon()==Player3.PieceImages[4]) {\n\t\t\t //System.out.println(\"This is player 3's \" + Player3.playersTeam.teamPieces[4].name);\n\t\t\t\tfor (int i=0; i<tile.length; i++) {\n\t\t\t \t\tfor(int j=0; j<tile[i].length; j++) {\n\t\t\t \t\t\tif (currentButton == tile[i][j]) {\n\t\t\t \t\t\t\tpieceYCoord = i;\n\t\t\t \t\t\t\tpieceXCoord = j;\n\t\t\t \t\t\t\t//System.out.println(pieceYCoord + \"\" + pieceXCoord);\n\t\t\t \t\t\t}\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t }\n\t\t\t if(currentButton.getIcon()==Player4.PieceImages[0]) {\n\t\t\t //System.out.println(\"This is player 4's \" + Player4.playersTeam.teamPieces[0].name);\n\t\t\t\tfor (int i=0; i<tile.length; i++) {\n\t\t\t \t\tfor(int j=0; j<tile[i].length; j++) {\n\t\t\t \t\t\tif (currentButton == tile[i][j]) {\n\t\t\t \t\t\t\tpieceYCoord = i;\n\t\t\t \t\t\t\tpieceXCoord = j;\n\t\t\t \t\t\t\t//System.out.println(pieceYCoord + \"\" + pieceXCoord);\n\t\t\t \t\t\t}\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t }\n\t\t\t if(currentButton.getIcon()==Player4.PieceImages[1]) {\n\t\t\t //System.out.println(\"This is player 4's \" + Player4.playersTeam.teamPieces[1].name);\n\t\t\t\tfor (int i=0; i<tile.length; i++) {\n\t\t\t \t\tfor(int j=0; j<tile[i].length; j++) {\n\t\t\t \t\t\tif (currentButton == tile[i][j]) {\n\t\t\t \t\t\t\tpieceYCoord = i;\n\t\t\t \t\t\t\tpieceXCoord = j;\n\t\t\t \t\t\t\t//System.out.println(pieceYCoord + \"\" + pieceXCoord);\n\t\t\t \t\t\t}\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t }\n\t\t\t if(currentButton.getIcon()==Player4.PieceImages[2]) {\n\t\t\t //System.out.println(\"This is player 4's \" + Player4.playersTeam.teamPieces[2].name);\n\t\t\t\tfor (int i=0; i<tile.length; i++) {\n\t\t\t \t\tfor(int j=0; j<tile[i].length; j++) {\n\t\t\t \t\t\tif (currentButton == tile[i][j]) {\n\t\t\t \t\t\t\tpieceYCoord = i;\n\t\t\t \t\t\t\tpieceXCoord = j;\n\t\t\t \t\t\t\t//System.out.println(pieceYCoord + \"\" + pieceXCoord);\n\t\t\t \t\t\t}\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t }\n\t\t\t if(currentButton.getIcon()==Player4.PieceImages[3]) {\n\t\t\t //System.out.println(\"This is player 4's \" + Player4.playersTeam.teamPieces[3].name);\n\t\t\t\tfor (int i=0; i<tile.length; i++) {\n\t\t\t \t\tfor(int j=0; j<tile[i].length; j++) {\n\t\t\t \t\t\tif (currentButton == tile[i][j]) {\n\t\t\t \t\t\t\tpieceYCoord = i;\n\t\t\t \t\t\t\tpieceXCoord = j;\n\t\t\t \t\t\t\t//System.out.println(pieceYCoord + \"\" + pieceXCoord);\n\t\t\t \t\t\t}\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t }\n\t\t\t if(currentButton.getIcon()==Player4.PieceImages[4]) {\n\t\t\t //System.out.println(\"This is player 4's \" + Player4.playersTeam.teamPieces[4].name);\n\t\t\t\tfor (int i=0; i<tile.length; i++) {\n\t\t\t \t\tfor(int j=0; j<tile[i].length; j++) {\n\t\t\t \t\t\tif (currentButton == tile[i][j]) {\n\t\t\t \t\t\t\tpieceYCoord = i;\n\t\t\t \t\t\t\tpieceXCoord = j;\n\t\t\t \t\t\t\t//System.out.println(pieceYCoord + \"\" + pieceXCoord);\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\n\t}", "public void initPieces() {\r\n\t\tfor (int i = 0; i < 64; i++) {\r\n\t\t\tif (i < 12) {\r\n\t\t\t\tblackPieces[i] = new ChessPiece(\"black\", \"\");\r\n\t\t\t\tblackPieces[i].setBackground(Color.BLACK);\r\n\t\t\t\tblackPieces[i].addMouseMotionListener(this);\r\n\t\t\t\tblackPieces[i].addMouseListener(this);\r\n\t\t\t\tblackPieces[i].setText(null);\r\n\t\t\t\twhitePieces[i] = new ChessPiece(\"white\", \"\");\r\n\t\t\t\twhitePieces[i].setBackground(Color.WHITE);\r\n\t\t\t\twhitePieces[i].addMouseMotionListener(this);\r\n\t\t\t\twhitePieces[i].addMouseListener(this);\r\n\t\t\t\twhitePieces[i].setText(null);\r\n\t\t\t}\r\n\t\t\tspacePieces[i] = new ChessPiece(\"empty\", \"\");\r\n\t\t\tspacePieces[i].setEnabled(false);\r\n\t\t\tspacePieces[i].setVisible(false);\r\n\t\t\tspacePieces[i].setText(null);\r\n\t\t}\r\n\t}", "private void setMapPos()\r\n {\r\n try\r\n {\r\n Thread.sleep(1000);//so that you can see players move\r\n }\r\n catch(Exception e){}\r\n int currentPlayer = worldPanel.getCurrentPlayer();\r\n int currentUnit = worldPanel.getCurrentUnit();\r\n int unitPos = 0;\r\n int firstX = 0;\r\n int firstY = 0;\r\n if (currentPlayer == 1)\r\n {\r\n unitPos = worldPanel.player1.units[currentUnit - 1].getPosition();\r\n }\r\n if (currentPlayer == 2)\r\n {\r\n unitPos = worldPanel.player2.units[currentUnit - 1].getPosition();\r\n }\r\n int tempX = unitPos % mapWidth;\r\n int tempY = unitPos - tempX;\r\n if (tempY == 0) {}\r\n else\r\n tempY = tempY / mapHeight;\r\n tempX = tempX - 11;\r\n tempY = tempY - 7;\r\n if (tempX >= 0)\r\n firstX = tempX;\r\n else\r\n firstX = tempX + mapWidth;\r\n if (tempY >= 0)\r\n firstY = tempY;\r\n else\r\n firstY = tempY + mapWidth;\r\n\r\n int drawWidth = worldPanel.getDrawWidth();\r\n int drawHeight = worldPanel.getDrawHeight();\r\n worldPanel.setNewXYPos(firstX, firstY);\r\n miniMap.setNewXY(firstX, firstY, drawWidth, drawHeight);\r\n }", "public void updateBoard() {\r\n\t\tfor(int i = 0, k = 0; i < board.getWidth(); i+=3) {\r\n\t\t\tfor(int j = 0; j < board.getHeight(); j+=3) {\r\n\t\t\t\t//Check that there are pieces to display\r\n\t\t\t\tif(k < bag.size()) {\r\n\t\t\t\t\tboard.setTile(bag.get(k), i, j);\r\n\t\t\t\t\tk++;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tboard.fillSpace(GridSquare.Type.EMPTY, i, j);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void boardInit() {\n ArrayList<Piece> white_piece_list = new ArrayList<>();\n ArrayList<Piece> black_piece_list = new ArrayList<>();\n ArrayList<Piece> piece_array = PieceFactory.createPieces();\n for(Piece p : piece_array)\n {\n if(p.getColor())\n {\n black_piece_list.add(p);\n }\n else\n {\n white_piece_list.add(p);\n }\n }\n white_player.setpieceList(white_piece_list);\n white_player.setKingXYCoords(PieceFactory.KING_INITIAL_X, PieceFactory.INITAL_Y_COORD_WHITE_PLAYER_OTHER);\n black_player.setpieceList(black_piece_list);\n black_player.setKingXYCoords(PieceFactory.KING_INITIAL_X, PieceFactory.INITAL_Y_COORD_WHITE_PLAYER_OTHER + PieceFactory.DIST_BETWEEN_PIECES);\n }", "@Test\n public void shouldChangeWhenPieceMoves() throws Exception {\n Player p1 = new Player(ChessPieceColor.BLACK, position);\n Pawn p = p1.pawns[0];\n Assert.assertSame(p, position.getPieceAtPosition(0, 1));\n p.move(0, 3, position);\n Assert.assertSame(p, position.getPieceAtPosition(0, 3));\n }", "public static void setUpGamePlayer() {\r\n String orientation; \r\n int xCoord;\r\n int yCoord;\r\n \r\n System.out.println(\"Let's place your ships on this \" + gameBoardPlayer.length + \"\"\r\n + \" by \" + gameBoardPlayer[0].length + \" board!\");\r\n \r\n displayBoard(gameBoardPlayer);\r\n \r\n System.out.println(\"\\n - - - - - - - - - - - - - - - - - - - \\n\");\r\n System.out.print(\"Position ships randomly (r) or manually (m): \");\r\n String choice = scan.next();\r\n \r\n // randomly places ships\r\n if (choice.equalsIgnoreCase(\"r\")) {\r\n System.out.println(\"Outcome: \");\r\n for (int i = 0; i < fleet.length; i++) {\r\n int random = (int)(Math.random() * 10);\r\n //0 - 4: ships placed horizontally, 5 - 9: ships placed vertically\r\n if (random < 5) {\r\n placeShipHorzRand(gameBoardPlayer, fleet[i], symbols[i]);\r\n }\r\n else {\r\n placeShipVertRand(gameBoardPlayer, fleet[i], symbols[i]);\r\n }\r\n }\r\n // display after all ships are randomly placed\r\n displayBoard(gameBoardPlayer);\r\n }\r\n // player chooses location for each ship\r\n else {\r\n for (int i = 0; i < fleet.length; i++) {\r\n System.out.println();\r\n displayBoard(gameBoardPlayer);\r\n System.out.println();\r\n System.out.println(\"Current ship: \" + fleet[i].getTitle());\r\n System.out.println(\"Length: \" + fleet[i].getLength());\r\n System.out.println();\r\n System.out.print(\"Place vertically (v) or horizontally (h): \");\r\n orientation = scan.next();\r\n System.out.print(\"Starting x-coordinate: \");\r\n xCoord = scan.nextInt();\r\n System.out.print(\"Starting y-coordinate: \");\r\n yCoord = scan.nextInt();\r\n \r\n if (orientation.equalsIgnoreCase(\"h\")) {\r\n placeShipHorzMan(gameBoardPlayer, fleet[i], symbols[i], xCoord, yCoord);\r\n }\r\n else {\r\n placeShipVertMan(gameBoardPlayer, fleet[i], symbols[i], xCoord, yCoord);\r\n }\r\n }\r\n }\r\n System.out.print(\"\\nComplete!! Now the computer is setting up . . .\");\r\n \r\n }", "public boolean movePiece(int player, int from, int to) {\n\n int piece = players.get(player).getPiece(from);\n\n // PIECELISTENER : Throw PieceEvent to PieceListeners\n for (PieceListener listener : pieceListeners) {\n PieceEvent pieceEvent = new PieceEvent(this, player, piece, from, to);\n listener.pieceMoved(pieceEvent);\n }\n\n if (piece != -1) {\n //last throw was a 6, but player is in starting position\n //end of turn\n if (this.lastThrow == 6 && players.get(player).inStartingPosition() && from == 0) {\n // PLAYERLISTENER : Trigger playerEvent for player that is WAITING\n for (PlayerListener listener : playerListeners) {\n PlayerEvent event = new PlayerEvent(this, players.get(player).getColour(), PlayerEvent.WAITING);\n listener.playerStateChanged(event);\n }\n this.setNextActivePlayer();\n }\n //player didn't throw a 6\n //end of turn\n if (this.lastThrow != 6) {\n // PLAYERLISTENER : Trigger playerEvent for player that is WAITING\n for (PlayerListener listener : playerListeners) {\n PlayerEvent event = new PlayerEvent(this, players.get(player).getColour(), PlayerEvent.WAITING);\n listener.playerStateChanged(event);\n }\n this.setNextActivePlayer();\n }\n\n //Resets the tower info when a tower is split\n if (players.get(player).getPieces().get(piece).towerPos != -1) {\n players.get(player)\n .getPieces()\n .get(piece)\n .setTower(-1);\n\n for (Piece piece2 : players.get(player).pieces) {\n if (piece2.position == from) {\n piece2.setTower(-1);\n }\n }\n }\n\n //Sets tower info when a tower is made\n for (Piece piece2 : players.get(player).pieces) {\n if (piece2.position == to) {\n //Both pieces become a tower\n piece2.setTower(piece2.position);\n players.get(player)\n .getPieces()\n .get(piece)\n .setTower(to);\n }\n }\n\n //move piece\n players.get(player)\n .getPieces()\n .get(piece)\n .setPosition(to);\n\n //set piece to in play\n if (to > 0 && to < 59) {\n players.get(player)\n .getPieces()\n .get(piece)\n .setInPlay(true);\n }\n\n checkIfAnotherPlayerLiesThere(player, to);\n\n if (to == 59) {\n\n if (players.get(player).pieceFinished()) {\n this.status = \"Finished\";\n getWinner();\n }\n }\n\n return true;\n } else {\n //doesn't work\n return false;\n }\n\n }", "public void movePlayer(String nomeArq, int px, int py) {\r\n if(Main.player1.Vez()) {\r\n if(nomeArq.equals(Main.PLAYER_LEFT)){\r\n \tMain.player1.MudaLado(true,false);\r\n }\r\n else {\r\n \tMain.player1.MudaLado(false,true);\r\n } \r\n pos = Main.player1.Position();\r\n int x = pos[0]+px;\r\n int y = pos[1];\r\n double t = 0.1;\r\n int OrigemY = y;\r\n double g=10;\r\n if(andar.BatidaFrente(x,y,Main.player1.Size()[0]+1,Main.player1.Size()[1]+1)==false) {\r\n \tMain.player1.NovaPosition(x,y); \r\n }\r\n Main.Fase.repinta(); \r\n while(andar.temChao(x,y,Main.player1.Size()[0]+1,Main.player1.Size()[1]+1)==false && andar.Paredao((int)x,(int)y,Main.player1.Size()[0],Main.player1.Size()[1])==false)\r\n {\r\n \tMain.player1.NovaPosition(x,y);\r\n \tMain.Fase.repinta(); \r\n y = (int)(OrigemY - (0-(g * (t*t))/2.0));\r\n t = t + 0.1; \r\n }\r\n Main.Fase.repinta(); \r\n }\r\n else {\r\n if(nomeArq.equals(Main.PLAYER_LEFT)) {\r\n \tMain.player2.MudaLado(true,false);\r\n }\r\n else {\r\n \tMain.player2.MudaLado(false,true);\r\n } \r\n pos = Main.player2.Position();\r\n int x = pos[0]+px;\r\n int y = pos[1];\r\n double t = 0;\r\n int OrigemY = y;\r\n double g=10;\r\n if(andar.BatidaFrente(x,y,Main.player2.Size()[0]+1,Main.player2.Size()[1]+1)==false) {\r\n \tMain.player2.NovaPosition(x,y); \r\n }\r\n Main.Fase.repinta(); \r\n while(andar.temChao(x,y,Main.player2.Size()[0]+1,Main.player2.Size()[1]+1)==false && andar.Paredao((int)x,(int)y,Main.player2.Size()[0]+1,Main.player2.Size()[1]+1)==false)\r\n {\r\n \tMain.player2.NovaPosition(x,y);\r\n \tMain.Fase.repinta(); \r\n y = (int)(OrigemY - (0-(g * (t*t))/2.0));\r\n t = t + 0.1; \r\n }\r\n }\r\n }", "public void reset() {\n // White Pieces\n placePiece(new Rook(Player.White), new Position(\"a1\"));\n placePiece(new Knight(Player.White), new Position(\"b1\"));\n placePiece(new Bishop(Player.White), new Position(\"c1\"));\n placePiece(new Queen(Player.White), new Position(\"d1\"));\n placePiece(new King(Player.White), new Position(\"e1\"));\n placePiece(new Bishop(Player.White), new Position(\"f1\"));\n placePiece(new Knight(Player.White), new Position(\"g1\"));\n placePiece(new Rook(Player.White), new Position(\"h1\"));\n placePiece(new Pawn(Player.White), new Position(\"a2\"));\n placePiece(new Pawn(Player.White), new Position(\"b2\"));\n placePiece(new Pawn(Player.White), new Position(\"c2\"));\n placePiece(new Pawn(Player.White), new Position(\"d2\"));\n placePiece(new Pawn(Player.White), new Position(\"e2\"));\n placePiece(new Pawn(Player.White), new Position(\"f2\"));\n placePiece(new Pawn(Player.White), new Position(\"g2\"));\n placePiece(new Pawn(Player.White), new Position(\"h2\"));\n\n // Black Pieces\n placePiece(new Rook(Player.Black), new Position(\"a8\"));\n placePiece(new Knight(Player.Black), new Position(\"b8\"));\n placePiece(new Bishop(Player.Black), new Position(\"c8\"));\n placePiece(new Queen(Player.Black), new Position(\"d8\"));\n placePiece(new King(Player.Black), new Position(\"e8\"));\n placePiece(new Bishop(Player.Black), new Position(\"f8\"));\n placePiece(new Knight(Player.Black), new Position(\"g8\"));\n placePiece(new Rook(Player.Black), new Position(\"h8\"));\n placePiece(new Pawn(Player.Black), new Position(\"a7\"));\n placePiece(new Pawn(Player.Black), new Position(\"b7\"));\n placePiece(new Pawn(Player.Black), new Position(\"c7\"));\n placePiece(new Pawn(Player.Black), new Position(\"d7\"));\n placePiece(new Pawn(Player.Black), new Position(\"e7\"));\n placePiece(new Pawn(Player.Black), new Position(\"f7\"));\n placePiece(new Pawn(Player.Black), new Position(\"g7\"));\n placePiece(new Pawn(Player.Black), new Position(\"h7\"));\n }", "public static void placePlayerPiece(PlayerMovesHandler player) {\n\t\t// char piece = player.getPiece();\n\t\tScanner in = new Scanner(System.in);\n\t\tboolean invalidInput = true;\n\n\t\twhile (invalidInput) {\n\t\t\tSystem.out.println(\"Enter row and column no. where you want to place your mark (Top left is [1,1])\");\n\n\t\t\tint row = in.nextInt() - 1;\n\t\t\tint col = in.nextInt() - 1;\n\t\t\tinvalidInput = !(player.setPiece(row, col));\t// callee returns true if success \n\t\t}\n\t}", "private void prepareBoard(){\n gameBoard.arrangeShips();\n }", "public Vector<ChessBoardBlock> getMovablePosition(ChessPiece p) {\r\n\t\tString player = p.chessPlayer;\r\n\t\tString position = p.position;\r\n\t\tchar h = position.charAt(0);\r\n\t\tint v = Integer.parseInt(position.substring(1));\r\n\t\tVector<ChessBoardBlock> tmp = new Vector<ChessBoardBlock>();\r\n\t\ttmp.add(board.get(position));\r\n\t\t\r\n\t\t// Condition for white piece\r\n\t\tif (player.equals(\"white\")) {\r\n\t\t\t\r\n\t\t\t// Condition for not King piece\r\n\t\t\tif (p.getText() == null) {\r\n\t\t\t\tChessBoardBlock br1 = board.get(Character.toString((char)(h+1)) + (v+1));\r\n\t\t\t\tChessBoardBlock br2 = board.get(Character.toString((char)(h+2)) + (v+2));\r\n\t\t\t\t// Condition for upper right to the piece\r\n\t\t\t\tif (br1 != null && piece.get(br1.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(br1.position));\r\n\t\t\t\t} else if (br2 != null && piece.get(br1.position).chessPlayer.equals(\"black\") && piece.get(br2.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(br2.position));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tChessBoardBlock bl1 = board.get(Character.toString((char)(h-1)) + (v+1));\r\n\t\t\t\tChessBoardBlock bl2 = board.get(Character.toString((char)(h-2)) + (v+2));\r\n\t\t\t\t// Condition for upper left to the piece\r\n\t\t\t\tif (bl1 != null && piece.get(bl1.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bl1.position));\r\n\t\t\t\t} else if (bl2 != null && piece.get(bl1.position).chessPlayer.equals(\"black\") && piece.get(bl2.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bl2.position));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t} \r\n\r\n\t\t\t// Condition for King piece\r\n\t\t\telse {\r\n\t\t\t\tChessBoardBlock bur1 = board.get(Character.toString((char)(h+1)) + (v+1));\r\n\t\t\t\tChessBoardBlock bur2 = board.get(Character.toString((char)(h+2)) + (v+2));\r\n\t\t\t\t// Condition for upper right to the piece\r\n\t\t\t\tif (bur1 != null && piece.get(bur1.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bur1.position));\r\n\t\t\t\t} else if (bur2 != null && piece.get(bur1.position).chessPlayer.equals(\"black\") && piece.get(bur2.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bur2.position));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tChessBoardBlock bul1 = board.get(Character.toString((char)(h-1)) + (v+1));\r\n\t\t\t\tChessBoardBlock bul2 = board.get(Character.toString((char)(h-2)) + (v+2));\r\n\t\t\t\t// Condition for upper left to the piece\r\n\t\t\t\tif (bul1 != null && piece.get(bul1.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bul1.position));\r\n\t\t\t\t} else if (bul2 != null && piece.get(bul1.position).chessPlayer.equals(\"black\") && piece.get(bul2.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bul2.position));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tChessBoardBlock bdr1 = board.get(Character.toString((char)(h+1)) + (v-1));\r\n\t\t\t\tChessBoardBlock bdr2 = board.get(Character.toString((char)(h+2)) + (v-2));\r\n\t\t\t\t// Condition for lower right to the piece\r\n\t\t\t\tif (bdr1 != null && piece.get(bdr1.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bdr1.position));\r\n\t\t\t\t} else if (bdr2 != null && piece.get(bdr1.position).chessPlayer.equals(\"black\") && piece.get(bdr2.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bdr2.position));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tChessBoardBlock bdl1 = board.get(Character.toString((char)(h-1)) + (v-1));\r\n\t\t\t\tChessBoardBlock bdl2 = board.get(Character.toString((char)(h-2)) + (v-2));\r\n\t\t\t\t// Condition for lower left to the piece\r\n\t\t\t\tif (bdl1 != null && piece.get(bdl1.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bdl1.position));\r\n\t\t\t\t} else if (bdl2 != null && piece.get(bdl1.position).chessPlayer.equals(\"black\") && piece.get(bdl2.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bdl2.position));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Condition for black piece\r\n\t\telse {\r\n\t\t\t\r\n\t\t\t// Condition for not King piece\r\n\t\t\tif (p.getText() == null) {\r\n\t\t\t\tChessBoardBlock br1 = board.get(Character.toString((char)(h+1)) + (v-1));\r\n\t\t\t\tChessBoardBlock br2 = board.get(Character.toString((char)(h+2)) + (v-2));\r\n\t\t\t\t// Condition for upper right to the piece\r\n\t\t\t\tif (br1 != null && piece.get(br1.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(br1.position));\r\n\t\t\t\t} else if (br2 != null && piece.get(br1.position).chessPlayer.equals(\"white\") && piece.get(br2.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(br2.position));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tChessBoardBlock bl1 = board.get(Character.toString((char)(h-1)) + (v-1));\r\n\t\t\t\tChessBoardBlock bl2 = board.get(Character.toString((char)(h-2)) + (v-2));\r\n\t\t\t\t// Condition for upper left to the piece\r\n\t\t\t\tif (bl1 != null && piece.get(bl1.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bl1.position));\r\n\t\t\t\t} else if (bl2 != null && piece.get(bl1.position).chessPlayer.equals(\"white\") && piece.get(bl2.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bl2.position));\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tChessBoardBlock bur1 = board.get(Character.toString((char)(h+1)) + (v+1));\r\n\t\t\t\tChessBoardBlock bur2 = board.get(Character.toString((char)(h+2)) + (v+2));\r\n\t\t\t\t// Condition for upper right to the piece\r\n\t\t\t\tif (bur1 != null && piece.get(bur1.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bur1.position));\r\n\t\t\t\t} else if (bur2 != null && piece.get(bur1.position).chessPlayer.equals(\"white\") && piece.get(bur2.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bur2.position));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tChessBoardBlock bul1 = board.get(Character.toString((char)(h-1)) + (v+1));\r\n\t\t\t\tChessBoardBlock bul2 = board.get(Character.toString((char)(h-2)) + (v+2));\r\n\t\t\t\t// Condition for upper left to the piece\r\n\t\t\t\tif (bul1 != null && piece.get(bul1.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bul1.position));\r\n\t\t\t\t} else if (bul2 != null && piece.get(bul1.position).chessPlayer.equals(\"white\") && piece.get(bul2.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bul2.position));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tChessBoardBlock bdr1 = board.get(Character.toString((char)(h+1)) + (v-1));\r\n\t\t\t\tChessBoardBlock bdr2 = board.get(Character.toString((char)(h+2)) + (v-2));\r\n\t\t\t\t// Condition for lower right to the piece\r\n\t\t\t\tif (bdr1 != null && piece.get(bdr1.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bdr1.position));\r\n\t\t\t\t} else if (bdr2 != null && piece.get(bdr1.position).chessPlayer.equals(\"white\") && piece.get(bdr2.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bdr2.position));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tChessBoardBlock bdl1 = board.get(Character.toString((char)(h-1)) + (v-1));\r\n\t\t\t\tChessBoardBlock bdl2 = board.get(Character.toString((char)(h-2)) + (v-2));\r\n\t\t\t\t// Condition for lower left to the piece\r\n\t\t\t\tif (bdl1 != null && piece.get(bdl1.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bdl1.position));\r\n\t\t\t\t} else if (bdl2 != null && piece.get(bdl1.position).chessPlayer.equals(\"white\") && piece.get(bdl2.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bdl2.position));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn tmp;\r\n\t}", "public void move()\n {\n if (!alive) {\n return;\n }\n\n if (speedTimer > 0) {\n speedTimer --;\n } else if (speedTimer == 0 && speed != DEFAULT_SPEED) {\n speed = DEFAULT_SPEED;\n }\n\n Location last = playerLocations.get(playerLocations.size()-1);\n Location next = null;\n\n // For the speed, iterate x blocks between last and next\n\n if (direction == UPKEY)\n {\n next = getLocation(last.getX(), (int)(last.getY() - speed * getPixelSize()));\n } else if (direction == DOWNKEY)\n {\n next = getLocation(last.getX(), (int)(last.getY() + speed * getPixelSize()));\n } else if (direction == LEFTKEY)\n {\n next = getLocation((int)(last.getX() - speed * getPixelSize()), last.getY());\n } else if (direction == RIGHTKEY)\n {\n next = getLocation((int)(last.getX() + speed * getPixelSize()), last.getY());\n }\n\n ArrayList<Location> line = getLine(last, next);\n\n if (line.size() == 0) {\n gameOver();\n return;\n }\n\n for (Location loc : line) {\n if (checkCrash (loc)) {\n gameOver();\n return;\n } else {\n // Former bug: For some reason when a player eats a powerup a hole appears in the line where the powerup was.\n Location l2 = getLocation(loc.getX(), loc.getY());\n l2.setType(LocationType.PLAYER);\n l2.setColor(this.col);\n\n playerLocations.add(l2);\n getGridCache().add(l2);\n }\n }\n }", "public static void drawPlayerBoard()\n {\n char rowLetter=' '; //Letra de las filas.\n \n System.out.println(\" 1 2 3 4 \" ); //Imprime la parte superior del tablero.\n System.out.println(\" +-------+-------+\");\n \n \n for (int i = 0; i< BOARD_HEIGHT; i++) //Controla los saltos de fila.\n {\n switch(i)\n {\n case 0: rowLetter='A';\n break;\n case 1: rowLetter='B';\n break;\n case 2: rowLetter='C';\n break;\n case 3: rowLetter='D';\n break;\n }\n \n System.out.print(rowLetter);\n \n for (int j = 0; j < BOARD_WIDTH; j++ ) //Dibuja las filas.\n {\n if (playerBoardPos[i][j]==0)\n {\n System.out.print(\"| · \");\n }\n else\n {\n System.out.print(\"| \" + playerBoardPos[i][j] + \" \");\n }\n }\n System.out.println(\"|\");\n \n if (i==((BOARD_HEIGHT/2)-1)) //Si se ha dibujado la mitad del tablero.\n {\n System.out.println(\" +-------+-------+\"); //Dibuja una separación en medio del tablero.\n }\n }\n \n System.out.println(\" +-------+-------+\"); //Dibuja linea de fin del tablero.\n }", "protected abstract void position(int[][] gameboard, int col, int row);", "private void initialiseBoard() {\r\n\t\t//Set all squares to EMPTY\r\n\t\tfor(int x = 0; x < board.getWidth(); x++) {\r\n\t\t\tfor(int y = 0; y < board.getHeight(); y++) {\r\n\t\t\t\tboard.setSquare(new GridSquare(GridSquare.Type.EMPTY), x, y);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Assign player tiles\r\n\t\tsetFixedTile(new PlayerTile(GridSquare.Type.PLAYER_ONE_TILE), Board.PLAYER_ONE_POSITION_X, Board.PLAYER_ONE_POSITION_Y);\r\n\t\tsetFixedTile(new PlayerTile(GridSquare.Type.PLAYER_TWO_TILE), Board.PLAYER_TWO_POSITION_X, Board.PLAYER_TWO_POSITION_Y);\r\n\t\t\r\n\t\t//Assign Creation tiles\r\n\t\tsetFixedTile(new CreationTile(GridSquare.Type.CREATION_TILE), Board.PLAYER_ONE_POSITION_X+3, Board.PLAYER_ONE_POSITION_Y+3);\r\n\t\tsetFixedTile(new CreationTile(GridSquare.Type.CREATION_TILE), Board.PLAYER_TWO_POSITION_X-3, Board.PLAYER_TWO_POSITION_Y-3);\r\n\t\t\r\n\t\t//Assign Out of Bounds tiles\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_ONE_POSITION_X-3, Board.PLAYER_ONE_POSITION_Y);\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_ONE_POSITION_X, Board.PLAYER_ONE_POSITION_Y-3);\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_ONE_POSITION_X-3, Board.PLAYER_ONE_POSITION_Y-3);\r\n\t\t\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_TWO_POSITION_X+3, Board.PLAYER_TWO_POSITION_Y);\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_TWO_POSITION_X, Board.PLAYER_TWO_POSITION_Y+3);\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_TWO_POSITION_X+3, Board.PLAYER_TWO_POSITION_Y+3);\r\n\t\t\r\n\t\t\r\n\t}", "private void playerMove(PlayerPiece playerPiece, String direction) {\n // Row will be -1 from player location with the same column value\n System.out.println(playerPiece + \" trying to move \" + direction + \".\");\n Tile playerLocation = playerPiece.getLocation();\n System.out.println(\"Player in: \" + playerLocation.getRow() + \" \" + playerLocation.getColumn());\n int newRow = playerLocation.getRow();\n int newColumn = playerLocation.getColumn();\n switch (direction) {\n case \"u\":\n newRow -= 1;\n break;\n case \"d\":\n newRow += 1;\n break;\n case \"l\":\n newColumn -= 1;\n break;\n case \"r\":\n newColumn += 1;\n break;\n }\n if (newRow >= 0 && newColumn >= 0 && newRow < this.board.getGrid().getRows() && newColumn < this.board.getGrid().getColumns()) {\n System.out.println(newRow + \" \" + newColumn);\n Tile newLocation = this.board.getGrid().getTile(newRow, newColumn);\n System.out.println(\"New Location:\" + newLocation);\n System.out.println(\"Cords: \" + newLocation.getRow() + \" \" + newLocation.getColumn());\n if (newLocation.isAvailable()) {\n playerLocation.removeOccupier();\n playerPiece.setLocation(newLocation);\n newLocation.setOccupier(playerPiece);\n System.out.println(\"Player moved to: \" + playerLocation.getRow() + \" \" + playerLocation.getColumn());\n this.board.getGrid().print();\n }\n }\n }", "public void play(int direction)\r\n {\r\n int temp = 0; \r\n boolean moved = false;\r\n if (direction == LEFT_INPUT ) {\r\n for (int q = 0;q < 4; q++) { \r\n for (int i = 0; i < grid.length;i++){ \r\n if (grid[i][q] > 0 && q != 0){ \r\n for (int sum = q - 1; sum >= 0; sum--) {\r\n if (sum >= 0 && grid[i][sum] == grid[i][q]) {\r\n gui.clearSlot(i, q);\r\n currentScore = (long) Math.pow(2, grid[i][q]) + currentScore;\r\n gui.setScore(currentScore);\r\n moved = true;\r\n gui.setNewSlotBySlotIndex(i, sum, ++grid[i][q]);\r\n if (grid[i][q] == winningLevel+1){ highS(high); gui.showGameWon();}\r\n temp = grid[i][q];\r\n grid[i][q] = 0;\r\n grid[i][sum] = temp;\r\n break;\r\n } else if (sum >= 0 && grid[i][sum] != 0){\r\n break;\r\n }}\r\n for (int r = 0; grid[i][q] > 0 && r < q; r++){\r\n if (grid[i][r] == 0) {\r\n gui.clearSlot(i,q);\r\n gui.setNewSlotBySlotIndex(i,r,grid[i][q]);\r\n temp = grid[i][q];\r\n grid[i][q] = 0; \r\n grid[i][r] = temp;\r\n moved = true;\r\n break;\r\n }}}}} \r\n \r\n } else if (direction == DOWN_INPUT) {\r\n \r\n for (int i = grid.length - 1; i >= 0; i--) {\r\n for (int q = 0; q < grid[i].length; q++) {\r\n if (grid[i][q] > 0) {\r\n for (int sum = i + 1; sum <= 3; sum++) {\r\n if (sum >= 0 && grid[sum][q] == grid[i][q]) {\r\n gui.clearSlot(i, q);\r\n currentScore = (long) Math.pow(2, grid[i][q]) + currentScore;\r\n gui.setScore(currentScore);\r\n moved = true;\r\n gui.setNewSlotBySlotIndex(sum, q, ++grid[i][q]);\r\n if (grid[i][q] == winningLevel+1) {highS(high); gui.showGameWon();}\r\n temp = grid[i][q];\r\n grid[i][q] = 0;\r\n grid[sum][q] = temp;\r\n break;\r\n } else if (sum >= 0 && grid[sum][q] != 0)\r\n break;\r\n }\r\n for (int r = 3; grid[i][q] > 0 && r > i; r--)\r\n if (grid[r][q] == 0) {\r\n gui.clearSlot(i, q);\r\n gui.setNewSlotBySlotIndex(r, q, grid[i][q]);\r\n temp = grid[i][q];\r\n moved = true;\r\n grid[i][q] = 0;\r\n grid[r][q] = temp;\r\n break;\r\n }}}} \r\n \r\n } else if (direction == RIGHT_INPUT){\r\n \r\n for (int q = 3; q >= 0; q--) {\r\n for (int i = 0; i < grid.length; i++) {\r\n if (grid[i][q] > 0) {\r\n for (int sum = q + 1; sum <= 3; sum++) {\r\n if (sum >= 0 && grid[i][sum] == grid[i][q]) {\r\n gui.clearSlot(i, q);\r\n currentScore = (long) Math.pow(2, grid[i][q]) + currentScore;\r\n gui.setScore(currentScore);\r\n moved = true;\r\n gui.setNewSlotBySlotIndex(i, sum, ++grid[i][q]);\r\n if (grid[i][q] == winningLevel+1) {highS(high); gui.showGameWon();}\r\n temp = grid[i][q];\r\n grid[i][q] = 0;\r\n grid[i][sum] = temp;\r\n break;\r\n } else if (sum >= 0 && grid[i][sum] != 0)\r\n break;\r\n }\r\n for (int r = 3; grid[i][q] > 0 && r > q; r--)\r\n if (grid[i][r] == 0) {\r\n gui.clearSlot(i, q);\r\n gui.setNewSlotBySlotIndex(i, r, grid[i][q]);\r\n temp = grid[i][q];\r\n moved = true;\r\n grid[i][q] = 0;\r\n grid[i][r] = temp;\r\n break;\r\n }}}} \r\n \r\n } else if (direction == UP_INPUT) {\r\n \r\n for (int i = 0; i < grid.length; i++) {\r\n for (int q = 0; q < grid[i].length; q++) {\r\n if (grid[i][q] > 0) {\r\n for (int sum = i - 1; sum >= 0; sum--) {\r\n if (sum >= 0 && grid[sum][q] == grid[i][q]) {\r\n gui.clearSlot(i, q);\r\n currentScore = (long) Math.pow(2, grid[i][q]) + currentScore;\r\n gui.setScore(currentScore);\r\n moved = true;\r\n gui.setNewSlotBySlotIndex(sum, q, ++grid[i][q]);\r\n if (grid[i][q] == winningLevel+1) {highS(high); gui.showGameWon();}\r\n temp = grid[i][q];\r\n grid[i][q] = 0;\r\n grid[sum][q] = temp;\r\n break;\r\n } else if (sum >= 0 && grid[sum][q] != 0)\r\n break;\r\n }\r\n for (int r = 0; grid[i][q] > 0 && r < i; r++)\r\n if (grid[r][q] == 0) {\r\n gui.clearSlot(i, q);\r\n gui.setNewSlotBySlotIndex(r, q, grid[i][q]);\r\n temp = grid[i][q];\r\n moved = true;\r\n grid[i][q] = 0;\r\n grid[r][q] = temp;\r\n break;\r\n }}}} \r\n } else if (direction == S_INPUT) {\r\n int save = gui.saveGame();\r\n if (save == 0) {\r\n try {\r\n BufferedWriter out = new BufferedWriter(new FileWriter(\"load.txt\"));\r\n out.write(\"1\");\r\n out.newLine();\r\n for (int i = 0; i < grid.length; i++){\r\n for (int q = 0; q < grid[i].length; q++){\r\n out.write(\"\"+grid[i][q]);\r\n out.newLine();\r\n }}\r\n if (high == currentScore) highS(high);\r\n out.write(\"\"+currentScore);\r\n out.close();\r\n } catch (IOException iox) {\r\n System.out.println(\"Problem with files\" );\r\n }}}\r\n else if (direction == R_INPUT) {\r\n try {\r\n BufferedWriter out = new BufferedWriter(new FileWriter(\"load.txt\"));\r\n out.write(\"0\");\r\n out.newLine();\r\n for (int i = 0; i < grid.length; i++){\r\n for (int q = 0; q < grid[i].length; q++){\r\n out.write(\"0\");\r\n out.newLine();\r\n }}\r\n out.write(\"0\");\r\n out.close();\r\n gui.restSave();\r\n } catch (IOException iox) {\r\n System.out.println(\"Problem with files\" );\r\n }}\r\n else if (direction == H_INPUT) {\r\n gui.highScore(high,currentScore);\r\n }\r\n else if (direction == K_INPUT){\r\n gui.clearSlot(3, 3);\r\n gui.clearSlot(3, 2);\r\n grid[3][3] = 10;\r\n grid[3][2] = 10;\r\n gui.setNewSlotBySlotIndex(3, 3, grid[3][3]);\r\n gui.setNewSlotBySlotIndex(3, 2, grid[3][2]);\r\n }\r\n \r\n int counter = 0;\r\n boolean check = false;\r\n if (moved == false) {\r\n for (int i = 0;i<grid.length;i++){\r\n for(int q =0; q<grid[i].length;q++){\r\n if (i != 0) if (grid[i][q] == grid[i-1][q]) {check = true; break;} // Up\r\n if (q != 3) if (grid[i][q]==grid[i][q+1]){check = true; break;} // Right\r\n if (grid[i][q]>0) counter = counter + 1;\r\n }}\r\n for (int i = 3;i>=0;i--){\r\n for(int q =3; q>=0;q--){\r\n if (i != 0) if (grid[i][q] == grid[i-1][q]){check = true; break;} // Down\r\n if (q != 3) if (grid[i][q]==grid[i][q+1]) {check = true; break;} // Left\r\n if (grid[i][q]>0) counter = counter + 1;\r\n }}}\r\n if (counter == 32) {\r\n highS(high);\r\n gui.showGameOver();\r\n }\r\n \r\n newSlot(moved,check);\r\n // TO DO: implement the action to be taken after an arrow key of the\r\n // specified direction is pressed.\r\n }", "public int move(Piece piece, int dices){\n int step = this.roll(dices); //and returns the new position of piece of player.\n this.piece.position += step;\n this.piece.position = (this.piece.position%40);\n System.out.println(this.name + \" is now located in Square \" + this.piece.position);\n return piece.position;\n }", "private void printBoard() {\n\n for (int j=Board.getSize()-1; j >= 0; j--) {\n for (int i=0; i < Board.getSize(); i++) {\n // make sure indexes get printed for my pieces\n if (board.layout[i][j] == player) {\n //System.out.print(\" \"+ getPieceIndex(i,j)+ \" \");\n } else {\n System.out.print(\" \"+ board.layout[i][j]+ \" \");\n }\n }\n System.out.print(\"\\n\");\n\n }\n }", "public static void initialize()\n\t{\n\n\t\tint[] actualPlayers = new int[4]; // indices of the existing players\n\t\tint index = 0;\n\t\tfor (int i = 0; i < 5; i++)\n\t\t{\n\t\t\tif (players[i].exist)\n\t\t\t\tactualPlayers[index++] = i;\n\t\t}\n\n\t\tif (playerNum == 4)\n\t\t{\n\t\t\tplayers[2].x = 16;\n\t\t\tplayers[2].y = 30;\n\t\t\tplayers[1].x = 16;\n\t\t\tplayers[1].y = 10;\n\t\t\tplayers[3].x = 37;\n\t\t\tplayers[3].y = 10;\n\t\t\tplayers[4].x = 37;\n\t\t\tplayers[4].y = 30;\n\t\t}\n\t\telse if (playerNum == 2)\n\t\t{\t\t\t\n\t\t\tplayers[actualPlayers[0]].x = 16;\n\t\t\tplayers[actualPlayers[0]].y = 20;\n\t\t\tplayers[actualPlayers[1]].x = 37;\n\t\t\tplayers[actualPlayers[1]].y = 20;\t\t\t \n\t\t}\n\t\telse if (playerNum == 3)\n\t\t{\n\t\t\tplayers[actualPlayers[0]].x = 16;\n\t\t\tplayers[actualPlayers[0]].y = 20;\n\t\t\tplayers[actualPlayers[1]].x = 37;\n\t\t\tplayers[actualPlayers[1]].y = 10;\n\t\t\tplayers[actualPlayers[2]].x = 37;\n\t\t\tplayers[actualPlayers[2]].y = 30;\t\n\t\t}\n\n\t\tfor (int i = 0; i < 5; i++)\n\t\t{\n\t\t\tplayers[i].square = new boolean[HEIGHT + 2][WIDTH + 2];\n\t\t\tif (players[i].exist)\n\t\t\t{\n\t\t\t\tplayers[i].alive = true;\n\t\t\t\tplayers[i].square[players[i].y][players[i].x] = true;\n\t\t\t}\n\t\t\tplayers[i].dir = 'a'; // 'a' means no direction yet\n\t\t}\n\n\t\tstarting = false;\n\n\t}", "@Override\n\tpublic void mousePressed(MouseEvent e) {\n\t\tint[] position = new int[2];\n\t\tposition = db.MovableHumanPiecePosition(p);\n\t\t\n\t\t// show possible moves of the selected piece in the board\n\t\tif(position[0] < 6){\n\t\t\ttry{\n\t\t\t\tif(db.isPlayed() == false){\n\t\t\t\t\tdb.displayPossibleMoveSquare(position);\n\t\t\t}\n\t\t\t}catch(Exception e1){\n\t\t\t\te1.toString();\n\t\t\t}\n\t\t}\t\n\t\t\n\t}", "public void attack(int x, int y, int xx, int yy) {\n int result = ((MovablePiece)(controller.getBoard().getPiece(x, y))).attack(controller.getBoard().getPiece(xx,yy));\n int player;\n \n if(result < 4) {\n mc.playMusic(\"sounds\\\\Bomb.wav\");\n }\n \n if(result == 1) {\n controller.getPlayer(controller.getTurn()).getMyGraveyard().setPiece(controller.getBoard().getPiece(xx, yy));\n controller.getBoard().setPiece(controller.getBoard().getPiece(x, y), xx, yy);\n controller.getBoard().deletePiece(x, y);\n Cell[xx][yy].setIcon(new ImageIcon(\"pieces\\\\\" + this.getName()));\n } else if(result == 2) {\n controller.getPlayer(controller.getTurn()).getMyGraveyard().setPiece(controller.getBoard().getPiece(xx, yy));\n controller.getPlayer(prevTurn).getMyGraveyard().setPiece(controller.getBoard().getPiece(x, y));\n controller.getBoard().deletePiece(xx,yy);\n controller.getBoard().deletePiece(x, y);\n Cell[xx][yy].setIcon(null);\n Cell[xx][yy].setBackground(Color.white);\n } else if(result == 3){\n controller.getPlayer(prevTurn).getMyGraveyard().setPiece(controller.getBoard().getPiece(x, y));\n controller.getBoard().deletePiece(x, y);\n } else if(result == 5) {\n mc.playMusic(\"sounds\\\\Sorceress.wav\");\n try {\n Thread.sleep(4000);\n } catch (InterruptedException ex) {\n Logger.getLogger(Graphics.class.getName()).log(Level.SEVERE, null, ex);\n }\n piece = controller.getBoard().getTable()[xx][yy];\n if(piece.getLevel()< controller.getBoard().getPiece(x, y).getLevel() && piece.getLevel() != 0 ) {\n if(piece.getColour() == 'R') {\n piece.setColour('B');\n piece.setName(piece.getName().replace(\"R\", \"B\"));\n } else {\n piece.setColour('R');\n piece.setName(piece.getName().replace(\"B\", \"R\"));\n }\n piece.setIcon(piece.getName());\n }\n } else {\n /* NOTHING IS CHARGED */\n }\n Cell[x][y].setIcon(null);\n Cell[x][y].setBackground(Color.white);\n for(int i = 0; i < 12; i++) {\n RGrave[i].setToolTipText(controller.getPlayer(2).getMyGraveyard().getQuantity(i) + \"/\" + (new Collection('R')).getQuantity(i));\n BGrave[i].setToolTipText(controller.getPlayer(1).getMyGraveyard().getQuantity(i) + \"/\" + (new Collection('B')).getQuantity(i));\n }\n }", "void move() {\r\n\t\tif (x + xa < 0){\r\n\t\t\txa = mov;\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\telse if (x + xa > game.getWidth() - diameter){\r\n\t\t\txa = -mov;\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\tif (y + ya < 0){\r\n\t\t\tya = mov;\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\telse if (y + ya > game.getHeight() - diameter){\r\n\t\t\tgame.gameOver();\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\tif (colisionPalas()){\r\n\t\t\tya = -mov;\r\n\t\t}\r\n\t\telse if(colisionEstorbos()){\r\n\t\t\tgame.puntuacion+=2;\r\n\t\t}\r\n\t\t\r\n\t\tx = x + xa;\r\n\t\ty = y + ya;\r\n\t}", "private void setCellGrid(){\n count=0;\n status.setText(\"Player 1 Move\");\n field = new ArrayList<>();\n for (int i=0; i< TwoPlayersActivity.CELL_AMOUNT; i++) {\n field.add(new Cell(i));\n }\n }", "public void setSpace(int position, Box player){\r\n\t\tboard[position - 1] = player;\r\n\t\t\r\n\t}", "public void playerMove()\n\t{\n\t\tint col = 0;\n\t\tint row = 0;\n\t\tint choice = 0;\n\t\twhile (true)\n\t\t{\n\t\t\tif (StdDraw.mousePressed())\n\t\t\t{\n\t\t\t\tif (StdDraw.mouseX() > 0.5)\t\t//checks if player is clicking on a number option\n\t\t\t\t{\n\t\t\t\t\tif (StdDraw.mouseY() < 0.25) //logic for checking which number is selected\n\t\t\t\t\t{\n\t\t\t\t\t\tfor(int a = 0; a < human.size(); a++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (choice == 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (human.get(a).equals(2))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tchoice = 2;\n\t\t\t\t\t\t\t\t\thuman.remove(a);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (StdDraw.mouseY() < 0.5)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor(int a = 0; a < human.size(); a++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (choice == 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (human.get(a).equals(4))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tchoice = 4;\n\t\t\t\t\t\t\t\t\thuman.remove(a);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (StdDraw.mouseY() < 0.75)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor(int a = 0; a < human.size(); a++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (choice == 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (human.get(a).equals(6))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tchoice = 6;\n\t\t\t\t\t\t\t\t\thuman.remove(a);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfor(int a = 0; a < human.size(); a++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (choice == 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (human.get(a).equals(8))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tchoice = 8;\n\t\t\t\t\t\t\t\t\thuman.remove(a);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (StdDraw.mousePressed()) //fills in players move\n\t\t\t{\n\t\t\t\tif (choice != 0)\n\t\t\t\t{\n\t\t\t\t\tif (StdDraw.mouseX() < 0.5)\n\t\t\t\t\t{\t\n\t\t\t\t\t\tcol = (int) ((StdDraw.mouseX() * 6));\t\t\t\t\t\t\n\t\t\t\t\t\trow = (int) ((StdDraw.mouseY() * 3));\n\t\t\t\t\t\tif (board[row][col] == 0) \n\t\t\t\t\t\t{\t\t// valid move (empty slot)\n\t\t\t\t\t\t\tboard[row][col] = choice;\n\t\t\t\t\t\t\tdraw.drawMove(col, row, choice);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public int getPlayersPiece() {\n return playersPiece;\n }", "private Board(Piece[][] initialContents, Side player) {\n assert player != null && initialContents.length == 8;\n Piece p;\n for (int i = 0; i < 8; i++) {\n for(int j = 0; j < 8; j++) {\n p = initialContents[i][j];\n if (p.side() != null) {\n if (p.side() == BLACK) {\n _countBlack += 1;\n } else {\n _countWhite += 1;\n }\n addPiece(j + 1, i + 1);\n }\n _pieces[i][j] = p\n }\n }\n _turn = player;\n }", "private void calculatePlayerStats(int pos) {\r\n\r\n initializeStatisticVariables();\r\n StatistisDAO statDAO = new StatistisDAO(Statistics.this);\r\n DAOUtilities daoUtil = new DAOUtilities(Statistics.this);\r\n PlayerDAO playerDAO = new PlayerDAO(Statistics.this);\r\n BagDAO bagDAO = new BagDAO(Statistics.this);\r\n\r\n Player player = new Player();\r\n long id = playerDAO.readIDFromName(players.get(pos));\r\n player.setID(id);\r\n\r\n averageScore = daoUtil.getAverageAdjustedScorePlayer(player);\r\n averagePlusMinus = averageScore - 72;\r\n averageFront9Score = daoUtil.getAverageAdjustedFrontNineScorePlayer(player);\r\n averageFront9PlusMinus = averageFront9Score - 36;\r\n averageBack9Score = daoUtil.getAverageAdjustedBackNineScorePlayer(player);\r\n averageBack9PlusMinus = averageBack9Score - 36;\r\n averageHoleScore = averageScore / 18;\r\n averageHolePlusMinus = averageHoleScore - 4;\r\n\r\n\r\n // get the number of each holes\r\n numberOfPar3Holes = statDAO.getNHolesPar(3, player);\r\n numberOfPar4Holes = statDAO.getNHolesPar(4, player);\r\n numberOfPar5Holes = statDAO.getNHolesPar(5, player);\r\n numberOfHoles = numberOfPar3Holes\r\n + numberOfPar4Holes\r\n + numberOfPar5Holes;\r\n\r\n // get the hole stats\r\n float nfairwayholes = numberOfPar4Holes + numberOfPar5Holes;\r\n fairways = nfairwayholes<=0 ? 0 : statDAO.getNFairways(player) / nfairwayholes * 100.;\r\n if (numberOfHoles > 0) {\r\n girs = statDAO.getNGiR(player) / (float) numberOfHoles * 100.;\r\n chips = statDAO.getNumofChips(player) / (float) numberOfHoles;\r\n putts = statDAO.getNumofPutts(player) / (float) numberOfHoles;\r\n penalties = statDAO.getNumofPenalties(player) / (float) numberOfHoles * 18.;\r\n }\r\n\r\n // get the counts for par 3's\r\n if (numberOfPar3Holes > 0) {\r\n par3Girs = statDAO.getNGiR(3, player) / (float)numberOfPar3Holes * 100.;\r\n par3Chips = statDAO.getNumofChips(3, player) / (float) numberOfPar3Holes;\r\n par3Putts = statDAO.getNumofPutts(3, player) / (float) numberOfPar3Holes;\r\n par3Penalties = statDAO.getNumofPenalties(3, player) / (float) numberOfPar3Holes;\r\n }\r\n par3EagleCount = statDAO.getNHolesParScore(3, -2, player);\r\n par3BirdieCount = statDAO.getNHolesParScore(3, -1, player);\r\n par3ParCount = statDAO.getNHolesParScore(3, 0, player);\r\n par3BogeyCount = statDAO.getNHolesParScore(3, 1, player);\r\n par3DoubleBogeyCount = statDAO.getNHolesParScore(3, 2, player);\r\n par3TripleBogeyCount = statDAO.getNHolesParScore(3, 3, player);\r\n par3QuadBogeyPlusCount = statDAO.getNHolesParGreaterThanScore(3, 4, player);\r\n\r\n // get the counts for par 4's\r\n if (numberOfPar4Holes > 0) {\r\n par4Fairways = statDAO.getNFairways(4, player) / (float) numberOfPar4Holes * 100.;\r\n par4Girs = statDAO.getNGiR(4, player) / (float) numberOfPar4Holes * 100.;\r\n par4Chips = statDAO.getNumofChips(4, player) / (float) numberOfPar4Holes;\r\n par4Putts = statDAO.getNumofPutts(4, player) / (float) numberOfPar4Holes;\r\n par4Penalties = statDAO.getNumofPenalties(4, player) / (float) numberOfPar4Holes;\r\n }\r\n par4AlbatrossCount = statDAO.getNHolesParScore(4, -3, player);\r\n par4EagleCount = statDAO.getNHolesParScore(4, -2, player);\r\n par4BirdieCount = statDAO.getNHolesParScore(4, -1, player);\r\n par4ParCount = statDAO.getNHolesParScore(4, 0, player);\r\n par4BogeyCount = statDAO.getNHolesParScore(4, 1, player);\r\n par4DoubleBogeyCount = statDAO.getNHolesParScore(4, 2, player);\r\n par4TripleBogeyCount = statDAO.getNHolesParScore(4, 3, player);\r\n par4QuadBogeyPlusCount = statDAO.getNHolesParGreaterThanScore(4, 4, player);\r\n\r\n // get the counts for the par 5's\r\n if (numberOfPar5Holes > 0) {\r\n par5Fairways = statDAO.getNFairways(5, player) / (float) numberOfPar5Holes * 100.;\r\n par5Girs = statDAO.getNGiR(5, player) / (float) numberOfPar5Holes * 100.;\r\n par5Putts = statDAO.getNumofPutts(5, player) / (float) numberOfPar5Holes;\r\n par5Chips = statDAO.getNumofChips(5, player) / (float) numberOfPar5Holes;\r\n par5Penalties = statDAO.getNumofPenalties(5, player) / (float) numberOfPar5Holes;\r\n }\r\n par5AlbatrossCount = statDAO.getNHolesParScore(5, -3, player);\r\n par5EagleCount = statDAO.getNHolesParScore(5, -2, player);\r\n par5BirdieCount = statDAO.getNHolesParScore(5, -1, player);\r\n par5ParCount = statDAO.getNHolesParScore(5, 0, player);\r\n par5BogeyCount = statDAO.getNHolesParScore(5, 1, player);\r\n par5DoubleBogeyCount = statDAO.getNHolesParScore(5, 2, player);\r\n par5TripleBogeyCount = statDAO.getNHolesParScore(5, 3, player);\r\n par5QuadBogeyPlusCount = statDAO.getNHolesParGreaterThanScore(5, 4, player);\r\n\r\n // sum various scores\r\n albatrossCount = par4AlbatrossCount + par5AlbatrossCount;\r\n eagleCount = par3EagleCount + par4EagleCount + par5EagleCount;\r\n birdieCount = par3BirdieCount + par4BirdieCount + par5BirdieCount;\r\n parCount = par3ParCount + par4ParCount + par5ParCount;\r\n bogeyCount = par3BogeyCount + par4BogeyCount + par5BogeyCount;\r\n doubleBogeyCount = par3DoubleBogeyCount\r\n + par4DoubleBogeyCount\r\n + par5DoubleBogeyCount;\r\n tripleBogeyCount = par3TripleBogeyCount\r\n + par4TripleBogeyCount\r\n + par5TripleBogeyCount;\r\n quadBogeyPlusCount = par3QuadBogeyPlusCount\r\n + par4QuadBogeyPlusCount\r\n + par5QuadBogeyPlusCount;\r\n\r\n\r\n clubs = bagDAO.readClubsInBag(player);\r\n // Remove the putter\r\n int idx = 0;\r\n int pidx = -1;\r\n for (Club club : clubs) {\r\n if (club.getClub().equals(\"Putter\"))\r\n pidx = idx;\r\n idx++;\r\n }\r\n if (pidx >= 0)\r\n clubs.remove(pidx);\r\n // Fill the distances and accuracy\r\n for (Club club : clubs) {\r\n club.setAvgDist(statDAO.getClubAvgDist(player, club));\r\n club.setAccuracy(statDAO.getClubAccuracy(player, club, (float) 10));\r\n }\r\n\r\n\r\n // get the number of rounds played\r\n int courseCount = 0;\r\n\t\t//Calls the method that displays the stats on the screen\r\n\t\tfillInList(courseCount++);\r\n\t}", "void play() {\n\n ArrayList<Card> cardsInMiddle = new ArrayList<>();\n\n Card[] lastCardsPlayed = new Card[numOfPlayers];\n\n //simulation of each player flipping their next card\n for (int i = 0; i < players.length; i++) {\n lastCardsPlayed[i] = players[i].getNextCard();\n cardsInMiddle.add(lastCardsPlayed[i]);\n\n }\n\n //if there's a tie\n while (tieForCards(lastCardsPlayed)) {\n //check to see if players have enough cards to continue\n //if not, then clear that players hand and game will end\n WarPlayer lessThan3Cards = tryGetPlayerWithLessThanThreeCards();\n if (lessThan3Cards != null) {\n lessThan3Cards.getHand().clear();\n return;\n }\n\n //simulation of flipping 2 extra cards\n for (int i = 0; i < players.length; i++) {\n cardsInMiddle.add(players[i].getNextCard());\n cardsInMiddle.add(players[i].getNextCard());\n\n Card lastCard = players[i].getNextCard();\n cardsInMiddle.add(lastCard);\n lastCardsPlayed[i] = lastCard;\n }\n }\n setLastCardsPlayed(lastCardsPlayed);\n\n //determining who gets all the cards played for the round\n int highestCardIndex = largestCard(lastCardsPlayed);\n players[highestCardIndex].addCards(cardsInMiddle);\n players[highestCardIndex].addPoints(cardsInMiddle.size() / numOfPlayers);\n }", "@Test\n public void testKingPosition() {\n // initialize the complete chess board\n ChessBoard chessBoard = init(\"CHESS\");\n\n assertEquals(0, chessBoard.getPiece(0, 4).getRow());\n assertEquals(4, chessBoard.getPiece(0, 4).getColumn());\n\n assertEquals(7, chessBoard.getPiece(7, 4).getRow());\n assertEquals(4, chessBoard.getPiece(7, 4).getColumn());\n }", "public void Poneymove() {\n for (int i = 0; i < this.getNumberPoney(); i++) {\n Poney P = this.getPoney()[i];\n if (P.getTour_realise() != this.getNumberRounds()) {\n P.setX(P.getX() + P.getSpeed());\n P.whileJumping();\n collision(i);\n if (P.getX() > 520) {\n P.setX(-220.0);\n P.setSpeed(0.3+(double)(Math.random()*(1-0.3)+1));\n P.setSpeedDecreased(false);\n P.setTour_realise(P.getTour_realise() + 1);\n if (ObstacleStatique.class.isInstance(getObstacle()[i]))\n getObstacle()[i].setX(0);\n P.modeNianOff();\n setChanged();\n notifyObserver(false, i, getPoney()[i].getPoneyColor(), getPoney()[i].getX(), getPoney()[i].getY());\n }\n } else {\n if (!getRank().contains(P.getPoneyColor()))\n getRank().add(P.getPoneyColor());\n }\n setChanged();\n notifyObserver(i, getPoney()[i].getX(), getPoney()[i].getY());\n }\n }", "public void initialiseBoard() {\n\t\tPlayer1Mancala = new MancalaPit(this.player1Name, 0, null);\n\t\tPit player1_Pit6 = new Pit(this.player1Name, 6, 1, Player1Mancala);\n\t\tPit player1_Pit5 = new Pit(this.player1Name, 5, 1, player1_Pit6);\n\t\tPit player1_Pit4 = new Pit(this.player1Name, 4, 1, player1_Pit5);\n\t\tPit player1_Pit3 = new Pit(this.player1Name, 3, 1, player1_Pit4);\n\t\tPit player1_Pit2 = new Pit(this.player1Name, 2, 1, player1_Pit3);\n\t\tPit player1_Pit1 = new Pit(this.player1Name, 1, 1, player1_Pit2);\n\n\t\t// Define Player2 Pits in descending order \n\t\tPlayer2Mancala = new MancalaPit(this.player2Name, 0, null);\n\t\tPit player2_Pit6 = new Pit(this.player2Name, 6, 1, Player2Mancala);\n\t\tPit player2_Pit5 = new Pit(this.player2Name, 5, 1, player2_Pit6);\n\t\tPit player2_Pit4 = new Pit(this.player2Name, 4, 1, player2_Pit5);\n\t\tPit player2_Pit3 = new Pit(this.player2Name, 3, 1, player2_Pit4);\n\t\tPit player2_Pit2 = new Pit(this.player2Name, 2, 1, player2_Pit3);\n\t\tPit player2_Pit1 = new Pit(this.player2Name, 1, 1, player2_Pit2);\n\n\t\t// Complete the board by connecting mancala with player pits\n\t\tPlayer1Mancala.setNextPit(player2_Pit1);\n\t\tPlayer2Mancala.setNextPit(player1_Pit1);\n\n\t\t//Initialize the Player1 board \n\t\tthis.Player1Pits[0] = player1_Pit1;\n\t\tthis.Player1Pits[1] = player1_Pit2;\n\t\tthis.Player1Pits[2] = player1_Pit3;\n\t\tthis.Player1Pits[3] = player1_Pit4;\n\t\tthis.Player1Pits[4] = player1_Pit5;\n\t\tthis.Player1Pits[5] = player1_Pit6;\n\n\t\t// Initialize the Player2 board \n\t\tthis.Player2Pits[0] = player2_Pit1;\n\t\tthis.Player2Pits[1] = player2_Pit2;\n\t\tthis.Player2Pits[2] = player2_Pit3;\n\t\tthis.Player2Pits[3] = player2_Pit4;\n\t\tthis.Player2Pits[4] = player2_Pit5;\n\t\tthis.Player2Pits[5] = player2_Pit6;\n\t}", "public Position getPlayerPiecePosition(int playerNum) {\n return playerPiecePositions[playerNum];\n }", "@Override\n public void drawValidMove() {\n if(this.getPlayer().getPlayerID() % 2 != 0) {\n //Pawn can move one space forwards if no piece is in front\n if (board.getSquare(x-1, y).getPiece()== null) {\n board.getSquare(x-1, y).drawOutline();\n }\n \n //if first move, pawn can move 2 spaces forward\n if (!hasMoved && board.getSquare(x-2, y).getPiece() == null && board.getSquare(x-1, y).getPiece() == null) {\n board.getSquare(x-2, y).drawOutline();\n }\n \n //If there is an enemy piece in the diagonal forward square of the pawn, the pawn can move (capture the piece)\n if (y-1 > 0) { //ensures no arrayoutofbounds error\n if (board.getSquare(x-1, y-1) != null && board.getSquare(x-1, y-1).getPiece() != null &&\n board.getSquare(x-1, y-1).getPiece().getPlayer() != this.getPlayer()) {\n board.getSquare(x-1, y-1).drawOutline();\n }\n }\n \n if(y+1<SIZE) { //ensures no arrayoutofbounds error\n if (board.getSquare(x-1, y+1) != null && board.getSquare(x-1, y+1).getPiece() != null &&\n board.getSquare(x-1, y+1).getPiece().getPlayer() != this.getPlayer() ) {\n board.getSquare(x-1, y+1).drawOutline();\n }\n }\n \n System.out.println(\"\");\n //En passant\n if (y - 1 > 0) {\n \n System.out.println();\n if (board.getSquare(x, y-1).getPiece() != null) { \n System.out.println(\"the piece's enPassant is: \" + board.getSquare(x, y-1).getPiece().getEnPassant());\n System.out.println(\"The game's turn counter is: \" + board.getTurnCounter());\n }\n else {\n System.out.println(\"Null piece when checking for en passent.\");\n }\n \n if (board.getSquare(x, y-1).getPiece() != null && board.getSquare(x, y-1).getPiece().getPlayer() != this.player &&\n board.getSquare(x, y-1).getPiece().getEnPassant() == board.getTurnCounter() - 1) {\n board.getSquare(x-1, y-1).drawOutline();\n board.getSquare(x-1, y-1).setEnPassent(true);\n }\n }\n \n if (y + 1 < SIZE) {\n if (board.getSquare(x, y+1).getPiece() != null && board.getSquare(x, y+1).getPiece().getPlayer() != this.player &&\n board.getSquare(x, y+1).getPiece().getEnPassant() == board.getTurnCounter() - 1) {\n board.getSquare(x-1, y+1).drawOutline();\n board.getSquare(x-1, y+1).setEnPassent(true);\n }\n }\n }\n \n //If this pawn belongs to player 2:\n else {\n \n if (board.getSquare(x+1, y).getPiece() == null) {\n board.getSquare(x+1, y).drawOutline();\n }\n \n //if first move, pawn can move 2 spaces forward\n if (!hasMoved && board.getSquare(x+2, y).getPiece() == null && board.getSquare(x+1, y).getPiece() == null) {\n board.getSquare(x+2, y).drawOutline();\n \n }\n \n if(y-1 > 0) {\n if (board.getSquare(x+1, y-1) != null && board.getSquare(x+1, y-1).getPiece() != null &&\n board.getSquare(x+1, y-1).getPiece().getPlayer() != this.getPlayer() ) {\n board.getSquare(x+1, y-1).drawOutline();\n }\n }\n \n if(y+1 < SIZE) {\n if (board.getSquare(x+1, y+1) != null && board.getSquare(x+1, y+1).getPiece() != null &&\n board.getSquare(x+1, y+1).getPiece().getPlayer() != this.getPlayer()) {\n board.getSquare(x+1, y+1).drawOutline();\n }\n }\n \n //En passant\n if (y - 1 > 0) {\n if (board.getSquare(x, y-1).getPiece() != null &&board.getSquare(x, y-1).getPiece().getPlayer() != this.player &&\n board.getSquare(x, y-1).getPiece().getEnPassant() == board.getTurnCounter() - 1) {\n board.getSquare(x+1, y-1).drawOutline();\n board.getSquare(x+1, y-1).setEnPassent(true);\n }\n }\n \n if (y + 1 < SIZE) {\n if (board.getSquare(x, y+1).getPiece() != null && board.getSquare(x, y+1).getPiece().getPlayer() != this.player &&\n board.getSquare(x, y+1).getPiece().getEnPassant() == board.getTurnCounter() - 1) {\n board.getSquare(x+1, y+1).drawOutline();\n board.getSquare(x+1, y+1).setEnPassent(true);\n }\n }\n }\n }", "private void setInfoPlayers() {\n\n\t\t//PLAYER 1\n\t\tlblPlayer1name.setText(players.get(0).getName());\n\t\tlblCashP1.setText(\"\" + players.get(0).getMoney());\n\t\tlblBuildP1.setText(\"\" + players.get(0).getNumberBuildings());\n\t\tlblPropP1.setText(\"\" + players.get(0).getOwnproperties().size());\n\t\tlblPosP1.setText(\"\"+ players.get(0).getPosition());\n\n\t\t//PLAYER 2\n\t\tlblPlayer2name.setText(players.get(1).getName());\n\t\tlblCashP2.setText(\"\" + players.get(1).getMoney());\n\t\tlblBuildP2.setText(\"\" + players.get(1).getNumberBuildings());\n\t\tlblPropP2.setText(\"\" + players.get(1).getOwnproperties().size());\n\t\tlblPosP2.setText(\"\"+ players.get(1).getPosition());\n\t\t\n\t\tif(players.size() > 2){\n\t\t\t//PLAYER 3\n\t\t\tlblPlayerName3.setText(players.get(2).getName());\n\t\t\tlblCashP3.setText(\"\" + players.get(2).getMoney());\n\t\t\tlblBuildP3.setText(\"\" + players.get(2).getNumberBuildings());\n\t\t\tlblPropP3.setText(\"\" + players.get(2).getOwnproperties().size());\n\t\t\tlblPosP3.setText(\"\"+ players.get(2).getPosition());\n\n\t\t\tif(players.size() > 3){\n\t\t\t\t//PLAYER 4\n\t\t\t\tlblPlayerName4.setText(players.get(3).getName());\n\t\t\t\tlblCashP4.setText(\"\" + players.get(3).getMoney());\n\t\t\t\tlblBuildP4.setText(\"\" + players.get(3).getNumberBuildings());\n\t\t\t\tlblPropP4.setText(\"\" + players.get(3).getOwnproperties().size());\n\t\t\t\tlblPosP4.setText(\"\"+ players.get(3).getPosition());\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public void updateBoard() {\n for(SnakePart s : snakePartList) {\n board[s.getSnakePartRowsOld()][s.getSnakePartCollsOld()] = ' ';\n board[s.getSnakePartRowsNew()][s.getSnakePartCollsNew()] = 'S';\n }\n \n for (SnakeEnemyPart e : snakeEnemyPartList) {\n board[e.getSnakeEnemyPartRowsOld()][e.getSnakeEnemyPartCollsOld()] = ' ';\n board[e.getSnakeEnemyPartRowsNew()][e.getSnakeEnemyPartCollsNew()] = 'E';\n }\n }", "private void movePlayer() {\r\n\t\tshipImageView.setX(ship.getCurrentLocation().x * scalingFactor);\r\n\t\tshipImageView.setY(ship.getCurrentLocation().y * scalingFactor);\r\n\t\tship.notifyObservers();\r\n\t}", "public void setPlayersAtGo()\n {\n for(int i = 0; i < m_numPlayers; i++)\n {\n m_gameBoard.addPlayerToSpace(i + 1, 0);\n }\n }", "private void update()\n {\n // update the grid square panels\n Component[] components = pnlIsland.getComponents();\n for ( Component c : components )\n {\n // all components in the panel are GridSquarePanels,\n // so we can safely cast\n GridSquarePanel gsp = (GridSquarePanel) c;\n gsp.update();\n }\n \n // update player information\n int[] playerValues = game.getPlayerValues();\n txtPlayerName.setText(game.getPlayerName());\n progPlayerStamina.setMaximum(playerValues[Game.MAXSTAMINA_INDEX]);\n progPlayerStamina.setValue(playerValues[Game.STAMINA_INDEX]);\n progBackpackWeight.setMaximum(playerValues[Game.MAXWEIGHT_INDEX]);\n progBackpackWeight.setValue(playerValues[Game.WEIGHT_INDEX]);\n progBackpackSize.setMaximum(playerValues[Game.MAXSIZE_INDEX]);\n progBackpackSize.setValue(playerValues[Game.SIZE_INDEX]);\n \n //Update Kiwi and Predator information\n txtKiwisCounted.setText(Integer.toString(game.getKiwiCount()) );\n txtPredatorsLeft.setText(Integer.toString(game.getPredatorsRemaining()));\n \n // update inventory list\n listInventory.setListData(game.getPlayerInventory());\n listInventory.clearSelection();\n listInventory.setToolTipText(null);\n btnUse.setEnabled(false);\n btnDrop.setEnabled(false);\n \n // update list of visible objects\n listObjects.setListData(game.getOccupantsPlayerPosition());\n listObjects.clearSelection();\n listObjects.setToolTipText(null);\n btnCollect.setEnabled(false);\n btnCount.setEnabled(false);\n \n // update movement buttons\n btnMoveNorth.setEnabled(game.isPlayerMovePossible(MoveDirection.NORTH));\n btnMoveEast.setEnabled( game.isPlayerMovePossible(MoveDirection.EAST));\n btnMoveSouth.setEnabled(game.isPlayerMovePossible(MoveDirection.SOUTH));\n btnMoveWest.setEnabled( game.isPlayerMovePossible(MoveDirection.WEST));\n }", "@Test\n public void testGetPawnPositionsAround() {\n assertNotNull(this.board.getPawnPositionsAround(Pawn.ZEN));\n assertNotNull(this.board.getPawnPositionsAround(Pawn.RED));\n assertNotNull(this.board.getPawnPositionsAround(Pawn.RED));\n }", "public void startGame() {\n\n // Initialize both players\n players[0] = new Player(\"Paras\", true);\n players[1] = new Player(\"Computer\", false);\n\n // Initialize ChessBoard\n board = new ChessBoard(8);\n movesPlayed = new ArrayList<>();\n\n // Keep playing game until GameStatus is BLACK_WIN or WHITE_WIN\n while (true) {\n\n processTurn(players[0]);\n if (this.status == GameStatus.WHITE_WIN) {\n System.out.println(\"P1 win!\");\n break;\n }\n\n processTurn(players[1]);\n if (this.status == GameStatus.BLACK_WIN) {\n System.out.println(\"P2 win!\");\n break;\n }\n }\n\n }", "private void updateBigGameBoardForNextMove(){\n changeLetterAndVisuals();\n /*\n This next step is essential to the game:\n The player just chose a position on a smallGameBoard; this position is where he will\n be able to choose on the big board. For example, if player 1 puts an x in the top-left\n corner of a small game, then player 2 should play in the top-left small game (provided\n it is not already won).\n */\n nextGamePosition = chosenButton.getButtonPosition();\n nextGame = getGame(nextGamePosition);\n //If the next game is already won, then the next player can choose anywhere\n if (checkGameWin(nextGame.getLettersOfAllButtons())){\n for (ButtonClass b : allButtons) {\n b.setAvailable(true);\n }\n for(SmallGameBoard game: games){\n if (game.getGameBoardColor() == R.color.blackTransparent){\n game.changeGameColor(R.color.black);\n }\n }\n } else {\n //If next game is not won, then the player must play on the next game board\n setAvailableButtons(nextGamePosition);\n //Sets all boards besides the next game board to half transparent\n for (SmallGameBoard game: games){\n if(game.getGameBoardColor() == R.color.black){\n game.changeGameColor(R.color.blackTransparent);\n }\n }\n nextGame.changeGameColor(R.color.black);\n }\n //For playerVsComputer, this is when the computer makes its move\n if (!activity.getPlayerVsPlayer() && !computerIsMoving){\n computerMove(activity.getDifficulty());\n computerIsMoving = false;\n }\n }", "public void newGame() {\n \tturn = PieceColor.White;\n \t\n \t//the middle are empty squares\n \tfor(int i = 2; i < 6; i++) {\n \t\tfor(int j = 0; j < 8; j++) {\n \t\t\tsetPiece(j, i, new NoPiece(j, i));\n \t\t}\n \t}\n \t\n \t//pawns\n \tfor(int i = 0; i < 8; i++) {\n \t\t//make these pawns\n \t\tsetPiece(i, 1, new Pawn(i, 1, PieceColor.White, this));\n \t\tsetPiece(i, 6, new Pawn(i, 6, PieceColor.Black, this));\n \t}\n \t\n \t//white back row\n \tsetPiece(0, 0, new Rook(0, 0, PieceColor.White, this));\n \tsetPiece(1, 0, new Knight(1, 0, PieceColor.White, this));\n \tsetPiece(2, 0, new Bishop(2, 0, PieceColor.White, this));\n \tsetPiece(3, 0, new Queen(3, 0, PieceColor.White, this));\n \tsetPiece(4, 0, new King(4, 0, PieceColor.White, this));\n \tsetPiece(5, 0, new Bishop(5, 0, PieceColor.White, this));\n \tsetPiece(6, 0, new Knight(6, 0, PieceColor.White, this));\n \tsetPiece(7, 0, new Rook(7, 0, PieceColor.White, this));\n \t\n \t//black back row\n \tsetPiece(0, 7, new Rook(0, 7, PieceColor.Black, this));\n \tsetPiece(1, 7, new Knight(1, 7, PieceColor.Black, this));\n \tsetPiece(2, 7, new Bishop(2, 7, PieceColor.Black, this));\n \tsetPiece(3, 7, new Queen(3, 7, PieceColor.Black, this));\n \tsetPiece(4, 7, new King(4, 7, PieceColor.Black, this));\n \tsetPiece(5, 7, new Bishop(5, 7, PieceColor.Black, this));\n \tsetPiece(6, 7, new Knight(6, 7, PieceColor.Black, this));\n \tsetPiece(7, 7, new Rook(7, 7, PieceColor.Black, this));\n \t\n \t//store locations of king so they can be checked\n \twKing = new Square(4, 0);\n \tbKing = new Square(4, 7);\n }", "public void setValidMoves(Board board, int x, int y, int playerType) {\n\t\tmoves.clear();\n\t\t// if this is pawn's first move, it can move two squares forward\n\t\tif (firstMove == true)\n\t\t{\n\t\t\t// white moves forward with y++\n\t\t\tif(this.getPlayer() == 1)\n\t\t\t{\n\t\t\t\tPoint firstMove = new Point(x + 0, y + 2);\n\t\t\t\tif (board.getPiece(x, y + 1) == null && board.getPiece(x, y + 2) == null)\n\t\t\t\t{\n\t\t\t\t\t\tmoves.add(firstMove);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// black moves forward with y--\n\t\t\telse\n\t\t\t{\n\t\t\t\tPoint firstMove = new Point(x + 0, y - 2);\n\t\t\t\tif (board.getPiece(x, y - 1) == null && board.getPiece(x, y - 2) == null)\n\t\t\t\t{\n\t\t\t\t\t\tmoves.add(firstMove);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif (this.getPlayer() == 1)\n\t\t{\n\t\t\t// if a piece is occupying a square diagonal from pawn, it can capture\n\t\t\tif (x + 1 < 8 && y + 1 < 8 && x + 1 >= 0 && y + 1 >= 0)\n\t\t\t{\n\t\t\t\tPoint move = new Point(x + 1, y + 1);\n\t\t\t\tif (board.getPiece(x + 1, y + 1) != null)\n\t\t\t\t{\n\t\t\t\t\tif (board.getPiece(x+1,y+1).getPlayer() != this.getPlayer())\n\t\t\t\t\t{\n\t\t\t\t\t\tmoves.add(move);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (x - 1 < 8 && y + 1 < 8 && x - 1 >= 0 && y + 1 >= 0)\n\t\t\t{\n\t\t\t\tPoint move = new Point(x - 1, y + 1);\n\t\t\t\tif (board.getPiece(x - 1, y + 1) != null)\n\t\t\t\t{\n\t\t\t\t\tif (board.getPiece(x - 1, y + 1).getPlayer() != this.getPlayer())\n\t\t\t\t\t{\n\t\t\t\t\t\tmoves.add(move);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t// if no piece is in front of pawn, it can move forward one square\n\t\t\tif (x < 8 && y + 1 < 8 && x >= 0 && y + 1 >=0)\n\t\t\t{\n\t\t\t\tPoint move = new Point(x + 0, y + 1);\n\t\t\t\tif (board.getPiece(x, y + 1) == null)\n\t\t\t\t{\n\t\t\t\t\t\tmoves.add(move);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// if a piece is occupying a square diagonal from pawn, it can capture\n\t\t\tif (x + 1 < 8 && y - 1 < 8 && x + 1 >= 0 && y - 1 >= 0)\n\t\t\t{\n\t\t\t\tPoint move = new Point(x + 1, y - 1);\n\t\t\t\tif (board.getPiece(x + 1, y - 1) != null)\n\t\t\t\t{\n\t\t\t\t\tif (board.getPiece(x + 1,y - 1).getPlayer() != this.getPlayer())\n\t\t\t\t\t{\n\t\t\t\t\t\tmoves.add(move);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (x - 1 < 8 && y - 1 < 8 && x - 1 >= 0 && y - 1 >= 0)\n\t\t\t{\n\t\t\t\tPoint move = new Point(x - 1, y - 1);\n\t\t\t\tif (board.getPiece(x - 1, y - 1) != null)\n\t\t\t\t{\n\t\t\t\t\tif (board.getPiece(x - 1, y - 1).getPlayer() != this.getPlayer())\n\t\t\t\t\t{\n\t\t\t\t\t\tmoves.add(move);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t// if no piece is in front of pawn, it can move forward one square\n\t\t\tif (x < 8 && y - 1 < 8 && x >= 0 && y - 1 >=0)\n\t\t\t{\n\t\t\t\tPoint move = new Point(x + 0, y - 1);\n\t\t\t\tif (board.getPiece(x, y - 1) == null)\n\t\t\t\t{\n\t\t\t\t\t\tmoves.add(move);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "@Test\n public void testAroundPlayerPositions() {\n IntStream.iterate(0, i -> i + 1).limit(LevelImpl.LEVEL_MAX).forEach(k -> {\n terrain = terrainFactory.create(level.getBlocksNumber());\n final List<Position> safePosition = new ArrayList<>();\n safePosition.add(TerrainFactoryImpl.PLAYER_POSITION);\n safePosition.add(new Position(TerrainFactoryImpl.PLAYER_POSITION.getX() + TerrainFactoryImpl.CELL_DIMENSION * ScreenToolUtils.SCALE,\n TerrainFactoryImpl.PLAYER_POSITION.getY()));\n safePosition.add(new Position(TerrainFactoryImpl.PLAYER_POSITION.getX(), \n TerrainFactoryImpl.PLAYER_POSITION.getY() + TerrainFactoryImpl.CELL_DIMENSION * ScreenToolUtils.SCALE));\n /*use assertFalse because they have already been removed*/\n assertFalse(terrain.getFreeTiles().stream().map(i -> i.getPosition()).collect(Collectors.toList()).containsAll(safePosition));\n level.levelUp();\n });\n }", "public void playOn(int x, int y)\r\n\t{\r\n\t\t//Converts x positions to array indices.\r\n\t\tx--;\r\n\t\ty--;\r\n\t\t//The x and y inputs need to be within the board boundaries.\r\n\t\tif(x>=0 && x<grid.length && y>=0 && y<grid.length)\r\n\t\t{\r\n\t\t\t//The UI grid will be updated.\r\n\t\t\t/*This method will have to be resolved.\r\n\t\t\tif(ships.hitsShipOn(x, y))\r\n\t\t\t\t\tgrid[x][y] = 1;\r\n\t\t\telse\r\n\t\t\t\t\tgrid[x][y] = -1;*/\r\n\t\t}\r\n\t\t\t\r\n\t}", "public void setPiece(int x, int y, int player) throws GameException {\n if (!squareInBounds(x, y)) {\n throw new GameException(\"Square is off the board\");\n }\n int arrayPos = getArrayPos(x, y);\n if (!isSquareFree(arrayPos)) {\n throw new GameException(\"Location is already taken\");\n }\n ;\n setSurrounding(x, y);\n intArray[arrayPos] = player;\n }", "public static void playerpoints(String board[][]){\n\t\tint player1pointcount=0, player2pointcount=0;\n\t\tfor(int x=1;x<=boardwidth;x++){\n\t\t\tfor(int i=1;i<=boardlength;i++){\n\t\t\t\tif(board[x][i]==\"x\"){\n\t\t\t\t\tplayer1pointcount++;\n\t\t\t\t}\n\t\t\t\tif(board[x][i]==\"o\"){\n\t\t\t\t\tplayer2pointcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tplayer1score=player1pointcount;\n\t\tplayer2score=player2pointcount;\n\t}", "private void putOnBoard(int row, int col, boolean direction,String topWord, ArrayList<Piece> piecesOfTopWord,Board board){\n \t\t\n \t\tif (direction){\n \t\t\tfor (int i = 0; i < piecesOfTopWord.size(); i++) {\n \t\t\t\tif (piecesOfTopWord.get(i).isPinned()){\n \t\t\t\t\tpiecesOfTopWord.remove(piecesOfTopWord.get(i));\n \t\t\t\t\ti--;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tint index = 0;\n \t\t\tfor (int i = 0; index <piecesOfTopWord.size(); i++) {\n \t\t\t\t\n \t\t\t\tif (board.getPiece(row, col+i)==null){\n \t\t\t\t\t\n \t\t\t\t\tPiece toPlace = null;\n \t\t\t\t\tfor (int r = 0; r < playersPieces.size(); r++) {\n \t\t\t\t\t\tSystem.out.println(piecesOfTopWord.get(index).theLetter());\n \t\t\t\t\t\tif (playersPieces.get(r) != null && playersPieces.get(r).theLetter() == piecesOfTopWord.get(index).theLetter()){\n \t\t\t\t\t\t\ttoPlace = playersPieces.get(r);\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t\n \t\t\t\t\tboard.insertPiece(toPlace, row, col + i);\n \t\t\t\t\ttoPlace.x = (col+i)*42 + 64;\n \t\t\t\t\ttoPlace.y = (row)*42 + 64;\n \t\t\t\t\tthis.removeAI(toPlace);\n \t\t\t\t\tindex++;\n \t\t\t\t}\n \t\t\t}\n \t\t}else{\n \t\t\tfor (int i = 0; i < piecesOfTopWord.size(); i++) {\n \t\t\t\tif (piecesOfTopWord.get(i).isPinned()){\n \t\t\t\t\tpiecesOfTopWord.remove(piecesOfTopWord.get(i));\n \t\t\t\t\ti--;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tint index = 0;\n \t\t\tfor (int i = 0; index <piecesOfTopWord.size(); i++) {\n \t\t\t\tif (board.getPiece(row+i, col)==null){\n \t\t\t\t\t\n \t\t\t\t\tPiece toPlace = null;\n \t\t\t\t\tfor (int r = 0; r < playersPieces.size(); r++) {\n \t\t\t\t\t\tSystem.out.println(piecesOfTopWord.get(index).theLetter());\n \t\t\t\t\t\tif (playersPieces.get(r) != null && playersPieces.get(r).theLetter() == piecesOfTopWord.get(index).theLetter()){\n \t\t\t\t\t\t\ttoPlace = playersPieces.get(r);\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t\n \t\t\t\t\tboard.insertPiece(toPlace, row+i, col);\n \t\t\t\t\ttoPlace.y = (row+i)*42 + 64;\n \t\t\t\t\ttoPlace.x = (col)*42 + 64;\n \t\t\t\t\tthis.removeAI(toPlace);\n \t\t\t\t\tindex++;\n \t\t\t\t}\n \t\t\t\t\t\n \t\t\t}\n \t\t}\n \t}", "Piece(int row, int col, int player) {\n this(row, col);\n if (player == 0 || player == 1)\n this.player = player;\n }", "private void displayBoard() {\r\n\r\n for (int r = 0; r < 8; r++) {\r\n for (int c = 0; c < 8; c++) {\r\n if (model.pieceAt(r, c) == null)\r\n board[r][c].setIcon(null);\r\n else if (model.pieceAt(r, c).player() == Player.WHITE) {\r\n if (model.pieceAt(r, c).type().equals(\"Pawn\"))\r\n board[r][c].setIcon(wPawn);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Rook\"))\r\n board[r][c].setIcon(wRook);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Knight\"))\r\n board[r][c].setIcon(wKnight);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Bishop\"))\r\n board[r][c].setIcon(wBishop);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Queen\"))\r\n board[r][c].setIcon(wQueen);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"King\"))\r\n board[r][c].setIcon(wKing);\r\n } else if (model.pieceAt(r, c).player() == Player.BLACK) {\r\n if (model.pieceAt(r, c).type().equals(\"Pawn\"))\r\n board[r][c].setIcon(bPawn);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Rook\"))\r\n board[r][c].setIcon(bRook);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Knight\"))\r\n board[r][c].setIcon(bKnight);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Bishop\"))\r\n board[r][c].setIcon(bBishop);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Queen\"))\r\n board[r][c].setIcon(bQueen);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"King\"))\r\n board[r][c].setIcon(bKing);\r\n }\r\n repaint();\r\n }\r\n }\r\n if (model.inCheck(Player.WHITE))\r\n JOptionPane.showMessageDialog(null, \"White King in Check\");\r\n if (model.inCheck(Player.BLACK))\r\n JOptionPane.showMessageDialog(null, \"Black King in Check\");\r\n if (model.movingIntoCheck())\r\n JOptionPane.showMessageDialog(null, \"Cannot move into check\");\r\n if (model.isComplete())\r\n JOptionPane.showMessageDialog(null, \"Checkmate\");\r\n }", "private void makeAIMove(){\n final GamePiece opponentPiece = mGame.getmCurrentlyPlaying();\n\n // Creating new thread for A.I. move calculation, just in case the calculation would be too long.\n // (So the A.I. move calculation won't freeze the screen).\n new Thread(new Runnable() {\n\n @Override\n public void run() {\n\n // Making the play:\n mGame.makeAIMove(mDifficulty);\n\n // Now back to UI thread:\n runOnUiThread(new Runnable() {\n\n @Override\n public void run() {\n\n // Updating the grid:\n ((TileAdapter)mGrid.getAdapter()).notifyDataSetChanged();\n\n // Playing proper sound:\n if(mSoundStatus.equals(Constants.ON)) mPutPieceSound.start();\n\n // Updating Counters:\n mBlackCounter.setText(\"\" + mGame.getmBoard().getmNumberOfBlackPieces());\n mWhiteCounter.setText(\"\" + mGame.getmBoard().getmNumberOfWhitePieces());\n\n // Update playableTiles:\n mPlayableTiles = mGame.getmBoard().getPlayableTiles(mPlayerGamePiece);\n\n // While the UI changes, make a proper sound for flipping pieces (after a short delay):\n // And then move on (update UI, let player play next, end game, etc.)\n new Thread(new Runnable() {\n\n @Override\n public void run() {\n\n try {\n Thread.sleep(200);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n if(mSoundStatus.equals(Constants.ON)) mFlipPieceSound.start(); // Playing proper sound.\n\n try {\n Thread.sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n // Now back to UI thread in order to update UI:\n runOnUiThread(new Runnable() {\n\n @Override\n public void run() {\n\n // If game is still ongoing:\n if(mGame.getmGameStatus() == Game.GameStatus.ONGOING){\n\n // If turn was toggled:\n if(mGame.getmCurrentlyPlaying() != opponentPiece) {\n\n // Updating colors for profile areas:\n mPlayerProfileArea.setBackgroundResource(R.drawable.user_area_green);\n mPlayerUsername.setBackgroundResource(R.color.colorGreenDarkAlpha);\n mOpponentProfileArea.setBackgroundResource(R.drawable.user_area_gray);\n mOpponentUsername.setBackgroundResource(R.color.colorGrayDarkAlpha);\n\n // Now Player should make a move:\n showGuidelines();\n mIsAllowedToPlay = true;\n\n }\n\n // Otherwise, opponent gets another turn:\n else{\n makeAIMove();\n }\n\n }\n\n else{ // Otherwise (game has ended)\n handleGameEnding();\n }\n\n }\n });\n\n\n }\n\n }).start();\n\n\n }\n });\n\n\n }\n }).start();\n\n }", "@Test\n public void testGetPossibleMoveCoordinate() throws Exception{\n ChessBoard board = new ChessBoard(8, 8);\n Piece p;\n\n p = new Pawn(board, Player.WHITE);\n p.setCoordinate(0, 0);\n assertEquals(2, p.getPossibleMoveCoordinate().size()); // first time move, therefore it should be able to advance two squares.\n\n\n p.setCoordinate(0, 1);\n assertEquals(1, p.getPossibleMoveCoordinate().size()); // already moved, therefore it could move two squares.\n\n\n /*\n * create a pawn in same group\n * put it ahead p, then p couldn't move\n */\n Piece friend = new Pawn(board, Player.WHITE);\n friend.setCoordinate(0, 2);\n assertEquals(0, p.getPossibleMoveCoordinate().size());\n\n /*\n * create an opponent piece at top right\n * therefore, p can move top right\n */\n Piece opponent_piece = new Pawn(board, Player.BLACK);\n opponent_piece.setCoordinate(1, 2);\n assertEquals(1, p.getPossibleMoveCoordinate().size());\n\n /*\n * p reaches top boundary\n */\n p.setCoordinate(0, 7);\n assertEquals(0, p.getPossibleMoveCoordinate().size());\n }" ]
[ "0.70111114", "0.69476277", "0.68275523", "0.68051", "0.6798026", "0.6779781", "0.6776115", "0.6735578", "0.6690413", "0.6634313", "0.66174495", "0.64508027", "0.6432882", "0.64152485", "0.641355", "0.63953507", "0.6360094", "0.6329799", "0.632398", "0.63189244", "0.6317708", "0.62981987", "0.6294461", "0.6293493", "0.6287876", "0.62828195", "0.62746423", "0.6271168", "0.62681353", "0.6263849", "0.62444496", "0.62442535", "0.62290955", "0.62114716", "0.6205673", "0.62012994", "0.61830586", "0.6176553", "0.61733305", "0.6170485", "0.61636394", "0.6159338", "0.6159106", "0.6154859", "0.6136162", "0.61335903", "0.61170435", "0.6100032", "0.6088013", "0.6086976", "0.60869366", "0.60792", "0.6073792", "0.6051014", "0.6045834", "0.6042339", "0.60381323", "0.6037508", "0.6031504", "0.6025587", "0.60217726", "0.60096216", "0.6006567", "0.5998238", "0.5985732", "0.5985069", "0.598097", "0.5977758", "0.5968177", "0.59612536", "0.59599966", "0.59518766", "0.59422547", "0.5940523", "0.5939436", "0.5928299", "0.59263116", "0.5925644", "0.59251285", "0.5920563", "0.59120834", "0.59035534", "0.5903024", "0.59003955", "0.5898946", "0.5888431", "0.5886097", "0.5884404", "0.5878077", "0.5877387", "0.5873804", "0.5872411", "0.5860274", "0.5854782", "0.5842732", "0.5841627", "0.58387166", "0.5833569", "0.5831115", "0.58297837", "0.58260494" ]
0.0
-1
Updates the board and the turn
public void update(int[][] board, int t) { this.board = board; turn = t; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void updateBoard() {\n notifyBoardUpdate(board);\n }", "boolean updateBoard(String currentPlayerTurn, String newBoard);", "public void update() {\n System.out.println(\"\\n\\n Board: \\n\");\n System.out.println(\" \" + pos1 + \" | \" + pos2 + \" | \" + pos3 + \" \");\n System.out.println(\" ---+---+--- \");\n System.out.println(\" \" + pos4 + \" | \" + pos5 + \" | \" + pos6 + \" \");\n System.out.println(\" ---+---+--- \");\n System.out.println(\" \" + pos7 + \" | \" + pos8 + \" | \" + pos9 + \" \");\n }", "public void updateBoard() {\n for(SnakePart s : snakePartList) {\n board[s.getSnakePartRowsOld()][s.getSnakePartCollsOld()] = ' ';\n board[s.getSnakePartRowsNew()][s.getSnakePartCollsNew()] = 'S';\n }\n \n for (SnakeEnemyPart e : snakeEnemyPartList) {\n board[e.getSnakeEnemyPartRowsOld()][e.getSnakeEnemyPartCollsOld()] = ' ';\n board[e.getSnakeEnemyPartRowsNew()][e.getSnakeEnemyPartCollsNew()] = 'E';\n }\n }", "private void updateBoard(int column, int turn) {\n rowHeight = cfBoard.rowHeight(column);\n int color = cfBoard.getColor(rowHeight-1, column-1);\n switch(column) {\n case 1:\n if(rowHeight == 1) {\n switch(color) {\n case 1:\n r1c1.setBackground(Color.BLACK);\n break;\n case 2:\n r1c1.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 2) {\n switch(color) {\n case 1:\n r2c1.setBackground(Color.BLACK);\n break;\n case 2:\n r2c1.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 3) {\n switch(color) {\n case 1:\n r3c1.setBackground(Color.BLACK);\n break;\n case 2:\n r3c1.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 4) {\n switch(color) {\n case 1:\n r4c1.setBackground(Color.BLACK);\n break;\n case 2:\n r4c1.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 5) {\n switch(color) {\n case 1:\n r5c1.setBackground(Color.BLACK);\n break;\n case 2:\n r5c1.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 6) {\n switch(color) {\n case 1:\n r6c1.setBackground(Color.BLACK);\n break;\n case 2:\n r6c1.setBackground(Color.RED);\n break;\n }\n }\n break;\n case 2:\n if(rowHeight == 1) {\n switch(color) {\n case 1:\n r1c2.setBackground(Color.BLACK);\n break;\n case 2:\n r1c2.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 2) {\n switch(color) {\n case 1:\n r2c2.setBackground(Color.BLACK);\n break;\n case 2:\n r2c2.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 3) {\n switch(color) {\n case 1:\n r3c2.setBackground(Color.BLACK);\n break;\n case 2:\n r3c2.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 4) {\n switch(color) {\n case 1:\n r4c2.setBackground(Color.BLACK);\n break;\n case 2:\n r4c2.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 5) {\n switch(color) {\n case 1:\n r5c2.setBackground(Color.BLACK);\n break;\n case 2:\n r5c2.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 6) {\n switch(color) {\n case 1:\n r6c2.setBackground(Color.BLACK);\n break;\n case 2:\n r6c2.setBackground(Color.RED);\n break;\n }\n }\n break;\n case 3:\n if(rowHeight == 1) {\n switch(color) {\n case 1:\n r1c3.setBackground(Color.BLACK);\n break;\n case 2:\n r1c3.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 2) {\n switch(color) {\n case 1:\n r2c3.setBackground(Color.BLACK);\n break;\n case 2:\n r2c3.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 3) {\n switch(color) {\n case 1:\n r3c3.setBackground(Color.BLACK);\n break;\n case 2:\n r3c3.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 4) {\n switch(color) {\n case 1:\n r4c3.setBackground(Color.BLACK);\n break;\n case 2:\n r4c3.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 5) {\n switch(color) {\n case 1:\n r5c3.setBackground(Color.BLACK);\n break;\n case 2:\n r5c3.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 6) {\n switch(color) {\n case 1:\n r6c3.setBackground(Color.BLACK);\n break;\n case 2:\n r6c3.setBackground(Color.RED);\n break;\n }\n }\n break;\n case 4:\n if(rowHeight == 1) {\n switch(color) {\n case 1:\n r1c4.setBackground(Color.BLACK);\n break;\n case 2:\n r1c4.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 2) {\n switch(color) {\n case 1:\n r2c4.setBackground(Color.BLACK);\n break;\n case 2:\n r2c4.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 3) {\n switch(color) {\n case 1:\n r3c4.setBackground(Color.BLACK);\n break;\n case 2:\n r3c4.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 4) {\n switch(color) {\n case 1:\n r4c4.setBackground(Color.BLACK);\n break;\n case 2:\n r4c4.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 5) {\n switch(color) {\n case 1:\n r5c4.setBackground(Color.BLACK);\n break;\n case 2:\n r5c4.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 6) {\n switch(color) {\n case 1:\n r6c4.setBackground(Color.BLACK);\n break;\n case 2:\n r6c4.setBackground(Color.RED);\n break;\n }\n }\n break;\n case 5:\n if(rowHeight == 1) {\n switch(color) {\n case 1:\n r1c5.setBackground(Color.BLACK);\n break;\n case 2:\n r1c5.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 2) {\n switch(color) {\n case 1:\n r2c5.setBackground(Color.BLACK);\n break;\n case 2:\n r2c5.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 3) {\n switch(color) {\n case 1:\n r3c5.setBackground(Color.BLACK);\n break;\n case 2:\n r3c5.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 4) {\n switch(color) {\n case 1:\n r4c5.setBackground(Color.BLACK);\n break;\n case 2:\n r4c5.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 5) {\n switch(color) {\n case 1:\n r5c5.setBackground(Color.BLACK);\n break;\n case 2:\n r5c5.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 6) {\n switch(color) {\n case 1:\n r6c5.setBackground(Color.BLACK);\n break;\n case 2:\n r6c5.setBackground(Color.RED);\n break;\n }\n }\n break;\n case 6:\n if(rowHeight == 1) {\n switch(color) {\n case 1:\n r1c6.setBackground(Color.BLACK);\n break;\n case 2:\n r1c6.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 2) {\n switch(color) {\n case 1:\n r2c6.setBackground(Color.BLACK);\n break;\n case 2:\n r2c6.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 3) {\n switch(color) {\n case 1:\n r3c6.setBackground(Color.BLACK);\n break;\n case 2:\n r3c6.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 4) {\n switch(color) {\n case 1:\n r4c6.setBackground(Color.BLACK);\n break;\n case 2:\n r4c6.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 5) {\n switch(color) {\n case 1:\n r5c6.setBackground(Color.BLACK);\n break;\n case 2:\n r5c6.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 6) {\n switch(color) {\n case 1:\n r6c6.setBackground(Color.BLACK);\n break;\n case 2:\n r6c6.setBackground(Color.RED);\n break;\n }\n }\n break;\n case 7:\n if(rowHeight == 1) {\n switch(color) {\n case 1:\n r1c7.setBackground(Color.BLACK);\n break;\n case 2:\n r1c7.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 2) {\n switch(color) {\n case 1:\n r2c7.setBackground(Color.BLACK);\n break;\n case 2:\n r2c7.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 3) {\n switch(color) {\n case 1:\n r3c7.setBackground(Color.BLACK);\n break;\n case 2:\n r3c7.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 4) {\n switch(color) {\n case 1:\n r4c7.setBackground(Color.BLACK);\n break;\n case 2:\n r4c7.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 5) {\n switch(color) {\n case 1:\n r5c7.setBackground(Color.BLACK);\n break;\n case 2:\n r5c7.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 6) {\n switch(color) {\n case 1:\n r6c7.setBackground(Color.BLACK);\n break;\n case 2:\n r6c7.setBackground(Color.RED);\n break;\n }\n }\n break;\n }\n \n if (turn%2 ==1) {\n turnButton.setBackground(Color.RED);\n jTextField1.setText(\"It's Red's turn.\");\n }\n if (turn%2 ==0) {\n turnButton.setBackground(Color.BLACK);\n jTextField1.setText(\"It's Black's turn.\");\n }\n \n }", "@Override\n\tpublic int updateBoard(int num) {\n\t\treturn 0;\n\t}", "private void board() {\r\n\t\tfor (int n = 0; n < ROW; n++) {\r\n\t\t\tfor (int m = 0; m < COL; m++) {\r\n\t\t\t\tboard[n][m] = 'X';\r\n\t\t\t}\r\n\t\t}\r\n\t\tturnRemaining = 42;\r\n\t}", "public void updateBoard(int[][] board, int piece){\r\n this.board=board;\r\n this.piece=piece;\r\n columns = board.length;\r\n rows = board[0].length;\r\n save = Math.min((size / columns), (size / rows));\r\n this.repaint();\r\n repaint();\r\n }", "@Override\n public void update(Move move) {\n System.out.println(\"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\");\n if (move == null) {\n printBoard();\n System.out.println(\"Opponent Passed\");\n return;\n }\n System.out.println(\"Your turn: \"+player);\n board.update(move, enemy.player);\n printBoard();\n\n }", "void updateDevBoard(LightDevelopmentBoard board);", "@Override\r\n\tpublic int updateBoard(Board board) {\n\t\treturn session.update(namespace+\"updateBoard\",board);\r\n\t}", "public void updateGame(int rowSelected, int colSelected)\n {\n System.out.println(\"Function: GameMain, updateGame()\");\n game.setBoard(game.updateBoard(rowSelected, colSelected, game.getBoard()));\n game.setCurrentState(game.returnGameState(game.getBoard()));\n\n gameGui.update(game.getBoard(), game.getCurrentState());\n\n if (game.getCurrentState() == GameState.WON)\n {\n cleanBoard();\n }\n }", "public void updateFields(MessageUpdate msg) {\n System.out.println(\"Updating board.\");\n\n if (msg.getOrigin().i != msg.getDestination().i || msg.getOrigin().j != msg.getDestination().j) {\n Color color = gameService.getPieceColor(msg.getOrigin().i, msg.getOrigin().j);\n\n gameService.setPieceColor(msg.getDestination().i, msg.getDestination().j, color);\n gameService.setPieceColor(msg.getOrigin().i, msg.getOrigin().j, null);\n\n gameService.repaintPanel();\n System.out.println(\"Board repainted.\");\n }\n\n checkIfMyTurn(msg.isCurrPlayer());\n }", "public void refreshBoard() {\n\t\tif (_board.checkGameWon()) {\n\t\t\t_blinkList = new ArrayList<TokenGUI>();\n\t\t}\n\t\tfor (SingleColumnGUI e : _allColumnsGUI) {\n\t\t\te.refresh();\n\t\t}\n\t\tif (_board.checkGameWon()) {\n\t\t\tstartBlink();\n\t\t}\n\t\telse if (_timer != null && _timer.isRunning()) {\n\t\t\t_timer.stop();\n\t\t}\n\t\t_mainGameGUI.updateStatus();\n\t}", "public void update(){\r\n\t\tupdateTurnLabel();\r\n\t\tupdateCanvas();\r\n\t}", "public void updatePossibleMovesKnights(){}", "public void updateScoreBoard() {\n Player player1 = playerManager.getPlayer(1);\n Player player2 = playerManager.getPlayer(2);\n MainActivity mainActivity = (MainActivity) this.getContext();\n\n mainActivity.updateScoreBoard(player1, player2);\n }", "public void updateBoard() {\r\n\t\tfor(int i = 0, k = 0; i < board.getWidth(); i+=3) {\r\n\t\t\tfor(int j = 0; j < board.getHeight(); j+=3) {\r\n\t\t\t\t//Check that there are pieces to display\r\n\t\t\t\tif(k < bag.size()) {\r\n\t\t\t\t\tboard.setTile(bag.get(k), i, j);\r\n\t\t\t\t\tk++;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tboard.fillSpace(GridSquare.Type.EMPTY, i, j);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void changeBoard(Board board){\n this.board = board;\n }", "public void updateMoves(){\r\n\t\tthis.moves = getMoves() + 1;\r\n\t}", "public void updateBoard(Move move) {\n\t\ttry {\n\t\tint type = board.getBoard()[move.getyOrigin()][move.getxOrigin()];\n\t\t\n\t\t\tboard.getBoard()[move.getyOrigin()][move.getxOrigin()] = 0;\n\t\t\tboard.getBoard()[move.getyMove()][move.getxMove()] = type;\n\t\t} catch (NullPointerException e) {\n\t\t\tSystem.out.println(\"Move invalid\");\n\t\t}\n\t}", "private void updateBigGameBoardForNextMove(){\n changeLetterAndVisuals();\n /*\n This next step is essential to the game:\n The player just chose a position on a smallGameBoard; this position is where he will\n be able to choose on the big board. For example, if player 1 puts an x in the top-left\n corner of a small game, then player 2 should play in the top-left small game (provided\n it is not already won).\n */\n nextGamePosition = chosenButton.getButtonPosition();\n nextGame = getGame(nextGamePosition);\n //If the next game is already won, then the next player can choose anywhere\n if (checkGameWin(nextGame.getLettersOfAllButtons())){\n for (ButtonClass b : allButtons) {\n b.setAvailable(true);\n }\n for(SmallGameBoard game: games){\n if (game.getGameBoardColor() == R.color.blackTransparent){\n game.changeGameColor(R.color.black);\n }\n }\n } else {\n //If next game is not won, then the player must play on the next game board\n setAvailableButtons(nextGamePosition);\n //Sets all boards besides the next game board to half transparent\n for (SmallGameBoard game: games){\n if(game.getGameBoardColor() == R.color.black){\n game.changeGameColor(R.color.blackTransparent);\n }\n }\n nextGame.changeGameColor(R.color.black);\n }\n //For playerVsComputer, this is when the computer makes its move\n if (!activity.getPlayerVsPlayer() && !computerIsMoving){\n computerMove(activity.getDifficulty());\n computerIsMoving = false;\n }\n }", "public Tile[][] updateBoard(int startRow, int startColumn, int endRow, int endColumn, Tile[][] board) {\n\t\t/*String[] fileRanks = input.split(\" \");\n\t\tint startRow= 8 -Integer.parseInt(fileRanks[0].substring(1));\n\t\tint startColumn = (fileRanks[0].charAt(0)) -'a';\n\t\tint endRow = 8-Integer.parseInt(fileRanks[1].substring(1));\n\t\tint endColumn = (fileRanks[1].charAt(0))-'a'; */\n\n\t\tboard[endRow][endColumn].setOccupyingPiece(null);\n\t\tboard[endRow][endColumn].setOccupyingPiece(board[startRow][startColumn].getOccupyingPiece());\n\t\tboard[startRow][startColumn].setOccupyingPiece(null);\n\n\t\treturn board;\n\t}", "public void update(int row, int column)\n {\n //temporary Toast message\n //Toast.makeText(MainActivity.this,\"update: row is \"+row+\"and column is \"+column, Toast.LENGTH_SHORT).show();\n\n //put an X on the Button that was clicked\n // buttons[row][column].setText(\"X\");\n\n int currentPlayer = game.play(row,column);\n\n if (currentPlayer == 1)\n buttons[row][column].setText(\"X\");\n else if (currentPlayer == 2 )\n buttons[row][column].setText(\"O\");\n\n //check if the game is over\n if (game.isGameOver())\n {\n\n gameStatus.setBackgroundColor(Color.CYAN);\n //disable all the buttons\n enableButtons(false);\n gameStatus.setText(game.result());\n showNewGameDialog();\n }\n }", "private void updateShuffleboard()\n {\n }", "void setBoard(Board board);", "public void updateGame(Seed theSeed, int rowSelected, int columnSelected) {\n \n if (hasWon(theSeed, rowSelected, columnSelected)) { // check for win\n currentState = (theSeed == Seed.CROSS) ? GameState.CROSS_WIN : GameState.NOUGHT_WIN;\n \n } else if (isDraw()) { // checks for draw\n currentState = GameState.DRAW;\n }\n // Otherwise, no change to current state (still GameState.PLAYING).\n }", "@Override\n\tpublic void updateLog(boardDTO board) throws Exception {\n\t\tsqlSession.update(namespace+\".update_board\", board);\n\t}", "Integer update(BoardCell cell, int newPlayerId);", "public boolean move(int x, int y, CheckersBoard board) {\n if (whiteTurn == true && team == Constants.TeamId.team1Id) {\n return false;\n }\n if (whiteTurn == false && team == Constants.TeamId.team2Id) {\n return false;\n }\n /**\n * then change the x - y coords of the piece\n * update the UI to remove the highlighted squares then move the piece\n * if chess and shared square you take a piece\n * if checkers you jumped them you take the piece\n * return new x - y components\n *\n * if this is too high up in the tree you can override this implementation or update it\n * to fit specific pieces if its not working for some reason\n */\n if (possible(x, y, gameBoard)) {\n int changex = this.getX()-x;\n int changey = this.getY()-y;\n CheckersPiece temp = gameBoard.boardPositions[getX()][getY()];\n gameBoard.boardPositions[getX()][getY()] = null;\n gameBoard.boardPositions[x][y] = temp;\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] != null) {\n System.out.println(\"Here\");\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].team != this.team) {\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].imageView.setVisibility(View.GONE);\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] = null;\n }\n }\n this.setX(x);\n this.setY(y);/*\n if (Math.abs(changex) == 2) {\n gameBoard.boardPositions[x + (changex/2)][y + (changey/2)] = null;\n if (team == Constants.TeamId.team1Id) {\n board.numPieces1--;\n } else if (team == Constants.TeamId.team2Id) {\n board.numPieces0--;\n }\n }*/\n\n gameBoard.boardPositions[x][y].imageView.setX(142*x);\n gameBoard.boardPositions[x][y].imageView.setY(142*y);\n // flips after move is\n whiteTurn = !whiteTurn;\n gameBoard.startTimer();\n }\n //setUpUI(gameBoard);\n if (getY() == 7 && team == Constants.TeamId.team2Id) {\n board.crown(this);\n }\n if (getY() == 0 && team == Constants.TeamId.team1Id) {\n board.crown(this);\n }\n return possible(x, y, gameBoard);\n }", "public void turn(){ \r\n\t\tif (currentTurn == 0){ \r\n\t\t\tSystem.out.println(\"Computer's Turn\");\r\n\t\t\tnextRowWin();\r\n\t\t\tnextColWin(); \r\n\t\t\tnextDiagWin();\r\n\t\t\t//check if next move is row win\r\n\t\t\tif (!Arrays.equals(rowWin, checkWin)){\r\n\t\t\t\tcounter(rowWin); \r\n\t\t\t}\r\n\t\t\t//check if next move is column win \r\n\t\t\telse if (!Arrays.equals (colWin, checkWin)) {\r\n\t\t\t\tcounter(colWin); \r\n\t\t\t}\r\n\t\t\t//check if next move is diagonal win\r\n\t\t\telse if (!Arrays.equals(diagWin, checkWin)){\r\n\t\t\t\tcounter(diagWin);\r\n\t\t\t}\r\n\t\t\t//computer moves based on priority positions\r\n\t\t\telse\r\n\t\t\t\tcompMove(); \r\n\t\t\tchangeTurn(); \r\n\t\t}\r\n\t\telse { \r\n\t\t\tSystem.out.println(\"Player's Turn\");\r\n\t\t\tint nextCol, nextRow; \r\n\t\t\tScanner in = new Scanner (System.in); \r\n\t\t\tSystem.out.print (\"Please enter row and column to place your piece [Enter as col row]: \");\r\n\t\t\tif (in.hasNext()) { \r\n\t\t\t\tnextCol = in.nextInt(); \r\n\t\t\t\tnextRow = in.nextInt(); \r\n\t\t\t\tif (nextCol == 3 || nextRow == 3)\r\n\t\t\t\t\tSystem.out.println(\"Input of of range. col and row must be between 0-2.\");\r\n\t\t\t\telse if (board[nextCol][nextRow] == '-') {\r\n\t\t\t\t\tboard[nextCol][nextRow] = 'X'; \r\n\t\t\t\t\tchangeTurn(); \r\n\t\t\t\t}\r\n\t\t\t\telse { \r\n\t\t\t\t\tSystem.out.println(\"Invalid Input. There is already a piece in that location.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse { \r\n\t\t\t\tSystem.out.println(\"Invalid Input. Please input integers for col row.\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void updateTurn(int turn)\n\t{\n\t\tcurTurn = turn;\n\t\trepaint();\n\t}", "public static void update_scoreboard2(){\n\t\t//Update score\n\tif(check_if_wicket2){\n\t\t\n\t\twicket_2++;\n\t\tupdate_score2.setText(\"\"+team_score_2+\"/\"+wicket_2);\n\t}\n\telse{\n\t\tif(TossBrain.compselect.equals(\"bat\")){\n\t\t\ttempshot2=PlayArena2.usershot2;\n\t\tteam_score_2=team_score_2+PlayArena2.usershot2;\n\t\treq=req-tempshot2;\n\t\t}\n\t\telse{\n\t\t\ttempshot2=PlayArena2.compshot2;\n\t\t\tteam_score_2=team_score_2+PlayArena2.compshot2;\n\t\t\treq=req-tempshot2;\n\t\t\t}\n\t\tif(req<0)\n\t\t{\treq=0;}\n\t\t\n\t\tupdate_score2.setText(\"\"+team_score_2+\"/\"+wicket_2);\n\t}\n\t// Overs update\n\tif(over_ball_2==5){\n\t\tover_ball_2=0;\n\t\tover_overs_2++;\n\t\tover_totalballs_2--;\n\t}\n\telse{\n\t\tover_ball_2++;\n\tover_totalballs_2--;}\n\tupdate_overs2.setText(\"\"+over_overs_2+\".\"+over_ball_2+\" (\"+PlayMode.overs+\")\");\n\t\n\t//Check if_first_inning_over\n\tif(over_overs_2==Integer.parseInt(PlayMode.overs) || wicket_2==3 || PlayBrain1.team_score_1<team_score_2)\n\t\t\t{\n\t\tif_second_inning_over=true;\n\t\treference2.add(PlayArena2.viewscore2);\n\t\t\t}\n\t\n\t\n\t//Needed update\n\t\t\tupdate_runrate2.setText(\"<html>NEED<br>\"+req+\"<br>OFF<br>\"+over_totalballs_2+\" <br>BALLS</html>\");\n\t\t}", "public abstract void advanceBoard(float deltaTime);", "void doMove(int move, int piece) {\n //makes a move on the offscreen board\n currentBoard.makeMove(move, piece);\n //displays the move in the GUI\n changeColourSquare(move);\n //changes turn\n turn = !turn;\n }", "public void printBoard() {\n System.out.println(\"Updated board:\");\n for (int row = 0; row < size; row++) {\n for (int col = 0; col < size; col++) {\n\n System.out.print(grid[row][col] + \" \");\n\n }\n System.out.println(\"\");\n }\n }", "protected void takeTurn(int[][] boardState)\n {\n \n }", "public static void updatePositions() {\n\t\tfor(Square s1 : ChessBoard.BOARD_SQUARES) {\n\t\t\tif(s1.hasPiece()) {\n\t\t\t\t(s1.getPiece()).setPosition(s1.getPosition());\n\t\t\t\t(s1.getPiece()).updatePossibleMoves();\n\t\t\t}\n\t\t}\n\t}", "public void initializeBoard() {\n\n\t\t/*\n\t\t * How the array coordinates align with the actual chess board\n\t\t * (row,col) \n\t\t * (7,0) ... ... ... \n\t\t * (7,7) ... ... ... \n\t\t * ... ... ... \n\t\t * (2,0) ...\n\t\t * (1,0) ... \n\t\t * (0,0) ... ... ... (0,7)\n\t\t */\n\n\t\tboolean hasMoved = false;\n\t\tboolean white = true;\n\t\tboolean black = false;\n\n\t\t// Set white piece row\n\t\tboard[0][0] = new Piece('r', white, hasMoved, 0, 0, PieceArray.A_rookId);\n\t\tboard[0][1] = new Piece('n', white, hasMoved, 0, 1, PieceArray.B_knightId);\n\t\tboard[0][2] = new Piece('b', white, hasMoved, 0, 2, PieceArray.C_bishopId);\n\t\tboard[0][3] = new Piece('q', white, hasMoved, 0, 3, PieceArray.D_queenId);\n\t\tboard[0][4] = new Piece('k', white, hasMoved, 0, 4, PieceArray.E_kingId);\n\t\tboard[0][5] = new Piece('b', white, hasMoved, 0, 5, PieceArray.F_bishopId);\n\t\tboard[0][6] = new Piece('n', white, hasMoved, 0, 6, PieceArray.G_knightId);\n\t\tboard[0][7] = new Piece('r', white, hasMoved, 0, 7, PieceArray.H_rookId);\n\n\t\t// Set white pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[1][i] = new Piece('p', white, hasMoved, 1, i, i + 8);\n\t\t}\n\n\t\t// Set empty rows\n\t\tfor (int row = 2; row < 6; row++)\n\t\t\tfor (int col = 0; col < 8; col++)\n\t\t\t\tboard[row][col] = null;\n\n\t\t// Set black pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[6][i] = new Piece('p', black, hasMoved, 6, i, i+8);\n\t\t}\n\n\t\t// Set black piece row\n\t\tboard[7][0] = new Piece('r', black, hasMoved, 7, 0, PieceArray.A_rookId);\n\t\tboard[7][1] = new Piece('n', black, hasMoved, 7, 1, PieceArray.B_knightId);\n\t\tboard[7][2] = new Piece('b', black, hasMoved, 7, 2, PieceArray.C_bishopId);\n\t\tboard[7][3] = new Piece('q', black, hasMoved, 7, 3, PieceArray.D_queenId);\n\t\tboard[7][4] = new Piece('k', black, hasMoved, 7, 4, PieceArray.E_kingId);\n\t\tboard[7][5] = new Piece('b', black, hasMoved, 7, 5, PieceArray.F_bishopId);\n\t\tboard[7][6] = new Piece('n', black, hasMoved, 7, 6, PieceArray.G_knightId);\n\t\tboard[7][7] = new Piece('r', black, hasMoved, 7, 7, PieceArray.H_rookId);\n\t}", "private void completeGameBoard() {\n for (int i = 0; i < row; i++) {\n for (int j = 0; j < column; j++) {\n if (game[i][j].equals(open)) {\n int replaceOpen = getNearbyMines(i, j); //calls to get nearby mines\n game[i][j] = String.valueOf(replaceOpen);\n }\n }\n }\n }", "public void setBoard() {\n bestPieceToMove = null;\n bestPieceFound = false;\n bestMoveDirectionX = 0;\n bestMoveDirectionY = 0;\n bestMoveFound = false;\n killAvailable = false;\n lightCounter = 12;\n darkCounter = 12;\n for (int y = 0; y < boardSize; y++) {\n for (int x = 0; x < boardSize; x++) {\n board[y][x] = new Field(x, y);\n if (y < 3 && board[y][x].getPlaceable()) {\n board[y][x].setPiece(new Piece(PieceColor.DARK, PieceType.MEN));\n } else if (y > 4 && board[y][x].getPlaceable()) {\n board[y][x].setPiece(new Piece(PieceColor.LIGHT, PieceType.MEN));\n }\n }\n }\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tmainBoard.commitNewValues();\n\t\t\t}", "void updateBoard(@TTTConstants.Sign int sign, int row, int column) {\n board[row][column] = sign;\n depth++;\n }", "public void play() {\r\n _board = new Board();\r\n _command = new LoaGUI(\"Lines of Action\", this);\r\n\r\n while (true) {\r\n int playerInd = _board.turn().ordinal();\r\n if (_playing) {\r\n if (_board.gameOver()) {\r\n announceWinner();\r\n _playing = false;\r\n continue;\r\n }\r\n Move next = _players[playerInd].makeMove();\r\n System.out.println(\"The move is get\");\r\n if (next != null) {\r\n assert _board.isLegal(next);\r\n _board.makeMove(next);\r\n _command.repaint();\r\n System.out.println(\"Repaint\");\r\n if (_board.gameOver()) {\r\n announceWinner();\r\n _playing = false;\r\n }\r\n }\r\n } else {\r\n try {\r\n Thread.sleep(magic2);\r\n } catch (InterruptedException ex) {\r\n return;\r\n }\r\n }\r\n }\r\n }", "private void easyMove(Board board) {\n\t\t\r\n\t}", "public void tick() {\r\n //2d array gameBoard is being copied to 2d array update\r\n for (int i = 0; i < gameBoard.length; i++) {\r\n update[i] = gameBoard[i].clone();\r\n }\r\n\r\n //For the entire board, go through every tile\r\n for (int i = 0; i < gameBoard.length; i++) {\r\n for (int j = 0; j < gameBoard[0].length; j++) {\r\n //Counting neighbours\r\n int count = 0;\r\n\r\n //For the current tile, go through all the neighbouring tiles\r\n for (int y = -1; y <= 1; y++) {\r\n for (int x = -1; x <= 1; x++) {\r\n if (x == 0 && y == 0) {\r\n } else {\r\n try {\r\n if (gameBoard[y + i][x + j] > 0) {\r\n count++;\r\n }\r\n } catch (Exception e) {\r\n }\r\n }\r\n }\r\n }\r\n\r\n //Automation Rules (check)\r\n if (count < 2 || count >= 4) {\r\n update[i][j] = -1;\r\n } else if (count == 3) {\r\n update[i][j] = 1;\r\n }\r\n\r\n }\r\n }\r\n\r\n //Once board, neighbours, and automation are completed\r\n //2d array update is copied back to the original 2d array gameBoard\r\n for (int i = 0; i < gameBoard.length; i++) {\r\n gameBoard[i] = update[i].clone();\r\n }\r\n }", "void gameTurn(int move){\n int gameWon = -1;\n boolean gameTie = false;\n //set the board to a move and print it\n if (loggedInUser.myGame.currentLetter.equals(\"X\")){\n gameBoard [move] = 1;\n printMove(move,\"X\");\n }\n else{\n gameBoard[move] = 2;\n printMove(move,\"O\");\n }\n //Update the status of the buttons graying out the ones that were played\n updateButtons();\n\n //checks if the game has been won or not\n gameWon = checkGameWon();\n\n //check of the game has been tied\n gameTie = checkTie();\n\n Game game = new Game(loggedInUser.opponentId);\n game.currentMove = move;\n\n if (loggedInUser.myGame.currentLetter.equals(\"X\")){\n game.currentLetter = \"O\";\n }else {\n game.currentLetter = \"X\";\n }\n\n //if the game hasn't been won and the game hasnt been tied the other playesr turn is made\n if(gameWon != 0 && !gameTie){\n game.gameInProgress = true;\n }\n //if game won\n else if (gameWon != 0){\n //remove all of the buttons\n removeAllButtons();\n game.gameInProgress = false;\n }\n else{\n playerText.setText(\"The game is tie\");\n turn.setText(\"No one wins\");\n game.gameInProgress = false;\n }\n\n //set data\n mDatabaseRef.child(loggedInUser.myId).child(\"myGame\").setValue(game);\n mDatabaseRef.child(loggedInUser.opponentId).child(\"myGame\").setValue(game);\n }", "public void updateBoard(int columns, int rows){\r\n board = new int[columns][rows];\r\n for(int c=0; c<board[0].length; c++) {\r\n for(int r=0; r<board.length; r++) {\r\n board[r][c] = -1;\r\n }\r\n }\r\n this.columns = columns;\r\n this.rows = rows;\r\n save = Math.min((size / columns), (size / rows));\r\n this.repaint();\r\n }", "public void BoardWorkerUpdate() {\n\n notifyWorkerBoardUpdate(board, this.getCurrentTurn().getCurrentPlayer().getNickname());\n }", "public void setBeginningBoard() {\n clearBooleanBoard();\n\n figBoard[0][0] = new Rook(\"white\", 00, white[0]);\n figBoard[0][1] = new Knight(\"white\", 01, white[1]);\n figBoard[0][2] = new Bishop(\"white\", 02, white[2]);\n figBoard[0][4] = new King(\"white\", 04, white[3]);\n figBoard[0][3] = new Queen(\"white\", 03, white[4]);\n figBoard[0][5] = new Bishop(\"white\", 05, white[2]);\n figBoard[0][6] = new Knight(\"white\", 06, white[1]);\n figBoard[0][7] = new Rook(\"white\", 07, white[0]);\n\n for (int i = 0; i < gA.getBoard().length; i++) {\n booleanBoard[0][i] = true;\n gA.getBoard()[0][i].setRotation(180);\n }\n\n for (int i = 0; i < gA.getBoard().length; i++) {\n booleanBoard[1][i] = true;\n gA.getBoard()[1][i].setRotation(180);\n figBoard[1][i] = new Pawn(\"white\", 10 + i, white[8]);\n }\n\n figBoard[7][0] = new Rook(\"black\", 70, black[0]);\n figBoard[7][1] = new Knight(\"black\", 71, black[1]);\n figBoard[7][2] = new Bishop(\"black\", 72, black[2]);\n figBoard[7][4] = new King(\"black\", 74, black[3]);\n figBoard[7][3] = new Queen(\"black\", 73, black[4]);\n figBoard[7][5] = new Bishop(\"black\", 75, black[2]);\n figBoard[7][6] = new Knight(\"black\", 76, black[1]);\n figBoard[7][7] = new Rook(\"black\", 77, black[0]);\n\n for (int i = 0; i < gA.getBoard().length; i++) {\n booleanBoard[7][i] = true;\n gA.getBoard()[7][i].setRotation(0);\n }\n\n for (int i = 0; i < gA.getBoard().length; i++) {\n booleanBoard[6][i] = true;\n gA.getBoard()[6][i].setRotation(0);\n figBoard[6][i] = new Pawn(\"black\", 60 + i, black[8]);\n }\n\n clearFallenFigures();\n clearBoardBackground();\n clearStringBoard();\n showBoard(); //shows the figures\n showScore();\n setBoardClickable();\n\n if (beginner % 2 == 0)\n this.turn = 0;\n else this.turn = 1;\n\n beginner++;\n\n numberOfBlackFallen = 0;\n numberOfWhiteFallen = 0;\n fallenFiguresWhite = new ArrayList<Figure>();\n fallenFiguresBlack = new ArrayList<Figure>();\n\n showCheck();\n showTurn();\n }", "public void setBoard(Board board){this.board = board;}", "public void addMoveToBoardAndSwitchesTurns(Move move) {\n int moveX = move.getMoveX();\n int moveY = move.getMoveY(); \n char symbol = move.getPlayer().getType();\n this.boardState[moveX][moveY] = symbol;\n this.turn = move.getPlayer().getId() == 1 ? 2 : 1; \n }", "public void update(){\n \n // ADD YOU CODE HERE\n\n // Updating the number of steps label\n nbreOfStepsLabel.setText(\"Number of steps: \" + Integer.toString(gameModel.getNumberOfSteps()));\n \n // Updating the icons\n for (int i=0; i<gameModel.getHeigth(); i++) {\n\n for (int j=0; j<gameModel.getWidth(); j++) {\n\n board[i][j].setIconNumber(getIcon(j,i));\n \n } \n }\n\n pack();\n }", "private void updateCanvas()\r\n\t{\r\n\t\tboardCanvas.repaint();\r\n\t\tdiceCanvas.repaint();\r\n\t}", "public char[][] updateBoard(char[][] board, int[] click) {\n\t\tint i = click[0];\n\t\tint j = click[1];\n\t\tchar c = board[i][j];\n\t\tif (c == 'M') {\n\t\t\tboard[i][j] = 'X';\n\t\t\treturn board;\n\t\t} else if (c == 'E') {\n\t\t\tint count = 0;\n\t\t\tfor (int[] d : directions) {\n\t\t\t\tint a = i + d[0];\n\t\t\t\tint b = j + d[1];\n\t\t\t\tif (a >= 0 && b >= 0 && a < board.length && b < board[0].length) {\n\t\t\t\t\tif (board[a][b] == 'M') {\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (count == 0) {\n\t\t\t\tboard[i][j] = 'B';\n\t\t\t\tfor (int[] d : directions) {\n\t\t\t\t\tint a = i + d[0];\n\t\t\t\t\tint b = j + d[1];\n\t\t\t\t\tif (a >= 0 && b >= 0 && a < board.length && b < board[0].length) {\n\t\t\t\t\t\tif (board[a][b] == 'E') {\n\t\t\t\t\t\t\tboard = updateBoard(board, new int[] { a, b });\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tboard[i][j] = (count+\"\").charAt(0);\n\t\t\t}\n\n\t\t} else if (c == 'B') {\n\t\t\treturn board;\n\t\t}\n\t\treturn board;\n\n\t}", "public void setOpBoardMove(int row, int col, int oppiece)\n\t{\n\t\tboard[row][col] = oppiece;\n\t}", "public void changeTurn(){\n // this function is used to calculate the turn of a player after every move is played\n int turn = this.turn;\n turn++;\n this.turn = turn%GameConfiguration.NUMBER_OF_PLAYERS;\n }", "public void update()\r\n {\r\n try\r\n {\r\n Thread.sleep(DELAY);\r\n }\r\n catch (InterruptedException delayException)\r\n {\r\n System.out.println(\"Uh-oh, unexpected exception occured\");\r\n System.out.println(\"This is probably the result of a unruly delay\");\r\n System.out.println(delayException);\r\n } // end of catch (InterruptedException delayException)\r\n\r\n //checkCellStatus(); \r\n\r\n checkCellStatus();\r\n \r\n System.out.print(\"\\f\");\r\n for (int columns = 0; columns < LOWER_BOUND; columns ++)\r\n {\r\n for (int rows = 0; rows < RIGHT_BOUND; rows ++)\r\n {\r\n if (cellGrid[columns][rows].isToBeAlive())\r\n {\r\n cellGrid[columns][rows].setAlive(true);\r\n }\r\n else\r\n {\r\n cellGrid[columns][rows].setAlive(false);\r\n } // end of if (cellGrid[columns][rows].isToBeAlive())\r\n } // end of for (int rows = 0; rows < RIGHT_BOUND; rows ++)\r\n System.out.print(\"\\n\");\r\n } // end of for (int columns = 0; columns < LOWER_BOUND; columns ++)\r\n }", "public void update()\r\n\t{\r\n\t\tAndroidGame.camera.update(grid, player);\r\n\t\tplayer.update(grid);\r\n\t\tplayButton.update(player, grid);\r\n\t\tmenu.update(grid);\r\n\t\tgrid.update();\r\n\t\tif(grid.hasKey())\r\n\t\t\tgrid.getKey().update(player, grid.getFinish());\r\n\t\tif(levelEditingMode)//checking if the make button is clicked\r\n\t\t{\r\n\t\t\tif(makeButton.getBoundingRectangle().contains(Helper.PointerX(), Helper.PointerY()))\r\n\t\t\t{\r\n\t\t\t\tgrid.makeLevel();\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tdoorBubble.update();\r\n\t\t\tif(hasKey)\r\n\t\t\t\tkeyBubble.update();\r\n\t\t}\r\n\t}", "public void initializeDebugBoard() {\n\t\tboolean hasNotMoved = false;\n\t\tboolean hasMoved = true;\n\t\tboolean white = true;\n\t\tboolean black = false;\n\n\t\t// Set empty rows\n\t\tfor (int row = 0; row < 8; row++)\n\t\t\tfor (int col = 0; col < 8; col++)\n\t\t\t\tboard[row][col] = null;\n\n\t\tboard[5][4] = new Piece('k', white, hasMoved, 5, 4, PieceArray.E_kingId);\n//\t\tboard[1][4] = new Piece(\"rook\", white, hasMoved, 1, 4);\n\t\tboard[2][2] = new Piece('q', black, hasMoved, 2, 2, PieceArray.A_rookId);\n//\t\tboard[3][2] = new Piece('q', black, hasMoved, 3, 2, PieceArray.H_rookId);\n\t\t\n\n\t\tboard[0][0] = new Piece('k', black, hasMoved, 0, 0, PieceArray.E_kingId);\n//\t\tboard[7][7] = new Piece('r', black, hasNotMoved, 7, 7, PieceArray.A_rookId);\n//\t\tboard[6][7] = new Piece('p', black, hasNotMoved, 6, 7, PieceArray.A_pawnId);\n//\t\tboard[6][6] = new Piece('p', black, hasNotMoved, 6, 6, PieceArray.B_pawnId);\n//\t\tboard[6][5] = new Piece('p', black, hasNotMoved, 6, 5, PieceArray.C_pawnId);\n//\t\tboard[6][4] = new Piece('p', black, hasNotMoved, 6, 4, PieceArray.D_pawnId);\n\t\n//\t\tboard[6][6] = new Piece(\"pawn\", black, hasMoved, 6, 6);\n//\t\tboard[6][7] = new Piece(\"pawn\", black, hasMoved, 6, 7);\n//\t\tboard[6][4] = new Piece(\"pawn\", black, hasMoved, 6, 4);\n//\t\t\t\n//\t\t\n//\t\tboard[4][4] = new Piece(\"pawn\", black, hasMoved, 4,4);\n//\t\tboard[3][5] = new Piece(\"rook\", white,hasMoved,3,5);\n//\t\tboard[1][7] = new Piece(\"pawn\",black,hasMoved,1,7);\n\n\t}", "public static void main(String[] args) throws InterruptedException, NumberFormatException, IOException {\n\n\t\tint game = 0;\n\t\tFile fileToBeModified = new File(\"src/Game/winCount.txt\");\n\t\tBufferedReader reader = new BufferedReader(new FileReader(fileToBeModified));\n\n\t\tint whiteWin = Integer.parseInt(reader.readLine());\n\t\tSystem.out.println(\"White Wins:\" + whiteWin);\n\t\tint blackWin = Integer.parseInt(reader.readLine());\n\t\tSystem.out.println(\"Black Wins:\" + blackWin);\n\t\tint stalemates = Integer.parseInt(reader.readLine());\n\t\tSystem.out.println(\"Stalemates:\" + stalemates);\n\n\t\tint currWhiteWin = 0;\n\t\tint currBlackWin = 0;\n\t\tint currStalemate = 0;\n\n\t\tlong start= System.currentTimeMillis();\n\n\t\tBoardState board = new BoardState();\n\t\tMinimaxAI minimaxBlackPlayer = new MinimaxAI(5);\n\t\tMinimaxAI minimaxWhitePlayer = new MinimaxAI(5);\n\t\tAlphaBetaAI abBlackPlayer = new AlphaBetaAI(5);\n\t\tAlphaBetaAI abWhitePlayer = new AlphaBetaAI(5);\n\t\twhile (game <=30) {\t\n\t\t\tfor (int y = 8; y > 0; y--) {\n\t\t\t\tfor (int x = 1; x <= 8; x++) {\n\t\t\t\t\tSystem.out.print(board.getTile(x, y) + \"\\t\");\n\t\t\t\t}System.out.println();\n\t\t\t}\n\t\t\t\n\t\t\tint turn = 1;\n\t\t\twhile (!board.gameOver()) {\n\t\t\t\tif (board != null) {\n\t\t\t\t\tif (board.isWhiteTurn) {\n\t\t\t\t\t\t//board = abWhitePlayer.alphaBetaPlay(board);\n\t\t\t\t\t\tboard = minimaxWhitePlayer.minimaxPlay(board);\n\t\t\t\t\t}else {\n\t\t\t\t\t\t//board = abBlackPlayer.alphaBetaPlay(board);\n\t\t\t\t\t\tboard = minimaxBlackPlayer.minimaxPlay(board);\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(\"Turn #\" + turn++);\n\t\t\t\t\tboard.printBoard();\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\tTimeUnit.MILLISECONDS.sleep(250);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (board.whiteWin()) {\n\t\t\t\tSystem.out.println(\"White Wins\");\n\t\t\t\twhiteWin++;\n\t\t\t\tcurrWhiteWin++;\n\t\t\t}else if(board.blackWin()){\n\t\t\t\tSystem.out.println(\"Black Wins\");\n\t\t\t\tblackWin++;\n\t\t\t\tcurrBlackWin++;\n\t\t\t}else {\n\t\t\t\tSystem.out.println(\"Stalemate\");\n\t\t\t\tstalemates++;\n\t\t\t\tcurrStalemate++;\n\t\t\t}\n\t\t\t\n//\t\t\tboard.reset();\n//\t\t\tgame++;\n\t\t\tbreak;\n\t\t}\n\n\t\tlong elapsed = System.currentTimeMillis() - start;\n\t\tSystem.out.println(\"Time Elapsed: \" + elapsed);\n\n\t\tFileWriter writer = new FileWriter(fileToBeModified);\n\t\twriter.write(Integer.toString(whiteWin));\n\t\twriter.write(System.getProperty( \"line.separator\" ));\n\t\twriter.write(Integer.toString(blackWin));\n\t\twriter.write(System.getProperty( \"line.separator\" ));\n\t\twriter.write(Integer.toString(stalemates));\n\t\tSystem.out.println(\"White Wins:\" + currWhiteWin);\n\t\tSystem.out.println(\"Black Wins:\" + currBlackWin);\n\t\tSystem.out.println(\"Stalemates:\" + currStalemate);\n\t\treader.close();\n\t\twriter.close();\n\t}", "private void resetBoard() {\n\t\tGameScores.ResetScores();\n\t\tgameTime = SystemClock.elapsedRealtime();\n\t\t\n\t}", "public void nextTurn() {\n visionChanged = true;\n SoundPlayer.playEndTurn();\n // Check if any protection objectives have failed\n gameState.updateAllHeroProtectionGoals(getHeroManager());\n // hook the next turn\n if (!multiplayerGameManager.hookNextTurn()) {\n\n if (map.enemyPerformingMove()) {\n return;\n }\n // Enemy action was made\n if (playerTurn && map.hasEnemy()) {\n try {\n map.enemyTurn(this);\n } catch (InterruptedException e) {\n logger.error(\"ayylmao at the GameManager.nextTurn(..) Method\");\n Platform.exit();\n Thread.currentThread().interrupt();\n }\n } else {\n map.playerTurn(this);\n updateBuffIcons();\n updateTempVisiblePoints();\n map.turnTick();\n for(CurrentHeroChangeListener listener:heroChangeListeners){\n \tlistener.onHeroChange(getHeroManager().getCurrentHero());\n }\n }\n\n } else {\n moveViewTo(getHeroManager().getCurrentHero().getX(), getHeroManager().getCurrentHero().getY());\n updateBuffIcons();\n updateTempVisiblePoints();\n }\n\n map.updateVisibilityArray();\n dayNightClock.tick();\n turnTickLiveTiles();\n abilitySelected = AbilitySelected.MOVE;\n abilitySelectedChanged = true;\n backgroundChanged = true;\n gameChanged = true;\n minimapChanged = true;\n saveOriginator.writeMap(this.map, this.getObjectives(), this.gameState);\n // update(this.tracker,null);\n }", "public void initializeGameboard() {\r\n\t\t\r\n\t\t for (int row=0 ; row<gameBoard.length; row++)\r\n\t\t { \r\n\t\t \t \r\n\t\t \t for(int column=0;column<gameBoard[row].length;column++ )\t \r\n\t\t \t { \r\n\t\t \t\t if( row==0|| row ==1)\r\n\t\t \t\t { \r\n\t\t \t\t\t if (column==0) {gameBoard[row][column]=\"2\";}\r\n\t\t \t\t\t else if (column==1) {gameBoard[row][column]=\"3\";}\t \r\n\t\t \t\t\t else if (column==2) {gameBoard[row][column]=\"4\";} \r\n\t\t \t\t\t else if (column==3) {gameBoard[row][column]=\"5\";} \r\n\t\t \t\t\t else if (column==4) {gameBoard[row][column]=\"6\";} \r\n\t\t \t\t\t else if (column==5) {gameBoard[row][column]=\"7\";}\r\n\t\t \t\t\t else if (column==6) {gameBoard[row][column]=\"8\";} \r\n\t\t \t\t\t else if (column==7) {gameBoard[row][column]=\"9\";}\r\n\t\t \t\t\t else if (column==8) {gameBoard[row][column]=\"10\";} \r\n\t\t \t\t\t else if (column==9) {gameBoard[row][column]=\"11\";} \r\n\t\t \t\t\t else if (column==10) {gameBoard[row][column]=\"12\";} \r\n\t\t \t\t }\r\n\t\t \t\t \r\n\t\t\t \t else if(row ==2 || row==3) \r\n\t\t\t \t {\r\n\t\t\t \t\t if (column==0) {gameBoard[row][column]=\"12\";}\r\n\t\t \t\t\t else if (column==1) {gameBoard[row][column]=\"11\";}\t \r\n\t\t \t\t\t else if (column==2) {gameBoard[row][column]=\"10\";} \r\n\t\t \t\t\t else if (column==3) {gameBoard[row][column]=\"9\";} \r\n\t\t \t\t\t else if (column==4) {gameBoard[row][column]=\"8\";} \r\n\t\t \t\t\t else if (column==5) {gameBoard[row][column]=\"7\";}\r\n\t\t \t\t\t else if (column==6) {gameBoard[row][column]=\"6\";} \r\n\t\t \t\t\t else if (column==7) {gameBoard[row][column]=\"5\";}\r\n\t\t \t\t\t else if (column==8) {gameBoard[row][column]=\"4\";} \r\n\t\t \t\t\t else if (column==9) {gameBoard[row][column]=\"3\";} \r\n\t\t \t\t\t else if (column==10) {gameBoard[row][column]=\"2\";} \r\n\t\t\t \t }\r\n\t\t }\r\n\t\t }\r\n\t }", "public void changeTurn(){\r\n model.setCheckPiece(null);\r\n model.swapPlayers();\r\n }", "private void update() {\n setPieceType();\n initBackground(pieceIndex);\n }", "private void doGameTurn()\n\t{\n\t\tif (!lost && !won)\n\t\t{\n\t\t\trefreshMapAndFrame();\n\t\t\t\n\t\t\tcheckPlayerCondition();\n\t\t\tElementAccess.openExit();\n\t\t\tSystem.out.println(turn);\n\t\t}\n\t\telse if (lost)\n\t\t{\n\t\t\tSound.lost();\n\t\t\trefreshMapAndFrame();\n\n\t\t\tif (playerHasLost())\n\t\t\t{\n\t\t\t\tstop = true;\n\t\t\t}\n\n\t\t\tMapInstance.getInstance().levelRestart();\n\t\t\tlost = false;\n\t\t}\n\t\telse if (won)\n\t\t{\n\t\t\tSound.won();\n\t\t\trefreshMapAndFrame();\n\n\t\t\twon = false;\n\t\t\tif (playerNotInLevel())\n\t\t\t{\n\t\t\t\tstop = true;\n\t\t\t}\n\n\t\t\tnextLevel();\n\t\t\tMapInstance.getInstance().levelRestart();\n\t\t}\n\t}", "@Override\r\n\tpublic int update(cms_board_vo cms_board_vo) throws Exception {\n\t\treturn sql.update(\"cms_board.update\", cms_board_vo);\r\n\t}", "public void refreshBoard()\r\n\t{\r\n\r\n\t\tsetLayout (new GridLayout(1,1));\r\n\t\tthis.setBackground(Color.LIGHT_GRAY);\r\n\t\t//Set updated food cells and snakes for the snake panel object\r\n\t\tsp.setFoodCells(foodCells);\r\n\t\tsp.setSnakes(snakes);\r\n\t\t//Refresh/recreate the board with the updated values of food cells and snakes\r\n\t\tsp.refreshSnakePanel();\r\n\r\n\r\n\t\t// Create an input stream to receive data from the server\r\n\t\ttry {\r\n\t\t\t// Create an output stream to send data to the server\r\n\t\t\toutputToServer = new ObjectOutputStream(socket.getOutputStream());\r\n\r\n\t\t\t//Send updated values of foodcells and Snakes (with updated locations/cells of current snake) to the server\r\n\t\t\tsnakeProtocol.setSnakeIndex(snakeIndex);\r\n\t\t\tsnakeProtocol.setFoodCells(foodCells);\r\n\t\t\tsnakeProtocol.setSnakes(snakes);\r\n\r\n\t\t\toutputToServer.writeObject(snakeProtocol);\r\n\t\t\toutputToServer.flush();\r\n\t\t} catch (IOException e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\r\n\t\tsetFocusable(true);\r\n\t\tsetFocusTraversalKeysEnabled(true);\r\n\r\n\t\t//paint the panel to refresh the board\r\n\t\tpaintAll(getGraphics()); \r\n\r\n\t\t//Get the player status from server. i.e. isPlayerAlive and hasPlayerWon\r\n\t\tgetPlayerStatusFromServer();\r\n\r\n\t\ttry {\r\n\t\t\t//Stop the game if player is not alive or has won the game.\r\n\t\t\t// And update the status in the frame\r\n\t\t\tif(!isPlayerAlive)\r\n\t\t\t{\r\n\t\t\t\t//remove(sp);\r\n\t\t\t\tt.stop();\r\n\t\t\t\tview.playerLost();\r\n\t\t\t\t//get the final scores and refresh the scorecard \r\n\t\t\t\tgetPlayerScoresFromServer();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif(hasPlayerWon)\r\n\t\t\t{\r\n\t\t\t\t//remove(sp);\r\n\t\t\t\tt.stop();\r\n\t\t\t\tview.playerWon();\r\n\t\t\t\t//get the final scores and refresh the scorecard \r\n\t\t\t\tgetPlayerScoresFromServer();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t//Else, get latest snakeProtocol data from the server. i.e. \r\n\t\t\t// any updates to the food cells and updated snake cell locations for other snakes\r\n\t\t\tinputFromServer = new ObjectInputStream(socket.getInputStream());\r\n\r\n\t\t\t//TODO\r\n\t\t\t//Loop until the object is received. Sometimes this may take time due to synchronization code on the server.\r\n\t\t\tObject obj = null;\r\n\t\t\t//do\r\n\t\t\t//{\r\n\t\t\tobj = inputFromServer.readObject();\r\n\t\t\t//}while (obj == null);\r\n\r\n\t\t\tsnakeProtocol = (SnakeProtocol)obj;\r\n\t\t\tfoodCells = snakeProtocol.getFoodCells();\r\n\r\n\t\t\tsnakes = null;\r\n\t\t\tsnakes = snakeProtocol.getSnakes();\r\n\t\t\tcurrentDirection = snakes.get(snakeIndex).getSnakeDirection();\r\n\t\t\tcurrentSpeed = snakes.get(snakeIndex).getSnakeSpeed();\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void update(){\n\t\t//Arm up (spool out cable from winch while going up)\n\t\tif(Robot.stick.getRawButton(4)){\n\t\t\ttalonArm.set(SmartDashboard.getNumber(\"Climber Arm Speed: \", 0.5));\n\t\t\twinchGroup.set(-SmartDashboard.getNumber(\"Climber Winch Speed: \", 0.25));\n\t\t}\n\t\t//Arm down\n\t\telse if(Robot.stick.getRawButton(2)){\n\t\t\ttalonArm.set(-SmartDashboard.getNumber(\"Climber Arm Speed: \", 0.5));\n\t\t}\n\t\t//Stop moving\n\t\telse{\n\t\t\ttalonArm.set(0);\n\t\t\twinchGroup.set(0);\n\t\t}\n\t\t//Climb with winch\n\t\tif(Robot.stick.getRawButton(1)){\n\t\t\twinchGroup.set(SmartDashboard.getNumber(\"Climber Winch Speed: \", 0.25));\n\t\t}\n\t}", "protected void update(Input input) {\n\n if (input.wasPressed(Keys.ESCAPE) || boardNum > 4 ||turn.getShots() == 0){\n System.exit(0);\n }\n\n // if all red pegs are destroyed, advance to the next board\n if (board.finished() && balls == null){\n\n boardNum++;\n board = new Board(boardNum);\n }\n\n // B A L L'S O U T\n if (input.wasPressed(MouseButtons.LEFT) && balls == null) {\n balls = new ArrayList<>();\n balls.add(new Ball());\n balls.get(0).reset(input.getMouseX(), input.getMouseY());\n }\n\n if (balls != null) {\n board.update(balls);\n\n for (int i = 0; i < balls.size(); i++) {\n Ball ball = balls.get(i);\n\n ball.update();\n\n // check if all the balls are out of window, if yes, start a new turn\n if (ball.isOut()) {\n balls.remove(i);\n i--;\n }\n if (balls.isEmpty()){\n turn.nextTurn(board);\n balls = null;\n break;\n }\n\n // activate power up if struck\n if (turn.isActivated(ball)){\n balls.add(turn.activate(ball));\n balls.remove(ball);\n }\n\n // detect if the ball activates the bucket, if so, extra shot given\n if (ball.bounding().centre().y > Window.getHeight() && ball.bounding().intersects(bucket.bounding())){\n turn.extraShot();\n }\n\n }\n\n }\n\n board.render();\n turn.update();\n bucket.update();\n\n }", "void update(boolean winner);", "public void play() {\n\n int turn = 1;\n\n while (!isCheckMate()) {\n System.out.println(\"Turn \" + turn++);\n board.print();\n playTurn(whitePlayer);\n board.print();\n playTurn(blackPlayer);\n }\n }", "public void updateComputerBoard()\r\n {\r\n boardpanel.removeAll();\r\n for (int i = 0; i < 3; i++) {\r\n for (int j = 0; j < 3; j++) {\r\n buttons[i][j].setEnabled(false);\r\n boardpanel.add(buttons[i][j]);\r\n }\r\n }\r\n }", "private void displayBoard() {\r\n\r\n for (int r = 0; r < 8; r++) {\r\n for (int c = 0; c < 8; c++) {\r\n if (model.pieceAt(r, c) == null)\r\n board[r][c].setIcon(null);\r\n else if (model.pieceAt(r, c).player() == Player.WHITE) {\r\n if (model.pieceAt(r, c).type().equals(\"Pawn\"))\r\n board[r][c].setIcon(wPawn);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Rook\"))\r\n board[r][c].setIcon(wRook);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Knight\"))\r\n board[r][c].setIcon(wKnight);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Bishop\"))\r\n board[r][c].setIcon(wBishop);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Queen\"))\r\n board[r][c].setIcon(wQueen);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"King\"))\r\n board[r][c].setIcon(wKing);\r\n } else if (model.pieceAt(r, c).player() == Player.BLACK) {\r\n if (model.pieceAt(r, c).type().equals(\"Pawn\"))\r\n board[r][c].setIcon(bPawn);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Rook\"))\r\n board[r][c].setIcon(bRook);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Knight\"))\r\n board[r][c].setIcon(bKnight);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Bishop\"))\r\n board[r][c].setIcon(bBishop);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Queen\"))\r\n board[r][c].setIcon(bQueen);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"King\"))\r\n board[r][c].setIcon(bKing);\r\n }\r\n repaint();\r\n }\r\n }\r\n if (model.inCheck(Player.WHITE))\r\n JOptionPane.showMessageDialog(null, \"White King in Check\");\r\n if (model.inCheck(Player.BLACK))\r\n JOptionPane.showMessageDialog(null, \"Black King in Check\");\r\n if (model.movingIntoCheck())\r\n JOptionPane.showMessageDialog(null, \"Cannot move into check\");\r\n if (model.isComplete())\r\n JOptionPane.showMessageDialog(null, \"Checkmate\");\r\n }", "@Override\n\tpublic Integer update(BoardDTO dto) {\n\t\treturn mapper.update(dto);\n\t}", "public static void move(TTTBoard board, char piece) {\n if (board.winner() != ' ') {\n throw new IllegalArgumentException(\"Game Over\");\n }\n if (board.size() == 1) {\n board.set(0, 0, piece);\n return;\n }\n if (board.size() == 3) {\n int turnNumber = getBoardTurnNumber(board);\n if (turnNumber == 1) {\n board.set(0, 0, piece);\n return;\n } else if (turnNumber == 2) {\n if (board.get(1, 1) == ' ') {\n board.set(1, 1, piece);\n return;\n } else if (board.get(0, 0) == ' ') {\n board.set(0, 0, piece);\n return;\n }\n } else if (turnNumber == 3) {\n try {\n int[] opp = getFirstOpp(board, piece);\n int oppRow = opp[0];\n if (oppRow == 0) {\n board.set(2, 0, piece);\n return;\n } else if (oppRow == 1) {\n board.set(0, 2, piece);\n return;\n } else {\n board.set(0, 2, piece);\n return;\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n\n // check if win diagonal\n int selfC = 0;\n int oppC = 0;\n int spaceC = 0;\n for (int i = 0; i < board.size(); ++i) {\n int j = i;\n char p = board.get(i, j);\n if (p == ' ') spaceC++;\n else if (p == piece) selfC++;\n else oppC++;\n }\n\n if (spaceC == 1 && (selfC == 0 || oppC == 0)) {\n // fill in that space\n for (int i = 0; i < board.size(); ++i) {\n int j = i;\n char p = board.get(i, j);\n if (p == ' ') {\n board.set(i, j, piece);\n return;\n }\n }\n }\n\n selfC = 0;\n oppC = 0;\n spaceC = 0;\n for (int i = 0; i < board.size(); ++i) {\n int j = board.size() - i - 1;\n char p = board.get(i, j);\n if (p == ' ') spaceC++;\n else if (p == piece) selfC++;\n else oppC++;\n\n }\n\n if (spaceC == 1 && (selfC == 0 || oppC == 0)) {\n // fill in that space\n for (int i = 0; i < board.size(); ++i) {\n int j = board.size() - i - 1;\n char p = board.get(i, j);\n if (p == ' ') {\n board.set(i, j, piece);\n return;\n }\n }\n }\n\n // check if win row col\n\n boolean[] selfWinnableRows = new boolean[board.size()];\n boolean[] oppWinnableRows = new boolean[board.size()];\n boolean[] selfWinnableCols = new boolean[board.size()];\n boolean[] oppWinnableCols = new boolean[board.size()];\n int[] selfCountRows = new int[board.size()];\n int[] selfCountCols = new int[board.size()];\n int[] oppCountRows = new int[board.size()];\n int[] oppCountCols = new int[board.size()];\n\n // checks if any rows can be won\n for (int i = 0; i < board.size(); ++i) {\n boolean containsSelf = false;\n boolean containsOpp = false;\n boolean hasEmpty = false;\n int selfCount = 0;\n int oppCount = 0;\n\n for (int j = 0; j < board.size(); ++j) {\n char p = board.get(i, j);\n\n if (p == ' ') {\n hasEmpty = true;\n } else if (p == piece) {\n containsSelf = true;\n selfCount++;\n } else {\n containsOpp = true;\n oppCount++;\n }\n }\n\n selfCountRows[i] = selfCount;\n oppCountRows[i] = oppCount;\n\n if (!hasEmpty) continue;\n\n if (!containsSelf && !containsOpp) {\n selfWinnableRows[i] = true;\n oppWinnableRows[i] = true;\n }\n\n if (containsSelf && !containsOpp) {\n selfWinnableRows[i] = true;\n }\n if (containsOpp && !containsSelf) {\n oppWinnableRows[i] = true;\n }\n }\n\n // checks if any cols can be won\n for (int i = 0; i < board.size(); ++i) {\n boolean containsSelf = false;\n boolean containsOpp = false;\n boolean hasEmpty = false;\n int selfCount = 0;\n int oppCount = 0;\n for (int j = 0; j < board.size(); ++j) {\n char p = board.get(j, i);\n\n if (p == ' ') {\n hasEmpty = true;\n } else if (p == piece) {\n containsSelf = true;\n selfCount++;\n } else {\n containsOpp = true;\n oppCount++;\n }\n }\n\n selfCountCols[i] = selfCount;\n oppCountCols[i] = oppCount;\n\n if (!hasEmpty) continue;\n\n if (!containsSelf && !containsOpp) {\n selfWinnableCols[i] = true;\n oppWinnableCols[i] = true;\n }\n\n if (containsSelf && !containsOpp) {\n selfWinnableCols[i] = true;\n }\n\n if (containsOpp && !containsSelf) {\n oppWinnableCols[i] = true;\n }\n }\n\n int[] selfInRowRows = new int[board.size()];\n int[] selfInRowCols = new int[board.size()];\n int[] oppInRowRows = new int[board.size()];\n int[] oppInRowCols = new int[board.size()];\n\n for (int i = 0; i < selfWinnableRows.length; ++i) {\n if (selfWinnableRows[i]) {\n int count = selfCountRows[i];\n selfInRowRows[count]++;\n }\n }\n for (int i = 0; i < selfWinnableCols.length; ++i) {\n if (selfWinnableCols[i]) {\n int count = selfCountCols[i];\n selfInRowCols[count]++;\n }\n }\n for (int i = 0; i < oppWinnableRows.length; ++i) {\n if (oppWinnableRows[i]) {\n int count = oppCountRows[i];\n oppInRowRows[count]++;\n }\n }\n for (int i = 0; i < oppWinnableCols.length; ++i) {\n if (oppWinnableCols[i]) {\n int count = oppCountCols[i];\n oppInRowCols[count]++;\n }\n }\n\n if (board.size() == 3) {\n int turnNumber = getBoardTurnNumber(board);\n if (selfInRowRows[board.size() - 1] == 0 &&\n selfInRowCols[board.size() - 1] == 0 &&\n oppInRowRows[board.size() - 1] == 0 &&\n oppInRowCols[board.size() - 1] == 0) {\n if (turnNumber == 4) {\n if ((board.get(1, 1) != ' ' && board.get(1, 1) != piece)\n && (board.get(2, 2) != ' ' && board.get(2, 2) != piece)) {\n board.set(2, 0, piece);\n return;\n }\n } else if (turnNumber == 5) {\n if (selfCountCols[0] == 2) {\n board.set(2, 2, piece);\n return;\n } else if (selfCountRows[0] == 2) {\n if (board.get(1, 0) != piece && board.get(1, 0) != ' ') {\n board.set(2, 2, piece);\n return;\n }\n if (board.get(2, 0) != piece && board.get(2, 0) != ' ') {\n board.set(2, 2, piece);\n return;\n }\n board.set(2, 0, piece);\n return;\n }\n }\n }\n }\n\n for (int i = board.size() - 1; i >= 0; i--) {\n int selfRowsCount = selfInRowRows[i];\n //System.out.println(i + \" self rows count: \" + selfRowsCount);\n if (selfRowsCount > 0) {\n // get a row index that contains this self in row rows\n try {\n int rowIndex = getRowIndexForInRowRows(board, i, selfWinnableRows, selfCountRows);\n int colIndex = getNextInRow(board, rowIndex);\n board.set(rowIndex, colIndex, piece);\n return;\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }\n int selfColsCount = selfInRowCols[i];\n if (selfColsCount > 0) {\n try {\n int colIndex = getRowIndexForInRowRows(board, i, selfWinnableCols, selfCountCols);\n int rowIndex = getNextInCol(board, colIndex);\n board.set(rowIndex, colIndex, piece);\n return;\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n int oppRowsCount = oppInRowRows[i];\n // System.out.println(i + \" opp rows count: \" + oppRowsCount);\n if (oppRowsCount > 0) {\n\n try {\n int rowIndex = getRowIndexForInRowRows(board, i, oppWinnableRows, oppCountRows);\n int colIndex = getNextInRow(board, rowIndex);\n board.set(rowIndex, colIndex, piece);\n return;\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }\n int oppColsCount = oppInRowCols[i];\n if (oppColsCount > 0) {\n try {\n int colIndex = getRowIndexForInRowRows(board, i, oppWinnableCols, oppCountCols);\n int rowIndex = getNextInCol(board, colIndex);\n board.set(rowIndex, colIndex, piece);\n return;\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n\n try {\n int[] nextEmpty = getNextEmpty(board);\n board.set(nextEmpty[0], nextEmpty[1], piece);\n } catch (Exception e) {\n throw new IllegalArgumentException(\"DRAW / SOMEONE WON\");\n }\n }", "public void His_Turn(String opponent_coord){\r\n\r\n\t\t/*\r\n\t\t * will get xcoor and ycoor\r\n\t\t * NOTE: We don't need to validate, it should be already validate\r\n\t\t * we only need this function to parse the xcoor and ycoor\r\n\t\t */\r\n\t\tValidate_Input(opponent_coord);\r\n\t\t\r\n\t\t/*\r\n\t\t * update hit_history\r\n\t\t */\r\n\t\tmyBoard.hit_history[xcoor][ycoor]=1; \r\n\r\n\t\tboolean hit=false;\r\n\t\t\r\n\t\tdisplay.putStaticLine(\"\");\r\n\t\tif(myBoard.hit_or_miss(xcoor, ycoor)){\r\n\t\t\tSound.playSound(\"res/explosion.wav\");\r\n\t\t\thit=true;\r\n\t\t}\r\n\t\telse{\r\n\t\t\tSound.playSound(\"res/Missile_Incoming_FlyBy.wav\");\r\n\t\t}\r\n\r\n\t\t\r\n\t\t// Check if a ship was sunk and update the board accordingly\r\n\t\tString sunk=myBoard.check_sunk();\r\n\t\tif(sunk!=\"nothing\"){\r\n\t\t\tSound.playSound(\"res/bubbles.wav\");\r\n\t\t\tif(myBoard.check_all_sunk()){\r\n\t\t\t\topponent_victory=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\t// Handle all the output/display after all the calculation...\r\n\t\tdisplay.clearScreen();\r\n\t\tthis.Display_Boards();\r\n\t\tdisplay.putStaticLine(\"\");\r\n\t\tif(hit)\r\n\t\t\tdisplay.putStaticLine(\"Opponent attacked \" + opponent_coord+\"... \" + \"Hit!\");\r\n\t\telse\r\n\t\t\tdisplay.putStaticLine(\"Opponent attacked \" + opponent_coord+\"... \" + \"Miss\");\r\n\t\tif(sunk!=\"nothing\"){\r\n\t\t\tdisplay.putStaticLine(\"\");\r\n\t\t\tdisplay.putStaticLine(\"He sunk your \" + sunk); \r\n\t\t}\r\n\t\tif(opponent_victory){\r\n\t\t\tdisplay.putStaticLine(\"\");\r\n\t\t\tdisplay.putStaticLine(\"You LOSE!!!!!!\");\r\n\t\t}\r\n\t\t\r\n\t\tdisplay.putStaticLine(\"\");\r\n\t\tdisplay.putStaticLine(\"Press Enter to continue with you turn...\");\r\n\t\tdisplay.printScreen();\r\n\t\tdisplay.printPrompt(\"user> \");\r\n\t\t\r\n\t\thit=false;\r\n\t\tturn_change=true;\r\n\t\t// now it's my turn again\r\n\t\tthis.isTurn=true;\r\n\t}", "@Override\n\tpublic int update(BoardDTO boardDTO) throws Exception {\n\t\treturn 0;\n\t}", "public void refreshDisplay(){\r\n for (int i = 0; i < 6; i++) {\r\n for (int j = 0; j < 7; j++) {\r\n switch (boardRep[i][j]) { //maybe not best style to have default red but whatever (change board\r\n case 0:\r\n boardSquares[i][j].setBackground(Color.WHITE);\r\n break;\r\n case 1:\r\n boardSquares[i][j].setBackground(Color.BLACK);\r\n break;\r\n default:\r\n boardSquares[i][j].setBackground(Color.RED);\r\n break;\r\n }\r\n }\r\n }\r\n \r\n if (blackToPlay){ //change to move squares\r\n for (int i = 0; i < 7; i++) {\r\n moveSelect[i].setBackground(Color.BLACK);\r\n }\r\n } else{\r\n for (int i = 0; i < 7; i++) {\r\n moveSelect[i].setBackground(Color.RED);\r\n }\r\n }\r\n \r\n \r\n }", "public void update(){\n\t\tthis.game.atacarZombies(this.x, this.y, this.damage, 1, false); //Misma fila\n\t\tthis.game.atacarZombies(this.x-1, this.y, this.damage, 1, false); //Fila arriba\n\t\tthis.game.atacarZombies(this.x+1, this.y, this.damage, 1, false); //Fila abajo\n\t\tthis.turno++;\n\t}", "public void setState(int row, int col) throws ArrayIndexOutOfBoundsException {\r\n board[row][col] = currentPlayer;\r\n }", "private void buttonClicked(int c){\r\n boardRep[currentFilled[c]][c] = blackToPlay ? 1:-1; //adjust board rep\r\n if (blackToPlay){\r\n boardSquares[5-currentFilled[c]][c].setBackground(Color.BLACK);\r\n for (int i = 0; i < 7; i++) {\r\n moveSelect[i].setBackground(Color.RED);\r\n }\r\n int y = 5-currentFilled[c];\r\n \r\n \r\n for (int i = 0; i < 4; i++) { //check horizontal for black win\r\n if ((c-3 + i)>-1 && c-3+i<4){\r\n horizontal4s[y][c-3+i]++;\r\n if (horizontal4s[y][c-3+i] == 4){\r\n winnerText.setText(\"BLACK WINS\");\r\n disableMoves();\r\n }\r\n }\r\n }\r\n \r\n for (int i = 0; i < 4; i++) { //check vertical for black win\r\n if (y-3+i>-1 && y-3+i<3){\r\n vertical4s[y-3+i][c]++;\r\n if (vertical4s[y-3+i][c] == 4){\r\n winnerText.setText(\"BLACK WINS\");\r\n disableMoves();\r\n }\r\n }\r\n }\r\n \r\n for (int i = 0; i < 4; i++) { //check TLBR diag for black win\r\n if (y-3+i>-1 && y-3+i<3 && c-3+i>-1 && c-3+i<4){\r\n diagonalTLBR4s[y-3+i][c-3+i]++;\r\n if (diagonalTLBR4s[y-3+i][c-3+i] == 4){\r\n winnerText.setText(\"BLACK WINS\");\r\n disableMoves();\r\n }\r\n }\r\n }\r\n \r\n for (int i = 0; i < 4; i++) { //check TRBL diag for black win\r\n if (y-3+i>-1 && y-3+i<3 && c+3-i>-1 && c+3-i < 4){\r\n diagonalTRBL4s[y-3+i][c+3-i]++;\r\n if (diagonalTRBL4s[y-3+i][c+3-i] == 4){\r\n winnerText.setText(\"BLACK WINS\");\r\n disableMoves();\r\n }\r\n }\r\n }\r\n \r\n \r\n \r\n }\r\n else{\r\n boardSquares[5-currentFilled[c]][c].setBackground(Color.RED);\r\n for (int i = 0; i < 7; i++) {\r\n moveSelect[i].setBackground(Color.BLACK);\r\n }\r\n \r\n int y = 5-currentFilled[c];\r\n \r\n \r\n for (int i = 0; i < 4; i++) { //check horizontal for black win\r\n if ((c-3 + i)>-1 && c-3+i<4){\r\n horizontal4s[y][c-3+i]--;\r\n if (horizontal4s[y][c-3+i] == -4){\r\n winnerText.setText(\"RED WINS\");\r\n disableMoves();\r\n }\r\n }\r\n }\r\n \r\n for (int i = 0; i < 4; i++) { //check vertical for black win\r\n if (y-3+i>-1 && y-3+i<3){\r\n vertical4s[y-3+i][c]--;\r\n if (vertical4s[y-3+i][c] == -4){\r\n winnerText.setText(\"RED WINS\");\r\n disableMoves();\r\n }\r\n }\r\n }\r\n \r\n for (int i = 0; i < 4; i++) { //check TLBR diag for black win\r\n if (y-3+i>-1 && y-3+i<3 && c-3+i>-1 && c-3+i<4){\r\n diagonalTLBR4s[y-3+i][c-3+i]--;\r\n if (diagonalTLBR4s[y-3+i][c-3+i] == -4){\r\n winnerText.setText(\"RED WINS\");\r\n disableMoves();\r\n }\r\n }\r\n }\r\n \r\n for (int i = 0; i < 4; i++) { //check TRBL diag for black win\r\n if (y-3+i>-1 && y-3+i<3 && c+3-i>-1 && c+3-i < 4){\r\n diagonalTRBL4s[y-3+i][c+3-i]--;\r\n if (diagonalTRBL4s[y-3+i][c+3-i] == -4){\r\n winnerText.setText(\"RED WINS\");\r\n disableMoves();\r\n }\r\n }\r\n }\r\n \r\n \r\n }\r\n blackToPlay = !blackToPlay;\r\n currentFilled[c]++;\r\n if(currentFilled[c] == 6)\r\n moveSelect[c].setEnabled(false);\r\n }", "public void takeTurn() {\n world.updateLinkedList();\n repaint();\n }", "public void makeChanges() { \n for(int i = 1; i < 9; i++) {\n for(int j = 1; j < 11; j++) {\n if(!(controller.getBoard().getPiece(i, j) instanceof Forbidden)) {\n Cell[i][j].setBackground(Color.white);\n if(controller.getBoard().getPiece(i,j) != null) {\n if(controller.getPlayer(controller.getTurn()).getColour() != controller.getBoard().getPiece(i,j).getColour()) {\n if(controller.getTurn() == 1) {\n Cell[i][j].setIcon(new ImageIcon(\"pieces\\\\redHidden.png\"));\n Cell[i][j].setEnabled(false);\n } else {\n Cell[i][j].setIcon(new ImageIcon(\"pieces\\\\blueHidden.png\"));\n Cell[i][j].setEnabled(false);\n }\n } else {\n Cell[i][j].setIcon((controller.getBoard().getPiece(i, j).getIcon()));\n Cell[i][j].setEnabled(true);\n }\n if(controller.getBoard().getPiece(i,j) instanceof Trap || controller.getBoard().getPiece(i,j) instanceof Flag) {\n Cell[i][j].removeActionListener(handler);\n Cell[i][j].setEnabled(false);\n }\n } else {\n Cell[i][j].setBackground(Color.white);\n Cell[i][j].setEnabled(false);\n }\n }\n }\n }\n controller.setTurn(); \n }", "public void updateGame() \n\t{\n\t\tif (bet <= credit && bet <=500) // Verify that the bet is valid. \n\t\t{\n\t\t\tcredit = credit - bet; // Decrement the credit by the amount bet\n\t\t\tgamesPlayed++;\n\t\t\tif (ourWin == \"Royal Flush\")\n\t\t\t{\n\t\t\t\tgamesWon++;\t\t\t\t//Increment the amount of games won\n\t\t\t\tcurrentWin = 250 *bet; // Determine the current win\n\t\t\t\tcredit+= currentWin;\t// Add the winnings to the player's credit\n\t\t\t\twinnings+= currentWin;\t// Keep a tally of all the winnings to this point\n\t\t\t\tcreditValue.setText(String.valueOf(credit)); // Update the credit value.\n\t\t\t\tourWinLabel.setText(ourWin);\n\t\t\t}\n\t\t\telse if (ourWin == \"Straight Flush\")\n\t\t\t{\n\t\t\t\tgamesWon++;\n\t\t\t\tcurrentWin+= 50 * bet;\n\t\t\t\tcredit+= currentWin;\n\t\t\t\twinnings+= currentWin;\n\t\t\t\tcreditValue.setText(String.valueOf(credit));\n\t\t\t\tourWinLabel.setText(ourWin);\n\t\t\t}\n\t\t\telse if (ourWin == \"Four of a Kind\")\n\t\t\t{\n\t\t\t\tgamesWon++;\n\t\t\t\tcurrentWin+= 25 *bet;\n\t\t\t\tcredit+= currentWin;\n\t\t\t\twinnings+= currentWin;\n\t\t\t\tcreditValue.setText(String.valueOf(credit));\n\t\t\t\tourWinLabel.setText(ourWin);\n\t\t\t}\n\t\t\telse if (ourWin == \"Full House\")\n\t\t\t{\n\t\t\t\tgamesWon++;\n\t\t\t\tcurrentWin+= 9* bet;\n\t\t\t\tcredit+= currentWin;\n\t\t\t\twinnings+= currentWin;\n\t\t\t\tcreditValue.setText(String.valueOf(credit));\n\t\t\t\tourWinLabel.setText(ourWin);\n\t\t\t}\n\t\t\telse if (ourWin == \"Flush\")\n\t\t\t{\n\t\t\t\tgamesWon++;\n\t\t\t\tcurrentWin= 6 * bet;\n\t\t\t\tcredit+= currentWin;\n\t\t\t\twinnings+= currentWin;\n\t\t\t\tcreditValue.setText(String.valueOf(credit));\n\t\t\t\tourWinLabel.setText(ourWin);\n\t\t\t}\n\t\t\telse if (ourWin == \"Straight\")\n\t\t\t{\n\t\t\t\tgamesWon++;\n\t\t\t\tcurrentWin= 4* bet;\n\t\t\t\tcredit+= currentWin;\n\t\t\t\twinnings+= currentWin;\n\t\t\t\tcreditValue.setText(String.valueOf(credit));\n\t\t\t\tourWinLabel.setText(ourWin);\n\t\t\t}\n\t\t\telse if (ourWin == \"Three of a Kind\")\n\t\t\t{\n\t\t\t\tgamesWon++;\n\t\t\t\tcurrentWin= 3* bet;\n\t\t\t\tcredit+= currentWin;\n\t\t\t\twinnings+= currentWin;\n\t\t\t\tcreditValue.setText(String.valueOf(credit));\n\t\t\t\tourWinLabel.setText(ourWin);\n\t\t\t}\n\t\t\telse if (ourWin == \"Two Pair\")\n\t\t\t{\n\t\t\t\tgamesWon++;\n\t\t\t\tcurrentWin= 2* bet;\n\t\t\t\tcredit+= currentWin;\n\t\t\t\twinnings+= currentWin;\n\t\t\t\tcreditValue.setText(String.valueOf(credit));\n\t\t\t\tourWinLabel.setText(ourWin);\n\t\t\t}\n\t\t\telse if (ourWin == \"Jacks or Better\")\n\t\t\t{\n\t\t\t\tgamesWon++;\n\t\t\t\tcurrentWin= bet;\n\t\t\t\tcredit+= currentWin;\n\t\t\t\twinnings+= currentWin;\n\t\t\t\tcreditValue.setText(String.valueOf(credit));\n\t\t\t\tourWinLabel.setText(ourWin);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcreditValue.setText(String.valueOf(credit));\n\t\t\t\tgamesLost++;\n\t\t\t\tlosses+= bet;\n\t\t\t\tourWinLabel.setText(ourWin);\n\t\t\t}\n\t\t\t//Update the remaining statistics\n\t\t\tplayedValue.setText(String.valueOf(gamesPlayed));\n\t\t\twonValue.setText(String.valueOf(gamesWon));\n\t\t\tlostValue.setText(String.valueOf(gamesLost));\n\t\t\twinningsValue.setText(String.valueOf(winnings));\n\t\t\tlossesValue.setText(String.valueOf(losses));\n\t\t}\t\n\t}", "void updateBoard() {\r\n\t\tfor (int x = 0; x < length; x++) {\r\n\t\t\tfor (int y = 0; y < length; y++) {\r\n\t\t\t\tif (filled[x][y]) {\r\n\t\t\t\t\t// Draw filled square\r\n\t\t\t\t\tdouble rand = Math.random();\r\n\t\t\t\t\tColor use = new Color(0, 0, 0);\r\n\t\t\t\t\tif (rand < .25) {\r\n\t\t\t\t\t\tuse = a;\r\n\t\t\t\t\t} else if (rand < .50) {\r\n\t\t\t\t\t\tuse = b;\r\n\t\t\t\t\t} else if (rand < .75) {\r\n\t\t\t\t\t\tuse = c;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tuse = d;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tJSquare element = new JSquare(this.getWidth() / length, this.board.getHeight() / length, use, true);\r\n\t\t\t\t\telement.addMouseListener(this);\r\n\t\t\t\t\tboard.add(element);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Draw empty square\r\n\t\t\t\t\tJSquare element = new JSquare(this.getWidth() / length, this.board.getHeight() / length,\r\n\t\t\t\t\t\t\tnew Color(192, 192, 192), false);\r\n\t\t\t\t\telement.addMouseListener(this);\r\n\t\t\t\t\tboard.add(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void HandleOnChangeTurn(Board board, Piece turn){\n\t\tthis.turn = turn;\n\t\tif(multiview())decidesActivateBoard(turn);\n\t\tdecideMakeAutomaticMove();\n\t\tif(playerModes.get(turn)==PlayerMode.RANDOM)Utils.sleep(300);\n\t}", "private void updateAllTiles() {\r\n mEntireBoard.updateDrawableState();\r\n for (int large = 0; large < 9; large++) {\r\n mLargeTiles[large].updateDrawableState();\r\n for (int small = 0; small < 9; small++) {\r\n mSmallTiles[large][small].updateDrawableState();\r\n }\r\n }\r\n }", "private void updateALUTableScorboard() {\n\t\t// Get a copy of the memory stations\n\t\t// ALUStation[] temp_alu = alu_rs;\n\n\t\t// Update the table with current values for the stations\n\t\tfor (int i = 0; i < _lstFuStatusScorboard2.size(); i++) {\n\t\t\t// generate a meaningfull representation of busy\n\t\t\t// String busy_desc = (temp_alu[i].isBusy() ? \"Yes\" : \"No\" );\n\t\t\t// _FunctionUnitsModel.setColumnIdentifiers( new Object[]{\"Cycle\",\n\t\t\t// \"Name\",\"Busy\", \"Op\", \"Fi\", \"Fj\", \"Fk\", \"Qj\",\"Qk\",\"Rj\",\"Rk\"} );\n\n\t\t\t_FunctionUnitsModelScoreboard.setValueAt(_lstFuStatusScorboard2.get(i).getTime(), i, 0);\n\n\t\t\t_FunctionUnitsModelScoreboard.setValueAt(_lstFuStatusScorboard2.get(i).getFu_name(), i, 1);\n\t\t\t_FunctionUnitsModelScoreboard.setValueAt(_lstFuStatusScorboard2.get(i).getBusy(), i, 2);\n\t\t\t_FunctionUnitsModelScoreboard.setValueAt(_lstFuStatusScorboard2.get(i).getOp(), i, 3);\n\t\t\t_FunctionUnitsModelScoreboard.setValueAt(_lstFuStatusScorboard2.get(i).getFi(), i, 4);\n\t\t\t_FunctionUnitsModelScoreboard.setValueAt(_lstFuStatusScorboard2.get(i).getFj(), i, 5);\n\t\t\t_FunctionUnitsModelScoreboard.setValueAt(_lstFuStatusScorboard2.get(i).getFk(), i, 6);\n\t\t\t_FunctionUnitsModelScoreboard.setValueAt(_lstFuStatusScorboard2.get(i).getQj(), i, 7);\n\t\t\t_FunctionUnitsModelScoreboard.setValueAt(_lstFuStatusScorboard2.get(i).getQk(), i, 8);\n\t\t\t_FunctionUnitsModelScoreboard.setValueAt(_lstFuStatusScorboard2.get(i).getRj(), i, 9);\n\t\t\t_FunctionUnitsModelScoreboard.setValueAt(_lstFuStatusScorboard2.get(i).getRk(), i, 10);\n\t\t}\n\t}", "void notifyBoardChanged(List<Pit> changedPits);", "public void changeTurn()\r\n {\r\n isPlayersTurn = !isPlayersTurn;\r\n }", "public void setBoard(Board board) {\n this.board = board;\n }", "public void setBoard(Board board) {\n this.board = board;\n }", "public void newGame() {\n\n\n inGame = true;\n mines_left = mines+ePirate+mPirate+hPirate;\n\n all_cells = rows * cols;\n field = new int[all_cells];\n\n for (int i = 0; i < all_cells; i++)\n field[i] = COVER_FOR_CELL;\n\n statusbar.setText(Integer.toString(mines_left));\n\n // draw the board -- pass to the undo array\n drawBoard(mines) ; // now rocks\n drawBoard(ePirate) ;\n drawBoard(mPirate) ;\n drawBoard(hPirate) ;\n\n }", "public void update(GameModel model) {\n assert model.getRowCount() == this.rowCount && model.getColumnCount() == this.columnCount;\n //\n for (int row = 0; row < this.rowCount; row++){\n for (int column = 0; column < this.columnCount; column++){\n CellValue value = model.getCellValue(row, column);\n if (value == CellValue.WALL) {\n this.cellViews[row][column].setImage(this.wallImage);\n }\n else if (value == CellValue.PISTOLA) {\n this.cellViews[row][column].setImage(this.pistolaImage);\n }\n else if (value == CellValue.ALIENEGG) {\n this.cellViews[row][column].setImage(this.alienEggImage);\n }\n else {\n this.cellViews[row][column].setImage(null);\n }\n //verifique en qué dirección va astronauta y muestre la imagen correspondiente\n if (row == model.getAstronautaLocation().getX() && column == model.getAstronautaLocation().getY() && (GameModel.getLastDirection() == GameModel.Direction.RIGHT || GameModel.getLastDirection() == GameModel.Direction.NONE)) {\n this.cellViews[row][column].setImage(this.astronautaImage);\n }\n else if (row == model.getAstronautaLocation().getX() && column == model.getAstronautaLocation().getY() && GameModel.getLastDirection() == GameModel.Direction.LEFT) {\n this.cellViews[row][column].setImage(this.astronautaImage);\n }\n else if (row == model.getAstronautaLocation().getX() && column == model.getAstronautaLocation().getY() && GameModel.getLastDirection() == GameModel.Direction.UP) {\n this.cellViews[row][column].setImage(this.astronautaImage);\n }\n else if (row == model.getAstronautaLocation().getX() && column == model.getAstronautaLocation().getY() && GameModel.getLastDirection() == GameModel.Direction.DOWN) {\n this.cellViews[row][column].setImage(this.astronautaImage);\n }\n //hacer que los OVNIS \"parpadeen\" hacia el final de ovniEatingMode (mostrar imágenes OVNI regulares en actualizaciones alternas del contador)\n if (GameModel.isOvniEatingMode() && (Controller.getovniEatingModeCounter() == 6 ||Controller.getovniEatingModeCounter() == 4 || Controller.getovniEatingModeCounter() == 2)) {\n if (row == model.getOvniLocation().getX() && column == model.getOvniLocation().getY()) {\n this.cellViews[row][column].setImage(this.ovniImage);\n }\n if (row == model.getOvni2Location().getX() && column == model.getOvni2Location().getY()) {\n this.cellViews[row][column].setImage(this.ovni2Image);\n }\n }\n //mostrar OVNIS azules en ovniEatingMode\n else if (GameModel.isOvniEatingMode()) {\n if (row == model.getOvniLocation().getX() && column == model.getOvniLocation().getY()) {\n this.cellViews[row][column].setImage(this.ovnidestructibleImage);\n }\n if (row == model.getOvni2Location().getX() && column == model.getOvni2Location().getY()) {\n this.cellViews[row][column].setImage(this.ovnidestructibleImage);\n }\n }\n //display imágenes OVNIS regulares de lo contrario\n else {\n if (row == model.getOvniLocation().getX() && column == model.getOvniLocation().getY()) {\n this.cellViews[row][column].setImage(this.ovniImage);\n }\n if (row == model.getOvni2Location().getX() && column == model.getOvni2Location().getY()) {\n this.cellViews[row][column].setImage(this.ovni2Image);\n }\n }\n }\n }\n }", "void update() {\n matrix();\n }", "private void updateGame(int roundWinner) {\n\n\t\t// War cards get face down\n\t\tif (game.getWarring() == 2) {\n\t\t\tcpuStack.setIcon(new ImageIcon(Card.CARD_DOWN));\n\t\t\tplayerStack.setIcon(new ImageIcon(Card.CARD_DOWN));\n\t\t\tgame.clearWar();\n\t\t} else if (game.getWarring() == 1)\n\t\t\tgame.nextDown(); // next one is down, current battle triggered a war\n\t\telse {\n\n\t\t\tcpuStack.setIcon(new ImageIcon(game.getCardImage(War.CPU)));\n\t\t\tplayerStack.setIcon(new ImageIcon(game.getCardImage(War.PLAYER)));\n\t\t}\n\t\tif (roundWinner == War.TIE_FLAG) {\n\t\t\tstatus.setText(\"Tie Game!\");\n\t\t\tplayerDeck.setEnabled(false);\n\t\t} else if (roundWinner == War.WAR_FLAG)\n\t\t\tstatus.setText(\"War!\");\n\t\telse if (game.gameWinner() != null) {\n\t\t\tif (game.cpuScore() > game.playerScore())\n\t\t\t\tstatus.setText(\"CPU Wins!\");\n\t\t\telse\n\t\t\t\tstatus.setText(\"You Win!\");\n\t\t\tplayerDeck.setEnabled(false);\n\t\t} else {\n\t\t\tif (roundWinner == War.CPU)\n\t\t\t\tstatus.setText(\"CPU \" + \"wins the round!\");\n\t\t\telse\n\t\t\t\tstatus.setText(\"Player \" + \"wins the round!\");\n\n\t\t}\n\t\tcpuScore.setText(game.getCPUScore());\n\t\tplayerScore.setText(game.getPlayerScore());\n\t\tupdateDecks();\n\t}", "@Override\r\n\tpublic boolean movement(BoardCells[][] chessBoard, Piece targetPiece, int fromX,int fromY,int toX,int toY) {\t\t\r\n\t\t//DEBUG -- System.out.println(\"\"+fromX+fromY+\" \"+toX+toY);\r\n\t\t\r\n\t\tif(fromY == toY){\t\t\t\r\n\t\t\tif(fromX > toX) {\r\n\t\t\t\tfor(int i = fromX-1; i>toX; i--) {\r\n\t\t\t\t\tif(chessBoard[8-fromY][i].getPiece() != null) {\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn false;\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\r\n\t\t\t} else if (fromX < toX) {\r\n\t\t\t\tfor(int i = fromX+1; i<toX; i++) {\r\n\t\t\t\t\tif(chessBoard[8-fromY][i].getPiece() != null) {\t\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn false;\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\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(getPieceID().equals(\"bR\")) {\r\n\t\t\t\tfor(int i = 0; i<9 ;i++) {\r\n\t\t\t\t\tfor (int j = 0; j<9; j++){\r\n\t\t\t\t\t\tif(chessBoard[8-i][j].getPiece() != null) {\r\n\t\t\t\t\t\tif(chessBoard[8-i][j].getPiece().getPieceID().equals(\"bKc\")) {\r\n\t\t\t\t\t\t\t//Piece king = chessBoard[8-i][j].getPiece();\t\t\t\t\t\r\n\t\t\t\t\t\t\t//DEBUG -- System.out.println(king.getPieceID()+color+\" \"+king );\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tchessBoard[8-i][j].getPiece().setPieceID(\"bK\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(getPieceID().equals(\"wR\")) {\r\n\t\t\t\tfor(int i = 0; i<9 ;i++) {\r\n\t\t\t\t\tfor (int j = 0; j<9; j++){\r\n\t\t\t\t\t\tif(chessBoard[8-i][j].getPiece() != null) {\r\n\t\t\t\t\t\tif(chessBoard[8-i][j].getPiece().getPieceID().equals(\"wKc\")) {\r\n\t\t\t\t\t\t\t//Piece king = chessBoard[8-i][j].getPiece();\t\t\t\t\t\r\n\t\t\t\t\t\t\t//DEBUG -- System.out.println(king.getPieceID()+color+\" \"+king );\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tchessBoard[8-i][j].getPiece().setPieceID(\"wK\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\tif(fromX == toX) {\t\t\t\t\r\n\t\t\tif(fromY > toY) {\t\r\n\t\t\t\tfor(int i = fromY-1; i>toY; i--) {\r\n\t\t\t\t\tif(chessBoard[8-i][toX].getPiece() != null) {\t\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn false;\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\t\r\n\t\t\t\t\r\n\t\t\t} else if (fromY < toY) {\t\t\t\t\r\n\t\t\t\tfor(int i = fromY+1; i<toY; i++) {\t\t\t\t\t\r\n\t\t\t\t\tif(chessBoard[8-i][toX].getPiece() != null) {\t\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn false;\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\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(getPieceID().equals(\"bR\")) {\r\n\t\t\t\t\tfor(int i = 0; i<9 ;i++) {\r\n\t\t\t\t\t\tfor (int j = 0; j<9; j++){\r\n\t\t\t\t\t\t\tif(chessBoard[8-i][j].getPiece() != null) {\r\n\t\t\t\t\t\t\tif(chessBoard[8-i][j].getPiece().getPieceID().equals(\"bKc\")) {\r\n\t\t\t\t\t\t\t\t//Piece king = chessBoard[8-i][j].getPiece();\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//DEBUG -- System.out.println(king.getPieceID()+color+\" \"+king );\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tchessBoard[8-i][j].getPiece().setPieceID(\"bK\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(getPieceID().equals(\"wR\")) {\r\n\t\t\t\t\tfor(int i = 0; i<9 ;i++) {\r\n\t\t\t\t\t\tfor (int j = 0; j<9; j++){\r\n\t\t\t\t\t\t\tif(chessBoard[8-i][j].getPiece() != null) {\r\n\t\t\t\t\t\t\tif(chessBoard[8-i][j].getPiece().getPieceID().equals(\"wKc\")) {\r\n\t\t\t\t\t\t\t\t//Piece king = chessBoard[8-i][j].getPiece();\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//DEBUG -- System.out.println(king.getPieceID()+color+\" \"+king );\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tchessBoard[8-i][j].getPiece().setPieceID(\"wK\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\r\n\t\t\treturn true;\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\treturn false;\t\t\r\n\t}", "public void draw() {\n mGameBoard.draw();\n }" ]
[ "0.78351116", "0.7488738", "0.72081333", "0.71098584", "0.6866799", "0.6857154", "0.68509626", "0.6792757", "0.6787306", "0.67726076", "0.6762991", "0.6689983", "0.66698945", "0.6643316", "0.66027546", "0.6600918", "0.6553403", "0.6550737", "0.6534703", "0.6533551", "0.65288556", "0.64970034", "0.6480643", "0.6461634", "0.6443966", "0.6429875", "0.63760185", "0.63517594", "0.63374424", "0.6326328", "0.63217705", "0.6315671", "0.6280581", "0.6271807", "0.626263", "0.62611", "0.62549436", "0.623268", "0.6221756", "0.62208945", "0.6218599", "0.6203671", "0.61761016", "0.61718386", "0.6168487", "0.616787", "0.61654234", "0.6160411", "0.6145862", "0.61341876", "0.61319935", "0.6131841", "0.6128855", "0.6117393", "0.61022794", "0.6094203", "0.6089213", "0.6087972", "0.6087759", "0.6062877", "0.6061019", "0.60503983", "0.60492957", "0.60473055", "0.604134", "0.60354555", "0.6032751", "0.6030464", "0.60201246", "0.6007737", "0.6002789", "0.59969825", "0.5977729", "0.5976231", "0.59604615", "0.5958022", "0.59520274", "0.5937385", "0.5932761", "0.593145", "0.5931148", "0.59306306", "0.5917372", "0.5917036", "0.59126395", "0.5910425", "0.59040934", "0.58986086", "0.5891153", "0.58890563", "0.58764535", "0.58763295", "0.5873776", "0.5873776", "0.5866802", "0.5863218", "0.58604544", "0.5860339", "0.5859555", "0.58593076" ]
0.73173213
2
Returns the game board
public int[][] getBoard() { return board; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int[][] getBoard();", "String getBoard();", "private Board getBoard() {\n return gameStatus.getBoard();\n }", "public Board getBoard()\r\n {\r\n return gameBoard;\r\n }", "public Board getBoard() {\n return gameBoard;\n }", "private void getBoard() {\n gameBoard = BoardFactory.makeBoard();\n }", "public List<GameBoard> getBoardList() {\r\n return new ArrayList<GameBoard>(this.boards);\r\n }", "public GameBoard getBoard() {\n return board;\n }", "public static char[][] getBoard() {\n\t\treturn board;\n\t}", "public String getBoard() {\r\n\t\tString r = \"\";\r\n\t\tfor (int y = 0; y < 3; y++) {\r\n\t\t\tfor (int x = 0; x < 3; x++) {\r\n\t\t\t\tr = r + board[y][x];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn r;\r\n\t}", "public Integer[][] getBoard() {\n\t\treturn _board;\n\t}", "public Board getBoard ();", "public Tile[][] getBoard() {\r\n return board;\r\n }", "public int[][] getBoard() {\n\t\treturn board;\n\t}", "public static WildBoard getBoard()\n {\n System.out.println(\"*** WildApp.getBoard() called\");\n \n return myBoard;\n }", "public FloorTile[][] getBoard(){\r\n return board;\r\n }", "public Board getBoard() {\n\t\treturn (this.gameBoard);\n\t}", "public static Board getBoard(){\n\t\treturn board;\n\t}", "public int[] getBoard() {\n\t return board;\n }", "public Piece[][] getBoard(){\r\n\t\treturn this.board;\r\n\t}", "public static GameBoard getGame(){\n\t\t\treturn gameBoard;\n\t\t}", "public int[][] get() {\r\n return gameBoard;\r\n }", "public Piece[][] getBoard() {\n return _board;\n }", "public GameCell[] getBoardCells(){\r\n return this.boardCells;\r\n }", "public char[][] getBoard() {\n return board;\n\t}", "String[][] getBoard();", "public int[] getBoard() {\n return board.clone(); //return board.clone();\n }", "public GameToken[][] getBoard() {\n\t\treturn this.board;\n\t}", "public boolean[][] getBoard() {\r\n return board;\r\n }", "public BoardInterface[] getBoards();", "protected int[][] getBoard() {\n\t// EDIT: usar directamente .clone() referencia al mismo objeto, para\n\t// reutilizar el método en las rotaciones copiamos la matriz de forma\n\t// que no se referencien entre sí.\n\treturn deepCopy(board);\n }", "public Board getBoard() {\r\n return board;\r\n }", "public Board getBoard() {\n return board;\n }", "public Board getBoard() {\n return board;\n }", "public Piece[] getBoard() {\n return board;\n }", "public Board getBoard() {\n return this.board;\n }", "public Board getBoard() {\n return this.board;\n }", "public Integer[][] GetCurrentBoard()\n {\n return new Integer[2][3];\n }", "public Board getOpponentsBoard() {\n return opponentsBoard;\n }", "public BlockFor2048[][] getBoard() {\n\t\treturn this.myBoard;\n\t}", "public static int[][] createBoard() {\r\n\t\t\r\n\t\tint[][] board = new int [8][8];\r\n\t\t//printing the red solduers\r\n\t\tfor (int line =0,column=0;line<3;line=line+1){\r\n\t\t\tif (line%2==0){column=0;}\r\n\t\t\telse {column=1;}\r\n\t\t\tfor (;column<8;column=column+2){\r\n\t\t\t\tboard [line][column] = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//printing the blu solduers\r\n\t\tfor (int line =5,column=0;line<8;line=line+1){\r\n\t\t\tif (line%2==0){column=0;}\r\n\t\t\telse {column=1;}\r\n\t\t\tfor (;column<8;column=column+2){\r\n\t\t\t\tboard [line][column] = -1;\r\n\t\t\t}\r\n\t\t}\t\t\t\r\n\t\treturn board;\r\n\t}", "ArrayList<ArrayList<GamePiece>> makeBoard() {\n ArrayList<ArrayList<GamePiece>> row = new ArrayList<ArrayList<GamePiece>>();\n for (int i = 0; i < this.width; i++) {\n ArrayList<GamePiece> column = new ArrayList<GamePiece>();\n for (int j = 0; j < this.height; j++) {\n GamePiece temp = new GamePiece(i, j);\n column.add(temp);\n nodes.add(temp);\n }\n row.add(column);\n }\n return row;\n }", "protected Board getBoard() { // nao vou deixar public, vou deixar privado\n\t\treturn board;\n\t}", "public Board getBoard() {\n\t\treturn this.board;\n\t}", "@Override\n\tpublic List<Map> boardList() {\n\t\treturn dao.boardList(session);\n\t}", "public Board getPlayersBoard() {\n return playersBoard;\n }", "public Marker[][] getBoard() { return board; }", "public Board getBoard() {\n\t\treturn board;\n\t}", "public Board getBoard() {\n\t\treturn board;\n\t}", "public Board aiGetBoard() {\n return b;\n }", "Board getBoard() {\r\n return _board;\r\n }", "public BoardView getActiveBoard() {\n if (activePlayer == Piece.COLOR.RED)\n return getRedBoard();\n else\n return getWhiteBoard();\n }", "private void generateBoard(){\n\t}", "public GUIBoard getBoard() {\n return board;\n }", "public char[][] getBoardState(){\n\t\treturn board;\n\t}", "public static void printBoard() {\n int separatorLen = 67;\n StringBuilder boardString = new StringBuilder();\n boardString.append(new String(new char [separatorLen]).replace(\"\\0\",\"*\"));\n boardString.append(\"\\n\");\n for(int y = Y_UPPER_BOUND - 1; y >= 0; y--)\n {\n boardString.append(y + 1).append(\" \");\n boardString.append(\"*\");\n for (int x = 0; x < X_UPPER_BOUND; x++)\n {\n Piece p = Board.board[x + y * X_UPPER_BOUND];\n if(p != null)\n {\n boardString.append(\" \").append(p).append(p.getColor()? \"-B\":\"-W\").append(\" \").append((p.toString().length() == 1? \" \":\"\"));\n }\n else\n {\n boardString.append(\" \");\n }\n boardString.append(\"*\");\n }\n boardString.append(\"\\n\").append((new String(new char [separatorLen]).replace(\"\\0\",\"*\"))).append(\"\\n\");\n }\n boardString.append(\" \");\n for(char c = 'A'; c <= 'H';c++ )\n {\n boardString.append(\"* \").append(c).append(\" \");\n }\n boardString.append(\"*\\n\");\n System.out.println(boardString);\n }", "public char[][] getBoardState(){\n return board;\n }", "public GoPlayingBoard getCurrentBoard() {\n \t\treturn currentBoard.clone();\n \t}", "public Pawn[][] getBoardGrid() {\n\t\treturn boardGrid;\n\t}", "String getBoardString();", "String drawBoard();", "public String toString() {\n\t\t// Variables\n\t\tString gameboard;\n\t\tchar[] firstLetter = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O' };\n\n\t\t// Top\n\t\tgameboard = \" ===============================================================\\n\";\n\n\t\t// Middle\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\t// Beginning of the line\n\t\t\tgameboard += \" \" + firstLetter[i] + \" ||\";\n\n\t\t\t// Letters\n\t\t\tfor (int j = 0; j < 15; j++) {\n\t\t\t\tif (this.grid[i][j].getTile().getLetter() == Character.MIN_VALUE) {\n\t\t\t\t\tif (this.grid[i][j].getScoreMult() > 1)\n\t\t\t\t\t\tgameboard += \" * \";\n\t\t\t\t\telse\n\t\t\t\t\t\tgameboard += \" . \";\n\t\t\t\t} else {\n\t\t\t\t\tgameboard += \" \" + this.grid[i][j].getTile().getLetter() + \" \";\n\t\t\t\t}\n\t\t\t\tif (j != 14)\n\t\t\t\t\tgameboard += '|';\n\t\t\t}\n\n\t\t\t// End of the line\n\t\t\tgameboard += \"||\\n\";\n\t\t\tif (i != 14)\n\t\t\t\tgameboard += \" ||---|---|---|---|---|---|---|---|---|---|---|---|---|---|---||\\n\";\n\t\t}\n\n\t\t// Bottom\n\t\tgameboard += \" ===============================================================\\n\";\n\t\tgameboard += \" 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\";\n\n\t\treturn gameboard;\n\t}", "private CurrentBoard board() throws IOException, EncodeException {\n\n //obtain current board state to init POJO\n boolean[][] player = new boolean[model.BOARD_SIZE][model.BOARD_SIZE];\n boolean[][] occupied = new boolean[model.BOARD_SIZE][model.BOARD_SIZE];\n boolean[][] king = new boolean[model.BOARD_SIZE][model.BOARD_SIZE];\n for(int row = 0; row < model.getBoard().length; row++){\n for(int col = 0; col < model.getBoard()[row].length; col++) {\n player[row][col] = model.isPlayerOne(row, col);\n occupied[row][col] = model.squareIsOccupied(row, col);\n king[row][col] = model.squareHoldsKing(row,col);\n }\n }\n currentBoard.setDoubleJump(model.canDoubleJump);\n currentBoard.setPlayerOne(player);\n currentBoard.setKing(king);\n currentBoard.setOccupied(occupied);\n return currentBoard;\n }", "public Board getCurrentBoard() {\n return boardIterator.board;\n }", "public Board getBoard(){\n return m_board;\n }", "public SudokuBoard getBoard() {\n return sb;\n }", "Board getBoard() {\n return _board;\n }", "public static SquareBoard getFullBoard() {\n\n\t\tSquareBoard fullBoard = new SquareBoard(BOARD_SIZE);\n\t\t\n\t\tfor (int ctr = 0; ctr < (BOARD_SIZE * BOARD_SIZE); ctr++) {\n\t\t\tfullBoard.getSpaceByIndex(ctr).setPiece(\n\t\t\t\t\tnew BasicPieceHelper(String.valueOf(ctr), null));\n\t\t}\n\t\t\n\t\treturn fullBoard;\n\t}", "public GameBoard getBoard(int i, int j) {\n return board[i][j];\n }", "public FourBoard getBoard() {\n return board;\n }", "public ArrayList<Integer> getCurBoard() {\n return curBoard;\n }", "public WorldImage drawBoard() {\r\n return new OverlayOffsetAlign(\"center\", \"bottom\",\r\n new TextImage(\"Flood-It!\", Cnst.textHeight, Color.BLUE),\r\n 0, Cnst.boardHeight + Cnst.scale,\r\n new AboveAlignImage(\"center\",\r\n new TextImage(\"Turn Count: \" + Integer.toString(this.currTurn) + \"/\"\r\n + Integer.toString(this.maxTurn), Cnst.textHeight, Color.BLACK),\r\n this.indexHelp(0,0).drawBoard(this.blocks)).movePinhole(0, (Cnst.scale * 7) / 2)\r\n ).movePinhole(0, (Cnst.scale * 76) / 10)\r\n .movePinhole(-Cnst.boardWidth / 2, -Cnst.boardHeight / 2);\r\n }", "public Gameboard() {\n\n\t\tturn = 0;\n\n\t\tboard = new Cell[4][4][4];\n\n\t\tfor (int i = 0; i < board.length; i++) {\n\t\t\tfor (int j = 0; j < board.length; j++) {\n\t\t\t\tfor (int k = 0; k < board.length; k++) {\n\n\t\t\t\t\tboard[i][j][k] = Cell.E;\n\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public SudokuBoard getBoard() {\n return board;\n }", "public void showGameBoard() {\n for (int row = 0; row < BOARD_SIZE; row++) {\n for (int col = 0; col < BOARD_SIZE; col++) {\n System.out\n .printf(\"%3d\", playingBoard[row][col].getMoveNumber());\n if (col == BOARD_SIZE - 1) {\n System.out.println();\n }\n }\n }\n }", "public String drawBoard() {\n fillBoard();\n return \"\\n\" +\n \" \" + boardArray[0][0] + \" | \" + boardArray[0][1] + \" | \" + boardArray[0][2] + \" \\n\" +\n \"------------\\n\" +\n \" \" + boardArray[1][0] + \" | \" + boardArray[1][1] + \" | \" + boardArray[1][2] + \" \\n\" +\n \"------------\\n\" +\n \" \" + boardArray[2][0] + \" | \" + boardArray[2][1] + \" | \" + boardArray[2][2] + \" \\n\";\n }", "@Override\r\n\tpublic ArrayList<BoardVO> getBoardList() {\n\t\treturn boardDao.getBoardList();\r\n\t}", "public List<Building> getBoardBuildings() {\n return mPersonalBoardCards.getBoardBuildings();\n }", "public GraphicalBoard getGraphicalBoard() {\n\treturn gb;\n }", "public Board getBoardObject() {\n return boardObject;\n }", "public Board getBoard(){\n return board;\n }", "public String[][] getBoard() {\n ArrayList<Point<Integer,Integer>> bomb_positions = new ArrayList<>(this.NUMBOMBS);\n\n int size=0;\n while ( size < this.NUMBOMBS) {\n int x=(int)Math.floor(Math.random()*this.SIZE);\n int y=(int)Math.floor(Math.random()*this.SIZE);\n if (!bomb_positions.contains(new Point<>(x,y))) {\n bomb_positions.add(new Point<>(x,y));\n size++;\n }\n }\n // [ , , , ]\n // [ ,cnrXY, , ]\n // [ , ,Bomb, ]\n // [ , , , ]\n for (Point<Integer,Integer> bomb:\n bomb_positions) {\n int cornerX = bomb.getX()-1;\n int cornerY= bomb.getY()-1;\n for (int i = cornerX; i < cornerX+3 ; i++) {\n for (int j = cornerY; j < cornerY+3; j++) {\n if(i>=0 && i<SIZE && j>=0 && j< SIZE){\n if ((new Point<>(i,j)).equals(bomb)){\n board[i][j]=\"B\";\n }else {\n if (!board[i][j].equals(\"B\") && board[i][j].equals(\" \")){\n board[i][j] = \"1\";\n }else if (!board[i][j].equals(\"B\") && !board[i][j].equals(\" \")){\n int n = Integer.parseInt(board[i][j]);\n n=n+1;\n board[i][j] = String.valueOf(n);\n }\n }\n\n }\n }\n }\n }\n return board;\n }", "public void getBoard(int r, int c, String a){\n \n if (a == \"x\"){\n board[r-1][c-1] = 'X';\n }\n else if (a == \"o\"){\n board[r-1][c-1] = 'O';\n }\n \n int x = 1;\n System.out.println(\" 1 2 3 \");\n for (int i = 0; i < board.length; i++){\n System.out.println(\" | | \");\n for (int j = 0; j < board[i].length; j++){\n System.out.print(\" \" + board[i][j] + \" \");\n }\n System.out.println();\n System.out.println(x +\"------------------------\");\n x = x + 1;\n } \n checkWinner(); // Check if someone has won.\n \n }", "@Override\n public String toString() {\n String returnBoard = \" \";\n for (int i = 1; i <= 3; i++) {\n returnBoard=returnBoard+\" \" +Integer.toString(i);\n }\n returnBoard+=\"\\n\";\n for (int i = 1; i <= 3; i++) {\n returnBoard+= Integer.toString(i);\n for (int j = 1; j <= 3; j++) {\n returnBoard = returnBoard + \" \" + board[i-1][j-1].toString();\n }\n returnBoard+=\"\\n\";\n }\n return returnBoard;\n }", "public char[][] getBoard(Connection c) {\n Statement stmt = null;\n ResultSet rs = null;\n char[][] board = new char[4][3];\n \n try {\n c.setAutoCommit(false);\n System.out.println(\"Database opened successfully\");\n \n stmt = c.createStatement();\n String sql = \"SELECT * FROM GAMEBOARD;\";\n rs = stmt.executeQuery(sql);\n if (!rs.next()) {\n return null;\n }\n int id = rs.getInt(\"PLAYER_ID\");\n int x = rs.getInt(\"COORD_X\");\n int y = rs.getInt(\"COORD_Y\");\n char type = rs.getString(\"PLAYER_TYPE\").charAt(0);\n board[x][y] = type;\n if (id == 1) {\n board[3][0] = type;\n }\n\n while (rs.next()) {\n id = rs.getInt(\"PLAYER_ID\");\n x = rs.getInt(\"COORD_X\");\n y = rs.getInt(\"COORD_Y\");\n type = rs.getString(\"PLAYER_TYPE\").charAt(0);\n board[x][y] = type;\n if (id == 1) {\n board[3][0] = type;\n }\n }\n } catch (Exception e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n return null;\n } finally {\n if (stmt != null) {\n try {\n stmt.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n if (rs != null) {\n try {\n rs.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n }\n \n System.out.println(\"Get Board Succeed.\");\n return board;\n }", "private void renderBoard() {\n Cell[][] cells = gameBoard.getCells();\n StringBuilder battleField = new StringBuilder(\"\\tA B C D E F G H I J \\n\");\n\n for (int i = 0; i < cells.length; i++) {\n battleField.append(i+1).append(\"\\t\");\n for (int j = 0; j < cells[i].length; j++) {\n if (cells[i][j].getContent().equals(Content.deck)) {\n battleField.append(\"O \");\n } else {\n battleField.append(\"~ \");\n }\n }\n battleField.append(\"\\n\");\n }\n\n System.out.println(battleField.toString());\n }", "public GoLCell[][] getCellArray() {\n return gameBoard;\n }", "public void displayBoard(){\r\n System.out.println(board.toString());\r\n }", "public int evalBoard(){\n if (wins('o')){\n return 3;\n }\n // Return 0 if human wins\n else if (wins('b')){\n return 0;\n }\n //Return 2 if game is draw\n else if (isDraw()){\n return 2;\n }\n // Game is not a draw and no player has won. Game is still undecided.\n else {\n return 1;\n }\n }", "String displayMyBoard();", "void displayBoard();", "public String showBoard() {\n return name + \"\\r\\n\" + myBoard.displayMyBoard() + \"\\r\\n\" + opponentsBoard.displayShotsTaken();\n }", "public Board getBoard(){return board;}", "public int getBorders() {\n for (int row = 0; row < board.length; row++)\n for (int col = 0; col < board.length; col++) {\n\n // left-border (excluding corners - check 3 sides only)\n if (row != 0 && row != board.length - 1 && col == 0) {\n if (board[row - 1][col] != null && board[row][col + 1] !=\n null && board[row + 1][col] != null)\n if (board[row - 1][col].getPlayerNumber() == board[row][col + 1].getPlayerNumber()\n && board[row - 1][col].getPlayerNumber() == board[row + 1][col].getPlayerNumber() &&\n board[row][col + 1].getPlayerNumber() != board[row][col].getPlayerNumber())\n return board[row][col + 1].getPlayerNumber();\n }\n\n // right-border (excluding corners - check 3 sides only)\n if (row != 0 && row != board.length - 1 && col == board.length - 1) {\n if (board[row - 1][col] != null && board[row][col - 1] !=\n null && board[row + 1][col] != null)\n if (board[row - 1][col].getPlayerNumber() == board[row][col - 1].getPlayerNumber()\n && board[row - 1][col].getPlayerNumber() == board[row + 1][col].getPlayerNumber() &&\n board[row][col - 1].getPlayerNumber() != board[row][col].getPlayerNumber())\n return board[row][col - 1].getPlayerNumber();\n }\n\n // top-border (excluding corners - check 3 sides only)\n if (col != 0 && col != board.length - 1 && row == 0) {\n if (board[row][col - 1] != null && board[row][col + 1] !=\n null && board[row + 1][col] != null)\n if (board[row][col - 1].getPlayerNumber() == board[row][col + 1].getPlayerNumber()\n && board[row + 1][col].getPlayerNumber() == board[row][col - 1].getPlayerNumber() &&\n board[row][col - 1].getPlayerNumber() != board[row][col].getPlayerNumber())\n return board[row][col - 1].getPlayerNumber();\n }\n\n // bottom-border (excluding corners - check 3 sides only)\n if (col != 0 && col != board.length - 1 && row == board.length - 1) {\n if (board[row][col - 1] != null && board[row][col + 1] !=\n null && board[row - 1][col] != null)\n if (board[row][col - 1].getPlayerNumber() == board[row][col + 1].getPlayerNumber()\n && board[row - 1][col].getPlayerNumber() == board[row][col - 1].getPlayerNumber() &&\n board[row][col - 1].getPlayerNumber() != board[row][col].getPlayerNumber())\n return board[row][col - 1].getPlayerNumber();\n }\n\n }\n return -1;\n }", "Data<List<Boards>> getBoards();", "@Override\n public BlockGrid getBoard() {\n return checkersBoard;\n }", "public static int[][] createBoard() {\r\n\r\n\t\tint[][] board = new int[9][9];\r\n\t\tfor (int i = 0; i < 9; i++) {\r\n\t\t\tfor (int j = 0; j < 9; j++)\r\n\t\t\t\tboard[i][j] = scan.nextInt();\r\n\t\t}\r\n\t\treturn board;\r\n\r\n\t}", "public static Draw getRunningDrawBoard() {\r\n\t\tif (STATUS.equals(Gamestatus.RUNNING)) {\r\n\t\t\tGameplayMenu menu = (GameplayMenu) gui.getCurrentMenu();\r\n\t\t\treturn menu.getDrawBoard();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public String toString(){\n\t\tString board = \"\";\n\t\tfor(int i = 0; i < rows; i++){\n\t\t\tfor(int j = 0; j < columns; j++){\n\t\t\t\tif(theGrid[i][j]){ //iterate through, if cell is alive, mark with *\n\t\t\t\t\tboard += \"*\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tboard += \" \"; //else, [space]\n\t\t\t\t}\n\t\t\t}\n\t\t\tboard += \"\\n\";//create a new line, to create the board\n\t\t}\n\t\treturn board; //return the board\n\t}", "public String getSlackRepresentationOfBoard() {\n String boardBorders[] = {\"```| \",\n \" | \",\n \" | \",\n \" |\\n|---+---+---|\\n| \",\n \" | \",\n \" | \",\n \" |\\n|---+---+---|\\n| \",\n \" | \",\n \" | \",\n \" |```\"};\n int boardBordersIndex = 0;\n StringBuilder boardString = new StringBuilder();\n for(int row = 0; row < BOARD_SIZE; row ++ ){\n for(int col = 0; col <BOARD_SIZE; col ++ ){\n boardString.append( boardBorders[boardBordersIndex] );\n boardString.append( getTokenAsCharFromBoardPosition(row, col, boardBordersIndex+1));\n boardBordersIndex++;\n }\n }\n boardString.append( boardBorders[boardBordersIndex] );\n return boardString.toString();\n }" ]
[ "0.77928126", "0.77089083", "0.76961184", "0.7691085", "0.7641054", "0.7639658", "0.75214773", "0.74758947", "0.7474971", "0.7466634", "0.7451774", "0.73883945", "0.7370452", "0.7360929", "0.7349188", "0.7343648", "0.73391646", "0.73272", "0.7308599", "0.72924834", "0.72888124", "0.72829217", "0.7281516", "0.72361726", "0.72167057", "0.720824", "0.7207856", "0.71967584", "0.71907544", "0.7171494", "0.71507585", "0.7138223", "0.7131299", "0.71147054", "0.7111577", "0.71085984", "0.71085984", "0.7098475", "0.7093547", "0.7076043", "0.7063036", "0.70207936", "0.6975808", "0.6909166", "0.69062483", "0.6904043", "0.6884328", "0.6865972", "0.6865972", "0.6834317", "0.68231326", "0.6820421", "0.68033046", "0.68011856", "0.67678887", "0.67653805", "0.6755863", "0.6751195", "0.6743907", "0.6735435", "0.67348886", "0.67335826", "0.6733315", "0.6731031", "0.67201483", "0.6715062", "0.67149657", "0.6708465", "0.6695937", "0.6674536", "0.6654199", "0.6653326", "0.66445094", "0.66434646", "0.6624474", "0.6623019", "0.6620014", "0.66125125", "0.65962243", "0.65932643", "0.6579893", "0.6575042", "0.654965", "0.65485907", "0.65407395", "0.6538337", "0.6524539", "0.65078735", "0.6499787", "0.6477283", "0.64766777", "0.6474879", "0.64727587", "0.64703196", "0.6469959", "0.64628106", "0.64619625", "0.6449544", "0.64426064", "0.6436574" ]
0.7387638
12
Prompts the user to enter the number of players that will be playing on the server
public int getNoOfPlayers() { String noOfPlayers = JOptionPane.showInputDialog(null, "Please enter the number of players from 1-6", "Number of Players", JOptionPane.INFORMATION_MESSAGE); //Check to see if the entry was invalid while(!isNumber(noOfPlayers) || Integer.parseInt(noOfPlayers) < 1 || Integer.parseInt(noOfPlayers) > 6) { if(!isNumber(noOfPlayers)) noOfPlayers = JOptionPane.showInputDialog(null, "You must enter a NUMBER. Please re-enter the number of players from 1-6", "NUMBER of Players", JOptionPane.INFORMATION_MESSAGE); else noOfPlayers = JOptionPane.showInputDialog(null, "Please re-enter the number of players from 1-6", "Players must be between 1 and 6", JOptionPane.INFORMATION_MESSAGE); } return Integer.parseInt(noOfPlayers); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int promptNumPlayers() {\r\n Object[] options = {1, 2, 3, 4};\r\n int numPlr = (int) JOptionPane.showInputDialog(\r\n null,\r\n \"How many people are playing?\",\r\n \"Welcome!\",\r\n JOptionPane.PLAIN_MESSAGE,\r\n null,\r\n options,\r\n 1);\r\n\r\n players = new Player[numPlr];\r\n\r\n for (int i = 0; i < numPlr; i++) {\r\n players[i] = new Player();\r\n }\r\n\r\n return numPlr;\r\n }", "private void getNumPlayers() {\n\t\tSystem.out.println(\"How many people are playing? (must be between \"+MIN_PLAYERS+\" and \"+MAX_PLAYERS+\")\");\n\t\tnumPlayers = GetInput.getInstance().anInteger(MIN_PLAYERS, MAX_PLAYERS);\n\t}", "public void NumberOfPlayers()\r\n {\r\n Input=JOptionPane.showInputDialog(\"Type the number of players\", JOptionPane.YES_NO_OPTION);\r\n \r\n SecondInput = JOptionPane.showInputDialog(\"How many of those \"+ Input +\" players will be AI ?\", JOptionPane.YES_NO_OPTION);\r\n \r\n while(Converter(SecondInput) >= Converter(Input))\r\n {\r\n if(Converter(SecondInput) >= Converter(Input))\r\n {\r\n JOptionPane.showMessageDialog(this,\"AI players can't be equal or more than the original number of players!\",\r\n \"ERROR\",\r\n JOptionPane.ERROR_MESSAGE);\r\n\r\n SecondInput = JOptionPane.showInputDialog(\"How many of those \"+ Input +\" players will be AI ?\", JOptionPane.YES_NO_OPTION);\r\n }\r\n \r\n }\r\n \r\n if(Input!=null)\r\n {\r\n int j = Converter(Input); \r\n \r\n Start();\r\n }\r\n \r\n }", "private static void pickNumOfPlayers()\n\t{\n\t\tprintBorder();\n\t\tSystem.out.print(\"Enter 1 for one player or 2 for two player: \");\n\t\tnumOfPlayers = input.nextInt(); // Throws error if input is not an int\n\t\tif (numOfPlayers == 2) isMultiplayer = true;\n\t\tSystem.out.println();\n\t}", "private int inputNumPlayers() {\n\t\t\t// set up dialog box\n\t\t\tString[] options = {\"OK\"};\n\t\t\tJPanel panel = new JPanel(new GridLayout(0, 1));\n\t\t\tJLabel lbl = new JLabel(\"How many players? (2-6)\");\n\t\t\tJTextField txt = new JTextField(10);\n\t\t\tpanel.add(lbl);\n\t\t\tpanel.add(txt);\n\t\t\t\n\t\t\t// show dialog box\n\t\t\tJOptionPane.showOptionDialog(frame, panel, \"# Players\",\n\t\t\t\t\tJOptionPane.NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options , options[0]);\n\t\t\tString numPlayersResponse = txt.getText();\n\t\t\t\n\t\t\t// determine input validity\n\t\t\tint numPlayers = 0;\n\t\t\ttry{\n\t\t\t\tnumPlayers = Integer.parseInt(numPlayersResponse);\n\t\t\t\t// check for out of bounds number\n\t\t\t\twhile(numPlayers < 2 || numPlayers > 6){\n\t\t\t\t\tpanel.remove(lbl);\n\t\t\t\t\ttxt.setText(\"\");\n\t\t\t\t\tlbl = new JLabel(\"Invalid number. Must be 2-6 players.\");\n\t\t\t\t\tpanel.add(lbl);\n\t\t\t\t\tJOptionPane.showOptionDialog(frame, panel, \"# Players\",\n\t\t\t\t\t\t\tJOptionPane.NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options , options[0]);\n\t\t\t\t\tnumPlayersResponse = txt.getText();\n\t\t\t\t\tnumPlayers = Integer.parseInt(numPlayersResponse);\n\t\t\t\t}\n\t\t\t} catch(NumberFormatException e){\n\t\t\t\t// player entered nothing or a non-numeric string\n\t\t\t\treturn inputNumPlayers();\n\t\t\t}\n\t\t\treturn numPlayers;\n\t\t}", "private static int getNumberOfPlayers() {\n Scanner scanner = new Scanner(System.in);\n System.out.print(\"Enter the number of kids: \");\n return scanner.nextInt();\n }", "public static int GetNumberOfPlayers () {\n int result;\r\n\r\n // LOOP UNTIL A VALID NUMBER IS ENTERED\r\n do {\r\n // PROMPT THE USER\r\n System.out.print(\"Enter the number of players: \");\r\n\r\n // GET THE RESULT & MAKE SOME SPACE\r\n result = input.nextInt();\r\n input.nextLine();\r\n System.out.println();\r\n\r\n // MUST HAVE AT LEAST TWO PLAYERS\r\n if (result < 2) {\r\n System.out.println(\"You need at least two players!\\n\");\r\n }\r\n\r\n } while (result < 2);\r\n\r\n // RETURN THE RESULT\r\n return result;\r\n }", "public static int getNumberOfPlayers() {\n //Create a variable to track the number of players and start it at 0.\n int numberOfPlayers = 0;\n //Use try/catch to gracefully handle a user entering a non integer.\n try {\n //Create a new instance of the Scanner class called reader to take input from the user.\n Scanner reader = new Scanner(System.in);\n //Set the numberOfPlayers variable to the users input. The input must be an integer.\n numberOfPlayers = reader.nextInt();\n\n //Since we only want to allow between 2 and 6 players, we need to give feedback to the user if they\n //enter a number less than 2 or greater than 6 and allow them to try again.\n if (numberOfPlayers < 2) {\n System.out.println(\"You can not have less than two players. Please enter the number of players. (2-6)\");\n numberOfPlayers = reader.nextInt();\n } else if (numberOfPlayers > 6) {\n System.out.println(\"You can not have more than 6 players. Please enter the number of players. (2-6)\");\n numberOfPlayers = reader.nextInt();\n }\n //If the input is a non integer, we want to tell the user to restart the program.\n } catch (InputMismatchException e) {\n System.out.println(\"You did not enter a number. Now everything is broken. Please restart.\");\n }\n //The getNumberOfPlayers method will return numberOfPlayers.\n return numberOfPlayers;\n }", "public void setNumberOfPlayers(int numberOfPlayers) {\n this.numberOfPlayers = numberOfPlayers;\n }", "public static int getNumPlayers(){\n\t\treturn numPlayers;\n\t}", "public int askHowManyUsers() {\r\n\t\tint userAmount = 0;\r\n\t\tboolean correctInput = false;\r\n\r\n\t\twhile (correctInput == false) {\r\n\t\t\tSystem.out.println(\r\n\t\t\t\t\t\"How many players would like to participate in the game?\\nPlease type 1,2,3 or 4. If you type 1 a virtual user will automatically be created. Otherwise have fun playing with your human friends!\");\r\n\t\t\ttry {\r\n\t\t\t\tuserAmount = input.nextInt();\r\n\t\t\t\tinput.nextLine();\r\n\t\t\t\tif (userAmount == 1 || userAmount == 2 || userAmount == 3 || userAmount == 4 || userAmount == 5) {\r\n\t\t\t\t\tcorrectInput = true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (userAmount > 5) {\r\n\t\t\t\t\t\tSystem.out.println(\"Five players is the maximum!\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (userAmount == 0) {\r\n\t\t\t\t\t\tSystem.out.println(\"At least one person should play!\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} catch (InputMismatchException e) {\r\n\t\t\t\tSystem.out.println(\"Please type a number\");\r\n\t\t\t\tinput.nextLine();\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn userAmount;\r\n\t}", "void askForNumber(String spieler,String playerChoices) throws IOException;", "public int getNumPlayers() {\n return numPlayers;\n }", "public int getNumPlayers(){\n\t\treturn this.players.size();\n\t}", "@Override\npublic int getNumPlayers() {\n\treturn numPlayer;\n}", "public int playersCount(){\r\n\t\treturn players.size();\r\n\t}", "private void askForNumberOfRequests() {\n\t\tconnectToServer();\n\t\tout.println(\"How many requests have you handled ?\");\n\t\tout.flush();\n\t\tint count = 0;\n\t\ttry {\n\t\t\tcount = Integer.parseInt(in.readLine());\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tSystem.out.println(\"CLIENT: Cannot receive num requests from server\");\n\t\t}\n\t\tSystem.out.println(\"CLIENT: The number of requests are \" + count);\n\t\tdisconnectFromServer();\n\t}", "public void start(){\n int numberOfPlayers = Integer.parseInt(JOptionPane.showInputDialog(\"How many players\"));\n player1 = new Player(JOptionPane.showInputDialog(\"What is your name?\"));\n if(numberOfPlayers == 1){\n player2 = new Player(\"Computer\");\n }\n else if(numberOfPlayers == 2){\n player2 = new Player(JOptionPane.showInputDialog(\"What is the second player name?\"));\n }\n\n }", "public int countPlayers(){\n return players.size();\n }", "public static void main(String[] args) {\n\t\tHashSet<String> players=new HashSet<String>(); \n\t\tScanner sc = new Scanner(System.in);\n\t\tint count = sc.nextInt();\n\t\tString player;\n\t\tfor(int i=0;i<count+1;i++)\n\t\t{\n\t\t\tplayer = sc.nextLine();\n\t\t\tplayers.add(player);\n\t\t}\n\t\tSystem.out.println(players.size());\n\t}", "private static void getPlayers() {\n while (true) {\n Scanner intInput = new Scanner(System.in);\n System.out.println(\"Please enter Number of total players (MAX 5 ALLOWED)\");\n try {\n totalPlayers = intInput.nextInt();\n } catch (InputMismatchException e) {\n System.out.println(\"Please enter valid input\");\n continue;\n }\n if (totalPlayers > 5 || totalPlayers < 2) {\n System.out.println(\"Total players must be between 2 - 5\");\n continue;\n }\n Scanner strInput = new Scanner(System.in);\n for (int i = 1; i <= totalPlayers; i++) {\n System.out.println(\"Please Enter Player \" + i + \" Name:\");\n String name = strInput.nextLine();\n playerList.add(name);\n }\n break;\n }\n }", "public int getNumPlayers(){\n return m_numPlayers;\n }", "@Override\n public void setNrPlayers(int value) {\n this.nrPlayers = value;\n }", "public int numPlayers() {\n return playerList.size();\n }", "public int getNumPlayers() {\n\n\t\treturn this.playerCount;\n\t}", "public int getNumOfPlayers() {\n\t\treturn numOfPlayers;\n\t}", "public void askInfoOnPlayer(int n, String nickname) throws IOException, InterruptedException{}", "public static int getGameSize()\n {\n boolean flag = true;\n int n = 0;\n while(flag)\n {\n String s = JOptionPane.showInputDialog(null, \"How many Fighters on each Team?\", \"Game Size\", JOptionPane.QUESTION_MESSAGE);\n try{\n n = Integer.parseInt(s);\n }\n catch(Exception e){}\n if(n<=0)\n JOptionPane.showMessageDialog(null, \"Please enter a number.\");\n else\n flag = false;\n }\n return n;\n }", "public void setMinimumPlayers(int nPlayers)\r\n {\n \r\n }", "public static int getUserChoice(){\r\n return Input.getInt(\"Enter 1 to add a song, 2 to display all songs, or 3 to quit the program: \");\r\n }", "public void setPlayers(){\n System.out.println();\n System.out.println(\"First, please enter the number of players:\");\n Scanner sc = new Scanner(System.in);\n int number;\n\n while(true){\n try {\n number = sc.nextInt();\n if(number > maxPlayer || number < minPlayer){\n System.out.println(\"Please enter a number between \" + minPlayer + \" and \" + maxPlayer+ \":\");\n continue;\n }\n } catch (InputMismatchException e){\n System.out.println(\"Invalid input! Please enter a number between \" + minPlayer + \" and \" + maxPlayer + \":\");\n sc.next();\n continue;\n }\n players = new ArrayList<>(number);\n for(int i = 0; i < number; i ++){\n players.add(new Player(\"Player \" + (i + 1)));\n }\n setNames();\n return;\n }\n }", "public int getNumOfPlayers() {\n\t\treturn playerList.size();\n\t}", "public int getNumberOfSelectedPlayers() {\n\t\treturn tmpTeam.size();\n\t}", "public static void setPlayerCount(int playerCount) {\n PLAYER_COUNT = playerCount;\n }", "int getNumOfPlayers() {\n return this.numOfPlayers;\n }", "private void createGame() {\n String[] options = { \"2\", \"3\", \"4\" };\n String result = (String) JOptionPane.showInputDialog(frame, \"Please enter the max player amount (must be between 2-4\", \"Create game\", JOptionPane.QUESTION_MESSAGE, null, options, options[2]);\n if (result == null) {\n System.out.println(\"[Client] Cancelled game creation\");\n } else {\n connectedServer.writeMessage(client.create(Integer.parseInt(result)));\n gameWindow();\n }\n }", "public int numPlayers(){\n return this.members.size();\n }", "private int enterNumberOfPins(Player currentPlayer, int limit, Scanner scanner) {\n\t\tint numPins;\n\t\t\n\t\tdo {\n\t\t\tSystem.out.println(currentPlayer.name + \"'s turn.\");\n\t\t\tSystem.out.print(\"Enter number of pins (0-10): \");\n\t\t\tnumPins = scanner.nextInt();\n\t\t} while(numPins < 0 || numPins > limit);\n\t\t\n\t\treturn numPins;\n\t}", "public int playerCount() {\n\t\treturn playerList.size();\n\t}", "public int parseNumPlayers() {\n\t\tboolean validParse = false;\n\t\tSystem.out.println(\"How many players are playing Legends of Heroes? (1-4)\");\n\t\t\n\t\twhile(!validParse) {\n\t\t\tint num = parseInt();\n\t\t\tif(num < 1 || num > 4) {\n\t\t\t\tprintErrorParse();\n\t\t\t} else {\n\t\t\t\tvalidParse = true;\n\t\t\t\treturn num;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t\t\n\t}", "public int nrOfPlayers() {\n int playerCount = 0;\n for (Player player : players) {\n if (player.getName() != null) {\n playerCount++;\n }\n }\n\n return playerCount;\n }", "int getNumberOfPlayers(){\n return players.size();\n }", "public int getPlayerCount() {\n return 0;\n }", "public int incrementPlayersNumber(){//setter/incrementer di numberofplayers chiamato da ServerRoom: qua ho cambiato! è qui che si setta il client id, e il primo della stanza ha id=1 scritta come era prima!\r\n\t\tint idToSend=numberOfPlayers;\r\n\t\tnumberOfPlayers++;\r\n\t\treturn idToSend;\r\n\t}", "public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n System.out.print(\"Welcome to Mafia\\n\" +\n \"Enter Number of players: \");\n if(scan.hasNextInt()) {\n int n = -1;\n while(n < 6){\n n = scan.nextInt();\n if(n<6) {\n System.out.println(\"Invalid Input.\");\n System.out.println(\"Enter Again:\");\n }\n }\n MafiaGame MG = new MafiaGame(n);\n MG.start();\n } else {\n System.out.println(\"Invalid Input\");\n }\n }", "private void getPlayers() {\r\n\t\tSystem.out.println(\"How Many Players: \");\r\n\t\tpnum = getNumber(1, 3);\r\n\r\n\t\tfor(int i=0; i < pnum; i++){\r\n\t\t\tSystem.out.println(\"What is player \" + (i + 1) + \"'s name? \");\r\n\t\t\tString name = sc.next();\r\n\t\t\tboolean dupe = true;\r\n\t\t\twhile(dupe){\r\n\t\t\t\tint samecounter = 0;\r\n\t\t\t\tfor(Player p : players){\r\n\t\t\t\t\tif(name.equals(p.getName())){\r\n\t\t\t\t\t\tsamecounter += 1;\r\n\t\t\t\t\t\tSystem.out.println(\"Name is the same as another players. Please choose another name: \");\r\n\t\t\t\t\t\tname = sc.next();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(samecounter == 0){\r\n\t\t\t\t\tdupe = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tplayers.add(new Player(name));\r\n\r\n\t\t}\r\n\t}", "public PlayerAsker(int player) {\r\n initComponents();\r\n choice=0;\r\n text.setText(\"What do you want player \" + (player+1) + \" to be ?:\");\r\n \r\n }", "public int getNumberOfPlayers() {\n return listaJogadores.size() - listaJogadoresFalidos.size();\n }", "public List<Integer> askPlayerCardsToUse();", "public int getNumSpeakers() { return numSpeakers; }", "public int playerCount()\r\n\t{\r\n\t\tint count = 0;\r\n\t\tfor(Player player: this.players)\r\n\t\t{\r\n\t\t\tif(player != null)\r\n\t\t\t{\r\n\t\t\t\t++count;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count;\r\n\t}", "public int getPlayerCount() {\n \n \treturn playerCount;\n \t\n }", "@Override\n\tpublic int selectCount() {\n\n\t\tint res = session.selectOne(\"play.play_count\");\n\n\t\treturn res;\n\t}", "public int getPlayerCount() {\n\t\treturn playerCount;\n\t}", "public int getMaximumPlayers() {\n return maximumPlayers;\n }", "public int getMaxPlayers() {\n return maxPlayers;\n }", "private static void createPlayers(int numPlayers){\r\n\t\t// crea la lista de jugadores\r\n\t\tfor(int i = 1; i <= numPlayers; i++){\r\n\t\t\t// Muestra una ventana de dialogo para introducir el nombre del jugador\r\n\t\t\tJTextField textField = new JTextField();\r\n\t\t\ttextField.setText(\"Jugador\"+i);\r\n\t\t\tJOptionPane.showOptionDialog(null, textField, \"Escriba el nombre para el jugador #\"+i, JOptionPane.OK_OPTION, JOptionPane.INFORMATION_MESSAGE, null, new String[]{\"Aceptar\"}, null);\r\n\t\t\tplayers.add(new Player(textField.getText()));\r\n\t\t}\r\n\t}", "public void setPlayerNumber(int num) {\n playerNum = num;\n }", "public void createPlayers() {\r\n\t\tPlayerList playerlist = new PlayerList();\r\n\t\tPlayer p = new Player();\r\n\t\tfor (int x = 0; x <= players; x++) {\r\n\t\t\tplayerlist.createPlayer(p);\r\n\t\t}\r\n\r\n\t\tScanner nameScanner = new Scanner(System.in);\r\n\r\n\t\tfor (int createdPlayers = 1; createdPlayers < players; createdPlayers++) {\r\n\t\t\tSystem.out.println(\"Enter next player's name:\");\r\n\t\t\tplayerlist.namePlayer(createdPlayers, nameScanner.nextLine());\r\n\t\t}\r\n\t\tnameScanner.close();\r\n\t}", "public void sendNumOpponents(int numPlayers) {\n try {\n dOut.writeInt(numPlayers);\n dOut.flush();\n } catch (IOException e) {\n System.out.println(\"Could not send number of players\");\n e.printStackTrace();\n }\n }", "public void run(){\n //make sure user enters valid number of players\n if((numTotalPlayers < 1) || (numTotalPlayers > 8)){\n view.showErrorPopUp(\"Invalid input, please enter a player number from 2 to 8\");\n System.out.println(\"Please enter a number from 2 to 8\");\n System.exit(0);\n }\n \n //creates the player queue with diff values according to num players\n players = initPlayers();\n\n // init and show board and currentPlayer\n board.resetBoard();\n startNewTurn();\n view.show(); // show view as last step of run()\n\n if (numTotalPlayers == numComputerPlayers) { // if all players are computers, trigger doComputerTurn()\n view.showErrorPopUp(\"The board is excited to have all computer players, so it's about to shake things up, like it's dancing! \\n\\nWARNING: do not run the program with all of the players as computer players if you have epilepsy as the colors of the game are about to flash on-screen during the whole game.\");\n doComputerTurn();\n }\n }", "public static void main(String[] args) {\n\n Scanner scanner = new Scanner(System.in);\n\n final String gameType = scanner.nextLine();\n final int playerCount = scanner.nextInt();\n\n log.info(\"[{}] was selected.\", gameType);\n log.info(\"Player count is [{}].\", playerCount);\n\n final Game game = GameFactory.build(gameType, playerCount);\n\n game.populate();\n game.shuffle();\n game.deal();\n game.start();\n\n scanner.close();\n }", "public int getCurentPlayerNumber() {\n return players.size();\n }", "public static void addPlayer(){\n Scanner scanner = new Scanner(System.in);\n System.out.println(\"Enter the player\");\n int player = scanner.nextInt();\n if(player >=2) {\n System.out.println(\"Enter the 2 more than player\");\n cardsPlayer(player);\n }\n\n }", "private int getOnlinePlayers()\n {\n return (int) Bukkit.getOnlinePlayers().stream().filter( p -> p != null && p.isOnline() ).count();\n }", "public void setGame(int numPlayers) {\r\n\t\tif (numPlayers > MAX_PLAYERS || numPlayers < 1) {\r\n\t\t\tSystem.out.println(\"Too many players. Please choose a number 1-8.\");\r\n\t\t}\r\n\t\t//Set up gameDeck\r\n\t\tScanner scanner = new Scanner(System.in);\r\n\t\tthis.gameDeck = new Deck();\r\n\t\tgameDeck.shuffle();\r\n\t\t//Set up players and empty board\r\n\t\tthis.numPlayers = numPlayers;\r\n\t\tboard = new ArrayList<Card>();\r\n\t\tplayers = new ArrayList<Player>();\r\n\t\tfor (int i = 0; i < numPlayers; i++) {\r\n\t\t\tSystem.out.println(\"Please enter player name: \");\r\n\t\t\tString name = scanner.nextLine();\r\n\t\t\tplayers.add(new Player(name));\r\n\t\t}\r\n\t\tscanner.close();\r\n\t}", "private Game (String[] args) {\n numTotalPlayers = Integer.valueOf(args[2]); \n try {\n numComputerPlayers = Integer.parseInt(args[3]);\n } catch (ArrayIndexOutOfBoundsException e) {\n numComputerPlayers = 0;\n System.out.println(\"No computer players enabled.\");\n }\n numHumanPlayers = numTotalPlayers - numComputerPlayers;\n board = Board.getInstance(args[0], args[1]);\n view = View.getInstance();\n }", "public int getMaximumPlayers() {\n return getOption(ArenaOption.MAXIMUM_PLAYERS);\n }", "public void Players()\n\t{\n\t\tSystem.out.println(\"What team are you looking for?: \");\n\t\tSystem.out.println(\"1: Soccer\\n2: Basketball\\n3: Football\\n4: RETURN\");\n\t\tint choice1 = input.nextInt();\n\t\tswitch (choice1) {\n\t\t\n\t\tcase 1:\n\t\t\t\n\t\t\tString name = \"GB Soccer\";\n\t\t\tSelectTeam(name);\n\t\t\t\n\t\t\tSystem.out.println(\"\\nTo view player's full Bio, type Last Name\");\n\t\t\t\n\t\t\tScanner input = new Scanner(System.in);\n\t\t\tString Spname = input.nextLine();\n\t\t\tSelectPlayer(Spname);\n\t\t\tSystem.out.println(\"To return to teams list press 1, to exit press 2\");\n\t\t\tint choice2 = input.nextInt();\n\t\t\tswitch(choice2)\n\t\t\t{\n\t\t\tcase 1: Players(); break; case 2: System.exit(2); break;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Yet to be implemented\");\n\t\t\t\tbreak; \n\t\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tString name1 = \"GB Basketball\";\n\t\t\tSelectTeam(name1);\n\t\t\t\n\t\t\tSystem.out.println(\"\\nTo view player's full Bio, type Last Name\");\n\t\t\t\n\t\t\tScanner input1 = new Scanner(System.in);\n\t\t\tString Bpname = input1.nextLine();\n\t\t\tSelectPlayer(Bpname);\n\t\t\tSystem.out.println(\"To return to teams list press 1, to exit press 2\");\n\t\t\tint choice3 = input1.nextInt();\n\t\t\tswitch(choice3)\n\t\t\t{\n\t\t\tcase 1: Players(); break; case 2: System.exit(0); break;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Yet to be implemented\");\n\t\t\t\tbreak; \n\t\t\t\t}\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tString name2 = \"GB Football\";\n\t\t\tSelectTeam(name2);\n\t\t\t\n\t\t\tSystem.out.println(\"\\nTo view player's full Bio, type Last Name\");\n\t\t\t\n\t\t\tScanner input2 = new Scanner(System.in);\n\t\t\tString Fpname = input2.nextLine();\n\t\t\tSelectPlayer(Fpname);\n\t\t\tSystem.out.println(\"To return to teams list press 1, to exit press 2\");\n\t\t\tint choice4 = input2.nextInt();\n\t\t\tswitch(choice4)\n\t\t\t{\n\t\t\tcase 1: Players(); break; case 2: System.exit(0); break;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Yet to be implemented\");\n\t\t\t\tbreak; \n\t\t\t\t}\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tquestion();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.out.println(\"Yet to be implemented\");\n\t\t\tbreak;\n\t\t}\n\t\t\n\t}", "public void playGame() {\n\t\tdo {\n\t\t\tSystem.out.print(\"How many people are playing (1-5)? \");\n\t\t\tusers = kb.nextInt();\n\n\t\t} while (users > 5 || users < 0);\n\n\t\tplayer = new Player[users];\n\t\tdeck = new Deck();\n\n\t\tfor (int i = 0; i < users; i++) {\n\t\t\tSystem.out.print(\"What is player \" + (i + 1) + \"'s name? \");\n\t\t\tString name;\n\t\t\tname = kb.next();\n\t\t\tplayer[i] = new Player();\n\t\t\tplayer[i].setName(name);\n\t\t}\n\t}", "public int size ()\n\t{\n\t\treturn playerList.size();\n\t}", "private void startUpConditions(){\n\t\t\tString strSize = JOptionPane.showInputDialog(null, \n\t\t\t\t\t\"Pick a Board Size between 3-30.\");\n\t\t\ttry{\n\t\t\t\tselectedSize = Integer.parseInt(strSize);\n\t\t\t\t\n\t\t\tif(selectedSize < 2||selectedSize > 30){\n\t\t\t\tselectedSize = 10;\n\t\t\t\tJOptionPane.showMessageDialog(null, \"The Game has\"\n\t\t\t\t+ \" defaulted to a Board Size of 10.\");\n\t\t\t\t}\n\t\t\t\n\t\t\t}catch(NumberFormatException exception){\n\n\t\t\t\tJOptionPane.showMessageDialog(null, \"The Game has\"\n\t\t\t\t+ \" defaulted to a Board Size of 10.\"+\n\t\t\t\t\" Because you input characters other than numbers.\");\n\t\t\t\tselectedSize = 10;\t\t\t\t\n\t\t\t}\n\n\t\n\t\t//selecting the number of players within the game\n\t\t//verifying a valid input for the Players\n\t\t//It's awfully boring to play by yourself after all.\n\t\t\tString strPlay = JOptionPane.showInputDialog(null, \n\t\t\t\t\t\"Pick number of players between 2-10\");\n\t\t\ttry{\n\t\t\t\tif(strPlay==null){\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"The game\"\n\t\t\t\t\t+\" has defaulted to 2 players.\");\n\t\t\t\t\tselectedPlayers = 2;\n\t\t\t\t}\n//\t\t\t\tif(input == JOptionPane.CANCEL_OPTION){\n//\t\t\t\t\tSystem.exit(1);\n//\t\t\t\t}\n\t\t\t\tif(strPlay!=null){\n\t\t\t\t\tselectedPlayers = Integer.parseInt(strPlay);\n\t\t\t\t\t\n\t\t\t\t\tif(selectedPlayers < 2||selectedPlayers > 10){\n\t\t\t\t\t\tselectedPlayers = 2;\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"The game\"\n\t\t\t\t\t\t\t+\" has defaulted to 2 players.\"\n\t\t\t\t\t\t\t+\" Because you input a number that \"\n\t\t\t\t\t\t\t+\"was out of bounds.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}catch(NumberFormatException exception){\n\t\t\t\tJOptionPane.showMessageDialog(null,\"You input \"\n\t\t\t\t\t+ \"something that was not a number.\"\n\t\t\t\t\t+ \" The game has defaulted to 2 players.\");\n\t\t\t\tselectedPlayers = 2;\n\t\t\t}\n\t\t\t\n\t\t\tString goFirst = JOptionPane.showInputDialog(null, \"Pick\"\n\t\t\t+ \" who will go first.\");\n\t\t\t\n\t\t\ttry{\n\t\t\t\tif(goFirst==null){\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"The game\"\n\t\t\t\t\t+\" has defaulted to Player 1s turn.\");\n\t\t\t\t\tthis.firstTurn = 0;\n\t\t\t\t}\n\t\t\t\tif(goFirst!=null){\n\t\t\t\t\t this.firstTurn = Integer.parseInt(goFirst);\n\t\t\t\t}\n\t\t\t}catch(NumberFormatException exception){\n\t\t\t\tJOptionPane.showMessageDialog(null, \"You input \"\n\t\t\t\t+ \"something other than a number.\"\n\t\t\t\t+ \" The Game has defaulted to player 1s turn.\");\n\t\t\t\tthis.firstTurn = 0;\n\t\t\t}finally{\n\t\t\t\tJOptionPane.showMessageDialog(null, \"The game\"\n\t\t\t\t\t+\" will now begin.\");\n\t\t\t}\n\t\t\t\n\t\t}", "public int getPlayerIdsCount() {\n return playerIds_.size();\n }", "private int promptForPassengerNumbers() throws Exception {\n\t\tint numPassengers = 0;\n\t\tboolean validPassengerNumbers = false;\n\t\t\n\t\t// By pass user input validation.\n\t\tif (!testingWithValidation) {\n\t\t\treturn Integer.parseInt(console.nextLine());\n\t\t} \n\t\t\n\t\telse {\n\t\t\t\n\t\t\twhile (!validPassengerNumbers) {\n\t\t\t\tnumPassengers = Integer.parseInt(console.nextLine());\n\t\t\t\tString validId = application.isValidPassengerCapacity(numPassengers);\n\t\t\t\t\n\t\t\t\tif (validId.contains(\"Error:\")) {\n\t\t\t\t\tSystem.out.println(validId);\n\t\t\t\t\tSystem.out.println(\"Enter passenger capacity: \");\n\t\t\t\t\tSystem.out.println(\"(or hit ENTER to exit)\");\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\telse {\n\t\t\t\t\tvalidPassengerNumbers = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn numPassengers;\n\t\t}\n\t}", "private void getPlayerNames(){\n players[0] = JOptionPane.showInputDialog(\"Please input the name for the first player\");\n players[1] = JOptionPane.showInputDialog(\"Please input the name for the second player\");\n }", "public int getPlayerAnswer()\r\n\t{\r\n\t\tScanner in = new Scanner(System.in);\r\n\t\tSystem.out.print(\"Enter your answer (0-3): \");\r\n\t\treturn in.nextInt();\r\n\t}", "public int getPlayerIdsCount() {\n return playerIds_.size();\n }", "public int loadedPlayers(){\n return playerMap.size();\n }", "public static void boardSize() {\n\t\tString boardSizeInput = JOptionPane\n\t\t\t\t.showInputDialog(\"Please enter a number greater than 2 for the n x n game board size: \");\n\n\t\tif (boardSizeInput == null) {\n\t\t\tSystem.exit(0);\n\t\t}\n\n\t\twhile (Integer.parseInt(boardSizeInput) < 3) {\n\t\t\tboardSizeInput = JOptionPane.showInputDialog(\n\t\t\t\t\t\"Invalid input! Please enter a number greater than 2 for the n x n game board size: \");\n\n\t\t\tif (boardSizeInput == null) {\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}\n\n\t\tsize = Integer.parseInt(boardSizeInput);\n\t}", "public void started()\n {\n playerOneName = JOptionPane.showInputDialog( null, \"Please enter your name:\", \"PlayerOne Name\", JOptionPane.QUESTION_MESSAGE );\n playerTwoName = JOptionPane.showInputDialog( null, \"Please enter your name:\", \"PlayerTwo Name\", JOptionPane.QUESTION_MESSAGE );\n }", "public static void main(String[] args) {\n\n\t\tGame myGame = new Game(\"Monopoly\");\n\t\tPrompter prompter = new Prompter(myGame);\n\t\t\n\t\twhile (myGame.getRemainingTries() > 0 && !myGame.isWon()) {\n\t\t\t\n\t\t\tprompter.displayProgress();\n\t\t\tprompter.promptForGuess();\n\t\t}\n\t\tprompter.displayOutcome();\n\t}", "public void startToRecivePlayers() {\n while (numberOfPlayers == 0) {\n controller.getSpf().getLabel1().setText(\"Ingresa el numero de jugadores\");\n }\n try {\n ss = new ServerSocket(8888);\n Thread.sleep(100);\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } catch (InterruptedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n controller.getSpf().getLabel1().setText(\"Recibido\");\n run();\n }", "public void startGame() {\n int numberOFPlayers = view.askForNumberOfPlayers();\n\n // adding dealer...\n players.add(dealer);\n //...and players to 'players' ArrayList\n for (int i = 1; i < numberOFPlayers; i++) {\n players.add(new RegularPlayer(i + 1));\n }\n\n // dealing cards to players\n dealer.dealCardsToPlayers(players);\n // Game\n while (!(players.size() == 1)) {\n\n for (int i = 0; i < players.size(); i++) {\n\n // printowanie ilości kart kazdego z graczy dla testów\n if (checkGameStatus()) {\n try {\n // display no of cards for each player\n for (Player player : players) {\n view.print(\"Player \" + player.getPlayerId() + \" no of cards: \" + player.getCardsCount());\n }\n\n round(players.get(i), players);\n } catch (IndexOutOfBoundsException e) {\n continue;\n }\n } else {\n break;\n }\n }\n }\n }", "public int countPlayers(Long gameId){\n List<User_Game> user_games = userGameRepository.retrieveGamePlayers(gameId);\n return user_games.size();\n }", "public static int numbersOfIterations(Scanner console){\n\t\tSystem.out.println(\"Enter number of iterations: \");\n\t\treturn console.nextInt();\n\t\t\n\t}", "public static int numberofplayers (String filename) throws IOException\n {\n int countplayer = 0;\n LineNumberReader L1= new LineNumberReader(new FileReader(filename));// reading the lines by using line reader\n while ((L1.readLine())!=null) {};\t// reading the line while its not null\n countplayer = L1.getLineNumber(); // number of lines equals the number of player\n L1.close();\n return countplayer;\n }", "public int getMinimumPlayers() {\n return getOption(ArenaOption.MINIMUM_PLAYERS);\n }", "private static void playGame(int maxGuessCount) {\n Random random = new Random();\n int randomNumber = random.nextInt(50) + 1;\n\n // track user guesses and set a limit\n int userGuess;\n int guessCount = 0;\n\n // INITIALIZE GAME\n\n // the number range is modified through param when calling method validateInput\n System.out.println(\"Please type a number between 1 and 50.\");\n\n while (guessCount < maxGuessCount) {\n guessCount++;\n // put param for lowest and highest number range\n userGuess = validateInput(1, 50);\n\n if (userGuess == randomNumber) {\n System.out.println(\"That's right, you won!\");\n break;\n }\n if (userGuess < randomNumber) {\n System.out.println(\"Nope, try something higher.\" + \"\\n\");\n continue;\n } else if (userGuess > randomNumber) {\n System.out.println(\"Nope, try something lower.\" + \"\\n\");\n continue;\n }\n }\n\n // decide if game should restart or not\n System.out.println(\"\\n\" + \"Would you like to start over?\" + \"\\n\" + \"1. Yes\" + \"\\n\" + \"2. No\");\n int playAgainOrNot = validateInput(1, 2);\n\n switch (playAgainOrNot) {\n case 1:\n playAgain = true;\n break;\n case 2:\n System.out.println(\"Ok, see you next time.\");\n playAgain = false;\n break;\n }\n\n }", "public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n int manyPlayers;\n System.out.println(\"How many players are in this Easter egg hunt? \");\n System.out.println(\"Enter a positive whole number:\");\n /* found the input validation at: \n https://stackoverflow.com/questions/3059333/validating-input-using-java-util-scanner \n */\n //Extra Credit 1: input validation\n do {\n while (!s.hasNextInt()) {\n System.out.println(\"Enter a positive whole number:\");\n s.next();\n }\n manyPlayers = s.nextInt();\n if(manyPlayers <= 0){\n System.out.println(\"Enter a positive whole number:\");\n }\n } while (manyPlayers <= 0);\n \n ArrayList<Player> playerList = new ArrayList<Player>();\n for(int i = 0; i < manyPlayers; i++){\n Player p = new Player();\n playerList.add(p);\n }\n System.out.println(\"We have added \" + manyPlayers + \" players to this hunt. Let’s find some eggs!\");\n System.out.println();\n hunt(playerList);\n recap(playerList);\n stats(playerList);\n }", "@Override\n public int getTotalHumanPlayers() {\n return totalHumanPlayers;\n }", "public int initialAsk(){\n System.out.println(\"Hi, what would you like to do? \");\n System.out.println(\"Please type in the number: \");\n System.out.println(\"1. Add a client to the database \");\n System.out.println(\"2. Add an order to the database \");\n System.out.println(\"3. Display all clients from the database \");\n System.out.println(\"4. Display all orders from the database \");\n System.out.println(\"5. Update the client data \");\n System.out.println(\"6. Update the order data \");\n System.out.println(\"7. Delete the client from a database \");\n System.out.println(\"8. Delete the order from a database \");\n System.out.println(\"9. Find the client\");\n System.out.println(\"10. Find the order\");\n System.out.println(\"11. Finish work/ Close app\");\n return inN.nextInt();\n}", "public int numVanished() {\n return this.vanishedPlayers.size();\n }", "@Override\n // report number of players on a given team (or all players, if null)\n\tpublic int numPlayers(String teamName) {\n\n int numPlayers = 0;\n\n\n if (teamName == null) {\n\n for (int i = 0; i < (stats.keySet()).toArray().length; i++) {\n\n numPlayers++;\n\n }\n\n return numPlayers;\n\n }\n\n else {\n\n Collection<SoccerPlayer> soccerPlayers = stats.values();\n\n for (SoccerPlayer sp: soccerPlayers) {\n\n if (sp.getTeamName().equals(teamName)){\n\n numPlayers++;\n }\n }\n\n return numPlayers;\n\n }\n\n\n\t}", "public int NumPlayersInGame(int game_number)\n\t{\n\t\treturn gametype[game_number].NumOfPlayersInGame();\n\t}", "public static void main(String[] args) {\n\r\n Scanner s = new Scanner(System.in);\r\n\r\n\r\n int option = 0;\r\n while(option != 5) {\r\n System.out.println(\"\");\r\n System.out.println(\"To Add a Player : Press A\");\r\n System.out.println(\"To View all Players : Press V\");\r\n System.out.println(\"Display two best batmans : Press B\");\r\n System.out.println(\"Display two best bowlers : Press C\");\r\n System.out.println(\"Display two best keeper : Press D\");\r\n System.out.println(\"To Exit : Press E\");\r\n System.out.println(\"\");\r\n System.out.println(\"Press the Number : \");\r\n System.out.println(\"\");\r\n\r\n option = s.nextInt();\r\n switch (option) {\r\n case \"A\":\r\n //\r\n break;\r\n case \"V\":\r\n //\r\n\r\n case \"B\":\r\n //\r\n break;\r\n case \"C\":\r\n //\r\n break;\r\n case \"D\":\r\n break;\r\n case \"E\":\r\n break;\r\n default:\r\n System.out.println(\"Press the Correct Letter:\");\r\n\r\n\r\n }\r\n }\r\n\r\n }", "public void numberOfChoices() {\n\t\tcommon.waitForElement(mcqChoices, 60);\n\t\tchoicesinMCQ = mcqChoices.getText();\n\t\tarr = choicesinMCQ.split(\"\\\\W+\");\n\t\tnumberOfChoicesinMCQ = arr[3];\n\t\tlastOption = numberOfChoicesinMCQ.charAt(0);\n\t\tint a = 1;\n\t\tfor (char x = firstOption; x < lastOption; x++) {\n\t\t\tfirstOption += 1;\n\t\t\ta += 1;\n\t\t}\n\t\tfor (choice = 0; choice < a; choice++) {\n\t\t\tcommon.waitForElement(mcqChoices, 60);\n\t\t\tanswerChoice.get(choice).click();\n\t\t}\n\t\tchoice = 0;\n\t\ta = 1;\n\t\tfirstOption = 'A';\n\t}", "int getNewlyAvailableQuestsCount();", "public void beginTakingPlayers() {\n currentQuestionIndex = 0;\n setGameState(GameState.AWAITING_PLAYERS);\n }", "public int getMinPlayers() {\n return minPlayers;\n }", "private void initialize() {\n frame = new JFrame();\n frame.setBounds(100, 100, 550, 412);\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.getContentPane().setLayout(null);\n\n JLabel lblHi = new JLabel(\"<html>How many days would you like to play?</html>\");\n lblHi.setBounds(12, 12, 267, 48);\n frame.getContentPane().add(lblHi);\n\n JComboBox<String> howManyDays = new JComboBox<String>();\n howManyDays.setModel(new DefaultComboBoxModel<String>(new String[]{\"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\"}));\n howManyDays.setBounds(328, 24, 56, 24);\n frame.getContentPane().add(howManyDays);\n\n JLabel lblNewLabel = new JLabel(\"How many players do you want ?\");\n lblNewLabel.setBounds(12, 89, 267, 15);\n frame.getContentPane().add(lblNewLabel);\n\n JComboBox<Integer> numOfCrew = new JComboBox<Integer>();\n numOfCrew.setModel(new DefaultComboBoxModel<Integer>(new Integer[]{2, 3, 4}));\n numOfCrew.setBounds(328, 84, 56, 24);\n frame.getContentPane().add(numOfCrew);\n\n JLabel lblWhatIsYour = new JLabel(\"What is your Ship name?\");\n lblWhatIsYour.setBounds(12, 154, 267, 15);\n frame.getContentPane().add(lblWhatIsYour);\n\n JTextField shipName = new JTextField();\n shipName.setText(\"fake_taxi\");\n shipName.setBounds(271, 154, 226, 24);\n frame.getContentPane().add(shipName);\n shipName.setColumns(10);\n\n JLabel errorMessage = new JLabel(\"\");\n errorMessage.setBounds(281, 200, 216, 48);\n frame.getContentPane().add(errorMessage);\n\n\n JButton btnLetsPlay = new JButton(\"Next\");\n btnLetsPlay.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent arg0) {\n\n\n if (shipName.getText().length() > 15 || shipName.getText().length() < 1) {\n errorMessage.setText(\"<html>Your ship name has to be between 1 to 15 characters</html>\");\n\n } else if (shipName.getText().contains(\" \")) {\n errorMessage.setText(\"<html>Your ship name cannot contain spaces</html1>\");\n } else {\n Game gameState = new Game(Integer.parseInt(howManyDays.getSelectedItem().toString()), Integer.parseInt(numOfCrew.getSelectedItem().toString()));\n Crew theCrew = new Crew(shipName.getText(), gameState);\n frame.dispose();\n CharacterCreationScreen.main(theCrew);\n }\n }\n });\n\n btnLetsPlay.setBounds(209, 283, 114, 25);\n frame.getContentPane().add(btnLetsPlay);\n\n\n }" ]
[ "0.78418154", "0.77931464", "0.7668661", "0.75488335", "0.7495851", "0.7300658", "0.72041976", "0.69144684", "0.67806387", "0.6703635", "0.6601608", "0.6558993", "0.6510605", "0.64879966", "0.6412197", "0.64087176", "0.6396889", "0.6357791", "0.6341875", "0.62996507", "0.6287116", "0.62823796", "0.6281316", "0.62792844", "0.6253082", "0.6249524", "0.62434435", "0.6228745", "0.62184334", "0.62106013", "0.6206125", "0.61769396", "0.6090503", "0.6041477", "0.6036866", "0.6015725", "0.60145885", "0.59732854", "0.5917357", "0.59117305", "0.5896007", "0.5894217", "0.5888216", "0.5845285", "0.5835662", "0.58294976", "0.5810872", "0.58090615", "0.57881355", "0.5774016", "0.5738982", "0.5731425", "0.57308006", "0.5725688", "0.57217014", "0.57099384", "0.5707408", "0.56910515", "0.5688968", "0.5678465", "0.56698984", "0.56466013", "0.56440854", "0.563803", "0.5616865", "0.56154925", "0.56082696", "0.5606744", "0.5597991", "0.55978197", "0.55918604", "0.55879825", "0.5571829", "0.5540011", "0.55387837", "0.5537164", "0.5527898", "0.5511655", "0.5506871", "0.54961586", "0.5492137", "0.548842", "0.5488208", "0.5487924", "0.54733986", "0.5468287", "0.546828", "0.5465302", "0.5464557", "0.54469544", "0.54376143", "0.5412533", "0.5406433", "0.54027414", "0.5386074", "0.53855324", "0.5380228", "0.5368612", "0.53679496", "0.5367619" ]
0.6898775
8
Checks to see if a given String is a nonnegative number
public boolean isNumber(String str) { for(int i = 0; i < str.length(); i++) { if(!Character.isDigit(str.charAt(i))) return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static final boolean isNumberNotNegative(String str) {\n\t\treturn isNumber(str,false);\n\t}", "private boolean valid_numbers(String nr)\n\t{\n\t\t// loop through the string, char by char\n\t\tfor(int i = 0; i < nr.length();i++)\n\t\t{\n\t\t\t// if the char is not a numeric value or negative\n\t\t\tif(Character.getNumericValue(nr.charAt(i)) < 0)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// if it did not return false in the loop, return true\n\t\treturn true;\n\t}", "private boolean containsOnlyNumbers(String inputString)\r\n {\r\n inputString = inputString.trim();\r\n if (inputString.equals(null))\r\n return false;\r\n else\r\n for (int i = 0; i < inputString.length(); i++)\r\n if (!(inputString.charAt(i) >= '0' && inputString.charAt(i) <= '9'))\r\n return false;\r\n return true;\r\n }", "private boolean isNotNumeric(String s) {\n return s.matches(\"(.*)\\\\D(.*)\");\n }", "private static boolean isPositiveInteger(String s){\n\t\ttry{\n\t\t\t//If the token is an integer less than 0 return false\n\t\t\tif(Integer.parseInt(s) < 0){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t//If an exception occurs return false\n\t\tcatch(NumberFormatException e){\n\t\t\treturn false;\n\t\t}\n\t\t//otherwise return true\n\t\treturn true;\n\t}", "private static boolean isNumeric(String str){\n return str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); //match a number with optional '-' and decimal.\n }", "public static boolean isNonnegLong(String s) {\n\t\tif(s == null) {\n\t\t\treturn false;\n\t\t}\n\t\ttry {\n\t\t\tlong val = (new BigInteger(s)).longValue();\n\t\t\tif (val < 0)\n\t\t\t\treturn false;\n\t\t\treturn true;\n\t\t}\n\t\tcatch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t}", "public static boolean IsNumber(String par_Number) {\n\n java.util.regex.Pattern p = java.util.regex.Pattern.compile(\"^\\\\-?\\\\d*.?\\\\d+$\");\n java.util.regex.Matcher m = p.matcher(par_Number);\n\n return m.matches() || IsInteger(par_Number);\n }", "public static boolean isNumber(String s) \r\n{ \r\n for (int i = 0; i < s.length(); i++) \r\n if (Character.isDigit(s.charAt(i)) \r\n == false) \r\n return false; \r\n\r\n return true; \r\n}", "public static boolean isNumeric(String str)\n {\n return str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); //match a number with optional '-' and decimal.\n }", "public boolean isNum(String x) {\n\t\tfor (int i = 0; i < x.length(); i++) {\n\t\t\tchar c = x.charAt(i);\n\t\t\tif ((c == '-' || c == '+') && x.length() > 1)\n\t\t\t\tcontinue;\n\t\t\tif ((int) c > 47 && (int) c < 58)\n\t\t\t\tcontinue;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private static boolean isNumeric(String str)\t{\n\n\t\treturn str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); \n\t\t\t// match a number with optional '-' and decimal.\n\t}", "public static boolean isNumeric(String str)\n {\n return str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); //match a number with optional '-' and decimal.\n }", "public static final boolean isNumber(String str, boolean allowNegative) {\n\t\tboolean r = str.length()>0;\n\t\tint i = 0;\n\t\tfor (char c:str.toCharArray()) {\n\t if (!(Character.isDigit(c) || (i==0 && allowNegative && c==CHAR_MINUS && str.length()>1))) {\n\t \tr = false;\n\t \tbreak;\n\t }\n\t i++;\n\t }\n\t return r;\n\t}", "private boolean isNumeric(String s) {\n return java.util.regex.Pattern.matches(\"\\\\d+\", s);\n }", "public static boolean isNumber(String string) {\n if (string == null || string.isEmpty()) {\n return false;\n }\n int i = 0;\n if (string.charAt(0) == '-') {\n if (string.length() > 1) {\n i++;\n } else {\n return false;\n }\n }\n for (; i < string.length(); i++) {\n if (!Character.isDigit(string.charAt(i))) {\n return false;\n }\n }\n return true;\n}", "public boolean isNumber(String sIn)\r\n {\r\n int parseNumber = -1;\r\n \r\n try{\r\n parseNumber = Integer.parseInt(sIn);\r\n }catch(Exception e){\r\n return false;\r\n }\r\n \r\n return true;\r\n }", "private boolean checkForNumber(String field) {\n\n\t\tPattern p = Pattern.compile(\"[0-9].\");\n\t\tMatcher m = p.matcher(field);\n\n\t\treturn (m.find()) ? true : false;\n\t}", "public boolean isZero() {\n Pattern pattern = Pattern.compile(\"0+\");\n Matcher matcher = pattern.matcher(numberString);\n return matcher.matches();\n }", "public static boolean isNumeric(String string) { \r\n\t\ttry { \r\n\t\t\tint testNumber = Integer.parseInt(string); \r\n\t\t} catch(NumberFormatException e) { \r\n\t\t\treturn false; \r\n\t\t} \r\n\t\t\r\n\t\treturn true; \r\n\t}", "public static final boolean isNumber(StringBuilder str, boolean allowNegative) {\n\t\tboolean r = str.length()>0;\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\tchar c = str.charAt(i);\n\t if (!(Character.isDigit(c) || (i==0 && allowNegative && c==CHAR_MINUS && str.length()>1))) {\n\t \tr = false;\n\t \tbreak;\n\t }\n\t\t}\n\t return r;\n\t}", "private boolean isValidNumber(String quantity) {\n\t\ttry{\n\t\t\tint value=Integer.parseInt(quantity);\n\t\t\treturn value>0? true: false;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t}", "public static boolean numbersCheck(String num)\r\n\t{\r\n\t\treturn num.matches(\"[0-9]+\");\r\n\t}", "public static boolean isInteger(String str) {\n if (str == null || str.isEmpty() || str.equals(\"-\"))\n return false;\n\n int startIndex = str.startsWith(\"-\") ? 1 : 0;\n for (int i = startIndex; i < str.length(); i++)\n if (Character.digit(str.charAt(i), 10) < 0)\n return false;\n return true;\n }", "public boolean isNumeric(String str){\r\n\t Pattern pattern = Pattern.compile(\"[0-9]*\");\r\n\t return pattern.matcher(str).matches(); \r\n\t}", "public static boolean isNumericRegex(String str)\n {\n return str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); //match a number with optional '-' and decimal.\n }", "public boolean isNegative() {\n return (numberString.charAt(0) == '-');\n }", "public static boolean isNumeric(String strNum) {\n if (strNum == null) {\n return false;\n }\n try {\n Integer d = Integer.parseInt(strNum);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "public static boolean isNumeric(String strNum) {\r\n if (strNum == null) {\r\n return true;\r\n }\r\n try {\r\n Integer.parseInt(strNum);\r\n } catch (NumberFormatException nfe) {\r\n return true;\r\n }\r\n return false;\r\n }", "private static boolean isNumber(String value){\r\n\t\tfor (int i = 0; i < value.length(); i++){\r\n\t\t\tif (value.charAt(i) < '0' || value.charAt(i) > '9')\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private static boolean areNumbers(String s) {\n boolean isADigit = false;//only changed once everything has been checked\n //checks if places 0-2 are numbers and 3 is a \"-\"\n for(int i = 0; i < 3; i++) {\n if(Character.isDigit(s.charAt(i)) && s.charAt(3) == '-') {\n isADigit = true;\n }\n }\n //checks if places 4-5 are numbers and 6 is a \"-\"\n for(int i = 4; i < 6; i++) {\n if(Character.isDigit(s.charAt(i)) && s.charAt(6) == '-') {\n isADigit = true;\n }\n }\n //checks if places 7-10 are numbers\n for(int i = 7; i < 11; i++) {\n if(Character.isDigit(s.charAt(i))) {\n isADigit = true;\n }\n }\n return isADigit;\n }", "public boolean isNumeric(String str){\n try {\n int i = Integer.parseInt(str);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "public String validateNumberString() {\n String tempNumber = numberString;\n int start = 0;\n Pattern pattern = Pattern.compile(\"\\\\D+\");\n Matcher matcher = pattern.matcher(tempNumber);\n if (isZero()) {\n return \"0\";\n }\n if (isNegative()) {\n start++;\n }\n if (matcher.find(start)) {\n throw new IllegalArgumentException(\"Wrong number: \" + tempNumber);\n }\n pattern = Pattern.compile(\"([1-9][0-9]*)\");\n matcher.usePattern(pattern);\n if (!matcher.find(0)) {\n throw new IllegalArgumentException(\"Wrong number: \" + tempNumber);\n }\n return tempNumber.substring(matcher.start(), matcher.end());\n }", "public boolean checkInt( String s ) {\n \tchar[] c = s.toCharArray();\n \tboolean d = true;\n\n \tfor ( int i = 0; i < c.length; i++ )\n \t // verifica se o char não é um dígito\n \t if ( !Character.isDigit( c[ i ] ) ) {\n \t d = false;\n \t break;\n \t }\n \treturn d;\n \t}", "public static boolean isNumber(final String s) {\r\n\t\tfor (int i = 0; i < s.length(); i++) {\r\n\t\t\tif (!Character.isDigit(s.charAt(i))) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "public static boolean IsInteger(String par_Number) {\n\n java.util.regex.Pattern p = java.util.regex.Pattern.compile(\"^[\\\\d|\\\\-]\\\\d*$\");\n java.util.regex.Matcher m = p.matcher(par_Number);\n\n return m.matches();\n\n }", "private boolean isNumber(String str) {\r\n int ASCII_0 = 48;\r\n int ASCII_9 = 57;\r\n if (str.equals(\"\")) {\r\n return false;\r\n }\r\n for (int i = 0; i < str.length(); i++) {\r\n int chr = str.charAt(i);\r\n if (chr < ASCII_0 || chr > ASCII_9) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "private boolean isNumeric(String s)\n {\n for (int i = 0; i < s.length(); ++i)\n {\n if (!Character.isDigit(s.charAt(i)))\n {\n return false;\n }\n }\n return true;\n }", "public boolean isNumber(String in) \n\t{\n\t\ttry \n\t\t{\n\t\t\tInteger.parseInt(in);\n\t\t\treturn true;\n\t\t}\n\t\tcatch (Exception e) \n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "@Test\n void checkIsFalseForStringWithoutNumbers() {\n // Act, Assert\n assertFalse(IsNumeric.check(\"a\"));\n assertFalse(IsNumeric.check(\"ö\"));\n assertFalse(IsNumeric.check(\"\"));\n assertFalse(IsNumeric.check(\"´´´\"));\n assertFalse(IsNumeric.check(\"lgk\"));\n assertFalse(IsNumeric.check(\"lL y\"));\n assertFalse(IsNumeric.check(\" \"));\n assertFalse(IsNumeric.check(\"h* \"));\n assertFalse(IsNumeric.check(\"/+\"));\n assertFalse(IsNumeric.check(\"-\"));\n assertFalse(IsNumeric.check(\"+\"));\n assertFalse(IsNumeric.check(\"d\"));\n assertFalse(IsNumeric.check(\"ariel\"));\n assertFalse(IsNumeric.check(\"#€%/!\"));\n }", "public static boolean isNumber(String input) {\n boolean hasDecimal = false;\n for (int i = 0; i < input.length(); i++) {\n char test = input.charAt(i);\n if (test == '-' && i == 0)\n continue; // Allow negative indicator.\n\n if (test == '.') {\n if (!hasDecimal) {\n hasDecimal = true;\n continue;\n } else {\n return false; // Multiple decimal = invalid number.\n }\n }\n\n if (!Character.isDigit(test))\n return false; // Character isn't a digit, so it can't be a number.\n }\n\n return true;\n }", "public boolean isNum(String cad){\n try{\n Integer.parseInt(cad);\n return true;\n }catch(NumberFormatException nfe){\n System.out.println(\"Solo se aceptan valores numericos\");\n return false;\n }\n }", "public static boolean isNumber(String val)\n {\n\t if(val == null || val.trim().isEmpty())\n\t {\n\t\t return false;\n\t }\n\t else\n\t {\n\t\t Pattern patternForNumber = Pattern.compile(\"^[+-]?(([0-9]+\\\\.?[0-9]+)|[0-9]+)\");\n\t\t return patternForNumber.matcher(val).matches();\n\t }\n }", "public static boolean isNumericString(String value) {\n\t try {\n\t\t if (Double.parseDouble(value) > 0) {\n\t\t return true;\n\t\t }\n\t } catch (NumberFormatException nfe) {\n\t return false;\n\t }\n\t return false;\n\t}", "public boolean isNumber(String str) {\n\t\treturn str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\");\n\t}", "public static boolean isNumeric(String cadena){ \r\n try {\r\n Integer.parseInt(cadena);\r\n return true;\r\n } catch (NumberFormatException e){\t\r\n System.out.println(e.getMessage());\r\n return false;\r\n }\r\n }", "public static boolean isNumberNegative(Object val) throws BaseException\n{\n\tif(val instanceof Number && NumberUtil.toDouble(val) < 0 )\n\t{\n\t return true;\n\t}\n\treturn false;\n}", "public static Boolean isNumeric(String text)\n {\n //This checks for negative numbers...\n if (text.startsWith(\"-\"))\n {\n text = text.substring(1, text.length());\n }\n\n for (char c : text.toCharArray())\n {\n if (!Character.isDigit(c))\n {\n return false;\n }\n }\n return true;\n }", "public boolean isNumber(String input) {\r\n\t\tif (input == null || input.isEmpty())\r\n\t\t\treturn false;\r\n\t\tif (input.charAt(0) == '-')\r\n\t\t\treturn false;\r\n\t\tfor (int i = 0; i < input.length(); i++) {\r\n\t\t\tif (Character.isDigit(input.charAt(i)) == false)\r\n\t\t\t\treturn false;\r\n\t\t\tif (Integer.parseInt(input) < 1 || Integer.parseInt(input) > 7)\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Test\n void checkIsTrueForStringWithNumbers() {\n // Act, Assert\n assertTrue(IsNumeric.check(\"3\"));\n assertTrue(IsNumeric.check(\"0\"));\n assertTrue(IsNumeric.check(\"-0f\"));\n assertTrue(IsNumeric.check(\"3.8f\"));\n assertTrue(IsNumeric.check(\"-3.87F\"));\n assertTrue(IsNumeric.check(\"-3\"));\n assertTrue(IsNumeric.check(\"32f\"));\n assertTrue(IsNumeric.check(\"15D\"));\n assertTrue(IsNumeric.check(\"3.2\"));\n assertTrue(IsNumeric.check(\"0.2\"));\n assertTrue(IsNumeric.check(\"-0.28\"));\n assertTrue(IsNumeric.check(\"0.24D\"));\n assertTrue(IsNumeric.check(\"0.379d\"));\n }", "private static boolean isNumeric(String cadena)\n\t {\n\t\t try \n\t\t {\n\t\t\t Integer.parseInt(cadena);\n\t\t\t return true;\n\t\t } catch (NumberFormatException nfe)\n\t\t {\n\t\t\t return false;\n\t\t }\n\t }", "private boolean isInt (String s) {\n\t\ttry {\n\t\t\tif(Integer.parseInt(s) < 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tcatch(NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t\tcatch(NullPointerException e) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public static boolean isNumber(String string) {\n\n\t\ttry {\n\t\t\tLong.parseLong(string);\n\t\t\treturn true;\n\t\t} catch (Exception e) {\n\t\t\treturn false;\n\t\t}\n\n\t}", "private boolean isNumber( String test ) {\n\treturn test.matches(\"\\\\d+\");\n }", "public static boolean isNumeric(String strNum) {\n if (strNum == null) {\n return false;\n }\n try {\n double d = Double.parseDouble(strNum);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "@Test\n void checkIsFalseForStringWithNumbersAndOtherChars() {\n // Act, Assert\n assertFalse(IsNumeric.check(\"a3\"));\n assertFalse(IsNumeric.check(\"3l\"));\n assertFalse(IsNumeric.check(\"345L\"));\n assertFalse(IsNumeric.check(\"32b\"));\n assertFalse(IsNumeric.check(\"*3.2 \"));\n assertFalse(IsNumeric.check(\"/0.2\"));\n assertFalse(IsNumeric.check(\"0.28L\"));\n assertFalse(IsNumeric.check(\"0.28.\"));\n assertFalse(IsNumeric.check(\"3.2.4\"));\n assertFalse(IsNumeric.check(\"0x400\"));\n assertFalse(IsNumeric.check(\"0.24Dd\"));\n }", "public static boolean isValidInt(String s)\n {\n for (int i = 0; i < s.length(); i++)\n {\n if (!Character.isDigit(s.charAt(i)))\n {\n return false;\n }\n }\n return true;\n }", "public boolean isNumeric(String strNum) {\n if (strNum == null) {\n return false;\n }\n try {\n double d = Double.parseDouble(strNum);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "private static boolean isNumeric(String str){\n return NumberUtils.isNumber(str);\n }", "public boolean isNumber(String s)\r\n {\r\n if (s == null)\r\n {\r\n return false;\r\n }\r\n s = s.trim();\r\n ValidNumberStateMachine vnsm = new ValidNumberStateMachine(s);\r\n return vnsm.isValid();\r\n }", "public static boolean isNumeric(String str) {\n try {\n Integer d = Integer.parseInt(str);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "private boolean isValid(String input){\n return input.length() == 10 && input.matches(\"-?\\\\d+(\\\\.\\\\d+)?\");\n //check its digits\n }", "private boolean checkInt(String str) {\n\t\ttry {\n\t\t\tint integer = Integer.parseInt(str);\n\t\t\tif(integer>=0&&integer<100000){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch(Exception e) {\n\t\t\treturn false;\n\t\t}\n\t}", "private boolean isValidNumber(String number) {\n if (null == number) {\n return false;\n }\n\n int i = 0;\n for (i = 0; i < number.length(); ++i) {\n if (number.charAt(i) != '+' && number.charAt(i) != '-') {\n if (Character.isDigit(number.charAt(i))) {\n break;\n }\n\n // Found a character that isn't a digit or sign\n return false;\n }\n }\n\n int firstDigitIndex = i;\n\n if (number.length() == i) {\n // The number has only signs\n return false;\n }\n\n return (number.substring(firstDigitIndex).chars().allMatch(Character::isDigit));\n }", "public static boolean isNumber(String str){\n try {\n Integer.parseInt(str);\n } catch(NumberFormatException e) {\n return false;\n } catch(NullPointerException e) {\n return false;\n }\n return true;\n }", "public static boolean containsOnlyNumbers(String string) {\n\n\t\tboolean letterFound = false;\n\n\t\tfor (char ch : string.toCharArray()) {\n\t\t\tif (Character.isLetter(ch)) {\n\t\t\t\tletterFound = true;\n\t\t\t}\n\t\t\tif (letterFound) {\n\t\t\t\t//Si tenemos letras retornar false\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t//Si no se encuentran letras, retornar true\n\t\treturn true;\n\t}", "private static boolean isNumeric(String str) {\n // The regular expression can match all numbers, including negative numbers\n Pattern pattern = Pattern.compile(\"-?[0-9]+(\\\\.[0-9]+)?\");\n String bigStr;\n try {\n bigStr = new BigDecimal(str).toString();\n } catch (Exception e) {\n return false;\n }\n // matcher是全匹配\n Matcher isNum = pattern.matcher(bigStr);\n return isNum.matches();\n }", "public static boolean isNumber(String text)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tInteger.parseInt(text);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tcatch(NumberFormatException e)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private static boolean isNegative(String value) {\n if (value.indexOf(\"-\") != -1) {\n return true;\n }\n return false;\n }", "public static boolean containsOnlyDigitsV1(String str) {\n\n if (str == null || str.isBlank()) {\n // or throw IllegalArgumentException\n return false;\n }\n \n for (int i = 0; i < str.length(); i++) {\n if (!Character.isDigit(str.charAt(i))) {\n return false;\n }\n }\n \n return true;\n }", "public static boolean isNumeric(String input) {\n\t\ttry {\n\t\t\tInteger.parseInt(input);\n\t\t\treturn true;\n\t\t}\n\t\tcatch (NumberFormatException e) {\n\t\t\t// string is not numeric\n\t\t\treturn false;\n\t\t}\n\t}", "public static boolean isIntValid (String str) {\r\n try {Integer.parseInt(str);} catch (NumberFormatException e) {return false;}\r\n return true;\r\n }", "public static boolean isNumeric(String aString) {\r\n if (aString == null) {\r\n return false;\r\n } else if (aString.isEmpty()) {\r\n return false;\r\n } else if (aString.indexOf(\".\") != aString.lastIndexOf(\".\")) {\r\n return false;\r\n } else {\r\n int counter = 0;\r\n for ( char c : aString.toCharArray()) {\r\n if ( Character.isDigit(c)) {\r\n counter++;\r\n }\r\n }\r\n return counter == aString.length();\r\n// if (counter == aString.length()) {\r\n// return true;\r\n// }\r\n// return false;\r\n }\r\n }", "private static boolean validNumber(String thing) {\n\t\treturn validDouble(thing);\n\t}", "private boolean isNumber(String s) {\n\t\ttry {\n\t\t\tDouble.parseDouble(s);\n\t\t} catch (NumberFormatException nfe) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public boolean isNum() \n\t{ \n\t try \n\t { \n\t int d = Integer.parseInt(numeric); \n\t } \n\t catch(NumberFormatException nfe) \n\t { \n\t return false; \n\t } \n\t return true; \n\t}", "public static boolean isNumeric(String cadena) {\n try {\n Integer.parseInt(cadena);\n return true;\n } catch (NumberFormatException ex) {\n return false;\n }\n }", "public static boolean isNumeric(String str) {\n if (isBlank(str)) {\n return false;\n }\n\n char[] charArray = str.toCharArray();\n\n for (char c : charArray) {\n if (!Character.isDigit(c)) {\n return false;\n }\n }\n\n return true;\n }", "public boolean isNumeric(String cadena) {\n try {\r\n Integer.parseInt(cadena);\r\n return true;\r\n } catch (NumberFormatException nfe) {\r\n return false;\r\n }\r\n }", "@Test\n public void isNumericNegetive() {\n Boolean bool = Utils.isNumeric(\"123a\");\n Assert.assertEquals(false, bool);\n }", "public static boolean isNumber(String str){\n return str != null && numberPattern.matcher(str).matches();\n }", "public static boolean isNumber(String text) {\r\n\t\ttry {\r\n\t\t\tInteger.parseInt(text);\r\n\t\t} catch(NumberFormatException e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public static boolean isNumeric(String str) {\n\t\ttry {\n\t\t\tInteger.parseInt(str.trim().substring(0, 1));\n\t\t\treturn true;\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t}", "public static boolean isNumeric(final String input) {\n\t\tif (input == null || input.isEmpty())\n\t\t\treturn false;\n\n\t\tfor (int i = 0; i < input.length(); i++)\n\t\t\tif (!Character.isDigit(input.charAt(i)))\n\t\t\t\treturn false;\n\n\t\treturn true;\n\t}", "protected boolean isNumber(String s)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tDouble.parseDouble(s);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tcatch(NumberFormatException ex)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private static boolean isNumeric(String str) { \n\t\ttry { \n\t\t\tDouble.parseDouble(str); \n\t\t} \n\t\tcatch(NumberFormatException nfe) { \n\t\t\treturn false; \n\t\t} \n\t\treturn true; \n\t}", "private static boolean isValidDigit(String strInput) {\n boolean isValid = true;\n if (isPrimitive(strInput)) {\n int input = Integer.parseInt(strInput);\n if (input < 1 || input > 255) {\n log.debug(\"Wrong config input value: {}\", strInput);\n isValid = false;\n } else {\n isValid = true;\n }\n\n } else {\n isValid = false;\n }\n\n return isValid;\n }", "private boolean validNum (int num) {\n if (num >= 0) return true;\n else return false;\n }", "public boolean isNumeric(String sNumericString) {\n try {\n for (char c : sNumericString.toCharArray()) {\n if (!Character.isDigit(c)) {\n return false;\n }\n }\n return true;\n } catch (Exception e) {\n return false;\n }\n }", "public static boolean isDigit(final String str) {\n if (str == null || str.length() == 0) {\n return false;\n }\n\n for (var i = 0; i < str.length(); i++) {\n if (!Character.isDigit(str.charAt(i)) && str.charAt(i) != '.') {\n return false;\n }\n }\n return true;\n }", "private static boolean stringContainsNumber( String userName ) {\n return Pattern.compile( \"[0-9]\" ).matcher( userName).find();\n }", "public static boolean isInt(String strNum) {\n try {\n int d = Integer.parseInt(strNum);\n } catch (NumberFormatException | NullPointerException nfe) {\n System.out.println(\"Invalid data format\");\n log.error(nfe);\n return false;\n }\n return true;\n }", "public boolean isNumeric(String str) {\n try {\n Double.parseDouble(str);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "public boolean isDigit(String s)\r\n\t\t{\n\t\t\tfor(char c : s.toCharArray())\r\n\t\t\t{\r\n\t\t\t if(!(Character.isDigit(c)))\r\n\t\t\t {\r\n\t\t\t return false;\r\n\t\t\t }\r\n\t\t\t}\r\n\t\t\t//return false;\r\n\t\t\treturn true;\r\n\t\t}", "private boolean isInteger(String userInput){\n if (userInput.matches(\"[0-9]+\")) {\n return true;\n }\n return false;\n }", "public static boolean isNumeric(String field) {\r\n\t\tif (isEmpty(field))\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\tfield = field.trim();\r\n\t\tif (field.trim().matches(\"[0-9\\\\-\\\\(\\\\)\\\\ ]*\")) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private boolean stringIsNumeric(String str) {\n\t\tfor(char c : str.toCharArray()) {\n\t\t\tif(!Character.isDigit(c)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public static boolean isInt(String str)\r\n\t{\r\n\t\tif (str == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tint length = str.length();\r\n\t\tif (length == 0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tint i = 0;\r\n\t\tif (str.charAt(0) == '-') {\r\n\t\t\tif (length == 1) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\ti = 1;\r\n\t\t}\r\n\t\tfor (; i < length; i++) {\r\n\t\t\tchar c = str.charAt(i);\r\n\t\t\tif (c < '0' || c > '9') {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public boolean checkInput(String str)\n {\n try\n {\n Integer.parseInt(str);\n } \n catch(NumberFormatException ex)\n {\n return false;\n } \n return true;\n }", "public static boolean isNumeric(String str)\n {\n return str.chars().allMatch( Character::isDigit );\n }" ]
[ "0.7693776", "0.7615872", "0.75708514", "0.7271431", "0.72654784", "0.7220075", "0.72040665", "0.7162199", "0.7089205", "0.7087527", "0.707254", "0.7049977", "0.702195", "0.70136744", "0.6997431", "0.6976338", "0.6963144", "0.6930662", "0.6922398", "0.6912647", "0.68971586", "0.68733394", "0.6872898", "0.6822372", "0.6817956", "0.6816447", "0.68113977", "0.6796967", "0.6795428", "0.67791784", "0.67470497", "0.67399937", "0.6736387", "0.6733442", "0.6727032", "0.672543", "0.6725412", "0.6721521", "0.6697544", "0.6696594", "0.66880286", "0.66798997", "0.6669947", "0.6665085", "0.66600615", "0.6656215", "0.6647381", "0.66396165", "0.66326463", "0.6625375", "0.6591661", "0.65841657", "0.65825766", "0.65809906", "0.6564779", "0.6563685", "0.6560194", "0.6555184", "0.6539923", "0.65307605", "0.6516179", "0.6510853", "0.65073484", "0.65017843", "0.6495687", "0.64867395", "0.64866817", "0.6474263", "0.64663655", "0.646507", "0.6464625", "0.6458098", "0.64550126", "0.64445674", "0.64439297", "0.64361227", "0.6435438", "0.64323163", "0.6431141", "0.64298034", "0.6429554", "0.64223254", "0.64220756", "0.6391272", "0.6389049", "0.6367769", "0.63564", "0.6344219", "0.63419306", "0.6335552", "0.63285065", "0.63113505", "0.63048863", "0.63042325", "0.6286876", "0.62818515", "0.6276757", "0.62713546", "0.6254009", "0.62499344" ]
0.6538426
59
Prompts the user to enter the maximum amount of time that the server will wait before sending a timeout
public int getTimeOut() { String time = JOptionPane.showInputDialog(null, "Please enter the timeout amount in milliseconds: ", "Set Timeout", JOptionPane.INFORMATION_MESSAGE); //Check to see if the entry was invalid while(!isNumber(time)) time = JOptionPane.showInputDialog(null, "You must enter a NUMBER. Please re-enter the timeout time in milliseconds: ", "Set Timeout", JOptionPane.INFORMATION_MESSAGE); return Integer.parseInt(time); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void timeout(String user, int time) { sendMessage(\"/timeout \" + user + \" \" + time); }", "protected int maxTimeout() { return 15*1000*1000; }", "int getTimeout();", "public long timeout(long timeout);", "long getTimeout();", "public int sendTimeout(){\n return 0; //TODO codavaj!!\n }", "public int getTimeout();", "public int explicitWait(){\n\t\tString time_out = null;\n\t\ttry {\n\t\t\ttime_out = new AutomationConfigurator().getTimeOut();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tif (time_out == null){\n\t\t\treturn default_timeout;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn Integer.parseInt(time_out);\n\t\t}\n\t}", "public void acceptTimeout();", "void alertTimeout(String msg)\n { /* alertTimeout */\n this.sleepFlag= false;\t/* flag for waiting */ \n updatePopupDialog(msg, \"\", null, 0);\n }", "int hardTimeout();", "private void checkTimeout() {\n val timeout = config.getInt(\"timeout\");\n\n checkArgument(timeout >= 1000, \"timeout is less than 1000!\");\n }", "int timeout();", "public void setTimeout(int timeout);", "public WaitForDigitCommand(long timeout) {\n super();\n this.timeout = timeout;\n }", "private void checkTimeout() {\n/* 169 */ if (this.socket != null) {\n/* */ \n/* 171 */ long i = this.keepaliveTimeoutMs;\n/* */ \n/* 173 */ if (this.listRequests.size() > 0)\n/* */ {\n/* 175 */ i = 5000L;\n/* */ }\n/* */ \n/* 178 */ long j = System.currentTimeMillis();\n/* */ \n/* 180 */ if (j > this.timeLastActivityMs + i)\n/* */ {\n/* 182 */ terminate(new InterruptedException(\"Timeout \" + i));\n/* */ }\n/* */ } \n/* */ }", "public long GetTimeout() { return timeout; }", "public void handleTimeout();", "@Override\n\tpublic void waitTimedOut() {\n\t\t\n\t\tif( busylinetimer == null )\n\t\t\treturn;\n\t\t\n\t\tbusylinetimer.stop();\n\t\tbusylinetimer = null;\n\t\t\n\t\tlog.info(\"linea ocupada por mas de 120 segundos, iniciando proceso para colgar llamada.......\");\n\t\t\n\t\tnew CellPhoneHandUpCall(modem,false);\n\t}", "protected int minTimeout() { return 500; }", "void timedOut();", "public void setTimeout(double timeout){\n this.timeout = timeout;\n }", "public void setNortpTimeout(int seconds);", "public int getNortpTimeout();", "public void setTimeOut(int value) {\n this.timeOut = value;\n }", "public WaitForDigitCommand() {\n super();\n this.timeout = -1;\n }", "public abstract void isTimeout(long ms);", "private void setTimedOut() {\n\t\tthis.timedOut.set(true);\n\t}", "public FormValidation doCheckLaunchTimeout(@QueryParameter String launchTimeout) {\n try {\n Integer num = Integer.valueOf(launchTimeout);\n if (num >= 0) {\n return FormValidation.ok();\n }\n } catch (Exception e) {\n return FormValidation.error(\"Timeout should be a valid number \");\n }\n return FormValidation.ok();\n }", "public void setTimeout(int timeout) {\r\n this.timeout = timeout;\r\n }", "public void setTimeout(final String timeout);", "public void setTimeout(Integer timeout) {\n\t\tthis.timeout = timeout;\n\t}", "public void setTimeout(int _timeout) {\n if (timeout < 0)\n return;\n timeout = _timeout;\n }", "public void setMaxWait(int maxWait) {\n\t\tif(maxWait < 0) {\n\t\t\tthrow new IllegalArgumentException(\"Wait time should be a positive number\");\n\t\t}\n\t\tthis.maxWait = maxWait;\n\t}", "public long getTimeout() { return timeout; }", "int getWaitTime();", "public void setTimeout( int timeout ) {\n this.timeout = timeout;\n }", "public void setTimeout(int timeout) {\n this.timeout = timeout;\n }", "public void resetTimeout(){\n this.timeout = this.timeoutMax;\n }", "public int getDelayedTimeout();", "public int getTimeout() {\n return params.getTimeout() * 1000;\n }", "public int getTimeout() {\r\n return timeout;\r\n }", "public void enquireTimeout(Long sessionId);", "public static int getTimeOut() {\n\t\tTIME_OUT = 10;\n\t\treturn TIME_OUT;\n\t}", "public void setMaxTime(Integer maxTime) {\n this.maxTime = maxTime;\n }", "public void setTimeout(int timeout) {\r\n\t\tthis.TIMEOUT = timeout;\r\n\t}", "public void requestTimeout(Pdu packet);", "private void popupTimeoutTrap() {\n\n LayoutInflater inflater = (LayoutInflater)\n getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n final View npView = inflater.inflate(R.layout.number_picker_dialog_layout, null);\n\n String[] values = new String[] {\"5\", \"10\", \"15\", \"20\", \"25\", \"30\"};\n NumberPicker np = ((NumberPicker) npView);\n np.setMinValue(0);\n np.setMaxValue(values.length - 1);\n np.setDisplayedValues(values);\n np.setWrapSelectorWheel(true);\n np.setValue(trap.getTimeout()/5 - 1);\n setNumberPickerTextColor(np, R.color.colorPrimaryDark);\n\n new AlertDialog.Builder(this)\n .setTitle(\"Timeout\")\n .setView(npView)\n .setPositiveButton(android.R.string.ok,\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int whichButton) {\n dialog.dismiss();\n\n MqttClient.getInstance().publish(Topic.TIMEOUT, trap.getId(),\n String.valueOf((((NumberPicker) npView).getValue() + 1)*5));\n }\n })\n .setNegativeButton(android.R.string.cancel,\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int whichButton) {\n dialog.cancel();\n }\n })\n .show();\n }", "public int getTimeout() {\n return timeout;\n }", "public int receiveTimeout(){\n return 0; //TODO codavaj!!\n }", "public void typeRemoteRequestTimeout(String value) {\n\t\tnew LabeledText(OpenShiftLabel.TextLabels.REMOTE_REQUEST_TIMEOUT).typeText(value);\n\t}", "public void setTimeout(long timeout)\r\n\t{\r\n\t\tthis.timeout = timeout;\r\n\t}", "private void startTimeOut(int seconds){\n\n timeoutTimer = new CountDownTimer(seconds* 1000 + 1000, 1000) {\n\n public void onTick(long millisUntilFinished) {}\n\n public void onFinish() {\n progressDialog.cancel();\n showErrorDialog(getString(R.string.msgNoConnection));\n }\n }.start();\n }", "public static void printTimelimit() {\n\t\n\tSystem.out.println(\"Time Limit \" + timeLimit);\n\t\n}", "public void setTimeout(final long timeout);", "RequestSender onTimeout(long timeout, Runnable runnable);", "protected void setTimeout() {\r\n\t\tTimeout timeout = new Timeout();\r\n\t\tt.schedule(timeout, TIMEOUT);\r\n\t}", "public LWTRTPdu timeout() throws IncorrectTransitionException;", "static void waitServerResponse(){\n try {\n Thread.sleep(5000);\n }catch(InterruptedException e){\n System.out.println(\"The application close due to an error.\");\n System.exit(-1);\n }\n }", "private void pickTime() {\n System.out.println(\"what time would you like to reserve?\");\n boolean keepgoing = true;\n int time;\n while (keepgoing) {\n time = input.nextInt();\n if (time < 0 || time > 23) {\n System.out.println(\"Invalid time, try again.\");\n } else {\n pickedtime = time;\n keepgoing = false;\n }\n }\n }", "public void setTimeout (int timeout) {\n\tif (timeout >= 0)\n\t call.setTimeout (new Integer (timeout));\n }", "public void delay(long waitAmount){\r\n long time = System.currentTimeMillis();\r\n while ((time+waitAmount)>=System.currentTimeMillis()){ \r\n //nothing\r\n }\r\n }", "public void setTimeout(long timeout) {\n this.timeout = timeout;\n }", "public void setTimeout(long timeout) {\n this.timeout = timeout;\n }", "public void setMaxTime(int aMaxTime)\n{\n // Set max time\n _maxTime = aMaxTime;\n \n // If time is greater than max-time, reset time to max time\n if(getTime()>_maxTime)\n setTime(_maxTime);\n}", "public void setTimeout(org.apache.axis.types.UnsignedInt timeout) {\n this.timeout = timeout;\n }", "void setTimeout(@Nullable Duration timeout);", "public SetIdleTimeoutCommand(int timeout) {\n this.timeout = timeout;\n }", "public void onTimeout();", "public int getTimeout() {\n\t\treturn (Integer)getObject(\"timeout\");\n\t}", "private void askForTime() {\n\t\tconnectToServer();\n\t\tout.println(\"What Time is It ?\");\n\t\tout.flush();\n\t\ttry {\n\t\t\tString time = in.readLine();\n\t\t\tSystem.out.println(\"CLIENT: The time is \" + time);\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tSystem.out.println(\"CLIENT: Cannot receive time from server\");\n\t\t}\n\t\tdisconnectFromServer();\n\t}", "private int optionQuestion(String message, int max) {\n System.out.println(message + \" (enter the number without parenthesis)\");\n return obtainIntSafely(1, max, (\"Type a number between 1 and \" + max));\n }", "private void waitForStateChange(int maxTTW) throws MqttException {\n synchronized (caller) {\n if (!donext) {\n try {\n caller.wait(maxTTW);\n } catch (InterruptedException e) {\n Debug.logError(\"Timed out.\" + e.getMessage(), MODULE);\n }\n\n if (ex != null) {\n throw (MqttException) ex;\n }\n }\n donext = false;\n }\n }", "public void setRemoteRequestTimeout(String value) {\n\t\tnew LabeledText(OpenShiftLabel.TextLabels.REMOTE_REQUEST_TIMEOUT).setText(value);\n\t}", "public void setSendTimeout(int sendTimeout){\n return; //TODO codavaj!!\n }", "public void setTimeout(int timeout) {\r\n\t\tconnTimeout = timeout;\r\n\t}", "public abstract void onTimeout();", "public void setTimeout(long timeout) {\n\t\tthis.timeout = timeout;\n\t}", "private void createGame() {\n String[] options = { \"2\", \"3\", \"4\" };\n String result = (String) JOptionPane.showInputDialog(frame, \"Please enter the max player amount (must be between 2-4\", \"Create game\", JOptionPane.QUESTION_MESSAGE, null, options, options[2]);\n if (result == null) {\n System.out.println(\"[Client] Cancelled game creation\");\n } else {\n connectedServer.writeMessage(client.create(Integer.parseInt(result)));\n gameWindow();\n }\n }", "public void time() {\n System.out.println(\"Enter the time you wish to free up\");\n }", "public void setTimeout(final int timeout) {\n this.timeout = timeout;\n }", "boolean awaitMessages(long timeout) throws InterruptedException;", "public void setTimeoutLength(int timeout) {\n\t\tmyTimeoutLength = timeout;\n\t\tif (myPort == null) {\n\t\t\treturn;\n\t\t}\n\t\tmyPort.setTimeoutLength(timeout);\n\t}", "public int getHardwareTimeout();", "public void setTimeout(Long value) {\r\n timeout = value;\r\n incompatibleWithSpawn |= timeout != null;\r\n }", "int askForTempMax();", "public void sessionTimeout() {\n\n AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(DeviceTrackerApplication.getContext());\n alertDialogBuilder.setTitle(getString(R.string.app_name));\n alertDialogBuilder\n .setMessage(R.string.session_expired)\n .setCancelable(false)\n .setPositiveButton(R.string.ok_msg, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n logout();\n }\n });\n alertDialog = alertDialogBuilder.create();\n alertDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);\n startSessionTimer(0);\n }", "public void processTransmissionTimeout() {\n //to be overridden by extending classes\n }", "public static void addWaitTime(double time){\n waitTimeTotal = waitTimeTotal + time;\n if (time > maxWaitTime) {\n maxWaitTime = time;\n }\n }", "private void tellTheUserToWait() {\n\t\tfinal JDialog warningDialog = new JDialog(descriptionDialog, ejsRes.getString(\"Simulation.Opening\"));\r\n\t\tfinal JLabel label = new JLabel(ejsRes.getString(\"Simulation.Opening\"));\r\n\t\tlabel.setBorder(new javax.swing.border.EmptyBorder(5, 5, 5, 5));\r\n\t\tSwingUtilities.invokeLater(new Runnable() {\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\twarningDialog.getContentPane().setLayout(new java.awt.BorderLayout());\r\n\t\t\t\twarningDialog.getContentPane().add(label, java.awt.BorderLayout.CENTER);\r\n\t\t\t\twarningDialog.validate();\r\n\t\t\t\twarningDialog.pack();\r\n\t\t\t\twarningDialog.setLocationRelativeTo(descriptionDialog);\r\n\t\t\t\twarningDialog.setModal(false);\r\n\t\t\t\twarningDialog.setVisible(true);\r\n\t\t\t}\r\n\t\t});\r\n\t\tjavax.swing.Timer timer = new javax.swing.Timer(3000, new ActionListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent _actionEvent) {\r\n\t\t\t\twarningDialog.setVisible(false);\r\n\t\t\t\twarningDialog.dispose();\r\n\t\t\t}\r\n\t\t});\r\n\t\ttimer.setRepeats(false);\r\n\t\ttimer.start();\r\n\t}", "public void setDelayedTimeout(int seconds);", "@Override\n\tpublic void setTimeout(long maxIdleTimeInMillis)\n\t\t\tthrows InvalidSessionException {\n\t}", "public static void waitTime(long s) {\n long l = System.currentTimeMillis() + s;\n while (System.currentTimeMillis() < l) {\n\n }\n }", "public void setResponseTimeOut(int timeOut)\n {\n fResponseTimeOut = timeOut;\n }", "@Override\n default UserpostPrx ice_timeout(int t)\n {\n return (UserpostPrx)_ice_timeout(t);\n }", "public int getMaxWait() {\n\t\treturn this.maxWait;\n\t}", "public int getDefaultTimeout() {\n return defaultTimeout;\n }", "public int getTimeOut() {\n return timeOut;\n }", "private static int getImplicitWaitTime()\n\t{\n\t\tString implicitWaitTime = System.getProperty(IMPLICIT_WAIT_TIME_KEY);\n\t\t\n\t\tif (implicitWaitTime == null || implicitWaitTime.isEmpty())\n\t\t{ \n\t\t\treturn implicitWaitDefaultTime; \n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn Integer.parseInt(implicitWaitTime);\n\t\t}\n\t}", "T setStartTimeout(Integer timeout);" ]
[ "0.7061178", "0.65005165", "0.63646483", "0.62893164", "0.62864", "0.6220695", "0.6182463", "0.6150231", "0.6150074", "0.60996926", "0.6076366", "0.6074248", "0.60198", "0.60002303", "0.59353894", "0.5917662", "0.59158933", "0.5905593", "0.58948815", "0.5887521", "0.58847237", "0.5883449", "0.5861731", "0.5850657", "0.5841671", "0.5823104", "0.5804504", "0.5803388", "0.57989097", "0.57723945", "0.5769438", "0.57454115", "0.5745183", "0.5736544", "0.5730374", "0.57268584", "0.57031375", "0.56931204", "0.5669805", "0.565867", "0.56581634", "0.5620299", "0.5616224", "0.56135476", "0.56075096", "0.56010264", "0.5598401", "0.55981183", "0.55974954", "0.55954456", "0.5584364", "0.5573687", "0.55696464", "0.55653113", "0.5555441", "0.55497813", "0.55452824", "0.5538443", "0.55285895", "0.55056465", "0.5487872", "0.54872525", "0.5475488", "0.5475488", "0.5474586", "0.5464675", "0.54554105", "0.5441429", "0.54302984", "0.54239655", "0.5423928", "0.54237765", "0.5419716", "0.5416038", "0.53990626", "0.53965944", "0.53927267", "0.5385962", "0.53796583", "0.53650314", "0.5361936", "0.53606164", "0.53483033", "0.5342668", "0.53398305", "0.5326545", "0.53257525", "0.5316631", "0.53163165", "0.5313551", "0.5311732", "0.5307111", "0.53008187", "0.5291512", "0.52864444", "0.52761924", "0.5276018", "0.5275329", "0.52703214", "0.52665746" ]
0.65355784
1
Paints the pieces on the board
public void paintComponent(Graphics g) { ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g.setColor(Color.WHITE); g.clearRect(0, 0, getWidth(), getHeight()); //Drawn the board for (int i = 0; i < 17; i++) { for (int j = 0; j < 17; j++) { if (board[i][j] != -1) { int x = (int) (getWidth() / 2 - WIDTH / 2 + 4 * SPACE / 2 - DIAMETER / 2) + (j * SPACE - i * SPACE / 2); int y = (int) ((getHeight() / 2 - HEIGHT / 2) + (i * SPACE * Math.sqrt(3) / 2)); g.setColor(Color.BLACK); g.fillOval(x - BORDER, y - BORDER, DIAMETER + 2 * BORDER, DIAMETER + 2 * BORDER); // 0 = empty position if (board[i][j] == 0) g.setColor(Color.LIGHT_GRAY); // 1-6 player positions else if (board[i][j] == 1) g.setColor(Color.RED); else if (board[i][j] == 2) g.setColor(Color.ORANGE); else if (board[i][j] == 3) g.setColor(Color.YELLOW); else if (board[i][j] == 4) g.setColor(Color.GREEN); else if (board[i][j] == 5) g.setColor(Color.BLUE); else if (board[i][j] == 6) g.setColor(Color.MAGENTA.darker()); g.fillOval(x, y, DIAMETER, DIAMETER); } } } //Display the current player g.setColor(Color.BLACK); g.setFont(g.getFont().deriveFont(Font.PLAIN, 32)); g.drawString("Current player: " + (turn), 5, 36); g.drawString("Total Turns: " + (totalTurn), 5, 76); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void paint(Graphics g){\r\n super.paintComponent(g);\r\n for(int row = 0; row < 8; row++) {\r\n for (int col = 0; col < 8; col++) {\r\n if((row % 2 == 0 && col % 2 == 0) || (row % 2 != 0 && col % 2 != 0)){\r\n g.setColor(Color.gray.brighter()); //pale yellow\r\n g.fillRect(col * tileSize, row * tileSize, tileSize, tileSize);\r\n }\r\n else{\r\n g.setColor(Color.gray.darker()); //dark brown\r\n g.fillRect(col * tileSize, row * tileSize, tileSize, tileSize);\r\n if ((currentPlayer.getColor()==checks[row][col])) {\r\n g.setColor(Color.darkGray.darker());\r\n g.fillRect(col * tileSize, row * tileSize, tileSize, tileSize);\r\n }\r\n if (this.nextMove[row][col] == 1) {\r\n g.setColor(Color.getHSBColor(98,70,43));\r\n g.fillRect(col * tileSize, row * tileSize, tileSize, tileSize);\r\n }\r\n if (this.checks[row][col] != 0) {\r\n if (this.checks[row][col] == WHITE) {\r\n drawPiece(row, col, g, Color.yellow.brighter());\r\n if (row == 7)\r\n g.drawImage(crownImage, (col * tileSize)+6, (row * tileSize) + 6, tileSize - 12, tileSize - 12, null);\r\n }\r\n else{\r\n drawPiece(row, col, g, Color.black);\r\n if (row == 0)\r\n g.drawImage(crownImage, (col * tileSize)+6, (row * tileSize) + 6, tileSize - 12, tileSize - 12, null);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if(isOver && isGame){\r\n gameOverDisplay(g);\r\n }\r\n }", "public void paint(Graphics graphics){\n\n\t\tsetSize(BOARD_SIZE, BOARD_SIZE);\n\n\t\tint iWidth = getWidth();\n\t\tint iHeight = getHeight();\n\n\t\t// print the cells of the game board\n\t\tfor(int i = 0; i< BOARD_LENGTH; i+=2){\n\t\t\tfor(int j = 0; j<BOARD_LENGTH; j+=2){\n\n\t\t\t\tgraphics.setColor(BOARD_FIELD_COLOR);\n\t\t\t\tgraphics.fillRect(j * iWidth / BOARD_LENGTH, (1 + i) * iWidth / BOARD_LENGTH, iWidth / BOARD_LENGTH, iHeight / BOARD_LENGTH); \n\t\t\t\tgraphics.fillRect((1 + j) * iWidth / BOARD_LENGTH, i * iWidth / BOARD_LENGTH, iWidth / BOARD_LENGTH, iHeight / BOARD_LENGTH);\n\t\t\t}\n\t\t}\n\n\t\t// print the pieces on the gameboard\n\t\tfor(int i = 0; i<BOARD_NUM_PIECES; i++){\n\t\t\tpieces[i].getPosition().x = rowToX(pieces[i].getColumnRow().y);\n\t\t\tpieces[i].getPosition().y = colToY(pieces[i].getColumnRow().x);\n\t\t\tif (pieces[i].isVisible())\n\t\t\t\tgraphics.drawImage(\n\t\t\t\t\t\tpieces[i].getPieceIcon(), \n\t\t\t\t\t\tpieces[i].getPosition().x,\n\t\t\t\t\t\tpieces[i].getPosition().y, \n\t\t\t\t\t\tiWidth / BOARD_LENGTH, \n\t\t\t\t\t\tiHeight / BOARD_LENGTH, this);\n\n\t\t} \n\t\t// this is a square hightlighted\n\t\tif(this.okToMove){\n\t\t\tgraphics.setColor(Color.green.darker());\n\t\t\tgraphics.drawRect(pieces[pieceChosen].getPosition().x,\n\t\t\t\t\tpieces[pieceChosen].getPosition().y, BOARD_PIECE_LENGTH, BOARD_PIECE_LENGTH);\n\n\t\t\tgraphics.setColor(Color.green.brighter().brighter());\n\t\t\tgraphics.drawRect(pieces[pieceChosen].getPosition().x + 1,\n\t\t\t\t\tpieces[pieceChosen].getPosition().y + 1, BOARD_PIECE_LENGTH-2, BOARD_PIECE_LENGTH-2);\n\n\t\t\tgraphics.setColor(Color.green.darker());\n\t\t\tgraphics.drawRect(pieces[pieceChosen].getPosition().x + 2,\n\t\t\t\t\tpieces[pieceChosen].getPosition().y + 2, BOARD_PIECE_LENGTH-4, BOARD_PIECE_LENGTH-4);\n\n\t\t} \n\t}", "@Override\n public void paintComponent(Graphics g){\n // Paint the well\n g.setColor(Color.DARK_GRAY);\n g.fillRoundRect(0, 0, 338, 546, 8, 8);\n\n for (int i = 1; i < 21; i++){\n for (int j = 1; j < 13; j++){\n g.setColor(Color.BLACK);\n g.fillRoundRect(26 * j - 13, 26 * i - 13, 25, 25, 2, 2);\n }\n }\n\n drawPiece(g);\n }", "public void paintComponent(final Graphics the_graphics)\n {\n super.paintComponent(the_graphics);\n final Graphics2D g2d = (Graphics2D) the_graphics;\n g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, \n RenderingHints.VALUE_ANTIALIAS_ON);\n g2d.setFont(my_font);\n g2d.setColor(Color.WHITE);\n g2d.setStroke(new BasicStroke(STROKE_SIZE));\n g2d.drawString(PIECE_STRING, (getWidth() / (STROKE_SIZE * STROKE_SIZE)) - \n (PIECE_STRING.length() / STROKE_SIZE), (int) (getHeight() * LABEL_STARTING_Y));\n \n for (int y = Piece.NUMBER_OF_BLOCKS - 1; 0 <= y; y--) \n {\n for (int x = 0; x < Piece.NUMBER_OF_BLOCKS; x++) \n {\n for (int i = 0; i < Piece.NUMBER_OF_BLOCKS; i++) \n {\n final Point block = my_board.nextPiece().blocks()[i];\n if (block.x() == x && block.y() == y) \n {\n g2d.setColor(my_board.nextPiece().color());\n g2d.fill(new Rectangle2D.Double((x * getWidth() * BLOCK_SIZE_CONSTANT) + \n (int) (getWidth() * BLOCK_STARTING_X), (getHeight() / 2) + \n (float) (getWidth() * BLOCK_SIZE_CONSTANT) - (y * getWidth() * \n BLOCK_SIZE_CONSTANT), getWidth() * BLOCK_SIZE_CONSTANT, getWidth() * \n BLOCK_SIZE_CONSTANT));\n g2d.setColor(Color.DARK_GRAY);\n g2d.draw(new Rectangle2D.Double((x * getWidth() * BLOCK_SIZE_CONSTANT) + \n (int) (getWidth() * BLOCK_STARTING_X), (getHeight() / 2) + \n (float) (getWidth() * BLOCK_SIZE_CONSTANT) - (y * getWidth() * \n BLOCK_SIZE_CONSTANT), getWidth() * BLOCK_SIZE_CONSTANT, getWidth() * \n BLOCK_SIZE_CONSTANT));\n } \n }\n }\n }\n }", "public void draw()\n\t{\n\t\tSystem.out.println(\" |-------------------------------|\");\n\t\t\n\t\tfor (int i = 0; i < board_size; i++)\n\t\t{\n\t\t\tSystem.out.print(board_size - i + \" |\");\n\t\t\t\n\t\t\tfor (int j = 0; j < board_size; j++)\n\t\t\t{\n\t\t\t\tif (getPiece(i,j) == null) {System.out.print(\" |\");}\n\t\t\t\telse {System.out.print(\" \" + getPiece(i,j).getSymbol().toChar() + \" |\");}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"\");\n\t\t\tSystem.out.println(\" |-------------------------------|\");\n\t\t}\n\t\t\n\t\tSystem.out.println(\" A B C D E F G H \\n\");\n\t}", "private void drawStuff() {\n //Toolkit.getDefaultToolkit().sync();\n g = bf.getDrawGraphics();\n bf.show();\n Image background = window.getBackg();\n try {\n g.drawImage(background, 4, 24, this);\n\n for(i=12; i<264; i++) {\n cellKind = matrix[i];\n\n if(cellKind > 0)\n g.drawImage(tile[cellKind], (i%12)*23-3, (i/12)*23+17, this);\n }\n\n drawPiece(piece);\n drawNextPiece(pieceKind2);\n\n g.setColor(Color.WHITE);\n g.drawString(\"\" + (level+1), 303, 259);\n g.drawString(\"\" + score, 303, 339);\n g.drawString(\"\" + lines, 303, 429);\n\n } finally {bf.show(); g.dispose();}\n }", "public void drawPiece(Graphics g){\n if (current == null){\n return;\n }\n\n for (int y = 1; y < 21; y++){\n for (int x = 1; x < 13; x++){\n if (map[x][y]){\n g.setColor(colors[x][y]);\n g.fillRoundRect(26 * x - 13, 26 * (21 - y) - 13, 25, 25, 2, 2);\n }\n }\n }\n }", "@Override \r\n public void paintComponent(final Graphics theGraphics) { \r\n super.paintComponent(theGraphics); \r\n final Graphics2D g2d = (Graphics2D) theGraphics; \r\n \r\n final int width = myBoard.getWidth(); \r\n final int height = myBoard.getHeight(); \r\n g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, \r\n RenderingHints.VALUE_ANTIALIAS_ON); \r\n \r\n // draw purple game grid\r\n g2d.setColor(PURPLE); \r\n for (int i = 0; i < Math.max(width, height); i++) { \r\n final int lines = i * GRID_SIZING; \r\n \r\n //draws horizontal lines\r\n g2d.draw(new Line2D.Double(lines, ZERO, lines, height * GRID_SIZING));\r\n \r\n //draws vertical lines\r\n g2d.draw(new Line2D.Double(ZERO, lines, width * GRID_SIZING, lines));\r\n \r\n if (myBoard.isGameOver()) { \r\n myGameOver = true; \r\n myGamePaused = true; \r\n }\r\n } \r\n \r\n //update blocks\r\n drawCurrentPiece(g2d, height, width);\r\n drawFrozenBlocks(g2d, height, width);\r\n handlePausedGame(g2d);\r\n }", "private void draw() {\n GraphicsContext gc = canvas.getGraphicsContext2D();\n\n double size = getCellSize();\n Point2D boardPosition = getBoardPosition();\n\n // Clear the canvas\n gc.clearRect(0, 0, canvas.getWidth(), canvas.getHeight());\n\n // Draw the grid\n gc.setStroke(Color.LIGHTGRAY);\n for (int i = 0; i <= board.getWidth(); i++) {\n gc.strokeLine(boardPosition.getX() + i * size, boardPosition.getY(),\n boardPosition.getX() + i * size, boardPosition.getY() + board.getHeight() * size);\n }\n\n for (int i = 0; i <= board.getHeight(); i++) {\n gc.strokeLine(boardPosition.getX(), boardPosition.getY() + i * size,\n boardPosition.getX() + board.getWidth() * size, boardPosition.getY() + i * size);\n }\n\n // Draw cells\n gc.setFill(Color.ORANGE);\n for (int i = 0; i < board.getWidth(); i++) {\n for (int j = 0; j < board.getHeight(); j++) {\n if (board.isAlive(i, j)) {\n gc.fillRect(boardPosition.getX() + i * size, boardPosition.getY() + j * size, size, size);\n }\n }\n }\n }", "void draw_pieces(int x, int y, char[][] _display, char[][] _board) {\n for (int i = 0; i < 8; i++) {\n for (int j = 0; j < 8; j++) {\n switch (_board[i][j]) {\n case ' ':\n break;\n case 'p':\n draw_text(i*8 + 2 + x, j*4 + 2 + y, _display, \" _ \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 1, _display, \" (_) \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 2, _display, \" /_\\\\ \");\n break;\n case 'r':\n draw_text(i*8 + 2 + x, j*4 + 2 + y, _display, \" [###] \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 1, _display, \" |_| \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 2, _display, \" /___\\\\ \");\n break;\n case 'k':\n draw_text(i*8 + 2 + x, j*4 + 2 + y, _display, \" /\\\\_ \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 1, _display, \" / o = \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 2, _display, \" \\\\ \\\\ \");\n break;\n case 'b':\n draw_text(i*8 + 2 + x, j*4 + 2 + y, _display, \" O \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 1, _display, \" ( ) \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 2, _display, \" / \\\\ \");\n break;\n case 'q':\n draw_text(i*8 + 2 + x, j*4 + 2 + y, _display, \" \\\\\\\\|// \");\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 1, _display, \" )_( \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 2, _display, \" /___\\\\ \" );\n break;\n case 'K':\n draw_text(i*8 + 2 + x, j*4 + 2 + y, _display, \" [###] \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 1, _display, \" (___) \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 2, _display, \" /___\\\\ \");\n break;\n default:\n break;\n }\n }\n }\n }", "public void paint () {\n\t\tPaint.clear();\n\t\t\n\t\tPaint.setColor(Color.WHITE);\n\t\tPaint.fillRect(0,0,numcols_ * cellsize_,numrows_ * cellsize_);\n\t\tPaint.setColor(Color.GRAY);\n\t\tPaint.drawRect(0,0,numcols_ * cellsize_ - 1,numrows_ * cellsize_ - 1);\n\n\t\tfor ( int row = 0 ; row < numrows_ ; row++ ) {\n\t\t\tfor ( int col = 0 ; col < numcols_ ; col++ ) {\n\t\t\t\tint x = col * cellsize_;\n\t\t\t\tint y = row * cellsize_;\n\n\t\t\t\tThing thing = at(row,col);\n\t\t\t\tif ( thing != null ) {\n\t\t\t\t\tthing.paint(x,y,cellsize_,cellsize_);\n\t\t\t\t}\n\t\t\t\tPaint.setColor(Color.GRAY);\n\t\t\t\tPaint.drawRect(x,y,cellsize_,cellsize_);\n\t\t\t}\n\t\t}\n\n\t}", "private void paintGrid() {\n\n g2d.setColor(_BOARDCOLOR); //Set the color to specific color of the board.\n\n for(int i = 0; i < grids.size(); i++) { //Iterating the 16 grids while drawing each on JComponent.\n\n g2d.draw(grids.get(i));\n }\n }", "@Override\n public String[] draw() {\n Piece[][] pieces = solver.getSolution();\n int height = pieces.length;\n int width = pieces[0].length;\n char[][] board = new char[height * 4][width * 4 + 1];\n int totalPieces = pieces.length * pieces[0].length;\n int countPieces = 0;\n // run through each piece and add it to the temp board\n for (int i = 0; i < height; i++) {\n for (int j = 0; j < width; j++) {\n countPieces++;\n Piece curPiece = pieces[i][j];\n int tempHeight = i * 4 + 1;\n int tempWidth = j * 4 + 2;\n if (curPiece == null) {\n board[tempHeight][tempWidth] = EMPTY;\n board[tempHeight][tempWidth + 1] = EMPTY;\n board[tempHeight][tempWidth + 2] = EMPTY;\n board[tempHeight + 1][tempWidth] = EMPTY;\n board[tempHeight + 1][tempWidth + 1] = EMPTY;\n board[tempHeight + 1][tempWidth + 2] = EMPTY;\n board[tempHeight + 2][tempWidth] = EMPTY;\n board[tempHeight + 2][tempWidth + 1] = EMPTY;\n board[tempHeight + 2][tempWidth + 2] = EMPTY;\n Arrays.fill(board[tempHeight + 3], EMPTY);\n } else {\n char[][] displayPiece = pieceToDisplay(curPiece);\n\n board[tempHeight][tempWidth] = displayPiece[0][0];\n board[tempHeight][tempWidth + 1] = displayPiece[0][1];\n board[tempHeight][tempWidth + 2] = displayPiece[0][2];\n board[tempHeight + 1][tempWidth] = displayPiece[1][0];\n board[tempHeight + 1][tempWidth + 1] = displayPiece[1][1];\n board[tempHeight + 1][tempWidth + 2] = displayPiece[1][2];\n board[tempHeight + 2][tempWidth] = displayPiece[2][0];\n board[tempHeight + 2][tempWidth + 1] = displayPiece[2][1];\n board[tempHeight + 2][tempWidth + 2] = displayPiece[2][2];\n Arrays.fill(board[tempHeight + 3], EMPTY);\n }\n }\n }\n\n // convert the completed char[][] to the final string[]\n return finalBoard(board, totalPieces, totalPieces - countPieces);\n }", "private void displayBoard() {\r\n\r\n for (int r = 0; r < 8; r++) {\r\n for (int c = 0; c < 8; c++) {\r\n if (model.pieceAt(r, c) == null)\r\n board[r][c].setIcon(null);\r\n else if (model.pieceAt(r, c).player() == Player.WHITE) {\r\n if (model.pieceAt(r, c).type().equals(\"Pawn\"))\r\n board[r][c].setIcon(wPawn);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Rook\"))\r\n board[r][c].setIcon(wRook);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Knight\"))\r\n board[r][c].setIcon(wKnight);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Bishop\"))\r\n board[r][c].setIcon(wBishop);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Queen\"))\r\n board[r][c].setIcon(wQueen);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"King\"))\r\n board[r][c].setIcon(wKing);\r\n } else if (model.pieceAt(r, c).player() == Player.BLACK) {\r\n if (model.pieceAt(r, c).type().equals(\"Pawn\"))\r\n board[r][c].setIcon(bPawn);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Rook\"))\r\n board[r][c].setIcon(bRook);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Knight\"))\r\n board[r][c].setIcon(bKnight);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Bishop\"))\r\n board[r][c].setIcon(bBishop);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Queen\"))\r\n board[r][c].setIcon(bQueen);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"King\"))\r\n board[r][c].setIcon(bKing);\r\n }\r\n repaint();\r\n }\r\n }\r\n if (model.inCheck(Player.WHITE))\r\n JOptionPane.showMessageDialog(null, \"White King in Check\");\r\n if (model.inCheck(Player.BLACK))\r\n JOptionPane.showMessageDialog(null, \"Black King in Check\");\r\n if (model.movingIntoCheck())\r\n JOptionPane.showMessageDialog(null, \"Cannot move into check\");\r\n if (model.isComplete())\r\n JOptionPane.showMessageDialog(null, \"Checkmate\");\r\n }", "public void createPieces(){ \n\t\tfor(int x = 0; x<BOARD_LENGTH; x++){\n\t\t\tfor(int y = 0; y<BOARD_LENGTH; y++){ \n\t\t\t\tif(CHESS_MAP[x][y] != (null)){\n\t\t\t\t\tswitch (CHESS_MAP[x][y]){\n\t\t\t\t\tcase KING:\n\t\t\t\t\t\tpieces[pieceCounter] = new King(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase QUEEN:\n\t\t\t\t\t\tpieces[pieceCounter] = new Queen(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BISHOP:\n\t\t\t\t\t\tpieces[pieceCounter] = new Bishop(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase KNIGHT:\n\t\t\t\t\t\tpieces[pieceCounter] = new Knight(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PAWN:\n\t\t\t\t\t\tpieces[pieceCounter] = new Pawn(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ROOK:\n\t\t\t\t\t\tpieces[pieceCounter] = new Rook(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} \n\t\t\t\t\tsetPieceIconAndName(x, y, CHESS_MAP[x][y]); \t\n\t\t\t\t\tpieceCounter++;\n\t\t\t\t}else{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t}", "public void paintComponent(Graphics g)\r\n {\r\n super.paintComponent(g);\r\n g2 = (Graphics2D) g;\r\n this.setBackground(Color.black);\r\n\r\n this.addMouseListener(this);\r\n this.addMouseMotionListener(this);\r\n Image chPieces;\r\n chPieces = new ImageIcon(\"C:/Users/eolochr/Desktop/backup/own/code/Ch/ChessPieces.png\").getImage();\r\n for (int x = 0; x < 8; x++)\r\n {\r\n for (int y = 0; y < 8; y++)\r\n {\r\n if ((x % 2 == 0 && y % 2 == 0) || (x % 2 == 1 && y % 2 == 1))\r\n {\r\n g.setColor(Color.white);\r\n }\r\n else if ((x % 2 == 0 && y % 2 == 1) || (x % 2 == 1 && y % 2 == 0))\r\n {\r\n g.setColor(Color.gray);\r\n }\r\n else\r\n {}\r\n g.fillRect(sizeOfSquare * x, sizeOfSquare * y, sizeOfSquare, sizeOfSquare);\r\n\r\n g.drawString(y + \"\", 420, 24 + (sizeOfSquare * y));\r\n g.drawString(x + \"\", 24 + (sizeOfSquare * x), 420);\r\n }\r\n\r\n }\r\n\r\n for (int i = 0; i < 64; i++) //taken, not my logic\r\n {\r\n int j = -1, k = -1;\r\n switch (Movements.chessBoard[i / 8][i % 8])\r\n {\r\n\r\n case \"R\":\r\n j = 2;\r\n k = 0;\r\n break;\r\n case \"P\":\r\n j = 5;\r\n k = 0;\r\n break;\r\n case \"K\":\r\n j = 4;\r\n k = 0;\r\n break;\r\n case \"B\":\r\n j = 3;\r\n k = 0;\r\n break;\r\n case \"Q\":\r\n j = 1;\r\n k = 0;\r\n break;\r\n case \"A\":\r\n j = 0;\r\n k = 0;\r\n break;\r\n\r\n case \"p\":\r\n j = 5;\r\n k = 1;\r\n break;\r\n case \"r\":\r\n j = 2;\r\n k = 1;\r\n break;\r\n case \"k\":\r\n j = 4;\r\n k = 1;\r\n break;\r\n case \"b\":\r\n j = 3;\r\n k = 1;\r\n break;\r\n case \"q\":\r\n j = 1;\r\n k = 1;\r\n break;\r\n case \"a\":\r\n j = 0;\r\n k = 1;\r\n break;\r\n\r\n }\r\n if (j != -1 && k != -1)\r\n {\r\n g.drawImage(chPieces, (i % 8) * sizeOfSquare, (i / 8) * sizeOfSquare, (i % 8 + 1) * sizeOfSquare, (i / 8 + 1) * sizeOfSquare, j * 64, k * 64, (j + 1) * 64,\r\n (k + 1) * 64, this);\r\n }\r\n }\r\n g.setColor(Color.GREEN);\r\n\r\n if (Movements.turnC)\r\n {\r\n g.drawString(\"White turn\", 150, 440);\r\n }\r\n else\r\n {\r\n g.drawString(\"Black turn\", 150, 440);\r\n }\r\n\r\n if(movement.length() > 3)\r\n {\r\n g.drawString(\"Selected square: \" + movement.charAt(0) + movement.charAt(1), 120, 460);\r\n }\r\n\r\n\r\n if (Movements.checkC)\r\n {\r\n g.drawString(\"Check white\", 240, 440);\r\n }\r\n else if (Movements.checkL)\r\n {\r\n g.drawString(\"Check black\", 240, 440);\r\n }\r\n\r\n }", "protected void drawPossibleMoves(){\n if (selectedPiece == null) return;\n Pair<Integer,Integer> coord = getJButtonCoord(selectedPiece);\n int startRow = coord.getKey();\n int startCol = coord.getValue();\n for(int row = 0;row < ROWS;row ++){\n for(int col = 0; col < COLS ;col++){\n if (board.canMove(startRow,startCol,row,col)){\n buttonGrid[row][col].setBackground(Color.GREEN);\n }\n }\n }\n\n\n }", "public void paint() {\n for (int row = 0; row < ROWS; ++row) {\n for (int col = 0; col < COLS; ++col) {\n cells[row][col].paint();\n if (col < COLS - 1) System.out.print(\"|\");\n }\n System.out.println();\n if (row < ROWS - 1) {\n System.out.println(\"-----------\");\n }\n }\n }", "private void drawBoard(int N) {\n\t\tfor (int i = 0; i < N; i++) {\n for (int j = 0; j < N; j++) {\n if ((i + j) % 2 == 0) StdDrawPlus.setPenColor(StdDrawPlus.GRAY);\n else StdDrawPlus.setPenColor(StdDrawPlus.BLACK);\n StdDrawPlus.filledSquare(i + .5, j + .5, .5);\n StdDrawPlus.setPenColor(StdDrawPlus.WHITE);\n }\n }\n\n if (hasSelected) {\n StdDrawPlus.setPenColor(StdDrawPlus.WHITE);\n \tStdDrawPlus.filledSquare(prevSelectedX + .5, prevSelectedY + .5, .5);\n }\n\n // Drawing pieces\n for (int x = 0; x < 8; x++) {\n \tfor (int y = 0; y < 8; y++) {\n \t\tPiece p = pieceAt(x, y);\n \t\tif (p != null) {\n\t \t\t\tif (p.isFire() && p.isShield() && !p.isKing()) {\n\t \t\t\t\tStdDrawPlus.picture(x + .5, y + .5, \"img/shield-fire.png\", 1, 1);\n\t \t\t\t}\n\t \t\t\telse if (p.isFire() && p.isBomb() && !p.isKing()) {\n\t \t\t\t\tStdDrawPlus.picture(x + .5, y + .5, \"img/bomb-fire.png\", 1, 1);\n\t \t\t\t}\n\t \t\t\telse if (!p.isFire() && p.isBomb() && !p.isKing()) {\n\t \t\t\t\tStdDrawPlus.picture(x + .5, y + .5, \"img/bomb-water.png\", 1, 1);\n\t \t\t\t}\n\t \t\t\telse if (!p.isFire() && p.isShield() && !p.isKing()) {\n\t \t\t\t\tStdDrawPlus.picture(x + .5, y + .5, \"img/shield-water.png\", 1, 1);\n\t \t\t\t}\n\t \t\t\telse if (!p.isFire() && !p.isKing()) {\n\t \t\t\t\tStdDrawPlus.picture(x + .5, y + .5, \"img/pawn-water.png\", 1, 1);\n\t \t\t\t}\n\t \t\t\telse if (p.isFire() && !p.isKing()) {\n\t \t\t\t\tStdDrawPlus.picture(x + .5, y + .5, \"img/pawn-fire.png\", 1, 1);\n\t \t\t}\n\t \t\telse if (p.isFire() && p.isBomb() && p.isKing()) {\n\t \t\t\tStdDrawPlus.picture(x + .5, y + .5, \"img/bomb-fire-crowned.png\", 1, 1);\n\t \t\t}\n\t \t\telse if (p.isFire() && p.isShield() && p.isKing()) {\n\t \t\t\tStdDrawPlus.picture(x + .5, y + .5, \"img/shield-fire-crowned.png\", 1, 1);\n\t \t\t}\n\t \t\telse if (p.isFire() && p.isKing()) {\n\t \t\t\tStdDrawPlus.picture(x + .5, y + .5, \"img/pawn-fire-crowned.png\", 1, 1);\n\t \t\t}\n\t \t\telse if (!p.isFire() && p.isBomb() && p.isKing()) {\n\t \t\t\tStdDrawPlus.picture(x + .5, y + .5, \"img/bomb-water-crowned.png\", 1, 1);\n\t \t\t}\n\t \t\telse if (!p.isFire() && p.isShield() && p.isKing()) {\n\t \t\t\tStdDrawPlus.picture(x + .5, y + .5, \"img/shield-fire-crowned.png\", 1, 1);\n\t \t\t}\n\t \t\telse if (!p.isFire() && p.isKing()) {\n\t \t\t\tStdDrawPlus.picture(x + .5, y + .5, \"img/pawn-water-crowned.png\", 1, 1);\n\t \t\t}\n\t \t}\n \t}\n }\n\t}", "private void drawGrid() {\r\n\t\t// loops through the 2d array of the grid.\r\n\t\tfor (int i = 0; i < TetrisGame.PANEL_WIDTH; i++) {\r\n\t\t\tfor (int j = 0; j < TetrisGame.PANEL_HEIGHT; j++) {\r\n\t\t\t\t// checks to see if the piece isn't empty, and draws the piece at it's position.\r\n\t\t\t\tif (game.grid[i][j] != Piece.PieceShape.E) {\r\n\t\t\t\t\tdrawSquare(i, j, Piece.getColor(game.grid[i][j]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void doDrawing(Graphics g) {\n Dimension size = getSize();\n//paint all the shapes that have been dropped to the bottom \n int boardTop = (int) size.getHeight() - BOARD_HEIGHT * squareHeight();\n\n for (int i = 0; i < BOARD_HEIGHT; ++i) {\n\n for (int j = 0; j < BOARD_WIDTH; ++j) {\n// access all the squares that were stored in the board array\n Tetrominoe shape = shapeAt(j, BOARD_HEIGHT - i - 1);\n\n if (shape != Tetrominoe.NoShape) {\n \n drawSquare(g, 0 + j * squareWidth(),\n boardTop + i * squareHeight(), shape);\n }\n }\n }\n//paint the falling piece\n if (curPiece.getShape() != Tetrominoe.NoShape) {\n\n for (int i = 0; i < 4; ++i) {\n\n int x = curX + curPiece.x(i);\n int y = curY - curPiece.y(i);\n drawSquare(g, 0 + x * squareWidth(),\n boardTop + (BOARD_HEIGHT - y - 1) * squareHeight(),\n curPiece.getShape());\n }\n }\n }", "public void paint(Graphics g) {\n int rad = 30;\n int x = border;\n int y = border;\n size = 400/n;\n\n for (int i = 0; i < n; i++) {\n y = i * size + border;\n for (int j = 0; j < n; j++) {\n x = j * size + border;\n int z = matrix[i][j].getColor();\n\n if (matrix[i][j].isClicked()) {\n setRectColor(g, z); \n }\n\n else {\n g.setColor(Color.white);\n }\n\n g.fillRect(x, y, size, size);\n g.setColor(Color.black);\n g.drawRect(x, y, size, size);\n\n if (matrix[i][j].isDot()) {\n setDotColor(g, z);\n drawCircle(g, x, y, rad);\n }\n }\n }\n\n if (isOver()==true) { //Draw win screen if entire board is filled\n g.setColor(Color.white);\n g.fillRect(70, 70, 300, 225);\n g.setColor(Color.black);\n g.drawRect(70, 70, 300, 225);\n \n youWin(g, 110, 160, game.getMoves());\n }\n\n\n }", "public abstract void drawPiece(int x, int y, Graphics g);", "@Override\n protected void onDraw(Canvas canvas) {\n super.onDraw(canvas);\n\n int width = getWidth();\n int height = getHeight();\n float pieceWidth = width/5.0f-5;\n float pieceHeight = height/3.0f-20;\n Log.d(\"hello\", \"DRAWINGGGGGGG\");\n\n //this.paint.setColor(Color.WHITE);\n this.paint.setStyle(Paint.Style.FILL);\n //canvas.drawPaint(this.paint);\n canvas.drawColor(0x00000000);\n\n this.paint.setColor(Color.WHITE);\n //canvas.drawRect(0, 0, 100, 100, this.paint);\n\n\n for(int i = 0; i < 5; i++)\n for(int j = 0; j<3; j++){\n Cell cell = grid.getCellAt(i, j);\n if(cell!=null){\n //Before you can call any drawing methods, though, it's necessary to create a Paint object.\n\n this.paint.setColor(cell.getColor());\n canvas.drawRect(i*pieceWidth, j*pieceHeight, i*pieceWidth + pieceWidth, j*pieceHeight + pieceHeight, this.paint);\n\n this.paint.setColor(Color.WHITE);\n this.paint.setStrokeWidth(4);\n //Lines on window\n canvas.drawLine(i*pieceWidth, j*pieceHeight, i*pieceWidth, j*pieceHeight + pieceHeight, this.paint);\n canvas.drawLine(i*pieceWidth, j*pieceHeight, i*pieceWidth + pieceWidth, j*pieceHeight, this.paint);\n canvas.drawLine(i*pieceWidth + pieceWidth, j*pieceHeight, i*pieceWidth + pieceWidth, j*pieceHeight + pieceHeight, this.paint);\n canvas.drawLine(i*pieceWidth, j*pieceHeight + pieceHeight, i*pieceWidth + pieceWidth, j*pieceHeight + pieceHeight, this.paint);\n\n }\n }\n\n\n\n }", "private void draw(){\n GraphicsContext gc = canvasArea.getGraphicsContext2D();\n canvasDrawer.drawBoard(canvasArea, board, gc, currentCellColor, currentBackgroundColor, gridToggle);\n }", "public void setPieces(){\r\n Pawn[] arrwPawn = new Pawn[8];\r\n for (int i=0 ; i<8 ; i++){\r\n pos.setPosition(6,i);\r\n arrwPawn[i] = new Pawn (pos , piece.Colour.WHITE);\r\n GameBoard.putPiece(arrwPawn[i]);\r\n }\r\n\r\n Pawn[] arrbPawn = new Pawn[8];\r\n for(int i=0 ; i<8 ; i++){\r\n pos.setPosition(0,i);\r\n arrbPawn[i] = new Pawn(pos , piece.Colour.BLACK);\r\n GameBoard.putPiece(arrbPawn[i]);\r\n }\r\n\r\n\r\n //set black pieces in the board\r\n\r\n pos.setPosition(0,0);\r\n Rook bRook1 = new Rook(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bRook1);;\r\n\r\n pos.setPosition(0,7);\r\n Rook bRook2 = new Rook(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bRook2);\r\n\r\n\r\n pos.setPosition(0,1);\r\n Knight bKnight1 = new Knight(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKnight1);\r\n\r\n pos.setPosition(0,6);\r\n Knight bKnight2 = new Knight(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKnight1);\r\n\r\n pos.setPosition(0,2);\r\n Bishop bBishop1 = new Bishop(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bBishop1);\r\n\r\n pos.setPosition(0,5);\r\n Bishop bBishop2 = new Bishop(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bBishop2);\r\n\r\n pos.setPosition(0,3);\r\n Queen bQueen = new Queen(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bQueen);\r\n\r\n pos.setPosition(0,4);\r\n King bKing = new King(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKing);\r\n\r\n //set white pieces in the board\r\n\r\n pos.setPosition(7,0);\r\n Rook wRook1 = new Rook(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wRook1);\r\n\r\n pos.setPosition(7,7);\r\n Rook wRook2 = new Rook(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wRook2);\r\n\r\n pos.setPosition(7,1);\r\n Knight wKnight1 = new Knight(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKnight1);\r\n\r\n pos.setPosition(7,6);\r\n Knight wKnight2 = new Knight(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKnight1);\r\n\r\n pos.setPosition(7,2);\r\n Bishop wBishop1 = new Bishop(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wBishop1);\r\n\r\n pos.setPosition(7,5);\r\n Bishop wBishop2 = new Bishop(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wBishop2);\r\n\r\n pos.setPosition(7,3);\r\n Queen wQueen = new Queen(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wQueen);\r\n\r\n pos.setPosition(7,4);\r\n King wKing = new King(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKing);\r\n\r\n\r\n\r\n Rook arrwRook[] = {wRook1,wRook2};\r\n Rook arrbRook[] = {bRook1,bRook2};\r\n Queen arrwQueen[] = {wQueen};\r\n Queen arrbQueen[] = {bQueen};\r\n Knight arrwKnight[] = {wKnight1,wKnight2};\r\n Knight arrbKnight[] = {bKnight1,bKnight2};\r\n King arrwKing[] = {wKing};\r\n King arrbKing[] = {bKing};\r\n Bishop arrwBishop[] = {wBishop1,wBishop2};\r\n Bishop arrbBishop[] = {bBishop1,bBishop2};\r\n }", "private void drawPiece(int row, int col, Graphics g, Color color){\r\n ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\r\n ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);\r\n g.setColor(color);\r\n g.fillOval((col*tileSize)+2, (row*tileSize)+2, tileSize-4, tileSize-4);\r\n }", "private void drawCurrentPiece(final Graphics2D theG2D, final int theHeight, \r\n final int theWidth) {\r\n \r\n final Piece piece = (AbstractPiece) myBoard.getCurrentPiece(); \r\n final int[][] currentPiece = ((AbstractPiece) piece).getBoardCoordinates(); \r\n \r\n //Calculates rows\r\n for (int row = 0; row < theHeight; row++) { \r\n //Calculates columns\r\n for (int column = 0; column < theWidth; column++) { \r\n //Creates blocks from column and rows\r\n for (int block = 0; block < currentPiece.length; block++) { \r\n if (currentPiece[block][1] == row \r\n && currentPiece[block][0] == column) { \r\n \r\n theG2D.setColor(PURPLE); \r\n rectangle(theG2D, SIZE * column, \r\n (SIZE * theHeight) - ((row + 1) * SIZE), \r\n SIZE, SIZE, COLOR); \r\n \r\n theG2D.setColor(((AbstractPiece) piece).getBlock().getColor()); \r\n rectangle(theG2D, \r\n SIZE * column, \r\n (SIZE * theHeight) - ((row + 1) * SIZE), \r\n SIZE - 1, SIZE - 1, COLOR); \r\n \r\n theG2D.setColor(PURPLE); \r\n rectangle(theG2D, SIZE * column, \r\n (SIZE * theHeight) - ((row + 1) * SIZE), \r\n SIZE, SIZE, DRAW); \r\n } \r\n } \r\n } \r\n } \r\n }", "void displayFilledSquare(Button button, int row, int column, ChessPiece piece);", "@Override\n public void paint(Graphics g) {\n g.setColor(Color.white);\n g.fillRect(0, 0, getWidth(), getHeight() );\n\n for (PieceUI pieceUI : pieceUIList) {\n pieceUI.draw(g);\n }\n\n g.drawImage(trapeze.getTrapezeView(), 200, 400, null);\n }", "private void drawPiece(Piece piece) {\n int kind = piece.getKind() + 1;\n int pos0 = piece.getPos(0);\n int pos1 = piece.getPos(1);\n int pos2 = piece.getPos(2);\n int pos3 = piece.getPos(3);\n\n g.drawImage(tile[kind], (pos0%12)*23-3, (pos0/12)*23+17, this);\n g.drawImage(tile[kind], (pos1%12)*23-3, (pos1/12)*23+17, this);\n g.drawImage(tile[kind], (pos2%12)*23-3, (pos2/12)*23+17, this);\n g.drawImage(tile[kind], (pos3%12)*23-3, (pos3/12)*23+17, this);\n }", "protected abstract void paintBoard() throws TilePixelOutOfRangeException;", "@Override\n\t protected void paintComponent(Graphics g) {\n\t super.paintComponent(g);\n\t for (int y = 0; y < MAX_Y; y++) {\n\t for (int x = 0; x < MAX_X; x++) { \n\t if(seed[x][y].isAlive) {\n\t g.setColor(FILL_COLOR);\n\t g.fillRect(x * CELL_WIDTH, y * CELL_WIDTH, CELL_WIDTH, CELL_WIDTH);\n\t }\n\t else{\n\t g.setColor(defaultBackground);\n\t g.fillRect(x * CELL_WIDTH, y * CELL_WIDTH, CELL_WIDTH, CELL_WIDTH);\n\t }//end if..\n\t g.setColor(Color.GRAY);\n\t g.drawRect(x * CELL_WIDTH, y * CELL_WIDTH, CELL_WIDTH, CELL_WIDTH);\n\t }//end for x\n\t }//end for y\n\t }", "public void newGame() {\n \tturn = PieceColor.White;\n \t\n \t//the middle are empty squares\n \tfor(int i = 2; i < 6; i++) {\n \t\tfor(int j = 0; j < 8; j++) {\n \t\t\tsetPiece(j, i, new NoPiece(j, i));\n \t\t}\n \t}\n \t\n \t//pawns\n \tfor(int i = 0; i < 8; i++) {\n \t\t//make these pawns\n \t\tsetPiece(i, 1, new Pawn(i, 1, PieceColor.White, this));\n \t\tsetPiece(i, 6, new Pawn(i, 6, PieceColor.Black, this));\n \t}\n \t\n \t//white back row\n \tsetPiece(0, 0, new Rook(0, 0, PieceColor.White, this));\n \tsetPiece(1, 0, new Knight(1, 0, PieceColor.White, this));\n \tsetPiece(2, 0, new Bishop(2, 0, PieceColor.White, this));\n \tsetPiece(3, 0, new Queen(3, 0, PieceColor.White, this));\n \tsetPiece(4, 0, new King(4, 0, PieceColor.White, this));\n \tsetPiece(5, 0, new Bishop(5, 0, PieceColor.White, this));\n \tsetPiece(6, 0, new Knight(6, 0, PieceColor.White, this));\n \tsetPiece(7, 0, new Rook(7, 0, PieceColor.White, this));\n \t\n \t//black back row\n \tsetPiece(0, 7, new Rook(0, 7, PieceColor.Black, this));\n \tsetPiece(1, 7, new Knight(1, 7, PieceColor.Black, this));\n \tsetPiece(2, 7, new Bishop(2, 7, PieceColor.Black, this));\n \tsetPiece(3, 7, new Queen(3, 7, PieceColor.Black, this));\n \tsetPiece(4, 7, new King(4, 7, PieceColor.Black, this));\n \tsetPiece(5, 7, new Bishop(5, 7, PieceColor.Black, this));\n \tsetPiece(6, 7, new Knight(6, 7, PieceColor.Black, this));\n \tsetPiece(7, 7, new Rook(7, 7, PieceColor.Black, this));\n \t\n \t//store locations of king so they can be checked\n \twKing = new Square(4, 0);\n \tbKing = new Square(4, 7);\n }", "@Override\n\tpublic void paint(Graphics g) {\n\t\tsuper.paint(g);\t\t\t\t\t\t\t\t\t// If this method is reimplemented, super.paint(g) should be called so that lightweight components are properly rendered.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// If a child component is entirely clipped by the current clipping setting in g, paint() will not be forwarded to that child.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// from http://docs.oracle.com/javase/7/docs/api/java/awt/Container.html#paint(java.awt.Graphics)\n\t\t\n\t\tif (newGame) newGoGame();\t\t\t\t\t\t// if new go game: setup goBoard array, goHistory, black player first\n\t\tif (checkWin) \t\t\t\t\t\t\t\t\t// if checkWin is true - check to see if the last move was a win\n\t\t\tif ((k=gameWin())!=0) {\n\t\t\t\tif (k==1)\n\t\t\t\t\tJOptionPane.showMessageDialog(this, \"White player has won!\", \"Gomoku Winner\", JOptionPane.PLAIN_MESSAGE);\n\t\t\t\telse \n\t\t\t\t\tJOptionPane.showMessageDialog(this, \"Black player has won!\", \"Gomoku Winner\", JOptionPane.PLAIN_MESSAGE);\n\t\t\t\tnewGoGame();\n\t\t\t}\n\t\t\n\t\t// Draw Background Image, depending on the index of bgNum\n\t\tg.drawImage(imgBackground[bgNum], 0, 54, Color.BLACK, null); // 44\n\t\t\n\t\t// Draw Grid\n\t\tg.setColor(Color.BLACK);\n\t\tfor (i=0; i<525; i+=35) {\t\t\t\t\t\t// 15x15 grid - 35 pixels per side - offset by 75 pixels on x, 75 pixels on y\n\t\t\tg.drawLine(75, 75+i, 565, 75+i);\t\t// draws horizontal lines\n\t\t\tg.drawLine(75+i, 75+0, 75+i, 565); \t// draws vertical lines\n\t\t} // end loop for drawing lines\n\t\t\n\t\t// draw pieces on board\n\t\tfor (i=0; i<15; ++i) {\n\t\t\tfor (j=0; j<15; ++j) {\n\t\t\t\tif ((k=goBoard[i][j])!=0) {\n\t\t\t\t\tif (k==1) { g.setColor(Color.WHITE); g.fillOval(61+(i*35),62+(j*35),30,30); }\n\t\t\t\t\telse { g.setColor(Color.BLACK); g.fillOval(61+(i*35),62+(j*35),30,30); }\n\t\t\t\t} // end if goBoard\n\t\t\t} // end j - inner loop for drawing game pieces\n\t\t} // end i - outer loop for drawing game pieces\n\n\t\t\n\t\t// To Do list\n\t\t// Check move - 5 in a row - (not with stack, but with int Array)\n\n\t\t\n\t}", "public void draw(GraphicsContext gc) {\n // draw the base grid\n gc.setFill(Color.LIGHTGREY);\n for (int i = 0; i < board.side(); i++)\n for (int j = (i % 2 == 0) ? 1 : 0; j < board.side(); j += 2)\n gc.fillRect(startX + j * unitLength, startY + i * unitLength,\n unitLength, unitLength);\n\n // draw boundaries\n gc.setStroke(Color.BLACK);\n gc.strokeRect(startX, startY, sideLength, sideLength);\n\n // highlight legal positions\n for (BoardPos pos : legalPos) {\n gc.setFill(Color.ORANGE);\n gc.fillRect(startX + pos.getX() * unitLength,\n startY + pos.getY() * unitLength, unitLength, unitLength);\n gc.setFill(Color.LIGHTYELLOW);\n if (pos.route != null)\n for (BoardPos step : pos.route)\n gc.fillRect(startX + step.getX() * unitLength,\n startY + step.getY() * unitLength, unitLength, unitLength);\n }\n\n // draw pieces\n for (int i = 0; i < board.side(); i++)\n for (int j = 0; j < board.side(); j++)\n board.get(i, j).draw(gc, startX + i * unitLength,\n startY + j * unitLength, pieceMargin, unitLength);\n }", "public void paintComponent(Graphics g) {\n\t\t\tsuper.paintComponent(g);\n\t\t\tif (image == null) return;\n\t\t\t((Graphics2D) g).setStroke(new BasicStroke(4)); // thick border\n\t\t\tcreatePieces();\n\t\t\t// Lay out the pieces in a matrix.\n\t\t\tint c = 0, r = 0;\n\t\t\tfor (int p = 0; p < order.size(); p++) {\n\t\t\t\t// Piece image.\n\t\t\t\tCvMat piece = pieces.get(order.get(p));\n\t\t\t\tg.drawImage(piece.asIplImage().getBufferedImage(), c * pieceWidth, r * pieceHeight, null);\n\t\t\t\t// Border (green if selected).\n\t\t\t\tif (p == selected) {\n\t\t\t\t\tg.setColor(Color.green);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t}\n\t\t\t\tg.drawRect(c * pieceWidth, r * pieceHeight, pieceWidth - 2, pieceHeight - 2);\n\t\t\t\t// Advance column, and maybe row.\n\t\t\t\tc++;\n\t\t\t\tif (c == pcols) {\n\t\t\t\t\tc = 0;\n\t\t\t\t\tr++;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "void drawCurrentToBoard () {\n board.clearTemp();\n for (int r = 0; r < currentPiece.height; ++r)\n for (int c = 0; c < currentPiece.width; ++c)\n if (currentPiece.blocks[r][c] == 1)\n board.addBlock(new Block(currentPiece.color), r + currentRow, c + currentColumn);\n }", "public void paint(Graphics g) {\n\n super.paint(g);\n \n //Fill the board with black if 0, red if 1\n for(int x = 0; x < gameBoard.length; x++) {\n for (int y = 0; y < gameBoard[0].length; y++) {\n \n //Draw red\n if (gameBoard[x][y] == 1) {\n\n g.setColor(Color.BLACK);\n g.fillRect(x*24, y*24, 24, 24);\n g.setColor(Color.RED);\n g.fillRect(x*24+1, y*24+1, 22, 22);\n\n //Draw black\n } else {\n\n g.setColor(Color.BLACK);\n g.fillRect(x*24, y*24, 24, 24);\n }\n }\n } \n }", "public void Draw (Graphics graphics, MainJPanel JPanel){ // draw the player game pieces\n for(Piece piece : pieces.values())\n piece.Draw(graphics,JPanel);\n }", "public void initPieces() {\r\n\t\tfor (int i = 0; i < 64; i++) {\r\n\t\t\tif (i < 12) {\r\n\t\t\t\tblackPieces[i] = new ChessPiece(\"black\", \"\");\r\n\t\t\t\tblackPieces[i].setBackground(Color.BLACK);\r\n\t\t\t\tblackPieces[i].addMouseMotionListener(this);\r\n\t\t\t\tblackPieces[i].addMouseListener(this);\r\n\t\t\t\tblackPieces[i].setText(null);\r\n\t\t\t\twhitePieces[i] = new ChessPiece(\"white\", \"\");\r\n\t\t\t\twhitePieces[i].setBackground(Color.WHITE);\r\n\t\t\t\twhitePieces[i].addMouseMotionListener(this);\r\n\t\t\t\twhitePieces[i].addMouseListener(this);\r\n\t\t\t\twhitePieces[i].setText(null);\r\n\t\t\t}\r\n\t\t\tspacePieces[i] = new ChessPiece(\"empty\", \"\");\r\n\t\t\tspacePieces[i].setEnabled(false);\r\n\t\t\tspacePieces[i].setVisible(false);\r\n\t\t\tspacePieces[i].setText(null);\r\n\t\t}\r\n\t}", "public void draw() {\r\n\t\tthis.sprite.draw(this.col * MainApp.getGridSize(), this.row * MainApp.getGridSize());\r\n\t}", "public static void draw() {\n\t\tSystem.out.println();\n\t\tSystem.out.println(\" | | \");\n\t\tSystem.out.println(\" \" + board[0][0] + \" | \" + board[0][1] + \" | \"\n\t\t\t\t+ board[0][2]);\n\t\tSystem.out.println(\" | | \");\n\t\tSystem.out.println(\"---+---+---\");\n\t\tSystem.out.println(\" | | \");\n\t\tSystem.out.println(\" \" + board[1][0] + \" | \" + board[1][1] + \" | \"\n\t\t\t\t+ board[1][2]);\n\t\tSystem.out.println(\" | | \");\n\t\tSystem.out.println(\"---+---+---\");\n\t\tSystem.out.println(\" | | \");\n\t\tSystem.out.println(\" \" + board[2][0] + \" | \" + board[2][1] + \" | \"\n\t\t\t\t+ board[2][2]);\n\t\tSystem.out.println(\" | | \");\n\t\tSystem.out.println();\n\t}", "private void redraw() {\r\n for (int row = 0; row < maxRows; row++) {\r\n for (int column = 0; column < maxColumns; column++) {\r\n grid[row][column].setBackground(SQUARE_COLOR);\r\n }\r\n }\r\n grid[snake[HEAD].row][snake[HEAD].column].setBackground(\r\n SNAKE_HEAD_COLOR);\r\n for (int i = 1; i < length; i++) {\r\n grid[snake[i].row][snake[i].column].setBackground(SNAKE_BODY_COLOR);\r\n }\r\n grid[powerUp.row][powerUp.column].setBackground(POWER_UP_COLOR);\r\n }", "public void paint(Graphics g){\n if (moves == 0){\n xLength[2] = 50;\n xLength[1] = 75;\n xLength[0] = 100;\n\n yLength[2] = 100;\n yLength[1] = 100;\n yLength[0] = 100;\n }\n\n //draw Title box\n g.setColor(Color.WHITE);\n g.drawRect(24, 10,851,55);\n\n g.setColor(new Color(34,155,3));\n g.fillRect(25,11,850,54);\n\n //draw Title\n g.setColor(Color.WHITE);\n String msg = \"Snake\";\n g.setFont(new Font(\"arial\", Font.BOLD, 30));\n g.drawString(msg, 420, 50);\n\n //draw Board\n g.setColor(Color.WHITE);\n g.drawRect(24,74,851,577);\n\n g.setColor(Color.BLACK);\n g.fillRect(25,75,850,575);\n\n\n //set Images\n rightHead = new ImageIcon(getClass().getResource(\"resources/headRight.png\"));\n rightHead.paintIcon(this, g, xLength[0], yLength[0]);\n\n for(int i = 0; i < snakeLength; i++){\n if(i==0 && right){\n rightHead = new ImageIcon(getClass().getResource(\"resources/headRight.png\"));\n rightHead.paintIcon(this, g, xLength[i], yLength[i]);\n }\n if(i==0 && left){\n leftHead = new ImageIcon(getClass().getResource(\"resources/headLeft.png\"));\n leftHead.paintIcon(this, g, xLength[i], yLength[i]);\n }\n if(i==0 && down){\n downHead = new ImageIcon(getClass().getResource(\"resources/headDown.png\"));\n downHead.paintIcon(this, g, xLength[i], yLength[i]);\n }\n if(i==0 && up){\n upHead = new ImageIcon(getClass().getResource(\"resources/headUp.png\"));\n upHead.paintIcon(this, g, xLength[i], yLength[i]);\n }\n\n if(i!=0){\n tail = new ImageIcon(getClass().getResource(\"resources/tail.png\"));\n tail.paintIcon(this,g,xLength[i],yLength[i]);\n }\n }\n\n apple = new ImageIcon(getClass().getResource(\"resources/apple.png\"));\n apple.paintIcon(this,g,appleX[xApplePosition],appleY[yApplePosition]);\n\n if(gameOver){\n gameOver(g);\n }\n\n g.dispose();\n\n\n }", "private void displayBoard()\n {\n GreenfootImage toDisplay;\n \n for( int r = 0; r < board.length; r ++ )\n {\n for( int c = 0; c < board[r].length; c ++ )\n {\n toDisplay = new GreenfootImage( board[r][c], 100, Color.BLACK, new Color(0,0,0,0) ); \n getBackground().drawImage( toDisplay, c * getWidth()/3 + (getWidth()/3 - toDisplay.getWidth() )/2 , r * getHeight()/3 + (getHeight()/3 - toDisplay.getHeight() )/2 );\n }\n }\n }", "public static void drawBoard(){\n\t\tSystem.out.println(\"\\n\\t A B C\");\r\n\t\tSystem.out.println(\"\\t .-----------.\");\r\n\t\tSystem.out.println(\"\\t1 |_\"+TicTac.place[0]+\"_|_\"+TicTac.place[1]+\"_|_\"+TicTac.place[2]+\"_|\\n\");\r\n\t\tSystem.out.println(\"\\t2 |_\"+TicTac.place[3]+\"_|_\"+TicTac.place[4]+\"_|_\"+TicTac.place[5]+\"_|\\n\");\r\n\t\tSystem.out.println(\"\\t3 |_\"+TicTac.place[6]+\"_|_\"+TicTac.place[7]+\"_|_\"+TicTac.place[8]+\"_|\");\r\n\t\tSystem.out.println(\"\\t '-----------'\");\r\n\t}", "void draw_board(int x, int y, char[][] _display, char[][] _board) {\n for (int i = 0; i < 65; i++) {\n for (int j = 0; j < 33; j++) {\n if (i%8 == 0 && j%4 == 0) {\n draw_char(x + i + 1, y + j + 1, _display, '+');\n } else if (j%4 == 0) {\n draw_char(x + i + 1, y + j + 1, _display, '-');\n } else if (i%8 == 0) {\n draw_char(x + i + 1, y + j + 1, _display, '|');\n } else {\n draw_char(x + i + 1, y + j + 1, _display, ' ');\n }\n }\n }\n char label_row = '1';\n char label_column = 'A';\n for (int i = 0; i < 8; i++) {\n draw_char(x, \t\t\t\t\t\t\t4 * i + 3 + y, _display, label_row);\n draw_char(x + 66, \t\t\t\t4 * i + 3 + y, _display, label_row);\n draw_char(8 * i + 5 + x, \ty,\t\t\t\t\t\t _display, label_column);\n draw_char(8 * i + 5 + x, \ty + 34,\t\t\t\t _display, label_column);\n label_row ++;\n label_column ++;\n }\n draw_pieces(x, y, _display, _board);\n }", "private void addPieces() {\n gridPane.getChildren().clear();\n Map<Piece, Position> pieces = controller.getAllActivePiecesPositions();\n /* Add the tiles */\n for (int row = 0; row < 8; row++) {\n for (int col = 0; col < 8; col++) {\n Tile tile = new TileView(new Position(row, col));\n gridPane.add(tile.getRootNode(),\n 1 + tile.getPosition().getCol(),\n 1 + tile.getPosition().getRow());\n GridPane.setHgrow(tile.getRootNode(), Priority.ALWAYS);\n GridPane.setVgrow(tile.getRootNode(), Priority.ALWAYS);\n getTiles()[row][col] = tile;\n tile.getRootNode().setOnMouseClicked(\n tileListener(tile));\n tile.clear();\n tile.setSymbol(\"\");\n }\n }\n /* Add the pieces */\n for (Piece p : pieces.keySet()) {\n Position placeAt = pieces.get(p);\n getTileAt(placeAt).setSymbol(p.getType().getSymbol(p.getSide()));\n }\n /* Add the coordinates around the perimeter */\n for (int i = 1; i <= 8; i++) {\n Text coord1 = new Text((char) (64 + i) + \"\");\n coord1.setFont(Font.font(null, FontWeight.BOLD, 14));\n coord1.setFill(Color.WHITE);\n GridPane.setHalignment(coord1, HPos.CENTER);\n gridPane.add(coord1, i, 0);\n\n Text coord2 = new Text((char) (64 + i) + \"\");\n coord2.setFont(Font.font(null, FontWeight.BOLD, 14));\n coord2.setFill(Color.WHITE);\n GridPane.setHalignment(coord2, HPos.CENTER);\n gridPane.add(coord2, i, 9);\n\n Text coord3 = new Text(\" \" + (9 - i) + \" \");\n coord3.setFont(Font.font(null, FontWeight.BOLD, 14));\n coord3.setFill(Color.WHITE);\n GridPane.setHalignment(coord3, HPos.CENTER);\n gridPane.add(coord3, 0, i);\n\n Text coord4 = new Text(\" \" + (9 - i) + \" \");\n coord4.setFont(Font.font(null, FontWeight.BOLD, 14));\n coord4.setFill(Color.WHITE);\n GridPane.setHalignment(coord4, HPos.CENTER);\n gridPane.add(coord4, 9, i);\n }\n }", "private void draw() {\n\n // Current generation (y-position on canvas)\n int generation = 0;\n\n // Looping while still on canvas\n while (generation < canvasHeight / CELL_SIZE) {\n\n // Next generation\n cells = generate(cells);\n\n // Drawing\n for (int i = 0; i < cells.length; i++) {\n gc.setFill(colors[cells[i]]);\n gc.fillRect(i * CELL_SIZE, generation * CELL_SIZE, CELL_SIZE, CELL_SIZE);\n }\n\n // Next line..\n generation++;\n }\n }", "public abstract WorldImage drawBoard(int blocks);", "public void render() {\n int pixel = getPixelSize();\n for (int xx = x; xx<x+w; xx += pixel) {\n for (int yy = y; yy<y+h; yy += pixel) {\n Location next = getLocation(xx, yy);\n if (next != null) { // This way if a wall is spawned at the edge it's ok\n next.setColor(color(255,255,255));\n next.setType(LocationType.WALL);\n getGridCache().add(next);\n }\n }\n }\n }", "public void paintComponent(Graphics g) {\n if (board == null)\n return; // refuse to paint a null board\n \n Graphics2D g2 = (Graphics2D) g;\n g2.setPaint(Color.WHITE);\n int bw = cellDistance(board.getWidth());\n int bh = cellDistance(board.getHeight());\n for (int x = 0; x < bw; x += CELL_SIZE + GUTTER_SIZE) {\n g2.fillRect(x, 0, GUTTER_SIZE, bh);\n }\n for (int y = 0; y < bh; y += CELL_SIZE + GUTTER_SIZE) {\n g2.fillRect(0, y, bw, GUTTER_SIZE);\n }\n \n g2.setPaint(Color.BLUE);\n \n for (int x = 0; x < board.getWidth(); x++) {\n int xpos = cellDistance(x);\n \n for (int y = 0; y < board.getHeight(); y++) {\n int ypos = cellDistance(y);\n if (board.getCell(x, y)) {\n g2.fillRect(xpos, ypos, CELL_SIZE, CELL_SIZE);\n }\n }\n }\n }", "@Override\n\t\t\tprotected void paintComponent(Graphics g) {\n\t\t\t\tsuper.paintComponent(g);\n\t\t\t\tfor (int i = 0; i < wall.length; i++) {\n\t\t\t\t\tfor (int j = 0; j < wall[i].length; j++) {\n\t\t\t\t\t\tg.setColor(Color.blue);\n\t\t\t\t\t\tg.drawRect(i*30, j*30, 30, 30);\n\t\t\t\t\t\tif (wall[i][j] == 1) {\n\t\t\t\t\t\t\tg.fillRect(i*30, j*30, 30, 30);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "private void drawFallingPiece() {\r\n\t\t// loops through each rectangle of the shape type (always 4), and draws it\r\n\t\t// based on it's status and position.\r\n\t\tfor (int i = 0; i < 4; i++) {\r\n\t\t\tdrawSquare(game.fallingPiece.x + game.fallingPiece.coord[game.fallingPiece.status][i][0],\r\n\t\t\t\t\t game.fallingPiece.y + game.fallingPiece.coord[game.fallingPiece.status][i][1],\r\n\t\t\t\t\t game.fallingPiece.color);\r\n\t\t}\r\n\t}", "private void drawGame() {\r\n //For each each cell of the grid if there is a snake draw green,\r\n //an apple draw red or nothing draw white.\r\n for (int x = 0; x < gridWidth; x++) {\r\n for (int y = 0; y < gridHeight; y++) {\r\n if (isSnakeAt(new Coordinates(x, y))) {\r\n drawCell(x, y, Color.GREEN);\r\n } else if (apple.equals(new Coordinates(x, y))) {\r\n drawCell(x, y, Color.RED);\r\n } else {\r\n drawCell(x, y, Color.WHITE);\r\n }\r\n }\r\n }\r\n //Draw a grid around the game grid\r\n gc.strokeRect(0, 0, gridWidth * cellSize, gridHeight * cellSize); \r\n }", "public void create() {\n\t\t// setup Chess board\n\t\tthis.removeAll();\n\t\tthis.layout = new GridLayout(this.startupBoardSize, this.startupBoardSize);\n\t\tthis.squares = new SquarePanel[this.startupBoardSize][this.startupBoardSize];\n\t\t\n\t\tsetLayout(layout);\n\t\tsetPreferredSize(new Dimension(600, 600));\n\t\tsetBorder(new LineBorder(new Color(0, 0, 0)));\n\n\t\t//paint the chess board\n\n\t\tfor (int i = 0; i < this.startupBoardSize; i++) \n\t\t{\n\t\t\tfor (int j = 0; j < this.startupBoardSize; j++) \n\t\t\t{\n\t\t\t\tsquares[i][j] = new SquarePanel(j, i);\n\t\t\t\tsquares[i][j].setPreferredSize(new Dimension(600 / this.startupBoardSize - 5, 600 / this.startupBoardSize - 5));\n\n\n\t\t\t\tsquares[i][j].setBackground(Color.WHITE);\n\t\t\t\t\n\t\t\t\tif (((i + j) % 2) == 0) \n\t\t\t\t{\n\t\t\t\t\tsquares[i][j].setBackground(Color.DARK_GRAY);\n\t\t\t\t}\n\t\t\t\tadd(squares[i][j]);\n\t\t\t}\n\t\t}\n\t}", "void updateBoard() {\r\n\t\tfor (int x = 0; x < length; x++) {\r\n\t\t\tfor (int y = 0; y < length; y++) {\r\n\t\t\t\tif (filled[x][y]) {\r\n\t\t\t\t\t// Draw filled square\r\n\t\t\t\t\tdouble rand = Math.random();\r\n\t\t\t\t\tColor use = new Color(0, 0, 0);\r\n\t\t\t\t\tif (rand < .25) {\r\n\t\t\t\t\t\tuse = a;\r\n\t\t\t\t\t} else if (rand < .50) {\r\n\t\t\t\t\t\tuse = b;\r\n\t\t\t\t\t} else if (rand < .75) {\r\n\t\t\t\t\t\tuse = c;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tuse = d;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tJSquare element = new JSquare(this.getWidth() / length, this.board.getHeight() / length, use, true);\r\n\t\t\t\t\telement.addMouseListener(this);\r\n\t\t\t\t\tboard.add(element);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Draw empty square\r\n\t\t\t\t\tJSquare element = new JSquare(this.getWidth() / length, this.board.getHeight() / length,\r\n\t\t\t\t\t\t\tnew Color(192, 192, 192), false);\r\n\t\t\t\t\telement.addMouseListener(this);\r\n\t\t\t\t\tboard.add(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void makeBoardChess() {\r\n \r\n white = new AllPiece(\"White\");\r\n black = new AllPiece(\"Black\");\r\n \r\n }", "void showpos(pieces chesspiece)\n {if(chesspiece.alive == true)\n {\n int position = chesspiece.position;\n chesspiece.select = true;\n \n int x;int y;\n if((position+1)%8 == 0) {x = 8; y = (position+8)/8;}\n else{ x = (position+1)%8;\n y = (position+9)/8;}\n chesspiece.move(new moves(x,y));\n for( int a : chesspiece.movnum )\n {\n if ( chesspiece.color == 0)\n {\n if (Checkerboard.allWhitePositions.contains(a-1)== true)\n panel[a-1].setBackground(Color.GRAY);\n else if (Checkerboard.allBlackPositions.contains(a-1)== true)\n panel[a-1].setBackground(Color.RED);\n else\n panel[a-1].setBackground(Color.GREEN);\n }\n else\n {\n if (Checkerboard.allWhitePositions.contains(a-1)== true)\n panel[a-1].setBackground(Color.RED);\n else if (Checkerboard.allBlackPositions.contains(a-1)== true)\n panel[a-1].setBackground(Color.GRAY);\n else\n panel[a-1].setBackground(Color.GREEN);\n }\n \n }\n }//if(chesspiece.alive==true) ends\n }", "public void draw() {\n mGameBoard.draw();\n }", "private void drawBoard(Canvas cnv) {\n\t\tfor (int row = 0; row < 3; row++) {\n\t\t\tfor (int column = 0; column < 3; column++) {\n\t\t\t\tif (board.getPosition(row, column)==Marker.O) {\n\t\t\t\t\tdrawMarkerO(cnv, row, column);\n\t\t\t\t}\n\t\t\t\telse if (board.getPosition(row, column)==Marker.X) {\n\t\t\t\t\tdrawMarkerX(cnv, row, column);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void draw_grid() {\n for (int i = 0; i <= xNumTiles; i++) {\n stroke(100);\n line(i * tileSize, 0, i * tileSize, yNumTiles * tileSize);\n }\n\n for (int j = 0; j <= yNumTiles; j++) {\n stroke(100);\n line(0, j * tileSize, xNumTiles * tileSize, j * tileSize);\n }\n }", "public Board(ArrayList<Piece> pieces)\n {\n squares = new Square[Chess.ROWS][Chess.COLUMNS];\n setLayout(new GridLayout(Chess.ROWS,Chess.COLUMNS,0,0));\n firstSelected = null;\n mainBoard=true;\n turn = 0;\n fiftyMove = 0;\n for (int i = 0; i < Chess.ROWS; i++)\n for (int j = 0; j < Chess.COLUMNS; j++)\n {\n squares[i][j] = new Square(i,j,this);\n for (Piece p: pieces)\n if (p.getOrigin().equals(new Location(i,j)))\n squares[i][j].setPiece(p);\n add(squares[i][j]);\n }\n positions = new ArrayList<>();\n positions.add(toString());\n }", "public void showBoard() {\n for (int i = 0; i < booleanBoard.length; i++) {\n for (int j = 0; j < booleanBoard.length; j++) {\n if (strBoard[i][j].equals(\"possible move\") || strBoard[i][j].equals(\"castling\")) {\n gA.getBoard()[i][j].setBackgroundResource(R.color.green);\n }\n if (strBoard[i][j].equals(\"possible kill\")) {\n gA.getBoard()[i][j].setBackgroundResource(R.color.red);\n }\n if (booleanBoard[i][j]) {\n if (figBoard[i][j].getColor().equals(\"white\")) {\n gA.getBoard()[i][j].setRotation(180);\n } else {\n gA.getBoard()[i][j].setRotation(0);\n }\n gA.getBoard()[i][j].setImageResource(figBoard[i][j].getImageResource());\n } else {\n gA.getBoard()[i][j].setImageResource(0);\n }\n }\n }\n }", "public void updateBoard() {\r\n\t\tfor(int i = 0, k = 0; i < board.getWidth(); i+=3) {\r\n\t\t\tfor(int j = 0; j < board.getHeight(); j+=3) {\r\n\t\t\t\t//Check that there are pieces to display\r\n\t\t\t\tif(k < bag.size()) {\r\n\t\t\t\t\tboard.setTile(bag.get(k), i, j);\r\n\t\t\t\t\tk++;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tboard.fillSpace(GridSquare.Type.EMPTY, i, j);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void drawGrid()\n {\n noStroke();\n for(int i = 0; i < xCells; i++)\n {\n for(int j = 0; j < yCells; j++)\n {\n if(pattern[i][j])\n fill(0);\n else\n fill(255);\n rect(firstCellPosition[0]+i*cellSize,firstCellPosition[1]+j*cellSize,cellSize-1,cellSize-1);\n }\n }\n }", "@Override\r\n protected void paintComponent(Graphics g) {\n paintWater(g);\r\n \r\n g.setColor(new Color(255, 255, 255, 70));\r\n g.fillRect(0, 0, 500, 500);\r\n \r\n \r\n // Paint the Grid ------------------------------------------\r\n g.setColor(Color.BLACK);\r\n \r\n for (int i = -1; i < 500; i += 50) {\r\n \r\n g.fillRect(i, 0, 2, 500);\r\n g.fillRect(0, i, 500, 2);\r\n \r\n }\r\n \r\n paintShips(g);\r\n paintHits(g);\r\n \r\n \r\n if (isPainted && shortBoard == ATTACK_BOARD && newGD.isMyTurn() && !missile.isPlaced()) {\r\n g.drawImage(Assets.imgMissile, mouseX, mouseY, null);\r\n }\r\n \r\n if (shortBoard == ATTACK_BOARD && newGD.isMyTurn() && missile.isPlaced()) {\r\n g.drawImage(Assets.imgMissile, missile.getPosition().x, missile.getPosition().y, null);\r\n }\r\n \r\n // Paint square under mouse pointer (also for testing)\r\n /*if (isPainted) {\r\n \r\n g.setColor(colorSquare);\r\n g.fillRect(mouseX, mouseY, 50, 50);\r\n \r\n }*/\r\n \r\n }", "public void drawBoard() {\n String[][] strBoard= new String[4][4];\n for(int x= 0; x<4; x++) {\n for(int y= 0; y<4; y++) {\n if(board[x][y]==0) {\n strBoard[x][y]= \".\";\n }\n else {\n // set color\n if(board[x][y]%3==2) {\n }\n strBoard[x][y]= \"\"+board[x][y];\n }\n }\n }\n \n String line= \"---------------------------------\";\n System.out.println(line);\n for(int x= 0; x<4; x++) {\n for(int y= 0; y<4; y++) {\n System.out.print(\"|\"+strBoard[x][y]+\"\\t\");\n }\n System.out.println(\"|\");\n }\n System.out.println(line);\n }", "private void putTilesOnBoard() {\n boolean isWhite = true;\n for (int x = 0; x < 8; x++) {\n for (int y = 0; y < 8; y++) {\n Tile t = new Tile(isWhite, new Position(x, y));\n t.setOnMouseClicked(e -> {\n if (t.piece != null && this.activeTile == null && this.whitePlayer == t.piece.isWhite()) {\n this.activeTile = t;\n ArrayList<Position> moves = t.piece.getLegalMoves();\n this.highlightAvailableMoves(moves, t.isWhite);\n } else if (t.isHighlighted.getValue() && this.activeTile.piece != null ) {\n movePieces(t);\n } else {\n this.activeTile = null;\n this.clearHighlightedTiles();\n }\n this.updatePieceBoards();\n });\n t.isHighlighted.addListener((o, b, b1) -> {\n if (o.getValue() == true) {\n t.startHighlight();\n } else {\n t.clearHighlight();\n }\n });\n this.board[x][y] = t;\n this.add(this.board[x][y], x, y);\n isWhite = !isWhite;\n }\n isWhite = !isWhite;\n }\n\n }", "public void PrintBoard() {\n\tSystem.out.println(\"printing from class\");\n\t\tString[][] a = this.piece;\n\t\tSystem.out.println(\" 0 1 2 3 4 5 6 7 <- X axis\");\n\t\tSystem.out.println(\" +----------------+ \");\n\t\t\n\t\tfor (int i=0; i<8 ;i++) {\n\t\t\tSystem.out.print(i + \" |\");\n\t\t\tfor (int j=0; j<8;j++) {\n\t\t\t\t\n\t\tSystem.out.print(\"\" + a[i] [j] + \" \");\n\t\t\t\t\t} \n\t\t\tSystem.out.println(\"|\");\n\t\t}\n\t\tSystem.out.println(\" +----------------+ \");\n\t\tSystem.out.println(\" 0 1 2 3 4 5 6 7 \");\n\t\n\t}", "public void paintComponent(Graphics arg0) {\n\t\tsuper.paintComponent(arg0);\n\t\targ0.setColor(Color.BLACK); \n\t\tboard(arg0); \n\t\tdrawStone(arg0);\n\t}", "protected void paintComponent(Graphics g) {\n super.paintComponent(g);\n // draw all piles and the remaining cards left in the deck\n for (int i = 0; i < mainPiles.length; i++) {\n mainPiles[i].draw(g);\n }\n for (int i = 0; i < suitPiles.length; i++) {\n suitPiles[i].draw(g);\n }\n deckPile.draw(g);\n deck.draw(g);\n \n if (selectedPile != null) {\n selectedPile.draw(g);\n }\n }", "public void addPieces() {\r\n\t\tboard[0] = 8;\r\n\t\tboard[1] = 1;\r\n\t\tboard[2] = 6;\r\n\t\tboard[3] = 3;\r\n\t\tboard[4] = 5;\r\n\t\tboard[5] = 7;\r\n\t\tboard[6] = 4;\r\n\t\tboard[7] = 9;\r\n\t\tboard[8] = 2;\r\n\t}", "@Override\n public void paintComponent(final Graphics theGraphics) {\n super.paintComponent(theGraphics);\n final Graphics2D g2d = (Graphics2D) theGraphics;\n\n for (int i = 0; i < myDrawingArray.size(); i++) {\n final Drawing drawing = myDrawingArray.get(i);\n g2d.setPaint(drawing.getColor());\n g2d.setStroke(new BasicStroke(drawing.getWidth()));\n g2d.draw(drawing.getShape());\n }\n \n if (myCurrentShape != null) {\n g2d.setPaint(myCurrentShape.getColor());\n g2d.setStroke(new BasicStroke(myCurrentShape.getWidth()));\n g2d.draw(myCurrentShape.getShape());\n }\n \n if (myGrid) { //Paints the grid if myGrid is true.\n g2d.setStroke(new BasicStroke(1));\n g2d.setPaint(Color.GRAY);\n for (int row = 0; row < getHeight() / GRID_SPACING; row++) {\n final Line2D line = new Line2D.Float(0, GRID_SPACING + (row * GRID_SPACING),\n getWidth(), GRID_SPACING + (row * GRID_SPACING));\n g2d.draw(line);\n }\n for (int col = 0; col < getWidth() / GRID_SPACING; col++) {\n final Line2D line = new Line2D.Float(GRID_SPACING \n + (col * GRID_SPACING), 0,\n GRID_SPACING\n + (col * GRID_SPACING), getHeight());\n g2d.draw(line);\n }\n \n }\n }", "public void Display_Boards(){\r\n\t\tfor(int i=0; i<13; i++){\r\n\t\t\tdisplay.putStaticLine(myBoard.Display(i)+\" \"+hisBoard.Display(i));\r\n\t\t}\r\n\t}", "public static void printBoard() {\n int separatorLen = 67;\n StringBuilder boardString = new StringBuilder();\n boardString.append(new String(new char [separatorLen]).replace(\"\\0\",\"*\"));\n boardString.append(\"\\n\");\n for(int y = Y_UPPER_BOUND - 1; y >= 0; y--)\n {\n boardString.append(y + 1).append(\" \");\n boardString.append(\"*\");\n for (int x = 0; x < X_UPPER_BOUND; x++)\n {\n Piece p = Board.board[x + y * X_UPPER_BOUND];\n if(p != null)\n {\n boardString.append(\" \").append(p).append(p.getColor()? \"-B\":\"-W\").append(\" \").append((p.toString().length() == 1? \" \":\"\"));\n }\n else\n {\n boardString.append(\" \");\n }\n boardString.append(\"*\");\n }\n boardString.append(\"\\n\").append((new String(new char [separatorLen]).replace(\"\\0\",\"*\"))).append(\"\\n\");\n }\n boardString.append(\" \");\n for(char c = 'A'; c <= 'H';c++ )\n {\n boardString.append(\"* \").append(c).append(\" \");\n }\n boardString.append(\"*\\n\");\n System.out.println(boardString);\n }", "public static void setBoard() {\n\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\tStdDraw.filledRectangle(500, 500, 1000, 1000);\n\t\tStdDraw.setPenColor(StdDraw.BLACK);\n\t\tStdDraw.filledCircle(200, 800, 35);\n\t\tStdDraw.filledCircle(500, 800, 35);\n\t\tStdDraw.filledCircle(800, 800, 35);\n\t\tStdDraw.filledCircle(200, 200, 35);\n\t\tStdDraw.filledCircle(500, 200, 35);\n\t\tStdDraw.filledCircle(800, 200, 35);\n\t\tStdDraw.filledCircle(200, 500, 35);\n\t\tStdDraw.filledCircle(800, 500, 35);\n\t\tStdDraw.filledCircle(350, 650, 35);\n\t\tStdDraw.filledCircle(500, 650, 35);\n\t\tStdDraw.filledCircle(650, 650, 35);\n\t\tStdDraw.filledCircle(350, 350, 35);\n\t\tStdDraw.filledCircle(500, 350, 35);\n\t\tStdDraw.filledCircle(650, 350, 35);\n\t\tStdDraw.filledCircle(350, 500, 35);\n\t\tStdDraw.filledCircle(650, 500, 35);\n\n\t\tStdDraw.setPenRadius(0.01);\n\t\tStdDraw.line(200, 200, 800, 200);\n\t\tStdDraw.line(200, 800, 800, 800);\n\t\tStdDraw.line(350, 350, 650, 350);\n\t\tStdDraw.line(350, 650, 650, 650);\n\t\tStdDraw.line(200, 500, 350, 500);\n\t\tStdDraw.line(650, 500, 800, 500);\n\t\tStdDraw.line(200, 800, 200, 200);\n\t\tStdDraw.line(800, 800, 800, 200);\n\t\tStdDraw.line(350, 650, 350, 350);\n\t\tStdDraw.line(650, 650, 650, 350);\n\t\tStdDraw.line(500, 800, 500, 650);\n\t\tStdDraw.line(500, 200, 500, 350);\n\n\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\tStdDraw.filledCircle(80, 200, 35);\n\t\tStdDraw.filledCircle(80, 300, 35);\n\t\tStdDraw.filledCircle(80, 400, 35);\n\t\tStdDraw.filledCircle(80, 500, 35);\n\t\tStdDraw.filledCircle(80, 600, 35);\n\t\tStdDraw.filledCircle(80, 700, 35);\n\n\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\tStdDraw.filledCircle(920, 200, 35);\n\t\tStdDraw.filledCircle(920, 300, 35);\n\t\tStdDraw.filledCircle(920, 400, 35);\n\t\tStdDraw.filledCircle(920, 500, 35);\n\t\tStdDraw.filledCircle(920, 600, 35);\n\t\tStdDraw.filledCircle(920, 700, 35);\n\n\t\tStdDraw.setPenColor(StdDraw.BLACK);\n\n\t}", "public void draw(){\r\n\r\n\t\t\t//frame of house\r\n\t\t\tpen.move(0,0);\r\n\t\t\tpen.down();\r\n\t\t\tpen.move(250,0);\r\n\t\t\tpen.move(250,150);\r\n\t\t\tpen.move(0,300);\r\n\t\t\tpen.move(-250,150);\r\n\t\t\tpen.move(-250,0);\r\n\t\t\tpen.move(0,0);\r\n\t\t\tpen.up();\r\n\t\t\tpen.move(250,150);\r\n\t\t\tpen.down();\r\n\t\t\tpen.move(-250,150);\r\n\t\t\tpen.up();\r\n\t\t\tpen.move(0,0);\r\n\t\t\tpen.down();\r\n\r\n\t\t\t//door\r\n\t\t\tpen.setColor(Color.blue);\r\n\t\t\tpen.setWidth(10);\r\n\t\t\tpen.move(50,0);\r\n\t\t\tpen.move(50,100);\r\n\t\t\tpen.move(-50,100);\r\n\t\t\tpen.move(-50,0);\r\n\t\t\tpen.move(0,0);\r\n\r\n\t\t\t//windows\r\n\t\t\tpen.up();\r\n\t\t\tpen.move(150,80);\r\n\t\t\tpen.down();\r\n\t\t\tpen.drawCircle(30);\r\n\t\t\tpen.up();\r\n\t\t\tpen.move(-150,80);\r\n\t\t\tpen.down();\r\n\t\t\tpen.drawCircle(30);\r\n\t\t\tpen.up();\r\n\r\n\t\t\t//extra\r\n\t\t\tpen.move(-45,120);\r\n\t\t\tpen.down();\r\n\t\t\tpen.setColor(Color.black);\r\n\t\t\tpen.drawString(\"This is a house\");\r\n\t}", "private void fillBoardWithCells(){\n double posx = MyValues.HORIZONTAL_VALUE*0.5*MyValues.HEX_SCALE + MyValues.DIAGONAL_VALUE*MyValues.HEX_SCALE;\n double posy = 2*MyValues.DIAGONAL_VALUE*MyValues.HEX_SCALE ;\n HexCell startCell = new HexCell(0,0, this);\n startCell.changePosition(posx, posy);\n boardCells[0][0] = startCell;\n for (int i = 0; i< x-1; i++) {\n HexCell currentCell = new HexCell(i+1, 0, this);\n boardCells[i+1][0] = currentCell;\n //i mod 2 = 0: Bottom\n if (i % 2 == 0) {\n boardCells[i][0].placeHexCell(currentCell, MyValues.HEX_POSITION.BOT_RIGHT );\n } else {\n //i mod 2 =1: Top\n boardCells[i][0].placeHexCell(currentCell, MyValues.HEX_POSITION.TOP_RIGHT );\n }\n }\n for(int i = 0; i < x; i++){\n for(int j = 0; j < y-1; j++){\n HexCell currentCell = new HexCell(i, j+1, this);\n //System.out.println(Integer.toString(i) + Integer.toString(j));\n boardCells[i][j+1] = currentCell;\n boardCells[i][j].placeHexCell(currentCell, MyValues.HEX_POSITION.BOT);\n }\n }\n }", "public void drawBoard() {\n\n\t\t// Create Observable variable\n\t\tgameObserver = new GameObservable(0);\n\n\t\t// Add panel with buttons Start/Stop, Pause/Resume, Undo and Replay\n\t\tJPanel buttonPanel = new JPanel();\n\n\t\tstartStopButton = new JButton();\n\t\tstartStopButton.setText(\"Start\");\n\t\tstartStopButton.addMouseListener(new customMouseListener());\n\t\tstartStopButton.setFocusable(false);\n\n\t\tpauseResumeButton = new JButton();\n\t\tpauseResumeButton.setText(\"Pause\");\n\t\tpauseResumeButton.addMouseListener(new customMouseListener());\n\t\tpauseResumeButton.setFocusable(false);\n\t\tpauseResumeButton.setEnabled(false);\n\n\t\tundoButton = new JButton();\n\t\tundoButton.setText(\"Undo\");\n\t\tundoButton.addMouseListener(new customMouseListener());\n\t\tundoButton.setFocusable(false);\n\t\tundoButton.setEnabled(false);\n\n\t\treplayButton = new JButton();\n\t\treplayButton.setText(\"Replay\");\n\t\treplayButton.addMouseListener(new customMouseListener());\n\t\treplayButton.setFocusable(false);\n\t\treplayButton.setEnabled(false);\n\n\t\t// Add buttons to the panel\n\t\tbuttonPanel.add(startStopButton);\n\t\tbuttonPanel.add(pauseResumeButton);\n\t\tbuttonPanel.add(undoButton);\n\t\tbuttonPanel.add(replayButton);\n\n\t\t// Add Panels\n\t\tsetLayout(new BorderLayout());\n\t\tclock = new Clock(gameObserver);\n\t\tadd(clock, BorderLayout.NORTH);\n\t\tadd(buttonPanel, BorderLayout.SOUTH);\n\t\tboard = new Board(gameObserver);\n\t\tboard.setBackground(Color.white);\n\t\tadd(board);\n\n\t\t// Register to observer\n\t\tgameObserver.addObserver(board);\n\t\tgameObserver.addObserver(clock);\n\n\t\t// JFrame Properties\n\t\tsetTitle(\"Breakout\");\n\t\tsetDefaultCloseOperation(EXIT_ON_CLOSE);\n\t\tsetSize(Constants.WIDTH, Constants.HEIGTH);\n\t\tsetLocationRelativeTo(null);\n\t\tsetResizable(false);\n\t\tsetVisible(true);\n\n\t}", "public void drawPiece(int row, int col, GamePiece piece) {\n picturesArray[row][col] = new Picture(col * CELL_SIZE + PADDING, row * CELL_SIZE + PADDING, piece.getPieceAsset());\n picturesArray[row][col].draw();\n }", "public void initializeBoard() {\n\n\t\t/*\n\t\t * How the array coordinates align with the actual chess board\n\t\t * (row,col) \n\t\t * (7,0) ... ... ... \n\t\t * (7,7) ... ... ... \n\t\t * ... ... ... \n\t\t * (2,0) ...\n\t\t * (1,0) ... \n\t\t * (0,0) ... ... ... (0,7)\n\t\t */\n\n\t\tboolean hasMoved = false;\n\t\tboolean white = true;\n\t\tboolean black = false;\n\n\t\t// Set white piece row\n\t\tboard[0][0] = new Piece('r', white, hasMoved, 0, 0, PieceArray.A_rookId);\n\t\tboard[0][1] = new Piece('n', white, hasMoved, 0, 1, PieceArray.B_knightId);\n\t\tboard[0][2] = new Piece('b', white, hasMoved, 0, 2, PieceArray.C_bishopId);\n\t\tboard[0][3] = new Piece('q', white, hasMoved, 0, 3, PieceArray.D_queenId);\n\t\tboard[0][4] = new Piece('k', white, hasMoved, 0, 4, PieceArray.E_kingId);\n\t\tboard[0][5] = new Piece('b', white, hasMoved, 0, 5, PieceArray.F_bishopId);\n\t\tboard[0][6] = new Piece('n', white, hasMoved, 0, 6, PieceArray.G_knightId);\n\t\tboard[0][7] = new Piece('r', white, hasMoved, 0, 7, PieceArray.H_rookId);\n\n\t\t// Set white pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[1][i] = new Piece('p', white, hasMoved, 1, i, i + 8);\n\t\t}\n\n\t\t// Set empty rows\n\t\tfor (int row = 2; row < 6; row++)\n\t\t\tfor (int col = 0; col < 8; col++)\n\t\t\t\tboard[row][col] = null;\n\n\t\t// Set black pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[6][i] = new Piece('p', black, hasMoved, 6, i, i+8);\n\t\t}\n\n\t\t// Set black piece row\n\t\tboard[7][0] = new Piece('r', black, hasMoved, 7, 0, PieceArray.A_rookId);\n\t\tboard[7][1] = new Piece('n', black, hasMoved, 7, 1, PieceArray.B_knightId);\n\t\tboard[7][2] = new Piece('b', black, hasMoved, 7, 2, PieceArray.C_bishopId);\n\t\tboard[7][3] = new Piece('q', black, hasMoved, 7, 3, PieceArray.D_queenId);\n\t\tboard[7][4] = new Piece('k', black, hasMoved, 7, 4, PieceArray.E_kingId);\n\t\tboard[7][5] = new Piece('b', black, hasMoved, 7, 5, PieceArray.F_bishopId);\n\t\tboard[7][6] = new Piece('n', black, hasMoved, 7, 6, PieceArray.G_knightId);\n\t\tboard[7][7] = new Piece('r', black, hasMoved, 7, 7, PieceArray.H_rookId);\n\t}", "public void draw() { \n\t\tbackground(255); // Clear the screen with a white background\n\t\tfill(0);\n\t\ttextAlign(LEFT);\n\t\ttextSize(12);\n\t\t\n\t\tif (runCount == 0) {\n\t\t\tboard.onClick();\n\t\t} else if (runCount > 0) {\n\t\t\trunCount--;\n\t\t}\n\t\t\n\t\tif (board != null) {\n\t\t\tboard.draw(this, 0, 0, height, height);\n\t\t}\n\t\t\n\t}", "@Override\n public void paintComponent(Graphics g){\n super.paintComponent(g);\n if(ingame){\n\n int screenWidth = this.getWidth();\n int screenHeight = this.getHeight();\n\n\n for(int i = 0; i < end_positions.size(); i++){\n End_position item = end_positions.get(i);\n g.setColor(Color.green);\n g.fillRect(item.getDestinationX()*screenWidth/LEVEL_WIDTH,item.getDestinationY()*screenHeight/LEVEL_HEIGHT,item.getImage().getWidth(null)*screenWidth/LEVEL_WIDTH,item.getImage().getWidth(null)*screenHeight/LEVEL_HEIGHT);\n }\n\n g.setColor(Color.white);\n g.fillRect(player.getCurrentX()*screenWidth/LEVEL_WIDTH,player.getCurrentY()*screenHeight/LEVEL_HEIGHT,player.getImage().getWidth(null)*screenWidth/LEVEL_WIDTH,player.getImage().getWidth(null)*screenHeight/LEVEL_HEIGHT);\n\n\n for(int i = 0; i < boxes.size(); i++){\n Box item = boxes.get(i);\n g.setColor(Color.yellow);\n g.fillRect(item.getCurrentX()*screenWidth/LEVEL_WIDTH,item.getCurrentY()*screenHeight/LEVEL_HEIGHT,item.getImage().getWidth(null)*screenWidth/LEVEL_WIDTH,item.getImage().getWidth(null)*screenHeight/LEVEL_HEIGHT);\n }\n for(int i = 0; i < walls.size(); i++){\n Wall item = walls.get(i);\n\n g.setColor(Color.red);\n g.fillRect(item.getDestinationX()*screenWidth/LEVEL_WIDTH,item.getDestinationY()*screenHeight/LEVEL_HEIGHT,item.getImage().getWidth(null)*screenWidth/LEVEL_WIDTH,item.getImage().getWidth(null)*screenHeight/LEVEL_HEIGHT);\n\n }\n\n }\n\n }", "@Override\n\t\tpublic void update(Graphics g) {\n\t\t\t\n\t\t\tImage pieceImg = null;\n\t\t\tif (board.square(row,column).isOccupied()) {\n\t\t\t\tint index = board.square(row,column).piece().imageIndex();\n\t\t\t\tpieceImg = pieceImages[index];\n\t\t\t}\n\t\t\tif (lightSquare)\n\t\t\t\t{ setIcon(new ImageIcon(combine(pieceImg, lightSquareImg))); }\n\t\t\telse\n\t\t\t\t{ setIcon(new ImageIcon(combine(pieceImg, darkSquareImg))); }\n\t\t}", "public void paint() {\n BufferStrategy bs;\n bs = this.getBufferStrategy();\n\n Graphics g = bs.getDrawGraphics();\n g.drawImage(background, 0, 0, this.getWidth(), this.getHeight(), null);\n if (this.blackHoles != null) {\n for (BlackHole blackHole : this.blackHoles) {\n blackHole.paint(g);\n }\n }\n if (this.balls != null) {\n for (int i = 0; i <this.balls.size() ; i++) {\n this.balls.get(i).paint(g);\n }\n\n }\n\n bs.show();\n g.dispose();\n\n }", "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 }", "public void drawOn(Graphics page) {\n\t\tif(num != 1) {\n\t\t\tpage.drawImage(image, x, y, size, size, null);\n\t\t} else {\n\t\t\t// Creates a \"blank piece\" for the Piece\n\t\t\t// with a num id of 1\n\t\t\tpage.setColor(Color.white);\n\t\t\tpage.fillRect(x, y, size, size);\n\t\t}\n\t}", "public void drawGrid() {\r\n\t\tsetLayout(new GridLayout(getSize_w(), getSize_h()));\r\n\t\tfor (int i = 0; i < getSize_h(); i++) {\r\n\t\t\tfor (int j = 0; j < getSize_w(); j++) {\r\n\t\t\t\tcity_squares[i][j] = new Gridpanel(j, i);\r\n\t\t\t\tadd(city_squares[i][j]);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tprotected void paintComponent(Graphics g) {\n\t\tsuper.paintComponent(g);\n\t\tfor (int i = 0; i < MyFrame.ROW; i++)\n\t\t\tfor (int j = 0; j < MyFrame.COLUMN; j++)\n\t\t\t\tMyFrame.cells[i][j].paint(g);\n\t}", "public void draw() {\n if (numSides <= 6) {\n System.out.println(\"- - - - - -\");\n \n for (int i = numSides - 2; i < numSides; i++) {\n System.out.print(\" | \");\n for (int j = 0; j < this.value ; j++) {\n if (value == 1) {\n System.out.print(\" \");\n }\n if (i % 2 == 0) {\n System.out.print(\"*\");\n } else {\n System.out.print(\" \");\n }\n if (value == 1) {\n System.out.print(\" \");\n }\n }\n }\n System.out.println(\"\");\n System.out.println(\"- - - - - -\");\n } else {\n print();\n }\n }", "void drawBoard(Board board);", "public void print_board(){\n\t\tfor(int i = 0; i < size*size; i++){\n\t\t\tif(i%this.size == 0) System.out.println(); //just for divider\n\t\t\tfor(int j = 0; j < size*size; j++){\n\t\t\t\tif(j%this.size == 0) System.out.print(\" \"); //just for divider\n\t\t\t\tSystem.out.print(board[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "@Override\r\n\t\tpublic void paintComponent(Graphics g) {\r\n\r\n\t\t\tsuper.paintComponent(g); // Fills the background color.\r\n\r\n\t\t\tg.setColor(Color.DARK_GRAY);\r\n\t\t\tg.fillRect(10, 10, columns * squareSize + 1, rows * squareSize + 1);\r\n\r\n\t\t\tfor (int r = 0; r < rows; r++) {\r\n\t\t\t\tfor (int c = 0; c < columns; c++) {\r\n\t\t\t\t\tif (grid[r][c] == EMPTY) {\r\n\t\t\t\t\t\tg.setColor(Color.WHITE);\r\n\t\t\t\t\t} else if (grid[r][c] == ROBOT) {\r\n\t\t\t\t\t\tg.setColor(Color.RED);\r\n\t\t\t\t\t} else if (grid[r][c] == TARGET) {\r\n\t\t\t\t\t\tg.setColor(Color.GREEN);\r\n\t\t\t\t\t} else if (grid[r][c] == OBST) {\r\n\t\t\t\t\t\tg.setColor(Color.BLACK);\r\n\t\t\t\t\t} else if (grid[r][c] == FRONTIER) {\r\n\t\t\t\t\t\tg.setColor(Color.BLUE);\r\n\t\t\t\t\t} else if (grid[r][c] == CLOSED) {\r\n\t\t\t\t\t\tg.setColor(Color.CYAN);\r\n\t\t\t\t\t} else if (grid[r][c] == ROUTE) {\r\n\t\t\t\t\t\tg.setColor(Color.YELLOW);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tg.fillRect(11 + c * squareSize, 11 + r * squareSize, squareSize - 1, squareSize - 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (drawArrows.isSelected()) {\r\n\t\t\t\t// We draw all arrows from each open or closed state\r\n\t\t\t\t// to its predecessor.\r\n\t\t\t\tfor (int r = 0; r < rows; r++) {\r\n\t\t\t\t\tfor (int c = 0; c < columns; c++) {\r\n\t\t\t\t\t\t// If the current cell is the goal and the solution has\r\n\t\t\t\t\t\t// been found,\r\n\t\t\t\t\t\t// or belongs in the route to the target,\r\n\t\t\t\t\t\t// or is an open state,\r\n\t\t\t\t\t\t// or is a closed state but not the initial position of\r\n\t\t\t\t\t\t// the robot\r\n\t\t\t\t\t\tif ((grid[r][c] == TARGET && found) || grid[r][c] == ROUTE || grid[r][c] == FRONTIER\r\n\t\t\t\t\t\t\t\t|| (grid[r][c] == CLOSED && !(r == robotStart.row && c == robotStart.col))) {\r\n\t\t\t\t\t\t\t// The tail of the arrow is the current cell, while\r\n\t\t\t\t\t\t\t// the arrowhead is the predecessor cell.\r\n\t\t\t\t\t\t\tCell head;\r\n\t\t\t\t\t\t\tif (grid[r][c] == FRONTIER) {\r\n\t\t\t\t\t\t\t\tif (dijkstra.isSelected()) {\r\n\t\t\t\t\t\t\t\t\thead = findPrev(graph, new Cell(r, c));\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\thead = findPrev(openSet, new Cell(r, c));\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\thead = findPrev(closedSet, new Cell(r, c));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// The coordinates of the center of the current cell\r\n\t\t\t\t\t\t\tint tailX = 11 + c * squareSize + squareSize / 2;\r\n\t\t\t\t\t\t\tint tailY = 11 + r * squareSize + squareSize / 2;\r\n\t\t\t\t\t\t\t// The coordinates of the center of the predecessor\r\n\t\t\t\t\t\t\t// cell\r\n\t\t\t\t\t\t\tint headX = 11 + head.col * squareSize + squareSize / 2;\r\n\t\t\t\t\t\t\tint headY = 11 + head.row * squareSize + squareSize / 2;\r\n\t\t\t\t\t\t\t// If the current cell is the target\r\n\t\t\t\t\t\t\t// or belongs to the path to the target ...\r\n\t\t\t\t\t\t\tif (grid[r][c] == TARGET || grid[r][c] == ROUTE) {\r\n\t\t\t\t\t\t\t\t// ... draw a red arrow directing to the target.\r\n\t\t\t\t\t\t\t\tg.setColor(Color.RED);\r\n\t\t\t\t\t\t\t\tdrawArrow(g, tailX, tailY, headX, headY);\r\n\t\t\t\t\t\t\t\t// Else ...\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t// ... draw a black arrow to the predecessor\r\n\t\t\t\t\t\t\t\t// cell.\r\n\t\t\t\t\t\t\t\tg.setColor(Color.BLACK);\r\n\t\t\t\t\t\t\t\tdrawArrow(g, headX, headY, tailX, tailY);\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}", "@Override public void paintComponent(Graphics g) {\n super.paintComponent(g);\n g.drawImage(board, 0, 0, null);\n \n //draw currently placed ship\n if(currentlyPlacedShip != null)\n g.drawImage(imageMap.get(currentlyPlacedShip),\n mousePosition.getX()*40, mousePosition.getY()*40, null);\n \n //draw ships and shots\n if(shotsBoard != null && shipsBoard != null) {\n for(int i = 0; i != 10; ++i)\n for(int j = 0; j != 10; ++j) {\n if(shipsBoard[i][j] != null)\n g.drawImage(imageMap.get(shipsBoard[i][j]), i*40, j*40, null);\n if(shotsBoard[i][j] == ShotField.HIT)\n g.drawImage(hit, i*40, j*40, null);\n if(shotsBoard[i][j] == ShotField.MISHIT)\n g.drawImage(mishit, i*40, j*40, null);\n }\n }\n }", "public void paintComponent(Graphics g){\n \t\tsuper.paintComponent(g);\r\n \r\n \t\tint numOfRows = (int)blockShape.getResolution().x;\r\n \t\tint numOfCols = (int)blockShape.getResolution().y;\r\n \t\tint gridSize = (int)(SHAPE_WIN_SIZE/numOfRows);\r\n \t\t\r\n \t\t//1st: paint each element in the BlockShape -> shape(Color[][])\r\n \t\tfor(int i=0; i< numOfRows;i++){\r\n \t\t\tfor(int j=0; j< numOfCols; j++){\r\n \t\t\t\tg.setColor(blockShape.getShapeElement(i, j));\r\n \r\n \t\t\t\tif(i == numOfRows-1 || j == numOfCols-1){\r\n \t\t\t\t\t//the last row and last column is a bit wider because of the type casting =_=\r\n \t\t\t\t\tg.fillRect(j*gridSize, i*gridSize, gridSize+10, gridSize+10);\r\n \t\t\t\t}else{\r\n \t\t\t\t\tg.fillRect(j*gridSize, i*gridSize, gridSize, gridSize);\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\r\n \t\t//2nd: paint the grid corresponding to the resolution of blockShape\r\n \t\tg.setColor(Color.orange);\r\n \t\tfor (int row = 0; row < numOfRows; row++) {\r\n \t\t\tg.drawLine(0,row*gridSize ,SHAPE_WIN_SIZE, row*gridSize);\r\n \t\t}\r\n \t\tg.drawLine(0,SHAPE_WIN_SIZE, SHAPE_WIN_SIZE, SHAPE_WIN_SIZE);\r\n \r\n \t\tfor (int col = 0; col < numOfCols; col++) {\r\n \t\t\tg.drawLine(col*gridSize, 0 , col*gridSize , SHAPE_WIN_SIZE);\r\n \t\t}\r\n \t\tg.drawLine(SHAPE_WIN_SIZE-1, 0, SHAPE_WIN_SIZE-1, SHAPE_WIN_SIZE);\r\n \t}", "private void paintNumbers() {\n\n g2d.setColor(_BOARDCOLOR);\n g2d.drawString(\"0\", 100, 150);\n g2d.drawString(\"1\", 200, 150);\n g2d.drawString(\"2\", 300, 150);\n g2d.drawString(\"3\", 400, 150);\n g2d.drawString(\"4\", 100, 250);\n g2d.drawString(\"5\", 200, 250);\n g2d.drawString(\"6\", 300, 250);\n g2d.drawString(\"7\", 400, 250);\n g2d.drawString(\"8\", 100, 350);\n g2d.drawString(\"9\", 200, 350);\n g2d.drawString(\"10\", 300, 350);\n g2d.drawString(\"11\", 400, 350);\n g2d.drawString(\"12\", 100, 450);\n g2d.drawString(\"13\", 200, 450);\n g2d.drawString(\"14\", 300, 450);\n g2d.drawString(\"15\", 400, 450);\n }", "public void draw(Graphics g, Dimension winSize) {\n\t\t\n\t\tfor (int i = 0; i < dimensions.x; ++i) {\n\t\t\tfor (int j = 0; j < dimensions.y; ++j) {\n\t\t\t\tg.setColor(Color.getHSBColor(.5f, .5f, .5f));\n\t\t\t\tg.fillRect(i*Square.Size, j*Square.Size, Square.Size, Square.Size);\n\t\t\t\tg.setColor(Color.BLACK);\n\t\t\t\tg.drawRect(i*Square.Size, j*Square.Size, Square.Size, Square.Size);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Fill selected square\n\t\tg.setColor(Color.CYAN);\n\t\tRectangle r = highlightedSquare.getBoundingRect(); \n\t\tg.fill3DRect(r.x, r.y, r.width, r.height, true);\n\t\t\n\t\t// Draw pieces - delegated to square class\n\t\tfor (int i = 0; i < dimensions.x; ++i) {\n\t\t\tfor (int j = 0; j < dimensions.y; ++j) {\n\t\t\t\tboard[i][j].draw(g);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public void redraw(int [][] board)\n\t{\n\t\tfor(int i = 0; i < 20; ++i)\n\t\t{\n\t\t\tfor( int j = 0; j < 10; ++j)\n\t\t\t{\n\t\t\t\tswitch (board[i][j])\n\t\t\t\t{\n\t\t\t\t\t//empty\n\t\t\t\t\tcase 0:\tcolors[i][j] = Color.GRAY; \n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//J - shape\n\t\t\t\t\tcase 1:\tcolors[i][j] = Color.BLUE; \n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//Z shape\n\t\t\t\t\tcase 2:\tcolors[i][j] = Color.RED; \n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//L shape\n\t\t\t\t\tcase 3:\tcolors[i][j] = Color.ORANGE; \n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//S shape\n\t\t\t\t\tcase 4:\tcolors[i][j] = new Color(102,255,102); ;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//I shape\n\t\t\t\t\tcase 5:\tcolors[i][j] = Color.CYAN; \n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//O shape\n\t\t\t\t\tcase 6:\tcolors[i][j] = Color.YELLOW; \n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//T shape\n\t\t\t\t\tcase 7:\tcolors[i][j] = Color.PINK; \n\t\t\t\t\t\tbreak;\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tview.getInGamePanel().getBoardGamePanel().redraw(colors);\t\n\t}" ]
[ "0.79271376", "0.7894529", "0.77715194", "0.7694318", "0.7603892", "0.7570861", "0.7519817", "0.7499765", "0.73574173", "0.73146087", "0.7311036", "0.7297718", "0.7268602", "0.72616076", "0.71977144", "0.7187938", "0.718759", "0.71585196", "0.7149892", "0.71147305", "0.71146435", "0.70905644", "0.7084184", "0.70501006", "0.7040652", "0.6993811", "0.69910103", "0.69844663", "0.6981843", "0.6967145", "0.6966375", "0.69507784", "0.69477814", "0.6936235", "0.69331604", "0.69181335", "0.69081146", "0.6873649", "0.68598384", "0.6857691", "0.68541265", "0.6853387", "0.68410146", "0.68391776", "0.6835202", "0.68337625", "0.6813866", "0.6796805", "0.6794471", "0.6780303", "0.6771687", "0.6763377", "0.67410076", "0.67172694", "0.67154527", "0.67066133", "0.66966754", "0.66819394", "0.66776335", "0.6676869", "0.6668217", "0.66391313", "0.6636306", "0.66311973", "0.6618106", "0.6614997", "0.66144526", "0.66090816", "0.65928614", "0.6584452", "0.6582844", "0.6578778", "0.65528774", "0.6544248", "0.65385354", "0.6534319", "0.6528439", "0.65192175", "0.6517947", "0.6515327", "0.6512056", "0.65087414", "0.6504651", "0.65027636", "0.6502745", "0.64905363", "0.6482079", "0.6475814", "0.6475057", "0.64665765", "0.6466506", "0.64587694", "0.6455532", "0.64531827", "0.64471436", "0.6442031", "0.6438186", "0.6433248", "0.6429491", "0.64286596" ]
0.68368185
44
Fills the board array with integers that correspond to each player
public static void fillTriangle(int attitude, int[][] board, int player, int row, int col) { for (int i = 0; i < 4; i++) for (int j = 0; j <= i; j++) board[attitude > 0 ? row + i : row - i][attitude > 0 ? col + j : col - j] = player; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void fillBoard() {\n List<Integer> fifteen = ArrayUtils.intArrayToList(SOLVED_BOARD);\n Collections.shuffle(fifteen, this.random);\n this.emptyTileIndex = fifteen.indexOf(0);\n this.matrix = fifteen.stream().mapToInt(i -> i).toArray();\n }", "private void fillBoard() {\n\n boardMapper.put(1, new int[]{0, 0});\n boardMapper.put(2, new int[]{0, 1});\n boardMapper.put(3, new int[]{0, 2});\n boardMapper.put(4, new int[]{1, 0});\n boardMapper.put(5, new int[]{1, 1});\n boardMapper.put(6, new int[]{1, 2});\n boardMapper.put(7, new int[]{2, 0});\n boardMapper.put(8, new int[]{2, 1});\n boardMapper.put(9, new int[]{2, 2});\n\n }", "public int[] setUpBoard(int noOfPlayers)\r\n\t{\r\n\t\tswitch(noOfPlayers)\r\n\t\t{\r\n\t\t//One player\r\n\t\tcase 1:\r\n\t\t\tfillTriangle(-1, board, 1, 16, 12);\r\n\t\t\treturn new int[] {1};\r\n\t\t//Two players opposite to one another\r\n\t\tcase 2:\r\n\t\t\tfillTriangle(-1, board, 1, 16, 12);\r\n\t\t\tfillTriangle(1, board, 4, 0, 4);\r\n\t\t\treturn new int[] {1,4};\r\n\t\t//Three players arranged in a triangle\r\n\t\tcase 3:\r\n\t\t\tfillTriangle(1, board, 2, 9, 13);\r\n\t\t\tfillTriangle(1, board, 4, 0, 4);\r\n\t\t\tfillTriangle(1, board, 6, 9, 4);\r\n\t\t\treturn new int[] {2,4,6};\r\n\t\t//Four players with two empty spots opposite from one another\r\n\t\tcase 4:\r\n\t\t\tfillTriangle(1, board, 2, 9, 13);\r\n\t\t\tfillTriangle(-1, board, 3, 7, 12);\r\n\t\t\tfillTriangle(-1, board, 5, 7, 3);\r\n\t\t\tfillTriangle(1, board, 6, 9, 4);\r\n\t\t\treturn new int[] {2,3,5,6};\r\n\t\t//Five players\r\n\t\tcase 5:\r\n\t\t\tfillTriangle(-1, board, 1, 16, 12);\r\n\t\t\tfillTriangle(1, board, 2, 9, 13);\r\n\t\t\tfillTriangle(-1, board, 3, 7, 12);\r\n\t\t\tfillTriangle(1, board, 4, 0, 4);\r\n\t\t\tfillTriangle(-1, board, 5, 7, 3);\r\n\t\t\treturn new int[] {1,2,3,4,5};\r\n\t\t//All six positions occupied by players\r\n\t\tdefault:\r\n\t\t\tfillTriangle(-1, board, 1, 16, 12);\r\n\t\t\tfillTriangle(1, board, 2, 9, 13);\r\n\t\t\tfillTriangle(-1, board, 3, 7, 12);\r\n\t\t\tfillTriangle(1, board, 4, 0, 4);\r\n\t\t\tfillTriangle(-1, board, 5, 7, 3);\r\n\t\t\tfillTriangle(1, board, 6, 9, 4);\r\n\t\t\treturn new int[] {1,2,3,4,5,6};\r\n\t\t}\r\n\t}", "public CardGame(int players, int myID) {\r\n s = new Scanner(System.in);\r\n this.players = players;\r\n this.cardPerPlayer = 52 / players;\r\n this.playerCard = new int[players][4][cardPerPlayer + 2];\r\n this.myID = myID;\r\n for (int i = 0; i < playerCard.length; i++) {\r\n for (int j = 0; j < playerCard[0].length; j++) {\r\n for (int j2 = 2; j2 < playerCard[0][0].length; j2++) {\r\n playerCard[i][j][j2] = 1;\r\n }\r\n }\r\n }\r\n\r\n }", "public void setBoard() {\n for (int i = 0; i < 10 ; i++) {\n board[i] = coordinator.holes[i].getNumberOfMarbleBalls();\n }\n }", "public void fillTheBoard() {\n for (int i = MIN; i <= MAX; i++) {\n for (int j = MIN; j <= MAX; j++) {\n this.getCells()[i][j] = new Tile(i, j, false);\n }\n }\n }", "public void initializeGameboard() {\r\n\t\t\r\n\t\t for (int row=0 ; row<gameBoard.length; row++)\r\n\t\t { \r\n\t\t \t \r\n\t\t \t for(int column=0;column<gameBoard[row].length;column++ )\t \r\n\t\t \t { \r\n\t\t \t\t if( row==0|| row ==1)\r\n\t\t \t\t { \r\n\t\t \t\t\t if (column==0) {gameBoard[row][column]=\"2\";}\r\n\t\t \t\t\t else if (column==1) {gameBoard[row][column]=\"3\";}\t \r\n\t\t \t\t\t else if (column==2) {gameBoard[row][column]=\"4\";} \r\n\t\t \t\t\t else if (column==3) {gameBoard[row][column]=\"5\";} \r\n\t\t \t\t\t else if (column==4) {gameBoard[row][column]=\"6\";} \r\n\t\t \t\t\t else if (column==5) {gameBoard[row][column]=\"7\";}\r\n\t\t \t\t\t else if (column==6) {gameBoard[row][column]=\"8\";} \r\n\t\t \t\t\t else if (column==7) {gameBoard[row][column]=\"9\";}\r\n\t\t \t\t\t else if (column==8) {gameBoard[row][column]=\"10\";} \r\n\t\t \t\t\t else if (column==9) {gameBoard[row][column]=\"11\";} \r\n\t\t \t\t\t else if (column==10) {gameBoard[row][column]=\"12\";} \r\n\t\t \t\t }\r\n\t\t \t\t \r\n\t\t\t \t else if(row ==2 || row==3) \r\n\t\t\t \t {\r\n\t\t\t \t\t if (column==0) {gameBoard[row][column]=\"12\";}\r\n\t\t \t\t\t else if (column==1) {gameBoard[row][column]=\"11\";}\t \r\n\t\t \t\t\t else if (column==2) {gameBoard[row][column]=\"10\";} \r\n\t\t \t\t\t else if (column==3) {gameBoard[row][column]=\"9\";} \r\n\t\t \t\t\t else if (column==4) {gameBoard[row][column]=\"8\";} \r\n\t\t \t\t\t else if (column==5) {gameBoard[row][column]=\"7\";}\r\n\t\t \t\t\t else if (column==6) {gameBoard[row][column]=\"6\";} \r\n\t\t \t\t\t else if (column==7) {gameBoard[row][column]=\"5\";}\r\n\t\t \t\t\t else if (column==8) {gameBoard[row][column]=\"4\";} \r\n\t\t \t\t\t else if (column==9) {gameBoard[row][column]=\"3\";} \r\n\t\t \t\t\t else if (column==10) {gameBoard[row][column]=\"2\";} \r\n\t\t\t \t }\r\n\t\t }\r\n\t\t }\r\n\t }", "public static void initialize()\n\t{\n\n\t\tint[] actualPlayers = new int[4]; // indices of the existing players\n\t\tint index = 0;\n\t\tfor (int i = 0; i < 5; i++)\n\t\t{\n\t\t\tif (players[i].exist)\n\t\t\t\tactualPlayers[index++] = i;\n\t\t}\n\n\t\tif (playerNum == 4)\n\t\t{\n\t\t\tplayers[2].x = 16;\n\t\t\tplayers[2].y = 30;\n\t\t\tplayers[1].x = 16;\n\t\t\tplayers[1].y = 10;\n\t\t\tplayers[3].x = 37;\n\t\t\tplayers[3].y = 10;\n\t\t\tplayers[4].x = 37;\n\t\t\tplayers[4].y = 30;\n\t\t}\n\t\telse if (playerNum == 2)\n\t\t{\t\t\t\n\t\t\tplayers[actualPlayers[0]].x = 16;\n\t\t\tplayers[actualPlayers[0]].y = 20;\n\t\t\tplayers[actualPlayers[1]].x = 37;\n\t\t\tplayers[actualPlayers[1]].y = 20;\t\t\t \n\t\t}\n\t\telse if (playerNum == 3)\n\t\t{\n\t\t\tplayers[actualPlayers[0]].x = 16;\n\t\t\tplayers[actualPlayers[0]].y = 20;\n\t\t\tplayers[actualPlayers[1]].x = 37;\n\t\t\tplayers[actualPlayers[1]].y = 10;\n\t\t\tplayers[actualPlayers[2]].x = 37;\n\t\t\tplayers[actualPlayers[2]].y = 30;\t\n\t\t}\n\n\t\tfor (int i = 0; i < 5; i++)\n\t\t{\n\t\t\tplayers[i].square = new boolean[HEIGHT + 2][WIDTH + 2];\n\t\t\tif (players[i].exist)\n\t\t\t{\n\t\t\t\tplayers[i].alive = true;\n\t\t\t\tplayers[i].square[players[i].y][players[i].x] = true;\n\t\t\t}\n\t\t\tplayers[i].dir = 'a'; // 'a' means no direction yet\n\t\t}\n\n\t\tstarting = false;\n\n\t}", "public static void initialiseGameBoard(){\n\n for ( int row = 0 ; row < 6 ; row++ ){\n for ( int column = 0 ; column < 7 ; column++ ){\n gameBoard[row][column] = \"-\";\n }\n }\n }", "public TicTacToeBoard() {board = new int[rows][columns];}", "protected void fillBoard(Color playerColor)\n {\n for(int i = 0; i < 9; i++)\n this.setSquare(i, playerColor);\n }", "public void resetBoard(){\n totalmoves = 0;\n this.board = new Cell[3][3];\n //fill the board with \"-\"\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) {\n this.board[i][j]=new Cell(new Coordinates(i,j), \"-\");\n }\n }\n }", "private void board() {\r\n\t\tfor (int n = 0; n < ROW; n++) {\r\n\t\t\tfor (int m = 0; m < COL; m++) {\r\n\t\t\t\tboard[n][m] = 'X';\r\n\t\t\t}\r\n\t\t}\r\n\t\tturnRemaining = 42;\r\n\t}", "public ProbIA5Board(int []init) {\n board = new int[init.length];\n\n for (int i = 0; i< init.length; i++) {\n board[i] = init[i];\n }\n }", "public void initializeBoard() {\n\t\tfor (int i = 0; i < 9; i++) {\n\t\t\tthis.board[i] = \"-\";\n\n\t\t}\n\n\t}", "public void clearBoardData()\n {\n player_turn = RED;\n total_moves = 0;\n int[][] clear_board = new int[7][6];\n for (int i = 0; i < clear_board.length; i++)\n current_board[i] = clear_board[i].clone();\n }", "public void aiInitBoard(){\n for(int i = 0; i < boardSize; i++) {\n for (int j = 0; j < boardSize; j++) {\n board[i][j] = 'O';\n }\n }\n }", "public GameBoard()\n\t{\n\t\tint i = 0;\n\t\tboard = new int[9][9];\n\t\tString s = ReadCSV.readCSV(); //data in CSV file is turned into a string\n\t\tfor(int r = 0; r < board.length; r++)\n\t\t{\n\t\t\tfor(int c = 0; c < board.length; c++)\n\t\t\t{\n\t\t\t\twhile((s.charAt(i) == ',') || (s.charAt(i) == '\\n')) //passes over enters and commas\n\t\t\t\t{\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tif(s.charAt(i) == '-') //dashes represent 0\n\t\t\t\t\tboard[r][c] = 0;\n\t\t\t\telse\n\t\t\t\t\tboard[r][c] = (int)s.charAt(i) - 48; //int value of the character which is a number \n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t}", "public void initializeBoard() {\n\n\t\t/*\n\t\t * How the array coordinates align with the actual chess board\n\t\t * (row,col) \n\t\t * (7,0) ... ... ... \n\t\t * (7,7) ... ... ... \n\t\t * ... ... ... \n\t\t * (2,0) ...\n\t\t * (1,0) ... \n\t\t * (0,0) ... ... ... (0,7)\n\t\t */\n\n\t\tboolean hasMoved = false;\n\t\tboolean white = true;\n\t\tboolean black = false;\n\n\t\t// Set white piece row\n\t\tboard[0][0] = new Piece('r', white, hasMoved, 0, 0, PieceArray.A_rookId);\n\t\tboard[0][1] = new Piece('n', white, hasMoved, 0, 1, PieceArray.B_knightId);\n\t\tboard[0][2] = new Piece('b', white, hasMoved, 0, 2, PieceArray.C_bishopId);\n\t\tboard[0][3] = new Piece('q', white, hasMoved, 0, 3, PieceArray.D_queenId);\n\t\tboard[0][4] = new Piece('k', white, hasMoved, 0, 4, PieceArray.E_kingId);\n\t\tboard[0][5] = new Piece('b', white, hasMoved, 0, 5, PieceArray.F_bishopId);\n\t\tboard[0][6] = new Piece('n', white, hasMoved, 0, 6, PieceArray.G_knightId);\n\t\tboard[0][7] = new Piece('r', white, hasMoved, 0, 7, PieceArray.H_rookId);\n\n\t\t// Set white pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[1][i] = new Piece('p', white, hasMoved, 1, i, i + 8);\n\t\t}\n\n\t\t// Set empty rows\n\t\tfor (int row = 2; row < 6; row++)\n\t\t\tfor (int col = 0; col < 8; col++)\n\t\t\t\tboard[row][col] = null;\n\n\t\t// Set black pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[6][i] = new Piece('p', black, hasMoved, 6, i, i+8);\n\t\t}\n\n\t\t// Set black piece row\n\t\tboard[7][0] = new Piece('r', black, hasMoved, 7, 0, PieceArray.A_rookId);\n\t\tboard[7][1] = new Piece('n', black, hasMoved, 7, 1, PieceArray.B_knightId);\n\t\tboard[7][2] = new Piece('b', black, hasMoved, 7, 2, PieceArray.C_bishopId);\n\t\tboard[7][3] = new Piece('q', black, hasMoved, 7, 3, PieceArray.D_queenId);\n\t\tboard[7][4] = new Piece('k', black, hasMoved, 7, 4, PieceArray.E_kingId);\n\t\tboard[7][5] = new Piece('b', black, hasMoved, 7, 5, PieceArray.F_bishopId);\n\t\tboard[7][6] = new Piece('n', black, hasMoved, 7, 6, PieceArray.G_knightId);\n\t\tboard[7][7] = new Piece('r', black, hasMoved, 7, 7, PieceArray.H_rookId);\n\t}", "public static void winnerBoard(Player winner) {\r\n\t\tfor (int i = 0; i < Spaces.length; i++) {\r\n\t\t\tSpaces[i] = winner.piece[0];\r\n\t\t}\r\n\t}", "private void initializeBoard() {\n\n squares = new Square[8][8];\n\n // Sets the initial turn to the White Player\n turn = white;\n\n final int maxSquares = 8;\n for(int i = 0; i < maxSquares; i ++) {\n for (int j = 0; j < maxSquares; j ++) {\n\n Square square = new Square(j, i);\n Piece piece;\n Player player;\n\n if (i < 2) {\n player = black;\n } else {\n player = white;\n }\n\n if (i == 0 || i == 7) {\n switch(j) {\n case 3:\n piece = new Queen(player, square);\n break;\n case 4:\n piece = new King(player, square);\n break;\n case 2:\n case 5:\n piece = new Bishop(player, square);\n break;\n case 1:\n case 6:\n piece = new Knight(player, square);\n break;\n default:\n piece = new Rook(player, square);\n }\n square.setPiece(piece);\n } else if (i == 1 || i == 6) {\n piece = new Pawn(player, square);\n square.setPiece(piece);\n }\n squares[j][i] = square;\n }\n }\n }", "public static int[] createBoard(Gamepiece[][] gBoard){\n\t\tint[] ret = new int[100];\n\t\tfor(int x = 0; x < GRID; x++){\n\t\t\tfor(int y = 0; y < GRID; y++){\n\t\t\t\tret[y*GRID+x] = gBoard[y][x].val();\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t}", "private void initializeBoard(){\r\n checks =new int[][]{{0,2,0,2,0,2,0,2},\r\n {2,0,2,0,2,0,2,0},\r\n {0,2,0,2,0,2,0,2},\r\n {0,0,0,0,0,0,0,0},\r\n {0,0,0,0,0,0,0,0},\r\n {1,0,1,0,1,0,1,0},\r\n {0,1,0,1,0,1,0,1},\r\n {1,0,1,0,1,0,1,0}};\r\n }", "private void intializeBoard(int row, int column, int countToWin)\n\t{\n\t\t_board = new Integer[row][column];\n\t\t_rowCount = row;\n\t\t_columnCount = column;\n\t\t_countToWin = countToWin;\n\t\t\n\t\t_columnFull = new HashSet<Integer>();\n\t\t_lastPosition = new HashMap<Integer,Integer>();\n\t}", "void makeBoard(int[] values) {\n int c = 0;\n for (int i = 0; i < SIZE; i++) {\n for (int j = 0; j < SIZE; j++) {\n if (values[c] == 0) {\n blankRow = i;\n blankCol = j;\n }\n board[i][j] = values[c++];\n }\n }\n this.rank = setRank();\n }", "public void reset() {\n\t\t//reset player to 0\n\t\tplayer = 0;\n\t\t\n\t\tfor(int row = size - 1; row >= 0; row --)\n\t\t\tfor(int col = 0; col < size; col ++)\n\t\t\t\tfor(int dep = 0; dep < size; dep ++)\n\t\t\t\t\t//goes through all board positions and sets to -1\n\t\t\t\t\tboard[row][col][dep] = -1;\n\t}", "public static int[][] createBoard() {\r\n\r\n\t\tint[][] board = new int[9][9];\r\n\t\tfor (int i = 0; i < 9; i++) {\r\n\t\t\tfor (int j = 0; j < 9; j++)\r\n\t\t\t\tboard[i][j] = scan.nextInt();\r\n\t\t}\r\n\t\treturn board;\r\n\r\n\t}", "private GamePiece[][] initBoard(int rows, int cols, Random rand) {\n gameBoard = new GamePiece[rows][cols];\n curPlayerRow = 0;\n curPlayerCol = 0;\n for(int i = 0; i < rows; i++){\n for(int j = 0; j < cols; j++){\n gameBoard[i][j] = new EmptyPiece();\n }\n }\n gameBoard[0][0] = new PlayerPiece(INIT_PLAYER_POINTS);\n curTrollRow = getRandTrollRow(rand, rows);\n curTrollCol = getRandTrollCol(rand, cols);\n while(curTrollRow == 7 && curTrollCol == 9){\n curTrollRow = getRandTrollRow(rand, rows);\n curTrollCol = getRandTrollCol(rand, cols);\n }\n gameBoard[curTrollRow][curTrollCol] = new TrollPiece();\n gameBoard[7][9] = new TreasurePiece(TREASURE_POINTS);\n return gameBoard;\n }", "private void inputData(int[][] board) {\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tfor(int j=0;j<N;j++) {\n\t\t\t\tboard[i][j]=0;\n\t\t\t}\n\t\t}\n\t\t\n\t}", "@Override\n public void startGame() {\n //create new board instance\n board = new int[NUM_ROWS][NUM_COLS];\n //set all elements to EMPTY\n for (int c = 0; c < NUM_COLS; c++) {\n for (int r = 0; r < NUM_ROWS; r++) {\n board[r][c] = EMPTY;\n }\n }\n //set the turn to red\n turn = RED;\n }", "private void fillGameBoard() {\n for (int i = 0; i < row; i++) {\n String next = input.get(pointer);\n for (int j = 0; j < column; j++) {\n game[i][j] = String.valueOf(next.charAt(j)); //takes char from string next, this is where columns are filled\n }\n pointer++;\n }\n }", "private void fillBoard() {\n\t\tint randomRow, randomColumn;\n\t\t\n\t\tfor (int i = 0; i < bombs; ++i) {\n\t\t\trandomRow = (int)(Math.random() * rows);\n\t\t\trandomColumn = (int)(Math.random() * columns);\n\t\t\tboard[randomRow][randomColumn] = -1;\n\t\t}\n\t\t\n\t\tfor (int r = 0; r < rows; ++r) {\n\t\t\tfor (int c = 0; c < columns; ++c) {\n\t\t\t\tif (board[r][c] == -1) {\n\t\t\t\t\tincreaseFreeCells(r, c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void setUpPlayers(){\n\t\tTreeMap<String,Integer> turnsDetails = new TreeMap<>();\n\t\tint e = 0;\n\t\tfor(Player i : allplayers) {\n\t\t\ti.fillHand();\n\t\t\tturnsDetails.put(i.getFirstLetter()+String.valueOf(e),e);\n\t\t\te++;\n\t\t}\n\t\t// populate the turn list\n //entryset returns a set view of mappings contained\n\t\tfor(Map.Entry<String,Integer> i : turnsDetails.entrySet())\n\t\t\tturns.add(i.getValue());\n\t}", "private Board(Piece[][] initialContents, Side player) {\n assert player != null && initialContents.length == 8;\n Piece p;\n for (int i = 0; i < 8; i++) {\n for(int j = 0; j < 8; j++) {\n p = initialContents[i][j];\n if (p.side() != null) {\n if (p.side() == BLACK) {\n _countBlack += 1;\n } else {\n _countWhite += 1;\n }\n addPiece(j + 1, i + 1);\n }\n _pieces[i][j] = p\n }\n }\n _turn = player;\n }", "private void fillDeck() {\n int index = 0;\n for (int suit = 1; suit <= 4; suit++) {\n for (int rank = 1; rank <= 13; rank++) {\n deck[index] = new Card(rank, suit);\n index++;\n\n }\n }\n }", "public void gameOfLife(int[][] board) {\n int m = board.length;\n int n = board[0].length;\n\n int[][] nextGeneration = new int[m][n];\n\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n int liveNeighbors = countLiveNeighbors(board, i, j, m, n);\n\n if (board[i][j] == 1) {\n if (liveNeighbors < 2 || liveNeighbors > 3) {\n nextGeneration[i][j] = 0;\n } else {\n nextGeneration[i][j] = 1;\n }\n } else {\n if (liveNeighbors == 3) {\n nextGeneration[i][j] = 1;\n }\n }\n }\n }\n\n for (int i = 0; i < m; i++) {\n System.arraycopy(nextGeneration[i], 0, board[i], 0, n);\n }\n }", "public void resetBoard() {\n\t\t\n\t\tfor(int row = 0; row < board.length; row++) {\n\t\t\tfor(int col = 0; col < board[row].length; col++) {\n\t\t\t\t\n\t\t\t\tboard[row][col] = 0;\n\t\t\t}\n\t\t}\n\t}", "public void fill(){\n int i = 0;\n for (Suit suit:Suit.values()){\n for (Rank rank:Rank.values()) {\n deck[i] = new Card(rank, suit);\n numCards++;\n i++;\n }\n }\n }", "public void prepairBoard() {\n if (NrOfGames == 0){\r\n StdOut.println(\"Enter player 1 name: \");\r\n Scanner scan = new Scanner(System.in);\r\n player1 = scan.nextLine();\r\n StdOut.println(\"Enter player 2 name: \");\r\n player2 = scan.nextLine();\r\n NrOfGames++;\r\n }\r\n NrOfGames++;\r\n //clear board\r\n int i = 0;\r\n while (i < 9){board[i] = ' ';i++;}\r\n player1turn = 1;\r\n player2turn = 0;\r\n }", "public Board(int x, int y){\n player1 = \"Player 1\";\n player2 = \"Player 2\";\n randomPlayer1 = \"CPU 1\";\n randomPlayer2 = \"CPU 2\";\n board = new Square[x][y];\n for (int i = 0; i < board.length;i++){\n row++;\n for(int j = 0; j < board.length; j++){\n if(column == y){\n column = 0;\n }\n column++;\n board[i][j] = new Square(row, column);\n }\n }\n row = x;\n column = y;\n }", "public static int[][] createBoard() {\r\n\t\t\r\n\t\tint[][] board = new int [8][8];\r\n\t\t//printing the red solduers\r\n\t\tfor (int line =0,column=0;line<3;line=line+1){\r\n\t\t\tif (line%2==0){column=0;}\r\n\t\t\telse {column=1;}\r\n\t\t\tfor (;column<8;column=column+2){\r\n\t\t\t\tboard [line][column] = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//printing the blu solduers\r\n\t\tfor (int line =5,column=0;line<8;line=line+1){\r\n\t\t\tif (line%2==0){column=0;}\r\n\t\t\telse {column=1;}\r\n\t\t\tfor (;column<8;column=column+2){\r\n\t\t\t\tboard [line][column] = -1;\r\n\t\t\t}\r\n\t\t}\t\t\t\r\n\t\treturn board;\r\n\t}", "public static int[][] createArrayForCards(int totalPlayers) {\n int[][] cardValues = new int[totalPlayers][2];\n // this makes the default value zero. redunant yes, but wanted to populate it first\n for (int i = 0; i < cardValues.length; i++) {\n for (int j = 0; j < 2 ; j++) {\n cardValues[i][j] = 0;\n }\n }\n return cardValues;\n }", "public int[][] getBoard();", "public static void createBoard() \n\t{\n\t\tfor (int i = 0; i < tictactoeBoard.length; i++) \n\t\t{\n\t\t\ttictactoeBoard[i] = '-';\n\t\t}\n\t}", "private void setNumbers() {\n\t\tint w = worldWidth;\n\t\tint h = worldHeight;\n\t\tfor (int x = 0; x <= w - 1; x++) {\n\t\t\tfor (int y = 0; y <= h - 1; y++) {\n\t\t\t\tint numbers = 0;\n\n\t\t\t\tint right = x + 1;\n\t\t\t\tint left = x - 1;\n\t\t\t\tint up = y - 1;\n\t\t\t\tint down = y + 1;\n\n\t\t\t\tif (left < 0) {\n\t\t\t\t\tleft = 0;\n\t\t\t\t}\n\t\t\t\tif (up < 0) {\n\t\t\t\t\tup = 0;\n\t\t\t\t}\n\t\t\t\tif (down >= h) {\n\t\t\t\t\tdown = h - 1;\n\t\t\t\t}\n\t\t\t\tif (right >= w) {\n\t\t\t\t\tright = w - 1;\n\t\t\t\t}\n\n\t\t\t\tfor (int m = left; m <= right; m++) {\n\t\t\t\t\tfor (int n = up; n <= down; n++) {\n\t\t\t\t\t\tif (!(m == x && n == y)) {\n\t\t\t\t\t\t\tif (tileArr[m][n].hasBomb()) {\n\t\t\t\t\t\t\t\tnumbers++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttileArr[x][y].setNeighbors(numbers);\n\t\t\t}\n\n\t\t}\n\n\t}", "private void initialiseBoard() {\r\n\t\thorizontal = new char[width];\r\n\t\tvertical = new int[height];\r\n\t\tfor (int i=0; i<horizontal.length; i++) {\r\n\t\t\thorizontal[i] = (char)(i+65);\r\n\t\t}\r\n\t\tfor (int i=0; i<vertical.length; i++) {\r\n\t\t\tvertical[i] = i+1;\r\n\t\t}\r\n\t}", "private void generateBoard(){\n\t}", "private void fillBoard() {\n\t\tfor (int i = 0; i < board.length; i++) {\n\t\t\tboard[i] = ' ';\n\t\t}\n\t\tfor (int i = 0; i < isFree.length; i++) {\n\t\t\tisFree[i] = true;\n\t\t}\n\t}", "public void setBoard(int[][] board) {\n this.board = board;\n }", "public void resetBoard() {\n piece = 1;\n b = new Board(9);\n board = b.getBoard();\n\n board2d = new int[3][3];\n makeBoard2d();\n\n }", "private int[][] makeBoard() {\r\n int[][] gridBoard = new int[gridSize][gridSize];\r\n int remainingPlacedBombs = numBombs;\r\n \r\n for (int i = 0; i < gridBoard.length; i++) {\r\n for (int j = 0; j < gridBoard[i].length; j++) {\r\n gridBoard[i][j] = 0;\r\n }\r\n } \r\n while (remainingPlacedBombs > 0) {\r\n int row = (int) (Math.random() * gridSize);\r\n int col = (int) (Math.random() * gridSize);\r\n if (gridBoard[row][col] == 0) {\r\n gridBoard[row][col] = 1;\r\n remainingPlacedBombs--;\r\n } \r\n } \r\n return gridBoard;\r\n }", "public void populateArray()\n { \n Random rand = new Random(); // calling random class to generate random numbers\n randInt = new int[this.getWidth()]; // initializing array to its panel width\n rand.setSeed(System.currentTimeMillis());\n for(int i = 0; i < this.getWidth();i++) // assigning the random values to array \n {\n randInt[i] = rand.nextInt(this.getHeight() -1) + 1;\n }\n this.repaint(); // calling paint method\n }", "public int[][] createBoard(int size){\r\n\t\tint[][] newBoard = new int[size+1][size+1];\r\n\t\tfor (int i = 0; i < newBoard.length; i++){\r\n\t\t\tfor (int j = 0; j < newBoard[i].length; j++) {\r\n\t\t\t\tif (i == 0) {\r\n\t\t\t\t\tnewBoard[i][j] = j;\r\n\t\t\t\t} else if (j == 0) {\r\n\t\t\t\t\tnewBoard[i][j] = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}newBoard[0][0] = 0;\r\n\treturn newBoard;\r\n\t}", "public static void createBoard() {\n Checkers[] CheckerBoard = new Checkers[24];\n CheckerBoard[0] = new Checkers(0,1,\"black\");\n CheckerBoard[1] = new Checkers(0,3,\"black\");\n CheckerBoard[2] = new Checkers(0,5,\"black\");\n CheckerBoard[3] = new Checkers(0,7,\"black\");\n CheckerBoard[4] = new Checkers(1,0,\"black\");\n CheckerBoard[5] = new Checkers(1,2,\"black\");\n CheckerBoard[6] = new Checkers(1,4,\"black\");\n CheckerBoard[7] = new Checkers(1,6,\"black\");\n CheckerBoard[8] = new Checkers(2,1,\"black\");\n CheckerBoard[9] = new Checkers(2,3,\"black\");\n CheckerBoard[10] = new Checkers(2,5,\"black\");\n CheckerBoard[11] = new Checkers(2,7,\"black\");\n CheckerBoard[12] = new Checkers(5,1,\"red\");\n CheckerBoard[13] = new Checkers(5,3,\"red\");\n CheckerBoard[14] = new Checkers(5,5,\"red\");\n CheckerBoard[15] = new Checkers(5,7,\"red\");\n CheckerBoard[16] = new Checkers(6,0,\"red\");\n CheckerBoard[17] = new Checkers(6,2,\"red\");\n CheckerBoard[18] = new Checkers(6,4,\"red\");\n CheckerBoard[19] = new Checkers(6,6,\"red\");\n CheckerBoard[20] = new Checkers(7,1,\"red\");\n CheckerBoard[21] = new Checkers(7,3,\"red\");\n CheckerBoard[22] = new Checkers(7,5,\"red\");\n CheckerBoard[23] = new Checkers(7,7,\"red\");\n\n\n\n }", "public void initBoard(){\n System.out.print(\" \");\n for(int i = 0; i < boardSize; i++){\n System.out.print(\" \" + i + \" \");\n }\n System.out.println();\n for(int i = 0; i < boardSize; i++){\n System.out.print(\" \" + (char)(i + 'A') + \" \");\n for (int j = 0; j < boardSize; j++){\n board[i][j] = 'O';\n System.out.print(\" \" + board[i][j] + \" \");\n }\n System.out.println();\n }\n System.out.println();\n }", "public static void initBoard()\r\n\t{\n\t\tfor ( int r=0; r<3; r++ )\r\n\t\t\tfor ( int c=0; c<3; c++ )\r\n\t\t\t\tboard[r][c] = ' ';\r\n\t}", "private void initGameBoard(int rows, int cols)\n {\n //GameBoard = new Cell[ROWS][COLS];\n\n for(int i = 0; i < rows; i++)\n {\n for(int j = 0; j < cols; j++)\n {\n GameBoard[i][j] = new Cell(i,j, Color.BLUE,false);\n }\n\n }\n }", "public void assignmines() {\n\n for(int row = 0; row < mineBoard.length; row++) {\n for(int col = 0; col < mineBoard[0].length; col++) {\n mineBoard[row][col] = 0;\n }\n }\n\n int minesPlaced = 0;\n Random t = new Random();\n while(minesPlaced < nummines) {\n int row = t.nextInt(10);\n int col = t.nextInt(10);\n if(mineBoard[row][col] == Empty) {\n setmine(true);\n mineBoard[row][col] = Mine;\n minesPlaced++;\n }\n }\n }", "public void populateLists() {\n\t\tfor (int row = 0; row < 8; row++) {\n\t\t\tfor (int col = 0; col < 8; col++)\n\t\t\t\tif (board[row][col] != null && board[row][col].isWhite())\n\t\t\t\t\twhitePieces.add(board[row][col]);\n\t\t\t\t\t//whitePieces.add(board[row][col]);\n\t\t}\n\t\tfor (int row = 0; row < 8; row++) {\n\t\t\tfor (int col = 0; col < 8; col++){\n\t\t\t\tif (board[row][col] != null && !board[row][col].isWhite())\n\t\t\t\t\tblackPieces.add(board[row][col]);}\n\t\t\t\n\t\t}\n\t}", "private void setDefaultBoard() throws TooManyPlayersException, InvalidColourException{\r\n\t\tif(getPlayers().size() != 2) {\r\n\t\t\tthrow new TooManyPlayersException(\"There are too many players, must only be 2\");\r\n\t\t}else {\r\n\t\t\tArrayList<Coordinate> pawnRankCoords, backRankCoords; //indexes for row numbers for ranks\r\n\t\t\tfor (Player player: getPlayers()) {\r\n\t\t\t\t\r\n\t\t\t\t//select what rank the pieces should be based on colour\r\n\t\t\t\tswitch (player.getColour()) {\r\n\t\t\t\tcase BLACK:\r\n\t\t\t\t\tpawnRankCoords = this.getRowCoordinates(1);\r\n\t\t\t\t\tbackRankCoords = this.getRowCoordinates(0);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase WHITE:\r\n\t\t\t\t\tpawnRankCoords = this.getRowCoordinates(getBoardArray().length-2);\r\n\t\t\t\t\tbackRankCoords = this.getRowCoordinates(getBoardArray().length-1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthrow new InvalidColourException(\"Chess only has white or black colours, please reset\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfinal int NUM_PIECES_IN_RANK = 8;\r\n\t\t\t\t//create the pieces, assigning the player to them\r\n\t\t\t\tPiece[] specialPieces = {new Rook(player), new Knight(player), new Bishop(player), new Queen(player),\r\n\t\t\t\tnew King(player), new Bishop(player), new Knight(player), new Rook(player)};\r\n\t\t\t\t\r\n\t\t\t\tfor (int i = 0; i < NUM_PIECES_IN_RANK; i++) {\r\n\t\t\t\t\tthis.setPiece(pawnRankCoords.get(i), new Pawn(player));\r\n\t\t\t\t\tthis.setPiece(backRankCoords.get(i), specialPieces[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void gameOfLife(int[][] board) {\n\n }", "public void initializeBoard() {\r\n int x;\r\n int y;\r\n\r\n this.loc = this.userColors();\r\n\r\n this.board = new ArrayList<ACell>();\r\n\r\n for (y = -1; y < this.blocks + 1; y += 1) {\r\n for (x = -1; x < this.blocks + 1; x += 1) {\r\n ACell nextCell;\r\n\r\n if (x == -1 || x == this.blocks || y == -1 || y == this.blocks) {\r\n nextCell = new EndCell(x, y);\r\n } else {\r\n nextCell = new Cell(x, y, this.randColor(), false);\r\n }\r\n if (x == 0 && y == 0) {\r\n nextCell.flood();\r\n }\r\n this.board.add(nextCell);\r\n }\r\n }\r\n this.stitchCells();\r\n this.indexHelp(0, 0).floodInitStarter();\r\n }", "public int[] getBoard() {\n return board.clone(); //return board.clone();\n }", "public void initGame() {\n for (int row = 0; row < ROWS; ++row) {\n for (int columns = 0; columns < COLUMNS; ++columns) {\n board[row][columns] = Seed.EMPTY; // all cells empty\n }\n }\n currentState = GameState.PLAYING; // ready to play\n currentPlayer = Seed.CROSS; // cross starts first\n }", "public HexBoard(boolean playerOne){\n this.playerOne = playerOne;\n board = new int[126]; //really size 121 but begin indexing at 1\n Arrays.fill(board,0);\n boardWidth = (int) java.lang.Math.sqrt(board.length);\n\n //making final constants to store winning paths\n TOP = board.length -4;\n BOTTOM = board.length -3;\n LEFT = board.length -2;\n RIGHT = board.length -1;\n\n }", "public int updateBoard() {\n clearTemporaryData();\n setUsedValuesbyRow();\n setUsedValuesByColumns();\n setUsedValueInBoxes();\n findUniqueInBoxes();\n updateValues();\n\n return numbers.stream()\n .filter(n -> n.getValue() == 0)\n .collect(Collectors.toList()).size();\n }", "public void clear() {\r\n //This for loop assigns every value in the gameBoard array to -1\r\n //Using the Arrays.fill method and the for loop it fills in all sub arrays\r\n for (int i = 0; i < gameBoard.length; i++) {\r\n Arrays.fill(gameBoard[i], -1);\r\n }\r\n }", "public void setBoard(){\n \n\t m_Pieces[3][3]= WHITE_PIECE;\n m_Pieces[4][4]= WHITE_PIECE;\n m_Pieces[3][4]= BLACK_PIECE;\n m_Pieces[4][3]= BLACK_PIECE;\n for(int x=0;x<WIDTH;x++){\n for(int y=0;y<HEIGHT;y++){\n if(m_Pieces[x][y]==null){\n m_Pieces[x][y]=NONE_PIECE;\n }\n }\n }\n }", "public static void resetBoard()\n {\n for (int i = 0; i<BOARD_HEIGHT;i++) //Recorre las filas.\n {\n for (int j = 0; j <BOARD_WIDTH;j++) //Recorre las columnas.\n {\n boardPos[i][j]=0; //Resetea la casilla actual.\n }\n }\n }", "public void renderBoard(){\n for (int k = 0; k < grid.length; k++)\n for (int m = 0; m < grid[k].length; m++)\n grid[k][m] = 0;\n\n // fill the 2D array using information for non-empty tiles\n for (Cell c : game.getNonEmptyTiles())\n grid[c.getRow()][c.getCol()] = c.getValue();\n }", "public void assignPlayerPieces(Map<Player, Integer> playerHash) {\n List<Integer> nums = new ArrayList<>(playerHash.values());// get all the numbers from playerHash\n List<Player> players = new ArrayList<>(playerHash.keySet()); // get all the players from the hash map\n Collections.sort(nums); // sort the list of numbers\n Collections.reverse(nums);// reverse the list so the highest numbers are first\n int pieceIndex = 0; // variable used to represent the index for the playerPiece\n List<Integer> usedNums = new ArrayList<Integer>();// Empty list that will be used to know what numbers have been used.\n for (Integer num : nums) { // go through each number in numbers\n if (!usedNums.contains(num)) {// if the usedNums list doesn't contain num\n for (Player player : players) { // for each player\n if (playerHash.get(player).equals(num)) {// if the num is the number they got from their dice roll\n player.setPiece(this.playerPieces.get(pieceIndex)); // give them the playerPiece at index pieceIndex\n pieceIndex++;// increment pieceIndex\n usedNums.add(num);//add the used number into usedNums list\n }\n }\n }\n }\n }", "public void randomize(){\r\n int random = (int) (Math.random()*36);\r\n for(int i = 0;i<7;i++){\r\n for(int j = 0;j<36;j++){\r\n temparray[1] = gameBoard[random];\r\n temparray[2] = gameBoard[j];\r\n gameBoard[j] = temparray[1];\r\n gameBoard[random] = temparray[2];\r\n \r\n }\r\n }\r\n \r\n }", "public static void boardInit() {\n ArrayList<Piece> white_piece_list = new ArrayList<>();\n ArrayList<Piece> black_piece_list = new ArrayList<>();\n ArrayList<Piece> piece_array = PieceFactory.createPieces();\n for(Piece p : piece_array)\n {\n if(p.getColor())\n {\n black_piece_list.add(p);\n }\n else\n {\n white_piece_list.add(p);\n }\n }\n white_player.setpieceList(white_piece_list);\n white_player.setKingXYCoords(PieceFactory.KING_INITIAL_X, PieceFactory.INITAL_Y_COORD_WHITE_PLAYER_OTHER);\n black_player.setpieceList(black_piece_list);\n black_player.setKingXYCoords(PieceFactory.KING_INITIAL_X, PieceFactory.INITAL_Y_COORD_WHITE_PLAYER_OTHER + PieceFactory.DIST_BETWEEN_PIECES);\n }", "public void Game() {\n\t\tboard = new int[3][3];\n\t\trowSum = new int[3];\n\t\tcolSum = new int[3];\n\t\tdiagSum = new int[2];\n\t\treset();\n\t}", "public Board() {\n tiles = new int[3][3];\n int[] values = genValues(new int[]{1, 2, 3, 4, 5, 6, 7, 8, 0});\n\n int offset;\n for (int i = 0; i < 3; i++) {\n offset = 2 * i;\n tiles[i] = Arrays.copyOfRange(values, i + offset, i + offset + 3);\n }\n }", "public int[] getBoard() {\n\t return board;\n }", "public TTT_GamePlay() {\r\n\t\tArrays.fill(p1, 0);\r\n\t\tArrays.fill(p2, 0);\r\n\t\tArrays.fill(selectedCells, false);\r\n\t\tthis.board = new int[9];\r\n\t\tthis.player = player1;\r\n\t\twin = false;\r\n\t}", "public void resetBoard(){\r\n for(int i = 0;i<6;i++){ //empty board \r\n for (int j = 0; j < 7; j++) {\r\n boardRep[i][j] = 0;\r\n }\r\n }\r\n \r\n for (int i = 0; i < 7; i++) { // set column heights to 0\r\n currentFilled[i] = 0;\r\n }\r\n \r\n blackToPlay = true; //black goes first for now\r\n refreshDisplay(); \r\n \r\n }", "public void populateBoard(int x, int y) {\n board = new Cell[x][y];\n for (int i = 0; i < board.length; i++) {\n for (int j = 0; j < board[i].length; j++) {\n board[i][j] = new Cell();\n boolean random = Math.random() > 0.5;\n if (random) {\n board[i][j].setAlive(true);\n }\n }\n }\n }", "private static void fillArray(int[][] array) {\n for (int i = 0; i < array.length; i++)\n for (int j = 0; j < array[i].length; j++)\n array[i][j] = i + j;\n\n // The following lines do nothing\n array = new int[1][1];\n array[0][0] = 239;\n }", "public Gameboard() {\n\n\t\tturn = 0;\n\n\t\tboard = new Cell[4][4][4];\n\n\t\tfor (int i = 0; i < board.length; i++) {\n\t\t\tfor (int j = 0; j < board.length; j++) {\n\t\t\t\tfor (int k = 0; k < board.length; k++) {\n\n\t\t\t\t\tboard[i][j][k] = Cell.E;\n\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "Game() {\n this.id = new Random(100).nextInt();\n this.board = new ArrayList<>();\n for (int i = 0; i < NUMBER_OF_ALL_HOUSES_AND_KALAHS; i++) {\n // Add Kalah on n-th position and 2*n-1 position\n if (i == NUMBER_OF_HOUSES || i == NUMBER_OF_ALL_HOUSES_AND_KALAHS - 1) {\n this.board.add(new Pit(0));\n }\n this.board.add(new Pit(NUMBER_OF_SEEDS));\n }\n }", "public void initialize() {\n int numberOfReds = board.length / 2;\n\n for (int i = 0; i < board.length; i++) {\n if (i < numberOfReds) {\n board[i] = PIECE_RED;\n } else if (i > numberOfReds) {\n board[i] = PIECE_BLUE;\n }\n }\n }", "public Board() {\n\t\tthis.table = new int[Constants.SIZE][Constants.SIZE];\n\t\tthis.P1Movable = new boolean[Constants.SIZE][Constants.SIZE];\n\t\tthis.P2Movable = new boolean[Constants.SIZE][Constants.SIZE];\n\t\tP1turn = true;\n\t\tnumPieces = 0;\n\t\t\n\t\tfor(int i=0; i<table.length; i++) {\n\t\t\tfor(int j=0; j<table[i].length; j++) {\n\t\t\t\ttable[i][j] = Constants.EMPTY;\n\t\t\t\tP1Movable[i][j] = true;\n\t\t\t\tP2Movable[i][j] = true;\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public GameBoard(){\r\n\t\tboard = new Box[boardSize];\r\n\t\tfor(int i = 0; i < boardSize; i++){\r\n\t\t\tboard[i] = Box.EMPTY;\r\n\t\t}\r\n\t}", "public int[] boardConvertto1d() {\n for (int i = 0; i < 9; i++) {\n int row = i / 3;\n int col = i % 3;\n board[i] = board2d[row][col];\n }\n return board;\n }", "private char[] createBoard() {\n for (int i = 1; i < 10; i++) {\n board[i] = 0;\n }\n return board;\n }", "public GameBoard(){\r\n boardCells = new GameCell[NUMBER_OF_CELLS];\r\n for( int i= 0; i< NUMBER_OF_CELLS; i++ ){\r\n boardCells[i] = new GameCell(i);//\r\n }\r\n }", "public static int[][] defensivePlayer(int[][] board, int player) {\r\n\t\t\r\n\t\tint [][] BasicMove = getAllBasicMoves (board,player);\r\n\t\tint [][] savedefensMove = new int [BasicMove.length][4]; /*arry had all the definding moves*/\r\n\t\tint[][] boardnow = new int [8][8];\r\n\t\tint numrandom = (int)((Math.random())*100);/*reciving varible random*/\r\n\t\tint sumdefensMove=0;/*varible that count defince moves*/\r\n\t\tint fromRow=0;\r\n\t\tint fromCol=0;\r\n\t\tint toRow=0;\r\n\t\tint toCol=0;\r\n\t\t\r\n\t\tif (canJump(board,player)){/*if ther jump choosed randomaly*/\r\n\t\t\tboard = randomPlayer(board,player);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t//copieng the board \r\n\t\t\tfor (int line=0;line<8;line=line+1){\r\n\t\t\t\tfor (int column=0;column<8;column=column+1){\r\n\t\t\t\t\tboardnow [line][column] = board[line][column];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t/*running an all the posible moves */\r\n\t\t\tfor(int index=0;index<BasicMove.length;index=index+1){\r\n\t\t\t\tfromRow = BasicMove[index][0];\r\n\t\t\t\tfromCol = BasicMove[index][1];\r\n\t\t\t\ttoRow = BasicMove[index][2];\r\n\t\t\t\ttoCol = BasicMove[index][3];\r\n\t\t\t\tboard = playMove(board,player,fromRow,fromCol,toRow,toCol);\r\n\t\t\t\t/*if we can do eating in the next jump*/\r\n\t\t\t\tif (canJump(board,(player*(-1)))==false){\r\n\t\t\t\t\tsavedefensMove[sumdefensMove][0]=fromRow;\r\n\t\t\t\t\tsavedefensMove[sumdefensMove][1]=fromCol;\r\n\t\t\t\t\tsavedefensMove[sumdefensMove][2]=toRow;\r\n\t\t\t\t\tsavedefensMove[sumdefensMove][3]=toCol;\r\n\t\t\t\t\tsumdefensMove=sumdefensMove+1;\r\n\t\t\t\t}\r\n\t\t\t\t/*copieng the board*/\r\n\t\t\t\tfor (int line=0;line<8;line=line+1){\r\n\t\t\t\t\tfor (int column=0;column<8;column=column+1){\r\n\t\t\t\t\t\tboard[line][column] = boardnow[line][column];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t/*if there is posible defence move chose one randomaly */\r\n\t\t\tif (sumdefensMove>0){\r\n\t\t\t\tnumrandom = numrandom%sumdefensMove;\r\n\t\t\t\tfromRow = savedefensMove[numrandom][0];\r\n\t\t\t\tfromCol = savedefensMove[numrandom][1];\r\n\t\t\t\ttoRow = savedefensMove[numrandom][2];\r\n\t\t\t\ttoCol = savedefensMove[numrandom][3];\r\n\t\t\t\tboard=playMove(board,player,fromRow,fromCol,toRow,toCol);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse{/*if there is no posible defence move chose one randomaly*/\r\n\t\t\t\tboard=randomPlayer(boardnow,player);\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t}\r\n\t\treturn board;\r\n\t}", "public abstract int[][] setupBattleships(int[] ships, int gridSize);", "public static int[][] randomPlayer(int[][] board, int player) {\r\n\t\t\r\n\t\tint numrandom = (int)((Math.random())*100); /*varible to recive a random number*/\r\n\t\tint fromRow;\r\n\t\tint fromCol;\r\n\t\tint toRow;\r\n\t\tint toCol;\r\n\t\t/*builed array whit the all posibles jumps and choos one of them randomy*/\r\n\t\tif (canJump(board,player)){\r\n\t\t\t\tint [][] moveJump = getAllBasicJumps (board,player);\r\n\t\t\t\tnumrandom = numrandom%(moveJump.length);\r\n\t\t\t\tfromRow = moveJump[numrandom][0];\r\n\t\t\t\tfromCol = moveJump[numrandom][1]; \r\n\t\t\t\ttoRow = moveJump[numrandom][2];\r\n\t\t\t\ttoCol = moveJump[numrandom][3];\r\n\t\t\t\tboard=playMove(board,player,fromRow,fromCol,toRow,toCol);\r\n\t\t\t\tint [][] morJump = getRestrictedBasicJumps(board,player,toRow,toCol);\r\n\t\t\t\twhile (morJump.length>0){\r\n\t\t\t\t\tnumrandom = numrandom%(morJump.length);\r\n\t\t\t\t\tfromRow = morJump[numrandom][0];\r\n\t\t\t\t\tfromCol = morJump[numrandom][1]; \r\n\t\t\t\t\ttoRow = morJump[numrandom][2];\r\n\t\t\t\t\ttoCol = morJump[numrandom][3];\r\n\t\t\t\t\tboard=playMove(board,player,fromRow,fromCol,toRow,toCol);\r\n\t\t\t\t\tmorJump = getRestrictedBasicJumps(board,player,toRow,toCol);\t\t\r\n\t\t\t\t}\r\n\t\t}\t\t\t\t\r\n\t\telse {/*if ther are no posibele jums bulding an arry */\r\n\t\t\tint [][] BasicMove = getAllBasicMoves (board,player);\r\n\t\t\tnumrandom = numrandom%(BasicMove.length);\r\n\t\t\tfromRow = BasicMove[numrandom][0];\r\n\t\t\tfromCol = BasicMove[numrandom][1];\r\n\t\t\ttoRow = BasicMove[numrandom][2];\r\n\t\t\ttoCol = BasicMove[numrandom][3];\r\n\t\t\tboard=playMove(board,player,fromRow,fromCol,toRow,toCol);\r\n\t\t}\r\n\t\t\r\n\t\treturn board;\r\n\t}", "private void layTiles() {\n board = new Tile[height][width];\n for (int i = 0; i < height; i++) {\n for (int j = 0; j < width; j++) {\n layTile(new Tile(i, j));\n }\n }\n }", "private void initializeGameBoard()\n\t{\n\t\tboard = new State[3][3];\n\t\tfor (int r = 0; r < 3; r++)\n\t\t\tfor (int c = 0; c < 3; c++)\n\t\t\t\tboard[r][c] = State.EMPTY;\n\t}", "private Board(int[][] array)\n\t{\n\t\tcols = 0;\n\t\trows = array.length;\n\t\tif (rows > 0)\n\t\t\tcols = array[0].length;\n\t\t\n\t\tpieces = new int[rows][cols];\n\t\tif (pieces.length > 0)\n\t\t{\n\t\t\tfor (int i = 0; i < pieces.length; i++)\n\t\t\t\tfor (int j = 0; j < pieces[0].length; j++)\n\t\t\t\t\tpieces[i][j] = array[i][j];\n\t\t}\n\t}", "@Override\n\tpublic int updateBoard(int num) {\n\t\treturn 0;\n\t}", "public void addPieces() {\r\n\t\tboard[0] = 8;\r\n\t\tboard[1] = 1;\r\n\t\tboard[2] = 6;\r\n\t\tboard[3] = 3;\r\n\t\tboard[4] = 5;\r\n\t\tboard[5] = 7;\r\n\t\tboard[6] = 4;\r\n\t\tboard[7] = 9;\r\n\t\tboard[8] = 2;\r\n\t}", "public static int[][] sidesPlayer(int[][] board, int player) {\r\n\t\t\r\n\t\tint [][] BasicMove = getAllBasicMoves (board,player);\r\n\t\tint [][] savesidesMove = new int [8][4];\r\n\t\tsavesidesMove[0][0]= -1;\r\n\t\tint sumsidesMove=0;/*varible count all the moves to the sides*/\r\n\t\tint numrandom = (int)((Math.random())*100);/*varible to recive random number*/\r\n\t\t\r\n\t\tif (canJump(board,player)){/*if there is jump is choosed randomly*/\r\n\t\t\tboard = randomPlayer(board,player);\r\n\t\t}\r\n\t\telse { /*if there is moves to tle lines 1-8*/\r\n\t\t\tfor(int index=0;index<BasicMove.length;index=index+1){\r\n\t\t\t\tif(BasicMove[index][3]==7||BasicMove[index][3]==0){\r\n\t\t\t\t\tsavesidesMove[sumsidesMove][0]=BasicMove[index][0];\r\n\t\t\t\t\tsavesidesMove[sumsidesMove][1]=BasicMove[index][1];\r\n\t\t\t\t\tsavesidesMove[sumsidesMove][2]=BasicMove[index][2];\r\n\t\t\t\t\tsavesidesMove[sumsidesMove][3]=BasicMove[index][3];\r\n\t\t\t\t\tsumsidesMove=sumsidesMove+1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (savesidesMove[0][0]==-1){/*if ther is no moves to 1 or 8 chick if there is posibble moves to 2 or 7*/\r\n\t\t\t\tfor(int index=0;index<BasicMove.length;index=index+1){\r\n\t\t\t\t\tif(BasicMove[index][3]==6||BasicMove[index][3]==1){\r\n\t\t\t\t\t\tsavesidesMove[sumsidesMove][0]=BasicMove[index][0];\r\n\t\t\t\t\t\tsavesidesMove[sumsidesMove][1]=BasicMove[index][1];\r\n\t\t\t\t\t\tsavesidesMove[sumsidesMove][2]=BasicMove[index][2];\r\n\t\t\t\t\t\tsavesidesMove[sumsidesMove][3]=BasicMove[index][3];\r\n\t\t\t\t\t\tsumsidesMove=sumsidesMove+1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (savesidesMove[0][0]==-1){/*if ther is no moves to 2 or 7 chick if there is posibble moves to 3 or 6*/\r\n\t\t\t\tfor(int index=0;index<BasicMove.length;index=index+1){\r\n\t\t\t\t\tif(BasicMove[index][3]==5||BasicMove[index][3]==2){\r\n\t\t\t\t\t\tsavesidesMove[sumsidesMove][0]=BasicMove[index][0];\r\n\t\t\t\t\t\tsavesidesMove[sumsidesMove][1]=BasicMove[index][1];\r\n\t\t\t\t\t\tsavesidesMove[sumsidesMove][2]=BasicMove[index][2];\r\n\t\t\t\t\t\tsavesidesMove[sumsidesMove][3]=BasicMove[index][3];\r\n\t\t\t\t\t\tsumsidesMove=sumsidesMove+1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (savesidesMove[0][0]==-1){/*if ther is no moves to 3 or 6 chick if there is posibble moves to 4 or 5*/\r\n\t\t\tboard = randomPlayer(board,player);\r\n\t\t\t}\r\n\t\t\tif (savesidesMove[0][0]!=-1){/*doing a randomly moves of ehat he find to the side*/\r\n\t\t\t\tnumrandom = numrandom%sumsidesMove;\r\n\t\t\t\tboard=playMove(board,player,savesidesMove[numrandom][0],savesidesMove[numrandom][1],savesidesMove[numrandom][2],savesidesMove[numrandom][3]);\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\treturn board;\r\n\t}", "public void initialize(){ \r\n\t\tfor (int i=0; i<3; i++){ \r\n\t\t\tfor (int j=0; j<3; j++){\r\n\t\t\t\tboard [i][j] = '-';\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void initialiseBoard() {\r\n\t\t//Set all squares to EMPTY\r\n\t\tfor(int x = 0; x < board.getWidth(); x++) {\r\n\t\t\tfor(int y = 0; y < board.getHeight(); y++) {\r\n\t\t\t\tboard.setSquare(new GridSquare(GridSquare.Type.EMPTY), x, y);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Assign player tiles\r\n\t\tsetFixedTile(new PlayerTile(GridSquare.Type.PLAYER_ONE_TILE), Board.PLAYER_ONE_POSITION_X, Board.PLAYER_ONE_POSITION_Y);\r\n\t\tsetFixedTile(new PlayerTile(GridSquare.Type.PLAYER_TWO_TILE), Board.PLAYER_TWO_POSITION_X, Board.PLAYER_TWO_POSITION_Y);\r\n\t\t\r\n\t\t//Assign Creation tiles\r\n\t\tsetFixedTile(new CreationTile(GridSquare.Type.CREATION_TILE), Board.PLAYER_ONE_POSITION_X+3, Board.PLAYER_ONE_POSITION_Y+3);\r\n\t\tsetFixedTile(new CreationTile(GridSquare.Type.CREATION_TILE), Board.PLAYER_TWO_POSITION_X-3, Board.PLAYER_TWO_POSITION_Y-3);\r\n\t\t\r\n\t\t//Assign Out of Bounds tiles\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_ONE_POSITION_X-3, Board.PLAYER_ONE_POSITION_Y);\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_ONE_POSITION_X, Board.PLAYER_ONE_POSITION_Y-3);\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_ONE_POSITION_X-3, Board.PLAYER_ONE_POSITION_Y-3);\r\n\t\t\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_TWO_POSITION_X+3, Board.PLAYER_TWO_POSITION_Y);\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_TWO_POSITION_X, Board.PLAYER_TWO_POSITION_Y+3);\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_TWO_POSITION_X+3, Board.PLAYER_TWO_POSITION_Y+3);\r\n\t\t\r\n\t\t\r\n\t}", "public Grid(int[] intBoard)\n\t{\n\t\tfor (int x =0;x<=8;x++)\n\t\t\tthis.grid[x]= intBoard[x];\n\t}", "public static void clearBoard(){\n for(int i = 0; i < Board.X_UPPER_BOUND * Board.Y_UPPER_BOUND ; i++){\n Board.board[i] = null;\n }\n white_player.setpieceList(null);\n black_player.setpieceList(null);\n }" ]
[ "0.7412364", "0.7306766", "0.7111106", "0.7014243", "0.6866308", "0.67226595", "0.66814905", "0.66679", "0.6639551", "0.66234565", "0.6612585", "0.6571436", "0.6535575", "0.6519873", "0.6506909", "0.65013415", "0.65000105", "0.64838403", "0.64255065", "0.6425276", "0.64029396", "0.6402492", "0.63954806", "0.63796264", "0.6356204", "0.6336705", "0.6312023", "0.6286674", "0.6277152", "0.6275775", "0.6258186", "0.6257207", "0.62497574", "0.62353003", "0.6207605", "0.61839867", "0.6177925", "0.6173331", "0.61563593", "0.61534685", "0.6153141", "0.61403245", "0.61196536", "0.61006725", "0.6097053", "0.60956275", "0.60908085", "0.6090086", "0.6088377", "0.6083424", "0.6079781", "0.6068547", "0.6061734", "0.60572344", "0.6020183", "0.6014741", "0.6008078", "0.600619", "0.60006034", "0.6000213", "0.59984446", "0.59865123", "0.59755", "0.59737396", "0.5972783", "0.5972656", "0.59719694", "0.59719205", "0.59669495", "0.59610087", "0.5955614", "0.5941123", "0.5936921", "0.5930542", "0.5917528", "0.5912839", "0.59033805", "0.5897927", "0.58961004", "0.58914936", "0.5880394", "0.586672", "0.58619756", "0.5842972", "0.58424115", "0.58393615", "0.5837437", "0.5836959", "0.5834158", "0.5832616", "0.5820129", "0.58175963", "0.5817218", "0.5814736", "0.5804917", "0.58037025", "0.58018667", "0.5799613", "0.5798865", "0.57968104", "0.57916" ]
0.0
-1
TODO Autogenerated method stub
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.splash); MyThread myThread=new MyThread(); myThread.start(); }
{ "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 run() { super.run(); //经过两秒后跳转到LogActivity界面 try { Thread.sleep(2000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); }finally{ Intent intent=new Intent(SplashActivity.this,Mytoee_keActivity.class); startActivity(intent); finish(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
methode principale du cas
public void archiver(int numProfil) { controlArchiver.archiver(numProfil); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void buscar() {\n\r\n\t\t\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\tpublic void buscar() {\n\t\t\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\r\n public void salir() {\n }", "@Override\n public void perish() {\n \n }", "public contrustor(){\r\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n\tpublic void coba() {\n\t\t\n\t}", "@Override\n protected void prot() {\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 dormir() {\n\t\t\r\n\t}", "public void cocinar(){\n\n }", "public void logic(){\r\n\r\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "public void miseAJour();", "public void smell() {\n\t\t\n\t}", "@Override\n\tpublic void trabajar() {\n\n\t}", "public void selecao () {}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "public void Ordenamiento() {\n\n\t}", "@Override\r\n\tpublic void method() {\n\t\r\n\t}", "@Override\n public void alRechazarOperacion() {\n }", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void salir() {\n\t\t\n\t}", "@Override\n\tpublic void iniciar() {\n\t\t\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n\tpublic void erstellen() {\n\t\t\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "public void actualiserAffichage();", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void verkaufen() {\n\t}", "public void operacao();", "@Override\r\n\tpublic void member() {\n\t\t\r\n\t}", "@Override // Métodos que fazem a anulação\n\tpublic void vota() {\n\t\t\n\t}", "@Override\n\tvoid geraDados() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "public abstract void afvuren();", "public void asetaTeksti(){\n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "void courir();", "protected FanisamBato(){\n\t}", "public void trenneVerbindung();", "private stendhal() {\n\t}", "protected void agregarUbicacion(){\n\n\n\n }", "@Override\n\tpublic void dibuja() {\n\t\t\n\t}", "@Override\n\tpublic void verificar() {\n\t\tsuper.verificar();\n\t}", "public void sendeSpielfeld();", "@Override\n\tpublic void classroom() {\n\t\t\n\t}", "@Override\r\n\tpublic void horario() {\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "public Final_parametre() {\r\n\t}", "protected abstract Set method_1559();", "public abstract boolean muere(Casilla cas);", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tpublic void pausaParaComer() {\n\n\t}", "public void Interior() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void voar() {\n\t\t\r\n\t}", "public void validerSaisie();", "@Override\r\n\tpublic void Method3() {\n\t\t\r\n\t}", "public IRecepteur quiEstAuDessus();", "void berechneFlaeche() {\n\t}", "public void ovr() {\n\n\t}", "public void Data(){\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public void datos_elegidos(){\n\n\n }", "@Override\n\tpublic void function() {\n\t\t\n\t}", "public abstract Koordinate schuss();", "@Override\n\tpublic void leti() \n\t{\n\t}", "public void pedirValoresCabecera(){\n \r\n \r\n \r\n \r\n }", "public void iniciar()\n {\n }", "public void method(){}", "abstract void uminus();", "@Override\n\tpublic int method() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic void recreo() {\n\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "public abstract void operation();", "public abstract void alimentarse();", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "public void finePartita() {\n\r\n }", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "public abstract void comes();", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "public void consulterClassement() {\n\t\t\n\t}", "private ControleurAcceuil(){ }" ]
[ "0.7182921", "0.6962168", "0.6943928", "0.68994576", "0.68829733", "0.68127775", "0.6785964", "0.66682", "0.6613948", "0.6609853", "0.65996337", "0.65996337", "0.65793294", "0.6557415", "0.65141547", "0.6497578", "0.64746803", "0.64648396", "0.6441664", "0.64394796", "0.6434468", "0.6400845", "0.63890743", "0.63890743", "0.6383006", "0.6378673", "0.63472676", "0.633644", "0.63354886", "0.6330304", "0.63019955", "0.6274749", "0.6271571", "0.6248551", "0.62312", "0.62159735", "0.61914814", "0.61849403", "0.6180559", "0.6177347", "0.6165964", "0.6155222", "0.6143087", "0.6140692", "0.61342794", "0.61130875", "0.60966355", "0.6083915", "0.60826963", "0.6080109", "0.60539114", "0.60484", "0.6046004", "0.60344636", "0.6025754", "0.6022798", "0.60126543", "0.60064524", "0.5981661", "0.5962995", "0.59601253", "0.5951445", "0.5945909", "0.5939792", "0.5935917", "0.5932495", "0.59323776", "0.5929316", "0.5919398", "0.59170777", "0.5913391", "0.5912658", "0.59110934", "0.59003055", "0.58797836", "0.58794767", "0.58758646", "0.5874381", "0.5869004", "0.5864976", "0.5862302", "0.586171", "0.58614695", "0.585945", "0.58585507", "0.58584183", "0.5843761", "0.5835668", "0.58300966", "0.5826723", "0.58233786", "0.5821552", "0.5809042", "0.5804662", "0.58031803", "0.58031154", "0.5800638", "0.579838", "0.57851654", "0.57841754", "0.57826465" ]
0.0
-1
Show location driver on map
private void displayLocation() { try{ if (ActivityCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { return; } }catch (NullPointerException e){ e.printStackTrace(); } Common.mLastLocationDriver = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient); if (Common.mLastLocationDriver != null) { if (mSwitchButton.isChecked()) { final double latitude = Common.mLastLocationDriver.getLatitude(); final double longitude = Common.mLastLocationDriver.getLongitude(); // save location driver to firebase to comunicate with customer FirebaseDatabase.getInstance().getReference(Common.driver_working_tbl) .child(FirebaseAuth.getInstance().getCurrentUser().getUid()) .addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { if(!dataSnapshot.exists() && mGeoFire!=null){ mGeoFire.setLocation(FirebaseAuth.getInstance().getCurrentUser().getUid(), new GeoLocation(latitude, longitude), new GeoFire.CompletionListener() { @Override public void onComplete(String key, DatabaseError error) { if(oldLocation!=null){ Location startingLocation = new Location("starting point"); startingLocation.setLatitude(oldLocation.getLatitude()); startingLocation.setLongitude(oldLocation.getLongitude()); //Get the target location Location endingLocation = new Location("ending point"); endingLocation.setLatitude(latitude); endingLocation.setLongitude(longitude); bearing = startingLocation.bearingTo(endingLocation); } //Add marker if (mMarker != null) mMarker.remove(); mMarker = mMap.addMarker(new MarkerOptions() .icon(getMarkerIconFromDrawable(getResources().getDrawable(R.drawable.ic_navigation_driver))) .position(new LatLng(latitude, longitude)) .anchor(0.5f, 0.5f) .rotation(bearing) .title("You")); mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(latitude, longitude), 17.0f)); } }); } } @Override public void onCancelled(@NonNull DatabaseError databaseError) { } }); } } else { Log.e("ERROR", "Can't get your location"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void showMap() {\n \t\t\n \t\tApplicationData applicationData;\n \t\ttry {\n \t\t\tapplicationData = ApplicationData.readApplicationData(this);\n \t\t\tif(applicationData != null){\n \t\t\t\tIntent intent = getIntent();\n \t\t\t\tNextLevel nextLevel = (NextLevel)intent.getSerializableExtra(ApplicationData.NEXT_LEVEL_TAG);\n \t\t\t\tAppLevelDataItem item = applicationData.getDataItem(this, nextLevel);\t\t\t\t\n \t\t\t\t\n \t\t\t\tif(Utils.hasLength(item.getGeoReferencia())){\n \t\t\t\t\tString urlString = \"http://maps.google.com/maps?q=\" + item.getGeoReferencia() + \"&near=Madrid,Espa�a\";\n \t\t\t\t\tIntent browserIntent = new Intent(\"android.intent.action.VIEW\", \n \t\t\t\t\t\t\tUri.parse(urlString ));\n \t\t\t\t\tstartActivity(browserIntent);\n \t\t\t\t}\n \t\t\t}\n \t\t} catch (InvalidFileException e) {\n \t\t}\n \t}", "public void showLocation(double lat, double lon) {\n IMapController mapController = mapView.getController();\n GeoPoint cl = new GeoPoint(lat, lon);\n mapController.animateTo(cl);\n settings.setZoomLevel(settings.getZoomLevel(), cl.getLatitude(), cl.getLongitude());\n }", "private void showSelectedLocation(String location) {\n DatabaseHelper database = new DatabaseHelper(this);\n double lat = database.getLatitude(location);\n double lng = database.getLongitude(location);\n\n Log.i(\"Called\", lat + \" \" + lng);\n LatLng current = new LatLng(lat, lng);\n\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(current, 18));\n }", "public void displayMap() {\n MapMenuView mapMenu = new MapMenuView();\r\n mapMenu.display();\r\n \r\n }", "private void showOnMap(Location location) {\n\t\tfinal double RADIUS_KM = 1.5; // the distance, in KM, to show around the point.\n\n\t\tif (!TestHarnessUtils.isTestHarness() && isShowingMap) {\n\t\t\tLatLng gmLocation = new LatLng(location.getLatitude(), location.getLongitude());\n\n\t\t\t// Update user's location marker\n\t\t\tif (this.userMapMarker != null) {\n\t\t\t\tthis.userMapMarker.setPosition(gmLocation);\n\t\t\t}\n\n\t\t\t// For now, just display RADIUS_KM in all directions around the given location.\n\t\t\tLatLng northBounds = LocationUtils.getLocation(gmLocation, 0, RADIUS_KM);\n\t\t\tLatLng southBounds = LocationUtils.getLocation(gmLocation, 180, RADIUS_KM);\n\t\t\tLatLng eastBounds = LocationUtils.getLocation(gmLocation, 90, RADIUS_KM);\n\t\t\tLatLng westBounds = LocationUtils.getLocation(gmLocation, 270, RADIUS_KM);\n\n\t\t\tLatLngBounds bounds;\n\t\t\tint padding;\n\n\t\t\tif (routePolyline == null) {\n\t\t\t\tbounds = LatLngBounds.builder().include(northBounds).include(southBounds).include(eastBounds)\n\t\t\t\t\t\t.include(westBounds).include(gmLocation).build();\n\t\t\t\tpadding = 0;\n\t\t\t} else {\n\t\t\t\tLatLngBounds.Builder builder = LatLngBounds.builder().include(gmLocation);\n\t\t\t\tfor (LatLng pt : routePolyline.getPoints()) {\n\t\t\t\t\tbuilder.include(pt);\n\t\t\t\t}\n\t\t\t\tbounds = builder.build();\n\t\t\t\tpadding = 100;\n\t\t\t}\n\n\t\t\tfinal CameraUpdate camUpdate = CameraUpdateFactory.newLatLngBounds(bounds, padding);\n\n if (this.theMap != null) {\n try {\n this.theMap.moveCamera(camUpdate);\n\n } catch (IllegalStateException ex) {\n // Map not yet initialized.\n logger.info(\"showOnMap(): IllegalStateException when trying to move camera. Will delegate task to listener.\");\n final View mapView = mapFragment.getView();\n if (mapView.getViewTreeObserver().isAlive()) {\n mapView.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {\n @SuppressWarnings(\"deprecation\")\n @SuppressLint(\"NewApi\")\n @Override\n public void onGlobalLayout() {\n if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {\n mapView.getViewTreeObserver().removeGlobalOnLayoutListener(this);\n } else {\n mapView.getViewTreeObserver().removeOnGlobalLayoutListener(this);\n }\n WorkoutActivity.this.theMap.moveCamera(camUpdate);\n }\n });\n }\n }\n }\n\t\t}\n\t}", "private void viewMap() {\r\n \r\n // Get the current game \r\n theGame = cityofaaron.CityOfAaron.getTheGame();\r\n \r\n // Get the map \r\n Map map = theGame.getMap();\r\n Location locations = null;\r\n \r\n // Print the map's title\r\n System.out.println(\"\\n*** Map: CITY OF AARON and Surrounding Area ***\\n\");\r\n // Print the column numbers \r\n System.out.println(\" 1 2 3 4 5\");\r\n // for every row:\r\n for (int i = 0; i < max; i++){\r\n // Print a row divider\r\n System.out.println(\" -------------------------------\");\r\n // Print the row number\r\n System.out.print((i + 1) + \" \");\r\n // for every column:\r\n for(int j = 0; j<max; j++){\r\n // Print a column divider\r\n System.out.print(\"|\");\r\n // Get the symbols and locations(row, column) for the map\r\n locations = map.getLocation(i, j);\r\n System.out.print(\" \" + locations.getSymbol() + \" \");\r\n }\r\n // Print the ending column divider\r\n System.out.println(\"|\");\r\n }\r\n // Print the ending row divider\r\n System.out.println(\" -------------------------------\\n\");\r\n \r\n // Print a key for the map\r\n System.out.println(\"Key:\\n\" + \"|=| - Temple\\n\" + \"~~~ - River\\n\" \r\n + \"!!! - Farmland\\n\" + \"^^^ - Mountains\\n\" + \"[*] - Playground\\n\" \r\n + \"$$$ - Capital \" + \"City of Aaron\\n\" + \"### - Chief Judge/Courthouse\\n\" \r\n + \"YYY - Forest\\n\" + \"TTT - Toolshed\\n\" +\"xxx - Pasture with \"\r\n + \"Animals\\n\" + \"+++ - Storehouse\\n\" +\">>> - Undeveloped Land\\n\");\r\n }", "public void showMyLocation() {\n if (myLocationoverlay.getLastFix() == null) return;\n\n boolean r = isMyLocationVisible(); // whether the current location is visible\n if (!r) {\n GeoPoint cl = new GeoPoint(myLocationoverlay.getLastFix());\n showLocation(cl.getLatitude(), cl.getLongitude());\n }\n }", "private void returnDriverLocationstoMaps() {\n }", "private void inicMapComponent() {\n\t\tmapView = ((MapFragment) getFragmentManager()\n\t\t\t\t.findFragmentById(R.id.map)).getMap();\n\t\t\n\n\t\tlocationService = new LocationService(MapPage.this);\n\t\tlocationService.getLocation();\n\t\t\n\t\tmapView.setMyLocationEnabled(true);\n\n\t Location location = mapView.getMyLocation();\n\t LatLng myLocation = null; //new LatLng(44.8167d, 20.4667d);\n\t \n\t\tif (location != null) {\n\t myLocation = new LatLng(location.getLatitude(),\n\t location.getLongitude());\n\t } else {\n\t \tLocationManager service = (LocationManager) getSystemService(LOCATION_SERVICE);\n\t\t\tCriteria criteria = new Criteria();\n\t\t\tString provider = service.getBestProvider(criteria, false);\n\t\t\tLocation lastKnownLocation = service.getLastKnownLocation(provider);\n\t\t\tmyLocation = new LatLng(lastKnownLocation.getLatitude(),lastKnownLocation.getLongitude());\n\t }\n\t\t\n\t\tmapView.animateCamera(CameraUpdateFactory.newLatLngZoom(myLocation, 13));\n\t\t\n\t\tmapView.setPadding(0, 0, 0, 80);\n\t\t\n\t\tmapView.setOnInfoWindowClickListener(new GoogleMap.OnInfoWindowClickListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onInfoWindowClick(Marker marker) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t//onMapWindwosClick(marker.getId(),marker.getTitle());\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\t\n\t}", "@Override\n protected void setUpMap() {\n super.setUpMap();\n // For showing a move to my location button and a blue\n // dot to show user's location\n MainActivity mainActivity = (MainActivity) getActivity();\n mMap.setMyLocationEnabled(mainActivity.checkIfGPSEnabled());\n }", "@Override\n public void onLocationChanged(MapWidget v, Location location) {\n }", "public void onLocationChanged(Location location) {\n\n //Display the current location\n double latitude = location.getLatitude();\n double longitude = location.getLongitude();\n MapProjection mapProjection = MapProjection.getDefault();\n GridPoint gp = mapProjection.toGridPoint(latitude,longitude);\n mGPSon.setText(\"Latitude: \"+Math.round(gp.x)+\"\\nLongitude: \"+Math.round(gp.y));\n\n }", "public void showmap() {\n MapForm frame = new MapForm(this.mapLayout);\n frame.setSize(750, 540);\n frame.setLocationRelativeTo(null);\n frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);\n frame.setVisible(true);\n }", "@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 showMap(Uri geoLocation) {\n Intent intent = new Intent(Intent.ACTION_VIEW);\n intent.setData(geoLocation);\n if (intent.resolveActivity(getPackageManager()) != null) {\n startActivity(intent);\n }\n }", "public void setShowMap( boolean show )\r\n {\r\n showMap = show;\r\n }", "String getLocationLabel();", "private void searchmap() {\n String location = \"475 Dien bien phu\";\n //lcSearch;\n\n if (location != null && !location.equals(\"\")) {\n List<Address> lstAddress = null;\n try {\n lstAddress = geocoder.getFromLocationName(location, 1);\n System.out.print(lstAddress);\n if (lstAddress != null) {\n double lat = lstAddress.get(0).getLatitude();\n double lng = lstAddress.get(0).getLongitude();\n LatLng latLng = new LatLng(lat, lng);\n goToMaps(latLng);\n } else {\n\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }", "private void configMap() {\n\n googleMap.getUiSettings().setMapToolbarEnabled(false);//an buton dieu huong bat snag map\n\n googleMap.getUiSettings().setMyLocationButtonEnabled(true);//nut vi tri cua minh tru se hien thi\n googleMap.getUiSettings().setZoomControlsEnabled(true);//co the zoom\n\n// b2\n googleMap.setInfoWindowAdapter(new MyInfoWindown());//cutom titlemap\n\n try {//them lenh nay de no cap location thì cai nut tren moi hoat dong\n\n googleMap.setMyLocationEnabled(true);//cung cap vi tri cua minh,can try cacth xin quyen\n } catch (SecurityException e) {\n\n }\n googleMap.setOnMyLocationButtonClickListener(this);//dNG KY\n\n\n }", "private void getLocation() {\n\n }", "public void getLocationInfo() {\n startLocationService();\n }", "private void setUpMap() {\n mMap.setMyLocationEnabled(true);\n }", "public void printLocationInfo()\n {\n System.out.println(currentRoom.getLongDescription());\n System.out.println();\n }", "private void toggleGoToMapBtn() {\n boolean isShow = isValidLocationFound();\n NodeUtil.setNodeVisibility(this.gotoGeoMapBtn, isShow);\n }", "private void updateLocationUi() {\n if (mMap == null) {\n return;\n }\n try {\n if (mPermissionCheck.locationPermissionGranted()) {\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n } else {\n mMap.setMyLocationEnabled(false);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "public boolean getShowMap()\r\n {\r\n return showMap;\r\n }", "private void showLocation(Location location) {\n if (location == null) {\n return;\n }\n if (location.getProvider().equals(LocationManager.GPS_PROVIDER)) {\n tvLocationGPS.setText(formatLocation(location));\n } else if (location.getProvider().equals(LocationManager.NETWORK_PROVIDER)) {\n tvLocationNet.setText(formatLocation(location));\n }\n }", "@Override\r\n public void ShowMaps() throws Exception {\r\n printInvalidCommandMessage();\r\n }", "private void setUpMap() throws IOException {\n // Get last location which means current location\n lastKnownLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);\n\n if (lastKnownLocation != null) {\n // shift view to current location\n LatLng latlng = new LatLng(lastKnownLocation.getLatitude(), lastKnownLocation.getLongitude());\n Geocoder geocoder = new Geocoder(this);\n adminArea = geocoder.getFromLocation(latlng.latitude, latlng.longitude, 1).get(0).getAdminArea();\n CameraUpdate update = CameraUpdateFactory.newLatLngZoom(latlng, 12);\n mMap.moveCamera(update);\n } else {\n Toast.makeText(this, \"Current Location is not Available\", Toast.LENGTH_SHORT).show();\n }\n }", "@Override\n\t\t\tpublic void onMapClick(LatLng arg0) {\n\t\t\t\tfinal LatLng location = arg0;\n \tAlertDialog builder = new AlertDialog.Builder(MainActivity.this)\n\t .setMessage(\"Do you want to add your location here?\")\n\t .setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n\t public void onClick(DialogInterface dialog, int id) {\n\t \t setFlag = true;\n\t \t myLocation = location;\n\t \t //use this flag to indicate that we want to see the path from current location or a set point\n\t \t Log.d(\"my location:\", \"\"+myLocation.latitude + myLocation.longitude);\n\t \t if(setFlag == true){\n\t \t\t if(myMarker != null){\n\t\t \t\t myMarker.remove();\n\t\t \t }\n\t\t \t myMarker = mMap.addMarker(new MarkerOptions().position(myLocation).title(\"myLocation\").draggable(true)\n\t\t \t\t\t\t\t\t.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_BLUE)));\n\t\t \t\t\t\t landmarks.addMarker(\"myLocation\", myMarker);\n\t \t } \n\t }\n\t })\n\t .setNegativeButton(\"Not now\", new DialogInterface.OnClickListener() {\n\t public void onClick(DialogInterface dialog, int id) {\n\t // User cancelled the dialog\n\t }\n\t }).create();\n \tbuilder.show();\n\t\t\t}", "@Override\n public void onMapClick(LatLng arg0) {\n mBaiduMap.hideInfoWindow();\n if (window != null) {\n window.showAtLocation(search, Gravity.BOTTOM, 0, 0);\n }\n }", "@Override\n public void onMapReady(final GoogleMap map) {\n map.moveCamera(CameraUpdateFactory.zoomTo(14));\n //map.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n map.setMyLocationEnabled(true);\n map.setOnMyLocationButtonClickListener(new GoogleMap.OnMyLocationButtonClickListener() {\n @Override\n public boolean onMyLocationButtonClick() {\n\n return true;\n }\n });\n map.setOnMyLocationChangeListener(new GoogleMap.OnMyLocationChangeListener() {\n @Override\n public void onMyLocationChange(Location location) {\n Log.d(\"map\", \"onMyLocationChange\");\n if (!isinit) {\n isinit = true;\n if (now_Location == null ||\n now_Location.getLatitude() != location.getLatitude() ||\n now_Location.getLongitude() != location.getLongitude()) {\n now_Location = location;\n initStreetView();\n }\n }\n LatLng sydney = new LatLng(location.getLatitude(), location.getLongitude());\n map.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }\n });\n }", "public static void map(int location)\n\t{\n\t\tswitch(location)\n\t\t{\t\n\t\t\tcase 1:\n\t\t\t\tSystem.out.print(\"________________________________________________________\"\n\t\t\t\t\t+ \"__________________\\n\\n\");\n\t\t\t\tSystem.out.print(\" -LEGEND- \\n\");\n\t\t\t\tSystem.out.print(\" X = Current Location \\n\");\t\n\t\t\t\tSystem.out.print(\" # = Wall ############################################ \\n\");\n\t\t\t\tSystem.out.print(\" * = Door # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # \\n\");\n\t\t\t\tSystem.out.print(\" ######################## # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############ \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ############### ############### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ###########***########### \\n\");\n\t\t\t\tSystem.out.print(\" ####################***# # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" #########***##### # ######## \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # #### # \\n\");\n\t\t\t\tSystem.out.print(\" ############ # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # ###########***########### # # \\n\");\n\t\t\t\tSystem.out.print(\" # ######## # # # ###***######### \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############## # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # X # # ##############***##### # # # \\n\");\n\t\t\t\tSystem.out.print(\" #***# # # # # # ####### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" ################# # # ######### \\n\");\n\t\t\t\tSystem.out.print(\" ############### \\n\");\n\t\t\t\tSystem.out.print(\"[R] Return\\n\");\n\t\t\t\tSystem.out.print(\"\\n______________________________________________________\"\n\t\t\t\t\t+ \"____________________\\n\\n\"); break;\n\t\t\tcase 2:\n\t\t\t\tSystem.out.print(\"________________________________________________________\"\n\t\t\t\t\t+ \"__________________\\n\\n\");\n\t\t\t\tSystem.out.print(\" -LEGEND- \\n\");\n\t\t\t\tSystem.out.print(\" X = Current Location \\n\");\t\n\t\t\t\tSystem.out.print(\" # = Wall ############################################ \\n\");\n\t\t\t\tSystem.out.print(\" * = Door # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # \\n\");\n\t\t\t\tSystem.out.print(\" ######################## # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############ \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ############### ############### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ###########***########### \\n\");\n\t\t\t\tSystem.out.print(\" ####################***# # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" #########***##### # ######## \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # #### # \\n\");\n\t\t\t\tSystem.out.print(\" ############ # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * X # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # ###########***########### # # \\n\");\n\t\t\t\tSystem.out.print(\" # ######## # # # ###***######### \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############## # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ##############***##### # # # \\n\");\n\t\t\t\tSystem.out.print(\" #***# # # # # # ####### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" ################# # # ######### \\n\");\n\t\t\t\tSystem.out.print(\" ############### \\n\");\n\t\t\t\tSystem.out.print(\"[R] Return\\n\");\n\t\t\t\tSystem.out.print(\"\\n______________________________________________________\"\n\t\t\t\t\t+ \"____________________\\n\\n\"); break;\n\t\t\tcase 3:\n\t\t\t\tSystem.out.print(\"________________________________________________________\"\n\t\t\t\t\t+ \"__________________\\n\\n\");\n\t\t\t\tSystem.out.print(\" -LEGEND- \\n\");\n\t\t\t\tSystem.out.print(\" X = Current Location \\n\");\t\n\t\t\t\tSystem.out.print(\" # = Wall ############################################ \\n\");\n\t\t\t\tSystem.out.print(\" * = Door # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # \\n\");\n\t\t\t\tSystem.out.print(\" ######################## # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############ \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ############### ############### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ###########***########### \\n\");\n\t\t\t\tSystem.out.print(\" ####################***# # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # X # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" #########***##### # ######## \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # #### # \\n\");\n\t\t\t\tSystem.out.print(\" ############ # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # ###########***########### # # \\n\");\n\t\t\t\tSystem.out.print(\" # ######## # # # ###***######### \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############## # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ##############***##### # # # \\n\");\n\t\t\t\tSystem.out.print(\" #***# # # # # # ####### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" ################# # # ######### \\n\");\n\t\t\t\tSystem.out.print(\" ############### \\n\");\n\t\t\t\tSystem.out.print(\"[R] Return\\n\");\n\t\t\t\tSystem.out.print(\"\\n______________________________________________________\"\n\t\t\t\t\t+ \"____________________\\n\\n\"); break;\n\t\t\tcase 4:\n\t\t\t\tSystem.out.print(\"________________________________________________________\"\n\t\t\t\t\t+ \"__________________\\n\\n\");\n\t\t\t\tSystem.out.print(\" -LEGEND- \\n\");\n\t\t\t\tSystem.out.print(\" X = Current Location \\n\");\t\n\t\t\t\tSystem.out.print(\" # = Wall ############################################ \\n\");\n\t\t\t\tSystem.out.print(\" * = Door # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # \\n\");\n\t\t\t\tSystem.out.print(\" ######################## # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############ \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # X # ############### ############### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ###########***########### \\n\");\n\t\t\t\tSystem.out.print(\" ####################***# # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" #########***##### # ######## \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # #### # \\n\");\n\t\t\t\tSystem.out.print(\" ############ # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # ###########***########### # # \\n\");\n\t\t\t\tSystem.out.print(\" # ######## # # # ###***######### \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############## # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ##############***##### # # # \\n\");\n\t\t\t\tSystem.out.print(\" #***# # # # # # ####### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" ################# # # ######### \\n\");\n\t\t\t\tSystem.out.print(\" ############### \\n\");\n\t\t\t\tSystem.out.print(\"[R] Return\\n\");\n\t\t\t\tSystem.out.print(\"\\n______________________________________________________\"\n\t\t\t\t\t+ \"____________________\\n\\n\"); break;\n\t\t\tcase 5:\n\t\t\t\tSystem.out.print(\"________________________________________________________\"\n\t\t\t\t\t+ \"__________________\\n\\n\");\n\t\t\t\tSystem.out.print(\" -LEGEND- \\n\");\n\t\t\t\tSystem.out.print(\" X = Current Location \\n\");\t\n\t\t\t\tSystem.out.print(\" # = Wall ############################################ \\n\");\n\t\t\t\tSystem.out.print(\" * = Door # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # \\n\");\n\t\t\t\tSystem.out.print(\" ######################## # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############ \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ############### ############### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ###########***########### \\n\");\n\t\t\t\tSystem.out.print(\" ####################***# # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" #########***##### # ######## \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # #### # \\n\");\n\t\t\t\tSystem.out.print(\" ############ # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # ###########***########### # # \\n\");\n\t\t\t\tSystem.out.print(\" # ######## # # # ###***######### \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############## # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * X # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ##############***##### # # # \\n\");\n\t\t\t\tSystem.out.print(\" #***# # # # # # ####### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" ################# # # ######### \\n\");\n\t\t\t\tSystem.out.print(\" ############### \\n\");\n\t\t\t\tSystem.out.print(\"[R] Return\\n\");\n\t\t\t\tSystem.out.print(\"\\n______________________________________________________\"\n\t\t\t\t\t+ \"____________________\\n\\n\"); break;\n\t\t\tcase 6:\n\t\t\t\tSystem.out.print(\"________________________________________________________\"\n\t\t\t\t\t+ \"__________________\\n\\n\");\n\t\t\t\tSystem.out.print(\" -LEGEND- \\n\");\n\t\t\t\tSystem.out.print(\" X = Current Location \\n\");\t\n\t\t\t\tSystem.out.print(\" # = Wall ############################################ \\n\");\n\t\t\t\tSystem.out.print(\" * = Door # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # \\n\");\n\t\t\t\tSystem.out.print(\" ######################## # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############ \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ############### ############### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ###########***########### \\n\");\n\t\t\t\tSystem.out.print(\" ####################***# # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" #########***##### # ######## \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # #### # \\n\");\n\t\t\t\tSystem.out.print(\" ############ # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # ###########***########### # # \\n\");\n\t\t\t\tSystem.out.print(\" # ######## # # # ###***######### \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############## # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ##############***##### # # # \\n\");\n\t\t\t\tSystem.out.print(\" #***# # # # # # ####### \\n\");\n\t\t\t\tSystem.out.print(\" # # # X # # # \\n\");\n\t\t\t\tSystem.out.print(\" ################# # # ######### \\n\");\n\t\t\t\tSystem.out.print(\" ############### \\n\");\n\t\t\t\tSystem.out.print(\"[R] Return\\n\");\n\t\t\t\tSystem.out.print(\"\\n______________________________________________________\"\n\t\t\t\t\t+ \"____________________\\n\\n\"); break;\n\t\t\tcase 7:\n\t\t\t\tSystem.out.print(\"________________________________________________________\"\n\t\t\t\t\t+ \"__________________\\n\\n\");\n\t\t\t\tSystem.out.print(\" -LEGEND- \\n\");\n\t\t\t\tSystem.out.print(\" X = Current Location \\n\");\t\n\t\t\t\tSystem.out.print(\" # = Wall ############################################ \\n\");\n\t\t\t\tSystem.out.print(\" * = Door # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # \\n\");\n\t\t\t\tSystem.out.print(\" ######################## # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############ \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ############### ############### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ###########***########### \\n\");\n\t\t\t\tSystem.out.print(\" ####################***# # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" #########***##### # ######## \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # X * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # #### # \\n\");\n\t\t\t\tSystem.out.print(\" ############ # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # ###########***########### # # \\n\");\n\t\t\t\tSystem.out.print(\" # ######## # # # ###***######### \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############## # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ##############***##### # # # \\n\");\n\t\t\t\tSystem.out.print(\" #***# # # # # # ####### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" ################# # # ######### \\n\");\n\t\t\t\tSystem.out.print(\" ############### \\n\");\n\t\t\t\tSystem.out.print(\"[R] Return\\n\");\n\t\t\t\tSystem.out.print(\"\\n______________________________________________________\"\n\t\t\t\t\t+ \"____________________\\n\\n\"); break;\n\t\t\tcase 8:\n\t\t\t\tSystem.out.print(\"________________________________________________________\"\n\t\t\t\t\t+ \"__________________\\n\\n\");\n\t\t\t\tSystem.out.print(\" -LEGEND- \\n\");\n\t\t\t\tSystem.out.print(\" X = Current Location \\n\");\t\n\t\t\t\tSystem.out.print(\" # = Wall ############################################ \\n\");\n\t\t\t\tSystem.out.print(\" * = Door # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # \\n\");\n\t\t\t\tSystem.out.print(\" ######################## # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############ \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ############### ############### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ###########***########### \\n\");\n\t\t\t\tSystem.out.print(\" ####################***# # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" #########***##### # ######## \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * X # \\n\");\n\t\t\t\tSystem.out.print(\" # # # #### # \\n\");\n\t\t\t\tSystem.out.print(\" ############ # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # ###########***########### # # \\n\");\n\t\t\t\tSystem.out.print(\" # ######## # # # ###***######### \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############## # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ##############***##### # # # \\n\");\n\t\t\t\tSystem.out.print(\" #***# # # # # # ####### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" ################# # # ######### \\n\");\n\t\t\t\tSystem.out.print(\" ############### \\n\");\n\t\t\t\tSystem.out.print(\"[R] Return\\n\");\n\t\t\t\tSystem.out.print(\"\\n______________________________________________________\"\n\t\t\t\t\t+ \"____________________\\n\\n\"); break;\n\t\t\tcase 9:\n\t\t\t\tSystem.out.print(\"________________________________________________________\"\n\t\t\t\t\t+ \"__________________\\n\\n\");\n\t\t\t\tSystem.out.print(\" -LEGEND- \\n\");\n\t\t\t\tSystem.out.print(\" X = Current Location \\n\");\t\n\t\t\t\tSystem.out.print(\" # = Wall ############################################ \\n\");\n\t\t\t\tSystem.out.print(\" * = Door # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # \\n\");\n\t\t\t\tSystem.out.print(\" ######################## # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############ \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ############### ############### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ###########***########### \\n\");\n\t\t\t\tSystem.out.print(\" ####################***# # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" #########***##### # ######## \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # #### # \\n\");\n\t\t\t\tSystem.out.print(\" ############ # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # ###########***########### # # \\n\");\n\t\t\t\tSystem.out.print(\" # ######## # # # ###***######### \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############## # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # X * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ##############***##### # # # \\n\");\n\t\t\t\tSystem.out.print(\" #***# # # # # # ####### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" ################# # # ######### \\n\");\n\t\t\t\tSystem.out.print(\" ############### \\n\");\n\t\t\t\tSystem.out.print(\"[R] Return\\n\");\n\t\t\t\tSystem.out.print(\"\\n______________________________________________________\"\n\t\t\t\t\t+ \"____________________\\n\\n\"); break;\n\t\t\tcase 10:\n\t\t\t\tSystem.out.print(\"________________________________________________________\"\n\t\t\t\t\t+ \"__________________\\n\\n\");\n\t\t\t\tSystem.out.print(\" -LEGEND- \\n\");\n\t\t\t\tSystem.out.print(\" X = Current Location \\n\");\t\n\t\t\t\tSystem.out.print(\" # = Wall ############################################ \\n\");\n\t\t\t\tSystem.out.print(\" * = Door # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # \\n\");\n\t\t\t\tSystem.out.print(\" ######################## # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############ \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ############### ############### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ###########***########### \\n\");\n\t\t\t\tSystem.out.print(\" ####################***# # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" #########***##### # ######## \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # #### # \\n\");\n\t\t\t\tSystem.out.print(\" ############ # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # ###########***########### # # \\n\");\n\t\t\t\tSystem.out.print(\" # ######## # # # ###***######### \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############## # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * X # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ##############***##### # # # \\n\");\n\t\t\t\tSystem.out.print(\" #***# # # # # # ####### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" ################# # # ######### \\n\");\n\t\t\t\tSystem.out.print(\" ############### \\n\");\n\t\t\t\tSystem.out.print(\"[R] Return\\n\");\n\t\t\t\tSystem.out.print(\"\\n______________________________________________________\"\n\t\t\t\t\t+ \"____________________\\n\\n\"); break;\n\t\t\tcase 11:\n\t\t\t\tSystem.out.print(\"________________________________________________________\"\n\t\t\t\t\t+ \"__________________\\n\\n\");\n\t\t\t\tSystem.out.print(\" -LEGEND- \\n\");\n\t\t\t\tSystem.out.print(\" X = Current Location \\n\");\t\n\t\t\t\tSystem.out.print(\" # = Wall ############################################ \\n\");\n\t\t\t\tSystem.out.print(\" * = Door # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # \\n\");\n\t\t\t\tSystem.out.print(\" ######################## # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # X # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############ \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ############### ############### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ###########***########### \\n\");\n\t\t\t\tSystem.out.print(\" ####################***# # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" #########***##### # ######## \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # #### # \\n\");\n\t\t\t\tSystem.out.print(\" ############ # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # ###########***########### # # \\n\");\n\t\t\t\tSystem.out.print(\" # ######## # # # ###***######### \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############## # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ##############***##### # # # \\n\");\n\t\t\t\tSystem.out.print(\" #***# # # # # # ####### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" ################# # # ######### \\n\");\n\t\t\t\tSystem.out.print(\" ############### \\n\");\n\t\t\t\tSystem.out.print(\"[R] Return\\n\");\n\t\t\t\tSystem.out.print(\"\\n______________________________________________________\"\n\t\t\t\t\t+ \"____________________\\n\\n\"); break;\n\t\t\tcase 12:\n\t\t\t\tSystem.out.print(\"________________________________________________________\"\n\t\t\t\t\t+ \"__________________\\n\\n\");\n\t\t\t\tSystem.out.print(\" -LEGEND- \\n\");\n\t\t\t\tSystem.out.print(\" X = Current Location \\n\");\t\n\t\t\t\tSystem.out.print(\" # = Wall ############################################ \\n\");\n\t\t\t\tSystem.out.print(\" * = Door # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # X # \\n\");\n\t\t\t\tSystem.out.print(\" ######################## # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############ \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ############### ############### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # ###########***########### \\n\");\n\t\t\t\tSystem.out.print(\" ####################***# # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # # \\n\");\n\t\t\t\tSystem.out.print(\" #########***##### # ######## \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # #### # \\n\");\n\t\t\t\tSystem.out.print(\" ############ # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # * # ###########***########### # # \\n\");\n\t\t\t\tSystem.out.print(\" # ######## # # # ###***######### \\n\");\n\t\t\t\tSystem.out.print(\" # # # ############## # # # # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # * # # * # \\n\");\n\t\t\t\tSystem.out.print(\" # # # ##############***##### # # # \\n\");\n\t\t\t\tSystem.out.print(\" #***# # # # # # ####### \\n\");\n\t\t\t\tSystem.out.print(\" # # # # # # \\n\");\n\t\t\t\tSystem.out.print(\" ################# # # ######### \\n\");\n\t\t\t\tSystem.out.print(\" ############### \\n\");\n\t\t\t\tSystem.out.print(\"[R] Return\\n\");\n\t\t\t\tSystem.out.print(\"\\n______________________________________________________\"\n\t\t\t\t\t+ \"____________________\\n\\n\");\n\t\t}//end switch(location)\n\t\t\n\t}", "@Override\n\tpublic void locationChanged(Location newLocation) {\n\t\tshowOnMap(newLocation);\n\t\tgiveNavigationInstructions(newLocation);\n\t}", "private void showCurrentLocation() {\n if (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n LocationRequest locationRequest = LocationRequest.create();\n locationRequest.setInterval(10000);\n locationRequest.setFastestInterval(5000);\n locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n\n LocationCallback mLocationCallback = new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n if (locationResult == null) {\n return;\n }\n for (Location location : locationResult.getLocations()) {\n if (location != null) {\n LatLng current = new LatLng(location.getLatitude(), location.getLongitude());\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(current, 18));\n if (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n mMap.setMyLocationEnabled(true);\n }\n\n }\n }\n }\n };\n\n LocationServices.getFusedLocationProviderClient(this).requestLocationUpdates(locationRequest, mLocationCallback, null);\n\n } else { // Show default location\n requestLocationPermission();\n\n LatLng current = new LatLng(34.180972800611016, -117.32337489724159);\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(current, 18));\n }\n }", "@Override\n public void onLocationResult(LocationResult locationResult) {\n super.onLocationResult(locationResult);\n Log.d(TAG, \"onLocationResult: \");\n if (locationResult != null) {\n Log.d(TAG, \"onLocationResult: loaction!==null\");\n myLocation = locationResult.getLastLocation();\n showMarker();//de show hinh len\n }\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n mMap.getUiSettings().setZoomControlsEnabled(true);\n googleMap.setPadding(0, 0, 0, 300);\n\n\n //if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION))\n\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n\n\n buildGoogleApiClient();\n\n mMap.setMyLocationEnabled(true);\n //mMap.getUiSettings().setZoomControlsEnabled(true);\n }\n\n mMap.setOnMapLongClickListener(new GoogleMap.OnMapLongClickListener() {\n @Override\n public void onMapLongClick(LatLng latLng) {\n\n if (marker != null) {\n marker.remove();\n }\n marker = mMap.addMarker(new MarkerOptions()\n .position(latLng)\n .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_AZURE))\n .title(\"My Current Click\"));\n\n\n }\n });\n\n mMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {\n @Override\n public boolean onMarkerClick(Marker marker) {\n\n mHeart.setVisibility(View.VISIBLE);\n manualEnter.setVisibility(View.VISIBLE);\n\n latitude = marker.getPosition().latitude;\n longitude = marker.getPosition().longitude;\n name = marker.getTitle();\n placeID = marker.getId();\n address = marker.getSnippet();\n\n time = DateFormat.getDateTimeInstance().format(new Date());\n //long miliTime = time.getTime\n\n\n\n //getMarkerInfo();\n\n //Toast.makeText(NearbyLocations.this, name, Toast.LENGTH_SHORT).show();\n return false;\n\n\n }\n });\n\n\n\n mMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() {\n\n @Override\n public View getInfoWindow(Marker arg0) {\n return null;\n }\n\n @Override\n public View getInfoContents(Marker marker) {\n\n LinearLayout info = new LinearLayout(NearbyLocations.this);\n info.setOrientation(LinearLayout.VERTICAL);\n\n TextView title = new TextView(NearbyLocations.this);\n title.setTextColor(Color.BLACK);\n title.setGravity(Gravity.CENTER);\n title.setTypeface(null, Typeface.BOLD);\n title.setText(marker.getTitle());\n\n TextView snippet = new TextView(NearbyLocations.this);\n snippet.setTextColor(Color.GRAY);\n snippet.setText(marker.getSnippet());\n\n info.addView(title);\n info.addView(snippet);\n\n return info;\n }\n });\n\n\n\n\n\n }", "public void getLocation(){\n }", "@Override\n public void onLocationChanged(Location location) {\n LatLng newLocation = new LatLng(location.getLatitude(), location.getLongitude());\n if (marker == null) {\n String address = getAddressFromCoordinates(location.getLatitude(), location.getLongitude());\n textView.setText(\"Your Current Location: \" + address); //For Testing, display coordinates on textView every time it's triggered\n marker = mMap.addMarker(new MarkerOptions().position(newLocation).title(\"Your current location:\"));\n arrayMarker.add(0, marker);\n builder.include(marker.getPosition());\n marker.setSnippet(address);\n } else {\n marker.setPosition(newLocation);\n String address = getAddressFromCoordinates(location.getLatitude(), location.getLongitude());\n// textView.setText(\"\\nCurrent Location: \" + address);\n marker.setTitle(\"Your current location:\");\n marker.setSnippet(address);\n }\n// mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(newLocation, 14.0f));\n renderCamera();\n }", "com.google.ads.googleads.v6.resources.LocationView getLocationView();", "private void initializeMap() {\n // - Map -\n map = (MapView) this.findViewById(R.id.map);\n //map.setBuiltInZoomControls(true);\n map.setMultiTouchControls(true);\n map.setMinZoomLevel(16);\n // Tiles for the map, can be changed\n map.setTileSource(TileSourceFactory.MAPNIK);\n\n // - Map controller -\n IMapController mapController = map.getController();\n mapController.setZoom(19);\n\n // - Map overlays -\n CustomResourceProxy crp = new CustomResourceProxy(getApplicationContext());\n currentLocationOverlay = new DirectedLocationOverlay(this, crp);\n\n map.getOverlays().add(currentLocationOverlay);\n\n // - Location -\n locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);\n if(locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER) != null) {\n onLocationChanged(locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER));\n }\n else if (locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER) != null) {\n onLocationChanged(locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER));\n }\n else {\n currentLocationOverlay.setEnabled(false);\n }\n }", "public void onMapClick (LatLng point) {\n\t\tmap.clear();\n\t\tdouble lat1 = point.latitude;\n\t\tdouble lng1 = point.longitude;\n\t\tlat=String.valueOf(lat1);\n\t\tlongi=String.valueOf(lng1);\n\t\tGeocoder gcd = new Geocoder(Home.this, Locale.getDefault());\n\t\tList<Address> addresses;\n\t\ttry {\n\t\t\taddresses = gcd.getFromLocation(lat1, lng1, 1);\n\t\t\tif (addresses.size() > 0) \n\t\t\t\t\n\t\t\t\theading.setText(addresses.get(0).getSubAdminArea());\n\t\t\tToast.makeText(Home.this, addresses.get(0).getLocality(),Toast.LENGTH_SHORT).show();\t\t\t\n\t\t\tMarkerOptions options = new MarkerOptions();\n\t\t\toptions.position(point);\n\t\t\tBitmap icon = BitmapFactory.decodeResource(Home.this.getResources(),\n\t\t\t\t\tR.drawable.pin);\n\t\t\tBitmap bhalfsize=Bitmap.createScaledBitmap(icon, icon.getWidth()/5,icon.getHeight()/5, false);\n\t\t\toptions.icon(BitmapDescriptorFactory.fromBitmap(bhalfsize));\n\t\t\toptions.title(addresses.get(0).getLocality());\t\t\n\t\t\tmap.addMarker(options);\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void map(){\n this.isMap = true;\n System.out.println(\"Switch to map mode\");\n }", "@OnClick({R.id.address_img, R.id.address})\n void OnClickMap() {\n // Open location on map\n Intent mapIntent=new Intent(Intent.ACTION_VIEW);\n mapIntent.setData(Uri.parse(\"geo:0,0?q=\" + getString(R.string.latitude) + \",\"\n + getString(R.string.longitude)));\n if (mapIntent.resolveActivity(getPackageManager()) != null) {\n startActivity(mapIntent);\n }\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n /*To find map coordinates for database\n mMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {\n @Override\n public void onMapClick(LatLng latLng) {\n Log.i(\"MAP\", latLng.latitude + \", \" + latLng.longitude);\n }\n });\n */\n\n\n styleMap();\n populateMap();\n setUpDirectionIntegration();\n\n Intent intent = getIntent();\n String location = intent.getStringExtra(\"Location\");\n if (location != null) {\n showSelectedLocation(location);\n } else {\n //showCurrentLocation();\n showCurrentLocation();\n }\n\n\n }", "public void printMap()\n {\n this.mapFrame.paint();\n this.miniMapFrame.paint();\n }", "private void showMapAndSendCoordinate(String coordinateMap, String name) {\n showMapFragment = new ShowMapFragment();\n Bundle bundle = new Bundle();\n bundle.putString(\"LatLng\", coordinateMap);\n bundle.putString(\"Name\", name);\n showMapFragment.setArguments(bundle);\n\n getSupportFragmentManager()\n .beginTransaction()\n .replace(R.id.linearMap, showMapFragment)\n .commit();\n }", "String getLocation(boolean detail);", "public void setShowMyLocation(boolean showMyLocation) {\n this.showMyLocation = showMyLocation;\n if(isNativeMaps()) {\n internalNative.setShowMyLocation(showMyLocation);\n }\n }", "@Override\n public void onMapReady(final GoogleMap map) {\n mMap = map;\n\n mMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() {\n\n @Override\n // Return null here, so that getInfoContents() is called next.\n public View getInfoWindow(Marker arg0) {\n return null;\n }\n\n @Override\n public View getInfoContents(Marker marker) {\n // Inflate the layouts for the info window, title and snippet.\n @SuppressLint(\"InflateParams\") View infoWindow = getLayoutInflater().inflate(R.layout.custom_info_contents, null);\n\n TextView title = infoWindow.findViewById(R.id.title);\n title.setText(marker.getTitle());\n\n TextView snippet = infoWindow.findViewById(R.id.snippet);\n snippet.setText(marker.getSnippet());\n\n return infoWindow;\n }\n });\n\n mMap.setOnMapLongClickListener(new GoogleMap.OnMapLongClickListener() {\n @Override\n public void onMapLongClick(LatLng point) {\n mMap.clear();\n buildMarker(\"User Tap\", \"This is snippet\", point, true);\n @SuppressLint(\"DefaultLocale\") String latLong = String.format(\"%f,%f\", point.latitude, point.longitude);\n String endPoint = String.format(placesURL,latLong, String.valueOf(distance), BuildConfig.API_KEY);\n Location locationSelected = new Location(mLastKnownLocation);\n locationSelected.setLatitude(point.latitude);\n locationSelected.setLongitude(point.longitude);\n showPlacesNearby(locationSelected, endPoint);\n }\n });\n\n mMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {\n @Override\n public void onMapClick(LatLng latLng) {\n mMap.clear();\n }\n });\n\n mMap.setOnMyLocationButtonClickListener(new GoogleMap.OnMyLocationButtonClickListener() {\n @Override\n public boolean onMyLocationButtonClick() {\n mMap.clear();\n updateLocationUI();\n getDeviceLocation();\n return true;\n }\n });\n\n\n // Prompt the user for permission.\n getLocationPermission();\n\n // Turn on the My Location layer and the related control on the map.\n updateLocationUI();\n\n // Get the current location of the device and set the position of the map.\n getDeviceLocation();\n }", "private void xxx() {\n LatLng westfieldNJ = new LatLng(40.659, -74.3474);\n mMap.addMarker(new MarkerOptions().position(westfieldNJ).title(\"Westfield, New Jersey\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(westfieldNJ));\n\n }", "@Override\n\t\t\tpublic void onLocationSuccess(AMapLocation location) {\n\n\t\t\t\tmLoadingDialog.cancelDialog();\n\t\t\t\tll_mySite = new LatLng(location.getLatitude(), location\n\t\t\t\t\t\t.getLongitude());\n\n\t\t\t\tAppConfigUtil.LocalLocation.Location_latitude = String\n\t\t\t\t\t\t.valueOf(location.getLatitude());\n\t\t\t\tAppConfigUtil.LocalLocation.Location_longitude = String\n\t\t\t\t\t\t.valueOf(location.getLongitude());\n\t\t\t\tLatLng latLng;\n\t\t\t\tif (AppConfigUtil.LocalLocation.Location_latitude.equals(\"0.0\")\n\t\t\t\t\t\t|| AppConfigUtil.LocalLocation.Location_longitude\n\t\t\t\t\t\t\t\t.equals(\"0.0\")) {\n\t\t\t\t\tAppConfigUtil.LocalLocation.Location_latitude = MyApplication.Location_latitude;\n\t\t\t\t\tAppConfigUtil.LocalLocation.Location_longitude = MyApplication.Location_longitude;\n\t\t\t\t\tmNaviStart = new NaviLatLng(Double\n\t\t\t\t\t\t\t.valueOf(MyApplication.Location_latitude), Double\n\t\t\t\t\t\t\t.valueOf(MyApplication.Location_longitude));\n\t\t\t\t\tmStartPoints.add(mNaviStart);\n\t\t\t\t\tlatLng = new LatLng(Double\n\t\t\t\t\t\t\t.valueOf(MyApplication.Location_latitude), Double\n\t\t\t\t\t\t\t.valueOf(MyApplication.Location_longitude));\n\t\t\t\t} else {\n\t\t\t\t\tmNaviStart = new NaviLatLng(location.getLatitude(),\n\t\t\t\t\t\t\tlocation.getLongitude());\n\t\t\t\t\tmStartPoints.add(mNaviStart);\n\t\t\t\t\tlatLng = new LatLng(location.getLatitude(), location\n\t\t\t\t\t\t\t.getLongitude());\n\t\t\t\t}\n\n\t\t\t\t// 初始化当前位置\n\t\t\t\t// aMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));\n\t\t\t\taMap.moveCamera(CameraUpdateFactory.zoomTo(14));\n\t\t\t\taMap.addMarker(new MarkerOptions()\n\t\t\t\t\t\t.position(latLng)\n\t\t\t\t\t\t.title(\"我的位置\")\n\t\t\t\t\t\t.icon(BitmapDescriptorFactory\n\t\t\t\t\t\t\t\t.fromResource(R.drawable.location_marker))\n\t\t\t\t\t\t.draggable(true));\n\t\t\t}", "private void displayLocation() {\n\n if (ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);\n\n if (mLastLocation != null) {\n double latitude = mLastLocation.getLatitude();\n double longitude = mLastLocation.getLongitude();\n\n\n String add = getAddressString(latitude, longitude);\n\n //Check in\n student_checkin chkIn = new student_checkin(getActivity(), sessionId, \"Lat: \" + latitude + \" Long: \" + longitude);\n chkIn.execute();\n lblLocation.setText(latitude + \", \" + longitude);\n cords.setText(add);\n\n\n\n } else {\n\n lblLocation\n .setText(\"(Couldn't get the location. Make sure location is enabled on the device)\");\n }\n }", "@SuppressLint(\"MissingPermission\")\n private void Locate(){\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 2000, 0, (LocationListener) this);\n\n // Obtain the SupportMapFragment and get notified when the map is ready to be used.\n mapFragment = (SupportMapFragment) getSupportFragmentManager()\n .findFragmentById(R.id.map);\n\n //Initialize fused location\n client = LocationServices.getFusedLocationProviderClient(this);\n }", "public abstract String getDisplayLocation();", "public void displaymap(AircraftData data);", "private void openPreferredLocationMap()\n\t{\n\n\t\tif (_forecastAdapter != null)\n\t\t{\n\t\t\tCursor cursor = _forecastAdapter.getCursor();\n\n\t\t\tif (cursor != null)\n\t\t\t{\n\t\t\t\tcursor.moveToPosition(0);\n\n\t\t\t\tString posLat = cursor.getString(COL_COORD_LAT);\n\t\t\t\tString posLong = cursor.getString(COL_COORD_LONG);\n\n\t\t\t\tUri geoLocation = Uri.parse(\"geo:\" + posLat + \",\" + posLong);\n\n\t\t\t\tIntent intent = new Intent(Intent.ACTION_VIEW);\n\t\t\t\tintent.setData(geoLocation);\n\n\t\t\t\tif (intent.resolveActivity(getActivity().getPackageManager()) != null)\n\t\t\t\t{\n\t\t\t\t\tstartActivity(intent);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tTraceUtil.logD(CLASS_NAME, \"openPreferredLocationMap\",\n\t\t\t\t\t\t\t\"Couldn't call \" + geoLocation.toString() +\n\t\t\t\t\t\t\t\t\t\", no receiving apps installed!\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void printMiniMap() \n { \n /* this.miniMapFrame(); */\n }", "@Override\n public void onMapReady(GoogleMap map) {\n mMap = map;\n\n // Use a custom info window adapter to handle multiple lines of text in the\n // info window contents.\n mMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() {\n\n @Override\n // Return null here, so that getInfoContents() is called next.\n public View getInfoWindow(Marker arg0) {\n return null;\n }\n\n @Override\n public View getInfoContents(Marker marker) {\n // Inflate the layouts for the info window, title and snippet.\n View infoWindow = getLayoutInflater().inflate(R.layout.custom_info_contents,\n (FrameLayout) findViewById(R.id.map), false);\n\n TextView title = ((TextView) infoWindow.findViewById(R.id.title));\n title.setText(marker.getTitle());\n\n TextView snippet = ((TextView) infoWindow.findViewById(R.id.snippet));\n snippet.setText(marker.getSnippet());\n\n return infoWindow;\n }\n });\n\n // Turn on the My Location layer and the related control on the map.\n updateLocationUI();\n\n // Get the current location of the device and set the position of the map.\n getDeviceLocation();\n\n initializeOtherSettlements(new LatLng(mLastKnownLocation.getLatitude(), mLastKnownLocation.getLongitude()));\n initializeQuestLocations(new LatLng(mLastKnownLocation.getLatitude(), mLastKnownLocation.getLongitude()));\n\n mMap.setOnMarkerClickListener(this);\n mMap.setOnMapClickListener(this);\n mMap.setOnPoiClickListener(this);\n mMap.setOnInfoWindowClickListener(this);\n\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), 9));\n\n final PlaceAutocompleteFragment autocompleteFragment = (PlaceAutocompleteFragment)\n getFragmentManager().findFragmentById(R.id.place_autocomplete_fragment);\n\n autocompleteFragment.getView().setBackgroundColor(Color.WHITE);\n autocompleteFragment.getView().setVisibility(View.GONE);\n autocompleteFragment.setOnPlaceSelectedListener(new PlaceSelectionListener() {\n @Override\n public void onPlaceSelected(Place place) {\n //Bias results towards the user's current location\n /*autocompleteFragment.setBoundsBias(new LatLngBounds(\n new LatLng(place.getLatLng().latitude, place.getLatLng().longitude),\n new LatLng(place.getLatLng().latitude, place.getLatLng().longitude)));*/\n\n //Get info about the selected place.\n //Log.i(TAG, \"Place: \" + place.getName());\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(place.getLatLng().latitude,\n place.getLatLng().longitude), mMap.getCameraPosition().zoom));\n\n addMarkerAtPoi(place);\n }\n\n @Override\n public void onError(Status status) {\n // TODO: Handle the error.\n Log.i(TAG, \"An error occurred: \" + status);\n }\n });\n\n updateMapHistory();\n updateCustomTimeUI();\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n Log.d(logTag,\"4\");\n mMap = googleMap;\n mMap.getUiSettings().setZoomControlsEnabled(true);\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, LOCATION_REQUEST);\n return;\n }\n mMap.setOnMapLongClickListener(this);\n mMap.setOnInfoWindowClickListener( this );\n mMap.setOnMapClickListener(this);\n mMap.setMyLocationEnabled(true);\n ll=new LatLng(currentLocation.getLatitude(),currentLocation.getLongitude());\n MarkerOptions options = new MarkerOptions().position(ll);\n options.title(getAddressFromLatLng(ll));\n\n Log.d(logTag,\"5\");\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n mMap.setTrafficEnabled(true);\n mMap.getUiSettings().setZoomGesturesEnabled(true);\n mMap.getUiSettings().setZoomControlsEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n mMap.getUiSettings().setCompassEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n\n LocationManager manager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);\n Criteria mCriteria = new Criteria();\n String bestProvider = String.valueOf(manager.getBestProvider(mCriteria, true));\n\n Location mLocation = manager.getLastKnownLocation(bestProvider);\n\n checkLocationPermission();\n mMap.setMyLocationEnabled(true);\n\n final double currentLatitude = mLocation.getLatitude();\n final double currentLongitude = mLocation.getLongitude();\n LatLng loc1 = new LatLng(currentLatitude, currentLongitude);\n mMap.addMarker(new MarkerOptions().position(loc1).title(\"Your Current Location\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(currentLatitude, currentLongitude), 15));\n mMap.animateCamera(CameraUpdateFactory.zoomTo(15), 2000, null);\n\n Geocoder geocoder = new Geocoder(MapsActivity.this, Locale.getDefault());\n List<Address> addresses = null;\n try {\n addresses = geocoder.getFromLocation(currentLatitude, currentLongitude, 1);\n } catch (IOException e) {\n e.printStackTrace();\n }\n cityName = addresses.get(0).getAddressLine(0);\n\n GraphRequest request = GraphRequest.newGraphPathRequest(\n accessToken,\n \"/search\",\n new GraphRequest.Callback() {\n @Override\n public void onCompleted(GraphResponse response) {\n JSONObject eventsInCityObject = response.getJSONObject();\n RealmList<Event> cityEvents = new RealmList<Event>();\n\n\n try {\n JSONArray eventsInCityArray = eventsInCityObject.getJSONArray(\"data\");\n for (int i = 0; i < eventsInCityArray.length(); i++) {\n JSONObject eventJSON = eventsInCityArray.getJSONObject(i);\n JSONObject placeJSON = (JSONObject) eventJSON.get(\"place\");\n\n if (placeJSON.has(getString(R.string.getEventLocation))){\n JSONObject locJSON = (JSONObject) placeJSON.get(getString(R.string.getEventLocation));\n\n String city = locJSON.getString(getString(R.string.getEventCity));\n String country = locJSON.getString(getString(R.string.getEventCountry));\n Double lat = locJSON.getDouble(getString(R.string.getEventLat));\n Double lng = locJSON.getDouble(getString(R.string.getEventLng));\n\n EventLocation loc = getRealm().createObject(EventLocation.class, UUID.randomUUID().toString());\n loc.setCity(city);\n loc.setCountry(country);\n loc.setLat(lat);\n loc.setLng(lng);\n\n String placeName = placeJSON.getString(getString(R.string.getPlaceName));\n String placeID = placeJSON.getString(getString(R.string.getPlaceID));\n Place place = getRealm().createObject(Place.class, UUID.randomUUID().toString());\n place.setName(placeName);\n place.setId(placeID);\n place.setLoc(loc);\n\n Event event = getRealm().createObject(Event.class, UUID.randomUUID().toString());\n event.setDesc(eventJSON.getString(getString(R.string.getDescription)));\n event.setEndTime(eventJSON.getString(getString(R.string.getEndTime)));\n event.setName(eventJSON.getString(getString(R.string.getEventName)));\n event.setPlace(place);\n event.setStartTime(eventJSON.getString(getString(R.string.getStartTime)));\n event.setEventID(eventJSON.getString(getString(R.string.getEventID)));\n\n cityEvents.add(event);\n\n mMap.addMarker(new MarkerOptions().position(new LatLng(event.getPlace().getLoc().getLat(),\n event.getPlace().getLoc().getLng())).title(event.getName()));\n } else {\n String placeName = placeJSON.getString(getString(R.string.getPlaceName));\n Place place = getRealm().createObject(Place.class, UUID.randomUUID().toString());\n place.setName(placeName);\n\n\n Event event = getRealm().createObject(Event.class, UUID.randomUUID().toString());\n event.setDesc(eventJSON.getString(getString(R.string.getDescription)));\n event.setEndTime(eventJSON.getString(getString(R.string.getEndTime)));\n event.setName(eventJSON.getString(getString(R.string.getEventName)));\n event.setPlace(place);\n event.setStartTime(eventJSON.getString(getString(R.string.getStartTime)));\n event.setEventID(eventJSON.getString(getString(R.string.getEventID)));\n }\n }\n } catch (JSONException e){\n e.printStackTrace();\n }\n }\n });\n\n Bundle parameters = new Bundle();\n parameters.putString(getString(R.string.query), cityName);\n parameters.putString(getString(R.string.type), getString(R.string.event));\n request.setParameters(parameters);\n request.executeAsync();\n\n\n }", "public void locate()\n\t{\n\t\tlocationClient = new LocationClient(Main.activity.getApplicationContext()); // 实例化LocationClient类\n\t\t\t\t\n\t\tlocationClient.registerLocationListener(myListener); // 注册监听函数\n\t\tthis.setLocationOption();\t//设置定位参数\n\t\tlocationClient.start(); // 开始定位\n\t\tlocationClient.requestLocation();\n\t}", "private void showCurrentLocation(LatLng ll) {\n if (mMarker != null) {\n mMarker.remove();\n }\n\n if (mZoom == 0) {\n mZoom = 15;\n } else {\n mZoom = googleMap.getCameraPosition().zoom;\n }\n\n // Move the camera instantly to current postion\n googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(ll, mZoom));\n\n // Marker\n mMarker = googleMap.addMarker(new MarkerOptions()\n .title(getString(R.string.current_location))\n .snippet(mLocationHelper.getAddress(ll.latitude, ll.longitude).toString())\n .position(ll));\n\n // Zoom in, animating the camera.\n googleMap.animateCamera(CameraUpdateFactory.zoomTo(mZoom), 2000, null);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n gpsTracker = new GPSTracker(this);\n\n // TODO Cek Permission >= Marshmellow\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED\n &&\n ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M &&\n checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n requestPermissions(new String[]{\n Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION\n }, 110);\n return;\n }\n }\n\n if (gpsTracker.canGetLocation()) {\n latawal = gpsTracker.getLatitude();\n lonawal = gpsTracker.getLongitude();\n namelocationawal = myLocation(latawal, lonawal);\n }\n\n // Add a marker in Sydney and move the camera\n LatLng myLocation = new LatLng(latawal, lonawal);\n locawal.setText(namelocationawal);\n mMap.addMarker(new MarkerOptions().position(myLocation).title(namelocationawal));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(myLocation, 14));\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n mMap.setPadding(30, 80, 30, 80);\n }", "private void updateLocationUI() {\n if (mMap == null) {\n return;\n }\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n if (mLocationPermissionGranted) {\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n } else {\n mMap.setMyLocationEnabled(false);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n mLastKnownLocation = null;\n }\n }", "@Override\n\tpublic void drawMap(Map map) {\n\t\tSystem.out.println(\"Draw map\"+map.getClass().getName()+\"on SD Screen\");\n\t}", "private void updateLocationUI() {\n if (mMap == null) {\n return;\n }\n try {\n if (mLocationPermissionGranted) {\n mMap.setMyLocationEnabled(true);\n\n // Display the user selected map type\n mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);\n\n MapStyleOptions style = MapStyleOptions.loadRawResourceStyle(mContext, R.raw.map_style_night);\n mMap.setMapStyle(style);\n\n // Don't want to display the default location button because\n // we are already displaying using a FAB\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n\n mMap.setOnMyLocationClickListener(this);\n } else {\n mMap.setMyLocationEnabled(false);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n mLastKnownLocation = null;\n getLocationPermission();\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "@Override\n public void onMapClick(LatLng arg0) {\n try {\n Geocoder geo = new Geocoder(MapsActivity.this, Locale.getDefault());\n List<Address> add = geo.getFromLocation(arg0.latitude, arg0.longitude, 1);\n String selectedCountry;\n if (add.size() > 0) {\n selectedCountry = add.get(0).getCountryName();\n selectedStateOrCountry = selectedCountry;\n\n //Log.d(\"country\", selectedCountry);\n //For usa go with states . All other countries - it gives the capital\n if (selectedCountry.equalsIgnoreCase(\"United States\") ||\n selectedCountry.equalsIgnoreCase(\"US\")) {\n selectedStateOrCountry = add.get(0).getAdminArea();\n }\n //Log.d(\"state\", selectedStateOrCountry);\n ConvertTextToSpeech();\n }\n } catch (Exception e) {\n //Log.e(TAG, \"Failed to initialize map\", e);\n }\n }", "@Override\n public void onMapReady(GoogleMap map) {\n mMap = map;\n\n // Use a custom info window adapter to handle multiple lines of text in the\n // info window contents.\n mMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() {\n\n @Override\n // Return null here, so that getInfoContents() is called next.\n public View getInfoWindow(Marker arg0) {\n return null;\n }\n\n @Override\n public View getInfoContents(Marker marker) {\n // Inflate the layouts for the info window, title and snippet.\n View infoWindow = getLayoutInflater().inflate(R.layout.custom_info_contents,\n (FrameLayout) findViewById(R.id.map), false);\n\n TextView title = ((TextView) infoWindow.findViewById(R.id.title));\n title.setText(marker.getTitle());\n\n TextView snippet = ((TextView) infoWindow.findViewById(R.id.snippet));\n snippet.setText(marker.getSnippet());\n\n return infoWindow;\n }\n });\n\n // Turn on the My Location layer and the related control on the map.\n updateLocationUI();\n\n // Get the current location of the device and set the position of the map.\n getDeviceLocation();\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n mMap.getUiSettings().setCompassEnabled(true);\n String mPermission = Manifest.permission.ACCESS_FINE_LOCATION;\n // if Permission not already given\n if (ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n ActivityCompat.requestPermissions(getActivity(), new String[]{mPermission}, REQUEST_CODE_PERMISSION);\n Toast.makeText(getContext(), \"Location permission not granted\", Toast.LENGTH_SHORT).show();\n // checkLocationPermission();\n return;\n } else {\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n getDeviceLocation();\n init();\n }\n if(sharedPref.getString(\"shared_status\",null).equalsIgnoreCase(\"User\")) { // if user in show driver\n showNearBy();\n }\n mMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {\n @Override\n public void onMapClick(LatLng latLng) {\n if (mPreviousMarker != null) {\n mPreviousMarker.remove();\n mPreviousMarker = mMap.addMarker(new MarkerOptions().position(latLng).title(\"Destination\"));\n // Toast.makeText(getContext(), mPreviousMarker.getSnippet(), Toast.LENGTH_LONG).show();\n }\n else\n mPreviousMarker = mMap.addMarker(new MarkerOptions().position(latLng).title(\"Destination\"));\n }\n });\n\n mMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {\n @Override\n public boolean onMarkerClick(Marker marker) {\n // Toast.makeText(getContext(), \"MARKER CLICKED \"+marker.getTitle(), Toast.LENGTH_SHORT).show();\n if(!marker.getTitle().equalsIgnoreCase(\"Destination\")) {\n if(mPreviousMarker !=null) // destination is marked\n show_card(marker.getTitle(),true,mlocation,mPreviousMarker);\n else\n show_card(marker.getTitle(),false,mlocation,mPreviousMarker);\n }else\n mPreviousMarker.getSnippet();\n\n return false;\n }\n });\n }", "protected void initMap(Location location, SimplePanel mapPanel) {\n GWT.log(\"initMap\");\n if (location == null) {\n mapWidget = new MapWidget();\n } else {\n LatLng latLng = LatLng.newInstance(location.getLatitude(), location.getLongitude());\n mapWidget = new MapWidget(latLng, 15);\n reverseGeocode(latLng, null);\n Marker marker = new Marker(latLng);\n mapWidget.addOverlay(marker);\n }\n mapWidget.setSize(\"840px\", \"600px\");\n mapWidget.setUIToDefault();\n MapUIOptions opts = mapWidget.getDefaultUI();\n opts.setDoubleClick(false);\n mapWidget.setUI(opts);\n mapWidget.addMapClickHandler(new MapClickHandler() {\n public void onClick(MapClickEvent e) {\n Overlay overlay = e.getOverlay();\n LatLng point = e.getLatLng();\n if (overlay != null && overlay instanceof Marker) {\n // no point if we click on marker\n } else {\n mywebapp.setAutoGps(false);\n //this is a callback\n reverseGeocode(point, afterGeocodeCallback);\n }\n }\n });\n //mapWidget.checkResize();\n //if (mapPanel != null) {\n mapPanel.setWidget(mapWidget);\n // }\n }", "public void showMapTypePanel(){\n mapTypePanel.showMapTypePanel();\n if(mapTypePanel.isVisible() && optionsPanel.isVisible()){\n optionsPanel.setVisible(false);\n if(iconPanel.isVisible()) iconPanel.setVisible(false);\n }\n if(routePanel.isVisible()) routePanel.setVisible(false); closeDirectionList();\n canvas.repaint();\n }", "public void showMaps() throws Exception{\r\n MapMaintenanceBaseWindow mapMaintenanceBaseWindow = null;\r\n String unitNumber=mdiForm.getUnitNumber();\r\n \r\n if( ( mapMaintenanceBaseWindow = (MapMaintenanceBaseWindow)mdiForm.getFrame(\r\n CoeusGuiConstants.MAPS_BASE_FRAME_TITLE+\" \"+unitNumber))!= null ){\r\n if( mapMaintenanceBaseWindow.isIcon() ){\r\n mapMaintenanceBaseWindow.setIcon(false);\r\n }\r\n mapMaintenanceBaseWindow.setSelected( true );\r\n return;\r\n }\r\n \r\n MapMaintenanceBaseWindowController mapMaintenanceBaseWindowController = new MapMaintenanceBaseWindowController(unitNumber,false);\r\n mapMaintenanceBaseWindowController.display();\r\n \r\n }", "public void printMap()\n {\n if(this.firstTime)\n {\n SwingUtilities.invokeLater(new Runnable() {\n @Override\n public void run() { setVisible(true); }\n });\n this.firstTime = false;\n }\n screen.repaint();\n }", "private void updateLocationUI() {\n if (mMap == null) {\n return;\n }\n\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n\n if (mLocationPermissionGranted) {\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n } else {\n mMap.setMyLocationEnabled(false);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n mLastKnownLocation = null;\n }\n }", "private void askPermissionsAndShowMyLocation() {\n if (Build.VERSION.SDK_INT >= 23) {\n int accessCoarsePermission\n = ContextCompat.checkSelfPermission(activity, android.Manifest.permission.ACCESS_COARSE_LOCATION);\n int accessFinePermission\n = ContextCompat.checkSelfPermission(activity, android.Manifest.permission.ACCESS_FINE_LOCATION);\n\n\n if (accessCoarsePermission != PackageManager.PERMISSION_GRANTED\n || accessFinePermission != PackageManager.PERMISSION_GRANTED) {\n // The Permissions to ask user.\n String[] permissions = new String[]{android.Manifest.permission.ACCESS_COARSE_LOCATION,\n android.Manifest.permission.ACCESS_FINE_LOCATION};\n // Show a dialog asking the user to allow the above permissions.\n ActivityCompat.requestPermissions(activity, permissions,\n REQUEST_ID_ACCESS_COURSE_FINE_LOCATION);\n\n return;\n }\n }\n\n // Show current location on Map.\n this.showMyLocation();\n }", "@Override\n\t\t\tpublic void onLocationChanged(Location location) {\n\t\t\t\t\n\t\t\t\tmLatitude = location.getLatitude();\n\t\t\t\tmLongitude = location.getLongitude();\n\t\t\t\t\n\t\t\t\t LatLng point = new LatLng(mLatitude, mLongitude);\n\t\t\t\t\n\t\t\t\t try {\n\t\t\t\t \taddresses = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1);\n\t\t\t\t } catch (IOException e) {\n\t\t\t\t \t// TODO Auto-generated catch block\n\t\t\t\t \te.printStackTrace();\n\t\t\t\t }\n\t\t\t\t MarkerOptions maker= new MarkerOptions().position(point);\n\n\t\t\t\t address = addresses.get(0).getAddressLine(0);\n\t\t\t\t if(address==null)\n\t\t\t\t {\n\t\t\t\t\t maker.title(\"My Location\");\n\t\t\t\t\t\tgoogleMap.addMarker(maker);\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\tmaker.title(\"\"+address);\n\t\t\t\t\tgoogleMap.addMarker(maker);\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t String type = mPlaceType;\n\t\t\t StringBuilder sb = new StringBuilder(\"https://maps.googleapis.com/maps/api/place/nearbysearch/json?\");\n\t\t\t sb.append(\"location=\"+mLatitude+\",\"+mLongitude);\n\t\t\t sb.append(\"&radius=1500\");\n\t\t\t sb.append(\"&types=\"+type);\n\t\t\t sb.append(\"&sensor=true\");\n\t\t\t sb.append(\"&key=AIzaSyAwZSGS1kZG7_UuqxqHH3MdO1hbwB2cjag\"); \n\t\t\t PlacesTask placesTask = new PlacesTask(); \n\t\t\t placesTask.execute(sb.toString());\n\t\t\t \n\t\t\t \n\t\t\t if(zoomm)\n\t\t\t {\n\t\t\t \t googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(new CameraPosition(point, 15, 30, 0)));\n\t\t\t \t zoomm=false;\n\t\t\t }\n\t\t\t\t\n\t\t\t}", "private void getMyLocation() {\n LatLng latLng = new LatLng(latitude, longitude);\n CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(latLng, 18);\n googleMap.animateCamera(cameraUpdate);\n }", "@Override\n public void onClick(View view) {\n Uri gmmIntentUri = Uri.parse(\"geo:0, 0?q=Animal+Shelter+near+me\");\n Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);\n mapIntent.setPackage(\"com.google.android.apps.maps\");\n startActivity(mapIntent);\n }", "@Override\n public String location() {\n return \"Vị trí sách giáo khoa\";\n }", "private void updateLocationUI() {\n if (mMap == null) {\n return;\n }\n try {\n if (mLocationPermissionGranted) {\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n } else {\n mMap.setMyLocationEnabled(false);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n mLastKnownLocation = null;\n getLocationPermission();\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "private void updateLocationUI() {\n if (mMap == null) {\n return;\n }\n try {\n if (mLocationPermissionGranted) {\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n } else {\n mMap.setMyLocationEnabled(false);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n mLastKnownLocation = null;\n getLocationPermission();\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "private void updateLocationUI() {\n if (mMap == null) {\n return;\n }\n try {\n if (mLocationPermissionGranted) {\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n } else {\n mMap.setMyLocationEnabled(false);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n mLastKnownLocation = null;\n getLocationPermission();\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "private void DisplayTrack(String sSouce, String dDestiny)\n {\n\n try {\n //when google map installed\n // intialize url\n Uri uri = Uri.parse(\"https://www.google.co.in/maps/dir/\" +sSouce + \"/\" +dDestiny);\n\n //Intialize intent with action view\n\n Intent intent = new Intent(Intent.ACTION_VIEW,uri);\n // set pkg\n intent.setPackage(\"com.google.android.apps.maps\");\n\n // set flag\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(intent);\n\n }catch (ActivityNotFoundException e)\n {\n // when google map is not install\n // set uri\n Uri uri = Uri.parse(\"https://play.google.com/store/apps/details?id=com.google.android.apps.maps\");\n // intialize intent with action view\n Intent intent = new Intent(Intent.ACTION_VIEW,uri);\n // set flag\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n // start acivity\n startActivity(intent);\n\n }\n\n\n }", "private void showMyLocation() {\n\n LocationManager locationManager = (LocationManager) activity.getSystemService(LOCATION_SERVICE);\n\n String locationProvider = this.getEnabledLocationProvider();\n\n if (locationProvider == null) {\n return;\n }\n\n // Millisecond\n final long MIN_TIME_BW_UPDATES = 1000;\n // Met\n final float MIN_DISTANCE_CHANGE_FOR_UPDATES = 1;\n\n Location myLocation = null;\n try {\n // This code need permissions (Asked above ***)\n\n /* locationManager.requestLocationUpdates(\n locationProvider,\n MIN_TIME_BW_UPDATES,\n MIN_DISTANCE_CHANGE_FOR_UPDATES, (android.location.LocationListener) this); */\n\n\n // Getting Location.\n myLocation = locationManager\n .getLastKnownLocation(locationProvider);\n }\n // With Android API >= 23, need to catch SecurityException.\n catch (SecurityException e) {\n\n Log.e(\"ActivityTackeSegment\", \"Show My Location Error:\" + e.getMessage());\n e.printStackTrace();\n return;\n }\n\n if (myLocation != null) {\n\n// // Add a marker in Sydney and move the camera\n// LatLng sydney = new LatLng(-34, 151);\n// myMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n// myMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n// Toast.makeText(getActivity(),\"Je suis a Sydney\",Toast.LENGTH_SHORT);\n\n\n LatLng latLng = new LatLng(myLocation.getLatitude(), myLocation.getLongitude());\n // LatLng latLng = new LatLng(-34, 151);\n //myMap.addMarker(new MarkerOptions().position(latLng).title(\"Marker in Sydney\"));\n // myMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 14));\n\n CameraPosition cameraPosition = new CameraPosition.Builder()\n .target(latLng) // Sets the center of the map to location user\n .zoom(currentZoom) // Sets the zoom\n .bearing(0) // Sets the orientation of the camera to east\n .tilt(40) // Sets the tilt of the camera to 30 degrees\n .build(); // Creates a CameraPosition from the builder\n myMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));\n\n /*\n // Add Marker to Map\n MarkerOptions option = new MarkerOptions();\n option.title(\"My Location\");\n option.snippet(\"....\");\n option.position(latLng);\n Marker currentMarker = myMap.addMarker(option);\n currentMarker.showInfoWindow();\n */\n } else {\n\n Log.i(\"ActivityTrackerFragment\", \"Location not found\");\n }\n\n }", "private String describeLocation() {\n\t\tSWLocation location = this.world.getEntityManager().whereIs(this);\n\t\treturn this.getShortDescription() + \" [\" + this.getHitpoints() + \"] is at \" + location.getShortDescription();\n\t}", "@Override\n\tpublic void onLocationChanged(Location location) {\n\t\t if (location != null) {\n\t\t //punto = location;\n\t\t GeoPoint puntoCap = new GeoPoint(location);\n\t\t this.posicionActualOverlay.setLocation(puntoCap);\n\t\t mapView.getController().animateTo(puntoCap);\n\t\t mapView.getController().setCenter(puntoCap);\n\t\t }\n\t\t\n\t}", "@Override\n public void onMapLongClick(LatLng point){\n location = new cLocation(point, this);\n\n //Open a dialog for the user to allow the user to set the name for the saved location\n DialogFragment dialog = new AddLocationDialog();\n dialog.show(getFragmentManager(), getText(R.string.map_ask_add).toString());\n }", "@Override public void drawDirections(Location location) {\n\t\tToast.makeText(mMapFragment.getActivity(), \"NOT YET IMPLEMENTED\", Toast.LENGTH_LONG).show();\n\t}", "public void onLocationChanged(Location argLocation) {\n\t GeoPoint myGeoPoint = new GeoPoint(\r\n\t (int)(argLocation.getLatitude()*1000000),\r\n\t (int)(argLocation.getLongitude()*1000000));\r\n\t /*\r\n\t * it will show a message on \r\n\t * location change\r\n\t Toast.makeText(getBaseContext(),\r\n\t \"New location latitude [\" +argLocation.getLatitude() +\r\n\t \"] longitude [\" + argLocation.getLongitude()+\"]\",\r\n\t Toast.LENGTH_SHORT).show();\r\n\t */\r\n\r\n\t mapController.animateTo(myGeoPoint);\r\n\r\n\t }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n mUiSettings = mMap.getUiSettings();\n mMap.setTrafficEnabled(true);\n mMap.setBuildingsEnabled(true);\n mUiSettings.setZoomControlsEnabled(true);\n mUiSettings.setZoomGesturesEnabled(true);\n mUiSettings.setCompassEnabled(true);\n mMap.setBuildingsEnabled(true);\n mMap.setTrafficEnabled(true);\n mMap.setIndoorEnabled(true);\n search(address);\n //checking if appropriate permissions are granted\n if(ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED){\n return;\n }\n mMap.setMyLocationEnabled(true);\n }", "public abstract String getLocation();", "public void updateLocation();", "private void setup() {\n\t\t map.setMyLocationEnabled(true);\n\t \n\t CameraPosition cameraPosition = new CameraPosition.Builder()\n\t .target(USMP_LOCATION) // Sets the center of the map to\n\t // Golden Gate Bridge\n\t .zoom(16) // Sets the zoom\n\t .bearing(90) // Sets the orientation of the camera to east\n\t .tilt(60) // Sets the tilt of the camera to 30 degrees\n\t .build(); // Creates a CameraPosition from the builder\n\t \n\t CameraUpdate cameraUpdate=CameraUpdateFactory.newCameraPosition(\n\t \t cameraPosition);\n\t\t map.animateCamera(cameraUpdate);\n\t\t \n\t map.addMarker(new MarkerOptions()\n\t .position(USMP_LOCATION)\n\t .title(\"DevFest 2013 Season 2\"));\n\t}", "String getLocation();", "String getLocation();", "String getLocation();", "private void updateLocationUI() {\n if (map == null) {\n return;\n }\n try {\n if (locationPermissionGranted) {\n map.setMyLocationEnabled(true);\n map.getUiSettings().setMyLocationButtonEnabled(true);\n } else {\n map.setMyLocationEnabled(false);\n map.getUiSettings().setMyLocationButtonEnabled(false);\n lastKnownLocation = null;\n getLocationPermission();\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "@Override\n public void onClick(View view) {\n Uri gmmIntentUri = Uri.parse(\"geo:0,0?q=\" + selected_location);\n Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);\n mapIntent.setPackage(\"com.google.android.apps.maps\");\n if (mapIntent.resolveActivity(getActivity().getPackageManager()) != null) {\n startActivity(mapIntent);\n }\n }", "private void displayLocation() {\n\n if(customProgressDialog.isShowing())\n customProgressDialog.cancel();\n\n boolean hasPermissionFine = (ContextCompat.checkSelfPermission(LocationChooser.this,\n android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED);\n boolean hasPermissionCoarse = (ContextCompat.checkSelfPermission(LocationChooser.this,\n android.Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED);\n if (!hasPermissionFine || !hasPermissionCoarse) {\n ActivityCompat.requestPermissions(LocationChooser.this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.ACCESS_COARSE_LOCATION}, REQUEST_LOCATION);\n } else {\n mLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);\n }\n mLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);\n if (mLocation != null) {\n sLat = mLocation.getLatitude();\n sLang = mLocation.getLongitude();\n Log.d(\"curren location:\", String.valueOf(sLat) + \"::\" + String.valueOf(sLang));\n source.setText(\"Your location\");\n //locationText.setText(String.valueOf(sLat)+\"::\"+String.valueOf(sLang));\n } else {\n Toast.makeText(this, \"Location not Detected.\", Toast.LENGTH_SHORT).show();\n // showSettingsAlert();\n }\n }", "@Override\r\n public boolean onTap(GeoPoint arg0, MapView arg1) {\n if(getMyLocation()!=null){\r\n int size = 30;\r\n Point out=new Point();\r\n mMapView.getProjection().toPixels(getMyLocation(), out); \r\n Rect rect = new Rect(out.x-size,out.y-size,out.x+size,out.y+size);\r\n mMapView.getProjection().toPixels(arg0, out);\r\n if(rect.contains(out.x, out.y)){\r\n //Log.e(\"MyLocation\", \"click my location \");\r\n mPopView.setVisibility(View.GONE);\r\n MapView.LayoutParams params = (MapView.LayoutParams) mPopView.getLayoutParams();\r\n params.x = 0;// Y轴偏移\r\n params.y = -5;// Y轴偏移\r\n GeoPoint point = getMyLocation().e();\r\n params.point = point;\r\n //mMapCtrl.animateTo(point);\r\n mMapView.updateViewLayout(mPopView, params);\r\n mPopView.setVisibility(View.VISIBLE);\r\n }else{\r\n mPopView.setVisibility(View.GONE) ; \r\n }\r\n }\r\n return super.onTap(arg0, arg1);\r\n }" ]
[ "0.7183939", "0.69428617", "0.68998474", "0.6892216", "0.68620795", "0.6848381", "0.672532", "0.66780436", "0.6569384", "0.6522945", "0.65096456", "0.65035844", "0.6492844", "0.64722675", "0.64442605", "0.6439045", "0.643835", "0.6400605", "0.6400082", "0.6398604", "0.6361402", "0.63488936", "0.6314686", "0.6313431", "0.62546617", "0.62536776", "0.62450486", "0.6232586", "0.62254536", "0.6201165", "0.6194088", "0.6179208", "0.61746603", "0.61734414", "0.6170861", "0.61701035", "0.6160749", "0.6124722", "0.61158764", "0.61079395", "0.61034584", "0.6096324", "0.6089971", "0.6084345", "0.60821223", "0.6081264", "0.6070519", "0.60695016", "0.6066435", "0.6064029", "0.606253", "0.60592526", "0.6051377", "0.6037071", "0.6032841", "0.6029654", "0.60282123", "0.602692", "0.6025921", "0.6018181", "0.6010185", "0.60008866", "0.6000631", "0.59894973", "0.5986533", "0.598121", "0.5979916", "0.59797", "0.5978387", "0.59758735", "0.5972462", "0.59681875", "0.5966744", "0.59658694", "0.59618783", "0.59604996", "0.5945089", "0.5939449", "0.5928902", "0.58965224", "0.58949894", "0.58949894", "0.58949894", "0.58947134", "0.5890661", "0.58863884", "0.5885891", "0.58842045", "0.58840305", "0.5880411", "0.5876264", "0.5873303", "0.5871533", "0.58707935", "0.5863522", "0.5863522", "0.5863522", "0.5858291", "0.58577985", "0.5848374", "0.5848105" ]
0.0
-1
Handle navigation view item clicks here.
@SuppressWarnings("StatementWithEmptyBody") @Override public boolean onNavigationItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.navigation_home) { DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); drawer.closeDrawer(GravityCompat.START); } else if (id == R.id.navigation_earnings) { Intent intentHistory = new Intent(DriverHomeActivity.this, DriverEarningsActivity.class); startActivity(intentHistory); } else if (id == R.id.navigation_ratings) { Intent intentHistory = new Intent(DriverHomeActivity.this, DriverRatingsActivity.class); startActivity(intentHistory); } else if (id == R.id.navigation_account) { Intent intentHistory = new Intent(DriverHomeActivity.this, DriverAccountActivity.class); startActivityForResult(intentHistory,REQUEST_ACTIVITY_ACCOUNT); }else if (id == R.id.nav_sign_out) { updateOffline(); FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); if (user != null) { FirebaseAuth.getInstance().signOut(); Intent intent = new Intent(getApplicationContext(), ChooseTypeUserActivity.class); startActivity(intent); finish(); } } DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); drawer.closeDrawer(GravityCompat.START); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void onNavigationItemClicked(Element element);", "@Override\n public void onClick(View view) { listener.onItemClick(view, getPosition()); }", "void onDialogNavigationItemClicked(Element element);", "@Override\n public void onClick(View view) {\n itemInterface.OnItemClickedListener(tracks, getAdapterPosition());\n }", "@Override\n public void onClickItem(MeowBottomNavigation.Model item) {\n }", "@Override\n public void onClickItem(MeowBottomNavigation.Model item) {\n }", "@Override\n public void onClick(View view) {\n listener.menuButtonClicked(view.getId());\n }", "@Override\r\n\tpublic boolean onNavigationItemSelected(int itemPosition, long itemId) {\n\t\tLog.d(\"SomeTag\", \"Get click event at position: \" + itemPosition);\r\n\t\tswitch (itemPosition) {\r\n\t\tcase 1:\r\n\t\t\tIntent i = new Intent();\r\n\t\t\ti.setClass(getApplicationContext(), MainActivity.class);\r\n\t\t\tstartActivity(i);\r\n\t\t\t//return true;\r\n\t\t\tbreak;\r\n\t\tcase 2 :\r\n\t\t\tIntent intent = new Intent(this,WhiteListActivity.class);\r\n\t\t\tstartActivity(intent);\r\n\t\t\t//return true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n String name = navDrawerItems.get(position).getListItemName();\n // call a helper method to perform a corresponding action\n performActionOnNavDrawerItem(name);\n }", "@Override\n\tpublic void rightNavClick() {\n\t\t\n\t}", "@Override\n public void OnItemClick(int position) {\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif (itemClicked != null)\n\t\t\t\t\titemClicked.OnItemClicked((BusinessType)item.getTag(), item);\n\t\t\t}", "@Override\n public void onClick(View view) {\n clickListener.onItemClicked(getBindingAdapterPosition());\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long id) {\n\t\t\t\thandleClick(position);\n\t\t\t}", "@Override\n public void onItemClicked(int itemPosition, Object dataObject) {\n }", "@Override\n public void onItemClick(int pos) {\n }", "@Override\n public void onClick(View v) {\n if (listener != null)\n listener.onItemClick(itemView, getPosition());\n }", "private void handleNavClick(View view) {\n final String label = ((TextView) view).getText().toString();\n if (\"Logout\".equals(label)) {\n logout();\n }\n if (\"Profile\".equals(label)) {\n final Intent intent = new Intent(this, ViewProfileActivity.class);\n startActivity(intent);\n }\n if (\"Search\".equals(label)){\n final Intent intent = new Intent(this, SearchActivity.class);\n startActivity(intent);\n }\n if (\"Home\".equals(label)) {\n final Intent intent = new Intent(this, HomeActivity.class);\n startActivity(intent);\n }\n }", "void onMenuItemClicked();", "@Override\n public void onClick(View view) {\n\n switch (view.getId()) {\n case R.id.tvSomeText:\n listener.sendDataToActivity(\"MainActivity: TextView clicked\");\n break;\n\n case -1:\n listener.sendDataToActivity(\"MainActivity: ItemView clicked\");\n break;\n }\n }", "@Override\n\t\t\t\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\t\t\t\tMainActivity sct = (MainActivity) act;\n\t\t\t\t\t\t\t\t\tsct.onItemClick(posit2, 11);\n\t\t\t\t\t\t\t\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t\t\t}", "@Override\n public void onClick(View v) {\n listener.onItemClick(v, position);\n }", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\n\t}", "@Override\n public void onItemClick(View view, String data) {\n }", "abstract public void onSingleItemClick(View view);", "@Override\n public void onClick(View v) {\n this.itemClickListener.onItemClick(v, getLayoutPosition());\n }", "@Override\n public void itemClick(int pos) {\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {\n TextView textView = (TextView)view;\n switch(textView.getText().toString()){\n case \"NavBar\":\n Intent nav = new Intent(this, NavDrawerActivity.class);\n startActivity(nav);\n break;\n }\n\n //Toast.makeText(MainActivity.this,\"Go to \" + textView.getText().toString() + \" page.\",Toast.LENGTH_LONG).show();\n }", "@Override\r\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\r\n\t}", "@Override\n\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\tlong arg3) {\n\t\t\t\n\t\t}", "@Override\n public void onItemClick(Nson parent, View view, int position) {\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\t\t\t\t\tlong arg3) {\n\t\t\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t\t\n\t\t\t}", "@Override\n public void onClick(View view) {\n int position = getAdapterPosition();\n\n // Check if listener!=null bcz it is not guarantee that we'll call setOnItemClickListener\n // RecyclerView.NO_POSITION - Constant for -1, so that we don't click item at Invalid position (safety measure)\n if (listener != null && position != RecyclerView.NO_POSITION) {\n //listener.onItemClick(notes.get(position)); - used in RecyclerView.Adapter\n listener.onItemClick(getItem(position)); // getting data from superclass\n }\n }", "@Override\n public void onClick(View v) {\n itemClickListener.itemClicked(movieId, v);\n }", "@Override\n\t\tpublic void onClick(View view) {\n\t\t\tif (iOnItemClickListener != null) {\n\t\t\t\tiOnItemClickListener.onItemClick(view, null, getAdapterPosition());\n\t\t\t}\n\t\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t}", "public void onItemClick(View view, int position);", "@Override\n public void onClick(View v) {\n if (mListener != null){\n mListener.onItemClick(itemView, getLayoutPosition());\n }\n }", "@Override\n public void onItemClick(int position) {\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\titemClickListener.Callback(itemInfo);\n\t\n\t\t\t}", "@Override\n public void onItemClick(View view, int position) {\n }", "@Override\n public void onItemClick(View view, int position) {\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t}", "@Override\n public void onItemOfListClicked(Object o) {\n UserProfileFragmentDirections.ActionUserProfileFragmentToEventProfileFragment action = UserProfileFragmentDirections.actionUserProfileFragmentToEventProfileFragment((MyEvent) o);\n navController.navigate(action);\n }", "@Override\n public void onClick(View view) {\n if(mFrom.equals(NetConstants.BOOKMARK_IN_TAB)) {\n IntentUtil.openDetailActivity(holder.itemView.getContext(), NetConstants.G_BOOKMARK_DEFAULT,\n bean.getArticleUrl(), position, bean.getArticleId());\n }\n else {\n IntentUtil.openDetailActivity(holder.itemView.getContext(), mFrom,\n bean.getArticleUrl(), position, bean.getArticleId());\n }\n }", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_ds_note) {\n // Handle the camera action\n } else if (id == R.id.nav_ds_todo) {\n\n } else if (id == R.id.nav_ql_the) {\n\n } else if (id == R.id.nav_tuychinh) {\n Intent intent = new Intent(this, CustomActivity.class);\n startActivity(intent);\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n\t\t\t\t\t\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\t\t\t\t\t\tint position, long id) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}", "@Override\n public void onItemClick(View view, ListItem obj, int position) {\n }", "@Override\n\tpublic void onItemClick(Object o, int position) {\n\n\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\n\t\t\t}", "void onLinkClicked(@Nullable ContentId itemId);", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case R.id.home:\n Intent homeIntent = new Intent(this, MainActivity.class);\n startActivity(homeIntent);\n break;\n case R.id.send_email:\n Intent mailIntent = new Intent(this, ContactActivity.class);\n startActivity(mailIntent);\n break;\n case R.id.send_failure_ticket:\n Intent ticketIntent = new Intent(this, TicketActivity.class);\n startActivity(ticketIntent);\n break;\n case R.id.position:\n Intent positionIntent = new Intent(this, LocationActivity.class);\n startActivity(positionIntent);\n break;\n case R.id.author:\n UrlRedirect urlRed = new UrlRedirect(this.getApplicationContext(),getString(R.string.linkedinDeveloper));\n urlRed.redirect();\n break;\n default:\n break;\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout_main_activity);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@SuppressWarnings(\"ConstantConditions\")\n public void onItemClicked(@NonNull Item item) {\n getView().openDetail(item);\n }", "void onItemClick(View view, int position);", "@Override\n public void onClick(View v) {\n startNavigation();\n }", "void onItemClick(int position);", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(@NonNull MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_logs) {\n startActivity(new Intent(this, LogView.class));\n } else if (id == R.id.nav_signOut) {\n signOut();\n }\n\n DrawerLayout drawer = findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n public void onClick(View v) {\n if(listener!=null & getLayoutPosition()!=0)\n listener.onItemClick(itemView, getLayoutPosition());\n }", "@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position,\n\t\t\tlong id) {\n\t\tpresenter.onItemClicked(position);\n\t}", "@Override\n public void onClick(View view) {\n listener.onMenuButtonSelected(view.getId());\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t\tHashMap<String, Object> item = (HashMap<String, Object>) arg0\n\t\t\t\t\t\t.getAdapter().getItem(arg2);\n\n\t\t\t\tIntent intent = new Intent(ViewActivity.this,\n\t\t\t\t\t\tContentActivity.class);\n\t\t\t\tBundle bundle = new Bundle();\n\t\t\t\tbundle.putString(\"_id\", item.get(\"_id\").toString());\n\t\t\t\tbundle.putString(\"_CityEventID\", item.get(\"_CityEventID\")\n\t\t\t\t\t\t.toString());\n\t\t\t\tbundle.putString(\"_type\", String.valueOf(_type));\n\t\t\t\tintent.putExtras(bundle);\n\t\t\t\tstartActivity(intent);\n\t\t\t}", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onClick(View view) {\n Navigation.findNavController(view).navigate(R.id.addEventFragment);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Log.w(TAG , \"POSITION : \" + position);\n\n itemClick(position);\n }", "void clickItem(int uid);", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(@NonNull MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_categories) {\n Intent intent = new Intent(getApplicationContext(), CategoryActivity.class);\n startActivity(intent, compat.toBundle());\n newsHere.setSourceActivity(\"search\");\n newsHere.setTargetActivity(\"category\");\n\n } else if (id == R.id.nav_top_headlines) {\n newsHere.setSourceActivity(\"search\");\n newsHere.setTargetActivity(\"home\");\n Intent intent = new Intent(getApplicationContext(), HomeActivity.class);\n startActivity(intent, compat.toBundle());\n } else if (id == R.id.nav_search) {\n // Do nothing\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n public void onItemClick(View view, int position) {\n\n }", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_orders) {\n\n Intent orderStatusIntent = new Intent(Home.this , OrderStatus.class);\n startActivity(orderStatusIntent);\n\n } else if (id == R.id.nav_banner) {\n\n Intent bannerIntent = new Intent(Home.this , BannerActivity.class);\n startActivity(bannerIntent);\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n }", "public void onItemClick(View view, int position) {\n\n }", "@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n\t}", "@Override\r\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\r\n\t\t\t\t\tlong arg3) {\n\r\n\t\t\t}", "void onClick(View item, View widget, int position, int which);", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n\n\n }", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n Intent intent;\n switch(item.getItemId()){\n case R.id.nav_home:\n finish();\n intent = new Intent(this, NavigationActivity.class);\n startActivity(intent);\n return true;\n case R.id.nav_calendar:\n finish();\n intent = new Intent(this, EventHome.class);\n startActivity(intent);\n return true;\n case R.id.nav_discussion:\n return true;\n case R.id.nav_settings:\n intent = new Intent(this, SettingsActivity.class);\n startActivity(intent);\n return true;\n case R.id.nav_app_blocker:\n intent = new Intent(this, AppBlockingActivity.class);\n startActivity(intent);\n return true;\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n public boolean onNavigationItemSelected(@NonNull MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n\n case R.id.nav_home:\n break;\n\n case R.id.nav_favourites:\n\n if (User.getInstance().getUser() == null) {\n Intent intent = new Intent(getApplicationContext(), LoginActivity.class);\n startActivity(intent);\n }\n\n Intent intent = new Intent(getApplicationContext(), PlaceItemListActivity.class);\n startActivity(intent);\n\n break;\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tonRgtRgtMenuClick(v);\n\t\t\t}", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n Toast.makeText(this, \"gallery is clicked!\", Toast.LENGTH_LONG).show();\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "public void menuClicked(MenuItem menuItemSelected);", "@Override\n public void onItemClick(int position) {\n }", "@Override\n public void onItemClick(int position) {\n }", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_my_account) {\n startActivity(new Intent(this, MyAccountActivity.class));\n } else if (id == R.id.nav_message_inbox) {\n startActivity(new Intent(this, MessageInboxActivity.class));\n } else if (id == R.id.nav_view_offers) {\n //Do Nothing\n } else if (id == R.id.nav_create_listing) {\n startActivity(new Intent(this, CreateListingActivity.class));\n } else if (id == R.id.nav_view_listings) {\n startActivity(new Intent(this, ViewListingsActivity.class));\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\r\n\t\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\r\n\t\t\t\t\t\tint position, long id) {\n\t\t\t\t}" ]
[ "0.7882029", "0.7235578", "0.6987005", "0.69458413", "0.6917864", "0.6917864", "0.6883472", "0.6875181", "0.68681556", "0.6766498", "0.67418456", "0.67207", "0.6716157", "0.6713947", "0.6698189", "0.66980195", "0.66793925", "0.66624063", "0.66595167", "0.6646381", "0.6641224", "0.66243863", "0.6624042", "0.66207093", "0.6602551", "0.6602231", "0.6599443", "0.65987265", "0.65935796", "0.6585869", "0.658491", "0.65811735", "0.65765643", "0.65751576", "0.65694076", "0.6561757", "0.65582377", "0.65581614", "0.6552827", "0.6552827", "0.6549224", "0.65389794", "0.65345114", "0.65337104", "0.652419", "0.652419", "0.6522521", "0.652146", "0.6521068", "0.6519354", "0.65165275", "0.65159816", "0.65028816", "0.6498054", "0.6498054", "0.64969087", "0.64937705", "0.6488544", "0.64867324", "0.64866185", "0.64865905", "0.6484047", "0.6481108", "0.6474686", "0.64628965", "0.64551884", "0.6446893", "0.64436555", "0.64436555", "0.64436555", "0.64436555", "0.64436555", "0.64386237", "0.643595", "0.64356565", "0.64329195", "0.6432562", "0.6429554", "0.64255124", "0.64255124", "0.64121485", "0.64102405", "0.64095175", "0.64095175", "0.64094734", "0.640727", "0.64060104", "0.640229", "0.6397359", "0.6392996", "0.63921124", "0.63899696", "0.63885015", "0.63885015", "0.63873845", "0.6368818", "0.6368818", "0.63643163", "0.63643163", "0.63643163", "0.6358884" ]
0.0
-1
System.out.println("entrou no dao listar noticias");
public List<SiteNoticia> listarPorData() { List<SiteNoticia> result = new ArrayList<SiteNoticia>(); EntityManager em1 = getEM(); em1.getTransaction().begin(); CriteriaBuilder builder = em1.getCriteriaBuilder(); CriteriaQuery query = builder.createQuery(SiteNoticia.class); //EntityType type = em1.getMetamodel().entity(SiteNoticia.class); Root root = query.from(SiteNoticia.class); query.orderBy(builder.desc(root.get("hora2"))); result = em1.createQuery(query).getResultList(); em1.close(); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void listar()\n\t{\n\t\tdatabase.list().forEach(\n\t\t\t(entidade) -> { IO.println(entidade.print() + \"\\n\"); }\n\t\t);\n\t}", "public void executar() {\n\t\tSystem.out.println(dao.getListaPorNome(\"abacatão\"));\n\t}", "public void listarProvincia() {\n provincias = JPAFactoryDAO.getFactory().getProvinciaDAO().find();\n// for(int i=0;i<provincias.size();i++ ){\n// System.out.println(\"lista:\"+provincias.get(i).getNombreprovincia());\n// }\n }", "List<O> obtenertodos() throws DAOException;", "public String listar() {\n DocumentoVinculadoDAO documentoVinculadoDAO = new DocumentoVinculadoDAO();\n lista = documentoVinculadoDAO.listarStatus(1);\n return \"listar\";\n\n }", "public void consultarEditorialesDAO() {\n Collection<Editorial> editoriales = em.createQuery(\"SELECT e\"\n + \" FROM Editorial e\").getResultList();\n\n //Iteramos entre autores\n for (Editorial e : editoriales) {\n\n System.out.println(e.getNombre());\n\n }\n\n }", "public static boolean testDaoLirePraticien() {\n boolean ok = true; \n ArrayList<Praticien> lesPraticiens = new ArrayList<Praticien>();\n try {\n lesPraticiens = daoPraticien.getAll();\n } catch (Exception ex) {\n ok = false;\n }\n System.out.println(\"liste des praticiens\");\n for (Praticien unPraticien: lesPraticiens){\n System.out.println(unPraticien);\n }\n return ok;\n \n }", "public List<Usuario> listarUsuario() {\n \n List<Usuario> lista = usuarioDAO.findAll();\n return lista;\n \n \n\n }", "List<NotificacionInfo> findAll();", "public void listar() {\n\t\t\n\t}", "@Test\n public void testListarTudo() {\n System.out.println(\"listarTudo\");\n String cnpjCliente = \"\";\n ClassificacaoTributariaDAO instance = new ClassificacaoTributariaDAO();\n List<ClassificacaoTributaria> expResult = null;\n List<ClassificacaoTributaria> result = instance.listarTudo(cnpjCliente);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public static boolean testDaoLireLabo() {\n boolean ok = true;\n ArrayList<Labo> lesLabo = new ArrayList<Labo>();\n try {\n lesLabo = daoLabo.getAll();\n } catch (Exception ex) {\n ok = false;\n }\n System.out.println(\"liste des labos\");\n for (Labo unLabo: lesLabo){\n System.out.println(unLabo);\n }\n return ok;\n }", "public void llenarTabla(){\n pedidoMatDao.llenarTabla();\n }", "List<Persona> obtenerTodasLasPersona();", "public void listarProducto() {\n }", "public static void main(String[] args) {\n UsuarioDaoImp listar = new UsuarioDaoImp();\n List<Usuario> l = listar.listarUsuario();\n System.out.println(\"LISTA DE USUARIOS\");\n for (Usuario u : l) {\n \n System.out.println(\"------------------------\");\n System.out.println(\"Nombre: \" + u.getNombre());\n System.out.println(\"Apellido: \" + u.getApellido());\n System.out.println(\"Edad: \" + u.getEdad());\n }\n\n }", "List<Entidade> listarTodos();", "public List<Tipousr> findAllTipos(){\n\t\t List<Tipousr> listado;\n\t\t Query q;\n\t\t em.getTransaction().begin();\n\t\t q=em.createQuery(\"SELECT u FROM Tipousr u ORDER BY u.idTipousr\");\n\t\t listado= q.getResultList();\n\t\t em.getTransaction().commit();\n\t\t return listado;\n\t\t \n\t\t}", "public List<Producto> traerTodos () {\n \n return jpaProducto.findProductoEntities();\n \n \n \n }", "public void Listar() {\n try {\n ApelacionesDao apelacionesDao = new ApelacionesDao();\n this.listaApelaciones.clear();\n setListaApelaciones(apelacionesDao.cargaApelaciones());\n } catch (ExceptionConnection ex) {\n Logger.getLogger(ApelacionController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "void iniciarOperacion() throws DAOException;", "public static boolean testDaoLireOffrir() {\n boolean ok = true;\n ArrayList<Echantillon> lesEchantillons = new ArrayList<Echantillon>();\n try {\n lesEchantillons = daoOffrir.getAll();\n } catch (Exception ex) {\n ok = false;\n }\n System.out.println(\"liste des échantillons\");\n for (Echantillon unEchantillon: lesEchantillons){\n System.out.println(unEchantillon);\n }\n return ok;\n }", "public List<EspecieEntity> encontrarTodos(){\r\n Query todos =em.createQuery(\"select p from EspecieEntity p\");\r\n return todos.getResultList();\r\n }", "@Override\r\n public List<Assunto> buscarTodas() {\r\n EntityManager em = PersistenceUtil.getEntityManager();\r\n Query query = em.createQuery(\"FROM Assunto As a\");\r\n return query.getResultList();\r\n }", "public void afficherReclamationAdmin(ObservableList<Reclamation> oblist1){\n try {\n PreparedStatement pt1 = c.prepareStatement(\"SELECT id_r, message, etat, date_rec, reponse, prenom, nom FROM reclamation, user where idch=id_u and etat != 'Archivée'\");\n ResultSet rs = pt1.executeQuery();\n while (rs.next()) {\n String fetch = rs.getString(\"prenom\")+\" \"+rs.getString(\"nom\");\n System.out.println(rs.getString(\"reponse\"));\n oblist1.add(new Reclamation(rs.getInt(\"id_r\"), rs.getString(\"message\"), rs.getString(\"etat\"), rs.getString(\"date_rec\"), rs.getString(\"reponse\"), fetch));\n }\n } catch (SQLException ex) {\n Logger.getLogger(ReclamationCRUD.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void mostrarNotificaciones(){\n System.out.println(notificaciones.toString());\n }", "@Override\n\tpublic List<Nota> getListNotas(int userid)\n\t{\n\t\tList<Nota> listnotas= null; //new ArrayList<Usuario>();\n\t\tSession session = HibernateUtil.getSessionFactory().openSession();\n\t\tTransaction transaction = null;\n\t\ttry {\n\t\t\ttransaction = session.beginTransaction();\n\t\t\tlistnotas = session.createQuery(\"FROM Nota where Usuario_userid = '\" +userid+\"'\").list();\n \t\t\t\n\t\t\ttransaction.commit();\n\t\t\t\n\t\t} catch (HibernateException e) {\n\t\t\ttransaction.rollback();\n\t\t\te.printStackTrace();\n\t\t}\n\t\tint i = 0;\n\t\twhile(i<listnotas.size())\n\t\t{\n\t\t\tSystem.out.println(\"*\" + listnotas.get(i).getIdNota() );\n\t\t\ti++;\n\t\t}\n\t\treturn listnotas;\n\t}", "public void ouvrirListe(){\n\t\n}", "@Override\n public List<Paciente> listar(){\n EntityManagerFactory factory = Persistence.createEntityManagerFactory(\"vesaliusPU\"); \n EntityManager em = factory.createEntityManager();\n List<Paciente> listaPaciente = em.createQuery(\"SELECT pac FROM Paciente pac\").getResultList(); \n em.close();\n factory.close();\n return (listaPaciente);\n }", "public List<Usuarios> getUsuarios(){ //retorna una lista con todos los Usuarios en la database\n List<Usuarios> listaUsuarios = new ArrayList<Usuarios>();\n conexion = base.GetConnection();\n try{\n String consulta = \"select Cedula from usuarios\";\n PreparedStatement select = conexion.prepareStatement(consulta);\n boolean r = select.execute();\n if(r){\n ResultSet result = select.getResultSet();\n while(result.next()){\n Usuarios usuario = new Usuarios(result.getString(1));\n System.out.println(usuario);\n listaUsuarios.add(usuario);\n }\n result.close();\n }\n conexion.close();\n }catch(SQLException ex){\n System.out.println(ex.toString());\n }\n return listaUsuarios;\n}", "public List<Tutores> readAllJPQL() throws SecurityException{ \n String sql=\"Select tu from Tutores tu\";\n \n Query q=em.createQuery(sql); \n return q.getResultList();\n }", "private static void getListTest() {\n\t\tList<CartVo> list=new CartDao().getList();\r\n\t\t\r\n\t\tfor(CartVo cartVo : list) {\r\n\t\t\tSystem.out.println(cartVo);\r\n\t\t}\r\n\t}", "@Override\n public List<Caja> buscarMovimientos(){\n List<Caja> listaCaja= cajaRepository.findAll();\n\n return listaCaja;\n\n }", "public ArrayList<Note> pedirTodasLasNotas(){\n ArrayList<Note> todasLasNotas = new ArrayList<>();\n Note nota;\n HashMap<Integer,String> misNotas = new HashMap<Integer,String>();\n ArrayList<String> tituloTratamiento = new ArrayList<String>();\n String[] campos = {\"_id\",\"titulo\",\"fecha\"};\n Cursor c = db.query(\"nota\",campos,null,null,null,null,null);\n if(c.moveToFirst()){\n\n do{\n nota = new Note();\n nota.setId(c.getInt(0));\n nota.setTitulo(c.getString(1));\n nota.setFechaFormateada(c.getString(2));\n todasLasNotas.add(nota);\n }while(c.moveToNext());\n return todasLasNotas;\n }\n\n return todasLasNotas;\n\n }", "@Test\r\n public void testListarTodos() throws Exception {\r\n limpar();\r\n tx.begin();\r\n Categoria categoria1 = new Categoria(\"Teste categoria1\");\r\n Categoria categoria2 = new Categoria(\"Teste categoria2\");\r\n Categoria categoria3 = new Categoria(\"Teste categoria3\");\r\n dao.persiste(categoria1);\r\n dao.persiste(categoria2);\r\n dao.persiste(categoria3);\r\n tx.commit();\r\n List<Categoria> expResult = dao.listarTodos();\r\n //List<Categoria> result = instance.listarTodos();\r\n //assertEquals(expResult, result);\r\n // TODO review the generated test code and remove the default call to fail.\r\n for(Categoria c:expResult){\r\n System.out.println(c.getId() + \" \" + c.getNome());\r\n }\r\n assertEquals(3, expResult.size());\r\n }", "public abstract List<GnNotaria> getAllGnNotaria() throws Exception;", "@Test\n void getAllNotesSuccess() {\n List<Note> notes = noteDao.getAll();\n assertEquals(2, notes.size());\n }", "public void listNens() {\n\t\t\tEntityManager em = emf.createEntityManager();\n\t\t\tem.getTransaction().begin();\n\t\t\tList<Nen> result = em.createQuery(\"from nen\", Nen.class)\n\t\t\t\t\t.getResultList();\n\t\t\tfor (Nen a : result) {\n\t\t\t\tSystem.out.println(a.toString());\n\t\t\t}\n\t\t\tem.getTransaction().commit();\n\t\t\tem.close();\t\n\t\t}", "public static void main(String[] args) {\n EntityManager gerenciador = JPAUtil.getGerenciador();\r\n\r\n //Criando a consulta ao BD\r\n TypedQuery<FilmeAtor> consulta = gerenciador.createQuery(\r\n \"SELECT new dados.dto.FilmeAtor(f, a) FROM Filme f JOIN f.atores a where f.nome = 'Les' OR a.nome = 'Les'\",\r\n FilmeAtor.class);\r\n\r\n System.out.println(\"Realizando a consulta\");\r\n List<FilmeAtor> lista = consulta.getResultList();\r\n System.out.println(\"Teste\");\r\n \r\n \r\n /*System.out.println(\"Tamanho da lista\");\r\n System.out.println(lista.size());\r\n \r\n \r\n for(Filme f : lista){\r\n System.out.println(f.getNome());\r\n System.out.println(f.getId());\r\n System.out.println(f.getAtores().size());\r\n }*/\r\n \r\n }", "@Override\n\tpublic List<Paciente> listar() {\n\t\treturn dao.findAll();\n\t}", "@Test\n\t \t\n\t public void listAll() {\n\t \n\t List<Persona> list = personaDao.listPersons();\n\t \n\t Assert.assertNotNull(\"Error listado\", list);\n\n\t }", "private void getinterrogantes(){\n try{\n EntityManagerFactory emf = Persistence.createEntityManagerFactory(\"ServiceQualificationPU\");\n EntityManager em = emf.createEntityManager();\n\n String jpql = \"SELECT i FROM Interrogante i \"\n + \"WHERE i.estado='a' \";\n\n Query query = em.createQuery(jpql);\n List<Interrogante> listInterrogantes = query.getResultList();\n\n ArrayList<ListQuestion> arrayListQuestions = new ArrayList<>();\n for (Interrogante i : listInterrogantes){\n ListQuestion lq = new ListQuestion();\n lq.setIdinterrogante(i.getIdinterrogante());\n lq.setQuestion(i.getDescripcion());\n lq.setListParametros(getParametros(i.getIdinterrogante()));\n arrayListQuestions.add(lq);\n }\n\n this.ListQuestions = arrayListQuestions;\n em.close();\n emf.close();\n }catch(Exception e){\n System.out.println(\"ERROR: \"+e);\n this.Error = \"ERROR: \"+e;\n } \n \n }", "public String borra() { \n clienteDAO.borra(c.getId());\n return \"listado\";\n }", "List<Horario_Disponible> findAll();", "public void ConsultaVehiculosSQlite() {\n preguntas = mydb.getCartList();\n for( int i = 0 ; i < preguntas.size() ; i++ ){\n //Toast.makeText(getApplicationContext(), preguntas.get( i ).getPregunta(), Toast.LENGTH_SHORT).show();\n persons.add(new Solicitud(\"Pregunta \" + String.valueOf(i+1) +\": \"+preguntas.get( i ).getPregunta(),\"Fecha: \"+ preguntas.get( i ).getFecha(), R.drawable.solicitudes,\"Motivo: \"+preguntas.get( i ).getMotivo(),\"Observacion: \"+preguntas.get( i ).getObservacion(),\"\"));\n }\n }", "@Override\r\n public List<Prova> consultarTodosProva() throws Exception {\n return rnProva.consultarTodos();\r\n }", "@Test\n public void retriveAllTest() throws SQLException {\n manager = new TableServizioManager(mockDb);\n List<Servizio> lista = manager.retriveAll();\n assertEquals(7,lista.size(),\"It should return a list of length 7\");\n }", "public static void main(String[] args) throws SQLException {\n\t\n\t\tDocumentDAO y = new DocumentDAO();\n\tObservableList<Document> listeDoc= (new DocumentDAO()).findall();\n\tSystem.out.println(listeDoc.get(0));\n\t\t\n\t\t//VisiteurDAO v = new VisiteurDAO();\n\t//<Visiteur> idVisiteur = v.findById(\"a131\");\n\t\t\n\t\n\t\n\t}", "public interface LogNotificacionDao extends GenericDao<LogNotificacion, Integer> {\n}", "@Test\r\n public void testGGetContratistas() {\r\n System.out.println(\"getContratistas\");\r\n \r\n UsuarioDao instance = new UsuarioDao();\r\n List<Usuario> result = instance.getContratistas();\r\n \r\n assertFalse(result.isEmpty());\r\n }", "public String borra(Cliente cliente) {\n clienteDAO.borra(cliente.getId());\n return \"listado\";\n }", "public interface FakturaTekstVDAO extends DAO<FakturaTekstV> {\r\n\t/**\r\n\t * Finner tekster tilhørende faktura\r\n\t * \r\n\t * @param fakturaId\r\n\t * @return tekster\r\n\t */\r\n\tList<FakturaTekstV> findByFakturaId(Integer fakturaId);\r\n}", "public List display(FeedbackVO vo1) {\nList l1 = new ArrayList();\r\n\t\t\r\n\t\ttry{\r\n\t\tSessionFactory sessionFactory=new Configuration().configure().buildSessionFactory();\r\n\t\tSession session =sessionFactory.openSession();\r\n\t\t\r\n\t\tQuery q=session.createQuery(\"from FeedbackVO\");\r\n\t\tl1=q.list();\r\n\t\t\r\n\t\tSystem.out.println(\"done??\");\r\n\t\t\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 l1;\r\n\t}", "@Override\r\npublic List<Map<String, Object>> readAll() {\n\treturn detalle_pedidoDao.realAll();\r\n}", "public void mostrarLista(){\n Nodo recorrer = inicio;\n while(recorrer!=null){\n System.out.print(\"[\"+recorrer.edad+\"]-->\");\n recorrer=recorrer.siguiente;\n }\n System.out.println(recorrer);\n }", "@Override\r\n public List<QuestaoDiscursiva> consultarTodosQuestaoDiscursiva()\r\n throws Exception {\n return rnQuestaoDiscursiva.consultarTodos();\r\n }", "@Test\n\tpublic void testGetLista() throws Exception {\n\t\tSystem.out.println(\"getLista\");\n\t\tso.execute(entity);\n\t\tList<IGeneralEntity> expResult = ((TakeTrucksOperation) so).getLista();\n\t\tList<IGeneralEntity> result = so.db.vratiSve(entity);\n\n\t\tassertEquals(expResult.size(), result.size());\n\t}", "@SuppressWarnings(\"unchecked\")\t\r\n\t@Override\r\n\tpublic List<Distrito> listar() {\n\t\tList<Distrito> lista = new ArrayList<Distrito>();\r\n\t\tQuery q = em.createQuery(\"select m from Distrito m\");\r\n\t\tlista = (List<Distrito>) q.getResultList();\r\n\t\treturn lista;\r\n\t}", "public List<PokemonEntity> findAll() {\n LOGGER.log(Level.INFO, \"Consultando todas los trayectos\");\n // Se crea un query para buscar todas las ciudades en la base de datos.\n TypedQuery query = em.createQuery(\"select u from PokemonEntity u\", PokemonEntity.class);\n // Note que en el query se hace uso del método getResultList() que obtiene una lista de ciudades.\n return query.getResultList();\n}", "public List<TipoDocumento> listar() throws SQLException{\n ArrayList<TipoDocumento> tipodocumentos = new ArrayList();\n TipoDocumento tipodocumento;\n ResultSet resultado;\n String sentenciaSQL = \"SELECT documentoid, descripcion FROM tipodocumento;\";\n \n resultado = gestorJDBC.ejecutarConsulta(sentenciaSQL);\n while(resultado.next()){ \n //para hacer \"new Genero\" necesito tener un Construtor vacio.\n tipodocumento = new TipoDocumento();\n tipodocumento.setTipodocumentoid(resultado.getInt(\"documentoid\"));\n tipodocumento.setDescripcion(resultado.getString(\"descripcion\"));\n tipodocumentos.add(tipodocumento);\n }\n resultado.close();\n return tipodocumentos; \n }", "public List<Calificar> list_comentarios(String nombre){\n List<Calificar> comentarios = null;\n\n Session session = sessionFactory.openSession();\n Transaction tx = null;\n\n try{\n\n tx = session.beginTransaction();\n String hql = \"from Calificar c where c.puesto.idNombre = :puesto\";\n Query query = session.createQuery(hql);\n query.setParameter(\"puesto\", nombre);\n comentarios = (List<Calificar>)query.list();\n tx.commit();\n\n } catch (Exception e) {\n if (tx != null) {\n tx.rollback();\n }\n e.printStackTrace();\n } finally {\n session.close();\n }\n\n return comentarios;\n }", "List<ParqueaderoEntidad> listar();", "private void listar() throws Exception{\n int resId=1;\n List<PlatoDia> lista = this.servicioRestaurante.listarMenuDia(resId);\n this.modelListEspecial.clear();\n lista.forEach(lse -> {\n this.modelListEspecial.addElement(\"ID: \" + lse.getId() \n + \" NOMBRE: \" + lse.getNombre()\n + \" DESCRIPCION: \" + lse.getDescripcion()\n + \" PRECIO: \" + lse.getPrecio()\n + \" ENTRADA: \"+lse.getEntrada() \n + \" PRINCIPIO: \"+lse.getPrincipio()\n + \" CARNE: \"+lse.getCarne()\n + \" BEBIDA: \"+lse.getBebida()\n + \" DIA: \"+lse.getDiaSemana());\n });\n }", "@Override\n\n public void run(String... strings) throws Exception {\n \n Usuario u= new Usuario(1521L, \"Viridiana Hernandez\",\"ndzmviridiana@hotmail.com\");\n \n //la guardamos\n \n // repoUsu.save(u);\n \n //GENERAMOS LA DIRECCION QUE VAMOS A GUARDAR\n \n Direccion d = new Direccion(new Usuario(1521L),\"Calle 13\", 55120, \"Ecatepec\");\n //repoDir.save(d);\n \n \n //AQUI HAREMOS EL JOIN\n \n \n Direccion d2= repoDir.findOne(2L);\n System.out.println(\"Correo:\"+d2.getU().getEmail()+ \" municipio \"+d2.getMunicipio());\n \n \n \n \n \n \n //repoMensa.save (new Mensajito(\"Primero\",\"Mi primera vez con hibernate\"))\n /*\n Mensajito m= repoMensa.findOne(1);\n System.out.println(m.getTitulo());\n \n \n \n // repoMensa.save(new Mensajito(\"17 de octubre\",\"No temblo\"));\n System.out.println(\"vamos a uscar todos\");\n \n for (Mensajito mensa:repoMensa.findAll()){\n System.out.println(mensa);\n \n }\n \n //para buscar por id FINDONE\n System.out.println(\"vamos a buscar por id\");\n System.out.println(repoMensa.findOne(1));\n \n \n // Actualizar \n repoMensa.save(new Mensajito(1,\"nuevo titulo\",\"nuevo cuerpo\"));\n System.out.println(repoMensa.findOne(1));\n*/\n }", "private void listaContatos() throws SQLException {\n limpaCampos();\n BdLivro d = new BdLivro();\n livros = d.getLista(\"%\" + jTPesquisar.getText() + \"%\");\n\n // Após pesquisar os contatos, executa o método p/ exibir o resultado na tabela pesquisa\n mostraPesquisa(livros);\n livros.clear();\n }", "private void getPlayerList(){\r\n\r\n PlayerDAO playerDAO = new PlayerDAO(Statistics.this);\r\n players = playerDAO.readListofPlayerNameswDefaultFirst();\r\n\r\n }", "List<Plaza> consultarPlazas();", "public static boolean testDaoLireMedicament() {\n boolean ok = true;\n ArrayList<Medicament> lesMedicaments = new ArrayList<Medicament>();\n try {\n lesMedicaments = daoMedicament.getAll();\n } catch (Exception ex) {\n ok = false;\n }\n System.out.println(\"liste des medicaments\");\n for (Medicament unMedicament: lesMedicaments){\n System.out.println(unMedicament);\n }\n return ok;\n }", "@Override\n public Retorno_MsgObj obtenerLista() {\n PerManejador perManager = new PerManejador();\n\n return perManager.obtenerLista(\"Inscripcion.findAll\", null);\n }", "public static boolean testDaoLireVisiteur() {\n boolean ok = true;\n ArrayList<Visiteur> lesVisiteurs = new ArrayList<Visiteur>();\n try {\n lesVisiteurs = daoVisiteur.getAll();\n } catch (Exception ex) {\n ok = false;\n }\n System.out.println(\"liste des visiteurs\");\n for (Visiteur unVisiteur: lesVisiteurs){\n System.out.println(unVisiteur);\n }\n return ok;\n }", "private List<Produto> retornaProduto (Long cod){\n \n Query q = entityManager.createNamedQuery(\"Produto.findByCodigo\");\n q.setParameter(\"codigo\", cod);\n List <Produto> p = q.getResultList();\n return p; \n}", "@Test\n public void testConsultarTodos() throws Exception {\n System.out.println(\"testConsultarTodos\");\n List<ConfiguracaoTransferencia> result = instance.findAll();\n assertTrue(result != null && result.size() > 0);\n }", "Jugador consultarGanador();", "public void iniciarProduccion(){\n try {\n Connection conn = Conectar.conectar();\n Statement st = conn.createStatement();\n ResultSet rs = st.executeQuery(\"select nick from usuarios where nick in(select usuario from construcciones) or nick \"\n +\"in(select usuario from investigaciones) or nick in(select usuario from movimientos)\");\n\n while(rs.next()){\n produccion.add(new Construcciones(rs.getString(1)));\n System.out.println(rs.getString(1));\n }\n\n st.close();\n rs.close();\n conn.close();\n\n }catch(SQLException e){\n System.out.println(\"Fallo actualizacion de produccion.\");\n }\n}", "public void consultarListaDeContatos() {\n\t\tfor (int i = 0; i < listaDeContatos.size(); i++) {\n\t\t\tSystem.out.printf(\"%d %s \\n\", i, listaDeContatos.get(i));\n\t\t}\n\t}", "public void listarAlunosNaDisciplina(){\r\n for(int i = 0;i<alunos.size();i++){\r\n System.out.println(alunos.get(i).getNome());\r\n }\r\n }", "public static void main(String[] args) {\n\t\t\n\t\ttry {\n//\t\t\tSystem.out.println(new VoluntarioDAO().consultarVoluntario(27).getAll());\n//\t\t\tSystem.out.println(\"----------------------------------------------\");\n//\t\t\tSystem.out.println(VoluntarioBO.consultarVoluntario(28).getAll());\n//\t\t\t\n//\t\tSystem.out.println(new VoluntarioDAO().gravarVoluntario(new Voluntario(1744,\n////\t\t\t\t\"anjosHenry\", \"henryAnjos@henryanjos.com\", \"12/01/1985\", \"HenryAnjos\", \"anjos\", 3, \"c:/windwos\", \"masculino\", 1744, \"23082342J\", 123123123, \"psicologia\", \"noturno\", \"chato\", 272188991)));\t\n//\t\t\n//\t\t\tSystem.out.println(VoluntarioBO.novoVoluntario((new Voluntario(1944,\n\t//\t\t\t\t\"anjosHenry\", \"asdfasfd@asfdasf.com\", \"12/01/1985\", \"loginss\", \"anjos\", 3, \"c:/windwos\", \"masculino\", 1744, \"23082342JK\", 1231231323, \"psicologia\", \"noturno\", \"chato\", 272188991))));\t\n\n\t//\t\tSystem.out.println(VoluntarioBO.excluirVoluntario(28));\n//\tSystem.out.println(new VoluntarioDAO().alterarDadosVoluntario(new Voluntario(23,\n\t//\t\t\t\t\t\t\"anjosHenry\", \"asdfasfd@asfdasf.com\", \"12/01/1985\", \"loginss\", \"anjos\", 3, \"c:/windwos\", \"masculino\", \"230823K\", 1231231323, \"psicologia\", \"noturno\", \"chato\", 272188991)));\t\n\n\t//\tSystem.out.println(VoluntarioBO.pesquisarVoluntario(23).getAll());\n\t//\tSystem.out.println(\"---------------------------------\");\n\t//\tSystem.out.println(PacienteBO.pesquisarPaciente(4).getAll());\n\t\t\n\t\tSystem.out.println(\"================================\");\n\t\tList<Voluntario> voluntarios = new ArrayList<Voluntario>();\n\t\tvoluntarios = VoluntarioBO.pesquisarVoluntarioTemporarios();\n\t\tfor(Voluntario voluntario : voluntarios) {\n\t\t\tSystem.out.println(voluntario.getAll());\n\t\t}\n\t\n\t\n\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(Excecao.tratarExcecao(e));\n\t\t}\n\n\t}", "Tablero consultarTablero();", "public static void testEmprunt() throws DaoException {\r\n EmpruntDao empruntDao = EmpruntDaoImpl.getInstance();\r\n LivreDao livreDao = LivreDaoImpl.getInstance();\r\n MembreDao membreDao = MembreDaoImpl.getInstance();\r\n\r\n List<Emprunt> list = new ArrayList<Emprunt>();\r\n list = empruntDao.getList();\r\n System.out.println(\"\\n 'Emprunts' list: \" + list);\r\n\r\n list = empruntDao.getListCurrent();\r\n System.out.println(\"\\n Current 'Emprunts' list: \" + list);\r\n\r\n list = empruntDao.getListCurrentByMembre(5);\r\n System.out.println(\"\\n Current 'Emprunts' list by member: \" + list);\r\n\r\n list = empruntDao.getListCurrentByLivre(3);\r\n System.out.println(\"\\n Current 'Emprunts' list by book: \" + list);\r\n\r\n Emprunt test = empruntDao.getById(5);\r\n System.out.println(\"\\n Selected 'Emprunt' : \" + test);\r\n\r\n empruntDao.create(1, 4, LocalDate.now());\r\n list = empruntDao.getList();\r\n System.out.println(\"\\n List updated with one creation: \" + list);\r\n\r\n\r\n int id_book = livreDao.create(\"My Book\", \"My Autor\", \"123456\");\r\n Livre test_livre = new Livre();\r\n test_livre = livreDao.getById(id_book);\r\n int idMember = membreDao.create(\"Rodrigues\", \"Henrique\", \"ENSTA\", \"henrique@email.fr\", \"+33071234567\", Abonnement.VIP);\r\n Membre test_membre = new Membre();\r\n test_membre = membreDao.getById(idMember);\r\n test = new Emprunt(2, test_membre, test_livre, LocalDate.now(), LocalDate.now().plusDays(60));\r\n empruntDao.update(test);\r\n list = empruntDao.getList();\r\n System.out.println(\"\\n List updated: \" + list);\r\n //System.out.println(\"\\n \" + test_livre.getId() + \" \" + test_membre.getId());\r\n\r\n\r\n int total = empruntDao.count();\r\n System.out.println(\"\\n Number of 'emprunts' in DB : \" + total);\r\n\r\n }", "public static List<Comentario> listar()\n {\n Session sessionRecheio;\n sessionRecheio = HibernateUtil.getSession();\n Transaction tr = sessionRecheio.beginTransaction();\n String hql = \"from Comentario u\";\n List<Comentario> lista = (List)sessionRecheio.createQuery(hql).list();\n tr.commit();\n return lista;\n }", "public void Found_project_from_DATABASE(int id){\n print_pro();\n// return project;\n }", "public List listar() {\n Query query = Database.manager.createNamedQuery(\"StatussistemaDTO.findAll\");\n query.setHint(QueryHints.MAINTAIN_CACHE, HintValues.FALSE);// evita consulta em cache\n List lista = query.getResultList();\n return lista;\n }", "public interface PreguntaDao {\n\n\t/** Devuelve las preguntas mas recientes, ordenadas desde la mas reciente hacia la mas antigua.\n\t * @param page La pagina de preguntas (comienza de la 1)\n\t * @param pageSize El numero de resultados a devolver por pagina. */\n\tpublic List<Pregunta> getPreguntasRecientes(int page, int pageSize);\n\n\t/** Devuelve las preguntas hechas por el usuario indicado. */\n\tpublic List<Pregunta> getPreguntasUsuario(Usuario user);\n\n\t/** Devuelve las preguntas que contienen el tag especificado. */\n\tpublic List<Pregunta> getPreguntasConTag(TagPregunta tag);\n\n\t/** Devuelve todas las preguntas que tengan al menos uno de los tags especificados. */\n\tpublic List<Pregunta> getPreguntasConTags(Set<TagPregunta> tags);\n\n\t/** Devuelve las preguntas que contienen el tag especificado. */\n\tpublic List<Pregunta> getPreguntasConTag(String tag);\n\n\t/** Devuelve los tags mas utilizados en preguntas.\n\t * @param limit El numero maximo de tags a devolver. */\n\tpublic List<TagPregunta> getTagsPopulares(int limit);\n\n\t/** Devuelve la pregunta con el id especificado. */\n\tpublic Pregunta getPregunta(int id);\n\n\t/** Devuelve las respuestas a la pregunta especificada.\n\t * @param pageSize El numero maximo de preguntas a devolver.\n\t * @param page El numero de pagina a devolver (la primera pagina es 1)\n\t * @param crono Indica si se deben ordenar las respuestas en orden cronologico, en vez de por votos\n\t * (default es por votos). */\n\tpublic List<Respuesta> getRespuestas(Pregunta q, int pageSize, int page, boolean crono);\n\n\t/** Devuelve la lista de preguntas con mas votos positivos.\n\t * @param limit El numero maximo de preguntas a devolver. */\n\tpublic List<Pregunta> getPreguntasMasVotadas(int limit);\n\n\t/** Devuelve la lista de preguntas que no tienen ni una sola respuesta. */\n\tpublic List<Pregunta> getPreguntasSinResponder(int limit);\n\n\t/** Devuelve la lista de preguntas cuyo autor no ha elegido una respuesta. */\n\tpublic List<Pregunta> getPreguntasSinResolver(int limit);\n\n\t/** Registra un voto que un usuario hace a una pregunta.\n\t * @param user El usuario que hace el voto\n\t * @param pregunta La pregunta a la cual se aplica el voto\n\t * @param up Indica si el voto es positivo (true) o negativo (false).\n\t * @throws PrivilegioInsuficienteException si el usuario no tiene reputacion suficiente para dar un voto negativo. */\n\tpublic VotoPregunta vota(Usuario user, Pregunta pregunta, boolean up) throws PrivilegioInsuficienteException;\n\n\t/** Registra un voto que un usuario hace a una respuesta que se hizo a una pregunta.\n\t * @param user El usuario que hace el voto.\n\t * @param resp La respuesta a la cual se aplica el voto.\n\t * @param up Indica si el voto es positivo (true) o negativo (false).\n\t * @throws PrivilegioInsuficienteException si el usuario no tiene reputacion suficiente para dar un voto negativo. */\n\tpublic VotoRespuesta vota(Usuario user, Respuesta resp, boolean up) throws PrivilegioInsuficienteException;\n\n\t/** Busca y devuelve el voto realizado por el usuario indicado a la pregunta especificada, si es que existe. */\n\tpublic VotoPregunta findVoto(Usuario user, Pregunta pregunta);\n\n\t/** Busca y devuelve el voto hecho por el usuario indicado a la respuesta especificada, si es que existe. */\n\tpublic VotoRespuesta findVoto(Usuario user, Respuesta respuesta);\n\n\tpublic void insert(Pregunta p);\n\n\tpublic void update(Pregunta p);\n\n\tpublic void delete(Pregunta p);\n\n\t/** Crea una respuesta con el texto especificado, para la pregunta especificada, por el autor especificado.\n\t * @return La respuesta recien creada. */\n\tpublic Respuesta addRespuesta(String resp, Pregunta p, Usuario autor);\n\n\t/** Agrega un comentario a la pregunta especificada, a nombre del usuario especificado. */\n\tpublic ComentPregunta addComentario(String c, Pregunta p, Usuario autor);\n\n\t/** Agrega un comentario a la respuesta especificada, a nombre del usuario especificado. */\n\tpublic ComentRespuesta addComentario(String c, Respuesta r, Usuario autor);\n\n\t/** Agrega el tag especificado a la pregunta. Primero se busca el tag existente para relacionarlo con la\n\t * pregunta, pero si no existe, se crea uno nuevo. */\n\tpublic void addTag(String tag, Pregunta p);\n\n\t/** Devuelve una lista con tags que contengan el texto parcial especificado. */\n\tpublic List<TagPregunta> findMatchingTags(String parcial);\n\n}", "private void listaContatos() throws SQLException {\n limpaCampos();\n DAOLivro d = new DAOLivro();\n livros = d.getLista(\"%\" + jTPesquisar.getText() + \"%\"); \n \n // Após pesquisar os contatos, executa o método p/ exibir o resultado na tabela pesquisa\n mostraPesquisa(livros);\n livros.clear();\n }", "public interface TProvinciasDAO {\n\t\n\tpublic ArrayList<TProvinciasBean> obtenerProvincias(String codigoDepartamento) throws DataAccessException;\n\t\n}", "private static void getListTest(int no) {\n\t\tList<CartVo> list=new CartDao().getList(no);\r\n\t\t\r\n\t\tfor(CartVo cartVo : list) {\r\n\t\t\tSystem.out.println(cartVo);\r\n\t\t}\r\n\t}", "public List<Permiso> obtenerTodosActivos();", "public static void main(String[] args) {\n\t\tEntityManagerFactory fabrica = Persistence.createEntityManagerFactory(\"mysql\");\n\t\t// 2. crea el manejador de entidades\n\t\tEntityManager em = fabrica.createEntityManager();\n\t\t\n\t\t//--proceso:obtener listar usuario\n\t\tSystem.out.println(\"Listado de los usuarios\");\n\t\t\n\t\tString sql=\"select u from Usuario u\";//JPA u.codigo, u.etc\n\t\t\n\t\tList<Usuario>lstUsuario = em.createQuery(sql,Usuario.class).getResultList();\n\t\t\n\t\tSystem.out.println(\"Cantidad de usuarios: \"+ lstUsuario.size());//para ver cantidad\n\t\t//para imprimir en consola el listado\n\t\tfor(Usuario u:lstUsuario) {\n\t\t\tSystem.out.println(\">>> \"+u);\n\t\t}\n\t\t\n\t\t/////////////////listado por tipo (where)////////////////////////\n\t\tSystem.out.println(\"Listado de los usuarios por tipo\");\n\t\t\n\t\tString sql2=\"select u from Usuario u where u.tipo= :xtipo\";//JPA se usa la variable de la clase y se setea una variable con setParameter\n\t\t\n\t\tTypedQuery<Usuario> query = em.createQuery(sql2,Usuario.class);//para setear varias variables en listar\n\t\tquery.setParameter(\"xtipo\", 1);\n\t\tList<Usuario>lstUsuarioxtipo = query.getResultList();\n\t\t\n\t\tSystem.out.println(\"Cantidad de usuarios: \"+ lstUsuarioxtipo.size());//para ver cantidad\n\t\t//para imprimir en consola el listado\n\t\tfor(Usuario u:lstUsuarioxtipo) {\n\t\t\tSystem.out.println(\">>> \"+u);\n\t\t}\n\t\tem.close();\n\t\t\n\t}", "public interface IdeaCommentDao extends GenericDao<IdeaComment, Long>{\n\n\tList<IdeaComment> findIdeaCommentList(String ideaId);\n\n}", "@Test\r\n @Ignore\r\n public void testFindPaciente() {\r\n System.out.println(\"findPaciente\");\r\n String termo = \"\";\r\n EnfermeiroDaoImpl instance = new EnfermeiroDaoImpl();\r\n List<Enfermeiro> expResult = null;\r\n List<Enfermeiro> result = instance.findPaciente(termo);\r\n assertEquals(expResult, result);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }", "public void listar(){\n if (!esVacia()) {\n // Crea una copia de la lista.\n NodoEmpleado aux = inicio;\n // Posicion de los elementos de la lista.\n int i = 0;\n System.out.print(\"-> \");\n // Recorre la lista hasta llegar nuevamente al incio de la lista.\n do{\n // Imprime en pantalla el valor del nodo.\n System.out.print(i + \".[ \" + aux.getEmpleado() + \" ]\" + \" -> \");\n // Avanza al siguiente nodo.\n aux = aux.getSiguiente();\n // Incrementa el contador de la posi�n.\n i++;\n }while(aux != inicio);\n }\n }", "@Override\n\tpublic void mostrarDados() {\n\t\t\n\t}", "@Override\n public List<Venda> listar() {\n String sql = \"SELECT v FROM venda v\";\n TypedQuery<Venda> query = em.createQuery(sql, Venda.class);\n List<Venda> resultList = query.getResultList();\n\n return resultList;\n }", "@Test\n\tpublic void testConsultarTodos() {\n\t\tList<Dispositivo> dispositivos = new ArrayList<Dispositivo>();\n\t\ttry {\n\t\t\tdispositivos = dispositivoBL.consultarTodos();\n\t\t\tassertTrue(dispositivos.size() > 0);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\r\n\tpublic List<ServicesDto> list() {\r\n\t\treturn sessionFactory.getCurrentSession().createQuery(\"FROM ServicesDto WHERE active = TRUE\").list();\r\n}", "@Query(\"SELECT * FROM \" + TABLE_NAME)\n List<Note> getNotes();", "@Test\n public void test3FindAll() {\n SpecialityFactory factory = new MysqlSpecialityDAOFactry();\n SpecialityDAO dao = factory.create();\n List<SpecialityDTO> lista=(List<SpecialityDTO>)dao.findAll(); \n System.out.println(lista);\n assertTrue(!lista.isEmpty());\n }", "@Override\n\t@Transactional(readOnly=true)\n\tpublic List<Interesado> findByConsumidor(Consumidor consumidor) { \n\t\tSystem.out.println(\"entro2\");\n\t\treturn interesadoDao.findByConsumidor(consumidor); \n\t}", "public List<GoleadoresDTO> listarTodo(int idTorneo,Connection conexion) throws MiExcepcion {\n ArrayList<GoleadoresDTO> listarGoleadores = new ArrayList();\n\n try {\n String query = \"SELECT DISTINCT usuarios.primerNombre, \" +\n\" usuarios.primerApellido, tablagoleadores.numeroGoles, tablagoleadores.idEquipo, \"+ \n\" tablagoleadores.idTorneo,tablagoleadores.idJugador, \" +\n\" equipo.nombre \" +\n\" FROM tablagoleadores \" +\n\" INNER JOIN jugadoresporequipo \" +\n\" ON tablagoleadores.idJugador = jugadoresporequipo.codigoJugador \" +\n\" INNER JOIN usuarios \" +\n\" ON jugadoresporequipo.codigoJugador = usuarios.idUsuario \" +\n\" INNER JOIN equiposdeltorneo \" +\n\" ON tablagoleadores.idEquipo = equiposdeltorneo.equipoCodigo \" +\n\" INNER JOIN equipo \" +\n\" ON equiposdeltorneo.equipoCodigo = equipo.codigo \" +\n\" INNER JOIN torneo \" +\n\" ON tablagoleadores.idTorneo = torneo.idTorneo \" +\n\" WHERE tablagoleadores.idTorneo = ? \" +\n\" AND equiposdeltorneo.torneoIdTorneo=? \" +\n\" ORDER BY numeroGoles DESC\";\n statement = conexion.prepareStatement(query);\n statement.setInt(1, idTorneo);\n statement.setInt(2, idTorneo);\n rs = statement.executeQuery();\n //mientras que halla registros cree un nuevo dto y pasele la info\n while (rs.next()) {\n //crea un nuevo dto\n GoleadoresDTO gol = new GoleadoresDTO();\n UsuariosDTO usu = new UsuariosDTO();\n EquipoDTO equipo = new EquipoDTO();\n //le pasamos los datos que se encuentren\n gol.setNumeroGoles(rs.getInt(\"numeroGoles\"));\n gol.setIdEquipo(rs.getInt(\"idEquipo\"));\n gol.setIdTorneo(rs.getInt(\"idTorneo\"));\n gol.setIdJugador(rs.getLong(\"idJugador\"));\n usu.setPrimerNombre(rs.getString(\"primerNombre\"));\n usu.setPrimerApellido(rs.getString(\"primerApellido\"));\n gol.setUsu(usu);//paso el usuario al objeto \n equipo.setNombre(rs.getString(\"nombre\"));\n gol.setEquipo(equipo);\n //agregamos el objeto dto al arreglo\n listarGoleadores.add(gol);\n\n }\n } catch (SQLException sqlexception) {\n throw new MiExcepcion(\"Error listando goles\", sqlexception);\n\n } \n// finally {\n// try{\n// if (statement != null) {\n// statement.close(); \n// }\n// }catch (SQLException sqlexception) {\n// throw new MiExcepcion(\"Error listando goles\", sqlexception);\n//\n// }\n// }\n //devolvemos el arreglo\n return listarGoleadores;\n\n }", "public static void main(String [] args){\n\t\t\r\n\t\tEstadoDAO dao = new EstadoDAO();\r\n\t//\tdao.salvar(estado);\r\n\t\tList<Estado> estados= dao.list();\r\n\t\t \r\n\t\t for(Estado est: estados){\r\n\t\t System.out.println(est.getEstado());\r\n\t\t \r\n\t\t\t\t\r\n\r\n\t\t \r\n\t\t // CidadeDAO dao = new CidadeDAO();\r\n\t\t // cidades = dao.buscartudo();\r\n\t\t // for(Cidade cid: cidades){\r\n\t\t // System.out.println(cid.getNome_cidade());\r\n\t\t }\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t}" ]
[ "0.6850972", "0.67662877", "0.6622524", "0.6622482", "0.66212887", "0.65667516", "0.65241504", "0.64988", "0.6441655", "0.6429732", "0.6418483", "0.6388211", "0.63869625", "0.63412493", "0.63003755", "0.6292817", "0.62872714", "0.6278743", "0.6272187", "0.6243131", "0.623029", "0.62290365", "0.6208594", "0.62019706", "0.6164352", "0.61610764", "0.61375755", "0.613435", "0.6130797", "0.6119167", "0.6119165", "0.6117496", "0.60981196", "0.60872173", "0.6075281", "0.6074701", "0.6059621", "0.6025036", "0.60198164", "0.6003445", "0.59962463", "0.5983358", "0.598232", "0.5968291", "0.5967826", "0.5967423", "0.59670657", "0.5962581", "0.5962546", "0.5958067", "0.59535027", "0.59495914", "0.5947229", "0.594494", "0.5943832", "0.59386754", "0.5934999", "0.5933729", "0.5932338", "0.59285724", "0.59256464", "0.59228534", "0.59203297", "0.59199005", "0.59140605", "0.5912154", "0.59056765", "0.59010255", "0.59007573", "0.5899611", "0.5890287", "0.5887509", "0.5884628", "0.5883803", "0.58798826", "0.5877644", "0.5874703", "0.5868807", "0.5857655", "0.5855697", "0.5855286", "0.58549696", "0.5849251", "0.5842533", "0.58398134", "0.583757", "0.583454", "0.58300084", "0.58289665", "0.5827709", "0.5824529", "0.58190507", "0.58145887", "0.5808084", "0.5807824", "0.58062124", "0.5804693", "0.5802034", "0.5799943", "0.5799677" ]
0.5842522
84
System.out.println("entrou no dao listar noticias");
public List<SiteNoticia> listarPorUsuario(TbUsersystem id) { List<SiteNoticia> result = new ArrayList<SiteNoticia>(); EntityManager em1 = getEM(); em1.getTransaction().begin(); CriteriaBuilder builder = em1.getCriteriaBuilder(); CriteriaQuery query = builder.createQuery(SiteNoticia.class); EntityType type = em1.getMetamodel().entity(SiteNoticia.class); Root root = query.from(SiteNoticia.class); query.where(builder.equal(root.get(type.getDeclaredSingularAttribute("usuarioId", TbUsersystem.class)), id)); query.orderBy(builder.desc(root.get("hora2"))); result = em1.createQuery(query).getResultList(); em1.close(); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void listar()\n\t{\n\t\tdatabase.list().forEach(\n\t\t\t(entidade) -> { IO.println(entidade.print() + \"\\n\"); }\n\t\t);\n\t}", "public void executar() {\n\t\tSystem.out.println(dao.getListaPorNome(\"abacatão\"));\n\t}", "List<O> obtenertodos() throws DAOException;", "public void listarProvincia() {\n provincias = JPAFactoryDAO.getFactory().getProvinciaDAO().find();\n// for(int i=0;i<provincias.size();i++ ){\n// System.out.println(\"lista:\"+provincias.get(i).getNombreprovincia());\n// }\n }", "public String listar() {\n DocumentoVinculadoDAO documentoVinculadoDAO = new DocumentoVinculadoDAO();\n lista = documentoVinculadoDAO.listarStatus(1);\n return \"listar\";\n\n }", "public void consultarEditorialesDAO() {\n Collection<Editorial> editoriales = em.createQuery(\"SELECT e\"\n + \" FROM Editorial e\").getResultList();\n\n //Iteramos entre autores\n for (Editorial e : editoriales) {\n\n System.out.println(e.getNombre());\n\n }\n\n }", "public static boolean testDaoLirePraticien() {\n boolean ok = true; \n ArrayList<Praticien> lesPraticiens = new ArrayList<Praticien>();\n try {\n lesPraticiens = daoPraticien.getAll();\n } catch (Exception ex) {\n ok = false;\n }\n System.out.println(\"liste des praticiens\");\n for (Praticien unPraticien: lesPraticiens){\n System.out.println(unPraticien);\n }\n return ok;\n \n }", "public List<Usuario> listarUsuario() {\n \n List<Usuario> lista = usuarioDAO.findAll();\n return lista;\n \n \n\n }", "List<NotificacionInfo> findAll();", "public void listar() {\n\t\t\n\t}", "@Test\n public void testListarTudo() {\n System.out.println(\"listarTudo\");\n String cnpjCliente = \"\";\n ClassificacaoTributariaDAO instance = new ClassificacaoTributariaDAO();\n List<ClassificacaoTributaria> expResult = null;\n List<ClassificacaoTributaria> result = instance.listarTudo(cnpjCliente);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public static boolean testDaoLireLabo() {\n boolean ok = true;\n ArrayList<Labo> lesLabo = new ArrayList<Labo>();\n try {\n lesLabo = daoLabo.getAll();\n } catch (Exception ex) {\n ok = false;\n }\n System.out.println(\"liste des labos\");\n for (Labo unLabo: lesLabo){\n System.out.println(unLabo);\n }\n return ok;\n }", "public void llenarTabla(){\n pedidoMatDao.llenarTabla();\n }", "List<Persona> obtenerTodasLasPersona();", "public void listarProducto() {\n }", "public static void main(String[] args) {\n UsuarioDaoImp listar = new UsuarioDaoImp();\n List<Usuario> l = listar.listarUsuario();\n System.out.println(\"LISTA DE USUARIOS\");\n for (Usuario u : l) {\n \n System.out.println(\"------------------------\");\n System.out.println(\"Nombre: \" + u.getNombre());\n System.out.println(\"Apellido: \" + u.getApellido());\n System.out.println(\"Edad: \" + u.getEdad());\n }\n\n }", "List<Entidade> listarTodos();", "public List<Tipousr> findAllTipos(){\n\t\t List<Tipousr> listado;\n\t\t Query q;\n\t\t em.getTransaction().begin();\n\t\t q=em.createQuery(\"SELECT u FROM Tipousr u ORDER BY u.idTipousr\");\n\t\t listado= q.getResultList();\n\t\t em.getTransaction().commit();\n\t\t return listado;\n\t\t \n\t\t}", "public List<Producto> traerTodos () {\n \n return jpaProducto.findProductoEntities();\n \n \n \n }", "public void Listar() {\n try {\n ApelacionesDao apelacionesDao = new ApelacionesDao();\n this.listaApelaciones.clear();\n setListaApelaciones(apelacionesDao.cargaApelaciones());\n } catch (ExceptionConnection ex) {\n Logger.getLogger(ApelacionController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "void iniciarOperacion() throws DAOException;", "public static boolean testDaoLireOffrir() {\n boolean ok = true;\n ArrayList<Echantillon> lesEchantillons = new ArrayList<Echantillon>();\n try {\n lesEchantillons = daoOffrir.getAll();\n } catch (Exception ex) {\n ok = false;\n }\n System.out.println(\"liste des échantillons\");\n for (Echantillon unEchantillon: lesEchantillons){\n System.out.println(unEchantillon);\n }\n return ok;\n }", "public List<EspecieEntity> encontrarTodos(){\r\n Query todos =em.createQuery(\"select p from EspecieEntity p\");\r\n return todos.getResultList();\r\n }", "@Override\r\n public List<Assunto> buscarTodas() {\r\n EntityManager em = PersistenceUtil.getEntityManager();\r\n Query query = em.createQuery(\"FROM Assunto As a\");\r\n return query.getResultList();\r\n }", "public void afficherReclamationAdmin(ObservableList<Reclamation> oblist1){\n try {\n PreparedStatement pt1 = c.prepareStatement(\"SELECT id_r, message, etat, date_rec, reponse, prenom, nom FROM reclamation, user where idch=id_u and etat != 'Archivée'\");\n ResultSet rs = pt1.executeQuery();\n while (rs.next()) {\n String fetch = rs.getString(\"prenom\")+\" \"+rs.getString(\"nom\");\n System.out.println(rs.getString(\"reponse\"));\n oblist1.add(new Reclamation(rs.getInt(\"id_r\"), rs.getString(\"message\"), rs.getString(\"etat\"), rs.getString(\"date_rec\"), rs.getString(\"reponse\"), fetch));\n }\n } catch (SQLException ex) {\n Logger.getLogger(ReclamationCRUD.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void mostrarNotificaciones(){\n System.out.println(notificaciones.toString());\n }", "@Override\n\tpublic List<Nota> getListNotas(int userid)\n\t{\n\t\tList<Nota> listnotas= null; //new ArrayList<Usuario>();\n\t\tSession session = HibernateUtil.getSessionFactory().openSession();\n\t\tTransaction transaction = null;\n\t\ttry {\n\t\t\ttransaction = session.beginTransaction();\n\t\t\tlistnotas = session.createQuery(\"FROM Nota where Usuario_userid = '\" +userid+\"'\").list();\n \t\t\t\n\t\t\ttransaction.commit();\n\t\t\t\n\t\t} catch (HibernateException e) {\n\t\t\ttransaction.rollback();\n\t\t\te.printStackTrace();\n\t\t}\n\t\tint i = 0;\n\t\twhile(i<listnotas.size())\n\t\t{\n\t\t\tSystem.out.println(\"*\" + listnotas.get(i).getIdNota() );\n\t\t\ti++;\n\t\t}\n\t\treturn listnotas;\n\t}", "public void ouvrirListe(){\n\t\n}", "@Override\n public List<Paciente> listar(){\n EntityManagerFactory factory = Persistence.createEntityManagerFactory(\"vesaliusPU\"); \n EntityManager em = factory.createEntityManager();\n List<Paciente> listaPaciente = em.createQuery(\"SELECT pac FROM Paciente pac\").getResultList(); \n em.close();\n factory.close();\n return (listaPaciente);\n }", "public List<Usuarios> getUsuarios(){ //retorna una lista con todos los Usuarios en la database\n List<Usuarios> listaUsuarios = new ArrayList<Usuarios>();\n conexion = base.GetConnection();\n try{\n String consulta = \"select Cedula from usuarios\";\n PreparedStatement select = conexion.prepareStatement(consulta);\n boolean r = select.execute();\n if(r){\n ResultSet result = select.getResultSet();\n while(result.next()){\n Usuarios usuario = new Usuarios(result.getString(1));\n System.out.println(usuario);\n listaUsuarios.add(usuario);\n }\n result.close();\n }\n conexion.close();\n }catch(SQLException ex){\n System.out.println(ex.toString());\n }\n return listaUsuarios;\n}", "public List<Tutores> readAllJPQL() throws SecurityException{ \n String sql=\"Select tu from Tutores tu\";\n \n Query q=em.createQuery(sql); \n return q.getResultList();\n }", "private static void getListTest() {\n\t\tList<CartVo> list=new CartDao().getList();\r\n\t\t\r\n\t\tfor(CartVo cartVo : list) {\r\n\t\t\tSystem.out.println(cartVo);\r\n\t\t}\r\n\t}", "@Override\n public List<Caja> buscarMovimientos(){\n List<Caja> listaCaja= cajaRepository.findAll();\n\n return listaCaja;\n\n }", "public ArrayList<Note> pedirTodasLasNotas(){\n ArrayList<Note> todasLasNotas = new ArrayList<>();\n Note nota;\n HashMap<Integer,String> misNotas = new HashMap<Integer,String>();\n ArrayList<String> tituloTratamiento = new ArrayList<String>();\n String[] campos = {\"_id\",\"titulo\",\"fecha\"};\n Cursor c = db.query(\"nota\",campos,null,null,null,null,null);\n if(c.moveToFirst()){\n\n do{\n nota = new Note();\n nota.setId(c.getInt(0));\n nota.setTitulo(c.getString(1));\n nota.setFechaFormateada(c.getString(2));\n todasLasNotas.add(nota);\n }while(c.moveToNext());\n return todasLasNotas;\n }\n\n return todasLasNotas;\n\n }", "@Test\r\n public void testListarTodos() throws Exception {\r\n limpar();\r\n tx.begin();\r\n Categoria categoria1 = new Categoria(\"Teste categoria1\");\r\n Categoria categoria2 = new Categoria(\"Teste categoria2\");\r\n Categoria categoria3 = new Categoria(\"Teste categoria3\");\r\n dao.persiste(categoria1);\r\n dao.persiste(categoria2);\r\n dao.persiste(categoria3);\r\n tx.commit();\r\n List<Categoria> expResult = dao.listarTodos();\r\n //List<Categoria> result = instance.listarTodos();\r\n //assertEquals(expResult, result);\r\n // TODO review the generated test code and remove the default call to fail.\r\n for(Categoria c:expResult){\r\n System.out.println(c.getId() + \" \" + c.getNome());\r\n }\r\n assertEquals(3, expResult.size());\r\n }", "public abstract List<GnNotaria> getAllGnNotaria() throws Exception;", "@Test\n void getAllNotesSuccess() {\n List<Note> notes = noteDao.getAll();\n assertEquals(2, notes.size());\n }", "public void listNens() {\n\t\t\tEntityManager em = emf.createEntityManager();\n\t\t\tem.getTransaction().begin();\n\t\t\tList<Nen> result = em.createQuery(\"from nen\", Nen.class)\n\t\t\t\t\t.getResultList();\n\t\t\tfor (Nen a : result) {\n\t\t\t\tSystem.out.println(a.toString());\n\t\t\t}\n\t\t\tem.getTransaction().commit();\n\t\t\tem.close();\t\n\t\t}", "public static void main(String[] args) {\n EntityManager gerenciador = JPAUtil.getGerenciador();\r\n\r\n //Criando a consulta ao BD\r\n TypedQuery<FilmeAtor> consulta = gerenciador.createQuery(\r\n \"SELECT new dados.dto.FilmeAtor(f, a) FROM Filme f JOIN f.atores a where f.nome = 'Les' OR a.nome = 'Les'\",\r\n FilmeAtor.class);\r\n\r\n System.out.println(\"Realizando a consulta\");\r\n List<FilmeAtor> lista = consulta.getResultList();\r\n System.out.println(\"Teste\");\r\n \r\n \r\n /*System.out.println(\"Tamanho da lista\");\r\n System.out.println(lista.size());\r\n \r\n \r\n for(Filme f : lista){\r\n System.out.println(f.getNome());\r\n System.out.println(f.getId());\r\n System.out.println(f.getAtores().size());\r\n }*/\r\n \r\n }", "@Override\n\tpublic List<Paciente> listar() {\n\t\treturn dao.findAll();\n\t}", "@Test\n\t \t\n\t public void listAll() {\n\t \n\t List<Persona> list = personaDao.listPersons();\n\t \n\t Assert.assertNotNull(\"Error listado\", list);\n\n\t }", "private void getinterrogantes(){\n try{\n EntityManagerFactory emf = Persistence.createEntityManagerFactory(\"ServiceQualificationPU\");\n EntityManager em = emf.createEntityManager();\n\n String jpql = \"SELECT i FROM Interrogante i \"\n + \"WHERE i.estado='a' \";\n\n Query query = em.createQuery(jpql);\n List<Interrogante> listInterrogantes = query.getResultList();\n\n ArrayList<ListQuestion> arrayListQuestions = new ArrayList<>();\n for (Interrogante i : listInterrogantes){\n ListQuestion lq = new ListQuestion();\n lq.setIdinterrogante(i.getIdinterrogante());\n lq.setQuestion(i.getDescripcion());\n lq.setListParametros(getParametros(i.getIdinterrogante()));\n arrayListQuestions.add(lq);\n }\n\n this.ListQuestions = arrayListQuestions;\n em.close();\n emf.close();\n }catch(Exception e){\n System.out.println(\"ERROR: \"+e);\n this.Error = \"ERROR: \"+e;\n } \n \n }", "public String borra() { \n clienteDAO.borra(c.getId());\n return \"listado\";\n }", "List<Horario_Disponible> findAll();", "@Test\n public void retriveAllTest() throws SQLException {\n manager = new TableServizioManager(mockDb);\n List<Servizio> lista = manager.retriveAll();\n assertEquals(7,lista.size(),\"It should return a list of length 7\");\n }", "@Override\r\n public List<Prova> consultarTodosProva() throws Exception {\n return rnProva.consultarTodos();\r\n }", "public void ConsultaVehiculosSQlite() {\n preguntas = mydb.getCartList();\n for( int i = 0 ; i < preguntas.size() ; i++ ){\n //Toast.makeText(getApplicationContext(), preguntas.get( i ).getPregunta(), Toast.LENGTH_SHORT).show();\n persons.add(new Solicitud(\"Pregunta \" + String.valueOf(i+1) +\": \"+preguntas.get( i ).getPregunta(),\"Fecha: \"+ preguntas.get( i ).getFecha(), R.drawable.solicitudes,\"Motivo: \"+preguntas.get( i ).getMotivo(),\"Observacion: \"+preguntas.get( i ).getObservacion(),\"\"));\n }\n }", "public interface LogNotificacionDao extends GenericDao<LogNotificacion, Integer> {\n}", "public static void main(String[] args) throws SQLException {\n\t\n\t\tDocumentDAO y = new DocumentDAO();\n\tObservableList<Document> listeDoc= (new DocumentDAO()).findall();\n\tSystem.out.println(listeDoc.get(0));\n\t\t\n\t\t//VisiteurDAO v = new VisiteurDAO();\n\t//<Visiteur> idVisiteur = v.findById(\"a131\");\n\t\t\n\t\n\t\n\t}", "@Test\r\n public void testGGetContratistas() {\r\n System.out.println(\"getContratistas\");\r\n \r\n UsuarioDao instance = new UsuarioDao();\r\n List<Usuario> result = instance.getContratistas();\r\n \r\n assertFalse(result.isEmpty());\r\n }", "public String borra(Cliente cliente) {\n clienteDAO.borra(cliente.getId());\n return \"listado\";\n }", "public interface FakturaTekstVDAO extends DAO<FakturaTekstV> {\r\n\t/**\r\n\t * Finner tekster tilhørende faktura\r\n\t * \r\n\t * @param fakturaId\r\n\t * @return tekster\r\n\t */\r\n\tList<FakturaTekstV> findByFakturaId(Integer fakturaId);\r\n}", "public List display(FeedbackVO vo1) {\nList l1 = new ArrayList();\r\n\t\t\r\n\t\ttry{\r\n\t\tSessionFactory sessionFactory=new Configuration().configure().buildSessionFactory();\r\n\t\tSession session =sessionFactory.openSession();\r\n\t\t\r\n\t\tQuery q=session.createQuery(\"from FeedbackVO\");\r\n\t\tl1=q.list();\r\n\t\t\r\n\t\tSystem.out.println(\"done??\");\r\n\t\t\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 l1;\r\n\t}", "public void mostrarLista(){\n Nodo recorrer = inicio;\n while(recorrer!=null){\n System.out.print(\"[\"+recorrer.edad+\"]-->\");\n recorrer=recorrer.siguiente;\n }\n System.out.println(recorrer);\n }", "@Override\r\npublic List<Map<String, Object>> readAll() {\n\treturn detalle_pedidoDao.realAll();\r\n}", "@Override\r\n public List<QuestaoDiscursiva> consultarTodosQuestaoDiscursiva()\r\n throws Exception {\n return rnQuestaoDiscursiva.consultarTodos();\r\n }", "@Test\n\tpublic void testGetLista() throws Exception {\n\t\tSystem.out.println(\"getLista\");\n\t\tso.execute(entity);\n\t\tList<IGeneralEntity> expResult = ((TakeTrucksOperation) so).getLista();\n\t\tList<IGeneralEntity> result = so.db.vratiSve(entity);\n\n\t\tassertEquals(expResult.size(), result.size());\n\t}", "@SuppressWarnings(\"unchecked\")\t\r\n\t@Override\r\n\tpublic List<Distrito> listar() {\n\t\tList<Distrito> lista = new ArrayList<Distrito>();\r\n\t\tQuery q = em.createQuery(\"select m from Distrito m\");\r\n\t\tlista = (List<Distrito>) q.getResultList();\r\n\t\treturn lista;\r\n\t}", "public List<PokemonEntity> findAll() {\n LOGGER.log(Level.INFO, \"Consultando todas los trayectos\");\n // Se crea un query para buscar todas las ciudades en la base de datos.\n TypedQuery query = em.createQuery(\"select u from PokemonEntity u\", PokemonEntity.class);\n // Note que en el query se hace uso del método getResultList() que obtiene una lista de ciudades.\n return query.getResultList();\n}", "public List<TipoDocumento> listar() throws SQLException{\n ArrayList<TipoDocumento> tipodocumentos = new ArrayList();\n TipoDocumento tipodocumento;\n ResultSet resultado;\n String sentenciaSQL = \"SELECT documentoid, descripcion FROM tipodocumento;\";\n \n resultado = gestorJDBC.ejecutarConsulta(sentenciaSQL);\n while(resultado.next()){ \n //para hacer \"new Genero\" necesito tener un Construtor vacio.\n tipodocumento = new TipoDocumento();\n tipodocumento.setTipodocumentoid(resultado.getInt(\"documentoid\"));\n tipodocumento.setDescripcion(resultado.getString(\"descripcion\"));\n tipodocumentos.add(tipodocumento);\n }\n resultado.close();\n return tipodocumentos; \n }", "public List<Calificar> list_comentarios(String nombre){\n List<Calificar> comentarios = null;\n\n Session session = sessionFactory.openSession();\n Transaction tx = null;\n\n try{\n\n tx = session.beginTransaction();\n String hql = \"from Calificar c where c.puesto.idNombre = :puesto\";\n Query query = session.createQuery(hql);\n query.setParameter(\"puesto\", nombre);\n comentarios = (List<Calificar>)query.list();\n tx.commit();\n\n } catch (Exception e) {\n if (tx != null) {\n tx.rollback();\n }\n e.printStackTrace();\n } finally {\n session.close();\n }\n\n return comentarios;\n }", "List<ParqueaderoEntidad> listar();", "private void listar() throws Exception{\n int resId=1;\n List<PlatoDia> lista = this.servicioRestaurante.listarMenuDia(resId);\n this.modelListEspecial.clear();\n lista.forEach(lse -> {\n this.modelListEspecial.addElement(\"ID: \" + lse.getId() \n + \" NOMBRE: \" + lse.getNombre()\n + \" DESCRIPCION: \" + lse.getDescripcion()\n + \" PRECIO: \" + lse.getPrecio()\n + \" ENTRADA: \"+lse.getEntrada() \n + \" PRINCIPIO: \"+lse.getPrincipio()\n + \" CARNE: \"+lse.getCarne()\n + \" BEBIDA: \"+lse.getBebida()\n + \" DIA: \"+lse.getDiaSemana());\n });\n }", "@Override\n\n public void run(String... strings) throws Exception {\n \n Usuario u= new Usuario(1521L, \"Viridiana Hernandez\",\"ndzmviridiana@hotmail.com\");\n \n //la guardamos\n \n // repoUsu.save(u);\n \n //GENERAMOS LA DIRECCION QUE VAMOS A GUARDAR\n \n Direccion d = new Direccion(new Usuario(1521L),\"Calle 13\", 55120, \"Ecatepec\");\n //repoDir.save(d);\n \n \n //AQUI HAREMOS EL JOIN\n \n \n Direccion d2= repoDir.findOne(2L);\n System.out.println(\"Correo:\"+d2.getU().getEmail()+ \" municipio \"+d2.getMunicipio());\n \n \n \n \n \n \n //repoMensa.save (new Mensajito(\"Primero\",\"Mi primera vez con hibernate\"))\n /*\n Mensajito m= repoMensa.findOne(1);\n System.out.println(m.getTitulo());\n \n \n \n // repoMensa.save(new Mensajito(\"17 de octubre\",\"No temblo\"));\n System.out.println(\"vamos a uscar todos\");\n \n for (Mensajito mensa:repoMensa.findAll()){\n System.out.println(mensa);\n \n }\n \n //para buscar por id FINDONE\n System.out.println(\"vamos a buscar por id\");\n System.out.println(repoMensa.findOne(1));\n \n \n // Actualizar \n repoMensa.save(new Mensajito(1,\"nuevo titulo\",\"nuevo cuerpo\"));\n System.out.println(repoMensa.findOne(1));\n*/\n }", "private void listaContatos() throws SQLException {\n limpaCampos();\n BdLivro d = new BdLivro();\n livros = d.getLista(\"%\" + jTPesquisar.getText() + \"%\");\n\n // Após pesquisar os contatos, executa o método p/ exibir o resultado na tabela pesquisa\n mostraPesquisa(livros);\n livros.clear();\n }", "private void getPlayerList(){\r\n\r\n PlayerDAO playerDAO = new PlayerDAO(Statistics.this);\r\n players = playerDAO.readListofPlayerNameswDefaultFirst();\r\n\r\n }", "List<Plaza> consultarPlazas();", "public static boolean testDaoLireMedicament() {\n boolean ok = true;\n ArrayList<Medicament> lesMedicaments = new ArrayList<Medicament>();\n try {\n lesMedicaments = daoMedicament.getAll();\n } catch (Exception ex) {\n ok = false;\n }\n System.out.println(\"liste des medicaments\");\n for (Medicament unMedicament: lesMedicaments){\n System.out.println(unMedicament);\n }\n return ok;\n }", "@Override\n public Retorno_MsgObj obtenerLista() {\n PerManejador perManager = new PerManejador();\n\n return perManager.obtenerLista(\"Inscripcion.findAll\", null);\n }", "public static boolean testDaoLireVisiteur() {\n boolean ok = true;\n ArrayList<Visiteur> lesVisiteurs = new ArrayList<Visiteur>();\n try {\n lesVisiteurs = daoVisiteur.getAll();\n } catch (Exception ex) {\n ok = false;\n }\n System.out.println(\"liste des visiteurs\");\n for (Visiteur unVisiteur: lesVisiteurs){\n System.out.println(unVisiteur);\n }\n return ok;\n }", "private List<Produto> retornaProduto (Long cod){\n \n Query q = entityManager.createNamedQuery(\"Produto.findByCodigo\");\n q.setParameter(\"codigo\", cod);\n List <Produto> p = q.getResultList();\n return p; \n}", "@Test\n public void testConsultarTodos() throws Exception {\n System.out.println(\"testConsultarTodos\");\n List<ConfiguracaoTransferencia> result = instance.findAll();\n assertTrue(result != null && result.size() > 0);\n }", "Jugador consultarGanador();", "public void iniciarProduccion(){\n try {\n Connection conn = Conectar.conectar();\n Statement st = conn.createStatement();\n ResultSet rs = st.executeQuery(\"select nick from usuarios where nick in(select usuario from construcciones) or nick \"\n +\"in(select usuario from investigaciones) or nick in(select usuario from movimientos)\");\n\n while(rs.next()){\n produccion.add(new Construcciones(rs.getString(1)));\n System.out.println(rs.getString(1));\n }\n\n st.close();\n rs.close();\n conn.close();\n\n }catch(SQLException e){\n System.out.println(\"Fallo actualizacion de produccion.\");\n }\n}", "public void consultarListaDeContatos() {\n\t\tfor (int i = 0; i < listaDeContatos.size(); i++) {\n\t\t\tSystem.out.printf(\"%d %s \\n\", i, listaDeContatos.get(i));\n\t\t}\n\t}", "public void listarAlunosNaDisciplina(){\r\n for(int i = 0;i<alunos.size();i++){\r\n System.out.println(alunos.get(i).getNome());\r\n }\r\n }", "public static void main(String[] args) {\n\t\t\n\t\ttry {\n//\t\t\tSystem.out.println(new VoluntarioDAO().consultarVoluntario(27).getAll());\n//\t\t\tSystem.out.println(\"----------------------------------------------\");\n//\t\t\tSystem.out.println(VoluntarioBO.consultarVoluntario(28).getAll());\n//\t\t\t\n//\t\tSystem.out.println(new VoluntarioDAO().gravarVoluntario(new Voluntario(1744,\n////\t\t\t\t\"anjosHenry\", \"henryAnjos@henryanjos.com\", \"12/01/1985\", \"HenryAnjos\", \"anjos\", 3, \"c:/windwos\", \"masculino\", 1744, \"23082342J\", 123123123, \"psicologia\", \"noturno\", \"chato\", 272188991)));\t\n//\t\t\n//\t\t\tSystem.out.println(VoluntarioBO.novoVoluntario((new Voluntario(1944,\n\t//\t\t\t\t\"anjosHenry\", \"asdfasfd@asfdasf.com\", \"12/01/1985\", \"loginss\", \"anjos\", 3, \"c:/windwos\", \"masculino\", 1744, \"23082342JK\", 1231231323, \"psicologia\", \"noturno\", \"chato\", 272188991))));\t\n\n\t//\t\tSystem.out.println(VoluntarioBO.excluirVoluntario(28));\n//\tSystem.out.println(new VoluntarioDAO().alterarDadosVoluntario(new Voluntario(23,\n\t//\t\t\t\t\t\t\"anjosHenry\", \"asdfasfd@asfdasf.com\", \"12/01/1985\", \"loginss\", \"anjos\", 3, \"c:/windwos\", \"masculino\", \"230823K\", 1231231323, \"psicologia\", \"noturno\", \"chato\", 272188991)));\t\n\n\t//\tSystem.out.println(VoluntarioBO.pesquisarVoluntario(23).getAll());\n\t//\tSystem.out.println(\"---------------------------------\");\n\t//\tSystem.out.println(PacienteBO.pesquisarPaciente(4).getAll());\n\t\t\n\t\tSystem.out.println(\"================================\");\n\t\tList<Voluntario> voluntarios = new ArrayList<Voluntario>();\n\t\tvoluntarios = VoluntarioBO.pesquisarVoluntarioTemporarios();\n\t\tfor(Voluntario voluntario : voluntarios) {\n\t\t\tSystem.out.println(voluntario.getAll());\n\t\t}\n\t\n\t\n\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(Excecao.tratarExcecao(e));\n\t\t}\n\n\t}", "Tablero consultarTablero();", "public static void testEmprunt() throws DaoException {\r\n EmpruntDao empruntDao = EmpruntDaoImpl.getInstance();\r\n LivreDao livreDao = LivreDaoImpl.getInstance();\r\n MembreDao membreDao = MembreDaoImpl.getInstance();\r\n\r\n List<Emprunt> list = new ArrayList<Emprunt>();\r\n list = empruntDao.getList();\r\n System.out.println(\"\\n 'Emprunts' list: \" + list);\r\n\r\n list = empruntDao.getListCurrent();\r\n System.out.println(\"\\n Current 'Emprunts' list: \" + list);\r\n\r\n list = empruntDao.getListCurrentByMembre(5);\r\n System.out.println(\"\\n Current 'Emprunts' list by member: \" + list);\r\n\r\n list = empruntDao.getListCurrentByLivre(3);\r\n System.out.println(\"\\n Current 'Emprunts' list by book: \" + list);\r\n\r\n Emprunt test = empruntDao.getById(5);\r\n System.out.println(\"\\n Selected 'Emprunt' : \" + test);\r\n\r\n empruntDao.create(1, 4, LocalDate.now());\r\n list = empruntDao.getList();\r\n System.out.println(\"\\n List updated with one creation: \" + list);\r\n\r\n\r\n int id_book = livreDao.create(\"My Book\", \"My Autor\", \"123456\");\r\n Livre test_livre = new Livre();\r\n test_livre = livreDao.getById(id_book);\r\n int idMember = membreDao.create(\"Rodrigues\", \"Henrique\", \"ENSTA\", \"henrique@email.fr\", \"+33071234567\", Abonnement.VIP);\r\n Membre test_membre = new Membre();\r\n test_membre = membreDao.getById(idMember);\r\n test = new Emprunt(2, test_membre, test_livre, LocalDate.now(), LocalDate.now().plusDays(60));\r\n empruntDao.update(test);\r\n list = empruntDao.getList();\r\n System.out.println(\"\\n List updated: \" + list);\r\n //System.out.println(\"\\n \" + test_livre.getId() + \" \" + test_membre.getId());\r\n\r\n\r\n int total = empruntDao.count();\r\n System.out.println(\"\\n Number of 'emprunts' in DB : \" + total);\r\n\r\n }", "public static List<Comentario> listar()\n {\n Session sessionRecheio;\n sessionRecheio = HibernateUtil.getSession();\n Transaction tr = sessionRecheio.beginTransaction();\n String hql = \"from Comentario u\";\n List<Comentario> lista = (List)sessionRecheio.createQuery(hql).list();\n tr.commit();\n return lista;\n }", "public void Found_project_from_DATABASE(int id){\n print_pro();\n// return project;\n }", "public List listar() {\n Query query = Database.manager.createNamedQuery(\"StatussistemaDTO.findAll\");\n query.setHint(QueryHints.MAINTAIN_CACHE, HintValues.FALSE);// evita consulta em cache\n List lista = query.getResultList();\n return lista;\n }", "public interface PreguntaDao {\n\n\t/** Devuelve las preguntas mas recientes, ordenadas desde la mas reciente hacia la mas antigua.\n\t * @param page La pagina de preguntas (comienza de la 1)\n\t * @param pageSize El numero de resultados a devolver por pagina. */\n\tpublic List<Pregunta> getPreguntasRecientes(int page, int pageSize);\n\n\t/** Devuelve las preguntas hechas por el usuario indicado. */\n\tpublic List<Pregunta> getPreguntasUsuario(Usuario user);\n\n\t/** Devuelve las preguntas que contienen el tag especificado. */\n\tpublic List<Pregunta> getPreguntasConTag(TagPregunta tag);\n\n\t/** Devuelve todas las preguntas que tengan al menos uno de los tags especificados. */\n\tpublic List<Pregunta> getPreguntasConTags(Set<TagPregunta> tags);\n\n\t/** Devuelve las preguntas que contienen el tag especificado. */\n\tpublic List<Pregunta> getPreguntasConTag(String tag);\n\n\t/** Devuelve los tags mas utilizados en preguntas.\n\t * @param limit El numero maximo de tags a devolver. */\n\tpublic List<TagPregunta> getTagsPopulares(int limit);\n\n\t/** Devuelve la pregunta con el id especificado. */\n\tpublic Pregunta getPregunta(int id);\n\n\t/** Devuelve las respuestas a la pregunta especificada.\n\t * @param pageSize El numero maximo de preguntas a devolver.\n\t * @param page El numero de pagina a devolver (la primera pagina es 1)\n\t * @param crono Indica si se deben ordenar las respuestas en orden cronologico, en vez de por votos\n\t * (default es por votos). */\n\tpublic List<Respuesta> getRespuestas(Pregunta q, int pageSize, int page, boolean crono);\n\n\t/** Devuelve la lista de preguntas con mas votos positivos.\n\t * @param limit El numero maximo de preguntas a devolver. */\n\tpublic List<Pregunta> getPreguntasMasVotadas(int limit);\n\n\t/** Devuelve la lista de preguntas que no tienen ni una sola respuesta. */\n\tpublic List<Pregunta> getPreguntasSinResponder(int limit);\n\n\t/** Devuelve la lista de preguntas cuyo autor no ha elegido una respuesta. */\n\tpublic List<Pregunta> getPreguntasSinResolver(int limit);\n\n\t/** Registra un voto que un usuario hace a una pregunta.\n\t * @param user El usuario que hace el voto\n\t * @param pregunta La pregunta a la cual se aplica el voto\n\t * @param up Indica si el voto es positivo (true) o negativo (false).\n\t * @throws PrivilegioInsuficienteException si el usuario no tiene reputacion suficiente para dar un voto negativo. */\n\tpublic VotoPregunta vota(Usuario user, Pregunta pregunta, boolean up) throws PrivilegioInsuficienteException;\n\n\t/** Registra un voto que un usuario hace a una respuesta que se hizo a una pregunta.\n\t * @param user El usuario que hace el voto.\n\t * @param resp La respuesta a la cual se aplica el voto.\n\t * @param up Indica si el voto es positivo (true) o negativo (false).\n\t * @throws PrivilegioInsuficienteException si el usuario no tiene reputacion suficiente para dar un voto negativo. */\n\tpublic VotoRespuesta vota(Usuario user, Respuesta resp, boolean up) throws PrivilegioInsuficienteException;\n\n\t/** Busca y devuelve el voto realizado por el usuario indicado a la pregunta especificada, si es que existe. */\n\tpublic VotoPregunta findVoto(Usuario user, Pregunta pregunta);\n\n\t/** Busca y devuelve el voto hecho por el usuario indicado a la respuesta especificada, si es que existe. */\n\tpublic VotoRespuesta findVoto(Usuario user, Respuesta respuesta);\n\n\tpublic void insert(Pregunta p);\n\n\tpublic void update(Pregunta p);\n\n\tpublic void delete(Pregunta p);\n\n\t/** Crea una respuesta con el texto especificado, para la pregunta especificada, por el autor especificado.\n\t * @return La respuesta recien creada. */\n\tpublic Respuesta addRespuesta(String resp, Pregunta p, Usuario autor);\n\n\t/** Agrega un comentario a la pregunta especificada, a nombre del usuario especificado. */\n\tpublic ComentPregunta addComentario(String c, Pregunta p, Usuario autor);\n\n\t/** Agrega un comentario a la respuesta especificada, a nombre del usuario especificado. */\n\tpublic ComentRespuesta addComentario(String c, Respuesta r, Usuario autor);\n\n\t/** Agrega el tag especificado a la pregunta. Primero se busca el tag existente para relacionarlo con la\n\t * pregunta, pero si no existe, se crea uno nuevo. */\n\tpublic void addTag(String tag, Pregunta p);\n\n\t/** Devuelve una lista con tags que contengan el texto parcial especificado. */\n\tpublic List<TagPregunta> findMatchingTags(String parcial);\n\n}", "private void listaContatos() throws SQLException {\n limpaCampos();\n DAOLivro d = new DAOLivro();\n livros = d.getLista(\"%\" + jTPesquisar.getText() + \"%\"); \n \n // Após pesquisar os contatos, executa o método p/ exibir o resultado na tabela pesquisa\n mostraPesquisa(livros);\n livros.clear();\n }", "public List<SiteNoticia> listarPorData() {\n List<SiteNoticia> result = new ArrayList<SiteNoticia>();\n EntityManager em1 = getEM();\n em1.getTransaction().begin();\n CriteriaBuilder builder = em1.getCriteriaBuilder();\n CriteriaQuery query = builder.createQuery(SiteNoticia.class);\n //EntityType type = em1.getMetamodel().entity(SiteNoticia.class);\n Root root = query.from(SiteNoticia.class);\n query.orderBy(builder.desc(root.get(\"hora2\")));\n result = em1.createQuery(query).getResultList();\n em1.close();\n return result;\n }", "public interface TProvinciasDAO {\n\t\n\tpublic ArrayList<TProvinciasBean> obtenerProvincias(String codigoDepartamento) throws DataAccessException;\n\t\n}", "private static void getListTest(int no) {\n\t\tList<CartVo> list=new CartDao().getList(no);\r\n\t\t\r\n\t\tfor(CartVo cartVo : list) {\r\n\t\t\tSystem.out.println(cartVo);\r\n\t\t}\r\n\t}", "public List<Permiso> obtenerTodosActivos();", "public static void main(String[] args) {\n\t\tEntityManagerFactory fabrica = Persistence.createEntityManagerFactory(\"mysql\");\n\t\t// 2. crea el manejador de entidades\n\t\tEntityManager em = fabrica.createEntityManager();\n\t\t\n\t\t//--proceso:obtener listar usuario\n\t\tSystem.out.println(\"Listado de los usuarios\");\n\t\t\n\t\tString sql=\"select u from Usuario u\";//JPA u.codigo, u.etc\n\t\t\n\t\tList<Usuario>lstUsuario = em.createQuery(sql,Usuario.class).getResultList();\n\t\t\n\t\tSystem.out.println(\"Cantidad de usuarios: \"+ lstUsuario.size());//para ver cantidad\n\t\t//para imprimir en consola el listado\n\t\tfor(Usuario u:lstUsuario) {\n\t\t\tSystem.out.println(\">>> \"+u);\n\t\t}\n\t\t\n\t\t/////////////////listado por tipo (where)////////////////////////\n\t\tSystem.out.println(\"Listado de los usuarios por tipo\");\n\t\t\n\t\tString sql2=\"select u from Usuario u where u.tipo= :xtipo\";//JPA se usa la variable de la clase y se setea una variable con setParameter\n\t\t\n\t\tTypedQuery<Usuario> query = em.createQuery(sql2,Usuario.class);//para setear varias variables en listar\n\t\tquery.setParameter(\"xtipo\", 1);\n\t\tList<Usuario>lstUsuarioxtipo = query.getResultList();\n\t\t\n\t\tSystem.out.println(\"Cantidad de usuarios: \"+ lstUsuarioxtipo.size());//para ver cantidad\n\t\t//para imprimir en consola el listado\n\t\tfor(Usuario u:lstUsuarioxtipo) {\n\t\t\tSystem.out.println(\">>> \"+u);\n\t\t}\n\t\tem.close();\n\t\t\n\t}", "public interface IdeaCommentDao extends GenericDao<IdeaComment, Long>{\n\n\tList<IdeaComment> findIdeaCommentList(String ideaId);\n\n}", "@Test\r\n @Ignore\r\n public void testFindPaciente() {\r\n System.out.println(\"findPaciente\");\r\n String termo = \"\";\r\n EnfermeiroDaoImpl instance = new EnfermeiroDaoImpl();\r\n List<Enfermeiro> expResult = null;\r\n List<Enfermeiro> result = instance.findPaciente(termo);\r\n assertEquals(expResult, result);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }", "public void listar(){\n if (!esVacia()) {\n // Crea una copia de la lista.\n NodoEmpleado aux = inicio;\n // Posicion de los elementos de la lista.\n int i = 0;\n System.out.print(\"-> \");\n // Recorre la lista hasta llegar nuevamente al incio de la lista.\n do{\n // Imprime en pantalla el valor del nodo.\n System.out.print(i + \".[ \" + aux.getEmpleado() + \" ]\" + \" -> \");\n // Avanza al siguiente nodo.\n aux = aux.getSiguiente();\n // Incrementa el contador de la posi�n.\n i++;\n }while(aux != inicio);\n }\n }", "@Override\n\tpublic void mostrarDados() {\n\t\t\n\t}", "@Override\n public List<Venda> listar() {\n String sql = \"SELECT v FROM venda v\";\n TypedQuery<Venda> query = em.createQuery(sql, Venda.class);\n List<Venda> resultList = query.getResultList();\n\n return resultList;\n }", "@Test\n\tpublic void testConsultarTodos() {\n\t\tList<Dispositivo> dispositivos = new ArrayList<Dispositivo>();\n\t\ttry {\n\t\t\tdispositivos = dispositivoBL.consultarTodos();\n\t\t\tassertTrue(dispositivos.size() > 0);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\r\n\tpublic List<ServicesDto> list() {\r\n\t\treturn sessionFactory.getCurrentSession().createQuery(\"FROM ServicesDto WHERE active = TRUE\").list();\r\n}", "@Test\n public void test3FindAll() {\n SpecialityFactory factory = new MysqlSpecialityDAOFactry();\n SpecialityDAO dao = factory.create();\n List<SpecialityDTO> lista=(List<SpecialityDTO>)dao.findAll(); \n System.out.println(lista);\n assertTrue(!lista.isEmpty());\n }", "@Query(\"SELECT * FROM \" + TABLE_NAME)\n List<Note> getNotes();", "@Override\n\t@Transactional(readOnly=true)\n\tpublic List<Interesado> findByConsumidor(Consumidor consumidor) { \n\t\tSystem.out.println(\"entro2\");\n\t\treturn interesadoDao.findByConsumidor(consumidor); \n\t}", "public List<GoleadoresDTO> listarTodo(int idTorneo,Connection conexion) throws MiExcepcion {\n ArrayList<GoleadoresDTO> listarGoleadores = new ArrayList();\n\n try {\n String query = \"SELECT DISTINCT usuarios.primerNombre, \" +\n\" usuarios.primerApellido, tablagoleadores.numeroGoles, tablagoleadores.idEquipo, \"+ \n\" tablagoleadores.idTorneo,tablagoleadores.idJugador, \" +\n\" equipo.nombre \" +\n\" FROM tablagoleadores \" +\n\" INNER JOIN jugadoresporequipo \" +\n\" ON tablagoleadores.idJugador = jugadoresporequipo.codigoJugador \" +\n\" INNER JOIN usuarios \" +\n\" ON jugadoresporequipo.codigoJugador = usuarios.idUsuario \" +\n\" INNER JOIN equiposdeltorneo \" +\n\" ON tablagoleadores.idEquipo = equiposdeltorneo.equipoCodigo \" +\n\" INNER JOIN equipo \" +\n\" ON equiposdeltorneo.equipoCodigo = equipo.codigo \" +\n\" INNER JOIN torneo \" +\n\" ON tablagoleadores.idTorneo = torneo.idTorneo \" +\n\" WHERE tablagoleadores.idTorneo = ? \" +\n\" AND equiposdeltorneo.torneoIdTorneo=? \" +\n\" ORDER BY numeroGoles DESC\";\n statement = conexion.prepareStatement(query);\n statement.setInt(1, idTorneo);\n statement.setInt(2, idTorneo);\n rs = statement.executeQuery();\n //mientras que halla registros cree un nuevo dto y pasele la info\n while (rs.next()) {\n //crea un nuevo dto\n GoleadoresDTO gol = new GoleadoresDTO();\n UsuariosDTO usu = new UsuariosDTO();\n EquipoDTO equipo = new EquipoDTO();\n //le pasamos los datos que se encuentren\n gol.setNumeroGoles(rs.getInt(\"numeroGoles\"));\n gol.setIdEquipo(rs.getInt(\"idEquipo\"));\n gol.setIdTorneo(rs.getInt(\"idTorneo\"));\n gol.setIdJugador(rs.getLong(\"idJugador\"));\n usu.setPrimerNombre(rs.getString(\"primerNombre\"));\n usu.setPrimerApellido(rs.getString(\"primerApellido\"));\n gol.setUsu(usu);//paso el usuario al objeto \n equipo.setNombre(rs.getString(\"nombre\"));\n gol.setEquipo(equipo);\n //agregamos el objeto dto al arreglo\n listarGoleadores.add(gol);\n\n }\n } catch (SQLException sqlexception) {\n throw new MiExcepcion(\"Error listando goles\", sqlexception);\n\n } \n// finally {\n// try{\n// if (statement != null) {\n// statement.close(); \n// }\n// }catch (SQLException sqlexception) {\n// throw new MiExcepcion(\"Error listando goles\", sqlexception);\n//\n// }\n// }\n //devolvemos el arreglo\n return listarGoleadores;\n\n }", "public List<Listas_de_las_Solicitudes> Mostrar_las_peticiones_que_han_llegado_al_Usuario_Administrador(int cedula) {\n\t\t//paso3: Obtener el listado de peticiones realizadas por el usuario\n\t\tEntityManagerFactory entitymanagerfactory = Persistence.createEntityManagerFactory(\"LeyTransparencia\");\n\t\tEntityManager entitymanager = entitymanagerfactory.createEntityManager();\n\t\tentitymanager.getEntityManagerFactory().getCache().evictAll();\n\t\tQuery consulta4=entitymanager.createQuery(\"SELECT g FROM Gestionador g WHERE g.cedulaGestionador =\"+cedula);\n\t\tGestionador Gestionador=(Gestionador) consulta4.getSingleResult();\n\t\t//paso4: Obtener por peticion la id, fecha y el estado\n\t\tList<Peticion> peticion=Gestionador.getEmpresa().getPeticions();\n\t\tList<Listas_de_las_Solicitudes> peticion2 = new ArrayList();\n\t\t//paso5: buscar el area de cada peticion\n\t\tfor(int i=0;i<peticion.size();i++){\n\t\t\tString almcena=\"\";\n\t\t\tString sarea=\"no posee\";\n\t\t\tBufferedReader in;\n\t\t\ttry{\n\t\t\t\tin = new BufferedReader(new InputStreamReader(new FileInputStream(\"C:/area/area\"+String.valueOf(peticion.get(i).getIdPeticion())+\".txt\"), \"utf-8\"));\n\t\t\t\ttry {\n\t\t\t\t\twhile((sarea=in.readLine())!=null){\n\t\t\t\t\t\tint s=0;\n\t\t\t\t\t\talmcena=sarea;\n\t\t\t\t\t}\n\t\t\t\t\tin.close();\n\t\t\t\t\tSystem.out.println(almcena);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t} catch (UnsupportedEncodingException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\t//paso6: Mostrar un listado de peticiones observando el id, la fecha de realizacion de la peticion, hora de realizacion de la peticion, y el estado actual de la peticion\n\t\t\tListas_de_las_Solicitudes agregar=new Listas_de_las_Solicitudes();\n\t\t\tagregar.setId(String.valueOf(peticion.get(i).getIdPeticion()));\n\t\t\tagregar.setFechaPeticion(peticion.get(i).getFechaPeticion());\n\t\t\tagregar.setNombreestado(peticion.get(i).getEstado().getTipoEstado());\n\t\t\tagregar.setArea(almcena);\n\t\t\tpeticion2.add(agregar);\n\t\t\t\n\t\t\t\n\t\t}\n\t\tSystem.out.println(\"el usuario existe\");\n\t\treturn peticion2;\n\t\t//aun no se\n\t}" ]
[ "0.6850209", "0.6767436", "0.66230077", "0.66222996", "0.66216654", "0.6565688", "0.6524038", "0.64987123", "0.6439758", "0.6429705", "0.64198756", "0.6389446", "0.63868", "0.6340421", "0.6300805", "0.6292466", "0.6286711", "0.62774366", "0.6271284", "0.6243339", "0.6232365", "0.62292296", "0.6207896", "0.6201508", "0.6164027", "0.6159257", "0.6137196", "0.61349744", "0.6130482", "0.6118979", "0.61185306", "0.6117147", "0.6098004", "0.6085867", "0.60763615", "0.6075089", "0.6058907", "0.6024032", "0.6019491", "0.6002415", "0.59960973", "0.59835523", "0.5982928", "0.59680617", "0.59679693", "0.59668", "0.5966607", "0.5962875", "0.5961843", "0.5959287", "0.59544736", "0.5950104", "0.5946861", "0.5943432", "0.5943239", "0.5938413", "0.59366363", "0.5933054", "0.59314865", "0.5927547", "0.5926151", "0.59231263", "0.59208953", "0.59195596", "0.59141403", "0.59120345", "0.5905871", "0.5901325", "0.59004986", "0.5900385", "0.5890474", "0.58881086", "0.5884976", "0.5883927", "0.5878962", "0.58773154", "0.5875266", "0.5868603", "0.58580476", "0.58555275", "0.585537", "0.585475", "0.5849856", "0.5842513", "0.5841647", "0.58400655", "0.5837463", "0.5834523", "0.58299", "0.58292484", "0.58287895", "0.5824339", "0.58181363", "0.58144426", "0.5808318", "0.58075047", "0.58051026", "0.58043617", "0.58020735", "0.58009565", "0.57997376" ]
0.0
-1
assigns the countryCode depending on the country clicked to pass onto goToDictionary
public void goToDictionaryKorea(View v) { countryCode = 1; countryName = getCountry(countryCode); goToDictionary(countryName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void goToDictionary(String country) {\n Intent myIntent = new Intent(this, Dictionary.class);\n myIntent.putExtra(\"flag\", country);\n\n Bundle bundle2 = new Bundle();\n bundle2.putString(\"flag\", country);\n\n DictionaryTab1 send2 = new DictionaryTab1();\n send2.setArguments(bundle2);\n\n startActivity(myIntent);\n }", "public void handleCountrySelection(ActionEvent actionEvent) {\n }", "@Override\n public void onMapClick(LatLng arg0) {\n try {\n Geocoder geo = new Geocoder(MapsActivity.this, Locale.getDefault());\n List<Address> add = geo.getFromLocation(arg0.latitude, arg0.longitude, 1);\n String selectedCountry;\n if (add.size() > 0) {\n selectedCountry = add.get(0).getCountryName();\n selectedStateOrCountry = selectedCountry;\n\n //Log.d(\"country\", selectedCountry);\n //For usa go with states . All other countries - it gives the capital\n if (selectedCountry.equalsIgnoreCase(\"United States\") ||\n selectedCountry.equalsIgnoreCase(\"US\")) {\n selectedStateOrCountry = add.get(0).getAdminArea();\n }\n //Log.d(\"state\", selectedStateOrCountry);\n ConvertTextToSpeech();\n }\n } catch (Exception e) {\n //Log.e(TAG, \"Failed to initialize map\", e);\n }\n }", "@Override\n\t\t\t\t\tpublic void onSelectCountry(String name, String code) {\n\t\t\t\t\t\tIntent intent = new Intent(contry.this, SignUpActivity.class);\n\t\t\t\t\t\t intent.putExtra(\"pays_iso\",code); \n\t\t\t\t\t\t intent.putExtra(\"pays_name\",name); \n\t\t\t\t\t\t intent.putExtra(\"device_key\",registrationId); \n\t\t\t\t\t\tstartActivityForResult(intent, 0);\n\t\t\t\t\t\toverridePendingTransition(R.anim.slidein, R.anim.slideout);\n\t\t\t\t\t\tfinish();\n\t\t\t\t\t}", "@Override\n\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\tlastSelectCountryCode = which;\n\t\t\t((Button)(AccountForgetPSWActivity.this.findViewById(R.id.getpsw_choose_country_btn)))\n\t\t\t\t\t.setText(countryCodeManager.getCountryName(which));\n\t\t\tchooseCountryDialog.dismiss();\n\t\t}", "@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tshowCountrycode();\n\t\t\t\t}", "@Override\n\t\t\tpublic void onSelectCountry(String name, String code) {\n\t\t\t\tIntent intent = new Intent(contry.this, SignUpActivity.class);\n\t\t\t\t intent.putExtra(\"pays_iso\",code); \n\t\t\t\t intent.putExtra(\"pays_name\",name); \n\t\t\t\t intent.putExtra(\"device_key\",registrationId); \n\t\t\t\tstartActivityForResult(intent, 0);\n\t\t\t\toverridePendingTransition(R.anim.slidein, R.anim.slideout);\n\t\t\t\tfinish();\n\t\t\t}", "public void switchToCountry()\n {\n questionLabel.setText(currentQuestion.getQuestion());\n d.setVisible(true);\n atQuestionStage=true;\n mapImageLabel.setVisible(false);\n a.setText(\"A\");\n b.setText(\"B\");\n c.setText(\"C\");\n a.setBounds(380,220,a.getPreferredSize().height+20,30);\n b.setBounds(500,220,b.getPreferredSize().height+20,30);\n c.setBounds(380,320,c.getPreferredSize().height+20,30);\n d.setBounds(500,320,d.getPreferredSize().height+20,30);\n questionLabel.setBounds(380,100,600,100);\n revalidate();\n }", "@FXML\n public void changeCountry(ActionEvent event) {\n Countries countries = countryCB.getSelectionModel().getSelectedItem();\n\n showStatesProvinces(countries.getCountryID());\n }", "private void ActionChooseCountry() {\n final AlertDialog.Builder dialog = new AlertDialog.Builder(getContext());\n dialog.setTitle(getString(R.string.dialog_title_choose_country));\n\n final List<String> countryNames = Arrays.asList(getResources().getStringArray(R.array.countries_names));\n final List<String> countryArgs = Arrays.asList(getResources().getStringArray(R.array.countries_arg));\n\n final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1);\n arrayAdapter.addAll(countryNames);\n\n dialog.setNegativeButton(getString(R.string.dialog_btn_cancel), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n dialogInterface.dismiss();\n }\n });\n\n dialog.setAdapter(arrayAdapter, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n CoutryArg = countryArgs.get(i);\n\n tvChooseCountry.setText(countryNames.get(i));\n if (SourceId != null) {\n SourceId = null;\n tvChooseSource.setText(R.string.tv_pick_sourse);\n currentPage = 1;\n }\n }\n });\n dialog.show();\n }", "@Override\n public void onSelectCountry(Country country) {\n // get country name and country ID\n binding.editTextCountry.setText(country.getName());\n countryID = country.getCountryId();\n statePicker.equalStateObject.clear();\n cityPicker.equalCityObject.clear();\n \n //set state name text view and state pick button invisible\n setStateListener();\n \n // set text on main view\n// countryCode.setText(\"Country code: \" + country.getCode());\n// countryPhoneCode.setText(\"Country dial code: \" + country.getDialCode());\n// countryCurrency.setText(\"Country currency: \" + country.getCurrency());\n// flagImage.setBackgroundResource(country.getFlag());\n \n \n // GET STATES OF SELECTED COUNTRY\n for (int i = 0; i < stateObject.size(); i++) {\n // init state picker\n statePicker = new StatePicker.Builder().with(this).listener(this).build();\n State stateData = new State();\n if (stateObject.get(i).getCountryId() == countryID) {\n \n stateData.setStateId(stateObject.get(i).getStateId());\n stateData.setStateName(stateObject.get(i).getStateName());\n stateData.setCountryId(stateObject.get(i).getCountryId());\n stateData.setFlag(country.getFlag());\n statePicker.equalStateObject.add(stateData);\n }\n }\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tIntent intent = new Intent(MainActivity.this, MapActivity.class);\n\t\t\t\tintent.putExtra(\"Choice\", 2);\n\t\t\t\tintent.putExtra(\"latc\", 13.0827);\n\t\t\t\tintent.putExtra(\"lngc\", 80.2707);\n\t\t\t\tstartActivity(intent);\n\n\t\t\t}", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tIntent intent = new Intent(MainActivity.this, MapActivity.class);\n\t\t\t\tintent.putExtra(\"Choice\", 1);\n\t\t\t\tintent.putExtra(\"latb\", 12.9716);\n\t\t\t\tintent.putExtra(\"lngb\", 77.5946);\n\t\t\t\tstartActivity(intent);\n\n\t\t\t}", "@Override\n public void onSelectCountry(Country country) {\n // get country name and country ID\n countryName.setText(country.getName());\n countryName.setVisibility(View.VISIBLE);\n countryID = country.getCountryId();\n statePicker.equalStateObject.clear();\n cityPicker.equalCityObject.clear();\n\n //set state name text view and state pick button invisible\n //pickStateButton.setVisibility(View.VISIBLE);\n //stateNameTextView.setVisibility(View.VISIBLE);\n stateNameTextView.setText(\"State\");\n cityName.setText(\"City\");\n // set text on main view\n flagImage.setBackgroundResource(country.getFlag());\n\n\n // GET STATES OF SELECTED COUNTRY\n for (int i = 0; i < stateObject.size(); i++) {\n // init state picker\n statePicker = new StatePicker.Builder().with(this).listener(this).build();\n State stateData = new State();\n if (stateObject.get(i).getCountryId() == countryID) {\n\n stateData.setStateId(stateObject.get(i).getStateId());\n stateData.setStateName(stateObject.get(i).getStateName());\n stateData.setCountryId(stateObject.get(i).getCountryId());\n stateData.setFlag(country.getFlag());\n statePicker.equalStateObject.add(stateData);\n }\n }\n }", "@OnClick(R.id.txt_country_code)\n void onCountryCodeClicked(){\n if (mCountryPickerDialog == null){\n mCountryPickerDialog = new CountryPickerDialog(this, (country, flagResId) -> {\n mSelectedCountry = country;\n setCountryCode(mSelectedCountry);\n });\n }\n\n mCountryPickerDialog.show();\n }", "static public void set_country_data(){\n\n\t\tEdit_row_window.attrs = new String[]{\"country name:\", \"area (1000 km^2):\", \"GDP per capita (1000 $):\",\n\t\t\t\t\"population (million):\", \"capital:\", \"GDP (billion $):\"};\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), Edit_row_window.selected[0].getText(4), \n\t\t\t\tEdit_row_window.selected[0].getText(5), Edit_row_window.selected[0].getText(6)};\n\t\t\n\t\tEdit_row_window.linked_query =\t\" select distinct l.id, l.name, l.num_links, l.population \" +\n\t\t\t\t\t\t\t\t\t\t\t\" from curr_places_locations l, \" +\n\t\t\t\t\t\t\t\t\t\t\t\" curr_places_location_country lc \" +\n\t\t\t\t\t\t\t\t\t\t\t\" where lc.location_id=l.id and lc.country_id=\"+Edit_row_window.id+\n\t\t\t\t\t\t\t\t\t\t\t\" order by num_links desc \";\n\t\t\t\t\n\t\tEdit_row_window.not_linked_query = \" select distinct l.id, l.name, l.num_links, l.population \" +\n\t\t\t\t\" from curr_places_locations l \";\n\t\t\n\t\tEdit_row_window.linked_attrs = new String[]{\"id\", \"location name\", \"rating\", \"population\"};\n\t\tEdit_row_window.label_min_parameter=\"min. population:\";\n\t\tEdit_row_window.linked_category_name = \"LOCATIONS\";\n\t}", "public void setCountry(Integer country) {\n this.country = country;\n }", "public void setCountry(Integer country) {\n this.country = country;\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tIntent intent = new Intent(MainActivity.this, MapActivity.class);\n\t\t\t\tintent.putExtra(\"Choice\", 0);\n\t\t\t\tstartActivity(intent);\n\n\t\t\t}", "@Override\n public void onCountrySelected(@NotNull Country country, View countryItemView) {\n\n mainCallBack.onCountrySelected(country, countryItemView);\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n googleMap.setOnMapClickListener(new OnMapClickListener() {\n\n @Override\n public void onMapClick(LatLng arg0) {\n\n\n // TODO Auto-generated method stub\n try {\n Geocoder geo = new Geocoder(MapsActivity.this, Locale.getDefault());\n List<Address> add = geo.getFromLocation(arg0.latitude, arg0.longitude, 1);\n String selectedCountry;\n if (add.size() > 0) {\n selectedCountry = add.get(0).getCountryName();\n selectedStateOrCountry = selectedCountry;\n\n //Log.d(\"country\", selectedCountry);\n //For usa go with states . All other countries - it gives the capital\n if (selectedCountry.equalsIgnoreCase(\"United States\") ||\n selectedCountry.equalsIgnoreCase(\"US\")) {\n selectedStateOrCountry = add.get(0).getAdminArea();\n }\n //Log.d(\"state\", selectedStateOrCountry);\n ConvertTextToSpeech();\n }\n } catch (Exception e) {\n //Log.e(TAG, \"Failed to initialize map\", e);\n }\n }\n });\n mMap = googleMap;\n\n // Add a marker in California and move the camera\n LatLng californiaMarker = new LatLng(37, -122);\n mMap.addMarker(new MarkerOptions().position(californiaMarker).title(\"Click anywhere to get more info\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(californiaMarker));\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public MentorConnectRequestCompose addIndCountry(){\n\t\tmentorConnectRequestObjects.allCountries.click();\n\t\tmentorConnectRequestObjects.algeriaCountry.click();\n\t\tmentorConnectRequestObjects.allIndustries.click();\n\t\tmentorConnectRequestObjects.agriIndustry.click();\n\t\treturn new MentorConnectRequestCompose(driver);\n\t}", "public void setCountry(String country) {\n this.country = country;\n }", "public final void go() {\n this.getView().showCountries(this.getModel().getCountries());\n CountryFindChoice choice;\n do {\n choice = this.getView().askUserFindChoice();\n } while (choice == CountryFindChoice.error);\n String codeOrName = this.getView().askCodeOrName(choice);\n Country country = null;\n switch (choice) {\n case byCode:\n country = this.getModel().getCountryByCode(codeOrName);\n break;\n case byName:\n country = this.getModel().getCountryByName(codeOrName);\n break;\n }\n if(country != null) {\n this.getView().printMessage(country.getHelloWorld().getMessage());\n }\n this.getModel().close();\n }", "private void setCountryFlag(View view, String country) {\n ImageView countryView = view.findViewById(R.id.collected_country);\n if (country != null) {\n String countryResource = String.format(\"country_%s\", country.toLowerCase());\n int id = mContext.getResources().getIdentifier(countryResource, \"drawable\", mContext.getPackageName());\n if (id != 0) {\n countryView.setImageResource(id);\n countryView.setVisibility(View.VISIBLE);\n return;\n }\n }\n countryView.setVisibility(View.GONE);\n }", "private void pickCountry() {\r\n\t\tmch.clicked = false;\r\n\t\tloadButton.setVisible(false);\r\n\t\t\r\n\t\t//creates a temporary country to be moved around\r\n\t\tCountry tempC = null;\r\n\r\n\t\t//ensure the country that was clicked has yet to be claimed\r\n\t\tfor (int j = 0; j < CountryPicker.size(); j++) {\r\n\t\t\t//Add this country to the player's arrayList\r\n\t\t\tif (hoveredColor.equals(CountryPicker.get(j).getDetectionColor())) {\r\n\t\t\t\tCountryPicker.get(j).setClicked(true);\r\n\t\t\t\ttempC = CountryPicker.get(j);\r\n\t\t\t\t//colors the chosen country to the selecting player's color\r\n\t\t\t\tfor (int i = 0; i < CountryPicker.size(); i++) {\r\n\t\t\t\t\tif (CountryPicker.get(i).isClicked() == true) {\r\n\t\t\t\t\t\t threadz.recolorCountry(CountryPicker.get(i), players.get(turnCounter).getColor(), false );\r\n\t\t\t\t\t\tCountryPicker.remove(i);\r\n\t\t\t\t\t\ttempC.setTroops(1);\r\n\t\t\t\t\t\tplayers.get(turnCounter).addCountries(tempC);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// Move on to the next player's turn\r\n\r\n\t\t\t\tturnCounter++;\r\n\t\t\t\tif (turnCounter >= players.size()) {\r\n\t\t\t\t\tturnCounter = 0;\r\n\t\t\t\t}\r\n\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t//if there are no countriies left, reset the turn so player one moves first\r\n\t\tif (CountryPicker.size() == 0) {\r\n\t\t\tturnCounter = 0;\r\n\t\t}\r\n\r\n\t}", "public void setcountryCode(String countryCode) {\n this.countryCode = countryCode;\n }", "public void nextCountry(View view) {\n if (!countryList.getCountryList().isEmpty() && index < countryList.getCountryList().size()) {\n index += 1;\n displayCountry();\n }\n }", "public void setCountry(Country country) {\n this.country = country;\n }", "public void setCountry_id(String country_id) {\n this.country_id = country_id;\n }", "public void setCountryAccessCode(String countryAccessCode) {\n this.countryAccessCode = countryAccessCode;\n }", "public void setCountry(java.lang.String country) {\r\n this.country = country;\r\n }", "public void setCountry(String country) {\r\n\t\tthis.country = country;\r\n\t}", "public void setCountry(String country) {\r\n\t\tthis.country = country;\r\n\t}", "public void setCountry(String country) {\r\n\t\tthis.country = country;\r\n\t}", "public void setCountryCallingCode(int countryCallingCode) {\n this.countryCallingCode = countryCallingCode;\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id)\n {\n String stateSelect = parent.getItemAtPosition(position).toString();\n //calling the getState function present in the countrys activity\n ((countrys)getActivity()).getState(stateSelect);\n }", "@Override\n public void onItemSelected(AdapterView<?> arg0, View arg1,\n int arg2, long arg3) {\n Country selectedCountry;\n country = new Country();\n if (!(ssWholeSale_Imported_Country.getSelectedItem() == null)) {\n selectedCountry = (Country) ssWholeSale_Imported_Country.getSelectedItem();\n app.setImportSugarCountryOfOrigin(selectedCountry);\n\n String country_id = (String) selectedCountry.getC_country_id();\n\n country = selectedCountry;\n\n }\n }", "public void setCountry(java.lang.String country) {\n this.country = country;\n }", "public void setAddressCountry(String addressCountry) {\n this.addressCountry = addressCountry;\n }", "public void setCountryCode(String countryCode)\r\n\t{\r\n\t\tthis.countryCode = countryCode;\r\n\t}", "@FXML\n public void selectOneCountry(MouseEvent mouseEvent) {\n int countryIndex = lsv_ownedCountries.getSelectionModel().getSelectedIndex();\n ObservableList datalist = InfoRetriver.getAdjacentCountryObservablelist(Main.curRoundPlayerIndex, countryIndex);\n\n lsv_adjacentCountries.setItems(datalist);\n ListviewRenderer.renderCountryItems(lsv_adjacentCountries);\n }", "public void setCountry(String country) {\n\t\tthis.country = country;\n\t}", "@Override\r\n\t\t\tpublic void vertexTraversed(VertexTraversalEvent<Country> e) {\n\t\t\t\t\r\n\t\t\t}", "public void setCountryId(String countryId) {\r\n this.countryId = countryId;\r\n }", "void fetchCountryInformation();", "public void onCountrySelect(ActionEvent actionEvent) {\n divisionCombo.getItems().clear();\n int selectedCountryId;\n if (countryCombo.getValue().equals(\"U.S\")) {\n selectedCountryId = 1;\n }\n else if (countryCombo.getValue().equals(\"UK\")) {\n selectedCountryId = 2;\n }\n else if (countryCombo.getValue().equals(\"Canada\")) {\n selectedCountryId = 3;\n }\n else {\n selectedCountryId = 0;\n }\n\n ObservableList<String> divisionNames = FXCollections.observableArrayList();\n for (FirstLevelDivisions f : DBFirstLevelDivisions.getAllDivisionsFromCountryID(selectedCountryId)) {\n divisionNames.add(f.getName());\n }\n divisionCombo.setItems(divisionNames);\n }", "public void setCountryCode(String countryCode) {\n this.countryCode = countryCode;\n }", "private void setCountrySelected(String countrySelected, String divisionSelected) {\n for (Countries country : countriesList) {\n if (country.getCountry().equals(countrySelected)){\n this.countryCB.setValue(country);\n this.firstLevelDivisions = FirstLevelDivisionsDAOImpl.getAllStatesProvinces(country.getCountryID());\n stateProvinceCB.setItems(this.firstLevelDivisions);\n setSelectedStateProvince(country.getCountryID(), divisionSelected);\n return;\n }\n }\n }", "public void prevCountry(View view) {\n if (!countryList.getCountryList().isEmpty() && index > 1) {\n index -= 1;\n displayCountry();\n }\n }", "@FXML\r\n public void handleOnEditButtonClick ()\r\n {\r\n mainApp.showCountryEditDialog(country);\r\n }", "@Override\r\n public void onMapClick(LatLng latLng) {\n geocoder1 = new Geocoder(getApplicationContext(), Locale.getDefault());\r\n String State = null;\r\n String City = null;\r\n String Country = null;\r\n try {\r\n\r\n List<Address> Addresses = geocoder1.getFromLocation(latLng.latitude, latLng.longitude, 1);\r\n if (Addresses != null && Addresses.size() > 0) {\r\n\r\n City = Addresses.get(0).getAddressLine(0);\r\n State = Addresses.get(0).getAddressLine(1);\r\n Country = Addresses.get(0).getAddressLine(2);\r\n\r\n }\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n // Clears the previously touched position\r\n googleMap.clear();\r\n\r\n TextView tvLocation = (TextView) findViewById(R.id.tv_location);\r\n\r\n\r\n // Animating to the touched position\r\n googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 16.0f));\r\n\r\n // Placing a marker on the touched position\r\n googleMap.addMarker(new MarkerOptions().position(latLng).title(City + \",\" + State + \",\" + Country));\r\n\r\n tvLocation.setText(\"Latitude:\" + latitude + \", Longitude:\" + longitude + \"\\n\" + City + \",\" + State + \",\\n\" + Country);\r\n\r\n }", "public void setCountry(java.lang.String Country) {\n this.Country = Country;\n }", "public void setCountryCode(java.lang.String countryCode) {\n this.countryCode = countryCode;\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n switch (requestCode) {\n case RegisterActivity.CHANGE_COUNTRY_CODE:\n tv_cphone.setText(\"+\" + AppConfig.COUNTRY_CODE);\n break;\n default:\n break;\n }\n }", "public void setCountry(java.lang.CharSequence value) {\n this.country = value;\n }", "public void setCountryId(java.lang.String countryId) {\r\n this.countryId = countryId;\r\n }", "public void setCountry (java.lang.String country) {\n\t\tthis.country = country;\n\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\tcapitalBox.setText(getCapitalCity(countryBox.getSelectedItem().toString()));\n\t\t}", "public void setCountryId(long countryId) {\n this.countryId = countryId;\n }", "@Override\r\n\t\t\tpublic void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n\t\t\t\tCountry_ID = (Integer.parseInt(lst_countries.get(position).get(\"Country_ID\")));\r\n\t\t\t}", "public void setCountryCode(String countryCode) {\r\n\t\t\tthis.countryCode = countryCode;\r\n\t\t}", "@RequestMapping(value = \"showCountry\", method = RequestMethod.POST)\r\n public String showCountry(@RequestParam(value = \"countryCode\", required = false, defaultValue = \"pl\") String countryCode, Model model) {\r\n PanaStructureCollector psc = new PanaStructureCollector();\r\n // List<String> categories = psc.getCategoriesUrls(countryCode);\r\n model.addAttribute(\"categories\", psc.getCategoriesUrls(countryCode));\r\n System.out.println(countryCode);\r\n return \"country\";\r\n }", "void switchToMapSelectActivity();", "@Override\n\tpublic void onClick(View arg0) {\n switch (arg0.getId())\n {\n case R.id.btnContinue:\n {\n registerPhone();\n break;\n }\n case R.id.lnSelectLanguage:\n {\n Intent intent = new Intent(mContext,\n SelectNationActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP\n | Intent.FLAG_ACTIVITY_SINGLE_TOP);\n startActivityForResult(intent, Constants.KEY_SELECT_LANGUAGE);\n break;\n }\n case R.id.tvDieuKhoan:\n {\n Intent i = new Intent(Intent.ACTION_VIEW);\n String language= Pasgo.getInstance().prefs.getLanguage();\n String dieuKhoan;\n if(language.equals(Constants.LANGUAGE_VIETNAM))\n {\n dieuKhoan=Constants.KEY_DIEU_KHOAN_VN;\n }else\n {\n dieuKhoan=Constants.KEY_DIEU_KHOAN_EN;\n }\n i.setData(Uri.parse(dieuKhoan));\n startActivity(i);\n break;\n }\n }\n\t}", "@Override\n\t\t\t\t\tpublic void onItemSelected(AdapterView<?> arg0, View arg1,\n\t\t\t\t\t\t\tint position, long id) {\n\t\t\t\t\t\tint itemlselectedposition = position;\n\t\t\t\t\t\tString countrycode = countrynameSpinner\n\t\t\t\t\t\t\t\t.getSelectedItem().toString();\n\n\t\t\t\t\t\tszBankCountryCode = bankcountrycodes[itemlselectedposition];\n\t\t\t\t\t}", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n et_country = CountryNameSpinner.getSelectedItem().toString();\n et_mcode.setText(\"+\"+CountriesCode.get(position));\n }", "public void setDestinationCountry(String value) {\r\n this.destinationCountry = value;\r\n }", "private String getCountry(int countryCode) {\n switch (countryCode) {\n case 1:\n return countryName = \"Korea\";\n case 2:\n return countryName = \"England\";\n case 3:\n return countryName = \"France\";\n default:\n return \"Error\";\n }\n }", "@Override\n public void onItemSelected(AdapterView<?> adapterView, android.view.View view, int i, long l) {\n continent = continentSpinner.getSelectedItem().toString();\n\n String text = continent.replaceAll(\"\\\\s+\", \"\");\n text = text.toLowerCase();\n\n //creating name of corresponding countrie's xml string array\n String continentName = \"countries_\"+text+\"_array\";\n\n //fetching the list of countries of selected continent and storing it in to an array\n int countriesArrayID= getResources().getIdentifier(continentName , \"array\",AddNewLocation.this.getPackageName());\n String[] items = getResources().getStringArray(countriesArrayID);\n\n //showing list of countries as spinner dropdown items\n ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(AddNewLocation.this.getApplicationContext(), android.R.layout.simple_spinner_item, items);\n spinnerArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); // The drop down view\n countrySpinner.setAdapter(spinnerArrayAdapter);\n\n countrySpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n\n country = countrySpinner.getSelectedItem().toString();\n System.out.println(\"selected country = \"+country);\n\n statesSpinner.setOnTouchListener(new AdapterView.OnTouchListener(){\n\n @Override\n public boolean onTouch(View view, MotionEvent motionEvent) {\n table_name = \"states\";\n column_to_fetch = \"state\";\n column_to_serach = \"country\";\n value_to_search = new String[]{country};\n\n db_table_result_rows_list = travlogDB.getAllQueriedRows(column_to_fetch, table_name, column_to_serach, value_to_search);\n\n db_table_result_rows_list.add(\"Add State +\");\n\n ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(AddNewLocation.this.getApplicationContext(), android.R.layout.simple_spinner_item, db_table_result_rows_list);\n spinnerArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); // The drop down view\n statesSpinner.setAdapter(spinnerArrayAdapter);\n\n statesSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n state = statesSpinner.getSelectedItem().toString();\n// System.out.println(\"selected state = \"+state);\n if(state == \"Add State +\")\n {\n //showing pop up alert dialog box to add new item\n AlertDialog.Builder builder = new AlertDialog.Builder(AddNewLocation.this);\n builder.setTitle(\"Add New State\");\n builder.setMessage(\"Enter State Name\");\n\n final EditText input_add_new_state = new EditText(AddNewLocation.this);\n LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(\n LinearLayout.LayoutParams.MATCH_PARENT,\n LinearLayout.LayoutParams.MATCH_PARENT);\n input_add_new_state.setLayoutParams(lp);\n builder.setView(input_add_new_state);\n// builder.setIcon(R.drawable.key);\n\n builder.setCancelable(true)\n .setPositiveButton(\"Add\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n // this block will execute when we click on \"Yes\"\n state = input_add_new_state.getText().toString();\n System.out.println(\"hehe=\"+state);\n db_table_result_rows_list.remove(0);\n db_table_result_rows_list.add(state);\n\n ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(AddNewLocation.this.getApplicationContext(), android.R.layout.simple_spinner_item, db_table_result_rows_list);\n spinnerArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); // The drop down view\n statesSpinner.setAdapter(spinnerArrayAdapter);\n\n statesSpinner.setSelection(((ArrayAdapter<String>)statesSpinner.getAdapter()).getPosition(state));\n\n //district spinner flow starts here\n if(state != \"\")\n {\n System.out.println(\"entered to district spinner flow\");\n districtsSpinner.setOnTouchListener(new AdapterView.OnTouchListener() {\n @Override\n public boolean onTouch(View view, MotionEvent motionEvent) {\n table_name = \"districts\";\n column_to_fetch = \"district\";\n column_to_serach = \"state\";\n value_to_search = new String[]{state};\n\n db_table_result_rows_list = travlogDB.getAllQueriedRows(column_to_fetch, table_name, column_to_serach, value_to_search);\n\n db_table_result_rows_list.add(\"Add District +\");\n\n ArrayAdapter<String> spinnerArrayAdapterDistrict = new ArrayAdapter<String>(AddNewLocation.this.getApplicationContext(), android.R.layout.simple_spinner_item, db_table_result_rows_list);\n spinnerArrayAdapterDistrict.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); // The drop down view\n districtsSpinner.setAdapter(spinnerArrayAdapterDistrict);\n\n districtsSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n district = districtsSpinner.getSelectedItem().toString();\n// System.out.println(\"selected district = \"+district);\n if(district == \"Add District +\")\n {\n //showing pop up alert dialog box to add new item\n AlertDialog.Builder builder = new AlertDialog.Builder(AddNewLocation.this);\n builder.setTitle(\"Add New District\");\n builder.setMessage(\"Enter District Name\");\n\n final EditText input_add_new_district = new EditText(AddNewLocation.this);\n LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(\n LinearLayout.LayoutParams.MATCH_PARENT,\n LinearLayout.LayoutParams.MATCH_PARENT);\n input_add_new_district.setLayoutParams(lp);\n builder.setView(input_add_new_district);\n\n builder.setCancelable(true)\n .setPositiveButton(\"Add\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n // this block will execute when we click on \"Yes\"\n district = input_add_new_district.getText().toString();\n\n db_table_result_rows_list.remove(0);\n db_table_result_rows_list.add(district);\n\n ArrayAdapter<String> spinnerArrayAdapterDistrict = new ArrayAdapter<String>(AddNewLocation.this.getApplicationContext(), android.R.layout.simple_spinner_item, db_table_result_rows_list);\n spinnerArrayAdapterDistrict.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); // The drop down view\n districtsSpinner.setAdapter(spinnerArrayAdapterDistrict);\n\n districtsSpinner.setSelection(((ArrayAdapter<String>)districtsSpinner.getAdapter()).getPosition(district));\n\n }\n }).setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n // this block will execute when we click on \"Cancel\"\n district = \"\";\n dialogInterface.cancel();\n }\n });\n\n AlertDialog alertDialog = builder.create();\n alertDialog.setTitle(\"Add New District\");\n alertDialog.show();\n }\n\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> adapterView) {\n district = \"\";\n }\n });\n return false;\n }\n });\n }\n\n //district spinnner flow ends here\n\n }\n }).setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n // this block will execute when we click on \"Cancel\"\n state = \"\";\n dialogInterface.cancel();\n }\n });\n\n AlertDialog alertDialog = builder.create();\n alertDialog.setTitle(\"Add New State\");\n alertDialog.show();\n }\n\n else\n {\n //district spinner flow starts here\n if(state != \"\")\n {\n System.out.println(\"entered to district spinner flow\");\n districtsSpinner.setOnTouchListener(new AdapterView.OnTouchListener() {\n @Override\n public boolean onTouch(View view, MotionEvent motionEvent) {\n table_name = \"districts\";\n column_to_fetch = \"district\";\n column_to_serach = \"state\";\n value_to_search = new String[]{state};\n\n db_table_result_rows_list = travlogDB.getAllQueriedRows(column_to_fetch, table_name, column_to_serach, value_to_search);\n\n db_table_result_rows_list.add(\"Add District +\");\n\n ArrayAdapter<String> spinnerArrayAdapterDistrict = new ArrayAdapter<String>(AddNewLocation.this.getApplicationContext(), android.R.layout.simple_spinner_item, db_table_result_rows_list);\n spinnerArrayAdapterDistrict.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); // The drop down view\n districtsSpinner.setAdapter(spinnerArrayAdapterDistrict);\n\n districtsSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n district = districtsSpinner.getSelectedItem().toString();\n// System.out.println(\"selected district = \"+district);\n if(district == \"Add District +\")\n {\n //showing pop up alert dialog box to add new item\n AlertDialog.Builder builder = new AlertDialog.Builder(AddNewLocation.this);\n builder.setTitle(\"Add New District\");\n builder.setMessage(\"Enter District Name\");\n\n final EditText input_add_new_district = new EditText(AddNewLocation.this);\n LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(\n LinearLayout.LayoutParams.MATCH_PARENT,\n LinearLayout.LayoutParams.MATCH_PARENT);\n input_add_new_district.setLayoutParams(lp);\n builder.setView(input_add_new_district);\n\n builder.setCancelable(true)\n .setPositiveButton(\"Add\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n // this block will execute when we click on \"Yes\"\n district = input_add_new_district.getText().toString();\n\n db_table_result_rows_list.remove(0);\n db_table_result_rows_list.add(district);\n\n ArrayAdapter<String> spinnerArrayAdapterDistrict = new ArrayAdapter<String>(AddNewLocation.this.getApplicationContext(), android.R.layout.simple_spinner_item, db_table_result_rows_list);\n spinnerArrayAdapterDistrict.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); // The drop down view\n districtsSpinner.setAdapter(spinnerArrayAdapterDistrict);\n\n districtsSpinner.setSelection(((ArrayAdapter<String>)districtsSpinner.getAdapter()).getPosition(district));\n\n }\n }).setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n // this block will execute when we click on \"Cancel\"\n district = \"\";\n dialogInterface.cancel();\n }\n });\n\n AlertDialog alertDialog = builder.create();\n alertDialog.setTitle(\"Add New District\");\n alertDialog.show();\n }\n\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> adapterView) {\n district = \"\";\n }\n });\n return false;\n }\n });\n }\n\n //district spinnner flow ends here\n }\n\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> adapterView) {\n state = \"\";\n }\n\n });\n\n System.out.println(\"stateeee=\"+state);\n return false;\n }\n });\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> adapterView) {\n\n }\n });\n }", "public void displayCountry() {\n Country country = countryList.getCountryById(index);\n\n ImageView image = (ImageView) findViewById(R.id.ImageViewCountry);\n image.setImageResource(country.getImage());\n\n TextView name = (TextView) findViewById(R.id.CountryName);\n name.setText(country.getName());\n\n TextView capital = (TextView) findViewById(R.id.CountryCapital);\n capital.setText(country.getCapital());\n\n TextView population = (TextView) findViewById(R.id.CountryPopulation);\n population.setText(country.getPopulation());\n\n TextView climat = (TextView) findViewById(R.id.CountryClimat);\n climat.setText(country.getClimat());\n\n TextView description = (TextView) findViewById(R.id.CountryDescription);\n description.setText(country.getDescription());\n }", "public void setCountryId(int value);", "@Override\n\t\t\tpublic void onClick(View v)\n\t\t\t{\n\t\t\t\tIntent intent = new Intent(DeviceActivity.this, sdw.com.CountyActivity.class);// ����������Activity\n\t\t\t\t Bundle bundle = new Bundle(0); \n\t bundle.putString(\"fun1\",transferValue); \n\t bundle.putString(\"search1\",\"btnCheckMap\");\n\t intent.putExtras(bundle);//\n\t\t\t\tstartActivity(intent);\n\t\t\t\t//finish();\n\t\t\t}", "@Override\n public void onClick(View v) {\n\n Intent intent = new Intent(v.getContext(), DetailViewActivity.class);\n intent.putExtra(\"title\", countries.get(position).getName());\n intent.putExtra(\"link\", countries.get(position).altSpellings.get(0));\n v.getContext().startActivity(intent);\n\n\n\n }", "public void setCountryName(String value);", "@Override\n public void onClick(View view) {\n String geoUri = \"http://maps.google.com/maps?q=loc:\" + 18.5155346 + \",\" + 73.7836165 + \" (\" + \"Manyavar\" + \")\";\n Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(geoUri));\n mcontext.startActivity(intent);\n\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent intent = null,chooser = null;\n\t\t\t\tintent = new Intent(android.content.Intent.ACTION_VIEW);\n\t \t\t//For any Action\n\t \t\tintent.setData(Uri.parse(\"geo:27.961429,76.402788\"));\n\t \t\tchooser = Intent.createChooser(intent,\"MAPS Launch\");\n\t \t\tstartActivity(chooser);\n\t\t\t}", "void onPickPhoneNumberAction(HashMap<String,String> pairs);", "void mapChosen(int map);", "@Override\r\n\t//Allows buttons on the graph to be controlled by changes in the DropDown boxes.\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\tcitiesActive.clear();\r\n\t\tcitiesActive.add((String) t.getSelectedItem());\r\n\t\tthis.middleEarth.activateButton((String) t.getSelectedItem(), this.thatCity);\n\t}", "@Override\n public void onItemSelected(AdapterView<?> adapter, View view,\n int position, long id) {\n chefRegCountry = countryList.get(position);\n countryid = countryId.get(position);\n\n if(!countryid.equalsIgnoreCase(\"-1\"))\n doStateList(countryid);\n }", "@FXML\n void selectCountry() {\n \t//hide all errors\n \thideErrors();\n \t//Getting start year and end year limits from /type/country/metadata.txt\n if (isComboBoxEmpty(T3_country_ComboBox.getValue())){\n //if nothing has been selected do nothing\n return;\n }\n String type = T3_type_ComboBox.getValue(); // getting type\n String country = T3_country_ComboBox.getValue(); // getting country\n //update ranges\n Pair<String,String> validRange = DatasetHandler.getValidRange(type,country);\n\n //update relevant menus\n\n int start = Integer.parseInt(validRange.getKey());\n int end = Integer.parseInt(validRange.getValue());\n //set up end list\n endOptions.clear();\n startOptions.clear();\n for (int i = start; i <= end ; ++i){\n endOptions.add(Integer.toString(i));\n startOptions.add(Integer.toString(i));\n }\n //set up comboBox default values and valid lists\n T3_startYear_ComboBox.setValue(Integer.toString(start));\n T3_endYear_ComboBox.setValue(Integer.toString(end));\n }", "Country(int flagImage, String name) {\n this.flagImage = flagImage;\n this.name = name;\n }", "public void setCountryName(String countryName) {\n this.countryName = countryName;\n }", "public void setCountryName(String countryName) {\n this.countryName = countryName;\n }", "public void onClickDictionary(View view) {\n Intent intent = new Intent(this, DictionaryActivity.class);\n startActivity(intent);\n }", "@Override\r\n\t\t\t\t\t\t\t\t\t\tpublic void onClick(\r\n\t\t\t\t\t\t\t\t\t\t\t\tDialogInterface dialog,\r\n\t\t\t\t\t\t\t\t\t\t\t\tint which) {\n\t\t\t\t\t\t\t\t\t\t\tIntent intent = new Intent(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAdminMapField.this,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAdminMapField.class);\r\n\t\t\t\t\t\t\t\t\t\t\tstartActivity(intent);\r\n\t\t\t\t\t\t\t\t\t\t}", "private void initChoose() {\n lat = view.findViewById(R.id.lat);\r\n lng = view.findViewById(R.id.lng);\r\n//\r\n// huayuan.setOnClickListener(new View.OnClickListener() {\r\n// @Override\r\n// public void onClick(View view) {\r\n// huayuan.setBackgroundColor(Color.RED);\r\n// louceng.setBackgroundColor(0x99EEE6E6);\r\n// lu.setBackgroundColor(0x99EEE6E6);\r\n// qita.setBackgroundColor(0x99EEE6E6);\r\n// choose = 1;\r\n// }\r\n// });\r\n//\r\n// louceng.setOnClickListener(new View.OnClickListener() {\r\n// @Override\r\n// public void onClick(View view) {\r\n// louceng.setBackgroundColor(Color.RED);\r\n// huayuan.setBackgroundColor(0x99EEE6E6);\r\n// lu.setBackgroundColor(0x99EEE6E6);\r\n// qita.setBackgroundColor(0x99EEE6E6);\r\n// choose = 2;\r\n// }\r\n// });\r\n// lu.setOnClickListener(new View.OnClickListener() {\r\n// @Override\r\n// public void onClick(View view) {\r\n// lu.setBackgroundColor(Color.RED);\r\n// louceng.setBackgroundColor(0x99EEE6E6);\r\n// huayuan.setBackgroundColor(0x99EEE6E6);\r\n// qita.setBackgroundColor(0x99EEE6E6);\r\n// choose = 3;\r\n// }\r\n// });\r\n// qita.setOnClickListener(new View.OnClickListener() {\r\n// @Override\r\n// public void onClick(View view) {\r\n// qita.setBackgroundColor(Color.RED);\r\n// louceng.setBackgroundColor(0x99EEE6E6);\r\n// lu.setBackgroundColor(0x99EEE6E6);\r\n// huayuan.setBackgroundColor(0x99EEE6E6);\r\n// choose = 4;\r\n// }\r\n// });\r\n }", "public String getCountry() {\r\n return this.country;\r\n }", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n\n// GeoCoderUtils.getCountryCode(3.152194, 101.778446, RegisterActivityNewFirst.this, new GeoCoderUtils.GeocoderListner() {\n// GeoCoderUtils.getCountryCode(location.getLatitude(), location.getLongitude(), RegisterActivityNewFirst.this, new GeoCoderUtils.GeocoderListner() {\n\n GeoCoderUtils.getCountryCode(location.getLatitude(), location.getLongitude(), RegisterActivityNewFirst.this, new GeoCoderUtils.GeocoderListner() {\n// GeoCoderUtils.getCountryCode(25.105497, 121.597366, RegisterActivityNewFirst.this, new GeoCoderUtils.GeocoderListner() {\n// malasia GeoCoderUtils.getCountryCode(3.152194, 101.778446, RegisterActivityNewFirst.this, new GeoCoderUtils.GeocoderListner() {\n @Override\n public void onGetCode(String country_name,String country_code, String stateNamefromeo, String cityNamefrogeo) {\n\n countryName = country_name;\n stateNamefromGeo = stateNamefromeo;\n cityNameFromGeo = cityNamefrogeo;\n CommonUtils.showLog(\"location1\", \"Code is :\" + country_code);\n if (country_code != null) {\n String dialcode = \"\";\n if (countryCode != null && countryList != null) {\n for (int i = 0; i < countryList.size(); i++) {\n if (country_code.equalsIgnoreCase(countryList.get(i).getCountrycode())) {\n CommonUtils.showLog(\"location2\", \"Code is :\" + country_code);\n textViewCountry.setText(\"\" + countryList.get(i).getName());\n countryId = countryList.get(i).getId();\n countryCode = country_code;\n getState();\n textViewDialCode.setText(\"+\" + countryList.get(i).getPhonecode());\n dialCode = countryList.get(i).getPhonecode();\n\n for (int j = 0; j < Country.getAllCountries().size(); j++) {\n {\n if (countryList.get(i).getName().equalsIgnoreCase(Country.getAllCountries().get(j).getName())) {\n imageViewFlag.setImageResource(Country.getAllCountries().get(j).getFlag());\n return;\n }\n }\n }\n return;\n }\n }\n }\n }\n }\n });\n }\n }", "public final void setCountry(final String ccountry) {\n\t\tthis.country = ccountry;\n\t}", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n\n //Changes capital/language/currency/visa textView based on country spinner selection by corresponding array position\n //The array is searched (deliverable 7)\n asiaCapital.setText(capital[position]);\n asiaLanguage.setText(language[position]);\n asiaCurrency.setText(currency[position]);\n asiaVisa.setText(visa[position]);\n }", "@Override\r\n\tpublic void onClick(View view) {\n\t\tswitch (view.getId()) {\r\n\t\tcase R.id.vc_shuaixi:\r\n\t\t\tvc_image.setImageBitmap(Code.getInstance().getBitmap());\r\n\t\t\tgetCode = Code.getInstance().getCode();\r\n\t\t\tbreak;\t\t\r\n\t\t}\r\n\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.main);\n\n\t\tButton clocation, bangalore, chennai;\n\t\tclocation = (Button) findViewById(R.id.clocation);\n\t\tbangalore = (Button) findViewById(R.id.bangalore);\n\t\tchennai = (Button) findViewById(R.id.chennai);\n\n\t\tclocation.setOnClickListener(new OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tIntent intent = new Intent(MainActivity.this, MapActivity.class);\n\t\t\t\tintent.putExtra(\"Choice\", 0);\n\t\t\t\tstartActivity(intent);\n\n\t\t\t}\n\t\t});\n\n\t\tbangalore.setOnClickListener(new OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tIntent intent = new Intent(MainActivity.this, MapActivity.class);\n\t\t\t\tintent.putExtra(\"Choice\", 1);\n\t\t\t\tintent.putExtra(\"latb\", 12.9716);\n\t\t\t\tintent.putExtra(\"lngb\", 77.5946);\n\t\t\t\tstartActivity(intent);\n\n\t\t\t}\n\t\t});\n\n\t\tchennai.setOnClickListener(new OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tIntent intent = new Intent(MainActivity.this, MapActivity.class);\n\t\t\t\tintent.putExtra(\"Choice\", 2);\n\t\t\t\tintent.putExtra(\"latc\", 13.0827);\n\t\t\t\tintent.putExtra(\"lngc\", 80.2707);\n\t\t\t\tstartActivity(intent);\n\n\t\t\t}\n\t\t});\n\n\t}" ]
[ "0.70702666", "0.64028454", "0.6307177", "0.6270544", "0.6267239", "0.62606865", "0.62514424", "0.620435", "0.6158291", "0.61035764", "0.60792476", "0.60475665", "0.6011524", "0.5981727", "0.58871055", "0.581104", "0.5803976", "0.5803976", "0.5692443", "0.5686803", "0.56475586", "0.56431204", "0.56431204", "0.56431204", "0.56431204", "0.56431204", "0.56431204", "0.56343096", "0.5625351", "0.5619529", "0.5617517", "0.5596992", "0.55883914", "0.557801", "0.55612457", "0.5492834", "0.5476597", "0.5472486", "0.5471802", "0.5471802", "0.5471802", "0.5468987", "0.54678535", "0.54631925", "0.54603815", "0.54416496", "0.5400534", "0.5395688", "0.5386919", "0.5375668", "0.5353512", "0.5339523", "0.5332522", "0.53265446", "0.53207207", "0.5319397", "0.53180873", "0.52980185", "0.52818453", "0.52658385", "0.52483577", "0.5239266", "0.521851", "0.5206005", "0.51972336", "0.5187265", "0.518722", "0.5183028", "0.51793206", "0.5166259", "0.5158909", "0.5153885", "0.51469177", "0.51389307", "0.51264864", "0.5122596", "0.5109949", "0.510969", "0.51041013", "0.5103783", "0.50921834", "0.50909907", "0.50870854", "0.50857425", "0.5082968", "0.5061444", "0.5055221", "0.5052488", "0.5038721", "0.5036049", "0.5036049", "0.5029008", "0.5028523", "0.5026107", "0.502089", "0.5019466", "0.5018696", "0.50122535", "0.5008886", "0.5003446" ]
0.7018097
1
makes it neater to collate all countries and countryCodes together
private String getCountry(int countryCode) { switch (countryCode) { case 1: return countryName = "Korea"; case 2: return countryName = "England"; case 3: return countryName = "France"; default: return "Error"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void _generateAdjacentCountries() {\n\n // North America\n this.adjCountries.put(CountryName.Alaska, new CountryName[] {\n CountryName.NorthwestTerritories });\n this.adjCountries.put(CountryName.WesternCanada, new CountryName[] {\n CountryName.NorthwestTerritories,\n CountryName.CentralCanada,\n CountryName.WesternCanada,\n CountryName.WesternUS});\n this.adjCountries.put(CountryName.CentralAmerica, new CountryName[] {\n CountryName.EasternUS,\n CountryName.WesternUS,\n CountryName.Venezuela});\n this.adjCountries.put(CountryName.EasternUS, new CountryName[] {\n CountryName.CentralAmerica,\n CountryName.CentralCanada,\n CountryName.WesternUS });\n this.adjCountries.put(CountryName.Greenland, new CountryName[] {\n CountryName.NorthwestTerritories,\n CountryName.CentralCanada,\n CountryName.EasternCanada,\n CountryName.Iceland });\n this.adjCountries.put(CountryName.NorthwestTerritories, new CountryName[] {\n CountryName.Alaska,\n CountryName.WesternCanada,\n CountryName.Greenland,\n CountryName.CentralCanada });\n this.adjCountries.put(CountryName.CentralCanada, new CountryName[] {\n CountryName.WesternCanada,\n CountryName.Greenland,\n CountryName.NorthwestTerritories,\n CountryName.EasternCanada });\n this.adjCountries.put(CountryName.EasternCanada, new CountryName[] {\n CountryName.EasternUS,\n CountryName.Greenland,\n CountryName.NorthwestTerritories,\n CountryName.CentralCanada });\n this.adjCountries.put(CountryName.WesternUS, new CountryName[] {\n CountryName.WesternCanada,\n CountryName.CentralAmerica,\n CountryName.EasternUS,\n CountryName.CentralCanada });\n\n // South America\n this.adjCountries.put(CountryName.Argentina, new CountryName[] {\n CountryName.Brazil,\n CountryName.Peru });\n this.adjCountries.put(CountryName.Brazil, new CountryName[] {\n CountryName.Argentina,\n CountryName.Peru,\n CountryName.Venezuela});\n this.adjCountries.put(CountryName.Peru, new CountryName[] {\n CountryName.Argentina,\n CountryName.Brazil,\n CountryName.Venezuela });\n this.adjCountries.put(CountryName.Venezuela, new CountryName[] {\n CountryName.Brazil,\n CountryName.Peru,\n CountryName.CentralAmerica});\n\n // Europe\n this.adjCountries.put(CountryName.GreatBritain, new CountryName[] {\n CountryName.Iceland,\n CountryName.NorthernEurope,\n CountryName.Scandinavia,\n CountryName.WesternEurope });\n this.adjCountries.put(CountryName.Iceland, new CountryName[] {\n CountryName.GreatBritain,\n CountryName.Greenland });\n this.adjCountries.put(CountryName.NorthernEurope, new CountryName[] {\n CountryName.GreatBritain,\n CountryName.Scandinavia,\n CountryName.SouthernEurope,\n CountryName.Ukraine,\n CountryName.WesternEurope });\n this.adjCountries.put(CountryName.Scandinavia, new CountryName[] {\n CountryName.GreatBritain,\n CountryName.Iceland,\n CountryName.NorthernEurope,\n CountryName.Ukraine });\n this.adjCountries.put(CountryName.SouthernEurope, new CountryName[] {\n CountryName.NorthernEurope,\n CountryName.Ukraine,\n CountryName.WesternEurope,\n CountryName.Egypt,\n CountryName.NorthAfrica,\n CountryName.MiddleEast });\n this.adjCountries.put(CountryName.Ukraine, new CountryName[] {\n CountryName.NorthernEurope,\n CountryName.Scandinavia,\n CountryName.SouthernEurope,\n CountryName.Afghanistan,\n CountryName.MiddleEast,\n CountryName.Ural });\n this.adjCountries.put(CountryName.WesternEurope, new CountryName[] {\n CountryName.GreatBritain,\n CountryName.NorthernEurope,\n CountryName.SouthernEurope,\n CountryName.NorthAfrica });\n\n // Africa\n this.adjCountries.put(CountryName.Congo, new CountryName[] {\n CountryName.EastAfrica,\n CountryName.NorthAfrica,\n CountryName.SouthAfrica });\n this.adjCountries.put(CountryName.EastAfrica, new CountryName[] {\n CountryName.Congo,\n CountryName.Egypt,\n CountryName.Madagascar,\n CountryName.MiddleEast });\n this.adjCountries.put(CountryName.Egypt, new CountryName[] {\n CountryName.EastAfrica,\n CountryName.NorthAfrica,\n CountryName.SouthernEurope,\n CountryName.MiddleEast });\n this.adjCountries.put(CountryName.Madagascar, new CountryName[] {\n CountryName.EastAfrica,\n CountryName.SouthAfrica });\n this.adjCountries.put(CountryName.NorthAfrica, new CountryName[] {\n CountryName.Congo,\n CountryName.Egypt,\n CountryName.Brazil,\n CountryName.SouthernEurope,\n CountryName.WesternEurope });\n this.adjCountries.put(CountryName.SouthAfrica, new CountryName[] {\n CountryName.Congo,\n CountryName.EastAfrica,\n CountryName.Madagascar });\n\n // Asia\n this.adjCountries.put(CountryName.Afghanistan, new CountryName[] {\n CountryName.China,\n CountryName.India,\n CountryName.MiddleEast,\n CountryName.Ural,\n CountryName.Ukraine });\n this.adjCountries.put(CountryName.China, new CountryName[] {\n CountryName.Afghanistan,\n CountryName.India,\n CountryName.Mongolia,\n CountryName.Siam,\n CountryName.Siberia,\n CountryName.Ural });\n this.adjCountries.put(CountryName.India, new CountryName[] {\n CountryName.Afghanistan,\n CountryName.China,\n CountryName.MiddleEast });\n this.adjCountries.put(CountryName.Irkutsk, new CountryName[] {\n CountryName.Kamchatka,\n CountryName.Mongolia,\n CountryName.Siberia,\n CountryName.Yakutsk });\n this.adjCountries.put(CountryName.Japan, new CountryName[] {\n CountryName.Kamchatka,\n CountryName.Mongolia });\n this.adjCountries.put(CountryName.Kamchatka, new CountryName[] {\n CountryName.Irkutsk,\n CountryName.Japan,\n CountryName.Yakutsk });\n this.adjCountries.put(CountryName.MiddleEast, new CountryName[] {\n CountryName.Afghanistan,\n CountryName.India,\n CountryName.EastAfrica,\n CountryName.Egypt,\n CountryName.SouthernEurope,\n CountryName.Ukraine });\n this.adjCountries.put(CountryName.Mongolia, new CountryName[] {\n CountryName.China,\n CountryName.Irkutsk,\n CountryName.Japan,\n CountryName.Kamchatka,\n CountryName.Siberia });\n this.adjCountries.put(CountryName.Siam, new CountryName[] {\n CountryName.China,\n CountryName.India,\n CountryName.Indonesia });\n this.adjCountries.put(CountryName.Siberia, new CountryName[] {\n CountryName.China,\n CountryName.Irkutsk,\n CountryName.Mongolia,\n CountryName.Ural,\n CountryName.Yakutsk });\n this.adjCountries.put(CountryName.Ural, new CountryName[] {\n CountryName.Afghanistan,\n CountryName.China,\n CountryName.Siberia,\n CountryName.Ukraine });\n this.adjCountries.put(CountryName.Yakutsk, new CountryName[] {\n CountryName.Irkutsk,\n CountryName.Kamchatka,\n CountryName.Siberia });\n\n // Australia\n this.adjCountries.put(CountryName.EasternAustralia, new CountryName[] {\n CountryName.NewGuinea,\n CountryName.WesternAustralia});\n this.adjCountries.put(CountryName.Indonesia, new CountryName[] {\n CountryName.NewGuinea,\n CountryName.WesternAustralia,\n CountryName.Siam });\n this.adjCountries.put(CountryName.NewGuinea, new CountryName[] {\n CountryName.EasternAustralia,\n CountryName.Indonesia });\n this.adjCountries.put(CountryName.WesternAustralia, new CountryName[] {\n CountryName.EasternAustralia,\n CountryName.NewGuinea,\n CountryName.Indonesia});\n }", "void countries_init() throws SQLException {\r\n countries = DatabaseQuerySF.get_all_stations();\r\n }", "public static CCodeAdj2CTRYtype getCountryCode2CountryMap() {\n return countryCode2CountryMap;\n }", "private void buildCountryComboBox() {\n ResultSet rs = DatabaseConnection.performQuery(\n session.getConn(),\n Path.of(Constants.QUERY_SCRIPT_PATH_BASE + \"SelectCountryByID.sql\"),\n Collections.singletonList(Constants.WILDCARD)\n );\n\n ObservableList<Country> countries = FXCollections.observableArrayList();\n try {\n if (rs != null) {\n while (rs.next()) {\n int id = rs.getInt(\"Country_ID\");\n String name = rs.getString(\"Country\");\n countries.add(new Country(id, name));\n }\n }\n } catch (Exception e) {\n Common.handleException(e);\n }\n\n countryComboBox.setItems(countries);\n\n countryComboBox.setConverter(new StringConverter<>() {\n @Override\n public String toString(Country item) {\n return item.getCountryName();\n }\n\n @Override\n public Country fromString(String string) {\n return null;\n }\n });\n }", "public void populateBasicCountryNames() {\n basicCountryNames = new HashMap<>();\n for (Country c : countries.getCountries()) {\n basicCountryNames.put(c.getNamenorm(), c);\n }\n basicCountryNames.put(\"united states\", countries.getCountry(\"US\"));\n }", "public void setCountries(List<Country> countries)\n {\n this.countries = countries;\n\n countriesMap = countries.stream().\n filter(c -> !\"-99\".equals(c.getIsoCode())).\n collect(Collectors.toMap(Country::getIsoCode, Function.identity()));\n\n LOGGER.info(\"Stored {} countries with valid code ( != -99) \", countriesMap.size());\n\n regions = new WorldRegions(countries);\n }", "private void clearCountryCode() {\n\n countryCode_ = getDefaultInstance().getCountryCode();\n }", "public void populateAllCountries(SolrGazetteer gaz) {\n // SolrGazetteer has full Country metadata, like\n // GeonamesUtility lists offical countries (with TZ, region, aliases, codes)\n // SolrGazetteer lists more aliases/name variants.\n // So have Map( variant =&gt; Country ), where Country is official one.\n //\n allCountries = new HashMap<>();\n\n // Gather 'Official names'\n for (Country C : countries.getCountries()) {\n // NAME: 'United States of America'\n allCountries.put(C.getName().toLowerCase(), C);\n // ISO alpha-2 'US'\n allCountries.put(C.CC_ISO2.toLowerCase(), C);\n // ISO alpha-3 'USA'\n allCountries.put(C.CC_ISO3.toLowerCase(), C);\n }\n\n // Gather name variants from anything that looks like PCLI or PCLI* in\n // gazetteer:\n //\n for (String cc : gaz.getCountries().keySet()) {\n Country alt = gaz.getCountries().get(cc);\n Country C = countries.getCountry(cc);\n // NAME: 'United States of America'\n allCountries.put(alt.getName().toLowerCase(), C);\n // ISO alpha-2 'US'\n allCountries.put(alt.CC_ISO2.toLowerCase(), C);\n // ISO alpha-3 'USA'\n allCountries.put(alt.CC_ISO3.toLowerCase(), C);\n for (String a : alt.getAliases()) {\n // Aliases: 'U.S.A', 'US of A', 'America', etc.\n //\n allCountries.put(a.toLowerCase(), C);\n }\n }\n }", "public static Set<String> getRegionCodeSet() {\n // The capacity is set to 321 as there are 241 different entries,\n // and this offers a load factor of roughly 0.75.\n Set<String> regionCodeSet = new HashSet<String>(321);\n\n regionCodeSet.add(\"AC\");\n regionCodeSet.add(\"AD\");\n regionCodeSet.add(\"AE\");\n regionCodeSet.add(\"AF\");\n regionCodeSet.add(\"AG\");\n regionCodeSet.add(\"AI\");\n regionCodeSet.add(\"AL\");\n regionCodeSet.add(\"AM\");\n regionCodeSet.add(\"AO\");\n regionCodeSet.add(\"AR\");\n regionCodeSet.add(\"AS\");\n regionCodeSet.add(\"AT\");\n regionCodeSet.add(\"AU\");\n regionCodeSet.add(\"AW\");\n regionCodeSet.add(\"AX\");\n regionCodeSet.add(\"AZ\");\n regionCodeSet.add(\"BA\");\n regionCodeSet.add(\"BB\");\n regionCodeSet.add(\"BD\");\n regionCodeSet.add(\"BE\");\n regionCodeSet.add(\"BF\");\n regionCodeSet.add(\"BG\");\n regionCodeSet.add(\"BH\");\n regionCodeSet.add(\"BI\");\n regionCodeSet.add(\"BJ\");\n regionCodeSet.add(\"BL\");\n regionCodeSet.add(\"BM\");\n regionCodeSet.add(\"BN\");\n regionCodeSet.add(\"BO\");\n regionCodeSet.add(\"BQ\");\n regionCodeSet.add(\"BR\");\n regionCodeSet.add(\"BS\");\n regionCodeSet.add(\"BT\");\n regionCodeSet.add(\"BW\");\n regionCodeSet.add(\"BY\");\n regionCodeSet.add(\"BZ\");\n regionCodeSet.add(\"CA\");\n regionCodeSet.add(\"CC\");\n regionCodeSet.add(\"CD\");\n regionCodeSet.add(\"CF\");\n regionCodeSet.add(\"CG\");\n regionCodeSet.add(\"CH\");\n regionCodeSet.add(\"CI\");\n regionCodeSet.add(\"CK\");\n regionCodeSet.add(\"CL\");\n regionCodeSet.add(\"CM\");\n regionCodeSet.add(\"CN\");\n regionCodeSet.add(\"CO\");\n regionCodeSet.add(\"CR\");\n regionCodeSet.add(\"CU\");\n regionCodeSet.add(\"CV\");\n regionCodeSet.add(\"CW\");\n regionCodeSet.add(\"CX\");\n regionCodeSet.add(\"CY\");\n regionCodeSet.add(\"CZ\");\n regionCodeSet.add(\"DE\");\n regionCodeSet.add(\"DJ\");\n regionCodeSet.add(\"DK\");\n regionCodeSet.add(\"DM\");\n regionCodeSet.add(\"DO\");\n regionCodeSet.add(\"DZ\");\n regionCodeSet.add(\"EC\");\n regionCodeSet.add(\"EE\");\n regionCodeSet.add(\"EG\");\n regionCodeSet.add(\"EH\");\n regionCodeSet.add(\"ER\");\n regionCodeSet.add(\"ES\");\n regionCodeSet.add(\"ET\");\n regionCodeSet.add(\"FI\");\n regionCodeSet.add(\"FJ\");\n regionCodeSet.add(\"FK\");\n regionCodeSet.add(\"FM\");\n regionCodeSet.add(\"FO\");\n regionCodeSet.add(\"FR\");\n regionCodeSet.add(\"GA\");\n regionCodeSet.add(\"GB\");\n regionCodeSet.add(\"GD\");\n regionCodeSet.add(\"GE\");\n regionCodeSet.add(\"GF\");\n regionCodeSet.add(\"GG\");\n regionCodeSet.add(\"GH\");\n regionCodeSet.add(\"GI\");\n regionCodeSet.add(\"GL\");\n regionCodeSet.add(\"GM\");\n regionCodeSet.add(\"GN\");\n regionCodeSet.add(\"GP\");\n regionCodeSet.add(\"GR\");\n regionCodeSet.add(\"GT\");\n regionCodeSet.add(\"GU\");\n regionCodeSet.add(\"GW\");\n regionCodeSet.add(\"GY\");\n regionCodeSet.add(\"HK\");\n regionCodeSet.add(\"HN\");\n regionCodeSet.add(\"HR\");\n regionCodeSet.add(\"HT\");\n regionCodeSet.add(\"HU\");\n regionCodeSet.add(\"ID\");\n regionCodeSet.add(\"IE\");\n regionCodeSet.add(\"IL\");\n regionCodeSet.add(\"IM\");\n regionCodeSet.add(\"IN\");\n regionCodeSet.add(\"IQ\");\n regionCodeSet.add(\"IR\");\n regionCodeSet.add(\"IS\");\n regionCodeSet.add(\"IT\");\n regionCodeSet.add(\"JE\");\n regionCodeSet.add(\"JM\");\n regionCodeSet.add(\"JO\");\n regionCodeSet.add(\"JP\");\n regionCodeSet.add(\"KE\");\n regionCodeSet.add(\"KG\");\n regionCodeSet.add(\"KH\");\n regionCodeSet.add(\"KI\");\n regionCodeSet.add(\"KM\");\n regionCodeSet.add(\"KN\");\n regionCodeSet.add(\"KP\");\n regionCodeSet.add(\"KR\");\n regionCodeSet.add(\"KW\");\n regionCodeSet.add(\"KY\");\n regionCodeSet.add(\"KZ\");\n regionCodeSet.add(\"LA\");\n regionCodeSet.add(\"LB\");\n regionCodeSet.add(\"LC\");\n regionCodeSet.add(\"LI\");\n regionCodeSet.add(\"LK\");\n regionCodeSet.add(\"LR\");\n regionCodeSet.add(\"LS\");\n regionCodeSet.add(\"LT\");\n regionCodeSet.add(\"LU\");\n regionCodeSet.add(\"LV\");\n regionCodeSet.add(\"LY\");\n regionCodeSet.add(\"MA\");\n regionCodeSet.add(\"MC\");\n regionCodeSet.add(\"MD\");\n regionCodeSet.add(\"ME\");\n regionCodeSet.add(\"MF\");\n regionCodeSet.add(\"MG\");\n regionCodeSet.add(\"MH\");\n regionCodeSet.add(\"MK\");\n regionCodeSet.add(\"ML\");\n regionCodeSet.add(\"MM\");\n regionCodeSet.add(\"MN\");\n regionCodeSet.add(\"MO\");\n regionCodeSet.add(\"MP\");\n regionCodeSet.add(\"MQ\");\n regionCodeSet.add(\"MR\");\n regionCodeSet.add(\"MS\");\n regionCodeSet.add(\"MT\");\n regionCodeSet.add(\"MU\");\n regionCodeSet.add(\"MV\");\n regionCodeSet.add(\"MW\");\n regionCodeSet.add(\"MX\");\n regionCodeSet.add(\"MY\");\n regionCodeSet.add(\"MZ\");\n regionCodeSet.add(\"NA\");\n regionCodeSet.add(\"NC\");\n regionCodeSet.add(\"NE\");\n regionCodeSet.add(\"NF\");\n regionCodeSet.add(\"NG\");\n regionCodeSet.add(\"NI\");\n regionCodeSet.add(\"NL\");\n regionCodeSet.add(\"NO\");\n regionCodeSet.add(\"NP\");\n regionCodeSet.add(\"NR\");\n regionCodeSet.add(\"NU\");\n regionCodeSet.add(\"NZ\");\n regionCodeSet.add(\"OM\");\n regionCodeSet.add(\"PA\");\n regionCodeSet.add(\"PE\");\n regionCodeSet.add(\"PF\");\n regionCodeSet.add(\"PG\");\n regionCodeSet.add(\"PH\");\n regionCodeSet.add(\"PK\");\n regionCodeSet.add(\"PL\");\n regionCodeSet.add(\"PM\");\n regionCodeSet.add(\"PR\");\n regionCodeSet.add(\"PS\");\n regionCodeSet.add(\"PT\");\n regionCodeSet.add(\"PW\");\n regionCodeSet.add(\"PY\");\n regionCodeSet.add(\"QA\");\n regionCodeSet.add(\"RE\");\n regionCodeSet.add(\"RO\");\n regionCodeSet.add(\"RS\");\n regionCodeSet.add(\"RU\");\n regionCodeSet.add(\"RW\");\n regionCodeSet.add(\"SA\");\n regionCodeSet.add(\"SB\");\n regionCodeSet.add(\"SC\");\n regionCodeSet.add(\"SD\");\n regionCodeSet.add(\"SE\");\n regionCodeSet.add(\"SG\");\n regionCodeSet.add(\"SH\");\n regionCodeSet.add(\"SI\");\n regionCodeSet.add(\"SJ\");\n regionCodeSet.add(\"SK\");\n regionCodeSet.add(\"SL\");\n regionCodeSet.add(\"SM\");\n regionCodeSet.add(\"SN\");\n regionCodeSet.add(\"SO\");\n regionCodeSet.add(\"SR\");\n regionCodeSet.add(\"SS\");\n regionCodeSet.add(\"ST\");\n regionCodeSet.add(\"SV\");\n regionCodeSet.add(\"SX\");\n regionCodeSet.add(\"SY\");\n regionCodeSet.add(\"SZ\");\n regionCodeSet.add(\"TC\");\n regionCodeSet.add(\"TD\");\n regionCodeSet.add(\"TG\");\n regionCodeSet.add(\"TH\");\n regionCodeSet.add(\"TJ\");\n regionCodeSet.add(\"TL\");\n regionCodeSet.add(\"TM\");\n regionCodeSet.add(\"TN\");\n regionCodeSet.add(\"TO\");\n regionCodeSet.add(\"TR\");\n regionCodeSet.add(\"TT\");\n regionCodeSet.add(\"TV\");\n regionCodeSet.add(\"TW\");\n regionCodeSet.add(\"TZ\");\n regionCodeSet.add(\"UA\");\n regionCodeSet.add(\"UG\");\n regionCodeSet.add(\"US\");\n regionCodeSet.add(\"UY\");\n regionCodeSet.add(\"UZ\");\n regionCodeSet.add(\"VA\");\n regionCodeSet.add(\"VC\");\n regionCodeSet.add(\"VE\");\n regionCodeSet.add(\"VG\");\n regionCodeSet.add(\"VI\");\n regionCodeSet.add(\"VN\");\n regionCodeSet.add(\"VU\");\n regionCodeSet.add(\"WF\");\n regionCodeSet.add(\"WS\");\n regionCodeSet.add(\"XK\");\n regionCodeSet.add(\"YE\");\n regionCodeSet.add(\"YT\");\n regionCodeSet.add(\"ZA\");\n regionCodeSet.add(\"ZM\");\n regionCodeSet.add(\"ZW\");\n\n return regionCodeSet;\n }", "public void createCountries() {\n\t\t\n\t\tcountryArray = new Country[Constants.NUM_COUNTRIES];\n\t\t\n\t\tfor(int i=0; i<Constants.NUM_COUNTRIES; i++) {\n\t\t\tcountryArray[i] = (new Country(i));\n\t\t}\n\t}", "private void populateCountryList(JComboBox cmbCountryList)\n {\n cmbCountryList.removeAllItems();\n CountryEnterprise countryEnterprise;\n \n for(Enterprise country: internationalNetwork.getEnterpriseDirectory().getEnterpriseList())\n {\n cmbCountryList.addItem((CountryEnterprise) country);\n }\n \n }", "void fetchCountryInformation();", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n\n// GeoCoderUtils.getCountryCode(3.152194, 101.778446, RegisterActivityNewFirst.this, new GeoCoderUtils.GeocoderListner() {\n// GeoCoderUtils.getCountryCode(location.getLatitude(), location.getLongitude(), RegisterActivityNewFirst.this, new GeoCoderUtils.GeocoderListner() {\n\n GeoCoderUtils.getCountryCode(location.getLatitude(), location.getLongitude(), RegisterActivityNewFirst.this, new GeoCoderUtils.GeocoderListner() {\n// GeoCoderUtils.getCountryCode(25.105497, 121.597366, RegisterActivityNewFirst.this, new GeoCoderUtils.GeocoderListner() {\n// malasia GeoCoderUtils.getCountryCode(3.152194, 101.778446, RegisterActivityNewFirst.this, new GeoCoderUtils.GeocoderListner() {\n @Override\n public void onGetCode(String country_name,String country_code, String stateNamefromeo, String cityNamefrogeo) {\n\n countryName = country_name;\n stateNamefromGeo = stateNamefromeo;\n cityNameFromGeo = cityNamefrogeo;\n CommonUtils.showLog(\"location1\", \"Code is :\" + country_code);\n if (country_code != null) {\n String dialcode = \"\";\n if (countryCode != null && countryList != null) {\n for (int i = 0; i < countryList.size(); i++) {\n if (country_code.equalsIgnoreCase(countryList.get(i).getCountrycode())) {\n CommonUtils.showLog(\"location2\", \"Code is :\" + country_code);\n textViewCountry.setText(\"\" + countryList.get(i).getName());\n countryId = countryList.get(i).getId();\n countryCode = country_code;\n getState();\n textViewDialCode.setText(\"+\" + countryList.get(i).getPhonecode());\n dialCode = countryList.get(i).getPhonecode();\n\n for (int j = 0; j < Country.getAllCountries().size(); j++) {\n {\n if (countryList.get(i).getName().equalsIgnoreCase(Country.getAllCountries().get(j).getName())) {\n imageViewFlag.setImageResource(Country.getAllCountries().get(j).getFlag());\n return;\n }\n }\n }\n return;\n }\n }\n }\n }\n }\n });\n }\n }", "private void _generateContinents() {\n this.continents.put(ContinentName.NorthAmerica, new CountryName[] {\n CountryName.Alaska,\n CountryName.WesternCanada,\n CountryName.CentralAmerica,\n CountryName.EasternUS,\n CountryName.Greenland,\n CountryName.NorthwestTerritories,\n CountryName.CentralCanada,\n CountryName.EasternCanada,\n CountryName.WesternUS\n });\n this.continents.put(ContinentName.SouthAmerica, new CountryName[] {\n CountryName.Argentina,\n CountryName.Brazil,\n CountryName.Peru,\n CountryName.Venezuela\n });\n this.continents.put(ContinentName.Europe, new CountryName[] {\n CountryName.GreatBritain,\n CountryName.Iceland,\n CountryName.NorthernEurope,\n CountryName.Scandinavia,\n CountryName.SouthernEurope,\n CountryName.Ukraine,\n CountryName.WesternEurope\n });\n this.continents.put(ContinentName.Africa, new CountryName[] {\n CountryName.Congo,\n CountryName.EastAfrica,\n CountryName.Egypt,\n CountryName.Madagascar,\n CountryName.NorthAfrica,\n CountryName.SouthAfrica\n });\n this.continents.put(ContinentName.Asia, new CountryName[] {\n CountryName.Afghanistan,\n CountryName.China,\n CountryName.India,\n CountryName.Irkutsk,\n CountryName.Japan,\n CountryName.Kamchatka,\n CountryName.MiddleEast,\n CountryName.Mongolia,\n CountryName.Siam,\n CountryName.Siberia,\n CountryName.Ural,\n CountryName.Yakutsk\n });\n this.continents.put(ContinentName.Australia, new CountryName[] {\n CountryName.EasternAustralia,\n CountryName.Indonesia,\n CountryName.NewGuinea,\n CountryName.WesternAustralia\n });\n }", "public List<CountryMasterDesc> getCountryListFromDB() {\n\t\t sessionStateManage = new SessionStateManage(); \n\t\tcountryList = new ArrayList<CountryMasterDesc>();\n\t\tcountryList.addAll( getGeneralService().getCountryList(new BigDecimal(sessionStateManage.isExists(\"languageId\")?sessionStateManage.getSessionValue(\"languageId\"):\"1\")));\n\t\tfor(CountryMasterDesc countryMasterDesc:countryList) {\n\t\t\tmapCountryList.put(countryMasterDesc.getFsCountryMaster().getCountryId(), countryMasterDesc.getCountryName());\n\t\t}\n \t\treturn countryList;\n\t}", "public static void checkCountries(List<Token> tokenList) {\r\n\t\tList<List<String>> tokenizedCountries = new ArrayList<List<String>>();\r\n\t\t\r\n\t\t// Iterate through the countriesAndTerritories from the WordLists library.\r\n\t\tIterator<String> it = WordLists.countriesAndTerritories().iterator();\r\n\t\t\r\n\t\tString orig = Token.combineTokenList(tokenList);\r\n\t\t\r\n\t\twhile(it.hasNext()) {\r\n\t\t\tString country = it.next();\r\n\t\t\tif(!orig.contains(country)) continue;\r\n\t\t\tList<String> piece = tokenizeString(country);\r\n\t\t\t\r\n\t\t\tif(piece != null) {\r\n\t\t\t\ttokenizedCountries.add(tokenizeString(country)); // Tokenize the string for comparison\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\ttokenizedCompare(tokenList, tokenizedCountries, \"country\");\r\n\t}", "public void setCountryItems(){\r\n\t\tComboItem[] comboItems;\r\n\t\t//array list is used as interim solution due to the fact that regular arrays size is immutable\r\n\t\tArrayList<ComboItem> itemList = new ArrayList<ComboItem>();\r\n\t\t\r\n\t\ttry {\r\n\t\t\t//Query database and populate array list with values. \r\n\t\t\tResultSet result = COUNTRY_OPTIONS.executeQuery();\r\n\t\t\twhile(result.next()){\r\n\t\t\t\titemList.add(new ComboItem(result.getInt(1), result.getString(2)));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Initialise new array with needed size\r\n\t\t\tcomboItems = new ComboItem[itemList.size()];\r\n\t\t\t//convert arraylist object into array\r\n\t\t\tcomboItems = itemList.toArray(comboItems);\r\n\t\t} catch (SQLException e) {\r\n\t\t\t//initialise empty array to be returned\r\n\t\t\tcomboItems = new ComboItem[0];\r\n\t\t\tlogger.log(Level.SEVERE, e.getMessage());\r\n\t\t} \r\n\t\t\r\n\t\tthis.countries = comboItems;\r\n\t}", "private static Map<String, List<String>> loadCitiesByLanguage() {\n String resource = Config.get(\"generate.geography.foreign.birthplace.default_file\",\n \"geography/foreign_birthplace.json\");\n return loadCitiesByLanguage(resource);\n }", "public void allocateCountries() {\n\t\tmakeDeck() ;\n\t\t\n\t\tint id =0;\n\t\t//Randomly give players 9 country cards, and place 1 army on country\n\t\tfor(int j=0;j<Constants.NUM_PLAYERS;j++) {\n\t\t\tfor (int i=0; i<9;i++) {\n\t\t\t\tid = deck.get(0).getCardID() ;\n\t\t\t\tif(deck.get(0).getInsignia()=='w') {\n\t\t\t\t\ti--;\n\t\t\t\t} else {\n\t\t\t\t\tsetCountryOwnership(j, id, 1);\n\t\t\t\t\t\n\t\t\t\t\t//Tells user what cards where drawn\n\t\t\t\t\tview.displayString(\"Player \"+(j+1)+\" Drew Card ' \" +deck.get(0).toString()+\"'\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdiscardPile.add(deck.remove(0));\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Set rest of countries to neutrals with 1 army\n\t\tfor(int j=Constants.NUM_PLAYERS;j<6;j++) {\n\t\t\tfor (int i=0; i<6;i++) {\n\t\t\t\tid = deck.get(0).getCardID() ;\n\t\t\t\tif(deck.get(0).getInsignia()=='w') {\n\t\t\t\t\ti--;\n\t\t\t\t} else { \n\t\t\t\t\tsetCountryOwnership(j, id, 1);\n\t\t\t\t}\n\t\t\t\tdiscardPile.add(deck.remove(0));\n\t\t\t}\n\t\t}\n\t\t//Adds cards back to deck and shuffles\n\t\tdiscardToDeck() ;\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic void init() {\n\t\tif (allcode.isEmpty()) {\r\n\t\t\tCode code = new Code();\r\n\r\n\t\t\tList list = this.dynamicsqldao.findbyWhere(code, Code.class);\r\n\t\t\tif (list.isEmpty() == false) {\r\n\t\t\t\tfor (int i = 0; i < list.size(); i++) {\r\n\t\t\t\t\tcode = new Code();\r\n\t\t\t\t\tcode = (Code) list.get(i);\r\n\t\t\t\t\tString ckey = code.getCode();\r\n\t\t\t\t\tList codelist = this.dynamicsqldao\r\n\t\t\t\t\t\t\t.findbyWhere( code, Code.class);\r\n\t\t\t\t\tallcode.put(ckey, codelist);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void importCountries(JTFFile file) {\n for (SimpleData country : file.getCountries()) {\n if (countriesService.exist(country)) {\n country.setId(countriesService.getSimpleData(country.getName()).getId());\n } else {\n countriesService.create(country);\n }\n }\n }", "public HashMap<String, Integer> combineCountryPopList(Connection conn) {\n // Retrieve concrete list of countries and populations\n ConcreteStatService concreteClass = new ConcreteStatService();\n List<Pair<String, Integer>> concreteList = concreteClass.GetCountryPopulations();\n\n HashMap<String, Integer> databaseList = getDataBaseCountryPop(conn);\n\n // Combine Lists. If duplicate, use database data.\n for (int i = 0; i < concreteList.size(); i++) {\n String country = concreteList.get(i).getKey();\n if (!(databaseList.containsKey(country))) {\n if (country.equals(\"U.S.A.\") || country.equals(\"United States of America\")) {\n if ((!(databaseList.containsKey(\"U.S.A.\"))) && (!(databaseList.containsKey(\"United States of America\")))) {\n databaseList.put(country, concreteList.get(i).getValue());\n }\n } else {\n databaseList.put(country, concreteList.get(i).getValue());\n }\n }\n }\n\n return databaseList;\n }", "public static String[] localizeCountries(Context context, String[] toLocalize){\n String language = Locale.getDefault().getLanguage();\n if(!language.equals(lastLanguage)){\n lastLanguage = language;\n resetArrayMaps();\n }\n if(countriesTranslations.isEmpty()){\n //Mapping english names and android ids allows to translate\n //int[] countriesIds = Values.COUNTRIES_IDS;\n String[] localizedCountries = context.getResources().getStringArray(R.array.supported_countries);\n String[] countries = Values.COUNTRIES_DEFAULT_NAMES;\n for(int i = 0; i < countries.length; i++)\n countriesTranslations.put(countries[i], localizedCountries[i]);\n }\n String[] localized = new String[toLocalize.length];\n for(int i = 0; i < toLocalize.length; i++)\n localized[i] = countriesTranslations.get(toLocalize[i]);\n\n return localized;\n }", "java.lang.String getCountryCode();", "java.lang.String getCountryCode();", "private void setCountries(List<Country> countries) {\n this.countries = countries;\n }", "List<Country> listCountries();", "private void fixupLanguageCodes() {\n long timer = -System.currentTimeMillis();\n\n // Hack to fix ssl1->sil. If we ever have more, abstract this a bit more.\n String from = \"ssl1\";\n String to = \"sil\";\n RFC3066LanguageCode abstractLanguageCode = new RFC3066LanguageCode(to);\n MetadataValue<RFC3066LanguageCode> abstractMetadataLanguageCode = new MetadataValue<>(\n abstractLanguageCode);\n\n Transaction transaction = this.store.newTransaction();\n Collection<AudioItem> items = this.store.getAudioItems();\n int itemsFixed = 0;\n\n boolean success = false;\n try {\n for (AudioItem audioItem : items) {\n if (audioItem.getLanguageCode().equalsIgnoreCase(from)) {\n audioItem.getMetadata().putMetadataField(DC_LANGUAGE, abstractMetadataLanguageCode);\n transaction.add(audioItem);\n itemsFixed++;\n }\n }\n if (transaction.size() > 0) {\n transaction.commit();\n } else {\n transaction.rollback();\n }\n success = true;\n } catch (IOException e1) {\n e1.printStackTrace();\n } finally {\n if (!success) {\n try {\n transaction.rollback();\n } catch (IOException e) {\n LOG.log(Level.SEVERE, \"Unable to rollback transaction.\", e);\n }\n }\n }\n\n timer += System.currentTimeMillis();\n // If we did anything, or if the delay was perceptable (1/10th second), show the time.\n if (itemsFixed > 0 || timer > 100) {\n System.out.printf(\"Took %d ms to fix %d language codes%n\", timer, itemsFixed);\n }\n }", "private static void m568a() {\n if (f878a == null) {\n HashMap hashMap = new HashMap();\n f878a = hashMap;\n hashMap.put(\"CN\", p.China);\n f878a.put(\"FI\", p.Europe);\n f878a.put(\"SE\", p.Europe);\n f878a.put(\"NO\", p.Europe);\n f878a.put(\"FO\", p.Europe);\n f878a.put(\"EE\", p.Europe);\n f878a.put(\"LV\", p.Europe);\n f878a.put(\"LT\", p.Europe);\n f878a.put(\"BY\", p.Europe);\n f878a.put(\"MD\", p.Europe);\n f878a.put(\"UA\", p.Europe);\n f878a.put(\"PL\", p.Europe);\n f878a.put(\"CZ\", p.Europe);\n f878a.put(\"SK\", p.Europe);\n f878a.put(\"HU\", p.Europe);\n f878a.put(\"DE\", p.Europe);\n f878a.put(\"AT\", p.Europe);\n f878a.put(\"CH\", p.Europe);\n f878a.put(\"LI\", p.Europe);\n f878a.put(\"GB\", p.Europe);\n f878a.put(\"IE\", p.Europe);\n f878a.put(\"NL\", p.Europe);\n f878a.put(\"BE\", p.Europe);\n f878a.put(\"LU\", p.Europe);\n f878a.put(\"FR\", p.Europe);\n f878a.put(\"RO\", p.Europe);\n f878a.put(\"BG\", p.Europe);\n f878a.put(\"RS\", p.Europe);\n f878a.put(\"MK\", p.Europe);\n f878a.put(\"AL\", p.Europe);\n f878a.put(\"GR\", p.Europe);\n f878a.put(\"SI\", p.Europe);\n f878a.put(\"HR\", p.Europe);\n f878a.put(\"IT\", p.Europe);\n f878a.put(\"SM\", p.Europe);\n f878a.put(\"MT\", p.Europe);\n f878a.put(\"ES\", p.Europe);\n f878a.put(\"PT\", p.Europe);\n f878a.put(\"AD\", p.Europe);\n f878a.put(\"CY\", p.Europe);\n f878a.put(\"DK\", p.Europe);\n f878a.put(\"RU\", p.Russia);\n f878a.put(\"IN\", p.India);\n }\n }", "public PostalCodeDataBase()\n {\n codeToCityMap = new HashMap<String, Set<String>>();\n // additional instance variable(s) to be initialized in part (b)\n }", "static public void set_country_data(){\n\n\t\tEdit_row_window.attrs = new String[]{\"country name:\", \"area (1000 km^2):\", \"GDP per capita (1000 $):\",\n\t\t\t\t\"population (million):\", \"capital:\", \"GDP (billion $):\"};\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), Edit_row_window.selected[0].getText(4), \n\t\t\t\tEdit_row_window.selected[0].getText(5), Edit_row_window.selected[0].getText(6)};\n\t\t\n\t\tEdit_row_window.linked_query =\t\" select distinct l.id, l.name, l.num_links, l.population \" +\n\t\t\t\t\t\t\t\t\t\t\t\" from curr_places_locations l, \" +\n\t\t\t\t\t\t\t\t\t\t\t\" curr_places_location_country lc \" +\n\t\t\t\t\t\t\t\t\t\t\t\" where lc.location_id=l.id and lc.country_id=\"+Edit_row_window.id+\n\t\t\t\t\t\t\t\t\t\t\t\" order by num_links desc \";\n\t\t\t\t\n\t\tEdit_row_window.not_linked_query = \" select distinct l.id, l.name, l.num_links, l.population \" +\n\t\t\t\t\" from curr_places_locations l \";\n\t\t\n\t\tEdit_row_window.linked_attrs = new String[]{\"id\", \"location name\", \"rating\", \"population\"};\n\t\tEdit_row_window.label_min_parameter=\"min. population:\";\n\t\tEdit_row_window.linked_category_name = \"LOCATIONS\";\n\t}", "@Override\n\tpublic void updateAllCountries(List<Country> countries) {\n\n\t}", "@Override\r\n public void assignCountries() {\r\n printInvalidCommandMessage();\r\n }", "@Override\r\n public String getCountryToAttackFrom(HashMap<String, ArrayList<String>> attackScenarios) {\r\n return null;\r\n }", "String getCountryCode();", "public interface CountryIsoConverter {\n\n /**\n * <p> Converts an ISO 3166 alpha-2 country code to ISO 3166 alpha-3.\n * Example: toAlpha3(\"DE\") would result in \"DEU\".\n * </p>\n * \n * @since 1.8\n * @param iso3166Alpha2 the ISO 3166 alpha-2 country code\n * @return the ISO 3166 alpha-3 conversion of the parameter\n * @throws NullPointerException if parameter iso3166Alpha2 is null\n * @throws IllegalArgumentException if parameter iso3166Alpha2 is not in ISO 3166 alpha-2\n * @throws IsoConversionException if no alpha-3 code is known for the given alpha-2 code\n */\n String toAlpha3(final String iso3166Alpha2);\n\n /**\n * <p> Converts an ISO 3166 alpha-3 country code to ISO 3166 alpha-2.\n * Example: toAlpha2(\"DEU\") would result in \"DE\".\n * </p>\n * \n * @since 1.8\n * @param iso3166Alpha3 the ISO 3166 alpha-3 country code\n * @return the ISO 3166 alpha-2 conversion of the parameter\n * @throws NullPointerException if parameter iso3166Alpha3 is null\n * @throws IsoConversionException if no alpha-2 code is known for the given alpha-3 code\n */\n String toAlpha2(final String iso3166Alpha3);\n\n}", "private void updateCountryCode(final String newCountryCode) {\n if (!TextUtils.isEmpty(newCountryCode) && !newCountryCode.equals(mCountryCode)) {\n mCountryCode = newCountryCode;\n switch (mDisplayMode) {\n case DISPLAY_COUNTRY_FULL_NAME:\n mCountryCodeInput.setText(PhoneNumberUtils.getHumanCountryCode(mCountryCode));\n break;\n case DISPLAY_COUNTRY_ISO_CODE:\n mCountryCodeInput.setText(mCountryCode);\n break;\n }\n // Update the prefix\n final int prefix = PhoneNumberUtil.getInstance().getCountryCodeForRegion(mCountryCode);\n if (prefix > 0) {\n mCurrentPhonePrefix = \"+\" + prefix;\n }\n }\n }", "public AdapterCountry(List<Country> countryList, Context context) {\n this.countryList = countryList;\n this.context = context;\n }", "public String changeTownNamesCasing(String country) throws SQLException {\n PreparedStatement updateStatement = this.connection.prepareStatement(Queries.UPDATE_TOWN_NAMES_CASING_TO_UPPER);\n PreparedStatement selectAffectedTownsStatement = this.connection.prepareStatement(Queries.SELECT_AFFECTED_TOWN_NAMES);\n updateStatement.setString(1, country);\n int affectedTownsCount = updateStatement.executeUpdate();\n\n if (affectedTownsCount == 0) {\n return Constants.NO_AFFECTED_TOWN_NAMES;\n }\n\n selectAffectedTownsStatement.setString(1, country);\n ResultSet affectedTownNames = selectAffectedTownsStatement.executeQuery();\n List<String> affectedTowns = new ArrayList<>();\n\n while (affectedTownNames.next()) {\n affectedTowns.add(affectedTownNames.getString(\"name\"));\n }\n\n return affectedTownsCount + Constants.AFFECTED_TOWN_NAMES_COUNT + System.lineSeparator()\n + \"[\" + String.join(\", \", affectedTowns) + \"]\";\n }", "public void setCountryCode(int value) {\r\n\t\tthis.countryCode = value;\r\n\t}", "private String getCountryName(String name)\r\n {\r\n }", "public void CountryComboSelect(){\n errorLabel.setText(\"\");\n ObservableList<Divisions> divisionsList = DivisionsImp.getAllDivisions();\n ObservableList<Divisions> filteredDivisions = FXCollections.observableArrayList();\n if (countryCombo.getValue() != null){\n int countryId = countryCombo.getValue().getCountryId();\n for(Divisions division : divisionsList){\n if(division.getCountryId() == countryId){\n filteredDivisions.add(division);\n }\n }\n divisionCombo.setItems(filteredDivisions);\n divisionCombo.setValue(null);\n }\n }", "public boolean correctCheckCountryBelonging(ArrayList<MEContinent> continentsArr, ArrayList<MECountry> countryArr){\n int countryAddByContinent = 0;\n\n //If the map is empty.\n if(continentsArr.isEmpty() && countryArr.isEmpty()){\n return true;\n }\n\n for(int i = 0; i<continentsArr.size();i++){\n\n countryAddByContinent = continentsArr.get(i).getCountryNumber()+countryAddByContinent;\n }\n if(countryAddByContinent != countryArr.size()){\n System.out.println(countryAddByContinent);\n System.out.println(countryArr.size());\n checkFlagCB = false;\n }\n return checkFlagCB;\n }", "public CustomersByCountry(){\n\n }", "public JSONArray getCountry(Activity act)\n\t{\n\t\tJSONArray json = null;\n\n\t\tprefManager = new SharedPrefManager(act);\n\t\tHashMap<String, String> init = prefManager.getCountry();\n\t\tString dataCountry = init.get(SharedPrefManager.COUNTRY);\n\t\tLog.e(\"dataCountry\",dataCountry);\n\n\t\ttry {\n\t\t\tjson = new JSONArray(dataCountry);\n\t\t\tLog.e(\"json\",Integer.toString(json.length()));\n\t\t}catch (JSONException e){\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn json;\n\n\t\t/*Locale[] locales = Locale.getAvailableLocales();\n\t\tArrayList<String> countries = new ArrayList<String>();\n\n\t\tfor (Locale locale : locales) {\n\t\t\tString country = locale.getDisplayCountry();\n\t\t\tString countryCode = locale.getCountry();\n\n\n\t\t\tif (country.trim().length()>0 && !countries.contains(country)) {\n\t\t\t\tcountries.add(country+\"-\"+countryCode);\n\t\t\t}\n\t\t}\n\n\t\tCollections.sort(countries);\n\t\treturn countries;*/\n\t}", "String toAlpha3(final String iso3166Alpha2);", "private static VKApiCountry m147466a(Parcel parcel) {\n return new VKApiCountry(parcel);\n }", "public Builder clearCountryCode() {\n copyOnWrite();\n instance.clearCountryCode();\n return this;\n }", "public List<String> supportedCountries() {\n final List<String> countryCodes = new ArrayList<>(bbanStructures.size());\n for (BbanStructureDTO structure : this.bbanStructures) {\n countryCodes.add(structure.getCountry_coode());\n }\n return Collections.unmodifiableList(countryCodes);\n }", "private void populateRegionFilterComboBox() {\n Collection<String> uniqueRegions = new TreeSet<>();\n for (ReceiverRecord record : records) {\n uniqueRegions.add(record.getRegion());\n }\n regionFilterComboBox.getItems().removeAll(regionFilterComboBox.getItems());\n regionFilterComboBox.getItems().add(regionString);\n regionFilterComboBox.getItems().addAll(uniqueRegions);\n regionFilterComboBox.getSelectionModel().select(0);\n }", "public void resetTransforms() { \r\n transforms2 = new HashMap<BundlesDT.DT,Map<String,Map<String,String>>>(); \r\n transforms2.put(BundlesDT.DT.IPv4, new HashMap<String,Map<String,String>>());\r\n transforms2.put(BundlesDT.DT.IPv4CIDR, new HashMap<String,Map<String,String>>());\r\n if (transforms.containsKey(BundlesDT.DT.IPv4)) {\r\n Iterator<String> it = transforms.get(BundlesDT.DT.IPv4).keySet().iterator();\r\n while (it.hasNext()) transforms2.get(BundlesDT.DT.IPv4).put(it.next(), new HashMap<String,String>());\r\n }\r\n if (transforms.containsKey(BundlesDT.DT.IPv4CIDR)) {\r\n sorted_cidr_trans = new HashMap<String,CIDRRec[]>();\r\n Iterator<String> it = transforms.get(BundlesDT.DT.IPv4CIDR).keySet().iterator();\r\n while (it.hasNext()) {\r\n String trans = it.next();\r\n transforms2.get(BundlesDT.DT.IPv4).put(trans, new HashMap<String,String>());\r\n transforms2.get(BundlesDT.DT.IPv4CIDR).put(trans, new HashMap<String,String>());\r\n\tCIDRRec recs[] = new CIDRRec[transforms.get(BundlesDT.DT.IPv4CIDR).get(trans).keySet().size()];\r\n\tIterator<String> it_cidr = transforms.get(BundlesDT.DT.IPv4CIDR).get(trans).keySet().iterator();\r\n\tfor (int i=0;i<recs.length;i++) {\r\n\t String cidr = it_cidr.next();\r\n\t recs[i] = new CIDRRec(cidr,transforms.get(BundlesDT.DT.IPv4CIDR).get(trans).get(cidr));\r\n }\r\n\tArrays.sort(recs);\r\n\tsorted_cidr_trans.put(trans,recs);\r\n }\r\n }\r\n }", "String toAlpha2(final String iso3166Alpha3);", "java.lang.String getCountry();", "java.lang.String getCountry();", "@PostConstruct\r\n public void getCountriesKeysAndNamesAtApplicationStartUp() {\r\n ViewsController.countries = new HashMap<>();\r\n Object object = restTemplate.getForObject(\"https://api.covid19tracking.narrativa.com/api/countries\", Object.class);\r\n new HashMap<>();\r\n if (object != null) {\r\n ObjectMapper objectMapper = new ObjectMapper();\r\n Country data = objectMapper.convertValue(object, Country.class);\r\n for (Country_ country : data.getCountries()) {\r\n ViewsController.countries.put(country.getId(), country.getName());\r\n }\r\n }\r\n }", "List<GenericTypedGrPostal> getCountryNames();", "boolean hasCountryCode();", "boolean hasCountryCode();", "public static URL getUrlForGetCountries()\r\n {\r\n String strUrl = getBaseURL() + \"account_services/api/1.0/static_content/countries/client_type/3/language/\"+\r\n \t\tA.getContext().getString( R.string.backend_language_code )+\"?brand=\"+Config.BRAND_NAME_URL;\r\n return str2url( strUrl );\r\n }", "private void setCountryLabels()\n {\n int usCount = 0;\n int ukCount = 0;\n int canadaCount = 0;\n\n for (Customer customer : customerList) {\n if (customer.getCountry().equals(\"U.S\")) { usCount++; }\n if (customer.getCountry().equals(\"UK\")) { ukCount++; }\n if (customer.getCountry().equals(\"Canada\")) { canadaCount++; }\n }\n\n usCountLabel.setText(Integer.toString(usCount));\n ukCountLabel.setText(Integer.toString(ukCount));\n canadaCountLabel.setText(Integer.toString(canadaCount));\n\n }", "public void updateCountries(List<CountryModel> newCountryList)\n {\n mCountryList.clear();\n mCountryList.addAll(newCountryList);\n //deletes everything and recreates the list whenever data set is changed\n notifyDataSetChanged();\n }", "private String countryCode(String address) {\n\t\tint j = address.lastIndexOf('.') + 1;\n\t\tString cc = address.substring(j);\n\t\treturn cc.toLowerCase();\n\t}", "private void setCountryCodeBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n\n countryCode_ = value.toStringUtf8();\n }", "public Canada() {\n\n //Initialize the array \n provinces = new String[NUM_PROVINCES][NUM_NAMES];\n\n // Set the elements in the array \n provinces[BC][NAME_OF_PROVINCE] = \"British Columbia\";\n provinces[BC][NAME_OF_CAPITAL_CITY] = \"Victoria\";\n provinces[BC][NAME_OF_BIGGEST_CITY] = \"Vancouver\";\n provinces[PE][NAME_OF_PROVINCE] = \"Prince Edward Island\";\n provinces[PE][NAME_OF_CAPITAL_CITY] = \"Charlottetown\";\n provinces[PE][NAME_OF_BIGGEST_CITY] = \"Charlottetown\";\n provinces[SK][NAME_OF_PROVINCE] = \"Saskatchewan\";\n provinces[SK][NAME_OF_CAPITAL_CITY] = \"Regina\";\n provinces[SK][NAME_OF_BIGGEST_CITY] = \"Saskatoon\";\n provinces[AB][NAME_OF_PROVINCE] = \"Alberta\";\n provinces[AB][NAME_OF_CAPITAL_CITY] = \"Edmonton\";\n provinces[AB][NAME_OF_BIGGEST_CITY] = \"Calgary\";\n provinces[NL][NAME_OF_PROVINCE] = \"Newfoundland and Labrador\";\n provinces[NL][NAME_OF_CAPITAL_CITY] = \"St. John's\";\n provinces[NL][NAME_OF_BIGGEST_CITY] = \"St. John's\";\n provinces[YK][NAME_OF_PROVINCE] = \"Yukon\";\n provinces[YK][NAME_OF_CAPITAL_CITY] = \"WhiteHorse\";\n provinces[YK][NAME_OF_BIGGEST_CITY] = \"Whitehorse\";\n provinces[NV][NAME_OF_PROVINCE] = \"Nunavut\";\n provinces[NV][NAME_OF_CAPITAL_CITY] = \"Iqaluit\";\n provinces[NV][NAME_OF_BIGGEST_CITY] = \"Iqaluit\";\n provinces[NT][NAME_OF_PROVINCE] = \"Northwest Territories\";\n provinces[NT][NAME_OF_CAPITAL_CITY] = \"Yellowknife\";\n provinces[NT][NAME_OF_BIGGEST_CITY] = \"Yellowknife\";\n provinces[ON][NAME_OF_PROVINCE] = \"Ontario\";\n provinces[ON][NAME_OF_CAPITAL_CITY] = \"Toronto\";\n provinces[ON][NAME_OF_BIGGEST_CITY] = \"Toronto\";\n provinces[QC][NAME_OF_PROVINCE] = \"Quebec\";\n provinces[QC][NAME_OF_CAPITAL_CITY] = \"Quebec City\";\n provinces[QC][NAME_OF_BIGGEST_CITY] = \"Montreal\";\n provinces[NS][NAME_OF_PROVINCE] = \"Nova Scotia\";\n provinces[NS][NAME_OF_CAPITAL_CITY] = \"Halifax\";\n provinces[NS][NAME_OF_BIGGEST_CITY] = \"Halifax\";\n provinces[NB][NAME_OF_PROVINCE] = \"New Brunswick\";\n provinces[NB][NAME_OF_CAPITAL_CITY] = \"Fredericton\";\n provinces[NB][NAME_OF_BIGGEST_CITY] = \"Saint John\";\n provinces[MB][NAME_OF_PROVINCE] = \"Manitoba\";\n provinces[MB][NAME_OF_CAPITAL_CITY] = \"Winnipeg\";\n provinces[MB][NAME_OF_BIGGEST_CITY] = \"Winnipeg\";\n }", "public final com.iqoption.core.microservices.configuration.a.c apply(List<com.iqoption.core.microservices.configuration.a.c> list, com.iqoption.core.microservices.core.response.f fVar) {\n kotlin.jvm.internal.i.f(list, \"countries\");\n kotlin.jvm.internal.i.f(fVar, \"countryCode\");\n for (Object next : list) {\n if (kotlin.jvm.internal.i.y(((com.iqoption.core.microservices.configuration.a.c) next).acN(), fVar.adh())) {\n break;\n }\n }\n Object next2 = null;\n if (next2 == null) {\n kotlin.jvm.internal.i.bnJ();\n }\n return (com.iqoption.core.microservices.configuration.a.c) next2;\n }", "public CountryList() {\n\t\tthis.totalCount = 0;\n\t\tthis.nextAvailable = 0;\n\t}", "private void setCountryCode(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n countryCode_ = value;\n }", "@Override\n\tpublic List<City> findCityByCountryCode(String countryCode) {\n\t\treturn null;\n\t}", "protected Collection<Country> loadCountries(BufferedReader in, String columnSeparator) throws IOException {\n\t\t\r\n\t\tCollection<Country> countries = new HashSet<Country>();\r\n\t\tString[] columnHeaders = in.readLine().split(columnSeparator);\r\n\t\t\r\n\t\tString line = in.readLine();\r\n\t\twhile (line != null) {\r\n\t\t\tMap<String, String> properties = new HashMap<String, String>();\r\n\t\t\t\r\n\t\t\tString[] columns = line.split(columnSeparator);\r\n\t\t\tfor (int i = 0, n = Math.min(columnHeaders.length, columns.length); i < n; i++) {\r\n\t\t\t\tproperties.put(columnHeaders[i].toLowerCase(), columns[i].trim());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcountries.add(toCountry(properties));\r\n\t\t\tline = in.readLine();\r\n\t\t}\r\n\t\t\r\n\t\tif (countries.size() <= 0) {\r\n\t\t\tLOG.warn(\"{} countries loaded from resource file\", countries.size());\t\t\t\r\n\t\t} else {\r\n\t\t\tLOG.info(\"{} countries loaded from resource file\", countries.size());\r\n\t\t}\r\n\t\t\r\n\t\treturn countries;\r\n\t}", "@Override\n\tpublic void saveAllCountries(List<Country> countries) {\n\n\t}", "public Country findByCode(String code);", "public boolean correctCheckContinentCountry(ArrayList<MEContinent> continents, ArrayList<MECountry> country){\n //If it is a empty map.\n if(continents.isEmpty() && country.isEmpty()) {\n return true;\n }\n\n for(int i=0 ;i<continents.size();i++){\n if(continents.get(i).getCountryNumber() >= 1){\n //\n for(int j=0;j<country.size();j++){\n MECountry checkCountry = country.get(j);\n if(MEMain.arrMEContinent.get(i).getCountryNumber()>1) {\n if (checkCountry.getNeighbor().isEmpty()) {\n return checkFlagCC = false;\n }\n }\n }\n }else {\n continue;\n }\n }\n return checkFlagCC;\n }", "@Override\n\tpublic List<DictCode> searchByDictNameLocal(String dictName, String country) {\n\t\treturn dictCodeDao.searchByDictNameLocal(dictName, country);\n\t}", "public List<Country_Language> getcountry(String id) {\n \tIterable<Country_Language> countries=new ArrayList<>();\n \tList<Country_Language> countr=new ArrayList<>();\n \tcountries=country_Language_Repository.findAll();\n \tfor (Country_Language s :countries)\n \t{ \n\t\t if (s.getCountry_code().equals(id) && s.isIs_official())\n\t\t\t{countr.add(s);\n\t\t return countr;\n\t\t\t}\n \t}\n\t\t return countr;\n \t \n \t\n }", "static Country getByNumber(Context context, List<Country> preferredCountries, String fullNumber) {\n int firstDigit;\n if (fullNumber.length() != 0) {\n if (fullNumber.charAt(0) == '+') {\n firstDigit = 1;\n } else {\n firstDigit = 0;\n }\n Country country;\n for (int i = firstDigit; i < firstDigit + 4; i++) {\n String code = fullNumber.substring(firstDigit, i);\n country = getByCode(context, preferredCountries, code);\n if (country != null) {\n return country;\n }\n }\n }\n return null;\n }", "@Override\n public void initialize(URL url, ResourceBundle resourceBundle) {\n ObservableList<String> countryNames = FXCollections.observableArrayList();\n for (Countries c : DBCountries.getAllCountries()) {\n countryNames.add(c.getName());\n }\n countryCombo.setItems(countryNames);\n }", "private String urlForDatabaseCountries() {\n\t\tString token;\n\t\tStringBuilder builder = new StringBuilder(ConstantsForVkApi.URL);\n\n\t\ttoken = proxyServerService.getProxyServerByDestiny(\"user\").get(0).getToken();\n\n\t\tbuilder.append(ConstantsForVkApi.METHOD_GET_COUNTRIES);\n\t\tbuilder.append(ConstantsForVkApi.PARAMETERS_FOR_COUNTRIES);\n\t\tbuilder.append(ConstantsForVkApi.TOKEN);\n\t\tbuilder.append(token);\n\t\tbuilder.append(ConstantsForVkApi.VERSION);\n\n\t\treturn builder.toString();\n\t}", "public ScText newOriginCountryCodeText()\n {\n return newOriginCountryCodeText(\"Origin Country Code\");\n }", "private static VKApiCountry[] m147467a(int i) {\n return new VKApiCountry[i];\n }", "private void shadeCountries() {\n \n for(Marker marker: countryMarkers) {\n String countryId = marker.getId();\n \n if(lifeExpMap.containsKey(countryId)) {\n float lifeExp = lifeExpMap.get(countryId);\n int colorLevel = (int) map(lifeExp, 40, 90, 10, 255);\n marker.setColor(color(255 - colorLevel, 100, colorLevel));\n } else {\n marker.setColor(color(150, 150, 150));\n }\n }\n }", "public Country(ausstage.Database p_db) {\n\t\tm_db = p_db;\n\t\tinitialise();\n\t}", "private void replaceWithSponsorBaseAdress(String sponsorCode){\r\n /**\r\n * Updated for REF ID :0003 Feb'21 2003.\r\n * Hour Glass implementation while DB Trsactions Wait\r\n * by Subramanya Feb' 21 2003\r\n */\r\n dlgWindow.setCursor( new Cursor( Cursor.WAIT_CURSOR ) );\r\n String rldxId = rldxController.getRolodexIdForSponsor(sponsorCode);\r\n RolodexDetailsBean rolodexBean =\r\n rldxController.displayRolodexInfo(rldxId);\r\n dlgWindow.setCursor( new Cursor( Cursor.DEFAULT_CURSOR ) );\r\n \r\n txtAddress1.setText(\r\n rolodexBean.getAddress1() == null ? \"\" : rolodexBean.getAddress1());\r\n txtAddress2.setText(\r\n rolodexBean.getAddress2() == null ? \"\" : rolodexBean.getAddress2());\r\n txtAddress3.setText(\r\n rolodexBean.getAddress3() == null ? \"\" : rolodexBean.getAddress3());\r\n txtCity.setText(\r\n rolodexBean.getCity() == null ? \"\" : rolodexBean.getCity());\r\n txtCounty.setText(\r\n rolodexBean.getCounty() == null ? \"\" : rolodexBean.getCounty());\r\n //Modified for Case#4252 - Rolodex state dropdown associated with country - Start\r\n cmbCountry.setSelectedItem(rolodexBean.getCountry());\r\n// cmbState.setSelectedItem(rolodexBean.getState());\r\n// if (((ComboBoxBean)cmbCountry.getSelectedItem()).getCode().trim().equals(\"USA\") ){\r\n//// cmbState.setShowCode(true);\r\n// setStateInfo();\r\n// }else{\r\n//// cmbState.setShowCode(false);\r\n// cmbState.removeAllItems();\r\n// ComboBoxBean cmbBean = rolodexBean.getState() != null ?\r\n// new ComboBoxBean(rolodexBean.getState(),rolodexBean.getState())\r\n// : new ComboBoxBean(\" \",\" \");\r\n// cmbState.addItem(cmbBean);\r\n// }\r\n //Case#4252 - End\r\n cmbState.setRequestFocusEnabled(false);\r\n cmbState.setSelectedItem(\r\n rolodexBean.getState() == null ? \" \" :rolodexBean.getState().toString());\r\n txtPostalCode.setText(\r\n rolodexBean.getPostalCode() == null ? \"\" : rolodexBean.getPostalCode());\r\n txtPhone.setText(\r\n rolodexBean.getPhone() == null ? \"\" : rolodexBean.getPhone());\r\n txtEMail.setText(\r\n rolodexBean.getEMail() == null ? \"\" : rolodexBean.getEMail());\r\n txtFax.setText(\r\n rolodexBean.getFax() == null ? \"\" : rolodexBean.getFax());\r\n }", "private void setCountryObservers() {\n ArrayList<String> ownedCountryNameList = curPlayer.getOwnedCountryNameList();\n CountryChangedObserver observer = curPlayer.getCountryChangedObserver();\n for (String name : ownedCountryNameList) {\n Main.graphSingleton.get(name).getCountry().getCountryObservable().deleteObservers();\n Main.graphSingleton.get(name).getCountry().getCountryObservable().addObserver(observer);\n }\n }", "public void initialise() {\n\t\tm_country_id = 0;\n\t\tm_country_name = \"\";\n\t\tm_error_string = \"\";\n\t}", "com.google.protobuf.ByteString\n getCountryCodeBytes();", "com.google.protobuf.ByteString\n getCountryCodeBytes();", "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:00:06.410 -0500\", hash_original_method = \"BFC255CAA5852747525F7A463403B75F\", hash_generated_method = \"5E246E1D734705125312F8B71BE424A7\")\n \nprivate String getCountryNameForNumber(PhoneNumber number, Locale language) {\n String regionCode = phoneUtil.getRegionCodeForNumber(number);\n return (regionCode == null || regionCode.equals(\"ZZ\"))\n ? \"\" : new Locale(\"\", regionCode).getDisplayCountry(language);\n }", "private static void loadConsonant() {\r\n subConsonant = new LinkedHashMap<String, String>();\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1000\")), \"0xE000\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1001\")), \"0xE001\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1002\")), \"0xE002\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1003\")), \"0xE003\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1005\")), \"0xE005\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1006\")), \"0xE006\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1007\")), \"0xE007\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1008\")), \"0xE008\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x100C\")), \"0xE00C\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x100E\")), \"0xE00E\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x100F\")), \"0xE00F\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1010\")), \"0xE010\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1011\")), \"0xE011\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1012\")), \"0xE012\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1013\")), \"0xE013\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1014\")), \"0xE014\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1015\")), \"0xE015\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1016\")), \"0xE016\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1017\")), \"0xE017\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1018\")), \"0xE018\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x1019\")), \"0xE019\");\r\n subConsonant.put(getSubConsonantKey(UnicodeUtil.unicodeChar(\"0x101C\")), \"0xE01C\");\r\n }", "Country getCountry();", "@Override\n\tpublic List<String> findAllCountries() {\n\t\treturn theCountryRepository.findAllCountries();\n\t}", "public CachedRowSet getVenueCountries(Statement p_stmt, String firstCountry) {\n\t\t\n\t\tCachedRowSet l_rs;\n\t\tString sqlString;\n\t\tString l_ret;\n\t\tString orderByCase = \"\";\n\t\t\n\t\tif (!firstCountry.equals(\"\")){ orderByCase = \"CASE WHEN countryname LIKE '\"+ m_db.plSqlSafeString(firstCountry) +\"%' THEN 1 ELSE 2 END, \"; }\n\t\t\n\t\ttry {\n\t\t\tStatement stmt = m_db.m_conn.createStatement();\n\n\t\t\tsqlString = \"SELECT DISTINCT country.countryid as countryid, countryname \"+ \n\t\t\t\t\t\t\"FROM country \"+ \n\t\t\t\t\t\t\"left join venue \"+ \n\t\t\t\t\t\t\"ON country.countryid = venue.countryid \"+ \n\t\t\t\t\t\t\"WHERE venue.countryid IS NOT NULL \"+\n\t\t\t\t\t\t\"ORDER BY \"+orderByCase+\" country.countryname\";\n\t\t\tl_rs = m_db.runSQL(sqlString, stmt);\n\t\t\tstmt.close();\n\t\t\treturn (l_rs);\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\">>>>>>>> EXCEPTION <<<<<<<<\");\n\t\t\tSystem.out.println(\"An Exception occured in getVenueCountries().\");\n\t\t\tSystem.out.println(\"MESSAGE: \" + e.getMessage());\n\t\t\tSystem.out.println(\"LOCALIZED MESSAGE: \" + e.getLocalizedMessage());\n\t\t\tSystem.out.println(\"CLASS.TOSTRING: \" + e.toString());\n\t\t\tSystem.out.println(\">>>>>>>>>>>>>-<<<<<<<<<<<<<\");\n\t\t\treturn (null);\n\t\t}\n\t}", "public void setCountryCode(String countryCode)\r\n\t{\r\n\t\tthis.countryCode = countryCode;\r\n\t}", "private void buildComboBoxes() {\n buildCountryComboBox();\n buildDivisionComboBox();\n }", "private ZipCodes() {}", "public void divyCountries() {\r\n\t\twhile (CountryPicker.size() > 0) {\r\n\t\t\tfor (int x = 0; x < 6; x++) {\r\n\t\t\t\tif (CountryPicker.size() > 0) {\r\n\t\t\t\t\tnew threadz(CountryPicker.get(0), players.get(x).getColor(), false);\r\n\t\t\t\t\tCountryPicker.get(0).setTroops(1);\r\n\t\t\t\t\tplayers.get(x).addCountries(CountryPicker.get(0));\r\n\t\t\t\t\tCountryPicker.remove(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public List<Country> getAll() throws Exception;", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof LookupCountry)) {\r\n return false;\r\n }\r\n LookupCountry other = (LookupCountry) object;\r\n if ((this.dbid == null && other.dbid != null) || (this.dbid != null && !this.dbid.equals(other.dbid))) {\r\n return false;\r\n }\r\n return true;\r\n }", "protected void buildMappings(android.icu.impl.coll.CollationData r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: android.icu.impl.coll.CollationDataBuilder.buildMappings(android.icu.impl.coll.CollationData):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.icu.impl.coll.CollationDataBuilder.buildMappings(android.icu.impl.coll.CollationData):void\");\n }", "public GenCountry(IDomainModel model) {\r\n\t\tsuper(model);\r\n\t\t// internal child neighbors only\r\n\t\t\t \tsetStates(new States((Country) this));\r\n \t\t}", "@RequestMapping(value = \"/getCountries.abhi\")\n\tpublic List<CountryTO> getCountries(Model model, HttpServletRequest request) {\n\n\t\treturn addressService.getAllActiveCountries();\n\n\t}", "public ArrayList<Country> getCountryList() throws LocationException;" ]
[ "0.6203994", "0.60787815", "0.6040685", "0.59779066", "0.5934584", "0.5893158", "0.58842635", "0.58803976", "0.5824346", "0.5816212", "0.580688", "0.58050597", "0.5789918", "0.5762803", "0.57549447", "0.5741687", "0.5737401", "0.56565005", "0.5620605", "0.56029946", "0.5585659", "0.55763125", "0.5498444", "0.5492034", "0.5492034", "0.54422164", "0.5433088", "0.54314166", "0.54295856", "0.5399507", "0.5377441", "0.5376026", "0.53692794", "0.5358162", "0.5317959", "0.52830213", "0.52803725", "0.5279233", "0.52785414", "0.5271934", "0.5267574", "0.5260629", "0.5259454", "0.5243641", "0.5240095", "0.5227504", "0.52209747", "0.52198726", "0.5214835", "0.5213906", "0.5213177", "0.5186791", "0.51831335", "0.51831335", "0.51728445", "0.51672244", "0.51598394", "0.51598394", "0.51455516", "0.5135878", "0.5133485", "0.512336", "0.51226455", "0.51222116", "0.5116974", "0.51096207", "0.5109399", "0.510743", "0.51009053", "0.509602", "0.5089263", "0.5088734", "0.50864726", "0.5080499", "0.50765246", "0.50597316", "0.50554204", "0.5037939", "0.5034142", "0.50315297", "0.50237465", "0.5019248", "0.5018486", "0.50135356", "0.5008094", "0.5008094", "0.50071657", "0.5002312", "0.49893022", "0.49881452", "0.4987619", "0.49807748", "0.496857", "0.4961316", "0.4953638", "0.495362", "0.4948576", "0.49433157", "0.49425825", "0.49424392", "0.4938354" ]
0.0
-1
takes the countryCode and passes it to the dictionary screen
private void goToDictionary(String country) { Intent myIntent = new Intent(this, Dictionary.class); myIntent.putExtra("flag", country); Bundle bundle2 = new Bundle(); bundle2.putString("flag", country); DictionaryTab1 send2 = new DictionaryTab1(); send2.setArguments(bundle2); startActivity(myIntent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void goToDictionaryKorea(View v) {\n countryCode = 1;\n countryName = getCountry(countryCode);\n goToDictionary(countryName);\n }", "void fetchCountryInformation();", "public void setCountryCode(String countryCode)\r\n\t{\r\n\t\tthis.countryCode = countryCode;\r\n\t}", "public void setCountry(java.lang.CharSequence value) {\n this.country = value;\n }", "public void setcountryCode(String countryCode) {\n this.countryCode = countryCode;\n }", "public void setAddressCountry(String addressCountry) {\n this.addressCountry = addressCountry;\n }", "public void setCountryCode(String countryCode) {\n this.countryCode = countryCode;\n }", "public void setCountryCode(java.lang.String countryCode) {\n this.countryCode = countryCode;\n }", "private String getCountry(int countryCode) {\n switch (countryCode) {\n case 1:\n return countryName = \"Korea\";\n case 2:\n return countryName = \"England\";\n case 3:\n return countryName = \"France\";\n default:\n return \"Error\";\n }\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountry(Integer country) {\n this.country = country;\n }", "public void setCountry(Integer country) {\n this.country = country;\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void displayCountry() {\n Country country = countryList.getCountryById(index);\n\n ImageView image = (ImageView) findViewById(R.id.ImageViewCountry);\n image.setImageResource(country.getImage());\n\n TextView name = (TextView) findViewById(R.id.CountryName);\n name.setText(country.getName());\n\n TextView capital = (TextView) findViewById(R.id.CountryCapital);\n capital.setText(country.getCapital());\n\n TextView population = (TextView) findViewById(R.id.CountryPopulation);\n population.setText(country.getPopulation());\n\n TextView climat = (TextView) findViewById(R.id.CountryClimat);\n climat.setText(country.getClimat());\n\n TextView description = (TextView) findViewById(R.id.CountryDescription);\n description.setText(country.getDescription());\n }", "static public void set_country_data(){\n\n\t\tEdit_row_window.attrs = new String[]{\"country name:\", \"area (1000 km^2):\", \"GDP per capita (1000 $):\",\n\t\t\t\t\"population (million):\", \"capital:\", \"GDP (billion $):\"};\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), Edit_row_window.selected[0].getText(4), \n\t\t\t\tEdit_row_window.selected[0].getText(5), Edit_row_window.selected[0].getText(6)};\n\t\t\n\t\tEdit_row_window.linked_query =\t\" select distinct l.id, l.name, l.num_links, l.population \" +\n\t\t\t\t\t\t\t\t\t\t\t\" from curr_places_locations l, \" +\n\t\t\t\t\t\t\t\t\t\t\t\" curr_places_location_country lc \" +\n\t\t\t\t\t\t\t\t\t\t\t\" where lc.location_id=l.id and lc.country_id=\"+Edit_row_window.id+\n\t\t\t\t\t\t\t\t\t\t\t\" order by num_links desc \";\n\t\t\t\t\n\t\tEdit_row_window.not_linked_query = \" select distinct l.id, l.name, l.num_links, l.population \" +\n\t\t\t\t\" from curr_places_locations l \";\n\t\t\n\t\tEdit_row_window.linked_attrs = new String[]{\"id\", \"location name\", \"rating\", \"population\"};\n\t\tEdit_row_window.label_min_parameter=\"min. population:\";\n\t\tEdit_row_window.linked_category_name = \"LOCATIONS\";\n\t}", "public void setCountryCode(String countryCode) {\r\n\t\t\tthis.countryCode = countryCode;\r\n\t\t}", "public void setCountry(java.lang.String country) {\r\n this.country = country;\r\n }", "public void setCountry(java.lang.String country) {\n this.country = country;\n }", "@RequestMapping(value = \"showCountry\", method = RequestMethod.POST)\r\n public String showCountry(@RequestParam(value = \"countryCode\", required = false, defaultValue = \"pl\") String countryCode, Model model) {\r\n PanaStructureCollector psc = new PanaStructureCollector();\r\n // List<String> categories = psc.getCategoriesUrls(countryCode);\r\n model.addAttribute(\"categories\", psc.getCategoriesUrls(countryCode));\r\n System.out.println(countryCode);\r\n return \"country\";\r\n }", "public void setCountryAccessCode(String countryAccessCode) {\n this.countryAccessCode = countryAccessCode;\n }", "public void setCountry(Country country) {\n this.country = country;\n }", "public void setCountryName(String value);", "@Override\n public void onMapClick(LatLng arg0) {\n try {\n Geocoder geo = new Geocoder(MapsActivity.this, Locale.getDefault());\n List<Address> add = geo.getFromLocation(arg0.latitude, arg0.longitude, 1);\n String selectedCountry;\n if (add.size() > 0) {\n selectedCountry = add.get(0).getCountryName();\n selectedStateOrCountry = selectedCountry;\n\n //Log.d(\"country\", selectedCountry);\n //For usa go with states . All other countries - it gives the capital\n if (selectedCountry.equalsIgnoreCase(\"United States\") ||\n selectedCountry.equalsIgnoreCase(\"US\")) {\n selectedStateOrCountry = add.get(0).getAdminArea();\n }\n //Log.d(\"state\", selectedStateOrCountry);\n ConvertTextToSpeech();\n }\n } catch (Exception e) {\n //Log.e(TAG, \"Failed to initialize map\", e);\n }\n }", "public void setCountry(String country) {\r\n\t\tthis.country = country;\r\n\t}", "public void setCountry(String country) {\r\n\t\tthis.country = country;\r\n\t}", "public void setCountry(String country) {\r\n\t\tthis.country = country;\r\n\t}", "public void setCountry(java.lang.String Country) {\n this.Country = Country;\n }", "public void switchToCountry()\n {\n questionLabel.setText(currentQuestion.getQuestion());\n d.setVisible(true);\n atQuestionStage=true;\n mapImageLabel.setVisible(false);\n a.setText(\"A\");\n b.setText(\"B\");\n c.setText(\"C\");\n a.setBounds(380,220,a.getPreferredSize().height+20,30);\n b.setBounds(500,220,b.getPreferredSize().height+20,30);\n c.setBounds(380,320,c.getPreferredSize().height+20,30);\n d.setBounds(500,320,d.getPreferredSize().height+20,30);\n questionLabel.setBounds(380,100,600,100);\n revalidate();\n }", "@FXML\n public void changeCountry(ActionEvent event) {\n Countries countries = countryCB.getSelectionModel().getSelectedItem();\n\n showStatesProvinces(countries.getCountryID());\n }", "public void setCountry_id(String country_id) {\n this.country_id = country_id;\n }", "@Override\n\t\t\t\t\tpublic void onSelectCountry(String name, String code) {\n\t\t\t\t\t\tIntent intent = new Intent(contry.this, SignUpActivity.class);\n\t\t\t\t\t\t intent.putExtra(\"pays_iso\",code); \n\t\t\t\t\t\t intent.putExtra(\"pays_name\",name); \n\t\t\t\t\t\t intent.putExtra(\"device_key\",registrationId); \n\t\t\t\t\t\tstartActivityForResult(intent, 0);\n\t\t\t\t\t\toverridePendingTransition(R.anim.slidein, R.anim.slideout);\n\t\t\t\t\t\tfinish();\n\t\t\t\t\t}", "java.lang.String getCountry();", "java.lang.String getCountry();", "public static void main(String[] args) {\n\t\t\n\t\tHashMap<String,String> countries = new HashMap<String,String>();\n\t\t\n\t\t//add a key and value\n\t\tcountries.put(\"USA\",\"Washington DC\");\n\t\tcountries.put(\"India\",\"New Delhi\");\n\t\tcountries.put(\"Russia\",\"Moscow\");\n\t\tcountries.put(\"China\",\"Beijing\");\n\t\t\n\t\t//System.out.println(countries);\n\t\t//countries.remove(\"USA\");\n\t\t//System.out.println(countries.get(\"Russia\"));\n\t\t//countries.clear();\n\t\t//System.out.println(countries.size());\n\t\t//countries.replace(\"USA\", \"Detroit\");\n\t\t//System.out.print(countries.containsKey(\"England\"));\n\t\t//System.out.print(countries.containsValue(\"Beijing\"));\n\t\t\n\t\t\n\t\t for(String i : countries.keySet()) { \n\t\t\t System.out.print(i+\"\\t\"+\"= \");\n\t\t \t System.out.println(countries.get(i));\n\t\t \t }\n\t\t \n\t\t\n\t}", "public String getCountry() {\r\n return this.country;\r\n }", "public void setCountry(String country) {\n\t\tthis.country = country;\n\t}", "private void displayCountryFields() {\n FieldRelatedLabel countryLabel = new FieldRelatedLabel(\"Country\", 750, 470);\n try {\n country = new CountryComboBox(750, 500);\n sceneNodes.getChildren().add(country);\n } catch (IOException e) { e.printStackTrace(); }\n\n\n sceneNodes.getChildren().addAll(countryLabel);\n }", "public String countryCode() {\n return countryCode;\n }", "@Override\n\t\t\tpublic void onSelectCountry(String name, String code) {\n\t\t\t\tIntent intent = new Intent(contry.this, SignUpActivity.class);\n\t\t\t\t intent.putExtra(\"pays_iso\",code); \n\t\t\t\t intent.putExtra(\"pays_name\",name); \n\t\t\t\t intent.putExtra(\"device_key\",registrationId); \n\t\t\t\tstartActivityForResult(intent, 0);\n\t\t\t\toverridePendingTransition(R.anim.slidein, R.anim.slideout);\n\t\t\t\tfinish();\n\t\t\t}", "public void setCountryCode(int value) {\r\n\t\tthis.countryCode = value;\r\n\t}", "private String getCountryName(String name)\r\n {\r\n }", "public void setCountryCallingCode(int countryCallingCode) {\n this.countryCallingCode = countryCallingCode;\n }", "@Override\n\tpublic String toString() {\n\t\treturn super.country;\n\t}", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n switch (requestCode) {\n case RegisterActivity.CHANGE_COUNTRY_CODE:\n tv_cphone.setText(\"+\" + AppConfig.COUNTRY_CODE);\n break;\n default:\n break;\n }\n }", "public void setCOUNTRY_CODE(java.lang.String COUNTRY_CODE) {\r\n\t\tthis._COUNTRY_CODE = COUNTRY_CODE;\r\n\t}", "public void setCountry (java.lang.String country) {\n\t\tthis.country = country;\n\t}", "public String getCountryName();", "private void setCountryCode(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n countryCode_ = value;\n }", "public final void go() {\n this.getView().showCountries(this.getModel().getCountries());\n CountryFindChoice choice;\n do {\n choice = this.getView().askUserFindChoice();\n } while (choice == CountryFindChoice.error);\n String codeOrName = this.getView().askCodeOrName(choice);\n Country country = null;\n switch (choice) {\n case byCode:\n country = this.getModel().getCountryByCode(codeOrName);\n break;\n case byName:\n country = this.getModel().getCountryByName(codeOrName);\n break;\n }\n if(country != null) {\n this.getView().printMessage(country.getHelloWorld().getMessage());\n }\n this.getModel().close();\n }", "public String getcountryCode() {\n return countryCode;\n }", "@Override\r\n public String getCountryToAttackFrom(HashMap<String, ArrayList<String>> attackScenarios) {\r\n return null;\r\n }", "public void setCountry(String country) {\r\n this.country = country.trim();\r\n }", "public void setCountryName(String countryName) {\n this.countryName = countryName;\n }", "public void setCountryName(String countryName) {\n this.countryName = countryName;\n }", "public CountryCode getCountry() {\n return country;\n }", "public String getCountry() {\n return country;\n }", "@Override\n\tpublic List<DictCode> searchByDictNameLocal(String dictName, String country) {\n\t\treturn dictCodeDao.searchByDictNameLocal(dictName, country);\n\t}", "public void nextCountry(View view) {\n if (!countryList.getCountryList().isEmpty() && index < countryList.getCountryList().size()) {\n index += 1;\n displayCountry();\n }\n }", "public String getCountry()\n {\n return country;\n }", "@Override\n public void onSelectCountry(Country country) {\n // get country name and country ID\n binding.editTextCountry.setText(country.getName());\n countryID = country.getCountryId();\n statePicker.equalStateObject.clear();\n cityPicker.equalCityObject.clear();\n \n //set state name text view and state pick button invisible\n setStateListener();\n \n // set text on main view\n// countryCode.setText(\"Country code: \" + country.getCode());\n// countryPhoneCode.setText(\"Country dial code: \" + country.getDialCode());\n// countryCurrency.setText(\"Country currency: \" + country.getCurrency());\n// flagImage.setBackgroundResource(country.getFlag());\n \n \n // GET STATES OF SELECTED COUNTRY\n for (int i = 0; i < stateObject.size(); i++) {\n // init state picker\n statePicker = new StatePicker.Builder().with(this).listener(this).build();\n State stateData = new State();\n if (stateObject.get(i).getCountryId() == countryID) {\n \n stateData.setStateId(stateObject.get(i).getStateId());\n stateData.setStateName(stateObject.get(i).getStateName());\n stateData.setCountryId(stateObject.get(i).getCountryId());\n stateData.setFlag(country.getFlag());\n statePicker.equalStateObject.add(stateData);\n }\n }\n }", "public static void main(String[] args) {\n\n Map<String,Double> countries = new LinkedHashMap<>();\n countries.put(\"US\", 44.75);\n countries.put(\"UK\", 22.2);\n countries.put(\"China\", 33.05);\n\n for( int i = 0; i < 10; i++) {\n String country = getCountry(countries);\n System.out.println(String.format(\"%s) %s\", i + 1, country));\n }\n }", "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2014-03-25 14:14:32.652 -0400\", hash_original_method = \"323D3A6C48A6D472DDFE2721C7FED43F\", hash_generated_method = \"9B8474327C39F7658DB849B205974B0F\")\n \n public static boolean setCountryCodeCommand(String countryCode){\n \tdouble taintDouble = 0;\n \ttaintDouble += countryCode.getTaintInt();\n \n \treturn ((taintDouble) == 1);\n }", "@FXML\n void selectCountry() {\n \t//hide all errors\n \thideErrors();\n \t//Getting start year and end year limits from /type/country/metadata.txt\n if (isComboBoxEmpty(T3_country_ComboBox.getValue())){\n //if nothing has been selected do nothing\n return;\n }\n String type = T3_type_ComboBox.getValue(); // getting type\n String country = T3_country_ComboBox.getValue(); // getting country\n //update ranges\n Pair<String,String> validRange = DatasetHandler.getValidRange(type,country);\n\n //update relevant menus\n\n int start = Integer.parseInt(validRange.getKey());\n int end = Integer.parseInt(validRange.getValue());\n //set up end list\n endOptions.clear();\n startOptions.clear();\n for (int i = start; i <= end ; ++i){\n endOptions.add(Integer.toString(i));\n startOptions.add(Integer.toString(i));\n }\n //set up comboBox default values and valid lists\n T3_startYear_ComboBox.setValue(Integer.toString(start));\n T3_endYear_ComboBox.setValue(Integer.toString(end));\n }", "public String getCountry() {\r\n return country;\r\n }", "public String getCountry(){\n\t\treturn country;\n\t}", "public String getCountry(){\n\t\treturn country;\n\t}", "public void setCountryCode(@Nullable String countryCode) {\n this.countryCode = countryCode;\n api.setCountryCode(this.countryCode);\n }", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n\n// GeoCoderUtils.getCountryCode(3.152194, 101.778446, RegisterActivityNewFirst.this, new GeoCoderUtils.GeocoderListner() {\n// GeoCoderUtils.getCountryCode(location.getLatitude(), location.getLongitude(), RegisterActivityNewFirst.this, new GeoCoderUtils.GeocoderListner() {\n\n GeoCoderUtils.getCountryCode(location.getLatitude(), location.getLongitude(), RegisterActivityNewFirst.this, new GeoCoderUtils.GeocoderListner() {\n// GeoCoderUtils.getCountryCode(25.105497, 121.597366, RegisterActivityNewFirst.this, new GeoCoderUtils.GeocoderListner() {\n// malasia GeoCoderUtils.getCountryCode(3.152194, 101.778446, RegisterActivityNewFirst.this, new GeoCoderUtils.GeocoderListner() {\n @Override\n public void onGetCode(String country_name,String country_code, String stateNamefromeo, String cityNamefrogeo) {\n\n countryName = country_name;\n stateNamefromGeo = stateNamefromeo;\n cityNameFromGeo = cityNamefrogeo;\n CommonUtils.showLog(\"location1\", \"Code is :\" + country_code);\n if (country_code != null) {\n String dialcode = \"\";\n if (countryCode != null && countryList != null) {\n for (int i = 0; i < countryList.size(); i++) {\n if (country_code.equalsIgnoreCase(countryList.get(i).getCountrycode())) {\n CommonUtils.showLog(\"location2\", \"Code is :\" + country_code);\n textViewCountry.setText(\"\" + countryList.get(i).getName());\n countryId = countryList.get(i).getId();\n countryCode = country_code;\n getState();\n textViewDialCode.setText(\"+\" + countryList.get(i).getPhonecode());\n dialCode = countryList.get(i).getPhonecode();\n\n for (int j = 0; j < Country.getAllCountries().size(); j++) {\n {\n if (countryList.get(i).getName().equalsIgnoreCase(Country.getAllCountries().get(j).getName())) {\n imageViewFlag.setImageResource(Country.getAllCountries().get(j).getFlag());\n return;\n }\n }\n }\n return;\n }\n }\n }\n }\n }\n });\n }\n }", "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:00:06.410 -0500\", hash_original_method = \"BFC255CAA5852747525F7A463403B75F\", hash_generated_method = \"5E246E1D734705125312F8B71BE424A7\")\n \nprivate String getCountryNameForNumber(PhoneNumber number, Locale language) {\n String regionCode = phoneUtil.getRegionCodeForNumber(number);\n return (regionCode == null || regionCode.equals(\"ZZ\"))\n ? \"\" : new Locale(\"\", regionCode).getDisplayCountry(language);\n }", "public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\r\n System.out.print(\"Where are you from? \");\r\n String country = sc.next().toLowerCase();\r\n\r\n // Test the variable against the cases\r\n switch(country)\r\n {\r\n case \"ireland\": System.out.println(\"So you are Irish\"); break;\r\n case \"france\": System.out.println(\"So you are French\"); break;\r\n case \"brazil\": System.out.println(\"So you are Brazilian\"); break;\r\n default: System.out.println(\"Unknown\"); break;\r\n }\r\n }", "@Override\n public void run() {\n AlertDialog.Builder dialog = new AlertDialog.Builder( getMapController().getContext());\n dialog.setTitle(geoCode.getDisplayName());\n dialog.show();\n }", "public void setCountryId(String countryId) {\r\n this.countryId = countryId;\r\n }", "public final void setCountry(final String ccountry) {\n\t\tthis.country = ccountry;\n\t}", "private static void m568a() {\n if (f878a == null) {\n HashMap hashMap = new HashMap();\n f878a = hashMap;\n hashMap.put(\"CN\", p.China);\n f878a.put(\"FI\", p.Europe);\n f878a.put(\"SE\", p.Europe);\n f878a.put(\"NO\", p.Europe);\n f878a.put(\"FO\", p.Europe);\n f878a.put(\"EE\", p.Europe);\n f878a.put(\"LV\", p.Europe);\n f878a.put(\"LT\", p.Europe);\n f878a.put(\"BY\", p.Europe);\n f878a.put(\"MD\", p.Europe);\n f878a.put(\"UA\", p.Europe);\n f878a.put(\"PL\", p.Europe);\n f878a.put(\"CZ\", p.Europe);\n f878a.put(\"SK\", p.Europe);\n f878a.put(\"HU\", p.Europe);\n f878a.put(\"DE\", p.Europe);\n f878a.put(\"AT\", p.Europe);\n f878a.put(\"CH\", p.Europe);\n f878a.put(\"LI\", p.Europe);\n f878a.put(\"GB\", p.Europe);\n f878a.put(\"IE\", p.Europe);\n f878a.put(\"NL\", p.Europe);\n f878a.put(\"BE\", p.Europe);\n f878a.put(\"LU\", p.Europe);\n f878a.put(\"FR\", p.Europe);\n f878a.put(\"RO\", p.Europe);\n f878a.put(\"BG\", p.Europe);\n f878a.put(\"RS\", p.Europe);\n f878a.put(\"MK\", p.Europe);\n f878a.put(\"AL\", p.Europe);\n f878a.put(\"GR\", p.Europe);\n f878a.put(\"SI\", p.Europe);\n f878a.put(\"HR\", p.Europe);\n f878a.put(\"IT\", p.Europe);\n f878a.put(\"SM\", p.Europe);\n f878a.put(\"MT\", p.Europe);\n f878a.put(\"ES\", p.Europe);\n f878a.put(\"PT\", p.Europe);\n f878a.put(\"AD\", p.Europe);\n f878a.put(\"CY\", p.Europe);\n f878a.put(\"DK\", p.Europe);\n f878a.put(\"RU\", p.Russia);\n f878a.put(\"IN\", p.India);\n }\n }", "public MentorConnectRequestCompose addIndCountry(){\n\t\tmentorConnectRequestObjects.allCountries.click();\n\t\tmentorConnectRequestObjects.algeriaCountry.click();\n\t\tmentorConnectRequestObjects.allIndustries.click();\n\t\tmentorConnectRequestObjects.agriIndustry.click();\n\t\treturn new MentorConnectRequestCompose(driver);\n\t}", "public void setContactCountry(String contactCountry) {\n this.contactCountry = contactCountry;\n }", "private void showStatesProvinces(int countryID){\n this.firstLevelDivisions = FirstLevelDivisionsDAOImpl.getAllStatesProvinces(countryID);\n if (countryID == 1){\n stateProvinceCB.setPromptText(\"Select A State\");\n }else{\n stateProvinceCB.setPromptText(\"Select A Province\");\n }\n stateProvinceCB.setItems(this.firstLevelDivisions);\n }", "@PostConstruct\r\n public void getCountriesKeysAndNamesAtApplicationStartUp() {\r\n ViewsController.countries = new HashMap<>();\r\n Object object = restTemplate.getForObject(\"https://api.covid19tracking.narrativa.com/api/countries\", Object.class);\r\n new HashMap<>();\r\n if (object != null) {\r\n ObjectMapper objectMapper = new ObjectMapper();\r\n Country data = objectMapper.convertValue(object, Country.class);\r\n for (Country_ country : data.getCountries()) {\r\n ViewsController.countries.put(country.getId(), country.getName());\r\n }\r\n }\r\n }", "@OnClick(R.id.txt_country_code)\n void onCountryCodeClicked(){\n if (mCountryPickerDialog == null){\n mCountryPickerDialog = new CountryPickerDialog(this, (country, flagResId) -> {\n mSelectedCountry = country;\n setCountryCode(mSelectedCountry);\n });\n }\n\n mCountryPickerDialog.show();\n }", "@Override\r\n public void assignCountries() {\r\n printInvalidCommandMessage();\r\n }", "public String getCountry() {\n return country;\n }", "public String getCountry() {\n return country;\n }", "public String getCountry() {\n return country;\n }", "public String getCountry() {\n return country;\n }", "public String getCountry() {\n return country;\n }", "public String getCountry() {\n return country;\n }", "public String getCountry() {\n return country;\n }", "public void handleCountrySelection(ActionEvent actionEvent) {\n }", "public java.lang.CharSequence getCountry() {\n return country;\n }", "String getCountryCode();", "public void updateCountry (Country country, String code, Country newCountry){\n HibernateDAO dao = new HibernateDAO();\n try {\n dao.load(country, code);\n \n if(newCountry.getCode2()!= null)\n country.setCode2(newCountry.getCode2()); \n else if(newCountry.getGovernmentform()!= null)\n country.setGovernmentform(newCountry.getGovernmentform());\n else if(newCountry.getSurfacearea()!= 0)\n country.setSurfacearea(newCountry.getSurfacearea());\n else if(newCountry.getPopulation() != 0)\n country.setPopulation(newCountry.getPopulation());\n else if(newCountry.getLifeexpectancy()!= null)\n country.setLifeexpectancy(newCountry.getLifeexpectancy());\n else if(newCountry.getHeadofstate()!= null)\n country.setHeadofstate(newCountry.getHeadofstate());\n \n \n dao.update(country);\n transaction = dao.getSession().beginTransaction();\n transaction.commit();\n } catch (Exception e) {\n e.printStackTrace();\n }\n dao.closeSession();\n }", "java.lang.String getCountryName();", "public static void displayTextCountries(){\n for (Country country : countryList){\n System.out.println(country.getCountryName() + \",\" + country.getIndicator(1) + \",\" + country.getIndicator(2) + \",\" + country.getIndicator(3) + \",\" + country.getIndicator(4) + \",\" + country.getIndicator(5) + \",\" + country.getIndicator(6) + \",\" + country.getIndicator(7) + \",\" + country.getIndicator(8));\n }\n }", "private void ActionChooseCountry() {\n final AlertDialog.Builder dialog = new AlertDialog.Builder(getContext());\n dialog.setTitle(getString(R.string.dialog_title_choose_country));\n\n final List<String> countryNames = Arrays.asList(getResources().getStringArray(R.array.countries_names));\n final List<String> countryArgs = Arrays.asList(getResources().getStringArray(R.array.countries_arg));\n\n final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1);\n arrayAdapter.addAll(countryNames);\n\n dialog.setNegativeButton(getString(R.string.dialog_btn_cancel), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n dialogInterface.dismiss();\n }\n });\n\n dialog.setAdapter(arrayAdapter, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n CoutryArg = countryArgs.get(i);\n\n tvChooseCountry.setText(countryNames.get(i));\n if (SourceId != null) {\n SourceId = null;\n tvChooseSource.setText(R.string.tv_pick_sourse);\n currentPage = 1;\n }\n }\n });\n dialog.show();\n }", "public void setCountryName(){\n\t\tcountry_name = JOptionPane.showInputDialog(FrameHandler.main_frame, \"Enter the name of your country\");\n\t}" ]
[ "0.69652885", "0.6353339", "0.61930454", "0.61715895", "0.6171055", "0.6169655", "0.6093916", "0.60580677", "0.6038585", "0.60376865", "0.60376865", "0.60376865", "0.60376865", "0.60376865", "0.60376865", "0.6029378", "0.6029378", "0.6004318", "0.5953939", "0.59135634", "0.58947915", "0.58870226", "0.58735436", "0.58568907", "0.5851977", "0.5840321", "0.58371866", "0.58345044", "0.580202", "0.580202", "0.580202", "0.57901657", "0.57766026", "0.5758615", "0.57527333", "0.5742049", "0.57212687", "0.57212687", "0.57105696", "0.57064795", "0.56845933", "0.566353", "0.565616", "0.5638397", "0.5631637", "0.5621027", "0.56205344", "0.55889684", "0.55824107", "0.55692005", "0.5546258", "0.5542866", "0.554091", "0.55408484", "0.5532108", "0.5525654", "0.5524162", "0.55185705", "0.55185705", "0.5515638", "0.5507728", "0.5497306", "0.5496283", "0.5479577", "0.54718673", "0.546975", "0.5458835", "0.54587704", "0.54564416", "0.5454289", "0.5454289", "0.545335", "0.54418343", "0.5438194", "0.542674", "0.5425909", "0.54238105", "0.5423659", "0.54027975", "0.5401211", "0.5388478", "0.5382356", "0.53808993", "0.53795815", "0.5371727", "0.53695166", "0.53695166", "0.53695166", "0.53695166", "0.53695166", "0.53695166", "0.53695166", "0.5367726", "0.53656244", "0.53589064", "0.5355209", "0.53452283", "0.53398603", "0.5336088", "0.53294927" ]
0.64879334
1
go to AddWord1 screen (AddWord button)
public void goToAddWord1(View v) { Intent myIntent = new Intent(this, AddWord1.class); startActivity(myIntent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onClick(View view) {\n AddWordFromDaum();\n }", "@FXML\n\tpublic void addWord() {\n\n\t\twordList.add(new Word(TextFieldWord.getText(), TextFieldDescribe.getText(), liczbaznakow));\n\n\t\ttry {\n\n\t\t\tout = new PrintWriter(selectedFile);\n\n\t\t\tfor (int i = 0; i < wordList.size(); i++) {\n\n\t\t\t\tout.printf(\"%s;%s;%d;\",\n\n\t\t\t\t\t\twordList.get(i).getWord(), wordList.get(i).getDescribe(), wordList.get(i).getLiczbaznakow());\n\t\t\t}\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tif (out != null)\n\t\t\t\tout.close();\n\t\t}\n\t}", "public AddWordAction(JTextComponent jText, String word) {\r\n this(jText, word, Utils.getResource(\"Adicionar ao dicionário\"));\r\n }", "public void onClickWordGame(View view) {\n Intent intent = new Intent(\n this,\n edu.neu.madcourse.shuwanhuang.numad18s_shuwanhuang.wordgame.MainActivity.class);\n startActivity(intent);\n }", "public void addWord(Word word);", "private void newWord() {\r\n defaultState();\r\n int random_id_String = 0;\r\n int random_id_Char[] = new int[4];\r\n Random random = new Random();\r\n if (wordNumber == WordCollection.NO_OF_WORDS) return;//quit if all word list is complete;\r\n wordNumber++;\r\n //in case the word has already occured\r\n while (currentWord.equals(\"\")) {\r\n random_id_String = random.nextInt(WordCollection.NO_OF_WORDS);\r\n currentWord = tempWord[random_id_String];\r\n }\r\n currentWord.toUpperCase();\r\n tempWord[random_id_String] = \"\";//so that this word will not be used again in the game session\r\n //generates 4 random nums each for each btn char\r\n for (int i = 0; i < 4; i++) {\r\n random_id_Char[i] = (random.nextInt(4));\r\n for (int j = i - 1; j >= 0; j--) {\r\n if (random_id_Char[i] == random_id_Char[j]) i--;\r\n }\r\n }\r\n\r\n btn1.setText((currentWord.charAt(random_id_Char[0]) + \"\").toUpperCase());\r\n btn2.setText((currentWord.charAt(random_id_Char[1]) + \"\").toUpperCase());\r\n btn3.setText((currentWord.charAt(random_id_Char[2]) + \"\").toUpperCase());\r\n btn4.setText((currentWord.charAt(random_id_Char[3]) + \"\").toUpperCase());\r\n }", "@Override\r\n public void actionPerformed(ActionEvent arg0) {\r\n UserDictionaryProvider provider = SpellChecker.getUserDictionaryProvider();\r\n if (provider != null) {\r\n provider.addWord(word);\r\n }\r\n Dictionary dictionary = SpellChecker.getCurrentDictionary();\r\n dictionary.add(word);\r\n dictionary.trimToSize();\r\n AutoSpellChecker.refresh(jText);\r\n }", "public void story(View view) {\n Intent intent = new Intent(this, GetWordActivity.class);\n startActivity(intent);\n finish();\n\n }", "private void addItemScreen() {\n \tIntent intent = new Intent(this, ItemEditor.class);\n \tstartActivity(intent);\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsave_word();\n\t\t\t}", "public void onAddText(View view){\n setPage(view);\n int index = deleteView(view);\n addTextField(\"label:\", \"\", index);\n Toast.makeText(this, \"Short Query Added\", Toast.LENGTH_LONG).show();\n }", "public void addToDatabaseButtonClicked(View v) {\n byte[] holderString = DBBitmapUtility.getBytes(MainActivityGCV.bitmap);\n databaseHandler.addWordInfo(MainActivityGCV.imageArray.get(0), meaning.getText().toString(), sentence.getText().toString(), holderString);\n Toast.makeText(getApplicationContext(), \"Add to database Successful\", Toast.LENGTH_SHORT).show();\n Intent i = new Intent(this, WordsDatabase.class);\n startActivity(i);\n\n }", "public AddWordAction(JTextComponent jText, String word, String label) {\r\n super(label);\r\n this.word = word;\r\n this.jText = jText;\r\n }", "@Override\n public void onClick(View view) {\n Intent i = new Intent(getApplicationContext(), AllWordsActivity.class);\n startActivity(i);\n\n }", "public void addWord (String word) {\r\n word = word.toUpperCase ();\r\n if (word.length () > 1) {\r\n String s = validateWord (word);\r\n if (!s.equals (\"\")) {\r\n JOptionPane.showMessageDialog (null, \"The word you have entered contained invalid characters\\nInvalid characters are: \" + s, \"Error\",\r\n JOptionPane.ERROR_MESSAGE);\r\n return;\r\n }\r\n checkEasterEgg (word);\r\n words.add (word);\r\n Components.wordList.getContents ().addElement (word);\r\n } else {\r\n JOptionPane.showMessageDialog (null, \"The word you have entered does not meet the minimum requirement length of 2\", \"Error\", JOptionPane.ERROR_MESSAGE);\r\n }\r\n }", "public void goTranslate(View view)\n {\n Intent startIntent = new Intent(help.this, wordPageActivity.class);\n startActivity(startIntent);\n }", "public void onAddByWebSitePressed( ) {\n Router.Instance().changeView(Router.Views.AddFromWebSite);\n }", "void addWordToDoc(int doc,VocabWord word);", "public void newwordClicked(View Sender) {\n this.gameOver = false;\n this.clearLayouts();\n selectedWord = wordGenerator.nextWord(selectedLength).toUpperCase();\n scrambledWord = WordScrambler.Scramble(selectedWord);\n ImageView[] imageList = this.createTiledWord(scrambledWord);\n for (ImageView iv : imageList) {\n imageLayout.addView(iv);\n }\n }", "@Override\n public void onClick(View v) {\n Button tword = (Button) v.findViewById(R.id.tvWord);\n String valueToFind = tword.getText().toString().replace(\"Ver más de: \",\"\");\n Intent allWords = new Intent((MainActivity) context, AllWordsActivity.class);\n allWords.putExtra(\"wordtf\", valueToFind);\n allWords.putExtra(\"olanguage\", originalLanguaje);\n context.startActivity(allWords);\n\n }", "private void setupAddToReviewButton() {\n\t\tImageIcon addreview_button_image = new ImageIcon(parent_frame.getResourceFileLocation() + \"addtoreview.png\");\n\t\tJButton add_to_review = new JButton(\"\", addreview_button_image);\n\t\tadd_to_review.setBounds(374, 598, 177, 100);\n\t\tadd_to_review.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\twords_to_add_to_review.add(words_to_spell.get(current_word_number));\n\t\t\t\tinput_from_user.requestFocusInWindow();//gets focus back to the spell here field\n\t\t\t}\n\t\t});\n\t\tadd_to_review.addMouseListener(new VoxMouseAdapter(add_to_review,null));\n\t\tadd(add_to_review);\n\t}", "@Override\n public void onClick(View view) {\n // Create a new intent to open the {@link word_list}\n Intent accomodationIntent = new Intent(Home.this, Accomodation.class);\n\n // Start the new activity\n startActivity(accomodationIntent);\n }", "@FXML\r\n void searchButtonAction() {\r\n String definition=dictionary.Search(wordInput.getText());\r\n String translation=dictionary.Translate(wordInput.getText());\r\n area.setWrapText(true);\r\n area.setText(definition+\"\\n\\n\\n\\nTranslation: \"+ translation);\r\n\r\n String name = wordInput.getText().substring(0,1).toUpperCase() + wordInput.getText().substring(1).toLowerCase();\r\n wordName.setText(name);\r\n listView.getItems().addAll(wordInput.getText());\r\n }", "private JButton getJButton1() {\r\n\t\tif (jButton1 == null) {\r\n\t\t\tjButton1 = new JButton();\r\n\t\t\tjButton1.setBounds(new Rectangle(38, 176, 124, 30));\r\n\t\t\tjButton1.setText(\"Add\");\r\n\t\t\tjButton1.setBackground(new Color(0, 204, 0));\r\n\t\t\tjButton1.setVisible(false);\r\n\t\t\tjButton1.setEnabled(false);\r\n\t\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\r\n\t\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) {\r\n\t\t\t\t\tString s=jTextField.getText();\r\n\t\t\t\t\tif(!validate1(s)) jTextArea.setText(\"Invalide word\");\r\n\t\t\t\t\tif(s.length()>0 && validate1(s))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(jTextArea.getText().length()>0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tload.myMap.put(s,s+\" =\"+jTextArea.getText());\r\n\t\t\t\t\t\t\t//Note. we put in the file whith space followed by \"=\"\r\n\t\t\t\t\t\t\tload.writeInFile(\"Dictionary.txt\",s+\" =\"+jTextArea.getText());\r\n\t\t\t\t\t\t\tjTextArea.setText(\"\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse jTextArea.setText(\"Invalide explanations\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse \r\n\t\t\t\t\t\tjTextArea.setText(\"Invalide word\");\r\n\t\t\t\t\tjTextField.setText(\"\");\r\n\t\t\t\t\t//jTextArea.setText(\"\");\r\n\t\t\t\t\tjTextArea.setEditable(false);\r\n\t\t\t\t\tjButton.setEnabled(true);\r\n\t\t\t\t\tjButton2.setEnabled(true);\r\n\t\t\t\t\tjButton1.setEnabled(false);\r\n\t\t\t\t\tjButton1.setVisible(false);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn jButton1;\r\n\t}", "private void addModifyButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_addModifyButtonMouseClicked\n String inputWord = this.searchField.getText();\n String inputDefinition = this.getDefinitionTextArea().getText();\n WordDefinition wordToModifyAdd = new WordDefinition(inputWord, inputDefinition);\n \n // find the index of the matching tree\n char firstLetterOfWord = inputWord.toUpperCase().charAt(0);\n int index = -1;\n for(int i = 0 ; i < lexiNodeTrees.size() ; i++)\n {\n if(lexiNodeTrees.get(i).getCurrentCharacter() == firstLetterOfWord)\n {\n index = i;\n i = lexiNodeTrees.size();\n }\n }\n \n // if index was not found, we have to create a new tree\n if(index == -1)\n {\n lexiNodeTrees.add(new LexiNode(firstLetterOfWord));\n index = lexiNodeTrees.size() - 1;\n \n // only possibility here is to add the word since the tree was just craeted\n if(!lexiNodeTrees.get(index).addWord( wordToModifyAdd ))\n {\n // if there was an error adding the word \n JOptionPane.showMessageDialog(this, \"ERREUR: Le mot n'a pas pu \"\n + \"être modifié/ajouté\\n\\n\", \"ERREUR\", JOptionPane.ERROR_MESSAGE);\n }\n \n else // if add was successful\n {\n JOptionPane.showMessageDialog(this, \"Le mot a été ajouté!\\n\", \"INFORMATION\", \n JOptionPane.INFORMATION_MESSAGE);\n }\n }\n \n else // if index was found, we can modify/add the definition\n {\n if( !lexiNodeTrees.get(index).modifyWord( wordToModifyAdd ) )\n {\n System.out.println(\"hi\");\n // if there was an error modifying / adding the word \n JOptionPane.showMessageDialog(this, \"ERREUR: Le mot n'a pas pu \"\n + \"être modifié/ajouté\\n\\n\", \"ERREUR\", JOptionPane.ERROR_MESSAGE);\n }\n \n else // if modification was successful\n {\n JOptionPane.showMessageDialog(this, \"Le mot a été modifié!\\n\", \"INFORMATION\", \n JOptionPane.INFORMATION_MESSAGE);\n }\n }\n \n // refresh the list\n refreshAllWordsList();\n }", "public void actionPerformed(ActionEvent e) {\n if(e.getSource() == insertBtn) {\n Word newWord = new Word(insertChTF.getText(), insertEnTF.getText());\n dbDictionary.insert(newWord);\n dbDictionary.writeData();\n }\n else if(e.getSource() == searchBtn) {\n Word findWord = new Word(searchChTF.getText(), searchEnTF.getText());\n if(dbDictionary.search(findWord)) {\n searchDisplay(findWord);\n }\n }\n }", "public void clickAddButton() {\n\t\tfilePicker.fileManButton(locAddButton);\n\t}", "void addButton_actionPerformed(ActionEvent e) {\n addButton();\n }", "public void addTerm(View v){\n termListView.setVisibility(View.GONE);\n addButton.setVisibility(View.GONE);\n termEntry.setVisibility(View.VISIBLE);\n\n if (db.isTermsEmpty()){\n termHeader.setText(\"Term 1\");\n } else {\n fillInTerm();\n }\n\n }", "void add(String prompt, UIMenuAction action);", "public void btn_AddActivity(View view) {\n startActivity(new Intent(this, add_Recipe.class));\n }", "private void addCustomWords() {\r\n\r\n }", "void onAddClicked();", "void actionButton ( ) throws IOException {\n String textOfField = this.gui.wdgInputText.getText();\n this.gui.widgOutput.append(\"Button1 \" + (++this.ctKeyStroke1) + \" time, text=\" + textOfField + \"\\n\");\n }", "private void addWords(){\n wordList.add(\"EGE\");\n wordList.add(\"ABBAS\");\n wordList.add(\"KAZIM\");\n }", "public void addButton()\n\t{\n\t\tdriver.findElement(By.xpath(\"//input[@name='Insert']\")).click();\n\t}", "public void program1Pressed() {\n // display\n TextLCD.print(PROGRAM1);\n }", "public void actionPerformed(ActionEvent e) {\n\t\t\t\tDefaultListModel<String> listModel = new DefaultListModel<>();\n\t\t\t\tArrayList<Word> jsonArray = GSONread.returnWords(false);\n\t\t\t\tfor (int i = 0; i < jsonArray.size(); i++) {\n\t\t\t\t\tlistModel.addElement(jsonArray.get(i).getName().toString());\n\t\t\t\t}\n\t\t\t\twordList.setModel(listModel);\n\t\t\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t\tDefaultListModel<String> listModel = new DefaultListModel<>();\n\t\t\t\tArrayList<Word> jsonArray = GSONread.returnWords(true);\n\t\t\t\tfor (int i = 0; i < jsonArray.size(); i++) {\n\t\t\t\t\tlistModel.addElement(jsonArray.get(i).getName().toString());\n\t\t\t\t}\n\t\t\t\twordList.setModel(listModel);\n\t\t\t}", "public void add(String word) {\n\t\twordList.add(word);\n\t\t// TODO Add your code here\n\t}", "public void addWord(int id, int start, int length, int[] type);", "public void onClickDictionary(View view) {\n Intent intent = new Intent(this, DictionaryActivity.class);\n startActivity(intent);\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tlisten_word();\n\t\t\t}", "private void computerTurn() {\n String text = txtWord.getText().toString();\n String nextWord;\n if (text.length() >= 4 && dictionary.isWord(text)){\n endGame(false, text + \" is a valid word\");\n return;\n } else {\n nextWord = dictionary.getGoodWordStartingWith(text);\n if (nextWord == null){\n endGame(false, text + \" is not a prefix of any word\");\n return;\n } else {\n addTextToGame(nextWord.charAt(text.length()));\n }\n }\n userTurn = true;\n txtLabel.setText(USER_TURN);\n }", "@Override\n public void add_content() {\n Scanner _thisText = new Scanner(System.in);\n System.out.println(\"Enter Ad text:\");\n _adContent = _thisText.nextLine();\n }", "public void addButtonClicked(View view) {\n\n Products product = new Products(johnsInput.getText().toString());\n\n dbHandler.addProduct(product);\n printDatabase();\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif(edit_add.getText().toString().length()>0){\n\t\t\t\t\taddQuestion(UrlUtils.USERQUESTIONADD, edit_add.getText().toString());\n\t\t\t\t}\n\t\t\t}", "public boolean addEntryFromMenu(String newWord)\n {\n if (this.hasWord(newWord))\n {\n return false;\n }\n else\n {\n //a new blank entry\n Entry newEntry = new Entry();\n //adds my new word tothe entry\n newEntry.setWord(newWord);\n //insert the new entry to the list\n this.addEntryInOrder(newEntry);\n return true;\n }\n //System.out.println(\"You broke logic\");\n //#unreachable\n }", "public void actionPerformed (ActionEvent event) {\n if(event.getSource()==addButton){\n System.out.println(redname.getText());\n game.orderPlay(bluename.getText(),redname.getText(), yellowname.getText(), greenname.getText());\n }\n }", "public void addBookmarks(ActionEvent event) throws IOException{\n bookmarkTxt();\n }", "void addButton_actionPerformed(ActionEvent e) {\n doAdd();\n }", "public void finished(View view){\n\n // reads user input\n EditText thewordET = (EditText) findViewById(R.id.word);\n String theword = String.valueOf(thewordET.getText());\n\n // user input is placed in story\n story.fillInPlaceholder(theword);\n\n // number of filled in blanks is updated\n pointer++;\n\n // once all blanks have been filled FinishedStory activity is started\n if (pointer == wordnumber) {\n\n // full story is retrieved from story object\n String theend = story.toString();\n\n // intent is created and full story is added\n Intent intent = new Intent(this, FinishedStory.class);\n intent.putExtra(\"theend\", theend);\n\n // story is reset\n story.clear();\n\n // FinishedStory activity is started\n startActivity(intent);\n }\n\n // type of word for next blank is determined\n String typeofword = story.getNextPlaceholder();\n thewordET.setText(typeofword);\n\n }", "public void addWord(String word) {\n root.addWord(word);\n }", "public void onAddByMapPressed( ) {\n Router.Instance().changeView(Router.Views.AddWithMap);\n }", "void addWordsToDoc(int doc,List<VocabWord> words);", "public void addQuestion(View view) {\n startActivity(new Intent(MainActivity.this, DicebreakerQuestions.class));\n\n }", "public void actionPerformed(ActionEvent e){\n\t\t\topenAdd();\n\t\t}", "public void secondPlayer(){\n firstName = enterName.getText();\n //testing if we received it\n System.out.println(firstName + \" ...........\");\n //Change some info\n enterName.clear();\n writeNote.setText(\"Enter Second Player Name\");\n writeNote.setFont(Font.font(\"Arial\", FontWeight.BOLD, 45));\n //button action Click\n enterAndContinue.setOnAction(new EventHandler() {\n @Override\n public void handle(Event event) {\n //Move to explain BorderPane\n explainWhoStart();\n }\n });\n }", "private void generateScreen(String form,String text) throws IOException {\r\n \r\n MainScreenController.formName = text;\r\n Stage stage = new Stage();\r\n Parent root = FXMLLoader.load(getClass().getResource(form));\r\n stage.setScene(new Scene(root));\r\n stage.initModality(Modality.APPLICATION_MODAL);\r\n stage.initOwner(partAddBtn.getScene().getWindow());\r\n stage.showAndWait();\r\n \r\n }", "@FXML\n private void goToAddEvent(ActionEvent event){\n SceneManager.navigate(SceneName.ADDEVENT);\n }", "public void addButtonClicked(){\n Products products = new Products(buckysInput.getText().toString());\n dbHandler.addProduct(products);\n printDatabase();\n }", "@OnClick(R.id.team_a_1_button)\n public void add1TeamA() {\n addToScore(scoreATextView, 1);\n }", "public void buttonHintNext(View view) {\n //using finish to activity\n finish();\n\n //create a new object to start new activity\n Intent intent = new Intent(this, Hint.class);\n //pass object to startActivity\n startActivity(intent);\n }", "@FXML\r\n void go_to_link(){\r\n String key= wordName.getText().toLowerCase();\r\n String link= dictionary.get_key_link(key);\r\n link = link.replaceAll(\"^\\\"|\\\"S\",\"\");\r\n File file = new File(link);\r\n\r\n try{\r\n if(!Desktop.isDesktopSupported()){\r\n System.out.println(\"Desktop is not supported\");\r\n return;\r\n }\r\n Desktop desktop = Desktop.getDesktop();\r\n if (file.exists())\r\n desktop.edit(file);\r\n } catch (IOException e1){\r\n e1.printStackTrace();\r\n }\r\n }", "private void setupSayAgainButton() {\n\t\tImageIcon sayagain_button_image = new ImageIcon(parent_frame.getResourceFileLocation() + \"sayagain.png\");\n\t\tJButton sayagain_button = new JButton(\"\", sayagain_button_image);\n\t\tsayagain_button.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tinput_from_user.requestFocusInWindow();//gets focus back to the spell here field\n\t\t\t\t\n\t\t\t\t//says the word slowly\n\t\t\t\tparent_frame.getFestival().speak(words_to_spell.get(current_word_number),true);\n\n\t\t\t\t//says the sample sentence at user's preferred speed there is one @author Abby S\n\t\t\t\tif(parent_frame.getDataHandler().hasSampleSentences()){\n\t\t\t\t\tint index=parent_frame.getDataHandler().getWordlistWords().get(parent_frame.getDataHandler().getCurrentLevel()).indexOf(words_to_spell.get(current_word_number));\n\t\t\t\t\tString sentence=parent_frame.getDataHandler().getSampleSentences().get(parent_frame.getDataHandler().getCurrentLevel()).get(index);\n\t\t\t\t\tif (!sentence.trim().isEmpty()){\n\t\t\t\t\t\tparent_frame.getFestival().speak(sentence,false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tsayagain_button.addMouseListener(new VoxMouseAdapter(sayagain_button,null));\n\t\tadd(sayagain_button);\n\t\tsayagain_button.setBounds(667, 598, 177, 100);\n\t}", "private void addActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addActionPerformed\n add();\n }", "public void program2Pressed() {\n // display\n TextLCD.print(PROGRAM2);\n }", "private WriteAReviewPage clickOnStartHereButton(){\n click(button_StartHereLocator);\n return new WriteAReviewPage();\n }", "@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tmenu.add(0,context_class_test_menu1, 0, \"newmenu\"+Math.random());\r\n\t\t\t\tLog.e(\"test\", \"完成添加\");\r\n\r\n\t\t\t}", "private JButton createButtonAddKeyword() {\n\n JButton btn = new JButton(\"Add Keyword\");\n btn.setEnabled(false);\n btn.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n if (newKeyword(JOptionPane.showInputDialog(\"Insert a Keyword\"))) {\n JOptionPane.showMessageDialog(rootPane, \"Keyword inserted sucessfully!\", \"Sucess\", JOptionPane.PLAIN_MESSAGE);\n }\n\n }\n });\n\n return btn;\n }", "@SuppressWarnings(\"unused\")\n\t@Override\n\tpublic void onClick(View v) {\n\t\tif (v==cancel){\n\t\t\tfinish();\n\t\t}\n\t\tif (v==confirm){\n\t\t\tif (meanning.getText().toString().equals(\"\")||spelling.getText().toString().equals(\"\")){\n\t\t\t\tToast.makeText(EditWord.this, \"信息不能为空\", Toast.LENGTH_SHORT).show();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (action.equals(\"add\")){\n\t\t\t\tboolean add =true;\n\t\t\t\tfinal DataAccess data = new DataAccess(this);\n\t\t\t\tArrayList<Word> words = data.QueryAttention(null, null);\n\t\t\t\t\n\t\t\tfor(int i=0;i<words.size();i++){\n\t\t\t\t\tif(this.spelling.getText().toString().equals(words.get(i).getSpelling())){\n\t\t\t\t\t\tadd=false;\n\t\t\t\t\t\tLog.i(\"thesame\", \"\"+i);\n\t\t\t\t\t\tword = words.get(i);\n\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t\t\tif (!add){\n\t\t\t\t\t\tDialog dialog = new AlertDialog.Builder(this)\n\t\t\t .setIcon(R.drawable.dialog_icon)\n\t\t\t .setTitle(\"该单词已存在\")\n\t\t\t .setMessage(\"生词本中有这个单词,要覆盖掉它吗?\")\n\t\t\t .setPositiveButton(\"确定\", new DialogInterface.OnClickListener() {\n\t\t\t public void onClick(DialogInterface dialog, int whichButton) {\n\t\t\t word.setSpelling(spelling.getText().toString());\n\t\t\t word.setMeanning(meanning.getText().toString());\n\t\t\t data.UpdateAttention(word);\n\t\t\t finish();\n\t\t\t }\n\t\t\t })\n\t\t\t .setNegativeButton(\"取消\", new DialogInterface.OnClickListener() {\n\t\t\t public void onClick(DialogInterface dialog, int whichButton) {\n\t\t\t }\n\t\t\t }).create();\n\t\t\t\t\t\tdialog.show();\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\tif(add){\n\t\t\t\tWord word1 = new Word();\n\t\t\t\tword1.setMeanning(this.meanning.getText().toString());\n\t\t\t\tword1.setSpelling(this.spelling.getText().toString());\n\t\t\t\tword1.setPhonetic_alphabet(\" \");\n\t\t\t\tdata.InsertIntoAttention(word1);\n\t\t\t\tfinish();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse if (action.equals(\"edit\")){\n\t\t\t\tBundle bundle = new Bundle();\n\t\t\t\tbundle = this.getIntent().getExtras();\n\t\t\t\tDataAccess data = new DataAccess(EditWord.this);\n\t\t\t Word word = data.QueryAttention(\"ID = '\"+bundle.getString(\"id\")+\"'\", null).get(0);\n\t\t\t word.setMeanning(this.meanning.getText().toString());\n\t\t\t\tword.setSpelling(this.spelling.getText().toString());\n\t\t\t\tdata.UpdateAttention(word);\n\t\t\t\tfinish();\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public boolean addWord(String word) {\n return false;\n }", "@FXML\n private void copyAdd() {\n final Clipboard clipboard = Clipboard.getSystemClipboard();\n final ClipboardContent url = new ClipboardContent();\n url.putString(ADD_MESSAGE);\n clipboard.setContent(url);\n }", "protected View ShowWord() {\n\t\tTextView btn=new TextView(this);\n\t\tbtn.setId(index);\n\t\tbtn.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));\n//\t\tbtn.setText(\"text not sent here!!!!! \"); //這一行是可以顯示文字的\n\t\treturn btn;\n\t}", "public void processAddLabel() {\n AppTextEnterDialogSingleton dialog = AppTextEnterDialogSingleton.getSingleton();\n\n // POP UP THE DIALOG\n dialog.show(\"Add Label\", \"Enter text of the label to add:\");\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_LABEL_MODE);\n }", "void addFocus();", "@OnClick(R.id.fabAdd)\n void onClickAdd() {\n Intent addAddressIntent = new Intent(this, AddAddressActivity.class);\n startActivity(addAddressIntent);\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tAndroidTools.PlaySound(getBaseContext(), R.raw.animalspelling);\n\t\t\t\tAndroidTools.wait(1500);\n\t\t\t\tIntent learningScreenIntent = new Intent(MainPage.this, SpellingPage.class);\n\n\t\t\t\t//load screen\n\t\t\t\tMainPage.this.startActivity(learningScreenIntent);\n\t\t\t}", "@Override\n\tpublic void OnForwardCommand() {\n\t\tsuper.OnForwardCommand();\n\t\tSoundManage.playSound(forwordSound1);\n\t}", "public void addGenreAction()\n\t{\n\t\tViewNavigator.loadScene(\"Add Genre\", ViewNavigator.ADD_GENRE_SCENE);\n\t}", "private void clickAddManualPlaceButton() {\n // scroll to save button to make sure Espresso can click it\n onView(withId(R.id.btn_manual_add_place))\n .perform(scrollTo());\n // save manual place\n onView(withId(R.id.btn_manual_add_place)).perform(click());\n }", "public void actionButton(String text);", "public void btnAddClicked(View view){\n List list = new List(input.getText().toString());\n dbHandler.addProduct(list);\n printDatabase();\n }", "public void onClick(View view) {\n if(Instruction.getText().length()>=0 &&Instruction_pic.getText().length()>=0) {\n\n newRecipe.instructions.add(Instruction.getText().toString());\n newRecipe.instruction_pics.add(Instruction_pic.getText().toString());\n Instruction.setText(\"\");\n Step += 1;\n Instruction.setText(\"Step \" + Step + \")\");\n }\n else {\n\n }\n\n }", "public void onAddParagraph(View view){\n setPage(view);\n int index = deleteView(view);\n addParagraphField(\"Question?\", \"Answer\", index);\n Toast.makeText(this, \"Long Query Added\", Toast.LENGTH_LONG).show();\n }", "private void buttonNext (){\n Intent nextActivity = new Intent(Question_One.this, Question_two.class);\n nextActivity.putExtra(EXTRA_TEXT,scoreCounter);\n startActivity(nextActivity);\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_practice);\n\n\n textViewAddWords = (TextView) findViewById(R.id.textViewAddWords);\n\n textViewPulledTheWord = (TextView) findViewById(R.id.textViewPulledTheWord);\n\n editTextEnglishWord = (EditText) findViewById(R.id.editTextEnglishWord);\n\n btnPullTheWord = (Button) findViewById(R.id.btnPullTheWord);\n\n btnSubmitEngWord = (Button) findViewById(R.id.btnSubmitEngWord);\n\n textViewTypedEnglishWord = (TextView) findViewById(R.id.textViewTypedEnglishWord);\n\n\n\n\n\n btnSubmitEngWord.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n String eng = editTextEnglishWord.getText().toString();\n engWord = editTextEnglishWord.getText().toString();\n\n textViewTypedEnglishWord.setText(engWord);\n //PostData postData = new PostData();\n //postData.execute();\n\n //new PostData().execute();\n\n sendDataToServer(view);\n\n\n }\n\n\n // }\n });\n\n\n btnPullTheWord.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n GetData getData = new GetData();\n getData.execute();\n\n }\n });\n\n\n // btnSubmitEngWord.setOnClickListener(new View.OnClickListener() {\n // @Override\n // public void onClick(View view) {\n\n\n // }\n // });\n\n\n textViewAddWords.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n Intent addWordsIntent = new Intent(PracticeActivity.this, AddWordsActivity.class);\n PracticeActivity.this.startActivity(addWordsIntent);\n }\n });\n }", "public void actionPerformed(ActionEvent event)\n\t\t\t\t{\n\t\t\t\t\tSet<String> currentDictionaryTree = treeHandler.convertFileToTree(selectedWord.dictionaryFile);\n\t\t\t\t\t\n\t\t\t\t\ttry \n\t\t\t\t\t{\n\t\t\t\t\t\tif(treeHandler.wordIsUnique(selectedWord.word, currentDictionaryTree)) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tselectedWord.added = true;\n\t\t\t\t\t\t\tout = new BufferedWriter(new FileWriter(selectedWord.dictionaryFile, true)); \n\t\t\t\t\t\t\tout.newLine();\n\t\t\t\t\t\t\tout.write(selectedWord.word);\n\t\t\t\t\t\t\tout.close();\n\n\t\t\t\t\t\t\t// Statistics updating after word is successfully added\n\t\t\t\t\t\t\tint loc = (selectedWord.inputFileIndex+1)*(selectedWord.dictionaryFileIndex+1);\n\t\t\t\t\t\t\tdisplay.numAdded.set(loc, Integer.valueOf(display.numAdded.get(loc) + 1));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\ttext.unhighlight(selectedWord);\n\t\t\t\t\t}\n\t\t\t\t\t/**\n\t\t\t\t * @exception IOException signals that there was an error in writing user added words to the corresponding dictionary\n\t\t\t\t */ \n\t\t\t\t\tcatch (IOException exception) \n\t\t\t\t\t{\n\t\t\t\t\t\texception.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}", "public welcomePage1() {\n welcomePage1.setDefaultLookAndFeelDecorated(false);\n // welcomePage1.RIGHT_ALIGNMENT(100.00);\n JIntellitype.getInstance().registerHotKey(ALT_S, JIntellitype.MOD_ALT, (int) 'S');\n JIntellitype.getInstance().registerHotKey(ALT_D,JIntellitype.MOD_ALT,(int)'D');\n JIntellitype.getInstance().addHotKeyListener(this);\n JIntellitype.getInstance().addIntellitypeListener(this);\n try {\n UIManager.setLookAndFeel(new WindowsLookAndFeel());\n } catch (UnsupportedLookAndFeelException ex) {\n Logger.getLogger(welcomePage1.class.getName()).log(Level.SEVERE, null, ex);\n } \n initComponents();\n LOG.info(\"Initializing UI\");\n this.addWindowListener(new java.awt.event.WindowAdapter() {\n\n @Override\n public void windowClosing(java.awt.event.WindowEvent evt) {\n LOG.info(\"Exiting Application\");\n // don't forget to clean up any resources before close\n JIntellitype.getInstance().cleanUp();\n System.exit(0);\n }\n });\n undo = new UndoManager();\n Document doc = textArea.getDocument();\n doc.addUndoableEditListener(new UndoableEditListener() {\n\n public void undoableEditHappened(UndoableEditEvent evt) {\n undo.addEdit(evt.getEdit());\n }\n });\n JMenu Help = new javax.swing.JMenu();\n JMenuItem HelpTopics = new javax.swing.JMenuItem();\n Help.setText(\"Help\");\n HelpTopics.setText(\"Help Topics\");\n HelpTopics.addActionListener(new java.awt.event.ActionListener() {\n\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n HelpTopicsActionPerformed(evt);\n }\n });\n Help.add(HelpTopics);\n jMenuBar3.add(Help);\n // playB.setDefaultCapable(true);\n\n }", "public void save() {\n MainActivity.db.updateWord(this);\n }", "@Override\n public void onClick(View view) {\n //Reads the text that was passed by the user in the EditText and saves it to the notesArrayList.\n String noteText = String.valueOf(noteEditText.getText());\n allNotes.addNote(noteText);\n //Sets the content of the EditText to empty.\n noteEditText.setText(\"\");\n //Gets user back to MainActivity using Intent.\n Intent getBackIntent = new Intent(AddNoteActivity.this,\n MainActivity.class);\n startActivity(getBackIntent);\n }", "public void add(String word, String file, int position) {\n\t \taddHelper(word, file, position);\n\t}", "public void addWord(String word) {\n\t\taddWord(word, root);\n\t}", "public void pressMovieButton() {\n System.out.println(\"Home: You must pick an app to show movies.\\n\");\n }", "public void btnClick(final AutoCompleteTextView actv2) {\n button = (Button) findViewById(R.id.button1);\n button.setOnClickListener(new OnClickListener() {\n @Override\n public void onClick(View arg0) {\n \tIntent i = new Intent(getBaseContext(), StockDetailActivity.class); // navigate to NZX50 screen to add stocks to the watchlist\n \t//Create a bundle object\n Bundle b = new Bundle();\n \n //Inserts a String value into the mapping of this Bundle\n String code = actv2.getText().toString();\n b.putString(\"name\", code.substring(code.indexOf(':'), code.length())); \n \n //Add the bundle to the intent.\n i.putExtras(b);\n \t\n \tstartActivity(i);\n }\n });\n\t}", "public Form_stage_one() {\n System.out.println(Global.categories.size());\n initComponents();\n ws = new JWS(\"WordNet\", \"2.1\");\n stem = new WordnetStemmer(ws.getDictionary());\n POSTaggerButton.setVisible(false);\n }", "private void startQuiz(){\t\n\t\tparent_frame.getFestival().speak(\"Please spell... \"+words_to_spell.get(current_word_number),false);\n\n\t\tfeedback_display.append(\"Word: \"+(current_word_number+1)+\" out of \"+words_to_spell.size()+\"\\nAttempt: \"+current_attempt_number+\" out of 2\\n\");\n\t\tprogress_bar.setValue(current_word_number);\n\t}", "public void addContinue() {\n if (cursor == 0) {\n JOptionPane.showMessageDialog(null, \"There's no note to continue!\", \"Invalid Continue\", JOptionPane.WARNING_MESSAGE);\n } else {\n notePressed(CONTINUE);\n }\n }", "@Override\n public void onClick(View view) {\n\n Intent i = new Intent(MainActivity.this, AddRecipeNameActivity.class);\n MainActivity.this.startActivity(i);\n }", "public void add(String word, String url) {\n \n // don't need to add this word if it's a stop word\n for (String stopWord : Settings.getStopWords()) {\n if (word.equalsIgnoreCase(stopWord)) return;\n }\n \n // don't need to add this word if it's already in here\n StringNode check = locate(word);\n if (check != null) {\n check.getPagesContainingWord().add(url);\n return;\n }\n \n // not a stop word, not present--need to add it\n StringNode newNode = new StringNode(word, new URLLinkedList());\n newNode.getPagesContainingWord().add(url);\n if (first == null) { // if first is null, there's nothing in the list\n first = newNode; // set first to this new node\n newNode.getPagesContainingWord().add(url);\n }\n else { // first isn't null, so we want to find the correct place to put this new node\n StringNode current = first;\n // this barebones linked list is very inconvenient, so we have to make a special \n // check for the first item in the list.\n if (word.compareTo(current.getWord()) < 0) { // the word in the new node goes before the word in the first node\n first = newNode; // now the new node is the first one\n newNode.setNext(current); // and its next is the old first one\n }\n else if (!current.hasNext()) { // no next node, so this word goes after current\n current.setNext(newNode);\n }\n else { // new node doesn't go before first, so check the rest of the list\n boolean newNodePlaced = false;\n StringNode previous;\n while (current.hasNext() && !newNodePlaced) { \n previous = current;\n current = current.getNext(); // grab next node\n if (word.compareTo(current.getWord()) < 0) { // new word goes before this one\n// StringNode oldNext = current.getNext();\n// current.setNext(newNode);\n// newNode.setNext(oldNext);\n// newNodePlaced = true;\n previous.setNext(newNode);\n newNode.setNext(current);\n newNodePlaced = true;\n }\n }\n if (!newNodePlaced) { // if we're here and haven't yet placed the node, it goes at the end\n current.setNext(newNode);\n }\n }\n }\n size++;\n }" ]
[ "0.7002931", "0.6664196", "0.65270096", "0.6505664", "0.64454055", "0.6271836", "0.6256292", "0.6048734", "0.6008549", "0.59913546", "0.5983759", "0.597622", "0.5959396", "0.5913891", "0.59051746", "0.5903097", "0.5888774", "0.58696425", "0.5864843", "0.58255416", "0.58017623", "0.5793148", "0.5738318", "0.57191765", "0.5709151", "0.5708366", "0.57034963", "0.56969976", "0.567579", "0.5668582", "0.5663434", "0.56623524", "0.56585735", "0.5643772", "0.5631509", "0.5629664", "0.5624228", "0.55586845", "0.55553097", "0.55387294", "0.5537248", "0.5534985", "0.5531846", "0.55265033", "0.55180585", "0.5517313", "0.5514189", "0.5511412", "0.5511146", "0.55109", "0.5508928", "0.55053115", "0.550327", "0.55030555", "0.5498181", "0.5496138", "0.54826075", "0.5465509", "0.5464007", "0.54389876", "0.54348457", "0.54166687", "0.5414385", "0.53952706", "0.5395205", "0.5394378", "0.5383674", "0.53787845", "0.5373385", "0.53732425", "0.53682137", "0.53648186", "0.53572637", "0.5342002", "0.5340513", "0.53392726", "0.5338704", "0.5332506", "0.5331283", "0.53205305", "0.5316343", "0.5315314", "0.53125465", "0.53122884", "0.5302179", "0.5298519", "0.5296987", "0.529257", "0.5286252", "0.5283532", "0.52832115", "0.52809364", "0.52715904", "0.52523315", "0.5241902", "0.5234541", "0.52334934", "0.52303016", "0.52194434", "0.5218358" ]
0.8224303
0
Retrieves the session bound cart instance.
@GetMapping ResponseEntity<Cart> retrieve() { return ResponseEntity.ok(unwrapProxy(cart)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static CartModel getCartInSession(HttpServletRequest request) {\n CartModel cartInfo = (CartModel) request.getSession().getAttribute(\"myCart\");\r\n\r\n if (cartInfo == null) {\r\n cartInfo = new CartModel();\r\n request.getSession().setAttribute(\"myCart\", cartInfo);\r\n }\r\n\r\n return cartInfo;\r\n }", "public ShoppingCart getOrderInSession(HttpServletRequest request) {\n\t\tShoppingCart cart = (ShoppingCart) request.getSession().getAttribute(\"shoppingCart\");\n\t\treturn cart;\n\t\t\n\t}", "public Cart getCart() {\n return this.cart;\n }", "public final List<Item> getCart() {\n return cart;\n }", "private ShoppingCart getExistingScFromSession(HttpServletRequest request) throws UnartigSessionExpiredException\n {\n HttpSession s = request.getSession();\n ShoppingCart shoppingCart = (ShoppingCart) s.getAttribute(Registry._NAME_SHOPPING_CART_SESSION);\n if (shoppingCart == null)\n {\n _logger.debug(\"no shopping cart found in session. throwing exception\");\n throw new UnartigSessionExpiredException(\"Session expired, no Shopping cart available\");\n }\n return shoppingCart;\n }", "public ShoppingCartSubsystem getShoppingCart();", "public Map<String, Integer> getCart() {\n return cart;\n }", "public static CustomSession get() {\r\n\t\treturn (CustomSession) Session.get();\r\n\t}", "public static Session getSession() {\n return session;\n }", "protected Session getSession() { return session; }", "public Session getSession() { return session; }", "public String getCartId()\n\t{\n\t\treturn getCartId( getSession().getSessionContext() );\n\t}", "@GetMapping(value = { \"\", \"/cart\" })\n\tpublic @NotNull ShoppingCartDto getShoppingCartDetail() {\n\t\tLOGGER.info(\"ShoppingCartRestController.getCartDetail() invocation started\");\n\t\treturn theShoppingCartService.getItemDetailFromCart();\n\t}", "protected Session getSession() {\n return sessionUtility.getSession();\n }", "Session getCurrentSession();", "Session getCurrentSession();", "public static HashMap<Integer,Item> getUserCart(){\n\t\treturn userCart;\n\t}", "@GetMapping(value = \"/viewcart\")\n public ResponseEntity<List<CartProduct>> viewCart(final HttpSession session) {\n log.info(session.getId() + \" : Retrieving the cart to view\");\n Map<String, CartProduct> initialCart = (Map<String, CartProduct>) session.getAttribute(CART_SESSION_CONSTANT);\n ControllerUtils.checkEmptyCart(initialCart, session.getId());\n List<CartProduct> result = new ArrayList();\n\n for (String key : initialCart.keySet()) {\n result.add(initialCart.get(key));\n }\n return ResponseEntity.status(HttpStatus.OK).body(result);\n }", "public Session getSession() {\n return session;\n }", "public AbstractSession getSession() {\n return session;\n }", "public Session getSession()\n {\n return session;\n }", "protected Session getSession() {\n\n return (Session) getExtraData().get(ProcessListener.EXTRA_DATA_SESSION);\n }", "public Session getSession()\n\t{\n\t\treturn m_Session;\n\t}", "protected final Session getSession() {\n\t\treturn m_sess;\n\t}", "public Session getSession() {\n return session;\n }", "private Session getSession() {\n\t\treturn factory.getCurrentSession();\n\t}", "@Override\n\tpublic Cart getCartOrCreate(Authentication auth) {\n\t\tCart cart = new Cart();\n\t\tcart.setUpdateDate(LocalDate.now());\n\t\t\n\t\treturn cartRepo.findUserCart(Long.parseLong(auth.getName()))\n\t\t\t\t.orElse(cart);\n\t}", "public static Session getSession() {\n if(sesh == null) {\n return sesh = sf.openSession();\n }\n\n return sesh;\n }", "public RDBMSSession getSession() {\r\n\t\treturn (RDBMSSession) session;\r\n\t}", "public Session getSession() {\n\t\treturn session;\n\t}", "public Session getSession() {\n\t\treturn session;\n\t}", "public Session getSession() {\n\t\treturn session;\n\t}", "public int getCartId() {\n return cartId;\n }", "protected final Session getSession() {\n return sessionTracker.getSession();\n }", "public CartaBean getCarta() {\n\t\t\treturn carta;\n\t\t}", "public Session session() {\n return session;\n }", "protected GatheringSessionBean getinventory$GatheringSessionBean() {\n return (GatheringSessionBean) getBean(\"inventory$GatheringSessionBean\");\n }", "public Session getSession();", "public SessionService session() {\n return service;\n }", "public static Session getCurrentSession() {\n return sessionfactory.getCurrentSession();\n }", "private Session getCurrentSession() {\n return sessionFactory.getCurrentSession();\n }", "public static Session getCurrentSession() {\n if(currentSession != null){\n return currentSession;\n } else {\n createNewSession(new Point2D(300,300));\n return getCurrentSession();\n }\n }", "public Session getCurrentSession() {\r\n return sessionFactory.getCurrentSession();\r\n }", "public static Session getSession() {\n\n if (serverRunning.get() && !session.isClosed()) {\n return session;\n } else {\n if (session.isClosed()) {\n throw new IllegalStateException(\"Session is closed\");\n } else {\n throw new IllegalStateException(\"Cluster not running\");\n }\n }\n }", "protected StoreSessionFacade getStoreSessionFacade()\n\t{\n\t\treturn storeSessionFacade;\n\t}", "@Override\n\tpublic Cart findCart(int cartId) {\n\t\treturn cartRepository.findById(cartId).get();\n\t}", "public Session getCurrentSession() {\r\n return sessionFactory.getCurrentSession();\r\n }", "public String getSession() {\n return this.session;\n }", "public jkt.hms.masters.business.MasSession getSession () {\n\t\treturn session;\n\t}", "public Session getSession(){\n\t\treturn sessionFactory.openSession();\n\t}", "public Session getSession() {\n\t\treturn sessionFactory.getCurrentSession();\r\n\t}", "public Session getCurrentSession() {\r\n\t\treturn sessionFactory.getCurrentSession();\r\n\t}", "public List<Publication> getShoppingCart() {\n return Collections.unmodifiableList(shoppingCart);\n }", "@Override // com.android.server.wm.WindowContainer\n public SurfaceSession getSession() {\n return this.mSession;\n }", "protected abstract SESSION getThisAsSession();", "protected Session getCurrentSession() {\n\t\treturn sessionFactory.getCurrentSession();\n\t}", "protected Session getCurrentSession() {\n\t\treturn sessionFactory.getCurrentSession();\n\t}", "protected Session getCurrentSession()\n \t{\n \t\treturn this.sessionFactory.getCurrentSession();\n \t}", "Cart getCartForUser(String userId);", "public String getSession() {\n return session;\n }", "public String[] loadCart(Session session) throws RemoteException{\n\t\tSystem.out.println(\"Server model invokes loadCart() method\");\n\t\treturn null;\n\t\t\n\t}", "public LocalSession session() { return session; }", "public User getSession(){\n\t\treturn this.session;\n\t}", "public IHTTPSession getSession() {\n\t\treturn session;\n\t}", "@Override\n\tpublic List<Cart> findAllCart() {\n\t\treturn cartRepository.findAll();\n\t}", "public String getCartItem() {\n\t\tMobileElement el = driver.findElement(By.xpath(\"//android.view.View[@resource-id='\" + cart + \"']\"));\n\t\tList<MobileElement> els = el.findElements(By.className(\"android.view.View\"));\n\t\treturn els.get(3).getText();\n\t}", "public /*static*/ Session getSession() {\n return sessionFactory.getCurrentSession();\n }", "public Object getObject() {\n\t\treturn this.sessionFactory;\n\t}", "Session getSession();", "Session getSession();", "public org.openejb.config.ejb11.Session getSession() {\n return this._session;\n }", "public Object getObjFromSession(String key)\n\t{\n\t\treturn context.getSession().get(key);\n\t}", "protected Session getSession() {\n return sessionFactory.getCurrentSession();\n }", "private static Session getInstance() {\n return SingletonHolder.INSTANCE;\n }", "public GameSession getGameSession()\n {\n return gameSession;\n }", "SessionManager get();", "@Provides\n @Current\n IpcSession getCurrentSession(@Current IpcConnection connection) {\n return connection.getSession();\n }", "final protected RobotSessionGlobals getSession() {\n return mSession;\n }", "public int getCartQuantity() {\n return cartQuantity;\n }", "protected SessionBean1 getSessionBean1() {\n return (SessionBean1) getBean(\"SessionBean1\");\n }", "public ItemStack getCartItem() {\n return new ItemStack(ModItems.fluxLevitatorItem);\n }", "public JavabotSession getQuickStartSession()\n {\n return (JavabotSession)getSession();\n }", "public static Session getSession(SlingHttpServletRequest request) {\n ResourceResolver resourceResolver = request.getResourceResolver();\n return resourceResolver.adaptTo(Session.class);\n }", "public SESSION getCurrentSessionForTest() {\n return currentSession;\n }", "public ShoppingCart getById(long id) {\n\t\treturn entityManager.find(ShoppingCart.class, id);\n\t}", "Cart getCartForCode(String orderCode);", "protected SessionBean1 getSessionBean1() {\n return (SessionBean1)getBean(\"SessionBean1\");\n }", "protected SessionBean1 getSessionBean1() {\n return (SessionBean1)getBean(\"SessionBean1\");\n }", "public ShoppingSessionClient() {\n\t\t/* TODO: instantiate the proxy using the EJBProxyFactory (see the other client classes) */\n\t}", "public ShoppingCart createCart() {\n\t\treturn save(new ShoppingCart());\n\t}", "public com.weizhu.proto.WeizhuProtos.Session getSession() {\n return session_;\n }", "synchronized Session getSession(long id) {\n return (Session) sessionMap.get(id);\n }", "public static synchronized Session getCurrentSession(Context context) {\n \tif (Session.currentSession == null) {\n Session.sessionFromCurrentSession(context);\n \t}\n\n \t\treturn Session.currentSession;\n }", "public static ShoppingCartService createShoppingCartService() {\n\t\treturn null;\r\n\t}", "public String getSessionContext() {\n return this.SessionContext;\n }", "public IEvolizerSession getEvolizerSession() throws EvolizerException {\n // IEvolizerSession session = EvolizerSessionHandler.getHandler().getCurrentSession(fDbUrl);\n // return session;\n\n return fSession;\n }", "public Session getSession() {\n\t\tSession session = this.session;\r\n\t\tif (session == null) {\r\n\t\t\t// 2. altrimenti genera una nuova sessione utilizzando la factory (e.g. Spring MVC)\r\n\t\t\tsession = this.sessionFactory.getCurrentSession();\r\n\t\t}\r\n\t\treturn session;\r\n\t}", "private Session getSession (String sessionID) {\n\t\tSession session;\n\t\tif (get(sessionID) != null) {\n\t\t\tsession = get(sessionID);\n\t\t} else {\n\t\t\tsession = new Session();\n\t\t\tput(session.getId(), session);\n\t\t}\n\t\treturn session;\n\t}", "@SneakyThrows\n private static Cart unwrapProxy(Cart cart) {\n if (AopUtils.isAopProxy(cart) && cart instanceof Advised) {\n Object target = ((Advised) cart).getTargetSource().getTarget();\n return (Cart) target;\n } else {\n return cart;\n }\n }", "Session get(int id);" ]
[ "0.71719277", "0.6944858", "0.6807864", "0.6716428", "0.6676629", "0.658014", "0.64743894", "0.6457672", "0.6222734", "0.6111561", "0.6097456", "0.6054587", "0.60294783", "0.6012703", "0.60099965", "0.60099965", "0.60074985", "0.60041976", "0.5990827", "0.59743017", "0.59617114", "0.59438956", "0.5939132", "0.5937331", "0.5920522", "0.5914895", "0.5903023", "0.58973664", "0.5889898", "0.5888946", "0.5888946", "0.5888946", "0.58857846", "0.5885226", "0.5883452", "0.5875239", "0.58096945", "0.58087564", "0.5801152", "0.57833356", "0.577813", "0.5754931", "0.5716981", "0.57101846", "0.5709662", "0.57080984", "0.5687656", "0.568694", "0.568258", "0.56752133", "0.5655129", "0.5637424", "0.5635255", "0.56207556", "0.5611209", "0.56034833", "0.56034833", "0.5594908", "0.559066", "0.55836344", "0.5583447", "0.5566441", "0.55643713", "0.5561067", "0.55576205", "0.5551665", "0.55420226", "0.5529977", "0.55239654", "0.55239654", "0.5518822", "0.55144954", "0.5511333", "0.5503143", "0.5496793", "0.5490678", "0.54844445", "0.5464605", "0.54582816", "0.5454431", "0.54443085", "0.5432347", "0.54276323", "0.54225016", "0.54217935", "0.54049134", "0.5402547", "0.5402547", "0.53981674", "0.5382149", "0.53794146", "0.5370136", "0.53680915", "0.5349575", "0.5313233", "0.52894604", "0.52861494", "0.52703625", "0.52694356", "0.52665734" ]
0.60925835
11
/ Cart is managed by the IoCContainer. Thus, the cart instance is actually a proxy reflection containing some ugly properties that are not desirable in a JSON document. Source:
@SneakyThrows private static Cart unwrapProxy(Cart cart) { if (AopUtils.isAopProxy(cart) && cart instanceof Advised) { Object target = ((Advised) cart).getTargetSource().getTarget(); return (Cart) target; } else { return cart; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CartPojo() {\r\n\t\tsuper();\r\n\t\t// TODO Auto-generated constructor stub\r\n\t}", "public Cart getCart() {\n return this.cart;\n }", "@GetMapping\n ResponseEntity<Cart> retrieve() {\n return ResponseEntity.ok(unwrapProxy(cart));\n }", "public interface Cart {\n Map<Product, Integer> items();\n\n void add(Product product);\n\n void add(Product product, String promo);\n\n Double total();\n\n String getPromoCode();\n}", "public interface iCart {\n\tString addToCart(CartRequest request);\n\tString updateCartQuantity(CartRequest request);\n\tString removeProductFromCart(CartRequest request);\n\tString ClearAllItemFromCart(CartRequest request);\n\tList<CartSummary> getCartSummary(CartRequest request);\n\t\n\n}", "private Cart() {\n }", "public interface CartView {\n\tvoid showState(int state);\n\n\tLifecycleTransformer<List<StoreInfoBean>> bindLife();\n\n\tvoid showCart(List<StoreInfoBean> groups);\n\n\tvoid showGood(RecomGoodModel goodModel);\n\n\tvoid deteleGood(boolean result);\n\n void postOrder();\n}", "@GetMapping(value = { \"\", \"/cart\" })\n\tpublic @NotNull ShoppingCartDto getShoppingCartDetail() {\n\t\tLOGGER.info(\"ShoppingCartRestController.getCartDetail() invocation started\");\n\t\treturn theShoppingCartService.getItemDetailFromCart();\n\t}", "public void setCart(Cart cart){\n\t\tthis.cart = cart;\n\t}", "public CartaBean getCarta() {\n\t\t\treturn carta;\n\t\t}", "public Cart() {\r\n\t\tSystem.out.println(\"in ctor of cart\");\r\n\t}", "public CartRepositoryImpl() {\n\t\tsuper(Cart.class);\n\t\t// this.qf = qf;\n\t}", "public CartBean() {\n }", "public Cart() {\n\t}", "public CartItem() {\n }", "public ShoppingCartSubsystem getShoppingCart();", "public Map<String, Integer> getCart() {\n return cart;\n }", "public final List<Item> getCart() {\n return cart;\n }", "public ShoppingCartBean(){\n super();\n }", "public interface CartService {\n\n\t/**\n\t * Returns all carts present in the system.\n\t * \n\t * @return list of carts\n\t */\n\tList<Cart> getAllCarts();\n\n\t/**\n\t * Returns cart for User Id\n\t * \n\t * @param userId the User Id\n\t * @return cart\n\t */\n\tCart getCartForUser(String userId);\n\n\t/**\n\t * Adds product to cart\n\t * \n\t * @param productCode the product code\n\t * @param quantity the quantity of product to be added\n\t * @param userId the User Id\n\t * @return updated cart\n\t */\n\tCart addToCart(String productCode, Long quantity, String userId);\n\n\t/**\n\t * Returns cart for cart code.\n\t * \n\t * @param orderCode the order code\n\t * @return cart\n\t */\n\tCart getCartForCode(String orderCode);\n\n\t/**\n\t * Removes product from cart\n\t * \n\t * @param code the product code\n\t * @param quantity the quantity of to be removed\n\t * @param userId the User Id\n\t * @return updated cart\n\t */\n\tCart deleteFromCart(String code, Long quantity, String userId);\n}", "public interface CartService extends Service<Cart> {\n\n}", "public CartProduct() {\n }", "public Cart() {\n\t\tcart = new ArrayList<CartItem>();\n\t}", "public interface CartService {\n //向购物车中添加商品\n Map<Integer,CartDishDto> addDishToCart(AddToCartDto addToCartDto,HttpSession session);\n //删除购物车中的商品\n Map<Integer,CartDishDto> deleteFromCart(int id,HttpSession session);\n //改变购物车中商品的数量\n Map<Integer,CartDishDto> changeDishCount(int dishId,int buyCount,HttpSession session);\n}", "public void setCart(Map<String, Integer> cart) {\n this.cart = cart;\n }", "@JsonProperty(\"cart_id\")\n public String getCartId() {\n return cartId;\n }", "public interface CartService {\n List<Cart> getCarts(String cid) throws MyException;\n List<Cart> report(String start,String end);\n void add(Cart cart);\n void delOne(String id);\n void delAll(String cid);\n void edit(String itemId, Double num);\n}", "@JsonSubTypes({\n @JsonSubTypes.Type(value = com.commercetools.api.models.cart_discount.CartDiscountValueAbsoluteImpl.class, name = CartDiscountValueAbsolute.ABSOLUTE),\n @JsonSubTypes.Type(value = com.commercetools.api.models.cart_discount.CartDiscountValueFixedImpl.class, name = CartDiscountValueFixed.FIXED),\n @JsonSubTypes.Type(value = com.commercetools.api.models.cart_discount.CartDiscountValueGiftLineItemImpl.class, name = CartDiscountValueGiftLineItem.GIFT_LINE_ITEM),\n @JsonSubTypes.Type(value = com.commercetools.api.models.cart_discount.CartDiscountValueRelativeImpl.class, name = CartDiscountValueRelative.RELATIVE) })\n@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = \"type\", defaultImpl = CartDiscountValueImpl.class, visible = true)\n@JsonDeserialize(as = CartDiscountValueImpl.class)\n@Generated(value = \"io.vrap.rmf.codegen.rendering.CoreCodeGenerator\", comments = \"https://github.com/commercetools/rmf-codegen\")\npublic interface CartDiscountValue extends CartDiscountValueMixin {\n\n /**\n *\n * @return type\n */\n @NotNull\n @JsonProperty(\"type\")\n public String getType();\n\n /**\n * factory method to create a deep copy of CartDiscountValue\n * @param template instance to be copied\n * @return copy instance\n */\n @Nullable\n public static CartDiscountValue deepCopy(@Nullable final CartDiscountValue template) {\n if (template == null) {\n return null;\n }\n if (template instanceof com.commercetools.api.models.cart_discount.CartDiscountValueAbsolute) {\n return com.commercetools.api.models.cart_discount.CartDiscountValueAbsolute\n .deepCopy((com.commercetools.api.models.cart_discount.CartDiscountValueAbsolute) template);\n }\n if (template instanceof com.commercetools.api.models.cart_discount.CartDiscountValueFixed) {\n return com.commercetools.api.models.cart_discount.CartDiscountValueFixed\n .deepCopy((com.commercetools.api.models.cart_discount.CartDiscountValueFixed) template);\n }\n if (template instanceof com.commercetools.api.models.cart_discount.CartDiscountValueGiftLineItem) {\n return com.commercetools.api.models.cart_discount.CartDiscountValueGiftLineItem\n .deepCopy((com.commercetools.api.models.cart_discount.CartDiscountValueGiftLineItem) template);\n }\n if (template instanceof com.commercetools.api.models.cart_discount.CartDiscountValueRelative) {\n return com.commercetools.api.models.cart_discount.CartDiscountValueRelative\n .deepCopy((com.commercetools.api.models.cart_discount.CartDiscountValueRelative) template);\n }\n CartDiscountValueImpl instance = new CartDiscountValueImpl();\n return instance;\n }\n\n /**\n * builder for absolute subtype\n * @return builder\n */\n public static com.commercetools.api.models.cart_discount.CartDiscountValueAbsoluteBuilder absoluteBuilder() {\n return com.commercetools.api.models.cart_discount.CartDiscountValueAbsoluteBuilder.of();\n }\n\n /**\n * builder for fixed subtype\n * @return builder\n */\n public static com.commercetools.api.models.cart_discount.CartDiscountValueFixedBuilder fixedBuilder() {\n return com.commercetools.api.models.cart_discount.CartDiscountValueFixedBuilder.of();\n }\n\n /**\n * builder for giftLineItem subtype\n * @return builder\n */\n public static com.commercetools.api.models.cart_discount.CartDiscountValueGiftLineItemBuilder giftLineItemBuilder() {\n return com.commercetools.api.models.cart_discount.CartDiscountValueGiftLineItemBuilder.of();\n }\n\n /**\n * builder for relative subtype\n * @return builder\n */\n public static com.commercetools.api.models.cart_discount.CartDiscountValueRelativeBuilder relativeBuilder() {\n return com.commercetools.api.models.cart_discount.CartDiscountValueRelativeBuilder.of();\n }\n\n /**\n * accessor map function\n * @param <T> mapped type\n * @param helper function to map the object\n * @return mapped value\n */\n default <T> T withCartDiscountValue(Function<CartDiscountValue, T> helper) {\n return helper.apply(this);\n }\n\n /**\n * gives a TypeReference for usage with Jackson DataBind\n * @return TypeReference\n */\n public static com.fasterxml.jackson.core.type.TypeReference<CartDiscountValue> typeReference() {\n return new com.fasterxml.jackson.core.type.TypeReference<CartDiscountValue>() {\n @Override\n public String toString() {\n return \"TypeReference<CartDiscountValue>\";\n }\n };\n }\n}", "@Test\n public void testCartItemGetters() {\n int quantity = 4;\n Product p = new Product(\"test-product\", 5, new Category(\"Category1\"));\n CartItem cartItem = new CartItem(p, quantity);\n assertEquals(cartItem.getProduct(), p);\n assertEquals(cartItem.getQuantity(), quantity);\n }", "@Override\n public void loadCartProductsData() {\n mCartPresenter.loadCartProductsData();\n }", "public interface CartService {\n\n Cart getCartById (int cartId);\n\n void update(Cart cart);\n}", "public CustomerCartItem() {\n }", "DetailedCart generateDetailedCart(Cart cart);", "public Shopper() {\r\n cart = new Carryable[MAX_CART_ITEMS];\r\n numItems = 0;\r\n }", "public interface ShoppingCart {\n\t\n\t/**\n\t * Returns Total Count of Products User has added in the Shopping cart\n\t * @return Total Count of Products\n\t */\n\tpublic int getProductCount();\n\t\n\t/**\n\t * Adds a particular product in the Shopping Cart\n\t * @param product Product\n\t */\n\tpublic void addProduct(Product product);\n\t\n\t/**\n\t * The Total Value of all the products added in the Shopping cart\n\t * @return Total Value\n\t */\n\tpublic double getTotalCartValue();\n\t\n}", "public List<Publication> getShoppingCart() {\n return Collections.unmodifiableList(shoppingCart);\n }", "@Override\n\tpublic List<Cart> findAllCart() {\n\t\treturn cartRepository.findAll();\n\t}", "public Cartao() {\r\n\t\tsuper();\r\n\t\t// TODO Auto-generated constructor stub\r\n\t}", "public interface ShoppingCartService {\n ShoppingCartDetail getShoppingCartDetailWithAmount(BigDecimal quantity,\n Product product);\n BigDecimal calculateAmount(BigDecimal quantity, Product product);\n}", "List<Cart> getAllCarts();", "public int getCartQuantity() {\n return cartQuantity;\n }", "public ShoppingSessionClient() {\n\t\t/* TODO: instantiate the proxy using the EJBProxyFactory (see the other client classes) */\n\t}", "public interface ShoppingCartService {\n\n\tShoppingCartVO addToShoppingCart(ShoppingCartVO shoppingCart, String isbn, String isRent) throws SapeStoreException;\n\n\tShoppingCartVO removeFromShoppingCart(ShoppingCartVO shoppingCart, BookVO book);\n\n\tShoppingCartVO updateBookQuantity(ShoppingCartVO shoppingCart, BookVO book, int quantity, String trantype);\n\t\n\tShoppingCartVO calculateTotalPrice(ShoppingCartVO shoppingcart);\n\t\n\tShoppingCartVO calculateTotalQuantity(ShoppingCartVO shoppingcart);\n\n}", "ResponseEntity<List<ItemDTO>> getAllCartItems(String cartId);", "public int getCartId() {\n return cartId;\n }", "public CustomerCartItem(CartItem cartItem) {\n Item item = cartItem.getItem();\n this.id = item.getId();\n this.quantity = cartItem.getQuantity();\n }", "public CompraResponse cartao(String cartao) {\n this.cartao = cartao;\n return this;\n }", "public CartLines() {\n }", "Cart getCartForUser(String userId);", "public ShoppingCart() {\n\t\t_items = new ArrayList<Product>();\n\t}", "public final void setCart(final List<Item> cartNew) {\n this.cart = cartNew;\n }", "public ShoppingCart createCart() {\n\t\treturn save(new ShoppingCart());\n\t}", "@Override\n\tpublic List<ShopCarVO> getShopCartList(String member) {\n\t\treturn null;\n\t}", "public ShoppingCart() {\r\n myShoppingCart = new HashMap<Item, BigDecimal>();\r\n }", "@Override\n\tpublic List<Cart> viewMyCart() throws BusinessException {\n\t\treturn null;\n\t}", "public Cart() {\n initComponents();\n \n }", "public CartLine get(int id);", "@ModelAttribute(\"cartContent\")\n public ArrayList<ShoppingCartItem> getCartContent() {\n return ShoppingCart.INSTANCE.getCartContent();\n }", "public List<CartItem> getAllcartitem();", "ResponseEntity<Price> findPriceByCartId(String cartId);", "public void update(Object cart) {\n wrapper.clear();\r\n wrapper.add(createPanel(cart));\r\n }", "@Override\n public CartState getCartState() {\n return null;\n }", "@JsonProperty(\"cart_id\")\n public void setCartId(String cartId) {\n this.cartId = cartId;\n }", "public interface ICartView {\r\n void loadViewCart(List<Product> cart,List<String> list);\r\n void loadFailView();\r\n\r\n void removeItemCart(int position);\r\n\r\n void reloadView(int quantity, int position);\r\n\r\n}", "ProxyValue createProxyValue();", "public static ShoppingCartService createShoppingCartService() {\n\t\treturn null;\r\n\t}", "private ProductProperties innerProperties() {\n return this.innerProperties;\n }", "public void setCarta(CartaBean carta) {\n\t\t\tthis.carta = carta;\n\t\t}", "@Test\n public void setCart() throws NullReferenceException {\n cartItem.setCart(cart2);\n assertSame(cart2, cartItem.getCart());\n }", "bookingDTO getCart(int userID) throws DataAccessException;", "public String getCartype() {\n return cartype;\n }", "public String getCartype() {\n return cartype;\n }", "@Override\n public void shoppingCartChanged(CartEvent cartEvent) {\n }", "public ShoppingCart() {\n\t\tmaxSize = 3;\n\t\tCart = new Item[maxSize];\n\t\tcurrentSize = 0;\n\t}", "public ArrayList getCartas();", "@Test\n public void testCartItemSetters() {\n int quantity = 4;\n Product p = new Product(\"test-product\", 5, new Category(\"Category1\"));\n CartItem cartItem = new CartItem(p, quantity);\n cartItem.setProduct(new Product(\"test-product-2\", 1, new Category(\"Category2\")));\n cartItem.setQuantity(quantity + 1);\n assertNotEquals(cartItem.getProduct(), p);\n assertNotEquals(cartItem.getQuantity(), quantity);\n }", "@Override\n public TicketDTO buyCart() throws InvalidQuantityException, IOException, ProductNotFoundException {\n\n return catalogueRepository.buyCart();\n }", "ResponseEntity<Cart> addCartItem(CartFormData formData);", "public ObjectContainer getObjectContainer()\n {\n return container;\n }", "@Override\n\tpublic Cart findCart(int cartId) {\n\t\treturn cartRepository.findById(cartId).get();\n\t}", "public void setCartQuantity(int cartQuantity) {\n this.cartQuantity = cartQuantity;\n }", "@GetMapping(value = \"/viewcart\")\n public ResponseEntity<List<CartProduct>> viewCart(final HttpSession session) {\n log.info(session.getId() + \" : Retrieving the cart to view\");\n Map<String, CartProduct> initialCart = (Map<String, CartProduct>) session.getAttribute(CART_SESSION_CONSTANT);\n ControllerUtils.checkEmptyCart(initialCart, session.getId());\n List<CartProduct> result = new ArrayList();\n\n for (String key : initialCart.keySet()) {\n result.add(initialCart.get(key));\n }\n return ResponseEntity.status(HttpStatus.OK).body(result);\n }", "@Override\n\t@Transactional\n\tpublic List<ShoppingCart> getListShoppingCart() {\n\t\treturn shoppingCartDao.getListShoppingCart();\n\t}", "private CatalogContract() {}", "@JsonGetter(\"product_details\")\n public ProductData getProductDetails ( ) { \n return this.productDetails;\n }", "public ProductDecorator() {}", "public Collection<CartItem> getCartItems(){\t\t\n\t\treturn map.values();\n\t}", "public static HashMap<Integer,Item> getUserCart(){\n\t\treturn userCart;\n\t}", "public CarAccessBean ( javax.ejb.EJBObject o ) throws java.rmi.RemoteException {\n super(o);\n }", "@Test\n public void testProxy() {\n Dell dell = new Dell();\n Proxy proxy = new Proxy(dell);\n proxy.salePc();\n }", "protected ProductDecorator(Product prod) {\n\t\tproduct = prod;\n\t}", "public ShoppingCartPersisterImpl(final CookieTuplizer cookieTuplizer) {\r\n this.cookieTuplizer = cookieTuplizer;\r\n }", "public static CartModel getCartInSession(HttpServletRequest request) {\n CartModel cartInfo = (CartModel) request.getSession().getAttribute(\"myCart\");\r\n\r\n if (cartInfo == null) {\r\n cartInfo = new CartModel();\r\n request.getSession().setAttribute(\"myCart\", cartInfo);\r\n }\r\n\r\n return cartInfo;\r\n }", "public void setCartype(String cartype) {\n this.cartype = cartype;\n }", "@Override\n public void loadAdd2CartProductData() {\n mAdd2CartPresenter.loadAdd2CartProductData();\n }", "Cart getCartForCode(String orderCode);", "public interface CartDao {\n\n Cart create(Cart cart);\n\n Cart read(String cartId);\n\n void update ( String cartId, Cart cart);\n\n void delete (String cartId);\n}", "public static Order buildCart(Cart cart) {\n\n cart.getAddress().saveInBackground();\n\n final Order order = new Order();\n order.setSchedule(cart.getSchedule());\n order.setAddress(cart.getAddress());\n order.setPickUp(cart.getPickup());\n order.setEvent(cart.getEvent());\n order.setProductGroup(cart.getProducts());\n try {\n order.save();\n System.out.println(order.getObjectId());\n } catch (ParseException e) {\n Log.e(Order.DEFAULT_PIN, \"CartHelper unable to save Order \", e);\n }\n for (Promotion promotion : cart.promotions) {\n promotion.promotionUtilized();\n if (promotion instanceof InvitationPromotion) {\n cart.getUser().setNewUserPromotionUsed();\n }\n }\n\n\n for (ProductPriceRow productPriceRow : cart.productPrice) {\n\n addVendorPayment(productPriceRow.getProduct().getGyftyProduct(), order.getObjectId(), productPriceRow);\n addVendorNotes(productPriceRow.getProduct(), order);\n\n }\n\n/* try {\n cart.delete();\n } catch (ParseException e) {\n Log.e(\"CartHelper\", \"CartHelper unable to delete cart\", e);\n }*/\n return order;\n\n }", "@WebService(targetNamespace = \"http://www.polytech.unice.fr/si/4a/isa/tcf/cart\", name = \"CartWebService\")\n@XmlSeeAlso({ObjectFactory.class})\npublic interface CartWebService {\n\n @WebMethod\n @RequestWrapper(localName = \"validate\", targetNamespace = \"http://www.polytech.unice.fr/si/4a/isa/tcf/cart\", className = \"stubs.cart.Validate\")\n @ResponseWrapper(localName = \"validateResponse\", targetNamespace = \"http://www.polytech.unice.fr/si/4a/isa/tcf/cart\", className = \"stubs.cart.ValidateResponse\")\n @WebResult(name = \"order_id\", targetNamespace = \"\")\n public java.lang.String validate(\n @WebParam(name = \"customer_name\", targetNamespace = \"\")\n java.lang.String customerName\n ) throws PaymentException_Exception, UnknownCustomerException_Exception, EmptyCartException_Exception;\n\n @WebMethod\n @RequestWrapper(localName = \"removeItemToCustomerCart\", targetNamespace = \"http://www.polytech.unice.fr/si/4a/isa/tcf/cart\", className = \"stubs.cart.RemoveItemToCustomerCart\")\n @ResponseWrapper(localName = \"removeItemToCustomerCartResponse\", targetNamespace = \"http://www.polytech.unice.fr/si/4a/isa/tcf/cart\", className = \"stubs.cart.RemoveItemToCustomerCartResponse\")\n public void removeItemToCustomerCart(\n @WebParam(name = \"customer_name\", targetNamespace = \"\")\n java.lang.String customerName,\n @WebParam(name = \"item\", targetNamespace = \"\")\n stubs.cart.Item item\n ) throws UnknownCustomerException_Exception;\n\n @WebMethod\n @RequestWrapper(localName = \"addItemToCustomerCart\", targetNamespace = \"http://www.polytech.unice.fr/si/4a/isa/tcf/cart\", className = \"stubs.cart.AddItemToCustomerCart\")\n @ResponseWrapper(localName = \"addItemToCustomerCartResponse\", targetNamespace = \"http://www.polytech.unice.fr/si/4a/isa/tcf/cart\", className = \"stubs.cart.AddItemToCustomerCartResponse\")\n public void addItemToCustomerCart(\n @WebParam(name = \"customer_name\", targetNamespace = \"\")\n java.lang.String customerName,\n @WebParam(name = \"item\", targetNamespace = \"\")\n stubs.cart.Item item\n ) throws UnknownCustomerException_Exception;\n\n @WebMethod\n @RequestWrapper(localName = \"getCustomerCartContents\", targetNamespace = \"http://www.polytech.unice.fr/si/4a/isa/tcf/cart\", className = \"stubs.cart.GetCustomerCartContents\")\n @ResponseWrapper(localName = \"getCustomerCartContentsResponse\", targetNamespace = \"http://www.polytech.unice.fr/si/4a/isa/tcf/cart\", className = \"stubs.cart.GetCustomerCartContentsResponse\")\n @WebResult(name = \"cart_contents\", targetNamespace = \"\")\n public java.util.List<stubs.cart.Item> getCustomerCartContents(\n @WebParam(name = \"customer_name\", targetNamespace = \"\")\n java.lang.String customerName\n ) throws UnknownCustomerException_Exception;\n}", "public ProductoDTO(){\r\n\t\t\r\n\t}" ]
[ "0.69669366", "0.6587448", "0.62174183", "0.6150895", "0.5965738", "0.5963912", "0.5900151", "0.58644533", "0.58574873", "0.58466274", "0.58402187", "0.5839296", "0.5808367", "0.5807378", "0.5780172", "0.57766795", "0.5733645", "0.5733274", "0.5690301", "0.5667999", "0.5599007", "0.55918646", "0.55881697", "0.5585683", "0.55726296", "0.5564725", "0.5524394", "0.5446606", "0.5403021", "0.53996027", "0.53840166", "0.5349413", "0.53084344", "0.5292732", "0.52611333", "0.52427334", "0.5218575", "0.5199603", "0.51989204", "0.5183293", "0.51755494", "0.51741374", "0.51710844", "0.51272976", "0.5120874", "0.511395", "0.51072866", "0.5104442", "0.5098952", "0.50978315", "0.5078423", "0.5065476", "0.5059573", "0.5046479", "0.50410527", "0.50351804", "0.50209314", "0.5003295", "0.49825507", "0.49686122", "0.4965209", "0.496178", "0.49581426", "0.49525315", "0.49496374", "0.49398378", "0.49365744", "0.49294695", "0.4923749", "0.49156666", "0.4910102", "0.4910102", "0.48971003", "0.4893434", "0.4893039", "0.4892384", "0.489222", "0.48904657", "0.48890758", "0.4877467", "0.4874971", "0.4865162", "0.48640943", "0.48637053", "0.48630735", "0.48580167", "0.48570493", "0.48560098", "0.48467362", "0.48437455", "0.48299453", "0.48293507", "0.48291203", "0.48290437", "0.48222125", "0.48090392", "0.4807207", "0.4803243", "0.47974023", "0.4792141" ]
0.6853889
1
Creates and completes a new Order and generates a completion report afterwards.
@PostMapping("/checkout") ResponseEntity<OrderCompletionReport> checkout(@RequestParam int amount, @RequestParam("crate_size") CrateSize crateSize) { verify(cart); Order order = new Order(); transferItems(cart, order, Long.valueOf(crateSize.times(amount)).intValue()); order.complete(); repository.save(order); cart.clear(); return ResponseEntity.ok(OrderCompletionReport.success(order)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void makeComplete(Order order) {}", "public void createNewOrder()\n\t{\n\t\tnew DataBaseOperationAsyn().execute();\n\t}", "@Test (priority = 3)\n\t@Then(\"^Create Order$\")\n\tpublic void create_Order() throws Throwable {\n\t\tCommonFunctions.clickButton(\"wlnk_Home\", \"Sheet1\", \"Home\", \"CLICK\");\n\t\t//Thread.sleep(2000);\n\t\tCommonFunctions.clickButton(\"WLNK_OrderNewServices\", \"Sheet1\", \"Oreder New Service\", \"CLICK\");\n\t\t//Thread.sleep(3000);\n\t\tCommonFunctions.clickButton(\"WRD_complete\", \"Sheet1\", \"Complete\", \"CLICK\");\n\t\t//Thread.sleep(2000);\n\t\tCommonFunctions.clickButton(\"WLK_continue\", \"Sheet1\", \"Contine\", \"CLICK\");\n\t\t//Thread.sleep(2000);\n\t\tCommonFunctions.clickButton(\"WCB_Additional\", \"Sheet1\", \"Additional\", \"CLICK\");\n\t\t//Thread.sleep(2000);\n\t\tCommonFunctions.clickButton(\"WLK_continue\", \"Sheet1\", \"Complete\", \"CLICK\");\n\t\tCommonFunctions.clickButton(\"WBT_checkout\", \"Sheet1\", \"Checkout\", \"CLICK\");\n\t\tCommonFunctions.clickButton(\"WBT_completeOrder\", \"Sheet1\", \"complete order\", \"CLICK\");\n\t\tCommonFunctions.clickButton(\"WBT_PayNow\", \"Sheet1\", \"Pay Now\", \"CLICK\");\n\t\tCommonFunctions.checkObjectExist(\"WBT_PayPal\", \"Sheet1\", \"Pay pal\", \"NO\");\n\t\tCommonFunctions.clickButton(\"WBT_PayPal\", \"Sheet1\", \"Pay pal\", \"CLICK\");\n\t}", "void finishOrder(int orderId);", "void create(Order order);", "private void generateAndSubmitOrder()\n {\n OrderSingle order = Factory.getInstance().createOrderSingle();\n order.setOrderType(OrderType.Limit);\n order.setPrice(BigDecimal.ONE);\n order.setQuantity(BigDecimal.TEN);\n order.setSide(Side.Buy);\n order.setInstrument(new Equity(\"METC\"));\n order.setTimeInForce(TimeInForce.GoodTillCancel);\n if(send(order)) {\n recordOrderID(order.getOrderID());\n }\n }", "void newOrder();", "NewOrderResponse newOrder(NewOrder order);", "public void startOrder() {\r\n this.o= new Order();\r\n }", "@Test(dependsOnMethods = \"checkSiteVersion\")\n public void createNewOrder() {\n actions.openRandomProduct();\n\n // save product parameters\n actions.saveProductParameters();\n\n // add product to Cart and validate product information in the Cart\n actions.addToCart();\n actions.goToCart();\n actions.validateProductInfo();\n\n // proceed to order creation, fill required information\n actions.proceedToOrderCreation();\n\n // place new order and validate order summary\n\n // check updated In Stock value\n }", "public Order() {\n\t\tthis.orderID = DataHolder.getInstance().getLastOrderId() + 1;\n\t\tthis.dateOrdered = new Date();\n\t\tthis.dateFilled = null;\n\t\tthis.projectedDate = addDays(dateOrdered,1);\n\t}", "Order placeNewOrder(Order order, Project project, User user);", "public void clearOrder()\r\n\t{\r\n\t\tsubtotal = new BigDecimal(\"0.0\");\r\n\t\torderSize = 0;\r\n\t\tSystem.out.println(\"Starting a new order\");\r\n\t\tModelEvent me = new ModelEvent(this,0,\"New Order\",0);\r\n\t\tnotifyChanged(me);\r\n\t}", "@Override\n\tpublic OrderResponseDto createOrder(OrderRequestDto orderRequestDto) {\n\t\tLOGGER.info(\"Enter into order service impl\");\n\n\t\tOptional<Stocks> stock = stockRepository.findById(orderRequestDto.getStockId());\n\t\tOptional<User> user = userRepository.findById(orderRequestDto.getUserId());\n\n\t\tif (!stock.isPresent())\n\t\t\tthrow new CommonException(TradingConstants.ERROR_STOCK_NOT_FOUND);\n\t\tif (!user.isPresent())\n\t\t\tthrow new CommonException(TradingConstants.ERROR_USER_NOT_FOUND);\n\t\tif (orderRequestDto.getStockQuantity() >= 100)\n\t\t\tthrow new CommonException(TradingConstants.ERROR_QUANTITY);\n\t\tDouble brokeragePercent = Double.valueOf(stock.get().getBrokerageAmount() / 100d);\n\t\tDouble brokerageAmount = stock.get().getStockPrice() * orderRequestDto.getStockQuantity() + brokeragePercent;\n\t\tDouble totalPrice = stock.get().getStockPrice() * orderRequestDto.getStockQuantity() + brokerageAmount;\n\n\t\tOrders orders = Orders.builder().stockId(stock.get().getStockId())\n\t\t\t\t.stockQuantity(orderRequestDto.getStockQuantity()).totalPrice(totalPrice)\n\t\t\t\t.stockStatus(StockStatus.P.toString()).userId(orderRequestDto.getUserId()).build();\n\t\torderRepository.save(orders);\n\t\tResponseEntity<GlobalQuoteDto> latest = latestStockPrice(stock.get().getStockName());\n\t\treturn new OrderResponseDto(orders.getOrderId(), stock.get().getStockPrice(),\n\t\t\t\tlatest.getBody().getGlobalQuote().getPrice());\n\t}", "private void createIPOOrder(final OrderBO completedOrder)\n\t{\n\t\t// YTODO Auto-generated method stub\n\t\tfinal FMIPOOrderModel order = getmodelService().create(FMIPOOrderModel.class);\n\t\torder.setCode(completedOrder.getMstrOrdNbr().trim());\n\t\torder.setBilltoparty(getAccountByNabs(completedOrder.getBillToAcct().getAccountCode()));\n\t\torder.setShiptoparty(getAccountByNabs(completedOrder.getShipToAcct().getAccountCode()));\n\t\torder.setPONumber(completedOrder.getCustPoNbr());\n\t\torder.setOrdercomments(completedOrder.getComment1() + completedOrder.getComment2() + completedOrder.getComment3());\n\t\torder.setUserFirstName(\"IPO USER\");\n\t\tgetmodelService().save(order);\n\t\tcreateIPOOrderEntry(order, completedOrder.getItemList());\n\t}", "public Order() {\n\t\tsuper();\n\t\tcurrentOrder += 1;\n\t\torderNumber = currentOrder;\n\t\tthis.orderPrice.setScale(2, BigDecimal.ROUND_HALF_EVEN);\n\t}", "public void completeOrderById(String orderId) {\n String completePath = mgmtOrdersPath + orderId + \"/complete\";\n sendRequest(putResponseType, systemUserAuthToken(), completePath, resultResult, statusCode200);\n }", "@GetMapping(\"/createorders\")\n\tpublic void generateOrderRequest(){\n\t\tSystem.out.println(\" == generateOrderRequest == \");\n\t\tfor(int i=0;i<150;i++) {\n\t\t\t// create new order\n\t\t\tOrderRequest order = new OrderRequest();\n\t\t\torder.setOrderReqId(\n\t\t\t\t\tInteger.parseInt(new RandomStringGenerator.Builder().withinRange('1', '9').build().generate(5))\n\t\t\t\t\t);\n\t\t\torder.setName(new RandomStringGenerator.Builder().withinRange('a', 'z').build().generate(5));\n\t\t\t// create status row for this order\n\t\t\tOrderRequestStatus orderStatus = new OrderRequestStatus();\n\t\t\torderStatus.setStatus(\"new\");\n\t\t\torderStatus.setOrderRequest(order);\n\t\t\torderStateRepository.save(orderStatus);\n\t\t}\n\t}", "@Test\n public void testPopulateNewOrderInfo() throws Exception {\n\n Order order3 = new Order(\"003\");\n order3.setCustomerName(\"Paul\");\n order3.setState(\"Ky\");\n order3.setTaxRate(new BigDecimal(\"6.75\"));\n order3.setArea(new BigDecimal(\"5.00\"));\n order3.setOrderDate(\"Date_Folder_Orders/Orders_06232017.txt\");\n order3.setProductName(\"tile\");\n order3.setMatCostSqFt(new BigDecimal(\"5.50\"));\n order3.setLaborCostSqFt(new BigDecimal(\"6.00\"));\n order3.setMatCost(new BigDecimal(\"50.00\"));\n order3.setLaborCost(new BigDecimal(\"500.00\"));\n order3.setOrderTax(new BigDecimal(\"50.00\"));\n order3.setTotalOrderCost(new BigDecimal(\"30000.00\"));\n\n Order order4 = service.populateNewOrderInfo(order3);\n\n assertEquals(\"Paul\", order4.getCustomerName());\n }", "public MOrder createTransferOrder(Integer newDocTypeID) throws Exception{\n\t\t// Crear el pedido idéntico\n\t\tMOrder newOrder = new MOrder(getCtx(), 0, get_TrxName());\n\t\tMOrder.copyValues(this, newOrder);\n\t\tnewOrder.setC_DocTypeTarget_ID(newDocTypeID);\n\t\tnewOrder.setC_DocType_ID(newDocTypeID);\n\t\t// Intercambiar el depósito y organización origen por destino \n\t\tnewOrder.setAD_Org_ID(getAD_Org_Transfer_ID());\n\t\tnewOrder.setAD_Org_Transfer_ID(getAD_Org_ID());\n\t\tnewOrder.setM_Warehouse_ID(getM_Warehouse_Transfer_ID());\n\t\tnewOrder.setM_Warehouse_Transfer_ID(getM_Warehouse_ID());\n\t\tnewOrder.setRef_Order_ID(getID());\n\t\tnewOrder.setDocStatus(DOCSTATUS_Drafted);\n\t\tnewOrder.setDocAction(DOCACTION_Complete);\n\t\tnewOrder.setProcessed(false);\n\t\t// Guardar\n\t\tif(!newOrder.save()){\n\t\t\tthrow new Exception(CLogger.retrieveErrorAsString());\n\t\t}\n\t\t// Copiar las líneas\n\t\tMOrderLine newOrderLine;\n\t\tBigDecimal pendingQty;\n\t\tfor (MOrderLine orderLine : getLines(true)) {\n\t\t\tnewOrderLine = new MOrderLine(getCtx(), 0, get_TrxName());\n\t\t\tMOrderLine.copyValues(orderLine, newOrderLine);\n\t\t\tpendingQty = orderLine.getQtyOrdered().subtract(orderLine.getQtyDelivered());\n\t\t\t\n\t\t\tnewOrderLine.setC_Order_ID(newOrder.getID());\n\t\t\tnewOrderLine.setQty(pendingQty);\n\t\t\tnewOrderLine.setQtyReserved(BigDecimal.ZERO);\n\t\t\tnewOrderLine.setQtyInvoiced(pendingQty);\n\t\t\tnewOrderLine.setQtyDelivered(BigDecimal.ZERO);\n\t\t\tnewOrderLine.setQtyTransferred(BigDecimal.ZERO);\n\t\t\tnewOrderLine.setPrice(orderLine.getPriceEntered());\n\t\t\tnewOrderLine.setRef_OrderLine_ID(orderLine.getID());\n\t\t\tnewOrderLine.setProcessed(false);\n\t\t\tnewOrderLine.setM_Warehouse_ID(newOrder.getM_Warehouse_ID());\n\t\t\tnewOrderLine.setAD_Org_ID(newOrder.getAD_Org_ID());\n\t\t\tif(!newOrderLine.save()){\n\t\t\t\tthrow new Exception(CLogger.retrieveErrorAsString());\n\t\t\t}\n\t\t}\n\t\treturn newOrder;\n\t}", "@Override\n\tpublic void openOrderEnd() {\n\t}", "void createOrders(int orderNum) throws OrderBookOrderException;", "Order sendNotificationNewOrder(Order order);", "private void orderCompleted(ArrayList<Transaction> transactionList) {\n String customerName = studentDetails[0].getName();\n String customerMobile = studentDetails[0].getMobile();\n String customerEmail = studentDetails[0].getEmail();\n Order order = new Order(-1, customerName, customerMobile, customerEmail\n , \"\",\n total, discount, false);\n\n ArrayList<SubOrder> subOrderList = new ArrayList<>();\n\n for (CartItem cartItem : cartList) {\n ProductHeader product = cartItem.getProductHeader();\n subOrderList.add(new SubOrder(product.getName(), product.getId(),\n product.getSku(), cartItem.getPrice(), cartItem.getQuantity(),\n 0, 0, 0, 0, false));\n }\n\n ProductAPI.saveAndSyncOrder(getContext(), db, order, subOrderList, transactionList);\n\n Toast.makeText(getContext(), \"Order completed\", Toast.LENGTH_SHORT).show();\n cartList.clear();\n cartAdapter.notifyDataSetChanged();\n updatePriceView();\n\n cartRecyclerView.setVisibility(View.GONE);\n emptyCartView.setVisibility(View.VISIBLE);\n dismissDialog();\n }", "public Order() {\n }", "public Order() {\n\t}", "public OrderDoneExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "@Test\n public void testAddOrder() {\n Order addedOrder = new Order();\n\n addedOrder.setOrderNumber(1);\n addedOrder.setOrderDate(LocalDate.parse(\"1900-01-01\"));\n addedOrder.setCustomer(\"Add Test\");\n addedOrder.setTax(new Tax(\"OH\", new BigDecimal(\"6.25\")));\n addedOrder.setProduct(new Product(\"Wood\", new BigDecimal(\"5.15\"), new BigDecimal(\"4.75\")));\n addedOrder.setArea(new BigDecimal(\"100.00\"));\n addedOrder.setMaterialCost(new BigDecimal(\"515.00\"));\n addedOrder.setLaborCost(new BigDecimal(\"475.00\"));\n addedOrder.setTaxCost(new BigDecimal(\"61.88\"));\n addedOrder.setTotal(new BigDecimal(\"1051.88\"));\n\n dao.addOrder(addedOrder);\n\n Order daoOrder = dao.getAllOrders().get(0);\n\n assertEquals(addedOrder, daoOrder);\n }", "@Override\n public Order create(Order order) {\n this.orders.add(order);\n save();\n return order;\n }", "public LabOrder generateOrder() {\n LabOrder order = new LabOrder();\n Random r = new Random();\n Date date = getDate(r);\n order.insertts = date; //randbetween 1388534400 <-> 1420070400\n order.ordernr = \"O\" + r.nextInt();\n order.patientnr = \"P\" + r.nextInt(10000); //1 mil / 100 = 10 000\n order.visitNr = \"V\" + r.nextInt(); //unique;\n order.specimens.add(generateSpecimen(order));\n order.specimens.add(generateSpecimen(order));\n return order;\n }", "public static Order awaitOrder() throws InterruptedException {\n // While this is a console application, we need to get the input here too. When we convert to a GUI,\n // the order submission button should create the order, add it to the queue, and signal it's ready.\n System.out.println(\"Please enter the following details to complete your order:\");\n Scanner input = new Scanner(System.in);\n float length = (float) getInput(\"What length of pipe do you need, in metres? \", input, Float.class);\n float diameter = (float) getInput(\"What outer diameter do you need, in inches? \", input, Float.class);\n int grade = (int) getInputWithinRange(\"What grade of plastic do you need (1 through 5)? \", input, Integer.class,\n 1, 5);\n int colors = (int) getInputWithinRange(\"Do you need 0, 1, or 2-coloured plastic? \", input, Integer.class, 0, 2);\n boolean reinforced = (boolean) getInput(\"Do you need extra reinforcement (y/N)? \", input, Boolean.class);\n boolean insulated = (boolean) getInput(\"Do you need insulation (y/N)? \", input, Boolean.class);\n boolean chemResist = (boolean) getInput(\"Do you need chemical resistance (y/N)? \", input, Boolean.class);\n int quantity = (int) getInput(\"How many of these pipes do you need? \", input, Integer.class);\n Order customerOrder = new Order(grade, length, diameter, colors, insulated, reinforced, chemResist, quantity);\n \n ORDER_QUEUE.add(customerOrder);\n ORDER_SIGNALER.release();\n\n // Blocks until there's an order available in the queue.\n ORDER_SIGNALER.acquire();\n \n return ORDER_QUEUE.remove();\n }", "@ApiOperation(value = \"Completes an existing order\", response = OrderDto.class)\n\t@ApiResponses(value = {\n\t @ApiResponse(code = 200, message = \"Successfully completed order.\"),\n\t @ApiResponse(code = 400, message = \"The order is unable to complete.\"\n\t \t\t+ \" Either it is in no appropriate state or no items were added\")\n\t})\n\t@RequestMapping(path = \"{orderId}\", method = RequestMethod.PATCH)\n\tpublic @ResponseBody OrderDto complete(@PathVariable(\"orderId\") Long orderId) {\n\t\treturn this.orderConverter.toModel(this.orderManager.complete(orderId));\n\n\t}", "public void create(Order order) {\n order_dao.create(order);\n }", "public Order() {\n orderID = \"\";\n customerID = \"\";\n status = \"\";\n }", "public Order()\r\n\t{\r\n\t\tnew BigDecimal(\"0.0\");\r\n\t\tsubtotal = new BigDecimal(\"0.0\");\r\n\t\tarraySize = 5;\r\n\t\torderSize = 0;\r\n\t\torder = new Drink[arraySize];\r\n\t\tSystem.out.println(\"New Order started!\");\r\n\t}", "public void submitOrder(BeverageOrder order);", "public void generateOrder() throws IOException, StockException {\n\t\tManifest order = new Manifest();\n\n\t\tfor (Item item : Store.getInstance().getInventory().getItems()) {\n\t\t\tif (item.requiresOrder()) {\n\t\t\t\torder.addItem(item);\n\t\t\t}\n\t\t}\n\t\torder.saveToFile(\"manifest.csv\");\n\n\t\tfor (Truck truck : order.getTrucks()) {\n\t\t\tinventory.adjustBy(truck.getCargo(), true);\n\t\t}\n\t\tcapital -= order.getTotalCost();\n\t}", "public Invoice createInvoice(Order order);", "@Test\n public void testCreateOrderCalculations() throws Exception {\n\n service.loadFiles();\n \n\n Order newOrder = new Order();\n newOrder.setCustomerName(\"Jake\");\n newOrder.setState(\"OH\");\n newOrder.setProductType(\"Wood\");\n newOrder.setArea(new BigDecimal(\"233\"));\n\n service.calculateNewOrderDataInput(newOrder);\n\n Assert.assertEquals(newOrder.getMaterialCostTotal(), (new BigDecimal(\"1199.95\")));\n Assert.assertEquals(newOrder.getLaborCost(), (new BigDecimal(\"1106.75\")));\n Assert.assertEquals(newOrder.getTax(), (new BigDecimal(\"144.17\")));\n Assert.assertEquals(newOrder.getTotal(), (new BigDecimal(\"2450.87\")));\n\n }", "public void saveOrder(Order order) {\n Client client = clientService.findBySecurityNumber(order.getClient().getSecurityNumber());\n Product product = productService.findByBarcode(order.getProduct().getBarcode());\n order.setClient(client);\n order.setProduct(product);\n if (isClientPresent(order) && isProductPresent(order)) {\n do {\n currencies = parseCurrencies();\n } while (currencies.isEmpty());\n\n generateTransactionDate(order);\n\n// Client client = ClientServiceImpl.getClientRepresentationMap().get(order.getClient());\n// Product product = ProductServiceImpl.getProductRepresentationMap().get(order.getProduct());\n convertPrice(order);\n orders.add(order);\n orderedClients.add(client);\n orderedProducts.add(product);\n }\n }", "public CreateOrderRequest() {\n\t\t_pcs = new PropertyChangeSupport(this);\n\t}", "public void createWorkOrders() {\n Main.orderCount += 1;\n\n WorkOrder newOrder = new WorkOrder();\n\n Scanner scanner = new Scanner(System.in);\n\n System.out.println(\"Create a new Work Order:\");\n\n System.out.println(\"Enter description of work requested:\");\n\n newOrder.setDescription(scanner.nextLine());\n\n System.out.println(\"Enter your full name for our records:\");\n\n newOrder.setSenderName(scanner.nextLine());\n\n newOrder.setStatus(Status.INITIAL);\n\n newOrder.setId(Main.orderCount);\n\n //\n // mapper below\n //\n\n String workOrder = \"\";\n ObjectMapper mapper = new ObjectMapper();\n try {\n workOrder = mapper.writeValueAsString(newOrder);\n } catch (JsonProcessingException e) {\n e.printStackTrace();\n }\n String fileTitle = newOrder.getId() + \".json\";\n\n //\n // try catch block below for filewriting\n //\n\n try {\n File file = new File(fileTitle);\n FileWriter fileWriter = new FileWriter(file);\n fileWriter.write(workOrder);\n fileWriter.close();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n createWorkOrders();\n }", "public void submit(OrderInternal order_, OrderManagementContext orderManagementContext_);", "protected abstract Order createOrder(Cuisine cuisine);", "public void create(Order order) {\n\t\torderDao.create(order);\n\t}", "public static void createOrder(Staff staff) {\n\t\tSystem.out.print(\"\\t\\t\");\n\t\tSystem.out.println(\"************Creating a new order************\");\n\t\t// TODO - implement RRPSS.createOrder\n\t\tTableManager tableManager = new TableManager();\n\t\tList listOfTables = tableManager.onStartUp();\n\n\t\tOrderManager orderManager = new OrderManager();\n\t\tTable table = null;\n\t\tOrder order = null;\n\t\tint i = 0;\n\t\tint choice = 0;\n\t\tboolean check = false;\n\t\tScanner sc = new Scanner(System.in);\n\n\t\ttry {\n\t\t\t// print the list of tables for the user to select from.\n\t\t\tfor (i = 0; i < listOfTables.size(); i++) {\n\t\t\t\ttable = (Table) listOfTables.get(i);\n\t\t\t\tSystem.out.print(\"\\t\\t\");\n\t\t\t\tSystem.out.println((i + 1) + \") Table \" + table.getId()\n\t\t\t\t\t\t+ \" | Size: \" + table.getCapacity());\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.print(\"\\t\\t\");\n\t\t\tSystem.out.print(\"Select a table to create an order: \");\n\t\t\tchoice = Integer.parseInt(sc.nextLine());\n\n\t\t\ttable = (Table) listOfTables.get(choice - 1);\n\n\t\t\torder = new Order();\n\t\t\torder.setStaff(staff);\n\t\t\torder.setTable(table);\n\t\t\torder.setClosed(false);\n\n\t\t\tcheck = orderManager.createOrder(order);\n\n\t\t\tif (check) {\n\t\t\t\tSystem.out.print(\"\\t\\t\");\n\t\t\t\tSystem.out.format(\"%-25s:\", \"TASK UPDATE\");\n\t\t\t\tSystem.out.println(\"Order is created successfully!\");\n\n\t\t\t\tcheck = tableManager.updateTable(table);\n\n\t\t\t\tif (check) {\n\t\t\t\t\tSystem.out.print(\"\\t\\t\");\n\t\t\t\t\tSystem.out.format(\"%-25s:\", \"TASK STATUS\");\n\t\t\t\t\tSystem.out.println(\"Added order to table!\");\n\t\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.print(\"\\t\\t\");\n\t\t\t\t\tSystem.out.format(\"%-25s:\", \"TASK STATUS\");\n\t\t\t\t\tSystem.out.println(\"Failed to add order to table!\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tSystem.out.print(\"\\t\\t\");\n\t\t\t\tSystem.out.format(\"%-25s:\", \"TASK STATUS\");\n\t\t\t\tSystem.out.println(\"Failed to created order!\");\n\t\t\t}\n\t\t}\n\n\t\tcatch (Exception e) {\n\t\t\tSystem.out.print(\"\\t\\t\");\n\t\t\tSystem.out.format(\"%-25s:\", \"TASK STATUS\");\n\t\t\tSystem.out.println(\"Invalid Input!\");\n\t\t}\n\t\tSystem.out.print(\"\\t\\t\");\n\t\tSystem.out.println(\"************End of creating new order************\");\n\t}", "public void payForOrder(){\n\t\tcurrentOrder.setDate(new Date()); // setting date to current\n\t\t\n\t\t//Checking if tendered money is enough to pay for the order.\n\t\tfor(;;){\n\t\t\tJOptionPane.showMessageDialog(this.getParent(), new CheckoutPanel(currentOrder), \"\", JOptionPane.PLAIN_MESSAGE);\n\t\t\tif(currentOrder.getTendered().compareTo(currentOrder.getSubtotal())==-1){\n\t\t\t\tJOptionPane.showMessageDialog(this.getParent(), \"Not enough money tendered\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t//Setting order number.\n\t\tSimpleDateFormat df = new SimpleDateFormat(\"yyyyMMdd\");\n\t\tString str = df.format(currentOrder.getDate());\n\t\tString number = Integer.toString(till.getOrders().size()+1) +\"/\"+str;\n\t\tcurrentOrder.setNumber(number);\n\t\t\n\t\t//Setting customer name.\n\t\tcurrentOrder.setCustomerName(custNameField.getText());\n\t\t\n\t\t//Adding current order to orders list.\n\t\ttill.getOrders().add(currentOrder); \n\t\t\n\t\t//Displays the receipt.\n\t\tJOptionPane.showMessageDialog(this.getParent(), new ReceiptPanel(currentOrder), \"Receipt\", \n\t\t\t\tJOptionPane.PLAIN_MESSAGE);\n\t\t\n\t\t//Resets OrderPanel.\n\t\tthis.resetOrder();\n\t}", "private void createOrder(Shop shop, FileManager fileManager, ArrayList<Tool> toolList,\n ArrayList<Integer> quantityList) {\n if (toolList.size() != 0) {\n if (shop.createOrderOrAppendOrder(shop, toolList, quantityList, fileManager)) {\n System.out.println(\"Successfully added and/or appended order to orders.txt!\");\n } else {\n System.out.println(\"ERROR: Could not edit orders.txt.\");\n }\n }\n }", "public Order() {\n this(DSL.name(\"order\"), null);\n }", "public void createOrder() throws FlooringDaoException {\n boolean validData = true;\n do {\n try {\n Order newOrder = view.getNewOrderInfo();\n service.createOrder(newOrder);\n validData = true;\n } catch (InvalidDataException ex) {\n view.displayError(ex.getMessage());\n validData = false;\n } catch (NumberFormatException ex) {\n view.displayError(\"Area must consist of digits 0-9 with or without a decimal point.\");\n validData = false;\n }\n } while (!validData);\n }", "@Override\n\tpublic void takeNewOrder() {\n\t\tif(customersInLine.size()>0&&wait==0){\n\t\t\tint customerSelectedIndex = 0;\n\t\t\tfor(int i=0; i<customersInLine.size(); i++){\n\t\t\t\tif(customersInLine.get(i).getTimeToPrepare()<customersInLine.get(customerSelectedIndex).getTimeToPrepare()){\n\t\t\t\t\tcustomerSelectedIndex = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsetWait(customersInLine.get(customerSelectedIndex).getTimeToPrepare());\n\t\t\taddToProfit(customersInLine.get(customerSelectedIndex).getCostOfOrder());\n\t\t\tcustomersInLine.remove(customerSelectedIndex);\n\t\t\tcustomersInRestaurant--;\n\t\t}\n\t}", "OrderDTO create(OrderDTO orderDTO);", "void createOrder(List<Product> products, Customer customer);", "static void addCustomerOrder() {\n\n Customer newCustomer = new Customer(); // create new customer\n\n Product orderedProduct; // initialise ordered product variable\n\n int quantity; // set quantity to zero\n\n String name = Validate.readString(ASK_CST_NAME); // Asks for name of the customer\n\n newCustomer.setName(name); // stores name of the customer\n\n String address = Validate.readString(ASK_CST_ADDRESS); // Asks for address of the customer\n\n newCustomer.setAddress(address); // stores address of the customer\n\n customerList.add(newCustomer); // add new customer to the customerList\n\n int orderProductID = -2; // initialize orderProductID\n\n while (orderProductID != -1) { // keep looping until user enters -1\n\n orderProductID = Validate.readInt(ASK_ORDER_PRODUCTID); // ask for product ID of product to be ordered\n\n if(orderProductID != -1) { // keep looping until user enters -1\n\n quantity = Validate.readInt(ASK_ORDER_QUANTITY); // ask for the quantity of the order\n\n orderedProduct = ProductDB.returnProduct(orderProductID); // Search product DB for product by product ID number, return and store as orderedProduct\n\n Order newOrder = new Order(); // create new order for customer\n\n newOrder.addOrder(orderedProduct, quantity); // add the new order details and quantity to the new order\n\n newCustomer.addOrder(newOrder); // add new order to customer\n\n System.out.println(\"You ordered \" + orderedProduct.getName() + \", and the quantity ordered is \" + quantity); // print order\n }\n }\n }", "@Test\n\tpublic void createOrderTest() {\n\t\ttry {\n\t\t\tassertNull(salesOrderCtrl.getOrder());\n\t\t\tsalesOrderCtrl.createSalesOrder();\n\t\t\tassertNotNull(salesOrderCtrl.getOrder());\n\t\t} catch (Exception e) {\n\t\t\te.getMessage();\n\t\t}\n\t}", "public void completeOrderTransaction(Transaction trans){\n }", "@Test\n public void testCreatePurchaseOrder() throws Exception {\n System.out.println(\"createPurchaseOrder\");\n Long factoryId = 1L;\n Long contractId = 2L;\n Double purchaseAmount = 4D;\n Long storeId = 2L;\n String destination = \"store\";\n Calendar deliveryDate = Calendar.getInstance();\n deliveryDate.set(2015, 0, 13);\n Boolean isManual = false;\n Boolean isToStore = true;\n PurchaseOrderEntity result = PurchaseOrderManagementModule.createPurchaseOrder(factoryId, contractId, purchaseAmount, storeId, destination, deliveryDate, isManual, isToStore);\n assertNotNull(result);\n }", "public OrderUser finishOrder(final OrderUser orderUser) {\r\n\t\tAssert.isTrue(this.actorService.checkAuthority(Authority.USER));\r\n\r\n\t\tCreditCard principalCard;\r\n\r\n\t\tprincipalCard = this.creditCardService.findActorCreditCard();\r\n\r\n\t\tAssert.notNull(principalCard);\r\n\t\tAssert.isTrue(this.creditCardService.isCreditCardDateValid(principalCard));\r\n\r\n\t\tDate moment;\r\n\t\tOrderUser res;\r\n\r\n\t\tfor (final OrderQuantity oq : orderUser.getOrderQuantities())\r\n\t\t\tAssert.isTrue(this.orderQuantityService.checkProductStock(oq)); // Check if the quantities in the order can be satisfied.\r\n\r\n\t\tfor (final OrderQuantity oq : orderUser.getOrderQuantities()) {\r\n\t\t\tProduct product;\r\n\t\t\tint remainingStock;\r\n\r\n\t\t\tproduct = oq.getProduct();\r\n\t\t\tremainingStock = product.getStock() - oq.getQuantity(); // Update products' stocks\r\n\t\t\tproduct.setStock(remainingStock);\r\n\t\t\tthis.productService.save(product);\r\n\t\t}\r\n\r\n\t\tmoment = new Date(System.currentTimeMillis() - 1000);\r\n\t\torderUser.setMoment(moment);\r\n\t\torderUser.setFinished(true);\r\n\r\n\t\tres = this.updateTotal(orderUser);\r\n\r\n\t\treturn res;\r\n\t}", "ResponseDTO createPurchase(PurchaseOrderDTO purchaseOrderDTO) throws ApiException, IOException;", "public void submitOrder() throws BackendException;", "@Override\n\tpublic int completeOrder(int orderId) {\n\t\tOrder order = orderDao.getOrder(orderId);\n\t\tfor (ProductOrder productOrder : order.getProductOrders()) {\n\t\t\tProduct product = productOrder.getProduct();\n\t\t\tint newQuantity = product.getAvailableQuantity() - productOrder.getOrderAmount();\n\t\t\tproduct.setAvailableQuantity(newQuantity);\n\t\t\tcatalogService.editProduct(product);\n\t\t}\n\t\treturn orderDao.completeOrder(orderId);\n\t}", "public Order(String deliveryAddress, String customerName, double orderTotalPrice, String id,\n String description, String customerTelephone, String comment, String pharmacyId, Date date, String userToken) {\n this.deliveryAddress = deliveryAddress;\n this.customerName = customerName;\n this.orderStatus = OrderStatus.WAITING_ORDER;\n this.orderTotalPrice = orderTotalPrice;\n this.description = description;\n this.id = id;\n this.customerTelephone = customerTelephone;\n this.pharmacyId = pharmacyId;\n this.comment = comment;\n this.date = new Date(date.getTime());\n this.userToken = userToken;\n }", "public OrderResponseBuilder() {\r\n orderResponse = new OrderResponse();\r\n }", "public Order(Builder builder) {\r\n this.id = builder.id;\r\n this.orderDate = builder.orderDate;\r\n //this.orderLine = builder.orderLine;\r\n }", "public CreateOrderResponse execute(JCoDestination destination) throws JCoException {\n\t\tJCoFunction function = destination.getRepository().getFunction(\"TR40_ORDER_CREATE\"); //$NON-NLS-1$\n\t\tfunction.getImportParameterList().setValue(\"IV_CATEGORY\", category); //$NON-NLS-1$\n\t\tfunction.getImportParameterList().setValue(\"IV_KURZTEXT\", text); //$NON-NLS-1$\n\t\tfunction.getImportParameterList().setValue(\"IV_LAYER\", transportLayer); //$NON-NLS-1$\n\t\tfunction.getImportParameterList().setValue(\"IV_OWNER\", owner); //$NON-NLS-1$\n\t\tfunction.getImportParameterList().setValue(\"IV_CORRECTION\", correctionRequested ? \"X\" : \" \"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\n\t\tfunction.getImportParameterList().setValue(\"IV_REPAIR\", repairRequested ? \"X\" : \" \"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\n\t\tTaskUserListEntry.toTable(users, function.getTableParameterList().getTable(\"TT_USERLIST\")); //$NON-NLS-1$\n\t\tfunction.execute(destination);\n\t\tCreateOrderResponse response = new CreateOrderResponse();\n\t\tresponse.setOrderID(function.getExportParameterList().getString(\"EV_TRKORR_ORDER\")); //$NON-NLS-1$\n\t\tresponse.setUsers(TaskUserListEntry.fromTable(function.getTableParameterList().getTable(\"TT_USERLIST\"))); //$NON-NLS-1$\n\t\tresponse.setException(function.getExportParameterList().getString(\"EV_EXCEPTION\")); //$NON-NLS-1$\n\t\tresponse.setMessages(TransportMessage.fromTable(function.getTableParameterList().getTable(\"TT_MSG\"))); //$NON-NLS-1$\n\t\treturn response;\n\t}", "private void requestOrderDetail() {\n\n ModelHandler.OrderRequestor.requestOrderDetail(client, mViewData.getOrder().getId(), (order) -> {\n mViewData.setOrder(order);\n onViewDataChanged();\n }, this::showErrorMessage);\n }", "public void placeOrder(String custID) {\r\n //creates Order object based on current cart\r\n Order order = new Order(custID, getItems());\r\n //inserts new order into DB\r\n order.insertDB();\r\n }", "public static Product[] createOrder()\n {\n Order order = new Order();\n Random r = new Random();\n int x;\n order.orderNumber++;\n int itemCount = 1 + r.nextInt(50);\n order.orderContents = new Product[itemCount];\n for (x = 0 ; x < itemCount; x++){\n Product item = productMaker.generateProduct();\n order.orderContents[x] = item;\n }\n\n return order.orderContents;\n\n }", "public void makeOrder(Order order) {\n for(Order_Item x : order.getOrdered()){\n TableRow item_row = build_row(x.getItem().getName(), String.valueOf(x.getQuantity()), (x.getPrice()*x.getQuantity()) + \"€\");\n orderLayout.addView(item_row);\n }\n\n refreshPriceView();\n }", "public abstract void saveOrder(Order order);", "@Override\n @Transactional\n public OrderDTO createOrder(OrderDTO orderDTO) {\n\n String orderId = KeyUtil.genUniqueKey();\n BigDecimal orderAmount = new BigDecimal(BigInteger.ZERO);\n// List<CartDTO> cartDTOList = new ArrayList<>();\n //1.\n for (OrderDetail orderDetail : orderDTO.getOrderDetailList()) {\n ProductInfo productInfo = productInfoService.findOne(orderDetail.getProductId());\n if (productInfo == null) {\n throw new ProjectException(ResultEnum.PRODUCT_NOT_EXIST);\n }\n\n //2.\n orderAmount = productInfo.getProductPrice()\n .multiply(new BigDecimal(orderDetail.getProductQuantity()))\n .add(orderAmount);\n //3. orderDetail db insertion\n orderDetail.setDetailId(KeyUtil.genUniqueKey());\n orderDetail.setOrderId(orderId);\n BeanUtils.copyProperties(productInfo, orderDetail);\n orderDetailRepository.save(orderDetail);\n// CartDTO cartDTO = new CartDTO(orderDetail.getProductId(), orderDetail.getProductQuantity());\n// cartDTOList.add(cartDTO);\n }\n\n //3. orderMaster\n OrderMaster orderMaster = new OrderMaster();\n orderDTO.setOrderId(orderId);\n BeanUtils.copyProperties(orderDTO, orderMaster);\n orderMaster.setOrderAmount(orderAmount);\n orderMaster.setOrderStatus(OrderStatusEnum.NEW.getCode());\n orderMaster.setPayStatus(PayStatusEnum.WAIT.getCode());\n orderMasterRepository.save(orderMaster);\n\n //4.\n List<CartDTO> cartDTOList = orderDTO.getOrderDetailList().stream().map(e ->\n new CartDTO(e.getProductId(), e.getProductQuantity())\n ).collect(Collectors.toList());\n\n productInfoService.decreaseInventory(cartDTOList);\n\n return orderDTO;\n }", "@Test\n public void testWriteOrderData() throws Exception {\n dao.loadEnvironmentVariable();\n Order writeOrder = new Order();\n\n writeOrder.setOrderNumber(1);\n writeOrder.setOrderDate(LocalDate.parse(\"1901-01-01\"));\n writeOrder.setCustomer(\"Write Test\");\n writeOrder.setTax(new Tax(\"OH\", new BigDecimal(\"6.25\")));\n writeOrder.setProduct(new Product(\"Wood\", new BigDecimal(\"5.15\"), new BigDecimal(\"4.75\")));\n writeOrder.setArea(new BigDecimal(\"100.00\"));\n writeOrder.setMaterialCost(new BigDecimal(\"515.00\"));\n writeOrder.setLaborCost(new BigDecimal(\"475.00\"));\n writeOrder.setTaxCost(new BigDecimal(\"61.88\"));\n writeOrder.setTotal(new BigDecimal(\"1051.88\"));\n\n dao.addOrder(writeOrder);\n dao.writeOrderData();\n\n File orderFile = new File(System.getProperty(\"user.dir\") + \"/Orders_01011901.txt\");\n\n assertTrue(orderFile.exists());\n\n Files.deleteIfExists(Paths.get(System.getProperty(\"user.dir\") + \"/Orders_01011901.txt\"));\n\n }", "@Override\n\tpublic Order create(Order order) {\n\t\ttry (Connection connection = DBUtils.getInstance().getConnection();\n\t\t\t\tStatement statement = connection.createStatement();) {\n\t\t\tstatement.executeUpdate(\"INSERT INTO orders(customer_id) VALUES ('\" + order.getCustomer_id() + \"')\");\n\t\t\treturn readLatest();\n\t\t} catch (Exception e) {\n\t\t\tLOGGER.debug(e);\n\t\t\tLOGGER.error(e.getMessage());\n\t\t}\n\t\treturn null;\n\t}", "void prepareOrder(int orderId);", "@Override\n\tpublic void confirmOrders() {\n\t\t\n\t}", "@Override\n\tpublic void confirmOrders() {\n\t\t\n\t}", "@Override\n\tpublic void confirmOrders() {\n\t\t\n\t}", "private void btnCompleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCompleteActionPerformed\n DBManager db = new DBManager();\n \n for(Map.Entry<Integer, OrderLine> olEntry : loggedInCustomer.findLatestOrder().getOrderLines().entrySet())\n {\n OrderLine actualOrderLine = olEntry.getValue();\n Product orderedProduct = actualOrderLine.getProduct();\n \n orderedProduct.setStockLevel(orderedProduct.getStockLevel() - olEntry.getValue().getQuantity());\n db.updateProductAvailability(orderedProduct); \n }\n \n loggedInCustomer.findLatestOrder().setStatus(\"Complete\");\n db.completeOrder(orderId); \n \n Confirmation confirmation = new Confirmation(loggedInCustomer, orderId);\n this.dispose();\n confirmation.setVisible(true);\n \n }", "@SuppressWarnings(\"static-access\")\r\n\t@Test\r\n\tpublic void crearOrdersTest() {\r\n\r\n\t\tpd.crearOrders();\r\n\t\tpd.pm.deletePersistent(pd.o1);\r\n\t\tpd.pm.deletePersistent(pd.o2);\r\n\t\tpd.pm.deletePersistent(pd.o3);\r\n\r\n\t}", "@Test\n public void placeOrderTest() {\n Order body = new Order().id(10L)\n .petId(10L)\n .complete(false)\n .status(Order.StatusEnum.PLACED)\n .quantity(1);\n Order response = api.placeOrder(body);\n\n Assert.assertEquals(10L, response.getId().longValue());\n Assert.assertEquals(10L, response.getPetId().longValue());\n Assert.assertEquals(1, response.getQuantity().intValue());\n Assert.assertEquals(true, response.isComplete());\n Assert.assertEquals(Order.StatusEnum.APPROVED, response.getStatus());\n\n verify(exactly(1), postRequestedFor(urlEqualTo(\"/store/order\")));\n }", "@Test\n public void testValidateNewOrderProduct() throws Exception {\n\n Order order3 = new Order(\"003\");\n order3.setCustomerName(\"Paul\");\n order3.setState(\"Ky\");\n order3.setTaxRate(new BigDecimal(\"6.75\"));\n order3.setArea(new BigDecimal(\"5.00\"));\n order3.setOrderDate(\"Date_Folder_Orders/Orders_06232017.txt\");\n order3.setProductName(\"tile\");\n order3.setMatCostSqFt(new BigDecimal(\"5.50\"));\n order3.setLaborCostSqFt(new BigDecimal(\"6.00\"));\n order3.setMatCost(new BigDecimal(\"50.00\"));\n order3.setLaborCost(new BigDecimal(\"500.00\"));\n order3.setOrderTax(new BigDecimal(\"50.00\"));\n order3.setTotalOrderCost(new BigDecimal(\"30000.00\"));\n\n assertEquals(true, service.validateNewOrderProduct(order3));\n }", "@Test\n\tpublic void saveOrderLine() {\n\t\t// TODO: JUnit - Populate test inputs for operation: saveOrderLine \n\t\tOrderLine orderline_1 = new ecom.domain.OrderLine();\n\t\tservice.saveOrderLine(orderline_1);\n\t}", "protected Order(String custFName, String custLName, String custEmail, int orderID,\n Timestamp creationDate, double totalDue, String status, String salesFName,\n String salesLName,\n String salesEmail) {\n this.custFName = custFName;\n this.custLName = custLName;\n this.custEmail = custEmail;\n this.orderID = orderID;\n this.creationDate = creationDate;\n this.totalDue = totalDue;\n this.status = status;\n this.salesFName = salesFName;\n this.salesLName = salesLName;\n this.salesEmail = salesEmail;\n products = new ArrayList<>();\n }", "public Customer(String name, List<Food> order, int priority) {\n\t\tthis.name = name;\n\t\tthis.order = order;\n\t\tthis.priority = priority;\n\t\tthis.orderNum = runningCounter++;\n//\t\torderReadylatch = new CountDownLatch(order.size() + 1);\n\t}", "public Map<String, String> createOrder(boolean debug) throws IOException {\n Map<String, String> map = new HashMap<>();\n OrdersCreateRequest request = new OrdersCreateRequest();\n request.prefer(\"return=representation\");\n request.requestBody(buildRequestBody());\n //3. Call PayPal to set up a transaction\n HttpResponse<Order> response = client().execute(request);\n System.out.println(\"Response: \" + response.toString());\n // if (true) {\n if (response.statusCode() == 201) {\n System.out.println(\"Status Code: \" + response.statusCode());\n System.out.println(\"Status: \" + response.result().status());\n System.out.println(\"Order ID: \" + response.result().id());\n System.out.println(\"Intent: \" + response.result().intent());\n System.out.println(\"Links: \");\n for (LinkDescription link : response.result().links()) {\n System.out.println(\"\\t\" + link.rel() + \": \" + link.href() + \"\\tCall Type: \" + link.method());\n }\n System.out.println(\"Total Amount: \" + response.result().purchaseUnits().get(0).amount().currencyCode()\n + \" \" + response.result().purchaseUnits().get(0).amount().value());\n\n\n map.put(\"statusCode\" , response.statusCode()+\"\");\n map.put(\"status\" , response.result().status());\n map.put(\"orderID\" , response.result().id());\n\n //return response.result().id();\n } else {\n System.out.println(\"Response: \" + response.toString());\n map.put(\"Reponse\",response.toString());\n //return response.toString();\n }\n\n return map;\n //}\n }", "private void createAutoOrder(Shop shop, FileManager fileManager, ArrayList<Tool> toolList) {\n ArrayList<Integer> quantityList;\n if (toolList.size() != 0) {\n System.out.println(\"An item(s) quantity is less than \" + shop.getInventory().getMinStock() + \" items,\" +\n \" automatically creating new order lines and/or order items...\");\n quantityList = shop.getRequiredOrderAmt();\n if (shop.createOrderOrAppendOrder(shop, toolList, quantityList, fileManager)) {\n System.out.println(\"Successfully added and/or appended order to orders.txt!\");\n } else {\n System.out.println(\"ERROR: Could not edit orders.txt.\");\n }\n }\n }", "public UserOrder() {\n }", "public String processOrder() {\n notifyAllObservers();\n\n return getOrderReport();\n }", "public MOrder( Properties ctx,int C_Order_ID,String trxName ) {\n super( ctx,C_Order_ID,trxName );\n\n // New\n\n if( C_Order_ID == 0 ) {\n setDocStatus( DOCSTATUS_Drafted );\n setDocAction( DOCACTION_Prepare );\n\n //\n\n setDeliveryRule( DELIVERYRULE_Availability );\n setFreightCostRule( FREIGHTCOSTRULE_FreightIncluded );\n setInvoiceRule( INVOICERULE_Immediate );\n setPaymentRule( PAYMENTRULE_OnCredit );\n setPriorityRule( PRIORITYRULE_Medium );\n setDeliveryViaRule( DELIVERYVIARULE_Pickup );\n\n //\n\n setIsDiscountPrinted( false );\n setIsSelected( false );\n setIsTaxIncluded( false );\n setIsSOTrx( true );\n setIsDropShip( false );\n setSendEMail( false );\n\n //\n\n setIsApproved( false );\n setIsPrinted( false );\n setIsCreditApproved( false );\n setIsDelivered( false );\n setIsInvoiced( false );\n setIsTransferred( false );\n setIsSelfService( false );\n\n //\n\n super.setProcessed( false );\n setProcessing( false );\n setPosted( false );\n setDateOrdered(Env.getTimestamp());\n setDateAcct(getDateOrdered());\n setDatePromised(getDateOrdered());\n setFreightAmt( Env.ZERO );\n setChargeAmt( Env.ZERO );\n setTotalLines( Env.ZERO );\n setGrandTotal( Env.ZERO );\n }\n }", "@POST(\"orders/new_order/\")\n Call<ApiStatus> createNewOrderByUser(@Body Order myOrder);", "@Override\n\tpublic boolean doCreate(Orders vo) throws Exception\n\t{\n\t\treturn false;\n\t}", "public void buildOrders() {\n try (PreparedStatement prep = Database.getConnection()\n .prepareStatement(\"CREATE TABLE IF NOT\"\n + \" EXISTS orders (id TEXT, orderer_id TEXT, deliverer_id TEXT,\"\n + \" pickup_time REAL, dropoff_time REAL, pickup_location TEXT,\"\n + \" dropoff_location TEXT, price REAL, pickup_phone TEXT,\"\n + \" PRIMARY KEY (id),\" + \" FOREIGN KEY (orderer_id)\"\n + \" REFERENCES users(id), FOREIGN KEY (deliverer_id) REFERENCES\"\n + \" users(id), FOREIGN KEY (pickup_location) REFERENCES\"\n + \" locations(id),\"\n + \" FOREIGN KEY (dropoff_location) REFERENCES locations(id)\"\n + \" ON DELETE CASCADE ON UPDATE CASCADE);\")) {\n prep.executeUpdate();\n } catch (final SQLException exc) {\n exc.printStackTrace();\n }\n }", "public APIResponse placeOrder(@NotNull Order order){\n try {\n validateOrder(order);\n \n order.getItems().addAll(\n orderItemRepository.saveAll(order.getItems())\n );\n orderRepository.save( order );\n return APIResponse.builder()\n .success( true)\n .data( true )\n .error( null )\n .build();\n }catch (Exception exception){\n\n log.error(exception.getMessage());\n return APIResponse.builder()\n .success( true)\n .data( false )\n .error( exception.getMessage() )\n .build();\n }\n }", "public void orderPerform(ControllerOrder controllerOrder) throws IOException, SQLException {\n\r\n\t}", "public TaskOrder(TaskOrderDetails details){\n\t\tthis.details = details;\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n initiateOrder(request, response);\n }", "public void setOrder(Order order){\n this.order = order;\n }", "@Override\n\tpublic void addOrder(Order order) {\n\t\t\n\t em.getTransaction().begin();\n\t\t\tem.persist(order);\n\t\t\tem.getTransaction().commit();\n\t\t\tem.close();\n\t\t\temf.close();\n\t \n\t}", "public void addOrders() {\n\t\torders.stream()\n\t\t\t.forEach(db::store);\n\t}", "@PostMapping(\"/add-order\")\n\tpublic ResponseEntity<Object> insertOrder(@RequestBody Order order) {\n\t\tLOGGER.info(\"add-Order URL is opened\");\n\t\tLOGGER.info(\"addOrder() is initiated\");\n\t\tOrderDTO orderDTO = null;\n\t\tResponseEntity<Object> orderResponse = null;\n\t\torderDTO = orderService.addOrder(order);\n\t\torderResponse = new ResponseEntity<>(orderDTO, HttpStatus.ACCEPTED);\n\t\tLOGGER.info(\"addOrder() has executed\");\n\t\treturn orderResponse;\n\t}", "@Test\n public void testGetAllOrders() {\n Order addedOrder = new Order();\n Order addedOrder2 = new Order();\n\n addedOrder.setOrderNumber(1);\n addedOrder.setOrderDate(LocalDate.parse(\"1900-01-01\"));\n addedOrder.setCustomer(\"Order One\");\n addedOrder.setTax(new Tax(\"OH\", new BigDecimal(\"6.25\")));\n addedOrder.setProduct(new Product(\"Wood\", new BigDecimal(\"5.15\"), new BigDecimal(\"4.75\")));\n addedOrder.setArea(new BigDecimal(\"100.00\"));\n addedOrder.setMaterialCost(new BigDecimal(\"515.00\"));\n addedOrder.setLaborCost(new BigDecimal(\"475.00\"));\n addedOrder.setTaxCost(new BigDecimal(\"61.88\"));\n addedOrder.setTotal(new BigDecimal(\"1051.88\"));\n\n dao.addOrder(addedOrder);\n\n addedOrder2.setOrderNumber(2);\n addedOrder2.setOrderDate(LocalDate.parse(\"1900-01-01\"));\n addedOrder2.setCustomer(\"Order Two\");\n addedOrder2.setTax(new Tax(\"OH\", new BigDecimal(\"6.25\")));\n addedOrder2.setProduct(new Product(\"Wood\", new BigDecimal(\"5.15\"), new BigDecimal(\"4.75\")));\n addedOrder2.setArea(new BigDecimal(\"100.00\"));\n addedOrder2.setMaterialCost(new BigDecimal(\"515.00\"));\n addedOrder2.setLaborCost(new BigDecimal(\"475.00\"));\n addedOrder2.setTaxCost(new BigDecimal(\"61.88\"));\n addedOrder2.setTotal(new BigDecimal(\"1051.88\"));\n\n dao.addOrder(addedOrder2);\n\n assertEquals(2, dao.getAllOrders().size());\n }" ]
[ "0.7316646", "0.7248233", "0.668971", "0.65903336", "0.6568297", "0.6432502", "0.6418013", "0.63879955", "0.63366866", "0.6191062", "0.61574847", "0.6136184", "0.6127858", "0.6030165", "0.60203683", "0.5999781", "0.5986347", "0.59835225", "0.59545493", "0.59430104", "0.5926293", "0.59036285", "0.58504665", "0.581263", "0.5795391", "0.57899845", "0.57858014", "0.5779008", "0.5769865", "0.57595056", "0.5753365", "0.57526886", "0.5746617", "0.5743951", "0.5741152", "0.5730945", "0.5727911", "0.5721166", "0.5712188", "0.57053876", "0.5700927", "0.56716406", "0.56442064", "0.5637032", "0.56297064", "0.56239986", "0.56147057", "0.5609379", "0.56087315", "0.56075794", "0.56010985", "0.55941", "0.55788624", "0.55698675", "0.5567976", "0.5566604", "0.55637604", "0.55585706", "0.555355", "0.55487674", "0.55246145", "0.55200183", "0.55194765", "0.55090547", "0.5508547", "0.54961705", "0.5489731", "0.5487094", "0.5486425", "0.5477398", "0.54757684", "0.54706526", "0.5448603", "0.543287", "0.5429685", "0.5429685", "0.5429685", "0.5427974", "0.54242", "0.54186356", "0.54163176", "0.54128754", "0.5404152", "0.53985566", "0.53919005", "0.5387266", "0.5381165", "0.53728145", "0.53722364", "0.5363466", "0.53601676", "0.5354935", "0.5351482", "0.53500664", "0.5346494", "0.53437215", "0.534166", "0.5341189", "0.5336783", "0.53354305", "0.53320956" ]
0.0
-1
Method is used to call the getAllVehicles() method from the service object to populate on create of the managed bean Used so that the List vehicles contains data when vehicles.xhtml renders
@PostConstruct public void init() { if (vehicles == null) { try { vehicles = getVehicles(); } catch (Exception e) { // } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Vehicle> getVehicles() {\n\t\tList<Vehicle> vehicleList = new ArrayList<Vehicle>();\n\t\tif ((vehicles == null)||(vehicles.isEmpty())) { // call DAO method getCustomers to retrieve list of customer objects from database\n\t\t\ttry {\n\t\t\t\tvehicleList = vehicleService.getAllVehicles();\n\t\t\t} catch (Exception e) {\n\t\t\t\tcurrentInstance = FacesContext.getCurrentInstance();\n\t\t\t\tFacesMessage message = null;\n\t\t\t\tmessage = new FacesMessage(FacesMessage.SEVERITY_ERROR,\"Failed\",\"Failed to retrieve vehicles from the database\" + e.getMessage());\n\t\t\t\tcurrentInstance.addMessage(null, message);\n\t\t\t}\n\t\t} else {\n\t\t\tvehicleList = vehicles;\n\t\t}\n\t\treturn vehicleList;\n\t}", "private void getVehicleList() {\n mApiCall.getVehicleList();\n }", "@GetMapping(\"/getVehicleInformation\")\n public Iterable<Vehicle> getAllVehicle() {\n\n return vehicleService.list();\n }", "@Override\n public List<Vehicle> getVehicles(AuthContext context) throws DSException {\n\n isContextValidFor(context, roleId -> { if(roleId == -1) throw new DSAuthException(\"Invalid Context\"); }, 1,3);\n\n //get the vehicles - > for each vehicle, with the vehicle model field (String model = vehicle.getForeignKey(\"model\"))\n List<Vehicle> vehicles = new ArrayList<>();\n try {\n List<Map<String,Object>> data = get(\"SELECT * FROM TblVehicles\");\n for(Map<String,Object> map: data) {\n //create a vehicle\n Vehicle vehicle = new Vehicle(map);\n\n //get the model number\n String model = vehicle.getForeignKey(\"model\");\n\n //get the model from Tbl\n if (model != null) {\n VehicleModel vehicleModel = new VehicleModel(get(\"SELECT * FROM TblVehicleModel WHERE modelNum = ?\", model).get(0));\n vehicle.setModel(vehicleModel);\n }\n //adding\n vehicles.add(vehicle);\n }\n return vehicles;\n }catch (SQLException e) {\n throw new DSFormatException(e.getMessage());\n }\n }", "public void populateVehicleList() {\n\t\tfor (int i = 0; i < VEHICLE_LIST_SIZE; i++) {\n\t\t\tvehicleList[i] = createNewVehicle();\n\t\t}\n\t}", "public List<VehicleVO> getCarList() {\n return carList;\n }", "@Override\n\tpublic List<Vehicle> getAll() {\n\t\tList<Vehicle> list = new LinkedList<Vehicle>();\n\t\ttry {\n\t\t\tStatement st = Database.getInstance().getDBConn().createStatement();\n\t\t\tResultSet rs = st.executeQuery(\"SELECT v.vehicle_ID, v.plate_number, v.mv_number, v.engine_number, v.chassis_number, m.description as model_name, c.description as category, v.encumbered_to, v.amount, v.maturity_date, v.status, v.image FROM models m INNER JOIN vehicles v ON m.model_ID=v.model_ID INNER JOIN vehicle_categories c ON c.category_ID=v.category_ID\");\n\t\t\t\n\t\t\twhile(rs.next()) {\n\t\t\t\tBlob blob = rs.getBlob(\"image\");\n\t\t\t\tInputStream is = blob.getBinaryStream(1, (int)blob.length());\n\t\t\t\tBufferedImage bf = ImageIO.read(is);\n\t\t\t\tImage img = SwingFXUtils.toFXImage(bf, null);\n\t\t\t\t\n\t\t\t\tlist.add(new Vehicle(rs.getInt(\"vehicle_ID\"), rs.getString(\"plate_number\"), rs.getString(\"mv_number\"), rs.getString(\"engine_number\"), rs.getString(\"chassis_number\"),rs.getString(\"model_name\"), rs.getString(\"category\"), rs.getString(\"encumbered_to\"), rs.getDouble(\"amount\"), Date.parse(rs.getString(\"maturity_date\")), rs.getString(\"status\"), img));\n\t\t\t}\n\t\t\t\n\t\t\tst.close();\n\t\t\trs.close();\n\t\t} catch(Exception err) {\n\t\t\terr.printStackTrace();\n\t\t}\n\t\treturn list;\n\t}", "public VehicleList() {\n\t\tvehicles = new ArrayList<Vehicle>();\n\t}", "public List<Vehicle> getVehicles() {\n\t\treturn vehicles;\n\t\t\n\t}", "public VehicleSearchRS getVehicles() {\r\n\t\tVehicleSearchRS response = null;\r\n\t\t//VehicleSearchService vehiclesearch = new VehicleSearchService();\r\n\t\t\r\n\t\t///Suppliers are useful when we donít need to supply any value and obtain a result at the same time.\r\n\t\tSupplier<VehicleSearchService> vehiclesearch = VehicleSearchService::new;\r\n\t\ttry {\r\n\t\t\tresponse = vehiclesearch.get().getVehicles(searchRQ);\r\n\t\t\t//System.out.println(response);\r\n\t\t} catch (VehicleValidationException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t\treturn response;\r\n\t}", "public List<Vehicle> getAllVehicle() {\n // array of columns to fetch\n String[] columns = {\n COLUMN_VEHICLE_ID,\n COLUMN_VEHICLE_NAME,\n COLUMN_VEHICLE_NUMBER,\n COLUMN_VEHICLE_CC,\n COLUMN_VEHICLE_YEAR,\n COLUMN_VEHICLE_TYPE,\n COLUMN_VEHICLE_FUEL,\n COLUMN_VEHICLE_CATEGORY,\n COLUMN_VEHICLE_DATE\n };\n // sorting orders\n String sortOrder =\n COLUMN_VEHICLE_NAME + \" ASC\";\n List<Vehicle> vehicleList = new ArrayList<Vehicle>();\n\n SQLiteDatabase db = this.getReadableDatabase();\n\n // query the vehicle table\n /**\n * Here query function is used to fetch records from vehicle table this function works like we use sql query.\n */\n Cursor cursor = db.query(TABLE_VEHICLE, //Table to query\n columns, //columns to return\n null, //columns for the WHERE clause\n null, //The values for the WHERE clause\n null, //group the rows\n null, //filter by row groups\n sortOrder); //The sort order\n\n\n // Traversing through all rows and adding to list\n if (cursor.moveToFirst()) {\n do {\n Vehicle vehicle = new Vehicle();\n vehicle.setId(Integer.parseInt(cursor.getString(cursor.getColumnIndex(COLUMN_VEHICLE_ID))));\n vehicle.setName(cursor.getString(cursor.getColumnIndex(COLUMN_VEHICLE_NAME)));\n vehicle.setNumber(cursor.getString(cursor.getColumnIndex(COLUMN_VEHICLE_NUMBER)));\n vehicle.setCc(cursor.getString(cursor.getColumnIndex(COLUMN_VEHICLE_CC)));\n vehicle.setYear(cursor.getString(cursor.getColumnIndex(COLUMN_VEHICLE_YEAR)));\n vehicle.setType(cursor.getString(cursor.getColumnIndex(COLUMN_VEHICLE_TYPE)));\n vehicle.setFuel(cursor.getString(cursor.getColumnIndex(COLUMN_VEHICLE_FUEL)));\n vehicle.setCategory(cursor.getString(cursor.getColumnIndex(COLUMN_VEHICLE_CATEGORY)));\n vehicle.setDate(cursor.getString(cursor.getColumnIndex(COLUMN_VEHICLE_DATE)));\n // Adding vehicle record to list\n vehicleList.add(vehicle);\n } while (cursor.moveToNext());\n }\n cursor.close();\n db.close();\n\n // return vehicle list\n return vehicleList;\n }", "public static void listVehicles() {\n\t\tSystem.out.println(\"-----------------\");\n\t\tSystem.out.println(\"Listing Vehicles\");\n\t\tSystem.out.println(\"-----------------\");\n\t\t\n\t\tfor (int i = 0; i < owners.size(); i++) {\n\t\t\tfor (Vehicle v : owners.get(i).getVehicles()) {\n\t\t\t\t\n\t\t\t\tSystem.out.println((owners.get(i).getName() + \"'s \" + v.toString()));\n\t\t\t\t\n\t\t\t}\n\n\t\t}\n\t\t\n\t}", "@Override\n\tpublic ArrayList<Carpo> getAllCars() {\n\t\treturn inList.getAll();\n\t}", "protected void populateList() {\n\n\t\tif (inTruckMode) {\n\t\t\t// issue #37 fix(block 2 users from punch-in)\n\t\t\t// Doing force sync for Vehicles table\n\t\t\t// if (com.operasoft.snowboard.dbsync.Utils.isOnline(this)) {\n\t\t\t// System.out.println(\"Sw_LoginScreenActivity.populateList():vehicle sync start\");\n\t\t\t// AbstractPeriodicSync vehiclesPeriodicSync = new AnonymousPeriodicSync(\"Vehicle\", new\n\t\t\t// VehiclesDao());\n\t\t\t// vehiclesPeriodicSync.fetchData(this);\n\t\t\t// }\n\n\t\t\tString vehicleId = mSP.getString(Config.VEHICLE_ID_KEY, \"\");\n\t\t\tString lastVehicleId = mSP.getString(Config.LAST_VEHICLE_KEY, \"\");\n\t\t\tvehiclesDao = new VehiclesDao();\n\n\t\t\t// issue #37 fix(block 2 users from punch-in)\n\t\t\t// VehicleListController vehicleListController = new VehicleListController();\n\t\t\t// vehiclesArray = vehicleListController.listVehicles(this);//vehiclesDao.listSorted();\n\t\t\tvehiclesArray = vehiclesDao.listSorted();\n\t\t\tvehiclesNameArray = new ArrayList<String>();\n\t\t\tint selectedIndex = -1;\n\n\t\t\tfor (int i = 0; i < vehiclesArray.size(); i++) {\n\t\t\t\tVehicle vehicles = vehiclesArray.get(i);\n\t\t\t\tvehiclesNameArray.add(vehicles.getName());\n\t\t\t\t// Check if the user is already connected to a vehicle\n\t\t\t\tif (vehicles.getId().equals(vehicleId)) {\n\t\t\t\t\tvehicle = vehicles;\n\t\t\t\t\tselectedIndex = i;\n\t\t\t\t}\n\t\t\t\t// Else check if it is his preferred one\n\t\t\t\tif ((selectedIndex == -1) && (vehicles.getId().equals(lastVehicleId))) {\n\t\t\t\t\tvehicle = vehicles;\n\t\t\t\t\tselectedIndex = i;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ((selectedIndex == -1) && (!vehiclesArray.isEmpty())) {\n\t\t\t\t// The user is not currently connected to any vehicle and has no\n\t\t\t\t// preferred one\n\t\t\t\tvehicle = vehiclesArray.get(0);\n\t\t\t\tselectedIndex = 0;\n\t\t\t}\n\n\t\t\t// Update the session with the vehicle currently selected\n\t\t\tSession.setVehicle(vehicle);\n\n\t\t\ttruckList.setAdapter(new TruckListAdapter(this, vehiclesNameArray, selectedIndex));\n\t\t} else {\n\n\t\t\t// Sites are not supported yet. Enable this code once they become\n\t\t\t// supported\n\t\t\t// SiteDao siteDao = new SiteDao();\n\t\t\t// sitesArray = siteDao.listAllValid();\n\t\t\t// sitesNameArray = new ArrayList<String>();\n\t\t\t//\n\t\t\t// for (Site site : sitesArray)\n\t\t\t// sitesNameArray.add(site.getName());\n\n\t\t\ttruckList.setAdapter(new TruckListAdapter(this, sitesNameArray, 0));\n\t\t}\n\n\t\tsetLoginMarker();\n\t}", "public void getAllVehicles(DefaultTableModel dataTableModel, String brand, String model) {\n// dataTableModel.setColumnIdentifiers(Vehicle.getVehicleDefinition());\n// dataTableModel.addRow(Vehicle.getVehicleDefinition());\n// ResultSet rs = db.getAllVehicles(brand, model);\n// try {\n// while (rs.next()) {\n Vehicle vehicle = createVehicle(/*rs*/);\n// dataTableModel.addRow(vehicle.vehicleToArray());\n// }\n// } catch (SQLException e) {\n// e.printStackTrace();\n// }\n }", "public Vector<Cars> getCars() {\n\t\tVector<Cars> v = new Vector<Cars>();\n\t\ttry {\n\t\t\tStatement stmt = conn.createStatement();\n\t\t\tResultSet rs = stmt\n\t\t\t\t\t.executeQuery(\"select * from vehicle_details order by vehicle_reg\");\n\t\t\twhile (rs.next()) {\n\t\t\t\tString reg = rs.getString(1);\n\t\t\t\tString make = rs.getString(2);\n\t\t\t\tString model = rs.getString(3);\n\t\t\t\tString drive = rs.getString(4);\n\t\t\t\tCars cars = new Cars(reg, make, model, drive);\n\t\t\t\tv.add(cars);\n\t\t\t}\n\t\t}\n\n\t\tcatch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn v;\n\t}", "public List<VehicleMaintenance> getVehicleMaintenances(){\n\n return vehicleMaintenanceRepository.findAll();\n }", "public void setCarList(List<VehicleVO> carList) {\n this.carList = carList;\n }", "public ListaReservasBean() {\r\n\t\tthis.listaReservas = new ArrayList<ReservaDAO>();\r\n\t}", "public List<Car>getAllCars(){\r\n return (List<Car>) repository.findAll();\r\n }", "@Override\n public List<VehicleModel> getVehicleModels(AuthContext context) throws DSException {\n\n isContextValidFor(context, roleId -> { if(roleId == -1) throw new DSAuthException(\"Invalid Context\"); }, 1,2,3);\n List<VehicleModel> vehicleModels = new ArrayList<>();\n try {\n List<Map<String, Object>> data = get(\"SELECT * FROM TblVehicleModel\");\n for(Map<String,Object> map: data)\n vehicleModels.add(new VehicleModel(map));\n return vehicleModels;\n } catch (SQLException e) {\n throw new DSFormatException(e.getMessage());\n }\n }", "public List<VehicleCategoryMasterBean> categoryList() throws Exception;", "private void getVehicleByParse() {\n\t\tvehicles = new ArrayList<DCVehicle>();\n\t\tfinal ParseUser user = ParseUser.getCurrentUser();\n\t\tParseQuery<ParseObject> query = ParseQuery.getQuery(\"DCVehicle\");\n\n\t\tquery.setCachePolicy(ParseQuery.CachePolicy.NETWORK_ELSE_CACHE);\n\t\tquery.whereEqualTo(\"vehiclePrivateOwner\", user);\n\t\tquery.findInBackground(new FindCallback<ParseObject>() {\n\t\t\tpublic void done(final List<ParseObject> vehicleList,\n\t\t\t\t\tParseException e) {\n\t\t\t\tif (e == null) {\n\t\t\t\t\t// Loop through all vehicles that we got from the query\n\t\t\t\t\tfor (int i = 0; i < vehicleList.size(); i++) {\n\t\t\t\t\t\t// Convert parse object (DC Vehicle) into vehicle\n\t\t\t\t\t\tDCVehicle vehicle = ParseUtilities\n\t\t\t\t\t\t\t\t.convertVehicle(vehicleList.get(i));\n\n\t\t\t\t\t\t// Get photo from the parse\n\t\t\t\t\t\tParseFile photo = (ParseFile) vehicleList.get(i).get(\n\t\t\t\t\t\t\t\t\"vehiclePhoto\");\n\t\t\t\t\t\tbyte[] data = null;\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif (photo != null)\n\t\t\t\t\t\t\t\tdata = photo.getData();\n\t\t\t\t\t\t} catch (ParseException e1) {\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (data == null) {\n\t\t\t\t\t\t\tvehicle.setPhotoSrc(null);\n\t\t\t\t\t\t\tvehicle.setPhoto(false);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvehicle.setPhotoSrc(data);\n\t\t\t\t\t\t\tvehicle.setPhoto(true);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvehicles.add(vehicle);\n\t\t\t\t\t\tvehicleObjects.add(vehicleList.get(i));\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set adapter\n\t\t\t\t\tadapter = new VehicleListAdapter(VehiclesListActivity.this,\n\t\t\t\t\t\t\tvehicles, vehiclePicker, addJournyActivity);\n\t\t\t\t\tlist.setAdapter(adapter);\n\t\t\t\t} else {\n\t\t\t\t\tLog.e(\"Get Vehicle\", e.getMessage());\n\t\t\t\t}\n\n\t\t\t\t// Disable loading bar\n\t\t\t\tloading.setVisibility(View.GONE);\n\t\t\t}\n\t\t});\n\t}", "@Override\n\tpublic ResponseConsulta consultarVehiculos() {\n\t\tResponseConsulta respConsulta = new ResponseConsulta();\n\t\ttry {\n\t\t\tList<Vehiculo> listaVeiculos = vehiculoRepositorio.buscarTodasVehiculo();\n\t\t\trespConsulta.setListVehiculos(listaVeiculos);\n\t\t\trespConsulta.setMensaje(properties.msgExito);\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(properties.errorGenerico + e);\n\t\t\trespConsulta.setMensaje(properties.errorGenerico);\n\t\t}\n\t\treturn respConsulta;\n\t}", "@Override\r\n\tpublic void serviceVehicle() {\n\t\t\r\n\t\tVehicle vehicle = (ThreeWhleer)context.getBean(\"vehicle3.bean\");\r\n\t\t\r\n\t\tvehicle.serviceVehicle();\r\n\t}", "@GetMapping(\"/list\")\n public List<Traveller> listTraveller() {\n List<Traveller> theTraveller = travelService.findAll();\n return theTraveller;\n }", "@Override\n public List<Vehicle> getVehiclesByMake(String make){\n List<VehicleDetails> results = repo.findByMake(make);\n return mapper.mapAsList(results, Vehicle.class);\n }", "public ArrayList<Vehicle> get(LocalDate from,LocalDate to) {\n return vehicles;\n }", "public Vector<HotelInfo> getAllHotels(){\n Session session=null;\n List result=null;\n Vector<HotelInfo> hotelInfos = null;\n try\n {\n session= HibernateUtil.getSessionFactory().getCurrentSession();\n session.beginTransaction();\n result=session.createQuery(\"from Hotel\").list();\n System.out.println(\"Successfully return hotels from database\");\n session.getTransaction().commit();\n hotelInfos= new Vector<HotelInfo>();\n for (int i = 0; i < result.size(); i++)\n {\n HotelInfo myHotel=new HotelInfo();\n myHotel.setHotelId(((Hotel)result.get(i)).getHotelId());\n myHotel.setName(((Hotel)result.get(i)).getName());\n myHotel.setUsername((((Hotel)result.get(i)).getUsername()));\n myHotel.setPassword((((Hotel)result.get(i)).getPassword()));\n myHotel.setIpaddress((((Hotel)result.get(i)).getIpaddress()));\n myHotel.setPort((((Hotel)result.get(i)).getPort()));\n myHotel.setContextpath((((Hotel)result.get(i)).getContextPath()));\n hotelInfos.add(myHotel);\n }\n }\n catch(Exception e)\n {\n System.out.println(e.getMessage());\n }\n return hotelInfos;\n }", "public ArrayList<CarDetail> gettingAllAvailableCars() throws Exception;", "public abstract List<CarTO> listAll();", "public List<Service> list(){\r\n \tCriteria criteria = session.createCriteria(Service.class);\r\n \treturn criteria.list();\r\n }", "@Override\n\tpublic Collection<VendedorWebVO> getListVendedor(GetVendedorParams params) {\n\t\ttry {\n\t\t\tVendedorModuleRemote service = getVendedorModuleService();\n\t\t\tCollection<VendedorDTO> listVendedores = service.getListVendedor(params);\n\t\t\tCollection<VendedorWebVO> vendedores = new ArrayList<VendedorWebVO>();\n\t\t\tfor (VendedorDTO vendedor : listVendedores) {\n\t\t\t\tVendedorWebVO vend = MarketPlaceAdapterService.vendedorDTO2VendedorWebVO(vendedor);\n\t\t\t\tvendedores.add(vend);\n\t\t\t}\n\n\t\t\treturn vendedores;\n\t\t} catch (Exception e) {\n\t\t\t//throw AcademiaExceptionHandler.handleException(AcademiaErrorLayerConstants.WEB_SERVER, null, null, e);\n\t\t}\n\t\treturn null;\n\t}", "public interface VehicleService {\n\n void saveOrUpdate(Vehicle detainedObject);\n\n void delete(Vehicle detainedObject);\n List<Vehicle> getByplate(String plate);\n List<Vehicle> getBycarteJone(String carteJone );\n\n}", "@Override\r\n\tpublic List<sn.ucad.master.assurance.bo.Service> findAllService() {\n\t\treturn serviceRepository.findAll();\r\n\t}", "@Transactional\r\n\tpublic List<Car> getAllCars() {\n\t\treturn (List<Car>)cr.findAll();\r\n\t}", "@Override\n\tpublic ArrayList<Carpo> showAllCars() {\n\t\treturn inList.showAll();\n\t}", "public ArrayList<Vehicle> getVehicles() {\r\n ArrayList<Vehicle> allVehicles = new ArrayList<>();\r\n for (Lane lane : lanes) {\r\n allVehicles.addAll(lane.getVehicles());\r\n }\r\n return allVehicles;\r\n }", "List<Travel> getAllTravel();", "public List<Car> getCarsData() { return carsData; }", "@Override\n\t@Transactional\n\tpublic List<CategoryCar> getCategoryCarList() {\n\t\treturn categoryCarDAO.getCategoryCarList();\n\t}", "@PostConstruct\r\n public void leerListaUsuarios() {\r\n listaUsuarios.addAll(usuarioFacadeLocal.findAll());\r\n }", "@Override\n\tpublic List<Servicio> listarServicioTQ() {\n\t\tservicioDao = new ServicioDaoImpl();\n\t\treturn servicioDao.listarServicioTQ();\n\t}", "public ArrayList<Consulta> recuperaAllServicios() {\r\n\t\treturn servicioConsulta.recuperaAllServicios();\r\n\t}", "@RequestMapping(value = \"/obtenerVeredas\", method = RequestMethod.GET)\n\tpublic Iterable<Vereda> obtenerListaVeredas() {\n\t\treturn veredaRepository.findAll();\n\t\t//return JsonManager.toJson(veredaRepository.findAll());\n\t}", "public void GetVehiculos() {\n String A = \"&LOCATION=POR_ENTREGAR\";\n String Pahtxml = \"\";\n \n try {\n \n DefaultListModel L1 = new DefaultListModel();\n Pahtxml = Aso.SendGetPlacas(A);\n Lsvehiculo = Aso.Leerxmlpapa(Pahtxml);\n Lsvehiculo.forEach((veh) -> {\n System.out.println(\"Placa : \" + veh.Placa);\n L1.addElement(veh.Placa);\n });\n \n Lista.setModel(L1);\n \n } catch (Exception ex) {\n Logger.getLogger(Entrega.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }", "public List<Vet> getAllVets() {\n\t\tentityManager = JPAUtils.getEntityManager();\n\t\tentityManager.getTransaction().begin();\n\t\tvets = entityManager.createQuery(\"from Vet\", Vet.class).getResultList();\n\t\tentityManager.getTransaction().commit();\n\t\tentityManager.close();\n\t\treturn vets;\n\t}", "List<VehicleTypeDto> findAll();", "public List<CarsEntity> displayCars() {\n List<CarsEntity> carsEntities =\n em.createQuery(\n \"select c from CarsEntity c\").getResultList();\n\n return carsEntities;\n }", "@GET\r\n\t@Path(\"/vehicles/{id}\")\r\n\t@Produces(MediaType.APPLICATION_JSON)\r\n\tpublic Vehicle getVehicleById(@PathParam(\"id\") int id) {\r\n\t\treturn vehiclesMap.get(id);\r\n\t}", "@Override\n\tpublic List<Car> list() {\n\t\treturn carMapper.list1();\n\t}", "@Override\r\n\tpublic List<Vendor> listVendors() {\n\t\treturn dao.listVendors();\r\n\t}", "@Override\n public List<Vehicle> findAll() {\n List<AggregationOperation> operations = new ArrayList<>();\n operations.addAll(getVehicleAggregations());\n operations.add(getVehicleProjection());\n operations.add(sort(Sort.Direction.DESC, \"date_added\"));\n TypedAggregation<Warehouse> aggregation =\n Aggregation.newAggregation(Warehouse.class, operations);\n return mongoTemplate.aggregate(aggregation, Vehicle.class).getMappedResults();\n }", "public interface CarListService {\n\n public List<Transportation> getLocal();\n public List<Transportation> getLuxery();\n public List<Transportation> getExotic();\n}", "private void setCarList(){\n List<com.drife.digitaf.ORM.Database.CarModel> models = new ArrayList<>();\n\n if(nonPackageGrouping != null && nonPackageGrouping.size()>0){\n //cars = CarController.getAllAvailableCarInPackage(nonPackageGrouping.get(0).getCategoryGroupId());\n for (int i=0; i<nonPackageGrouping.size(); i++){\n List<com.drife.digitaf.ORM.Database.CarModel> carModels = CarController.getAllAvailableCarInPackage(nonPackageGrouping.get(i).getCategoryGroupId());\n for (int j=0; j<carModels.size(); j++){\n com.drife.digitaf.ORM.Database.CarModel model = carModels.get(j);\n models.add(model);\n }\n }\n }\n\n TextUtility.sortCar(models);\n\n for (int i=0; i<models.size(); i++){\n com.drife.digitaf.ORM.Database.CarModel model = models.get(i);\n String car = model.getCarName();\n if(!carModel.contains(car)){\n carModel.add(car);\n cars.add(model);\n }\n }\n\n /*for (int i=0; i<cars.size(); i++){\n com.drife.digitaf.ORM.Database.CarModel carModel = cars.get(i);\n String model = carModel.getCarName();\n this.carModel.add(model);\n }*/\n\n atModel.setAdapter(new ArrayAdapter<com.drife.digitaf.ORM.Database.CarModel>(this, android.R.layout.simple_list_item_1, this.cars));\n\n //SpinnerUtility.setSpinnerItem(getApplicationContext(), spinModel, this.carModel);\n }", "public ListIFace getLovAsListService() throws Exception {\r\n\t\tListIFace list = null;\t\r\n\t\tLovResultHandler lovResultHandler = new LovResultHandler( getLovResult() );\r\n\t\tSourceBean lovResultSB = lovResultHandler.getLovResultSB();\r\n\t\tPaginatorIFace paginator = new GenericPaginator();\r\n\t\t\r\n\t\tint numRows = 10;\r\n\t\ttry{\r\n\t\t\tSingletonConfig spagoconfig = SingletonConfig.getInstance();\r\n\t\t\tString lookupnumRows = spagoconfig.getConfigValue(\"SPAGOBI.LOOKUP.numberRows\");\r\n\t\t\tif(lookupnumRows!=null) {\r\n\t\t\t\tnumRows = Integer.parseInt(lookupnumRows);\r\n\t\t\t}\r\n\t\t} catch(Exception e) {\r\n\t\t\tnumRows = 10;\r\n\t\t\tSpagoBITracer.major(SpagoBIConstants.NAME_MODULE, this.getClass().getName(),\r\n\t\t\t\t\t \"getListServiceBaseConfig\", \"Error while recovering number rows for \" +\r\n\t\t\t\t\t \"lookup from configuration, usign default 10\", e);\r\n\t\t}\r\n\t\tpaginator.setPageSize(numRows);\r\n\t\t\r\n\t\t\r\n\t\tList rows = null;\r\n\t\tif (lovResultSB != null) {\r\n\t\t\trows = lovResultSB.getAttributeAsList(\"ROW\");\r\n\t\t\tfor (int i = 0; i < rows.size(); i++)\r\n\t\t\t\tpaginator.addRow(rows.get(i));\r\n\t\t}\r\n\t\tlist = new GenericList();\r\n\t\tlist.setPaginator(paginator);\r\n\t\treturn list;\r\n\t}", "@Override\n\tpublic List<BookVO> etcListCall() {\n\t\tList<BookVO> bookList =bookDAO.etcListCall();\n\t\t\n\t\treturn bookList;\n\t}", "public List<vacante> cargarvacante() {\n\t\treturn vacantesrepo.findAll();\n\t}", "public ArrayList<Service> selectAll(){\n return Database.servico;\n }", "public List<Servicio> findAll();", "@RequestMapping(value = \"/Reservation\", method = RequestMethod.GET)\n\t@ResponseBody\n\tpublic List<Reservation> listReservations() {\n\t\treturn new java.util.ArrayList<Reservation>(reservationService.loadReservations());\n\t}", "@Test\n public void findAllVehiclesTest() throws ItemNotFoundException {\n controller.findAllVehicles(null,null,null,request,principal);\n verify(vService).findAllVehicles(0,0, principal);\n\n //Test with all default values\n controller.findAllVehicles(null,null,5,request,principal);\n verify(vService).findAllVehicles(0,5, principal);\n\n //Test with all default values\n controller.findAllVehicles(\"car\",null,null,request,principal);\n verify(vService).findAllVehiclesByDisplayName(\"car\",0,0, principal);\n }", "@GetMapping(\"/vehicle1\")\n\tpublic ResponseEntity<List<Payment>> viewAllPayments(Vehicle vehicle) {\n\t\tlogger.info(\"View all Payments by Vehicle\");\n\t\treturn ResponseEntity.ok().body(payService.viewAllPayments(vehicle));\n\t}", "public interface VehicleService {\n\n Vehicle findById(Long id);\n\n List<Vehicle> findByUserId(String userId);\n\n Vehicle findByNumber(String number);\n\n void saveVehicle(Vehicle user);\n\n void updateVehicle(Vehicle user);\n\n void deleteVehicleById(Long id);\n\n void deleteAllVehicles();\n\n List<Vehicle> findAllVehicles();\n\n boolean isVehicleExists(Vehicle vehicle);\n}", "@Override\n public List<DetalleVenta> all() {\n return detalleVentaJpaRepository.findAll();\n }", "private void updateVehicles() {\n OffloaderSyncAdapter.syncImmediately(getContext());\n Log.w(LOG_TAG, \"updateVehicles: \");\n }", "@Override\r\n\tpublic List<TravelerDto> getAllTravelers() {\r\n\t\tList<Traveler> travelers = travelerDao.getAllTravelers();\r\n\t\treturn (List<TravelerDto>) modelMapper.mapCollection(travelers, TravelerDto.class);\r\n\t}", "public void showVehicles() {\n\t\tfor (Vehicle vehicle : vehicles) {\n\t\t\tSystem.out.println(vehicle);\n\t\t}\n\t}", "@GET\n public List<Lehrer> getAllLehrer() {\n Log.d(\"Webservice Lehrer Get:\");\n Query query = em.createNamedQuery(\"findAllTeachers\");\n List<Lehrer> lehrer = query.getResultList();\n return lehrer;\n }", "@Override\r\n\tpublic List<ManufacturersVO> k_getAll() {\n\t\treturn null;\r\n\t}", "@GET\n\t@Path(\"/carrocerias\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic ArrayList<CarroceriaDTO> listarCarrocerias(){\n\t\tSystem.out.println(\"ini: listarCarrocerias()\");\n\t\t\n\t\tCarroceriaService tipotService = new CarroceriaService();\n\t\tArrayList<CarroceriaDTO> lista = tipotService.ListadoCarroceria();\n\t\t\n\t\tif (lista == null) {\n\t\t\tSystem.out.println(\"Listado Vacío\");\n\t\t}else {\n\t\t\tSystem.out.println(\"Consulta Exitosa\");\n\t\t}\n\n\t\tSystem.out.println(\"fin: listarCarrocerias()\");\n\t\t\n\t\treturn lista;\n\t}", "@Override\n\tpublic LovServiceResponse getLovDetails() {\n\t\tLovServiceResponse l_res = new LovServiceResponse();\n\t\tList<LovDetail> l_lovList=null;\n\t\tList<LovVO> l_lovVoList=new ArrayList<LovVO>();\n\t\tLovVO l_lovVo = null;\n\t\ttry {\n\t\t\tl_lovList = lovDao.getLovDetails();\n\t\t\tfor(LovDetail l_etity : l_lovList ){\n\t\t\t\tl_lovVo = new LovVO(l_etity);\n\t\t\t\tBeanUtils.copyProperties(l_etity, l_lovVo);\n\t\t\t\tl_lovVoList.add(l_lovVo);\t\t\t\t\n\t\t\t}\n\t\t\tl_res.setLovList(l_lovVoList);\n\t\t\tl_res.setStatus(true);\n\t\t\t\n\t\t}catch(DataAccessException e){\t\t\t\n\t\t\tthrow new ServiceException(\"DataAccessException while fetch lov data\",e);\n\t\t}\n\t\tcatch (Exception e) {\t\t\t\n\t\t\tthrow new ServiceException(\"Unhandled Exception while fetch lov data\",e);\n\t\t}\n\t\treturn l_res;\t\t\n\t}", "@Override\n\tpublic List<PersonelContract> GetAll() {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic List<Hotel> getAllHotels() {\n\t\treturn showHotelList();\r\n\t}", "@Override\n\tpublic List<Dispositivo> getAll() {\n\t\treturn (List<Dispositivo>) dispositivoDao.findAll();\n\t}", "@Override\n public List<Client> getAllClients(){\n log.trace(\"getAllClients --- method entered\");\n List<Client> result = clientRepository.findAll();\n log.trace(\"getAllClients: result={}\", result);\n return result;\n }", "public static void showAllVilla(){\n ArrayList<Villa> villaList = getListFromCSV(FuncGeneric.EntityType.VILLA);\n displayList(villaList);\n showServices();\n }", "@PostConstruct\r\n/* 37: */ public void init()\r\n/* 38: */ {\r\n/* 39: 49 */ this.listaMotivoLlamadoAtencion = new LazyDataModel()\r\n/* 40: */ {\r\n/* 41: */ private static final long serialVersionUID = 1L;\r\n/* 42: */ \r\n/* 43: */ public List<MotivoLlamadoAtencion> load(int startIndex, int pageSize, String sortField, SortOrder sortOrder, Map<String, String> filters)\r\n/* 44: */ {\r\n/* 45: 59 */ List<MotivoLlamadoAtencion> lista = new ArrayList();\r\n/* 46: 60 */ boolean ordenar = sortOrder == SortOrder.ASCENDING;\r\n/* 47: */ \r\n/* 48: 62 */ filters.put(\"idOrganizacion\", String.valueOf(AppUtil.getOrganizacion().getId()));\r\n/* 49: 63 */ lista = MotivoLlamadoAtencionBean.this.servicioMotivoLlamadoAtencion.obtenerListaPorPagina(startIndex, pageSize, sortField, ordenar, filters);\r\n/* 50: */ \r\n/* 51: 65 */ MotivoLlamadoAtencionBean.this.listaMotivoLlamadoAtencion.setRowCount(MotivoLlamadoAtencionBean.this.servicioMotivoLlamadoAtencion.contarPorCriterio(filters));\r\n/* 52: */ \r\n/* 53: 67 */ return lista;\r\n/* 54: */ }\r\n/* 55: */ };\r\n/* 56: */ }", "public List<Reserva> getAllReservas(){\n return repositorioReserva.findAll();\n }", "public List<ServicioEntity> getServicios() {\r\n return servicios;\r\n }", "@Override\r\n\tpublic List<INonAutomatedVehicle> getVehiclesOfType(String vehicle) {\r\n\t\tList<INonAutomatedVehicle> vehicles = this.vehicleDatabase.get(vehicle);\r\n\t\treturn vehicles;\r\n\t}", "private void listarDepartamentos() {\r\n\t\tdepartamentos = departamentoEJB.listarDepartamentos();\r\n\t}", "public ArrayList<Cre> get_all_cre() throws Exception {\n\n \t\t log.setLevel(Level.INFO);\n\t log.info(\" service operation started !\");\n\n\t\ttry{\n\t\t\tArrayList<Cre> Cre_list;\n\n\t\t\tCre_list = Cre_Default_Activity_dao.get_all_cre();\n\n \t\t\tlog.info(\" Object returned from service method !\");\n\t\t\treturn Cre_list;\n\n\t\t}catch(Exception e){\n\n\t\t\tSystem.out.println(\"ServiceException: \" + e.toString());\n\t\t\tlog.error(\" service throws exception : \"+ e.toString());\n\n\t\t}\n\t\treturn null;\n\n\n\n\t}", "@PostConstruct\n public void init() {\n entradas = entradaFacadeLocal.findAll();\n salidas = salidaFacadeLocal.findAll();\n inventarios = inventarioFacadeLocal.leerTodos();\n }", "@Override\n public List<Person> getPeople() {\n return this.personRepository.findAll();\n }", "public List prices() {\n List ls = new ArrayList();\n try {\n\n Connection connection = DBUtil.getConnection();\n //PreparedStatement pst = connection.prepareStatement(\"select PriceId,VegetableId,GovernmentPrice,FarmerPrice,WholeSellerPrice,\"\n // + \"RetailerPrice from PriceDetails\");\n /*PreparedStatement pst = connection.prepareStatement(\"SELECT PriceDetails.PriceId,VegetableDetails.VegetableName,PriceDetails.GovernmentPrice,\"\n + \"PriceDetails.FarmerPrice,PriceDetails.WholeSellerPrice,PriceDetails.RetailerPrice\"\n + \" from PriceDetails INNER JOIN VegetableDetails \"\n + \"ON PriceDetails.VegetableId = VegetableDetails.VegetableId\");\n */\n\n PreparedStatement pst = connection.prepareStatement(\"select PriceDetails.PriceId,VegetableDetails.VegetableName,\"\n + \"PriceDetails.GovernmentPrice,PriceDetails.FarmerPrice,PriceDetails.WholeSellerPrice,\"\n + \"PriceDetails.RetailerPrice from PriceDetails INNER JOIN VegetableDetails ON PriceDetails.VegetableId = \"\n + \"VegetableDetails.VegetableId\");\n\n ResultSet rs = pst.executeQuery();\n while (rs.next()) {\n ViewPricesBean vpb = new ViewPricesBean();\n\n vpb.setPriceId(rs.getInt(1));\n vpb.setVegetableName(rs.getString(2));\n // vpb.setRegionName(rs.getString(3));\n vpb.setGovernmentPrice(rs.getFloat(3));\n vpb.setFarmerPrice(rs.getFloat(4));\n vpb.setWholeSellerPrice(rs.getFloat(5));\n vpb.setRetailerPrice(rs.getFloat(6));\n\n\n ls.add(vpb);\n\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n return ls;\n\n }", "@RequestMapping(path = \"medservices\", method = RequestMethod.GET)\n public List<MedicalService> getAllMedServices(){\n return medicalServiceService.getAllMedServices();\n }", "public ArrayList<Person> getAllPeople()\r\n\t{\r\n\t\treturn dataService.getAllPeople();\r\n\t}", "public void viewVehiclesInGarage() {\n\t\tfor (Vehicle vehicle : vehicleList) {\n\t\t\tvehicle.print();\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}", "@Override\n\tpublic List<DvdCd> getAll() {\n\t\tlogger.info(\"Listando todos os DVDs/CDs\");\n\t\treturn itemRepository.findAll(UserServiceImpl.authenticated().getId());\n\t}", "public List<Vehicle> getVehicles(String garageObjectId, Customer incomingCustomer){\n List<Vehicle> vehicleList = new ArrayList<>();\n List<ParseObject> list = this.parseEngine.getChildObjects\n (ParseDataFieldNames.customerId,incomingCustomer.getObjectId(), garageObjectId, ObjectType.Vehicle);\n if(list==null){\n return vehicleList;\n }\n if(!list.isEmpty() && list.size()>0){\n for(ParseObject parseObject : list){\n Vehicle foundVehicle = new Vehicle();\n foundVehicle.setObjectId(parseObject.getObjectId());\n foundVehicle.setMake(parseObject.getString(ParseDataFieldNames.make.toString()));\n foundVehicle.setModel(parseObject.getString(ParseDataFieldNames.model.toString()));\n foundVehicle.setYear(parseObject.getInt(ParseDataFieldNames.year.toString()));\n\n // add to list\n vehicleList.add(foundVehicle); \n }\n }\n return vehicleList;\n }", "@Override\r\n\tpublic ArrayList<theaterVO> selectList() {\n\t\treturn theaterRentalDaoImpl.selectList();\r\n\t}", "@Override\r\n\tpublic List<OrderDTO> findAllList() {\n\t\tList<OrderMaster> orderMasterList = orderMasterService.findAllOrderMaster();\r\n\t\t\r\n\t\tList<OrderDTO> orderDTOList = OrderMaster2OrderDTOConverter.convert(orderMasterList);\r\n\t\t\r\n\t\treturn orderDTOList;\r\n\t}", "public List<ReservaEntity> getReservas() {\n LOGGER.log(Level.INFO, \"Inicia proceso de consultar todas las reservas\");\n // Note que, por medio de la inyección de dependencias se llama al método \"findAll()\" que se encuentra en la persistencia.\n List<ReservaEntity> reservas = persistence.findAllReservas();\n LOGGER.log(Level.INFO, \"Termina proceso de consultar todas las reservas\");\n return reservas;\n }", "@Override\n\tpublic List<FoodTruckEntity> getAllFoodTrucks() {\n\t\t\n\t\t//modelmapper.addConverter(converter);\n\t\tList<FoodTruckEntity> list=repo.findAll();\n\t\treturn list;\n\t}", "public ArrayList<Servicio> cargarServicios() throws CaException {\n try {\n String strSQL = \"SELECT k_idservicio, f_fycentrada, f_fycsalida, q_valorapagar, k_idvehiculo FROM servicio\";\n Connection conexion = ServiceLocator.getInstance().tomarConexion();\n PreparedStatement prepStmt = conexion.prepareStatement(strSQL);\n ResultSet rs = prepStmt.executeQuery();\n while (rs.next()) {\n Servicio servicio1 = new Servicio();\n servicio1.setK_idservicio(rs.getInt(1));\n servicio1.setF_fycentrada(rs.getString(2));\n servicio1.setF_fycsalida(rs.getString(3));\n servicio1.setQ_valorapagar(rs.getInt(4));\n servicio1.setK_idvehiculo(rs.getInt(5));\n\n servicios.add(servicio1);\n }\n } catch (SQLException e) {\n throw new CaException(\"ServicioDAO\", \"No pudo recuperar el servicio\" + e.getMessage());\n }finally {\n ServiceLocator.getInstance().liberarConexion();\n }\n return servicios;\n }", "@PostConstruct\n @Override\n public void init() {\n super.setFacade(ejbFacade);\n newProspects = ejbFacade.findAllNew();\n \n FacesContext fc = FacesContext.getCurrentInstance();\n\tgetIdParam(fc);\n \n }", "public ArrayList<Poentity> get_all_poentity() throws Exception {\n\n \t\t log.setLevel(Level.INFO);\n\t log.info(\" service operation started !\");\n\n\t\ttry{\n\t\t\tArrayList<Poentity> Poentity_list;\n\n\t\t\tPoentity_list = Poentity_Activity_dao.get_all_poentity();\n\n \t\t\tlog.info(\" Object returned from service method !\");\n\t\t\treturn Poentity_list;\n\n\t\t}catch(Exception e){\n\n\t\t\tSystem.out.println(\"ServiceException: \" + e.toString());\n\t\t\tlog.error(\" service throws exception : \"+ e.toString());\n\n\t\t}\n\t\treturn null;\n\n\n\n\t}", "public void addVehicle() {\n\t\tcurrentInstance = FacesContext.getCurrentInstance();\n\t\tFacesMessage message = null;\n\t\ttry {\n\t\t\tvehicleService.insert(vehic);\n\t\t\tmessage = new FacesMessage(FacesMessage.SEVERITY_INFO,\"Saved\",\"Vehicle Saved\");\n\t\t} catch (Exception e) {\n\t\t\tmessage = new FacesMessage(FacesMessage.SEVERITY_ERROR,\"Failed\",\"Vehicle Failed to be Saved: \" + e.getMessage());\n\t\t}\n\t\tcurrentInstance.addMessage(null, message);\n\t}", "private void listarEntidades() {\r\n\t\tsetListEntidades(new ArrayList<EntidadDTO>());\r\n\t\tgetListEntidades().addAll(entidadController.encontrarTodos());\r\n\t\tif (!getListEntidades().isEmpty()) {\r\n\t\t\tfor (EntidadDTO entidadDTO : getListEntidades()) {\r\n\t\t\t\t// Conversión de decimales.\r\n\t\t\t\tDouble porcentaje = entidadDTO.getPorcentajeValorAsegurable() * 100;\r\n\t\t\t\tdouble por = Math.round(porcentaje * Math.pow(10, 2)) / Math.pow(10, 2);\r\n\t\t\t\tentidadDTO.setPorcentajeValorAsegurable(por);\r\n\t\t\t}\r\n\t\t}\r\n\t}" ]
[ "0.7477636", "0.73694086", "0.6964497", "0.66392756", "0.6591421", "0.658954", "0.64541316", "0.64294904", "0.64125794", "0.62077904", "0.6180371", "0.61641407", "0.6134423", "0.60593665", "0.60330594", "0.595009", "0.59218746", "0.5898356", "0.5895609", "0.5871093", "0.58620286", "0.5853231", "0.58251876", "0.58147234", "0.57596964", "0.5758236", "0.5758156", "0.5746999", "0.5729612", "0.5725329", "0.570693", "0.56998414", "0.56947786", "0.5683521", "0.56834674", "0.56701434", "0.56676334", "0.5651313", "0.56388634", "0.562798", "0.5625562", "0.5590329", "0.55684125", "0.5543829", "0.552896", "0.55171454", "0.5512829", "0.549742", "0.54901564", "0.54864293", "0.5486112", "0.5479678", "0.5452295", "0.54476124", "0.5445832", "0.5439404", "0.5436433", "0.5433226", "0.54306656", "0.54234", "0.5401294", "0.539727", "0.5374833", "0.5374011", "0.53576994", "0.53559554", "0.5354319", "0.5345045", "0.53450334", "0.533629", "0.5329828", "0.53284997", "0.5325585", "0.53220284", "0.5317364", "0.5317147", "0.53135926", "0.5307652", "0.5302545", "0.53020364", "0.52981424", "0.52962226", "0.5293352", "0.5289081", "0.5287524", "0.528327", "0.5281814", "0.528016", "0.52754813", "0.5273618", "0.5273258", "0.52717495", "0.5264768", "0.52543604", "0.5253757", "0.5253124", "0.5252882", "0.52487284", "0.52447736", "0.52419007" ]
0.5902439
17
Returns list of Vehicles
public List<Vehicle> getVehicles() { List<Vehicle> vehicleList = new ArrayList<Vehicle>(); if ((vehicles == null)||(vehicles.isEmpty())) { // call DAO method getCustomers to retrieve list of customer objects from database try { vehicleList = vehicleService.getAllVehicles(); } catch (Exception e) { currentInstance = FacesContext.getCurrentInstance(); FacesMessage message = null; message = new FacesMessage(FacesMessage.SEVERITY_ERROR,"Failed","Failed to retrieve vehicles from the database" + e.getMessage()); currentInstance.addMessage(null, message); } } else { vehicleList = vehicles; } return vehicleList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Vehicle> getVehicles() {\n\t\treturn vehicles;\n\t\t\n\t}", "public ArrayList<Vehicle> getVehicles() {\r\n ArrayList<Vehicle> allVehicles = new ArrayList<>();\r\n for (Lane lane : lanes) {\r\n allVehicles.addAll(lane.getVehicles());\r\n }\r\n return allVehicles;\r\n }", "@Override\n public List<Vehicle> getVehicles(AuthContext context) throws DSException {\n\n isContextValidFor(context, roleId -> { if(roleId == -1) throw new DSAuthException(\"Invalid Context\"); }, 1,3);\n\n //get the vehicles - > for each vehicle, with the vehicle model field (String model = vehicle.getForeignKey(\"model\"))\n List<Vehicle> vehicles = new ArrayList<>();\n try {\n List<Map<String,Object>> data = get(\"SELECT * FROM TblVehicles\");\n for(Map<String,Object> map: data) {\n //create a vehicle\n Vehicle vehicle = new Vehicle(map);\n\n //get the model number\n String model = vehicle.getForeignKey(\"model\");\n\n //get the model from Tbl\n if (model != null) {\n VehicleModel vehicleModel = new VehicleModel(get(\"SELECT * FROM TblVehicleModel WHERE modelNum = ?\", model).get(0));\n vehicle.setModel(vehicleModel);\n }\n //adding\n vehicles.add(vehicle);\n }\n return vehicles;\n }catch (SQLException e) {\n throw new DSFormatException(e.getMessage());\n }\n }", "public Vector<Cars> getCars() {\n\t\tVector<Cars> v = new Vector<Cars>();\n\t\ttry {\n\t\t\tStatement stmt = conn.createStatement();\n\t\t\tResultSet rs = stmt\n\t\t\t\t\t.executeQuery(\"select * from vehicle_details order by vehicle_reg\");\n\t\t\twhile (rs.next()) {\n\t\t\t\tString reg = rs.getString(1);\n\t\t\t\tString make = rs.getString(2);\n\t\t\t\tString model = rs.getString(3);\n\t\t\t\tString drive = rs.getString(4);\n\t\t\t\tCars cars = new Cars(reg, make, model, drive);\n\t\t\t\tv.add(cars);\n\t\t\t}\n\t\t}\n\n\t\tcatch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn v;\n\t}", "@GetMapping(\"/getVehicleInformation\")\n public Iterable<Vehicle> getAllVehicle() {\n\n return vehicleService.list();\n }", "public VehicleSearchRS getVehicles() {\r\n\t\tVehicleSearchRS response = null;\r\n\t\t//VehicleSearchService vehiclesearch = new VehicleSearchService();\r\n\t\t\r\n\t\t///Suppliers are useful when we donít need to supply any value and obtain a result at the same time.\r\n\t\tSupplier<VehicleSearchService> vehiclesearch = VehicleSearchService::new;\r\n\t\ttry {\r\n\t\t\tresponse = vehiclesearch.get().getVehicles(searchRQ);\r\n\t\t\t//System.out.println(response);\r\n\t\t} catch (VehicleValidationException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t\treturn response;\r\n\t}", "@Override\n\tpublic List<Vehicle> getAll() {\n\t\tList<Vehicle> list = new LinkedList<Vehicle>();\n\t\ttry {\n\t\t\tStatement st = Database.getInstance().getDBConn().createStatement();\n\t\t\tResultSet rs = st.executeQuery(\"SELECT v.vehicle_ID, v.plate_number, v.mv_number, v.engine_number, v.chassis_number, m.description as model_name, c.description as category, v.encumbered_to, v.amount, v.maturity_date, v.status, v.image FROM models m INNER JOIN vehicles v ON m.model_ID=v.model_ID INNER JOIN vehicle_categories c ON c.category_ID=v.category_ID\");\n\t\t\t\n\t\t\twhile(rs.next()) {\n\t\t\t\tBlob blob = rs.getBlob(\"image\");\n\t\t\t\tInputStream is = blob.getBinaryStream(1, (int)blob.length());\n\t\t\t\tBufferedImage bf = ImageIO.read(is);\n\t\t\t\tImage img = SwingFXUtils.toFXImage(bf, null);\n\t\t\t\t\n\t\t\t\tlist.add(new Vehicle(rs.getInt(\"vehicle_ID\"), rs.getString(\"plate_number\"), rs.getString(\"mv_number\"), rs.getString(\"engine_number\"), rs.getString(\"chassis_number\"),rs.getString(\"model_name\"), rs.getString(\"category\"), rs.getString(\"encumbered_to\"), rs.getDouble(\"amount\"), Date.parse(rs.getString(\"maturity_date\")), rs.getString(\"status\"), img));\n\t\t\t}\n\t\t\t\n\t\t\tst.close();\n\t\t\trs.close();\n\t\t} catch(Exception err) {\n\t\t\terr.printStackTrace();\n\t\t}\n\t\treturn list;\n\t}", "private void getVehicleList() {\n mApiCall.getVehicleList();\n }", "public static void listVehicles() {\n\t\tSystem.out.println(\"-----------------\");\n\t\tSystem.out.println(\"Listing Vehicles\");\n\t\tSystem.out.println(\"-----------------\");\n\t\t\n\t\tfor (int i = 0; i < owners.size(); i++) {\n\t\t\tfor (Vehicle v : owners.get(i).getVehicles()) {\n\t\t\t\t\n\t\t\t\tSystem.out.println((owners.get(i).getName() + \"'s \" + v.toString()));\n\t\t\t\t\n\t\t\t}\n\n\t\t}\n\t\t\n\t}", "@Override\n public List<Vehicle> getVehiclesByMake(String make){\n List<VehicleDetails> results = repo.findByMake(make);\n return mapper.mapAsList(results, Vehicle.class);\n }", "public List<Vehicle> getAllVehicle() {\n // array of columns to fetch\n String[] columns = {\n COLUMN_VEHICLE_ID,\n COLUMN_VEHICLE_NAME,\n COLUMN_VEHICLE_NUMBER,\n COLUMN_VEHICLE_CC,\n COLUMN_VEHICLE_YEAR,\n COLUMN_VEHICLE_TYPE,\n COLUMN_VEHICLE_FUEL,\n COLUMN_VEHICLE_CATEGORY,\n COLUMN_VEHICLE_DATE\n };\n // sorting orders\n String sortOrder =\n COLUMN_VEHICLE_NAME + \" ASC\";\n List<Vehicle> vehicleList = new ArrayList<Vehicle>();\n\n SQLiteDatabase db = this.getReadableDatabase();\n\n // query the vehicle table\n /**\n * Here query function is used to fetch records from vehicle table this function works like we use sql query.\n */\n Cursor cursor = db.query(TABLE_VEHICLE, //Table to query\n columns, //columns to return\n null, //columns for the WHERE clause\n null, //The values for the WHERE clause\n null, //group the rows\n null, //filter by row groups\n sortOrder); //The sort order\n\n\n // Traversing through all rows and adding to list\n if (cursor.moveToFirst()) {\n do {\n Vehicle vehicle = new Vehicle();\n vehicle.setId(Integer.parseInt(cursor.getString(cursor.getColumnIndex(COLUMN_VEHICLE_ID))));\n vehicle.setName(cursor.getString(cursor.getColumnIndex(COLUMN_VEHICLE_NAME)));\n vehicle.setNumber(cursor.getString(cursor.getColumnIndex(COLUMN_VEHICLE_NUMBER)));\n vehicle.setCc(cursor.getString(cursor.getColumnIndex(COLUMN_VEHICLE_CC)));\n vehicle.setYear(cursor.getString(cursor.getColumnIndex(COLUMN_VEHICLE_YEAR)));\n vehicle.setType(cursor.getString(cursor.getColumnIndex(COLUMN_VEHICLE_TYPE)));\n vehicle.setFuel(cursor.getString(cursor.getColumnIndex(COLUMN_VEHICLE_FUEL)));\n vehicle.setCategory(cursor.getString(cursor.getColumnIndex(COLUMN_VEHICLE_CATEGORY)));\n vehicle.setDate(cursor.getString(cursor.getColumnIndex(COLUMN_VEHICLE_DATE)));\n // Adding vehicle record to list\n vehicleList.add(vehicle);\n } while (cursor.moveToNext());\n }\n cursor.close();\n db.close();\n\n // return vehicle list\n return vehicleList;\n }", "public Vector<Trucks> getTrucks() {\n\t\tVector<Trucks> v = new Vector<Trucks>();\n\t\ttry {\n\t\t\tStatement stmt = conn.createStatement();\n\t\t\tResultSet rs = stmt\n\t\t\t\t\t.executeQuery(\"select vehicle_reg, vehicle_model, vehicle_weight, drive_class from vehicle_details order by vehicle_reg\");\n\t\t\twhile (rs.next()) {\n\t\t\t\tString reg = rs.getString(1);\n\t\t\t\tString model = rs.getString(2);\n\t\t\t\tdouble weight = rs.getDouble(3);\n\t\t\t\tString drive = rs.getString(4);\n\t\t\t\tTrucks truck = new Trucks(reg, model, weight, drive);\n//\t\t\t\tCars cars = new Truck(reg, model, drive);\n\t\t\t\tv.add(truck);\n\t\t\t}\n\t\t}catch(SQLException e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn v;\n\t}", "@JsonIgnore public Collection<Vehicle> getAircraftVehicles() {\n final Object current = myData.get(\"aircraft\");\n if (current == null) return Collections.emptyList();\n if (current instanceof Collection) {\n return (Collection<Vehicle>) current;\n }\n return Arrays.asList((Vehicle) current);\n }", "@Override\r\n\tpublic List<INonAutomatedVehicle> getVehiclesOfType(String vehicle) {\r\n\t\tList<INonAutomatedVehicle> vehicles = this.vehicleDatabase.get(vehicle);\r\n\t\treturn vehicles;\r\n\t}", "public ArrayList<Vehicle> get(LocalDate from,LocalDate to) {\n return vehicles;\n }", "public List<VehicleVO> getCarList() {\n return carList;\n }", "@Override\n public List<Vehicle> findAll() {\n List<AggregationOperation> operations = new ArrayList<>();\n operations.addAll(getVehicleAggregations());\n operations.add(getVehicleProjection());\n operations.add(sort(Sort.Direction.DESC, \"date_added\"));\n TypedAggregation<Warehouse> aggregation =\n Aggregation.newAggregation(Warehouse.class, operations);\n return mongoTemplate.aggregate(aggregation, Vehicle.class).getMappedResults();\n }", "public void showVehicles() {\n\t\tfor (Vehicle vehicle : vehicles) {\n\t\t\tSystem.out.println(vehicle);\n\t\t}\n\t}", "public List<Vehicle> getVehicles(String garageObjectId, Customer incomingCustomer){\n List<Vehicle> vehicleList = new ArrayList<>();\n List<ParseObject> list = this.parseEngine.getChildObjects\n (ParseDataFieldNames.customerId,incomingCustomer.getObjectId(), garageObjectId, ObjectType.Vehicle);\n if(list==null){\n return vehicleList;\n }\n if(!list.isEmpty() && list.size()>0){\n for(ParseObject parseObject : list){\n Vehicle foundVehicle = new Vehicle();\n foundVehicle.setObjectId(parseObject.getObjectId());\n foundVehicle.setMake(parseObject.getString(ParseDataFieldNames.make.toString()));\n foundVehicle.setModel(parseObject.getString(ParseDataFieldNames.model.toString()));\n foundVehicle.setYear(parseObject.getInt(ParseDataFieldNames.year.toString()));\n\n // add to list\n vehicleList.add(foundVehicle); \n }\n }\n return vehicleList;\n }", "public VehicleList() {\n\t\tvehicles = new ArrayList<Vehicle>();\n\t}", "@Override\n public List<VehicleModel> getVehicleModels(AuthContext context) throws DSException {\n\n isContextValidFor(context, roleId -> { if(roleId == -1) throw new DSAuthException(\"Invalid Context\"); }, 1,2,3);\n List<VehicleModel> vehicleModels = new ArrayList<>();\n try {\n List<Map<String, Object>> data = get(\"SELECT * FROM TblVehicleModel\");\n for(Map<String,Object> map: data)\n vehicleModels.add(new VehicleModel(map));\n return vehicleModels;\n } catch (SQLException e) {\n throw new DSFormatException(e.getMessage());\n }\n }", "@Override\r\n\tpublic List<IAutomatedVehicle> getVehiclesOfFuelType(Fuel fuel) {\r\n\t\tList<IAutomatedVehicle> allVehiclesOfFuelType = new ArrayList<>();\r\n\r\n//\t\tfor (INonAutomatedVehicle notAuto : this.vehicleDatabase.get(CAR)) {\r\n//\t\t\tIAutomatedVehicle auto = (IAutomatedVehicle) notAuto;\r\n//\t\t\tif (auto.getFuel().equals(fuel)) {\r\n//\t\t\t\tallVehiclesOfFuelType.add(auto);\r\n//\t\t\t}\r\n//\t\t}\r\n//\r\n//\t\tfor (INonAutomatedVehicle notAuto : this.vehicleDatabase.get(MOTORCYCLE)) {\r\n//\t\t\tIAutomatedVehicle auto = (IAutomatedVehicle) notAuto;\r\n//\t\t\tif (auto.getFuel().equals(fuel)) {\r\n//\t\t\t\tallVehiclesOfFuelType.add(auto);\r\n//\t\t\t}\r\n//\t\t}\r\n\r\n\t\tList<INonAutomatedVehicle> nonAuto = new ArrayList<>();\r\n\t\tnonAuto.addAll(this.vehicleDatabase.get(CAR));\r\n\t\tnonAuto.addAll(this.vehicleDatabase.get(MOTORCYCLE));\r\n\t\tfor (INonAutomatedVehicle nonVehicle : nonAuto) {\r\n\t\t\tIAutomatedVehicle auto = (IAutomatedVehicle) nonVehicle;\r\n\t\t\tif (auto.getFuel().equals(fuel)) {\r\n\t\t\t\tallVehiclesOfFuelType.add(auto);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn allVehiclesOfFuelType;\r\n\t}", "private static List<Element> getXMLVehicles(Model model) {\n Set<Vehicle> vehicles = new TreeSet<>(Comparators.objectsById());\n vehicles.addAll(model.getVehicles(null));\n List<Element> result = new ArrayList<>(vehicles.size());\n for (Vehicle curVehicle : vehicles) {\n Element vehicleElement = new Element(\"vehicle\");\n vehicleElement.setAttribute(\"id\", String.valueOf(curVehicle.getId()));\n vehicleElement.setAttribute(\"name\", curVehicle.getName());\n vehicleElement.setAttribute(\"length\",\n String.valueOf(curVehicle.getLength()));\n vehicleElement.setAttribute(\"energyLevelCritical\",\n String.valueOf(curVehicle.getEnergyLevelCritical()));\n vehicleElement.setAttribute(\"energyLevelGood\",\n String.valueOf(curVehicle.getEnergyLevelGood()));\n for (Map.Entry<String, String> curEntry\n : curVehicle.getProperties().entrySet()) {\n Element propertyElement = new Element(\"property\");\n propertyElement.setAttribute(\"name\", curEntry.getKey());\n propertyElement.setAttribute(\"value\", curEntry.getValue());\n vehicleElement.addContent(propertyElement);\n }\n result.add(vehicleElement);\n }\n return result;\n }", "List<VehicleTypeDto> findAll();", "private void getVehicleByParse() {\n\t\tvehicles = new ArrayList<DCVehicle>();\n\t\tfinal ParseUser user = ParseUser.getCurrentUser();\n\t\tParseQuery<ParseObject> query = ParseQuery.getQuery(\"DCVehicle\");\n\n\t\tquery.setCachePolicy(ParseQuery.CachePolicy.NETWORK_ELSE_CACHE);\n\t\tquery.whereEqualTo(\"vehiclePrivateOwner\", user);\n\t\tquery.findInBackground(new FindCallback<ParseObject>() {\n\t\t\tpublic void done(final List<ParseObject> vehicleList,\n\t\t\t\t\tParseException e) {\n\t\t\t\tif (e == null) {\n\t\t\t\t\t// Loop through all vehicles that we got from the query\n\t\t\t\t\tfor (int i = 0; i < vehicleList.size(); i++) {\n\t\t\t\t\t\t// Convert parse object (DC Vehicle) into vehicle\n\t\t\t\t\t\tDCVehicle vehicle = ParseUtilities\n\t\t\t\t\t\t\t\t.convertVehicle(vehicleList.get(i));\n\n\t\t\t\t\t\t// Get photo from the parse\n\t\t\t\t\t\tParseFile photo = (ParseFile) vehicleList.get(i).get(\n\t\t\t\t\t\t\t\t\"vehiclePhoto\");\n\t\t\t\t\t\tbyte[] data = null;\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif (photo != null)\n\t\t\t\t\t\t\t\tdata = photo.getData();\n\t\t\t\t\t\t} catch (ParseException e1) {\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (data == null) {\n\t\t\t\t\t\t\tvehicle.setPhotoSrc(null);\n\t\t\t\t\t\t\tvehicle.setPhoto(false);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvehicle.setPhotoSrc(data);\n\t\t\t\t\t\t\tvehicle.setPhoto(true);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvehicles.add(vehicle);\n\t\t\t\t\t\tvehicleObjects.add(vehicleList.get(i));\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set adapter\n\t\t\t\t\tadapter = new VehicleListAdapter(VehiclesListActivity.this,\n\t\t\t\t\t\t\tvehicles, vehiclePicker, addJournyActivity);\n\t\t\t\t\tlist.setAdapter(adapter);\n\t\t\t\t} else {\n\t\t\t\t\tLog.e(\"Get Vehicle\", e.getMessage());\n\t\t\t\t}\n\n\t\t\t\t// Disable loading bar\n\t\t\t\tloading.setVisibility(View.GONE);\n\t\t\t}\n\t\t});\n\t}", "public ArrayList<Vehicle> getPlanes() {\n return vehicles.stream().filter(loc -> loc.getClass().getSuperclass().getSimpleName().equals(\"Plane\")).collect(Collectors.toCollection(ArrayList::new));\n }", "public List<Car> getCars() {\n List<Car> cars = new ArrayList<>();\n\n for (Car car : DatabaseManager.getCars()) {\n if (!car.isReserved()) {\n cars.add(car);\n }\n }\n\n return cars;\n }", "public ArrayList<Circle> getLineVehicles()\r\n {\r\n return this.all_line_vehicles;\r\n }", "List<Vehicle> getLineVehicles(String line);", "public String toString() {\n\t\tStringBuilder returnStr = new StringBuilder();\n\t\tfor (Vehicle v : vehicles) {\n\t\t\treturnStr.append(v + \"\\n\");\n\t\t}\n\t\treturn returnStr.toString();\n\t}", "public List<Vet> getAllVets() {\n\t\tentityManager = JPAUtils.getEntityManager();\n\t\tentityManager.getTransaction().begin();\n\t\tvets = entityManager.createQuery(\"from Vet\", Vet.class).getResultList();\n\t\tentityManager.getTransaction().commit();\n\t\tentityManager.close();\n\t\treturn vets;\n\t}", "@GET\r\n\t@Path(\"/vehicles/{id}\")\r\n\t@Produces(MediaType.APPLICATION_JSON)\r\n\tpublic Vehicle getVehicleById(@PathParam(\"id\") int id) {\r\n\t\treturn vehiclesMap.get(id);\r\n\t}", "@Override\n\tpublic ArrayList<Carpo> getAllCars() {\n\t\treturn inList.getAll();\n\t}", "public ArrayList<CarDetail> gettingAllAvailableCars() throws Exception;", "List<Travel> getAllTravel();", "public List<MotorCycle> getListMototCycleNameAndCylinder(){\r\n\t\treturn motorCycleDao.getListMotorNameAndCylinder();\r\n\t}", "public void populateVehicleList() {\n\t\tfor (int i = 0; i < VEHICLE_LIST_SIZE; i++) {\n\t\t\tvehicleList[i] = createNewVehicle();\n\t\t}\n\t}", "public List<RWDCar> getCars() {\n return game.getCars();\n }", "public void viewVehiclesInGarage() {\n\t\tfor (Vehicle vehicle : vehicleList) {\n\t\t\tvehicle.print();\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}", "public static List<Carro> getCarros() {\n CarroDAO dao = CarrosApplication.getInstance().getCarroDAO();\n List<Carro> carros = dao.findAll();\n return carros;\n }", "public abstract List<CarTO> listAll();", "public Set<DynamicEntity> getAllValuesOfvehicle() {\n return rawStreamAllValuesOfvehicle(emptyArray()).collect(Collectors.toSet());\n }", "public Vehicle getVehicle() {\n\t\treturn new Vehicle(\"越野车\",\"LSW12333\",\"通用凯迪拉克\");\r\n\t}", "public List<Car>getAllCars(){\r\n return (List<Car>) repository.findAll();\r\n }", "public Vector<EntityWeapon> getWeaponList();", "public List<Vehicle> getVehiclesByVehicleType(List<Vehicle> vehicles, VehicleSearchRequest search) {\r\n\t\tList<Vehicle> intermediateSearchVehicles = null;\r\n\t\tintermediateSearchVehicles = new ArrayList<>();\r\n\t\tfor (Vehicle vehicle : vehicles) {\r\n\t\t\tif (vehicle.getVehicleType().getType().equals(search.getVehicleType().getType())) {\r\n\t\t\t\tintermediateSearchVehicles.add(vehicle);\r\n\t\t\t}\r\n\t\t}\r\n\treturn intermediateSearchVehicles;\r\n\t}", "@Override\n\tpublic List<Car> list() {\n\t\treturn carMapper.list1();\n\t}", "public List<Carro> getCarros(){\n\t\t\n\t\ttry {\t\t\t\n\t\t\tList<Carro> carros = db.getCarros();\n\t\t\treturn carros;\n\t\t\t\n\t\t} catch(SQLException ex) {\n\t\t\tex.printStackTrace();\n\t\t\treturn new ArrayList<>();\n\t\t}\n\t\t\n\t}", "@Override\n public List<Vehicle> findBySearchCriteria(SearchCriteria criteria) {\n List<AggregationOperation> operations = new ArrayList<>();\n operations.addAll(getVehicleAggregations());\n if (criteria.getMakes() != null && !criteria.getMakes().isEmpty()) {\n operations.add(getMatchOperation(\"cars.vehicles.make\", Operation.IN, criteria.getMakes()));\n }\n if (criteria.getModels() != null && !criteria.getModels().isEmpty()) {\n operations.add(getMatchOperation(\"cars.vehicles.model\", Operation.IN, criteria.getModels()));\n }\n if (criteria.getWarehouses() != null && !criteria.getWarehouses().isEmpty()) {\n operations.add(\n getMatchOperation(\n \"_id\",\n Operation.IN,\n criteria.getWarehouses().stream()\n .mapToInt(BigDecimal::intValue)\n .boxed()\n .collect(Collectors.toList())));\n }\n if (criteria.getPriceRange() != null) {\n operations.add(\n getMatchOperation(\"cars.vehicles.price\", Operation.BTW, criteria.getPriceRange()));\n }\n if (criteria.getYearRange() != null) {\n operations.add(\n getMatchOperation(\"cars.vehicles.year_model\", Operation.BTW, criteria.getYearRange()));\n }\n\n operations.add(getVehicleProjection());\n if (criteria.getSort() != null) {\n operations.add(\n sort(\n Sort.Direction.valueOf(criteria.getSort().getDirection().toString()),\n criteria.getSort().getField()));\n }\n TypedAggregation<Warehouse> aggregation =\n Aggregation.newAggregation(Warehouse.class, operations);\n List<Vehicle> filterVehicles =\n mongoTemplate.aggregate(aggregation, Vehicle.class).getMappedResults();\n return filterVehicles;\n }", "public ArrayList<Vehicle> getAircraftCarriers() {\n return getShips().stream().filter(ship -> ship.getClass().getSimpleName().equals(\"AircraftCarrier\")).collect(Collectors.toCollection(ArrayList::new));\n }", "public List<Vehicle> getVehiclesByFuelType(List<Vehicle> vehicles, VehicleSearchRequest search) {\r\n\t\tList<Vehicle> intermediateSearchVehicles = null;\r\n\t\tif (search.getFuelType().getFuel().equals(DefaultValues.FUEL_TYPE_DEFAULT.getDef())) {\r\n\t\t\tintermediateSearchVehicles = new ArrayList<>(vehicles);\r\n\t\t} else {\r\n\t\t\tintermediateSearchVehicles = new ArrayList<>();\r\n\t\t\tfor (Vehicle vehicle : vehicles) {\r\n\t\t\t\tif (vehicle.getFuelType().getFuel().equalsIgnoreCase(search.getFuelType().getFuel())) {\r\n\t\t\t\t\tintermediateSearchVehicles.add(vehicle);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn intermediateSearchVehicles;\r\n\t}", "@Override\n public List<Vessel> getVessels() {\n return new ArrayList<>(boats);\n }", "public static Car[] getAll() {\n Car[] cars = null;\n RequestGetObject requestGetObject = new RequestGetObject();\n try {\n String carsString = requestGetObject.execute(\"https://waiting-list-garage.herokuapp.com/car\").get();\n Gson gson = new Gson();\n cars = gson.fromJson(carsString, Car[].class);\n } catch (ExecutionException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n return cars;\n }", "public List<VehicleMaintenance> getVehicleMaintenances(){\n\n return vehicleMaintenanceRepository.findAll();\n }", "public ArrayList<Vehicle> getShips() {\n return vehicles.stream().filter(loc -> loc.getClass().getSuperclass().getSimpleName().equals(\"Ship\")).collect(Collectors.toCollection(ArrayList::new));\n }", "@GetMapping(\"/vehicle1\")\n\tpublic ResponseEntity<List<Payment>> viewAllPayments(Vehicle vehicle) {\n\t\tlogger.info(\"View all Payments by Vehicle\");\n\t\treturn ResponseEntity.ok().body(payService.viewAllPayments(vehicle));\n\t}", "public void getAllVehicles(DefaultTableModel dataTableModel, String brand, String model) {\n// dataTableModel.setColumnIdentifiers(Vehicle.getVehicleDefinition());\n// dataTableModel.addRow(Vehicle.getVehicleDefinition());\n// ResultSet rs = db.getAllVehicles(brand, model);\n// try {\n// while (rs.next()) {\n Vehicle vehicle = createVehicle(/*rs*/);\n// dataTableModel.addRow(vehicle.vehicleToArray());\n// }\n// } catch (SQLException e) {\n// e.printStackTrace();\n// }\n }", "@Override\r\n\tpublic List<Vendor> listVendors() {\n\t\treturn dao.listVendors();\r\n\t}", "public List<Venta> getVentas() {\n List<Venta> vts = new ArrayList<>();\n\n try {\n BufferedReader br = new BufferedReader(new FileReader(\"src/Archivo/ventas/ventas.txt\"));\n String record;\n\n while ((record = br.readLine()) != null) {\n\n StringTokenizer st = new StringTokenizer(record, \",\");\n \n String id = st.nextToken();\n String idCliente = st.nextToken();\n String sacosVendidos = st.nextToken();\n String valueVenta = st.nextToken();\n String fecha = st.nextToken();\n\n\n Venta venta = new Venta(\n Integer.parseInt(id),\n Integer.parseInt(idCliente),\n Integer.parseInt(sacosVendidos),\n Float.parseFloat(valueVenta),\n fecha\n );\n\n vts.add(venta);\n }\n\n br.close();\n } catch (Exception e) {\n System.err.println(e);\n }\n\n return vts;\n }", "public List<Vehicle> getVehiclesByModel(List<Vehicle> vehicles, VehicleSearchRequest search) {\r\n\t\tList<Vehicle> intermediateSearchVehicles = null;\r\n\t\tif (search.getModel().equals(DefaultValues.MODEL_DEFAULT.getDef())) {\r\n\t\t\tintermediateSearchVehicles = new ArrayList<>(vehicles);\r\n\t\t} else {\r\n\t\t\tintermediateSearchVehicles = new ArrayList<>();\r\n\t\t\tfor (Vehicle vehicle : vehicles) {\r\n\t\t\t\tif (vehicle.getModel().equalsIgnoreCase(search.getModel())) {\r\n\t\t\t\t\tintermediateSearchVehicles.add(vehicle);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn intermediateSearchVehicles;\r\n\t}", "public static void mostrarVehiculos() {\n for (Vehiculo elemento : vehiculos) {\n System.out.println(elemento);\n }\n\t}", "public List<VehicleCategoryMasterBean> categoryList() throws Exception;", "public List<String> getListOfAircraftModels() {\n \n List<AircraftModel> list = project.getAircraftModelList().getModelList();\n LinkedList<String> modelListInString = new LinkedList<>();\n for (AircraftModel model : list) {\n modelListInString.add(model.getId());\n }\n\n return modelListInString;\n }", "@Override\n public List<Vehicle> findByMake(String make) {\n List<AggregationOperation> operations = new ArrayList<>();\n operations.addAll(getVehicleAggregations());\n operations.add(getMatchOperation(\"cars.vehicles.make\", Operation.EQ, make));\n operations.add(getVehicleProjection());\n operations.add(sort(Sort.Direction.DESC, \"date_added\"));\n TypedAggregation<Warehouse> aggregation =\n Aggregation.newAggregation(Warehouse.class, operations);\n return mongoTemplate.aggregate(aggregation, Vehicle.class).getMappedResults();\n }", "@Override\n\tpublic Collection<VendedorWebVO> getListVendedor(GetVendedorParams params) {\n\t\ttry {\n\t\t\tVendedorModuleRemote service = getVendedorModuleService();\n\t\t\tCollection<VendedorDTO> listVendedores = service.getListVendedor(params);\n\t\t\tCollection<VendedorWebVO> vendedores = new ArrayList<VendedorWebVO>();\n\t\t\tfor (VendedorDTO vendedor : listVendedores) {\n\t\t\t\tVendedorWebVO vend = MarketPlaceAdapterService.vendedorDTO2VendedorWebVO(vendedor);\n\t\t\t\tvendedores.add(vend);\n\t\t\t}\n\n\t\t\treturn vendedores;\n\t\t} catch (Exception e) {\n\t\t\t//throw AcademiaExceptionHandler.handleException(AcademiaErrorLayerConstants.WEB_SERVER, null, null, e);\n\t\t}\n\t\treturn null;\n\t}", "public List<Vendedor> listarVendedor();", "@Override\n\tpublic List<Vendor> listVendors() {\n\t\treturn new ArrayList<>(vendors.values());\n\t}", "public List<Vehicle> getVehiclesByLocation(List<Vehicle> vehicles, VehicleSearchRequest search) {\r\n\t\tList<Vehicle> intermediateSearchVehicles = null;\r\n\t\tintermediateSearchVehicles = new ArrayList<>();\r\n\t\tfor (Vehicle vehicle : vehicles) {\r\n\t\t\tif (vehicle.getLocation().equals(search.getLocation())) {\r\n\t\t\t\tintermediateSearchVehicles.add(vehicle);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn intermediateSearchVehicles;\r\n\t}", "public List<Product> findByVehicleType(String typeOfVehicle);", "public List<Voto> getVotos(){\n\t\treturn em.createQuery(\"SELECT c from Voto c\", Voto.class).getResultList();\n\t}", "List<RadarTechnologies> getAllRadarTechnologies();", "java.util.List<WorldUps.UInitTruck> \n getTrucksList();", "public List<Agente> getAllAgentes(){\r\n\t\treturn resAgenteDAO.getAllAgentes();\r\n\t}", "public ArrayList<VtbObject> findAll() throws MappingException {\n\t\treturn null;\n\t}", "public void getAll() {\n try {\n\n String sql = \"select * from project_zero.carlot where owner = 'DEALERSHIP';\";\n Statement st = ConnectionUtil.getInstance().getConnection().createStatement();\n ResultSet rs = st.executeQuery(sql);\n\n while(rs.next()) {\n Car c = new Car(rs.getInt(1), rs.getString(2), rs.getString(3),\n rs.getInt(4), rs.getString(5), rs.getString(6), rs.getInt(7));\n System.out.println(c.toString());\n\n }\n\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public ArrayList<Sale> getAllSale() throws SQLException{\n\t\tSystem.out.println(\"Retrieving all sales record...\");\n\t\tConnection dbConnection = null;\n\t\tStatement statement = null;\n\t\tResultSet result = null;\n\t\t// query to retrieve all details from vehicles\n\t\tString query = \"SELECT * FROM vehicles;\";\n\t\tVehicle temp = null;\n\t\t// create an array list to store data\n\t\tArrayList<Sale> saleList = new ArrayList<>();\n\t\t\n\t\ttry{\n\t\t\t// Connect to database\n\t\t\tdbConnection = getDBConnection();\n\t\t\t// create a statement\n\t\t\tSystem.out.println(\"DBQuery = \"+query);\n\t\t\t// execute query and store the return value in result\n\t\t\tresult = statement.executeQuery(query);\n\t\t\t// loop through every row\n\t\t\twhile(result.next()){\n\t\t\t\tint vehicle_id = result.getInt(\"vehicle_id\");\n\t\t\t\tString sold_date = result.getString(\"sold_date\");\n\t\t\t\tint sold_price = result.getInt(\"sold_price\");\n\t\t\t\tString status = result.getString(\"status\");\n\t\t\t\t// add sale objects into array list\n\t\t\t\tsaleList.add(new Sale(vehicle_id, sold_date, sold_price, status));\n\t\t\t}\n\t\t} finally {\n\t\t\t// close the connection\n\t\t\tif (result != null){result.close();}\n\t\t\tif (statement != null){statement.close();}\n\t\t\tif (dbConnection != null){dbConnection.close();}\n\t\t}\n\t\treturn saleList;\n\t}", "public Vector getListSpecializations(){\n Vector listQualifications = new Vector();\n try{\n String sqlGet = \"SELECT * FROM qualification ORDER BY qualification_name\";\n\n ResultSet rsGet = this.queryData(sqlGet);\n int order = 0;\n while(rsGet.next()){\n order++;\n Vector dataSet = new Vector();\n dataSet.add(rsGet.getInt(\"qualification_id\"));\n dataSet.add(rsGet.getString(\"qualification_name\"));\n\n listQualifications.add(dataSet);\n }\n } catch(Exception e){\n System.out.println(e.getMessage());\n }\n return listQualifications;\n }", "@Override\n\tpublic List<VehicleCombustion> findByName(String name) {\n\t\tList<VehicleCombustion> resultsCombustion = new ArrayList<>();\n\n\t\tfor (VehicleCombustion results : vehiclesCombustion.values())\n\t\t\tif (results.getModel().equals(name))\n\t\t\t\tresultsCombustion.add(results);\n\n\t\treturn resultsCombustion;\n\t}", "public List<Vegetable> getVegetables() {\n ArrayList<Vegetable> vegetables = new ArrayList<>();\n for (VegetablePortion vegetablePortion : list) {\n vegetables.add(vegetablePortion.getVegetable());\n }\n return vegetables;\n }", "public ArrayList<ModelVenda> getListaVendasDAO(){\n ArrayList<ModelVenda> listamodelVendas = new ArrayList();\n ModelVenda modelVendas = new ModelVenda();\n try {\n this.conectar();\n this.executarSQL(\n \"SELECT \"\n + \"codigo_venda,\"\n + \"fk_cliente_venda,\"\n + \"data_venda,\"\n + \"valor_venda\"\n + \" FROM\"\n + \" venda\"\n + \";\"\n );\n\n while(this.getResultSet().next()){\n modelVendas = new ModelVenda();\n modelVendas.setCodigoVenda(this.getResultSet().getInt(1));\n modelVendas.setClienteVenda(this.getResultSet().getInt(2));\n modelVendas.setDataVenda(this.getResultSet().getDate(3));\n modelVendas.setValorVenda(this.getResultSet().getDouble(4));\n listamodelVendas.add(modelVendas);\n }\n }catch(Exception e){\n e.printStackTrace();\n }finally{\n this.fecharConexao();\n }\n return listamodelVendas;\n }", "@GetMapping(\"/list\")\n public List<Traveller> listTraveller() {\n List<Traveller> theTraveller = travelService.findAll();\n return theTraveller;\n }", "@Override\r\n\tpublic List<ManufacturersVO> k_getAll() {\n\t\treturn null;\r\n\t}", "public Stream<DynamicEntity> streamAllValuesOfvehicle() {\n return rawStreamAllValuesOfvehicle(emptyArray());\n }", "public List<ReservaEntity> getReservas() {\n LOGGER.log(Level.INFO, \"Inicia proceso de consultar todas las reservas\");\n // Note que, por medio de la inyección de dependencias se llama al método \"findAll()\" que se encuentra en la persistencia.\n List<ReservaEntity> reservas = persistence.findAllReservas();\n LOGGER.log(Level.INFO, \"Termina proceso de consultar todas las reservas\");\n return reservas;\n }", "List<Vehiculo>listar();", "@Override\n\tpublic String toString() {\n\t\treturn \"Vehicle [Id=\" + Id + \", Year=\" + Year + \", Make=\" + Make + \", Model=\" + Model + \"]\";\n\t}", "@Override\n\tpublic List<flightmodel> getflights() {\n\t\t\n\t\tSystem.out.println(\"heloo\"+repo.findAll());\n\t\treturn repo.findAll();\n\t}", "@Override\n\tpublic List<String> findCarModel() {\n\t\tList<String> carModelInfoList = chargeCarMapper.selectCarModelInfo();\n\t\treturn carModelInfoList;\n\t}", "@Override\n\tpublic ArrayList<Carpo> showAllCars() {\n\t\treturn inList.showAll();\n\t}", "List<Flight> findAllFlights();", "public List<VehicleMaintenance> getVehicleMaintenances() {\n return vehicleMaintenanceRepository.findAll();\n }", "@Override\r\n\tpublic List<IAutomatedVehicle> highSpeedCar() {\r\n\t\tList<IAutomatedVehicle> highSpeedCar = getHighSpeedVehicle(CAR);\r\n//\t\tIAutomatedVehicle auto;\r\n//\t\tint maxSpeed = Integer.MIN_VALUE;\r\n//\t\tfor (INonAutomatedVehicle vehicle : this.vehicleDatabase.get(CAR)) {\r\n//\t\t\tauto = (IAutomatedVehicle) vehicle;\r\n//\t\t\tif (auto.getMaxSpeed() > maxSpeed) {\r\n//\t\t\t\tmaxSpeed = auto.getMaxSpeed();\r\n//\t\t\t\thighSpeedCar.clear();\r\n//\t\t\t\thighSpeedCar.add(auto);\r\n//\t\t\t} else if (auto.getMaxSpeed() == maxSpeed) {\r\n//\t\t\t\thighSpeedCar.add(auto);\r\n//\t\t\t}\r\n//\t\t}\r\n//\t\tfor (INonAutomatedVehicle vehicle : this.vehicleDatabase.get(CAR)) {\r\n//\t\t\tauto = (IAutomatedVehicle) vehicle;\r\n//\t\t\tif (auto.getMaxSpeed() == maxSpeed) {\r\n//\t\t\t\thighSpeedCar.add(auto);\r\n//\t\t\t}\r\n//\t\t}\r\n\r\n\t\treturn highSpeedCar;\r\n\t}", "public List<Car> getCarsData() { return carsData; }", "public Collection<CarrierMasterDTO> getCarriers(CarrierParams cparams) throws Exception;", "public List<vacante> cargarvacante() {\n\t\treturn vacantesrepo.findAll();\n\t}", "public Entity getVehicle ( ) {\n\t\treturn extract ( handle -> handle.getVehicle ( ) );\n\t}", "@RequestMapping(value = \"/obtenerVeredas\", method = RequestMethod.GET)\n\tpublic Iterable<Vereda> obtenerListaVeredas() {\n\t\treturn veredaRepository.findAll();\n\t\t//return JsonManager.toJson(veredaRepository.findAll());\n\t}", "List<VoziloDto> sveVozila();", "public List<Robot> getRobots();", "public void sortVehicles() {\n\t\tCollections.sort(vehicles);\n\t\t\n\t}" ]
[ "0.8054036", "0.78666985", "0.7687211", "0.7663044", "0.7584697", "0.7575918", "0.7552315", "0.75416607", "0.7494376", "0.7480626", "0.73097235", "0.7294508", "0.7223466", "0.7222576", "0.719676", "0.718391", "0.69713074", "0.6900594", "0.6828146", "0.679013", "0.67868996", "0.6735886", "0.6717654", "0.67134637", "0.67123264", "0.6682316", "0.6655052", "0.66364825", "0.6604587", "0.6594097", "0.6580772", "0.65200573", "0.6496424", "0.6485348", "0.6320237", "0.63198704", "0.63084334", "0.6307472", "0.63024026", "0.630022", "0.6283868", "0.62791795", "0.62545025", "0.6245966", "0.62435484", "0.62372893", "0.6236933", "0.62276405", "0.6198359", "0.6198249", "0.61919254", "0.61780024", "0.6177861", "0.6158328", "0.6151775", "0.6146254", "0.61397433", "0.61390066", "0.61291987", "0.61163855", "0.6103282", "0.609521", "0.6062689", "0.60452366", "0.604455", "0.6036113", "0.60221493", "0.6002632", "0.59604305", "0.5958003", "0.5951981", "0.59337443", "0.5915718", "0.5915334", "0.59059143", "0.590382", "0.58877754", "0.58764523", "0.5875997", "0.58466613", "0.58403254", "0.5838113", "0.58283126", "0.582407", "0.5815455", "0.5814514", "0.57838845", "0.578189", "0.57798487", "0.57784003", "0.5773504", "0.5773496", "0.57725465", "0.57596004", "0.57432204", "0.57212234", "0.5707195", "0.5705762", "0.57033396", "0.5698634" ]
0.82038647
0
calls the insert business logic for Vehicle
public void addVehicle() { currentInstance = FacesContext.getCurrentInstance(); FacesMessage message = null; try { vehicleService.insert(vehic); message = new FacesMessage(FacesMessage.SEVERITY_INFO,"Saved","Vehicle Saved"); } catch (Exception e) { message = new FacesMessage(FacesMessage.SEVERITY_ERROR,"Failed","Vehicle Failed to be Saved: " + e.getMessage()); } currentInstance.addMessage(null, message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void insert(Vehicle v) {\n\t\ttry {\n\t\t\tint modelID = VehicleModelDAOImpl.getInstance()\n\t\t\t\t\t.getAll()\n\t\t\t\t\t.parallelStream()\n\t\t\t\t\t.filter(m-> m.getDescription().equals(v.getModel()))\n\t\t\t\t\t.findFirst()\n\t\t\t\t\t.get()\n\t\t\t\t\t.getModelID();\n\n\t\t\tint categoryID = VehicleCategoryDAOImpl.getInstance()\n\t\t\t\t\t.getAll()\n\t\t\t\t\t.parallelStream()\n\t\t\t\t\t.filter(c->c.getDescription().equals(v.getType()))\n\t\t\t\t\t.findFirst()\n\t\t\t\t\t.get()\n\t\t\t\t\t.getCategoryID();\n\n\n\t\t\tPreparedStatement st = Database.getInstance().getDBConn().prepareStatement(\"INSERT INTO vehicle(vehicle_ID,plate_number,mv_number,engine_number,chassis_number,model_ID,category_ID,status,image) VALUES(?,?,?,?,?,?,?,?,?)\");\n\t\t\t\n\t\t\tst.setString(1, v.getPlateNumber());\n\t\t\tst.setString(2, v.getMvNumber());\n\t\t\tst.setString(3, v.getEngineNumber());\n\t\t\tst.setString(4, v.getChassisNumber());\n\t\t\tst.setInt(5, modelID);\n\t\t\tst.setInt(6, categoryID);\n\t\t\tst.setString(7, v.getStatus());\n//\t\t\tst.setBlob(8, v.getImage());\n\t\t\tst.executeUpdate();\n\t\t\t\n\t\t\tst.close();\n\t\t} catch(Exception err) {\n\t\t\terr.printStackTrace();\n\t\t}\n\t}", "@Override\n\tpublic void insert(RaceZipTbVo vo) throws SQLException {\n\t\t\n\t}", "int insert(HotelType record);", "int insert(SrHotelRoomInfo record);", "int insert(TVmManufacturer record);", "public void insertNewVehicle(ShopGood vehicle) throws SQLException {\n int type = 0;\n String ability = new String();\n if(vehicle.getName().contains(\"Freezer\")) type = 1;\n if(vehicle.getName().contains(\"Fuel\")) type = 2;\n if(vehicle.getName().contains(\"Chemical\")) type = 3;\n if(vehicle.getName().contains(\"Pallet\")) type = 4;\n if(vehicle.getName().contains(\"Super\")) type = 5;\n double speed = 1;\n //if(vehicle.getName().contains(\"Truck\")) speed = 1;\n if(vehicle.getName().contains(\"Ship\")) speed = 0.5;\n if(vehicle.getName().contains(\"Plane\")) speed = 2;\n if (type == 5) speed++;\n\n String query = \"INSERT INTO `vehicles`(`name`, `type`, `speed`) VALUES (\\\"\"+vehicle.getName()+\"\\\", \\\"\"+type+\"\\\", \\\"\"+speed+\"\\\")\";\n st.executeUpdate(query);\n }", "int insert(EquipmentOrder record);", "@Override\n\tpublic void insert(Vehicle v, File file) {\n\t\ttry {\n\t\t\tint modelID = VehicleModelDAOImpl.getInstance()\n\t\t\t\t\t.getAll()\n\t\t\t\t\t.parallelStream()\n\t\t\t\t\t.filter(m-> m.getDescription().equals(v.getModel()))\n\t\t\t\t\t.findFirst()\n\t\t\t\t\t.get()\n\t\t\t\t\t.getModelID();\n\n\t\t\tint categoryID = VehicleCategoryDAOImpl.getInstance()\n\t\t\t\t\t.getAll()\n\t\t\t\t\t.parallelStream()\n\t\t\t\t\t.filter(c->c.getDescription().equals(v.getType()))\n\t\t\t\t\t.findFirst()\n\t\t\t\t\t.get()\n\t\t\t\t\t.getCategoryID();\n\n\t\t\tFileInputStream fis = new FileInputStream(file);\n\t\t\t\n\t\t\tPreparedStatement st = Database.getInstance().getDBConn().prepareStatement(\"INSERT INTO vehicles(vehicle_ID,plate_number,mv_number,engine_number,chassis_number,model_ID,category_ID,encumbered_to,amount,maturity_date,status,image) VALUES(?,?,?,?,?,?,?,?,?,?,?,?)\");\n\t\t\t\n\t\t\tst.setInt(1, v.getVehicleID());\n\t\t\tst.setString(2, v.getPlateNumber());\n\t\t\tst.setString(3, v.getMvNumber());\n\t\t\tst.setString(4, v.getEngineNumber());\n\t\t\tst.setString(5, v.getChassisNumber());\n\t\t\tst.setInt(6, modelID);\n\t\t\tst.setInt(7, categoryID);\n\t\t\tst.setString(8, v.getEncumberedTo());\n\t\t\tst.setDouble(9, v.getAmount());\n\t\t\tst.setString(10, v.getMaturityDate().toString());\n\t\t\tst.setString(11, v.getStatus());\n\t\t\tst.setBinaryStream(12, (InputStream) fis, (int)file.length());\n\t\t\tst.executeUpdate();\n\t\t\t\n\t\t\tst.close();\n\t\t} catch(Exception err) {\n\t\t\terr.printStackTrace();\n\t\t}\n\t}", "int insert(TblMotherSon record);", "@Override\r\n\tpublic void insert(BbsDto dto) {\n\t}", "int insert(TbSerdeParams record);", "@Override\n\tpublic void Insert(PersonelContract entity) {\n\n\t}", "int insert(OrderDetail record);", "int insert(Tour record);", "int insert(InspectionAgency record);", "int insert(Tourst record);", "public void insertBooking(Booking booking) throws SQLException, Exception;", "int insert(OrderDetails record);", "@Override\n\tpublic void insert(UserFlight userFlight) {\n\t\t\n\t}", "int insert(Depart record);", "int insert(Cargo record);", "int insert(BasicEquipment record);", "int insertSelective(SrHotelRoomInfo record);", "public void insertReservation(TestDto testDto) throws Exception;", "int insert(TBBearPer record);", "public void insert(Object item)\n\t{\n\t\tif(item instanceof Journey)\n\t\t{\n\t\t\tJourney tmp = (Journey) item;\n\t\t\t\n\t\t\t/* Insertion dans la table Journey */\n\t\t\tContentValues toAdd = new ContentValues();\n\t\t\ttoAdd.put(DBContract.JourneyTable.DATE[0], df.format(tmp.getDate()));\n\t\t\ttoAdd.put(DBContract.JourneyTable.ROADNAME[0], tmp.getRoad().getName());\n\n\t\t\tlong id = mainDatabase.insert(DBContract.JourneyTable.TABLE_NAME, null, toAdd);\n\t\t\tif(id==-1)\n\t\t\t{\n\t\t\t\tLog.e(\"error\", \"Error while inserting new Journey in database\");\n\t\t\t}\n\t\t\t\n\t\t\t/* Insertion dans la table JourenyxContacts */\n\t\t\ttoAdd.clear();\n\t\t\tlong retval;\n\t\t\tfor(Contact contact:tmp.getContact())\n\t\t\t{\n\t\t\t\ttoAdd.put(DBContract.JourneyContactTable.JOURNEY_ID[0], id);\n\t\t\t\ttoAdd.put(DBContract.JourneyContactTable.CONTACT_ID[0], contact.getId());\n\t\t\t\t//TODO Debug print\n\t\t\t\tLog.i(\"info\", \"Inserted Journey id : \" + id);\n\t\t\t\tLog.i(\"info\", \"Inserted Contact id : \" + contact.getId());\n\t\t\t\tretval = mainDatabase.insert(DBContract.JourneyContactTable.TABLE_NAME, null, toAdd);\n\t\t\t\tif(retval==-1)\n\t\t\t\t{\n\t\t\t\t\tLog.e(\"error\", \"Error while inserting the Journey\" + id + \"in database\");\n\t\t\t\t}\n\t\t\t\ttoAdd.clear();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(item instanceof Contact)\n\t\t{\n\t\t\tContact tmp = (Contact) item;\n\t\t\t\n\t\t\t/* Insertion dans la table Contact */\n\t\t\tContentValues toAdd = new ContentValues();\n\t\t\ttoAdd.put(DBContract.ContactTable.NAME[0], tmp.getName());\n\t\t\ttoAdd.put(DBContract.ContactTable.SURNAME[0], tmp.getFirstName());\n\t\t\ttoAdd.put(DBContract.ContactTable.BILL[0], tmp.getbill());\n\t\t\t\n\t\t\tlong id = mainDatabase.insert(DBContract.ContactTable.TABLE_NAME, null, toAdd);\n\t\t\tif(id==-1)\n\t\t\t{\n\t\t\t\tLog.e(\"error\", \"Error while inserting new Contact in database\");\n\t\t\t}\n\t\t\t\n\t\t\t/* Mise a jour du contact */\n\t\t\ttmp.setId(id);\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tString command = insertCommand(item);\n\t\tif(command == null)\n\t\t{\n\t\t\tLog.e(\"error\", \"Trying to insert non database compliant object !\");\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t\tmainDatabase.execSQL(command);\n\t}", "public boolean createVehicle(Vehicle incomingVehicle){\n if(incomingVehicle.isWellFormed()){\n try {\n incomingVehicle.save();\n return true;\n } catch (ParseException ex) {\n String message = \"VehicleParseEngine - We failed to create the Vehicle!\";\n Logger.getLogger(MotoLogEngine.class.getName()).log(Level.SEVERE, message, ex);\n return false;\n } \n }else{\n String message = \"VehicleParseEngine - Vehicle object was not well formed, not creating vehicle!\";\n Logger.getLogger(MotoLogEngine.class.getName()).log(Level.WARNING, message);\n return false;\n }\n }", "int insert(UcOrderGuestInfo record);", "int insert(Sequipment record);", "int insert(MVoucherDTO record);", "int insert(Pet record);", "int insertSelective(HotelType record);", "int insert(CityDO record);", "public void insert(VRpDyHlrforbe record) {\r\n getSqlMapClientTemplate().insert(\"V_RP_DY_HLR_FOR_BE.ibatorgenerated_insert\", record);\r\n }", "int insert(AccessModelEntity record);", "int insert(OcCustContract record);", "public void insert()\n\t{\n\t}", "public static boolean insertVehicle(String vehicle_no, String manufacture_year, float mileage, String model, String make, String fuel_type, String transmission, String technology, int userID) {\r\n\t\t\t\r\n\t\ttry {\r\n\t\t\t//Database connection\r\n\t\t\tcon = DBConnect.getConnection();\r\n\t\t\tstmt = con.createStatement();\r\n\t\t\t\t\r\n\t\t\t//insert query\r\n\t\t\tString sql = \"insert into vehicle values (0,'\"+vehicle_no+\"','\"+manufacture_year+\"','\"+mileage+\"','\"+model+\"','\"+make+\"','\"+fuel_type+\"','\"+transmission+\"','\"+technology+\"','\"+userID+\"')\";\r\n\t\t\t//execute query\r\n\t\t\tint rs= stmt.executeUpdate(sql);\r\n\t\t\t\r\n\t\t\t//checking if the data is entered\r\n\t\t\tif(rs > 0)\r\n\t\t\t\tisSuccess = true;\r\n\t\t\telse\r\n\t\t\t\tisSuccess = false;\r\n\t\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\t\r\n\t\treturn isSuccess;\r\n\t}", "int insert(DashboardGoods record);", "@Override\n\tpublic void dbInsert(MovementModel model)\tthrows DAOSysException {\n\t\tdbInsert(model, MovementDAO.INSERT_STM);\n\t}", "public void addDataToUserVehicle(DataBaseHelper dataBaseHelper) {\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(KEY_VEHICLE_ID_ODOO, dataBaseHelper.get_vehicle_id());\n values.put(KEY_BRAND_NAME, dataBaseHelper.get_brand_name());\n values.put(KEY_BRAND_ID, dataBaseHelper.get_brand_id_no());\n values.put(KEY_MODEL_NAME, dataBaseHelper.get_model_name());\n values.put(KEY_MODEL_ID, dataBaseHelper.get_model_id_no());\n values.put(KEY_LICENSE_PLATE, dataBaseHelper.get_license_plate());\n values.put(KEY_IMAGE_BASE64, dataBaseHelper.get_image_base64());\n values.put(KEY_MODEL_YEAR, dataBaseHelper.get_model_year());\n values.put(KEY_INSURANCE, dataBaseHelper.get_insurance_info());\n values.put(KEY_INSURANCE_ID, dataBaseHelper.get_insurance_id());\n values.put(KEY_EMISSION, dataBaseHelper.get_emission_info());\n values.put(KEY_EMISSION_ID, dataBaseHelper.get_emission_id());\n values.put(KEY_RCFC, dataBaseHelper.get_rcfc_info());\n values.put(KEY_RCFC_ID, dataBaseHelper.get_rcfc_id());\n values.put(KEY_SERVICE, dataBaseHelper.get_service_info());\n values.put(KEY_SERVICE_ID, dataBaseHelper.get_service_id());\n // Inserting Row\n //db.insert(TABLE_RECENT, null, values);\n db.insert(USER_VEHICLE_TABLE, null, values);\n\n db.close(); // Closing database connection\n }", "int insert(TdxCompanyTaxArrears record);", "public void insertClient(ClientVO clientVO);", "int insert(BusinessRepayment record);", "void insertBooking(detailDTO detail) throws DataAccessException;", "int insert(ParkCurrent record);", "int insert(DebtsRecordEntity record);", "int insert(BusnessOrder record);", "private void insertFields()\n {\n RideDetails details=new RideDetails();\n details.setStartPt(editStartingPt.getText().toString());\n details.setEndPt(editEndingPt.getText().toString());\n\n try {\n details.setTravelDate(dateFormatter.parse(editDate.getText().toString()));\n\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n details.setNoSpot(Integer.parseInt(editNoSpot.getText().toString()));\n\n\n dbOperations(details);\n\n }", "public void insert(TdiaryArticle obj) throws SQLException {\n\r\n\t}", "int insert(GoodsPo record);", "int insert(Goods record);", "private void insertPerform(){\n \tif(!verify()){\n \t\treturn;\n \t}\n \tString val=new String(\"\");\n \tval=val+\"'\"+jTextField1.getText()+\"', \"; // poNo\n \tval=val+\"'\"+\n \t\tinventorycontroller.util.DateUtil.getRawFormat(\n \t\t\t(java.util.Date)jXDatePicker1.getValue()\n \t\t)\n \t\t+\"', \"; // poDate\n \tval=val+\"'\"+vndList[jTextField2.getSelectedIndex()-1]+\"', \"; // vndNo\n \tval=val+\"'\"+jTextField3.getText()+\"', \"; // qtnNo\n \tval=val+\"'\"+\n \t\tinventorycontroller.util.DateUtil.getRawFormat(\n \t\t\t(java.util.Date)jXDatePicker2.getValue()\n \t\t)\n \t\t+\"', \"; // qtnDate\n \tval=val+\"'\"+poAmount+\"', \"; // poTotal\n \tval=val+\"'pending', \"; // poStatus\n \tval=val+\"'\"+jEditorPane1.getText()+\"' \"; // remark\n \t\n \ttry{\n \t\tdbInterface1.cmdInsert(\"poMaster\", val);\n \t\tinsertPoBomDesc();\n \t\tinsertPoDesc();\n\t \tupdateBOM();\n \t}\n \tcatch(java.sql.SQLException ex){\n \t\tSystem.out.println (ex);\n \t}\n \tresetPerform();\n }", "int insert(MedicalOrdersExecutePlan record);", "void insert(OrderPreferential record) throws SQLException;", "int insert(WizardValuationHistoryEntity record);", "int insert(TbCities record);", "@Override\r\n\tpublic void insert(CompanyBoardVO vo) throws Exception {\n\t\tdao.insert(vo);\r\n\t}", "int insert(FinancialManagement record);", "int insertSelective(EquipmentOrder record);", "int insert(Model record);", "void insert(organize_infoBean record);", "int insert(Computer record);", "@Override\n\tpublic void insertProduct(ProductVO dto) {\n\n\t}", "int insert(CompanyExtend record);", "public void addVehicle(Vehicle vehicle) {\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(COLUMN_VEHICLE_NAME, vehicle.getName());\n values.put(COLUMN_VEHICLE_NUMBER, vehicle.getNumber());\n values.put(COLUMN_VEHICLE_CC, vehicle.getCc());\n values.put(COLUMN_VEHICLE_YEAR, vehicle.getYear());\n values.put(COLUMN_VEHICLE_TYPE, vehicle.getType());\n values.put(COLUMN_VEHICLE_FUEL, vehicle.getFuel());\n values.put(COLUMN_VEHICLE_CATEGORY, vehicle.getCategory());\n values.put(COLUMN_VEHICLE_DATE, vehicle.getDate());\n\n // Inserting Row\n db.insert(TABLE_VEHICLE, null, values);\n db.close();\n }", "int insert(ProcurementSource record);", "int insertSelective(UcOrderGuestInfo record);", "int insertSelective(Depart record);", "public void insertMobil(MobilModel mobil) throws SQLException;", "int insertSelective(MVoucherDTO record);", "void insertFlightseat(AirFlightseat dRef);", "@Override\r\n public void newTransaction(int vehicleID, int customerID, int employeeID, int locationID, String date) {\n transactionDao.newTransaction(vehicleID, customerID, employeeID, locationID, date); \r\n }", "int insert(PersonRegisterDo record);", "public void insert(VRpHrStp record) {\r\n getSqlMapClientTemplate().insert(\"V_RP_HR_STP.ibatorgenerated_insert\", record);\r\n }", "int insert(Drug_OutWarehouse record);", "public void insert(AlManageOnAir record) {\r\n getSqlMapClientTemplate().insert(\"AL_MANAGE_ON_AIR.ibatorgenerated_insert\", record);\r\n }", "public void insert(ActorDto record) {\n getSqlMapClientTemplate().insert(\"HR_ACTOR.ibatorgenerated_insert\", record);\n }", "void insert(Customer customer);", "int insert(UploadStateRegDTO record);", "public void insert(BusiTagBean record) {\n }", "int insert(SpecialCircumstance record);", "int insert(NjProductTaticsRelation record);", "int insertSelective(TVmManufacturer record);", "int insert(HospitalType record);", "int insert(DO_Merchants record);", "public void insertBooking(){\n \n Validator v = new Validator();\n if (createBookingType.getValue() == null)\n {\n \n Dialogs.create()\n .owner(prevStage)\n .title(\"Error!\")\n .masthead(null)\n .message(\"Set Booking Type!\")\n .showInformation();\n \n return;\n \n }\n if (createBookingType.getValue().toString().equals(\"Repair\"))\n Dialogs.create()\n .owner(prevStage)\n .title(\"Error!\")\n .masthead(null)\n .message(\"Go to Diagnosis and Repair tab for creating Repair Bookings!\")\n .showInformation();\n \n \n if(v.checkBookingDate(parseToDate(createBookingDate.getValue(),createBookingTimeStart.localTimeProperty().getValue()),\n parseToDate(createBookingDate.getValue(),createBookingTimeEnd.localTimeProperty().getValue()))\n && customerSet)\n \n { \n \n int mID = GLOBAL.getMechanicID();\n \n try {\n mID = Integer.parseInt(createBookingMechanic.getSelectionModel().getSelectedItem().toString().substring(0,1));\n } catch (Exception ex) {\n Dialogs.create()\n .owner(prevStage)\n .title(\"Error!\")\n .masthead(null)\n .message(\"Set Mechanic!\")\n .showInformation();\n return;\n }\n \n if (mID != GLOBAL.getMechanicID())\n if (!getAuth(mID)) return;\n \n createBookingClass();\n dbH.insertBooking(booking);\n booking.setID(dbH.getLastBookingID());\n appointment = createAppointment(booking);\n closeWindow();\n \n }\n else\n {\n String extra = \"\";\n if (!customerSet) extra = \" Customer and/or Vehicle is not set!\";\n Dialogs.create()\n .owner(prevStage)\n .title(\"Error!\")\n .masthead(null)\n .message(\"Errors with booking:\"+v.getError()+extra)\n .showInformation();\n }\n \n }", "public void insert() throws SQLException;", "@Override\r\n\tpublic void review_insert(ReviewDTO dto) throws Exception {\n\r\n\t}", "int insertSelective(BusnessOrder record);", "int insertSelective(InspectionAgency record);", "int insert(StudentEntity record);", "int insert(TycCompanyCheckCrawler record);", "public void insert(HRouter record) {\r\n getSqlMapClientTemplate().insert(\"H_ROUTER.ibatorgenerated_insert\", record);\r\n }", "@Override\r\n\t@Transactional\r\n\tpublic void doService() {\n\t\tTbookingrecord booking = new Tbookingrecord();\r\n\t\tbooking.setId(Long.valueOf(31622L));\r\n\t\tbooking.setInstrumentid(2);\r\n\t\tbooking.setUserid(3);\r\n\t\tmappper.insertSelective(booking);\r\n\t\tlogger.debug(booking);\r\n\t\t//int i = 1/0;\r\n\t}", "public void insert() {\n\t\tSession session = DBManager.getSession();\n\t\tsession.beginTransaction();\n\t\tsession.save(this);\n\t\tsession.getTransaction().commit();\n\t}", "public void insert(VRpDyTrxTotal record) {\r\n getSqlMapClientTemplate().insert(\"V_RP_DY_TRX_TOTAL.ibatorgenerated_insert\", record);\r\n }", "int insert(DepAcctDO record);", "int insertSelective(Tour record);", "int insert(RepaymentPlanInfoUn record);" ]
[ "0.7401866", "0.6775261", "0.6754372", "0.6590375", "0.65744096", "0.6556977", "0.6528715", "0.64897704", "0.64638245", "0.6439559", "0.6423027", "0.640482", "0.63697773", "0.63592345", "0.6357383", "0.6355567", "0.63489753", "0.6342227", "0.63236916", "0.63230103", "0.6318277", "0.63098824", "0.6308304", "0.63000035", "0.6287712", "0.6282374", "0.627756", "0.62687767", "0.62673485", "0.6265478", "0.6259583", "0.6246877", "0.6245878", "0.6242341", "0.62254775", "0.62203467", "0.6207203", "0.6205227", "0.61954665", "0.6193865", "0.6182121", "0.6177574", "0.61695755", "0.6167081", "0.61659825", "0.6161219", "0.6157477", "0.61549", "0.6152462", "0.61500895", "0.6136826", "0.6132508", "0.612686", "0.61252177", "0.6118351", "0.61159825", "0.61132455", "0.61091423", "0.6101085", "0.60902035", "0.6081021", "0.60716057", "0.6070694", "0.6067723", "0.60665345", "0.6053533", "0.6053433", "0.60492396", "0.6040306", "0.60398084", "0.60387033", "0.60377634", "0.6036784", "0.60352784", "0.60333693", "0.6031958", "0.60309136", "0.60297287", "0.6024094", "0.6021082", "0.60160756", "0.6012664", "0.60089076", "0.600505", "0.60015804", "0.6001041", "0.5999188", "0.59954", "0.59947705", "0.59946394", "0.59927166", "0.5992631", "0.59893525", "0.5988555", "0.59880525", "0.59862936", "0.59846216", "0.59792995", "0.5973163", "0.59716827" ]
0.6263559
30
call update of DB
public void onRowEdit(RowEditEvent event) { currentInstance = FacesContext.getCurrentInstance(); FacesMessage msg = null; Vehicle editedVehic = (Vehicle)event.getObject(); try { vehicleService.update(editedVehic); msg = new FacesMessage("Truck Edited", Integer.toString(((Vehicle)event.getObject()).getId())); } catch (Exception e) { msg = new FacesMessage(FacesMessage.SEVERITY_ERROR,"Failed","Vehicle Failed to be Updated: " + e.getMessage()); } FacesContext.getCurrentInstance().addMessage(null, msg); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void updateDB() {\n }", "public void executeUpdate();", "void executeUpdate();", "public abstract int execUpdate(String query) ;", "public abstract void updateDatabase();", "@Override\r\n\tpublic void update() throws SQLException {\n\r\n\t}", "public void executeUpdate(String request) {\n try {\r\n st.executeUpdate(request);\r\n } catch (SQLException ex) {\r\n Logger.getLogger(Database.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "@Override\n\tpublic void update(DatabaseHandler db) {\n\t\tdb.updateWork(this);\n\t}", "public void update(){}", "public void update(){}", "public void dbUpdate(String query) {\n try {\n tryDbUpdate(query);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "Account.Update update();", "@Override\n\tpublic void update() {\n\t\tSystem.out.println(\"Mysql DB 서버에 접속해서 수정을 하다.\");\n\t}", "@Override\r\n\tpublic void update(Botany botany) {\n\t\tdao.update(botany);\r\n\t}", "@Test\n public void test() throws Exception{\n update(\"update user set username=? where id=?\",\"wangjian\",\"4\");\n }", "Integer update(final String sql);", "int executeUpdate() throws SQLException;", "@Override\n public void updateDatabase() {\n }", "public void update() {\n\t\tSession session = DBManager.getSession();\n\t\tsession.beginTransaction();\n\t\tsession.update(this);\n\t\tsession.getTransaction().commit();\n\t}", "@Override\n\tpublic void update(String query) {\n\t\ttry {\n\t\t\tStatement st = Database.getInstance().getDBConn().createStatement();\n\t\t\tst.executeUpdate(query);\n\t\t\t\n\t\t\tst.close();\n\t\t} catch(Exception err) {\n\t\t\terr.printStackTrace();\n\t\t}\n\t}", "int updateByPrimaryKey(Yqbd record);", "public void editar(String update){\n try {\n Statement stm = Conexion.getInstancia().createStatement();\n stm.executeUpdate(update);\n }\n catch (Exception ex){\n ex.printStackTrace();\n }\n }", "public void update(String expression) {\r\n \t\tStatement st = null;\r\n \t\ttry {\r\n \t\t\tst = conn.createStatement();\r\n \t\t\tint i = st.executeUpdate(expression); // run the query\r\n \t\t\tif (i == -1) {\r\n \t\t\t\tSystem.out.println(\"db error : \" + expression);\r\n \t\t\t}\r\n \r\n \t\t} catch (SQLException e) {\r\n \t\t\te.printStackTrace();\r\n \t\t} finally {\r\n \t\t\ttry {\r\n \t\t\t\tst.close();\r\n \t\t\t} catch (SQLException e) {\r\n \t\t\t\te.printStackTrace();\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t}", "int updateByPrimaryKey(FctWorkguide record);", "int updateByPrimaryKey(Admin record);", "int updateByPrimaryKey(Admin record);", "Update createUpdate();", "int updateByPrimaryKey(GirlInfo record);", "void executeUpdate(String noParamQuery, Connection conn);", "public void attemptToUpdate();", "int update(Purchase purchase) throws SQLException, DAOException;", "int updateByPrimaryKey(TbComEqpModel record);", "int updateByPrimaryKey(Forumpost record);", "public void updateDB() {\n \n sql = \"UPDATE Order set \" + \"CustomerID='\"+getCustomerID()+\"',\" + \" Status='\"+getStatus()+\"'\" + \" WHERE OrderID= '\" + getOrderID()+\"'\";\n db.updateDB(sql);\n \n }", "@Override\n\tpublic int update(Object obj) throws SQLException {\n\t\treturn 0;\n\t}", "public void update(Triplet t) throws DAOException;", "int updateByPrimaryKey(Caiwu record);", "int updateByPrimaryKey(Assist_table record);", "int updateByPrimaryKey(Online record);", "int updateByPrimaryKey(Commet record);", "int updateByPrimaryKey(CodeBuildProcedure record);", "void update(EmployeeDetail detail) throws DBException;", "int updateByPrimaryKey(AccessModelEntity record);", "public void update(ScahaDatabase _db) throws SQLException {\n\t\t// Lets update the person here.\r\n\t\t//\r\n\t\tsuper.update(_db);\r\n\t\t\r\n\t\t//\r\n\t\t// now.. we have to update the pertinat parts of the player table \r\n\t\t// to add the player extension data..\r\n\t\t\r\n\t\t// \r\n\t\t// is it an object that is not in the database yet..\r\n\t\t//\r\n\t\t//\r\n\t\tCallableStatement cs = _db.prepareCall(\"call scaha.updateManager(?,?,?,?)\");\r\n\t\t\r\n\t\t//LOGGER.info(\"HERE IS THE PERSON ID for manager:\" + super.ID);\r\n\t\t//LOGGER.info(\"HERE IS THE manager ID for manager:\" + this.ID);\r\n\t\t\r\n\t\tint i = 1;\r\n\t\tcs.registerOutParameter(1, java.sql.Types.INTEGER);\r\n\t\tcs.setInt(i++, this.ID);\r\n\t\tcs.setInt(i++, super.ID);\r\n\t\tcs.setInt(i++,1);\r\n\t\tcs.setString(i++,null);\r\n\t\tcs.execute();\r\n\t\t\t\t\r\n\t\t//\r\n\t\t// Update the new ID from the database...\r\n\t\t//\r\n\t\tthis.ID = cs.getInt(1);\r\n\t\tcs.close();\r\n\t\t//LOGGER.info(\"HERE IS THE New Manager ID:\" + this.ID);\r\n\t\t\r\n\t}", "int updateByPrimaryKey(JzAct record);", "int updateByPrimaryKey(Engine record);", "@Override\r\n\tpublic void update(Object obj) throws DAOException {\n\r\n\t}", "@Override\n\tpublic void queryUpdate() {\n\t\tneedToUpdate = true;\n\t}", "int updateByPrimaryKey(TempletLink record);", "@Override\n\tpublic void update(StockDataRecord bo) throws SQLException {\n\t\t\n\t}", "int updateByPrimaryKey(Access record);", "int updateByPrimaryKey(FileRecordAdmin record);", "@Override\n public void doUpdate(FasciaOrariaBean bean) throws SQLException {\n Connection con = null;\n PreparedStatement statement = null;\n String sql = \"UPDATE fasciaoraria SET fascia=? WHERE id=?\";\n try {\n con = DriverManagerConnectionPool.getConnection();\n statement = con.prepareStatement(sql);\n statement.setString(1, bean.getFascia());\n statement.setInt(2, bean.getId());\n System.out.println(\"doUpdate=\" + statement);\n statement.executeUpdate();\n con.commit();\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n\n try {\n\n statement.close();\n DriverManagerConnectionPool.releaseConnection(con);\n\n } catch (SQLException e) {\n\n e.printStackTrace();\n }\n }\n }", "public synchronized void update(String expression) throws SQLException {\n\n Statement st = null;\n\n st = conn.createStatement(); // statements\n\n int i = st.executeUpdate(expression); // run the query\n\n if (i == -1) {\n System.out.println(\"db error : \" + expression);\n }\n\n st.close();\n }", "int updateByPrimaryKey(Ltsprojectpo record);", "int updateByPrimaryKey(DataSync record);", "int updateByPrimaryKey(AdminTab record);", "@Override\n\tpublic void dbUpdate(MovementModel data, String updateStm)\tthrows DAOSysException {\n//\t\tMovementModel model = data;\n//\t\tConnection connection = null;\n//\t\tPreparedStatement preparedStm = null;\n//\t\ttry\t{\n//\t\t\tconnection = connectToDB();\n//\t\t\tpreparedStm = connection.prepareStatement(updateStm);\n//\n//\t\t\t/*\tGrab values from persistent fields to store in database\t*/\n//\t\t\tpreparedStm.setString(1, model.getComposer());\n//\n// \t\t\tint rowCount = preparedStm.executeUpdate();\n//\t\t\tif (rowCount == 0)\t{\n// \t\t\t\tthrow new DAOSysException(\n// \t\t\t\t\t\"Failed to store state for Movement <\"\n// \t\t\t\t\t+ model.getCompostionName() + \">\");\n// \t\t\t}\n//\n//\t\t}\tcatch (SQLException sex)\t{\n//\t\t\tthrow new DAOSysException(\n//\t\t\t\t\t\"dbUpdate() SQL Exception <\"\n//\t\t\t\t\t+ sex.getMessage() + \">\");\n//\n//\t\t}\tfinally\t{\n//\t\t\ttry\t{\n//\t\t\t\treleaseAll(null, preparedStm, connection);\n//\t\t\t} catch (Exception ex)\t{\n//\t\t\t\tSystem.err.println(\"Error releasing resources <\" + ex.toString());\n//\t\t\t}\n//\t\t}\n\t}", "int updateByPrimaryKey(FunctionInfo record);", "int updateByPrimaryKey(Tourst record);", "int updateByPrimaryKey(SupplyNeed record);", "private ServerError updateDatabase() {\n return updateDatabase(WebConf.DB_CONN, WebConf.JSON_OBJECTS, WebConf.DEFAULT_VERSION);\r\n }", "int updateByPrimaryKey(Abum record);", "public int Editcomp(Long comp_id, String compname, String address, String city,\r\n\t\tString state, Long offno, Long faxno, String website, String e_mail) throws SQLException {\nint i =DbConnect.getStatement().executeUpdate(\"update company set address='\"+address+\"',city='\"+city+\"',state='\"+state+\"',offno=\"+offno+\",faxno=\"+faxno+\",website='\"+website+\"',email='\"+e_mail+\"'where comp_id=\"+comp_id+\" \");\r\n\treturn i;\r\n}", "public int req(Long req_id)throws SQLException {\nint i=DbConnect.getStatement().executeUpdate(\"update requested set status='processed',remark='bought fail' where reqid=\"+req_id+\"\");\t\r\n\treturn i;\r\n}", "int updateByPrimaryKey(SysCode record);", "int updateByPrimaryKey(BaseCountract record);", "@Test\r\n\tpublic void testUpdate() {\r\n\t\tList<E> entities = dao.findAll();\r\n\t\tE updated = supplyUpdated(entities.get(0));\r\n\t\tdao.update(entities.get(0));\r\n\t\tentities = dao.findAll();\r\n\t\tassertEquals(updated, entities.get(0));\r\n\t}", "@Override\r\n\tpublic int do_update(DTO dto) {\n\t\treturn 0;\r\n\t}", "int updateByPrimaryKey(DashboardGoods record);", "int updateByPrimaryKey(Prueba record);", "int updateByPrimaryKey(Dress record);", "int updateByPrimaryKey(BnesBrowsingHis record) throws SQLException;", "int updateByPrimaryKey(NjOrderWork2 record);", "int updateByPrimaryKey(IceApp record);", "int updateByPrimaryKey(TCar record);", "int updateByPrimaryKey(TCpySpouse record);", "int updateByPrimaryKey(Basicinfo record);", "public void executeUpdate(String query) {\n \ttry {\n\t\t\tst.executeUpdate(query);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n }", "public void updateEntity();", "public void update(T t) {\n\t\tConnection connection = null;\n\t\tPreparedStatement statement = null;\n\t\tString query = createUpdate(t);\n\t\ttry {\n\t\t\tconnection = ConnectionDB.getConnection();\n\t\t\tstatement = connection.prepareStatement(query);\n\t\t\tstatement.executeUpdate();\n\t\t} catch (SQLException e) {\n\t\t\tLOGGER.log(Level.WARNING, type.getName() + \"DAO:Update \" + e.getMessage());\n\t\t} finally {\n\t\t\tConnectionDB.close(statement);\n\t\t\tConnectionDB.close(connection);\n\t\t}\n\t}", "int updateByPrimaryKey(SysId record);", "public void doUpdate(T objectToUpdate) throws SQLException;", "public void update(TdiaryArticle obj) throws SQLException {\n\r\n\t}", "int updateByPrimaryKey(WayShopCateRoot record);", "public void executeUpdate(String sql) {\n\t\ttry {\n\t\t\tstm = connection.createStatement();\n\t\t\tstm.executeUpdate(sql);\n\t\t\tSystem.out.println(\"Database update complete.\");\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "int updateByPrimaryKey(Disease record);", "int updateByPrimaryKey(PrhFree record);", "@Test\n public void update2()\n {\n int zzz = getJdbcTemplate().update(\"UPDATE account SET NAME =?,money=money-? WHERE id =?\", \"ros\", \"100\", 2);\n System.out.println(zzz);\n }", "int updateByPrimaryKey(GoodsPo record);", "int updateByPrimaryKey(WechatDemo record);", "int updateByPrimaryKey(CptDataStore record);", "int updateByPrimaryKey(Model record);", "public Hoppy update(Hoppy hoppy) throws DataAccessException;", "int updateByPrimaryKey(Dormitory record);", "public int update(StoreFeedBack storeFeedBack);", "int updateByPrimaryKey(HomeWork record);", "int updateByPrimaryKey(CTelnetServers record);", "int updateByPrimaryKey(WxNews record);", "public void update() {\r\n\t\tCampLeaseDAO leaseDao = (CampLeaseDAO) getApplicationContext().getBean(\"leaseDaoBean\", CampLeaseDAO.class);\r\n\t\tleaseDao.update(this); // routine now uses leaseDao to get CampLease class\r\n\t}", "@Override\n\tpublic void update_in_DB() throws CouponSiteMsg \n\t{\n\t\t\n\t}" ]
[ "0.8026011", "0.7959713", "0.78027964", "0.71401876", "0.71211255", "0.7073581", "0.70301855", "0.6969903", "0.6933489", "0.6933489", "0.68580246", "0.6819979", "0.68051803", "0.67892915", "0.67840844", "0.67792237", "0.6775112", "0.6771827", "0.67595696", "0.67487466", "0.67441344", "0.67326474", "0.6709022", "0.6693965", "0.6684251", "0.6684251", "0.66799676", "0.6678489", "0.6673922", "0.6673591", "0.6671395", "0.66512895", "0.6630552", "0.6628796", "0.66245484", "0.66185844", "0.6616641", "0.6614005", "0.6611508", "0.66069233", "0.660323", "0.6603088", "0.6600484", "0.6600203", "0.6592976", "0.6587858", "0.65858716", "0.6575068", "0.6568927", "0.65650165", "0.656101", "0.6560346", "0.6554729", "0.6554064", "0.6553488", "0.6545046", "0.6539544", "0.6537573", "0.6535432", "0.6534181", "0.6532767", "0.65326136", "0.6532335", "0.6531066", "0.6529305", "0.6528491", "0.6528176", "0.65267724", "0.6511221", "0.65099496", "0.6508868", "0.6498029", "0.64942425", "0.649246", "0.64922965", "0.6490177", "0.6488988", "0.6488714", "0.6487119", "0.64832896", "0.6479487", "0.64771646", "0.6476198", "0.64715856", "0.6470996", "0.6466571", "0.6462141", "0.64617753", "0.6458946", "0.64563423", "0.64518046", "0.6451465", "0.6447761", "0.64435816", "0.64361787", "0.64348036", "0.64345956", "0.6429253", "0.6428931", "0.642559", "0.64248097" ]
0.0
-1
this method starts Appium server. Calls startAppiumServer method to start the session depending upon your OS.
public void invokeAppium() throws Exception { String OS = System.getProperty("os.name").toLowerCase(); try { startAppiumServer(OS); LOGGER.info("Appium server started successfully"); } catch (Exception e) { LOGGER.warn("Unable to start appium server"); throw new TapException(TapExceptionType.PROCESSING_FAILED, "Unable to start appium server"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void appiumStart() throws IOException, InterruptedException {\n // Execute command string to start appium server.\n p = Runtime.getRuntime().exec(cmd);\n // Provide wait time of 10 mins to start appium server properly.\n // If face any error(Could not start a new session...) then Increase\n // this time to 15 or 20 mins.\n Thread.sleep(10000);\n if (p != null) {\n System.out.println(\"Appium server Is started now.\");\n }\n }", "public static void startAppiumServer() throws IOException, InterruptedException {\n\n\tRuntime runtime = Runtime.getRuntime();\n\n\tprocess = runtime.exec(STARTSERVER);\n\n\tThread.sleep(7000);\n\n\tif (process != null) {\n\n\tSystem.out.println(\"Appium server started\");\n\n\t}\n\n\t}", "public static AppiumDriverLocalService AppiumServerStart(){\n System.out.println(\"Into driver setup\");\n AppiumDriverLocalService service;\n\n AppiumServiceBuilder serviceBuilder = new AppiumServiceBuilder();\n\n serviceBuilder.usingAnyFreePort();\n // /usr/local/bin/node\n serviceBuilder.usingDriverExecutable(new File(\"/usr/local/bin/node\"));\n // /usr/local/bin/appium\n serviceBuilder.withAppiumJS(new File(\"/usr/local/bin/appium\"));\n serviceBuilder.withArgument(GeneralServerFlag.RELAXED_SECURITY);\n serviceBuilder.withArgument(GeneralServerFlag.SHELL);\n HashMap<String, String> environment = new HashMap();\n environment.put(\"PATH\", \"/usr/local/bin:\" + System.getenv(\"PATH\"));\n\n\n service = AppiumDriverLocalService.buildService(serviceBuilder);\n service.start();\n return service;\n }", "public void startAppiumServer(String os) throws ExecuteException, IOException, InterruptedException {\n if (os.contains(\"windows\")) {\n CommandLine command = new CommandLine(\"cmd\");\n command.addArgument(\"/c\");\n command.addArgument(\"C:/Program Files/nodejs/node.exe\");\n command.addArgument(\"C:/Appium/node_modules/appium/bin/appium.js\");\n command.addArgument(\"--address\", false);\n command.addArgument(\"127.0.0.1\");\n command.addArgument(\"--port\", false);\n command.addArgument(\"4723\");\n command.addArgument(\"--full-reset\", false);\n\n DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();\n DefaultExecutor executor = new DefaultExecutor();\n executor.setExitValue(1);\n executor.execute(command, resultHandler);\n Thread.sleep(5000);\n } else if (os.contains(\"mac\")) {\n CommandLine command = new CommandLine(\"/Applications/Appium.app/Contents/Resources/node/bin/node\");\n command.addArgument(\"/Applications/Appium.app/Contents/Resources/node_modules/appium/bin/appium.js\", false);\n command.addArgument(\"--address\", false);\n command.addArgument(\"127.0.0.1\");\n command.addArgument(\"--port\", false);\n command.addArgument(\"4723\");\n command.addArgument(\"--full-reset\", false);\n DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();\n DefaultExecutor executor = new DefaultExecutor();\n executor.setExitValue(1);\n executor.execute(command, resultHandler);\n Thread.sleep(5000);\n } else if (os.contains(\"linux\")) {\n //Start the appium server\n System.out.println(\"ANDROID_HOME : \");\n System.getenv(\"ANDROID_HOME\");\n //\tSystem.out.println(\"PATH :\" +System.getenv(\"PATH\"));\n CommandLine command = new CommandLine(\"/bin/bash\");\n command.addArgument(\"-c\");\n command.addArgument(\"~/.linuxbrew/bin/node\");\n command.addArgument(\"~/.linuxbrew/lib/node_modules/appium/lib/appium.js\", true);\n DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();\n DefaultExecutor executor = new DefaultExecutor();\n executor.setExitValue(1);\n executor.execute(command, resultHandler);\n Thread.sleep(5000); //Wait for appium server to start\n\n } else {\n LOGGER.info(os + \"is not supported yet\");\n }\n }", "public AppiumDriverLocalService StartServer()\n\t{\n\t\tservice = AppiumDriverLocalService.buildDefaultService();\n\t\tservice.start();\n\t\treturn service;\n\t}", "public void startAppium() throws ExecuteException, IOException{\n\t\t\t\tCommandLine command = new CommandLine(\"/bin/sh\");\n\t\t\t\tcommand.addArgument(\"/Applications/Appium.app/Contents/Resources/node/bin/node\");\n\t\t\t\tcommand.addArgument(\"/Applications/Appium.app/Contents/Resources/node_modules/appium/bin/appium.js\");\n\t\t\t\tcommand.addArgument(\"--address\");\n\t\t\t\tcommand.addArgument(\"127.0.0.1\");\n\t\t\t\tcommand.addArgument(\"--port\");\n\t\t\t\tcommand.addArgument(\"4723\");\n\t\t\t\tcommand.addArgument(\"--no-reset\");\n\t\t\t\tcommand.addArgument(\"--log\");\n\t\t\t\t\n\t\t\t\tcommand.addArgument(\"argument\", false);\n\t\t\t\tDefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();\n\t\t\t\tDefaultExecutor executor = new DefaultExecutor();\n\t\t\t\texecutor.setExitValue(1);\n\t\t\t\texecutor.execute(command, resultHandler);\n\t\t\t\t\t\n\t\t\t}", "@BeforeTest\n\tpublic void setUp() throws InterruptedException, IOException {\n\t\tAppiumServer appiumServer = new AppiumServer();\n\t\t\n\t\tint port = 4723;\n\t\tif(!appiumServer.checkIfServerIsRunnning(port)) {\n\t\t\tSystem.out.println(\"Port No.: \" + port + \" is available.\");\n\n\t\t\tappiumServer.startServer();\n\t\t\t\n\t\t} else {\n\t\t\tSystem.out.println(\"Appium Server already running on Port - \" + port);\n\t\t}\n\t\t\n\t\tFile appPath = new File(\"./app/eBay.apk\");\n\t\tDesiredCapabilities cap = new DesiredCapabilities();\n\n\t\tcap.setCapability(MobileCapabilityType.APP, appPath.getAbsolutePath());\n\t\tcap.setCapability(MobileCapabilityType.DEVICE_NAME, \"MI\");\n\t\tcap.setCapability(MobileCapabilityType.PLATFORM_NAME, \"Android\");\n//\t\tcap.setCapability(MobileCapabilityType.PLATFORM_VERSION,\"9\");\n\t\t\n\t\tcap.setCapability(\"unicodeKeyboard\", \"true\"); \n\t\tcap.setCapability(\"resetKeyboard\", \"true\");\n\t\t\n\t\tcap.setCapability(MobileCapabilityType.PLATFORM_VERSION, DeviceVersionFinder.getDeviceVersion());\n\t\tcap.setCapability(MobileCapabilityType.AUTOMATION_NAME, \"uiautomator2\");\n\t\tcap.setCapability(\"--session-override\", false);\n\t\t\n\t\tcap.setCapability(\"setWebContentsDebuggingEnabled\", true);\n\t\t\n\t\tdriver = new AndroidDriver<MobileElement>(new URL(\"http://0.0.0.0:4723/wd/hub\"), cap);\n\n\t\tdriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n\t\tPOM_LaunchHomeScreen homeScreen = new POM_LaunchHomeScreen(driver);\n\n\t\tif(homeScreen.btn_homeSignIn.isDisplayed()) {\n\t\t\t\n\t\t\tSystem.out.println(\"App has successfully loaded within the time provided!\");\n\t\t\t\n\t\t}\n\n\t\t\n//\t\tMobileElement element = driver.findElement(By.id(\"recycler_view_main\"));\n\t\t\n//\t\tTouchActions action = new TouchAction();\n//\t\taction.scroll(element, 10, 100);\n//\t\taction.perform();\n\t\t\n\t\t\n\n\t\tSystem.out.println(\"Setup successful!\");\n\n\n\t}", "@BeforeClass\n public void setUp() {\n\n service = AppiumDriverLocalService.buildDefaultService();\n\n service.start();\n\n if (service == null || !service.isRunning()) {\n throw new AppiumServerHasNotBeenStartedLocallyException(\"Failed to start the Appium Server\");\n }\n path = AppUtility.getInstance().getPath();\n }", "@BeforeClass\n public static void startApp() throws MalformedURLException {\n DesiredCapabilities caps = new DesiredCapabilities();\n caps.setCapability(\"platformName\", \"Android\");\n caps.setCapability(\"platformVersion\", \"5.0.1\"); //Replace this with your Android version\n caps.setCapability(\"deviceName\", \"Samsung Galaxy\"); //Replace this with your simulator/device \n Path currentRelativePath = Paths.get(\"\");\n String path = currentRelativePath.toAbsolutePath().toString() + \"/src/main/resources/Evernote.apk\";\n caps.setCapability(\"app\", path); //Replace this with app path in your system\n \n// caps.setCapability(\"appActivity\", \"com.evernote.ui.HomeActivity\");\n// caps.setCapability(\"appPackage\", \"com.evernote\");\n// appInstalled = true;\n\n AppiumServer server = new AppiumServer(serverAddress,port);//setup Appium server \n server.startAppiumServer();//open Appium server automatically\n \n driver = new AndroidDriver(server.getService(),caps);\n driver.manage().timeouts().implicitlyWait(20L, TimeUnit.SECONDS);\n }", "private void intializeAppiumDriver() {\n File app = new File(\"src/main/resources\", CommonUtils.getCentralData(\"App\"));\n\n DesiredCapabilities capabilities = new DesiredCapabilities();\n capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, CommonUtils.getCentralData(\"PlatformName\"));\n capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, CommonUtils.getCentralData(\"PlatformVersion\"));\n capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, CommonUtils.getCentralData(\"DeviceName\"));\n if (IS_ANDROID) {\n capabilities.setCapability(APPLICATION_NAME, app.getAbsolutePath());\n capabilities.setCapability(APP_PACKAGE, CommonUtils.getCentralData(\"AppPackage\"));\n capabilities.setCapability(APP_ACTIVITY, CommonUtils.getCentralData(\"AppActivity\"));\n }\n if (IS_IOS) {\n capabilities.setCapability(AUTOMATION_NAME, IOS_XCUI_TEST);\n capabilities.setCapability(\"app\", app.getAbsolutePath());\n }\n capabilities.setCapability(FULL_RESET, CommonUtils.getCentralData(\"FullReset\"));\n capabilities.setCapability(NO_RESET, CommonUtils.getCentralData(\"NoReset\"));\n capabilities.setCapability(\"udid\", CommonUtils.getCentralData(\"UDID\"));\n capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, CommonUtils.getCentralData(\"WaitTimeoutInSeconds\"));\n\n try {\n driver = new AppiumDriver(new URL(CommonUtils.getCentralData(\"URL\")), capabilities);\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n }", "public void startServer() {\n URLClassLoader loader = createClasspath(opts);\n X_Process.runInClassloader(loader, appServer\n .map(DevAppServer::doStartServer, getAppName() + \"Server\", getPort())\n .ignoreOut1().unsafe());\n }", "@BeforeClass\n\tpublic void appLaunch() throws IOException\n\t{\n\n\t\t/*String Appium_Node_Path=\"C:/Program Files (x86)/Appium/node.exe\"; \n\t\tString Appium_JS_Path=\"C:/Program Files (x86)/Appium/node_modules/appium/bin/appium.js\"; \n\t\tappiumService = AppiumDriverLocalService.buildService(new AppiumServiceBuilder().usingPort(4723).usingDriverExecutable(new File(Appium_Node_Path)).withAppiumJS(new File(Appium_JS_Path))); \n\t\tappiumService.start();\n\t\t */\t\t\t\n\t\tcapabilities.setCapability(MobileCapabilityType.PLATFORM,Platform.ANDROID);\n\t\tcapabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT,3000);\n\t\tcapabilities.setCapability(MobileCapabilityType.PLATFORM,Horoscope_GenericLib.readConfigPropFile(sPropFileName, \"PLATFORMNAME\"));\n\t\tcapabilities.setCapability(MobileCapabilityType.DEVICE_NAME,Horoscope_GenericLib.readConfigPropFile(sPropFileName, \"DeviceName\"));\n\t\tcapabilities.setCapability(MobileCapabilityType.VERSION,Horoscope_GenericLib.readConfigPropFile(sPropFileName, \"PLATFORMVERSION\"));\n//\t\tcapabilities.setCapability(\"appPackage\", Horoscope_GenericLib.readConfigPropFile(sPropFileName, \"packageName\"));\n//\t\tcapabilities.setCapability(\"appActivity\",Horoscope_GenericLib.readConfigPropFile(sPropFileName, \"activityName\"));\n\t\t\n\t\t// for testing\n\t\tcapabilities.setCapability(\"appPackage\", \"in.amazon.mShop.android.shopping\");\n\t\tcapabilities.setCapability(\"appActivity\", \"com.amazon.mShop.home.HomeActivity\");;\n\n\n\t\tURL url= new URL(\"http://0.0.0.0:4723/wd/hub\");\n\t\tdriver = new AndroidDriver<WebElement>(url, capabilities);\n\t\tdriver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\n\t\t// testing purpose\n\t\tbackButton(driver);\n\t\tbackButton(driver);\n\t\t\n// in.amazon.mShop.android.shopping\n//\tcom.amazon.mShop.sso.SigninPromptActivity\n\n\t}", "@Test\n public void startServer() throws InterruptedException {\n UicdInstrumentation uicdInstrumentation =\n UicdInstrumentation.getInstance(\n getInstrumentation().getContext(), DEFAULT_PORT);\n uicdInstrumentation.startServer();\n\n while (!uicdInstrumentation.isStopServer()) {\n SystemClock.sleep(PING_SERVER_MS);\n }\n }", "private void startServer() {\n\t\ttry {\n//\t\t\tserver = new Server();\n//\t\t\tserver.start();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: add message in UI for user\n\t\t}\n\t}", "@BeforeTest\n public void setUp() throws Exception {\n\t \n appiumStop();\n // Start appium server.\n appiumStart();\n DesiredCapabilities capabilities = new DesiredCapabilities();\n capabilities.setCapability(\"deviceName\", \"Android Emulator\");\n capabilities.setCapability(\"browserName\", \"Android\");\n capabilities.setCapability(\"platformVersion\", \"6.0\");\n capabilities.setCapability(\"platformName\", \"Android\");\n capabilities.setCapability(\"appPackage\", \"com.hmh.api\");\n capabilities.setCapability(\"appActivity\", \"com.hmh.api.ApiDemos\");\n driver = new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);\n }", "public static AppiumDriver<MobileElement> setUp() {\n\t\ttry {\t\t\n\t\t\t\n\t\tDesiredCapabilities cap=new DesiredCapabilities();\n\t\tcap.setCapability(MobileCapabilityType.PLATFORM_NAME,\"ANDROID\");\n\t\tcap.setCapability(MobileCapabilityType.PLATFORM_VERSION, \"10 QKQ1.190915.002\");\n\t\tcap.setCapability(MobileCapabilityType.DEVICE_NAME, \"Redmi Note 7 Pro\");\n\t\tcap.setCapability(MobileCapabilityType.UDID, \"d9b3ca47\");\n//\t\tcap.setCapability(MobileCapabilityType.APP, \"\");\n\t\tcap.setCapability(\"appPackage\", \"com.swaglabsmobileapp\");\n\t\tcap.setCapability(\"appActivity\", \"com.swaglabsmobileapp.SplashActivity\");\n\t\t\n\t\tURL url=new URL(\"http://127.0.0.1:4723/wd/hub\");\n\t\tdriver =new AppiumDriver<MobileElement>(url, cap);\n\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\n//\t\tlog.info(\"Launching the app\");\n//\t\tMobileElement loginbutton = driver.findElement(MobileBy.AccessibilityId(\"test-LOGIN\"));\n// loginbutton.click();\n\t\t\t\treturn driver;\n\t\t}catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn driver;\n\t\t}\n\t}", "public void startServer() {\n server.start();\n }", "public static void main(String[] args) throws MalformedURLException, InterruptedException {\n\t\tString deviceName = \"VCan\";\r\n\t\tString platformVersion = \"4.4.2\";\r\n\t\tString apkName = \"微博.apk\";\r\n\t\tString appActivity = \"com.sina.weibo.SplashActivity\";\r\n\t\tString AppiumServerIP = \"http://127.0.0.1:4723/wd/hub\";\r\n\t\tAndroidDriver driver;\r\n\t\tFile apk = new File(System.getProperty(\"user.dir\")+File.separator+\"apps\"+File.separator+apkName);\r\n\t\tDesiredCapabilities capabilities = new DesiredCapabilities();\r\n\t\tcapabilities.setCapability(\"deviceName\", deviceName);\r\n\t\tcapabilities.setCapability(\"platformVersion\", platformVersion);\r\n\t\tcapabilities.setCapability(\"app\", apk);\r\n\t\tcapabilities.setCapability(\"appActivity\", appActivity);\r\n\t\tcapabilities.setCapability(\"noSign\", true);\r\n\t\tcapabilities.setCapability(\"noReset\", true);\r\n\t\tdriver = new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"),capabilities);\r\n\t\tThread.sleep(3000);\r\n\t\tSystem.out.println(\"App启动等待时间\");\r\n\t\tThread.sleep(4000);\r\n\t\tdriver.findElementById(\"com.sina.weibo:id/plus_icon\").click();\r\n\t\tdriver.findElementById(\"com.sina.weibo:id/pop_control_bar_front_close_img\").click();\r\n\t\tThread.sleep(2000);\r\n\t\tdriver.close();\r\n\t\tdriver.quit();\r\n\t}", "public static AppiumDriver getDriver(String platformtype, AppiumDriverLocalService service) throws IOException, TimeoutException, URISyntaxException {\n AppiumDriver driver;\n /* List<InterceptedMessage> messages = new ArrayList<InterceptedMessage>();\n\n\n MitmproxyJava proxy = new MitmproxyJava(\"/usr/local/bin/mitmdump\", (InterceptedMessage m) -> {\n System.out.println(\"intercepted request for \" + m.requestURL.toString());\n messages.add(m);\n return m;\n });\n //System.out.println(\"Hello World\");\n proxy.start();*/\n if (platformtype== \"Android\") {\n DesiredCapabilities options = new DesiredCapabilities();\n options.setCapability(\"deviceName\", propertyManager.getInstance().getdevicename()); //Pixel_XL_API_29\n options.setCapability(\"udid\",propertyManager.getInstance().getdeviceUDID());\n //options.setCapability(\"avd\",\"Pixel_XL_API_29\");\n options.setCapability(\"platformName\", propertyManager.getInstance().getplatformName());\n options.setCapability(\"platformVersion\", propertyManager.getInstance().getplatformVersion()); //emulator: 10.0.0\n options.setCapability(\"automationName\", \"UiAutomator2\");\n options.setCapability(\"autoGrantPermissions\",\"true\");\n options.setCapability(\"noReset\",\"true\");\n options.setCapability(\"autoAcceptAlerts\",\"true\");\n options.setCapability(\"app\",propertyManager.getInstance().getAndroidapp());\n options.setCapability(\"uiautomator2ServerInstallTimeout\", \"60000\");\n options.setCapability(\"abdExecTimeout\", \"60000\");\n options.setCapability(\"ACCEPT_SSL_CERTS\",true);\n options.setCapability(\"clearDeviceLogsOnStart\",\"true\");\n //options.setCapability(\"--set ssl_version_client\",\"all\");\n //options.setCapability(\"--proxy-server\",\"localhost:8080\");\n //options.setCapability(\"appWaitPackage\", \"com.clearchannel.iheartradio.controller.debug\");\n //options.setCapability(\"appWaitActivity\", \"com.clearchannel.iheartradio.controller.activities.NavDrawerActivity\");\n //options.setCapability(\"appPackage\", \"com.clearchannel.iheartradio.controller.debug\");\n //options.setCapability(\"appActivity\", \"com.clearchannel.iheartradio.controller.activities.NavDrawerActivity\");\n\n\n driver = new AndroidDriver<MobileElement>(service, options);\n return driver;\n }\n else if(platformtype== \"iOS\"){\n DesiredCapabilities options = new DesiredCapabilities();\n\n options.setCapability(\"platformName\", \"iOS\");\n options.setCapability(\"platformVersion\", propertyManager.getInstance().getiOSplatformVersion());\n options.setCapability(\"deviceName\", propertyManager.getInstance().getiOSdevicename());\n options.setCapability(\"udid\",propertyManager.getInstance().getiOSUDID());\n //options.setCapability(CapabilityType.BROWSER_NAME,\"safari\");\n //options.setCapability(\"automationName\", \"XCUITest\");\n options.setCapability(\"bundleId\",\"com.clearchannel.iheartradio.enterprise\");\n options.setCapability(\"startIWDP\",\"true\");\n options.setCapability(\"noReset\",\"true\");\n options.setCapability(\"useNewWDA\",\"false\");\n //options.setCapability(\"showIOSLog\",\"true\");\n //options.setCapability(\"app\",\"/Users/Shruti/Desktop/untitled folder/iHRiOSAppCenter/iHeartRadio.ipa\"); // /Users/Shruti/Downloads/iHeartRadio.ipa\n options.setCapability(\"xcodeOrgId\",\"BCN32U332R\");\n options.setCapability(\"xcodeSigningId\",\"iPhone Developer\");\n options.setCapability(\"autoAcceptAlerts\",\"true\");\n options.setCapability(\"SHOW_XCODE_LOG\",\"true\");\n //options.setCapability(\"updatedWDABundleId\",\"com.Shruti7505.WebDriverAgentRunner\");\n driver = new IOSDriver<MobileElement>(service,options);\n return driver;\n }\n return driver=null;\n\n }", "public void Launch_app() {\n\t\tDesiredCapabilities caps = new DesiredCapabilities();\r\n\t\tcaps.setCapability(\"deviceName\", \"My Phone\");\r\n\t\tcaps.setCapability(\"udid\", \"LE66A06190140096\"); //Give Device ID of your mobile phone\r\n\t\t\r\n\t\t/* caps.setCapability(\"udid\", \"emulator-5556\"); //Give Device ID of your mobile phone\r\n\t\t caps.setCapability(\"app\", \"C:\\\\Users\\\\Blue Otter HP2\\\\Downloads\\\\xemoto_staging_v1.0.0.apk\"); \r\n\t\t caps.setCapability(\"appWaitActivity\", \"*\");\r\n\t\t caps.setCapability(MobileCapabilityType.AUTOMATION_NAME, \"UiAutomator2\");*/\r\n\t\t\r\n\t\tcaps.setCapability(\"platformName\", \"Android\");\r\n\t\tcaps.setCapability(\"platformVersion\", \"6.0\");\r\n\t\r\n\t\tcaps.setCapability(\"appPackage\", \"org.blueotter.motone\");\r\n\t\tcaps.setCapability(\"appActivity\", \"org.blueotter.motone.feature.main.view.ActivityMain\"); \r\n\t\t\r\n\t\tcaps.setCapability(\"noReset\", \"true\");\r\n\t\t\r\n\t\t//Instantiate Appium Driver\r\n\t\ttry {\r\n\t\t\t\t driver = new AndroidDriver<MobileElement>(new URL(\"http://127.0.0.1:4723/wd/hub\"), caps);\t\t\r\n\r\n\r\n\t\t} catch (MalformedURLException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t\t\r\n\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS) ;\r\n\t\tSystem.out.println(\"Launch motone successful!\");\r\n\r\n \t}", "public void startServer() {\n System.out.println(\"Inicie\");\n httpServer = new HttpServer();\n httpServer.registerProessor(\"/App\", this);\n try {\n httpServer.start();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void openSession() {\n \t\tmSession = new ApplicationSession(mCastContext, mSelectedDevice);\n \n \t\tint flags = 0;\n \n \t\t// Comment out the below line if you are not writing your own\n \t\t// Notification Screen.\n \t\tflags |= ApplicationSession.FLAG_DISABLE_NOTIFICATION;\n \n \t\t// Comment out the below line if you are not writing your own Lock\n \t\t// Screen.\n \t\tflags |= ApplicationSession.FLAG_DISABLE_LOCK_SCREEN_REMOTE_CONTROL;\n \t\tmSession.setApplicationOptions(flags);\n \n \t\tmSession.setListener(new com.google.cast.ApplicationSession.Listener() {\n \n \t\t\t@Override\n \t\t\tpublic void onSessionStarted(ApplicationMetadata appMetadata) {\n \t\t\t\tApplicationChannel channel = mSession.getChannel();\n \t\t\t\tif (channel == null) {\n \t\t\t\t\treturn;\n \t\t\t\t}\n \n \t\t\t\ttry {\n \t\t\t\t\tif (simpleWebServer == null) {\n \t\t\t\t\t\tsimpleWebServer = new SimpleWebServer(null, 1993,\n \t\t\t\t\t\t\t\tAndroidFileCache\n \t\t\t\t\t\t\t\t\t\t.getCacheDirectory(MainActivity.this),\n \t\t\t\t\t\t\t\ttrue);\n \t\t\t\t\t\tsimpleWebServer.start();\n \t\t\t\t\t}\n \n \t\t\t\t\tmMessageStream = new MediaProtocolMessageStream();\n \t\t\t\t\tchannel.attachMessageStream(mMessageStream);\n \n \t\t\t\t\tloadMedia(currentPage);\n \t\t\t\t} catch (IOException e) {\n \t\t\t\t\te.printStackTrace();\n \n \t\t\t\t\tshowCrouton(R.string.chromecast_failed, null,\n \t\t\t\t\t\t\tAppMsg.STYLE_ALERT);\n \t\t\t\t}\n \t\t\t}\n \n \t\t\t@Override\n \t\t\tpublic void onSessionStartFailed(SessionError error) {\n \t\t\t\tshowCrouton(R.string.chromecast_failed, null,\n \t\t\t\t\t\tAppMsg.STYLE_ALERT);\n \t\t\t}\n \n \t\t\t@Override\n \t\t\tpublic void onSessionEnded(SessionError error) {\n \t\t\t}\n \t\t});\n \n \t\ttry {\n \t\t\tmSession.startSession(\"c529f89e-2377-48fb-b949-b753d9094119\");\n \t\t} catch (IOException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t}", "private void runServer()\n\t{\n\t\tif(sm == null)\n\t\t{\n\t\t\tsm = new ServerManager();\n\t\t}\n\t\t\n\t\tint port = 1209;\n\t\ttry \n\t\t{\n\t\t\twaitUser(sm, port);\n\t\t\t//이 아래 로직이 실행된다는건 유저가 다 들어왔다는 뜻임. 즉 게임 시작할 준비 되었음을 의미함\t\t\t\n\t\t\tGame.getInstance().runGame();\n\t\t} \n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"[Server.runServer()] error >>> : \" + e.getMessage());\n\t\t}\n\t}", "public MockPIFrame startSession() {\n // 1. driver requests new session\n DriverRequest driverRequest = sendCommand(\"getNewBrowserSession\", \"*dummy\", \"http://x\");\n // 2. server generates new session, awaits browser launch\n sessionId = waitForSessionId(driverRequest);\n LOGGER.debug(\"browser starting session \" + sessionId);\n // 3. browser starts, requests work\n MockPIFrame frame = new MockPIFrame(DRIVER_URL, sessionId, \"frame1\");\n LOGGER.debug(\"browser sending start message\");\n frame.seleniumStart();\n // 4. server requests identification, asks for \"getTitle\"\n LOGGER.debug(\"browser expecting getTitle command, blocking..\");\n frame.expectCommand(\"getTitle\", \"\", \"\");\n // 5. browser replies \"selenium remote runner\" to getTitle\n frame.sendResult(\"OK,selenium remote runner\");\n // 6. server requests setContext\n frame.expectCommand(\"setContext\", sessionId, \"\");\n // 7. browser replies \"OK\" to setContext\n frame.sendResult(\"OK\");\n // 8. server replies \"OK,123\" to driver\n driverRequest.expectResult(\"OK,\" + sessionId);\n return frame;\n }", "private void startServer() {\n mBluetoothGattServer = mBluetoothManager.openGattServer(this, mGattServerCallback);\n if (mBluetoothGattServer == null) {\n Log.w(TAG, \"Unable to create GATT server\");\n return;\n }\n\n mBluetoothGattServer.addService(TimeProfile.createTimeService());\n\n // Initialize the local UI\n updateLocalUi(System.currentTimeMillis());\n mBluetoothGattServer.addService(SecurityProfile.createSecurityService());\n //mBluetoothGattServer.addService(ConfigurationProfile.createConfigurationService());\n\n }", "public void init() throws MalformedURLException {\n\n capabilities = new DesiredCapabilities();\n\n capabilities.setCapability(\"deviceName\", \"Nex5\");\n capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, \"Android\");\n capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, \"8.0\");\n capabilities.setCapability(\"appPackage\", \"com.trello\");\n capabilities.setCapability(\"appActivity\", \".home.HomeActivity\");\n\n capabilities.setCapability(\"automationName\", \"Appium\");\n capabilities.setCapability(\"app\", \"C:/Users/Study/APK/trello_new.apk\");\n driver = new AppiumDriver<MobileElement>(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\n welcomeActivity = new WelcomePage(driver);\n loginActivity = new LoginPage(driver);\n\n }", "@BeforeMethod\npublic void setUp() throws MalformedURLException, InterruptedException{\n\t\n\t File classpathRoot = new File(System.getProperty(\"user.dir\"));\n\t File appDir = new File(classpathRoot, \"/Apps/Pazo/\");\n\t File app = new File(appDir, \"app-ppz-debug.apk\");\n\t DesiredCapabilities capabilities = new DesiredCapabilities();\n\t capabilities.setCapability(CapabilityType.BROWSER_NAME, \"\");\n\t capabilities.setCapability(\"deviceName\", \"MI\");\n\t capabilities.setCapability(\"platformVersion\", \"7.0\");\n\t capabilities.setCapability(\"platformName\", \"Android\");\n\t capabilities.setCapability(\"app\", app.getAbsolutePath());\n\t capabilities.setCapability(\"appPackage\", \"com.pazo.ppz\");\n\t capabilities.setCapability(\"appPackage1\", \"com.google.android.packageinstaller\");\n\t capabilities.setCapability(\"appActivity\", \"com.tagtual.trackd.Activities.Splash\");\n\t capabilities.setCapability(\"appActivity1\", \"com.tagtual.trackd.Activities.LicenceLogin\");\n\t capabilities.setCapability(AndroidMobileCapabilityType.AUTO_GRANT_PERMISSIONS,true);\n\t capabilities.setCapability(\"unicodeKeyboard\", true);\n\t capabilities.setCapability(\"resetKeyboard\", true);\n\t try{\n\t driver = new AppiumDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\t }\n\t catch (ExceptionInInitializerError error){\n\t System.out.println(error.getCause());\n\t System.out.println(error.getMessage());\n\t System.out.println(error.getLocalizedMessage());\n\t System.out.println(error.getStackTrace().toString());\n\n\t }\n\t driver.manage().timeouts().pageLoadTimeout(80, TimeUnit.SECONDS);\n\t driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);\n\t// Thread.sleep(10000);\n\t\n}", "public void start()\r\n\t\t{\r\n\t\tDebug.assert(serverSocket != null, \"(Server/123)\");\r\n\r\n \t// flag the server as running\r\n \tstate = RUNNING;\r\n\r\n // Loop while still listening, accepting new connections from the server socket\r\n while (state == RUNNING)\r\n \t{\r\n // Get a connection from the server socket\r\n\t\t\tSocket socket = null;\r\n\t\t\ttry {\r\n socket = serverSocket.accept();\r\n \tif (state == RUNNING) \r\n \t createLogin(socket);\r\n }\r\n \r\n // The socket timeout allows us to check if the server has been shut down.\r\n // In this case the state will not be RUNNING and the loop will end.\r\n\t\t catch ( InterruptedIOException e )\r\n\t\t \t{\r\n\t\t \t// timeout happened\r\n\t\t \t}\r\n\t\t \r\n\t\t // This shouldn't happen...\r\n \t catch ( IOException e )\r\n \t \t{\r\n log(\"Server: Error creating Socket\");\r\n \t \tDebug.printStackTrace(e);\r\n \t }\r\n\t }\r\n\t \r\n\t // We've finished, clean up\r\n disconnect();\r\n\t\t}", "public static void start() {\n final Context appContext = ContextUtils.getApplicationContext();\n tryObtainingDataDirLock(appContext);\n // We must post to the UI thread to cover the case that the user\n // has invoked Chromium startup by using the (thread-safe)\n // CookieManager rather than creating a WebView.\n ThreadUtils.runOnUiThreadBlocking(new Runnable() {\n @Override\n public void run() {\n boolean multiProcess = CommandLine.getInstance().hasSwitch(\n AwSwitches.WEBVIEW_SANDBOXED_RENDERER);\n if (multiProcess) {\n // Have a background thread warm up a renderer process now, so that this can\n // proceed in parallel to the browser process initialisation.\n AsyncTask.THREAD_POOL_EXECUTOR.execute(new Runnable() {\n @Override\n public void run() {\n ChildProcessLauncher.warmUp(appContext);\n }\n });\n }\n // The policies are used by browser startup, so we need to register the policy\n // providers before starting the browser process. This only registers java objects\n // and doesn't need the native library.\n CombinedPolicyProvider.get().registerProvider(new AwPolicyProvider(appContext));\n\n try {\n BrowserStartupController.get(appContext, LibraryProcessType.PROCESS_WEBVIEW)\n .startBrowserProcessesSync(!multiProcess);\n } catch (ProcessInitException e) {\n throw new RuntimeException(\"Cannot initialize WebView\", e);\n }\n }\n });\n }", "private void startServerService() {\n Intent intent = new Intent(this, MainServiceForServer.class);\n // Call bindService(..) method to bind service with UI.\n this.bindService(intent, serverServiceConnection, Context.BIND_AUTO_CREATE);\n Utils.log(\"Server Service Starting...\");\n\n //Disable Start Server Button And Enable Stop and Message Button\n messageButton.setEnabled(true);\n stopServerButton.setEnabled(true);\n startServerButton.setEnabled(false);\n\n\n }", "public void startSession(){\n sessionID = client.startSession();\n \n //Get system temporary files path\n String temporaryPath = System.getProperty(\"java.io.tmpdir\").replaceAll(\"\\\\\\\\\",\"/\");\n \n //If temporary file path does not end with /, add it\n if(!temporaryPath.endsWith(\"/\"))\n temporaryPath = temporaryPath + \"/\";\n \n //Create session directory\n sessionDirectory = new File(temporaryPath+sessionID);\n sessionDirectory.mkdir();\n \n }", "@BeforeClass\npublic void setUp() throws MalformedURLException{\n\tDesiredCapabilities capabilities = new DesiredCapabilities();\n\t//capabilities.setCapability(\"BROWSER_NAME\", \"Android\");\n//\tcapabilities.setCapability(\"VERSION\", \"4.4.2\"); \n\tcapabilities.setCapability(\"deviceName\",\"NSM3Y18206000488\");\n\tcapabilities.setCapability(\"udid\",\"NSM3Y18206000488\");\n\tcapabilities.setCapability(\"platformName\",\"Android\");\n capabilities.setCapability(\"appPackage\", \"com.android.chrome\");\n// This package name of your app (you can get it from apk info app)\n\tcapabilities.setCapability(\"appActivity\",\"com.google.android.apps.chrome.Main\"); // This is Launcher activity of your app (you can get it from apk info app)\n//Create RemoteWebDriver instance and connect to the Appium server\n //It will launch the Calculator App in Android Device using the configurations specified in Desired Capabilities\n driver = new AndroidDriver<MobileElement>(new URL(\"http://localhost:4723/wd/hub\"), capabilities);\n \n // PageFactory.initElements(driver, this);\n}", "@BeforeClass\n public void classLevelSetup() {\n\t\t \t\tcaps = new DesiredCapabilities();\n \t\t\tcaps.setCapability(\"deviceName\", \"My Phone\");\n \t\t\tcaps.setCapability(\"udid\", \"8f81d4e2\"); //Give Device ID of your mobile phone\n \t\t\tcaps.setCapability(\"platformName\", \"Android\");\n \t\t\tcaps.setCapability(\"platformVersion\", \"9\"); // The version of Android on your device\n \t\t\tcaps.setCapability(\"browserName\", \"Chrome\");\n \t\t\tcaps.setCapability(\"noReset\", true);\n \t\t\tcaps.setCapability(MobileCapabilityType.PLATFORM_NAME, MobilePlatform.ANDROID);\n \t\t\tcaps.setCapability(\"chromedriverExecutable\", \"C:\\\\SeleniumGecko\\\\chromedriver78.exe\"); // Set ChromeDriver location\n \t\t\t\n\n \t\t\t//Instantiate Appium Driver or AndroidDriver\n \t\t\ttry {\n \t\t\t\tdriver = new AppiumDriver<>(new URL(appium_node), caps);\n \t\t\t\t\n \t\t\t} catch (MalformedURLException e) {\n \t\t\t\tSystem.out.println(e.getMessage());\n \t\t\t}\n \t\t\t\t\t\n\n\t\t\n }", "public static void stopAppiumServer() throws IOException {\n\tif (process != null) {\n\tprocess.destroy();\n\n\t}\n\n\tSystem.out.println(\"Appium server stopped\");\n\n\t}", "public static void main(String[] args) throws MalformedURLException, InterruptedException {\n\t\t\t\tDesiredCapabilities capabilities= new DesiredCapabilities();\r\n\t\t\t\t\t\t\r\n\t\t\t\t//device details\r\n\t\t\t\tcapabilities.setCapability(\"deviceName\",\"GT-I9300I\");\r\n\t\t\t\tcapabilities.setCapability(\"platformName\",\"Android\");\r\n\t\t\t\tcapabilities.setCapability(\"platformVersion\",\"4.4.4\");\t\t\r\n\t\t\t\t\r\n\t\t\t\t//app details\r\n\t\t\t\tcapabilities.setCapability(\"appPackage\",\"com.emn8.mobilem8.nativeapp.bk\");\r\n\t\t\t\tcapabilities.setCapability(\"appActivity\",\"com.emn8.mobilem8.nativeapp.bk.BKNativeMobileApp\");\r\n\t\t\t\t\r\n\t\t\t\t//Appium Server details\r\n\t\t\t\tAndroidDriver driver= new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\r\n\t\t\t\t\r\n\t\t\t\t//wait\r\n\t\t\t\tThread.sleep(4000);\r\n\t\t\t\t\r\n\t\t\t\tSet<String> contextHandles = driver.getContextHandles();\r\n\t\t\t\tint size = contextHandles.size();\r\n\t\t\t\tSystem.out.println(size);\r\n\t\t\t\t\r\n\t\t\t\t//****************************************************\r\n\t\t\t\tfor(String contextname:contextHandles)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"First Page\");\r\n\t\t\t\t\tSystem.out.println(contextname);\r\n\t\t\t\t\tSystem.out.println(\"-------------------\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(contextname.contains(\"NATIVE\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.context(contextname);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tWebDriverWait wait= new WebDriverWait(driver, 50);\r\n\t\t\t\tWebElement ele_voucher = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//*[@index='9'][@content-desc='VOUCHERS'][@class='android.view.View']\")));\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Voucher is displayed \"+ele_voucher.isDisplayed());\r\n\t\t\t\t\r\n\t\t\t\tele_voucher.click();\r\n\t\t\t\t\r\n\t\t\t\t//**************************************************************\r\n\t\t\t\t//Second page\r\n\t\t\t\tThread.sleep(4000);\r\n\t\t\t\tfor(String contextname:contextHandles)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"Second Page\");\r\n\t\t\t\t\tSystem.out.println(contextname);\r\n\t\t\t\t\tSystem.out.println(\"-------------------\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(contextname.contains(\"NATIVE\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.context(contextname);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tWebDriverWait wait2= new WebDriverWait(driver, 50);\r\n\t\t\t\tWebElement ele_redeem = wait2.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//*[@index='17'][@content-desc='REDEEM'][@class='android.view.View']\")));\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Redeem is displayed \"+ele_redeem.isDisplayed());\r\n\t\t\t\t\r\n\t\t\t\tele_redeem.click();\r\n\t\t\t\t//**************************************************************\r\n\t\t\t\t//Third page\r\n\t\t\t\tThread.sleep(4000);\r\n\t\t\t\tfor(String contextname:contextHandles)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"Third Page\");\r\n\t\t\t\t\tSystem.out.println(contextname);\r\n\t\t\t\t\tSystem.out.println(\"-------------------\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(contextname.contains(\"WEBVIEW\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.context(contextname);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tdriver.findElementByName(\"email\").sendKeys(\"nov@gmail.com\");\r\n\t\t\t\tWebElement ele_pwd = driver.findElementByName(\"password\");\r\n\t\t\t\tele_pwd.click();\r\n\t\t\t\t\r\n\t\t\t\tThread.sleep(4000);\r\n\t\t\t\tele_pwd.sendKeys(\"1234\");\r\n\t\t\t\t\r\n\t\t\t\t//********************************************************\r\n\t\t\t\t\r\n\t\t\t\tThread.sleep(4000);\r\n\t\t\t\t\r\n\t\t\t\tfor(String contextname:contextHandles)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"Third Page\");\r\n\t\t\t\t\tSystem.out.println(contextname);\r\n\t\t\t\t\tSystem.out.println(\"-------------------\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(contextname.contains(\"NATIVE\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.context(contextname);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tWebDriverWait wait3= new WebDriverWait(driver, 50);\r\n\t\t\t\tWebElement ele_Signin = wait3.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//*[@index='33'][@content-desc='SIGN IN'][@class='android.view.View']\")));\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Signin is displayed \"+ele_Signin.isDisplayed());\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\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\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\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\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\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t}", "@BeforeSuite\r\n\tvoid start() throws ClassNotFoundException, SQLException\r\n\t{\r\n\t\t//Database obj = new Database();\r\n\t\t//Database.database();\r\n\t\t\r\n\t\tstartServer();\r\n\t\tobj_phoneno = new PageObject_phonenumber(androidDriver) ;\r\n\t\tLog4j.info(\"SERVER START--log\");\r\n\t\t//Log4j.info();\r\n\t\t/*obj_otp=new PageObject_OTP(androidDriver);\r\n\t\tobj_setupprofile=new PageObject_setupprofile(androidDriver);*/\r\n\t}", "void startAIGame() {\n int status = gameServer.restartServer( true, settingsMenu.getMapSize(),\n settingsMenu.getPlayFor(), settingsMenu.getFirstMove(),\n settingsMenu.getServerName() );\n if( status != 0 ) {\n JOptionPane.showMessageDialog( frame, Language.ERROR_STARTUP,\n Language.CAPTION_ERROR, JOptionPane.PLAIN_MESSAGE );\n } else {\n host = \"127.0.0.1\";\n role = \"admin\";\n password = gameServer.getServerPassword();\n ( new Thread( this ) ).start();\n }\n }", "public void startServer(PWModelDetails pwModelDetails) {\n try {\n List<ServerSap> serverSaps = null;\n try {\n serverSaps = ServerSap.getSapsFromSclFile(pwModelDetails.getSclFileName());\n } catch (SclParseException e) {\n logger.info(\"Error parsing SCL/ICD file: \" + e.getMessage());\n e.printStackTrace();\n return;\n }\n serverSap = serverSaps.get(0);\n serverSap.setPort(pwModelDetails.getPortNumber());\n\n InetAddress address = null;\n try {\n ipAddress = pwModelDetails.getIpAddress();\n address = InetAddress.getByName(ipAddress);\n } catch (UnknownHostException e) {\n logger.info(\"Unknown host: \" + ipAddress);\n logger.info(\"Proxy will run with the defualt IP as define in the SCL file.\");\n logger.info(\"Unknown host \" + ipAddress);\n return;\n }\n if (address != null) {\n serverSap.setBindAddress(address);\n }\n Runtime.getRuntime().addShutdownHook(new Thread() {\n @Override\n public void run() {\n if (serverSap != null) {\n serverSap.stop();\n }\n logger.info(\"Server was stopped\");\n }\n });\n ServerModel serverModel = serverSap.getModelCopy();\n// create a SampleServer instance that can be passed as a callback object to startListening() and\n// SmartPowerIEDServer sampleServer = new SmartPowerIEDServer();\n SoftGridIEDServer sampleServer = this;\n// Open MUC initialization\n List<BasicDataAttribute> branchCircuitBreakerVals = new ArrayList<BasicDataAttribute>(3);\n for (String reference : iedRefFcHashMap.keySet()) {\n BasicDataAttribute field = (BasicDataAttribute) serverModel.findModelNode(reference, iedRefFcHashMap.get(reference));\n if (field == null) {\n logger.info(\">>>>>> Error in obtaining SCL reference object = \" + reference);\n }\n branchCircuitBreakerVals.add(field);\n }\n// Power World Device Initialization\n ParameterGenerator parameterGenerator = new ParameterGenerator();\n parameterGenerator.setSclKeyToPWKeyMap(pwModelDetails.getSclToPWMapping());\n parameterGenerator.setKeyParameters(pwModelDetails.getKeyArray());\n parameterGenerator.setValueParameters(pwModelDetails.getDataFieldArray());\n parameterGenerator.setPersistedValues(pwModelDetails.getValueArray());\n parameterGenerator.setDeviceObjectName(pwModelDetails.getDeviceName());\n if (controlAPI == null) {\n controlAPI = IedControlerFactory.getPWComBridgeIterface();\n synchronized (controlAPI) {\n if (!controlAPI.isCaseOpened()) {\n controlAPI.openCase();\n }\n }\n }\n parameterGenerator.setControlAPI(controlAPI);\n// load power world data\n serverSap.startListening(sampleServer, parameterGenerator);\n try {\n serverSap.setValues(branchCircuitBreakerVals);\n } catch (Exception e) {\n logger.info(\"pwModelDetails.getModelNodeReference() = \" + pwModelDetails.getModelNodeReference());\n e.printStackTrace();\n }\n\n String[][] paramPack = parameterGenerator.getParamPack();\n type = IEDUtils.getIEDType(parameterGenerator.getDeviceObjectName());\n id = ++IED_COUNT;\n StringBuffer sb = new StringBuffer();\n String logDataSeperator = \":\";\n boolean loged = false;\n logEvent(\"IED : \" + type.name() + \" : \" + id + \" is Started...!\");\n String[] elements = null;\n while (true) {\n synchronized (this) {\n try {\n Thread.sleep(PW_INTERROGATION_INTERVAL);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n\n elements = parameterGenerator.loadDataValues(paramPack);\n if (elements == null) {\n if(type.name().equals(\"BUS\"))\n {\n System.out.println(\"BUS\");\n }\n continue;\n }\n sb.append(\"Type:\").append(type.name());\n for (int i = 0; i < branchCircuitBreakerVals.size(); i++) {\n BasicDataAttribute modelNodes = branchCircuitBreakerVals.get(i);\n if (modelNodes != null && elements.length > i) {\n String pwKeyName = null;\n for (String sclKey : parameterGenerator.getSclKeyToPWKeyMap().keySet()) {\n if (modelNodes.getReference().toString().endsWith(sclKey)) {\n pwKeyName = sclKey;\n }\n }\n if (pwKeyName == null) {\n continue;\n }\n for (int j = 0; j < paramPack[0].length; j++) {\n if (!loged) {\n sb.append(logDataSeperator).append(paramPack[0][j]).append(logDataSeperator).append(elements[j]);\n }\n if (parameterGenerator.getSclKeyToPWKeyMap().get(pwKeyName).equals(paramPack[0][j])) {\n if (modelNodes instanceof BdaDoubleBitPos) {\n byte[] status = new byte[1];\n if (elements[j].equalsIgnoreCase(\"open\")) {\n status[0] = 0;\n } else {\n status[0] = 1;\n }\n ((BdaDoubleBitPos) modelNodes).setValue(status);\n } else if (modelNodes instanceof BdaVisibleString) {\n ((BdaVisibleString) modelNodes).setValue(elements[j]);\n } else if (modelNodes instanceof BdaFloat32) {\n ((BdaFloat32) modelNodes).setFloat(Float.parseFloat(elements[j]));\n }\n }\n }\n loged = true;\n }\n }\n serverStarted = true;\n// synchronized (logger) {\n// if (ConfigUtil.MANUAL_EXPERIMENT_MODE) {\n // if this string is not printed in the log file,\n logger.info(sb.toString());\n// }\n// }\n sb = new StringBuffer(\"\");\n loged = false;\n serverSap.setValues(branchCircuitBreakerVals);\n if (serverStoped) {\n serverStarted = false;\n break;\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public boolean setupStartSession() { \n\t\tthis.showNamedMessage(\"Initiating session with server...\");\n\t\ttry {\n\t\t\twhile (!this.requestSession()) {\n\t\t\t\ttextUI.getBoolean(\"Try again?\");\n\t\t\t}\n\t\t} catch (IOException | PacketException | UtilDatagramException e) {\n\t\t\ttextUI.showError(\"Something went wrong while starting the session: \" \n\t\t\t\t\t+ e.getLocalizedMessage());\n\t\t}\n\t\t\n\t\treturn this.sessionActive;\n\t}", "private void run() {\n try {\n traceBeginAndSlog(\"InitBeforeStartServices\");\n SystemProperties.set(SYSPROP_START_COUNT, String.valueOf(this.mStartCount));\n SystemProperties.set(SYSPROP_START_ELAPSED, String.valueOf(this.mRuntimeStartElapsedTime));\n SystemProperties.set(SYSPROP_START_UPTIME, String.valueOf(this.mRuntimeStartUptime));\n EventLog.writeEvent((int) EventLogTags.SYSTEM_SERVER_START, Integer.valueOf(this.mStartCount), Long.valueOf(this.mRuntimeStartUptime), Long.valueOf(this.mRuntimeStartElapsedTime));\n if (System.currentTimeMillis() < 86400000) {\n Slog.w(TAG, \"System clock is before 1970; setting to 1970.\");\n SystemClock.setCurrentTimeMillis(86400000);\n }\n if (!SystemProperties.get(\"persist.sys.language\").isEmpty()) {\n SystemProperties.set(\"persist.sys.locale\", Locale.getDefault().toLanguageTag());\n SystemProperties.set(\"persist.sys.language\", \"\");\n SystemProperties.set(\"persist.sys.country\", \"\");\n SystemProperties.set(\"persist.sys.localevar\", \"\");\n }\n Binder.setWarnOnBlocking(true);\n PackageItemInfo.forceSafeLabels();\n SQLiteGlobal.sDefaultSyncMode = \"FULL\";\n SQLiteCompatibilityWalFlags.init((String) null);\n Slog.i(TAG, \"Entered the Android system server!\");\n int uptimeMillis = (int) SystemClock.elapsedRealtime();\n EventLog.writeEvent((int) EventLogTags.BOOT_PROGRESS_SYSTEM_RUN, uptimeMillis);\n if (!this.mRuntimeRestart) {\n MetricsLogger.histogram((Context) null, \"boot_system_server_init\", uptimeMillis);\n Jlog.d(30, \"JL_BOOT_PROGRESS_SYSTEM_RUN\");\n }\n SystemProperties.set(\"persist.sys.dalvik.vm.lib.2\", VMRuntime.getRuntime().vmLibrary());\n VMRuntime.getRuntime().clearGrowthLimit();\n VMRuntime.getRuntime().setTargetHeapUtilization(0.8f);\n Build.ensureFingerprintProperty();\n Environment.setUserRequired(true);\n BaseBundle.setShouldDefuse(true);\n Parcel.setStackTraceParceling(true);\n BinderInternal.disableBackgroundScheduling(true);\n BinderInternal.setMaxThreads(31);\n Process.setThreadPriority(-2);\n Process.setCanSelfBackground(false);\n Looper.prepareMainLooper();\n Looper.getMainLooper().setSlowLogThresholdMs(SLOW_DISPATCH_THRESHOLD_MS, SLOW_DELIVERY_THRESHOLD_MS);\n System.loadLibrary(\"android_servers\");\n if (Build.IS_DEBUGGABLE) {\n initZygoteChildHeapProfiling();\n }\n performPendingShutdown();\n createSystemContext();\n HwFeatureLoader.SystemServiceFeature.loadFeatureFramework(this.mSystemContext);\n this.mSystemServiceManager = new SystemServiceManager(this.mSystemContext);\n this.mSystemServiceManager.setStartInfo(this.mRuntimeRestart, this.mRuntimeStartElapsedTime, this.mRuntimeStartUptime);\n LocalServices.addService(SystemServiceManager.class, this.mSystemServiceManager);\n SystemServerInitThreadPool.get();\n traceEnd();\n try {\n traceBeginAndSlog(\"StartServices\");\n startBootstrapServices();\n startCoreServices();\n startOtherServices();\n SystemServerInitThreadPool.shutdown();\n Slog.i(TAG, \"Finish_StartServices\");\n traceEnd();\n StrictMode.initVmDefaults(null);\n if (!this.mRuntimeRestart && !isFirstBootOrUpgrade()) {\n int uptimeMillis2 = (int) SystemClock.elapsedRealtime();\n MetricsLogger.histogram((Context) null, \"boot_system_server_ready\", uptimeMillis2);\n if (uptimeMillis2 > 60000) {\n Slog.wtf(SYSTEM_SERVER_TIMING_TAG, \"SystemServer init took too long. uptimeMillis=\" + uptimeMillis2);\n }\n }\n LogBufferUtil.closeLogBufferAsNeed(this.mSystemContext);\n if (!VMRuntime.hasBootImageSpaces()) {\n Slog.wtf(TAG, \"Runtime is not running with a boot image!\");\n }\n Looper.loop();\n throw new RuntimeException(\"Main thread loop unexpectedly exited\");\n } catch (Throwable th) {\n Slog.i(TAG, \"Finish_StartServices\");\n traceEnd();\n throw th;\n }\n } catch (Throwable th2) {\n traceEnd();\n throw th2;\n }\n }", "void doRun() throws IOException\n\t{\n\t\tif (m_session != null)\n\t\t{\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"sessionInProgress\")); //$NON-NLS-1$\n\t\t\treturn;\n\t\t}\n\n\t\tSessionManager mgr = Bootstrap.sessionManager();\n\n\t\tif (hasMoreTokens())\n\t\t{\n\t\t\tif (!setLaunchURI(restOfLine()))\n\t\t\t\treturn;\n\t\t}\n\n\t\tif (m_connectPort == null)\n\t\t\tmgr.startListening();\n\n\t\ttry\n\t\t{\n\t\t\tif (m_connectPort != null) {\n\t\t\t\tout(getLocalizationManager().getLocalizedTextString(\"waitingToConnectToPlayer\")); //$NON-NLS-1$\n\t\t\t\tm_session = mgr.connect(Integer.valueOf(m_connectPort), null);\n\t\t\t}\n\t\t\telse if (m_launchURI == null)\n\t\t\t{\n\t\t\t\tout(getLocalizationManager().getLocalizedTextString(\"waitingForPlayerToConnect\")); //$NON-NLS-1$\n\t\t\t\tm_session = mgr.accept(null);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tout(getLocalizationManager().getLocalizedTextString(\"launchingWithUrl\") + m_newline + m_launchURI); //$NON-NLS-1$\n\t\t\t\tm_session = mgr.launch(m_launchURI, null, true, null, null);\n\t\t\t}\n\n\t\t\t// now see what happened\n\t\t\tif (m_session == null)\n\t\t\t{\n\t\t\t\t// shouldn't have gotten here\n\t\t\t\tthrow new SocketTimeoutException();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tout(getLocalizationManager().getLocalizedTextString(\"playerConnectedSessionStarting\")); //$NON-NLS-1$\n\t\t\t\tinitSession(m_session);\n\n\t\t\t\t// pause for a while during startup, don't let exceptions ripple outwards\n\t\t\t\ttry { waitTilHalted(); } catch(Exception e) {}\n\n\t\t\t\t// pause for a while during startup, don't let exceptions ripple outwards\n\t\t\t\ttry { waitForMetaData(); } catch(Exception e) {}\n\n\t\t\t\tsetInitialSourceFile();\n\n\t\t\t\tout(getLocalizationManager().getLocalizedTextString(\"setBreakpointsThenResume\")); //$NON-NLS-1$\n\n\t\t\t\t// now poke to see if the player is good enough\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tif (m_session.getPreference(SessionManager.PLAYER_SUPPORTS_GET) == 0 )\n\t\t\t\t\t\terr(m_newline + getLocalizationManager().getLocalizedTextString(\"warningNotAllCommandsSupported\")); //$NON-NLS-1$\n\t\t\t\t}\n\t\t\t\tcatch(Exception npe) {}\n\t\t\t}\n\t\t}\n\t\tcatch (FileNotFoundException fnf)\n\t\t{\n\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\targs.put(\"uri\", fnf.getLocalizedMessage()); //$NON-NLS-1$\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"fileDoesNotExist\", args)); //$NON-NLS-1$\n\t\t}\n\t\tcatch (SocketTimeoutException ste)\n\t\t{\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"failedToConnect\")); //$NON-NLS-1$\n\t\t}\n\t\tcatch (IOException io)\n\t\t{\n\t\t\terr(io.getLocalizedMessage());\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\t// turn off listening, to allow other session to connect\n\t\t\tif (m_connectPort == null)\n\t\t\t\tmgr.stopListening();\n\t\t}\n\t}", "public void initializeNative(Context context, ServerHTTPSSetting httpsSetting) {\n mContext = context;\n\n Intent intent = new Intent(EMBEDDED_TEST_SERVER_SERVICE);\n setIntentClassName(intent);\n if (!mContext.bindService(intent, mConn, Context.BIND_AUTO_CREATE)) {\n throw new EmbeddedTestServerFailure(\n \"Unable to bind to the EmbeddedTestServer service.\");\n }\n synchronized (mImplMonitor) {\n Log.i(TAG, \"Waiting for EmbeddedTestServer service connection.\");\n while (mImpl == null) {\n try {\n mImplMonitor.wait(SERVICE_CONNECTION_WAIT_INTERVAL_MS);\n } catch (InterruptedException e) {\n // Ignore the InterruptedException. Rely on the outer while loop to re-run.\n }\n Log.i(TAG, \"Still waiting for EmbeddedTestServer service connection.\");\n }\n Log.i(TAG, \"EmbeddedTestServer service connected.\");\n boolean initialized = false;\n try {\n initialized = mImpl.initializeNative(httpsSetting == ServerHTTPSSetting.USE_HTTPS);\n } catch (RemoteException e) {\n Log.e(TAG, \"Failed to initialize native server.\", e);\n initialized = false;\n }\n\n if (!initialized) {\n throw new EmbeddedTestServerFailure(\"Failed to initialize native server.\");\n }\n if (!mDisableResetterForTesting) {\n ResettersForTesting.register(this::stopAndDestroyServer);\n }\n\n if (httpsSetting == ServerHTTPSSetting.USE_HTTPS) {\n try {\n String rootCertPemPath = mImpl.getRootCertPemPath();\n X509Util.addTestRootCertificate(CertTestUtil.pemToDer(rootCertPemPath));\n } catch (Exception e) {\n throw new EmbeddedTestServerFailure(\n \"Failed to install root certificate from native server.\", e);\n }\n }\n }\n }", "@Test\n\tpublic void LaunchAppTest() throws MalformedURLException {\n\n\t\t// Appium Code to Launch the Calculator App without .apk File \n\n\t\tDesiredCapabilities capabilities = new DesiredCapabilities();\n\n\t\tcapabilities.setCapability(\"platformName\", \"Android\");\n\t\tcapabilities.setCapability(MobileCapabilityType.DEVICE_NAME, \"emulator-5554\");\n\t\tcapabilities.setCapability(\"appPackage\", \"com.android.calculator2\");\n\t\tcapabilities.setCapability(\"appActivity\", \"com.android.calculator2.Calculator\");\n\t\tcapabilities.setCapability(\"autoLaunch\", true);\n\t\tAndroidDriver<AndroidElement> driver = new AndroidDriver<AndroidElement>(\n\t\t\t\tnew URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\t\tdriver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);\n\t\tdriver.quit();\n\t}", "public void launch() throws NotBoundException, IOException\n\t{\n\t\t//call method to connect to server\t\t\n\t\tServerManager serverConnect = initialConnect();\t\n\t\n\t\t//get Setup menu from server\n\t\tSetUpMenu newSetup = new SetUpMenu(serverConnect);\n\t\tnewSetup.welcomeMenu();\n\t}", "@Before\n\t public void setUp() throws Exception {\n\t \n\t DesiredCapabilities capabilities = new DesiredCapabilities();\n\t capabilities.setCapability(\"platformName\", \"Android\");\n\t //capabilities.setCapability(\"deviceName\", \"192.168.249.101:5555\");\n\t capabilities.setCapability(\"deviceName\", \"192.168.249.101:5555\");\n\t //capabilities.setCapability(\"deviceName\", \"f97f0457d73\");\n\t //capabilities.setCapability(\"platformVersion\", \"4.3\");\n\t //capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, \"emulator-5554\");\n\t capabilities.setCapability(\"noReset\", \"true\");\n\t capabilities.setCapability(\"unicodeKeyboard\",\"true\"); //输入中文\n\t capabilities.setCapability(\"resetKeyboard\",\"true\"); //输入中文\n\t capabilities.setCapability(\"appPackage\", \"com.worktile\"); //worktile的包\n\t capabilities.setCapability(\"appActivity\", \".ui.external.WelcomeActivity\"); //启动的activity .ui.external.WelcomeActivity\n\t try {\n\t\t\t\t//driver = new AndroidDriver<MobileElement>(new URL(\"http://192.168.31.225:4723/wd/hub\"), capabilities);\n\t\t\t\t//driver = new AndroidDriver<MobileElement>(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\t\t\t\tdriver = new AndroidDriver<MobileElement>(new URL(\"http://192.168.1.104:4723/wd/hub\"), capabilities);\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS); \n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\tdriver.quit();\n\t\t\t\tSystem.err.println(\"launch Android driver fail!\"+e.toString());\n\t\t\t}\n\t }", "public void startApp() {\n if (midletPaused) {\n resumeMIDlet();\n } else {\n initialize();\n startMIDlet();\n }\n midletPaused = false;\n }", "@BeforeTest\n\t\tpublic void setUp() throws MalformedURLException {\n\t\t\t DesiredCapabilities capabilities = new DesiredCapabilities();\n\t\t\t // Set android deviceName desired capability. Set your device name.\n\t\t\t capabilities.setCapability(\"deviceName\", \"Custom Phone - 4.2.2 API 17 - 768*1280\");\n\t\t\t // Set BROWSER_NAME desired capability. It's Android in our case here.\n\t\t\t capabilities.setCapability(\"browserName\", \"Android\");\n\n\t\t\t // Set android VERSION desired capability. Set your mobile device's OS version.\n\t\t\t capabilities.setCapability(\"platformVersion\", \"4.2.2\");\n\n\t\t\t // Set android platformName desired capability. It's Android in our case here.\n\t\t\t capabilities.setCapability(\"platformName\", \"Android\");\n\t\t\t // Created object of RemoteWebDriver will all set capabilities.\n\t\t\t // Set appium server address and port number in URL string.\n\t\t\t // It will launch calculator app in android device.\n\t\t\t // capabilities.setCapability(\"unicodeKeyboard\", true);\n\t\t\t // capabilities.setCapability(\"resetKeyboard\", true);\n\t\t\t driver = new RemoteWebDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\t\t\t driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);\n\t\t\t }", "@BeforeClass\npublic void beforeClass() throws MalformedURLException {\n\tDesiredCapabilities caps = new DesiredCapabilities();\n\tcaps.setCapability(\"deviceName\", \"Xiaomi Redmi Note 5 Pro\");\n caps.setCapability(\"platformName\", \"android\");\n caps.setCapability(\"automationName\", \"UiAutomator2\");\n caps.setCapability(\"appPackage\", \"com.android.chrome\");\n caps.setCapability(\"appActivity\", \"com.google.android.apps.chrome.Main\");\n caps.setCapability(\"noReset\", true);\n\n // Instantiate Appium Driver\n URL appServer = new URL(\"http://0.0.0.0:4723/wd/hub\");\n driver = new AndroidDriver<MobileElement>(appServer, caps);\n \n}", "@BeforeTest\n\tpublic static void loginFunctionality() throws Exception \n\t{\n\t\tDesiredCapabilities cap=new DesiredCapabilities();\n\t\t\n\t\tcap.setCapability(MobileCapabilityType.DEVICE_NAME,\"Redmi\");\n\t\tcap.setCapability(\"udid\", \"6215b09b\");\n\t\tcap.setCapability(\"platformName\", \"Android\");\n\t\tcap.setCapability(\"platformVersion\", \"9 PKQ1.180904.001\");\n\t\tcap.setCapability(\"appPackage\", \"com.danamon.uatomnimicroapps\");\n\t\tcap.setCapability(\"appActivity\", \"com.danamon.uatomnimicroapps.MainActivity\");\n\t\tcap.setCapability(\"noReset\", true);\n\t\tcap.setCapability(\"fullReset\",false);\n\t\t\n\t\t\n\t\t\n\t\tURL url=new URL(\"http://127.0.0.1:4723/wd/hub\");\n\t\t\n\t\t\n\t\tdriver=new AndroidDriver<AndroidElement>(url,cap);\n\t\tSystem.out.println(\"application started..\");\n\t\t//Thread.sleep(50000);\n\t\tdriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\n\t\t\n\t\t/*\n\t\t MobileElement el1 = (MobileElement) driver.findElementByXPath(\"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View[5]/android.view.View/android.view.View[2]/android.view.View[1]/android.view.View[1]/android.view.View[2]\");\n\t\t \n\t\tel1.click();\n\t\tMobileElement el2 = (MobileElement) driver.findElementByXPath(\"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View[5]/android.view.View/android.view.View[2]/android.view.View[2]/android.view.View[2]/android.view.View/android.view.View[1]/android.widget.EditText\");\n\t\tel2.sendKeys(\"perfomni1\");\n\t\t\n\t\tMobileElement el3=(MobileElement)driver.findElementByXPath(\"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View[5]/android.view.View/android.view.View[2]/android.view.View[2]/android.view.View[2]/android.view.View/android.view.View[1]/android.view.View[3]/android.widget.EditText\");\n\t\t\n\n\tel3.sendKeys(\"Reskin01\");\n\tdriver.findElementByXPath(\"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View[5]/android.view.View/android.view.View[2]/android.view.View[2]/android.view.View[2]/android.view.View/android.view.View[1]/android.widget.Button[1]\").click();\n\t\tThread.sleep(220000);\n\t\t\n\n\t\t//MobileElement el4=(MobileElement)driver.findElementByXPath(\"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View[5]/android.view.View/android.view.View[2]/android.view.View[2]/android.view.View[2]/android.view.View/android.view.View[1]/android.view.View[3]/android.widget.EditText\");\n\t\t\n\n\t\t//el4.sendKeys(\"Reskin01\");\n\t\t \n\t\t */\n\t\t\n\t\tMobileElement el5 = (MobileElement) driver.findElementByXPath(\"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View[5]/android.view.View/android.view.View[2]/android.view.View[2]/android.view.View[2]/android.view.View/android.view.View[1]/android.view.View[2]/android.widget.EditText\");\n\t\tel5.sendKeys(\"Reskin01\");\n\n\t\tdriver.findElementByXPath(\"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View[5]/android.view.View/android.view.View[2]/android.view.View[2]/android.view.View[2]/android.view.View/android.view.View[1]/android.widget.Button\").click();\n\t\n\t\t\t\t}", "private void launchRemote(Stage stage) throws Exception { \n\t\tmenuMessage.setText(\"Game will start as soon as the client is connected...\"); \n\t\t\n\t\t// thread of the server connecting to the game and of the game \n\t\tThread serverThread = new Thread(() -> { \n\t\t\tRemotePlayerServer server = new RemotePlayerServer(new GraphicalPlayerAdapter()); \n\t\t\tserver.run(); \n\t\t }); \n\t\tserverThread.setDaemon(true); \n\t\tserverThread.start(); \n\t }", "RemoteWebDriver getDriver(String appName, String appPackage, String appActivity, String deviceName,\n\t\t\tString fileName) {\n\t\tDesiredCapabilities androidDcap = new DesiredCapabilities();\n\t\tandroidDcap.setCapability(MobileCapabilityType.AUTOMATION_NAME, \"UIAutomator2\");\n\t\tandroidDcap.setCapability(MobileCapabilityType.PLATFORM_NAME, \"Android\");\n\t\tandroidDcap.setCapability(AndroidMobileCapabilityType.AUTO_GRANT_PERMISSIONS, true);\n\t\tandroidDcap.setCapability(MobileCapabilityType.NO_RESET, true);\n\t\tandroidDcap.setCapability(MobileCapabilityType.FULL_RESET, false);\n\t\tandroidDcap.setCapability(AndroidMobileCapabilityType.NO_SIGN, true);\n\t\tandroidDcap.setCapability(AndroidMobileCapabilityType.APP_WAIT_DURATION, 120);\n\t\tandroidDcap.setCapability(\"deviceName\", deviceName);\n\t\tandroidDcap.setCapability(\"browserName\", \"\");\n\t\tandroidDcap.setCapability(\"newCommandTimeout\", 1500);\n\t\tandroidDcap.setCapability(\"appPackage\", appPackage);\n\t\tandroidDcap.setCapability(\"appActivity\", appActivity);\n\t\tandroidDcap.setCapability(\"autoAcceptAlerts\", true);\n\t\tandroidDcap.setCapability(\"autoDismissAlerts\", true);\n\t\tandroidDcap.setCapability(\"app\", System.getProperty(\"user.dir\") + \"/src/main/resources\" + fileName);\n\t\ttry {\n\t\t\tif (System.getProperty(\"location\").equalsIgnoreCase(\"local\")) {\n\t\t\t\tdriver = new AndroidDriver<>(new URL(\"http://127.0.0.1:4651/wd/hub\"), androidDcap);\n\t\t\t\tlogger.info(\"Session ID of Android: \" + driver.getSessionId());\n\t\t\t} else if (System.getProperty(\"location\").equalsIgnoreCase(\"remote\")) {\n\t\t\t\tdriver = new AndroidDriver<>(new URL(PropertyHelper.getProperties(\"REMOTE_HUB_URL\")), androidDcap);\n\t\t\t\tlogger.info(\"Session ID of Android: \" + driver.getSessionId());\n\t\t\t}\n\t\t} catch (WebDriverException e) {\n\t\t\tlogger.error(\"Driver instantiating failed or app is not installed\", e);\n\t\t} catch (MalformedURLException e) {\n\t\t\tlogger.error(e);\n\t\t}\n\t\tdriver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);\n\t\tDriverFactory.getDriverPool().put(appName, driver);\n\t\treturn driver;\n\t}", "static void startSession() {\n /*if(ZeTarget.isDebuggingOn()){\n Log.d(TAG,\"startSession() called\");\n }*/\n if (!isContextAndApiKeySet(\"startSession()\")) {\n return;\n }\n final long now = System.currentTimeMillis();\n\n runOnLogWorker(new Runnable() {\n @Override\n public void run() {\n logWorker.removeCallbacks(endSessionRunnable);\n long previousEndSessionId = getEndSessionId();\n long lastEndSessionTime = getEndSessionTime();\n if (previousEndSessionId != -1\n && now - lastEndSessionTime < Constants.Z_MIN_TIME_BETWEEN_SESSIONS_MILLIS) {\n DbHelper dbHelper = DbHelper.getDatabaseHelper(context);\n dbHelper.removeEvent(previousEndSessionId);\n }\n //startSession() can be called in every activity by developer, hence upload events and sync datastore\n // only if it is a new session\n //syncToServerIfNeeded(now);\n startNewSessionIfNeeded(now);\n\n openSession();\n\n // Update last event time\n setLastEventTime(now);\n //syncDataStore();\n //uploadEvents();\n\n }\n });\n }", "public void startClientServer() {\n try {\n this.server_socket = new ServerSocket( port );\n this.start();\n } catch (IOException e ) {\n System.err.println( \"Failure: Socket couldn't OPEN! -> \" + e );\n } finally {\n System.out.println( \"Success: Server socket is now Listening on port \" + port + \"...\" );\n }\n }", "@BeforeTest\n public void appiumBrowserTestSetup() throws Exception{\n DesiredCapabilities capabilities = DesiredCapabilities.android();\n\n // set the capability to execute test in chrome browser\n capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, BrowserType.CHROME);\n\n // set the capability to execute our test in Android Platform\n capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, Platform.ANDROID);\n\n // Set the device name as well (you can give any name)\n capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, \"emulator-5554\");\n\n // set the android version as well\n capabilities.setCapability(MobileCapabilityType.VERSION, \"9\");\n\n // set the chromedriver\n capabilities.setCapability(\"chromedriverExecutable\",\"C:\\\\drivers\\\\chromedriver.exe\");\n\n // Create object of URL class and specify the appium server address\n URL url = new URL(\"http://127.0.0.1:4723/wd/hub\");\n\n // Create object of AndroidDriver class and pass the url and capability that we\n // created\n driver = new AppiumDriver(url, capabilities);\n\n driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);\n driver.get(\"https://www.amazon.co.uk/\");\n Thread.sleep(5000);\n }", "public static void main(String args[]) throws MalformedURLException, InterruptedException {\n\n\tDesiredCapabilities caps = new DesiredCapabilities();\n\t//caps.setCapability(\"browserName\", \"\");\n\tcaps.setCapability(\"platform\", \"iOS\");\n\tcaps.setCapability(\"deviceName\", \"iPhone 6\");\n\tcaps.setCapability(\"platformVersion\", \"9.0\");\n\tcaps.setCapability(\"waitForAppScript\", \"$.delay(10000); $.acceptAlert();\");\n\t//caps.setCapability(\"autoWebview\", \"true\");\n\t//caps.setCapability(\"appPackage\", \"com.apptivateme.next.ct\");\n\t//caps.setCapability(\"appActivity\", \"com.tribune.universalnews.MainActivity\");\n\tcaps.setCapability(\"appiumVersion\", \"1.4.14\");\n\tcaps.setCapability(\"app\", \"sauce-storage:CT_iOS.zip\");\n\t\n\tURL sauceUrl = new URL(\"http://shnakeygarg:66c91399-8cfb-46ca-a2da-f09c2ce5f170@ondemand.saucelabs.com:80/wd/hub\");\n\n\tIOSDriver driver = new IOSDriver(sauceUrl, caps);\n\n\t// driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\tWebDriverWait waitvar = new WebDriverWait(driver,90);\n\n\tThread.sleep(5000);\n\n\twaitvar.until(ExpectedConditions.elementToBeClickable(driver.findElementByIosUIAutomation(\".buttons()[0]\")));\n\tdriver.findElementByIosUIAutomation(\".buttons()[0]\").click();\n\twaitvar.until(ExpectedConditions.elementToBeClickable(driver.findElementByIosUIAutomation(\".buttons()[0]\")));\n\tdriver.findElementByIosUIAutomation(\".buttons()[0]\").click();\n\twaitvar.until(ExpectedConditions.elementToBeClickable(driver.findElementByIosUIAutomation(\".buttons()[0]\")));\n\tdriver.findElementByIosUIAutomation(\".buttons()[0]\").click();\n\twaitvar.until(ExpectedConditions.elementToBeClickable(driver.findElementByIosUIAutomation(\".buttons()[0]\")));\n\tdriver.findElementByIosUIAutomation(\".buttons()[0]\").click();\n\n\tfinal Date date1 = new Date();\n System.out.println(\"findElementByIosUIAutomation\" );\n \n //UIAApplication[1]/UIAWindow[1]/UIACollectionView[1]/UIACollectionCell[2]/UIATableView[1]/UIATableCell[2]\n waitvar.until(ExpectedConditions.elementToBeClickable(MobileBy.IosUIAutomation(\".collectionViews()[0].cells()[1].tableViews()[0].cells()[1].withPredicate(\\\"ALL staticTexts.isVisible == TRUE\\\")\")));\n //waitvar.until(ExpectedConditions.elementToBeClickable(driver.findElementByIosUIAutomation(\".collectionViews()[0].cells()[1].tableViews()[0].cells()[1].withPredicate(\\\"ALL staticTexts.isVisible == TRUE\\\")\")));\n WebElement firstArtile = driver.findElementByIosUIAutomation(\".collectionViews()[0].cells()[1].tableViews()[0].cells()[1].withPredicate(\\\"ALL staticTexts.isVisible == TRUE\\\")\");\n firstArtile.click();\n System.out.println(\"clicked element1\");\n\n final Date date2 = new Date();\n\n //UIAApplication[1]/UIAWindow[1]/UIANavigationBar[1]/UIAButton[1]\n waitvar.until(ExpectedConditions.elementToBeClickable(driver.findElementByIosUIAutomation(\".navigationBars()[0].buttons()[0]\")));\n\tdriver.findElementByIosUIAutomation(\".navigationBars()[0].buttons()[0]\").click();\n final Date date3 = new Date();\n/*\n System.out.println(\"\\n\\n\\n\\nxpath\\n\\n\\n\\n\");\n\n waitvar.until(ExpectedConditions.elementToBeClickable(By.xpath(\"//UIAApplication[1]/UIAWindow[1]/UIACollectionView[1]/UIACollectionCell[2]/UIATableView[1]/UIATableCell[2]\")));\n driver.findElement(By.xpath(\"//UIAApplication[1]/UIAWindow[1]/UIACollectionView[1]/UIACollectionCell[2]/UIATableView[1]/UIATableCell[2]\")).click();\n\n final Date date4 = new Date();\n\n waitvar.until(ExpectedConditions.elementToBeClickable(driver.findElementByName(\"header back\")));\n\n driver.findElement(By.name(\"header back\")).click();\n */\n final Date date5 = new Date();\n System.out.println(\"IOS Automator :\" + (date2.getTime() - date1.getTime()));\n System.out.println(\"Back :\" + (date3.getTime() - date2.getTime()));\n\n //System.out.println(\"XPath :\" + (date4.getTime() - date3.getTime()));\n //System.out.println(\"Back :\" + (date5.getTime() - date4.getTime()));\n\tThread.sleep(5000);\n\tdriver.quit();\n\tSystem.out.println(\"done\");\n }", "@BeforeTest\r\n\tpublic void setup() {\n\t\t\t\tDesiredCapabilities caps = new DesiredCapabilities();\r\n\t\t\t\tcaps.setCapability(\"deviceName\", \"Abhi Phone\");\r\n\t\t\t\tcaps.setCapability(\"udid\", \"FXYDU17916004799\"); //Give Device ID of your mobile phone\r\n\t\t\t\tcaps.setCapability(\"platformName\", \"Android\");\r\n\t\t\t\tcaps.setCapability(\"platformVersion\", \"9.0\");\r\n\t\t\t\tcaps.setCapability(\"appPackage\", \"com.wdc.ibi\");\r\n\t\t\t\tcaps.setCapability(\"appActivity\", \"com.kamino.wdt.MainActivity\");\r\n\t\t\t\tcaps.setCapability(\"noReset\", \"true\");\r\n\t\t\t\tcaps.setCapability(\"unicodeKeyboard\", true);\r\n\t\t\t\tcaps.setCapability(\"resetKeyboard\", true);\r\n\t\t\t\t\r\n\t\t\t\t//Instantiate Appium Driver\r\n\t\r\n\t\t\t\ttry {\t\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\tURL url= new URL(\"http://0.0.0.0:4723/wd/hub\");\r\n\t\t\t\t\t\tdriver = new AndroidDriver<MobileElement>(url, caps);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//WebDriverWait wait = new WebDriverWait(driver, 10);\r\n\t\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t\t\t//driver.findElementByClassName(\"android.widget.TextView\").click();\r\n\t\t\t\t\t\t//wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//*[@text ='I Agree']\"))).click();\r\n\t\t\t\t\t\t//driver.findElement(By.xpath(\"//*[@text ='I Agree']\")).click();\r\n\t\t\t\t\t\t//wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//*[@text ='SIGN IN']\"))).click();\r\n\t\t\t\t\t\tdriver.findElement(By.xpath(\"//*[@text ='SIGN IN']\")).click();\r\n\t\t\t\t\t\tdriver.findElement(By.xpath(\"//*[@text ='Email address']\")).sendKeys(\"mobappw+abtest@gmail.com\");\r\n\t\t\t\t\t\tdriver.findElement(By.xpath(\"//*[@text ='Password']\")).sendKeys(\"Admin@555\");\r\n\t\t\t\t\t\tdriver.findElement(By.xpath(\"//*[@text ='CONTINUE']\")).click();\r\n\t\t\t\t\t\tSystem.out.println(\"Signed In Successfuly\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t} catch (MalformedURLException e) {\r\n\t\t\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\t\t}\t\t\r\n\t\t\t\r\n\t}", "@BeforeClass\n public void beforeClass() throws MalformedURLException {\n DesiredCapabilities desiredCapabilities = new DesiredCapabilities();\n desiredCapabilities.setCapability(\"deviceName\", \"Pixel_4_emulator\");\n desiredCapabilities.setCapability(\"platformName\", \"android\");\n desiredCapabilities.setCapability(\"automationName\", \"UiAutomator2\");\n desiredCapabilities.setCapability(\"noReset\", true);\n desiredCapabilities.setCapability(\"appPackage\", \"com.google.android.apps.messaging\");\n desiredCapabilities.setCapability(\"appActivity\", \".ui.ConversationListActivity\");\n\n // Instantiate Appium Driver\n URL appServer = new URL(\"http://0.0.0.0:4723/wd/hub\");\n driver = new AndroidDriver<MobileElement>(appServer, desiredCapabilities);\n wait = new WebDriverWait(driver, 5);\n }", "public void run() { wait for the launcher script to talk to us\n //\n try {\n ssocket.setSoTimeout(30 * 1000); // 30 seconds\n socket = ssocket.accept();\n socket.setSoTimeout(3 * 60 * 1000);\n socket.setTcpNoDelay(true);\n } catch (SocketTimeoutException stmo) {\n String msg = \"timeout error on initial connection from \" + execName();\n task.log(msg, Project.MSG_ERR);\n failure = new BuildException(msg);\n } catch (Exception e) {\n String err = \"error establishing communication with \" + execName();\n String msg = e.getMessage();\n if (msg != null) {\n err = err + \": \" + msg;\n } else {\n err = err + \": \" + e;\n }\n task.log(err, Project.MSG_ERR);\n failure = new BuildException(err);\n }\n }", "public void run() {\n Runtime.getRuntime().addShutdownHook(new MNOSManagerShutdownHook(this));\n\n OFNiciraVendorExtensions.initialize();\n\n this.startDatabase();\n\n try {\n final ServerBootstrap switchServerBootStrap = this\n .createServerBootStrap();\n\n this.setServerBootStrapParams(switchServerBootStrap);\n\n switchServerBootStrap.setPipelineFactory(this.pfact);\n final InetSocketAddress sa = this.ofHost == null ? new InetSocketAddress(\n this.ofPort) : new InetSocketAddress(this.ofHost,\n this.ofPort);\n this.sg.add(switchServerBootStrap.bind(sa));\n }catch (final Exception e){\n throw new RuntimeException(e);\n }\n\n }", "public static void startServer() {\n clientListener.startListener();\n }", "@Override\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\tString[] notify_cmd={\"msg\",user,\"启动中\"};\n\t\t\t\t\t\t\t\tdisplayText(\"启动中\");\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tRuntime.getRuntime().exec(notify_cmd);\n\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(p.getInputStream()));\n\t\t\t\t\t\t\t\tString mssage_in=\"appium msg\";\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\twhile(true){\n\t\t\t\t\t\t\t\t\t\tif((mssage_in=br.readLine())!=null){\n\t\t\t\t\t\t\t\t\t\t\tMyFrame.displayText(mssage_in);\n\t\t\t\t\t\t\t\t\t\t\tpw.println(mssage_in);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}", "public void stopAppium() throws Exception {\n String OS = System.getProperty(\"os.name\").toLowerCase();\n try {\n stopAppiumServer(OS);\n LOGGER.info(\"Appium server stopped successfully\");\n } catch (Exception e) {\n LOGGER.warn(\"Unable to stop appium server\");\n throw new TapException(TapExceptionType.PROCESSING_FAILED, \"Unable to stop appium server\");\n }\n }", "@BeforeClass\npublic void beforeClass() throws MalformedURLException {\n DesiredCapabilities caps = new DesiredCapabilities();\n caps.setCapability(\"deviceName\", \"Xiaomi Redmi Note 5 Pro\");\n caps.setCapability(\"platformName\", \"android\");\n caps.setCapability(\"automationName\", \"UiAutomator2\");\n caps.setCapability(\"appPackage\", \"com.google.android.keep\");\n caps.setCapability(\"appActivity\", \".activities.BrowseActivity\");\n caps.setCapability(\"noReset\", true);\n\n // Instantiate Appium Driver\n URL appServer = new URL(\"http://0.0.0.0:4723/wd/hub\");\n driver = new AndroidDriver<MobileElement>(appServer, caps);\n \n}", "public void startServer() throws Exception {\n \t\ttry {\n \t\t\t// Instruct the robot to begin now\n\t \tout.write(RBCConstants.ROBOT_BEGIN);\n\t \tout.flush();\n\n\t\t\t// Now go into the infinite loop to do communications, return when server stopped or interrupted\n\t\t startListening(in, out);\n\n\t\t // All done, close the connection\n\t\t closeEverything();\n\t\t rb.showRobotDisconnected();\n\t } catch (InterruptedIOException e) {\n\t \tcloseEverything();\n\t \trb.showRobotDisconnected();\n \t\t} catch (IOException e) {\n\t\t rb.updateStatusBar(\"Unable to Start Robot\", Color.black);\n\t\t System.out.println(\"Unable to Start Robot\");\n\t\t\tcloseEverything();\n\t\t\trb.showRobotDisconnected();\n \t\t}\n }", "private void launchApplication() {\n driver.manage().deleteAllCookies();\n driver.get(config.getProperty(\"testSiteUrl\"));\n driver.manage().window().maximize();\n driver.manage().timeouts().implicitlyWait(Integer.parseInt(config.getProperty(\"implicit.wait\")), TimeUnit.SECONDS);\n }", "@Test(groups={\"ut\"})\r\n\tpublic void testCreateCapabilitiesWithApplication() {\r\n\t\tSeleniumTestsContext context = new SeleniumTestsContext(SeleniumTestsContextManager.getThreadContext());\r\n\t\tcontext.setMobilePlatformVersion(\"8.0\");\r\n\t\tcontext.setPlatform(\"android\");\r\n\t\tcontext.setDeviceName(\"Samsung Galasy S8\");\r\n\t\tcontext.setAppPackage(\"appPackage\");\r\n\t\tcontext.setAppActivity(\"appActivity\");\r\n\t\tcontext.setApp(\"com.covea.mobileapp\");\r\n\t\tDriverConfig config = new DriverConfig(context);\r\n\t\t\r\n\t\tAndroidCapabilitiesFactory capaFactory = new AndroidCapabilitiesFactory(config);\r\n\t\tMutableCapabilities capa = capaFactory.createCapabilities();\r\n\t\t\r\n\t\tAssert.assertEquals(capa.getCapability(CapabilityType.BROWSER_NAME), \"\");\r\n\t\tAssert.assertEquals(capa.getCapability(\"app\"), \"com.covea.mobileapp\");\r\n\t\tAssert.assertEquals(capa.getCapability(MobileCapabilityType.AUTOMATION_NAME), \"Appium\");\r\n\t\tAssert.assertEquals(capa.getCapability(MobileCapabilityType.PLATFORM_NAME), \"android\");\r\n\t\tAssert.assertEquals(capa.getCapability(MobileCapabilityType.PLATFORM_VERSION), \"8.0\");\r\n\t\tAssert.assertEquals(capa.getCapability(MobileCapabilityType.DEVICE_NAME), \"Samsung Galasy S8\");\r\n\t\tAssert.assertEquals(capa.getCapability(MobileCapabilityType.FULL_RESET), true);\r\n\t\tAssert.assertEquals(capa.getCapability(AndroidMobileCapabilityType.APP_PACKAGE), \"appPackage\");\r\n\t\tAssert.assertEquals(capa.getCapability(AndroidMobileCapabilityType.APP_ACTIVITY), \"appActivity\");\r\n\t}", "@BeforeClass\n public void beforeClass() throws MalformedURLException {\n DesiredCapabilities caps = new DesiredCapabilities();\n caps.setCapability(\"deviceName\", \"bb9d156c\");\n caps.setCapability(\"platformName\", \"Android\");\n caps.setCapability(\"appPackage\", \"com.google.android.apps.tasks\");\n caps.setCapability(\"appActivity\", \".ui.TaskListsActivity\");\n // caps.setCapability(\"noReset\", true);\n\n // Instantiate Appium Driver\n URL appServer = new URL(\"http://0.0.0.0:4723/wd/hub\");\n driver = new AndroidDriver<MobileElement>(appServer, caps);\n \n }", "@Test\r\n\tpublic void startapp() {\n\t\tdriver.get(\"http://q.door.fund/\");\r\n\t\tdriver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);\r\n\t\tString currentURL = driver.getCurrentUrl();\r\n\t\tAssert.assertTrue(currentURL.contains(\"q.door.fund\"));\r\n\t\tSystem.out.println(\"Application loaded\");\r\n\t}", "private ServerSocket setUpServer(){\n ServerSocket serverSocket = null;\n try{\n serverSocket = new ServerSocket(SERVER_PORT);\n\n }\n catch (IOException ioe){\n throw new RuntimeException(ioe.getMessage());\n }\n return serverSocket;\n }", "public void start() {\n _serverRegisterProcessor = new ServerRegisterProcessor();\n _serverRegisterProcessor.start();\n }", "public void startServer() {\n\r\n try {\r\n echoServer = new ServerSocket(port);\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n // Whenever a connection is received, start a new thread to process the connection\r\n // and wait for the next connection.\r\n while (true) {\r\n try {\r\n clientSocket = echoServer.accept();\r\n numConnections++;\r\n ServerConnection oneconnection = new ServerConnection(clientSocket, numConnections, this);\r\n new Thread(oneconnection).start();\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n }\r\n\r\n }", "public void startApp() {\n if (midletPaused) {\n resumeMIDlet ();\n } else {\n initialize ();\n startMIDlet ();\n }\n midletPaused = false;\n }", "public void startApp() {\n if (midletPaused) {\n resumeMIDlet ();\n } else {\n initialize ();\n startMIDlet ();\n }\n midletPaused = false;\n }", "public RemoteWebDriver startApp(String url) {\n\t\treturn startApp(\"chrome\", url);\r\n\t}", "private static void startServer(){\n try{\n MMServer server=new MMServer(50000);\n }catch (IOException ioe){\n System.exit(0);\n }\n \n }", "@BeforeClass\n public void beforeClass() throws MalformedURLException {\n\t DesiredCapabilities caps = new DesiredCapabilities();\n\t caps.setCapability(\"devicename\", \"Pixel\");\n\t caps.setCapability(\"platform\", \"Android\");\n\t caps.setCapability(\"addActivity\", \".ui.TaskListsActivity\");\n\t caps.setCapability(\"addPackage\", \"com.google.android.apps.tasks\");\n\t caps.setCapability(\"noReset\", true);\n\t caps.setCapability(\"webviewDevtoolsPort\", 9543);\n\t \n\t //instantiate appium driver\n\t URL appserver = new URL(\"http://0.0.0.0:4723/wd/hub\");\n\t driver = new AndroidDriver<MobileElement>(appserver,caps);\n\t wait = new WebDriverWait(driver, 5);\n }", "public void start() {\r\n\t\tString osName = System.getProperty(\"os.name\");\r\n\t\tif (osName.contains(\"Mac\")) {\r\n\t\t\tgameThread.run();\r\n\t\t} else {\r\n\t\t\tgameThread.start();\r\n\t\t}\r\n\t}", "public static DesiredCapabilities setAppCapabilities() {\n\t\tDesiredCapabilities capabilities = new DesiredCapabilities();\n\t\tString appID = PropertyFileHandler.getPropertyFromConfig(ConfigPropertyKeys.appID);\n\t\tcapabilities.setCapability(\"app\", appID + \"!App\");\n\t\treturn capabilities;\n\t}", "private void installLocalOrRemote() {\n CommandPacket startCommandPacket = null;\n //直到成功为止,控制台可能重启、网络问题等原因\n //TODO\n int time = 0;\n while ((startCommandPacket = getStartCommandPacket()) == null){\n try {\n time ++;\n if(time == 20){\n String defaultRegister = \"zookeeper\";\n String register = agentConfig.getProperty(\"register.name\", defaultRegister);\n if(defaultRegister.equals(register)){\n logger.error(\"经过10s尝试启动simulator失败, 请确认控制台是否正常\");\n }\n break;\n }\n logger.error(\"启动simulator获取远程失败,休眠500ms重试,请确认控制台是否正常\");\n Thread.sleep(500 );\n } catch (InterruptedException ignore) {\n }\n }\n\n if(startCommandPacket == null){\n startCommandPacket = new CommandPacket();\n // 启动\n startCommandPacket.setId(HeartCommandConstants.startCommandId);\n Map<String, Object> extras = new HashMap<String, Object>();\n extras.put(HeartCommandConstants.PATH_TYPE_KEY, HeartCommandConstants.PATH_TYPE_LOCAL_VALUE);\n // 使用本地探针包\n startCommandPacket.setExtras(extras);\n }\n install(startCommandPacket);\n }", "public void start() {\n System.out.println(\"server started\");\n mTerminalNetwork.listen(mTerminalConfig.port);\n }", "public void startServer() throws IOException {\n log.info(\"Starting server in port {}\", port);\n try {\n serverSocket = new ServerSocket(port);\n this.start();\n log.info(\"Started server. Server listening in port {}\", port);\n } catch (IOException e) {\n log.error(\"Error starting the server socket\", e);\n throw e;\n }\n }", "public void startApp()\r\n\t{\n\t}", "public void stopAppiumServer(String os) throws ExecuteException, IOException {\n if (os.contains(\"windows\")) {\n CommandLine command = new CommandLine(\"cmd\");\n command.addArgument(\"/c\");\n command.addArgument(\"Taskkill /F /IM node.exe\");\n\n DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();\n DefaultExecutor executor = new DefaultExecutor();\n executor.setExitValue(1);\n executor.execute(command, resultHandler);\n } else if (os.contains(\"mac os x\")) {\n String[] command = {\"/usr/bin/killall\", \"-KILL\", \"node\"};\n Runtime.getRuntime().exec(command);\n LOGGER.info(\"Appium server stopped\");\n }\n }", "public synchronized void start() {\n\t\trunning=true;\n\t\tnew Thread(this).start();\n\t\t\n\t\tif(JOptionPane.showConfirmDialog(this, \"Do you want to run the server\")==0){\n\t\t\tsocketServer = new GameServer(this);\n\t\t\tsocketServer.start();\n\t\t\t\n\t\t}\n\t\tsocketClient=new GameClient(this, \"localhost\");\n\t\tsocketClient.start();\n\t}", "public void start() {\n threadPoolExecutor.setCorePoolSize(configurations.threadPoolSize());\n new Thread(this::startServer).start();\n }", "public void startServer(View view) {\n Log.d(TAG, \"Server Starting........\");\n checkConnection();\n\n }", "public static String startServer() throws QVCSException, IOException {\n System.out.println(Thread.currentThread().getName() + \"********************************************************* TestHelper.startServer\");\n String serverStartSyncString = null;\n if (serverProxyObject == null) {\n // So the server starts fresh.\n initDirectories();\n\n // So the server uses a project property file useful for the machine the tests are running on.\n initProjectProperties();\n\n // For unit testing, listen on the 2xxxx ports.\n serverStartSyncString = \"Sync server start\";\n String userDir = System.getProperty(USER_DIR);\n File userDirFile = new File(userDir);\n String canonicalUserDir = userDirFile.getCanonicalPath();\n final String args[] = {canonicalUserDir, \"29889\", \"29890\", \"29080\", serverStartSyncString};\n serverProxyObject = new Object();\n ServerResponseFactory.setShutdownInProgress(false);\n Runnable worker = new Runnable() {\n\n @Override\n public void run() {\n try {\n QVCSEnterpriseServer.main(args);\n } catch (Exception e) {\n LOGGER.log(Level.SEVERE, Utility.expandStackTraceToString(e));\n }\n }\n };\n synchronized (serverStartSyncString) {\n try {\n // Put all this on a separate worker thread.\n new Thread(worker).start();\n serverStartSyncString.wait();\n }\n catch (InterruptedException e) {\n LOGGER.log(Level.SEVERE, Utility.expandStackTraceToString(e));\n }\n }\n } else {\n if (QVCSEnterpriseServer.getServerIsRunningFlag()) {\n System.out.println(Thread.currentThread().getName() + \"********************************************************* TestHelper.startServer -- server already running.\");\n serverProxyObject = null;\n throw new QVCSRuntimeException(\"Starting server when server already running!\");\n }\n }\n LOGGER.log(Level.INFO, \"********************************************************* TestHelper returning from startServer\");\n return (serverStartSyncString);\n }", "public static void main(String[] args) throws MalformedURLException, InterruptedException {\n\t\t\n\t\tFile app= new File(\"E:/Testing/Drag_and_Drop/com.mobeta.android.demodslv.apk\");\n\t\t\n\t\t\n\t\tDesiredCapabilities capabilities= new DesiredCapabilities();\n\t\t\n\t\tcapabilities.setCapability(\"deviceName\", \"XT1033\");\n\t\tcapabilities.setCapability(\"platformName\", \"Android\");\n\t\tcapabilities.setCapability(\"platformVersion\", \"4.4.4\");\n\t\t\n\t\t//app details\n\t\tcapabilities.setCapability(\"app\",app.getAbsolutePath());\n\t\t\n\t\t//Appium details\n\t\t\n\t\tAndroidDriver driver= new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\n\t\tThread.sleep(12000);\n\t\t\n\t\tif(driver.isAppInstalled(\"com.mobeta.android.demodslv\"))\n\t\t{\n\t\t\tSystem.out.println(\"Successfully Installed\");\n\t\t\t\n\t\t\t//Remove thrugh code\n\t\t\tdriver.removeApp(\"com.mobeta.android.demodslv\");\n\t\t\tThread.sleep(8000);\n\t\t\tSystem.out.println(\"Removed sucessfully\");\n\t\t\t\n\t\t\t\n\t\t\tdriver.installApp(\"E:/Testing/Drag_and_Drop/com.mobeta.android.demodslv.apk\");\n\t\t\tThread.sleep(8000);\n\t\t\tSystem.out.println(\"Again Installed the app\");\n\t\t\t\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"NOT Installed the app\");\n\t\t}\n\n\t\t\n\n\t}", "@BeforeClass\r\n\tpublic void setup() throws InterruptedException {\r\n\t test=extent.createTest(\"setup\");\r\n\t\tDesiredCapabilities caps = new DesiredCapabilities();\r\n\t\tcaps.setCapability(\"deviceName\", \"My Phone\");\r\n\t\tcaps.setCapability(\"udid\", \"emulator-5554\"); //Give Device ID of your mobile phone\r\n\t\tcaps.setCapability(\"platformName\", \"Android\");\r\n\t\tcaps.setCapability(\"platformVersion\", \"7.0\");\r\n\t\tcaps.setCapability(\"browser_name\", \"Chrome\");\r\n\t\t\r\n\t\tcaps.setCapability(\"appPackage\", \"pegasus.driver\");\r\n\t\tcaps.setCapability(\"appActivity\", \"pegasus.driver.mvvm.auth.AuthActivity\");\r\n\t\t\r\n\t\tcaps.setCapability(\"noReset\", \"false\");\r\n\t\tcaps.setCapability(\"automationName\", \"UiAutomator2\");\r\n\t\tcaps.setCapability(\"newCommandTimeout\", 10000);\r\n\t\tcaps.setCapability(\"autoGrantPermissions\", true);\r\n\t\tcaps.setCapability(\"autoDismissAlerts\", true);\r\n\t\r\n\t\ttry {\r\n\t\t\t String baseURL = \"http://0.0.0.0:\";\r\n\t\t\t String minorURL = \"/wd/hub\";\r\n\t\t\t String port = \"4723\";\r\n\t\t\t //driver = new AppiumDriver<MobileElement>(new URL(baseURL+port+minorURL), caps);\t\r\n\t\t\t driver = new AndroidDriver<MobileElement>(new URL(baseURL+port+minorURL), caps);\t\r\n\t\t\t //driver = new IOSDriver<MobileElement>(new URL(baseURL+port+minorURL), caps);\t\r\n\t\t\t\t \r\n\t\t\t System.out.print(\"passed!!!!!!\");\r\n\t\t} \r\n\t\t\r\n\t\tcatch (MalformedURLException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\tSystem.out.print(\"failed!!!!!!\");\r\n\t\t}\r\n\t\t\r\n\t\tdriver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);\r\n\t\t\r\n\t\t driver.findElement(LoginPage.companyId).sendKeys(\"1111\");\r\n\t\t \r\n\t\t //Enter vehicle id\r\n\t\t driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\r\n\t\t driver.findElement(LoginPage.vehicleId).sendKeys(\"11\");\r\n\t\t\t\r\n\t\t //enter pin number\r\n\t\t\tdriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\r\n\t\t\tdriver.findElement(LoginPage.pinNum).sendKeys(\"1234\");\r\n\t\t\t\r\n\t\t\t//click on login button\r\n\t\t\tdriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\r\n\t\t\tdriver.findElement(LoginPage.LoginBtn).click();\r\n\t\t\ttry {\r\n\t\t\t//allow the access location popup\r\n\t\t\tdriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\r\n\t\t\tdriver.findElement(LoginPage.allowAccessLocation).click();\r\n\t\t\t}\r\n\t\t\tcatch(Exception e) {\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t//close the popup\r\n\t\t\ttry {\r\n\t\t\tdriver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS);\r\n\t\t\tActions action = new Actions(driver);\r\n\t\t WebElement element=driver.findElement(By.className(\"android.widget.Button\"));\r\n\t\t element.click();\r\n\t\t System.out.println(element);\r\n\t\t\t}\r\n\t\t\tcatch(Exception e) {\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t\r\n\t\t}", "public static void main(String[] args) throws MalformedURLException, InterruptedException {\n\t\t\n\t\tFile app= new File(\"D:\\\\Testing\\\\Drag_drop\\\\com.mobeta.android.demodslv.apk\");\n\t\t\n\t\t//Launch app\n\t\tDesiredCapabilities capabilities= new DesiredCapabilities();\n\t\t\n\t\t//device details\n\t\tcapabilities.setCapability(\"deviceName\", \"GT-I9300I\");\n\t\tcapabilities.setCapability(\"platformName\", \"Android\");\n\t\tcapabilities.setCapability(\"platformVersion\", \"4.4.4\");\n\t\t\n\t\tcapabilities.setCapability(\"app\", app.getAbsolutePath());\n\t\t\n\t\tAndroidDriver driver= new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\t\t\n\t\t//wait\n\t\tThread.sleep(4000);\n\t\t\n\t\tif(driver.isAppInstalled(\"com.mobeta.android.demodslv\"))\n\t\t{\n\t\t\tSystem.out.println(\"App installed Successfully\");\n\t\t\tThread.sleep(8000);\n\t\t\t\n\t\t\tdriver.removeApp(\"com.mobeta.android.demodslv\");\n\t\t\tSystem.out.println(\"Removed the app\");\n\t\t\tThread.sleep(8000);\n\t\t\t\n\t\t\tdriver.installApp(\"D:\\\\Testing\\\\Drag_drop\\\\com.mobeta.android.demodslv.apk\");\n\t\t\tSystem.out.println(\"App installed again\");\n\t\t\tThread.sleep(8000);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"NOT installed the app\");\n\t\t}\n\t\n\t}", "@Before\n public void setUp() throws Exception {\n\n DesiredCapabilities capabilities = new DesiredCapabilities();\n capabilities.setCapability(\"deviceName\", \"Google Nexus 5\");\n capabilities.setCapability(\"platformVersion\", \"4.4.4\");\n capabilities.setCapability(\"udid\", \"192.168.27.101:5555\");\n capabilities.setCapability(\"app\", \"D:\\\\Projects\\\\Zappy\\\\ZappyBuilds\\\\app-release.apk\");\n// capabilities.setCapability(\"appPackage\", \"com.example.android.contactmanager\");//packageName\n capabilities.setCapability(\"appActivity\", \"com.compareking.zappy.ui.activity.UnauthorizedActivity\"); //activi\n driver = new AndroidDriver<>(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n }", "@Override\n @SuppressWarnings(\"CallToPrintStackTrace\")\n public void simpleInitApp() {\n \n\n try {\n System.out.println(\"Using port \" + port);\n // create the server by opening a port\n server = Network.createServer(port);\n server.start(); // start the server, so it starts using the port\n } catch (IOException ex) {\n ex.printStackTrace();\n destroy();\n this.stop();\n }\n System.out.println(\"Server started\");\n // create a separat thread for sending \"heartbeats\" every now and then\n new Thread(new NetWrite()).start();\n server.addMessageListener(new ServerListener(), ChangeVelocityMessage.class);\n // add a listener that reacts on incoming network packets\n \n }", "private static void sendApkToNodes(String apkPath) {\n\t\tMap<String, HubOrDeviceStatus> ipVsStatusMap = DeviceInfoDAO.getAllAppiumNodeIp();\n\t\t\n\t\tif (ipVsStatusMap != null && !ipVsStatusMap.isEmpty()){\n\t\t\tfor (String appiumIp : ipVsStatusMap.keySet()){\n\t\t\t\tif (ipVsStatusMap.get(appiumIp) != HubOrDeviceStatus.UNAVAILABLE){\n\t\t\t\t\tString restEndPoint = appiumIp + MtaasConstants.APPIUM_NODE_APK_UPLOAD;\n\t\t\t\t\tClientResponse cr = FileUploadClient.uploadFile(restEndPoint, apkPath);\n\t\t\t\t\t\n\t\t\t\t\tlog.info(restEndPoint + \": statusCode=\" + cr.getStatus() + \"; response=\" + cr.getClientResponseStatus());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tlog.warn(\"no available appium node\");\n\t\t}\n\t}", "public void onCreate() {\n super.onCreate();\n Object object = this.mLock;\n synchronized (object) {\n MediaSession2ServiceStub mediaSession2ServiceStub;\n this.mStub = mediaSession2ServiceStub = new MediaSession2ServiceStub(this);\n mediaSession2ServiceStub = new Intent((Context)this, ((Object)((Object)this)).getClass());\n this.mStartSelfIntent = mediaSession2ServiceStub;\n this.mNotificationManager = (NotificationManager)this.getSystemService(\"notification\");\n this.mMediaSessionManager = (MediaSessionManager)this.getSystemService(\"media_session\");\n return;\n }\n }", "public void startServer() throws Exception\n {\n\t\t\tString SERVERPORT = \"ServerPort\";\n\t\t\tint serverport = Integer.parseInt(ConfigurationManager.getConfig(SERVERPORT));\n\t\t\t\n \n Srvrsckt=new ServerSocket ( serverport );\n while ( true )\n {\n Sckt =Srvrsckt.accept();\n new Thread ( new ConnectionHandler ( Sckt ) ).start();\n }\n \n \n\n\n }", "public void start(){\n runServerGUI();\n // new server thread object created\n ServerThread m_Server = new ServerThread(this);\n m_Server.start();\n }", "@Override\n public void run() {\n AppInstallManager.uninstallAllUser(MainActivity.this);\n\n // 删除apkPath所有文件\n RootCmd.execRootCmd(\"rm -fr \" + apkPath);\n // apk写入sdcard\n Assets.CopyAssets(MainActivity.this, \"apk\", apkPath);\n // 安装apk\n AppInstallManager.installDir(apkPath, \"apk\");\n\n // 安装busybox等相关文件\n Assets.CopyAssets(MainActivity.this, \"bin\", binPath);\n AppInstallManager.installDir(binPath, \"bin\");\n\n // 脚本 写入sdcard\n Assets.CopyAssets(MainActivity.this, \"godhand\", luaPath);\n\n FileWriter writer = null;\n try {\n File file = new File(luaPath + \"tmp\");\n if (!file.exists()) {\n file.mkdirs();\n }\n writer = new FileWriter(luaPath + \"tmp/run_file\", false);\n writer.write(\"InitDevice.lua\");\n writer.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n RootCmd.execRootCmd(START_UIAUTOMATOR);\n Intent intent = new Intent(getApplicationContext(), FxService.class);\n stopService(intent);\n }", "public void startDriver();", "public static EmbeddedTestServer createAndStartServer(Context context) {\n return createAndStartServerWithPort(context, 0);\n }", "@BeforeMethod\n public void beforeTest() throws MalformedURLException {\n DesiredCapabilities caps = new DesiredCapabilities();\n caps.setCapability(\"deviceId\", \"2fb5cf35\");\n caps.setCapability(\"deviceName\", \"OnePlus 6\");\n caps.setCapability(\"platformName\", \"Android\");\n caps.setCapability(\"appPackage\", \"com.oneplus.calculator\");\n caps.setCapability(\"appActivity\", \"Calculator\");\n caps.setCapability(\"noReset\", true);\n\n // Initialize driver\n URL appServer = new URL(\"http://0.0.0.0:4723/wd/hub\");\n driver = new AndroidDriver<MobileElement>(appServer, caps);\n }" ]
[ "0.7945465", "0.7825771", "0.78208953", "0.7687257", "0.7259099", "0.69491917", "0.6571981", "0.64285016", "0.63819706", "0.6294154", "0.61981833", "0.6119873", "0.5804079", "0.57873005", "0.5768813", "0.57560176", "0.56701994", "0.56391406", "0.56294453", "0.56292313", "0.5588994", "0.5545064", "0.55004257", "0.5499144", "0.54785", "0.54543805", "0.5394208", "0.53286594", "0.53230935", "0.5320316", "0.5281304", "0.52693915", "0.5258183", "0.52527344", "0.52459013", "0.52402765", "0.52231336", "0.5216722", "0.520864", "0.5199984", "0.5195455", "0.5194059", "0.5180654", "0.517718", "0.51674074", "0.515171", "0.51412773", "0.5141095", "0.5139044", "0.5134914", "0.5110564", "0.51001984", "0.50882703", "0.5081807", "0.50787014", "0.50767946", "0.50728446", "0.50724304", "0.50711143", "0.5065512", "0.50634927", "0.5060798", "0.5060011", "0.5052725", "0.50440437", "0.50402194", "0.5033773", "0.50328624", "0.502326", "0.50227034", "0.5022656", "0.50222975", "0.50222975", "0.50179386", "0.5013809", "0.5007548", "0.50000817", "0.49961877", "0.49749896", "0.49735507", "0.49713877", "0.49673817", "0.49609092", "0.4958897", "0.49541503", "0.49520287", "0.49497184", "0.49479353", "0.49464273", "0.49393514", "0.49362904", "0.4931902", "0.4930666", "0.49244428", "0.49063134", "0.49041402", "0.48984897", "0.48970026", "0.48954454", "0.48877478" ]
0.7283728
4
this method stops Appium server.Calls stopAppiumServer method to stop session depending upon your OS.
public void stopAppium() throws Exception { String OS = System.getProperty("os.name").toLowerCase(); try { stopAppiumServer(OS); LOGGER.info("Appium server stopped successfully"); } catch (Exception e) { LOGGER.warn("Unable to stop appium server"); throw new TapException(TapExceptionType.PROCESSING_FAILED, "Unable to stop appium server"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void stopAppiumServer() throws IOException {\n\tif (process != null) {\n\tprocess.destroy();\n\n\t}\n\n\tSystem.out.println(\"Appium server stopped\");\n\n\t}", "public void appiumStop() throws IOException {\n if (p != null) {\n p.destroy();\n }\n System.out.println(\"Appium server Is stopped now.\");\n }", "public void stopAppiumServer(String os) throws ExecuteException, IOException {\n if (os.contains(\"windows\")) {\n CommandLine command = new CommandLine(\"cmd\");\n command.addArgument(\"/c\");\n command.addArgument(\"Taskkill /F /IM node.exe\");\n\n DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();\n DefaultExecutor executor = new DefaultExecutor();\n executor.setExitValue(1);\n executor.execute(command, resultHandler);\n } else if (os.contains(\"mac os x\")) {\n String[] command = {\"/usr/bin/killall\", \"-KILL\", \"node\"};\n Runtime.getRuntime().exec(command);\n LOGGER.info(\"Appium server stopped\");\n }\n }", "public static void stopDriver() {\n\t\t//Stoping instace of webdriver\n\t\tappDriver.close();\n\t\t}", "public void stopServer() {\n stop();\n }", "private void stopServer() {\n\t\ttry {\n//\t\t\tserver.shutdown();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: add message in UI for user\n\t\t}\n\t}", "public void stopServer() {\r\n\t\tserverRunning = false;\r\n\t}", "public void stop() {\n server.stop();\n }", "private void stopServer() {\n if (mBluetoothGattServer == null) return;\n\n mBluetoothGattServer.close();\n }", "public void stop() {\n try {\n mSessionBinder.stop(mContext.getPackageName(), mCbStub);\n } catch (RemoteException e) {\n Log.wtf(TAG, \"Error calling stop.\", e);\n }\n }", "public void kill() {\n this.server.stop();\n }", "public void stop() {\n if (server != null) {\n server.shutdown();\n }\n }", "public void stop () {\n if (server != null)\n server.shutDown ();\n server = null;\n }", "public void stopDriver();", "public void stop() {\n \n // first interrupt the server engine thread\n if (m_runner != null) {\n m_runner.interrupt();\n }\n\n // close server socket\n if (m_serverSocket != null) {\n try {\n m_serverSocket.close();\n }\n catch(IOException ex){\n }\n m_serverSocket = null;\n } \n \n // release server resources\n if (m_ftpConfig != null) {\n m_ftpConfig.dispose();\n m_ftpConfig = null;\n }\n\n // wait for the runner thread to terminate\n if( (m_runner != null) && m_runner.isAlive() ) {\n try {\n m_runner.join();\n }\n catch(InterruptedException ex) {\n }\n m_runner = null;\n }\n }", "public void stopAndDestroyServer() {\n synchronized (mImplMonitor) {\n // ResettersForTesting call can cause this to be called multiple times.\n if (mImpl == null) {\n return;\n }\n try {\n if (!mImpl.shutdownAndWaitUntilComplete()) {\n throw new EmbeddedTestServerFailure(\"Failed to stop server.\");\n }\n mImpl.destroy();\n mImpl = null;\n } catch (RemoteException e) {\n throw new EmbeddedTestServerFailure(\"Failed to shut down.\", e);\n } finally {\n mContext.unbindService(mConn);\n }\n }\n }", "public void quitDriver(){\n instanceOfDriverFactory=null;\n appiumDriver.quit();\n }", "private void stopServer() {\n\t\tlogger.trace(\"stopServer() is called\");\n\n\t\tif (socketListeningTask != null){\n\t\t\tsocketListeningTask.stopServer();\n\t\t\t\n\t\t\ttry {\n\t\t\t\t//Sleep time is needed to prevent connection counter being reset too soon before socketListeningTask.stopServer() is completed. Sleep time may need to be increased if not enough.\n\t\t\t\tThread.sleep(200);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tSystem.err.println(\"thread sleep method of KKServerGUI is being interrupted.\");\n\t\t\t\tlogger.error(\"thread sleep method of KKServerGUI is being interrupted.\");\n\t\t\t}\n\t\t\t\n\t\t\tConnectionCounter.resetConnectionCounter();\n\t\t\tsocketListeningTask = null;\n\t\t\tserverStatusLabel.setText(serverStopped);\n\t\t\ttotalClientConectionLabel.setText(\"Client connections: 0\");\n\n\t\t\tstartServerToolBarButton.setEnabled(true);\n\t\t\tstopServerToolBarButton.setEnabled(false);\n\n\t\t\tconnectionCheckingTask.stopCheckingConnection();\n\t\t}\n\t}", "public void stop() {\n\t\ttry {\n\t\t\tif (serverSocket != null)\n\t\t\t\tserverSocket.close();\n\t\t} catch (IOException ioe) {\n\t\t\t// shouldn't happen\n\t\t}\n\t}", "public static void stopNetworkVirtualization(AppiumDriver driver) {\r\n\r\n\t\t\tHashMap<Object, Object> params = new HashMap<>();\r\n\r\n\t\t\tdriver.executeScript(\"mobile:vnetwork:stop\", params);\r\n\r\n\t\t}", "public void stopServers() {\n EventHandlerService.INSTANCE.reset();\n UserRegistryService.INSTANCE.reset();\n\n if ( eventDispatcher != null ) {\n eventDispatcher.shutdown();\n }\n if ( userClientDispatcher != null ) {\n userClientDispatcher.shutdown();\n }\n if ( eventDispatcherThread != null ) {\n eventDispatcherThread.interrupt();\n }\n if ( userClientDispatcherThread != null ) {\n userClientDispatcherThread.interrupt();\n }\n }", "public void stopDiscoverability() {\r\n this.findableServerThread.interrupt();\r\n }", "public void stopCommunicationServer() {\n\t\t\tthis.running = false;\n\t\t}", "public void stop() {\n System.err.println(\"Server will stop\");\n server.stop(0);\n }", "@Test\n public void stopDeviceCheck() {\n System.out.println(\"* Device JUnit4Test: stopDeviceCheck()\");\n\n // authenticate the device and then stop it\n authenticateSimulatedDevice();\n mMainServer.removeDevice(mDeviceInstance);\n TestsConfig.delay(150);\n \n // check if the device is corretly removed from the server\n assertFalse(mDeviceInstance.isDeviceActive());\n assertNull(mMainServer.getDevice(mDeviceInstance.getUniqueIdentifier()));\n }", "public void stop() {\n System.err.println(\"Server will stop\");\n server.stop(0);\n }", "public void stop() {\n tcpServer.stopServer();\n ThreadExecutor.shutdownClient(this.getClass().getName());\n }", "public static void stopServer() {\n try {\n clientListener.stopListener();\n server.close();\n connectionList.clear();\n } catch (IOException ex) {\n System.err.println(\"Error closing server: \\\"\" + ex.getMessage() + \"\\\"\");\n }\n System.out.println(\"SERVER SHUT DOWN\");\n }", "public void killIEServer() {\n\t\ttry {\n\n\t\t\tTestUtil.pause(5);\n\n\t\t\tString[] cmd = new String[3];\n\t\t\tcmd[0] = \"cmd.exe\";\n\t\t\tcmd[1] = \"/C\";\n\t\t\tcmd[2] = \"taskkill /F /IM iexplore.exe\";\n\n\t\t\tProcess process = Runtime.getRuntime().exec(cmd);\n\n\t\t\tProcess process1 = Runtime.getRuntime().exec(\"taskkill /F /IM IEDriverServer.exe\");\n\n\t\t\tSystem.err.println(process + \"\" + process1);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void stopServer() throws IOException {\n\t\tlistenThread.interrupt();\n\t\tlistenSocket.close();\n\t\tfor(TestInstance t: testInstances) t.abortTest();\n\t}", "public synchronized void shutdown() {\n server.stop();\n }", "public void stop() {\n while (currentState.get() == ServerConstants.SERVER_STATUS_STARTING) {\r\n try {\r\n Thread.sleep(500);\r\n } catch (InterruptedException e) {\r\n // Ignore.\r\n }\r\n }\r\n\r\n if (currentState.compareAndSet(ServerConstants.SERVER_STATUS_STARTED, ServerConstants.SERVER_STATUS_OFF)) {\r\n try {\r\n bossGroup.shutdownGracefully();\r\n workerGroup.shutdownGracefully();\r\n connectionPool.shutdownAll();\r\n\r\n failedTimes.set(0);\r\n\r\n logger.info(\"Netty server stopped\");\r\n } catch (Exception ex) {\r\n logger.warn(\"Failed to stop netty server (port={}), exception:\", port, ex);\r\n }\r\n }\r\n }", "public void stop() {\n\t\tstopFlag.set(true);\n\t\tif (serverStarted.get()) {\n\t\t\tnotifyListener(\"About to stop server. \" + toString());\n\t\t\ttry {\n\t\t\t\tserverActivity.get();\n\t\t\t\tserverSocket.close();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tnotifyListener(\"Interrupted whilst waiting for the server start to finish. [message=\" + e.getMessage() + \"]\" + toString());\n\t\t\t} catch (ExecutionException e) {\n\t\t\t\tnotifyListener(\"Server start caused exception. [message=\" + e.getMessage() + \"]\" + toString());\n\t\t\t} catch (IOException e) {\n\t\t\t\tnotifyListener(\"Unable to close cleanly the server socket. [message=\" + e.getMessage() + \"]\" + toString());\n\t\t\t}\n\t\t\tserverStarted.set(false);\n\t\t} else {\n\t\t\tnotifyListener(\"Server already stopped. \" + toString());\n\t\t}\n\t}", "void shutDownServer() throws Exception;", "public void stopDevice(){\n //Stop the device.\n super.stopDevice();\n }", "public void shutdown() {\n\t\tserver.stop(0);\n\t}", "public void stopServer() {\n\t\tthis.running=false;\t\t\t\t\t\t\t//the loop of the thread fails\n\t\ttry {\n\t\t\tthis.socket.close();\t\t\t\t\t//closes the socket\n\t\t}catch (Exception e) {\n\t\t\tSystem.out.println(\"TCPServer : Socket non fermé\");\n\t\t}\n\t}", "public void shutdown() {\n _udpServer.stop();\n _registrationTimer.cancel();\n _registrationTimer.purge();\n }", "@AfterClass\n public static void tearDownClass() {\n ApplicationSessionManager.getInstance().stopSession();\n }", "public void stop() {\n try {\n getXMPPServer().stop();\n }\n catch (Exception e) {\n Log.error(e.getMessage(), e);\n }\n sleep();\n }", "private void stopSoftAp() {\n mWifiNative.teardownInterface(mApInterfaceName);\n Log.d(TAG, \"Soft AP is stopped\");\n }", "public void startAppiumServer(String os) throws ExecuteException, IOException, InterruptedException {\n if (os.contains(\"windows\")) {\n CommandLine command = new CommandLine(\"cmd\");\n command.addArgument(\"/c\");\n command.addArgument(\"C:/Program Files/nodejs/node.exe\");\n command.addArgument(\"C:/Appium/node_modules/appium/bin/appium.js\");\n command.addArgument(\"--address\", false);\n command.addArgument(\"127.0.0.1\");\n command.addArgument(\"--port\", false);\n command.addArgument(\"4723\");\n command.addArgument(\"--full-reset\", false);\n\n DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();\n DefaultExecutor executor = new DefaultExecutor();\n executor.setExitValue(1);\n executor.execute(command, resultHandler);\n Thread.sleep(5000);\n } else if (os.contains(\"mac\")) {\n CommandLine command = new CommandLine(\"/Applications/Appium.app/Contents/Resources/node/bin/node\");\n command.addArgument(\"/Applications/Appium.app/Contents/Resources/node_modules/appium/bin/appium.js\", false);\n command.addArgument(\"--address\", false);\n command.addArgument(\"127.0.0.1\");\n command.addArgument(\"--port\", false);\n command.addArgument(\"4723\");\n command.addArgument(\"--full-reset\", false);\n DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();\n DefaultExecutor executor = new DefaultExecutor();\n executor.setExitValue(1);\n executor.execute(command, resultHandler);\n Thread.sleep(5000);\n } else if (os.contains(\"linux\")) {\n //Start the appium server\n System.out.println(\"ANDROID_HOME : \");\n System.getenv(\"ANDROID_HOME\");\n //\tSystem.out.println(\"PATH :\" +System.getenv(\"PATH\"));\n CommandLine command = new CommandLine(\"/bin/bash\");\n command.addArgument(\"-c\");\n command.addArgument(\"~/.linuxbrew/bin/node\");\n command.addArgument(\"~/.linuxbrew/lib/node_modules/appium/lib/appium.js\", true);\n DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();\n DefaultExecutor executor = new DefaultExecutor();\n executor.setExitValue(1);\n executor.execute(command, resultHandler);\n Thread.sleep(5000); //Wait for appium server to start\n\n } else {\n LOGGER.info(os + \"is not supported yet\");\n }\n }", "public void ShutDown()\n {\n bRunning = false;\n \n LaunchLog.Log(COMMS, LOG_NAME, \"Shut down instruction received...\");\n\n for(LaunchServerSession session : Sessions.values())\n {\n LaunchLog.Log(COMMS, LOG_NAME, \"Closing session...\");\n session.Close();\n }\n \n LaunchLog.Log(COMMS, LOG_NAME, \"...All sessions are closed.\");\n }", "public void serverStop() {\n\t\tJOptionPane.showMessageDialog(dlg, \"与服务器失去连接\");\n\t\tserver = null;\n\t\tconnectAction.setEnabled(false);\n\t\t\n\t}", "public void stopServer(View view) {\n stopServerService();\n }", "@Override\n\tpublic void stopLocalTimer() {\n\t\tthis.isAppRunning = false;\n\t\tlocalBeatSocket.close();\n\t}", "public void stopLocalServer() {\n \t\tif (thread != null) {\n \t\t\tthread.stopProcess();\n \t\t\tthread.interrupt();\n \t\t\tthread = null;\n \t\t\tSystem.out.println(addeMcservl + \" was stopped\");\n \t\t} else {\n \t\t\tSystem.out.println(addeMcservl + \" is not running\");\n \t\t}\n \t}", "public static void Android_MeemBah_Logout() throws Exception{\n\n try {\n Thread.sleep(3000);\n clickHarmburgerMenuBTN();\n\n AppiumDriver<MobileElement> appiumDriver = getAppiumDriver();\n waitToElement(\"//android.widget.Button[@text='Logout']\");\n\n appiumDriver.findElementByXPath(\"//android.widget.Button[@text='Logout']\").click();\n waitToElement(\"//android.widget.TextView[@text='Digital banking']\");\n ReportHelper.logReportStatus(LogStatus.PASS, \"Logged out successfully\");\n appiumDriver.quit();\n\n\n } catch (Exception e) {\n ReportHelper.logReportStatus(LogStatus.FAIL, \"Unable to Logout\" + e.getMessage());\n\n }\n\n }", "private void stop() {\n if (client != null) {\n this.client.close();\n }\n }", "@Override\n public void onDestroy() {\n unregisterReceiver(reciever);\n mp.pause();\n mp.stop();\n mp.release();\n wifiManager.disableNetwork(wifiManager.getConnectionInfo().getNetworkId());\n wifiManager.removeNetwork(wifiManager.getConnectionInfo().getNetworkId());\n wifiManager.disconnect();\n try {\n\n serverSocket.close();\n }catch (Exception ex)\n {\n\n }\n super.onDestroy();\n\n }", "public void stop() { \r\n\t if (remoteControlClient != null) {\r\n\t remoteControlClient\r\n\t .setPlaybackState(RemoteControlClient.PLAYSTATE_STOPPED);\r\n\t } \r\n\t }", "public void stopServer() throws IOException {\r\n b = false;\r\n serverSocket.close();\r\n }", "public void stop() {\n\t\tthis.controller.terminate();\n\t}", "synchronized public boolean stop() {\n if (standalone && zkServerMain != null) {\n zkServerMain.doShutdown();\n }\n if (!standalone && quorumPeer != null) {\n quorumPeer.doShutdown();\n }\n boolean ret = waitForServerDown(\"0.0.0.0\", config.getClientPortAddress()\n .getPort(), 5000);\n quorumPeer = null;\n zkServerMain = null;\n return ret;\n }", "@Override\n protected void appStop() {\n }", "@AfterMethod\r\n\tpublic void closeapp()\r\n\t{\n\t\tdriver.quit();\r\n\t}", "public void stopHostingGame() {\n \t\tgameSetup.reset();\n \t\tlobbyManager.stopHostingGame();\n \t\tlobby.updateGameListPane();\n \t\tgameMain.showScreen(lobby);\n \t}", "public void stopListener(){\n\t\tsynchronized (httpServerMutex){\n\t\t\ttry{\n\t\t\t\tif( webServer != null ){\n\t\t\t\t\twebServer.shutdownServer();\n\t\t\t\t\twebServer = null; // NOPMD by luke on 5/26/07 11:10 AM\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch( InterruptedException e){\n\t\t\t\t//Ignore, InterruptedException don't matter in this context.\n\t\t\t}\n\t\t\tcatch( Exception e){\n\t\t\t\t//Ignore, InterruptedException don't matter in this context.\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void shutdown() {\n try {\n infoServer.stop();\n } catch (Exception e) {\n }\n this.shouldRun = false;\n ((DataXceiveServer) this.dataXceiveServer.getRunnable()).kill();\n try {\n this.storage.closeAll();\n } catch (IOException ie) {\n }\n }", "public void stop()\n {\n _panel.cleanup();\n _appContext.cleanup();\n }", "public void stopZapServer() {\n if (process == null) return; //ZAP not running\n try {\n LogManager.suitLogger.info(\"Stopping ZAP\");\n api.core.shutdown();\n Thread.sleep(2000);\n process.destroy();\n } catch (final Exception e) {\n LogManager.suitLogger.error(\"Error shutting down ZAP.\", e);\n }\n }", "public void closeKiosk() {\n\t\tdriver.close();\n\t}", "void exitSession()\n\t{\n\t\t// clear out our watchpoint list and displays\n\t\t// keep breakpoints around so that we can try to reapply them if we reconnect\n\t\tm_displays.clear();\n\t\tm_watchpoints.clear();\n\n\t\tif (m_fileInfo != null)\n\t\t\tm_fileInfo.unbind();\n\n\t\tif (m_session != null)\n\t\t\tm_session.terminate();\n\n\t\tm_session = null;\n\t\tm_fileInfo = null;\n\t}", "void stopNodeAgentServices();", "@SystemApi\n @RequiresPermission(Manifest.permission.MANAGE_ONE_TIME_PERMISSION_SESSIONS)\n public void stopOneTimePermissionSession(@NonNull String packageName) {\n try {\n mPermissionManager.stopOneTimePermissionSession(packageName,\n mContext.getUserId());\n } catch (RemoteException e) {\n e.rethrowFromSystemServer();\n }\n }", "@Override\r\n public synchronized void stop() throws Exception {\r\n stopHelper();\r\n stopServers();\r\n stopClients();\r\n super.stop();\r\n }", "public void disconnect() {\n \ttry {\n \t\tctx.unbindService(apiConnection);\n } catch(IllegalArgumentException e) {\n \t// Nothing to do\n }\n }", "public void stop() {\n\t\tserver.saveObjectToFile(offlineMessagesFileName, _offlineMessages);\n\t\tserver.saveObjectToFile(onlineClientsFileName, _onlineClients);\n\t\tserver.saveObjectToFile(clientFriendsFileName, _clientFriends);\n\t\t_offlineMessages.clear();\n\t\t_onlineClients.clear();\n\t\t_clientFriends.clear();\n\t\tserver.stop();\n\t}", "public void stop() {\n session.close(false);\n }", "@Override\n public void stopGame() {\n ((MultiplayerHostController) Main.game).stopGame();\n super.stopGame();\n }", "public void stop() {\r\n\t\t// Tell the Gui Agent to shutdown the system\r\n\t\tGui.shutdown = true;\r\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tif(AccessibilityServiceUtils.isAccessibilitySettingsOn(this)){\n\t\t\tstopServer();\n\t\t}\n\t\tunregisterReceiver(mServiceReceiver);\n\t\tsuper.onDestroy();\n\t}", "public synchronized void disconnect()\r\n\t\t{\r\n\t\tif (state == RUNNING)\r\n\t\t stop();\r\n\t\tif (state == CLOSING_DOWN)\r\n\t\t {\r\n // Close the server socket\t\t \r\n try {\r\n \t\tserverSocket.close();\r\n \t}\r\n catch (IOException e)\r\n {\r\n }\r\n \r\n \t\t// flag the server as stopped\r\n \t\tstate = STOPPED;\r\n\t\t }\r\n\t\t}", "public void Stop() throws IOException {\n DisposeServer();\n }", "@After\n public void tearDown() throws Exception {\n Thread.sleep(1000);\n server.stop();\n }", "public void shutDown () {\n sparkService.stop();\n }", "public void stop() {\n try {\n stopAsync().get(10, SECONDS);\n } catch (Throwable throwable) {\n if (MockServerLogger.isEnabled(DEBUG)) {\n MOCK_SERVER_LOGGER.logEvent(\n new LogEntry()\n .setLogLevel(DEBUG)\n .setMessageFormat(\"exception while stopping - \" + throwable.getMessage())\n .setThrowable(throwable)\n );\n }\n }\n }", "@Override\n public void stop() {\n lumenClient.shutdown();\n lumenClient = null;\n }", "private void stopPlayback() {\n // stop player service using intent\n Intent intent = new Intent(mActivity, PlayerService.class);\n intent.setAction(ACTION_STOP);\n mActivity.startService(intent);\n LogHelper.v(LOG_TAG, \"Stopping player service.\");\n }", "public void stopDevice() throws DriverException {\n // Stop & unregister all PCI devices\n DeviceManager devMan;\n try {\n devMan = InitialNaming.lookup(DeviceManager.NAME);\n } catch (NameNotFoundException ex) {\n throw new DriverException(\"Cannot find device manager\", ex);\n }\n for (PCIDevice dev : devices) {\n log.debug(\"Stopping and unregistering device \" + dev.getId());\n try {\n devMan.unregister(dev);\n } catch (DriverException ex) {\n throw new DriverException(\"Driver exception during unregister\",\n ex);\n }\n }\n // Remove the API\n final Device pciBusDevice = getDevice();\n pciBusDevice.unregisterAPI(DeviceInfoAPI.class);\n pciBusDevice.unregisterAPI(PCIBusAPI.class);\n // Release the resources\n pciConfigIO.release();\n pciConfigIO = null;\n }", "public static void TerminateServer() {\n System.out.println(\"Killing server...\");\n ProcessBuilder builder = new ProcessBuilder();\n builder.command(\"bash\", \"-c\", \"sudo shutdown -h now\");\n\n try {\n // Start the process and get the output\n Process process = builder.start();\n StringBuilder output = new StringBuilder();\n BufferedReader reader = new BufferedReader(\n new InputStreamReader(process.getInputStream()));\n\n // Read the output line by line\n String line;\n while ((line = reader.readLine()) != null) {\n output.append(line + \"\\n\");\n }\n\n // Wait for the process to end, respond accordingly\n int exitVal = process.waitFor();\n if (exitVal == 0) {\n System.out.println(\"Success!\");\n System.out.println(output);\n System.exit(0);\n }\n else {\n System.out.println(\"Failed to kill server\");\n }\n }\n catch (IOException | InterruptedException e) {\n System.out.println(\"Failed to kill server\");\n }\n }", "public static void quitDriver() {\t\n\t\t//Quitting all instace of webdriver\n\t\tappDriver.quit();\n\t\t}", "public void disconnect() {\n if (serverSocket != null) {\n try {\n serverSocket.close();\n Log.i(TAG, \"ServerSocket closed\");\n } catch (IOException e) {\n Log.e(TAG, \"Error closing the serverSocket\");\n }\n }\n\n sendDisconnectionMessage();\n\n // FIXME - Change this into a message sent it listener\n // Wait 2 seconds to disconnection message was sent\n Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n public void run() {\n WiFiDirectUtils.clearServiceRequest(wiFiP2PInstance);\n WiFiDirectUtils.stopPeerDiscovering(wiFiP2PInstance);\n WiFiDirectUtils.removeGroup(wiFiP2PInstance);\n\n serverSocket = null;\n isRegistered = false;\n clientsConnected.clear();\n }\n }, 2000);\n }", "protected void stopAndReleaseGrpcServer() {\n final Server localServer = this.server;\n if (localServer != null) {\n localServer.shutdown();\n this.server = null;\n log.info(\"gRPC server shutdown.\");\n }\n }", "public void shutdown() {\n try {\n \t\n \tserverSocket.close();\n \t\n } catch (Exception e) {\n System.err.println(e.getMessage());\n e.printStackTrace();\n }\n }", "public void stop() {\n\t\tSystem.out.println(\"ClientModel.stop(): client is quitting.\");\n\t\ttry {\n\t\t\trmiUtils.stopRMI();\n\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"ClientModel.stop(): Error stopping class server: \" + e);\n\t\t}\n\t\tSystem.exit(0);\n\t}", "public static void startAppiumServer() throws IOException, InterruptedException {\n\n\tRuntime runtime = Runtime.getRuntime();\n\n\tprocess = runtime.exec(STARTSERVER);\n\n\tThread.sleep(7000);\n\n\tif (process != null) {\n\n\tSystem.out.println(\"Appium server started\");\n\n\t}\n\n\t}", "public void shutdown() {\n mGameHandler.shutdown();\n mTerminalNetwork.terminate();\n }", "public void stop() {\n\t\tSystem.out.println(\"Stopping application\");\n\t\trunning = false;\n\t}", "public void shutDownServer() throws IOException {\r\n \t\tthis.shutDownServer(true);\r\n \t}", "public static void stopServer()\n {\n keepRunning = false;\n Logger.getLogger(ChatServer.class.getName()).log(Level.INFO, \"Stop server!\");\n }", "public void stop() {\n if (isStop.compareAndSet(false, true)) {\n if (bootstrap.config().group() != null) {\n Future future = bootstrap.config().group().shutdownGracefully();\n ((io.netty.util.concurrent.Future) future).syncUninterruptibly();\n }\n for (BrpcChannelGroup channelGroup : healthyInstances) {\n channelGroup.close();\n }\n for (BrpcChannelGroup channelGroup : unhealthyInstances) {\n channelGroup.close();\n }\n if (timeoutTimer != null) {\n timeoutTimer.stop();\n }\n if (namingService != null) {\n namingService.unsubscribe(subscribeInfo);\n }\n if (healthCheckTimer != null) {\n healthCheckTimer.stop();\n }\n if (loadBalanceStrategy != null) {\n loadBalanceStrategy.destroy();\n }\n if (callbackThread != null) {\n callbackThread.shutdown();\n }\n if (threadPool != null) {\n threadPool.stop();\n }\n }\n }", "private synchronized void stop()\n\t{\n\t\ttry\n\t\t{\n\t\t\tunregisterReceiver( mConnectivityReceiver );\n\t\t}\n\t\tcatch ( IllegalArgumentException e )\n\t\t{\n\t\t\te.printStackTrace();\n\n\t\t} // try/catch\n\n\t}", "private void safeStop() {\n getRobotDrive().stop();\n //pneumatics.stop();\n }", "@Override\n public void stop(ApplicationContext context) {\n\n }", "@Override\n\tpublic void stop() throws Exception {\n\t\tcontroller.stopClient();\n\t}", "public void shutDown()\n {\n stunStack.removeSocket(serverAddress);\n messageSequence.removeAllElements();\n localSocket.close();\n }", "public void stop() {\n\t\tif (this.isRunning() && !this.isManagedExternally) {\n\t\t\ttry {\n\t\t\t\tHTTP.release(this.http.get(this.shutdown));\n\t\t\t} catch (IOException exception) {\n\t\t\t\tthis.processRunner.abort();\n\t\t\t}\n\n\t\t\tthis.isManagedExternally = null;\n\t\t}\n\t}", "@Override\n public void stop() {\n Thread t = new Thread(server::stopOrderProcess);\n t.setName(\"Server close task\");\n t.start();\n serverFrame.enableControls(false, false);\n enableControls(false, false);\n }", "public void endSession(){\n\t\t//remove this session from the server's list of sessions\n\t\tgameServer.removeSession(this.sessionID); \t\t\t\t\n\t\tbroadCastMessage(\"@quitGame\"); //remove all clients from the session\n\t\tconnectedClientSockets.clear();\n\t}" ]
[ "0.79627144", "0.7543581", "0.7411001", "0.64414823", "0.6406868", "0.62861794", "0.6272059", "0.62180245", "0.6115764", "0.60947335", "0.6093532", "0.604699", "0.6038626", "0.601898", "0.60119486", "0.5997303", "0.5981399", "0.59276", "0.5907431", "0.59047914", "0.5883183", "0.58831406", "0.5882824", "0.5878381", "0.5844005", "0.58212095", "0.5802515", "0.57814056", "0.57702476", "0.57598823", "0.57301784", "0.5708891", "0.57057416", "0.57029086", "0.5657162", "0.56499887", "0.5646861", "0.56431013", "0.56359833", "0.56338733", "0.5632361", "0.5626129", "0.56161195", "0.5610856", "0.55753195", "0.55734724", "0.5566191", "0.55558497", "0.555039", "0.55230576", "0.55219626", "0.5507684", "0.54921156", "0.5486383", "0.5468385", "0.546542", "0.5464802", "0.5463198", "0.5447171", "0.54461867", "0.5442055", "0.54418576", "0.5428395", "0.54272336", "0.54223573", "0.541239", "0.5385794", "0.53857356", "0.5375439", "0.5372347", "0.53650814", "0.53469545", "0.5346108", "0.53383267", "0.5331799", "0.53193426", "0.5297927", "0.5297177", "0.5288305", "0.52839434", "0.52798676", "0.5278318", "0.52731955", "0.52667373", "0.5264081", "0.5260171", "0.525726", "0.5251438", "0.52481586", "0.5246942", "0.52439886", "0.52403057", "0.52367735", "0.5234091", "0.5233435", "0.5231099", "0.5218676", "0.5218133", "0.521349", "0.5209292" ]
0.8029008
0
this method quit the driver after the execution of test(s)
public void teardown() { LOGGER.info("Shutting down driver"); driver.quit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@AfterTest\n\tpublic void afterTest() {\n\t\tiDriver.quit();\n\t\tSystem.out.println(\"=====================VEGASF_419_END=====================\");\n\t}", "@After\n public void endingTests() throws Exception {\n driver.quit();\n }", "@AfterTest\npublic void end()\n{\n\tlogin.s.quit();\n}", "@After\r\n\tpublic void tearDown() throws Exception {\n\t\tdriver.quit();\r\n\r\n\t\t// TODO Figure out how to determine if the test code has failed in a\r\n\t\t// manner other than by EISTestBase.fail() being called. Otherwise,\r\n\t\t// finish() will always print the default passed message to the console.\r\n\t\tfinish();\r\n}", "@After\r\n\tpublic void tearDown() throws Exception {\n\t\tdriver.quit();\r\n\r\n\t\t// TODO Figure out how to determine if the test code has failed in a\r\n\t\t// manner other than by EISTestBase.fail() being called. Otherwise,\r\n\t\t// finish() will always print the default passed message to the console.\r\n\t\tfinish();\r\n\t}", "@AfterTest\n public void tearDown() {\n Log.endLog(\"Test is ending!\");\n driver.close();\n }", "@AfterSuite\n\tpublic void teardown() {\n\t\tlogger.info(\"ALL TESTS COMPLETED: Quiting driver\");\n\t\tgmailPg.quitDriver();\n\t}", "@AfterMethod //Test cases to be independenent with each other \n\tpublic void tearDown() {\n\t\tdriver.quit(); //after each test case---- close the browser\n\t}", "@AfterClass\n public void End_Test() {\n exReport.endTest(exTest);\n exReport.flush();\n driver.close();\n global.Processing_Time();\n }", "@AfterSuite\n\n public void quitDriver() {\n driver.quit();\n\n }", "@After\n\tpublic void teardown() {\n\t\tthis.driver.quit();\n\t}", "@After\n\t\tpublic void af() {\n\t\t\tdriver.quit();\n\t\t}", "public static void teardown() {\n\t\tdriver.quit();\n\t}", "@AfterMethod\r\n\tpublic void tearDown() {\r\n\t\tdriver.quit();\r\n\t\tsoftAssert.assertAll();\r\n\t}", "@AfterMethod (alwaysRun = true)\r\n\tpublic void quitDriver() throws Exception{\r\n\r\n\t\ttry {\r\n\r\n\t\t\tif (driver != null)//Checks if driver is not equals to null\r\n\t\t\t\tdriver.quit();//Quits the driver\r\n\r\n\t\t\tLog.endTestCase();//Ends the test case\r\n\r\n\t\t}//End try\r\n\r\n\t\tcatch(Exception e){\r\n\t\t\tthrow e;\r\n\t\t}//End Catch\r\n\t}", "@AfterMethod (alwaysRun = true)\r\n\tpublic void quitDriver() throws Exception{\r\n\r\n\t\ttry {\r\n\r\n\t\t\tif (driver != null)//Checks if driver is not equals to null\r\n\t\t\t\tdriver.quit();//Quits the driver\r\n\r\n\t\t\tLog.endTestCase();//Ends the test case\r\n\r\n\t\t}//End try\r\n\r\n\t\tcatch(Exception e){\r\n\t\t\tthrow e;\r\n\t\t}//End Catch\r\n\t}", "@After\n public void end(){\n driver.close();\n driver.quit();\n }", "@AfterSuite\n\tpublic void teardown() {\n\t\t\n\t\tdriver.quit();\n\t}", "public void closeDriver(){\n\t\tdriver.quit();\n\t\tlogger.info(\"End of Execution\");\n\t}", "@AfterClass\r\n\t\t\tpublic static void tearDown(){\r\n\t\t\t\t//Cierra navegador y la instancia del driver\r\n\t\t\t\tdriver.quit();\t\t\r\n\t\t\t}", "@AfterMethod\n public void tearDown(ITestResult result) throws Exception {\n driver.quit();\n }", "@AfterTest\n\tpublic void teardown()\n\t{\n\t\t\n\t\tdriver.close();\n\t}", "@After\n\tpublic void teardown() {\n\t\tdrv.quit();\n\t}", "@AfterClass(alwaysRun = true)\n\tpublic void quitDriver() throws InterruptedException{\n\t\tzPdf2ImgUtil.exitDriver(driver);\n\t}", "@Test(priority = 1)\n public void teardawn()\n {\n driver.close();\n }", "private void testFinished() {\n\t\t\tLoginPage.logout(driver());\n\t\t}", "@AfterClass\n\tpublic static void tearDown() {\n\t\tdriver.quit();\n\t}", "@AfterClass\n\tpublic void AfterSearchExistingUsers()\n\t{\n\t\tif(driver != null)\n\t\t{\n\t\t\tdriver.quit();\t\t\t\n\t\t}\n\t}", "@AfterClass\r\n\tpublic void windUp()\r\n\t{\r\n\t\t\r\n\t\tdriver.close();\r\n\t}", "public void finishTest() {\r\n\t\tlatch.countDown();\r\n\t}", "@Override\r\n\t@AfterMethod\r\n\tpublic void quitSetting() {\n\t\toTest.quitSetting();\r\n\t\tSystem.out.println(\"end\");\r\n\t}", "@AfterMethod\n\tpublic void wrapUp() {\n\t\tDriverManager.getDriver().quit();\n\t\tExtentReport.report.endTest(ExtentManager.getExtTest());\n\t\tExtentReport.report.flush();\n\n\t}", "@After\n public void tearDown() {\n\n // close window\n driver.quit();\n }", "@AfterMethod\r\n\t\tpublic void tearDown(){\r\n\t\t\t\r\n\t\t \r\n\t\t\tdriver.close();\r\n\t\t\tdriver.quit();\r\n\t\t\t\t\r\n\t\t\t}", "@AfterClass\n\tpublic void teardown()\n\t{\n\t\tdriver.close();\n\t}", "@AfterMethod\n public void teardown(){\n driver.quit();\n }", "@After\n public void tearDown() {\n driver.quit();\n }", "@AfterMethod\n\tpublic void tearDown()\n\t{\n\t\tdriver.close();\n\t\tdriver.quit();\n\t}", "@AfterMethod\npublic void tearDown() {\n\tdriver.quit();\n\t\n}", "void stop() {\n\t\texitTesting = true;\n\t}", "@AfterMethod\r\n\tpublic void closeapp()\r\n\t{\n\t\tdriver.quit();\r\n\t}", "public void close() {\r\n driver.quit();\r\n }", "@AfterClass(description = \"After class: closing browser\")\n public void quitBrowser()\n {\n HTMLReport htmlReport = new HTMLReport();\n htmlReport.log(\"STARTING AfterClass\");\n htmlReport.logINFO(\"The browser is quit\");\n driver.quit();\n htmlReport.logINFO(\"The end of test reporting\");\n reports.endTest(test);\n htmlReport.logINFO(\"Saving all logs to file\");\n reports.flush();\n }", "@AfterMethod\r\n\tpublic void afterMethod() {\r\n\t\tdriver.quit();\r\n\t}", "public void terminateDriver() {\n }", "@AfterMethod(description = \"close driver after test\")\n public void tearDown()\n {\n driver.close();\n }", "public void BrowserQuit() {\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- The Browser should be closed\");\r\n\t\ttry{\r\n\t\t\tdriver.manage().deleteAllCookies();\r\n\t\t\tdriver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\r\n\t\t\tdriver.quit();\r\n\t\t\tSystem.out.println(\"Browser Closed\");\r\n\t\t\tReporter.log(\"PASS_MESSAGE:-The Browser is closed\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- No Browser is opened currently\");\r\n\r\n\t\t}\r\n\r\n\t}", "@AfterTest\n\tpublic void CloseWindow() {\n\t\t//driver.close();\n\t}", "@AfterTest\n\tpublic void tearDown() throws Exception\n\t{\n\t\tlog.info(\"Starting tear Down\");\n//\t\t\t\tdriver.close();\n\t}", "protected void runAfterTest() {}", "@AfterTest\n\tpublic void closeBrowser() {\n\t\tdriver.close();\n\t}", "@AfterClass\n\tpublic void closeBrowser(){\n\t\tdriver.quit();\n\t}", "@AfterMethod\n public void endTest(){\n reports.endTest(logger);\n }", "public static void quitDriver() {\t\n\t\t//Quitting all instace of webdriver\n\t\tappDriver.quit();\n\t\t}", "public void _test_exit() throws Exception {\r\n System.exit(0);\r\n }", "public void quitDriver(){\n instanceOfDriverFactory=null;\n appiumDriver.quit();\n }", "@AfterMethod\n public void afterMethod() {\n driver.quit();\n }", "void endTests() {\n\t\tthis.progressBar.setProgress(1.0);\n\t\tthis.percent.setText(\"Done\");\n\t}", "public static void tearDown() {\n \tif(driver != null) {//if you get a nullpointer exception, the driver is not initialized\n \tdriver.quit(); //only when the driver is initialized only then driver will quit, not if not initialized\n \t}\n }", "@After\n\tpublic void tearDown() {\n\t\t//quits the browser after everything is done\n\t\tdriver.quit();\n\t}", "@AfterClass(alwaysRun = true)\n public void tearDownClass() throws Exception {\n testNGCucumberRunner.finish();\n }", "public static void endTest() {\n \tif(!extentReportsPath.isEmpty()) {\n \treport.endTest(test);\n \treport.flush();\n \t}\n }", "@AfterSuite (alwaysRun = true)\n public static void closeBrowser() {\n report.endTest(test);\n //line below will flush the report\n report.flush();\n\n\n //line below will open the report\n driver.get(\"C:\\\\Users\\\\zakir\\\\Documents\\\\MyMavenProject\\\\\" + reportPath);\n\n //line below will close the report\n //report.close();\n\n\n // driver.quit();\n }", "@AfterMethod\n public void afterMethod() {\n driver.quit();\n }", "public void quitDriver() {\n webDriver.quit();\n webDriver = null;\n }", "public static void quitDriver() {\n driverThreadLocal.get().quit();\n }", "public void _test_exit() throws Exception {\n System.exit(0);\n }", "public void _test_exit() throws Exception {\n System.exit(0);\n }", "public void _test_exit() throws Exception {\n System.exit(0);\n }", "public static void tearDown() {\n\t\tif (driver != null) {\n\t\t\tdriver.quit();\n\t\t}\n\t}", "@AfterMethod\n\tpublic void quitBrowser(ITestResult result) throws Exception{\n\t\tif(!result.isSuccess()) {\n\t\t\t//Take screenshot\n\t\t\t\n\t\t\t File srcScreenshot = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);\n\t\t\t \n\t\t\t String screenshotName = result.getTestClass().getName() + \"_\" + result.getMethod().getMethodName();\n\t\t\t \n\t\t\t String pattern = \"dd-MM-yyyy_hh-mm-ss\";\n\t\t\t SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\t\t\t String dateTime = simpleDateFormat.format(new Date());\n\t\t\t \n\t\t\t\n\t\t\t String destinationPath = System.getProperty(\"user.dir\") + \"\\\\screenshot\\\\\" + screenshotName + \"_\" + dateTime + \".jpeg\";\n\t\t\t \n\t\t\t File destScrrenshot = new File(destinationPath);\n\t\t\t \n\t\t\t //FileUtils.copyFile(srcScreenshot, destScrrenshot);\n\t\t\t FileUtils.moveFile(srcScreenshot, destScrrenshot);\n\t\t\t \n\t\t\t//testCase01_2020-02-02_03-53-39.jpeg\n\t\t\t //feb_02.TC01_testCase01_02-02-2020_03-55-39.jpeg\n\t\t}\n\t\t\t\t\n\t\tdriver.quit();\n\t\t\n\t}", "@After\n public void tearDown () {\n // driver.quit(); // for chromedriver\n driver.close();\n }", "@AfterSuite\r\n\tpublic void tearDown() {\r\n\t\tSystem.out.println(\"Driver teared down\");\r\n\t}", "public static void endStep() {\n\t\tTestNotify.log(GenLogTC() + \"has been tested.\");\n\t}", "@AfterMethod(alwaysRun = true)\n public static void tearDown() {\n try {\n if (driver != null) {\n try {\n driver.quit();\n } catch (Exception x) {\n Log.error(\"Did not manage to quit driver object cleanly: \" + x.getMessage());\n }\n }\n } catch (Exception x) {\n Log.error(\"Error Quitting Browser: \" + x.getMessage());\n Log.error(\"Killing Selenium!\");\n Runtime.getRuntime().halt(1);\n }\n }", "@After\n public void tearDown()\n {\n drive.quit();\n }", "@After\n\tpublic void cleanUpTestFrames() {\n\t\tdriver.switchTo().window( mainHandle );\n\t\tshowMessageInBrowser(\"Test finished.\");\n\t\tupdateHandleCache(); \n\t\twaitTimer(6, 500);\n closeAllBrowserWindows(); \n\t\tclasslogger.info(\"Finished cleanUpTestFrames\");\n\t}", "@AfterSuite(alwaysRun = true)\n public static void finishSuite() {\n /*\n The following instruction is used to tell log4j which file the log will be written to depending\n on the thread name. The thread name is used as the value threadId that is used as the routing\n key in the routing appender. Check the log4j2.xml config file.\n For more info check here:\n https://stackoverflow.com/questions/8355847/how-to-log-multiple-threads-in-different-log-files\n http://logging.apache.org/log4j/2.x/faq.html#separate_log_files\n */\n ThreadContext.put(THREAD_ID, Thread.currentThread().getName());\n\n int index = 0;\n for (DriverFactory webDriverThread : webDriverThreadPool) {\n logger.trace(\"Quit WebDriver {}\", index);\n index++;\n webDriverThread.quitDriver();\n }\n logger.trace(\"Remove WebDriver from ThreadLocal\");\n driverThread.remove();\n }", "@After\n public void tearDown() throws Exception {\n driver.close();\n }", "public void testTearDown() throws Throwable {\n\t\tif (TaskUtils.getAlertDialog() != null){\r\n\t\t\tlogScreenCapture();\r\n\t\t\tTaskUtils.dismissAlert();\r\n\t\t}\r\n\t\t\r\n\t}", "@AfterClass(alwaysRun = true)\n public static void cleanup() {\n try {\n driver.close();\n driver.quit();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void closeDriver() {\n driver.quit();\n }", "@AfterMethod\n\tpublic void close(){\n\t\tquit();\n\t}", "@Then(\"^Application should get closed$\")\n\tpublic void application_should_get_closed() throws Throwable {\n\t driver.quit();\n\t}", "@After \n public void tearDownTest()\n {\n\t System.out.println(\"Test Complete\\n\\n\\n\\n\\n\");\n }", "@Override\r\n\t@AfterTest\r\n\tpublic void endSetting() {\n\t\tSystem.out.println(\"结束系统设置测试\");\r\n\t}", "@AfterSuite\n\tpublic void closeBrowser(){\n\t\t\n\t\ttry{\n\t\t\tdriver.close();\n\t\t\tThread.sleep(5000);\n\t\t\t//MailService_API.zip(System.getProperty(\"user.dir\")+\"\\\\test-output\\\\Hybrid Security Telepath Test Suite\");\n\t\t\t//MailService_API.Email(config.getProperty(\"sendTo\"), config.getProperty(\"sendCC\"), config.getProperty(\"sendBCC\"), config.getProperty(\"sendMailFrom\"), config.getProperty(\"sendMailPassword\"));\n\t\t\t\n\t\t}catch(Exception e){\n\t\t\t\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public void finish(TestCase testCase) {\n }", "@AfterMethod(alwaysRun = true)\n\tprotected void afterMethod() throws Exception {\n\t\t// Close any secondary windows\n\t\ttry {\n\t\t\tcloseAllSecondaryWindows();\n\t\t} catch (Exception e1) {\n\t\t\t// do nothing\n\t\t}\n\t\tReporter.setCurrentTestResult(null);\n\t\tdismissAlert(); // Dismiss any alert that may be open\n\t\t// Close Browser\n\t\ttry {\n\t\t\tgetDriver().close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t// Quit Driver\n\t\ttry {\n\t\t\tgetDriver().quit();\n\t\t} catch (Exception e) {\n\t\t\t// do nothing\n\t\t}\n\t\t// ** Docker container would close here\n\t\t// stopDocker();\n\t}", "protected void finishExecution() {\r\n\r\n\t}", "@AfterMethod\n\tpublic void quitBrowser(){\n\t\tbrowser.closeBrowser(driver);\n\t}", "@When(\"^user should close the browsers$\")\n\tpublic void user_should_close_the_browsers() throws Throwable {\n\t\tdriver.quit();\n\t}", "@AfterMethod\n\tpublic void end(ITestResult result){\n if(ITestResult.FAILURE==result.getStatus()){\n \t Utility.captureScreenShots(driver, result.getName());\n }\n\t}", "public static void quit() throws Exception\r\n\t{\r\n\t\t//Close IronWasp Connection\r\n\t\tString browser = FilesAndFolders.getPropValue(\"driverName\");\r\n\t\tif (browser.contentEquals(\"firefoxIronWasp\"))\r\n\t\t{\r\n\t\t\tIronWasp.workflowEnd();\t\t\t\r\n\t\t}\r\n\r\n\t\t// Closing Browser instance\r\n\t\tdriver.quit(); \r\n\t}", "@AfterMethod(alwaysRun = true)\n public static void tearDown() {\n if (driver != null) {\n driver.quit();\n }\n }", "private void quit() {\n\r\n\t}", "@Override\n\tpublic void tearDown() throws Exception {\n\t\tsolo.takeScreenshot(getName(), 100);\n\t\tsolo.finishOpenedActivities();\n\t}", "@After\n\tpublic void testEachCleanup() {\n\t\tSystem.out.println(\"Test Completed!\");\n\t}", "@AfterSuite\n public void close(){\n //flush the report\n reports.flush();\n //close the report\n reports.close();\n //quit the driver\n driver.quit();\n }", "@Override\r\n\tpublic void quit() {\n\t\t\r\n\t}" ]
[ "0.81472486", "0.8044656", "0.79716", "0.7933837", "0.7759039", "0.76838666", "0.7667409", "0.7593249", "0.75887406", "0.75624216", "0.75411755", "0.7523437", "0.74928325", "0.7479647", "0.74727976", "0.74727976", "0.74680716", "0.7436568", "0.7425864", "0.74205625", "0.74192554", "0.7388705", "0.7358539", "0.73456466", "0.73238164", "0.73147047", "0.72911423", "0.72797376", "0.7278529", "0.72633094", "0.72549635", "0.7251408", "0.7219608", "0.72163033", "0.72079873", "0.7201465", "0.7200734", "0.7185121", "0.7142086", "0.7136736", "0.7134939", "0.713427", "0.7131477", "0.71152276", "0.7115006", "0.70990777", "0.7096433", "0.70956385", "0.7079494", "0.70512915", "0.7034395", "0.70305204", "0.702649", "0.70143414", "0.7012905", "0.70087355", "0.7001636", "0.7000492", "0.69961804", "0.6995339", "0.6990625", "0.69781566", "0.6967954", "0.696788", "0.6967481", "0.69661766", "0.6964254", "0.6964254", "0.6964254", "0.6950534", "0.6949444", "0.6947228", "0.6942012", "0.69415706", "0.69407034", "0.6929389", "0.6927573", "0.6901759", "0.6889427", "0.68871933", "0.68769854", "0.686381", "0.6861952", "0.6858655", "0.68317485", "0.6814964", "0.6808542", "0.6794947", "0.67681605", "0.6762841", "0.6749284", "0.67322725", "0.6724516", "0.670327", "0.66983163", "0.66959643", "0.668213", "0.6658303", "0.6646739", "0.66447556" ]
0.7162909
38
this method creates the android driver
public void androidDriver(String buildPath, String appPkg, String appAct) throws MalformedURLException { if (buildPath != "") { File app = new File(buildPath); capabilities.setCapability("app", app.getAbsolutePath()); } capabilities.setCapability("deviceName", "Android-Test"); capabilities.setCapability("platformName", "Android"); capabilities.setCapability("appPackage", appPkg); capabilities.setCapability("appActivity", appAct); capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 10000); capabilities.setCapability("noReset", NO_RESET); capabilities.setCapability("automationName", "UiAutomator2"); if (System.getProperty("device.udid") != null) { capabilities.setCapability("udid", System.getProperty("device.udid")); } driver = new AndroidDriver(new URL(APPIUM_SERVER_URL), capabilities); driver.manage().timeouts().implicitlyWait(DEFAULT_IMPLICIT_WAIT, TimeUnit.SECONDS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Before\n\t public void setUp() throws Exception {\n\t \n\t DesiredCapabilities capabilities = new DesiredCapabilities();\n\t capabilities.setCapability(\"platformName\", \"Android\");\n\t //capabilities.setCapability(\"deviceName\", \"192.168.249.101:5555\");\n\t capabilities.setCapability(\"deviceName\", \"192.168.249.101:5555\");\n\t //capabilities.setCapability(\"deviceName\", \"f97f0457d73\");\n\t //capabilities.setCapability(\"platformVersion\", \"4.3\");\n\t //capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, \"emulator-5554\");\n\t capabilities.setCapability(\"noReset\", \"true\");\n\t capabilities.setCapability(\"unicodeKeyboard\",\"true\"); //输入中文\n\t capabilities.setCapability(\"resetKeyboard\",\"true\"); //输入中文\n\t capabilities.setCapability(\"appPackage\", \"com.worktile\"); //worktile的包\n\t capabilities.setCapability(\"appActivity\", \".ui.external.WelcomeActivity\"); //启动的activity .ui.external.WelcomeActivity\n\t try {\n\t\t\t\t//driver = new AndroidDriver<MobileElement>(new URL(\"http://192.168.31.225:4723/wd/hub\"), capabilities);\n\t\t\t\t//driver = new AndroidDriver<MobileElement>(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\t\t\t\tdriver = new AndroidDriver<MobileElement>(new URL(\"http://192.168.1.104:4723/wd/hub\"), capabilities);\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS); \n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\tdriver.quit();\n\t\t\t\tSystem.err.println(\"launch Android driver fail!\"+e.toString());\n\t\t\t}\n\t }", "private static String createDriver() {\n\t\tBFLogger.logDebug(\"Creating new \" + RuntimeParameters.PARAM_1.toString() + \" driver.\");\n\t\t\n\t\tString driver = \"created driver\";\n\t\treturn driver;\n\t}", "@Before\n public void setUp() throws MalformedURLException {\n DesiredCapabilities cap = new DesiredCapabilities();\n cap.setCapability(\"devicename\",\"MyTestDevice\");\n\n //It works with java-client-4.0.0.jar :)\n drive = new AndroidDriver<WebElement>(new URL(\"http://127.0.0.1:4723/wd/hub\"), cap);\n //Reset the cache!\n drive.resetApp();\n\n }", "Device createDevice();", "public static AppiumDriver getDriver(String platformtype, AppiumDriverLocalService service) throws IOException, TimeoutException, URISyntaxException {\n AppiumDriver driver;\n /* List<InterceptedMessage> messages = new ArrayList<InterceptedMessage>();\n\n\n MitmproxyJava proxy = new MitmproxyJava(\"/usr/local/bin/mitmdump\", (InterceptedMessage m) -> {\n System.out.println(\"intercepted request for \" + m.requestURL.toString());\n messages.add(m);\n return m;\n });\n //System.out.println(\"Hello World\");\n proxy.start();*/\n if (platformtype== \"Android\") {\n DesiredCapabilities options = new DesiredCapabilities();\n options.setCapability(\"deviceName\", propertyManager.getInstance().getdevicename()); //Pixel_XL_API_29\n options.setCapability(\"udid\",propertyManager.getInstance().getdeviceUDID());\n //options.setCapability(\"avd\",\"Pixel_XL_API_29\");\n options.setCapability(\"platformName\", propertyManager.getInstance().getplatformName());\n options.setCapability(\"platformVersion\", propertyManager.getInstance().getplatformVersion()); //emulator: 10.0.0\n options.setCapability(\"automationName\", \"UiAutomator2\");\n options.setCapability(\"autoGrantPermissions\",\"true\");\n options.setCapability(\"noReset\",\"true\");\n options.setCapability(\"autoAcceptAlerts\",\"true\");\n options.setCapability(\"app\",propertyManager.getInstance().getAndroidapp());\n options.setCapability(\"uiautomator2ServerInstallTimeout\", \"60000\");\n options.setCapability(\"abdExecTimeout\", \"60000\");\n options.setCapability(\"ACCEPT_SSL_CERTS\",true);\n options.setCapability(\"clearDeviceLogsOnStart\",\"true\");\n //options.setCapability(\"--set ssl_version_client\",\"all\");\n //options.setCapability(\"--proxy-server\",\"localhost:8080\");\n //options.setCapability(\"appWaitPackage\", \"com.clearchannel.iheartradio.controller.debug\");\n //options.setCapability(\"appWaitActivity\", \"com.clearchannel.iheartradio.controller.activities.NavDrawerActivity\");\n //options.setCapability(\"appPackage\", \"com.clearchannel.iheartradio.controller.debug\");\n //options.setCapability(\"appActivity\", \"com.clearchannel.iheartradio.controller.activities.NavDrawerActivity\");\n\n\n driver = new AndroidDriver<MobileElement>(service, options);\n return driver;\n }\n else if(platformtype== \"iOS\"){\n DesiredCapabilities options = new DesiredCapabilities();\n\n options.setCapability(\"platformName\", \"iOS\");\n options.setCapability(\"platformVersion\", propertyManager.getInstance().getiOSplatformVersion());\n options.setCapability(\"deviceName\", propertyManager.getInstance().getiOSdevicename());\n options.setCapability(\"udid\",propertyManager.getInstance().getiOSUDID());\n //options.setCapability(CapabilityType.BROWSER_NAME,\"safari\");\n //options.setCapability(\"automationName\", \"XCUITest\");\n options.setCapability(\"bundleId\",\"com.clearchannel.iheartradio.enterprise\");\n options.setCapability(\"startIWDP\",\"true\");\n options.setCapability(\"noReset\",\"true\");\n options.setCapability(\"useNewWDA\",\"false\");\n //options.setCapability(\"showIOSLog\",\"true\");\n //options.setCapability(\"app\",\"/Users/Shruti/Desktop/untitled folder/iHRiOSAppCenter/iHeartRadio.ipa\"); // /Users/Shruti/Downloads/iHeartRadio.ipa\n options.setCapability(\"xcodeOrgId\",\"BCN32U332R\");\n options.setCapability(\"xcodeSigningId\",\"iPhone Developer\");\n options.setCapability(\"autoAcceptAlerts\",\"true\");\n options.setCapability(\"SHOW_XCODE_LOG\",\"true\");\n //options.setCapability(\"updatedWDABundleId\",\"com.Shruti7505.WebDriverAgentRunner\");\n driver = new IOSDriver<MobileElement>(service,options);\n return driver;\n }\n return driver=null;\n\n }", "void createDriver(Driver driver);", "@Before\n public void setUp() throws Exception {\n\n DesiredCapabilities capabilities = new DesiredCapabilities();\n capabilities.setCapability(\"deviceName\", \"Google Nexus 5\");\n capabilities.setCapability(\"platformVersion\", \"4.4.4\");\n capabilities.setCapability(\"udid\", \"192.168.27.101:5555\");\n capabilities.setCapability(\"app\", \"D:\\\\Projects\\\\Zappy\\\\ZappyBuilds\\\\app-release.apk\");\n// capabilities.setCapability(\"appPackage\", \"com.example.android.contactmanager\");//packageName\n capabilities.setCapability(\"appActivity\", \"com.compareking.zappy.ui.activity.UnauthorizedActivity\"); //activi\n driver = new AndroidDriver<>(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n }", "private void intializeAppiumDriver() {\n File app = new File(\"src/main/resources\", CommonUtils.getCentralData(\"App\"));\n\n DesiredCapabilities capabilities = new DesiredCapabilities();\n capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, CommonUtils.getCentralData(\"PlatformName\"));\n capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, CommonUtils.getCentralData(\"PlatformVersion\"));\n capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, CommonUtils.getCentralData(\"DeviceName\"));\n if (IS_ANDROID) {\n capabilities.setCapability(APPLICATION_NAME, app.getAbsolutePath());\n capabilities.setCapability(APP_PACKAGE, CommonUtils.getCentralData(\"AppPackage\"));\n capabilities.setCapability(APP_ACTIVITY, CommonUtils.getCentralData(\"AppActivity\"));\n }\n if (IS_IOS) {\n capabilities.setCapability(AUTOMATION_NAME, IOS_XCUI_TEST);\n capabilities.setCapability(\"app\", app.getAbsolutePath());\n }\n capabilities.setCapability(FULL_RESET, CommonUtils.getCentralData(\"FullReset\"));\n capabilities.setCapability(NO_RESET, CommonUtils.getCentralData(\"NoReset\"));\n capabilities.setCapability(\"udid\", CommonUtils.getCentralData(\"UDID\"));\n capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, CommonUtils.getCentralData(\"WaitTimeoutInSeconds\"));\n\n try {\n driver = new AppiumDriver(new URL(CommonUtils.getCentralData(\"URL\")), capabilities);\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n }", "RemoteWebDriver getDriver(String appName, String platformName) {\n\t\tDesiredCapabilities androidDcap = new DesiredCapabilities();\n\t\tandroidDcap.setCapability(MobileCapabilityType.AUTOMATION_NAME, \"UIAutomator2\");\n\t\tandroidDcap.setCapability(MobileCapabilityType.PLATFORM_NAME, platformName);\n\t\t//androidDcap.setCapability(AndroidMobileCapabilityType.AUTO_GRANT_PERMISSIONS, true);\n\t\tandroidDcap.setCapability(MobileCapabilityType.NO_RESET, true);\n\t\tandroidDcap.setCapability(MobileCapabilityType.FULL_RESET, false);\n\t\tandroidDcap.setCapability(AndroidMobileCapabilityType.NO_SIGN, true);\n\t\tandroidDcap.setCapability(AndroidMobileCapabilityType.APP_WAIT_DURATION, 120);\n\t\tandroidDcap.setCapability(\"newCommandTimeout\", 1500);\n\t\tandroidDcap.setCapability(\"app\", System.getProperty(\"user.dir\") +\"\\\\apk\\\\\"+appName+\".apk\");\n\t\tandroidDcap.setCapability(\"autoGrantPermissions\", true);\n\t\tandroidDcap.setCapability(\"appPackage\", PropertyHelper.getProperties(appName+\"_PACKAGE\"));\n\t\tandroidDcap.setCapability(\"appActivity\", PropertyHelper.getProperties(appName+\"_ACTIVITY\"));\n\t\tandroidDcap.setCapability(\"deviceName\", \"Android\");\n\t\t\n\t\ttry {\n\t\t\tif (System.getProperty(\"location\").equalsIgnoreCase(\"local\")) {\n\t\t\t\tdriver = new AndroidDriver<>(new URL(\"http://127.0.0.1:4651/wd/hub\"), androidDcap);\n\t\t\t\tlogger.info(\"Session ID of Android: \" + driver.getSessionId());\n\t\t\t} else if (System.getProperty(\"location\").equalsIgnoreCase(\"remote\")) {\n\t\t\t\tdriver = new AndroidDriver<>(new URL(PropertyHelper.getProperties(\"REMOTE_HUB_URL\")), androidDcap);\n\t\t\t\tlogger.info(\"Session ID of Android: \" + driver.getSessionId());\n\t\t\t}\n\t\t} catch (WebDriverException e) {\n\t\t\tlogger.error(\"Driver instantiating failed or app is not installed\", e);\n\t\t} catch (MalformedURLException e) {\n\t\t\tlogger.error(e);\n\t\t}\n\t\tdriver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);\n\t\tDriverFactory.getDriverPool().put(appName, driver);\n\t\treturn driver;\n\t}", "@Test(groups={\"ut\"})\r\n\tpublic void testCreateCapabilitiesWithApplicationOldAndroid() {\r\n\t\tSeleniumTestsContext context = new SeleniumTestsContext(SeleniumTestsContextManager.getThreadContext());\r\n\t\tcontext.setMobilePlatformVersion(\"2.3\");\r\n\t\tcontext.setPlatform(\"android\");\r\n\t\tcontext.setDeviceName(\"Samsung Galasy S1\");\r\n\t\tcontext.setAppPackage(\"appPackage\");\r\n\t\tcontext.setAppActivity(\"appActivity\");\r\n\t\tcontext.setFullReset(true);\r\n\t\tcontext.setApp(\"com.covea.mobileapp\");\r\n\t\tDriverConfig config = new DriverConfig(context);\r\n\t\t\r\n\t\tAndroidCapabilitiesFactory capaFactory = new AndroidCapabilitiesFactory(config);\r\n\t\tMutableCapabilities capa = capaFactory.createCapabilities();\r\n\t\t\r\n\t\tAssert.assertEquals(capa.getCapability(MobileCapabilityType.AUTOMATION_NAME), \"Selendroid\");\r\n\t}", "public AndroidDriver<AndroidElement> Capabilities() throws MalformedURLException {\n\t\t\n\t\t\n\t\t\n\t\tDesiredCapabilities cap = new DesiredCapabilities();\n\t\tcap.setCapability(MobileCapabilityType.PLATFORM_NAME, \"Andriod\");\n\t\t//cap.setCapability(MobileCapabilityType.PLATFORM_VERSION, \"9\");\n\t\tcap.setCapability(MobileCapabilityType.DEVICE_NAME, \"Android Device\");\n\t\tcap.setCapability(MobileCapabilityType.BROWSER_NAME, \"chrome\");\n\t\tcap.setCapability(MobileCapabilityType.BROWSER_VERSION, \"76.0\");\n\t\tcap.setCapability(MobileCapabilityType.AUTOMATION_NAME, \"uiautomator2\");\n\t\t\n\t\t//connection to server\n\t\t//AndroidDriver driver = new AndroidDriver(IPaddressOfserver,capabilities); // This will invokes android object. see below\n\t\t\n\t\tAndroidDriver<AndroidElement> driver = new AndroidDriver<AndroidElement>(new URL(\"http://0.0.0.0:4723/wd/hub\"),cap); // IP address of every local host in any machine is http://127.0.0.1\n\t\treturn driver;\n\t\t\n\t}", "@BeforeClass\n public void setUp() throws Exception {\n\n DesiredCapabilities capabilities = new DesiredCapabilities();\n capabilities.setCapability(\"platformName\", \"Android\");\n capabilities.setCapability(\"deviceName\", \"Samsung Galaxy S4 Emulator\");\n capabilities.setCapability(\"platformVersion\", \"4.4\");\n capabilities.setCapability(\"browserName\", \"browser\");\n capabilities.setCapability(\"deviceOrientation\", \"portrait\");\n capabilities.setCapability(\"appiumVersion\", \"1.5.3\");\n driver = new AndroidDriver(new URL(URL), capabilities);\n\n }", "@BeforeTest\n public void setUp() throws Exception {\n\t \n appiumStop();\n // Start appium server.\n appiumStart();\n DesiredCapabilities capabilities = new DesiredCapabilities();\n capabilities.setCapability(\"deviceName\", \"Android Emulator\");\n capabilities.setCapability(\"browserName\", \"Android\");\n capabilities.setCapability(\"platformVersion\", \"6.0\");\n capabilities.setCapability(\"platformName\", \"Android\");\n capabilities.setCapability(\"appPackage\", \"com.hmh.api\");\n capabilities.setCapability(\"appActivity\", \"com.hmh.api.ApiDemos\");\n driver = new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);\n }", "public static KAppiumDriver getDriver(String driverType, String seleniuGridUrl) {\n WebDriver driver = null;\n AppiumDriver appiumDriver = null;\n KAppiumDriver kAppiumDriver = null;\n //for specify download folder\n //String downloadFilepath = ConfigHelper.getDownloadFolder();\n switch (driverType) {\n case \"android\": {\n String appPath = ConfigHelper.getAppPath();\n\n String url = ConfigHelper.getAppiumServerURL();\n DesiredCapabilities capabilities = new DesiredCapabilities();\n\n capabilities.setCapability(MobileCapabilityType.APPIUM_VERSION, ConfigHelper.getAppiumVersion());\n //capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, ConfigHelper.getPlatformVersion());\n capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, ConfigHelper.getDeviceName());\n capabilities.setCapability(MobileCapabilityType.APP, appPath);\n if (!ConfigHelper.getAutomationName().isEmpty()) {\n capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, ConfigHelper.getAutomationName());\n }\n try {\n appiumDriver = new AndroidDriver(new URL(url), capabilities);\n kAppiumDriver = new KAppiumDriver(appiumDriver);\n logger.info(\"AndroidDriver is \" + driverType + \" driver, pointing \" + \" is generated on\" + url);\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n break;\n }\n case \"ios\": {\n String appPath = ConfigHelper.getAppPath();\n\n String url = ConfigHelper.getAppiumServerURL();\n DesiredCapabilities capabilities = new DesiredCapabilities();\n //capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, ConfigHelper.getDriverType());\n capabilities.setCapability(MobileCapabilityType.APPIUM_VERSION, ConfigHelper.getAppiumVersion());\n capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, ConfigHelper.getPlatformVersion());\n capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, ConfigHelper.getDeviceName());\n capabilities.setCapability(MobileCapabilityType.APP, appPath);\n if (!ConfigHelper.getAutomationName().isEmpty()) {\n capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, ConfigHelper.getAutomationName());\n }\n try {\n appiumDriver = new IOSDriver(new URL(url), capabilities);\n kAppiumDriver = new KAppiumDriver(appiumDriver);\n logger.info(\"IOSDriver is \" + driverType + \" driver, pointing \" + \" is generated on\" + url);\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n break;\n }\n case \"browserstack\":\n String USERNAME = \"a user name\";\n String AUTOMATE_KEY = \"a password\";\n // final String URL = \"http://otis8:5ZpdSfAmCEpyvwrF8BTq@hub.browserstack.com:80/wd/hub\";\n String URL = \"http://\" + USERNAME + \":\" + AUTOMATE_KEY + \"@hub.browserstack.com:80/wd/hub\";\n if (!ConfigHelper.getString(\"browserstack.url\").isEmpty()) {\n URL = ConfigHelper.getString(\"browserstack.url\");\n logger.info(URL);\n }\n\n //browserstack.debug=true\n DesiredCapabilities caps = new DesiredCapabilities();\n if (!ConfigHelper.getString(\"browserstack.os\").isEmpty()) {\n caps.setCapability(\"os\", ConfigHelper.getString(\"browserstack.os\"));\n logger.info(\"browserstack.os\" + ConfigHelper.getString(\"browserstack.os\"));\n }\n if (!ConfigHelper.getString(\"browserstack.debug\").isEmpty()) {\n caps.setCapability(\"browserstack.debug\", ConfigHelper.getString(\"browserstack.debug\"));\n logger.info(\"browserstack.debug\" + ConfigHelper.getString(\"browserstack.debug\"));\n }\n if (!ConfigHelper.getString(\"browserstack.os_version\").isEmpty()) {\n caps.setCapability(\"os_version\", ConfigHelper.getString(\"browserstack.os_version\"));\n logger.info(\"browserstack.os_version\" + ConfigHelper.getString(\"browserstack.os_version\"));\n }\n if (!ConfigHelper.getString(\"browserstack.browserName\").isEmpty()) {\n caps.setCapability(\"browserName\", ConfigHelper.getString(\"browserstack.browserName\"));\n logger.info(\"browserstack.browserName\" + ConfigHelper.getString(\"browserstack.browserName\"));\n }\n if (!ConfigHelper.getString(\"browserstack.browser_version\").isEmpty()) {\n caps.setCapability(\"browser_version\", ConfigHelper.getString(\"browserstack.browser_version\"));\n logger.info(\"browserstack.browser_version\" + ConfigHelper.getString(\"browserstack.browser_version\"));\n }\n if (!ConfigHelper.getString(\"browserstack.browserstack.local\").isEmpty()) {\n caps.setCapability(\"browserstack.local\", ConfigHelper.getString(\"browserstack.browserstack.local\"));\n logger.info(\"browserstack.local\" + ConfigHelper.getString(\"browserstack.browserstack.local\"));\n }\n if (!ConfigHelper.getString(\"browserstack.browserstack.debug\").isEmpty()) {\n caps.setCapability(\"browserstack.debug\", ConfigHelper.getString(\"browserstack.browserstack.debug\"));\n logger.info(\"browserstack.debug\" + ConfigHelper.getString(\"browserstack.browserstack.debug\"));\n }\n if (!ConfigHelper.getString(\"browserstack.browserstack.console\").isEmpty()) {\n caps.setCapability(\"browserstack.console\", ConfigHelper.getString(\"browserstack.browserstack.console\"));\n logger.info(\"browserstack.console\" + ConfigHelper.getString(\"browserstack.browserstack.console\"));\n }\n if (!ConfigHelper.getString(\"browserstack.browserstack.networkLogs\").isEmpty()) {\n caps.setCapability(\"browserstack.networkLogs\", ConfigHelper.getString(\"browserstack.browserstack.networkLogs\"));\n logger.info(\"browserstack.networkLogs\" + ConfigHelper.getString(\"browserstack.browserstack.networkLogs\"));\n }\n if (!ConfigHelper.getString(\"browserstack.browserstack.video\").isEmpty()) {\n caps.setCapability(\"browserstack.video\", ConfigHelper.getString(\"browserstack.browserstack.video\"));\n logger.info(\"browserstack.video\" + ConfigHelper.getString(\"browserstack.browserstack.video\"));\n }\n if (!ConfigHelper.getString(\"browserstack.browserstack.timezone\").isEmpty()) {\n caps.setCapability(\"browserstack.timezone\", ConfigHelper.getString(\"browserstack.browserstack.timezone\"));\n logger.info(\"browserstack.timezone\" + ConfigHelper.getString(\"browserstack.browserstack.timezone\"));\n }\n if (!ConfigHelper.getString(\"browserstack.resolution\").isEmpty()) {\n caps.setCapability(\"resolution\", ConfigHelper.getString(\"browserstack.resolution\"));\n\n logger.info(\"resolution\" + ConfigHelper.getString(\"browserstack.resolution\"));\n }\n if (!ConfigHelper.getString(\"browserstack.selenium_version\").isEmpty()) {\n caps.setCapability(\"selenium_version\", ConfigHelper.getString(\"browserstack.selenium_version\"));\n logger.info(\"selenium_version\" + ConfigHelper.getString(\"browserstack.selenium_version\"));\n }\n if (!ConfigHelper.getString(\"browserstack.device\").isEmpty()) {\n caps.setCapability(\"device\", ConfigHelper.getString(\"browserstack.device\"));\n logger.info(\"device\" + ConfigHelper.getString(\"browserstack.device\"));\n }\n if (!ConfigHelper.getString(\"browserstack.realMobile\").isEmpty()) {\n caps.setCapability(\"realMobile\", ConfigHelper.getString(\"browserstack.realMobile\"));\n logger.info(\"realMobile\" + ConfigHelper.getString(\"browserstack.realMobile\"));\n }\n if (!ConfigHelper.getString(\"browserstack.browserstack.appium_version\").isEmpty()) {\n caps.setCapability(\"browserstack.appium_version\", ConfigHelper.getString(\"browserstack.browserstack.appium_version\"));\n logger.info(\"browserstack.appium_version\" + ConfigHelper.getString(\"browserstack.browserstack.appium_version\"));\n }\n if (!ConfigHelper.getString(\"browserstack.deviceOrientation\").isEmpty()) {\n caps.setCapability(\"deviceOrientation\", ConfigHelper.getString(\"browserstack.deviceOrientation\"));\n logger.info(\"deviceOrientation\" + ConfigHelper.getString(\"browserstack.deviceOrientation\"));\n\n }\n // WebDriver driver = null;\n try {\n driver = new RemoteWebDriver(new URL(URL), caps);\n logger.info(\"browserStack is \" + driverType + \" driver, pointing \" + seleniuGridUrl, caps + \" is generated\");\n } catch (MalformedURLException malformedURLException) {\n logger.info(malformedURLException.toString());\n return null;\n }\n break;\n case \"chrome\":\n //final ChromeOptions chromeOptions = new ChromeOptions();\n HashMap<String, Object> chromePrefs = new HashMap<String, Object>();\n chromePrefs.put(\"profile.default_content_settings.popups\", 0);\n chromePrefs.put(\"download.prompt_for_download\", \"false\");\n chromePrefs.put(\"download.directory_upgrade\", \"true\");\n chromePrefs.put(\"plugins.always_open_pdf_externally\", \"true\");\n chromePrefs.put(\"download.default_directory\", ConfigHelper.getDownloadFolder());\n chromePrefs.put(\"plugins.plugins_disabled\", new String[]{\n \"Adobe Flash Player\",\n \"Chrome PDF Viewer\"\n });\n chromePrefs.put(\"pdfjs.disabled\", true);\n ChromeOptions chromeOptions = new ChromeOptions();\n chromeOptions.setExperimentalOption(\"prefs\", chromePrefs);\n chromeOptions.addArguments(\"start-maximized\");\n chromeOptions.addArguments(\"disable-infobars\");\n chromeOptions.addArguments(\"--test-type\");\n DesiredCapabilities cap = DesiredCapabilities.chrome();\n cap.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, UnexpectedAlertBehaviour.IGNORE);\n cap.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);\n cap.setCapability(ChromeOptions.CAPABILITY, chromeOptions);\n\n if (ConfigHelper.getString(\"chrome.headless\").toLowerCase().contains(\"t\") || ConfigHelper.getString(\"chrome.headless\").toLowerCase().contains(\"y\")) {\n chromeOptions.addArguments(\"--headless\");\n logger.info(\"chrome headless mode adopted\");\n }\n\n if ((null == seleniuGridUrl) || (seleniuGridUrl.equals(\"\") || seleniuGridUrl.equals(\"127.0.0.1\"))) {\n //remove later, should be a better way - Kris\n //System.setProperty(\"webdriver.chrome.driver\", \"c:/source/chromedriver.exe\");\n driver = new ChromeDriver(cap);\n\n logger.info(driverType + \" driver is generated locally\");\n } else {\n try {\n\n driver = new RemoteWebDriver(new URL(ConfigHelper.getString(\"selenium.grid.url\")), cap);\n logger.info(\"remoteWebdriver is \" + driverType + \" driver, pointing \" + seleniuGridUrl, cap + \" is generated\");\n } catch (MalformedURLException malformedURLException) {\n logger.info(malformedURLException.toString());\n return null;\n }\n }\n break;\n case \"firefox\":\n if ((null == seleniuGridUrl) || (seleniuGridUrl.equals(\"\"))) {\n FirefoxOptions options = new FirefoxOptions();\n driver = new FirefoxDriver(options);\n logger.info(driverType + \" driver is generated locally\");\n } else {\n try {\n DesiredCapabilities capability = DesiredCapabilities.firefox();\n driver = new RemoteWebDriver(new URL(ConfigHelper.getString(\"selenium.grid.url\")), capability);\n logger.info(\"remoteWebdriver is \" + driverType + \" driver, pointing \" + seleniuGridUrl, capability + \" is generated\");\n } catch (MalformedURLException malformedURLException) {\n logger.info(malformedURLException.toString());\n return null;\n }\n }\n break;\n case \"edge\":\n if ((null == seleniuGridUrl) || (seleniuGridUrl.equals(\"\"))) {\n EdgeOptions options = new EdgeOptions();\n driver = new EdgeDriver(options);\n logger.info(driverType + \" driver is generated locally\");\n } else {\n try {\n DesiredCapabilities capability = DesiredCapabilities.edge();\n driver = new RemoteWebDriver(new URL(ConfigHelper.getString(\"selenium.grid.url\")), capability);\n logger.info(\"remoteWebdriver is \" + driverType + \" driver, pointing \" + seleniuGridUrl, capability + \" is generated\");\n } catch (MalformedURLException malformedURLException) {\n logger.info(malformedURLException.toString());\n return null;\n }\n }\n break;\n case \"phantomjs\":\n if ((null == seleniuGridUrl) || (seleniuGridUrl.equals(\"\"))) {\n driver = new PhantomJSDriver();\n logger.info(driverType + \" driver is generated locally\");\n } else {\n try {\n DesiredCapabilities capability = DesiredCapabilities.edge();\n driver = new RemoteWebDriver(new URL(ConfigHelper.getString(\"selenium.grid.url\")), capability);\n logger.info(\"remoteWebdriver is \" + driverType + \" driver, pointing \" + seleniuGridUrl, capability + \" is generated\");\n } catch (MalformedURLException malformedURLException) {\n logger.info(malformedURLException.toString());\n return null;\n }\n }\n driver = new PhantomJSDriver();\n break;\n case \"ie\":\n if ((null == seleniuGridUrl) || (seleniuGridUrl.equals(\"\"))) {\n InternetExplorerOptions options = new InternetExplorerOptions();\n driver = new InternetExplorerDriver();\n logger.info(driverType + \" driver is generated locally\");\n } else {\n try {\n DesiredCapabilities capability = DesiredCapabilities.internetExplorer();\n driver = new RemoteWebDriver(new URL(ConfigHelper.getString(\"selenium.grid.url\")), capability);\n logger.info(\"remoteWebdriver is \" + driverType + \" driver, pointing \" + seleniuGridUrl, capability + \" is generated\");\n } catch (MalformedURLException malformedURLException) {\n logger.info(malformedURLException.toString());\n return null;\n }\n }\n\n break;\n case \"safari\":\n if ((null == seleniuGridUrl) || (seleniuGridUrl.equals(\"\"))) {\n SafariOptions options = new SafariOptions();\n driver = new SafariDriver(options);\n logger.info(driverType + \" driver is generated locally\");\n } else {\n try {\n DesiredCapabilities capability = DesiredCapabilities.safari();\n driver = new RemoteWebDriver(new URL(ConfigHelper.getString(\"selenium.grid.url\")), capability);\n logger.info(\"remoteWebdriver is \" + driverType + \" driver, pointing \" + seleniuGridUrl, capability + \" is generated\");\n } catch (MalformedURLException malformedURLException) {\n logger.info(malformedURLException.toString());\n return null;\n }\n }\n break;\n default:\n throw new IllegalArgumentException(\"the browser type is not defined\");\n }\n\n if (kAppiumDriver != null) {\n return kAppiumDriver;\n }\n return (KAppiumDriver) driver;\n }", "public void init() throws MalformedURLException {\n\n capabilities = new DesiredCapabilities();\n\n capabilities.setCapability(\"deviceName\", \"Nex5\");\n capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, \"Android\");\n capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, \"8.0\");\n capabilities.setCapability(\"appPackage\", \"com.trello\");\n capabilities.setCapability(\"appActivity\", \".home.HomeActivity\");\n\n capabilities.setCapability(\"automationName\", \"Appium\");\n capabilities.setCapability(\"app\", \"C:/Users/Study/APK/trello_new.apk\");\n driver = new AppiumDriver<MobileElement>(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\n welcomeActivity = new WelcomePage(driver);\n loginActivity = new LoginPage(driver);\n\n }", "@BeforeClass\npublic void setUp() throws MalformedURLException{\n\tDesiredCapabilities capabilities = new DesiredCapabilities();\n\t//capabilities.setCapability(\"BROWSER_NAME\", \"Android\");\n//\tcapabilities.setCapability(\"VERSION\", \"4.4.2\"); \n\tcapabilities.setCapability(\"deviceName\",\"NSM3Y18206000488\");\n\tcapabilities.setCapability(\"udid\",\"NSM3Y18206000488\");\n\tcapabilities.setCapability(\"platformName\",\"Android\");\n capabilities.setCapability(\"appPackage\", \"com.android.chrome\");\n// This package name of your app (you can get it from apk info app)\n\tcapabilities.setCapability(\"appActivity\",\"com.google.android.apps.chrome.Main\"); // This is Launcher activity of your app (you can get it from apk info app)\n//Create RemoteWebDriver instance and connect to the Appium server\n //It will launch the Calculator App in Android Device using the configurations specified in Desired Capabilities\n driver = new AndroidDriver<MobileElement>(new URL(\"http://localhost:4723/wd/hub\"), capabilities);\n \n // PageFactory.initElements(driver, this);\n}", "@BeforeClass\n public void beforeClass() throws MalformedURLException {\n\t DesiredCapabilities caps = new DesiredCapabilities();\n\t caps.setCapability(\"devicename\", \"Pixel\");\n\t caps.setCapability(\"platform\", \"Android\");\n\t caps.setCapability(\"addActivity\", \".ui.TaskListsActivity\");\n\t caps.setCapability(\"addPackage\", \"com.google.android.apps.tasks\");\n\t caps.setCapability(\"noReset\", true);\n\t caps.setCapability(\"webviewDevtoolsPort\", 9543);\n\t \n\t //instantiate appium driver\n\t URL appserver = new URL(\"http://0.0.0.0:4723/wd/hub\");\n\t driver = new AndroidDriver<MobileElement>(appserver,caps);\n\t wait = new WebDriverWait(driver, 5);\n }", "@BeforeClass\n public void classLevelSetup() {\n\t\t \t\tcaps = new DesiredCapabilities();\n \t\t\tcaps.setCapability(\"deviceName\", \"My Phone\");\n \t\t\tcaps.setCapability(\"udid\", \"8f81d4e2\"); //Give Device ID of your mobile phone\n \t\t\tcaps.setCapability(\"platformName\", \"Android\");\n \t\t\tcaps.setCapability(\"platformVersion\", \"9\"); // The version of Android on your device\n \t\t\tcaps.setCapability(\"browserName\", \"Chrome\");\n \t\t\tcaps.setCapability(\"noReset\", true);\n \t\t\tcaps.setCapability(MobileCapabilityType.PLATFORM_NAME, MobilePlatform.ANDROID);\n \t\t\tcaps.setCapability(\"chromedriverExecutable\", \"C:\\\\SeleniumGecko\\\\chromedriver78.exe\"); // Set ChromeDriver location\n \t\t\t\n\n \t\t\t//Instantiate Appium Driver or AndroidDriver\n \t\t\ttry {\n \t\t\t\tdriver = new AppiumDriver<>(new URL(appium_node), caps);\n \t\t\t\t\n \t\t\t} catch (MalformedURLException e) {\n \t\t\t\tSystem.out.println(e.getMessage());\n \t\t\t}\n \t\t\t\t\t\n\n\t\t\n }", "@SuppressWarnings(\"rawtypes\")\r\n\t@BeforeMethod\r\n\t public void setUp() throws MalformedURLException {\n\t\tDesiredCapabilities capabilities = new DesiredCapabilities();\r\n\t\tcapabilities.setCapability(\"deviceName\", \"ZX1D63SFXH\");\r\n\t\tcapabilities.setCapability(\"platformName\", \"Android\");\r\n\t\t//capabilities.setCapability(\"app\", targetApp.getAbsolutePath());\r\n\t\t//capabilities.setCapability(\"fastReset\", \"true\");\r\n\t\t//capabilities.setCapability(\"fullReset\", \"true\");\r\n\t\tcapabilities.setCapability(\"appPackage\", \"com.testleaf.leaforg\");\r\n\t\tcapabilities.setCapability(\"appActivity\", \"com.testleaf.leaforg.MainActivity\");\r\n\t\t\r\n\t\tdriver = new AndroidDriver(new URL(\"http://0.0.0.0:4723/wd/hub\"), capabilities);\r\n\t\tdriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\r\n\t\t\r\n\t\t\r\n\t}", "@BeforeClass\npublic void beforeClass() throws MalformedURLException {\n DesiredCapabilities caps = new DesiredCapabilities();\n caps.setCapability(\"deviceName\", \"Xiaomi Redmi Note 5 Pro\");\n caps.setCapability(\"platformName\", \"android\");\n caps.setCapability(\"automationName\", \"UiAutomator2\");\n caps.setCapability(\"appPackage\", \"com.google.android.keep\");\n caps.setCapability(\"appActivity\", \".activities.BrowseActivity\");\n caps.setCapability(\"noReset\", true);\n\n // Instantiate Appium Driver\n URL appServer = new URL(\"http://0.0.0.0:4723/wd/hub\");\n driver = new AndroidDriver<MobileElement>(appServer, caps);\n \n}", "@BeforeTest\n\t public void setup() throws MalformedURLException {\n\t DesiredCapabilities caps = new DesiredCapabilities();\n\t caps.setCapability(\"deviceName\", \"Pixel 4 API 28\");\n\t caps.setCapability(\"platformName\", \"Android\");\n\t caps.setCapability(\"appPackage\", \"com.google.android.apps.tasks\");\n\t caps.setCapability(\"appActivity\", \".ui.TaskListsActivity\");\n\t caps.setCapability(\"noReset\", true);\n\t \n\t // Instantiate Appium Driver\n\t driver = new AndroidDriver<MobileElement>(new URL(\"http://127.0.0.1:4723/wd/hub\"), caps);\n\t wait = new WebDriverWait(driver, 10);\n\t }", "@Test(groups={\"ut\"})\r\n\tpublic void testCreateCapabilitiesWithUserDefined() {\r\n\t\tSeleniumTestsContext context = new SeleniumTestsContext(SeleniumTestsContextManager.getThreadContext());\r\n\t\tcontext.setBrowser(BrowserType.CHROME.toString());\r\n\t\tcontext.setMobilePlatformVersion(\"8.0\");\r\n\t\tcontext.setPlatform(\"android\");\r\n\t\tcontext.setDeviceName(\"Samsung Galasy S8\");\r\n\t\tcontext.setApp(\"\");\r\n\t\tcontext.setAppiumCapabilities(\"key1=value1;key2=value2\");\r\n\t\t\r\n\t\tDriverConfig config = new DriverConfig(context);\r\n\t\t\r\n\t\t\r\n\t\tAndroidCapabilitiesFactory capaFactory = new AndroidCapabilitiesFactory(config);\r\n\t\tMutableCapabilities capa = capaFactory.createCapabilities();\r\n\t\t\r\n\t\tAssert.assertEquals(capa.getCapability(\"key1\"), \"value1\");\r\n\t\tAssert.assertEquals(capa.getCapability(\"key2\"), \"value2\");\r\n\r\n\t}", "public static AppiumDriverLocalService AppiumServerStart(){\n System.out.println(\"Into driver setup\");\n AppiumDriverLocalService service;\n\n AppiumServiceBuilder serviceBuilder = new AppiumServiceBuilder();\n\n serviceBuilder.usingAnyFreePort();\n // /usr/local/bin/node\n serviceBuilder.usingDriverExecutable(new File(\"/usr/local/bin/node\"));\n // /usr/local/bin/appium\n serviceBuilder.withAppiumJS(new File(\"/usr/local/bin/appium\"));\n serviceBuilder.withArgument(GeneralServerFlag.RELAXED_SECURITY);\n serviceBuilder.withArgument(GeneralServerFlag.SHELL);\n HashMap<String, String> environment = new HashMap();\n environment.put(\"PATH\", \"/usr/local/bin:\" + System.getenv(\"PATH\"));\n\n\n service = AppiumDriverLocalService.buildService(serviceBuilder);\n service.start();\n return service;\n }", "@Test(groups={\"ut\"})\r\n\tpublic void testCreateCapabilitiesWithApplicationOldAndroid2() {\r\n\t\tSeleniumTestsContext context = new SeleniumTestsContext(SeleniumTestsContextManager.getThreadContext());\r\n\t\tcontext.setMobilePlatformVersion(\"5.0\");\r\n\t\tcontext.setPlatform(\"android\");\r\n\t\tcontext.setDeviceName(\"Samsung Galasy S5\");\r\n\t\tcontext.setAppPackage(\"appPackage\");\r\n\t\tcontext.setAppActivity(\"appActivity\");\r\n\t\tcontext.setFullReset(true);\r\n\t\tcontext.setApp(\"com.covea.mobileapp\");\r\n\t\tDriverConfig config = new DriverConfig(context);\r\n\t\t\r\n\t\tAndroidCapabilitiesFactory capaFactory = new AndroidCapabilitiesFactory(config);\r\n\t\tMutableCapabilities capa = capaFactory.createCapabilities();\r\n\t\t\r\n\t\tAssert.assertEquals(capa.getCapability(MobileCapabilityType.AUTOMATION_NAME), \"UiAutomator1\");\r\n\t}", "@BeforeTest\n\t\tpublic void setUp() throws MalformedURLException {\n\t\t\t DesiredCapabilities capabilities = new DesiredCapabilities();\n\t\t\t // Set android deviceName desired capability. Set your device name.\n\t\t\t capabilities.setCapability(\"deviceName\", \"Custom Phone - 4.2.2 API 17 - 768*1280\");\n\t\t\t // Set BROWSER_NAME desired capability. It's Android in our case here.\n\t\t\t capabilities.setCapability(\"browserName\", \"Android\");\n\n\t\t\t // Set android VERSION desired capability. Set your mobile device's OS version.\n\t\t\t capabilities.setCapability(\"platformVersion\", \"4.2.2\");\n\n\t\t\t // Set android platformName desired capability. It's Android in our case here.\n\t\t\t capabilities.setCapability(\"platformName\", \"Android\");\n\t\t\t // Created object of RemoteWebDriver will all set capabilities.\n\t\t\t // Set appium server address and port number in URL string.\n\t\t\t // It will launch calculator app in android device.\n\t\t\t // capabilities.setCapability(\"unicodeKeyboard\", true);\n\t\t\t // capabilities.setCapability(\"resetKeyboard\", true);\n\t\t\t driver = new RemoteWebDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\t\t\t driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);\n\t\t\t }", "@BeforeClass\npublic void beforeClass() throws MalformedURLException {\n\tDesiredCapabilities caps = new DesiredCapabilities();\n\tcaps.setCapability(\"deviceName\", \"Xiaomi Redmi Note 5 Pro\");\n caps.setCapability(\"platformName\", \"android\");\n caps.setCapability(\"automationName\", \"UiAutomator2\");\n caps.setCapability(\"appPackage\", \"com.android.chrome\");\n caps.setCapability(\"appActivity\", \"com.google.android.apps.chrome.Main\");\n caps.setCapability(\"noReset\", true);\n\n // Instantiate Appium Driver\n URL appServer = new URL(\"http://0.0.0.0:4723/wd/hub\");\n driver = new AndroidDriver<MobileElement>(appServer, caps);\n \n}", "public DriverConfig createDriver()\n {\n DriverConfig driver = new DriverConfig(this);\n \n _driverList.add(driver);\n \n return driver;\n }", "@BeforeMethod\n public void beforeTest() throws MalformedURLException {\n DesiredCapabilities caps = new DesiredCapabilities();\n caps.setCapability(\"deviceId\", \"2fb5cf35\");\n caps.setCapability(\"deviceName\", \"OnePlus 6\");\n caps.setCapability(\"platformName\", \"Android\");\n caps.setCapability(\"appPackage\", \"com.oneplus.calculator\");\n caps.setCapability(\"appActivity\", \"Calculator\");\n caps.setCapability(\"noReset\", true);\n\n // Initialize driver\n URL appServer = new URL(\"http://0.0.0.0:4723/wd/hub\");\n driver = new AndroidDriver<MobileElement>(appServer, caps);\n }", "@BeforeClass\n public void beforeClass() throws MalformedURLException {\n DesiredCapabilities caps = new DesiredCapabilities();\n caps.setCapability(\"deviceName\", \"bb9d156c\");\n caps.setCapability(\"platformName\", \"Android\");\n caps.setCapability(\"appPackage\", \"com.google.android.apps.tasks\");\n caps.setCapability(\"appActivity\", \".ui.TaskListsActivity\");\n // caps.setCapability(\"noReset\", true);\n\n // Instantiate Appium Driver\n URL appServer = new URL(\"http://0.0.0.0:4723/wd/hub\");\n driver = new AndroidDriver<MobileElement>(appServer, caps);\n \n }", "private WebDriver createDriver() {\r\n\t\tlogger.info(\"Environment Type is \" + environmentType);\r\n\t\tswitch (environmentType) {\r\n\t\tcase LOCAL:\r\n\t\t\tdriver = createLocalDriver();\r\n\t\t\tbreak;\r\n\t\tcase REMOTE:\r\n\t\t\tdriver = createRemoteDriver();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn driver;\r\n\t}", "public DriverForCreateBuilder() {\r\n driverForCreate = new DriverForCreate();\r\n }", "@BeforeClass\r\n public void beforeClass() throws MalformedURLException {\n DesiredCapabilities caps = new DesiredCapabilities();\r\n caps.setCapability(\"deviceName\", \"PixelEmulator\");\r\n caps.setCapability(\"platformName\", \"Android\");\r\n caps.setCapability(\"appPackage\", \"com.google.android.keep\");\r\n caps.setCapability(\"appActivity\", \".activities.BrowseActivity\");\r\n caps.setCapability(\"noReset\", true);\r\n\r\n // Instantiate Appium Driver\r\n URL remoteURL = new URL(\"http://localhost:4723/wd/hub\");\r\n driver = new AndroidDriver<MobileElement>(remoteURL, caps);\r\n \r\n }", "public static void main(String[] args) throws MalformedURLException, InterruptedException {\n\t\t\nDesiredCapabilities capabilities= new DesiredCapabilities();\n\t\t\n\t\tcapabilities.setCapability(\"deviceName\", \"GT-I9300I\");\n\t\tcapabilities.setCapability(\"platformName\", \"Android\");\n\t\tcapabilities.setCapability(\"platformVersion\", \"4.4.4\");\n\t\t\n\t\tcapabilities.setCapability(\"appPackage\", \"org.khanacademy.android\");\n\t\tcapabilities.setCapability(\"appActivity\", \"org.khanacademy.android.ui.library.MainActivity\");\n\t\t\n\t\tAndroidDriver driver = new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\t\n\t\tThread.sleep(20000);\n\t\tSystem.out.println(driver.getContext());\n\t\t\n\t\tSet<String> contextNames = driver.getContextHandles();\n\t\tSystem.out.println(contextNames.size());\n\t\t //You can prints out something like NATIVE_APP , WEBVIEW_1 \n\t\t for (String contextName : contextNames) { \n\t\t System.out.println(contextName);\n//\t\t if (contextName.contains(\"WEBVIEW\")){\n//\t driver.context(contextName);\n//\t }\n\t\t }\n\n\t\t \n\n\t}", "private void createDriver() {\n account = new Account(\"driver\", \"password\", \"driver@uclive.ac.nz\",\n \"Dan\", \"20 Howard Street\", 1234567, 64278182123L,\n new Licence(\"Full for over 2 years\", \"YXF87231\",\n LocalDate.parse(\"12/12/2015\", formatter),\n LocalDate.parse(\"12/12/2020\", formatter)));\n }", "public static AppiumDriver<MobileElement> setUp() {\n\t\ttry {\t\t\n\t\t\t\n\t\tDesiredCapabilities cap=new DesiredCapabilities();\n\t\tcap.setCapability(MobileCapabilityType.PLATFORM_NAME,\"ANDROID\");\n\t\tcap.setCapability(MobileCapabilityType.PLATFORM_VERSION, \"10 QKQ1.190915.002\");\n\t\tcap.setCapability(MobileCapabilityType.DEVICE_NAME, \"Redmi Note 7 Pro\");\n\t\tcap.setCapability(MobileCapabilityType.UDID, \"d9b3ca47\");\n//\t\tcap.setCapability(MobileCapabilityType.APP, \"\");\n\t\tcap.setCapability(\"appPackage\", \"com.swaglabsmobileapp\");\n\t\tcap.setCapability(\"appActivity\", \"com.swaglabsmobileapp.SplashActivity\");\n\t\t\n\t\tURL url=new URL(\"http://127.0.0.1:4723/wd/hub\");\n\t\tdriver =new AppiumDriver<MobileElement>(url, cap);\n\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\n//\t\tlog.info(\"Launching the app\");\n//\t\tMobileElement loginbutton = driver.findElement(MobileBy.AccessibilityId(\"test-LOGIN\"));\n// loginbutton.click();\n\t\t\t\treturn driver;\n\t\t}catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn driver;\n\t\t}\n\t}", "public static void main(String[] args) throws MalformedURLException {\n\r\n\t\tDesiredCapabilities cap= new DesiredCapabilities();\r\n\t\tcap.setCapability(\"deviceName\", \"redmi\");\r\n\t\tcap.setCapability(\"platformName\", \"Android\");\r\n\t\t\r\n\t\t //can get from appium server inspector \r\n\t\t cap.setCapability(\"appPackage\",\"org.khanacademy.android\"); \r\n\t\t //Use apkAnalyzer app to get activity\r\n\t\t cap.setCapability(\"appActivity\", \"org.khanacademy.android.ui.library.MainActivity\");\r\n\t\t \r\n\r\n\t\t/*\r\n\t\t * //can get from appium server inspector \r\n\t\t * cap.setCapability(\"appPackage\", \"com.aranah.healthkart.plus\"); //Use apkAnalyzer app to get activity\r\n\t\t * cap.setCapability(\"appActivity\", \"com.aranah.healthkart.home.HomeActivity\");\r\n\t\t */\r\n\t\t/*\r\n\t\t * cap.setCapability(\"appPackage\", \"com.aranah.healthkart.plus\"); //Use\r\n\t\t * apkAnalyzer app to get activity cap.setCapability(\"appActivity\",\r\n\t\t * \"com.aranah.healthkart.home.HomeActivity\");\r\n\t\t */\t//To stop reseting aap\r\n\t\tcap.setCapability(\"noReset\", true);\r\n\r\n\t\tAndroidDriver<WebElement> driver = new AndroidDriver<WebElement>(new URL(\"http://localhost:4723/wd/hub\"), cap);\r\n\r\n\t\tdriver.manage().timeouts().implicitlyWait(40, TimeUnit.SECONDS);\r\n\t\t/*\r\n\t\t * driver.findElementByXPath(\"//*[@text='Health Products']\").click();\r\n\t\t * \r\n\t\t * //UiScrollable class String visibleText = \"Arts and humani\";\r\n\t\t * driver.findElementByAndroidUIAutomator\r\n\t\t * (\"new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().textContains(\\\"\"\r\n\t\t * + visibleText + \"\\\").instance(0))\").click();\r\n\t\t * \r\n\t\t */\r\n\t}", "private native void CreateJNIObj(String device);", "@Override\r\n public WebDriver createWebDriver() {\n MutableCapabilities capabilities = createSpecificGridCapabilities(webDriverConfig);\r\n capabilities.merge(driverOptions);\r\n \r\n // \r\n gridConnector.uploadMobileApp(capabilities);\r\n\r\n // connection to grid is made here\r\n driver = getDriver(gridConnector.getHubUrl(), capabilities);\r\n\r\n setImplicitWaitTimeout(webDriverConfig.getImplicitWaitTimeout());\r\n if (webDriverConfig.getPageLoadTimeout() >= 0 && SeleniumTestsContextManager.isWebTest()) {\r\n setPageLoadTimeout(webDriverConfig.getPageLoadTimeout());\r\n }\r\n\r\n this.setWebDriver(driver);\r\n\r\n runWebDriver();\r\n\r\n ((RemoteWebDriver)driver).setFileDetector(new LocalFileDetector());\r\n\r\n return driver;\r\n }", "@BeforeTest\n public void appiumBrowserTestSetup() throws Exception{\n DesiredCapabilities capabilities = DesiredCapabilities.android();\n\n // set the capability to execute test in chrome browser\n capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, BrowserType.CHROME);\n\n // set the capability to execute our test in Android Platform\n capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, Platform.ANDROID);\n\n // Set the device name as well (you can give any name)\n capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, \"emulator-5554\");\n\n // set the android version as well\n capabilities.setCapability(MobileCapabilityType.VERSION, \"9\");\n\n // set the chromedriver\n capabilities.setCapability(\"chromedriverExecutable\",\"C:\\\\drivers\\\\chromedriver.exe\");\n\n // Create object of URL class and specify the appium server address\n URL url = new URL(\"http://127.0.0.1:4723/wd/hub\");\n\n // Create object of AndroidDriver class and pass the url and capability that we\n // created\n driver = new AppiumDriver(url, capabilities);\n\n driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);\n driver.get(\"https://www.amazon.co.uk/\");\n Thread.sleep(5000);\n }", "public static void main(String[] args) throws MalformedURLException {\n\t\tDesiredCapabilities cap=new DesiredCapabilities();\r\n\t\tcap.setCapability(\"deviceName\",\"abc\");\r\n\t\tcap.setCapability(\"platformName\", \"Android\");\r\n\t\t//cap.setCapability(\"udid\",\"emulator-5554\");\r\n\t\tcap.setCapability(\"appPackage\",\"com.udemy.android\");\r\n\t\tcap.setCapability(\"appActivity\",\"com.udemy.android.SplashActivity\");\r\n\t\tcap.setCapability(\"uiautomator2ServerLaunchTimeout\", 600000);\r\n\t\tcap.setCapability(\"adbExecTimeout\", 600000);\r\n\t\tAndroidDriver<AndroidElement> driver = new AndroidDriver<AndroidElement>(new URL(\"http://0.0.0.0:4723/wd/hub\"),cap);\r\n\t\tdriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\r\n\t\tdriver.findElement(MobileBy.id(\"com.udemy.android:id/browse_button\")).click();\r\n\t\tdriver.findElement(MobileBy.AccessibilityId(\"Search tab\")).click();\r\n\t\tdriver.findElement(MobileBy.id(\"com.udemy.android:id/search_bar_text\")).click();\r\n\t\tdriver.findElement(MobileBy.id(\"com.udemy.android:id/search_bar_text\")).sendKeys(\"selenium\");\r\n\t\tdriver.hideKeyboard();\r\n\r\n\t}", "public static void main(String[] args) throws MalformedURLException {\n\t\tFile appDir = new File(\"src/test/java\");\n\t\tFile app = new File(appDir, \"com.google.android-2.3.apk\");\n\t\tDesiredCapabilities capabilities = new DesiredCapabilities();\n\t\t//capabilities.setCapability(\"browserName\", \"Chrome\");\n\n\t\t//capabilities.setCapability(\"device\",\"Android\");\n\t\tcapabilities.setCapability(\"deveiceName\",\"SimulatorGalaxy\" );\t\t\n\t\tcapabilities.setCapability(\"platformVersion\", \"5.0.1\");\n\t\tcapabilities.setCapability(\"platformName\", \"Android\");\n\t\tcapabilities.setCapability(\"app\",app.getAbsolutePath());\n\t\tcapabilities.setCapability(\"appPackage\",\"com.android.chrome\");\n\t\tcapabilities.setCapability(\"appActivity\",\"com.google.android.apps.chrome.\");\n\t\tdriver = new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\t\n\n\t\t/*driver.get(\"Url\");\n\t\tdriver.findElement(By.id(\"menu_projects\")).click();\n\t\tdriver.findElement(By.id(\"menu_about\")).click();\n\t\tdriver.findElement(By.id(\"menu_support\")).click();\n\t\tdriver.findElement(By.id(\"menu_documentation\")).click();\n\t\tdriver.findElement(By.id(\"menu_download\")).click();\n\n\t\tdriver.quit();*/\n\t}", "AndroidFactory getAndroidFactory();", "RemoteWebDriver getDriver(String appName, String appPackage, String appActivity, String deviceName,\n\t\t\tString fileName) {\n\t\tDesiredCapabilities androidDcap = new DesiredCapabilities();\n\t\tandroidDcap.setCapability(MobileCapabilityType.AUTOMATION_NAME, \"UIAutomator2\");\n\t\tandroidDcap.setCapability(MobileCapabilityType.PLATFORM_NAME, \"Android\");\n\t\tandroidDcap.setCapability(AndroidMobileCapabilityType.AUTO_GRANT_PERMISSIONS, true);\n\t\tandroidDcap.setCapability(MobileCapabilityType.NO_RESET, true);\n\t\tandroidDcap.setCapability(MobileCapabilityType.FULL_RESET, false);\n\t\tandroidDcap.setCapability(AndroidMobileCapabilityType.NO_SIGN, true);\n\t\tandroidDcap.setCapability(AndroidMobileCapabilityType.APP_WAIT_DURATION, 120);\n\t\tandroidDcap.setCapability(\"deviceName\", deviceName);\n\t\tandroidDcap.setCapability(\"browserName\", \"\");\n\t\tandroidDcap.setCapability(\"newCommandTimeout\", 1500);\n\t\tandroidDcap.setCapability(\"appPackage\", appPackage);\n\t\tandroidDcap.setCapability(\"appActivity\", appActivity);\n\t\tandroidDcap.setCapability(\"autoAcceptAlerts\", true);\n\t\tandroidDcap.setCapability(\"autoDismissAlerts\", true);\n\t\tandroidDcap.setCapability(\"app\", System.getProperty(\"user.dir\") + \"/src/main/resources\" + fileName);\n\t\ttry {\n\t\t\tif (System.getProperty(\"location\").equalsIgnoreCase(\"local\")) {\n\t\t\t\tdriver = new AndroidDriver<>(new URL(\"http://127.0.0.1:4651/wd/hub\"), androidDcap);\n\t\t\t\tlogger.info(\"Session ID of Android: \" + driver.getSessionId());\n\t\t\t} else if (System.getProperty(\"location\").equalsIgnoreCase(\"remote\")) {\n\t\t\t\tdriver = new AndroidDriver<>(new URL(PropertyHelper.getProperties(\"REMOTE_HUB_URL\")), androidDcap);\n\t\t\t\tlogger.info(\"Session ID of Android: \" + driver.getSessionId());\n\t\t\t}\n\t\t} catch (WebDriverException e) {\n\t\t\tlogger.error(\"Driver instantiating failed or app is not installed\", e);\n\t\t} catch (MalformedURLException e) {\n\t\t\tlogger.error(e);\n\t\t}\n\t\tdriver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);\n\t\tDriverFactory.getDriverPool().put(appName, driver);\n\t\treturn driver;\n\t}", "@BeforeClass\r\n\tpublic void setup() throws InterruptedException {\r\n\t test=extent.createTest(\"setup\");\r\n\t\tDesiredCapabilities caps = new DesiredCapabilities();\r\n\t\tcaps.setCapability(\"deviceName\", \"My Phone\");\r\n\t\tcaps.setCapability(\"udid\", \"emulator-5554\"); //Give Device ID of your mobile phone\r\n\t\tcaps.setCapability(\"platformName\", \"Android\");\r\n\t\tcaps.setCapability(\"platformVersion\", \"7.0\");\r\n\t\tcaps.setCapability(\"browser_name\", \"Chrome\");\r\n\t\t\r\n\t\tcaps.setCapability(\"appPackage\", \"pegasus.driver\");\r\n\t\tcaps.setCapability(\"appActivity\", \"pegasus.driver.mvvm.auth.AuthActivity\");\r\n\t\t\r\n\t\tcaps.setCapability(\"noReset\", \"false\");\r\n\t\tcaps.setCapability(\"automationName\", \"UiAutomator2\");\r\n\t\tcaps.setCapability(\"newCommandTimeout\", 10000);\r\n\t\tcaps.setCapability(\"autoGrantPermissions\", true);\r\n\t\tcaps.setCapability(\"autoDismissAlerts\", true);\r\n\t\r\n\t\ttry {\r\n\t\t\t String baseURL = \"http://0.0.0.0:\";\r\n\t\t\t String minorURL = \"/wd/hub\";\r\n\t\t\t String port = \"4723\";\r\n\t\t\t //driver = new AppiumDriver<MobileElement>(new URL(baseURL+port+minorURL), caps);\t\r\n\t\t\t driver = new AndroidDriver<MobileElement>(new URL(baseURL+port+minorURL), caps);\t\r\n\t\t\t //driver = new IOSDriver<MobileElement>(new URL(baseURL+port+minorURL), caps);\t\r\n\t\t\t\t \r\n\t\t\t System.out.print(\"passed!!!!!!\");\r\n\t\t} \r\n\t\t\r\n\t\tcatch (MalformedURLException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\tSystem.out.print(\"failed!!!!!!\");\r\n\t\t}\r\n\t\t\r\n\t\tdriver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);\r\n\t\t\r\n\t\t driver.findElement(LoginPage.companyId).sendKeys(\"1111\");\r\n\t\t \r\n\t\t //Enter vehicle id\r\n\t\t driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\r\n\t\t driver.findElement(LoginPage.vehicleId).sendKeys(\"11\");\r\n\t\t\t\r\n\t\t //enter pin number\r\n\t\t\tdriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\r\n\t\t\tdriver.findElement(LoginPage.pinNum).sendKeys(\"1234\");\r\n\t\t\t\r\n\t\t\t//click on login button\r\n\t\t\tdriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\r\n\t\t\tdriver.findElement(LoginPage.LoginBtn).click();\r\n\t\t\ttry {\r\n\t\t\t//allow the access location popup\r\n\t\t\tdriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\r\n\t\t\tdriver.findElement(LoginPage.allowAccessLocation).click();\r\n\t\t\t}\r\n\t\t\tcatch(Exception e) {\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t//close the popup\r\n\t\t\ttry {\r\n\t\t\tdriver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS);\r\n\t\t\tActions action = new Actions(driver);\r\n\t\t WebElement element=driver.findElement(By.className(\"android.widget.Button\"));\r\n\t\t element.click();\r\n\t\t System.out.println(element);\r\n\t\t\t}\r\n\t\t\tcatch(Exception e) {\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t\r\n\t\t}", "@BeforeClass\n public static void startApp() throws MalformedURLException {\n DesiredCapabilities caps = new DesiredCapabilities();\n caps.setCapability(\"platformName\", \"Android\");\n caps.setCapability(\"platformVersion\", \"5.0.1\"); //Replace this with your Android version\n caps.setCapability(\"deviceName\", \"Samsung Galaxy\"); //Replace this with your simulator/device \n Path currentRelativePath = Paths.get(\"\");\n String path = currentRelativePath.toAbsolutePath().toString() + \"/src/main/resources/Evernote.apk\";\n caps.setCapability(\"app\", path); //Replace this with app path in your system\n \n// caps.setCapability(\"appActivity\", \"com.evernote.ui.HomeActivity\");\n// caps.setCapability(\"appPackage\", \"com.evernote\");\n// appInstalled = true;\n\n AppiumServer server = new AppiumServer(serverAddress,port);//setup Appium server \n server.startAppiumServer();//open Appium server automatically\n \n driver = new AndroidDriver(server.getService(),caps);\n driver.manage().timeouts().implicitlyWait(20L, TimeUnit.SECONDS);\n }", "public static void main(String[] args) throws Exception\n\t{\n\t\tScanner sc=new Scanner(System.in);\n\t\tSystem.out.println(\"Enter contact name to call as it is you saved in ur contacts list\");\n\t\tString contactname=sc.nextLine();\n\t\tsc.close();\n\t\t//Start appium server\n\t\tRuntime.getRuntime().exec(\"cmd.exe /c start cmd.exe /k \\\"appium -a 127.0.0.1 -p 4723\\\"\");\n\t\t//Get address of appium Server\n\t\tURL u=new URL(\"http://127.0.0.1:4723/wd/hub\");\n\t\t//Details of app and device(AVD)\n\t\tDesiredCapabilities dc=new DesiredCapabilities();\n\t\tdc.setCapability(CapabilityType.BROWSER_NAME,\"\");\n\t\tdc.setCapability(\"deviceName\",\"ce081718334a5b0b05\");\n\t\tdc.setCapability(\"platformName\",\"android\");\n\t\tdc.setCapability(\"platformVersion\",\"8.0.0\");\n\t\tdc.setCapability(\"appPackage\",\"com.samsung.android.contacts\");\n\t\tdc.setCapability(\"appActivity\",\"com.android.contacts.activities.PeopleActivity\");\n\t\t//Create driver object\n\t\tAndroidDriver driver;\n\t\twhile(2>1)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tdriver=new AndroidDriver(u,dc);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcatch(Exception ex)\n\t\t\t{\n\t\t\t}\n\t\t}\n\t\t//App Automation\n\t\ttry\n\t\t{\n\t\t\tWebDriverWait wait=new WebDriverWait(driver,5);\n\t\t\twait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//*[@content-desc='Create contact']\")));\n\t\t\twhile(2>1)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\twait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//*[@text='\"+contactname+\"']\")));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcatch(Exception exe)\n\t\t\t\t{\n\t\t\t\t\t//Get device dimensions\n\t\t\t\t\tint width=driver.manage().window().getSize().getWidth();\n\t\t\t\t\tint height=driver.manage().window().getSize().getHeight();\n\t\t\t\t\t//Vertical Swipe Logic\n\t\t\t\t\tPointerInput finger=new PointerInput(PointerInput.Kind.TOUCH,\"finger\");\n\t\t\t\t\tSequence swipe=new Sequence(finger,1);\n\t\t\t\t\tInteraction i1=finger.createPointerMove(Duration.ofMillis(0),PointerInput.Origin.viewport(),width/2,(int) (height*0.8));\n\t\t\t\t\tswipe.addAction(i1);\n\t\t\t\t\tInteraction i2=finger.createPointerDown(PointerInput.MouseButton.LEFT.asArg());\n\t\t\t\t\tswipe.addAction(i2);\n\t\t\t\t\tInteraction i3=finger.createPointerMove(Duration.ofMillis(200),PointerInput.Origin.viewport(),width/2,(int) (height*0.3));\n\t\t\t\t\tswipe.addAction(i3);\n\t\t\t\t\tInteraction i4=finger.createPointerUp(PointerInput.MouseButton.LEFT.asArg());\n\t\t\t\t\tswipe.addAction(i4);\n\t\t\t\t\tdriver.perform(Arrays.asList(swipe));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Get element dimensions\n\t\t\tMobileElement ele=(MobileElement) driver.findElement(By.xpath(\"//*[@text='\"+contactname+\"']/parent::*/parent::*\"));\n\t\t\tPoint source=ele.getCenter();\n\t\t\tint w=ele.getSize().getWidth();\n\t\t\tint h=ele.getSize().getHeight();\n\t\t\tint x=source.x;\n\t\t\tint y=source.y;\n\t\t\t//Horizontal Swipe Logic\n\t\t\tPointerInput finger=new PointerInput(PointerInput.Kind.TOUCH,\"finger\");\n\t\t\tSequence swipe=new Sequence(finger,1);\n\t\t\tInteraction i1=finger.createPointerMove(Duration.ofMillis(0),PointerInput.Origin.viewport(),(int) (x-w/2*0.8),y);\n\t\t\tswipe.addAction(i1);\n\t\t\tInteraction i2=finger.createPointerDown(PointerInput.MouseButton.LEFT.asArg());\n\t\t\tswipe.addAction(i2);\n\t\t\tInteraction i3=finger.createPointerMove(Duration.ofMillis(1000),PointerInput.Origin.viewport(),(int) (x+w/2*0.8),y);\n\t\t\tswipe.addAction(i3);\n\t\t\tInteraction i4=finger.createPointerUp(PointerInput.MouseButton.LEFT.asArg());\n\t\t\tswipe.addAction(i4);\n\t\t\tdriver.perform(Arrays.asList(swipe));\n\t\t\tThread.sleep(15000);\n\t\t\tdriver.findElementByAndroidUIAutomator(\"new UiSelector().description(\\\"End call\\\")\").click();\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\tThread.sleep(5000);\n\t\t//Close app\n\t\tdriver.closeApp();\n\t\t//Stop appium server\n\t\tRuntime.getRuntime().exec(\"taskkill /F /IM node.exe\");\n\t\tRuntime.getRuntime().exec(\"taskkill /F /IM cmd.exe\");\n\t}", "@BeforeClass\n\tpublic void appLaunch() throws IOException\n\t{\n\n\t\t/*String Appium_Node_Path=\"C:/Program Files (x86)/Appium/node.exe\"; \n\t\tString Appium_JS_Path=\"C:/Program Files (x86)/Appium/node_modules/appium/bin/appium.js\"; \n\t\tappiumService = AppiumDriverLocalService.buildService(new AppiumServiceBuilder().usingPort(4723).usingDriverExecutable(new File(Appium_Node_Path)).withAppiumJS(new File(Appium_JS_Path))); \n\t\tappiumService.start();\n\t\t */\t\t\t\n\t\tcapabilities.setCapability(MobileCapabilityType.PLATFORM,Platform.ANDROID);\n\t\tcapabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT,3000);\n\t\tcapabilities.setCapability(MobileCapabilityType.PLATFORM,Horoscope_GenericLib.readConfigPropFile(sPropFileName, \"PLATFORMNAME\"));\n\t\tcapabilities.setCapability(MobileCapabilityType.DEVICE_NAME,Horoscope_GenericLib.readConfigPropFile(sPropFileName, \"DeviceName\"));\n\t\tcapabilities.setCapability(MobileCapabilityType.VERSION,Horoscope_GenericLib.readConfigPropFile(sPropFileName, \"PLATFORMVERSION\"));\n//\t\tcapabilities.setCapability(\"appPackage\", Horoscope_GenericLib.readConfigPropFile(sPropFileName, \"packageName\"));\n//\t\tcapabilities.setCapability(\"appActivity\",Horoscope_GenericLib.readConfigPropFile(sPropFileName, \"activityName\"));\n\t\t\n\t\t// for testing\n\t\tcapabilities.setCapability(\"appPackage\", \"in.amazon.mShop.android.shopping\");\n\t\tcapabilities.setCapability(\"appActivity\", \"com.amazon.mShop.home.HomeActivity\");;\n\n\n\t\tURL url= new URL(\"http://0.0.0.0:4723/wd/hub\");\n\t\tdriver = new AndroidDriver<WebElement>(url, capabilities);\n\t\tdriver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\n\t\t// testing purpose\n\t\tbackButton(driver);\n\t\tbackButton(driver);\n\t\t\n// in.amazon.mShop.android.shopping\n//\tcom.amazon.mShop.sso.SigninPromptActivity\n\n\t}", "@Test(groups={\"ut\"})\r\n\tpublic void testCreateDefaultCapabilitiesWithAutomationName() {\r\n\t\tSeleniumTestsContext context = new SeleniumTestsContext(SeleniumTestsContextManager.getThreadContext());\r\n\t\tcontext.setBrowser(BrowserType.CHROME.toString());\r\n\t\tcontext.setMobilePlatformVersion(\"8.0\");\r\n\t\tcontext.setPlatform(\"android\");\r\n\t\tcontext.setDeviceName(\"Samsung Galasy S8\");\r\n\t\tcontext.setAutomationName(\"UiAutomator1\");\r\n\t\tcontext.setApp(\"\");\r\n\t\t\r\n\t\tDriverConfig config = new DriverConfig(context);\r\n\t\t\r\n\t\t\r\n\t\tAndroidCapabilitiesFactory capaFactory = new AndroidCapabilitiesFactory(config);\r\n\t\tMutableCapabilities capa = capaFactory.createCapabilities();\r\n\t\t\r\n\t\tAssert.assertEquals(capa.getCapability(CapabilityType.BROWSER_NAME), BrowserType.CHROME.toString().toLowerCase());\r\n\t\tAssert.assertEquals(capa.getCapability(MobileCapabilityType.AUTOMATION_NAME), \"UiAutomator1\");\r\n\t\tAssert.assertNull(capa.getCapability(MobileCapabilityType.FULL_RESET));\r\n\t}", "@BeforeClass\n public void beforeClass() throws MalformedURLException {\n DesiredCapabilities desiredCapabilities = new DesiredCapabilities();\n desiredCapabilities.setCapability(\"deviceName\", \"Pixel_4_emulator\");\n desiredCapabilities.setCapability(\"platformName\", \"android\");\n desiredCapabilities.setCapability(\"automationName\", \"UiAutomator2\");\n desiredCapabilities.setCapability(\"noReset\", true);\n desiredCapabilities.setCapability(\"appPackage\", \"com.google.android.apps.messaging\");\n desiredCapabilities.setCapability(\"appActivity\", \".ui.ConversationListActivity\");\n\n // Instantiate Appium Driver\n URL appServer = new URL(\"http://0.0.0.0:4723/wd/hub\");\n driver = new AndroidDriver<MobileElement>(appServer, desiredCapabilities);\n wait = new WebDriverWait(driver, 5);\n }", "@BeforeTest\n\tpublic void setUp() throws InterruptedException, IOException {\n\t\tAppiumServer appiumServer = new AppiumServer();\n\t\t\n\t\tint port = 4723;\n\t\tif(!appiumServer.checkIfServerIsRunnning(port)) {\n\t\t\tSystem.out.println(\"Port No.: \" + port + \" is available.\");\n\n\t\t\tappiumServer.startServer();\n\t\t\t\n\t\t} else {\n\t\t\tSystem.out.println(\"Appium Server already running on Port - \" + port);\n\t\t}\n\t\t\n\t\tFile appPath = new File(\"./app/eBay.apk\");\n\t\tDesiredCapabilities cap = new DesiredCapabilities();\n\n\t\tcap.setCapability(MobileCapabilityType.APP, appPath.getAbsolutePath());\n\t\tcap.setCapability(MobileCapabilityType.DEVICE_NAME, \"MI\");\n\t\tcap.setCapability(MobileCapabilityType.PLATFORM_NAME, \"Android\");\n//\t\tcap.setCapability(MobileCapabilityType.PLATFORM_VERSION,\"9\");\n\t\t\n\t\tcap.setCapability(\"unicodeKeyboard\", \"true\"); \n\t\tcap.setCapability(\"resetKeyboard\", \"true\");\n\t\t\n\t\tcap.setCapability(MobileCapabilityType.PLATFORM_VERSION, DeviceVersionFinder.getDeviceVersion());\n\t\tcap.setCapability(MobileCapabilityType.AUTOMATION_NAME, \"uiautomator2\");\n\t\tcap.setCapability(\"--session-override\", false);\n\t\t\n\t\tcap.setCapability(\"setWebContentsDebuggingEnabled\", true);\n\t\t\n\t\tdriver = new AndroidDriver<MobileElement>(new URL(\"http://0.0.0.0:4723/wd/hub\"), cap);\n\n\t\tdriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n\t\tPOM_LaunchHomeScreen homeScreen = new POM_LaunchHomeScreen(driver);\n\n\t\tif(homeScreen.btn_homeSignIn.isDisplayed()) {\n\t\t\t\n\t\t\tSystem.out.println(\"App has successfully loaded within the time provided!\");\n\t\t\t\n\t\t}\n\n\t\t\n//\t\tMobileElement element = driver.findElement(By.id(\"recycler_view_main\"));\n\t\t\n//\t\tTouchActions action = new TouchAction();\n//\t\taction.scroll(element, 10, 100);\n//\t\taction.perform();\n\t\t\n\t\t\n\n\t\tSystem.out.println(\"Setup successful!\");\n\n\n\t}", "public static void main(String[] args) throws MalformedURLException, InterruptedException {\n\t\t\t\t\t\tDesiredCapabilities capabilities= new DesiredCapabilities();\n\t\t\t\t\t\t\n\t\t\t\t\t\tcapabilities.setCapability(\"deviceName\", \"GT-I9300I\");\n\t\t\t\t\t\tcapabilities.setCapability(\"platformName\", \"Android\");\n\t\t\t\t\t\tcapabilities.setCapability(\"platformVersion\", \"4.4.4\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t//app details\n\t\t\t\t\t\tcapabilities.setCapability(\"appPackage\", \"com.mobeta.android.demodslv\");\n\t\t\t\t\t\tcapabilities.setCapability(\"appActivity\", \"com.mobeta.android.demodslv.Launcher\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Appium details\n\t\t\t\t\t\t\n\t\t\t\t\t\tAndroidDriver driver= new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\n\t\t\t\t\t\tThread.sleep(3000);\n\t\t\t\t\n\t\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\t\t\t\t//click on the element\n\t\t\t\t\t//\tdriver.findElementById(\"com.mobeta.android.demodslv:id/activity_title\").click();\n\t\t\t\t\t\n\t\t\t\t\t\tWebElement ele1 = driver.findElementById(\"com.mobeta.android.demodslv:id/activity_title\");\n\t\t\t\t\t\tele1.click();\n\t\t\t\t//drag and drop\n\t\t\t\t\t\t\n\t\t\t\t\t\tList<WebElement> drag_ele = driver.findElementsById(\"com.mobeta.android.demodslv:id/drag_handle\");\n\t\t\t\t\t\tSystem.out.println(drag_ele.size());\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Touch action\n\t\t\t\t\t\t\n\t\t\t\t\t\tTouchAction action= new TouchAction(driver);\n\t\t\t\t\t\t//action.longPress(drag_ele.get(0)).moveTo(drag_ele.get(5)).release().perform();\n\t\t\t\t\t\t\n\t\t\t\t\t\tThread.sleep(6000);\n\t\t\t\t\t\taction.longPress(drag_ele.get(6)).moveTo(drag_ele.get(2)).release().perform();\n\t\t\t\t\t\t\n\n\n\t}", "private void setupBluetooth() throws NullPointerException{\n if( Utils.isOS( Utils.OS.ANDROID ) ){\n \t\n // Gets bluetooth hardware from phone and makes sure that it is\n // non-null;\n BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();\n \n // If bluetooth hardware does not exist...\n if (adapter == null) {\n Log.d(TAG, \"BluetoothAdapter is is null\");\n throw new NullPointerException(\"BluetoothAdapter is null\");\n } else {\n Log.d(TAG, \"BluetoothAdapter is is non-null\");\n }\n \n bluetoothName = adapter.getName();\n \n //TODO: restart bluetooth?\n \t\n try {\n bluetoothConnectionThreads.add( new ServerThread(adapter, router, uuid) );\n } catch (NullPointerException e) {\n throw e;\n }\n if (Constants.DEBUG)\n Log.d(TAG, \"Sever Thread Created\");\n // Create a new clientThread\n bluetoothConnectionThreads.add( new ClientThread(adapter, router, uuid) );\n if (Constants.DEBUG)\n Log.d(TAG, \"Client Thread Created\");\n }\n else if( Utils.isOS( Utils.OS.WINDOWS ) ){\n //TODO: implement this\n }\n else if( Utils.isOS( Utils.OS.LINUX ) ){\n //TODO: implement this\n }\n else if( Utils.isOS( Utils.OS.OSX ) ){\n //TODO: implement this\n }\n else{\n //TODO: throw exception?\n }\n \n }", "@Test\n public void testMobileAndroid() {\n try {\n\n System.out.println(\"Running test on Android mobile browser\");\n DeviceDescription description = new DeviceDescription();\n description.setOsType(\"Android\");\n description.setOsVersion(\">=6.0\");\n\n Device device = MobileLab.lockDevice(description);\n Browser browser2 = BrowserFactory.launch(BrowserType.CHROME, device);\n navigateBrowser(browser2);\n Reporter.reportEvent(\"Image of Mobile\", \"Using Chrome on Android\", Status.Passed, browser2.getSnapshot());\n windowsSync(1500);\n\n }\n catch (GeneralLeanFtException glftex) {System.out.println(\"GeneralLeanFtException: \" + glftex.getMessage());}\n catch (InterruptedException iex) {System.out.println(\"InterruptedException: \" + iex.getMessage());}\n catch (ReportException rex){System.out.println(\"ReportException: \" + rex.getMessage());}\n catch (StringIndexOutOfBoundsException soobEx) {System.out.println(\"StringIndexOutOfBoundsException: \" + soobEx.getMessage());}\n }", "@BeforeMethod\npublic void setUp() throws MalformedURLException, InterruptedException{\n\t\n\t File classpathRoot = new File(System.getProperty(\"user.dir\"));\n\t File appDir = new File(classpathRoot, \"/Apps/Pazo/\");\n\t File app = new File(appDir, \"app-ppz-debug.apk\");\n\t DesiredCapabilities capabilities = new DesiredCapabilities();\n\t capabilities.setCapability(CapabilityType.BROWSER_NAME, \"\");\n\t capabilities.setCapability(\"deviceName\", \"MI\");\n\t capabilities.setCapability(\"platformVersion\", \"7.0\");\n\t capabilities.setCapability(\"platformName\", \"Android\");\n\t capabilities.setCapability(\"app\", app.getAbsolutePath());\n\t capabilities.setCapability(\"appPackage\", \"com.pazo.ppz\");\n\t capabilities.setCapability(\"appPackage1\", \"com.google.android.packageinstaller\");\n\t capabilities.setCapability(\"appActivity\", \"com.tagtual.trackd.Activities.Splash\");\n\t capabilities.setCapability(\"appActivity1\", \"com.tagtual.trackd.Activities.LicenceLogin\");\n\t capabilities.setCapability(AndroidMobileCapabilityType.AUTO_GRANT_PERMISSIONS,true);\n\t capabilities.setCapability(\"unicodeKeyboard\", true);\n\t capabilities.setCapability(\"resetKeyboard\", true);\n\t try{\n\t driver = new AppiumDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\t }\n\t catch (ExceptionInInitializerError error){\n\t System.out.println(error.getCause());\n\t System.out.println(error.getMessage());\n\t System.out.println(error.getLocalizedMessage());\n\t System.out.println(error.getStackTrace().toString());\n\n\t }\n\t driver.manage().timeouts().pageLoadTimeout(80, TimeUnit.SECONDS);\n\t driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);\n\t// Thread.sleep(10000);\n\t\n}", "@Override\r\n\tpublic void buildDriver() throws DriverException\r\n\t{\r\n\t\tif(ConfigUtil.isLocalEnv())\r\n\t\t{\r\n\t\t\t// if it is a Selenium tool, then create selenium ChromeDriver\r\n\t\t\tif(ConfigUtil.isSelenium()){\r\n\t\t\t\t\r\n\t\t\t\tFile chromeDriverFile=getChromeDriverFile();\r\n\t\t\t\tSystem.out.println(\" Found Driver file\");\r\n\t\t\t\tdriver =SeleniumDriver.buildChromeDriver(chromeDriverFile);\r\n\t\t\t\t //new org.openqa.selenium.chrome.ChromeDriver();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\telse if(ConfigUtil.isRemoteEnv())\r\n\t\t{\r\n\t\t\tif(ConfigUtil.isSelenium()){\r\n\t\t\t\tcapabilities = DesiredCapabilities.chrome();\t\r\n\t\t\t\tdriver = SeleniumDriver.buildRemoteDriver(capabilities);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\telse if(ConfigUtil.isBrowserStackEnv())\r\n\t\t{\r\n\t\t\tcapabilities = DesiredCapabilities.chrome();\r\n\t\t\tbuildBrowserstackCapabilities();\r\n\r\n\t\t}\r\n\r\n\t}", "@Override\n public void onCreate() {\n super.onCreate();\n setUSDK();\n }", "public static void main(String[] args) throws MalformedURLException {\n\t\tFile src = new File(\"src\");\r\n\t\tFile appsrc = new File(src,\"ApiDemos-debug.apk\");\r\n\t\t\r\n\t\tDesiredCapabilities cap = new DesiredCapabilities();\r\n\t\tcap.setCapability(MobileCapabilityType.DEVICE_NAME, \"Android Device\");\r\n\t\tcap.setCapability(MobileCapabilityType.PLATFORM_NAME,MobilePlatform.ANDROID);\r\n\t\tcap.setCapability(MobileCapabilityType.APP, appsrc.getAbsolutePath());\r\n\t\t\r\n\t\tAndroidDriver driver = new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"),cap);\r\n\t\t\r\n\t}", "private SmartDevice createDevice(Cursor cursor){\n String id = cursor.getString(cursor.getColumnIndex(COLUMN_ID));\n String name = cursor.getString(cursor.getColumnIndex(COLUMN_NAME));\n String type = cursor.getString(cursor.getColumnIndex(COLUMN_TYPE));\n String active = cursor.getString(cursor.getColumnIndex(COLUMN_ACTIVE));\n String image = cursor.getString(cursor.getColumnIndex(COLUMN_IMAGE));\n return new SmartDevice(id, name, type, active, image);\n }", "public void initializeDriver() {\n }", "public static void main(String[] args) throws MalformedURLException, InterruptedException {\n\t\t\t\tDesiredCapabilities capabilities= new DesiredCapabilities();\r\n\t\t\t\t\t\t\r\n\t\t\t\t//device details\r\n\t\t\t\tcapabilities.setCapability(\"deviceName\",\"GT-I9300I\");\r\n\t\t\t\tcapabilities.setCapability(\"platformName\",\"Android\");\r\n\t\t\t\tcapabilities.setCapability(\"platformVersion\",\"4.4.4\");\t\t\r\n\t\t\t\t\r\n\t\t\t\t//app details\r\n\t\t\t\tcapabilities.setCapability(\"appPackage\",\"com.emn8.mobilem8.nativeapp.bk\");\r\n\t\t\t\tcapabilities.setCapability(\"appActivity\",\"com.emn8.mobilem8.nativeapp.bk.BKNativeMobileApp\");\r\n\t\t\t\t\r\n\t\t\t\t//Appium Server details\r\n\t\t\t\tAndroidDriver driver= new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\r\n\t\t\t\t\r\n\t\t\t\t//wait\r\n\t\t\t\tThread.sleep(4000);\r\n\t\t\t\t\r\n\t\t\t\tSet<String> contextHandles = driver.getContextHandles();\r\n\t\t\t\tint size = contextHandles.size();\r\n\t\t\t\tSystem.out.println(size);\r\n\t\t\t\t\r\n\t\t\t\t//****************************************************\r\n\t\t\t\tfor(String contextname:contextHandles)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"First Page\");\r\n\t\t\t\t\tSystem.out.println(contextname);\r\n\t\t\t\t\tSystem.out.println(\"-------------------\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(contextname.contains(\"NATIVE\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.context(contextname);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tWebDriverWait wait= new WebDriverWait(driver, 50);\r\n\t\t\t\tWebElement ele_voucher = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//*[@index='9'][@content-desc='VOUCHERS'][@class='android.view.View']\")));\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Voucher is displayed \"+ele_voucher.isDisplayed());\r\n\t\t\t\t\r\n\t\t\t\tele_voucher.click();\r\n\t\t\t\t\r\n\t\t\t\t//**************************************************************\r\n\t\t\t\t//Second page\r\n\t\t\t\tThread.sleep(4000);\r\n\t\t\t\tfor(String contextname:contextHandles)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"Second Page\");\r\n\t\t\t\t\tSystem.out.println(contextname);\r\n\t\t\t\t\tSystem.out.println(\"-------------------\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(contextname.contains(\"NATIVE\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.context(contextname);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tWebDriverWait wait2= new WebDriverWait(driver, 50);\r\n\t\t\t\tWebElement ele_redeem = wait2.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//*[@index='17'][@content-desc='REDEEM'][@class='android.view.View']\")));\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Redeem is displayed \"+ele_redeem.isDisplayed());\r\n\t\t\t\t\r\n\t\t\t\tele_redeem.click();\r\n\t\t\t\t//**************************************************************\r\n\t\t\t\t//Third page\r\n\t\t\t\tThread.sleep(4000);\r\n\t\t\t\tfor(String contextname:contextHandles)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"Third Page\");\r\n\t\t\t\t\tSystem.out.println(contextname);\r\n\t\t\t\t\tSystem.out.println(\"-------------------\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(contextname.contains(\"WEBVIEW\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.context(contextname);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tdriver.findElementByName(\"email\").sendKeys(\"nov@gmail.com\");\r\n\t\t\t\tWebElement ele_pwd = driver.findElementByName(\"password\");\r\n\t\t\t\tele_pwd.click();\r\n\t\t\t\t\r\n\t\t\t\tThread.sleep(4000);\r\n\t\t\t\tele_pwd.sendKeys(\"1234\");\r\n\t\t\t\t\r\n\t\t\t\t//********************************************************\r\n\t\t\t\t\r\n\t\t\t\tThread.sleep(4000);\r\n\t\t\t\t\r\n\t\t\t\tfor(String contextname:contextHandles)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"Third Page\");\r\n\t\t\t\t\tSystem.out.println(contextname);\r\n\t\t\t\t\tSystem.out.println(\"-------------------\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(contextname.contains(\"NATIVE\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.context(contextname);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tWebDriverWait wait3= new WebDriverWait(driver, 50);\r\n\t\t\t\tWebElement ele_Signin = wait3.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//*[@index='33'][@content-desc='SIGN IN'][@class='android.view.View']\")));\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Signin is displayed \"+ele_Signin.isDisplayed());\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\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\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\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\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\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t}", "public VMWareDriver() {\n }", "public HomePage_POF(AndroidDriver<?> driver) {\n\t\tsuper(driver);\n\n\t}", "@Test\n\t\t\n\t\tpublic void signUp() throws InterruptedException\n\t\t{\n\t\t\t\t\tDesiredCapabilities caps = new DesiredCapabilities();\n\t\t\t\t\tcaps.setCapability(\"deviceName\", \"My\"); \n\t\t\t\t\tcaps.setCapability(\"udid\", \"bd40918\"); \n\t\t\t\t\tcaps.setCapability(\"platformName\", \"Android\"); \n\t\t\t\t\tcaps.setCapability(\"platformVersion\", \"9.0\");\t\n\t\t\t\t\tcaps.setCapability(\"noReset\", true);\t\t\t\t\n\t\t\t\t\tcaps.setCapability(\"appPackage\", \"com.android.vending\");\n\t\t\t\t\tcaps.setCapability(\"appActivity\", \"com.google.android.finsky.activities.MainActivity\");\n\t\t\t\t\tcaps.setCapability(\"adbExecTimeout\", \"50000\");\n\t\t\t\t\tcaps.setCapability(\"autoGrantPermissions\", \"true\");\n\t\t\t\t\tcaps.setCapability(AndroidMobileCapabilityType.AUTO_GRANT_PERMISSIONS,true);\n\t\t\t\t\tcaps.setCapability(\"autoAcceptAlerts\",\"true\");\n\t\t\t\t\tcaps.setCapability(\"unicodeKeyboard\", true);\n\t\t\t\t caps.setCapability(\"resetKeybord\", true);\n\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\t\n\t\t\t\t\t\tdriver = new AndroidDriver<MobileElement>(new URL(\"http://0.0.0.0:4723/wd/hub\"), caps);\n\t\t\t\t\t\t\n\t\t\t\t\t} catch (MalformedURLException e) {\n\t\t\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t}", "public void run() {\n if (engine == 0) {\n byte buf[] = new byte[1024];\n AIEngine.aiengine_get_device_id(buf, getApplicationContext());\n\n String deviceId = new String(buf).trim();\n Log.d(TAG, \"deviceId: \" + deviceId);\n\n InputStream is = null;\n String provisionPath = \"\";\n\n try {\n is = getAssets().open(\"aiengine.provision\");\n File provisionFile = new File(AiUtil.externalFilesDir(context), \"aiengine.provision\");\n AiUtil.writeToFile(provisionFile, is);\n is.close();\n provisionPath = provisionFile.getAbsolutePath();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n Log.d(TAG, \"provisionPath:\" + provisionPath);\n\n String cfg = String.format(\"{\\\"appKey\\\": \\\"%s\\\", \\\"secretKey\\\": \\\"%s\\\", \\\"cloud\\\": {\\\"server\\\": \\\"%s\\\"}, \\\"provision\\\": \\\"%s\\\"}\",\n ChivoxOptions.APP_KEY, ChivoxOptions.SECRET_KEY, ChivoxOptions.SERVER, provisionPath);\n\n engine = AIEngine.aiengine_new(cfg, context);\n Log.d(TAG, \"aiengine: \" + engine);\n }\n\t\t\t\t/* create airecorder instance */\n if (recorder == null) {\n recorder = AIRecorder.getInstance();\n Log.d(TAG, \"airecorder: \" + recorder);\n }\n }", "public void Launch_app() {\n\t\tDesiredCapabilities caps = new DesiredCapabilities();\r\n\t\tcaps.setCapability(\"deviceName\", \"My Phone\");\r\n\t\tcaps.setCapability(\"udid\", \"LE66A06190140096\"); //Give Device ID of your mobile phone\r\n\t\t\r\n\t\t/* caps.setCapability(\"udid\", \"emulator-5556\"); //Give Device ID of your mobile phone\r\n\t\t caps.setCapability(\"app\", \"C:\\\\Users\\\\Blue Otter HP2\\\\Downloads\\\\xemoto_staging_v1.0.0.apk\"); \r\n\t\t caps.setCapability(\"appWaitActivity\", \"*\");\r\n\t\t caps.setCapability(MobileCapabilityType.AUTOMATION_NAME, \"UiAutomator2\");*/\r\n\t\t\r\n\t\tcaps.setCapability(\"platformName\", \"Android\");\r\n\t\tcaps.setCapability(\"platformVersion\", \"6.0\");\r\n\t\r\n\t\tcaps.setCapability(\"appPackage\", \"org.blueotter.motone\");\r\n\t\tcaps.setCapability(\"appActivity\", \"org.blueotter.motone.feature.main.view.ActivityMain\"); \r\n\t\t\r\n\t\tcaps.setCapability(\"noReset\", \"true\");\r\n\t\t\r\n\t\t//Instantiate Appium Driver\r\n\t\ttry {\r\n\t\t\t\t driver = new AndroidDriver<MobileElement>(new URL(\"http://127.0.0.1:4723/wd/hub\"), caps);\t\t\r\n\r\n\r\n\t\t} catch (MalformedURLException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t\t\r\n\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS) ;\r\n\t\tSystem.out.println(\"Launch motone successful!\");\r\n\r\n \t}", "public File extractAndroidDriverAPK() {\n\t\t\n\t\tInputStream is = AndroidDriverAPKBuilder.class\n\t\t\t.getResourceAsStream(\"prebuild/android-driver-app-\"\n\t\t\t\t\t+\"0.11.0\" + \".apk\");\t\t\n\t\ttry {\n\t\t\tFile tmpAndroidDriver = File.createTempFile(\"android-driver\",\n\t\t\t\t\t\".apk\");\n\t\t\tIOUtils.copy(is, new FileOutputStream(tmpAndroidDriver));\n\t\t\tIOUtils.closeQuietly(is);\n\t\t\treturn tmpAndroidDriver;\n\t\t} catch (IOException ioe) {\n\t\t\tthrow new RuntimeException(ioe);\n\t\t}\n\t}", "private void createNewDriverInstance() {\n String browser = props.getProperty(\"browser\");\n if (browser.equals(\"firefox\")) {\n FirefoxProfile profile = new FirefoxProfile();\n profile.setPreference(\"intl.accept_languages\", language);\n driver = new FirefoxDriver();\n } else if (browser.equals(\"chrome\")) {\n ChromeOptions options = new ChromeOptions();\n options.setBinary(new File(chromeBinary));\n options.addArguments(\"--lang=\" + language);\n driver = new ChromeDriver(options);\n } else {\n System.out.println(\"can't read browser type\");\n }\n }", "public AndroidFactoryImpl() {\n\t\tsuper();\n\t}", "public static void main(String[] args) throws MalformedURLException, InterruptedException {\n\t\t\n\t\tFile app= new File(\"D:\\\\Testing\\\\Drag_drop\\\\com.mobeta.android.demodslv.apk\");\n\t\t\n\t\t//Launch app\n\t\tDesiredCapabilities capabilities= new DesiredCapabilities();\n\t\t\n\t\t//device details\n\t\tcapabilities.setCapability(\"deviceName\", \"GT-I9300I\");\n\t\tcapabilities.setCapability(\"platformName\", \"Android\");\n\t\tcapabilities.setCapability(\"platformVersion\", \"4.4.4\");\n\t\t\n\t\tcapabilities.setCapability(\"app\", app.getAbsolutePath());\n\t\t\n\t\tAndroidDriver driver= new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\t\t\n\t\t//wait\n\t\tThread.sleep(4000);\n\t\t\n\t\tif(driver.isAppInstalled(\"com.mobeta.android.demodslv\"))\n\t\t{\n\t\t\tSystem.out.println(\"App installed Successfully\");\n\t\t\tThread.sleep(8000);\n\t\t\t\n\t\t\tdriver.removeApp(\"com.mobeta.android.demodslv\");\n\t\t\tSystem.out.println(\"Removed the app\");\n\t\t\tThread.sleep(8000);\n\t\t\t\n\t\t\tdriver.installApp(\"D:\\\\Testing\\\\Drag_drop\\\\com.mobeta.android.demodslv.apk\");\n\t\t\tSystem.out.println(\"App installed again\");\n\t\t\tThread.sleep(8000);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"NOT installed the app\");\n\t\t}\n\t\n\t}", "public void initDriver() {\n if (getBrowser().equals(\"firefox\")) {\n WebDriverManager.firefoxdriver().setup();\n if (System.getProperty(\"headless\") != null) {\n FirefoxOptions firefoxOptions = new FirefoxOptions();\n firefoxOptions.setHeadless(true);\n driver = new FirefoxDriver(firefoxOptions);\n } else {\n driver = new FirefoxDriver();\n }\n } else {\n WebDriverManager.chromedriver().setup();\n if (System.getProperty(\"headless\") != null) {\n ChromeOptions chromeOptions = new ChromeOptions();\n chromeOptions.setHeadless(true);\n driver = new ChromeDriver(chromeOptions);\n } else {\n driver = new ChromeDriver();\n }\n }\n }", "@BeforeTest\n\tpublic static void loginFunctionality() throws Exception \n\t{\n\t\tDesiredCapabilities cap=new DesiredCapabilities();\n\t\t\n\t\tcap.setCapability(MobileCapabilityType.DEVICE_NAME,\"Redmi\");\n\t\tcap.setCapability(\"udid\", \"6215b09b\");\n\t\tcap.setCapability(\"platformName\", \"Android\");\n\t\tcap.setCapability(\"platformVersion\", \"9 PKQ1.180904.001\");\n\t\tcap.setCapability(\"appPackage\", \"com.danamon.uatomnimicroapps\");\n\t\tcap.setCapability(\"appActivity\", \"com.danamon.uatomnimicroapps.MainActivity\");\n\t\tcap.setCapability(\"noReset\", true);\n\t\tcap.setCapability(\"fullReset\",false);\n\t\t\n\t\t\n\t\t\n\t\tURL url=new URL(\"http://127.0.0.1:4723/wd/hub\");\n\t\t\n\t\t\n\t\tdriver=new AndroidDriver<AndroidElement>(url,cap);\n\t\tSystem.out.println(\"application started..\");\n\t\t//Thread.sleep(50000);\n\t\tdriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\n\t\t\n\t\t/*\n\t\t MobileElement el1 = (MobileElement) driver.findElementByXPath(\"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View[5]/android.view.View/android.view.View[2]/android.view.View[1]/android.view.View[1]/android.view.View[2]\");\n\t\t \n\t\tel1.click();\n\t\tMobileElement el2 = (MobileElement) driver.findElementByXPath(\"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View[5]/android.view.View/android.view.View[2]/android.view.View[2]/android.view.View[2]/android.view.View/android.view.View[1]/android.widget.EditText\");\n\t\tel2.sendKeys(\"perfomni1\");\n\t\t\n\t\tMobileElement el3=(MobileElement)driver.findElementByXPath(\"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View[5]/android.view.View/android.view.View[2]/android.view.View[2]/android.view.View[2]/android.view.View/android.view.View[1]/android.view.View[3]/android.widget.EditText\");\n\t\t\n\n\tel3.sendKeys(\"Reskin01\");\n\tdriver.findElementByXPath(\"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View[5]/android.view.View/android.view.View[2]/android.view.View[2]/android.view.View[2]/android.view.View/android.view.View[1]/android.widget.Button[1]\").click();\n\t\tThread.sleep(220000);\n\t\t\n\n\t\t//MobileElement el4=(MobileElement)driver.findElementByXPath(\"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View[5]/android.view.View/android.view.View[2]/android.view.View[2]/android.view.View[2]/android.view.View/android.view.View[1]/android.view.View[3]/android.widget.EditText\");\n\t\t\n\n\t\t//el4.sendKeys(\"Reskin01\");\n\t\t \n\t\t */\n\t\t\n\t\tMobileElement el5 = (MobileElement) driver.findElementByXPath(\"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View[5]/android.view.View/android.view.View[2]/android.view.View[2]/android.view.View[2]/android.view.View/android.view.View[1]/android.view.View[2]/android.widget.EditText\");\n\t\tel5.sendKeys(\"Reskin01\");\n\n\t\tdriver.findElementByXPath(\"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View[5]/android.view.View/android.view.View[2]/android.view.View[2]/android.view.View[2]/android.view.View/android.view.View[1]/android.widget.Button\").click();\n\t\n\t\t\t\t}", "public static void main(String[] args)throws MalformedURLException, InterruptedException {\n\n \n\n AndroidDriver<AndroidElement> driver=capabilities();\n\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n \n \n driver.findElementById(\"de.soehnle.connect:id/registrationButton\").click();\n\n driver.findElementById( \"de.soehnle.connect:id/nameEditText\").sendKeys(\"Neeraj\");\n\n driver.findElementById( \"de.soehnle.connect:id/maleGender\").click();\n \n// driver.findElementByXPath(\"//android.widget.EditText[@index='1']\").click();\n driver.findElementByXPath(\"//android.widget.EditText[@text='Date of birth']\").click();\n// driver.findElementByXPath(\"//android.widget.Button[@text='Continue']\").click();\n driver.findElementByXPath(\"//android.widget.Button[@index='1']\").click();\n// driver.findElementById( \"de.soehnle.connect:id/birthEditText\").click();\n\n driver.findElementById(\"de.soehnle.connect:id/edittext_mail\").sendKeys(\"Neerajsingh151+11@gmail.com\");\n\n driver.findElementById(\"de.soehnle.connect:id/edittext_password\").sendKeys(\"Neeraj12345\");\n\n driver.findElementById(\"de.soehnle.connect:id/edittext_repeat_password\").sendKeys(\"Neeraj12345\");\n driver.findElement(By.className(\"android.widget.CheckBox\")).click();\n driver.findElementById(\"de.soehnle.connect:id/login_button\").click();\n\n\n\n}", "private void initDriver(){\r\n String browserToBeUsed = (String) jsonConfig.get(\"browserToBeUsed\");\r\n switch (browserToBeUsed) {\r\n case \"FF\":\r\n System.setProperty(\"webdriver.gecko.driver\", (String) jsonConfig.get(\"fireFoxDriverPath\"));\r\n FirefoxProfile ffProfile = new FirefoxProfile();\r\n // ffProfile.setPreference(\"javascript.enabled\", false);\r\n ffProfile.setPreference(\"intl.accept_languages\", \"en-GB\");\r\n\r\n FirefoxOptions ffOptions = new FirefoxOptions();\r\n ffOptions.setProfile(ffProfile);\r\n driver = new FirefoxDriver(ffOptions);\r\n break;\r\n case \"CH\":\r\n String driverPath = (String) jsonConfig.get(\"chromeDriverPath\");\r\n System.setProperty(\"webdriver.chrome.driver\", driverPath);\r\n\r\n Map<String, Object> prefs = new HashMap<String, Object>();\r\n prefs.put(\"profile.default_content_setting_values.notifications\", 2);\r\n\r\n ChromeOptions options = new ChromeOptions();\r\n options.setExperimentalOption(\"prefs\", prefs);\r\n options.addArguments(\"--lang=en-GB\");\r\n driver = new ChromeDriver(options);\r\n break;\r\n case \"IE\":\r\n System.setProperty(\"webdriver.ie.driver\", (String) jsonConfig.get(\"ieDriverPath\"));\r\n\r\n InternetExplorerOptions ieOptions = new InternetExplorerOptions();\r\n ieOptions.disableNativeEvents();\r\n ieOptions.requireWindowFocus();\r\n ieOptions.introduceFlakinessByIgnoringSecurityDomains();\r\n driver = new InternetExplorerDriver(ieOptions);\r\n }\r\n\r\n driver.manage().window().maximize();\r\n }", "public void startAppiumServer(String os) throws ExecuteException, IOException, InterruptedException {\n if (os.contains(\"windows\")) {\n CommandLine command = new CommandLine(\"cmd\");\n command.addArgument(\"/c\");\n command.addArgument(\"C:/Program Files/nodejs/node.exe\");\n command.addArgument(\"C:/Appium/node_modules/appium/bin/appium.js\");\n command.addArgument(\"--address\", false);\n command.addArgument(\"127.0.0.1\");\n command.addArgument(\"--port\", false);\n command.addArgument(\"4723\");\n command.addArgument(\"--full-reset\", false);\n\n DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();\n DefaultExecutor executor = new DefaultExecutor();\n executor.setExitValue(1);\n executor.execute(command, resultHandler);\n Thread.sleep(5000);\n } else if (os.contains(\"mac\")) {\n CommandLine command = new CommandLine(\"/Applications/Appium.app/Contents/Resources/node/bin/node\");\n command.addArgument(\"/Applications/Appium.app/Contents/Resources/node_modules/appium/bin/appium.js\", false);\n command.addArgument(\"--address\", false);\n command.addArgument(\"127.0.0.1\");\n command.addArgument(\"--port\", false);\n command.addArgument(\"4723\");\n command.addArgument(\"--full-reset\", false);\n DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();\n DefaultExecutor executor = new DefaultExecutor();\n executor.setExitValue(1);\n executor.execute(command, resultHandler);\n Thread.sleep(5000);\n } else if (os.contains(\"linux\")) {\n //Start the appium server\n System.out.println(\"ANDROID_HOME : \");\n System.getenv(\"ANDROID_HOME\");\n //\tSystem.out.println(\"PATH :\" +System.getenv(\"PATH\"));\n CommandLine command = new CommandLine(\"/bin/bash\");\n command.addArgument(\"-c\");\n command.addArgument(\"~/.linuxbrew/bin/node\");\n command.addArgument(\"~/.linuxbrew/lib/node_modules/appium/lib/appium.js\", true);\n DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();\n DefaultExecutor executor = new DefaultExecutor();\n executor.setExitValue(1);\n executor.execute(command, resultHandler);\n Thread.sleep(5000); //Wait for appium server to start\n\n } else {\n LOGGER.info(os + \"is not supported yet\");\n }\n }", "Driver getDriver();", "public AndroidInterfaceClass(){\n database = FirebaseDatabase.getInstance(\"https://brainstorming-1fa06-default-rtdb.europe-west1.firebasedatabase.app/\");\n }", "public static void main(String[] args) throws MalformedURLException, InterruptedException {\n\t\tString deviceName = \"VCan\";\r\n\t\tString platformVersion = \"4.4.2\";\r\n\t\tString apkName = \"微博.apk\";\r\n\t\tString appActivity = \"com.sina.weibo.SplashActivity\";\r\n\t\tString AppiumServerIP = \"http://127.0.0.1:4723/wd/hub\";\r\n\t\tAndroidDriver driver;\r\n\t\tFile apk = new File(System.getProperty(\"user.dir\")+File.separator+\"apps\"+File.separator+apkName);\r\n\t\tDesiredCapabilities capabilities = new DesiredCapabilities();\r\n\t\tcapabilities.setCapability(\"deviceName\", deviceName);\r\n\t\tcapabilities.setCapability(\"platformVersion\", platformVersion);\r\n\t\tcapabilities.setCapability(\"app\", apk);\r\n\t\tcapabilities.setCapability(\"appActivity\", appActivity);\r\n\t\tcapabilities.setCapability(\"noSign\", true);\r\n\t\tcapabilities.setCapability(\"noReset\", true);\r\n\t\tdriver = new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"),capabilities);\r\n\t\tThread.sleep(3000);\r\n\t\tSystem.out.println(\"App启动等待时间\");\r\n\t\tThread.sleep(4000);\r\n\t\tdriver.findElementById(\"com.sina.weibo:id/plus_icon\").click();\r\n\t\tdriver.findElementById(\"com.sina.weibo:id/pop_control_bar_front_close_img\").click();\r\n\t\tThread.sleep(2000);\r\n\t\tdriver.close();\r\n\t\tdriver.quit();\r\n\t}", "Device_Resource createDevice_Resource();", "@Before\n public void setUp() throws MalformedURLException {\n dc.setCapability(MobileCapabilityType.UDID, Main.devicesArrayList.get(Integer.parseInt(Thread.currentThread().getName())).getSerialNumber());\n\n if(Main.cloud){\n dc.setCapability(\"accessKey\", Main.accessKey);\n driver = new AndroidDriver<>(new URL(Main.ServerIP), dc);\n }\n else {\n driver = new AndroidDriver<>(new URL(\"http://localhost:4723/wd/hub\"), dc);\n }\n\n driver.setLogLevel(Level.INFO);\n client = new SeeTestClient(driver);\n }", "@Override // com.oculus.vrshell.panels.AndroidPanelApp\n public long createNativeInstance() {\n return nativeCreateInstance(0, 0);\n }", "@BeforeTest\r\n\tpublic void setup() {\n\t\t\t\tDesiredCapabilities caps = new DesiredCapabilities();\r\n\t\t\t\tcaps.setCapability(\"deviceName\", \"Abhi Phone\");\r\n\t\t\t\tcaps.setCapability(\"udid\", \"FXYDU17916004799\"); //Give Device ID of your mobile phone\r\n\t\t\t\tcaps.setCapability(\"platformName\", \"Android\");\r\n\t\t\t\tcaps.setCapability(\"platformVersion\", \"9.0\");\r\n\t\t\t\tcaps.setCapability(\"appPackage\", \"com.wdc.ibi\");\r\n\t\t\t\tcaps.setCapability(\"appActivity\", \"com.kamino.wdt.MainActivity\");\r\n\t\t\t\tcaps.setCapability(\"noReset\", \"true\");\r\n\t\t\t\tcaps.setCapability(\"unicodeKeyboard\", true);\r\n\t\t\t\tcaps.setCapability(\"resetKeyboard\", true);\r\n\t\t\t\t\r\n\t\t\t\t//Instantiate Appium Driver\r\n\t\r\n\t\t\t\ttry {\t\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\tURL url= new URL(\"http://0.0.0.0:4723/wd/hub\");\r\n\t\t\t\t\t\tdriver = new AndroidDriver<MobileElement>(url, caps);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//WebDriverWait wait = new WebDriverWait(driver, 10);\r\n\t\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);\r\n\t\t\t\t\t\t//driver.findElementByClassName(\"android.widget.TextView\").click();\r\n\t\t\t\t\t\t//wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//*[@text ='I Agree']\"))).click();\r\n\t\t\t\t\t\t//driver.findElement(By.xpath(\"//*[@text ='I Agree']\")).click();\r\n\t\t\t\t\t\t//wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//*[@text ='SIGN IN']\"))).click();\r\n\t\t\t\t\t\tdriver.findElement(By.xpath(\"//*[@text ='SIGN IN']\")).click();\r\n\t\t\t\t\t\tdriver.findElement(By.xpath(\"//*[@text ='Email address']\")).sendKeys(\"mobappw+abtest@gmail.com\");\r\n\t\t\t\t\t\tdriver.findElement(By.xpath(\"//*[@text ='Password']\")).sendKeys(\"Admin@555\");\r\n\t\t\t\t\t\tdriver.findElement(By.xpath(\"//*[@text ='CONTINUE']\")).click();\r\n\t\t\t\t\t\tSystem.out.println(\"Signed In Successfuly\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t} catch (MalformedURLException e) {\r\n\t\t\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\t\t}\t\t\r\n\t\t\t\r\n\t}", "private static void setupDrivers(Application application) {\n\t\tJob2dDriver loggerDriver = new LoggerDriver();\n\t\tDriverFeature.addDriver(\"Logger driver\", loggerDriver);\n\n\t\tDrawPanelController drawerController = DrawerFeature.getDrawerController();\n\t\tJob2dDriver driver = new LineDriverAdapter(drawerController, LineFactory.getBasicLine(), \"basic\");\n\t\tDriverFeature.addDriver(\"Line Simulator\", driver);\n\t\tDriverFeature.getDriverManager().setCurrentDriver(driver);\n\n\t\tdriver = new LineDriverAdapter(drawerController, LineFactory.getSpecialLine(), \"special\");\n\t\tDriverFeature.addDriver(\"Special line Simulator\", driver);\n\t\tDriverFeature.updateDriverInfo();\n\n\t\tdriver = new LineDriverAdapter(drawerController, customizableLine, \"customizable\");\n\t\tDriverFeature.addDriver(\"Customizable Line\", driver);\n\t\tDriverFeature.updateDriverInfo();\n\t}", "On_Device_Resource createOn_Device_Resource();", "private void initialize() {\n if (driver == null)\n createNewDriverInstance();\n }", "protected DesiredCapabilities getCapabilitiesForChrome(ExtentTest currentTest, ExtentReportGenerator extentReportGenerator){ //local physical device support for android still pending\n\t\tDesiredCapabilities desCap = new DesiredCapabilities();\n\t\t//desired caps go here\n\t\treturn desCap;\n\t}", "@Test(groups={\"ut\"})\r\n\tpublic void testCreateCapabilitiesWithUserDefinedOverride() {\r\n\t\tSeleniumTestsContext context = new SeleniumTestsContext(SeleniumTestsContextManager.getThreadContext());\r\n\t\tcontext.setBrowser(BrowserType.CHROME.toString());\r\n\t\tcontext.setMobilePlatformVersion(\"8.0\");\r\n\t\tcontext.setPlatform(\"android\");\r\n\t\tcontext.setDeviceName(\"Samsung Galasy S8\");\r\n\t\tcontext.setApp(\"\");\r\n\t\tcontext.setAppiumCapabilities(\"browserName=firefox;key2=value2\");\r\n\t\t\r\n\t\tDriverConfig config = new DriverConfig(context);\r\n\t\t\r\n\t\t\r\n\t\tAndroidCapabilitiesFactory capaFactory = new AndroidCapabilitiesFactory(config);\r\n\t\tMutableCapabilities capa = capaFactory.createCapabilities();\r\n\t\t\r\n\t\tAssert.assertEquals(capa.getCapability(CapabilityType.BROWSER_NAME), \"firefox\");\r\n\t\t\r\n\t}", "@RequiresApi(api = Build.VERSION_CODES.O)\n @Override\n public void onCreate() {\n super.onCreate();\n createVirtualEnvironment();\n createNotificationChannel();\n }", "@Test(groups={\"ut\"})\r\n\tpublic void testCreateCapabilitiesWithApplication() {\r\n\t\tSeleniumTestsContext context = new SeleniumTestsContext(SeleniumTestsContextManager.getThreadContext());\r\n\t\tcontext.setMobilePlatformVersion(\"8.0\");\r\n\t\tcontext.setPlatform(\"android\");\r\n\t\tcontext.setDeviceName(\"Samsung Galasy S8\");\r\n\t\tcontext.setAppPackage(\"appPackage\");\r\n\t\tcontext.setAppActivity(\"appActivity\");\r\n\t\tcontext.setApp(\"com.covea.mobileapp\");\r\n\t\tDriverConfig config = new DriverConfig(context);\r\n\t\t\r\n\t\tAndroidCapabilitiesFactory capaFactory = new AndroidCapabilitiesFactory(config);\r\n\t\tMutableCapabilities capa = capaFactory.createCapabilities();\r\n\t\t\r\n\t\tAssert.assertEquals(capa.getCapability(CapabilityType.BROWSER_NAME), \"\");\r\n\t\tAssert.assertEquals(capa.getCapability(\"app\"), \"com.covea.mobileapp\");\r\n\t\tAssert.assertEquals(capa.getCapability(MobileCapabilityType.AUTOMATION_NAME), \"Appium\");\r\n\t\tAssert.assertEquals(capa.getCapability(MobileCapabilityType.PLATFORM_NAME), \"android\");\r\n\t\tAssert.assertEquals(capa.getCapability(MobileCapabilityType.PLATFORM_VERSION), \"8.0\");\r\n\t\tAssert.assertEquals(capa.getCapability(MobileCapabilityType.DEVICE_NAME), \"Samsung Galasy S8\");\r\n\t\tAssert.assertEquals(capa.getCapability(MobileCapabilityType.FULL_RESET), true);\r\n\t\tAssert.assertEquals(capa.getCapability(AndroidMobileCapabilityType.APP_PACKAGE), \"appPackage\");\r\n\t\tAssert.assertEquals(capa.getCapability(AndroidMobileCapabilityType.APP_ACTIVITY), \"appActivity\");\r\n\t}", "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 }", "private WebDriver createEdgeDriver() {\n\t\tEdgeDriverService service = new EdgeDriverService.Builder()\n\t\t\t\t.usingDriverExecutable(\n\t\t\t\t\t\tnew File(\"C:\\\\ensilo-performance\\\\drivers\\\\MicrosoftWebDriver.exe\"))\n\t\t\t\t.usingAnyFreePort().build();\n\t\ttry {\n\t\t\tservice.start();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t_driver = new EdgeDriver(service, DesiredCapabilities.edge());// edgeOptions);\n\n\t\treturn _driver;\n\t}", "public static void main(String[] args) throws MalformedURLException, InterruptedException {\n\t\t\n\t\tFile app= new File(\"E:/Testing/Drag_and_Drop/com.mobeta.android.demodslv.apk\");\n\t\t\n\t\t\n\t\tDesiredCapabilities capabilities= new DesiredCapabilities();\n\t\t\n\t\tcapabilities.setCapability(\"deviceName\", \"XT1033\");\n\t\tcapabilities.setCapability(\"platformName\", \"Android\");\n\t\tcapabilities.setCapability(\"platformVersion\", \"4.4.4\");\n\t\t\n\t\t//app details\n\t\tcapabilities.setCapability(\"app\",app.getAbsolutePath());\n\t\t\n\t\t//Appium details\n\t\t\n\t\tAndroidDriver driver= new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\n\t\tThread.sleep(12000);\n\t\t\n\t\tif(driver.isAppInstalled(\"com.mobeta.android.demodslv\"))\n\t\t{\n\t\t\tSystem.out.println(\"Successfully Installed\");\n\t\t\t\n\t\t\t//Remove thrugh code\n\t\t\tdriver.removeApp(\"com.mobeta.android.demodslv\");\n\t\t\tThread.sleep(8000);\n\t\t\tSystem.out.println(\"Removed sucessfully\");\n\t\t\t\n\t\t\t\n\t\t\tdriver.installApp(\"E:/Testing/Drag_and_Drop/com.mobeta.android.demodslv.apk\");\n\t\t\tThread.sleep(8000);\n\t\t\tSystem.out.println(\"Again Installed the app\");\n\t\t\t\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"NOT Installed the app\");\n\t\t}\n\n\t\t\n\n\t}", "public static void main(String[] args) throws IOException, InterruptedException {\t\n\t\t\n\t\t System.out.println(\"Starting AndroidApp write simulator as standalone...\");\n\t\t \n\t\t File monitoredFile = new File(\"/home/fulvio/andoffline.txt\");\n\t\t\t\n\t\t// 1 start the SD card file writer process that simulate the AndofflineApp\n\t\tAndroidFileWriterSimulator androidFileWriterSimulator = new AndroidFileWriterSimulator(monitoredFile);\n\t\tandroidFileWriterSimulator.startWriterSimulator();\n\t }", "@BeforeMethod\r\n\tpublic void setUp() throws MalformedURLException {\r\n\t\tDesiredCapabilities capabilities = new DesiredCapabilities();\r\n\t\tcapabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, Platform.ANDROID);\r\n\t\tcapabilities.setCapability(MobileCapabilityType.DEVICE_NAME, \"Android Emulator\");\r\n\t\tcapabilities.setCapability(MobileCapabilityType.APP, new File(\"./src/test/resources/ApiDemos-debug.apk\"));\r\n\r\n\t\tcapabilities.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, \"io.appium.android.apis\");\r\n\t\tcapabilities.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, \".app.AlertDialogSamples\");\r\n\r\n\t\tdriver = new AndroidDriver<MobileElement>(new URL(\"http://0.0.0.0:4723/wd/hub\"), capabilities);\r\n\t\tdriver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);\r\n\r\n\t}", "public void startDriver();", "public static void main(String[] args) throws Exception {\n File app = new File(\"/Users/wanghb/AndroidStudioProjects/myapp/app/build/outputs/apk/debug/app-debug.apk\");\n DesiredCapabilities capabilities = new DesiredCapabilities();\n// capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, \"Android Emulator\");\n// capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, \"Android Emulator\");\n// capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());\n //安卓通过appPackage及appActivity\n capabilities.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, \"com.example.myapp\");\n capabilities.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, \".MainActivity\");\n capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, MobilePlatform.ANDROID);\n //you are free to set additional capabilities\n AppiumDriver<MobileElement> driver = new AppiumDriver<>(\n new URL(\"http://0.0.0.0:4723/wd/hub\"),\n //if it needs to use locally started server\n //then the target_ip is 127.0.0.1 or 0.0.0.0\n //the default port is 4723\n capabilities);\n MobileElement firstText = driver.findElement(By.id(\"textview_first\"));\n System.out.println(firstText.getText());\n System.out.println(firstText.getTagName());\n System.out.println(firstText.getSize());\n MobileElement firstButton = driver.findElement(By.id(\"button_first\"));\n firstButton.click();\n MobileElement secondtext = driver.findElement(By.id(\"textview_second\"));\n System.out.println(secondtext.getText());\n System.out.println(secondtext.getTagName());\n System.out.println(secondtext.getSize());\n MobileElement secondButton = driver.findElement(By.id(\"button_second\"));\n System.out.println(secondButton.getText());\n System.out.println(secondButton.getTagName());\n System.out.println(secondButton.getSize());\n System.out.println(\"success\");\n }", "private void createAndLaunchExoPlayer() {\n player = ExoPlayerFactory.newSimpleInstance(this);\n // Bind player to player view\n playerView.setPlayer(player);\n\n // DataSource to load media data\n DataSource.Factory dataSource = new DefaultDataSourceFactory(this,\n Util.getUserAgent(this, getString(R.string.app_name)));\n // Media Source containing tokenized Url\n MediaSource mediaSource = new HlsMediaSource.Factory(dataSource).createMediaSource(tokenizedUri);\n\n // Automatically play video when launched\n player.setPlayWhenReady(true);\n // Listener to load spinner when buffering\n player.addListener(playerListener);\n // Set mediaSource to player\n player.prepare(mediaSource);\n\n }", "public interface PeripheralSoftwareDriverInterface extends DriverBaseDataEventListener {\r\n\r\n /**\r\n * Is set in the BaseDriver, you can overwrite it, but for debugging\r\n * purposes not handy\r\n */\r\n public final static String DriverBaseName = \"driver:port\";\r\n\r\n /**\r\n * Returns the driver DB id.\r\n * @return \r\n */\r\n public int getId();\r\n \r\n /**\r\n * Starts the driver and runs the thread\r\n */\r\n public void startDriver();\r\n\r\n /**\r\n * Stops the driver and the thread the driver is running in\r\n */\r\n public void stopDriver();\r\n\r\n /**\r\n * Returns the Hardware driver which belongs to the given running software\r\n * driver.\r\n *\r\n * @return\r\n */\r\n public Peripheral getHardwareDriverFromSoftwareDriver();\r\n\r\n \r\n /**\r\n * Returns the hardware driver.\r\n * @return \r\n */\r\n public PeripheralHardwareDriverInterface getHardwareDriver();\r\n \r\n /**\r\n * Returns the amount of active devices attached to this driver.\r\n *\r\n * @return\r\n */\r\n public int getRunningDevicesCount();\r\n\r\n /**\r\n * Returns a list of running devices whom belong to this driver.\r\n *\r\n * @return\r\n */\r\n public List<Device> getRunningDevices();\r\n\r\n /**\r\n * Send a batch of commands through the proxy. This method is preferred when\r\n * sending multiple commands at once with a build in delay. this function\r\n * should create a batch with a default name (anonymous)\r\n *\r\n * @param batchData Strings with commands\r\n * @see #runBatch()\r\n * @see #runBatch(java.lang.String)\r\n */\r\n public void addBatch(List<Map<String, String>> batchData);\r\n\r\n /**\r\n * Send a batch of commands through the proxy. This method is preferred when\r\n * sending multiple commands at once with a build in delay.\r\n *\r\n * @param batchData Strings with commands\r\n * @param batchName String with the name of the batch to use later on with\r\n * runBatch()\r\n * @see #runBatch()\r\n * @see #runBatch(java.lang.String)\r\n */\r\n public void addBatch(List<Map<String, String>> batchData, String batchName);\r\n\r\n /**\r\n * Runs the batch previously set with the anonymous addBatch\r\n */\r\n public void runBatch();\r\n\r\n /**\r\n * Runs the batch previously set with addBatch with a batchName\r\n *\r\n * @param batchName Name of the batch to run\r\n */\r\n public void runBatch(String batchName);\r\n\r\n /**\r\n * Sends the data to the hardware itself\r\n *\r\n * @param data The data to send\r\n * @param prefix When having multiple devices supported by the hardware a\r\n * prefix can distinct the device in your hardware\r\n * @return result of the send command\r\n * @throws java.io.IOException\r\n * @Obsolete Use writeBytes.\r\n */\r\n public boolean sendData(String data, String prefix) throws IOException;\r\n\r\n /**\r\n * Sends the data to the hardware itself\r\n *\r\n * @param data The data to send\r\n * @return the result of the command\r\n * @throws java.io.IOException\r\n * @Obsolete Use WriteBytes.\r\n */\r\n public boolean sendData(String data) throws IOException;\r\n\r\n /**\r\n * Retrieves the name of the class.\r\n *\r\n * @return the name of the class\r\n */\r\n public String getName();\r\n\r\n /**\r\n * For adding an hardware driver.\r\n *\r\n * @param l\r\n */\r\n public void setPeripheralEventListener(PeripheralHardwareDriverInterface l);\r\n\r\n /**\r\n * for removing an hardware driver.\r\n *\r\n * @param l\r\n */\r\n public void removePeripheralEventListener(PeripheralHardwareDriverInterface l);\r\n\r\n /**\r\n * Handles data received from the hardware driver to be used by overwriting\r\n * classes.\r\n *\r\n * @param oEvent\r\n */\r\n @Override\r\n public void driverBaseDataReceived(PeripheralHardwareDataEvent oEvent);\r\n\r\n /**\r\n * Driver proxy for hardware data.\r\n *\r\n * @param oEvent\r\n */\r\n public void driverBaseDataReceivedProxy(PeripheralHardwareDataEvent oEvent);\r\n\r\n /**\r\n * Returns the package name of the driver as used in the database.\r\n *\r\n * @return The package name of this class\r\n */\r\n public String getPackageName();\r\n\r\n /**\r\n * Adds a device to the listers for whom data can exist.\r\n *\r\n * @param device\r\n */\r\n public void addDeviceListener(DeviceDriverListener device);\r\n\r\n /**\r\n * Removes a device from the listeners list.\r\n *\r\n * @param device\r\n */\r\n public void removeDeviceListener(DeviceDriverListener device);\r\n\r\n /**\r\n * Handle the data coming from a device driver to dispatch to the hardware\r\n * driver. With this function you can do stuff with the data. For example if\r\n * needed change from string to byte array?\r\n *\r\n * @param device\r\n * @param group\r\n * @param set\r\n * @param deviceData\r\n * @return A string which represents a result, human readable please.\r\n * @throws java.io.IOException\r\n */\r\n public boolean handleDeviceData(Device device, String group, String set, String deviceData) throws IOException;\r\n\r\n /**\r\n * Handles data coming from a device as is in the request!\r\n * @param device\r\n * @param request\r\n * @return\r\n * @throws IOException \r\n */\r\n public boolean handleDeviceData(Device device, DeviceCommandRequest request) throws IOException;\r\n \r\n /**\r\n * Sets the driver DB id.\r\n * @param driverDBId \r\n */\r\n public void setId(int driverDBId);\r\n \r\n /**\r\n * Sets the named id\r\n * @param dbNameId\r\n */\r\n public void setNamedId(String dbNameId);\r\n \r\n /**\r\n * Gets the named id\r\n * @return \r\n */\r\n public String getNamedId();\r\n \r\n /**\r\n * Returns if the driver supports custom devices.\r\n * @return \r\n */\r\n public boolean hasCustom();\r\n \r\n /**\r\n * Set if a driver has custom devices.\r\n * @param hasCustom\r\n * @return \r\n */\r\n public void setHasCustom(boolean hasCustom);\r\n \r\n /**\r\n * Returns the software driver id.\r\n *\r\n * @param softwareId\r\n */\r\n public void setSoftwareDriverId(String softwareId);\r\n\r\n /**\r\n * Returns the version set in the driver.\r\n *\r\n * @param softwareIdVersion\r\n */\r\n public void setSoftwareDriverVersion(String softwareIdVersion);\r\n\r\n /**\r\n * Returns the software driver id.\r\n *\r\n * @return\r\n */\r\n public String getSoftwareDriverId();\r\n\r\n /**\r\n * Returns the version set in the driver.\r\n *\r\n * @return\r\n */\r\n public String getSoftwareDriverVersion();\r\n\r\n /**\r\n * Returns true if there is a web presentation present.\r\n *\r\n * @return\r\n */\r\n public boolean hasPresentation();\r\n\r\n /**\r\n * Sets a web presentation;\r\n *\r\n * @param pres\r\n */\r\n public void addWebPresentationGroup(WebPresentationGroup pres);\r\n\r\n /**\r\n * Returns the web presentation.\r\n *\r\n * @return\r\n */\r\n public List<WebPresentationGroup> getWebPresentationGroups();\r\n\r\n /**\r\n * Sets the friendlyname.\r\n * @param name \r\n */\r\n public void setFriendlyName(String name);\r\n \r\n /**\r\n * Returns the friendlyname.\r\n * @return \r\n */\r\n public String getFriendlyName();\r\n \r\n /**\r\n * Sets a link with the device service.\r\n * @param deviceServiceLink \r\n */\r\n public void setDeviceServiceLink(PeripheralDriverDeviceMutationInterface deviceServiceLink);\r\n \r\n /**\r\n * Removes a device service link.\r\n */\r\n public void removeDeviceServiceLink();\r\n \r\n /**\r\n * Indicator to let know a device is loaded.\r\n * @param device \r\n */\r\n public void deviceLoaded(Device device);\r\n \r\n}", "@Override\n public void onCreate() {\n super.onCreate();\n super.setNeedAutoReConnect(NEED_AUTO_RECONNECT);\n super.setNeedConnectStatusBroadcast(NEED_CONNECT_STATUS_BROADCAST);\n Log.e(TAG, \"oncreat\");\n mCommunciation = new CommunciationImp(this);\n mProtocol = new ProtocolConfig(this);\n }", "@Test\n\tpublic void driverCreatePositiveTest() {\n\t\tDriver driver;\n\t\tUserAccount ua;\n\t\tfinal Authority authority;\n\t\tCollection<Authority> authorities;\n\n\t\tdriver = this.driverService.create();\n\t\tua = this.userAccountService.create();\n\t\tauthority = new Authority();\n\t\tauthority.setAuthority(Authority.DRIVER);\n\t\tauthorities = new ArrayList<Authority>();\n\t\tauthorities.add(authority);\n\n\t\tdriver.setName(\"Name\");\n\t\tdriver.setSurname(\"Surname\");\n\t\tdriver.setCountry(\"Country\");\n\t\tdriver.setCity(\"City\");\n\t\tdriver.setBankAccountNumber(\"ES4963116815932885489285\");\n\t\tdriver.setPhone(\"698456847\");\n\t\tdriver.setChilds(true);\n\t\tdriver.setMusic(true);\n\t\tdriver.setSmoke(false);\n\t\tdriver.setPets(true);\n\n\t\tua.setUsername(\"newdriver@gmail.com\");\n\t\tua.setPassword(\"newdriver\");\n\t\tua.setAuthorities(authorities);\n\n\t\tdriver.setUserAccount(ua);\n\n\t\tthis.driverService.save(driver);\n\t\tthis.driverService.flush();\n\t}", "public Device createObject(String brand, String model, Integer price, String photo, String date);" ]
[ "0.63742095", "0.6337549", "0.6331439", "0.6279286", "0.627033", "0.6262555", "0.62386096", "0.6159583", "0.6072954", "0.60311025", "0.59905005", "0.59829885", "0.59786487", "0.5954689", "0.59221125", "0.5865374", "0.5865362", "0.5847501", "0.58266044", "0.5802675", "0.57940334", "0.5789728", "0.57776624", "0.5773761", "0.5763611", "0.5762494", "0.57505417", "0.57436293", "0.5728076", "0.57118964", "0.56867176", "0.56858534", "0.56802243", "0.567513", "0.56712705", "0.5652382", "0.563946", "0.56391734", "0.5576369", "0.5570432", "0.55674046", "0.5546092", "0.55327296", "0.5527574", "0.55073833", "0.55064094", "0.54815185", "0.54515976", "0.5448477", "0.5447502", "0.53922385", "0.5387081", "0.5383666", "0.53823984", "0.5367885", "0.5367208", "0.53670686", "0.5355163", "0.5348155", "0.5346773", "0.53249437", "0.53086096", "0.53071946", "0.529171", "0.5280851", "0.5270525", "0.5265953", "0.5264151", "0.52577", "0.5252568", "0.5243073", "0.52250254", "0.52234995", "0.5215545", "0.51981187", "0.5185879", "0.51851827", "0.5180318", "0.51745945", "0.51693094", "0.5165758", "0.5164467", "0.51641756", "0.5162749", "0.515044", "0.5147563", "0.51415485", "0.51309955", "0.51222634", "0.51197946", "0.51065564", "0.50962204", "0.5093662", "0.5091786", "0.5054388", "0.5039183", "0.50374305", "0.50278527", "0.5027527", "0.5025869" ]
0.5583788
38
this method creates the iOS driver
public void iOSDriver(String buildPath, String iosBundleId, String iosUDID, String iosVersion) throws MalformedURLException { if (buildPath != "") { File app = new File(buildPath); capabilities.setCapability("app", app.getAbsolutePath()); } capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iOS-Test"); capabilities.setCapability("platformName", "iOS"); capabilities.setCapability("bundleId", iosBundleId); capabilities.setCapability("automationName", "XCUITest"); capabilities.setCapability("noReset", NO_RESET); if (System.getenv("DEVICEFARM_LOG_DIR") == null && System.getProperty("device.udid") == null) { if (iosUDID.isEmpty() || iosVersion.isEmpty()) { throw new TapException(TapExceptionType.PROCESSING_FAILED, "Please supply ios udid and platform version to move forward"); } capabilities.setCapability("udid", iosUDID); capabilities.setCapability("platformVersion", iosVersion); } else if (System.getProperty("device.udid") != null) { capabilities.setCapability("udid", System.getProperty("device.udid")); capabilities.setCapability("platformVersion", System.getProperty("device.version")); } driver = new IOSDriver(new URL(APPIUM_SERVER_URL), capabilities); driver.manage().timeouts().implicitlyWait(DEFAULT_IMPLICIT_WAIT, TimeUnit.SECONDS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void createDriver(Driver driver);", "public iOS(){\n //super.deviceOSType = OSType.iOS;\n //super.deviceType = \"Unknown\";\n this.iOSOSVersion = 9.0;\n }", "private static String createDriver() {\n\t\tBFLogger.logDebug(\"Creating new \" + RuntimeParameters.PARAM_1.toString() + \" driver.\");\n\t\t\n\t\tString driver = \"created driver\";\n\t\treturn driver;\n\t}", "private void intializeAppiumDriver() {\n File app = new File(\"src/main/resources\", CommonUtils.getCentralData(\"App\"));\n\n DesiredCapabilities capabilities = new DesiredCapabilities();\n capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, CommonUtils.getCentralData(\"PlatformName\"));\n capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, CommonUtils.getCentralData(\"PlatformVersion\"));\n capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, CommonUtils.getCentralData(\"DeviceName\"));\n if (IS_ANDROID) {\n capabilities.setCapability(APPLICATION_NAME, app.getAbsolutePath());\n capabilities.setCapability(APP_PACKAGE, CommonUtils.getCentralData(\"AppPackage\"));\n capabilities.setCapability(APP_ACTIVITY, CommonUtils.getCentralData(\"AppActivity\"));\n }\n if (IS_IOS) {\n capabilities.setCapability(AUTOMATION_NAME, IOS_XCUI_TEST);\n capabilities.setCapability(\"app\", app.getAbsolutePath());\n }\n capabilities.setCapability(FULL_RESET, CommonUtils.getCentralData(\"FullReset\"));\n capabilities.setCapability(NO_RESET, CommonUtils.getCentralData(\"NoReset\"));\n capabilities.setCapability(\"udid\", CommonUtils.getCentralData(\"UDID\"));\n capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, CommonUtils.getCentralData(\"WaitTimeoutInSeconds\"));\n\n try {\n driver = new AppiumDriver(new URL(CommonUtils.getCentralData(\"URL\")), capabilities);\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n }", "public DriverForCreateBuilder() {\r\n driverForCreate = new DriverForCreate();\r\n }", "RemoteWebDriver getDriver(String appName, String uuid, String bundleId, String xcodeOrgId, int timeout) {\n\t\tDesiredCapabilities ioscap = new DesiredCapabilities();\n\t\tioscap.setCapability(IOSMobileCapabilityType.WDA_LOCAL_PORT, 8100);\n\t\tioscap.setCapability(IOSMobileCapabilityType.BUNDLE_ID, bundleId);\n\t\tioscap.setCapability(IOSMobileCapabilityType.XCODE_ORG_ID, xcodeOrgId);\n\t\tioscap.setCapability(IOSMobileCapabilityType.XCODE_SIGNING_ID, \"iPhone Developer\");\n\t\tioscap.setCapability(\"automationName\", \"XCUITest\");\n\t\tioscap.setCapability(\"platformName\", \"iOS\");\n\t\tioscap.setAcceptInsecureCerts(true);\n\t\tioscap.acceptInsecureCerts();\n\t\tioscap.setCapability(IOSMobileCapabilityType.LAUNCH_TIMEOUT, 60000);\n\t\tioscap.setCapability(IOSMobileCapabilityType.COMMAND_TIMEOUTS, 60000);\n\t\tioscap.setCapability(IOSMobileCapabilityType.WDA_LAUNCH_TIMEOUT, 1200000);\n\t\tioscap.setCapability(IOSMobileCapabilityType.WDA_CONNECTION_TIMEOUT, 1200000);\n\t\ttry {\n\t\t\tif (System.getProperty(\"location\").equalsIgnoreCase(\"local\")) {\n\t\t\t\tdriver = new IOSDriver<>(new URL(\"http://127.0.0.1:4651/wd/hub\"), ioscap);\n\t\t\t} else {\n\t\t\t\tdriver = new IOSDriver<>(new URL(PropertyHelper.getProperties(\"REMOTE_HUB_URL\")), ioscap);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"IOSDriver Driver instantiating failed\", e);\n\t\t}\n\t\tdriver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);\n\t\tDriverFactory.getDriverPool().put(appName, driver);\n\t\treturn driver;\n\t}", "Device createDevice();", "public DriverConfig createDriver()\n {\n DriverConfig driver = new DriverConfig(this);\n \n _driverList.add(driver);\n \n return driver;\n }", "public void selectDriver();", "@Override\r\n public WebDriver createWebDriver() {\n MutableCapabilities capabilities = createSpecificGridCapabilities(webDriverConfig);\r\n capabilities.merge(driverOptions);\r\n \r\n // \r\n gridConnector.uploadMobileApp(capabilities);\r\n\r\n // connection to grid is made here\r\n driver = getDriver(gridConnector.getHubUrl(), capabilities);\r\n\r\n setImplicitWaitTimeout(webDriverConfig.getImplicitWaitTimeout());\r\n if (webDriverConfig.getPageLoadTimeout() >= 0 && SeleniumTestsContextManager.isWebTest()) {\r\n setPageLoadTimeout(webDriverConfig.getPageLoadTimeout());\r\n }\r\n\r\n this.setWebDriver(driver);\r\n\r\n runWebDriver();\r\n\r\n ((RemoteWebDriver)driver).setFileDetector(new LocalFileDetector());\r\n\r\n return driver;\r\n }", "public static AppiumDriver<MobileElement> setUp() {\n\t\ttry {\t\t\n\t\t\t\n\t\tDesiredCapabilities cap=new DesiredCapabilities();\n\t\tcap.setCapability(MobileCapabilityType.PLATFORM_NAME,\"ANDROID\");\n\t\tcap.setCapability(MobileCapabilityType.PLATFORM_VERSION, \"10 QKQ1.190915.002\");\n\t\tcap.setCapability(MobileCapabilityType.DEVICE_NAME, \"Redmi Note 7 Pro\");\n\t\tcap.setCapability(MobileCapabilityType.UDID, \"d9b3ca47\");\n//\t\tcap.setCapability(MobileCapabilityType.APP, \"\");\n\t\tcap.setCapability(\"appPackage\", \"com.swaglabsmobileapp\");\n\t\tcap.setCapability(\"appActivity\", \"com.swaglabsmobileapp.SplashActivity\");\n\t\t\n\t\tURL url=new URL(\"http://127.0.0.1:4723/wd/hub\");\n\t\tdriver =new AppiumDriver<MobileElement>(url, cap);\n\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\n//\t\tlog.info(\"Launching the app\");\n//\t\tMobileElement loginbutton = driver.findElement(MobileBy.AccessibilityId(\"test-LOGIN\"));\n// loginbutton.click();\n\t\t\t\treturn driver;\n\t\t}catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn driver;\n\t\t}\n\t}", "private static void setupDrivers(Application application) {\n\t\tJob2dDriver loggerDriver = new LoggerDriver();\n\t\tDriverFeature.addDriver(\"Logger driver\", loggerDriver);\n\n\t\tDrawPanelController drawerController = DrawerFeature.getDrawerController();\n\t\tJob2dDriver driver = new LineDriverAdapter(drawerController, LineFactory.getBasicLine(), \"basic\");\n\t\tDriverFeature.addDriver(\"Line Simulator\", driver);\n\t\tDriverFeature.getDriverManager().setCurrentDriver(driver);\n\n\t\tdriver = new LineDriverAdapter(drawerController, LineFactory.getSpecialLine(), \"special\");\n\t\tDriverFeature.addDriver(\"Special line Simulator\", driver);\n\t\tDriverFeature.updateDriverInfo();\n\n\t\tdriver = new LineDriverAdapter(drawerController, customizableLine, \"customizable\");\n\t\tDriverFeature.addDriver(\"Customizable Line\", driver);\n\t\tDriverFeature.updateDriverInfo();\n\t}", "public void initializeDriver() {\n }", "@Test\n public void testMobileIOS() throws GeneralLeanFtException, InterruptedException, ReportException {\n Browser browser;\n try {\n System.out.println(\"Running test on iOS mobile browser\");\n DeviceDescription description = new DeviceDescription();\n description.setOsType(\"IOS\");\n description.setOsVersion(\">=9.0\");\n\n Device device = MobileLab.lockDevice(description);\n browser = BrowserFactory.launch(BrowserType.SAFARI, device);\n navigateBrowser(browser);\n Reporter.reportEvent(\"Image of Mobile\", \"Using Safari on iOS\", Status.Passed, browser.getSnapshot());\n }\n catch (GeneralLeanFtException glftex) {System.out.println(\"GeneralLeanFtException: \" + glftex.getMessage());}\n catch (InterruptedException iex) {System.out.println(\"InterruptedException: \" + iex.getMessage());}\n catch (ReportException rex){System.out.println(\"ReportException: \" + rex.getMessage());}\n }", "private void initDriver(){\r\n String browserToBeUsed = (String) jsonConfig.get(\"browserToBeUsed\");\r\n switch (browserToBeUsed) {\r\n case \"FF\":\r\n System.setProperty(\"webdriver.gecko.driver\", (String) jsonConfig.get(\"fireFoxDriverPath\"));\r\n FirefoxProfile ffProfile = new FirefoxProfile();\r\n // ffProfile.setPreference(\"javascript.enabled\", false);\r\n ffProfile.setPreference(\"intl.accept_languages\", \"en-GB\");\r\n\r\n FirefoxOptions ffOptions = new FirefoxOptions();\r\n ffOptions.setProfile(ffProfile);\r\n driver = new FirefoxDriver(ffOptions);\r\n break;\r\n case \"CH\":\r\n String driverPath = (String) jsonConfig.get(\"chromeDriverPath\");\r\n System.setProperty(\"webdriver.chrome.driver\", driverPath);\r\n\r\n Map<String, Object> prefs = new HashMap<String, Object>();\r\n prefs.put(\"profile.default_content_setting_values.notifications\", 2);\r\n\r\n ChromeOptions options = new ChromeOptions();\r\n options.setExperimentalOption(\"prefs\", prefs);\r\n options.addArguments(\"--lang=en-GB\");\r\n driver = new ChromeDriver(options);\r\n break;\r\n case \"IE\":\r\n System.setProperty(\"webdriver.ie.driver\", (String) jsonConfig.get(\"ieDriverPath\"));\r\n\r\n InternetExplorerOptions ieOptions = new InternetExplorerOptions();\r\n ieOptions.disableNativeEvents();\r\n ieOptions.requireWindowFocus();\r\n ieOptions.introduceFlakinessByIgnoringSecurityDomains();\r\n driver = new InternetExplorerDriver(ieOptions);\r\n }\r\n\r\n driver.manage().window().maximize();\r\n }", "public void startDriver();", "Driver getDriver();", "protected WebDriver newDriver() {\n SupportedWebDriver supportedDriverType = Configuration.getDriverType();\n return webDriverFactory.newInstanceOf(supportedDriverType);\n }", "public static AppiumDriver getDriver(String platformtype, AppiumDriverLocalService service) throws IOException, TimeoutException, URISyntaxException {\n AppiumDriver driver;\n /* List<InterceptedMessage> messages = new ArrayList<InterceptedMessage>();\n\n\n MitmproxyJava proxy = new MitmproxyJava(\"/usr/local/bin/mitmdump\", (InterceptedMessage m) -> {\n System.out.println(\"intercepted request for \" + m.requestURL.toString());\n messages.add(m);\n return m;\n });\n //System.out.println(\"Hello World\");\n proxy.start();*/\n if (platformtype== \"Android\") {\n DesiredCapabilities options = new DesiredCapabilities();\n options.setCapability(\"deviceName\", propertyManager.getInstance().getdevicename()); //Pixel_XL_API_29\n options.setCapability(\"udid\",propertyManager.getInstance().getdeviceUDID());\n //options.setCapability(\"avd\",\"Pixel_XL_API_29\");\n options.setCapability(\"platformName\", propertyManager.getInstance().getplatformName());\n options.setCapability(\"platformVersion\", propertyManager.getInstance().getplatformVersion()); //emulator: 10.0.0\n options.setCapability(\"automationName\", \"UiAutomator2\");\n options.setCapability(\"autoGrantPermissions\",\"true\");\n options.setCapability(\"noReset\",\"true\");\n options.setCapability(\"autoAcceptAlerts\",\"true\");\n options.setCapability(\"app\",propertyManager.getInstance().getAndroidapp());\n options.setCapability(\"uiautomator2ServerInstallTimeout\", \"60000\");\n options.setCapability(\"abdExecTimeout\", \"60000\");\n options.setCapability(\"ACCEPT_SSL_CERTS\",true);\n options.setCapability(\"clearDeviceLogsOnStart\",\"true\");\n //options.setCapability(\"--set ssl_version_client\",\"all\");\n //options.setCapability(\"--proxy-server\",\"localhost:8080\");\n //options.setCapability(\"appWaitPackage\", \"com.clearchannel.iheartradio.controller.debug\");\n //options.setCapability(\"appWaitActivity\", \"com.clearchannel.iheartradio.controller.activities.NavDrawerActivity\");\n //options.setCapability(\"appPackage\", \"com.clearchannel.iheartradio.controller.debug\");\n //options.setCapability(\"appActivity\", \"com.clearchannel.iheartradio.controller.activities.NavDrawerActivity\");\n\n\n driver = new AndroidDriver<MobileElement>(service, options);\n return driver;\n }\n else if(platformtype== \"iOS\"){\n DesiredCapabilities options = new DesiredCapabilities();\n\n options.setCapability(\"platformName\", \"iOS\");\n options.setCapability(\"platformVersion\", propertyManager.getInstance().getiOSplatformVersion());\n options.setCapability(\"deviceName\", propertyManager.getInstance().getiOSdevicename());\n options.setCapability(\"udid\",propertyManager.getInstance().getiOSUDID());\n //options.setCapability(CapabilityType.BROWSER_NAME,\"safari\");\n //options.setCapability(\"automationName\", \"XCUITest\");\n options.setCapability(\"bundleId\",\"com.clearchannel.iheartradio.enterprise\");\n options.setCapability(\"startIWDP\",\"true\");\n options.setCapability(\"noReset\",\"true\");\n options.setCapability(\"useNewWDA\",\"false\");\n //options.setCapability(\"showIOSLog\",\"true\");\n //options.setCapability(\"app\",\"/Users/Shruti/Desktop/untitled folder/iHRiOSAppCenter/iHeartRadio.ipa\"); // /Users/Shruti/Downloads/iHeartRadio.ipa\n options.setCapability(\"xcodeOrgId\",\"BCN32U332R\");\n options.setCapability(\"xcodeSigningId\",\"iPhone Developer\");\n options.setCapability(\"autoAcceptAlerts\",\"true\");\n options.setCapability(\"SHOW_XCODE_LOG\",\"true\");\n //options.setCapability(\"updatedWDABundleId\",\"com.Shruti7505.WebDriverAgentRunner\");\n driver = new IOSDriver<MobileElement>(service,options);\n return driver;\n }\n return driver=null;\n\n }", "private WebDriver createDriver() {\r\n\t\tlogger.info(\"Environment Type is \" + environmentType);\r\n\t\tswitch (environmentType) {\r\n\t\tcase LOCAL:\r\n\t\t\tdriver = createLocalDriver();\r\n\t\t\tbreak;\r\n\t\tcase REMOTE:\r\n\t\t\tdriver = createRemoteDriver();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn driver;\r\n\t}", "public static KAppiumDriver getDriver(String driverType, String seleniuGridUrl) {\n WebDriver driver = null;\n AppiumDriver appiumDriver = null;\n KAppiumDriver kAppiumDriver = null;\n //for specify download folder\n //String downloadFilepath = ConfigHelper.getDownloadFolder();\n switch (driverType) {\n case \"android\": {\n String appPath = ConfigHelper.getAppPath();\n\n String url = ConfigHelper.getAppiumServerURL();\n DesiredCapabilities capabilities = new DesiredCapabilities();\n\n capabilities.setCapability(MobileCapabilityType.APPIUM_VERSION, ConfigHelper.getAppiumVersion());\n //capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, ConfigHelper.getPlatformVersion());\n capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, ConfigHelper.getDeviceName());\n capabilities.setCapability(MobileCapabilityType.APP, appPath);\n if (!ConfigHelper.getAutomationName().isEmpty()) {\n capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, ConfigHelper.getAutomationName());\n }\n try {\n appiumDriver = new AndroidDriver(new URL(url), capabilities);\n kAppiumDriver = new KAppiumDriver(appiumDriver);\n logger.info(\"AndroidDriver is \" + driverType + \" driver, pointing \" + \" is generated on\" + url);\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n break;\n }\n case \"ios\": {\n String appPath = ConfigHelper.getAppPath();\n\n String url = ConfigHelper.getAppiumServerURL();\n DesiredCapabilities capabilities = new DesiredCapabilities();\n //capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, ConfigHelper.getDriverType());\n capabilities.setCapability(MobileCapabilityType.APPIUM_VERSION, ConfigHelper.getAppiumVersion());\n capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, ConfigHelper.getPlatformVersion());\n capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, ConfigHelper.getDeviceName());\n capabilities.setCapability(MobileCapabilityType.APP, appPath);\n if (!ConfigHelper.getAutomationName().isEmpty()) {\n capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, ConfigHelper.getAutomationName());\n }\n try {\n appiumDriver = new IOSDriver(new URL(url), capabilities);\n kAppiumDriver = new KAppiumDriver(appiumDriver);\n logger.info(\"IOSDriver is \" + driverType + \" driver, pointing \" + \" is generated on\" + url);\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n break;\n }\n case \"browserstack\":\n String USERNAME = \"a user name\";\n String AUTOMATE_KEY = \"a password\";\n // final String URL = \"http://otis8:5ZpdSfAmCEpyvwrF8BTq@hub.browserstack.com:80/wd/hub\";\n String URL = \"http://\" + USERNAME + \":\" + AUTOMATE_KEY + \"@hub.browserstack.com:80/wd/hub\";\n if (!ConfigHelper.getString(\"browserstack.url\").isEmpty()) {\n URL = ConfigHelper.getString(\"browserstack.url\");\n logger.info(URL);\n }\n\n //browserstack.debug=true\n DesiredCapabilities caps = new DesiredCapabilities();\n if (!ConfigHelper.getString(\"browserstack.os\").isEmpty()) {\n caps.setCapability(\"os\", ConfigHelper.getString(\"browserstack.os\"));\n logger.info(\"browserstack.os\" + ConfigHelper.getString(\"browserstack.os\"));\n }\n if (!ConfigHelper.getString(\"browserstack.debug\").isEmpty()) {\n caps.setCapability(\"browserstack.debug\", ConfigHelper.getString(\"browserstack.debug\"));\n logger.info(\"browserstack.debug\" + ConfigHelper.getString(\"browserstack.debug\"));\n }\n if (!ConfigHelper.getString(\"browserstack.os_version\").isEmpty()) {\n caps.setCapability(\"os_version\", ConfigHelper.getString(\"browserstack.os_version\"));\n logger.info(\"browserstack.os_version\" + ConfigHelper.getString(\"browserstack.os_version\"));\n }\n if (!ConfigHelper.getString(\"browserstack.browserName\").isEmpty()) {\n caps.setCapability(\"browserName\", ConfigHelper.getString(\"browserstack.browserName\"));\n logger.info(\"browserstack.browserName\" + ConfigHelper.getString(\"browserstack.browserName\"));\n }\n if (!ConfigHelper.getString(\"browserstack.browser_version\").isEmpty()) {\n caps.setCapability(\"browser_version\", ConfigHelper.getString(\"browserstack.browser_version\"));\n logger.info(\"browserstack.browser_version\" + ConfigHelper.getString(\"browserstack.browser_version\"));\n }\n if (!ConfigHelper.getString(\"browserstack.browserstack.local\").isEmpty()) {\n caps.setCapability(\"browserstack.local\", ConfigHelper.getString(\"browserstack.browserstack.local\"));\n logger.info(\"browserstack.local\" + ConfigHelper.getString(\"browserstack.browserstack.local\"));\n }\n if (!ConfigHelper.getString(\"browserstack.browserstack.debug\").isEmpty()) {\n caps.setCapability(\"browserstack.debug\", ConfigHelper.getString(\"browserstack.browserstack.debug\"));\n logger.info(\"browserstack.debug\" + ConfigHelper.getString(\"browserstack.browserstack.debug\"));\n }\n if (!ConfigHelper.getString(\"browserstack.browserstack.console\").isEmpty()) {\n caps.setCapability(\"browserstack.console\", ConfigHelper.getString(\"browserstack.browserstack.console\"));\n logger.info(\"browserstack.console\" + ConfigHelper.getString(\"browserstack.browserstack.console\"));\n }\n if (!ConfigHelper.getString(\"browserstack.browserstack.networkLogs\").isEmpty()) {\n caps.setCapability(\"browserstack.networkLogs\", ConfigHelper.getString(\"browserstack.browserstack.networkLogs\"));\n logger.info(\"browserstack.networkLogs\" + ConfigHelper.getString(\"browserstack.browserstack.networkLogs\"));\n }\n if (!ConfigHelper.getString(\"browserstack.browserstack.video\").isEmpty()) {\n caps.setCapability(\"browserstack.video\", ConfigHelper.getString(\"browserstack.browserstack.video\"));\n logger.info(\"browserstack.video\" + ConfigHelper.getString(\"browserstack.browserstack.video\"));\n }\n if (!ConfigHelper.getString(\"browserstack.browserstack.timezone\").isEmpty()) {\n caps.setCapability(\"browserstack.timezone\", ConfigHelper.getString(\"browserstack.browserstack.timezone\"));\n logger.info(\"browserstack.timezone\" + ConfigHelper.getString(\"browserstack.browserstack.timezone\"));\n }\n if (!ConfigHelper.getString(\"browserstack.resolution\").isEmpty()) {\n caps.setCapability(\"resolution\", ConfigHelper.getString(\"browserstack.resolution\"));\n\n logger.info(\"resolution\" + ConfigHelper.getString(\"browserstack.resolution\"));\n }\n if (!ConfigHelper.getString(\"browserstack.selenium_version\").isEmpty()) {\n caps.setCapability(\"selenium_version\", ConfigHelper.getString(\"browserstack.selenium_version\"));\n logger.info(\"selenium_version\" + ConfigHelper.getString(\"browserstack.selenium_version\"));\n }\n if (!ConfigHelper.getString(\"browserstack.device\").isEmpty()) {\n caps.setCapability(\"device\", ConfigHelper.getString(\"browserstack.device\"));\n logger.info(\"device\" + ConfigHelper.getString(\"browserstack.device\"));\n }\n if (!ConfigHelper.getString(\"browserstack.realMobile\").isEmpty()) {\n caps.setCapability(\"realMobile\", ConfigHelper.getString(\"browserstack.realMobile\"));\n logger.info(\"realMobile\" + ConfigHelper.getString(\"browserstack.realMobile\"));\n }\n if (!ConfigHelper.getString(\"browserstack.browserstack.appium_version\").isEmpty()) {\n caps.setCapability(\"browserstack.appium_version\", ConfigHelper.getString(\"browserstack.browserstack.appium_version\"));\n logger.info(\"browserstack.appium_version\" + ConfigHelper.getString(\"browserstack.browserstack.appium_version\"));\n }\n if (!ConfigHelper.getString(\"browserstack.deviceOrientation\").isEmpty()) {\n caps.setCapability(\"deviceOrientation\", ConfigHelper.getString(\"browserstack.deviceOrientation\"));\n logger.info(\"deviceOrientation\" + ConfigHelper.getString(\"browserstack.deviceOrientation\"));\n\n }\n // WebDriver driver = null;\n try {\n driver = new RemoteWebDriver(new URL(URL), caps);\n logger.info(\"browserStack is \" + driverType + \" driver, pointing \" + seleniuGridUrl, caps + \" is generated\");\n } catch (MalformedURLException malformedURLException) {\n logger.info(malformedURLException.toString());\n return null;\n }\n break;\n case \"chrome\":\n //final ChromeOptions chromeOptions = new ChromeOptions();\n HashMap<String, Object> chromePrefs = new HashMap<String, Object>();\n chromePrefs.put(\"profile.default_content_settings.popups\", 0);\n chromePrefs.put(\"download.prompt_for_download\", \"false\");\n chromePrefs.put(\"download.directory_upgrade\", \"true\");\n chromePrefs.put(\"plugins.always_open_pdf_externally\", \"true\");\n chromePrefs.put(\"download.default_directory\", ConfigHelper.getDownloadFolder());\n chromePrefs.put(\"plugins.plugins_disabled\", new String[]{\n \"Adobe Flash Player\",\n \"Chrome PDF Viewer\"\n });\n chromePrefs.put(\"pdfjs.disabled\", true);\n ChromeOptions chromeOptions = new ChromeOptions();\n chromeOptions.setExperimentalOption(\"prefs\", chromePrefs);\n chromeOptions.addArguments(\"start-maximized\");\n chromeOptions.addArguments(\"disable-infobars\");\n chromeOptions.addArguments(\"--test-type\");\n DesiredCapabilities cap = DesiredCapabilities.chrome();\n cap.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, UnexpectedAlertBehaviour.IGNORE);\n cap.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);\n cap.setCapability(ChromeOptions.CAPABILITY, chromeOptions);\n\n if (ConfigHelper.getString(\"chrome.headless\").toLowerCase().contains(\"t\") || ConfigHelper.getString(\"chrome.headless\").toLowerCase().contains(\"y\")) {\n chromeOptions.addArguments(\"--headless\");\n logger.info(\"chrome headless mode adopted\");\n }\n\n if ((null == seleniuGridUrl) || (seleniuGridUrl.equals(\"\") || seleniuGridUrl.equals(\"127.0.0.1\"))) {\n //remove later, should be a better way - Kris\n //System.setProperty(\"webdriver.chrome.driver\", \"c:/source/chromedriver.exe\");\n driver = new ChromeDriver(cap);\n\n logger.info(driverType + \" driver is generated locally\");\n } else {\n try {\n\n driver = new RemoteWebDriver(new URL(ConfigHelper.getString(\"selenium.grid.url\")), cap);\n logger.info(\"remoteWebdriver is \" + driverType + \" driver, pointing \" + seleniuGridUrl, cap + \" is generated\");\n } catch (MalformedURLException malformedURLException) {\n logger.info(malformedURLException.toString());\n return null;\n }\n }\n break;\n case \"firefox\":\n if ((null == seleniuGridUrl) || (seleniuGridUrl.equals(\"\"))) {\n FirefoxOptions options = new FirefoxOptions();\n driver = new FirefoxDriver(options);\n logger.info(driverType + \" driver is generated locally\");\n } else {\n try {\n DesiredCapabilities capability = DesiredCapabilities.firefox();\n driver = new RemoteWebDriver(new URL(ConfigHelper.getString(\"selenium.grid.url\")), capability);\n logger.info(\"remoteWebdriver is \" + driverType + \" driver, pointing \" + seleniuGridUrl, capability + \" is generated\");\n } catch (MalformedURLException malformedURLException) {\n logger.info(malformedURLException.toString());\n return null;\n }\n }\n break;\n case \"edge\":\n if ((null == seleniuGridUrl) || (seleniuGridUrl.equals(\"\"))) {\n EdgeOptions options = new EdgeOptions();\n driver = new EdgeDriver(options);\n logger.info(driverType + \" driver is generated locally\");\n } else {\n try {\n DesiredCapabilities capability = DesiredCapabilities.edge();\n driver = new RemoteWebDriver(new URL(ConfigHelper.getString(\"selenium.grid.url\")), capability);\n logger.info(\"remoteWebdriver is \" + driverType + \" driver, pointing \" + seleniuGridUrl, capability + \" is generated\");\n } catch (MalformedURLException malformedURLException) {\n logger.info(malformedURLException.toString());\n return null;\n }\n }\n break;\n case \"phantomjs\":\n if ((null == seleniuGridUrl) || (seleniuGridUrl.equals(\"\"))) {\n driver = new PhantomJSDriver();\n logger.info(driverType + \" driver is generated locally\");\n } else {\n try {\n DesiredCapabilities capability = DesiredCapabilities.edge();\n driver = new RemoteWebDriver(new URL(ConfigHelper.getString(\"selenium.grid.url\")), capability);\n logger.info(\"remoteWebdriver is \" + driverType + \" driver, pointing \" + seleniuGridUrl, capability + \" is generated\");\n } catch (MalformedURLException malformedURLException) {\n logger.info(malformedURLException.toString());\n return null;\n }\n }\n driver = new PhantomJSDriver();\n break;\n case \"ie\":\n if ((null == seleniuGridUrl) || (seleniuGridUrl.equals(\"\"))) {\n InternetExplorerOptions options = new InternetExplorerOptions();\n driver = new InternetExplorerDriver();\n logger.info(driverType + \" driver is generated locally\");\n } else {\n try {\n DesiredCapabilities capability = DesiredCapabilities.internetExplorer();\n driver = new RemoteWebDriver(new URL(ConfigHelper.getString(\"selenium.grid.url\")), capability);\n logger.info(\"remoteWebdriver is \" + driverType + \" driver, pointing \" + seleniuGridUrl, capability + \" is generated\");\n } catch (MalformedURLException malformedURLException) {\n logger.info(malformedURLException.toString());\n return null;\n }\n }\n\n break;\n case \"safari\":\n if ((null == seleniuGridUrl) || (seleniuGridUrl.equals(\"\"))) {\n SafariOptions options = new SafariOptions();\n driver = new SafariDriver(options);\n logger.info(driverType + \" driver is generated locally\");\n } else {\n try {\n DesiredCapabilities capability = DesiredCapabilities.safari();\n driver = new RemoteWebDriver(new URL(ConfigHelper.getString(\"selenium.grid.url\")), capability);\n logger.info(\"remoteWebdriver is \" + driverType + \" driver, pointing \" + seleniuGridUrl, capability + \" is generated\");\n } catch (MalformedURLException malformedURLException) {\n logger.info(malformedURLException.toString());\n return null;\n }\n }\n break;\n default:\n throw new IllegalArgumentException(\"the browser type is not defined\");\n }\n\n if (kAppiumDriver != null) {\n return kAppiumDriver;\n }\n return (KAppiumDriver) driver;\n }", "@BeforeClass\n public void classLevelSetup() {\n\t\t \t\tcaps = new DesiredCapabilities();\n \t\t\tcaps.setCapability(\"deviceName\", \"My Phone\");\n \t\t\tcaps.setCapability(\"udid\", \"8f81d4e2\"); //Give Device ID of your mobile phone\n \t\t\tcaps.setCapability(\"platformName\", \"Android\");\n \t\t\tcaps.setCapability(\"platformVersion\", \"9\"); // The version of Android on your device\n \t\t\tcaps.setCapability(\"browserName\", \"Chrome\");\n \t\t\tcaps.setCapability(\"noReset\", true);\n \t\t\tcaps.setCapability(MobileCapabilityType.PLATFORM_NAME, MobilePlatform.ANDROID);\n \t\t\tcaps.setCapability(\"chromedriverExecutable\", \"C:\\\\SeleniumGecko\\\\chromedriver78.exe\"); // Set ChromeDriver location\n \t\t\t\n\n \t\t\t//Instantiate Appium Driver or AndroidDriver\n \t\t\ttry {\n \t\t\t\tdriver = new AppiumDriver<>(new URL(appium_node), caps);\n \t\t\t\t\n \t\t\t} catch (MalformedURLException e) {\n \t\t\t\tSystem.out.println(e.getMessage());\n \t\t\t}\n \t\t\t\t\t\n\n\t\t\n }", "public void initDriver() {\n if (getBrowser().equals(\"firefox\")) {\n WebDriverManager.firefoxdriver().setup();\n if (System.getProperty(\"headless\") != null) {\n FirefoxOptions firefoxOptions = new FirefoxOptions();\n firefoxOptions.setHeadless(true);\n driver = new FirefoxDriver(firefoxOptions);\n } else {\n driver = new FirefoxDriver();\n }\n } else {\n WebDriverManager.chromedriver().setup();\n if (System.getProperty(\"headless\") != null) {\n ChromeOptions chromeOptions = new ChromeOptions();\n chromeOptions.setHeadless(true);\n driver = new ChromeDriver(chromeOptions);\n } else {\n driver = new ChromeDriver();\n }\n }\n }", "public SignUpActions(WebDriver driver, DeviceInterface runnerInfo) {\n this.driver = driver;\n deviceHelper = new DeviceHelper(driver);\n //PageFactory.initElements(new AppiumFieldDecorator(driver), this);\n PageFactory.initElements(new AppiumFieldDecorator(driver), signUpObjects);\n this.runnerInfo = runnerInfo;\n }", "private void initialize() {\n if (driver == null)\n createNewDriverInstance();\n }", "public static AppiumDriverLocalService AppiumServerStart(){\n System.out.println(\"Into driver setup\");\n AppiumDriverLocalService service;\n\n AppiumServiceBuilder serviceBuilder = new AppiumServiceBuilder();\n\n serviceBuilder.usingAnyFreePort();\n // /usr/local/bin/node\n serviceBuilder.usingDriverExecutable(new File(\"/usr/local/bin/node\"));\n // /usr/local/bin/appium\n serviceBuilder.withAppiumJS(new File(\"/usr/local/bin/appium\"));\n serviceBuilder.withArgument(GeneralServerFlag.RELAXED_SECURITY);\n serviceBuilder.withArgument(GeneralServerFlag.SHELL);\n HashMap<String, String> environment = new HashMap();\n environment.put(\"PATH\", \"/usr/local/bin:\" + System.getenv(\"PATH\"));\n\n\n service = AppiumDriverLocalService.buildService(serviceBuilder);\n service.start();\n return service;\n }", "private void createNewDriverInstance() {\n String browser = props.getProperty(\"browser\");\n if (browser.equals(\"firefox\")) {\n FirefoxProfile profile = new FirefoxProfile();\n profile.setPreference(\"intl.accept_languages\", language);\n driver = new FirefoxDriver();\n } else if (browser.equals(\"chrome\")) {\n ChromeOptions options = new ChromeOptions();\n options.setBinary(new File(chromeBinary));\n options.addArguments(\"--lang=\" + language);\n driver = new ChromeDriver(options);\n } else {\n System.out.println(\"can't read browser type\");\n }\n }", "private void createUltraDuoPlusSetup(String useDeviceIdentifierName) {\n\t\tthis.ultraDuoPlusSetup = new ObjectFactory().createUltraDuoPlusType();\n\t\tList<MemoryType> cellMemories = this.ultraDuoPlusSetup.getMemory();\n\t\tif (cellMemories.size() < UltraDuoPlusDialog.numberMemories) { // initially create only base setup data\n\t\t\tfor (int i = 0; i < UltraDuoPlusDialog.numberMemories; i++) {\n\t\t\t\tMemoryType cellMemory = new ObjectFactory().createMemoryType();\n\t\t\t\tcellMemory.setSetupData(new ObjectFactory().createMemoryTypeSetupData());\n\t\t\t\tcellMemories.add(cellMemory);\n\t\t\t}\n\t\t}\n\t\tthis.ultraDuoPlusSetup.setIdentifierName(useDeviceIdentifierName);\n\t}", "public void init() throws MalformedURLException {\n\n capabilities = new DesiredCapabilities();\n\n capabilities.setCapability(\"deviceName\", \"Nex5\");\n capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, \"Android\");\n capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, \"8.0\");\n capabilities.setCapability(\"appPackage\", \"com.trello\");\n capabilities.setCapability(\"appActivity\", \".home.HomeActivity\");\n\n capabilities.setCapability(\"automationName\", \"Appium\");\n capabilities.setCapability(\"app\", \"C:/Users/Study/APK/trello_new.apk\");\n driver = new AppiumDriver<MobileElement>(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\n welcomeActivity = new WelcomePage(driver);\n loginActivity = new LoginPage(driver);\n\n }", "private void createDriver() {\n account = new Account(\"driver\", \"password\", \"driver@uclive.ac.nz\",\n \"Dan\", \"20 Howard Street\", 1234567, 64278182123L,\n new Licence(\"Full for over 2 years\", \"YXF87231\",\n LocalDate.parse(\"12/12/2015\", formatter),\n LocalDate.parse(\"12/12/2020\", formatter)));\n }", "public void connectAndCreateDB() {\n\t\tString connectionURL = \"jdbc:derby://localhost:1527/DerbyBPI;create=true\";\n\t //String connectionURL = \"jdbc:derby:DerbyBPI;create=true\";\n\t //String connectionURL = \"jdbc:derby://localhost:1527/\"+dbName+\";create=true\";\n\t// String connectionURL = \"jdbc:derby://ORCDatabase:1527/\"+dbName+\";create=true\";\n\n try {\t \n\t\tClass.forName(driver).newInstance(); \n System.out.println(driver + \" loaded. \");\n \n } catch(java.lang.ClassNotFoundException e) {\n System.err.print(\"ClassNotFoundException: \");\n System.err.println(e.getMessage());\n System.out.println(\"\\n >>> Please check your CLASSPATH variable <<<\\n\");\n } catch (InstantiationException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t} catch (IllegalAccessException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\n\n\n\t// Create (if needed) and connect to the database\n \n\t\ttry {\n\t\t\t\n\t\t\tconn = DriverManager.getConnection(connectionURL);\n\t\t\tSystem.out.println(\"******* Connected to database \" + dbName);\t \n\t\t\t\n\t\t\tif (this.tablesExist() == true) {\n\t\t\t\tthis.deleteAllTable();\n\t\t\t\tthis.createTables();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.createTables();\n\t\t\t}\n\n\t\t \n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\n \n \n\t}", "@Before\n\t public void setUp() throws Exception {\n\t \n\t DesiredCapabilities capabilities = new DesiredCapabilities();\n\t capabilities.setCapability(\"platformName\", \"Android\");\n\t //capabilities.setCapability(\"deviceName\", \"192.168.249.101:5555\");\n\t capabilities.setCapability(\"deviceName\", \"192.168.249.101:5555\");\n\t //capabilities.setCapability(\"deviceName\", \"f97f0457d73\");\n\t //capabilities.setCapability(\"platformVersion\", \"4.3\");\n\t //capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, \"emulator-5554\");\n\t capabilities.setCapability(\"noReset\", \"true\");\n\t capabilities.setCapability(\"unicodeKeyboard\",\"true\"); //输入中文\n\t capabilities.setCapability(\"resetKeyboard\",\"true\"); //输入中文\n\t capabilities.setCapability(\"appPackage\", \"com.worktile\"); //worktile的包\n\t capabilities.setCapability(\"appActivity\", \".ui.external.WelcomeActivity\"); //启动的activity .ui.external.WelcomeActivity\n\t try {\n\t\t\t\t//driver = new AndroidDriver<MobileElement>(new URL(\"http://192.168.31.225:4723/wd/hub\"), capabilities);\n\t\t\t\t//driver = new AndroidDriver<MobileElement>(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\t\t\t\tdriver = new AndroidDriver<MobileElement>(new URL(\"http://192.168.1.104:4723/wd/hub\"), capabilities);\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS); \n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\tdriver.quit();\n\t\t\t\tSystem.err.println(\"launch Android driver fail!\"+e.toString());\n\t\t\t}\n\t }", "public void newInst() {\n\t\tlogger.debug(\"DeviceNameTableTester has been initialized\");\n\t\t\n\t\tlogger.debug(\"@@@@@@@@@@@@@@@@@@@ Try to set the name of a device\");\n\t\tdeviceNameTable.addName(testDeviceId, null, \"La lampe HUE 1\");\n\t\t\n\t\tlogger.debug(\"@@@@@@@@@@@@@@@@@@@ Try to get the name of a device\");\n\t\tString name = deviceNameTable.getName(testDeviceId, null);\n\t\tlogger.debug(\" @@@@@@@@@@@@ Device name get: \"+name);\n\t\t\n\t\tlogger.debug(\"@@@@@@@@@@@@@@@@@@@ Try to delete the device name: \");\n\t\tdeviceNameTable.deleteName(testDeviceId, null);\n\t\t\n\t\tlogger.debug(\"@@@@@@@@@@@@@@@@@@@ Try to get the name of a device\");\n\t\tname = deviceNameTable.getName(testDeviceId, null);\n\t\tlogger.debug(\" @@@@@@@@@@@@ Device name get: \"+name);\n\t\t\n\t\tlogger.debug(\"@@@@@@@@@@@@@@@@@@@ Try to get the name of a device for a non existing user\");\n\t\tname = deviceNameTable.getName(testDeviceId, \"plop\");\n\t\tlogger.debug(\" @@@@@@@@@@@@ Device name get: \"+name);\n\t\t\n\t}", "private void initHardware(){\n }", "@BeforeMethod\n\tpublic void setup() throws MalformedURLException{\n\t\t\n\t\tbaseObj.mobileDriver();\n\t\t\n\t}", "@BeforeMethod\n public void beforeTest() throws MalformedURLException {\n DesiredCapabilities caps = new DesiredCapabilities();\n caps.setCapability(\"deviceId\", \"2fb5cf35\");\n caps.setCapability(\"deviceName\", \"OnePlus 6\");\n caps.setCapability(\"platformName\", \"Android\");\n caps.setCapability(\"appPackage\", \"com.oneplus.calculator\");\n caps.setCapability(\"appActivity\", \"Calculator\");\n caps.setCapability(\"noReset\", true);\n\n // Initialize driver\n URL appServer = new URL(\"http://0.0.0.0:4723/wd/hub\");\n driver = new AndroidDriver<MobileElement>(appServer, caps);\n }", "public void setDriver(String driver) {\r\n this.driver = driver;\r\n }", "public abstract String getDriver();", "private native void CreateJNIObj(String device);", "private void setupPhisicalDevice() {\n try (MemoryStack memstack = MemoryStack.stackPush();) {\n IntBuffer buffer = buffer = memstack.mallocInt(1);\n\n\n long result = vkEnumeratePhysicalDevices(instance, buffer, null);\n int count = buffer.get();\n if (count == 0) {\n throw new RuntimeException(\"No physical support for vulcan available!\");\n }\n\n System.out.println(count);\n buffer = memstack.mallocInt(1);\n buffer.put(buffer.position(), 1);\n PointerBuffer deviceBuffer = memstack.mallocPointer(1);\n vkEnumeratePhysicalDevices(instance, buffer, deviceBuffer);\n //TODO: select the best one\n physicalDevice = new VkPhysicalDevice(deviceBuffer.get(), instance);\n }\n }", "public void startDevice() throws DriverException {\n try {\n final Device pciBusDevice = getDevice();\n final ResourceManager rm = InitialNaming.lookup(ResourceManager.NAME);\n // Claim the resources\n pciConfigIO = claimPorts(rm, pciBusDevice);\n // Register the API's\n pciBusDevice.registerAPI(PCIBusAPI.class, this);\n pciBusDevice.registerAPI(DeviceInfoAPI.class, this);\n // Find the PCI devices\n devices = probeDevices();\n // Start the PCI devices\n WorkUtils.add(new Work(\"Starting PCI devices\") {\n\n public void execute() {\n startDevices(devices);\n }\n });\n } catch (ResourceNotFreeException ex) {\n throw new DriverException(\"Cannot claim IO ports\", ex);\n } catch (DriverException ex) {\n throw new DriverException(\"Driver exception during register\", ex);\n } catch (NameNotFoundException ex) {\n throw new DriverException(\"Cannot find resource or device manager\",\n ex);\n }\n }", "RemoteWebDriver getDriver(String appName, String platformName) {\n\t\tDesiredCapabilities androidDcap = new DesiredCapabilities();\n\t\tandroidDcap.setCapability(MobileCapabilityType.AUTOMATION_NAME, \"UIAutomator2\");\n\t\tandroidDcap.setCapability(MobileCapabilityType.PLATFORM_NAME, platformName);\n\t\t//androidDcap.setCapability(AndroidMobileCapabilityType.AUTO_GRANT_PERMISSIONS, true);\n\t\tandroidDcap.setCapability(MobileCapabilityType.NO_RESET, true);\n\t\tandroidDcap.setCapability(MobileCapabilityType.FULL_RESET, false);\n\t\tandroidDcap.setCapability(AndroidMobileCapabilityType.NO_SIGN, true);\n\t\tandroidDcap.setCapability(AndroidMobileCapabilityType.APP_WAIT_DURATION, 120);\n\t\tandroidDcap.setCapability(\"newCommandTimeout\", 1500);\n\t\tandroidDcap.setCapability(\"app\", System.getProperty(\"user.dir\") +\"\\\\apk\\\\\"+appName+\".apk\");\n\t\tandroidDcap.setCapability(\"autoGrantPermissions\", true);\n\t\tandroidDcap.setCapability(\"appPackage\", PropertyHelper.getProperties(appName+\"_PACKAGE\"));\n\t\tandroidDcap.setCapability(\"appActivity\", PropertyHelper.getProperties(appName+\"_ACTIVITY\"));\n\t\tandroidDcap.setCapability(\"deviceName\", \"Android\");\n\t\t\n\t\ttry {\n\t\t\tif (System.getProperty(\"location\").equalsIgnoreCase(\"local\")) {\n\t\t\t\tdriver = new AndroidDriver<>(new URL(\"http://127.0.0.1:4651/wd/hub\"), androidDcap);\n\t\t\t\tlogger.info(\"Session ID of Android: \" + driver.getSessionId());\n\t\t\t} else if (System.getProperty(\"location\").equalsIgnoreCase(\"remote\")) {\n\t\t\t\tdriver = new AndroidDriver<>(new URL(PropertyHelper.getProperties(\"REMOTE_HUB_URL\")), androidDcap);\n\t\t\t\tlogger.info(\"Session ID of Android: \" + driver.getSessionId());\n\t\t\t}\n\t\t} catch (WebDriverException e) {\n\t\t\tlogger.error(\"Driver instantiating failed or app is not installed\", e);\n\t\t} catch (MalformedURLException e) {\n\t\t\tlogger.error(e);\n\t\t}\n\t\tdriver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);\n\t\tDriverFactory.getDriverPool().put(appName, driver);\n\t\treturn driver;\n\t}", "public BaseJourney() {\n this.driver = DriverWrapper.getDriver();\n this.initElements();\n // load properties here\n this.isIOS = driver instanceof IOSDriver;\n this.isAndroid = driver instanceof AndroidDriver;\n }", "@BeforeTest\n\t\tpublic void setUp() throws MalformedURLException {\n\t\t\t DesiredCapabilities capabilities = new DesiredCapabilities();\n\t\t\t // Set android deviceName desired capability. Set your device name.\n\t\t\t capabilities.setCapability(\"deviceName\", \"Custom Phone - 4.2.2 API 17 - 768*1280\");\n\t\t\t // Set BROWSER_NAME desired capability. It's Android in our case here.\n\t\t\t capabilities.setCapability(\"browserName\", \"Android\");\n\n\t\t\t // Set android VERSION desired capability. Set your mobile device's OS version.\n\t\t\t capabilities.setCapability(\"platformVersion\", \"4.2.2\");\n\n\t\t\t // Set android platformName desired capability. It's Android in our case here.\n\t\t\t capabilities.setCapability(\"platformName\", \"Android\");\n\t\t\t // Created object of RemoteWebDriver will all set capabilities.\n\t\t\t // Set appium server address and port number in URL string.\n\t\t\t // It will launch calculator app in android device.\n\t\t\t // capabilities.setCapability(\"unicodeKeyboard\", true);\n\t\t\t // capabilities.setCapability(\"resetKeyboard\", true);\n\t\t\t driver = new RemoteWebDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\t\t\t driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);\n\t\t\t }", "@Override\n protected void startDriver(IOSCapabilities caps) {\n }", "private PerfectoDriverFactory() {\n\n\t}", "@Before\n public void setUp() throws Exception {\n\n DesiredCapabilities capabilities = new DesiredCapabilities();\n capabilities.setCapability(\"deviceName\", \"Google Nexus 5\");\n capabilities.setCapability(\"platformVersion\", \"4.4.4\");\n capabilities.setCapability(\"udid\", \"192.168.27.101:5555\");\n capabilities.setCapability(\"app\", \"D:\\\\Projects\\\\Zappy\\\\ZappyBuilds\\\\app-release.apk\");\n// capabilities.setCapability(\"appPackage\", \"com.example.android.contactmanager\");//packageName\n capabilities.setCapability(\"appActivity\", \"com.compareking.zappy.ui.activity.UnauthorizedActivity\"); //activi\n driver = new AndroidDriver<>(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n }", "@Test\n\tpublic void driverCreatePositiveTest() {\n\t\tDriver driver;\n\t\tUserAccount ua;\n\t\tfinal Authority authority;\n\t\tCollection<Authority> authorities;\n\n\t\tdriver = this.driverService.create();\n\t\tua = this.userAccountService.create();\n\t\tauthority = new Authority();\n\t\tauthority.setAuthority(Authority.DRIVER);\n\t\tauthorities = new ArrayList<Authority>();\n\t\tauthorities.add(authority);\n\n\t\tdriver.setName(\"Name\");\n\t\tdriver.setSurname(\"Surname\");\n\t\tdriver.setCountry(\"Country\");\n\t\tdriver.setCity(\"City\");\n\t\tdriver.setBankAccountNumber(\"ES4963116815932885489285\");\n\t\tdriver.setPhone(\"698456847\");\n\t\tdriver.setChilds(true);\n\t\tdriver.setMusic(true);\n\t\tdriver.setSmoke(false);\n\t\tdriver.setPets(true);\n\n\t\tua.setUsername(\"newdriver@gmail.com\");\n\t\tua.setPassword(\"newdriver\");\n\t\tua.setAuthorities(authorities);\n\n\t\tdriver.setUserAccount(ua);\n\n\t\tthis.driverService.save(driver);\n\t\tthis.driverService.flush();\n\t}", "public interface PeripheralSoftwareDriverInterface extends DriverBaseDataEventListener {\r\n\r\n /**\r\n * Is set in the BaseDriver, you can overwrite it, but for debugging\r\n * purposes not handy\r\n */\r\n public final static String DriverBaseName = \"driver:port\";\r\n\r\n /**\r\n * Returns the driver DB id.\r\n * @return \r\n */\r\n public int getId();\r\n \r\n /**\r\n * Starts the driver and runs the thread\r\n */\r\n public void startDriver();\r\n\r\n /**\r\n * Stops the driver and the thread the driver is running in\r\n */\r\n public void stopDriver();\r\n\r\n /**\r\n * Returns the Hardware driver which belongs to the given running software\r\n * driver.\r\n *\r\n * @return\r\n */\r\n public Peripheral getHardwareDriverFromSoftwareDriver();\r\n\r\n \r\n /**\r\n * Returns the hardware driver.\r\n * @return \r\n */\r\n public PeripheralHardwareDriverInterface getHardwareDriver();\r\n \r\n /**\r\n * Returns the amount of active devices attached to this driver.\r\n *\r\n * @return\r\n */\r\n public int getRunningDevicesCount();\r\n\r\n /**\r\n * Returns a list of running devices whom belong to this driver.\r\n *\r\n * @return\r\n */\r\n public List<Device> getRunningDevices();\r\n\r\n /**\r\n * Send a batch of commands through the proxy. This method is preferred when\r\n * sending multiple commands at once with a build in delay. this function\r\n * should create a batch with a default name (anonymous)\r\n *\r\n * @param batchData Strings with commands\r\n * @see #runBatch()\r\n * @see #runBatch(java.lang.String)\r\n */\r\n public void addBatch(List<Map<String, String>> batchData);\r\n\r\n /**\r\n * Send a batch of commands through the proxy. This method is preferred when\r\n * sending multiple commands at once with a build in delay.\r\n *\r\n * @param batchData Strings with commands\r\n * @param batchName String with the name of the batch to use later on with\r\n * runBatch()\r\n * @see #runBatch()\r\n * @see #runBatch(java.lang.String)\r\n */\r\n public void addBatch(List<Map<String, String>> batchData, String batchName);\r\n\r\n /**\r\n * Runs the batch previously set with the anonymous addBatch\r\n */\r\n public void runBatch();\r\n\r\n /**\r\n * Runs the batch previously set with addBatch with a batchName\r\n *\r\n * @param batchName Name of the batch to run\r\n */\r\n public void runBatch(String batchName);\r\n\r\n /**\r\n * Sends the data to the hardware itself\r\n *\r\n * @param data The data to send\r\n * @param prefix When having multiple devices supported by the hardware a\r\n * prefix can distinct the device in your hardware\r\n * @return result of the send command\r\n * @throws java.io.IOException\r\n * @Obsolete Use writeBytes.\r\n */\r\n public boolean sendData(String data, String prefix) throws IOException;\r\n\r\n /**\r\n * Sends the data to the hardware itself\r\n *\r\n * @param data The data to send\r\n * @return the result of the command\r\n * @throws java.io.IOException\r\n * @Obsolete Use WriteBytes.\r\n */\r\n public boolean sendData(String data) throws IOException;\r\n\r\n /**\r\n * Retrieves the name of the class.\r\n *\r\n * @return the name of the class\r\n */\r\n public String getName();\r\n\r\n /**\r\n * For adding an hardware driver.\r\n *\r\n * @param l\r\n */\r\n public void setPeripheralEventListener(PeripheralHardwareDriverInterface l);\r\n\r\n /**\r\n * for removing an hardware driver.\r\n *\r\n * @param l\r\n */\r\n public void removePeripheralEventListener(PeripheralHardwareDriverInterface l);\r\n\r\n /**\r\n * Handles data received from the hardware driver to be used by overwriting\r\n * classes.\r\n *\r\n * @param oEvent\r\n */\r\n @Override\r\n public void driverBaseDataReceived(PeripheralHardwareDataEvent oEvent);\r\n\r\n /**\r\n * Driver proxy for hardware data.\r\n *\r\n * @param oEvent\r\n */\r\n public void driverBaseDataReceivedProxy(PeripheralHardwareDataEvent oEvent);\r\n\r\n /**\r\n * Returns the package name of the driver as used in the database.\r\n *\r\n * @return The package name of this class\r\n */\r\n public String getPackageName();\r\n\r\n /**\r\n * Adds a device to the listers for whom data can exist.\r\n *\r\n * @param device\r\n */\r\n public void addDeviceListener(DeviceDriverListener device);\r\n\r\n /**\r\n * Removes a device from the listeners list.\r\n *\r\n * @param device\r\n */\r\n public void removeDeviceListener(DeviceDriverListener device);\r\n\r\n /**\r\n * Handle the data coming from a device driver to dispatch to the hardware\r\n * driver. With this function you can do stuff with the data. For example if\r\n * needed change from string to byte array?\r\n *\r\n * @param device\r\n * @param group\r\n * @param set\r\n * @param deviceData\r\n * @return A string which represents a result, human readable please.\r\n * @throws java.io.IOException\r\n */\r\n public boolean handleDeviceData(Device device, String group, String set, String deviceData) throws IOException;\r\n\r\n /**\r\n * Handles data coming from a device as is in the request!\r\n * @param device\r\n * @param request\r\n * @return\r\n * @throws IOException \r\n */\r\n public boolean handleDeviceData(Device device, DeviceCommandRequest request) throws IOException;\r\n \r\n /**\r\n * Sets the driver DB id.\r\n * @param driverDBId \r\n */\r\n public void setId(int driverDBId);\r\n \r\n /**\r\n * Sets the named id\r\n * @param dbNameId\r\n */\r\n public void setNamedId(String dbNameId);\r\n \r\n /**\r\n * Gets the named id\r\n * @return \r\n */\r\n public String getNamedId();\r\n \r\n /**\r\n * Returns if the driver supports custom devices.\r\n * @return \r\n */\r\n public boolean hasCustom();\r\n \r\n /**\r\n * Set if a driver has custom devices.\r\n * @param hasCustom\r\n * @return \r\n */\r\n public void setHasCustom(boolean hasCustom);\r\n \r\n /**\r\n * Returns the software driver id.\r\n *\r\n * @param softwareId\r\n */\r\n public void setSoftwareDriverId(String softwareId);\r\n\r\n /**\r\n * Returns the version set in the driver.\r\n *\r\n * @param softwareIdVersion\r\n */\r\n public void setSoftwareDriverVersion(String softwareIdVersion);\r\n\r\n /**\r\n * Returns the software driver id.\r\n *\r\n * @return\r\n */\r\n public String getSoftwareDriverId();\r\n\r\n /**\r\n * Returns the version set in the driver.\r\n *\r\n * @return\r\n */\r\n public String getSoftwareDriverVersion();\r\n\r\n /**\r\n * Returns true if there is a web presentation present.\r\n *\r\n * @return\r\n */\r\n public boolean hasPresentation();\r\n\r\n /**\r\n * Sets a web presentation;\r\n *\r\n * @param pres\r\n */\r\n public void addWebPresentationGroup(WebPresentationGroup pres);\r\n\r\n /**\r\n * Returns the web presentation.\r\n *\r\n * @return\r\n */\r\n public List<WebPresentationGroup> getWebPresentationGroups();\r\n\r\n /**\r\n * Sets the friendlyname.\r\n * @param name \r\n */\r\n public void setFriendlyName(String name);\r\n \r\n /**\r\n * Returns the friendlyname.\r\n * @return \r\n */\r\n public String getFriendlyName();\r\n \r\n /**\r\n * Sets a link with the device service.\r\n * @param deviceServiceLink \r\n */\r\n public void setDeviceServiceLink(PeripheralDriverDeviceMutationInterface deviceServiceLink);\r\n \r\n /**\r\n * Removes a device service link.\r\n */\r\n public void removeDeviceServiceLink();\r\n \r\n /**\r\n * Indicator to let know a device is loaded.\r\n * @param device \r\n */\r\n public void deviceLoaded(Device device);\r\n \r\n}", "public HospitalsPage(DriverType driverType) {\n\n switch (driverType) {\n case ANDROID:\n appiumDriver = DeviceDriver.getAndroidDriver();\n break;\n case IOS:\n appiumDriver = DeviceDriver.getIosDriver();\n break;\n case ANDROID_SAMSUNG_S105G:\n appiumDriver = DeviceDriver.getSamsungS105GDriver();\n break;\n case ANDROID_GOOGLE_PXL4:\n appiumDriver = DeviceDriver.getPixel4ADriver();\n break;\n }\n }", "public static void setup(String browser) throws Exception{\n if(browser.equalsIgnoreCase(\"firefox\")){\n \tFile pathToBinary = new File(\"C:\\\\Program Files (x86)\\\\Mozilla Firefox 41\\\\firefox.exe\");\n \tFirefoxBinary binary = new FirefoxBinary(pathToBinary);\n \tFirefoxDriver driver = new FirefoxDriver(binary, new FirefoxProfile());\n \t\n \t//System.setProperty(\"webdriver.firefox.driver\",\"C:\\\\Program Files (x86)\\\\Mozilla Firefox\\\\firefox.exe\");\n \t/*DesiredCapabilities capabilies = DesiredCapabilities.firefox();\t\t\t\n capabilies.getBrowserName();\n capabilies.getVersion();*/\n \t\t\t\n \t//create Firefox instance\t \n //driver = new FirefoxDriver(); \n System.out.println(\"Browser Used: \"+browser);\n }\t \n //Check if parameter passed is 'Chrome'\n // https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/chrome/ChromeOptions.html\n // http://www.programcreek.com/java-api-examples/index.php?api=org.openqa.selenium.remote.DesiredCapabilities (Singleton)\n else if(browser.equalsIgnoreCase(\"chrome\")){\t \t \n System.setProperty(\"webdriver.chrome.driver\",\"C:\\\\Selenium\\\\Assets\\\\chromedriver.exe\");\n ChromeOptions opt = new ChromeOptions();\n opt.setBinary(\"C:\\\\Selenium\\\\Assets\\\\chromedriver.exe\");\n opt.setExperimentalOption(\"Browser\", \"Chrome\");\n opt.getExperimentalOption(\"version\");\n \n// DesiredCapabilities capabilies = DesiredCapabilities.chrome();\n// capabilies.setBrowserName(\"chrome\");\n// capabilies.setPlatform(Platform.WINDOWS);\n// capabilies.setVersion(\"38\");\n// DesiredCapabilities capabilities = new DesiredCapabilities();\n \n //Create Chrome instance\n driver = new ChromeDriver(opt);\t \n }\n \n //Check if parameter passed is 'Safari'\t\n else if(browser.equalsIgnoreCase(\"safari\")){\t \t \n \tSystem.setProperty(\"webdriver.safari.driver\",\"C:/safaridriver.exe\");\n \t\n \t//System.setProperty(\"webdriver.safari.noinstall\", \"true\");\n \tdriver = new SafariDriver();\n \t\n /*\tSafariOptions options = new SafariOptions();\n \tSafariDriver driver = new SafariDriver(options);\n \tDesiredCapabilities capabilities = DesiredCapabilities.safari();\n \tcapabilities.setCapability(SafariOptions.CAPABILITY, options);*/\n }\n \n //Check if parameter passed is 'IE'\t \n else if(browser.equalsIgnoreCase(\"ie\")){\n \t//String IE32 = \"C:\\\\Selenium\\\\Assets\\\\IEDriverServer_32.exe\"; //IE 32 bit\n\t\t\tString IE64 = \"C:\\\\Selenium\\\\Assets\\\\IEDriverServer_64.exe\"; //IE 64 bit\n \tSystem.setProperty(\"webdriver.ie.driver\",IE64);\n \t\n /* \tDesiredCapabilities capabilies = DesiredCapabilities.internetExplorer();\n \tcapabilies.setBrowserName(\"ie\");\n capabilies.getBrowserName();\n capabilies.getPlatform();\n capabilies.getVersion();*/\n \n \t//Create IE instance\n \tdriver = new InternetExplorerDriver();\n }\t \n else{\t \n //If no browser passed throw exception\t \n throw new Exception(\"Browser is not correct\");\t \n }\t \n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\t\t\n\t}", "public static void main(String args[]) throws MalformedURLException, InterruptedException {\n\n\tDesiredCapabilities caps = new DesiredCapabilities();\n\t//caps.setCapability(\"browserName\", \"\");\n\tcaps.setCapability(\"platform\", \"iOS\");\n\tcaps.setCapability(\"deviceName\", \"iPhone 6\");\n\tcaps.setCapability(\"platformVersion\", \"9.0\");\n\tcaps.setCapability(\"waitForAppScript\", \"$.delay(10000); $.acceptAlert();\");\n\t//caps.setCapability(\"autoWebview\", \"true\");\n\t//caps.setCapability(\"appPackage\", \"com.apptivateme.next.ct\");\n\t//caps.setCapability(\"appActivity\", \"com.tribune.universalnews.MainActivity\");\n\tcaps.setCapability(\"appiumVersion\", \"1.4.14\");\n\tcaps.setCapability(\"app\", \"sauce-storage:CT_iOS.zip\");\n\t\n\tURL sauceUrl = new URL(\"http://shnakeygarg:66c91399-8cfb-46ca-a2da-f09c2ce5f170@ondemand.saucelabs.com:80/wd/hub\");\n\n\tIOSDriver driver = new IOSDriver(sauceUrl, caps);\n\n\t// driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\tWebDriverWait waitvar = new WebDriverWait(driver,90);\n\n\tThread.sleep(5000);\n\n\twaitvar.until(ExpectedConditions.elementToBeClickable(driver.findElementByIosUIAutomation(\".buttons()[0]\")));\n\tdriver.findElementByIosUIAutomation(\".buttons()[0]\").click();\n\twaitvar.until(ExpectedConditions.elementToBeClickable(driver.findElementByIosUIAutomation(\".buttons()[0]\")));\n\tdriver.findElementByIosUIAutomation(\".buttons()[0]\").click();\n\twaitvar.until(ExpectedConditions.elementToBeClickable(driver.findElementByIosUIAutomation(\".buttons()[0]\")));\n\tdriver.findElementByIosUIAutomation(\".buttons()[0]\").click();\n\twaitvar.until(ExpectedConditions.elementToBeClickable(driver.findElementByIosUIAutomation(\".buttons()[0]\")));\n\tdriver.findElementByIosUIAutomation(\".buttons()[0]\").click();\n\n\tfinal Date date1 = new Date();\n System.out.println(\"findElementByIosUIAutomation\" );\n \n //UIAApplication[1]/UIAWindow[1]/UIACollectionView[1]/UIACollectionCell[2]/UIATableView[1]/UIATableCell[2]\n waitvar.until(ExpectedConditions.elementToBeClickable(MobileBy.IosUIAutomation(\".collectionViews()[0].cells()[1].tableViews()[0].cells()[1].withPredicate(\\\"ALL staticTexts.isVisible == TRUE\\\")\")));\n //waitvar.until(ExpectedConditions.elementToBeClickable(driver.findElementByIosUIAutomation(\".collectionViews()[0].cells()[1].tableViews()[0].cells()[1].withPredicate(\\\"ALL staticTexts.isVisible == TRUE\\\")\")));\n WebElement firstArtile = driver.findElementByIosUIAutomation(\".collectionViews()[0].cells()[1].tableViews()[0].cells()[1].withPredicate(\\\"ALL staticTexts.isVisible == TRUE\\\")\");\n firstArtile.click();\n System.out.println(\"clicked element1\");\n\n final Date date2 = new Date();\n\n //UIAApplication[1]/UIAWindow[1]/UIANavigationBar[1]/UIAButton[1]\n waitvar.until(ExpectedConditions.elementToBeClickable(driver.findElementByIosUIAutomation(\".navigationBars()[0].buttons()[0]\")));\n\tdriver.findElementByIosUIAutomation(\".navigationBars()[0].buttons()[0]\").click();\n final Date date3 = new Date();\n/*\n System.out.println(\"\\n\\n\\n\\nxpath\\n\\n\\n\\n\");\n\n waitvar.until(ExpectedConditions.elementToBeClickable(By.xpath(\"//UIAApplication[1]/UIAWindow[1]/UIACollectionView[1]/UIACollectionCell[2]/UIATableView[1]/UIATableCell[2]\")));\n driver.findElement(By.xpath(\"//UIAApplication[1]/UIAWindow[1]/UIACollectionView[1]/UIACollectionCell[2]/UIATableView[1]/UIATableCell[2]\")).click();\n\n final Date date4 = new Date();\n\n waitvar.until(ExpectedConditions.elementToBeClickable(driver.findElementByName(\"header back\")));\n\n driver.findElement(By.name(\"header back\")).click();\n */\n final Date date5 = new Date();\n System.out.println(\"IOS Automator :\" + (date2.getTime() - date1.getTime()));\n System.out.println(\"Back :\" + (date3.getTime() - date2.getTime()));\n\n //System.out.println(\"XPath :\" + (date4.getTime() - date3.getTime()));\n //System.out.println(\"Back :\" + (date5.getTime() - date4.getTime()));\n\tThread.sleep(5000);\n\tdriver.quit();\n\tSystem.out.println(\"done\");\n }", "private void setup() {\n if (config.getProperty(\"browser\").equals(\"chrome\")) {\n System.setProperty(\"webdriver.chrome.driver\", chromeDriverPath);\n driver = new ChromeDriver();\n } else if (config.getProperty(\"browser\").equals(\"firefox\")) {\n System.setProperty(\"webdriver.gecko.driver\", geckoDriverPath);\n driver = new FirefoxDriver();\n }\n\n event_driver = new EventFiringWebDriver(driver);\n // Now create object of EventListerHandler to register it with EventFiringWebDriver\n eventListener = new WebEventListener();\n event_driver.register(eventListener);\n driver = event_driver;\n\n wait = new WebDriverWait(driver, 30);\n }", "@Before\n public void setUp() throws MalformedURLException {\n dc.setCapability(MobileCapabilityType.UDID, Main.devicesArrayList.get(Integer.parseInt(Thread.currentThread().getName())).getSerialNumber());\n\n if(Main.cloud){\n dc.setCapability(\"accessKey\", Main.accessKey);\n driver = new AndroidDriver<>(new URL(Main.ServerIP), dc);\n }\n else {\n driver = new AndroidDriver<>(new URL(\"http://localhost:4723/wd/hub\"), dc);\n }\n\n driver.setLogLevel(Level.INFO);\n client = new SeeTestClient(driver);\n }", "public DriverForCreate build() {\r\n return driverForCreate;\r\n }", "@SuppressWarnings(\"rawtypes\")\r\n\t@BeforeMethod\r\n\t public void setUp() throws MalformedURLException {\n\t\tDesiredCapabilities capabilities = new DesiredCapabilities();\r\n\t\tcapabilities.setCapability(\"deviceName\", \"ZX1D63SFXH\");\r\n\t\tcapabilities.setCapability(\"platformName\", \"Android\");\r\n\t\t//capabilities.setCapability(\"app\", targetApp.getAbsolutePath());\r\n\t\t//capabilities.setCapability(\"fastReset\", \"true\");\r\n\t\t//capabilities.setCapability(\"fullReset\", \"true\");\r\n\t\tcapabilities.setCapability(\"appPackage\", \"com.testleaf.leaforg\");\r\n\t\tcapabilities.setCapability(\"appActivity\", \"com.testleaf.leaforg.MainActivity\");\r\n\t\t\r\n\t\tdriver = new AndroidDriver(new URL(\"http://0.0.0.0:4723/wd/hub\"), capabilities);\r\n\t\tdriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\r\n\t\t\r\n\t\t\r\n\t}", "@Test(groups={\"ut\"})\r\n\tpublic void testCreateCapabilitiesWithUserDefined() {\r\n\t\tSeleniumTestsContext context = new SeleniumTestsContext(SeleniumTestsContextManager.getThreadContext());\r\n\t\tcontext.setBrowser(BrowserType.CHROME.toString());\r\n\t\tcontext.setMobilePlatformVersion(\"8.0\");\r\n\t\tcontext.setPlatform(\"android\");\r\n\t\tcontext.setDeviceName(\"Samsung Galasy S8\");\r\n\t\tcontext.setApp(\"\");\r\n\t\tcontext.setAppiumCapabilities(\"key1=value1;key2=value2\");\r\n\t\t\r\n\t\tDriverConfig config = new DriverConfig(context);\r\n\t\t\r\n\t\t\r\n\t\tAndroidCapabilitiesFactory capaFactory = new AndroidCapabilitiesFactory(config);\r\n\t\tMutableCapabilities capa = capaFactory.createCapabilities();\r\n\t\t\r\n\t\tAssert.assertEquals(capa.getCapability(\"key1\"), \"value1\");\r\n\t\tAssert.assertEquals(capa.getCapability(\"key2\"), \"value2\");\r\n\r\n\t}", "private void beginSetup() {\n try {\n if (dbType.equals(\"mysql\")) {\n Class.forName(\"gwe.sql.gweMysqlDriver\");\n }\n else if (dbType.equals(\"postgresql\")) {\n Class.forName(\"org.postgresql.Driver\");\n }\n } catch (ClassNotFoundException cnfe) {\n System.out.println(\"setup constructor ClassNotFound: \"+cnfe);\n System.out.println(\"Could not load the mysql driver: please check your classpath\");\n System.exit(-1);\n }\n\n try {\n if (!tableExists(DEFAULT_DB_CONFIG_TABLE)) {\n createConfigTable(DEFAULT_DB_CONFIG_TABLE);\n }\n } catch (SQLException sqle) {\n System.out.println(\"setup beginSetup SQLException: \"+sqle);\n System.out.println(\"Trouble interacting with vizConfig database table\");\n System.exit(-2);\n }\n prepareFrame();\n }", "public VMWareDriver() {\n }", "public void initDevice() {\r\n\t\t\r\n\t}", "private Device buildDevice() {\n Device device = Device.builder()\n .text(Narrative.builder().div(Xhtml.of(\"<div xmlns=\\\"http://www.w3.org/1999/xhtml\\\">Generated</div>\")).status(NarrativeStatus.GENERATED).build())\n .meta(Meta.builder()\n .profile(Canonical.of(\"http://ibm.com/fhir/StructureDefinition/test-device|0.1.0\"))\n .build())\n .statusReason(CodeableConcept.builder().coding(Coding.builder().system(Uri.of(\"http://terminology.hl7.org/CodeSystem/device-status-reason\")).code(Code.of(\"online\")).build()).build())\n .specialization(Specialization.builder()\n .systemType(CodeableConcept.builder().coding(Coding.builder().system(Uri.of(ValidationSupport.BCP_47_URN)).code(Code.of(ENGLISH_US)).build()).build()).build())\n .extension(Extension.builder().url(\"http://ibm.com/fhir/StructureDefinition/test-language-primary-extension\")\n .value(CodeableConcept.builder().coding(Coding.builder().system(Uri.of(ValidationSupport.BCP_47_URN)).code(Code.of(ENGLISH_US)).build()).build()).build(),\n Extension.builder().url(\"http://ibm.com/fhir/StructureDefinition/test-language-secondary-extension\")\n .value(Coding.builder().system(Uri.of(ValidationSupport.BCP_47_URN)).code(Code.of(ENGLISH_US)).build()).build(),\n Extension.builder().url(\"http://ibm.com/fhir/StructureDefinition/test-language-tertiary-extension\")\n .value(Code.of(ENGLISH_US)).build())\n .build();\n return device;\n }", "@BeforeTest\n\tpublic void setUp() throws InterruptedException, IOException {\n\t\tAppiumServer appiumServer = new AppiumServer();\n\t\t\n\t\tint port = 4723;\n\t\tif(!appiumServer.checkIfServerIsRunnning(port)) {\n\t\t\tSystem.out.println(\"Port No.: \" + port + \" is available.\");\n\n\t\t\tappiumServer.startServer();\n\t\t\t\n\t\t} else {\n\t\t\tSystem.out.println(\"Appium Server already running on Port - \" + port);\n\t\t}\n\t\t\n\t\tFile appPath = new File(\"./app/eBay.apk\");\n\t\tDesiredCapabilities cap = new DesiredCapabilities();\n\n\t\tcap.setCapability(MobileCapabilityType.APP, appPath.getAbsolutePath());\n\t\tcap.setCapability(MobileCapabilityType.DEVICE_NAME, \"MI\");\n\t\tcap.setCapability(MobileCapabilityType.PLATFORM_NAME, \"Android\");\n//\t\tcap.setCapability(MobileCapabilityType.PLATFORM_VERSION,\"9\");\n\t\t\n\t\tcap.setCapability(\"unicodeKeyboard\", \"true\"); \n\t\tcap.setCapability(\"resetKeyboard\", \"true\");\n\t\t\n\t\tcap.setCapability(MobileCapabilityType.PLATFORM_VERSION, DeviceVersionFinder.getDeviceVersion());\n\t\tcap.setCapability(MobileCapabilityType.AUTOMATION_NAME, \"uiautomator2\");\n\t\tcap.setCapability(\"--session-override\", false);\n\t\t\n\t\tcap.setCapability(\"setWebContentsDebuggingEnabled\", true);\n\t\t\n\t\tdriver = new AndroidDriver<MobileElement>(new URL(\"http://0.0.0.0:4723/wd/hub\"), cap);\n\n\t\tdriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n\t\tPOM_LaunchHomeScreen homeScreen = new POM_LaunchHomeScreen(driver);\n\n\t\tif(homeScreen.btn_homeSignIn.isDisplayed()) {\n\t\t\t\n\t\t\tSystem.out.println(\"App has successfully loaded within the time provided!\");\n\t\t\t\n\t\t}\n\n\t\t\n//\t\tMobileElement element = driver.findElement(By.id(\"recycler_view_main\"));\n\t\t\n//\t\tTouchActions action = new TouchAction();\n//\t\taction.scroll(element, 10, 100);\n//\t\taction.perform();\n\t\t\n\t\t\n\n\t\tSystem.out.println(\"Setup successful!\");\n\n\n\t}", "@BeforeTest\n\t public void setup() throws MalformedURLException {\n\t DesiredCapabilities caps = new DesiredCapabilities();\n\t caps.setCapability(\"deviceName\", \"Pixel 4 API 28\");\n\t caps.setCapability(\"platformName\", \"Android\");\n\t caps.setCapability(\"appPackage\", \"com.google.android.apps.tasks\");\n\t caps.setCapability(\"appActivity\", \".ui.TaskListsActivity\");\n\t caps.setCapability(\"noReset\", true);\n\t \n\t // Instantiate Appium Driver\n\t driver = new AndroidDriver<MobileElement>(new URL(\"http://127.0.0.1:4723/wd/hub\"), caps);\n\t wait = new WebDriverWait(driver, 10);\n\t }", "private void setUpController(){\n\n SessionController.getInstance().addCommand(new PartyCreateCommand(\"PARTY_CREATE\"));\n SessionController.getInstance().addCommand(new PartyDetailsRetrieveCommand(\"PARTY_DETAILS_RETRIEVE\"));\n SessionController.getInstance().addCommand(new PartyInvitesRetrieveCommand(\"PARTY_INVITES_RETRIEVE\"));\n SessionController.getInstance().addCommand(new PartyLeaveCommand(\"PARTY_LEAVE\"));\n SessionController.getInstance().addCommand(new PartyMemberRemoveCommand(\"PARTY_MEMBER_REMOVE\"));\n SessionController.getInstance().addCommand(new PlayerCreateCommand(\"PLAYER_CREATE\"));\n SessionController.getInstance().addCommand(new PlayerInvitesRetrieveCommand(\"PLAYER_INVITES_RETRIEVE\"));\n SessionController.getInstance().addCommand(new PlayerLogOutCommand(\"PLAYER_LOG_OUT\"));\n }", "public void initialization() {\n\t\t\t\n\t\t if(prop.getProperty(\"browser\").equals(\"chrome\")) {\n\t\t \t\n\t\t \tWebDriverManager.chromedriver().setup();\n\t\t\t\t\n\t\t\t\t driver=new ChromeDriver();\n\t\t\t\t\n\t\t } else if(prop.getProperty(\"browser\").equals(\"firefox\")) {\n\t\t \t\n\t\t \tWebDriverManager.firefoxdriver().setup();\n\t\t\t\t\n\t\t\t\t driver=new FirefoxDriver();\n\t\t\t\t \n\t\t } else if(prop.getProperty(\"browser\").equals(\"edge\")) {\n\t\t \tWebDriverManager.edgedriver().setup();\n\t\t\t\t\n\t\t\t\t driver=new EdgeDriver();\n\t\t \t\n\t\t }\n\t\t\t\n\t }", "@Before\n public void setUp() throws MalformedURLException {\n DesiredCapabilities cap = new DesiredCapabilities();\n cap.setCapability(\"devicename\",\"MyTestDevice\");\n\n //It works with java-client-4.0.0.jar :)\n drive = new AndroidDriver<WebElement>(new URL(\"http://127.0.0.1:4723/wd/hub\"), cap);\n //Reset the cache!\n drive.resetApp();\n\n }", "@BeforeClass\n @Parameters({ \"browser\", \"url\" })\n public void startDriver(@Optional(\"chrome\") String WindowBrowser, @Optional(\"http://computer-database.herokuapp.com/computers\") String URL) {\n\n final String os = System.getProperty(\"os.name\");\n userDirectory = System.getProperty(\"user.dir\");\n Log.info(\"Starting to intialise driver\");\n Log.info(\"OS environment: \" + os);\n Log.info(\"Browser: \" + WindowBrowser);\n if (WindowBrowser.equalsIgnoreCase(BROWSERS.FIREFOX.getBrowserName())) {\n final StringBuilder geckoDriverPath = new StringBuilder();\n geckoDriverPath.append(userDirectory + File.separator + \"src\" + File.separator + \"test\" + File.separator + \"resources\");\n if (os.contains(OS.MAC.getOsName())) {\n geckoDriverPath.append(File.separator + \"mac\" + File.separator + \"geckodriver\");\n } else if (os.contains(OS.WIN.getOsName())) {\n geckoDriverPath.append(File.separator + \"win\" + File.separator + \"geckodriver.exe\");\n }\n System.setProperty(\"webdriver.gecko.driver\", geckoDriverPath.toString());\n driver = new FirefoxDriver();\n } else if (WindowBrowser.equalsIgnoreCase(BROWSERS.CHROME.getBrowserName())) {\n final StringBuilder chromeDriverPath = new StringBuilder();\n System.out.println(userDirectory);\n chromeDriverPath.append(userDirectory + File.separator + \"src\" + File.separator + \"test\" + File.separator + \"resources\");\n if (os.contains(OS.MAC.getOsName())) {\n chromeDriverPath.append(File.separator + \"mac\" + File.separator + \"chromedriver\");\n } else if (os.contains(OS.WIN.getOsName())) {\n chromeDriverPath.append(File.separator + \"win\" + File.separator + \"chromedriver.exe\");\n }\n System.setProperty(\"webdriver.chrome.driver\", chromeDriverPath.toString());\n driver = new ChromeDriver();\n } else if (WindowBrowser.equalsIgnoreCase(BROWSERS.SAFARI.getBrowserName())) {\n driver = new SafariDriver();\n }\n driver.manage().window().setSize(new Dimension(1440, 844));\n driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\n BaseURl = URL;\n Log.info(\"Driver initialised successfully\");\n driver.get(BaseURl);\n Log.info(\"Opening URl: \" + URL);\n }", "public void creatSubInterface() throws IOException \n\t{\n\t baseWebDriver.waitExplicit(\"subInterace.link\");\n\t \n\t baseWebDriver.click(\"subInterace.link\");\n\t \n\t //String subInterfaceNew = baseWebDriver.getLocatorProperty(\"subInterface.New\");\n\t baseWebDriver.waitExplicit(\"subInterface.New\");\n\t \n\t baseWebDriver.click(\"subInterface.New\");\n\t \n\t try {\n\t\tThread.sleep(20000);\n\t \t } catch (InterruptedException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t \t }\n\t \n\t baseWebDriver.waitExplicit(\"subInterfaceNew.PERouter\");\n\t \n\t String appPERouter = baseWebDriver.getAppProperty(\"subInterfaceNew.PERouter\");\n\t //baseWebDriver.selectText(\"subInterfaceNew.PERouter\", appPERouter);\n\t \n\t baseWebDriver.type(\"subInterfaceNew.PERouter\", appPERouter);\n\t \n\t \n\t baseWebDriver.waitExplicit(\"subInterface.customer\");\n\t \n\t //Filling up all the data on New SubInterface screen\n\t \n\t String appCustomerName=baseWebDriver.getAppProperty(\"subInterface.customer\");\n\t baseWebDriver.type(\"subInterface.customer\",appCustomerName);\n\t \n\t String appTelefaktID = baseWebDriver.getAppProperty(\"subInterfaceNew.telefaktID\");\n\t baseWebDriver.type(\"subInterfaceNew.telefaktID\", appTelefaktID);\n\t \n\t baseWebDriver.waitExplicit(\"subInterfaceNew.PERouter\");\n\t \n\t String appSubInterfaceName = baseWebDriver.getAppProperty(\"subInterfaceNew.subInterfaceName\");\n\t baseWebDriver.type(\"subInterfaceNew.subInterfaceName\", appSubInterfaceName);\n\t \n\t String appTech = baseWebDriver.getAppProperty(\"subInterfaceNew.technology\");\n\t baseWebDriver.selectText(\"subInterfaceNew.technology\", appTech);\n\t \t \n\t String appASCircuitID = baseWebDriver.getAppProperty(\"subInterfaceNew.AScircuitID\");\n\t baseWebDriver.type(\"subInterfaceNew.AScircuitID\", appASCircuitID);\n\t \n\t String appServiceID= baseWebDriver.getAppProperty(\"subInterfaceNew.serviceID\");\n\t baseWebDriver.type(\"subInterfaceNew.serviceID\", appServiceID);\n\t \n\t String appVPNGroup = baseWebDriver.getAppProperty(\"subInterfaceNew.vpnGroup\");\n\t baseWebDriver.selectText(\"subInterfaceNew.vpnGroup\", appVPNGroup);\n\t \n\t \n\t \n\t //String appVPN = baseWebDriver.getAppProperty(\"subInterfaceNew.vpn\");\n\t \n\t //baseWebDriver.selectText(\"subInterfaceNew.vpn\", appVPN);\n\t \n\t String appLocation = baseWebDriver.getAppProperty(\"subInterfaceNew.location\");\n\t baseWebDriver.type(\"subInterfaceNew.location\", appLocation);\n\t \n\t baseWebDriver.waitExplicit(\"subInterfaceNew.inputSpeed\");\n\t \n\t String appInputSpeed = baseWebDriver.getAppProperty(\"subInterfaceNew.inputSpeed\");\n\t baseWebDriver.selectText(\"subInterfaceNew.inputSpeed\", appInputSpeed);\n\t \n\t baseWebDriver.waitExplicit(\"subInterfaceNew.outputSpeed\");\n\t \n\t String appOutputSpeed = baseWebDriver.getAppProperty(\"subInterfaceNew.outputSpeed\");\n\t baseWebDriver.selectText(\"subInterfaceNew.outputSpeed\", appOutputSpeed);\n\t \n\t baseWebDriver.waitExplicit(\"subInterfaceNew.interfaceRouter\");\n\t \n\t //String appInterfaceRouter = baseWebDriver.getAppProperty(\"subInterfaceNew.interfaceRouter\");\n\t baseWebDriver.selectIndex(\"subInterfaceNew.interfaceRouter\");\n\t \n\t //Need to refresh the application and also need to put Explicit wait for few items to be enabled\n\t \n\t \n\t \n\t String appSVLAN = baseWebDriver.getAppProperty(\"subInterfaceNew.SVLAN\");\n\t baseWebDriver.type(\"subInterfaceNew.SVLAN\", appSVLAN);\n\t \n\t String appcpeVendor = baseWebDriver.getAppProperty(\"subInterfaceNew.cpeVendor\");\n\t baseWebDriver.selectText(\"subInterfaceNew.cpeVendor\", appcpeVendor);\n\t \n\t String appcpHostName = baseWebDriver.getAppProperty(\"subInterfaceNew.cpeHostName\");\n\t baseWebDriver.type(\"subInterfaceNew.cpeHostName\", appcpHostName);\n\t \n\t baseWebDriver.submit(\"subInterfaceNew.create\");\n\t \n }", "protected abstract String getDriverClassName();", "private WfdDevice createWFDDevice(String iface, WfdEnums.WFDDeviceType type) {\n WfdDevice wfdDevice = new WfdDevice();\n wfdDevice.deviceType = type.getCode();\n wfdDevice.macAddress = null;\n wfdDevice.isAvailableForSession = false;//since init is to be called\n wfdDevice.addressOfAP = null;\n wfdDevice.coupledSinkStatus = 0;\n wfdDevice.preferredConnectivity = 0;\n if (type == WfdEnums.WFDDeviceType.SOURCE) {\n wfdDevice.deviceName = \"Source_device\";\n if (iface != null) {\n int index = iface.indexOf(':', 0);\n if (index > 0) {\n wfdDevice.ipAddress = iface.substring(0, index);\n wfdDevice.rtspPort =\n Integer.parseInt(iface.substring(index + 1, iface.length()));\n if (wfdDevice.ipAddress == null ||\n wfdDevice.rtspPort < 1 ||\n wfdDevice.rtspPort > 65535) {\n Log.e(TAG, \"Invalid RTSP port received or no valid IP\");\n return null;\n }\n }\n }\n } else if (type == WfdEnums.WFDDeviceType.PRIMARY_SINK) {\n wfdDevice.deviceName = \"Sink_device\";\n wfdDevice.rtspPort = 0;\n wfdDevice.ipAddress = null;\n } else {\n wfdDevice.deviceName = \"WFD_device\";\n wfdDevice.rtspPort = 0;\n wfdDevice.ipAddress = null;\n }\n return wfdDevice;\n }", "public void startAppiumServer(String os) throws ExecuteException, IOException, InterruptedException {\n if (os.contains(\"windows\")) {\n CommandLine command = new CommandLine(\"cmd\");\n command.addArgument(\"/c\");\n command.addArgument(\"C:/Program Files/nodejs/node.exe\");\n command.addArgument(\"C:/Appium/node_modules/appium/bin/appium.js\");\n command.addArgument(\"--address\", false);\n command.addArgument(\"127.0.0.1\");\n command.addArgument(\"--port\", false);\n command.addArgument(\"4723\");\n command.addArgument(\"--full-reset\", false);\n\n DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();\n DefaultExecutor executor = new DefaultExecutor();\n executor.setExitValue(1);\n executor.execute(command, resultHandler);\n Thread.sleep(5000);\n } else if (os.contains(\"mac\")) {\n CommandLine command = new CommandLine(\"/Applications/Appium.app/Contents/Resources/node/bin/node\");\n command.addArgument(\"/Applications/Appium.app/Contents/Resources/node_modules/appium/bin/appium.js\", false);\n command.addArgument(\"--address\", false);\n command.addArgument(\"127.0.0.1\");\n command.addArgument(\"--port\", false);\n command.addArgument(\"4723\");\n command.addArgument(\"--full-reset\", false);\n DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();\n DefaultExecutor executor = new DefaultExecutor();\n executor.setExitValue(1);\n executor.execute(command, resultHandler);\n Thread.sleep(5000);\n } else if (os.contains(\"linux\")) {\n //Start the appium server\n System.out.println(\"ANDROID_HOME : \");\n System.getenv(\"ANDROID_HOME\");\n //\tSystem.out.println(\"PATH :\" +System.getenv(\"PATH\"));\n CommandLine command = new CommandLine(\"/bin/bash\");\n command.addArgument(\"-c\");\n command.addArgument(\"~/.linuxbrew/bin/node\");\n command.addArgument(\"~/.linuxbrew/lib/node_modules/appium/lib/appium.js\", true);\n DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();\n DefaultExecutor executor = new DefaultExecutor();\n executor.setExitValue(1);\n executor.execute(command, resultHandler);\n Thread.sleep(5000); //Wait for appium server to start\n\n } else {\n LOGGER.info(os + \"is not supported yet\");\n }\n }", "private void createViewController() {\n if (outputFile.equals(\"out\")) {\n this.fileWriter = new OutputStreamWriter(System.out);\n } else {\n try {\n this.fileWriter = new FileWriter(outputFile);\n } catch (IOException e) {\n // ruh roh\n System.exit(-1);\n }\n }\n\n switch (this.viewType) {\n case PROVIDER:\n this.controller =\n new ProvControllerTextualImitate(\n new HybridView(this.tps),\n new EzAnimatorOpsAdapter(this.model),\n this.fileWriter);\n break;\n case PROVIDER_VISUAL:\n this.controller =\n new ProvControllerImitate(\n new VisualView(this.tps),\n new EzAnimatorOpsAdapter(this.model));\n break;\n case PROVIDER_TEXTUAL:\n this.controller =\n new ProvControllerTextualImitate(\n new TextualView(this.tps),\n new EzAnimatorOpsAdapter(this.model),\n fileWriter);\n break;\n case PROVIDER_SVG:\n this.controller =\n new ProvControllerTextualImitate(\n new SvgAnimationView(this.tps),\n new EzAnimatorOpsAdapter(this.model),\n fileWriter);\n break;\n default:\n throw new IllegalArgumentException(\"Invalid viewtype given\");\n }\n }", "void openHardware(){\n if(hardware!=null && hardware.isOpen()){\n playMode=PlayMode.LIVE; // in case (like StereoHardwareInterface) where device can be open but not by MotionViewer\n return;\n }\n try{\n hardware=(SiLabsC8051F320_OpticalFlowHardwareInterface)OpticalFlowHardwareInterfaceFactory.instance().getFirstAvailableInterface();\n hardware.setChip(chip);\n chip.setHardwareInterface(hardware);\n hardware.open();\n\n\n \n if(hardware==null) {\n fixLoggingControls();\n fixBiasgenControls();\n return;\n }\n\n fixLoggingControls();\n fixBiasgenControls();\n // note it is important that this openHardware succeeed BEFORE hardware is assigned to biasgen, which immeiately tries to openHardware and download biases, creating a storm of complaints if not sucessful!\n \n// if(hardware instanceof BiasgenHardwareInterface){\n// chip.getBiasgen().sendConfiguration(chip.getBiasgen());\n// chip.setHardwareInterface(hardware); // if we do this, events do not start coming again after reconnect of device\n// biasgen=chip.getBiasgen();\n// if(biasgenFrame==null) {\n// biasgenFrame=new BiasgenFrame(biasgen); // should check if exists...\n// }\n// }\n \n setPlaybackControlsEnabledState(true);\n setPlayMode(PlayMode.LIVE);\n setTitleAccordingToState();\n }catch(Exception e){\n log.warning(e.getMessage());\n if(hardware!= null) hardware.close();\n setPlaybackControlsEnabledState(false);\n fixLoggingControls();\n fixBiasgenControls();\n setPlayMode(PlayMode.WAITING);\n }\n }", "private void ucitajDrajver()throws Exception{\r\n db.loadDriver();\r\n }", "public static WebDriver setupDriver()\r\n\t{\r\n\t driver = getWebDriver();\r\n\t return driver;\r\n\t}", "public void setDriver(String driver) {\n this.driver = driver;\n saveProperties();\n }", "@BeforeClass\n public void beforeClass() throws MalformedURLException {\n DesiredCapabilities desiredCapabilities = new DesiredCapabilities();\n desiredCapabilities.setCapability(\"deviceName\", \"Pixel_4_emulator\");\n desiredCapabilities.setCapability(\"platformName\", \"android\");\n desiredCapabilities.setCapability(\"automationName\", \"UiAutomator2\");\n desiredCapabilities.setCapability(\"noReset\", true);\n desiredCapabilities.setCapability(\"appPackage\", \"com.google.android.apps.messaging\");\n desiredCapabilities.setCapability(\"appActivity\", \".ui.ConversationListActivity\");\n\n // Instantiate Appium Driver\n URL appServer = new URL(\"http://0.0.0.0:4723/wd/hub\");\n driver = new AndroidDriver<MobileElement>(appServer, desiredCapabilities);\n wait = new WebDriverWait(driver, 5);\n }", "@BeforeClass\n\tpublic void appLaunch() throws IOException\n\t{\n\n\t\t/*String Appium_Node_Path=\"C:/Program Files (x86)/Appium/node.exe\"; \n\t\tString Appium_JS_Path=\"C:/Program Files (x86)/Appium/node_modules/appium/bin/appium.js\"; \n\t\tappiumService = AppiumDriverLocalService.buildService(new AppiumServiceBuilder().usingPort(4723).usingDriverExecutable(new File(Appium_Node_Path)).withAppiumJS(new File(Appium_JS_Path))); \n\t\tappiumService.start();\n\t\t */\t\t\t\n\t\tcapabilities.setCapability(MobileCapabilityType.PLATFORM,Platform.ANDROID);\n\t\tcapabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT,3000);\n\t\tcapabilities.setCapability(MobileCapabilityType.PLATFORM,Horoscope_GenericLib.readConfigPropFile(sPropFileName, \"PLATFORMNAME\"));\n\t\tcapabilities.setCapability(MobileCapabilityType.DEVICE_NAME,Horoscope_GenericLib.readConfigPropFile(sPropFileName, \"DeviceName\"));\n\t\tcapabilities.setCapability(MobileCapabilityType.VERSION,Horoscope_GenericLib.readConfigPropFile(sPropFileName, \"PLATFORMVERSION\"));\n//\t\tcapabilities.setCapability(\"appPackage\", Horoscope_GenericLib.readConfigPropFile(sPropFileName, \"packageName\"));\n//\t\tcapabilities.setCapability(\"appActivity\",Horoscope_GenericLib.readConfigPropFile(sPropFileName, \"activityName\"));\n\t\t\n\t\t// for testing\n\t\tcapabilities.setCapability(\"appPackage\", \"in.amazon.mShop.android.shopping\");\n\t\tcapabilities.setCapability(\"appActivity\", \"com.amazon.mShop.home.HomeActivity\");;\n\n\n\t\tURL url= new URL(\"http://0.0.0.0:4723/wd/hub\");\n\t\tdriver = new AndroidDriver<WebElement>(url, capabilities);\n\t\tdriver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\n\t\t// testing purpose\n\t\tbackButton(driver);\n\t\tbackButton(driver);\n\t\t\n// in.amazon.mShop.android.shopping\n//\tcom.amazon.mShop.sso.SigninPromptActivity\n\n\t}", "public void appiumStart() throws IOException, InterruptedException {\n // Execute command string to start appium server.\n p = Runtime.getRuntime().exec(cmd);\n // Provide wait time of 10 mins to start appium server properly.\n // If face any error(Could not start a new session...) then Increase\n // this time to 15 or 20 mins.\n Thread.sleep(10000);\n if (p != null) {\n System.out.println(\"Appium server Is started now.\");\n }\n }", "@Before\n public void setup() {\n device = new Device(deviceID, token);\n }", "public interface UserDriver extends UosEventDriver {\n\n\tpublic static final String USER_DRIVER = UserDriverNativeSupport.class.getCanonicalName();\n\n\t// possible events\n\tpublic static final String NEW_USER_EVENT_KEY = \"NEW_USER_EVENT_KEY\";\n\tpublic static final String CHANGE_INFORMATION_TO_USER_KEY = \"CHANGE_INFORMATION_TO_USER_KEY\";\n\tpublic static final String LOST_USER_EVENT_KEY = \"LOST_USER_EVENT_KEY\";\n\n\tpublic static final String NAME_PARAM = \"name\";\n\tpublic static final String EMAIL_PARAM = \"email\";\n\tpublic static final String LAST_LABEL_NAME = \"lastlabelname\";\n\tpublic static final String LAST_LABEL_EMAIL = \"lastlabelemail\";\n\tpublic static final String CONFIDENCE_PARAM = \"confidence\";\n\tpublic static final String POSITION_X_PARAM = \"positionX\";\n\tpublic static final String POSITION_Z_PARAM = \"positionZ\";\n\tpublic static final String POSITION_Y_PARAM = \"positionY\";\n\n\tpublic static final String SPECIFIC_FIELD_PARAM = \"specificField\";\n\tpublic static final String EVENT_KEY_PARAM = \"eventKey\";\n\tpublic static final String USER_PARAM = \"user\";\n\n\tpublic static final String BYTES_IMAGE_PARAM = \"bytesImage\";\n\tpublic static final String INDEX_IMAGE_PARAM = \"indexImage\";\n\tpublic static final String LENGTH_IMAGE_PARAM = \"lengthImage\";\n\n\tpublic static final String RETURN_PARAM = \"return\";\n\n\tpublic static final String SPECIAL_CHARACTER_SEPARATOR = \":\";\n\n\t/* ******************\n\t * Services \n\t * ******************/\n\n\t/**\n\t * Retrieve information of the user with email\n\t * \n\t * @param serviceCall\n\t * @param serviceResponse\n\t * @param messageContext\n\t */\n\tpublic abstract void retrieveUserInfo(Call serviceCall, Response serviceResponse, CallContext messageContext);\n\n\t/**\n\t * Save image for the user with email in parameter\n\t * \n\t * @param serviceCall\n\t * @param serviceResponse\n\t * @param messageContext\n\t */\n\tpublic abstract void saveUserImage(Call serviceCall, Response serviceResponse, CallContext messageContext);\n\n\t/**\n\t * Remove images of user\n\t * \n\t * @param serviceCall\n\t * @param serviceResponse\n\t * @param messageContext\n\t */\n\tpublic abstract void removeUserImages(Call serviceCall, Response serviceResponse, CallContext messageContext);\n\n\t/**\n\t * List all known users\n\t * \n\t * @param serviceCall\n\t * @param serviceResponse\n\t * @param messageContext\n\t */\n\tpublic abstract void listKnownUsers(Call serviceCall, Response serviceResponse, CallContext messageContext);\n\n\t/**\n\t * Retrain the recognition algorithm\n\t * \n\t * @param serviceCall\n\t * @param serviceResponse\n\t * @param messageContext\n\t */\n\tpublic abstract void retrain(Call serviceCall, Response serviceResponse, CallContext messageContext);\n\n}", "private void initDevice() {\n device = new Device();\n device.setManufacture(new Manufacture());\n device.setInput(new Input());\n device.setPrice(new Price());\n device.getPrice().setCurrency(\"usd\");\n device.setCritical(DeviceCritical.FALSE);\n }", "public export.serializers.avro.DeviceInfo.Builder setDriver(java.lang.CharSequence value) {\n validate(fields()[6], value);\n this.driver = value;\n fieldSetFlags()[6] = true;\n return this;\n }", "@BeforeClass\n public static void startApp() throws MalformedURLException {\n DesiredCapabilities caps = new DesiredCapabilities();\n caps.setCapability(\"platformName\", \"Android\");\n caps.setCapability(\"platformVersion\", \"5.0.1\"); //Replace this with your Android version\n caps.setCapability(\"deviceName\", \"Samsung Galaxy\"); //Replace this with your simulator/device \n Path currentRelativePath = Paths.get(\"\");\n String path = currentRelativePath.toAbsolutePath().toString() + \"/src/main/resources/Evernote.apk\";\n caps.setCapability(\"app\", path); //Replace this with app path in your system\n \n// caps.setCapability(\"appActivity\", \"com.evernote.ui.HomeActivity\");\n// caps.setCapability(\"appPackage\", \"com.evernote\");\n// appInstalled = true;\n\n AppiumServer server = new AppiumServer(serverAddress,port);//setup Appium server \n server.startAppiumServer();//open Appium server automatically\n \n driver = new AndroidDriver(server.getService(),caps);\n driver.manage().timeouts().implicitlyWait(20L, TimeUnit.SECONDS);\n }", "public static WebDriver initializatio(){\n\t\t \r\n\t\t\t String browse_name= prop.getProperty(\"browser\");\r\n\t\t\t \r\n\t\t\t \r\n\t\t if(driver==null && browse_name.equals(\"chrome\")){\r\n\t\t\t System.setProperty(\"webdriver.chrome.driver\", \"C://Users//RJ//Downloads//chromedriver.exe\");\r\n\t\t\t driver=new ChromeDriver();\r\n\t\t\t //E:\\Yadav Selenium\r\n\t\t }\r\n\t\t \r\n\t\t else if(driver==null && browse_name.equals(\"FF\")){\r\n\t\t\t System.setProperty(\"webdriver.gecko.driver\", \"E://Yadav Selenium//geckodriver.exe\");\r\n\t\t\t driver=new FirefoxDriver();\r\n\t\t }\r\n\t\t event_driver=new EventFiringWebDriver(driver);\r\n\t\t //now cearte Eventlistnerhandler to resgistor with eventFireingWebdriver\r\n\t\t event_lisner=new WebEventListner();\r\n\t\t event_driver.register(event_lisner);\r\n\t\t driver=event_driver;\r\n\t\t \r\n\t\t driver.manage().window().maximize();\r\n\t\t driver.manage().deleteAllCookies();\r\n\t\t driver.manage().timeouts().pageLoadTimeout(Testutil.PAGE_LOAD_TIMEOUT, TimeUnit.SECONDS);\r\n\t\t driver.manage().timeouts().implicitlyWait(Testutil.IMPLICIT_WAIT, TimeUnit.SECONDS);\r\n\t\t // driver.get(prop.getProperty(\"url\"));\r\n\t\t driver.navigate().to(prop.getProperty(\"url\"));\r\n\t\treturn driver;\r\n\t}", "public PGShowHomePage(AppiumDriver driver) throws MalformedURLException {\r\n\t\tthis.driver = driver;\r\n\t\tlstTestData = db.getTestDataObject(\"Select * from PGShowHomePage\", \"Input\");\r\n\t\tlstObject = db.getTestDataObject(\"Select * from PGShowHomePage\", \"ObjectRepository\");\r\n\t}", "public static WebDriver setupDriver(String platform, String url, String browser) {\n if (platform.equalsIgnoreCase(\"mac\") && browser.equalsIgnoreCase(\"chrome\")) {\n System.setProperty(\"webdriver.chrome.driver\", \"src/main/resources/drivers/chromedriver\");\n } else if (platform.equalsIgnoreCase(\"windows\") && browser.equalsIgnoreCase(\"chrome\")) {\n System.setProperty(\"webdriver.chrome.driver\", \"src/main/resources/drivers/chromedriver.exe\");\n }\n driver = new ChromeDriver();\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n driver.manage().timeouts().pageLoadTimeout(20, TimeUnit.SECONDS);\n driver.manage().window().maximize();\n driver.get(url);\n return driver;\n }", "@BeforeClass\n public void beforeClass() throws MalformedURLException {\n DesiredCapabilities caps = new DesiredCapabilities();\n caps.setCapability(\"deviceName\", \"bb9d156c\");\n caps.setCapability(\"platformName\", \"Android\");\n caps.setCapability(\"appPackage\", \"com.google.android.apps.tasks\");\n caps.setCapability(\"appActivity\", \".ui.TaskListsActivity\");\n // caps.setCapability(\"noReset\", true);\n\n // Instantiate Appium Driver\n URL appServer = new URL(\"http://0.0.0.0:4723/wd/hub\");\n driver = new AndroidDriver<MobileElement>(appServer, caps);\n \n }", "public void driverStart(String baseURL) {\n// FirefoxDriverManager.getInstance().setup();\n// driver = new FirefoxDriver();\n// driver.manage().window().maximize();\n// webDriverWait = new WebDriverWait(driver, 10);\n//\n//// ChromeDriverManager.getInstance().setup();\n//// driver = new ChromeDriver();\n//// driver.manage().window().maximize();\n//// webDriverWait = new WebDriverWait(driver, 5);\n//\n// driver.get(baseURL);\n\n FirefoxDriverManager.getInstance().setup();\n WebDriver driver = new FirefoxDriver();\n driver.get(\"http://localhost/litecart/\");\n\n\n }", "public static AppiumDriver getDriver(){\n return appiumDriverList.get(0);\n }", "@Override\r\n\tpublic void buildDriver() throws DriverException\r\n\t{\r\n\t\tif(ConfigUtil.isLocalEnv())\r\n\t\t{\r\n\t\t\t// if it is a Selenium tool, then create selenium ChromeDriver\r\n\t\t\tif(ConfigUtil.isSelenium()){\r\n\t\t\t\t\r\n\t\t\t\tFile chromeDriverFile=getChromeDriverFile();\r\n\t\t\t\tSystem.out.println(\" Found Driver file\");\r\n\t\t\t\tdriver =SeleniumDriver.buildChromeDriver(chromeDriverFile);\r\n\t\t\t\t //new org.openqa.selenium.chrome.ChromeDriver();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\telse if(ConfigUtil.isRemoteEnv())\r\n\t\t{\r\n\t\t\tif(ConfigUtil.isSelenium()){\r\n\t\t\t\tcapabilities = DesiredCapabilities.chrome();\t\r\n\t\t\t\tdriver = SeleniumDriver.buildRemoteDriver(capabilities);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\telse if(ConfigUtil.isBrowserStackEnv())\r\n\t\t{\r\n\t\t\tcapabilities = DesiredCapabilities.chrome();\r\n\t\t\tbuildBrowserstackCapabilities();\r\n\r\n\t\t}\r\n\r\n\t}", "@Override\n IDeviceFactory getFactory();", "RemoteWebDriver getDriver(String appName, String appPackage, String appActivity, String deviceName,\n\t\t\tString fileName) {\n\t\tDesiredCapabilities androidDcap = new DesiredCapabilities();\n\t\tandroidDcap.setCapability(MobileCapabilityType.AUTOMATION_NAME, \"UIAutomator2\");\n\t\tandroidDcap.setCapability(MobileCapabilityType.PLATFORM_NAME, \"Android\");\n\t\tandroidDcap.setCapability(AndroidMobileCapabilityType.AUTO_GRANT_PERMISSIONS, true);\n\t\tandroidDcap.setCapability(MobileCapabilityType.NO_RESET, true);\n\t\tandroidDcap.setCapability(MobileCapabilityType.FULL_RESET, false);\n\t\tandroidDcap.setCapability(AndroidMobileCapabilityType.NO_SIGN, true);\n\t\tandroidDcap.setCapability(AndroidMobileCapabilityType.APP_WAIT_DURATION, 120);\n\t\tandroidDcap.setCapability(\"deviceName\", deviceName);\n\t\tandroidDcap.setCapability(\"browserName\", \"\");\n\t\tandroidDcap.setCapability(\"newCommandTimeout\", 1500);\n\t\tandroidDcap.setCapability(\"appPackage\", appPackage);\n\t\tandroidDcap.setCapability(\"appActivity\", appActivity);\n\t\tandroidDcap.setCapability(\"autoAcceptAlerts\", true);\n\t\tandroidDcap.setCapability(\"autoDismissAlerts\", true);\n\t\tandroidDcap.setCapability(\"app\", System.getProperty(\"user.dir\") + \"/src/main/resources\" + fileName);\n\t\ttry {\n\t\t\tif (System.getProperty(\"location\").equalsIgnoreCase(\"local\")) {\n\t\t\t\tdriver = new AndroidDriver<>(new URL(\"http://127.0.0.1:4651/wd/hub\"), androidDcap);\n\t\t\t\tlogger.info(\"Session ID of Android: \" + driver.getSessionId());\n\t\t\t} else if (System.getProperty(\"location\").equalsIgnoreCase(\"remote\")) {\n\t\t\t\tdriver = new AndroidDriver<>(new URL(PropertyHelper.getProperties(\"REMOTE_HUB_URL\")), androidDcap);\n\t\t\t\tlogger.info(\"Session ID of Android: \" + driver.getSessionId());\n\t\t\t}\n\t\t} catch (WebDriverException e) {\n\t\t\tlogger.error(\"Driver instantiating failed or app is not installed\", e);\n\t\t} catch (MalformedURLException e) {\n\t\t\tlogger.error(e);\n\t\t}\n\t\tdriver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);\n\t\tDriverFactory.getDriverPool().put(appName, driver);\n\t\treturn driver;\n\t}", "@BeforeMethod\n\tpublic static void launchDriver() throws MalformedURLException\n\t{\n\t \t\t \n\t\tDesiredCapabilities caps = new DesiredCapabilities();\n\t/* caps.setCapability(\"browser\", \"Chrome\");\n\t caps.setCapability(\"browser_version\", \"60.0\");\n\t caps.setCapability(\"os\", \"Windows\");\n\t caps.setCapability(\"os_version\", \"7\");\n\t caps.setCapability(\"resolution\", \"1024x768\");\n\t caps.setCapability(\"name\", \"Bstack-[Java] Sample Test\");*/\n\t //set from capability generator \n\t caps.setCapability(\"os\", \"Windows\");\n\t caps.setCapability(\"os_version\", \"10\");\n\t caps.setCapability(\"browser\", \"Chrome\");\n\t caps.setCapability(\"browser_version\", \"62.0\");\n\t caps.setCapability(\"project\", \"TestingOnBrowserStack\");\n\t caps.setCapability(\"build\", \"1.0\");\n\t caps.setCapability(\"name\", \"TestBroserStackSel\");\n\t caps.setCapability(\"browserstack.local\", \"false\");\n\t caps.setCapability(\"browserstack.selenium_version\", \"3.5.2\");\n\t \n\t driver = new RemoteWebDriver(new URL(URL), caps);\n\t\tdriver.manage().deleteAllCookies();\n\t\twait = new WebDriverWait(driver, 220);\n\t\tdriver.manage().window().maximize();\n\t\tdriver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);\n\t\t\n\t\t\n\t}", "public apilfixer() {\n\n try {\n System.out.print(\"Connection to Informix Driver \\n\");\n Class.forName(\"com.informix.jdbc.IfxDriver\");\n // Class.forName(\"sun.jdbc.odbc.JdbcOdbcDriver\");\n ConnectionURL = DriverManager.getConnection(INFORMX_URL, INFORMX_USERID,INFORMX_USERPASS);\n } catch (Exception e) {\n System.err.println( \"Unable to locate class \\n\" );\n e.printStackTrace();\n System.exit(1);\n }\n\n\n}", "private WebDriver createInternetExplorerDriver() {\n\t\tDesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();\n\t\tcapabilities.setCapability(InternetExplorerDriver.IGNORE_ZOOM_SETTING, true);\n\t\tsetDriverPropertyIfRequired(\"webdriver.ie.driver\", \"IEDriverServer.exe\");\n\t\t_driver = new InternetExplorerDriver(capabilities);\n\t\treturn _driver;\n\t}", "@BeforeMethod\n public void setDriver() throws MalformedURLException {\n\n\n driver = WebDriverFactory.getDriver(WebDriverFactory.CHROME).get();\n\n\n loginPage = new LoginPage(driver);\n loginPageHelper = new LoginPageHelper(driver);\n menuHelper = new MenuHelper(driver);\n }", "@BeforeClass\r\n public void beforeClass() throws MalformedURLException {\n DesiredCapabilities caps = new DesiredCapabilities();\r\n caps.setCapability(\"deviceName\", \"PixelEmulator\");\r\n caps.setCapability(\"platformName\", \"Android\");\r\n caps.setCapability(\"appPackage\", \"com.google.android.keep\");\r\n caps.setCapability(\"appActivity\", \".activities.BrowseActivity\");\r\n caps.setCapability(\"noReset\", true);\r\n\r\n // Instantiate Appium Driver\r\n URL remoteURL = new URL(\"http://localhost:4723/wd/hub\");\r\n driver = new AndroidDriver<MobileElement>(remoteURL, caps);\r\n \r\n }", "public static void main(String args[])\n {\n new HardwareDeviceRental();\n }", "@Deprecated\r\n private void setDevices() throws ClassNotFoundException {\n\r\n installedDevices = new Device[deviceName.length];\r\n\r\n for (int i = 0; i < deviceName.length; i++) {\r\n\r\n //Class<?> eine = Class.forName(deviceName[0]);\r\n try {\r\n Constructor<?>[] ctors = Class.forName(deviceName[i]).getDeclaredConstructors();\r\n Constructor<?> ctor = null;\r\n for (Constructor<?> c : ctors) {\r\n if (c.getGenericParameterTypes().length == 0) {\r\n ctor = c;\r\n }\r\n }\r\n ctor.setAccessible(true);\r\n Device device = (Device) ctor.newInstance();\r\n\r\n installedDevices[i] = device;\r\n\r\n } catch (Exception e) {\r\n throw new ClassNotFoundException(\r\n \"Ist abgestuerzt, weil Klasse aus Config nicht existiert oder im falschen ordner sich befindet\"\r\n + e + \".\");\r\n }\r\n\r\n }\r\n\r\n }" ]
[ "0.6643913", "0.6323709", "0.62552816", "0.61103", "0.5903213", "0.5877916", "0.5839138", "0.5803558", "0.56849295", "0.56267154", "0.5554803", "0.55497503", "0.5545727", "0.5503114", "0.5496069", "0.54486734", "0.5440431", "0.5431525", "0.54200125", "0.5387022", "0.5365743", "0.5355488", "0.5328349", "0.5310232", "0.53070366", "0.5304206", "0.5293792", "0.5272747", "0.5222772", "0.5219444", "0.52037805", "0.5174391", "0.5166453", "0.5154616", "0.5152838", "0.5149281", "0.51488817", "0.5140235", "0.51365197", "0.5135531", "0.51182616", "0.5102363", "0.5101839", "0.50992", "0.5092188", "0.50814974", "0.5072918", "0.50622475", "0.50494313", "0.5041416", "0.5036333", "0.50331396", "0.50264376", "0.5025711", "0.501804", "0.5007312", "0.49832088", "0.49787802", "0.49558848", "0.4954618", "0.49519122", "0.49400565", "0.49345708", "0.49345028", "0.492783", "0.49263105", "0.49205282", "0.4899033", "0.48906264", "0.48667735", "0.48617268", "0.48601848", "0.48535928", "0.48392504", "0.4833695", "0.48137197", "0.48094636", "0.4802837", "0.48016945", "0.47944015", "0.47887382", "0.4787654", "0.4786677", "0.47821385", "0.47748047", "0.47524267", "0.4752264", "0.47459948", "0.4745444", "0.47452837", "0.47450438", "0.4740806", "0.47396278", "0.47392547", "0.47360635", "0.47358966", "0.47314057", "0.47293285", "0.47263438", "0.47237602" ]
0.51016873
43
this method starts the appium server depending on your OS.
public void startAppiumServer(String os) throws ExecuteException, IOException, InterruptedException { if (os.contains("windows")) { CommandLine command = new CommandLine("cmd"); command.addArgument("/c"); command.addArgument("C:/Program Files/nodejs/node.exe"); command.addArgument("C:/Appium/node_modules/appium/bin/appium.js"); command.addArgument("--address", false); command.addArgument("127.0.0.1"); command.addArgument("--port", false); command.addArgument("4723"); command.addArgument("--full-reset", false); DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler(); DefaultExecutor executor = new DefaultExecutor(); executor.setExitValue(1); executor.execute(command, resultHandler); Thread.sleep(5000); } else if (os.contains("mac")) { CommandLine command = new CommandLine("/Applications/Appium.app/Contents/Resources/node/bin/node"); command.addArgument("/Applications/Appium.app/Contents/Resources/node_modules/appium/bin/appium.js", false); command.addArgument("--address", false); command.addArgument("127.0.0.1"); command.addArgument("--port", false); command.addArgument("4723"); command.addArgument("--full-reset", false); DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler(); DefaultExecutor executor = new DefaultExecutor(); executor.setExitValue(1); executor.execute(command, resultHandler); Thread.sleep(5000); } else if (os.contains("linux")) { //Start the appium server System.out.println("ANDROID_HOME : "); System.getenv("ANDROID_HOME"); // System.out.println("PATH :" +System.getenv("PATH")); CommandLine command = new CommandLine("/bin/bash"); command.addArgument("-c"); command.addArgument("~/.linuxbrew/bin/node"); command.addArgument("~/.linuxbrew/lib/node_modules/appium/lib/appium.js", true); DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler(); DefaultExecutor executor = new DefaultExecutor(); executor.setExitValue(1); executor.execute(command, resultHandler); Thread.sleep(5000); //Wait for appium server to start } else { LOGGER.info(os + "is not supported yet"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void appiumStart() throws IOException, InterruptedException {\n // Execute command string to start appium server.\n p = Runtime.getRuntime().exec(cmd);\n // Provide wait time of 10 mins to start appium server properly.\n // If face any error(Could not start a new session...) then Increase\n // this time to 15 or 20 mins.\n Thread.sleep(10000);\n if (p != null) {\n System.out.println(\"Appium server Is started now.\");\n }\n }", "public static AppiumDriverLocalService AppiumServerStart(){\n System.out.println(\"Into driver setup\");\n AppiumDriverLocalService service;\n\n AppiumServiceBuilder serviceBuilder = new AppiumServiceBuilder();\n\n serviceBuilder.usingAnyFreePort();\n // /usr/local/bin/node\n serviceBuilder.usingDriverExecutable(new File(\"/usr/local/bin/node\"));\n // /usr/local/bin/appium\n serviceBuilder.withAppiumJS(new File(\"/usr/local/bin/appium\"));\n serviceBuilder.withArgument(GeneralServerFlag.RELAXED_SECURITY);\n serviceBuilder.withArgument(GeneralServerFlag.SHELL);\n HashMap<String, String> environment = new HashMap();\n environment.put(\"PATH\", \"/usr/local/bin:\" + System.getenv(\"PATH\"));\n\n\n service = AppiumDriverLocalService.buildService(serviceBuilder);\n service.start();\n return service;\n }", "public static void startAppiumServer() throws IOException, InterruptedException {\n\n\tRuntime runtime = Runtime.getRuntime();\n\n\tprocess = runtime.exec(STARTSERVER);\n\n\tThread.sleep(7000);\n\n\tif (process != null) {\n\n\tSystem.out.println(\"Appium server started\");\n\n\t}\n\n\t}", "public void invokeAppium() throws Exception {\n String OS = System.getProperty(\"os.name\").toLowerCase();\n try {\n startAppiumServer(OS);\n LOGGER.info(\"Appium server started successfully\");\n } catch (Exception e) {\n LOGGER.warn(\"Unable to start appium server\");\n throw new TapException(TapExceptionType.PROCESSING_FAILED, \"Unable to start appium server\");\n }\n }", "public void startAppium() throws ExecuteException, IOException{\n\t\t\t\tCommandLine command = new CommandLine(\"/bin/sh\");\n\t\t\t\tcommand.addArgument(\"/Applications/Appium.app/Contents/Resources/node/bin/node\");\n\t\t\t\tcommand.addArgument(\"/Applications/Appium.app/Contents/Resources/node_modules/appium/bin/appium.js\");\n\t\t\t\tcommand.addArgument(\"--address\");\n\t\t\t\tcommand.addArgument(\"127.0.0.1\");\n\t\t\t\tcommand.addArgument(\"--port\");\n\t\t\t\tcommand.addArgument(\"4723\");\n\t\t\t\tcommand.addArgument(\"--no-reset\");\n\t\t\t\tcommand.addArgument(\"--log\");\n\t\t\t\t\n\t\t\t\tcommand.addArgument(\"argument\", false);\n\t\t\t\tDefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();\n\t\t\t\tDefaultExecutor executor = new DefaultExecutor();\n\t\t\t\texecutor.setExitValue(1);\n\t\t\t\texecutor.execute(command, resultHandler);\n\t\t\t\t\t\n\t\t\t}", "public AppiumDriverLocalService StartServer()\n\t{\n\t\tservice = AppiumDriverLocalService.buildDefaultService();\n\t\tservice.start();\n\t\treturn service;\n\t}", "@BeforeClass\n public static void startApp() throws MalformedURLException {\n DesiredCapabilities caps = new DesiredCapabilities();\n caps.setCapability(\"platformName\", \"Android\");\n caps.setCapability(\"platformVersion\", \"5.0.1\"); //Replace this with your Android version\n caps.setCapability(\"deviceName\", \"Samsung Galaxy\"); //Replace this with your simulator/device \n Path currentRelativePath = Paths.get(\"\");\n String path = currentRelativePath.toAbsolutePath().toString() + \"/src/main/resources/Evernote.apk\";\n caps.setCapability(\"app\", path); //Replace this with app path in your system\n \n// caps.setCapability(\"appActivity\", \"com.evernote.ui.HomeActivity\");\n// caps.setCapability(\"appPackage\", \"com.evernote\");\n// appInstalled = true;\n\n AppiumServer server = new AppiumServer(serverAddress,port);//setup Appium server \n server.startAppiumServer();//open Appium server automatically\n \n driver = new AndroidDriver(server.getService(),caps);\n driver.manage().timeouts().implicitlyWait(20L, TimeUnit.SECONDS);\n }", "@BeforeTest\n\tpublic void setUp() throws InterruptedException, IOException {\n\t\tAppiumServer appiumServer = new AppiumServer();\n\t\t\n\t\tint port = 4723;\n\t\tif(!appiumServer.checkIfServerIsRunnning(port)) {\n\t\t\tSystem.out.println(\"Port No.: \" + port + \" is available.\");\n\n\t\t\tappiumServer.startServer();\n\t\t\t\n\t\t} else {\n\t\t\tSystem.out.println(\"Appium Server already running on Port - \" + port);\n\t\t}\n\t\t\n\t\tFile appPath = new File(\"./app/eBay.apk\");\n\t\tDesiredCapabilities cap = new DesiredCapabilities();\n\n\t\tcap.setCapability(MobileCapabilityType.APP, appPath.getAbsolutePath());\n\t\tcap.setCapability(MobileCapabilityType.DEVICE_NAME, \"MI\");\n\t\tcap.setCapability(MobileCapabilityType.PLATFORM_NAME, \"Android\");\n//\t\tcap.setCapability(MobileCapabilityType.PLATFORM_VERSION,\"9\");\n\t\t\n\t\tcap.setCapability(\"unicodeKeyboard\", \"true\"); \n\t\tcap.setCapability(\"resetKeyboard\", \"true\");\n\t\t\n\t\tcap.setCapability(MobileCapabilityType.PLATFORM_VERSION, DeviceVersionFinder.getDeviceVersion());\n\t\tcap.setCapability(MobileCapabilityType.AUTOMATION_NAME, \"uiautomator2\");\n\t\tcap.setCapability(\"--session-override\", false);\n\t\t\n\t\tcap.setCapability(\"setWebContentsDebuggingEnabled\", true);\n\t\t\n\t\tdriver = new AndroidDriver<MobileElement>(new URL(\"http://0.0.0.0:4723/wd/hub\"), cap);\n\n\t\tdriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n\t\tPOM_LaunchHomeScreen homeScreen = new POM_LaunchHomeScreen(driver);\n\n\t\tif(homeScreen.btn_homeSignIn.isDisplayed()) {\n\t\t\t\n\t\t\tSystem.out.println(\"App has successfully loaded within the time provided!\");\n\t\t\t\n\t\t}\n\n\t\t\n//\t\tMobileElement element = driver.findElement(By.id(\"recycler_view_main\"));\n\t\t\n//\t\tTouchActions action = new TouchAction();\n//\t\taction.scroll(element, 10, 100);\n//\t\taction.perform();\n\t\t\n\t\t\n\n\t\tSystem.out.println(\"Setup successful!\");\n\n\n\t}", "public static void main(String[] args) throws MalformedURLException, InterruptedException {\n\t\tString deviceName = \"VCan\";\r\n\t\tString platformVersion = \"4.4.2\";\r\n\t\tString apkName = \"微博.apk\";\r\n\t\tString appActivity = \"com.sina.weibo.SplashActivity\";\r\n\t\tString AppiumServerIP = \"http://127.0.0.1:4723/wd/hub\";\r\n\t\tAndroidDriver driver;\r\n\t\tFile apk = new File(System.getProperty(\"user.dir\")+File.separator+\"apps\"+File.separator+apkName);\r\n\t\tDesiredCapabilities capabilities = new DesiredCapabilities();\r\n\t\tcapabilities.setCapability(\"deviceName\", deviceName);\r\n\t\tcapabilities.setCapability(\"platformVersion\", platformVersion);\r\n\t\tcapabilities.setCapability(\"app\", apk);\r\n\t\tcapabilities.setCapability(\"appActivity\", appActivity);\r\n\t\tcapabilities.setCapability(\"noSign\", true);\r\n\t\tcapabilities.setCapability(\"noReset\", true);\r\n\t\tdriver = new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"),capabilities);\r\n\t\tThread.sleep(3000);\r\n\t\tSystem.out.println(\"App启动等待时间\");\r\n\t\tThread.sleep(4000);\r\n\t\tdriver.findElementById(\"com.sina.weibo:id/plus_icon\").click();\r\n\t\tdriver.findElementById(\"com.sina.weibo:id/pop_control_bar_front_close_img\").click();\r\n\t\tThread.sleep(2000);\r\n\t\tdriver.close();\r\n\t\tdriver.quit();\r\n\t}", "@BeforeClass\n public void setUp() {\n\n service = AppiumDriverLocalService.buildDefaultService();\n\n service.start();\n\n if (service == null || !service.isRunning()) {\n throw new AppiumServerHasNotBeenStartedLocallyException(\"Failed to start the Appium Server\");\n }\n path = AppUtility.getInstance().getPath();\n }", "private void intializeAppiumDriver() {\n File app = new File(\"src/main/resources\", CommonUtils.getCentralData(\"App\"));\n\n DesiredCapabilities capabilities = new DesiredCapabilities();\n capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, CommonUtils.getCentralData(\"PlatformName\"));\n capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, CommonUtils.getCentralData(\"PlatformVersion\"));\n capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, CommonUtils.getCentralData(\"DeviceName\"));\n if (IS_ANDROID) {\n capabilities.setCapability(APPLICATION_NAME, app.getAbsolutePath());\n capabilities.setCapability(APP_PACKAGE, CommonUtils.getCentralData(\"AppPackage\"));\n capabilities.setCapability(APP_ACTIVITY, CommonUtils.getCentralData(\"AppActivity\"));\n }\n if (IS_IOS) {\n capabilities.setCapability(AUTOMATION_NAME, IOS_XCUI_TEST);\n capabilities.setCapability(\"app\", app.getAbsolutePath());\n }\n capabilities.setCapability(FULL_RESET, CommonUtils.getCentralData(\"FullReset\"));\n capabilities.setCapability(NO_RESET, CommonUtils.getCentralData(\"NoReset\"));\n capabilities.setCapability(\"udid\", CommonUtils.getCentralData(\"UDID\"));\n capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, CommonUtils.getCentralData(\"WaitTimeoutInSeconds\"));\n\n try {\n driver = new AppiumDriver(new URL(CommonUtils.getCentralData(\"URL\")), capabilities);\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n }", "public void Launch_app() {\n\t\tDesiredCapabilities caps = new DesiredCapabilities();\r\n\t\tcaps.setCapability(\"deviceName\", \"My Phone\");\r\n\t\tcaps.setCapability(\"udid\", \"LE66A06190140096\"); //Give Device ID of your mobile phone\r\n\t\t\r\n\t\t/* caps.setCapability(\"udid\", \"emulator-5556\"); //Give Device ID of your mobile phone\r\n\t\t caps.setCapability(\"app\", \"C:\\\\Users\\\\Blue Otter HP2\\\\Downloads\\\\xemoto_staging_v1.0.0.apk\"); \r\n\t\t caps.setCapability(\"appWaitActivity\", \"*\");\r\n\t\t caps.setCapability(MobileCapabilityType.AUTOMATION_NAME, \"UiAutomator2\");*/\r\n\t\t\r\n\t\tcaps.setCapability(\"platformName\", \"Android\");\r\n\t\tcaps.setCapability(\"platformVersion\", \"6.0\");\r\n\t\r\n\t\tcaps.setCapability(\"appPackage\", \"org.blueotter.motone\");\r\n\t\tcaps.setCapability(\"appActivity\", \"org.blueotter.motone.feature.main.view.ActivityMain\"); \r\n\t\t\r\n\t\tcaps.setCapability(\"noReset\", \"true\");\r\n\t\t\r\n\t\t//Instantiate Appium Driver\r\n\t\ttry {\r\n\t\t\t\t driver = new AndroidDriver<MobileElement>(new URL(\"http://127.0.0.1:4723/wd/hub\"), caps);\t\t\r\n\r\n\r\n\t\t} catch (MalformedURLException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t\t\r\n\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS) ;\r\n\t\tSystem.out.println(\"Launch motone successful!\");\r\n\r\n \t}", "@BeforeClass\n\tpublic void appLaunch() throws IOException\n\t{\n\n\t\t/*String Appium_Node_Path=\"C:/Program Files (x86)/Appium/node.exe\"; \n\t\tString Appium_JS_Path=\"C:/Program Files (x86)/Appium/node_modules/appium/bin/appium.js\"; \n\t\tappiumService = AppiumDriverLocalService.buildService(new AppiumServiceBuilder().usingPort(4723).usingDriverExecutable(new File(Appium_Node_Path)).withAppiumJS(new File(Appium_JS_Path))); \n\t\tappiumService.start();\n\t\t */\t\t\t\n\t\tcapabilities.setCapability(MobileCapabilityType.PLATFORM,Platform.ANDROID);\n\t\tcapabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT,3000);\n\t\tcapabilities.setCapability(MobileCapabilityType.PLATFORM,Horoscope_GenericLib.readConfigPropFile(sPropFileName, \"PLATFORMNAME\"));\n\t\tcapabilities.setCapability(MobileCapabilityType.DEVICE_NAME,Horoscope_GenericLib.readConfigPropFile(sPropFileName, \"DeviceName\"));\n\t\tcapabilities.setCapability(MobileCapabilityType.VERSION,Horoscope_GenericLib.readConfigPropFile(sPropFileName, \"PLATFORMVERSION\"));\n//\t\tcapabilities.setCapability(\"appPackage\", Horoscope_GenericLib.readConfigPropFile(sPropFileName, \"packageName\"));\n//\t\tcapabilities.setCapability(\"appActivity\",Horoscope_GenericLib.readConfigPropFile(sPropFileName, \"activityName\"));\n\t\t\n\t\t// for testing\n\t\tcapabilities.setCapability(\"appPackage\", \"in.amazon.mShop.android.shopping\");\n\t\tcapabilities.setCapability(\"appActivity\", \"com.amazon.mShop.home.HomeActivity\");;\n\n\n\t\tURL url= new URL(\"http://0.0.0.0:4723/wd/hub\");\n\t\tdriver = new AndroidDriver<WebElement>(url, capabilities);\n\t\tdriver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\n\t\t// testing purpose\n\t\tbackButton(driver);\n\t\tbackButton(driver);\n\t\t\n// in.amazon.mShop.android.shopping\n//\tcom.amazon.mShop.sso.SigninPromptActivity\n\n\t}", "public void startServer() {\n URLClassLoader loader = createClasspath(opts);\n X_Process.runInClassloader(loader, appServer\n .map(DevAppServer::doStartServer, getAppName() + \"Server\", getPort())\n .ignoreOut1().unsafe());\n }", "@BeforeTest\n public void setUp() throws Exception {\n\t \n appiumStop();\n // Start appium server.\n appiumStart();\n DesiredCapabilities capabilities = new DesiredCapabilities();\n capabilities.setCapability(\"deviceName\", \"Android Emulator\");\n capabilities.setCapability(\"browserName\", \"Android\");\n capabilities.setCapability(\"platformVersion\", \"6.0\");\n capabilities.setCapability(\"platformName\", \"Android\");\n capabilities.setCapability(\"appPackage\", \"com.hmh.api\");\n capabilities.setCapability(\"appActivity\", \"com.hmh.api.ApiDemos\");\n driver = new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);\n }", "public static AppiumDriver getDriver(String platformtype, AppiumDriverLocalService service) throws IOException, TimeoutException, URISyntaxException {\n AppiumDriver driver;\n /* List<InterceptedMessage> messages = new ArrayList<InterceptedMessage>();\n\n\n MitmproxyJava proxy = new MitmproxyJava(\"/usr/local/bin/mitmdump\", (InterceptedMessage m) -> {\n System.out.println(\"intercepted request for \" + m.requestURL.toString());\n messages.add(m);\n return m;\n });\n //System.out.println(\"Hello World\");\n proxy.start();*/\n if (platformtype== \"Android\") {\n DesiredCapabilities options = new DesiredCapabilities();\n options.setCapability(\"deviceName\", propertyManager.getInstance().getdevicename()); //Pixel_XL_API_29\n options.setCapability(\"udid\",propertyManager.getInstance().getdeviceUDID());\n //options.setCapability(\"avd\",\"Pixel_XL_API_29\");\n options.setCapability(\"platformName\", propertyManager.getInstance().getplatformName());\n options.setCapability(\"platformVersion\", propertyManager.getInstance().getplatformVersion()); //emulator: 10.0.0\n options.setCapability(\"automationName\", \"UiAutomator2\");\n options.setCapability(\"autoGrantPermissions\",\"true\");\n options.setCapability(\"noReset\",\"true\");\n options.setCapability(\"autoAcceptAlerts\",\"true\");\n options.setCapability(\"app\",propertyManager.getInstance().getAndroidapp());\n options.setCapability(\"uiautomator2ServerInstallTimeout\", \"60000\");\n options.setCapability(\"abdExecTimeout\", \"60000\");\n options.setCapability(\"ACCEPT_SSL_CERTS\",true);\n options.setCapability(\"clearDeviceLogsOnStart\",\"true\");\n //options.setCapability(\"--set ssl_version_client\",\"all\");\n //options.setCapability(\"--proxy-server\",\"localhost:8080\");\n //options.setCapability(\"appWaitPackage\", \"com.clearchannel.iheartradio.controller.debug\");\n //options.setCapability(\"appWaitActivity\", \"com.clearchannel.iheartradio.controller.activities.NavDrawerActivity\");\n //options.setCapability(\"appPackage\", \"com.clearchannel.iheartradio.controller.debug\");\n //options.setCapability(\"appActivity\", \"com.clearchannel.iheartradio.controller.activities.NavDrawerActivity\");\n\n\n driver = new AndroidDriver<MobileElement>(service, options);\n return driver;\n }\n else if(platformtype== \"iOS\"){\n DesiredCapabilities options = new DesiredCapabilities();\n\n options.setCapability(\"platformName\", \"iOS\");\n options.setCapability(\"platformVersion\", propertyManager.getInstance().getiOSplatformVersion());\n options.setCapability(\"deviceName\", propertyManager.getInstance().getiOSdevicename());\n options.setCapability(\"udid\",propertyManager.getInstance().getiOSUDID());\n //options.setCapability(CapabilityType.BROWSER_NAME,\"safari\");\n //options.setCapability(\"automationName\", \"XCUITest\");\n options.setCapability(\"bundleId\",\"com.clearchannel.iheartradio.enterprise\");\n options.setCapability(\"startIWDP\",\"true\");\n options.setCapability(\"noReset\",\"true\");\n options.setCapability(\"useNewWDA\",\"false\");\n //options.setCapability(\"showIOSLog\",\"true\");\n //options.setCapability(\"app\",\"/Users/Shruti/Desktop/untitled folder/iHRiOSAppCenter/iHeartRadio.ipa\"); // /Users/Shruti/Downloads/iHeartRadio.ipa\n options.setCapability(\"xcodeOrgId\",\"BCN32U332R\");\n options.setCapability(\"xcodeSigningId\",\"iPhone Developer\");\n options.setCapability(\"autoAcceptAlerts\",\"true\");\n options.setCapability(\"SHOW_XCODE_LOG\",\"true\");\n //options.setCapability(\"updatedWDABundleId\",\"com.Shruti7505.WebDriverAgentRunner\");\n driver = new IOSDriver<MobileElement>(service,options);\n return driver;\n }\n return driver=null;\n\n }", "@Test\n\tpublic void LaunchAppTest() throws MalformedURLException {\n\n\t\t// Appium Code to Launch the Calculator App without .apk File \n\n\t\tDesiredCapabilities capabilities = new DesiredCapabilities();\n\n\t\tcapabilities.setCapability(\"platformName\", \"Android\");\n\t\tcapabilities.setCapability(MobileCapabilityType.DEVICE_NAME, \"emulator-5554\");\n\t\tcapabilities.setCapability(\"appPackage\", \"com.android.calculator2\");\n\t\tcapabilities.setCapability(\"appActivity\", \"com.android.calculator2.Calculator\");\n\t\tcapabilities.setCapability(\"autoLaunch\", true);\n\t\tAndroidDriver<AndroidElement> driver = new AndroidDriver<AndroidElement>(\n\t\t\t\tnew URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\t\tdriver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);\n\t\tdriver.quit();\n\t}", "public void init() throws MalformedURLException {\n\n capabilities = new DesiredCapabilities();\n\n capabilities.setCapability(\"deviceName\", \"Nex5\");\n capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, \"Android\");\n capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, \"8.0\");\n capabilities.setCapability(\"appPackage\", \"com.trello\");\n capabilities.setCapability(\"appActivity\", \".home.HomeActivity\");\n\n capabilities.setCapability(\"automationName\", \"Appium\");\n capabilities.setCapability(\"app\", \"C:/Users/Study/APK/trello_new.apk\");\n driver = new AppiumDriver<MobileElement>(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\n welcomeActivity = new WelcomePage(driver);\n loginActivity = new LoginPage(driver);\n\n }", "public static void main(String[] args) throws MalformedURLException, InterruptedException {\n\t\t\n\t\tFile app= new File(\"D:\\\\Testing\\\\Drag_drop\\\\com.mobeta.android.demodslv.apk\");\n\t\t\n\t\t//Launch app\n\t\tDesiredCapabilities capabilities= new DesiredCapabilities();\n\t\t\n\t\t//device details\n\t\tcapabilities.setCapability(\"deviceName\", \"GT-I9300I\");\n\t\tcapabilities.setCapability(\"platformName\", \"Android\");\n\t\tcapabilities.setCapability(\"platformVersion\", \"4.4.4\");\n\t\t\n\t\tcapabilities.setCapability(\"app\", app.getAbsolutePath());\n\t\t\n\t\tAndroidDriver driver= new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\t\t\n\t\t//wait\n\t\tThread.sleep(4000);\n\t\t\n\t\tif(driver.isAppInstalled(\"com.mobeta.android.demodslv\"))\n\t\t{\n\t\t\tSystem.out.println(\"App installed Successfully\");\n\t\t\tThread.sleep(8000);\n\t\t\t\n\t\t\tdriver.removeApp(\"com.mobeta.android.demodslv\");\n\t\t\tSystem.out.println(\"Removed the app\");\n\t\t\tThread.sleep(8000);\n\t\t\t\n\t\t\tdriver.installApp(\"D:\\\\Testing\\\\Drag_drop\\\\com.mobeta.android.demodslv.apk\");\n\t\t\tSystem.out.println(\"App installed again\");\n\t\t\tThread.sleep(8000);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"NOT installed the app\");\n\t\t}\n\t\n\t}", "public static AppiumDriver<MobileElement> setUp() {\n\t\ttry {\t\t\n\t\t\t\n\t\tDesiredCapabilities cap=new DesiredCapabilities();\n\t\tcap.setCapability(MobileCapabilityType.PLATFORM_NAME,\"ANDROID\");\n\t\tcap.setCapability(MobileCapabilityType.PLATFORM_VERSION, \"10 QKQ1.190915.002\");\n\t\tcap.setCapability(MobileCapabilityType.DEVICE_NAME, \"Redmi Note 7 Pro\");\n\t\tcap.setCapability(MobileCapabilityType.UDID, \"d9b3ca47\");\n//\t\tcap.setCapability(MobileCapabilityType.APP, \"\");\n\t\tcap.setCapability(\"appPackage\", \"com.swaglabsmobileapp\");\n\t\tcap.setCapability(\"appActivity\", \"com.swaglabsmobileapp.SplashActivity\");\n\t\t\n\t\tURL url=new URL(\"http://127.0.0.1:4723/wd/hub\");\n\t\tdriver =new AppiumDriver<MobileElement>(url, cap);\n\t\tdriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);\n//\t\tlog.info(\"Launching the app\");\n//\t\tMobileElement loginbutton = driver.findElement(MobileBy.AccessibilityId(\"test-LOGIN\"));\n// loginbutton.click();\n\t\t\t\treturn driver;\n\t\t}catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn driver;\n\t\t}\n\t}", "@Test\r\n\tpublic void startapp() {\n\t\tdriver.get(\"http://q.door.fund/\");\r\n\t\tdriver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);\r\n\t\tString currentURL = driver.getCurrentUrl();\r\n\t\tAssert.assertTrue(currentURL.contains(\"q.door.fund\"));\r\n\t\tSystem.out.println(\"Application loaded\");\r\n\t}", "public static void main(String[] args) throws MalformedURLException, InterruptedException {\n\t\t\n\t\tFile app= new File(\"E:/Testing/Drag_and_Drop/com.mobeta.android.demodslv.apk\");\n\t\t\n\t\t\n\t\tDesiredCapabilities capabilities= new DesiredCapabilities();\n\t\t\n\t\tcapabilities.setCapability(\"deviceName\", \"XT1033\");\n\t\tcapabilities.setCapability(\"platformName\", \"Android\");\n\t\tcapabilities.setCapability(\"platformVersion\", \"4.4.4\");\n\t\t\n\t\t//app details\n\t\tcapabilities.setCapability(\"app\",app.getAbsolutePath());\n\t\t\n\t\t//Appium details\n\t\t\n\t\tAndroidDriver driver= new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\n\t\tThread.sleep(12000);\n\t\t\n\t\tif(driver.isAppInstalled(\"com.mobeta.android.demodslv\"))\n\t\t{\n\t\t\tSystem.out.println(\"Successfully Installed\");\n\t\t\t\n\t\t\t//Remove thrugh code\n\t\t\tdriver.removeApp(\"com.mobeta.android.demodslv\");\n\t\t\tThread.sleep(8000);\n\t\t\tSystem.out.println(\"Removed sucessfully\");\n\t\t\t\n\t\t\t\n\t\t\tdriver.installApp(\"E:/Testing/Drag_and_Drop/com.mobeta.android.demodslv.apk\");\n\t\t\tThread.sleep(8000);\n\t\t\tSystem.out.println(\"Again Installed the app\");\n\t\t\t\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"NOT Installed the app\");\n\t\t}\n\n\t\t\n\n\t}", "public void run() { wait for the launcher script to talk to us\n //\n try {\n ssocket.setSoTimeout(30 * 1000); // 30 seconds\n socket = ssocket.accept();\n socket.setSoTimeout(3 * 60 * 1000);\n socket.setTcpNoDelay(true);\n } catch (SocketTimeoutException stmo) {\n String msg = \"timeout error on initial connection from \" + execName();\n task.log(msg, Project.MSG_ERR);\n failure = new BuildException(msg);\n } catch (Exception e) {\n String err = \"error establishing communication with \" + execName();\n String msg = e.getMessage();\n if (msg != null) {\n err = err + \": \" + msg;\n } else {\n err = err + \": \" + e;\n }\n task.log(err, Project.MSG_ERR);\n failure = new BuildException(err);\n }\n }", "public void startServer() {\n System.out.println(\"Inicie\");\n httpServer = new HttpServer();\n httpServer.registerProessor(\"/App\", this);\n try {\n httpServer.start();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@BeforeClass\npublic void setUp() throws MalformedURLException{\n\tDesiredCapabilities capabilities = new DesiredCapabilities();\n\t//capabilities.setCapability(\"BROWSER_NAME\", \"Android\");\n//\tcapabilities.setCapability(\"VERSION\", \"4.4.2\"); \n\tcapabilities.setCapability(\"deviceName\",\"NSM3Y18206000488\");\n\tcapabilities.setCapability(\"udid\",\"NSM3Y18206000488\");\n\tcapabilities.setCapability(\"platformName\",\"Android\");\n capabilities.setCapability(\"appPackage\", \"com.android.chrome\");\n// This package name of your app (you can get it from apk info app)\n\tcapabilities.setCapability(\"appActivity\",\"com.google.android.apps.chrome.Main\"); // This is Launcher activity of your app (you can get it from apk info app)\n//Create RemoteWebDriver instance and connect to the Appium server\n //It will launch the Calculator App in Android Device using the configurations specified in Desired Capabilities\n driver = new AndroidDriver<MobileElement>(new URL(\"http://localhost:4723/wd/hub\"), capabilities);\n \n // PageFactory.initElements(driver, this);\n}", "private void startServer() {\n\t\ttry {\n//\t\t\tserver = new Server();\n//\t\t\tserver.start();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: add message in UI for user\n\t\t}\n\t}", "public void startApp()\r\n\t{\n\t}", "@BeforeTest\n\t\tpublic void setUp() throws MalformedURLException {\n\t\t\t DesiredCapabilities capabilities = new DesiredCapabilities();\n\t\t\t // Set android deviceName desired capability. Set your device name.\n\t\t\t capabilities.setCapability(\"deviceName\", \"Custom Phone - 4.2.2 API 17 - 768*1280\");\n\t\t\t // Set BROWSER_NAME desired capability. It's Android in our case here.\n\t\t\t capabilities.setCapability(\"browserName\", \"Android\");\n\n\t\t\t // Set android VERSION desired capability. Set your mobile device's OS version.\n\t\t\t capabilities.setCapability(\"platformVersion\", \"4.2.2\");\n\n\t\t\t // Set android platformName desired capability. It's Android in our case here.\n\t\t\t capabilities.setCapability(\"platformName\", \"Android\");\n\t\t\t // Created object of RemoteWebDriver will all set capabilities.\n\t\t\t // Set appium server address and port number in URL string.\n\t\t\t // It will launch calculator app in android device.\n\t\t\t // capabilities.setCapability(\"unicodeKeyboard\", true);\n\t\t\t // capabilities.setCapability(\"resetKeyboard\", true);\n\t\t\t driver = new RemoteWebDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\t\t\t driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);\n\t\t\t }", "private void runServer()\n\t{\n\t\tif(sm == null)\n\t\t{\n\t\t\tsm = new ServerManager();\n\t\t}\n\t\t\n\t\tint port = 1209;\n\t\ttry \n\t\t{\n\t\t\twaitUser(sm, port);\n\t\t\t//이 아래 로직이 실행된다는건 유저가 다 들어왔다는 뜻임. 즉 게임 시작할 준비 되었음을 의미함\t\t\t\n\t\t\tGame.getInstance().runGame();\n\t\t} \n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"[Server.runServer()] error >>> : \" + e.getMessage());\n\t\t}\n\t}", "public void launch() throws NotBoundException, IOException\n\t{\n\t\t//call method to connect to server\t\t\n\t\tServerManager serverConnect = initialConnect();\t\n\t\n\t\t//get Setup menu from server\n\t\tSetUpMenu newSetup = new SetUpMenu(serverConnect);\n\t\tnewSetup.welcomeMenu();\n\t}", "public static void main(String args[]) throws MalformedURLException, InterruptedException {\n\n\tDesiredCapabilities caps = new DesiredCapabilities();\n\t//caps.setCapability(\"browserName\", \"\");\n\tcaps.setCapability(\"platform\", \"iOS\");\n\tcaps.setCapability(\"deviceName\", \"iPhone 6\");\n\tcaps.setCapability(\"platformVersion\", \"9.0\");\n\tcaps.setCapability(\"waitForAppScript\", \"$.delay(10000); $.acceptAlert();\");\n\t//caps.setCapability(\"autoWebview\", \"true\");\n\t//caps.setCapability(\"appPackage\", \"com.apptivateme.next.ct\");\n\t//caps.setCapability(\"appActivity\", \"com.tribune.universalnews.MainActivity\");\n\tcaps.setCapability(\"appiumVersion\", \"1.4.14\");\n\tcaps.setCapability(\"app\", \"sauce-storage:CT_iOS.zip\");\n\t\n\tURL sauceUrl = new URL(\"http://shnakeygarg:66c91399-8cfb-46ca-a2da-f09c2ce5f170@ondemand.saucelabs.com:80/wd/hub\");\n\n\tIOSDriver driver = new IOSDriver(sauceUrl, caps);\n\n\t// driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\tWebDriverWait waitvar = new WebDriverWait(driver,90);\n\n\tThread.sleep(5000);\n\n\twaitvar.until(ExpectedConditions.elementToBeClickable(driver.findElementByIosUIAutomation(\".buttons()[0]\")));\n\tdriver.findElementByIosUIAutomation(\".buttons()[0]\").click();\n\twaitvar.until(ExpectedConditions.elementToBeClickable(driver.findElementByIosUIAutomation(\".buttons()[0]\")));\n\tdriver.findElementByIosUIAutomation(\".buttons()[0]\").click();\n\twaitvar.until(ExpectedConditions.elementToBeClickable(driver.findElementByIosUIAutomation(\".buttons()[0]\")));\n\tdriver.findElementByIosUIAutomation(\".buttons()[0]\").click();\n\twaitvar.until(ExpectedConditions.elementToBeClickable(driver.findElementByIosUIAutomation(\".buttons()[0]\")));\n\tdriver.findElementByIosUIAutomation(\".buttons()[0]\").click();\n\n\tfinal Date date1 = new Date();\n System.out.println(\"findElementByIosUIAutomation\" );\n \n //UIAApplication[1]/UIAWindow[1]/UIACollectionView[1]/UIACollectionCell[2]/UIATableView[1]/UIATableCell[2]\n waitvar.until(ExpectedConditions.elementToBeClickable(MobileBy.IosUIAutomation(\".collectionViews()[0].cells()[1].tableViews()[0].cells()[1].withPredicate(\\\"ALL staticTexts.isVisible == TRUE\\\")\")));\n //waitvar.until(ExpectedConditions.elementToBeClickable(driver.findElementByIosUIAutomation(\".collectionViews()[0].cells()[1].tableViews()[0].cells()[1].withPredicate(\\\"ALL staticTexts.isVisible == TRUE\\\")\")));\n WebElement firstArtile = driver.findElementByIosUIAutomation(\".collectionViews()[0].cells()[1].tableViews()[0].cells()[1].withPredicate(\\\"ALL staticTexts.isVisible == TRUE\\\")\");\n firstArtile.click();\n System.out.println(\"clicked element1\");\n\n final Date date2 = new Date();\n\n //UIAApplication[1]/UIAWindow[1]/UIANavigationBar[1]/UIAButton[1]\n waitvar.until(ExpectedConditions.elementToBeClickable(driver.findElementByIosUIAutomation(\".navigationBars()[0].buttons()[0]\")));\n\tdriver.findElementByIosUIAutomation(\".navigationBars()[0].buttons()[0]\").click();\n final Date date3 = new Date();\n/*\n System.out.println(\"\\n\\n\\n\\nxpath\\n\\n\\n\\n\");\n\n waitvar.until(ExpectedConditions.elementToBeClickable(By.xpath(\"//UIAApplication[1]/UIAWindow[1]/UIACollectionView[1]/UIACollectionCell[2]/UIATableView[1]/UIATableCell[2]\")));\n driver.findElement(By.xpath(\"//UIAApplication[1]/UIAWindow[1]/UIACollectionView[1]/UIACollectionCell[2]/UIATableView[1]/UIATableCell[2]\")).click();\n\n final Date date4 = new Date();\n\n waitvar.until(ExpectedConditions.elementToBeClickable(driver.findElementByName(\"header back\")));\n\n driver.findElement(By.name(\"header back\")).click();\n */\n final Date date5 = new Date();\n System.out.println(\"IOS Automator :\" + (date2.getTime() - date1.getTime()));\n System.out.println(\"Back :\" + (date3.getTime() - date2.getTime()));\n\n //System.out.println(\"XPath :\" + (date4.getTime() - date3.getTime()));\n //System.out.println(\"Back :\" + (date5.getTime() - date4.getTime()));\n\tThread.sleep(5000);\n\tdriver.quit();\n\tSystem.out.println(\"done\");\n }", "public static void main(String[] args) throws MalformedURLException {\n\t\tDesiredCapabilities cap=new DesiredCapabilities();\r\n\t\tcap.setCapability(\"deviceName\",\"abc\");\r\n\t\tcap.setCapability(\"platformName\", \"Android\");\r\n\t\t//cap.setCapability(\"udid\",\"emulator-5554\");\r\n\t\tcap.setCapability(\"appPackage\",\"com.udemy.android\");\r\n\t\tcap.setCapability(\"appActivity\",\"com.udemy.android.SplashActivity\");\r\n\t\tcap.setCapability(\"uiautomator2ServerLaunchTimeout\", 600000);\r\n\t\tcap.setCapability(\"adbExecTimeout\", 600000);\r\n\t\tAndroidDriver<AndroidElement> driver = new AndroidDriver<AndroidElement>(new URL(\"http://0.0.0.0:4723/wd/hub\"),cap);\r\n\t\tdriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\r\n\t\tdriver.findElement(MobileBy.id(\"com.udemy.android:id/browse_button\")).click();\r\n\t\tdriver.findElement(MobileBy.AccessibilityId(\"Search tab\")).click();\r\n\t\tdriver.findElement(MobileBy.id(\"com.udemy.android:id/search_bar_text\")).click();\r\n\t\tdriver.findElement(MobileBy.id(\"com.udemy.android:id/search_bar_text\")).sendKeys(\"selenium\");\r\n\t\tdriver.hideKeyboard();\r\n\r\n\t}", "public RemoteWebDriver startApp(String url) {\n\t\treturn startApp(\"chrome\", url);\r\n\t}", "@Before\n\t public void setUp() throws Exception {\n\t \n\t DesiredCapabilities capabilities = new DesiredCapabilities();\n\t capabilities.setCapability(\"platformName\", \"Android\");\n\t //capabilities.setCapability(\"deviceName\", \"192.168.249.101:5555\");\n\t capabilities.setCapability(\"deviceName\", \"192.168.249.101:5555\");\n\t //capabilities.setCapability(\"deviceName\", \"f97f0457d73\");\n\t //capabilities.setCapability(\"platformVersion\", \"4.3\");\n\t //capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, \"emulator-5554\");\n\t capabilities.setCapability(\"noReset\", \"true\");\n\t capabilities.setCapability(\"unicodeKeyboard\",\"true\"); //输入中文\n\t capabilities.setCapability(\"resetKeyboard\",\"true\"); //输入中文\n\t capabilities.setCapability(\"appPackage\", \"com.worktile\"); //worktile的包\n\t capabilities.setCapability(\"appActivity\", \".ui.external.WelcomeActivity\"); //启动的activity .ui.external.WelcomeActivity\n\t try {\n\t\t\t\t//driver = new AndroidDriver<MobileElement>(new URL(\"http://192.168.31.225:4723/wd/hub\"), capabilities);\n\t\t\t\t//driver = new AndroidDriver<MobileElement>(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\t\t\t\tdriver = new AndroidDriver<MobileElement>(new URL(\"http://192.168.1.104:4723/wd/hub\"), capabilities);\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS); \n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\tdriver.quit();\n\t\t\t\tSystem.err.println(\"launch Android driver fail!\"+e.toString());\n\t\t\t}\n\t }", "@BeforeClass\npublic void beforeClass() throws MalformedURLException {\n\tDesiredCapabilities caps = new DesiredCapabilities();\n\tcaps.setCapability(\"deviceName\", \"Xiaomi Redmi Note 5 Pro\");\n caps.setCapability(\"platformName\", \"android\");\n caps.setCapability(\"automationName\", \"UiAutomator2\");\n caps.setCapability(\"appPackage\", \"com.android.chrome\");\n caps.setCapability(\"appActivity\", \"com.google.android.apps.chrome.Main\");\n caps.setCapability(\"noReset\", true);\n\n // Instantiate Appium Driver\n URL appServer = new URL(\"http://0.0.0.0:4723/wd/hub\");\n driver = new AndroidDriver<MobileElement>(appServer, caps);\n \n}", "public static void main(String[] args) throws MalformedURLException {\n\r\n\t\tDesiredCapabilities cap= new DesiredCapabilities();\r\n\t\tcap.setCapability(\"deviceName\", \"redmi\");\r\n\t\tcap.setCapability(\"platformName\", \"Android\");\r\n\t\t\r\n\t\t //can get from appium server inspector \r\n\t\t cap.setCapability(\"appPackage\",\"org.khanacademy.android\"); \r\n\t\t //Use apkAnalyzer app to get activity\r\n\t\t cap.setCapability(\"appActivity\", \"org.khanacademy.android.ui.library.MainActivity\");\r\n\t\t \r\n\r\n\t\t/*\r\n\t\t * //can get from appium server inspector \r\n\t\t * cap.setCapability(\"appPackage\", \"com.aranah.healthkart.plus\"); //Use apkAnalyzer app to get activity\r\n\t\t * cap.setCapability(\"appActivity\", \"com.aranah.healthkart.home.HomeActivity\");\r\n\t\t */\r\n\t\t/*\r\n\t\t * cap.setCapability(\"appPackage\", \"com.aranah.healthkart.plus\"); //Use\r\n\t\t * apkAnalyzer app to get activity cap.setCapability(\"appActivity\",\r\n\t\t * \"com.aranah.healthkart.home.HomeActivity\");\r\n\t\t */\t//To stop reseting aap\r\n\t\tcap.setCapability(\"noReset\", true);\r\n\r\n\t\tAndroidDriver<WebElement> driver = new AndroidDriver<WebElement>(new URL(\"http://localhost:4723/wd/hub\"), cap);\r\n\r\n\t\tdriver.manage().timeouts().implicitlyWait(40, TimeUnit.SECONDS);\r\n\t\t/*\r\n\t\t * driver.findElementByXPath(\"//*[@text='Health Products']\").click();\r\n\t\t * \r\n\t\t * //UiScrollable class String visibleText = \"Arts and humani\";\r\n\t\t * driver.findElementByAndroidUIAutomator\r\n\t\t * (\"new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().textContains(\\\"\"\r\n\t\t * + visibleText + \"\\\").instance(0))\").click();\r\n\t\t * \r\n\t\t */\r\n\t}", "public void run() {\n Runtime.getRuntime().addShutdownHook(new MNOSManagerShutdownHook(this));\n\n OFNiciraVendorExtensions.initialize();\n\n this.startDatabase();\n\n try {\n final ServerBootstrap switchServerBootStrap = this\n .createServerBootStrap();\n\n this.setServerBootStrapParams(switchServerBootStrap);\n\n switchServerBootStrap.setPipelineFactory(this.pfact);\n final InetSocketAddress sa = this.ofHost == null ? new InetSocketAddress(\n this.ofPort) : new InetSocketAddress(this.ofHost,\n this.ofPort);\n this.sg.add(switchServerBootStrap.bind(sa));\n }catch (final Exception e){\n throw new RuntimeException(e);\n }\n\n }", "public static void main(String[] args) {\n\t\tstartAppium();\r\n\t\t//Draw.takeScreenShot();\r\n\r\n\t\t//方向接受参数:Right, Left, Up, Down\r\n\t\t\r\n\t\t//scrollToFind(\"890\");\r\n\t\twait(5);\r\n\t\t//clickByXpath(\"//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeNavigationBar[1]/XCUIElementTypeButton[1]\");\r\n\t\twait(5);\r\n\t\tiosdriver.findElement(By.name(\"我\")).click();\r\n\t\twait(2);\r\n\t\tiosdriver.findElement(By.name(\"发现\")).click();\r\n\t\twait(2);\r\n\t\tMobileElement s = (MobileElement) iosdriver.findElement(By.className(\"TabBar\"));\r\n\t\ts.findElement(By.name(\"相机\")).click();\r\n\t\twait(2);\r\n\t\tstopAppium();\r\n\t}", "@Override\n public void run() {\n AppInstallManager.uninstallAllUser(MainActivity.this);\n\n // 删除apkPath所有文件\n RootCmd.execRootCmd(\"rm -fr \" + apkPath);\n // apk写入sdcard\n Assets.CopyAssets(MainActivity.this, \"apk\", apkPath);\n // 安装apk\n AppInstallManager.installDir(apkPath, \"apk\");\n\n // 安装busybox等相关文件\n Assets.CopyAssets(MainActivity.this, \"bin\", binPath);\n AppInstallManager.installDir(binPath, \"bin\");\n\n // 脚本 写入sdcard\n Assets.CopyAssets(MainActivity.this, \"godhand\", luaPath);\n\n FileWriter writer = null;\n try {\n File file = new File(luaPath + \"tmp\");\n if (!file.exists()) {\n file.mkdirs();\n }\n writer = new FileWriter(luaPath + \"tmp/run_file\", false);\n writer.write(\"InitDevice.lua\");\n writer.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n RootCmd.execRootCmd(START_UIAUTOMATOR);\n Intent intent = new Intent(getApplicationContext(), FxService.class);\n stopService(intent);\n }", "public static void stopAppiumServer() throws IOException {\n\tif (process != null) {\n\tprocess.destroy();\n\n\t}\n\n\tSystem.out.println(\"Appium server stopped\");\n\n\t}", "public static void main(String[] args) throws MalformedURLException, InterruptedException {\n\t\t\nDesiredCapabilities capabilities= new DesiredCapabilities();\n\t\t\n\t\tcapabilities.setCapability(\"deviceName\", \"GT-I9300I\");\n\t\tcapabilities.setCapability(\"platformName\", \"Android\");\n\t\tcapabilities.setCapability(\"platformVersion\", \"4.4.4\");\n\t\t\n\t\tcapabilities.setCapability(\"appPackage\", \"org.khanacademy.android\");\n\t\tcapabilities.setCapability(\"appActivity\", \"org.khanacademy.android.ui.library.MainActivity\");\n\t\t\n\t\tAndroidDriver driver = new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\t\n\t\tThread.sleep(20000);\n\t\tSystem.out.println(driver.getContext());\n\t\t\n\t\tSet<String> contextNames = driver.getContextHandles();\n\t\tSystem.out.println(contextNames.size());\n\t\t //You can prints out something like NATIVE_APP , WEBVIEW_1 \n\t\t for (String contextName : contextNames) { \n\t\t System.out.println(contextName);\n//\t\t if (contextName.contains(\"WEBVIEW\")){\n//\t driver.context(contextName);\n//\t }\n\t\t }\n\n\t\t \n\n\t}", "@BeforeMethod\npublic void setUp() throws MalformedURLException, InterruptedException{\n\t\n\t File classpathRoot = new File(System.getProperty(\"user.dir\"));\n\t File appDir = new File(classpathRoot, \"/Apps/Pazo/\");\n\t File app = new File(appDir, \"app-ppz-debug.apk\");\n\t DesiredCapabilities capabilities = new DesiredCapabilities();\n\t capabilities.setCapability(CapabilityType.BROWSER_NAME, \"\");\n\t capabilities.setCapability(\"deviceName\", \"MI\");\n\t capabilities.setCapability(\"platformVersion\", \"7.0\");\n\t capabilities.setCapability(\"platformName\", \"Android\");\n\t capabilities.setCapability(\"app\", app.getAbsolutePath());\n\t capabilities.setCapability(\"appPackage\", \"com.pazo.ppz\");\n\t capabilities.setCapability(\"appPackage1\", \"com.google.android.packageinstaller\");\n\t capabilities.setCapability(\"appActivity\", \"com.tagtual.trackd.Activities.Splash\");\n\t capabilities.setCapability(\"appActivity1\", \"com.tagtual.trackd.Activities.LicenceLogin\");\n\t capabilities.setCapability(AndroidMobileCapabilityType.AUTO_GRANT_PERMISSIONS,true);\n\t capabilities.setCapability(\"unicodeKeyboard\", true);\n\t capabilities.setCapability(\"resetKeyboard\", true);\n\t try{\n\t driver = new AppiumDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\t }\n\t catch (ExceptionInInitializerError error){\n\t System.out.println(error.getCause());\n\t System.out.println(error.getMessage());\n\t System.out.println(error.getLocalizedMessage());\n\t System.out.println(error.getStackTrace().toString());\n\n\t }\n\t driver.manage().timeouts().pageLoadTimeout(80, TimeUnit.SECONDS);\n\t driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);\n\t// Thread.sleep(10000);\n\t\n}", "public static void main(String[] args) throws Exception\n\t{\n\t\tScanner sc=new Scanner(System.in);\n\t\tSystem.out.println(\"Enter contact name to call as it is you saved in ur contacts list\");\n\t\tString contactname=sc.nextLine();\n\t\tsc.close();\n\t\t//Start appium server\n\t\tRuntime.getRuntime().exec(\"cmd.exe /c start cmd.exe /k \\\"appium -a 127.0.0.1 -p 4723\\\"\");\n\t\t//Get address of appium Server\n\t\tURL u=new URL(\"http://127.0.0.1:4723/wd/hub\");\n\t\t//Details of app and device(AVD)\n\t\tDesiredCapabilities dc=new DesiredCapabilities();\n\t\tdc.setCapability(CapabilityType.BROWSER_NAME,\"\");\n\t\tdc.setCapability(\"deviceName\",\"ce081718334a5b0b05\");\n\t\tdc.setCapability(\"platformName\",\"android\");\n\t\tdc.setCapability(\"platformVersion\",\"8.0.0\");\n\t\tdc.setCapability(\"appPackage\",\"com.samsung.android.contacts\");\n\t\tdc.setCapability(\"appActivity\",\"com.android.contacts.activities.PeopleActivity\");\n\t\t//Create driver object\n\t\tAndroidDriver driver;\n\t\twhile(2>1)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tdriver=new AndroidDriver(u,dc);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcatch(Exception ex)\n\t\t\t{\n\t\t\t}\n\t\t}\n\t\t//App Automation\n\t\ttry\n\t\t{\n\t\t\tWebDriverWait wait=new WebDriverWait(driver,5);\n\t\t\twait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//*[@content-desc='Create contact']\")));\n\t\t\twhile(2>1)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\twait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//*[@text='\"+contactname+\"']\")));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcatch(Exception exe)\n\t\t\t\t{\n\t\t\t\t\t//Get device dimensions\n\t\t\t\t\tint width=driver.manage().window().getSize().getWidth();\n\t\t\t\t\tint height=driver.manage().window().getSize().getHeight();\n\t\t\t\t\t//Vertical Swipe Logic\n\t\t\t\t\tPointerInput finger=new PointerInput(PointerInput.Kind.TOUCH,\"finger\");\n\t\t\t\t\tSequence swipe=new Sequence(finger,1);\n\t\t\t\t\tInteraction i1=finger.createPointerMove(Duration.ofMillis(0),PointerInput.Origin.viewport(),width/2,(int) (height*0.8));\n\t\t\t\t\tswipe.addAction(i1);\n\t\t\t\t\tInteraction i2=finger.createPointerDown(PointerInput.MouseButton.LEFT.asArg());\n\t\t\t\t\tswipe.addAction(i2);\n\t\t\t\t\tInteraction i3=finger.createPointerMove(Duration.ofMillis(200),PointerInput.Origin.viewport(),width/2,(int) (height*0.3));\n\t\t\t\t\tswipe.addAction(i3);\n\t\t\t\t\tInteraction i4=finger.createPointerUp(PointerInput.MouseButton.LEFT.asArg());\n\t\t\t\t\tswipe.addAction(i4);\n\t\t\t\t\tdriver.perform(Arrays.asList(swipe));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Get element dimensions\n\t\t\tMobileElement ele=(MobileElement) driver.findElement(By.xpath(\"//*[@text='\"+contactname+\"']/parent::*/parent::*\"));\n\t\t\tPoint source=ele.getCenter();\n\t\t\tint w=ele.getSize().getWidth();\n\t\t\tint h=ele.getSize().getHeight();\n\t\t\tint x=source.x;\n\t\t\tint y=source.y;\n\t\t\t//Horizontal Swipe Logic\n\t\t\tPointerInput finger=new PointerInput(PointerInput.Kind.TOUCH,\"finger\");\n\t\t\tSequence swipe=new Sequence(finger,1);\n\t\t\tInteraction i1=finger.createPointerMove(Duration.ofMillis(0),PointerInput.Origin.viewport(),(int) (x-w/2*0.8),y);\n\t\t\tswipe.addAction(i1);\n\t\t\tInteraction i2=finger.createPointerDown(PointerInput.MouseButton.LEFT.asArg());\n\t\t\tswipe.addAction(i2);\n\t\t\tInteraction i3=finger.createPointerMove(Duration.ofMillis(1000),PointerInput.Origin.viewport(),(int) (x+w/2*0.8),y);\n\t\t\tswipe.addAction(i3);\n\t\t\tInteraction i4=finger.createPointerUp(PointerInput.MouseButton.LEFT.asArg());\n\t\t\tswipe.addAction(i4);\n\t\t\tdriver.perform(Arrays.asList(swipe));\n\t\t\tThread.sleep(15000);\n\t\t\tdriver.findElementByAndroidUIAutomator(\"new UiSelector().description(\\\"End call\\\")\").click();\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\tThread.sleep(5000);\n\t\t//Close app\n\t\tdriver.closeApp();\n\t\t//Stop appium server\n\t\tRuntime.getRuntime().exec(\"taskkill /F /IM node.exe\");\n\t\tRuntime.getRuntime().exec(\"taskkill /F /IM cmd.exe\");\n\t}", "public void stopAppiumServer(String os) throws ExecuteException, IOException {\n if (os.contains(\"windows\")) {\n CommandLine command = new CommandLine(\"cmd\");\n command.addArgument(\"/c\");\n command.addArgument(\"Taskkill /F /IM node.exe\");\n\n DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();\n DefaultExecutor executor = new DefaultExecutor();\n executor.setExitValue(1);\n executor.execute(command, resultHandler);\n } else if (os.contains(\"mac os x\")) {\n String[] command = {\"/usr/bin/killall\", \"-KILL\", \"node\"};\n Runtime.getRuntime().exec(command);\n LOGGER.info(\"Appium server stopped\");\n }\n }", "@Override\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\tString[] notify_cmd={\"msg\",user,\"启动中\"};\n\t\t\t\t\t\t\t\tdisplayText(\"启动中\");\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tRuntime.getRuntime().exec(notify_cmd);\n\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(p.getInputStream()));\n\t\t\t\t\t\t\t\tString mssage_in=\"appium msg\";\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\twhile(true){\n\t\t\t\t\t\t\t\t\t\tif((mssage_in=br.readLine())!=null){\n\t\t\t\t\t\t\t\t\t\t\tMyFrame.displayText(mssage_in);\n\t\t\t\t\t\t\t\t\t\t\tpw.println(mssage_in);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}", "@BeforeClass\npublic void beforeClass() throws MalformedURLException {\n DesiredCapabilities caps = new DesiredCapabilities();\n caps.setCapability(\"deviceName\", \"Xiaomi Redmi Note 5 Pro\");\n caps.setCapability(\"platformName\", \"android\");\n caps.setCapability(\"automationName\", \"UiAutomator2\");\n caps.setCapability(\"appPackage\", \"com.google.android.keep\");\n caps.setCapability(\"appActivity\", \".activities.BrowseActivity\");\n caps.setCapability(\"noReset\", true);\n\n // Instantiate Appium Driver\n URL appServer = new URL(\"http://0.0.0.0:4723/wd/hub\");\n driver = new AndroidDriver<MobileElement>(appServer, caps);\n \n}", "@Test\n public void startServer() throws InterruptedException {\n UicdInstrumentation uicdInstrumentation =\n UicdInstrumentation.getInstance(\n getInstrumentation().getContext(), DEFAULT_PORT);\n uicdInstrumentation.startServer();\n\n while (!uicdInstrumentation.isStopServer()) {\n SystemClock.sleep(PING_SERVER_MS);\n }\n }", "public static void start() {\n final Context appContext = ContextUtils.getApplicationContext();\n tryObtainingDataDirLock(appContext);\n // We must post to the UI thread to cover the case that the user\n // has invoked Chromium startup by using the (thread-safe)\n // CookieManager rather than creating a WebView.\n ThreadUtils.runOnUiThreadBlocking(new Runnable() {\n @Override\n public void run() {\n boolean multiProcess = CommandLine.getInstance().hasSwitch(\n AwSwitches.WEBVIEW_SANDBOXED_RENDERER);\n if (multiProcess) {\n // Have a background thread warm up a renderer process now, so that this can\n // proceed in parallel to the browser process initialisation.\n AsyncTask.THREAD_POOL_EXECUTOR.execute(new Runnable() {\n @Override\n public void run() {\n ChildProcessLauncher.warmUp(appContext);\n }\n });\n }\n // The policies are used by browser startup, so we need to register the policy\n // providers before starting the browser process. This only registers java objects\n // and doesn't need the native library.\n CombinedPolicyProvider.get().registerProvider(new AwPolicyProvider(appContext));\n\n try {\n BrowserStartupController.get(appContext, LibraryProcessType.PROCESS_WEBVIEW)\n .startBrowserProcessesSync(!multiProcess);\n } catch (ProcessInitException e) {\n throw new RuntimeException(\"Cannot initialize WebView\", e);\n }\n }\n });\n }", "@BeforeTest\n public void appiumBrowserTestSetup() throws Exception{\n DesiredCapabilities capabilities = DesiredCapabilities.android();\n\n // set the capability to execute test in chrome browser\n capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, BrowserType.CHROME);\n\n // set the capability to execute our test in Android Platform\n capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, Platform.ANDROID);\n\n // Set the device name as well (you can give any name)\n capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, \"emulator-5554\");\n\n // set the android version as well\n capabilities.setCapability(MobileCapabilityType.VERSION, \"9\");\n\n // set the chromedriver\n capabilities.setCapability(\"chromedriverExecutable\",\"C:\\\\drivers\\\\chromedriver.exe\");\n\n // Create object of URL class and specify the appium server address\n URL url = new URL(\"http://127.0.0.1:4723/wd/hub\");\n\n // Create object of AndroidDriver class and pass the url and capability that we\n // created\n driver = new AppiumDriver(url, capabilities);\n\n driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);\n driver.get(\"https://www.amazon.co.uk/\");\n Thread.sleep(5000);\n }", "@BeforeClass\n public void beforeClass() throws MalformedURLException {\n\t DesiredCapabilities caps = new DesiredCapabilities();\n\t caps.setCapability(\"devicename\", \"Pixel\");\n\t caps.setCapability(\"platform\", \"Android\");\n\t caps.setCapability(\"addActivity\", \".ui.TaskListsActivity\");\n\t caps.setCapability(\"addPackage\", \"com.google.android.apps.tasks\");\n\t caps.setCapability(\"noReset\", true);\n\t caps.setCapability(\"webviewDevtoolsPort\", 9543);\n\t \n\t //instantiate appium driver\n\t URL appserver = new URL(\"http://0.0.0.0:4723/wd/hub\");\n\t driver = new AndroidDriver<MobileElement>(appserver,caps);\n\t wait = new WebDriverWait(driver, 5);\n }", "@BeforeClass\n public void beforeClass() throws MalformedURLException {\n DesiredCapabilities desiredCapabilities = new DesiredCapabilities();\n desiredCapabilities.setCapability(\"deviceName\", \"Pixel_4_emulator\");\n desiredCapabilities.setCapability(\"platformName\", \"android\");\n desiredCapabilities.setCapability(\"automationName\", \"UiAutomator2\");\n desiredCapabilities.setCapability(\"noReset\", true);\n desiredCapabilities.setCapability(\"appPackage\", \"com.google.android.apps.messaging\");\n desiredCapabilities.setCapability(\"appActivity\", \".ui.ConversationListActivity\");\n\n // Instantiate Appium Driver\n URL appServer = new URL(\"http://0.0.0.0:4723/wd/hub\");\n driver = new AndroidDriver<MobileElement>(appServer, desiredCapabilities);\n wait = new WebDriverWait(driver, 5);\n }", "@Before\n public void setUp() throws Exception {\n\n DesiredCapabilities capabilities = new DesiredCapabilities();\n capabilities.setCapability(\"deviceName\", \"Google Nexus 5\");\n capabilities.setCapability(\"platformVersion\", \"4.4.4\");\n capabilities.setCapability(\"udid\", \"192.168.27.101:5555\");\n capabilities.setCapability(\"app\", \"D:\\\\Projects\\\\Zappy\\\\ZappyBuilds\\\\app-release.apk\");\n// capabilities.setCapability(\"appPackage\", \"com.example.android.contactmanager\");//packageName\n capabilities.setCapability(\"appActivity\", \"com.compareking.zappy.ui.activity.UnauthorizedActivity\"); //activi\n driver = new AndroidDriver<>(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n }", "public static void main(String[] args) throws IOException, InterruptedException {\t\n\t\t\n\t\t System.out.println(\"Starting AndroidApp write simulator as standalone...\");\n\t\t \n\t\t File monitoredFile = new File(\"/home/fulvio/andoffline.txt\");\n\t\t\t\n\t\t// 1 start the SD card file writer process that simulate the AndofflineApp\n\t\tAndroidFileWriterSimulator androidFileWriterSimulator = new AndroidFileWriterSimulator(monitoredFile);\n\t\tandroidFileWriterSimulator.startWriterSimulator();\n\t }", "public static void main(String[] args) throws MalformedURLException, InterruptedException {\n\t\t\t\t\t\tDesiredCapabilities capabilities= new DesiredCapabilities();\n\t\t\t\t\t\t\n\t\t\t\t\t\tcapabilities.setCapability(\"deviceName\", \"GT-I9300I\");\n\t\t\t\t\t\tcapabilities.setCapability(\"platformName\", \"Android\");\n\t\t\t\t\t\tcapabilities.setCapability(\"platformVersion\", \"4.4.4\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t//app details\n\t\t\t\t\t\tcapabilities.setCapability(\"appPackage\", \"com.mobeta.android.demodslv\");\n\t\t\t\t\t\tcapabilities.setCapability(\"appActivity\", \"com.mobeta.android.demodslv.Launcher\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Appium details\n\t\t\t\t\t\t\n\t\t\t\t\t\tAndroidDriver driver= new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\n\t\t\t\t\t\tThread.sleep(3000);\n\t\t\t\t\n\t\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\t\t\t\t//click on the element\n\t\t\t\t\t//\tdriver.findElementById(\"com.mobeta.android.demodslv:id/activity_title\").click();\n\t\t\t\t\t\n\t\t\t\t\t\tWebElement ele1 = driver.findElementById(\"com.mobeta.android.demodslv:id/activity_title\");\n\t\t\t\t\t\tele1.click();\n\t\t\t\t//drag and drop\n\t\t\t\t\t\t\n\t\t\t\t\t\tList<WebElement> drag_ele = driver.findElementsById(\"com.mobeta.android.demodslv:id/drag_handle\");\n\t\t\t\t\t\tSystem.out.println(drag_ele.size());\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Touch action\n\t\t\t\t\t\t\n\t\t\t\t\t\tTouchAction action= new TouchAction(driver);\n\t\t\t\t\t\t//action.longPress(drag_ele.get(0)).moveTo(drag_ele.get(5)).release().perform();\n\t\t\t\t\t\t\n\t\t\t\t\t\tThread.sleep(6000);\n\t\t\t\t\t\taction.longPress(drag_ele.get(6)).moveTo(drag_ele.get(2)).release().perform();\n\t\t\t\t\t\t\n\n\n\t}", "public static void main(String[] args) throws MalformedURLException, InterruptedException {\n\t\t\t\tDesiredCapabilities capabilities= new DesiredCapabilities();\r\n\t\t\t\t\t\t\r\n\t\t\t\t//device details\r\n\t\t\t\tcapabilities.setCapability(\"deviceName\",\"GT-I9300I\");\r\n\t\t\t\tcapabilities.setCapability(\"platformName\",\"Android\");\r\n\t\t\t\tcapabilities.setCapability(\"platformVersion\",\"4.4.4\");\t\t\r\n\t\t\t\t\r\n\t\t\t\t//app details\r\n\t\t\t\tcapabilities.setCapability(\"appPackage\",\"com.emn8.mobilem8.nativeapp.bk\");\r\n\t\t\t\tcapabilities.setCapability(\"appActivity\",\"com.emn8.mobilem8.nativeapp.bk.BKNativeMobileApp\");\r\n\t\t\t\t\r\n\t\t\t\t//Appium Server details\r\n\t\t\t\tAndroidDriver driver= new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\r\n\t\t\t\t\r\n\t\t\t\t//wait\r\n\t\t\t\tThread.sleep(4000);\r\n\t\t\t\t\r\n\t\t\t\tSet<String> contextHandles = driver.getContextHandles();\r\n\t\t\t\tint size = contextHandles.size();\r\n\t\t\t\tSystem.out.println(size);\r\n\t\t\t\t\r\n\t\t\t\t//****************************************************\r\n\t\t\t\tfor(String contextname:contextHandles)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"First Page\");\r\n\t\t\t\t\tSystem.out.println(contextname);\r\n\t\t\t\t\tSystem.out.println(\"-------------------\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(contextname.contains(\"NATIVE\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.context(contextname);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tWebDriverWait wait= new WebDriverWait(driver, 50);\r\n\t\t\t\tWebElement ele_voucher = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//*[@index='9'][@content-desc='VOUCHERS'][@class='android.view.View']\")));\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Voucher is displayed \"+ele_voucher.isDisplayed());\r\n\t\t\t\t\r\n\t\t\t\tele_voucher.click();\r\n\t\t\t\t\r\n\t\t\t\t//**************************************************************\r\n\t\t\t\t//Second page\r\n\t\t\t\tThread.sleep(4000);\r\n\t\t\t\tfor(String contextname:contextHandles)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"Second Page\");\r\n\t\t\t\t\tSystem.out.println(contextname);\r\n\t\t\t\t\tSystem.out.println(\"-------------------\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(contextname.contains(\"NATIVE\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.context(contextname);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tWebDriverWait wait2= new WebDriverWait(driver, 50);\r\n\t\t\t\tWebElement ele_redeem = wait2.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//*[@index='17'][@content-desc='REDEEM'][@class='android.view.View']\")));\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Redeem is displayed \"+ele_redeem.isDisplayed());\r\n\t\t\t\t\r\n\t\t\t\tele_redeem.click();\r\n\t\t\t\t//**************************************************************\r\n\t\t\t\t//Third page\r\n\t\t\t\tThread.sleep(4000);\r\n\t\t\t\tfor(String contextname:contextHandles)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"Third Page\");\r\n\t\t\t\t\tSystem.out.println(contextname);\r\n\t\t\t\t\tSystem.out.println(\"-------------------\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(contextname.contains(\"WEBVIEW\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.context(contextname);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tdriver.findElementByName(\"email\").sendKeys(\"nov@gmail.com\");\r\n\t\t\t\tWebElement ele_pwd = driver.findElementByName(\"password\");\r\n\t\t\t\tele_pwd.click();\r\n\t\t\t\t\r\n\t\t\t\tThread.sleep(4000);\r\n\t\t\t\tele_pwd.sendKeys(\"1234\");\r\n\t\t\t\t\r\n\t\t\t\t//********************************************************\r\n\t\t\t\t\r\n\t\t\t\tThread.sleep(4000);\r\n\t\t\t\t\r\n\t\t\t\tfor(String contextname:contextHandles)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"Third Page\");\r\n\t\t\t\t\tSystem.out.println(contextname);\r\n\t\t\t\t\tSystem.out.println(\"-------------------\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(contextname.contains(\"NATIVE\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdriver.context(contextname);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tWebDriverWait wait3= new WebDriverWait(driver, 50);\r\n\t\t\t\tWebElement ele_Signin = wait3.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//*[@index='33'][@content-desc='SIGN IN'][@class='android.view.View']\")));\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Signin is displayed \"+ele_Signin.isDisplayed());\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\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\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\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\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\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t}", "@BeforeClass\n public void beforeClass() throws MalformedURLException {\n DesiredCapabilities caps = new DesiredCapabilities();\n caps.setCapability(\"deviceName\", \"bb9d156c\");\n caps.setCapability(\"platformName\", \"Android\");\n caps.setCapability(\"appPackage\", \"com.google.android.apps.tasks\");\n caps.setCapability(\"appActivity\", \".ui.TaskListsActivity\");\n // caps.setCapability(\"noReset\", true);\n\n // Instantiate Appium Driver\n URL appServer = new URL(\"http://0.0.0.0:4723/wd/hub\");\n driver = new AndroidDriver<MobileElement>(appServer, caps);\n \n }", "private void installLocalOrRemote() {\n CommandPacket startCommandPacket = null;\n //直到成功为止,控制台可能重启、网络问题等原因\n //TODO\n int time = 0;\n while ((startCommandPacket = getStartCommandPacket()) == null){\n try {\n time ++;\n if(time == 20){\n String defaultRegister = \"zookeeper\";\n String register = agentConfig.getProperty(\"register.name\", defaultRegister);\n if(defaultRegister.equals(register)){\n logger.error(\"经过10s尝试启动simulator失败, 请确认控制台是否正常\");\n }\n break;\n }\n logger.error(\"启动simulator获取远程失败,休眠500ms重试,请确认控制台是否正常\");\n Thread.sleep(500 );\n } catch (InterruptedException ignore) {\n }\n }\n\n if(startCommandPacket == null){\n startCommandPacket = new CommandPacket();\n // 启动\n startCommandPacket.setId(HeartCommandConstants.startCommandId);\n Map<String, Object> extras = new HashMap<String, Object>();\n extras.put(HeartCommandConstants.PATH_TYPE_KEY, HeartCommandConstants.PATH_TYPE_LOCAL_VALUE);\n // 使用本地探针包\n startCommandPacket.setExtras(extras);\n }\n install(startCommandPacket);\n }", "void launchApp();", "private void launchApplication() {\n driver.manage().deleteAllCookies();\n driver.get(config.getProperty(\"testSiteUrl\"));\n driver.manage().window().maximize();\n driver.manage().timeouts().implicitlyWait(Integer.parseInt(config.getProperty(\"implicit.wait\")), TimeUnit.SECONDS);\n }", "@SuppressWarnings(\"rawtypes\")\r\n\t@BeforeMethod\r\n\t public void setUp() throws MalformedURLException {\n\t\tDesiredCapabilities capabilities = new DesiredCapabilities();\r\n\t\tcapabilities.setCapability(\"deviceName\", \"ZX1D63SFXH\");\r\n\t\tcapabilities.setCapability(\"platformName\", \"Android\");\r\n\t\t//capabilities.setCapability(\"app\", targetApp.getAbsolutePath());\r\n\t\t//capabilities.setCapability(\"fastReset\", \"true\");\r\n\t\t//capabilities.setCapability(\"fullReset\", \"true\");\r\n\t\tcapabilities.setCapability(\"appPackage\", \"com.testleaf.leaforg\");\r\n\t\tcapabilities.setCapability(\"appActivity\", \"com.testleaf.leaforg.MainActivity\");\r\n\t\t\r\n\t\tdriver = new AndroidDriver(new URL(\"http://0.0.0.0:4723/wd/hub\"), capabilities);\r\n\t\tdriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\r\n\t\t\r\n\t\t\r\n\t}", "@BeforeClass\n public void classLevelSetup() {\n\t\t \t\tcaps = new DesiredCapabilities();\n \t\t\tcaps.setCapability(\"deviceName\", \"My Phone\");\n \t\t\tcaps.setCapability(\"udid\", \"8f81d4e2\"); //Give Device ID of your mobile phone\n \t\t\tcaps.setCapability(\"platformName\", \"Android\");\n \t\t\tcaps.setCapability(\"platformVersion\", \"9\"); // The version of Android on your device\n \t\t\tcaps.setCapability(\"browserName\", \"Chrome\");\n \t\t\tcaps.setCapability(\"noReset\", true);\n \t\t\tcaps.setCapability(MobileCapabilityType.PLATFORM_NAME, MobilePlatform.ANDROID);\n \t\t\tcaps.setCapability(\"chromedriverExecutable\", \"C:\\\\SeleniumGecko\\\\chromedriver78.exe\"); // Set ChromeDriver location\n \t\t\t\n\n \t\t\t//Instantiate Appium Driver or AndroidDriver\n \t\t\ttry {\n \t\t\t\tdriver = new AppiumDriver<>(new URL(appium_node), caps);\n \t\t\t\t\n \t\t\t} catch (MalformedURLException e) {\n \t\t\t\tSystem.out.println(e.getMessage());\n \t\t\t}\n \t\t\t\t\t\n\n\t\t\n }", "@BeforeTest\n\t public void setup() throws MalformedURLException {\n\t DesiredCapabilities caps = new DesiredCapabilities();\n\t caps.setCapability(\"deviceName\", \"Pixel 4 API 28\");\n\t caps.setCapability(\"platformName\", \"Android\");\n\t caps.setCapability(\"appPackage\", \"com.google.android.apps.tasks\");\n\t caps.setCapability(\"appActivity\", \".ui.TaskListsActivity\");\n\t caps.setCapability(\"noReset\", true);\n\t \n\t // Instantiate Appium Driver\n\t driver = new AndroidDriver<MobileElement>(new URL(\"http://127.0.0.1:4723/wd/hub\"), caps);\n\t wait = new WebDriverWait(driver, 10);\n\t }", "@Override\n @SuppressWarnings(\"CallToPrintStackTrace\")\n public void simpleInitApp() {\n \n\n try {\n System.out.println(\"Using port \" + port);\n // create the server by opening a port\n server = Network.createServer(port);\n server.start(); // start the server, so it starts using the port\n } catch (IOException ex) {\n ex.printStackTrace();\n destroy();\n this.stop();\n }\n System.out.println(\"Server started\");\n // create a separat thread for sending \"heartbeats\" every now and then\n new Thread(new NetWrite()).start();\n server.addMessageListener(new ServerListener(), ChangeVelocityMessage.class);\n // add a listener that reacts on incoming network packets\n \n }", "@BeforeMethod\n public void beforeTest() throws MalformedURLException {\n DesiredCapabilities caps = new DesiredCapabilities();\n caps.setCapability(\"deviceId\", \"2fb5cf35\");\n caps.setCapability(\"deviceName\", \"OnePlus 6\");\n caps.setCapability(\"platformName\", \"Android\");\n caps.setCapability(\"appPackage\", \"com.oneplus.calculator\");\n caps.setCapability(\"appActivity\", \"Calculator\");\n caps.setCapability(\"noReset\", true);\n\n // Initialize driver\n URL appServer = new URL(\"http://0.0.0.0:4723/wd/hub\");\n driver = new AndroidDriver<MobileElement>(appServer, caps);\n }", "@BeforeTest\n\tpublic static void loginFunctionality() throws Exception \n\t{\n\t\tDesiredCapabilities cap=new DesiredCapabilities();\n\t\t\n\t\tcap.setCapability(MobileCapabilityType.DEVICE_NAME,\"Redmi\");\n\t\tcap.setCapability(\"udid\", \"6215b09b\");\n\t\tcap.setCapability(\"platformName\", \"Android\");\n\t\tcap.setCapability(\"platformVersion\", \"9 PKQ1.180904.001\");\n\t\tcap.setCapability(\"appPackage\", \"com.danamon.uatomnimicroapps\");\n\t\tcap.setCapability(\"appActivity\", \"com.danamon.uatomnimicroapps.MainActivity\");\n\t\tcap.setCapability(\"noReset\", true);\n\t\tcap.setCapability(\"fullReset\",false);\n\t\t\n\t\t\n\t\t\n\t\tURL url=new URL(\"http://127.0.0.1:4723/wd/hub\");\n\t\t\n\t\t\n\t\tdriver=new AndroidDriver<AndroidElement>(url,cap);\n\t\tSystem.out.println(\"application started..\");\n\t\t//Thread.sleep(50000);\n\t\tdriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\n\t\t\n\t\t/*\n\t\t MobileElement el1 = (MobileElement) driver.findElementByXPath(\"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View[5]/android.view.View/android.view.View[2]/android.view.View[1]/android.view.View[1]/android.view.View[2]\");\n\t\t \n\t\tel1.click();\n\t\tMobileElement el2 = (MobileElement) driver.findElementByXPath(\"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View[5]/android.view.View/android.view.View[2]/android.view.View[2]/android.view.View[2]/android.view.View/android.view.View[1]/android.widget.EditText\");\n\t\tel2.sendKeys(\"perfomni1\");\n\t\t\n\t\tMobileElement el3=(MobileElement)driver.findElementByXPath(\"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View[5]/android.view.View/android.view.View[2]/android.view.View[2]/android.view.View[2]/android.view.View/android.view.View[1]/android.view.View[3]/android.widget.EditText\");\n\t\t\n\n\tel3.sendKeys(\"Reskin01\");\n\tdriver.findElementByXPath(\"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View[5]/android.view.View/android.view.View[2]/android.view.View[2]/android.view.View[2]/android.view.View/android.view.View[1]/android.widget.Button[1]\").click();\n\t\tThread.sleep(220000);\n\t\t\n\n\t\t//MobileElement el4=(MobileElement)driver.findElementByXPath(\"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View[5]/android.view.View/android.view.View[2]/android.view.View[2]/android.view.View[2]/android.view.View/android.view.View[1]/android.view.View[3]/android.widget.EditText\");\n\t\t\n\n\t\t//el4.sendKeys(\"Reskin01\");\n\t\t \n\t\t */\n\t\t\n\t\tMobileElement el5 = (MobileElement) driver.findElementByXPath(\"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View[5]/android.view.View/android.view.View[2]/android.view.View[2]/android.view.View[2]/android.view.View/android.view.View[1]/android.view.View[2]/android.widget.EditText\");\n\t\tel5.sendKeys(\"Reskin01\");\n\n\t\tdriver.findElementByXPath(\"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View[5]/android.view.View/android.view.View[2]/android.view.View[2]/android.view.View[2]/android.view.View/android.view.View[1]/android.widget.Button\").click();\n\t\n\t\t\t\t}", "public static void main(String[] args) throws MalformedURLException {\n\t\tFile appDir = new File(\"src/test/java\");\n\t\tFile app = new File(appDir, \"com.google.android-2.3.apk\");\n\t\tDesiredCapabilities capabilities = new DesiredCapabilities();\n\t\t//capabilities.setCapability(\"browserName\", \"Chrome\");\n\n\t\t//capabilities.setCapability(\"device\",\"Android\");\n\t\tcapabilities.setCapability(\"deveiceName\",\"SimulatorGalaxy\" );\t\t\n\t\tcapabilities.setCapability(\"platformVersion\", \"5.0.1\");\n\t\tcapabilities.setCapability(\"platformName\", \"Android\");\n\t\tcapabilities.setCapability(\"app\",app.getAbsolutePath());\n\t\tcapabilities.setCapability(\"appPackage\",\"com.android.chrome\");\n\t\tcapabilities.setCapability(\"appActivity\",\"com.google.android.apps.chrome.\");\n\t\tdriver = new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\t\n\n\t\t/*driver.get(\"Url\");\n\t\tdriver.findElement(By.id(\"menu_projects\")).click();\n\t\tdriver.findElement(By.id(\"menu_about\")).click();\n\t\tdriver.findElement(By.id(\"menu_support\")).click();\n\t\tdriver.findElement(By.id(\"menu_documentation\")).click();\n\t\tdriver.findElement(By.id(\"menu_download\")).click();\n\n\t\tdriver.quit();*/\n\t}", "public void startServer() {\n server.start();\n }", "private void startWebApp(Handler<AsyncResult<HttpServer>> next) {\n Router router = Router.router(vertx);\n\n router.route(\"/assets/*\").handler(StaticHandler.create(\"assets\"));\n router.route(\"/api/*\").handler(BodyHandler.create());\n\n router.route(\"/\").handler(this::handleRoot);\n router.get(\"/api/timer\").handler(this::timer);\n router.post(\"/api/c\").handler(this::_create);\n router.get(\"/api/r/:id\").handler(this::_read);\n router.put(\"/api/u/:id\").handler(this::_update);\n router.delete(\"/api/d/:id\").handler(this::_delete);\n\n // Create the HTTP server and pass the \"accept\" method to the request handler.\n vertx.createHttpServer().requestHandler(router).listen(8888, next);\n }", "@Test\n @RunIn(TestGroup.QA_UNRELIABLE)\n public void importAndRunInstantApp() throws Exception {\n String runConfigName = \"topekabundle\";\n IdeFrameFixture ideFrame = guiTest.importProjectAndWaitForProjectSyncToFinish(\"TopekaInstantApp\");\n\n String avdName = EmulatorGenerator.ensureAvdIsCreated(\n ideFrame.invokeAvdManager(),\n new AvdSpec.Builder()\n .setSystemImageGroup(AvdSpec.SystemImageGroups.X86)\n .setSystemImageSpec(O_AVD_IMAGE)\n .build()\n );\n\n ideFrame.runApp(runConfigName, avdName);\n\n Pattern CONNECTED_APP_PATTERN = Pattern.compile(\".*Connected to process.*\", Pattern.DOTALL);\n\n ExecutionToolWindowFixture.ContentFixture runWindow = ideFrame.getRunToolWindow().findContent(runConfigName);\n runWindow.waitForOutput(new PatternTextMatcher(CONNECTED_APP_PATTERN), TimeUnit.MINUTES.toSeconds(2));\n\n runWindow.waitForStopClick();\n }", "public void stopAppium() throws Exception {\n String OS = System.getProperty(\"os.name\").toLowerCase();\n try {\n stopAppiumServer(OS);\n LOGGER.info(\"Appium server stopped successfully\");\n } catch (Exception e) {\n LOGGER.warn(\"Unable to stop appium server\");\n throw new TapException(TapExceptionType.PROCESSING_FAILED, \"Unable to stop appium server\");\n }\n }", "@Test\n public void testMobileAndroid() {\n try {\n\n System.out.println(\"Running test on Android mobile browser\");\n DeviceDescription description = new DeviceDescription();\n description.setOsType(\"Android\");\n description.setOsVersion(\">=6.0\");\n\n Device device = MobileLab.lockDevice(description);\n Browser browser2 = BrowserFactory.launch(BrowserType.CHROME, device);\n navigateBrowser(browser2);\n Reporter.reportEvent(\"Image of Mobile\", \"Using Chrome on Android\", Status.Passed, browser2.getSnapshot());\n windowsSync(1500);\n\n }\n catch (GeneralLeanFtException glftex) {System.out.println(\"GeneralLeanFtException: \" + glftex.getMessage());}\n catch (InterruptedException iex) {System.out.println(\"InterruptedException: \" + iex.getMessage());}\n catch (ReportException rex){System.out.println(\"ReportException: \" + rex.getMessage());}\n catch (StringIndexOutOfBoundsException soobEx) {System.out.println(\"StringIndexOutOfBoundsException: \" + soobEx.getMessage());}\n }", "public void start() {\n system = ActorSystem.create(\"http-server\", config);\n\n Settings settings = SettingsExtension.SettingsExtensionProvider.get(system);\n\n vHostHandlers = settings.vHostConfigs()\n .stream()\n .map(vc -> new AkkaTcpHandler(system, vc))\n .collect(Collectors.toList());\n\n vHostHandlers.forEach(VHostHandler::start);\n\n Runtime.getRuntime().addShutdownHook(new Thread(this::terminate));\n }", "private void launchRemote(Stage stage) throws Exception { \n\t\tmenuMessage.setText(\"Game will start as soon as the client is connected...\"); \n\t\t\n\t\t// thread of the server connecting to the game and of the game \n\t\tThread serverThread = new Thread(() -> { \n\t\t\tRemotePlayerServer server = new RemotePlayerServer(new GraphicalPlayerAdapter()); \n\t\t\tserver.run(); \n\t\t }); \n\t\tserverThread.setDaemon(true); \n\t\tserverThread.start(); \n\t }", "@BeforeClass\r\n public void beforeClass() throws MalformedURLException {\n DesiredCapabilities caps = new DesiredCapabilities();\r\n caps.setCapability(\"deviceName\", \"PixelEmulator\");\r\n caps.setCapability(\"platformName\", \"Android\");\r\n caps.setCapability(\"appPackage\", \"com.google.android.keep\");\r\n caps.setCapability(\"appActivity\", \".activities.BrowseActivity\");\r\n caps.setCapability(\"noReset\", true);\r\n\r\n // Instantiate Appium Driver\r\n URL remoteURL = new URL(\"http://localhost:4723/wd/hub\");\r\n driver = new AndroidDriver<MobileElement>(remoteURL, caps);\r\n \r\n }", "RemoteWebDriver getDriver(String appName, String platformName) {\n\t\tDesiredCapabilities androidDcap = new DesiredCapabilities();\n\t\tandroidDcap.setCapability(MobileCapabilityType.AUTOMATION_NAME, \"UIAutomator2\");\n\t\tandroidDcap.setCapability(MobileCapabilityType.PLATFORM_NAME, platformName);\n\t\t//androidDcap.setCapability(AndroidMobileCapabilityType.AUTO_GRANT_PERMISSIONS, true);\n\t\tandroidDcap.setCapability(MobileCapabilityType.NO_RESET, true);\n\t\tandroidDcap.setCapability(MobileCapabilityType.FULL_RESET, false);\n\t\tandroidDcap.setCapability(AndroidMobileCapabilityType.NO_SIGN, true);\n\t\tandroidDcap.setCapability(AndroidMobileCapabilityType.APP_WAIT_DURATION, 120);\n\t\tandroidDcap.setCapability(\"newCommandTimeout\", 1500);\n\t\tandroidDcap.setCapability(\"app\", System.getProperty(\"user.dir\") +\"\\\\apk\\\\\"+appName+\".apk\");\n\t\tandroidDcap.setCapability(\"autoGrantPermissions\", true);\n\t\tandroidDcap.setCapability(\"appPackage\", PropertyHelper.getProperties(appName+\"_PACKAGE\"));\n\t\tandroidDcap.setCapability(\"appActivity\", PropertyHelper.getProperties(appName+\"_ACTIVITY\"));\n\t\tandroidDcap.setCapability(\"deviceName\", \"Android\");\n\t\t\n\t\ttry {\n\t\t\tif (System.getProperty(\"location\").equalsIgnoreCase(\"local\")) {\n\t\t\t\tdriver = new AndroidDriver<>(new URL(\"http://127.0.0.1:4651/wd/hub\"), androidDcap);\n\t\t\t\tlogger.info(\"Session ID of Android: \" + driver.getSessionId());\n\t\t\t} else if (System.getProperty(\"location\").equalsIgnoreCase(\"remote\")) {\n\t\t\t\tdriver = new AndroidDriver<>(new URL(PropertyHelper.getProperties(\"REMOTE_HUB_URL\")), androidDcap);\n\t\t\t\tlogger.info(\"Session ID of Android: \" + driver.getSessionId());\n\t\t\t}\n\t\t} catch (WebDriverException e) {\n\t\t\tlogger.error(\"Driver instantiating failed or app is not installed\", e);\n\t\t} catch (MalformedURLException e) {\n\t\t\tlogger.error(e);\n\t\t}\n\t\tdriver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);\n\t\tDriverFactory.getDriverPool().put(appName, driver);\n\t\treturn driver;\n\t}", "public static void main(String[] args) throws MalformedURLException {\n\t\tFile src = new File(\"src\");\r\n\t\tFile appsrc = new File(src,\"ApiDemos-debug.apk\");\r\n\t\t\r\n\t\tDesiredCapabilities cap = new DesiredCapabilities();\r\n\t\tcap.setCapability(MobileCapabilityType.DEVICE_NAME, \"Android Device\");\r\n\t\tcap.setCapability(MobileCapabilityType.PLATFORM_NAME,MobilePlatform.ANDROID);\r\n\t\tcap.setCapability(MobileCapabilityType.APP, appsrc.getAbsolutePath());\r\n\t\t\r\n\t\tAndroidDriver driver = new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"),cap);\r\n\t\t\r\n\t}", "private void run() {\n try {\n traceBeginAndSlog(\"InitBeforeStartServices\");\n SystemProperties.set(SYSPROP_START_COUNT, String.valueOf(this.mStartCount));\n SystemProperties.set(SYSPROP_START_ELAPSED, String.valueOf(this.mRuntimeStartElapsedTime));\n SystemProperties.set(SYSPROP_START_UPTIME, String.valueOf(this.mRuntimeStartUptime));\n EventLog.writeEvent((int) EventLogTags.SYSTEM_SERVER_START, Integer.valueOf(this.mStartCount), Long.valueOf(this.mRuntimeStartUptime), Long.valueOf(this.mRuntimeStartElapsedTime));\n if (System.currentTimeMillis() < 86400000) {\n Slog.w(TAG, \"System clock is before 1970; setting to 1970.\");\n SystemClock.setCurrentTimeMillis(86400000);\n }\n if (!SystemProperties.get(\"persist.sys.language\").isEmpty()) {\n SystemProperties.set(\"persist.sys.locale\", Locale.getDefault().toLanguageTag());\n SystemProperties.set(\"persist.sys.language\", \"\");\n SystemProperties.set(\"persist.sys.country\", \"\");\n SystemProperties.set(\"persist.sys.localevar\", \"\");\n }\n Binder.setWarnOnBlocking(true);\n PackageItemInfo.forceSafeLabels();\n SQLiteGlobal.sDefaultSyncMode = \"FULL\";\n SQLiteCompatibilityWalFlags.init((String) null);\n Slog.i(TAG, \"Entered the Android system server!\");\n int uptimeMillis = (int) SystemClock.elapsedRealtime();\n EventLog.writeEvent((int) EventLogTags.BOOT_PROGRESS_SYSTEM_RUN, uptimeMillis);\n if (!this.mRuntimeRestart) {\n MetricsLogger.histogram((Context) null, \"boot_system_server_init\", uptimeMillis);\n Jlog.d(30, \"JL_BOOT_PROGRESS_SYSTEM_RUN\");\n }\n SystemProperties.set(\"persist.sys.dalvik.vm.lib.2\", VMRuntime.getRuntime().vmLibrary());\n VMRuntime.getRuntime().clearGrowthLimit();\n VMRuntime.getRuntime().setTargetHeapUtilization(0.8f);\n Build.ensureFingerprintProperty();\n Environment.setUserRequired(true);\n BaseBundle.setShouldDefuse(true);\n Parcel.setStackTraceParceling(true);\n BinderInternal.disableBackgroundScheduling(true);\n BinderInternal.setMaxThreads(31);\n Process.setThreadPriority(-2);\n Process.setCanSelfBackground(false);\n Looper.prepareMainLooper();\n Looper.getMainLooper().setSlowLogThresholdMs(SLOW_DISPATCH_THRESHOLD_MS, SLOW_DELIVERY_THRESHOLD_MS);\n System.loadLibrary(\"android_servers\");\n if (Build.IS_DEBUGGABLE) {\n initZygoteChildHeapProfiling();\n }\n performPendingShutdown();\n createSystemContext();\n HwFeatureLoader.SystemServiceFeature.loadFeatureFramework(this.mSystemContext);\n this.mSystemServiceManager = new SystemServiceManager(this.mSystemContext);\n this.mSystemServiceManager.setStartInfo(this.mRuntimeRestart, this.mRuntimeStartElapsedTime, this.mRuntimeStartUptime);\n LocalServices.addService(SystemServiceManager.class, this.mSystemServiceManager);\n SystemServerInitThreadPool.get();\n traceEnd();\n try {\n traceBeginAndSlog(\"StartServices\");\n startBootstrapServices();\n startCoreServices();\n startOtherServices();\n SystemServerInitThreadPool.shutdown();\n Slog.i(TAG, \"Finish_StartServices\");\n traceEnd();\n StrictMode.initVmDefaults(null);\n if (!this.mRuntimeRestart && !isFirstBootOrUpgrade()) {\n int uptimeMillis2 = (int) SystemClock.elapsedRealtime();\n MetricsLogger.histogram((Context) null, \"boot_system_server_ready\", uptimeMillis2);\n if (uptimeMillis2 > 60000) {\n Slog.wtf(SYSTEM_SERVER_TIMING_TAG, \"SystemServer init took too long. uptimeMillis=\" + uptimeMillis2);\n }\n }\n LogBufferUtil.closeLogBufferAsNeed(this.mSystemContext);\n if (!VMRuntime.hasBootImageSpaces()) {\n Slog.wtf(TAG, \"Runtime is not running with a boot image!\");\n }\n Looper.loop();\n throw new RuntimeException(\"Main thread loop unexpectedly exited\");\n } catch (Throwable th) {\n Slog.i(TAG, \"Finish_StartServices\");\n traceEnd();\n throw th;\n }\n } catch (Throwable th2) {\n traceEnd();\n throw th2;\n }\n }", "private void startServer() {\n mBluetoothGattServer = mBluetoothManager.openGattServer(this, mGattServerCallback);\n if (mBluetoothGattServer == null) {\n Log.w(TAG, \"Unable to create GATT server\");\n return;\n }\n\n mBluetoothGattServer.addService(TimeProfile.createTimeService());\n\n // Initialize the local UI\n updateLocalUi(System.currentTimeMillis());\n mBluetoothGattServer.addService(SecurityProfile.createSecurityService());\n //mBluetoothGattServer.addService(ConfigurationProfile.createConfigurationService());\n\n }", "RemoteWebDriver getDriver(String appName, String appPackage, String appActivity, String deviceName,\n\t\t\tString fileName) {\n\t\tDesiredCapabilities androidDcap = new DesiredCapabilities();\n\t\tandroidDcap.setCapability(MobileCapabilityType.AUTOMATION_NAME, \"UIAutomator2\");\n\t\tandroidDcap.setCapability(MobileCapabilityType.PLATFORM_NAME, \"Android\");\n\t\tandroidDcap.setCapability(AndroidMobileCapabilityType.AUTO_GRANT_PERMISSIONS, true);\n\t\tandroidDcap.setCapability(MobileCapabilityType.NO_RESET, true);\n\t\tandroidDcap.setCapability(MobileCapabilityType.FULL_RESET, false);\n\t\tandroidDcap.setCapability(AndroidMobileCapabilityType.NO_SIGN, true);\n\t\tandroidDcap.setCapability(AndroidMobileCapabilityType.APP_WAIT_DURATION, 120);\n\t\tandroidDcap.setCapability(\"deviceName\", deviceName);\n\t\tandroidDcap.setCapability(\"browserName\", \"\");\n\t\tandroidDcap.setCapability(\"newCommandTimeout\", 1500);\n\t\tandroidDcap.setCapability(\"appPackage\", appPackage);\n\t\tandroidDcap.setCapability(\"appActivity\", appActivity);\n\t\tandroidDcap.setCapability(\"autoAcceptAlerts\", true);\n\t\tandroidDcap.setCapability(\"autoDismissAlerts\", true);\n\t\tandroidDcap.setCapability(\"app\", System.getProperty(\"user.dir\") + \"/src/main/resources\" + fileName);\n\t\ttry {\n\t\t\tif (System.getProperty(\"location\").equalsIgnoreCase(\"local\")) {\n\t\t\t\tdriver = new AndroidDriver<>(new URL(\"http://127.0.0.1:4651/wd/hub\"), androidDcap);\n\t\t\t\tlogger.info(\"Session ID of Android: \" + driver.getSessionId());\n\t\t\t} else if (System.getProperty(\"location\").equalsIgnoreCase(\"remote\")) {\n\t\t\t\tdriver = new AndroidDriver<>(new URL(PropertyHelper.getProperties(\"REMOTE_HUB_URL\")), androidDcap);\n\t\t\t\tlogger.info(\"Session ID of Android: \" + driver.getSessionId());\n\t\t\t}\n\t\t} catch (WebDriverException e) {\n\t\t\tlogger.error(\"Driver instantiating failed or app is not installed\", e);\n\t\t} catch (MalformedURLException e) {\n\t\t\tlogger.error(e);\n\t\t}\n\t\tdriver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);\n\t\tDriverFactory.getDriverPool().put(appName, driver);\n\t\treturn driver;\n\t}", "public void launchAUT(String url) {\n\t\tSystem.out.println(\"Launching application under test.\");\n\t\tdriver.get(url);\n\t\tSystem.out.println(\"Launched application under test.\");\n\t}", "public void start() {\r\n\t\tString osName = System.getProperty(\"os.name\");\r\n\t\tif (osName.contains(\"Mac\")) {\r\n\t\t\tgameThread.run();\r\n\t\t} else {\r\n\t\t\tgameThread.start();\r\n\t\t}\r\n\t}", "@Override\n public void run() {\n ApplicationInfo ai = null;\n try {\n ai = MainActivity.getAppContext().getPackageManager().getApplicationInfo(MainActivity.getAppContext().getPackageName(), PackageManager.GET_META_DATA);\n } catch (PackageManager.NameNotFoundException e) {\n e.printStackTrace();\n }\n String brokerAddress = (String) ai.metaData.get(\"BROKER_ADDRESS\");\n int brokerPort = (int) ai.metaData.get(\"BROKER_PORT\");\n\n // configurazione delle proprietà del broker e avvio del server relativo\n Properties properties = new Properties();\n properties.setProperty(BrokerConstants.HOST_PROPERTY_NAME, brokerAddress);\n properties.setProperty(BrokerConstants.PORT_PROPERTY_NAME, String.valueOf(brokerPort));\n properties.setProperty(BrokerConstants.PERSISTENT_STORE_PROPERTY_NAME, Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + BrokerConstants.DEFAULT_MOQUETTE_STORE_MAP_DB_FILENAME);\n MemoryConfig memoryConfig = new MemoryConfig(properties);\n Server mqttBroker = new Server();\n try {\n mqttBroker.startServer(memoryConfig);\n } catch (IOException e) {\n e.printStackTrace();\n }\n Log.i(TAG, \"Server Started\");\n }", "private void addAutoStartupswitch() {\n\n try {\n Intent intent = new Intent();\n String manufacturer = android.os.Build.MANUFACTURER .toLowerCase();\n\n switch (manufacturer){\n case \"xiaomi\":\n intent.setComponent(new ComponentName(\"com.miui.securitycenter\", \"com.miui.permcenter.autostart.AutoStartManagementActivity\"));\n break;\n case \"oppo\":\n intent.setComponent(new ComponentName(\"com.coloros.safecenter\", \"com.coloros.safecenter.permission.startup.StartupAppListActivity\"));\n break;\n case \"vivo\":\n intent.setComponent(new ComponentName(\"com.vivo.permissionmanager\", \"com.vivo.permissionmanager.activity.BgStartUpManagerActivity\"));\n break;\n case \"Letv\":\n intent.setComponent(new ComponentName(\"com.letv.android.letvsafe\", \"com.letv.android.letvsafe.AutobootManageActivity\"));\n break;\n case \"Honor\":\n intent.setComponent(new ComponentName(\"com.huawei.systemmanager\", \"com.huawei.systemmanager.optimize.process.ProtectActivity\"));\n break;\n case \"oneplus\":\n intent.setComponent(new ComponentName(\"com.oneplus.security\", \"com.oneplus.security.chainlaunch.view.ChainLaunchAppListAct‌​ivity\"));\n break;\n }\n\n List<ResolveInfo> list = getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);\n if (list.size() > 0) {\n startActivity(intent);\n }\n } catch (Exception e) {\n Log.e(\"exceptionAutostarti2pd\" , String.valueOf(e));\n }\n\n }", "public static void main(String[] args) throws Exception {\n File app = new File(\"/Users/wanghb/AndroidStudioProjects/myapp/app/build/outputs/apk/debug/app-debug.apk\");\n DesiredCapabilities capabilities = new DesiredCapabilities();\n// capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, \"Android Emulator\");\n// capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, \"Android Emulator\");\n// capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());\n //安卓通过appPackage及appActivity\n capabilities.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, \"com.example.myapp\");\n capabilities.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, \".MainActivity\");\n capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, MobilePlatform.ANDROID);\n //you are free to set additional capabilities\n AppiumDriver<MobileElement> driver = new AppiumDriver<>(\n new URL(\"http://0.0.0.0:4723/wd/hub\"),\n //if it needs to use locally started server\n //then the target_ip is 127.0.0.1 or 0.0.0.0\n //the default port is 4723\n capabilities);\n MobileElement firstText = driver.findElement(By.id(\"textview_first\"));\n System.out.println(firstText.getText());\n System.out.println(firstText.getTagName());\n System.out.println(firstText.getSize());\n MobileElement firstButton = driver.findElement(By.id(\"button_first\"));\n firstButton.click();\n MobileElement secondtext = driver.findElement(By.id(\"textview_second\"));\n System.out.println(secondtext.getText());\n System.out.println(secondtext.getTagName());\n System.out.println(secondtext.getSize());\n MobileElement secondButton = driver.findElement(By.id(\"button_second\"));\n System.out.println(secondButton.getText());\n System.out.println(secondButton.getTagName());\n System.out.println(secondButton.getSize());\n System.out.println(\"success\");\n }", "@BeforeClass\r\n\tpublic void setup() throws InterruptedException {\r\n\t test=extent.createTest(\"setup\");\r\n\t\tDesiredCapabilities caps = new DesiredCapabilities();\r\n\t\tcaps.setCapability(\"deviceName\", \"My Phone\");\r\n\t\tcaps.setCapability(\"udid\", \"emulator-5554\"); //Give Device ID of your mobile phone\r\n\t\tcaps.setCapability(\"platformName\", \"Android\");\r\n\t\tcaps.setCapability(\"platformVersion\", \"7.0\");\r\n\t\tcaps.setCapability(\"browser_name\", \"Chrome\");\r\n\t\t\r\n\t\tcaps.setCapability(\"appPackage\", \"pegasus.driver\");\r\n\t\tcaps.setCapability(\"appActivity\", \"pegasus.driver.mvvm.auth.AuthActivity\");\r\n\t\t\r\n\t\tcaps.setCapability(\"noReset\", \"false\");\r\n\t\tcaps.setCapability(\"automationName\", \"UiAutomator2\");\r\n\t\tcaps.setCapability(\"newCommandTimeout\", 10000);\r\n\t\tcaps.setCapability(\"autoGrantPermissions\", true);\r\n\t\tcaps.setCapability(\"autoDismissAlerts\", true);\r\n\t\r\n\t\ttry {\r\n\t\t\t String baseURL = \"http://0.0.0.0:\";\r\n\t\t\t String minorURL = \"/wd/hub\";\r\n\t\t\t String port = \"4723\";\r\n\t\t\t //driver = new AppiumDriver<MobileElement>(new URL(baseURL+port+minorURL), caps);\t\r\n\t\t\t driver = new AndroidDriver<MobileElement>(new URL(baseURL+port+minorURL), caps);\t\r\n\t\t\t //driver = new IOSDriver<MobileElement>(new URL(baseURL+port+minorURL), caps);\t\r\n\t\t\t\t \r\n\t\t\t System.out.print(\"passed!!!!!!\");\r\n\t\t} \r\n\t\t\r\n\t\tcatch (MalformedURLException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\tSystem.out.print(\"failed!!!!!!\");\r\n\t\t}\r\n\t\t\r\n\t\tdriver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);\r\n\t\t\r\n\t\t driver.findElement(LoginPage.companyId).sendKeys(\"1111\");\r\n\t\t \r\n\t\t //Enter vehicle id\r\n\t\t driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\r\n\t\t driver.findElement(LoginPage.vehicleId).sendKeys(\"11\");\r\n\t\t\t\r\n\t\t //enter pin number\r\n\t\t\tdriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\r\n\t\t\tdriver.findElement(LoginPage.pinNum).sendKeys(\"1234\");\r\n\t\t\t\r\n\t\t\t//click on login button\r\n\t\t\tdriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\r\n\t\t\tdriver.findElement(LoginPage.LoginBtn).click();\r\n\t\t\ttry {\r\n\t\t\t//allow the access location popup\r\n\t\t\tdriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\r\n\t\t\tdriver.findElement(LoginPage.allowAccessLocation).click();\r\n\t\t\t}\r\n\t\t\tcatch(Exception e) {\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t//close the popup\r\n\t\t\ttry {\r\n\t\t\tdriver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS);\r\n\t\t\tActions action = new Actions(driver);\r\n\t\t WebElement element=driver.findElement(By.className(\"android.widget.Button\"));\r\n\t\t element.click();\r\n\t\t System.out.println(element);\r\n\t\t\t}\r\n\t\t\tcatch(Exception e) {\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t\r\n\t\t}", "public void startDriver();", "public static void main(String[] args) throws MalformedURLException, InterruptedException {\n\t\t\n\t\tDesiredCapabilities capabilities= new DesiredCapabilities();\n\t\t\n\t\tcapabilities.setCapability(MobileCapabilityType.DEVICE_NAME,\"Rajesh Iphone\");\n\t\tcapabilities.setCapability(MobileCapabilityType.PLATFORM_NAME,\"ios\");\n\t\tcapabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION,\"9.3.5\");\n\t\t\n\t\tcapabilities.setCapability(\"udid\",\"499ae5ae6d066971991c5d27e8fbff07899a489d\");\n\t\tcapabilities.setCapability(\"bundleId\",\"TAmobiletest.safarlauncher\");\n\t\t\n\t\tAppiumDriver driver= new IOSDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\t\t\n\t\tSet<String> contextHandles = driver.getContextHandles();\n\t\tSystem.out.println(contextHandles.size());\n\t\t\n\t\tfor(String contextname:contextHandles)\n\t\t{\n\t\t\tSystem.out.println(contextname);\n\t\t\t\n\t\t\tif(contextname.contains(\"WEBVIEW\"))\n\t\t\t{\n\t\t\t\tdriver.context(contextname);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tdriver.get(\"http://www.google.com\");\n\t\t\n\t\tThread.sleep(5000);\n\t\t\n\t\tdriver.findElementById(\"lst-ib\").sendKeys(\"Sachin\");\n\t\tdriver.findElementById(\"tsbb\").click();\n\t\t\n\t\tThread.sleep(9000);\n\t\t\n\t\tString Actual_Result = driver.findElementByXPath(\"//span[contains(text(),'Cricketer')]\").getText();\n\t\tSystem.out.println(\"Actual Result is \"+Actual_Result);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t}", "@BeforeMethod\n\tpublic void openAppp() throws IOException\n\t{\n\t\tSystem.out.println(\"Monefy Application launched successfully:\");\n\t\n\t}", "public void startApp() {\n if (midletPaused) {\n resumeMIDlet();\n } else {\n initialize();\n startMIDlet();\n }\n midletPaused = false;\n }", "@Test(groups={\"ut\"})\r\n\tpublic void testCreateCapabilitiesWithApplication() {\r\n\t\tSeleniumTestsContext context = new SeleniumTestsContext(SeleniumTestsContextManager.getThreadContext());\r\n\t\tcontext.setMobilePlatformVersion(\"8.0\");\r\n\t\tcontext.setPlatform(\"android\");\r\n\t\tcontext.setDeviceName(\"Samsung Galasy S8\");\r\n\t\tcontext.setAppPackage(\"appPackage\");\r\n\t\tcontext.setAppActivity(\"appActivity\");\r\n\t\tcontext.setApp(\"com.covea.mobileapp\");\r\n\t\tDriverConfig config = new DriverConfig(context);\r\n\t\t\r\n\t\tAndroidCapabilitiesFactory capaFactory = new AndroidCapabilitiesFactory(config);\r\n\t\tMutableCapabilities capa = capaFactory.createCapabilities();\r\n\t\t\r\n\t\tAssert.assertEquals(capa.getCapability(CapabilityType.BROWSER_NAME), \"\");\r\n\t\tAssert.assertEquals(capa.getCapability(\"app\"), \"com.covea.mobileapp\");\r\n\t\tAssert.assertEquals(capa.getCapability(MobileCapabilityType.AUTOMATION_NAME), \"Appium\");\r\n\t\tAssert.assertEquals(capa.getCapability(MobileCapabilityType.PLATFORM_NAME), \"android\");\r\n\t\tAssert.assertEquals(capa.getCapability(MobileCapabilityType.PLATFORM_VERSION), \"8.0\");\r\n\t\tAssert.assertEquals(capa.getCapability(MobileCapabilityType.DEVICE_NAME), \"Samsung Galasy S8\");\r\n\t\tAssert.assertEquals(capa.getCapability(MobileCapabilityType.FULL_RESET), true);\r\n\t\tAssert.assertEquals(capa.getCapability(AndroidMobileCapabilityType.APP_PACKAGE), \"appPackage\");\r\n\t\tAssert.assertEquals(capa.getCapability(AndroidMobileCapabilityType.APP_ACTIVITY), \"appActivity\");\r\n\t}", "private void startBootstrapServices() {\n traceBeginAndSlog(\"StartWatchdog\");\n Watchdog watchdog = Watchdog.getInstance();\n watchdog.start();\n traceEnd();\n if (MAPLE_ENABLE) {\n this.mPrimaryZygotePreload = SystemServerInitThreadPool.get().submit($$Lambda$SystemServer$UyrPns7R814gZEylCbDKhe8It4.INSTANCE, \"PrimaryZygotePreload\");\n }\n Slog.i(TAG, \"Reading configuration...\");\n traceBeginAndSlog(\"ReadingSystemConfig\");\n SystemServerInitThreadPool.get().submit($$Lambda$YWiwiKm_Qgqb55C6tTuq_n2JzdY.INSTANCE, \"ReadingSystemConfig\");\n traceEnd();\n traceBeginAndSlog(\"StartInstaller\");\n this.installer = (Installer) this.mSystemServiceManager.startService(Installer.class);\n traceEnd();\n traceBeginAndSlog(\"DeviceIdentifiersPolicyService\");\n this.mSystemServiceManager.startService(DeviceIdentifiersPolicyService.class);\n traceEnd();\n traceBeginAndSlog(\"UriGrantsManagerService\");\n this.mSystemServiceManager.startService(UriGrantsManagerService.Lifecycle.class);\n traceEnd();\n traceBeginAndSlog(\"StartActivityManager\");\n ActivityTaskManagerService atm = this.mSystemServiceManager.startService(ActivityTaskManagerService.Lifecycle.class).getService();\n this.mActivityManagerService = ActivityManagerService.Lifecycle.startService(this.mSystemServiceManager, atm);\n this.mActivityManagerService.setSystemServiceManager(this.mSystemServiceManager);\n this.mActivityManagerService.setInstaller(this.installer);\n this.mWindowManagerGlobalLock = atm.getGlobalLock();\n traceEnd();\n traceBeginAndSlog(\"StartPowerManager\");\n try {\n this.mPowerManagerService = (PowerManagerService) this.mSystemServiceManager.startService(\"com.android.server.power.HwPowerManagerService\");\n } catch (RuntimeException e) {\n Slog.w(TAG, \"create HwPowerManagerService failed\");\n this.mPowerManagerService = (PowerManagerService) this.mSystemServiceManager.startService(PowerManagerService.class);\n }\n traceEnd();\n traceBeginAndSlog(\"StartThermalManager\");\n this.mSystemServiceManager.startService(ThermalManagerService.class);\n traceEnd();\n try {\n Slog.i(TAG, \"PG Manager service\");\n this.mPGManagerService = PGManagerService.getInstance(this.mSystemContext);\n } catch (Throwable e2) {\n reportWtf(\"PG Manager service\", e2);\n }\n traceBeginAndSlog(\"InitPowerManagement\");\n this.mActivityManagerService.initPowerManagement();\n traceEnd();\n traceBeginAndSlog(\"StartRecoverySystemService\");\n this.mSystemServiceManager.startService(RecoverySystemService.class);\n traceEnd();\n RescueParty.noteBoot(this.mSystemContext);\n traceBeginAndSlog(\"StartLightsService\");\n try {\n this.mSystemServiceManager.startService(\"com.android.server.lights.LightsServiceBridge\");\n } catch (RuntimeException e3) {\n Slog.w(TAG, \"create LightsServiceBridge failed\");\n this.mSystemServiceManager.startService(LightsService.class);\n }\n traceEnd();\n traceBeginAndSlog(\"StartSidekickService\");\n if (SystemProperties.getBoolean(\"config.enable_sidekick_graphics\", false)) {\n this.mSystemServiceManager.startService(WEAR_SIDEKICK_SERVICE_CLASS);\n }\n traceEnd();\n traceBeginAndSlog(\"StartDisplayManager\");\n this.mDisplayManagerService = (DisplayManagerService) this.mSystemServiceManager.startService(DisplayManagerService.class);\n traceEnd();\n try {\n this.mSystemServiceManager.startService(\"com.android.server.security.HwSecurityService\");\n Slog.i(TAG, \"HwSecurityService start success\");\n } catch (Exception e4) {\n Slog.e(TAG, \"can't start HwSecurityService service\");\n }\n traceBeginAndSlog(\"WaitForDisplay\");\n this.mSystemServiceManager.startBootPhase(100);\n traceEnd();\n String cryptState = (String) VoldProperties.decrypt().orElse(\"\");\n if (ENCRYPTING_STATE.equals(cryptState)) {\n Slog.w(TAG, \"Detected encryption in progress - only parsing core apps\");\n this.mOnlyCore = true;\n } else if (ENCRYPTED_STATE.equals(cryptState)) {\n Slog.w(TAG, \"Device encrypted - only parsing core apps\");\n this.mOnlyCore = true;\n }\n HwBootCheck.bootSceneEnd(100);\n HwBootFail.setBootTimer(false);\n HwBootCheck.bootSceneStart(105, 900000);\n if (!this.mRuntimeRestart) {\n MetricsLogger.histogram((Context) null, \"boot_package_manager_init_start\", (int) SystemClock.elapsedRealtime());\n }\n traceBeginAndSlog(\"StartPackageManagerService\");\n try {\n Watchdog.getInstance().pauseWatchingCurrentThread(\"packagemanagermain\");\n this.mPackageManagerService = PackageManagerService.main(this.mSystemContext, this.installer, this.mFactoryTestMode != 0, this.mOnlyCore);\n Watchdog.getInstance().resumeWatchingCurrentThread(\"packagemanagermain\");\n this.mFirstBoot = this.mPackageManagerService.isFirstBoot();\n this.mPackageManager = this.mSystemContext.getPackageManager();\n Slog.i(TAG, \"Finish_StartPackageManagerService\");\n traceEnd();\n if (!this.mRuntimeRestart && !isFirstBootOrUpgrade()) {\n MetricsLogger.histogram((Context) null, \"boot_package_manager_init_ready\", (int) SystemClock.elapsedRealtime());\n HwBootCheck.addBootInfo(\"[bootinfo]\\nisFirstBoot: \" + this.mFirstBoot + \"\\nisUpgrade: \" + this.mPackageManagerService.isUpgrade());\n HwBootCheck.bootSceneStart(101, JobStatus.DEFAULT_TRIGGER_MAX_DELAY);\n HwBootFail.setBootTimer(true);\n }\n HwBootCheck.bootSceneEnd(105);\n if (!this.mOnlyCore && !SystemProperties.getBoolean(\"config.disable_otadexopt\", false)) {\n traceBeginAndSlog(\"StartOtaDexOptService\");\n try {\n Watchdog.getInstance().pauseWatchingCurrentThread(\"moveab\");\n OtaDexoptService.main(this.mSystemContext, this.mPackageManagerService);\n } catch (Throwable th) {\n Watchdog.getInstance().resumeWatchingCurrentThread(\"moveab\");\n traceEnd();\n throw th;\n }\n Watchdog.getInstance().resumeWatchingCurrentThread(\"moveab\");\n traceEnd();\n }\n traceBeginAndSlog(\"StartUserManagerService\");\n this.mSystemServiceManager.startService(UserManagerService.LifeCycle.class);\n traceEnd();\n traceBeginAndSlog(\"InitAttributerCache\");\n AttributeCache.init(this.mSystemContext);\n traceEnd();\n traceBeginAndSlog(\"SetSystemProcess\");\n this.mActivityManagerService.setSystemProcess();\n traceEnd();\n traceBeginAndSlog(\"InitWatchdog\");\n watchdog.init(this.mSystemContext, this.mActivityManagerService);\n traceEnd();\n this.mDisplayManagerService.setupSchedulerPolicies();\n traceBeginAndSlog(\"StartOverlayManagerService\");\n this.mSystemServiceManager.startService(new OverlayManagerService(this.mSystemContext, this.installer));\n traceEnd();\n traceBeginAndSlog(\"StartSensorPrivacyService\");\n this.mSystemServiceManager.startService(new SensorPrivacyService(this.mSystemContext));\n traceEnd();\n if (SystemProperties.getInt(\"persist.sys.displayinset.top\", 0) > 0) {\n this.mActivityManagerService.updateSystemUiContext();\n ((DisplayManagerInternal) LocalServices.getService(DisplayManagerInternal.class)).onOverlayChanged();\n }\n this.mSensorServiceStart = SystemServerInitThreadPool.get().submit($$Lambda$SystemServer$oG4I04QJrkzCGs6IcMTKU2211A.INSTANCE, START_SENSOR_SERVICE);\n } catch (Throwable th2) {\n Watchdog.getInstance().resumeWatchingCurrentThread(\"packagemanagermain\");\n throw th2;\n }\n }", "public static void main(String[] args) throws MalformedURLException, InterruptedException {\n\t\t\n\t\tDesiredCapabilities capabilities= new DesiredCapabilities();\n\t\t\n\t\tcapabilities.setCapability(\"deviceName\", \"XT1033\");\n\t\tcapabilities.setCapability(\"platformName\", \"Android\");\n\t\tcapabilities.setCapability(\"platformVersion\", \"4.4.4\");\n\t\t\n\t\t//app details\n\t\tcapabilities.setCapability(\"appPackage\", \"flipboard.app\");\n\t\tcapabilities.setCapability(\"appActivity\", \"flipboard.activities.LaunchActivity\");\n\t\t\n\t\t//Appium details\n\t\t\n\t\tAndroidDriver driver= new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\n\n\t\t//Thread.sleep(5000);\n\t\t\n\t\tWebDriverWait wait= new WebDriverWait(driver, 60);\n\t\tWebElement until = wait.until(ExpectedConditions.presenceOfElementLocated(By.id(\"flipboard.app:id/main_activity_pager\")));\n\t\t\n\t\tSystem.out.println(until.isDisplayed());\n\t\t\t\n\t\tThread.sleep(5000);\n\t\t//swipe from right to left\n\t\t\n\t\tDimension size = driver.manage().window().getSize();\n\t\tSystem.out.println(size);\n\t\t\n\t\t\n\t\tint Startx=(int)(size.width*0.90);\n\t\tSystem.out.println(\"Startx is \"+Startx);\n\t\t\n\t\tint Endx=(int)(size.width*0.10);\n\t\tSystem.out.println(\"Endx is \"+Endx);\n\t\t\n\t\tint Starty=(int)(size.height*0.50);\n\t\tSystem.out.println(\"Starty is \"+Starty);\n\t\t\n\t\t\n\t\tdriver.swipe(Startx, Starty, Endx, Starty, 1000);\n\t\tThread.sleep(4000);\n\t\t\n\t\tdriver.swipe(Startx, Starty, Endx, Starty, 1000);\n\t\tThread.sleep(4000);\n\t\t\n\t\tdriver.swipe(Startx, Starty, Endx, Starty, 1000);\n\t\tThread.sleep(4000);\n\t\t\n\t\tdriver.swipe(Startx, Starty, Endx, Starty, 1000);\n\t\tThread.sleep(4000);\n\t\t\n\t\tSystem.out.println(\"Right to left swipe is completed\");\n\t\t\n\t\tThread.sleep(4000);\n\t\t\n\t\t//*****************************************************\n\t\t\n\t\t//Reverse from Left to Right\n\t\tThread.sleep(4000);\n\t\t\n\t\tint Startx1=(int)(size.width*0.10);\n\t\tSystem.out.println(\"Startx1 is \"+Startx1);\n\t\t\n\t\tint Endx1=(int)(size.width*0.90);\n\t\tSystem.out.println(\"Endx1 is \"+Endx1);\n\t\t\n\t\tint Starty1=(int)(size.height*0.50);\n\t\tSystem.out.println(\"Starty1 is \"+Starty1);\n\t\t\n\t\t\n\t\tdriver.swipe(Startx1, Starty1, Endx1, Starty1, 1000);\n\t\tThread.sleep(4000);\n\t\t\n\t\tdriver.swipe(Startx1, Starty1, Endx1, Starty1, 1000);\n\t\tThread.sleep(4000);\n\t\t\n\t\tdriver.swipe(Startx1, Starty1, Endx1, Starty1, 1000);\n\t\tThread.sleep(4000);\n\t\t\n\t\tdriver.swipe(Startx1, Starty1, Endx1, Starty1, 1000);\n\t\tThread.sleep(4000);\n\t\t\n\t\t\n\t\t\n\n\t}", "public static void testApp(String appName) throws Exception {\n Settings.OcrTextRead = true;\r\n Settings.OcrLanguage = \"en\";\r\n Settings.OcrTextSearch = true;\r\n\r\n\r\n ImagePath.add(TestRun.class.getCanonicalName() + \"/ImagesAPI.sikuli\");\r\n File fResults = new File(System.getProperty(\"user.home\"), \"TestResults\");\r\n String fpResults = fResults.getPath();\r\n FileManager.deleteFileOrFolder(fpResults);\r\n fResults.mkdirs();\r\n //TO DO: print logging to this directory eventually as well as Unit Test results\r\n\r\n App app = new App(appName);\r\n Boolean appOpened = false;\r\n\r\n\r\n// try {\r\n// appOpened = openChanalyzer(app);\r\n// } catch (Exception e) {\r\n// e.printStackTrace();\r\n// }\r\n\r\n //need to wait for Chanalyzer to start up\r\n sleep(1500);\r\n\r\n if (appOpened = true && app.isRunning()) {\r\n// Region currentWindow = App.focusedWindow();\r\n// clickOnTarget(currentWindow, \"help\");\r\n// clickOnTarget(currentWindow, \"register\");\r\n// readFromTopRightOfRegistration(currentWindow);\r\n //focusOnWindowJustBelowImageAndRead(currentWindow, \"registration_image_above_name_field\");\r\n }\r\n\r\n Screen screen = new Screen();\r\n doubleClickOnTarget(screen, \"installer_msi\");\r\n sleep(1200);\r\n Screen screen2 = new Screen();\r\n clickOnTarget(screen2, \"next\");\r\n\r\n\r\n }", "public void startServer(PWModelDetails pwModelDetails) {\n try {\n List<ServerSap> serverSaps = null;\n try {\n serverSaps = ServerSap.getSapsFromSclFile(pwModelDetails.getSclFileName());\n } catch (SclParseException e) {\n logger.info(\"Error parsing SCL/ICD file: \" + e.getMessage());\n e.printStackTrace();\n return;\n }\n serverSap = serverSaps.get(0);\n serverSap.setPort(pwModelDetails.getPortNumber());\n\n InetAddress address = null;\n try {\n ipAddress = pwModelDetails.getIpAddress();\n address = InetAddress.getByName(ipAddress);\n } catch (UnknownHostException e) {\n logger.info(\"Unknown host: \" + ipAddress);\n logger.info(\"Proxy will run with the defualt IP as define in the SCL file.\");\n logger.info(\"Unknown host \" + ipAddress);\n return;\n }\n if (address != null) {\n serverSap.setBindAddress(address);\n }\n Runtime.getRuntime().addShutdownHook(new Thread() {\n @Override\n public void run() {\n if (serverSap != null) {\n serverSap.stop();\n }\n logger.info(\"Server was stopped\");\n }\n });\n ServerModel serverModel = serverSap.getModelCopy();\n// create a SampleServer instance that can be passed as a callback object to startListening() and\n// SmartPowerIEDServer sampleServer = new SmartPowerIEDServer();\n SoftGridIEDServer sampleServer = this;\n// Open MUC initialization\n List<BasicDataAttribute> branchCircuitBreakerVals = new ArrayList<BasicDataAttribute>(3);\n for (String reference : iedRefFcHashMap.keySet()) {\n BasicDataAttribute field = (BasicDataAttribute) serverModel.findModelNode(reference, iedRefFcHashMap.get(reference));\n if (field == null) {\n logger.info(\">>>>>> Error in obtaining SCL reference object = \" + reference);\n }\n branchCircuitBreakerVals.add(field);\n }\n// Power World Device Initialization\n ParameterGenerator parameterGenerator = new ParameterGenerator();\n parameterGenerator.setSclKeyToPWKeyMap(pwModelDetails.getSclToPWMapping());\n parameterGenerator.setKeyParameters(pwModelDetails.getKeyArray());\n parameterGenerator.setValueParameters(pwModelDetails.getDataFieldArray());\n parameterGenerator.setPersistedValues(pwModelDetails.getValueArray());\n parameterGenerator.setDeviceObjectName(pwModelDetails.getDeviceName());\n if (controlAPI == null) {\n controlAPI = IedControlerFactory.getPWComBridgeIterface();\n synchronized (controlAPI) {\n if (!controlAPI.isCaseOpened()) {\n controlAPI.openCase();\n }\n }\n }\n parameterGenerator.setControlAPI(controlAPI);\n// load power world data\n serverSap.startListening(sampleServer, parameterGenerator);\n try {\n serverSap.setValues(branchCircuitBreakerVals);\n } catch (Exception e) {\n logger.info(\"pwModelDetails.getModelNodeReference() = \" + pwModelDetails.getModelNodeReference());\n e.printStackTrace();\n }\n\n String[][] paramPack = parameterGenerator.getParamPack();\n type = IEDUtils.getIEDType(parameterGenerator.getDeviceObjectName());\n id = ++IED_COUNT;\n StringBuffer sb = new StringBuffer();\n String logDataSeperator = \":\";\n boolean loged = false;\n logEvent(\"IED : \" + type.name() + \" : \" + id + \" is Started...!\");\n String[] elements = null;\n while (true) {\n synchronized (this) {\n try {\n Thread.sleep(PW_INTERROGATION_INTERVAL);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n\n elements = parameterGenerator.loadDataValues(paramPack);\n if (elements == null) {\n if(type.name().equals(\"BUS\"))\n {\n System.out.println(\"BUS\");\n }\n continue;\n }\n sb.append(\"Type:\").append(type.name());\n for (int i = 0; i < branchCircuitBreakerVals.size(); i++) {\n BasicDataAttribute modelNodes = branchCircuitBreakerVals.get(i);\n if (modelNodes != null && elements.length > i) {\n String pwKeyName = null;\n for (String sclKey : parameterGenerator.getSclKeyToPWKeyMap().keySet()) {\n if (modelNodes.getReference().toString().endsWith(sclKey)) {\n pwKeyName = sclKey;\n }\n }\n if (pwKeyName == null) {\n continue;\n }\n for (int j = 0; j < paramPack[0].length; j++) {\n if (!loged) {\n sb.append(logDataSeperator).append(paramPack[0][j]).append(logDataSeperator).append(elements[j]);\n }\n if (parameterGenerator.getSclKeyToPWKeyMap().get(pwKeyName).equals(paramPack[0][j])) {\n if (modelNodes instanceof BdaDoubleBitPos) {\n byte[] status = new byte[1];\n if (elements[j].equalsIgnoreCase(\"open\")) {\n status[0] = 0;\n } else {\n status[0] = 1;\n }\n ((BdaDoubleBitPos) modelNodes).setValue(status);\n } else if (modelNodes instanceof BdaVisibleString) {\n ((BdaVisibleString) modelNodes).setValue(elements[j]);\n } else if (modelNodes instanceof BdaFloat32) {\n ((BdaFloat32) modelNodes).setFloat(Float.parseFloat(elements[j]));\n }\n }\n }\n loged = true;\n }\n }\n serverStarted = true;\n// synchronized (logger) {\n// if (ConfigUtil.MANUAL_EXPERIMENT_MODE) {\n // if this string is not printed in the log file,\n logger.info(sb.toString());\n// }\n// }\n sb = new StringBuffer(\"\");\n loged = false;\n serverSap.setValues(branchCircuitBreakerVals);\n if (serverStoped) {\n serverStarted = false;\n break;\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "@BeforeMethod\r\n\tpublic void setUp() throws MalformedURLException {\r\n\t\tDesiredCapabilities capabilities = new DesiredCapabilities();\r\n\t\tcapabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, Platform.ANDROID);\r\n\t\tcapabilities.setCapability(MobileCapabilityType.DEVICE_NAME, \"Android Emulator\");\r\n\t\tcapabilities.setCapability(MobileCapabilityType.APP, new File(\"./src/test/resources/ApiDemos-debug.apk\"));\r\n\r\n\t\tcapabilities.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, \"io.appium.android.apis\");\r\n\t\tcapabilities.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, \".app.AlertDialogSamples\");\r\n\r\n\t\tdriver = new AndroidDriver<MobileElement>(new URL(\"http://0.0.0.0:4723/wd/hub\"), capabilities);\r\n\t\tdriver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);\r\n\r\n\t}", "public void startApp() {\n\n\t\tboolean isContinue = true;\n\t\tint i = 0;\n\t\twhile (isContinue) {\n\t\t\ti = displayAppMenu();\n\t\t\texecuteMenuItem(i);\n\n\t\t\tif (i == APP_EXIT) {\n\t\t\t\tisContinue = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "private static void startServer(){\n try{\n MMServer server=new MMServer(50000);\n }catch (IOException ioe){\n System.exit(0);\n }\n \n }", "public void startApp() {\n if (midletPaused) {\n resumeMIDlet ();\n } else {\n initialize ();\n startMIDlet ();\n }\n midletPaused = false;\n }", "public void startApp() {\n if (midletPaused) {\n resumeMIDlet ();\n } else {\n initialize ();\n startMIDlet ();\n }\n midletPaused = false;\n }", "void startAIGame() {\n int status = gameServer.restartServer( true, settingsMenu.getMapSize(),\n settingsMenu.getPlayFor(), settingsMenu.getFirstMove(),\n settingsMenu.getServerName() );\n if( status != 0 ) {\n JOptionPane.showMessageDialog( frame, Language.ERROR_STARTUP,\n Language.CAPTION_ERROR, JOptionPane.PLAIN_MESSAGE );\n } else {\n host = \"127.0.0.1\";\n role = \"admin\";\n password = gameServer.getServerPassword();\n ( new Thread( this ) ).start();\n }\n }" ]
[ "0.8121256", "0.79108983", "0.790934", "0.7675162", "0.7297813", "0.7237085", "0.6975557", "0.68682355", "0.66654766", "0.6565269", "0.6556041", "0.64937574", "0.6362772", "0.630599", "0.62748116", "0.6263827", "0.62043405", "0.6096911", "0.60516787", "0.6047728", "0.6025041", "0.59855205", "0.59732604", "0.5958473", "0.59162265", "0.58827084", "0.5868315", "0.58582985", "0.58325493", "0.58298767", "0.5809508", "0.5808744", "0.5804279", "0.58021367", "0.57861614", "0.578295", "0.57746226", "0.5773112", "0.5756358", "0.5747853", "0.5736174", "0.5726646", "0.5723578", "0.5723257", "0.5710587", "0.57035154", "0.56912833", "0.5684083", "0.5677358", "0.5672633", "0.56583315", "0.56497955", "0.56480783", "0.56454283", "0.5637688", "0.56236327", "0.5585465", "0.5569746", "0.55658174", "0.55492723", "0.5535606", "0.5535245", "0.55283165", "0.5505907", "0.54961634", "0.5482649", "0.54733926", "0.54675347", "0.5461936", "0.5461556", "0.5444871", "0.5444847", "0.542816", "0.54258", "0.54241025", "0.5419247", "0.54075825", "0.5407461", "0.54071033", "0.540437", "0.5391582", "0.53914034", "0.5365899", "0.5349936", "0.53423566", "0.53399605", "0.53381604", "0.533467", "0.5327658", "0.5300283", "0.5293983", "0.52890646", "0.5265775", "0.52573407", "0.5253047", "0.52479404", "0.52338856", "0.52286124", "0.52286124", "0.5225434" ]
0.81404036
0
this method stops the appium server.
public void stopAppiumServer(String os) throws ExecuteException, IOException { if (os.contains("windows")) { CommandLine command = new CommandLine("cmd"); command.addArgument("/c"); command.addArgument("Taskkill /F /IM node.exe"); DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler(); DefaultExecutor executor = new DefaultExecutor(); executor.setExitValue(1); executor.execute(command, resultHandler); } else if (os.contains("mac os x")) { String[] command = {"/usr/bin/killall", "-KILL", "node"}; Runtime.getRuntime().exec(command); LOGGER.info("Appium server stopped"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void appiumStop() throws IOException {\n if (p != null) {\n p.destroy();\n }\n System.out.println(\"Appium server Is stopped now.\");\n }", "public static void stopAppiumServer() throws IOException {\n\tif (process != null) {\n\tprocess.destroy();\n\n\t}\n\n\tSystem.out.println(\"Appium server stopped\");\n\n\t}", "public void stopAppium() throws Exception {\n String OS = System.getProperty(\"os.name\").toLowerCase();\n try {\n stopAppiumServer(OS);\n LOGGER.info(\"Appium server stopped successfully\");\n } catch (Exception e) {\n LOGGER.warn(\"Unable to stop appium server\");\n throw new TapException(TapExceptionType.PROCESSING_FAILED, \"Unable to stop appium server\");\n }\n }", "public void stop() {\n server.stop();\n }", "public static void stopDriver() {\n\t\t//Stoping instace of webdriver\n\t\tappDriver.close();\n\t\t}", "public void stopDriver();", "public void kill() {\n this.server.stop();\n }", "public void stopServer() {\n stop();\n }", "public void stop () {\n if (server != null)\n server.shutDown ();\n server = null;\n }", "public void stopDiscoverability() {\r\n this.findableServerThread.interrupt();\r\n }", "public void stop() {\n\t\tthis.controller.terminate();\n\t}", "public void stop() {\n if (server != null) {\n server.shutdown();\n }\n }", "@Override\n public void stop() {\n lumenClient.shutdown();\n lumenClient = null;\n }", "public void quitDriver(){\n instanceOfDriverFactory=null;\n appiumDriver.quit();\n }", "public void stop() {\n try {\n getXMPPServer().stop();\n }\n catch (Exception e) {\n Log.error(e.getMessage(), e);\n }\n sleep();\n }", "public void stopServer() {\r\n\t\tserverRunning = false;\r\n\t}", "private void stop() {\n if (client != null) {\n this.client.close();\n }\n }", "public void stop() {\n \n // first interrupt the server engine thread\n if (m_runner != null) {\n m_runner.interrupt();\n }\n\n // close server socket\n if (m_serverSocket != null) {\n try {\n m_serverSocket.close();\n }\n catch(IOException ex){\n }\n m_serverSocket = null;\n } \n \n // release server resources\n if (m_ftpConfig != null) {\n m_ftpConfig.dispose();\n m_ftpConfig = null;\n }\n\n // wait for the runner thread to terminate\n if( (m_runner != null) && m_runner.isAlive() ) {\n try {\n m_runner.join();\n }\n catch(InterruptedException ex) {\n }\n m_runner = null;\n }\n }", "public void stop() {\r\n\t\t// Tell the Gui Agent to shutdown the system\r\n\t\tGui.shutdown = true;\r\n\t}", "private void stopServer() {\n\t\ttry {\n//\t\t\tserver.shutdown();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: add message in UI for user\n\t\t}\n\t}", "public void stop() {\n System.err.println(\"Server will stop\");\n server.stop(0);\n }", "public void stop() {\n try {\n mSessionBinder.stop(mContext.getPackageName(), mCbStub);\n } catch (RemoteException e) {\n Log.wtf(TAG, \"Error calling stop.\", e);\n }\n }", "public void stopDevice(){\n //Stop the device.\n super.stopDevice();\n }", "@Test\n public void stopDeviceCheck() {\n System.out.println(\"* Device JUnit4Test: stopDeviceCheck()\");\n\n // authenticate the device and then stop it\n authenticateSimulatedDevice();\n mMainServer.removeDevice(mDeviceInstance);\n TestsConfig.delay(150);\n \n // check if the device is corretly removed from the server\n assertFalse(mDeviceInstance.isDeviceActive());\n assertNull(mMainServer.getDevice(mDeviceInstance.getUniqueIdentifier()));\n }", "public void stop()\n {\n _panel.cleanup();\n _appContext.cleanup();\n }", "public void stop() {\n\t\tSystem.out.println(\"Stopping application\");\n\t\trunning = false;\n\t}", "private synchronized void stop()\n\t{\n\t\ttry\n\t\t{\n\t\t\tunregisterReceiver( mConnectivityReceiver );\n\t\t}\n\t\tcatch ( IllegalArgumentException e )\n\t\t{\n\t\t\te.printStackTrace();\n\n\t\t} // try/catch\n\n\t}", "public void stop() {\n System.err.println(\"Server will stop\");\n server.stop(0);\n }", "private void stopServer() {\n if (mBluetoothGattServer == null) return;\n\n mBluetoothGattServer.close();\n }", "public void stopCommunicationServer() {\n\t\t\tthis.running = false;\n\t\t}", "@Override\n protected void appStop() {\n }", "public void shutdown() {\n try {\n infoServer.stop();\n } catch (Exception e) {\n }\n this.shouldRun = false;\n ((DataXceiveServer) this.dataXceiveServer.getRunnable()).kill();\n try {\n this.storage.closeAll();\n } catch (IOException ie) {\n }\n }", "public synchronized void shutdown() {\n server.stop();\n }", "public void disconnect() {\n \ttry {\n \t\tctx.unbindService(apiConnection);\n } catch(IllegalArgumentException e) {\n \t// Nothing to do\n }\n }", "public void shutdown() {\n _udpServer.stop();\n _registrationTimer.cancel();\n _registrationTimer.purge();\n }", "public void shutdown() {\n\t\tserver.stop(0);\n\t}", "public void stop() {\n\t\ttry {\n\t\t\tif (serverSocket != null)\n\t\t\t\tserverSocket.close();\n\t\t} catch (IOException ioe) {\n\t\t\t// shouldn't happen\n\t\t}\n\t}", "void shutDownServer() throws Exception;", "public void stop() {\n tcpServer.stopServer();\n ThreadExecutor.shutdownClient(this.getClass().getName());\n }", "private void stopSoftAp() {\n mWifiNative.teardownInterface(mApInterfaceName);\n Log.d(TAG, \"Soft AP is stopped\");\n }", "public void stopAndDestroyServer() {\n synchronized (mImplMonitor) {\n // ResettersForTesting call can cause this to be called multiple times.\n if (mImpl == null) {\n return;\n }\n try {\n if (!mImpl.shutdownAndWaitUntilComplete()) {\n throw new EmbeddedTestServerFailure(\"Failed to stop server.\");\n }\n mImpl.destroy();\n mImpl = null;\n } catch (RemoteException e) {\n throw new EmbeddedTestServerFailure(\"Failed to shut down.\", e);\n } finally {\n mContext.unbindService(mConn);\n }\n }\n }", "@Override\n\tpublic void stop() throws Exception {\n\t\tcontroller.stopClient();\n\t}", "@Override\n public void onDestroy() {\n unregisterReceiver(reciever);\n mp.pause();\n mp.stop();\n mp.release();\n wifiManager.disableNetwork(wifiManager.getConnectionInfo().getNetworkId());\n wifiManager.removeNetwork(wifiManager.getConnectionInfo().getNetworkId());\n wifiManager.disconnect();\n try {\n\n serverSocket.close();\n }catch (Exception ex)\n {\n\n }\n super.onDestroy();\n\n }", "public void shutdown() {\n mGameHandler.shutdown();\n mTerminalNetwork.terminate();\n }", "protected void stop() {\n keepGoing = false;\n try {\n new Socket(\"localhost\", port);\n }\n catch(Exception e) {\n e.printStackTrace();\n }\n }", "public void stop() {\n\t\tif (this.isRunning() && !this.isManagedExternally) {\n\t\t\ttry {\n\t\t\t\tHTTP.release(this.http.get(this.shutdown));\n\t\t\t} catch (IOException exception) {\n\t\t\t\tthis.processRunner.abort();\n\t\t\t}\n\n\t\t\tthis.isManagedExternally = null;\n\t\t}\n\t}", "private void safeStop() {\n getRobotDrive().stop();\n //pneumatics.stop();\n }", "public void shutDown();", "public void stop() {}", "public void stop() {\n while (currentState.get() == ServerConstants.SERVER_STATUS_STARTING) {\r\n try {\r\n Thread.sleep(500);\r\n } catch (InterruptedException e) {\r\n // Ignore.\r\n }\r\n }\r\n\r\n if (currentState.compareAndSet(ServerConstants.SERVER_STATUS_STARTED, ServerConstants.SERVER_STATUS_OFF)) {\r\n try {\r\n bossGroup.shutdownGracefully();\r\n workerGroup.shutdownGracefully();\r\n connectionPool.shutdownAll();\r\n\r\n failedTimes.set(0);\r\n\r\n logger.info(\"Netty server stopped\");\r\n } catch (Exception ex) {\r\n logger.warn(\"Failed to stop netty server (port={}), exception:\", port, ex);\r\n }\r\n }\r\n }", "public void serverStop() {\n\t\tJOptionPane.showMessageDialog(dlg, \"与服务器失去连接\");\n\t\tserver = null;\n\t\tconnectAction.setEnabled(false);\n\t\t\n\t}", "public void onStop() {\n connectivityMonitor.unregister();\n requestTracker.pauseRequests();\n }", "public void shutDown () {\n sparkService.stop();\n }", "@Override\n\tpublic void stopLocalTimer() {\n\t\tthis.isAppRunning = false;\n\t\tlocalBeatSocket.close();\n\t}", "private void disconnect() {\n activityRunning = false;\n MRTClient.getInstance().doHangup();\n MRTClient.getInstance().removeClientListener(this);\n\n finish();\n }", "public void stopHostingGame() {\n \t\tgameSetup.reset();\n \t\tlobbyManager.stopHostingGame();\n \t\tlobby.updateGameListPane();\n \t\tgameMain.showScreen(lobby);\n \t}", "public void stopNetwork();", "public static void stopNetworkVirtualization(AppiumDriver driver) {\r\n\r\n\t\t\tHashMap<Object, Object> params = new HashMap<>();\r\n\r\n\t\t\tdriver.executeScript(\"mobile:vnetwork:stop\", params);\r\n\r\n\t\t}", "public void stopListener(){\n\t\tsynchronized (httpServerMutex){\n\t\t\ttry{\n\t\t\t\tif( webServer != null ){\n\t\t\t\t\twebServer.shutdownServer();\n\t\t\t\t\twebServer = null; // NOPMD by luke on 5/26/07 11:10 AM\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch( InterruptedException e){\n\t\t\t\t//Ignore, InterruptedException don't matter in this context.\n\t\t\t}\n\t\t\tcatch( Exception e){\n\t\t\t\t//Ignore, InterruptedException don't matter in this context.\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void ShutDown()\n {\n bRunning = false;\n \n LaunchLog.Log(COMMS, LOG_NAME, \"Shut down instruction received...\");\n\n for(LaunchServerSession session : Sessions.values())\n {\n LaunchLog.Log(COMMS, LOG_NAME, \"Closing session...\");\n session.Close();\n }\n \n LaunchLog.Log(COMMS, LOG_NAME, \"...All sessions are closed.\");\n }", "protected void stop() {\n keepGoing = false;\n // connect to myself as Client to exit\n try {\n new Socket(\"localhost\", port);\n } catch(Exception e) {\n // exception handling\n }\n }", "void stop()\n {\n this.service_skeleton.stop(0);\n this.registration_skeleton.stop(0);\n }", "public void stop() {\n\t\tserver.saveObjectToFile(offlineMessagesFileName, _offlineMessages);\n\t\tserver.saveObjectToFile(onlineClientsFileName, _onlineClients);\n\t\tserver.saveObjectToFile(clientFriendsFileName, _clientFriends);\n\t\t_offlineMessages.clear();\n\t\t_onlineClients.clear();\n\t\t_clientFriends.clear();\n\t\tserver.stop();\n\t}", "void shutDown();", "public void stop() { \r\n\t if (remoteControlClient != null) {\r\n\t remoteControlClient\r\n\t .setPlaybackState(RemoteControlClient.PLAYSTATE_STOPPED);\r\n\t } \r\n\t }", "public void stopService();", "public void stop() {\n\t\t// To be garbage collected if adapter remains active\n\t\tservletOut = null;\n\t}", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop() {\n\t\texec.stop();\n\t}", "public void stop() {\n }", "public void stop() {\n }", "public void stopServers() {\n EventHandlerService.INSTANCE.reset();\n UserRegistryService.INSTANCE.reset();\n\n if ( eventDispatcher != null ) {\n eventDispatcher.shutdown();\n }\n if ( userClientDispatcher != null ) {\n userClientDispatcher.shutdown();\n }\n if ( eventDispatcherThread != null ) {\n eventDispatcherThread.interrupt();\n }\n if ( userClientDispatcherThread != null ) {\n userClientDispatcherThread.interrupt();\n }\n }", "public void terminateDriver() {\n }", "public void stop() {\n try {\n stopAsync().get(10, SECONDS);\n } catch (Throwable throwable) {\n if (MockServerLogger.isEnabled(DEBUG)) {\n MOCK_SERVER_LOGGER.logEvent(\n new LogEntry()\n .setLogLevel(DEBUG)\n .setMessageFormat(\"exception while stopping - \" + throwable.getMessage())\n .setThrowable(throwable)\n );\n }\n }\n }", "private void stop() {\n\t\t/*\n if (this.status != PedoListener.STOPPED) {\n this.sensorManager.unregisterListener(this);\n }\n this.setStatus(PedoListener.STOPPED);\n\t\t*/\t\t\t\t\n\t\t\t\n\t\tif (status != PedoListener.STOPPED) {\n\t\t uninitSensor();\n\t\t}\n\n\t\tDatabase db = Database.getInstance(getActivity());\n\t\tdb.setConfig(\"status_service\", \"stop\");\n\t\t//db.clear(); // delete all datas on table\n\t\tdb.close();\t\t\n\n\t\tgetActivity().stopService(new Intent(getActivity(), StepsService.class));\n\t\tstatus = PedoListener.STOPPED;\n\n\t\tcallbackContext.success();\n }", "private void shutdown() {\n\t\ttry {\n\t\t\tsock.close();\n\t\t\tgame.handleExit(this);\n\t\t\tstopped = true;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t}", "private void quit() {\n\t\tmSipSdk = myApplication.getPortSIPSDK();\n\n\t\tif (myApplication.isOnline()) {\n\t\t\tLine[] mLines = myApplication.getLines();\n\t\t\tfor (int i = Line.LINE_BASE; i < Line.MAX_LINES; ++i) {\n\t\t\t\tif (mLines[i].getRecvCallState()) {\n\t\t\t\t\tmSipSdk.rejectCall(mLines[i].getSessionId(), 486);\n\t\t\t\t} else if (mLines[i].getSessionState()) {\n\t\t\t\t\tmSipSdk.hangUp(mLines[i].getSessionId());\n\t\t\t\t}\n\t\t\t\tmLines[i].reset();\n\t\t\t}\n\t\t\tmyApplication.setOnlineState(false);\n\t\t\tmSipSdk.unRegisterServer();\n\t\t\tmSipSdk.DeleteCallManager();\n\t\t}\n\t}", "public void stopServer(View view) {\n stopServerService();\n }", "@PostMapping(value = \"/stop\")\n public ResponseEntity stop(){\n try {\n CommandExecutor.execute(Commands.shutdown);\n return ResponseEntity.ok().build();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n return ResponseEntity.status(500).build();\n }", "public void killIEServer() {\n\t\ttry {\n\n\t\t\tTestUtil.pause(5);\n\n\t\t\tString[] cmd = new String[3];\n\t\t\tcmd[0] = \"cmd.exe\";\n\t\t\tcmd[1] = \"/C\";\n\t\t\tcmd[2] = \"taskkill /F /IM iexplore.exe\";\n\n\t\t\tProcess process = Runtime.getRuntime().exec(cmd);\n\n\t\t\tProcess process1 = Runtime.getRuntime().exec(\"taskkill /F /IM IEDriverServer.exe\");\n\n\t\t\tSystem.err.println(process + \"\" + process1);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\r\n\tpublic void stop() {\n\t\tthis.controller.stop();\r\n\t}", "public void stopServer() throws IOException {\n\t\tlistenThread.interrupt();\n\t\tlistenSocket.close();\n\t\tfor(TestInstance t: testInstances) t.abortTest();\n\t}", "public void stop() {\n if (isStop.compareAndSet(false, true)) {\n if (bootstrap.config().group() != null) {\n Future future = bootstrap.config().group().shutdownGracefully();\n ((io.netty.util.concurrent.Future) future).syncUninterruptibly();\n }\n for (BrpcChannelGroup channelGroup : healthyInstances) {\n channelGroup.close();\n }\n for (BrpcChannelGroup channelGroup : unhealthyInstances) {\n channelGroup.close();\n }\n if (timeoutTimer != null) {\n timeoutTimer.stop();\n }\n if (namingService != null) {\n namingService.unsubscribe(subscribeInfo);\n }\n if (healthCheckTimer != null) {\n healthCheckTimer.stop();\n }\n if (loadBalanceStrategy != null) {\n loadBalanceStrategy.destroy();\n }\n if (callbackThread != null) {\n callbackThread.shutdown();\n }\n if (threadPool != null) {\n threadPool.stop();\n }\n }\n }", "public void stopLocalServer() {\n \t\tif (thread != null) {\n \t\t\tthread.stopProcess();\n \t\t\tthread.interrupt();\n \t\t\tthread = null;\n \t\t\tSystem.out.println(addeMcservl + \" was stopped\");\n \t\t} else {\n \t\t\tSystem.out.println(addeMcservl + \" is not running\");\n \t\t}\n \t}", "@Override\r\n public synchronized void stop() throws Exception {\r\n stopHelper();\r\n stopServers();\r\n stopClients();\r\n super.stop();\r\n }", "@ReactMethod\n public void stop() {\n ChirpError error = chirpConnect.stop();\n if (error.getCode() > 0) {\n onError(context, error.getMessage());\n } else {\n isStarted = false;\n }\n }" ]
[ "0.8296405", "0.8153", "0.8147338", "0.6953126", "0.69076234", "0.6897866", "0.68151987", "0.673504", "0.6730639", "0.66719943", "0.66437596", "0.661311", "0.658728", "0.65716183", "0.657089", "0.6561828", "0.65568006", "0.6550675", "0.6545213", "0.65375316", "0.65112287", "0.65062934", "0.64731044", "0.64502746", "0.6427493", "0.64264274", "0.6419415", "0.6415534", "0.6400054", "0.6382003", "0.63578737", "0.6328756", "0.63048965", "0.628123", "0.6275898", "0.6237365", "0.6221225", "0.6216402", "0.6187916", "0.61863416", "0.6183961", "0.6181696", "0.615603", "0.6154764", "0.6151906", "0.6150844", "0.61470956", "0.6140491", "0.61217666", "0.6110377", "0.6108679", "0.6108461", "0.61079985", "0.6100404", "0.60946673", "0.60932434", "0.60925996", "0.60900885", "0.60868466", "0.6083956", "0.6075189", "0.6068259", "0.6067477", "0.60591185", "0.60575205", "0.6053731", "0.605003", "0.6048156", "0.6048156", "0.6048156", "0.6048156", "0.6048156", "0.6048156", "0.6048156", "0.6048156", "0.6048156", "0.6048156", "0.6048156", "0.6048156", "0.6048156", "0.6048156", "0.6048156", "0.6044436", "0.604137", "0.604137", "0.6033294", "0.6033159", "0.60288334", "0.6017836", "0.60051656", "0.59912294", "0.5988487", "0.5981924", "0.59811515", "0.5981038", "0.5976998", "0.59675777", "0.59671956", "0.59627485", "0.59580106" ]
0.7169767
3
Account a1 = new Account("Ankita",1000); a1.deposit(200); a1.withdraw(100); a1.summary(); Savings s1 = new Savings("Mona"); s1.withdraw(5); s1.summary(); Current c1 = new Current("Ankita"); //c1.deposit(1000); c1.withdraw(3000); c1.withdraw(7000); c1.deposit(2000); c1.deposit(4000); c1.summary(); Transaction t = new Transaction("Savings", 10000, 1000); t.print();
public static void main(String[] args) { Banking s1 = AccountFactory.openSavingAccount("Polo"); try { s1.withdraw(2000); } catch (BalanceException e) { //e.printStackTrace(); //For debugging - used by developers //System.out.println(e); //used for loggers System.out.println(e.getMessage()); //for end user } s1.deposit(3000); // s1.withdraw(2000); // s1.deposit(4000); // // s1.statement(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main (String[] args)\r\n{\nAccount a = new SavingsAccount(\"john\",500,4);\r\nSystem.out.println(\"\\n Savings Account details\");\r\nSystem.out.println(\"----------------------\");\r\nSystem.out.println(\"\"+a.getName()+\"has an initial balance of:\"+a.getBalance());\r\na.deposit(200);\r\na.withdraw(200);\r\nSystem.out.println(\"\"+a.getName()+\"at the end of transaction has a balance of \"+a.getBalance());\r\n\r\nSystem.out.println(\"\\n checking account details\");\r\nSystem.out.println(\"----------------------\");\r\nCheckingAccount cAobj = new CheckingAccount(\"Stephen\",200,200);\r\nSystem.out.println(\"\\n Savings Account details\");\r\nSystem.out.println(\"----------------------\");\r\nSystem.out.println(\"\"+cAobj.getName()+\"has an initial balance of:\"+cAobj.getBalance());\r\ncAobj.deposit(200);\r\ncAobj.withdraw(500);\r\nSystem.out.println(\"\"+cAobj.getName()+\"at the end of transaction has a balance of \"+cAobj.getBalance());\r\n}", "public static void main(String[] args) {\n SavingAccount savings = new SavingAccount(1112, 200);\r\n CheckingAccount checking = new CheckingAccount(1113, 200, -200);\r\n\r\n //account.setAnnualInterestRate(4.5);\r\n savings.setAnnualInterestRate(4.5);\r\n checking.setAnnualInterestRate(4.5);\r\n\r\n\r\n //account.withdraw(250);\r\n //account.deposit(30);\r\n //System.out.println(account.toString());\r\n\r\n\r\n\r\n\r\n checking.withdraw(250);\r\n checking.deposit(30);\r\n System.out.println(checking.toString());\r\n\r\n savings.withdraw(2504);\r\n savings.deposit(30);\r\n System.out.println(savings.toString());\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n }", "public static void main(String[] args) {\n Account firstAccount = new Account(\"first Account\",100.00);\n \n \n System.out.println(\"Initial State\");\n System.out.println(firstAccount);\n \n \n firstAccount.deposit(20);\n System.out.println(\"the balance of first Account is : \" + firstAccount.toString());\n \n \n }", "public static void main(String[] args) {\n BankAccount Yaoming = new BankAccount(0, \"blobfis@h\");\n BankAccount Hoshi = new BankAccount(2348123, \"Seventeen\");\n BankAccount Pewpew = new BankAccount(1245, \" \");\n\n System.out.println(Yaoming.getBalance());\n System.out.println(Hoshi.getAccountID());\n // System.out.println(Yaoming.getPassword());\n Yaoming.setPassword(\"donkey\");\n // System.out.println(Yaoming.getPassword());\n System.out.println(Yaoming.deposit(53.43));\n System.out.println(Yaoming.getBalance());\n if ( Yaoming.deposit(-100) ) System.out.println(\"Deposit successful!\");\n else {System.out.println(\"Deposit failed!\");}\n System.out.println();\n\n // System.out.println(Pewpew.getPassword());\n System.out.println(Pewpew.getBalance());\n System.out.println(Pewpew.deposit(2147823.23));\n System.out.println(Pewpew.withdraw(9999999));\n System.out.println(Pewpew.withdraw(-1231784.23));\n System.out.println(Pewpew.withdraw(0.23));\n System.out.println(Pewpew.getBalance());\n System.out.println();\n\n System.out.println(Hoshi.toString());\n System.out.println(Yaoming.toString());\n System.out.println(Pewpew.toString());\n System.out.println();\n\n BankAccount Sophia = new BankAccount(123456, \"meowmeow\");\n BankAccount Funky = new BankAccount(7890, \"woofwoof\");\n Sophia.deposit(7500);\n System.out.println(Sophia.getBalance());\n System.out.println(Funky.getBalance());\n System.out.println(Sophia.transferTo(Funky, 500, \"meowmeow\")); //should be true\n System.out.println(Funky.transferTo(Sophia, 1000, \"woofwoof\")); //should be false\n System.out.println(Funky.transferTo(Sophia, 300, \"hehehe\")); //should be false\n System.out.println(Sophia.getBalance()); //should be 7000.0\n System.out.println(Funky.getBalance()); //should be 500.0\n\n }", "public static void main(String[] args) {\n\t\t\n\tBankAccount acc1 = new BankAccount();\t\n\t\n\t// acc1.name = \"Roger hue\";\n\t// With Encapsulation : public API method\n\tacc1.setName(\"Roger Hue\");\n\tSystem.out.println(acc1.getName());\n\t// acc1.ssn = \"484644646\" ;\n\tacc1.setSSN(\"156418489\");\n\tSystem.out.println(acc1.getSSN());\n\tacc1.accountNumber = \"545465456\";\n\tacc1.setRate();\n\tacc1.balance = 10000;\n\t\n\tacc1.deposit(1500);\n\tacc1.deposit(1500);\n\tacc1.deposit(1500);\n\tacc1.withdraw(2000);\n\t\n\t// Polymorphism through overriding way 2\n\tSystem.out.println(acc1.toString());\n\t\n\t// Polymorphism through overloadnig way 1\n\tBankAccount acc2 = new BankAccount(\"Checking Account\");\n\tacc2.accountNumber = \"0514651651\";\n\tBankAccount acc3 = new BankAccount(\"Savings Account\", 4587.05);\n\t\n\t\n\tSystem.out.println(\"Your balance is: $\" + acc3.balance);\n\t/*\n\t// DEMO for inheritance\n\tCDAccount cd1 = new CDAccount();\n\tcd1.interestRate = \"4.5\";\n\tcd1.balance = 3000;\n\tcd1.name = \"Hello world\";\n\tcd1.accounType = \"CD Account\";\n\tcd1.accountNumber = \"546541651\";\n\tSystem.out.println(cd1.toString());\n\tcd1.compount();\n\t*/\n\t}", "public static void main(String[] args) {\n BankAccount bankAccount = new BankAccount(11211, 0, \"adam smith\", \"abc@email.com\", \"9090980980\");\n BankAccount tim = new BankAccount(\"tim\", \"tim@email.com\", \"9090980980\");\n System.out.println(\"Account Number = \" + tim.getAccountNumber());\n System.out.println(\"Balance = \"+ tim.getBalance());\n System.out.println(\"Customer Name = \" + bankAccount.getCustomerName());\n System.out.println(\"Email = \" + bankAccount.getEmailAddress());\n System.out.println(\"Phone Number = \" + bankAccount.getPhoneNumber());\n System.out.println(\"deposit = \"+ bankAccount.getDeposit(90));\n System.out.println(\"new balance = \"+ bankAccount.getWithdrawal(200));\n }", "public static void main(String[] args) {\n\t\tBankAccount account = new BankAccount(112299,\"sudesh teli\",10000);\r\n\t\tBankAccount newaccount = new BankAccount(112300,\"Ashitosh Dessai\",10000);\r\n\t\tSavingBankAccount sb=new SavingBankAccount(111111,\"Rahul Rane\",10000);\r\n\t\t\r\n\t\tSystem.out.println(\"The customer account no. is \"+account.getAccountnumber());\r\n\t\tSystem.out.println(\"The customer name is \"+account.getCustomername());\r\n\t\tSystem.out.println(\"The customer account balance is \"+account.getBalance());\r\n\t\t\r\n\t\taccount.setDeposit(1000,account);\r\n\t\tSystem.out.println(\"The customer \"+ account.getCustomername()+\" has balance \"+account.getBalance()+\" after depositing rs.\"+1000);\r\n\t\t\r\n\t\taccount.setWithdraw(1000,account);\r\n\t\tSystem.out.println(\"The customer \"+ account.getCustomername()+\" has balance \"+account.getBalance());\r\n\t\r\n\t\taccount.Transfer(account,newaccount,2000);\r\n\t\t\r\n\t\tSystem.out.println(\"The senders balance is \"+account.getBalance());\r\n\t\tSystem.out.println(\"The receivers balance is \"+newaccount.getBalance());\r\n\t\t\r\n\t\tBankAccount b= new BankAccount(112666,\"Diptesh teli\",100000);\r\n\r\n\t\tSavingBankAccount s = new SavingBankAccount(111222,\"Rahul Mane\",110000);\r\n\r\n\t\tCurrentAccount a = new CurrentAccount(191919,\"Karan Dhawaskar\",100000);\r\n\t\tb.Deposit(1000); \r\n\r\n\t\tb.Withdraw(2000);\r\n\r\n\t\ts.Deposit(2000);\r\n\r\n\t\ts.Withdraw(2000);\r\n\r\n\t\ts.calculateinterest();\r\n\t\tsb.calculateinterest();\r\n\t\t\r\n\t\ta.overdraft(100000);\r\n\t\ta.overdraft(5000);\r\n\t\ta.Withdraw(5000);\r\n\t\t\r\n\t\t//Here we are actually using polymorphism from bank account to saving or current account\r\n\t\tb=a;\r\n\t\tb=s;\r\n\t\t//type mismatch cannot convert from BankAccount to Current Account \r\n\t\t//a=b;\r\n\t\t//type mismatch cannot convert from BankAccount to Saving Account \r\n\t\t//s=b;\r\n\t\t////type mismatch cannot convert from SavingBankAccount to Current Account \r\n\t\t//a=s;\r\n\t\t////type mismatch cannot convert from Current Account to SavingBankAccount \r\n\t\t//s=a;\r\n\t}", "@Test\n public void savings_account2() {\n Bank bank = new Bank();\n Customer bill = new Customer(\"Bill\");\n Account savingsAccount = new SavingsAccount(bill, Account.SAVINGS);\n bank.addCustomer(new Customer(\"Bill\").openAccount(savingsAccount));\n Transaction t = new CreditTransaction(500.0);\n t.setTransactionDate(getTestDate(-15));\n savingsAccount.addTransaction(t);\n\n assertEquals(Math.pow(1 + 0.001 / 365, 15) * 500.0 - 500, bank.totalInterestPaid(), DOUBLE_DELTA);\n }", "public static void main(String[] args) {\n Account account = new Account(1122, 20000);\n account.setAnnualInterestRate(4.5);\n \n // create checkingaccount object and set variables\n CheckingAccount checking = new CheckingAccount(1122, 20000);\n checking.setAnnualInterestRate(4.5);\n \n // create savings account object and set variables\n SavingsAccount savings = new SavingsAccount(1122, 20000);\n savings.setAnnualInterestRate(4.5);\n \n // invoke toString() methods\n account.toString();\n checking.toString();\n savings.toString();\n }", "public static void main(String[] args) {\n Teller t = new Teller();\n Customer c1 = new Customer(\"Suthee\", 'F', \"11/22 BKK\", 30);\n t.newAccount(c1, 500);\n t.newAccount(c1, 1000);\n\n t.deposit(c1, 100, 500);\n t.withdraw(c1,100,200);\n\n t.deposit(c1,101,1200);\n t.withdraw(c1,101,500);\n\n System.out.println(\"Transaction Information\");\n ArrayList<Account> list = c1.getListBankAccount();\n for (Account account:list) {\n System.out.println(account);\n }\n }", "public static void main(String[] args) {\n\t\t Scanner input=new Scanner(System.in);//Input through Scanner Class\n\t\t System.out.println(\"You have Rs 500 in account\"); \n\t\t System.out.println(\"Enter the amount to be withdrawed\");\n\t\t int amount = input.nextInt();\n\t\t //Enter the amount \n\t\t CurrentAccount deposit=new CurrentAccount();\n\t\t payment(deposit, amount);\n\t\t //Withdraw the amount from bank\n\t\t System.out.println(\"Enter the amount to be deposited\");\n\t\t amount = input.nextInt();\n\t deposit(new SavingsAccount(), amount);\n //Deposit the amount bank\n }", "public static void main(String[] args) {\n\t\tBankAccount first=new BankAccount(123456);\r\n\t\tBankAccount second=new BankAccount(234567);\r\n\t\t\r\n\t\tfirst.deposit(900);\r\n\t\t\r\n\t\tSystem.out.println(first.balance);\r\n\t\tSystem.out.println(second.balance);\r\n\t\t\r\n\t\tfirst.transfer(second, 100);\r\n\t\tSystem.out.println(first.balance);\r\n\t\tSystem.out.println(second.balance);\r\n\t}", "public static void main(String[] args) {\r\n\t SavingAccount a= new SavingAccount();\r\n\t a.deposit(5000);\r\n\t a.withdraw(1000);\r\n\t a.getBalance();\r\n\t a.addInterest();\r\n\t \r\n\t \r\n\t\t\r\n\r\n\t}", "public static void main(String[] arguments)\n {\n BankAccount accountNum1 = new BankAccount();\n BankAccount accountNum2 = new BankAccount(1233203, 105.51, \"Betty\");\n BankAccount accountNum3 = new BankAccount(6542345, 33.11, \"Veronica\"); \n \n // Test the two String Method\n System.out.println(\"*** Does the toStringMethod work?\");\n System.out.println(\"First account : \" + accountNum1); \n System.out.println(\"Second account : \" + accountNum2); \n System.out.println(\"Third account : \" + accountNum3); \n System.out.println();\n \n // Do the get() method work?\n System.out.println(\"*** Does the get() methods work?\");\n System.out.println(accountNum2.getName() + \" has $\" + accountNum2.getBalance() +\n \" in account number \" + accountNum2.getID() + \".\"); \n System.out.println();\n\n // Can we change the account name\n System.out.println(\"*** Does the set() methods work?\");\n System.out.println(\"Second account Before : \" + accountNum2); \n accountNum2.setName(\"Archie\");\n System.out.println(\"Second account After : \" + accountNum2); \n\n // Can we change the account name\n System.out.println();\n System.out.println(\"*** Does the changeBalance() methods work?\");\n System.out.println(\"Third account Before : \" + accountNum3); \n accountNum3.changeBalance(10.10);\n System.out.println(\"Third account After : \" + accountNum3); \n accountNum3.changeBalance(-50);\n System.out.println(\"Third account After : \" + accountNum3); \n \n }", "public SavingsAccount(String n) {\n super(n); \n balance = 0;\n }", "@Test\n public void checkingAccount2() {\n Bank bank = new Bank();\n Customer bill = new Customer(\"Bill\");\n Account checkingAccount = new CheckingAccount(bill, Account.CHECKING);\n bank.addCustomer(new Customer(\"Bill\").openAccount(checkingAccount));\n Transaction t = new CreditTransaction(1000.0);\n t.setTransactionDate(getTestDate(-5));\n checkingAccount.addTransaction(t);\n\n assertEquals(Math.pow(1 + 0.001 / 365.0, 5) * 1000 - 1000, bank.totalInterestPaid(), DOUBLE_DELTA);\n }", "public static void main(String[] args) {\n\r\n\t\t\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tLocale.setDefault(Locale.US);\r\n\t\t\r\n\t\t/*Account ac = new Account();\r\n\t\t 1-Manter essa instancia no inicio geraria erros pois os construtores pedem inicialização na CLASS account */\r\n\t\t\r\n\t\tAccount ac;//Declaramos acima pois será necessário utilizar fora do escopo dos construtores\r\n\t\t\r\n\t\tdouble deposit;\r\n\t\tSystem.out.print(\"Enter account number: \");\r\n\t\tint number=sc.nextInt();//2-Com isso devo criar novas variaveis \r\n\t\tSystem.out.print(\"Enter account holder: \");\r\n\t\tString holder=sc.next();\r\n\t\tSystem.out.print(\"Is the initial deposit(y/n)? \");\r\n\t\tchar response = sc.next().charAt(0);\r\n\t\tif (response=='y') {\r\n\t\t\tSystem.out.print(\"Enter initial deposite value: \");\r\n\t\t\tdeposit = sc.nextDouble();\r\n\t\t\tac = new Account(number,holder, deposit);/*Ponto de inicio do construtor pois ao escolher iniciar \r\n\t\t\tcom deposito ele inicia o metodo com parametos definidos*/\r\n\t\t} \r\n\t\telse {\r\n\t\t ac = new Account(number,holder);/*Poderia colocar o 0 no lugar do deposito mas como isso poderia gerar algum erro,a boa prática \r\n\t\t é fazer um outro metodo sobrecarga*/ \r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.printf(\"Account Data: %n\"+ac);\r\n\t\r\n\t\tSystem.out.println(\"Enter a deposit value:\");\r\n\t\tdeposit = sc.nextDouble();\r\n\t\tac.depositar(deposit); //Esse parametro objinstanciada.metodo(parametro) garante que o dado esta sendo armazendo no metodo\r\n\t\t\r\n\t\tSystem.out.printf(\"Updated Data: %n\"+ac);\r\n\t\t\r\n\t\tSystem.out.println();\r\n\t\t\r\n\t\t\r\n System.out.println();\r\n\t\t\r\n\t\tSystem.out.println(\"Enter a withdraw value:\");\r\n\t\tdeposit = sc.nextDouble();\r\n\t\tac.saca(deposit);\r\n\t\t\r\n\t\tSystem.out.printf(\"Updated Data: %n\"+ac);\r\n\t\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tsc.close();\r\n\r\n\t\t\r\n\t}", "public interface Account {\n\t\n//\t\n//\t\tMoney money;\n//\t\tInterestRate interestRate;\n//\t\tPeriod interestPeriod;\n\t\t\n\t\tpublic int deposit(int depositAmmount);\n//\t\t{\n//\t\t\treturn money.getMoney()+depositAmmount;\n//\t\t}\n\t\t\n\t\tpublic int withdrawl(int withdrawAmmount);\n//\t\t{\n//\t\t\treturn money.getMoney()-withdrawAmmount;\n//\t\t}\n\t\t\n\t\tpublic int getBalance();\n//\t\t{\n//\t\t\treturn money.getMoney()*interestRate.getInterestRate()*interestPeriod.getPeriod()/100;\n//\t\t}\n\t}", "public Account() {\n\t\t//starting amount is 1500\n\t\tmoney = 1500;\n\t}", "public static void main(String[] args) {\n Account a = new Account(52384, 9999.99);\r\n System.out.println(a); // toString()\r\n \r\n // Test Setters and Getters\r\n a.setBalance(2012d);\r\n\t System.out.println(\"Balance is: \" + a.getBalance());\r\n a.credit(999.99);\r\n\t System.out.println(\"Balance is: \" + a.getBalance());\r\n a.debit(999999d);\r\n System.out.println(a.toString()); // run toString() to inspect the modified instance\r\n \r\n \r\n // Test setDate()\r\n a.setBalance( 999999999999999999.99);\r\n System.out.println(a); // toString()\r\n }", "public static void main(String[] args) {\n Bank newBank = new Bank(123456789);\n newBank.createAccount(45);\n newBank.createAccount(9);\n newBank.createAccount(342267);\n newBank.createAccount(7);\n newBank.createAccount(3);\n newBank.createAccount(343);\n newBank.createAccount(7);\n newBank.createAccount(789);\n newBank.createAccount(5645);\n //newBank.removeAccount(7);\n //System.out.println(\"New account: \" + newBank.createAccount(44));\n //System.out.println(\"2. account \" + newBank.createAccount(6));\n newBank.printAllAccounts();\n }", "public static void main(String[] args) {\n TaxaCambial taxac = new TxReal();\n\n ContaCorrente c = new ContaCorrente(200.0, \"123123\", \"23234\", 30.0);\n\n ContaPoupanca p = new ContaPoupanca(150.0, \"12341234\", \"232456\", 0.1);\n\n System.out.println(p.getRendimento());\n System.out.println(c.getTaxa());\n\n\n p.deposita(200.0,taxac);\n System.out.println(p.getValor());\n\n\n\n\n\n c.deposita(100.00, taxac);\n System.out.println(c.getValor());\n\n }", "public savingsAccount(){\n balance = 0;\n String[] sTransactions = new String[1000];\n savingTransactions = sTransactions;\n }", "public static void main(String[] args) {\n\t\tAccount a = new Account(\"윤영주\");\r\n\t\t\ta.total=a.save(12000,\"알바비\",\"2017.04.01\");\r\n\t\t\ta.print();\r\n\t\t\ta.total += a.withdraw(5000,\"편의점\",\"2017.04.11\");\r\n\t\t\ta.print();\r\n\t\t\ta.total += a.save(30000,\"용돈\",\"2017.04.20\");\r\n\t\t\ta.print();\r\n\t}", "public static void main(String[] args) {\n\t\tBank b = new Bank();\n\t\tRandom r = new Random();\n\t\tfor(int i = 0; i < 29; i++) {\n\t\t\tb.addAccount(new Account(i*100000, r.nextInt(1000000)*r.nextDouble(),Integer.toString(i)));\n\t\t}\n\t\tSystem.out.println(b);\n\t\tSystem.out.println(b.addAccount(new Account(1500l, r.nextInt(1000000)*r.nextDouble(), \"100\")));\n\t\tSystem.out.println(b.removeAccount(1500l));\n\t\tSystem.out.println(b.deposit(1500l, 1000d));\n\t\tSystem.out.println(b.deposit(0l, 1000d));\n\t\tSystem.out.println(b.withdraw(0l, 1000000000000000000d));\n\t}", "public static void main(String[] args) {\n\n BankAccount rustemAccount=new BankAccount(\"Rustem\",\"Erdem\");\n\n System.out.println(\"rustemAccount.firstName = \" + rustemAccount.firstName);\n System.out.println(\"rustemAccount.getAccountHolder() = \" + rustemAccount.getAccountHolder());\n\n\n System.out.println(\"getBalance() = \" + rustemAccount.getBalance());\n\n rustemAccount.setBalance(150);\n System.out.println(\"getBalance() = \"+rustemAccount.getBalance());\n\n rustemAccount.deposit(150);\n rustemAccount.avaliableBalance();\n rustemAccount.withdraw(100);\n rustemAccount.avaliableBalance();\n\n\n rustemAccount.setAccountNumber(23112432);\n System.out.println(\"rustemAccount.getAccountNumber() = \" + rustemAccount.getAccountNumber());\n\n\n System.out.println(rustemAccount);\n }", "public static void main(String[] args) {\n\t\tIAccount accountObjWithSavingsAcc=new SavingsAccount();\n\t\t\n\t\taccountObjWithSavingsAcc.depositAmount(100000);\n\t}", "@Test \n\tpublic void test1() {\n\t\taccount.withdraw(1000);\n\t\t//Sample (Expected) Output\n\t\tassertEquals(1000, account.getAmount(),0.01);\n\t}", "public account(){\n this.accNo = 000;\n this.id = 000;\n this.atype = \"\";\n this.abal = 0.00;\n }", "Account(int account_number,double balance) //pramiterized constrector\n {\n this.account_number=account_number;\n this.balance=balance;\n }", "public static void main(String[] args) {\n\n\t\tBankAccount one = new BankAccount();\n\t\tone.balance = 200;\n\t\tone.name = \"Johny Cash\";\n\t\t\n\t\tSystem.out.println(one.getClass().getSimpleName());\n\t\tSystem.out.println(one instanceof BankAccount);\n\t\t\n\t\tone.showAccountHolder();\n\t\tone.showBallance();\n\t\tone.addAmmount(300);\n\t\tone.showBallance();\n\t\t\n\t\t\n\t\tBankAccount two = new BankAccount();\n\t\ttwo.balance = 23200;\n\t\ttwo.name = \"Michal Jackson\";\n\t\t\n\t\ttwo.showAccountHolder();\n\t\ttwo.showBallance();\n\t\ttwo.addAmmount(3000);\n\t\ttwo.showBallance();\n\t}", "public Account() //default constructor \n {\n this.balance = 0;\n this.account_number = 0;\n }", "public ReturnCash(){\n\t\t\n\t}", "public static void main(String[] args) {\n Company myCompany = new Company();\n System.out.println(myCompany.getName());\n Worker oyelowo = new JuniorWorker(989.9);\n Worker Dan = new JuniorWorker(987.8);\n Worker Shane = new MidLevelWorker(34.5);\n Worker Dolan = new SeniorWorker(4567.8);\n Worker Maria = new SeniorWorker(84.3);\n SeniorWorker Sam = new SeniorWorker();\n JuniorWorker jim = new JuniorWorker(\"Jim\", \"HJK\", 1, 345.9);\n System.out.println(jim.getBalance());\n\n\n System.out.println(myCompany.getBalance() + \" \" +myCompany.getAuthorizationKey());\n\n\n\n myCompany.paySalary(1000.0, oyelowo);\n myCompany.paySalary(700.0, Dan);\n myCompany.paySalary(700.0, Dan);\n myCompany.paySalary(700.0, Dan);\n myCompany.paySalary(700.0, Dan);\n myCompany.paySalary(700.0, Dan);\n\n\n System.out.println();\n System.out.println(myCompany.getBalance());\n System.out.println(myCompany.getDebits());\n System.out.println(oyelowo.getBalance(myCompany));\n System.out.println(Dan.getBalance(myCompany));\n\n\n }", "public static void main(String[] args) {\n\t\n // Code to test Account class \n \n // testing selecting an account from the database - Lab #3 Part II\n /*Account a1 = new Account();\n a1.selectDB(\"90002\");\n\t\tdouble abalance = a1.getBalance();\n System.out.println(\"Balance: \" + abalance); */\n \n // testing deposit and withraw methods Lab #4 Part I\n Account a1 = new Account();\n a1.selectDB(\"90002\");\n a1.display();\n //a1.deposit(300.00);\n /*try {\n a1.withdraw(3000.00);\n }\n catch (InsufficientFundsException ex) {\n System.out.println(ex);\n } */\n \n //a1.display(); \n \n\t}", "public SavingsAccount(double balance)\n {\n startingBalance = balance;\n }", "@Override\n public void actionPerformed(ActionEvent e){\n int starNum = Integer.valueOf(JOptionPane.showInputDialog(\"Starting Balance?\"));\n \n String nam = JOptionPane.showInputDialog(\"Account Name?\");\n \n String type = JOptionPane.showInputDialog(\"Type Of Account?\");\n \n Account newAcc = null;\n \n if(type.equals(\"Checking\")) {\n \n newAcc = new CheckingAccount(nam, starNum);\n \n } else {\n \n newAcc = new SavingsAccount(nam, starNum);\n \n }\n \n bankSystem.addAcc(newAcc);\n \n current = newAcc;\n \n }", "public Object creditEarningsAndPayTaxes()\r\n/* */ {\r\n\t\t\t\tlogger.info(count++ + \" About to setInitialCash : \" + \"Agent\");\r\n/* 144 */ \tgetPriceFromWorld();\r\n/* 145 */ \tgetDividendFromWorld();\r\n/* */ \r\n/* */ \r\n/* 148 */ \tthis.cash -= (this.price * this.intrate - this.dividend) * this.position;\r\n/* 149 */ \tif (this.cash < this.mincash) {\r\n/* 150 */ \tthis.cash = this.mincash;\r\n/* */ }\t\r\n/* */ \r\n/* 153 */ \tthis.wealth = (this.cash + this.price * this.position);\r\n/* */ \r\n/* 155 */ \treturn this;\r\n/* */ }", "private void makeDeposit() {\n\t\t\r\n\t}", "public String toString(){\r\n //your code here\r\n return(\"Withdrawal of: $\" + amount + \"Date: \" + date + \"from account: \" + account);\r\n }", "public Account(String name, double balance){\n\n this.name = name;\n\n if (balance > 0.0 )\n this.balance = balance;\n }", "public saccoAccount (int account_num, double initial_balance) \r\n {\r\n\r\n account = account_num;\r\n balance = initial_balance;\r\n\r\n }", "@Test\n public void CompoundTransaction_AddTransactionTest()\n {\n ct = new CompoundTransaction(\"compound\");\n\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n ct.addTransaction(new Transaction(\"atomic1\", acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),10));\n\n ct.addTransaction(new Transaction(\"atomic2\",acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),40));\n\n Assert.assertEquals(2, ct.getTransaction_list().size());\n }", "public StudentSavingsAccount(double bal, String name) {\n\n \t\tsuper(bal, name);\n// \t super();\n// \t setName(name);\n// \t setBalance(bal);\n \t overdraftsBeforeFee = 3;\n \t System.out.println(\"double, String constructor called [StudentSavingsAccount]\");\t\n\n }", "public CheckingAccount()\n {\n withdrawals = 0;\n deposits = 0;\n }", "public static void main(String[] args) {\n\t\tAccount acc = new Account(1222, 20000);\r\n\t\tacc.withdraw(2500);\r\n\t\tacc.deposit(3000);\r\n\t\t\r\n\t\tSystem.out.println(\"Balance: \" + acc.getBalance() + \"\\nMonthly interest: \" + acc.getMonthlyInterest() + \"\\nDate: \" + acc.getDateCreated());\r\n\t}", "interface Transaction {\n int BALANCE = 500;\n //Storing Balance\n Object transaction(Object input);\n}", "public static void main(String[] args){\n System.out.println(\"\\nSTEP 1:\\n Create a new bank account.\");\n BankAccount a = new BankAccount(args[0], args[1], args[2]);\n System.out.println(a);\n\n // Get and set names\n System.out.println(\"\\nSTEP 2:\\n Get account holder name.\");\n String name = a.getName();\n System.out.println(\"The name is \" + name);\n System.out.println(a);\n\n System.out.println(\"\\nSTEP 3:\\n Set account holder name.\");\n a.setName(\"Mary Berry\");\n System.out.println(a);\n\n // Get and set account number\n System.out.println(\"\\nSTEP 4:\\n Get account number.\");\n String number = a.getNumber();\n System.out.println(\"The account number is \" + number);\n System.out.println(a);\n\n System.out.println(\"\\nSTEP 5:\\n Set account number.\");\n a.setNumber(\"0012044\");\n System.out.println(a);\n\n // Withdraw money with no funds\n System.out.println(\"\\nSTEP 6:\\n Attempt to withdraw money with insufficient funds.\");\n a.withdraw(22.0);\n System.out.println(a);\n\n // Deposit to account\n System.out.println(\"\\nSTEP 7:\\n Deposit to bank account.\");\n a.deposit(50.0);\n System.out.println(a);\n\n // Check balance\n System.out.println(\"\\nSTEP 8:\\n Check account balance.\");\n double balance = a.checkBalance();\n System.out.println(\"The balance is \" + balance);\n System.out.println(a);\n\n // Withdraw with sufficient funds\n System.out.println(\"\\nSTEP 9:\\n Withdraw from account.\");\n a.withdraw(22.0);\n System.out.println(a);\n }", "public static void main(String[] args) {\n\t\t\n\t\tBankAccount myBankAccount = new BankAccount();\n\t\t\n\t\t// Add a transaction to myBankAccount\n\t\tmyBankAccount.getTransactions().add(new Transaction());\n\t\t\n\t\t// Set the amount for the first transaction:\n\t\tmyBankAccount.getTransactions().get(0).setAmount(12.34);\n\t\t\n\t\t// Output value of first transaction:\n\t\tdouble firstTransactionAmount = myBankAccount.getTransactions().get(0).getAmount();\n\t\t\n\t\tSystem.out.println(\"firstTransactionAmount: \" + firstTransactionAmount);\n\t\t\n\t\t\n\t\t// Add a second transaction\n\t\tmyBankAccount.getTransactions().add(new Transaction());\n\t\t// set its value (ideally would be done in a constructor that took the value):\n\t\tmyBankAccount.getTransactions().get(1).setAmount(34.56);\n\t\t\n\t\t\n\t\t//Total and display balance:\n\t\tmyBankAccount.getTotalBalanceFromTransactions();\n\t\tSystem.out.println(\"myBankAccount.getBalance(): \" + myBankAccount.getBalance());\n\t}", "public SavingsAccount() {\n super();\n }", "public Account(){\r\n this.id = 0;\r\n this.saldo = 0.0;\r\n }", "public static void main(String[] args) \n\t{\n\t\tExercise039 account1 = new Exercise039( 50.00 ); // create Exercise039 object\n\t\tExercise039 account2 = new Exercise039( -7.53 ); // create Exercise039 object\n\t\t\n\t\t// display initial balance of each object\n\t\tSystem.out.printf( \"account1 balance: $%.2f\\n\", account1.getBalance() );\n\t\tSystem.out.printf( \"account2 balance: $%.2f\\n\\n\", account2.getBalance() );\n\t\t\n\t\t// create Scanner to obtain input from command window\n\t\tScanner input = new Scanner ( System.in );\n\t\tdouble withdrawAmount; // debit amount read from user\n\t\t\n\t\tSystem.out.print( \"Enter debit amount for account1: \" ); // prompt\n\t\twithdrawAmount = input.nextDouble(); // obtain user input\n\t\tSystem.out.printf(\"\\ndeducting %.2f from account1 balance\\n\\n\", withdrawAmount );\n\t\taccount1.debit(withdrawAmount); // deduct from account1 balance\n\t\t\n\t\t// display balances\n\t\tSystem.out.printf( \"account1 balance: $%.2f\\n\", account1.getBalance() );\n\t\tSystem.out.printf( \"account2 balance: $%.2f\\n\\n\", account2.getBalance() );\n\t\t\n\t\tSystem.out.print( \"Enter withdraw amount for account2: \"); // prompt\n\t\twithdrawAmount = input.nextDouble(); // obtain user input\n\t\tSystem.out.printf( \"\\ndeducting %.2f from account2 balance\\n\\n\", withdrawAmount );\n\t\taccount2.debit( withdrawAmount ); //deduct from account2 balance\n\t\t\n\t\t// display balances\n\t\tSystem.out.printf( \"account1 balance: $%.2f\\n\", account1.getBalance() );\n\t\tSystem.out.printf( \"account2 balance: $%.2f\\n\", account2.getBalance() );\n\t}", "public account(int acc,int Id,String Atype,double bal ){\n this.accNo = acc;\n this.id = Id;\n this.atype = Atype;\n this.abal = bal;\n }", "void deposit(double Cash){\r\n\t\tbalance=balance+Cash;\r\n\t}", "public static void main(String[] args) {\n\t\t\n\tbankAccount ba = new bankAccount();\n\t\n\tcheckingAccount ca = new checkingAccount();\n\t// after checkingAccount class when i extends with bankaccount class \n\t// now if i call ca. it will be connect with bankAccount class...which called inheritance..\n\t\n\tsavingAccount sa = new savingAccount();\n\t// sa. that means this savingAccount class have accesss savingAccount and bankAccount\n\t// caz i extends checkingAccount class with savingAccount......\n\t\n\tba.checkAccount();\n\tba.depositMoney();\n//.......this is abstruct idea..........................................//\n\t\n\t//Before absturct i can creat an object of the class...\n\t\n\tAbstract_class ac = new Abstract_class();\n\t\n\t\n\t// i cant not creat it caz the abastract......\n\t//Abstract1_class ac = new Abstract1_class();\n\t\n\t}", "public BankAccount() {\n\t\tthis.money = 0;\n\t}", "public Savings_Account (int account_num, double initial_balance, double interest_rate) \r\n {\r\n\r\n super (account_num, initial_balance);\r\n\r\n rate = interest_rate;\r\n\r\n }", "public static void main(String[] args) throws FileNotFoundException\r\n\t{\n\t\tBank b1 = new Bank();\r\n//\t\tb1.setCustomers(b1.LoadCustomersFromFile());\r\n\t\tSystem.out.println(b1.printCustomersToString());\r\n\t\tSystem.out.println(b1.printTransactionsToString());\r\n\t\tCustomer customer = b1.getCustomers().get(5);\r\n\t\tAccount account = b1.getCustomers().get(5).getAccounts().get(0);\r\n//\t\taccount.createMonthlyStatement(\"Oct\", 2019, account, customer, b1);\r\n//\t\tb1.setTransactions(b1.LoadTransactionsFromFile());\r\n\t\tSystem.out.println(b1);\r\n//\t\tBank b1=runcreate();\r\n//\t\tSystem.out.println(b1);\r\n//\t\tSaveorLoadBank.LoadBankFromFile();\r\n//\t\tArrayList<Customer> customers = b1.getCustomers();\r\n//\t\tCustomer c1 = customers.get(4);\r\n//\t\tCustomer c2 = customers.get(5);\r\n//\t\tSystem.out.println(customers.get(4));\r\n//\t\tSystem.out.println(customers.get(5));\r\n//\t\tAccount a1 = customers.get(4).getAccounts().get(0);\r\n//\t\tAccount a2 = customers.get(5).getAccounts().get(0);\r\n//\t\tTransferManager.Transfer(c1, a1, c2, a2, (long) 100);\r\n//\t\tSystem.out.println(c1);\r\n//\t\tSystem.out.println(c2);\r\n//\t\tSystem.out.println(b1);\r\n//\t\tSystem.out.println(b1);\r\n\t\tb1.saveTofilePrintWriter();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t}", "public BankAccount(int balance) {\n\n this.balance = balance;\n\n }", "public BankAccount() {\r\n\t\tbalance=0;\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tBankAccount joe = new BankAccount();\n\t\tSystem.out.println(joe.getAccountNumber());\n\t\tjoe.deposit(\"checking\", 4000.00);\n\t\tjoe.withdraw(\"savings\", 300.00);\n\t}", "public static void main(String[] args) {\n Addition onion = new Addition(\"Onion\", 1.5);\n Addition potato = new Addition(\"Potato\", 1.5);\n Addition lettuce = new Addition(\"Lettuce\", 0.5);\n Addition ketchup = new Addition(\"Ketchup\", 0.5);\n Addition chips = new Addition(\"Ketchup\", 1.5);\n Addition drink = new Addition(\"Ketchup\", 1.5);\n\n System.out.println(\"---------------Basic------------------\");\n Basic basic = new Basic(\"Basic\", \"Sesame\", \"Beaf\", 12.00,\n onion, potato, lettuce);\n System.out.println(basic.getName() + \" with \" + basic.getBreadRoll() + \" - Total \" + basic.getTotalPrice() + \"\\n\" +\n \" Base Price \" + basic.getBasePrice() + \"$\\n\" + basic.getAdditions() + \"Additions Total \" +\n basic.getAdditionsPrice());\n\n System.out.println(\"---------------Deluxe------------------\");\n Deluxe deluxe = new Deluxe(\"Deluxe\", \"Sumac\", \"Fish\", 8.5);\n System.out.println(deluxe.getName() + \" with \" + deluxe.getBreadRoll() + \"- Total \" + deluxe.getTotalPrice() + \"\\n\" +\n \" Base Price \" + deluxe.getBasePrice() + \"$\\n\" + deluxe.getAdditions()+ \"Additions Total \" +\n deluxe.getAdditionsPrice());\n\n System.out.println(\"---------------Healthy------------------\");\n Healthy healthy = new Healthy(\"Healthy\", \"Chicken\", 10.0, lettuce, onion);\n System.out.println(healthy.getName() + \" with \" + healthy.getBreadRoll() + \"- Total \" + healthy.getTotalPrice() + \"\\n\" +\n \" Base Price \" + healthy.getBasePrice() + \"$\\n\" + healthy.getAdditions()+ \"Additions Total \" +\n healthy.getAdditionsPrice());\n }", "private String statementForAccount(Account account) {\n\tStringBuilder statement = new StringBuilder(\"\");\n\n //Translate to pretty account type\n switch(account.getAccountType()){\n case CHECKING:\n statement.append(\"Checking Account\\n\");\n break;\n case SAVINGS:\n statement.append(\"Savings Account\\n\");\n break;\n case MAXI_SAVINGS:\n statement.append(\"Maxi Savings Account\\n\");\n break;\n }\n\n //Now total up all the transactions\n double total = 0.0;\n for (Transaction transaction : account.getTransactions()) {\n statement.append(\" \" + (transaction.getAmount() < 0 ? \"withdrawal\" : \"deposit\") + \" \" + toDollars(transaction.getAmount()) + \"\\n\");\n total += transaction.getAmount();\n }\n statement.append(\"Total \" + toDollars(total));\n return statement.toString();\n }", "public static Account test() {\r\n\t\tAccount newAccount = createNewAccount(\"address@email.com\", \"Test Account\");\r\n\t\t\r\n\t\t//Create participants - accounts first\r\n\t\tAccount partAccount1 = new Account(\"Manuel\");\r\n\t\tAccount partAccount2 = new Account(\"Tatenda\");\r\n\t\tAccount partAccount3 = new Account(\"Dan\");\r\n\t\tAccount partAccount4 = new Account(\"Kirill\");\r\n\t\t\r\n\t\t//Creates first event - Trip\r\n\t\tnewAccount.createEvent(\"Trip\", \"Short Term\");\r\n\t\t\r\n\t\t//Add participants\r\n\t\tnewAccount.events.get(0).addParticipant(new Participant(partAccount1));\r\n\t\tnewAccount.events.get(0).addParticipant(new Participant(partAccount2));\r\n\t\tnewAccount.events.get(0).addParticipant(new Participant(partAccount3));\r\n\t\tnewAccount.events.get(0).addParticipant(new Participant(partAccount4));\r\n\t\t\r\n\t\tEvent firstEvent = newAccount.events.get(0);\r\n\t\tArrayList<Participant> firstParts = (ArrayList<Participant>) firstEvent.getParticipants();\r\n\t\t\r\n\t\tArrayList<Item> items = new ArrayList<Item>();\r\n\t\titems.add(new Item(\"Bread1\", 10.0));\r\n\t\titems.add(new Item(\"Bread2\", 20.0));\r\n\t\titems.add(new Item(\"Bread3\", 30.0));\r\n\t\titems.add(new Item(\"Bread4\", 40.0));\r\n\t\t\r\n\t\t//Add activities\r\n\t\tfirstEvent.addBalanceChange(new Transaction(\"tmpname1\", firstParts, items));\r\n\t\tfirstEvent.addBalanceChange(new Transaction(\"tmpname2\", firstParts, items));\r\n\t\t//Could add more activities (transactions or payments here)\r\n\t\t\r\n\t\t//Creates second event - Household - and two three activities to it\r\n\t\tnewAccount.createEvent(\"Household\", \"Long Term\");\r\n\t\t\r\n\t\tArrayList<Item> items2 = new ArrayList<Item>();\r\n\t\titems2.add(new Item(\"Meat1\", 10.0));\r\n\t\titems2.add(new Item(\"Meat2\", 20.0));\r\n\t\titems2.add(new Item(\"Meat3\", 30.0));\r\n\t\titems2.add(new Item(\"Meat4\", 40.0));\t\t\r\n\t\t\r\n\t\t\r\n\t\t//Add participants\r\n\t\tnewAccount.events.get(1).addParticipant(new Participant(partAccount1));\r\n\t\tnewAccount.events.get(1).addParticipant(new Participant(partAccount2));\r\n\t\t\r\n\t\t\r\n\t\tEvent secondEvent = newAccount.events.get(1);\r\n\t\tArrayList<Participant> secondParts = (ArrayList<Participant>) secondEvent.getParticipants();\r\n\t\t\r\n\t\t//Add activities\r\n\t\tsecondEvent.addBalanceChange(new Transaction(\"tmpname3\", secondParts, items2));\r\n\t\tsecondEvent.addBalanceChange(new Transaction(\"tmpname4\", secondParts, items2));\r\n\t\t\r\n\t\tnewAccount.updatePastRelations();\r\n\t\t\r\n\t\treturn newAccount;\r\n\t}", "public void deposit (double amount) \r\n {\r\n\r\n balance += amount;\r\n System.out.println (\"Deposit into account shs: \" + account);\r\n System.out.println (\"Standing Amount: \" + amount);\r\n System.out.println (\"Current balance: \" + balance);\r\n System.out.println ();\r\n\r\n }", "public static void main(String[] args) {\n\n\t\tDemo dem = new Demo();\n\t\tBigDecimal initialDeposit = new BigDecimal(0);\n\n\t\tPerson customer1 = dem.addPerson(\"Ade\", \"104 Lane Dr\", 28738);\n\t\tdem.customers.put(dem.custTracker, customer1);\n\t\tBigDecimal startingNum1 = new BigDecimal(100);\n\t\tCustomer customer2 = dem.addPerson(\"Jane\", \"104 Lane Dr\", 43436);\n\t\tdem.customers.put(dem.custTracker, customer2);\n\t\tBigDecimal startingNum2 = new BigDecimal(30);\n\t\tCompany company1 = dem.addCompany(\"This Company\", \"3948 Lego Ln\", 76858);\n\t\tdem.customers.put(dem.custTracker, company1);\n\t\tBigDecimal startingNum3 = new BigDecimal(30124);\n\t\t\n\t\t\n\n\t\tSavings forcustomer1 = dem.addSavAcc(startingNum1);\n\t\tdem.accounts.put(dem.accTracker, forcustomer1);\n\t\tCurrent forcustomer2 = dem.addCurrAcc(startingNum2, 5615652, 8744155); //saving first check num and next cheque num\n\t\tdem.accounts.put(dem.accTracker, forcustomer2);\n\t\tCurrent forcompany1 = dem.addCurrAcc(startingNum3, 52929526, 615651922);\n\t\tdem.accounts.put(dem.accTracker, forcompany1);\n\n\t\tBigDecimal withdrawl = new BigDecimal(110); //testing no overdraft of savings\n\t\tforcustomer1.withdraw(withdrawl);\n\t\t\n\t\tBigDecimal deposit = new BigDecimal(40); //test deposit method\n\t\tforcustomer2.deposit(deposit);\n\t\t\n\t\tBigDecimal reset = new BigDecimal(1000);\n\t\tcustomer1.reset(reset);\n\n\t\t\n\t\tcompany1.add(deposit);\n\t\t\n\t\t\n\t\t//company1.add(bd);\n\t\t\n\t\t//forcustomer2.overdraw(); // test overdraft fee method\n\t\t\n\t\t//BigDecimal correctbalance = new BigDecimal(1000); // test correction method\n\t\t//forcustomer2.correction(correctbalance);\n\n\t\t\n\t\t\n\t\tSystem.out.println(dem.customers);\n\t\tSystem.out.println(dem.accounts);\n\n\t\t// BigDecimal accBalance = new BigDecimal(0);\n\t\t// currAcc.setBalance(accBalance); // okay it works. i guess. so thats good.\n\t\t// System.out.println(currAcc.getBalance());\n\t\t//\n\t\t// accountSetUp(accBalance, 1000);\n\t}", "public BankAccount() {\n numberOfAccounts++;\n this.accountNumber = accountNumberGenerator(); \n }", "public static void main(String[] args) {\n\t\tAccountClass account = new AccountClass(1122, 20000.0);\r\n\t\taccount.setAnnualInterestRate(4.5);\r\n\t\taccount.withdraw(2500.0);\r\n\t\taccount.deposit(3000.0);\r\n\t\tSystem.out.println(\"Balance: $\" + account.getBalance());\r\n System.out.println(\"Monthly Interest: \" + account.getMonthlyInterestRate());\r\n System.out.println(\"Date Created: \" + account.getDataCreatead());\r\n\t\t}", "public String toString() {\n return \"Account \" + name + \" has $\" + balance + \"and is \" + getState()\n + \"\\n\";\n }", "public BankAccount(int accountNum, String customerName, double balance){\n this.accountNum = accountNum;\n this. customerName = customerName;\n this.balance = balance;\n }", "public Account()\n {\n // initialise instance variables\n balance = 0.00;\n remainder = 0;\n }", "public static void main(String[] args){\n //create 2 SavingsAccount objects saver1 and saver2\n SavingsAccount saver1 = new SavingsAccount(2000.00);\n SavingsAccount saver2 = new SavingsAccount(3000.00);\n //set initial int rate at 4%\n SavingsAccount.modifyInterestRate(0.04);\n //calc monthly int for 12 months, set new balances and print new balances\n System.out.println(\"-Month----------Saver 1----------Saver 2----Interest Rate-\");\n for(int i = 1; i < 13; i++){\n //call each objects calc monthly int method 12 times\n saver1.calculateMonthlyInterest();\n saver2.calculateMonthlyInterest();\n //if statements are for proper table formatting, just visual whitespace changes\n if(i<=9) {\n System.out.printf(\" %d $%.02f $%.02f %.02f%%\\n\", i, saver1.getSavingBalance(), saver2.getSavingBalance(), (saver1.getInterestRate()*100.0));\n }\n else{\n System.out.printf(\" %d $%.02f $%.02f %.02f%%\\n\", i, saver1.getSavingBalance(), saver2.getSavingBalance(), (saver1.getInterestRate()*100.0));\n }\n }\n //set int rate to 5%\n SavingsAccount.modifyInterestRate(0.05);\n //calc next months int and print new balances\n saver1.calculateMonthlyInterest();\n saver2.calculateMonthlyInterest();\n System.out.printf(\" 13 $%.02f $%.02f %.02f%%\\n\", saver1.getSavingBalance(), saver2.getSavingBalance(),(saver1.getInterestRate()*100.0));\n System.out.println(\"\");\n }", "private Account createAccount4() {\n Account account = new Account(\"123456004\", \"Chad I. Cobbs\",\n new SimpleDate(4, 23, 1976).asDate(), \"chadc@netzero.com\", true, false,\n new CreditCard(\"1234123412340004\"), new CreditCard(\"4320123412340005\"));\n\n final Percentage percent50 = new Percentage(0.5);\n final Percentage percent25 = new Percentage(0.25);\n account.addBeneficiary(\"Jane\", percent25);\n account.addBeneficiary(\"Amy\", percent25);\n account.addBeneficiary(\"Susan\", percent50);\n return account;\n }", "public static void main(String[] args) {\n\nBank b=new Bank();\nb.creditCard();\nb.fixedDeposit();\nb.currentAccount();\nb.savingsAccount();\n\n\t}", "public void xxx() {\n System.out.println(\"Salary: \" + salary);\n printInfo();\n\n Employee e = new Employee(\"Andy\", \"123\", 26);\n// System.out.println(\"Name: \" + e.name + \"; Age: \" + e.age + \";ID: \" + e.id);\n\n Manager m = new Manager(\"Andylee\", \"124\", 27);\n// System.out.println(\"Name: \" + m.name + \"; Age: \" + m.age + \";ID: \" + m.id);\n\n }", "public Account(){\n this.id = 0;\n this.balance = 0;\n this.annualInterestRate = 0;\n this.dateCreated = new Date();\n }", "public static void main(String[] args)\r\n\t{\r\n\t\t\r\n\t\tCalendar calendarInstance = Calendar.getInstance();\r\n\t\t\r\n\t\tint monthInt = calendarInstance.get(Calendar.MONTH) + 1;\r\n\t\tint dayInt = calendarInstance.get(Calendar.DAY_OF_MONTH);\r\n\t\tint yearInt = calendarInstance.get(Calendar.YEAR);\r\n\t\t\r\n\t\tString year = Integer.toString(yearInt);\r\n\t\tString month = Integer.toString(monthInt);\r\n\t\tString day = Integer.toString(dayInt);\r\n\t\t\r\n\t\tString calendarDate = new String(year + \"-\" + month + \"-\" + day);\r\n\t\t\r\n\t\tCustomerAccount geckoAccount = new CustomerAccount(1, \"Gordon Gecko\", \"1 Wall Street New York, NY 10002\", 100000000);\r\n\t\t\r\n\t\tgeckoAccount.addPurchase(250000.00, \"2012-09-08\", \"Rolls Royce\", \"New York\", \"NY\");\r\n\t\tgeckoAccount.addPurchase(300000.00, \"2012-09-10\", \"Tiffany's\", \"New York\", \"NY\");\r\n\t\tgeckoAccount.addPurchase(250000.00, \"2012-09-15\", \"Alfa Romero\", \"New York\", \"NY\");\r\n\t\t\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Valued CardHolder:\\t\" + geckoAccount.getCustName());\r\n\t\tSystem.out.println(\"Cardholder Address:\\t\" + geckoAccount.getCustAddress());\r\n\t\tSystem.out.println(\"Credit Limit:\\t\\t\" + geckoAccount.getCreditLimit());\r\n\t\tSystem.out.println(\"Current Unpaid Balance:\\t\" + geckoAccount.getUnpaidBalance());\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Transactions on this account as of \" + calendarDate + \":\\n\");\r\n\t\tSystem.out.println(\"\\tDate:\\t\\t\\tMerchant:\\t\\tCity:\\t\\t\\tState:\\t\\tAmount:\\n\");\r\n\t\t\r\n\t\tString purchaseDate = \"\";\r\n\t\tString merchantName = \"\";\r\n\t\tString merchantCity = \"\";\r\n\t\tString merchantState = \"\";\r\n\t\tString purchaseAmount = \"\";\r\n\t\t\r\n\t\t// Initializes a purchase object in order to access the transactionList array and then prints the\r\n\t\t// purchase data via calling the appropriate getter methods\r\n\t\tfor(int index = 0; index < transactionList.size(); index++)\r\n\t\t{\r\n\t\t\t\r\n\t\t\tPurchase purchase = transactionList.get(index);\r\n\t\t\t\r\n\t\t\tpurchaseDate = purchase.getPurchaseDate();\r\n\t\t\tmerchantName = purchase.getMerchantName();\r\n\t\t\tmerchantCity = purchase.getMerchantCity();\r\n\t\t\tmerchantState = purchase.getMerchantState();\r\n\t\t\t\r\n\t\t\tdouble amount = purchase.getPurchaseAmount();\r\n\t\t\tpurchaseAmount = Double.toString(amount);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"\\t\" + purchaseDate + \"\\t\\t\" + merchantName + \"\\t\\t\" + merchantCity + \"\\t\\t\" + merchantState + \"\\t\\t$\" + purchaseAmount);\r\n\t\t\t\r\n\t\t}\t// End of for loop\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public SavingsAccount() {\n\t}", "public BankAccount()\n {\n \t//intializing instance variables\n \t//at the time object creation constuctor executes \n \t\n \taccountHolderName=\"unknow\";\n \taccountBalance=0;\n \t\n }", "Bank(String name, double currentAmount) {\n this.accountName = name;\n this.currentAmount = currentAmount;\n }", "public void deposit();", "public static void main(String[] args) {\n\t\tAccount2 lis = new Account2(\"李四\", \"1234\", 1000);\r\n\t\tlis.withdraw(100);\r\n\t\tlis.deposit(200);\r\n\t\tSystem.out.println(lis.getBanlance());\r\n\t}", "@Override\n public String toString()//to show data\n {\n return \"the balance = \" + balance + \"\\n the account_number = \" + account_number + \"\\n\";\n }", "public static void main(String[] args) {\r\n\t\t\r\n\t\tint num=10;\r\n\t\tAccount e[] = new Account[num]; //create size in stack\r\n\t\t\r\n\t\r\n\t\t\r\n\t\t \r\n\t\t\r\n\t\tfor(int i = 0;i<e.length;i++)\r\n\t\t{\r\n\t\t\te[i] = new Account();//create memory in heap\r\n\t\t\te[i].readData();\r\n\t\t\te[i].display();\r\n\t\t\te[i].withdraw(2200);\r\n\t\t\t e[i].deposit(400);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t \t \r\n\t \t \r\n\t \t \r\n\t\t \r\n\t\t \r\n\t }", "public static void deposit(){\n TOTALCMONEY = TOTALCMONEY + BALANCEDEPOSIT; //the cashier money equals the cashier money plus the amount that is being deposited\r\n BALANCE = BALANCE + BALANCEDEPOSIT; //the user balance equals the user balance plus the amount that is being deposited\r\n }", "public static void main(String[] args) {\n\t\tAccount johnAccount = new Account(\"John\",1234567,450.76);\r\n\t\t\r\n\t\t// Create account object for Mary\r\n\t\tAccount maryAccount = new Account(\"Mary\",637537558, 111.11);\r\n\t\t\r\n\t\t\r\n\t\t// Set the account fee\r\n\t\tAccount.fee = 12.40;\r\n\t\t\r\n\t\t// Display account fees\r\n\t\tSystem.out.println(\"John's fee: \" + johnAccount.fee);\r\n\t\tSystem.out.println(\"Mary's fee: \" + maryAccount.fee);\r\n\t\t\r\n\t\t// Change account fee\r\n\t\tAccount.fee = 6.20;\r\n\t\t\r\n\t\t// Display account fees again\r\n\t\tSystem.out.println(\"John's fee: \" + johnAccount.fee);\r\n\t\tSystem.out.println(\"Mary's fee: \" + maryAccount.fee);\r\n\r\n\t}", "@Override\n\tvoid make_deposit(DataStore ds){\n\tds.setbalancedepositAccount1(ds.getbalanceAccount1_temp()+ds.getdepositAccount1());\n\t}", "public Account(String owner, int ownerID, int accountID, double growthRate){\n this.owner = owner;\n this.ownerID = ownerID;\n this.accountID = accountID;\n this.growthRate = growthRate;\n \n }", "@Override\r\n\tpublic void deposit() {\n\t\tSystem.out.println(\"This Deposit value is from Axisbank class\");\r\n\t\t//super.deposit();\r\n\t}", "public static void main(String[] args) {\n\t\tAccount racun= new Account();\r\n\t\tAccount user= new Account(1122,20000);\r\n\t\t\r\n\t\t//pozivanje metoda na objekat\r\n\t\tuser.setAnnualInterestRate(4.5);\r\n\t\tuser.withdraw(2500);\r\n\t\tuser.deposit(3000);\r\n\t\t\r\n\t\t//ispis rezultata\r\n\t\tSystem.out.println(\"Stanje racuna je: \"+user.getBalance());\r\n\t\tSystem.out.println(\"Mjesecni prohod je: \"+user.getMonthlyInterest());\r\n\t\tSystem.out.println(\"Datum kreiranja racuna je: \"+user.getDateCreated());\r\n\t\t\r\n\t}", "public Account(String currency) {\n //numAccount += 1;\n incrementNumAccount();\n this.accountID = numAccount;\n this.dateOfCreation = LocalDate.now();\n\n setPrimaryCurrency(currency);\n this.currencyBalance = Money.of(0, this.primaryCurrency);\n ownerID = new ArrayList<>();\n }", "public Wallet() {\n total_bal = 10;\n }", "public static void main(String[] args) {\n\t\tAccount account = new Account(1122, 20000);\r\n\t\taccount.setAnnualInterestRate(4.5);\r\n\t\taccount.withdraw(2500); //withdraw $2500\r\n\t\taccount.deposit(3000); //deposit $3,000\r\n\t\t\r\n\t\t//print the balance, the monthly interest, and the date when this account was created\r\n\t\tSystem.out.println(\"Balance: \"+account.getBalance()\r\n\t\t\t\t+\"\\nMonthly Interest: \"+account.getMonthlyInterest()+\" \"\r\n\t\t\t\t+\"\\nThe account was created on: \"\r\n\t\t\t\t+new SimpleDateFormat(\"dd/MM/YYYY HH:mm:ss\").format(account.getDateCreated()));\r\n\t\t\t\t//using a format \"Day/Month/Year hours:minutes:seconds\" for the Date\r\n\t}", "public static void main(String[] args) {\n\t\tSbi b = new Sbi();\n\t\tb.deposit();\n\t\t\n\t\t/*Bank b1 = new Bank();\n\t\tb1.deposit();*/\n\t}", "Account(String name, double balance)\r\n\t{\r\n\t\t\r\n\t\tthis.name = name; //assign name to the instance variable name \r\n\t\t\r\n\t\t// validate that the balance is greater that 0.0; if it is not,\r\n\t\t// instance variable balance keeps its default value 0.0\r\n\t\tif(balance > 0.0) // if balance is valid\r\n\t\t\tthis.balance = balance; // assign balance to the instance variable balance\t\t\t\t\t\r\n\t}", "public void makeDeposit() {\n deposit();\n }", "public static void main(String[] args){\n\t\tAccount Nick_account = new Account(1122,20000);\n\t\t\n\t\t\n\t\t//Setting annual interest rate to 4.5%\n\t\tNick_account.set_AnnualInterest(4.5);\n\t\t\n\t\t//Withdraw\n\t\ttry{\t\n\t\t\tSystem.out.println(\"Withdrawing $2000\");\n\t\t\tNick_account.Withdraw(2000);\n\t\t}\n\t\tcatch(InsufficientFundsException e)\n\t {\n\t System.out.println(\"Sorry, but you are short $\"\n\t + e.getAmount());\n\t e.printStackTrace();\n\t }\n\t\t\n\t\t//Deposit\n\t\tSystem.out.println(\"Depositing $3000\");\n\t\tNick_account.Deposit(3000);\n\t\t\n\t\t//Withdraw that throws exception\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.printf(\"Your account contains $ %.2f\\n\", Nick_account.get_Balance());\n\t\t\n\t\tSystem.out.println(\"Your monthly interest is \" + Nick_account.get_MonthyInterest()+\"%\");\n\t\tSystem.out.println(\"Your account was created on \" + Nick_account.get_Date());\n\t\t\n\n\t}", "public SavingsAccount()\n {\n super();\n this.interestRate = DEFAULT_RATE;\n System.out.println(\"Constructor is called.\");\n }", "public BankAcc(){\r\n //uses another constuctor\r\n this(593,2.5,\"Deg\",\"Deg\",\"Deg\");\r\n System.out.println(\"EMpty\");;\r\n }", "public void TestAccount1() {\n\n AccountCreator account = new AccountCreator();\n account.setFirstName(\"Bob\");\n account.setLastName(\"Smith\");\n account.setAddress(\"5 Rain Road\");\n account.setPIN();\n account.setTestBalance(300);\n accountList.add(account);\n\n }" ]
[ "0.8042381", "0.8011274", "0.7290828", "0.70125914", "0.6992222", "0.68877864", "0.6868735", "0.6766186", "0.6687418", "0.6662226", "0.6656728", "0.66209215", "0.66148114", "0.65708864", "0.65031147", "0.65021306", "0.6403824", "0.63928086", "0.63576347", "0.63517976", "0.6333595", "0.63301533", "0.63153595", "0.63113534", "0.6302188", "0.63008696", "0.629412", "0.6293926", "0.6286665", "0.62857336", "0.6271891", "0.62327015", "0.6232081", "0.6231183", "0.62270975", "0.62084574", "0.6204477", "0.61878544", "0.61792654", "0.6173009", "0.6141285", "0.6140944", "0.61366695", "0.61243916", "0.61233085", "0.6122292", "0.61219037", "0.61125386", "0.61086875", "0.6090812", "0.60829735", "0.6081523", "0.6071081", "0.60681814", "0.60641253", "0.6059483", "0.6056672", "0.60531896", "0.6038592", "0.6038001", "0.60232407", "0.6011506", "0.5997241", "0.59950477", "0.5994776", "0.599324", "0.59866893", "0.5985547", "0.598029", "0.5968047", "0.59679264", "0.5966304", "0.59635454", "0.59606016", "0.59463286", "0.5936828", "0.5931694", "0.593034", "0.5923476", "0.59140956", "0.59075373", "0.59073514", "0.5902074", "0.58997256", "0.58956975", "0.58937293", "0.58902115", "0.58756137", "0.5870747", "0.5847226", "0.58437943", "0.58432376", "0.58405095", "0.583906", "0.5837391", "0.58291405", "0.58285874", "0.5828108", "0.5819626", "0.58062834" ]
0.62184286
35
Created by belong on 16116.
public interface IMoviesService{ String getPath(int Vid); Movies getPic(int Vid); ArrayList<Movies> search(Map map); void views(int Vid); void upload(Map map); Review review(Map map); ArrayList<Movies> getInfo(Map map); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "public final void mo51373a() {\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}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "public void mo38117a() {\n }", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "public void mo4359a() {\n }", "@Override\n public void func_104112_b() {\n \n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void interr() {\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\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n protected void init() {\n }", "@Override\n protected void getExras() {\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 public void memoria() {\n \n }", "private void poetries() {\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() {}", "public void gored() {\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\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n void init() {\n }", "@Override\n public void init() {}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n protected void initialize() \n {\n \n }", "@Override\n public void inizializza() {\n\n super.inizializza();\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}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "protected void mo6255a() {\n }", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\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 int describeContents() { return 0; }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\t\tpublic void init() {\n\t\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void emprestimo() {\n\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}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\n\tpublic void init() {\n\t}", "protected boolean func_70814_o() { return true; }", "private void init() {\n\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "public void mo6081a() {\n }", "public void mo55254a() {\n }", "@Override\n public void init() {\n }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "private Rekenhulp()\n\t{\n\t}" ]
[ "0.6177166", "0.59691966", "0.59564537", "0.5953267", "0.5953182", "0.59147316", "0.58934176", "0.58934176", "0.5854273", "0.57745516", "0.5772598", "0.57682097", "0.5735521", "0.5726933", "0.57230955", "0.57093495", "0.5689373", "0.5687238", "0.5686592", "0.56548136", "0.56359917", "0.56291646", "0.56283873", "0.5624934", "0.5623753", "0.5614188", "0.5614188", "0.5614188", "0.5614188", "0.5614188", "0.5601097", "0.55959284", "0.55900276", "0.5585016", "0.55791974", "0.5568324", "0.5568324", "0.5568324", "0.5568324", "0.5568324", "0.5568324", "0.556829", "0.556618", "0.5565919", "0.5565919", "0.5565919", "0.5565919", "0.5565919", "0.5565919", "0.5565919", "0.55651987", "0.55651486", "0.5564674", "0.5564674", "0.5564674", "0.5561883", "0.5561883", "0.55390143", "0.5538743", "0.5529173", "0.5526028", "0.55180997", "0.5517797", "0.55127764", "0.5506595", "0.5506595", "0.5506595", "0.5499415", "0.54969925", "0.54933935", "0.5492471", "0.54866385", "0.5486599", "0.54710114", "0.54710114", "0.5464062", "0.5464062", "0.5464062", "0.54543126", "0.54542667", "0.5449606", "0.5444481", "0.5438247", "0.5437926", "0.54320836", "0.5427232", "0.5427232", "0.54267204", "0.54211617", "0.54139906", "0.5393463", "0.5391545", "0.53870827", "0.53824806", "0.53744864", "0.5371864", "0.53708273", "0.5370726", "0.5362254", "0.5361394", "0.53494495" ]
0.0
-1
/ orElse of Optional checks and return if the Optional has value or null orElseThrow will throw the supplied exception if Optional is null or empty
public Topic getTopic(String id) { return topicRepository.findById(id).orElseThrow(() -> new ResourceNotFoundException(id)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void optional() {\n\n // .stream\n Stream<Optional<Employee>> emp = getEmployeeStream(\"Some employee ID\");\n Stream<Employee> empStream = emp.flatMap(Optional::stream);\n\n // .or\n Optional<Employee> or = getEmployee(\"123\").or(() -> Optional.of(new Employee(\"123\")));\n\n // .ifPresentOrElse\n or.ifPresentOrElse(employee -> {\n System.out.println(\"Present\");\n }, () -> {\n System.out.println(\"Else\");\n });\n\n }", "public void testOrNPE1() {\r\n try {\r\n validator.or(null);\r\n fail(\"an NPE is expected\");\r\n }\r\n catch (NullPointerException npe) {\r\n //pass\r\n }\r\n }", "Try<T> orElse(Supplier<Try<T>> fn);", "private static void optionalOrElseBasic() {\n \n System.out.println(\"name remains = \"+Optional.ofNullable(\"Yassir\").orElse(\"Arafat\"));\n System.out.println(\"name changed = \"+Optional.ofNullable(null).orElse(\"Arafat\"));\n }", "public User orElseThrow(Object object) {\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n Object value = Optional.ofNullable(null)\n .orElseGet(() -> \"default value\");\n\n System.out.println(value);\n\n // this returns an exception when the right value is not entered\n Object newValue = Optional.ofNullable(45)\n .orElseThrow(() -> new IllegalStateException(\"exception\"));\n\n System.out.println(newValue);\n\n // checks if a value is present and then runs an operation\n Optional.ofNullable(\"samuel.afotey@turntabl.io\")\n .ifPresentOrElse(email -> System.out.println(\"Sending email to \" + email),\n () -> System.out.println(\"Cannot send email\"));\n }", "boolean hasOptionalValue();", "boolean isOptional();", "default V getOrElse(V value) {\n return isEmpty() ? value : get();\n }", "private static void optionalIfPresent() {\n Optional<String> optionalOb = Optional.of(\"Yassir\");\n optionalOb.ifPresent(name -> {System.out.println(\"Name = \"+name);});\n }", "T getOrElse(T value);", "default V getOrThrow() {\n return getOrThrow(\"null\");\n }", "public THING orElseNull() {\n return directlyGetOrElse(null);\n }", "default void orElseThrow(Throwable t) throws Throwable {\n if (isFailure()) throw t;\n }", "default V getOrThrow(String message) {\n return Conditions.nonNull(get(), message);\n }", "Optional<T> toOptional();", "public T orElse(T other) {\r\n\t\treturn value != null ? value : other;\r\n\t}", "@Test(timeout = 4000)\n public void test049() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.addOptionalCondition(\"\", (StringBuilder) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "public static void main(String[] args) {\n\t\tOptional<Object> empty = Optional.empty();\r\n\t\tSystem.out.println(empty.isPresent()); // returns false, since Object is null\r\n\t\tSystem.out.println();\r\n\t\t\r\n\t\t// Using the of(value) method for a String that is Not null\r\n\t\tOptional<String> helloString = Optional.of(\"Hello!\");\r\n\t\tSystem.out.println(helloString.isPresent()); // returns true, since String = \"Hello and is Not null. \r\n\t\tSystem.out.println();\r\n\t\t\r\n\t\t// orElse(other value) - returns the value if present, otherwise returns the other value\r\n\t\tString orElse = helloString.orElse(\"Howdy!\");\r\n\t\tSystem.out.println(orElse);\r\n\t\tSystem.out.println();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t// Using the ofNullable(value) method for a null String\r\n\t\tOptional<String> hello = Optional.ofNullable(null);\r\n\t\thello\r\n\t\t\t.map(String::toUpperCase)\r\n\t\t\t.orElse(\"Howdy!\"); // orElse() returns the other value: String 'Howdy!'\r\n\t\tSystem.out.println(hello); \r\n\t\tSystem.out.println();\r\n\t\t\r\n\t\t// Using chain methods on helloString with map() and orElseGet() methods\r\n\t\torElse = helloString\r\n\t\t\t\t.map(String::toUpperCase)\r\n\t\t\t\t.orElseGet(() -> {\r\n\t\t\t\t\t// ..some extra computations to get the value\r\n\t\t\t\t\treturn \"world\"; // helloString is Not null, since not getting 'world'.\r\n\t\t\t\t});\r\n\t\tSystem.out.println(orElse);\r\n\t\tSystem.out.println();\r\n\t\t\r\n\t}", "public static void createOptionals() {\n String nullString = null;\n String emptyString = \"\";\n\n Optional.ofNullable(nullString);\n Optional.of(emptyString);\n try {\n Optional.of(nullString);\n } catch (NullPointerException e) {\n }\n Optional.empty();\n }", "T getOrElse(Supplier<T> fn);", "public void test6(){\n User user = null;\n\n String name = Optional.ofNullable(user).map(User :: getName).orElse(\"taotao\");\n\n System.out.println(name);\n }", "public Optional<SpreadsheetError> error() {\n final Optional<Object> value = this.value();\n\n final Object maybeValue = this.value()\n .orElse(null);\n return maybeValue instanceof SpreadsheetError ?\n Cast.to(value) :\n SpreadsheetFormula.NO_ERROR;\n }", "default Optional<V> toOptional() {\n V item = orElseNull();\n return item == null ? Optional.empty() : Optional.of( item );\n }", "public Object getElseValue();", "private <T> T swallowing(T throwing) {\n return null;\n }", "@Test\n public void throwWrappedExOrOriginEx() {\n assertThatThrownBy(() -> repository.findMemberWithSpringEx())\n .isInstanceOf(EmptyResultDataAccessException.class);\n\n // 2) throw origin ex\n assertThatThrownBy(() -> repository.findMemberWithOriginEx())\n .isInstanceOf(NoResultException.class);\n }", "Optional<X> elem();", "public void maybeThrow() {\n if (exception != null)\n throw this.exception;\n }", "private Optional optionalToOptional(ElementOptional optional) throws SemQAException {\n\t\tElement elm = optional.getOptionalElement();\r\n\t\tGraphPattern gp;\r\n\t\tValueConstraint vc;\r\n\t\tif (elm instanceof ElementGroup) {\r\n\t\t\tList<Element> children = ((ElementGroup) elm).getElements();\r\n\t\t\tSet<GraphPattern> childSemQA = new LinkedHashSet<GraphPattern>();\r\n\t\t\tSet<Optional> optionals = new LinkedHashSet<Optional>();\r\n\t\t\tSet<ElementFilter> filters = new LinkedHashSet<ElementFilter>();\r\n\t\t\tfor (Element child : children) {\r\n\t\t\t\tif (child instanceof ElementFilter) {\r\n\t\t\t\t\tfilters.add((ElementFilter) child);\r\n\t\t\t\t}\r\n\t\t\t\telse if (child instanceof ElementOptional) {\r\n\t\t\t\t\t// if child is an optional, need to get the graph pattern for the optional\r\n\t\t\t\t\t// and add it to the list of optional graph patterns\r\n\t\t\t\t\toptionals.add(optionalToOptional((ElementOptional) child));\r\n//\t\t\t\t\tchildSemQA.add(optionalToOptional((ElementOptional) child));\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tchildSemQA.add(sparqlToSemQA(child));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tGraphPattern baseGp = convertSetToJoin(childSemQA);\r\n\t\t\tif (childSemQA.size() == 0) {\r\n\t\t\t\tthrow new SemQAException(\"semQA: OPTIONAL without non-optional side not supported.\");\r\n\t\t\t}\r\n\t\t\tif (optionals.size() > 0) {\r\n\t\t\t\t// if there are optional elements, create a left join\r\n\t\t\t\t// convert the non-filter non-optional graph patterns to a Join if necessary\r\n\t\t\t\t// then, each optional element is part of a left join\r\n\t\t\t\tgp = new LeftJoin(baseGp, optionals);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// no optionals, just return the join of the graph patterns\r\n\t\t\t\tgp = baseGp;\r\n\t\t\t}\r\n\t\t\tif (filters.size() > 0) {\r\n\t\t\t\tvc = getConstraintFromFilters(filters);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvc = null;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tgp = sparqlToSemQA(elm); // if it is not a group\r\n\t\t\tvc = null;\r\n\t\t}\r\n\t\treturn new Optional(gp, vc);\r\n\t\t\r\n\t}", "@org.chromium.protocolReader.JsonOptionalField\n boolean wasThrown();", "public static <T> Optional<T> or(Optional<T> first, Optional<T> second) {\n return first.isPresent() ? first : second;\n }", "public abstract Optional<A> val();", "@Test\n void testDoThrow() {\n\n doThrow(RuntimeException.class).when(dao).foo();\n // doThrow(new RuntimeException()).when(dao).foo();\n\n RuntimeException exception = Assertions.assertThrows(NullPointerException.class,\n () -> service.fetchBookById(42)\n );\n assertThat(exception.getClass(), is(equalTo(NullPointerException.class)));\n }", "public Optional<E> one() {\n return Optional.ofNullable(queryOne());\n }", "@Test\n void borrowBookThrowsOperationStoppedException3(){\n Book book1 = new Book(\"Garry\", \"Fiction\", 0, 1234);\n User user1 = new User(\"Gayal\", \"Rupasinghe\", \"gayal@domain.com\");\n user1.setUserID(1L);\n book1.setBookID(1L);\n\n //User and book both exist.\n Optional<User> optionalUser1 = Optional.of(user1);\n Optional<Book> optionalBook1 = Optional.of(book1);\n given(userService.getUserByID(user1.getUserID())).willReturn(optionalUser1);\n given(bookRepository.findById(book1.getBookID())).willReturn(optionalBook1);\n\n //book is not already borrowed by user.\n given(bookRepository.isBookBorrowedByUser(user1.getUserID(), book1.getBookID())).willReturn(false);\n\n //when and then\n assertThatThrownBy(() -> testBookServiceImpl.borrowBook(user1.getUserID(), book1.getBookID()) )\n .isExactlyInstanceOf(OperationStoppedException.class)\n .hasMessage(\"Book is not available to borrow, quantity is 0.\");\n }", "static String checkEmptyString(String str, String strName) {\n String errorMsg = \"empty \" + strName;\n str = Optional.ofNullable(str).map(s -> {\n if(s.isEmpty()) {\n throw new NullPointerException(errorMsg);\n }\n return s;\n }).orElseThrow(() -> new NullPointerException(errorMsg));\n return str;\n }", "public static <T> Optional<T> or(Optional<T> first, Supplier<Optional<T>> second) {\n return first.isPresent() ? first : second.get();\n }", "private ParseTree maybeParseOptionalExpression(ParseTree operand) {\n // The optional chain's source info should cover the lhs operand also\n SourcePosition start = operand.location.start;\n\n while (peek(TokenType.QUESTION_DOT)) {\n eat(TokenType.QUESTION_DOT);\n switch (peekType()) {\n case OPEN_PAREN:\n ArgumentListTree arguments = parseArguments();\n operand =\n new OptChainCallExpressionTree(\n getTreeLocation(start),\n operand,\n arguments,\n /* isStartOfOptionalChain = */ true,\n arguments.hasTrailingComma);\n break;\n case OPEN_SQUARE:\n eat(TokenType.OPEN_SQUARE);\n ParseTree member = parseExpression();\n eat(TokenType.CLOSE_SQUARE);\n operand =\n new OptionalMemberLookupExpressionTree(\n getTreeLocation(start), operand, member, /* isStartOfOptionalChain = */ true);\n break;\n case NO_SUBSTITUTION_TEMPLATE:\n case TEMPLATE_HEAD:\n reportError(\"template literal cannot be used within optional chaining\");\n break;\n default:\n if (peekIdOrKeyword()) {\n IdentifierToken id = eatIdOrKeywordAsId();\n operand =\n new OptionalMemberExpressionTree(\n getTreeLocation(start), operand, id, /* isStartOfOptionalChain = */ true);\n } else {\n reportError(\"syntax error: %s not allowed in optional chain\", peekType());\n }\n }\n operand = parseRemainingOptionalChainSegment(operand);\n }\n return operand;\n }", "@Test\n void findByIdNotFound() {\n // I return an Optional here because \"findById\" in OwnerSDJpaService return either the owner, either null\n when(ownerRepository.findById(anyLong())).thenReturn(Optional.empty());\n\n Owner owner = service.findById(1L);\n\n // I'm expecting to return null\n assertNull(owner);\n }", "public static <T> Optional<T> supplyForAny(Optional<?>[] optionals, Supplier<T> supplier) {\n final boolean isAnyExists = Arrays.asList(optionals).stream().filter(Optional::isPresent).findAny().isPresent();\n return isAnyExists ? Optional.ofNullable(supplier.get()) : Optional.<T>empty();\n }", "@Test(timeout = 4000)\n public void test083() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.addOptionalCondition(\"A*RX\", (StringBuilder) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "public static <T> T checkIfNull(T value) {\n if(value == null) {\n throw new NullPointerException(value +\"== null\");\n }\n return value;\n }", "public T getOrThrow() {\n if (hasResult) {\n return value;\n } else {\n throw new ReflectionException(exception);\n }\n }", "boolean optional();", "public static void main(String[] args) {\n\t\t\n\t\tOptional<List<String>> opt = Optional.of(List.of(\"one\",\"two\",\"three\"));\n\t\t\n\t\topt.stream().forEach(l -> l.stream().filter(s -> !s.contains(\"w\")).forEach(System.out::println));\n\t\t\n\t\tSystem.out.println(\"=====================================\");\n\t\t\n\t\t/*\n\t\t * IfPresentOrElse() : If a value is present, performs the given action with the value, otherwise performs the given empty-based action. \n\t\t */\n\t\t Optional.of(4).ifPresentOrElse( x -> System.out.println(\"Result found: \" + x), () -> System.out.println(\"Not Found.\")); // Result found: 4\n\t\t \n\t\t Optional.empty().ifPresentOrElse( x -> System.out.println(\"Result found: \" + x), () -> System.out.println(\"Not Found.\")); // Not found.\n\t\t \n\t\t System.out.println(\"=====================================\");\n\t\t \n\t\t /*\n\t\t * or() : if a value is present in the optional, returns an Optional describing the value, otherwise returns an Optional produced by the \n\t\t * supplier passed as parameter.\n\t\t */\n\t\t System.out.println(Optional.of(\"Rams\").or(() -> Optional.of(\"No Name\"))); // Optional[Rams]\n\n\t\t System.out.println(Optional.empty().or(() -> Optional.of(\"No Name\"))); // Optional[No Name]\n\t}", "protected boolean isOptional()\n {\n return false;\n }", "@Test\n public void testDeleteHandlesOtherExceptionsCorrectly() throws Exception {\n\n AmazonServiceException exception = new AmazonServiceException(\"Boom!\");\n exception.setErrorCode(\"SomeOtherArbitraryCode\");\n testDelete(true, Optional.of(exception), true);\n }", "@Test(expected = NoSuchElementException.class)\n public void testOtherwiseThrow() {\n AtomicBoolean success = new AtomicBoolean(false);\n match(42L).otherwiseThrow(NoSuchElementException::new);\n\n assertTrue(success.get());\n }", "Optional<String> validate(T value);", "@Test\n void shouldReturnEmptyOptionalIfUserNotFound() {\n //given\n String id = \"xyz-abc\";\n //Lambda matcher\n given(userRepo.findById(argLambda(e -> Objects.equals(id, \"xyz-abc\")))).willReturn(Optional.empty());\n //when\n Optional<User> optionalUser = userService.getUser(id);\n //then\n assertThat(optionalUser).isNotNull();\n assertThat(optionalUser.isPresent()).isFalse();\n //Argument Captor\n verify(userRepo).findById(assertArg(e -> assertThat(e).isEqualTo(id)));\n verify(userRepo, times(1)).findById(assertArg(e -> assertThat(e).isEqualTo(id)));\n }", "protected abstract Optional<T> getSingleSelection();", "Optional<User> get(String userName);", "public static <X> ResponseEntity<X> wrapOrNotFound(Optional<X> maybeResponse) {\n return maybeResponse.map(response -> ResponseEntity.ok().body(response))\n .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));\n }", "@Test\n public void testDeleteHandlesDoesNotExistExceptionCorrectly() throws Exception {\n\n AmazonServiceException exception = new AmazonServiceException(\"Boom!\");\n exception.setErrorCode(\"AttributeDoesNotExist\");\n testDelete(false, Optional.of(exception), true);\n }", "public static String getOptionalString(Document document, String name)\n throws RepositoryException {\n String result = null;\n try {\n result = getStringAndThrow(document, name);\n } catch (IllegalArgumentException e) {\n LOGGER.log(Level.WARNING, \"Swallowing exception while accessing \" + name,\n e);\n }\n return result;\n }", "public boolean isMaybePresentOrUnknown() {\n return isUnknown() || isMaybePresent();\n }", "java.lang.String getOptionalValue();", "default boolean isPresent() {\n return get() != null;\n }", "default boolean isPresent() {\n return get() != null;\n }", "private static Optional<Schema> isOfOptionType(Schema schema) {\n Preconditions.checkNotNull(schema);\n\n // If not of type UNION, cant be an OPTION\n if (!Schema.Type.UNION.equals(schema.getType())) {\n return Optional.<Schema>absent();\n }\n\n // If has more than two members, can't be an OPTION\n List<Schema> types = schema.getTypes();\n if (null != types && types.size() == 2) {\n Schema first = types.get(0);\n Schema second = types.get(1);\n\n // One member should be of type NULL and other of non NULL type\n if (Schema.Type.NULL.equals(first.getType()) && !Schema.Type.NULL.equals(second.getType())) {\n return Optional.of(second);\n } else if (!Schema.Type.NULL.equals(first.getType()) && Schema.Type.NULL.equals(second.getType())) {\n return Optional.of(first);\n }\n }\n\n return Optional.<Schema>absent();\n }", "private static void optinalOfNullableBasic() {\n String answer1 = \"Yes\";\n String answer2 = null;\n System.out.println(\"\" + Optional.ofNullable(answer1));\n \n // we cn pass null value in ofNullable method. In this case it will return empty optional\n // rather then Null Pointer Exception\n System.out.println(\"\" + Optional.ofNullable(answer2));\n }", "Optional<V> get(K key);", "private void throwIfNullValue(final V value) {\n if (value == null) {\n throw new IllegalArgumentException(\"null values are not supported\");\n }\n }", "@Test(timeout = 4000)\n public void test050() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.addOptionalCondition(\"%KPzc}nCj\\\"i,>gZj u\", (StringBuilder) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test\r\n public void findserUserIdNull() {\r\n\r\n assertThatThrownBy(() -> {\r\n this.usermanagement.findUserRole(null);\r\n }).isInstanceOf(Exception.class);\r\n }", "static <V> Value<V> of(Optional<V> value) {\n return new ImmutableValue<>(value.orElse(null));\n }", "void acceptOrThrow(T t, U u, V v) throws Throwable;", "public Optional<T> getValue() {\n return Optional.ofNullable(value);\n }", "Optional<T> show();", "default Optional<T> optional(@NonNull final String key) {\n return Optional.ofNullable(get(key));\n }", "private <T> T deepSwallowing(T throwing) {\n return null;\n }", "@NotNull\n default ProgrammingExercise findByIdElseThrow(Long programmingExerciseId) throws EntityNotFoundException {\n return findById(programmingExerciseId).orElseThrow(() -> new EntityNotFoundException(\"Programming Exercise\", programmingExerciseId));\n }", "private static void optionalWithGenericTypeAndLamdaExpressions() {\n Optional opUserAccountWithoutGeneric = Optional.of(new UserAccount());\n // in this case optional will return object which we need to cast\n opUserAccountWithoutGeneric.ifPresent((t) -> {System.out.println(\"\" + ((UserAccount) t).doSomething());});// using lamda's\n // In this case method reference will not work cause it can't understand which object's method it is\n // as no generic type defined\n /**opUserAccountWithoutGeneric.ifPresent(UserAccount::doSomething);**/// using method reference\n\n // TYPE 2: With Generic \n Optional<UserAccount> opUserAccount = Optional.of(new UserAccount());\n // in this case we don't need to cast\n opUserAccount.ifPresent((t) -> {System.out.println(\"\" + t.doSomething());});// using lamda's\n opUserAccount.ifPresent(UserAccount::doSomething);// using method reference\n }", "@Test(expected = NoSuchElementException.class)\n public void testOtherwiseThrow() {\n match(\"foo\").otherwiseThrow(NoSuchElementException::new);\n fail();\n }", "boolean supportsNotNullable();", "boolean hasException();", "public static void main(String[] args) {\n\t\t\n\t\tOptional<Double> inversedNum = inverse(10D);\n\t\tSystem.out.println(inversedNum.orElseThrow());\n\t\t\n\t\t\n\t\tDouble nullable = null;\n\t\t// Optional<Double> op = Optional.of(nullable); - Null pointer exception\n\n\t\t\n\t\t// The ofNullable method is intended as a bridge from possibly null values to optional values.\n\t\t// Optional.ofNullable(obj) returns Optional.of(obj) if obj is not null and Optional.empty otherwise.\n\t\tOptional<Double> op1 = Optional.ofNullable(nullable);\n\t\tif(op1.isEmpty()) {\n\t\t\tSystem.out.println(\"success\");\n\t\t}\n\t}", "@Override\n\tpublic Optional<T> get() {\n\t\treturn null;\n\t}", "@Named(\"unwrap\")\n default <T> T unwrap(Optional<T> optional) {\n return optional.orElse(null);\n }", "@Test\n public void extractRejectionReason_null_throwIllegalArgumentException() {\n assertThrows(IllegalArgumentException.class, () -> MessageUtils.extractRejectionReason(null));\n }", "@Test(timeout = 4000)\n public void test049() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.addRequiredCondition(\" AND \", (StringBuilder) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test(timeout = 4000)\n public void test049() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.addRequiredCondition(\"\", (StringBuilder) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "@Test(expected = CTPException.class)\n public void getCaseByUPRNNotFound() throws Exception {\n\n when(dataRepo.readNonHILatestCollectionCaseByUprn(Long.toString(UPRN.getValue()), true))\n .thenReturn(Optional.empty());\n\n caseSvc.getLatestValidNonHICaseByUPRN(UPRN);\n }", "boolean containsValue(Object value) throws NullPointerException;", "@Test\n public void testOr() {\n if (true || addValue()) {\n assertThat(flag, equalTo(0));\n }\n\n // first not satisfied, invoke second\n if (false || addValue()) {\n assertThat(flag, equalTo(1));\n }\n }", "public void checkException() {\n/* 642 */ checkException(voidPromise());\n/* */ }", "public static <T> void handle(Optional<T> optional, Runnable ifEmpty, Consumer<T> ifPresent) {\n if (optional.isPresent()) {\n ifPresent.accept(optional.get());\n } else {\n ifEmpty.run();\n }\n }", "@MethodContract(post = @Expression(\"result != null ? contains(result\"))\n public PropertyException getAnElement() {\n if (isEmpty()) {\n return null;\n }\n else {\n Iterator<Set<PropertyException>> iter1 = getElementExceptions().values().iterator();\n Set<PropertyException> s = iter1.next();\n Iterator<PropertyException> iter2 = s.iterator();\n return iter2.next();\n }\n }", "Optional<User> findUserByUsername(String username);", "boolean checkNull();", "@Override\n\tpublic <T extends Throwable> T throwing(T t) {\n\t\treturn null;\n\t}", "private static void checkForNullValue(String value) {\n if ( value == null ) {\n throw new NullPointerException();\n }\n }", "public Optional<Path> getOptionalPathProperty(String propertyName) {\n if(propertiesMap.containsKey(propertyName)) {\n Path path = Paths.get(propertiesMap.get(propertyName));\n if(Files.isReadable(path)) {\n return Optional.of(path);\n }\n }\n System.out.println(\"Property name \" + propertyName + \" is invalid\");\n return Optional.empty();\n }", "@Test(expected = UserNotExists.class)\n public void getUserInformationThatDoesNotExistsTest() throws Exception {\n\n given(userRepository.findById(anyLong())).willReturn(Optional.empty());\n User user_retrived = userServiceImpl.getUserInformation(1L);\n\n }", "public Optional<String> safeGet(String key) {\n\t\tInstant start = Instant.now();\n\t\tOptional<String> result;\n\t\ttry {\n\t\t\tresult = Optional.of(get(key));\n\t\t} catch (ConfigException e) {\n\t\t\tLOGGER.warn(\"No value was found for key {}: an Optional.empty() will be returned\", key);\n\t\t\tresult = Optional.empty();\n\t\t}\n\t\tLOGGER.debug(\"Access to config {} to safeGet {} took {}\", uniqueInstance.instanceUUID, key, Duration.between(start, Instant.now()));\n\t\treturn result;\n\t}", "@Test\n public void testDeleteThrowsIfTheSimpledbConditionalCheckFailsThreeTimesRunning()\n throws Exception {\n\n testDelete(true, Optional.of(new Exception(\"Database put failed - conditional check failed\")),\n true, 3);\n }", "@Test\n\tpublic void testAuthenticateUserNullUser() {\n\t\t\n\t\tThrowable thrown = catchThrowable(() -> { authService.authenticateUser(null); } );\n\t\tassertThat(thrown).isNotNull().isInstanceOf(IllegalArgumentException.class).hasMessageContaining(\"Missing login and/or password\");\n\t}", "private boolean hasValue (String s) { return s != null && s.length() != 0; }", "@Test(expected = CopilotServiceInitializationException.class)\n public void testCheckNullForInjectedValueFailure() {\n Helper.checkNullForInjectedValue(null, \"obj\");\n }", "private ChannelFuture checkException(ChannelPromise promise) {\n/* 624 */ Throwable t = this.lastException;\n/* 625 */ if (t != null) {\n/* 626 */ this.lastException = null;\n/* */ \n/* 628 */ if (promise.isVoid()) {\n/* 629 */ PlatformDependent.throwException(t);\n/* */ }\n/* */ \n/* 632 */ return (ChannelFuture)promise.setFailure(t);\n/* */ } \n/* */ \n/* 635 */ return (ChannelFuture)promise.setSuccess();\n/* */ }" ]
[ "0.6282123", "0.6215173", "0.597664", "0.5742543", "0.57261163", "0.56666464", "0.55910754", "0.55124694", "0.54168797", "0.5409789", "0.53800565", "0.5367533", "0.53093845", "0.5267414", "0.5246247", "0.517388", "0.51589364", "0.51506287", "0.51464725", "0.51419896", "0.5128428", "0.5085718", "0.50412995", "0.5019435", "0.50062114", "0.4923572", "0.49059132", "0.48929662", "0.48757702", "0.48705092", "0.4860187", "0.48551574", "0.48484948", "0.48153943", "0.48104882", "0.48099938", "0.48061192", "0.4787142", "0.47830346", "0.47667956", "0.47606617", "0.47443175", "0.4727522", "0.4721627", "0.4711746", "0.47084385", "0.4699859", "0.46914768", "0.4670787", "0.46675062", "0.46641245", "0.46630627", "0.46492404", "0.46376953", "0.46257728", "0.46166122", "0.46076322", "0.45993075", "0.4592668", "0.4592668", "0.45829853", "0.457796", "0.45731387", "0.45666754", "0.45492777", "0.45479277", "0.45270386", "0.4509587", "0.45016548", "0.45014513", "0.44851777", "0.4482328", "0.44680423", "0.4467021", "0.44656458", "0.44646662", "0.44571796", "0.4432004", "0.4430582", "0.44296", "0.44242433", "0.44040224", "0.4400152", "0.43957675", "0.4387166", "0.43820423", "0.43799245", "0.43636185", "0.43621293", "0.43590677", "0.4348201", "0.43429062", "0.43341184", "0.43279728", "0.43272483", "0.4327067", "0.43268764", "0.4322479", "0.4322003", "0.43216223", "0.43107957" ]
0.0
-1
/ Method saves the topic instance to the database
public void addTopic(Topic topic) { topicRepository.save(topic); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void saveTopic(String categoryId, String forumId, Topic topic,\n\t\t\tboolean isNew, boolean isMove, MessageBuilder messageBuilder)\n\t\t\tthrows Exception {\n\n\t}", "int insert(UserTopic record);", "int insert(UserTopic record);", "@Override\n\tpublic void saveTopicType(TopicType topicType) throws Exception {\n\n\t}", "@Override\r\n\t@Transactional\r\n\tpublic Serializable save(TopicContent entity) {\n\t\treturn topicContentDao.save(entity);\r\n\t}", "@Override\n\tpublic void savePost(String categoryId, String forumId, String topicId,\n\t\t\tPost post, boolean isNew, MessageBuilder messageBuilder)\n\t\t\tthrows Exception {\n\n\t}", "public void saveForum(Forum forum);", "public void addTopic(Topic topic) {\n\t\tString sql = \"insert into \"\n\t\t\t\t+ Constant.schema\n\t\t\t\t+ \".topic (topic_name, start_time, end_time, speaker_name, speaker_des, attachment, speaker_img, rating) values (?,?,?,?,?,?,?,?)\";\n\t\tList<String> paramList = new ArrayList<String>();\n\t\tparamList.add(topic.getTopicName());\n\t\tparamList.add(topic.getStartTime());\n\t\tparamList.add(topic.getEndTime());\n\t\tparamList.add(topic.getSpeakerName());\n\t\tparamList.add(topic.getSpeakerDesc());\n\t\tparamList.add(topic.getAttachment());\n\t\tparamList.add(topic.getSpeakerimg());\n\t\tparamList.add(String.valueOf(0));\n\n\t\tConnection conn = null;\n\t\tPreparedStatement pstmt = null;\n\t\ttry {\n\t\t\tconn = DBConUtil.getConn();\n\t\t\tpstmt = conn.prepareStatement(sql);\n\t\t\tconn.setAutoCommit(true);\n\t\t\tDBConUtil.executeUpdate(paramList, conn, pstmt);\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t} finally {\n\t\t\t// close connections.\n\t\t\tDBConUtil.close(conn, pstmt);\n\t\t}\n\t}", "@Override\r\n\t@Transactional\r\n\tpublic void saveOrUpdate(TopicContent entity) {\n\t\ttopicContentDao.saveOrUpdate(entity);\r\n\t}", "@Override\r\n\tpublic int addTopic(String name) throws SQLException {\n\t\tString sql = \"insert into topic(tname) values(?) \";\r\n\t\t\r\n\t\tint excuteUpdate = excuteUpdate(sql, name);\r\n\t\t\r\n\t\treturn excuteUpdate;\r\n\t\t\r\n\t\t\r\n\t}", "void savePost(Post post);", "@Override\r\n\tpublic void save() {\n\r\n\t\ts.save();\r\n\r\n\t}", "public void createNewTopic() {\n try {\n forumService.createNewTopic(\n newTopicName.trim(),\n TopicCategory.OTHER,\n currentUser,\n cloudOfTopic);\n } catch (Exception e) {\n logger.error(ExceptionUtils.getStackTrace(e));\n }\n newTopicName = \"\";\n refreshForumState();\n }", "int insert(TopicFragmentWithBLOBs record);", "Post save(Post post) throws Exception;", "@Override\r\n\tpublic int updateTopic(Topic topic) throws SQLException {\n\t\treturn 0;\r\n\t}", "int insertSelective(UserTopic record);", "int insertSelective(UserTopic record);", "public void save(Connection con) throws TorqueException\n {\n if (!alreadyInSave)\n {\n alreadyInSave = true;\n\n\n \n // If this object has been modified, then save it to the database.\n if (isModified())\n {\n if (isNew())\n {\n NewsletterPeer.doInsert((Newsletter) this, con);\n setNew(false);\n }\n else\n {\n NewsletterPeer.doUpdate((Newsletter) this, con);\n }\n }\n\n alreadyInSave = false;\n }\n }", "VoteTopic createVoteTopic(VoteTopic topic, String userId);", "@RequestMapping(method=RequestMethod.POST, value = \"/topics\")\r\n\t\r\n\t// '@RequestBody' will convert content of the incoming \r\n\t// Request (POST) body to your parameter object on the fly \r\n\t// 'POST'/request should contain the object itself that's being sent \r\n\t// After object is sent, it is passed as an instance of class 'Topic'\r\n\tpublic void addTopic(@RequestBody Topic topic) {\r\n\t\ttopicService.addTopic(topic);\r\n\t\t\r\n\t}", "void save(Teacher teacher);", "@Override\n\tpublic int topicAdd(QuestionBean q) {\n\t\tString sql = \"insert into topic(title,result,subjectName,difficulty,type,score) values('\"+q.getTitle()+\"','\"+q.getResult()+\"',\"+q.getSubjectName()+\",'\"+q.getDifficulty()+\"',\"+q.getType()+\",\"+q.getScore()+\")\";\n\t\t//int result = jt.update(sql, q.getTitle(),q.getResult(),q.getSubjectName(),q.getDifficulty(),q.getType(),q.getScore());\n\t\tKeyHolder keyHolder = new GeneratedKeyHolder();\n\t\tjt.update(new PreparedStatementCreator() {\n\t\t\t@Override\n\t\t\tpublic java.sql.PreparedStatement createPreparedStatement(java.sql.Connection arg0) throws SQLException {\n\t\t\t\tPreparedStatement ps = arg0.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);\n\t\t\t\treturn ps;\n\t\t\t}\n\t\t}, keyHolder);\n\t\tSystem.out.println(\"新增加的primarykey:\"+keyHolder.getKey().intValue());\n\t\treturn keyHolder.getKey().intValue();\n\t}", "int updateByPrimaryKey(UserTopic record);", "int updateByPrimaryKey(UserTopic record);", "public void storeDiscussion(Discussion d) throws DAOException;", "public void createTopic(String topic) {\n\n\t}", "public void save() {\r\n\t\tCampLeaseDAO leaseDao = (CampLeaseDAO) getApplicationContext().getBean(\"leaseDaoBean\", CampLeaseDAO.class);\r\n\t\tleaseDao.save(this);\r\n\t}", "public void save(Object instance);", "public void save() {\n if (category != null) {\n category.save();\n }\n }", "int updateByPrimaryKey(TopicFragment record);", "private void saveData(){\n databaseReference.setValue(new Teacher(0, \"\", 0.0));\n }", "Post save(Post post, Long authorId, String category);", "public void save();", "public void save();", "public void save();", "public void save();", "int insert(QuestionOne record);", "public void addPostingToActiveTopic() {\n if (activeTopic == null || postingText.trim().isEmpty()) {\n return;\n }\n\n Date creationDate = new Date();\n\n try {\n forumService.addPostingToTopic(\n activeTopic,\n vFilter.filter(postingText),\n currentUser, creationDate);\n } catch (Exception e) {\n logger.error(ExceptionUtils.getStackTrace(e));\n }\n postingText = \"\";\n }", "public Article save(Article article);", "@Override\n\tpublic void save(String username, String profilelocation, long tweetId, String post) {\n\t\t Document document = new Document();\n \tdocument.put(\"TweetId\", tweetId);\n\t\t\tdocument.put(\"Username\", username);\n\t\t\tdocument.put(\"ProfileLocation\", profilelocation);\n\t\t\tdocument.put(\"Content\", post);\n\t\tcollection.insertOne(document);\n\t\t\n\t}", "int insert(PmPost record);", "public abstract void updateTopic(String topic);", "@Override\n\tpublic void saveForum(String categoryId, Forum forum, boolean isNew)\n\t\t\tthrows Exception {\n\n\t}", "public void save(PtJJdwcy entity);", "public void storeBlog() {\r\n // notify user\r\n activityScreen.setString(Locale.get(\"blogManager.alert.storing\"));\r\n controller.show(activityScreen);\r\n // schedule process\r\n this.storageTerminationNotifier.schedule(new BlogStoreTerminator(), STORAGE_TIMEOUT);\r\n // start process\r\n this.prepareBlog();\r\n this.serializeBlog();\r\n }", "public void saveToDB() {\n \twipeDB();\n\t\tSQLiteDatabase db = nodeData.getReadableDatabase();\n\t\tContentValues values = new ContentValues();\n\t\tfor (int i = 0; i < wallpapers.size(); i++) {\n\t\t\tvalues.put(EventDataSQLHelper.NODE, nodeToString(wallpapers.get(i)));\n\t\t\ttry {\t\t\t\t\n\t\t\t\tdb.insertOrThrow(EventDataSQLHelper.TABLE, null, values);\n\t\t\t\tLog.d(\"AddToDB\", nodeToString(wallpapers.get(i)));\n\t\t\t} catch (SQLException e) {\n\t\t\t\tLog.d(\"AddToDB\", \"\" + e.getMessage());\n\t\t\t}\n\t\t}\n\t\tdb.close();\n }", "int insert(WstatTeachingClasshourTeacher record);", "@Override\n\t\t\t\tpublic void addTopic(String topic) {\n\t\t\t\t\t\tsendData(\"<new><name>\" + topic +\"</name></new>\");\n\t\t\t\t}", "public interface TopicDao {\r\n public boolean create(Topic topic);\r\n}", "@Override\r\n\t\t\t\t\tpublic void messageArrived(String topic, MqttMessage message) throws Exception {\n\t\t\t\t\t\t try { \r\n//\t\t\t\t\t\t\t SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\"); \r\n//\t\t\t\t\t\t\t String date = sdf.format(new Date());\r\n\t\t\t\t\t System.out.println(\" From:\"+message.toString()); \r\n\t\t\t\t\t \r\n\t\t\t\t\t Connection conn = null;\r\n\t\t\t\t\t Class.forName(\"com.mysql.jdbc.Driver\"); \r\n\t\t\t\t\t conn = DriverManager.getConnection(\r\n\t\t\t\t\t \t\t\"jdbc:mysql://localhost:3306/mqtt?useUnicode=true&characterEncoding=UTF-8\",\r\n\t\t\t\t\t \t\t\"root\",\r\n\t\t\t\t\t \t\t\"tmu2012\");\r\n\t\t\t\t\t System.out.println(\"connected to the database\");\r\n\r\n\t\t\t\t\t Statement stmt = conn.createStatement();\r\n\t\t\t\t\t System.out.println(\"Inserting records\");\r\n\t\t\t\t\t \r\n\t\t\t\t\t String qry1 = \"INSERT INTO mymqtts (mqtt) VALUES('\"+message.toString()+\"')\";\r\n\t\t\t\t\t stmt.executeUpdate(qry1);\r\n\t\t\t\t\t System.out.println(\"ok\");\r\n\t\t\t\t\t\t }catch (Exception e) { \r\n\t\t\t\t\t e.printStackTrace(); \r\n\t\t\t\t\t System.out.println(\"error\"); \r\n\t\t\t\t\t } \r\n\t\t\t\t\t}", "void setTopic(String topic);", "public void saveTicket(Ticket ticket) throws DavException;", "int insert(WechatDemo record);", "@Override\n\tpublic Tutorial insert(Tutorial t) {\n\t\treturn cotizadorRepository.save(t);\n\n\t\t\n\t}", "@Override\n\tpublic void saveForumSubscription(ForumSubscription forumSubscription,\n\t\t\tString userId) throws Exception {\n\n\t}", "public void savePost(VBeatPostModel post) {\n AppLocalDB.getInstance().db.postDao().insertAll(post);\n }", "private void saveToDb(long subcategoryId) {\n\n for (NewsClass item : newsList)\n item.save();\n\n }", "@Override\n public void persist() {\n }", "@Override\r\n\tpublic void save(WechatMember member) {\n\t\t\r\n\t}", "public void addExamTopic(int id, int eId, int tId){\r\n SQLiteDatabase db = this.getWritableDatabase();\r\n\r\n ContentValues values = new ContentValues();\r\n values.put(KEY_ID, id);\r\n values.put(KEY_EID, eId);\r\n values.put(KEY_TID, tId);\r\n\r\n db.insert(TABLE_EXAMS_TOPICS, null, values);\r\n\r\n db.close();\r\n }", "int insertSelective(TopicFragmentWithBLOBs record);", "int insert(News record);", "int insert(JmfTaskMqRef record);", "@Test\n\tpublic void saveTest() {\n//\t\tlog.trace(\"Testing Save Note\");\n\n\t\t// find batch and trainee to associate with note\n\t\tfinal Batch batch = batchDao.findOne(TEST_QCBATCH_ID);\n\t\tfinal Trainee trainee = traineeDao.findAll().get(0);\n\n\t\t// create a new note\n\t\tNote note = new Note();\n\t\tnote.setNoteId(1);\n\t\tnote.setContent(\"Note Test\");\n\t\tnote.setBatch(batch);\n\t\tnote.setQcFeedback(false);\n\t\tnote.setWeek((short) 1);\n\t\tnote.setTrainee(trainee);\n\t\tnote.setQcStatus(null);\n\t\tnote.setMaxVisibility(null);\n\t\tnote.setType(NoteType.TRAINEE);\n\n\t\t// save note\n\t\tnoteDao.save(note);\n\t}", "void to(String topic);", "private static void writeToMysql(Publication publication) {\n\tSystem.out.println(publication); \n //1.加载driver驱动 \n try { \n // 加载MySql的驱动类 \n Class.forName(\"com.mysql.jdbc.Driver\"); \n } catch (ClassNotFoundException e) { \n System.out.println(\"找不到驱动程序类 ,加载驱动失败!\"); \n e.printStackTrace(); \n } \n //2.建立连接 \n Statement st = null; \n //调用DriverManager对象的getConnection()方法,获得一个Connection对象 \n Connection con =null; \n try { \n \t String sqlStr = \"jdbc:mysql://localhost:3306/huo\"; \n \t String rootName = \"root\";//数据库名 \n \t String rootPwd = \"1234\";//数据库密码 \n\t\t//建立数据库连接 \n con = DriverManager.getConnection(sqlStr, rootName,rootPwd); \n //INSERT INTO table_name (列1, 列2,...) VALUES (值1, 值2,....) \n String paperId= publication.getId(); \n String authors = publication.getAuthors(); \n //插入语句格式 \n String sql = \"insert into publication1(paperId,Authors) values(\\\"\"+paperId+\"\\\",\\\"\"+authors+\"\\\")\"; \n System.out.println(sql); \n st = con.createStatement(); //创建一个Statement对象 \n st.executeUpdate(sql);//提交数据更新 \n } catch (SQLException e) { \n e.printStackTrace(); \n }finally{ \n try { \n st.close(); \n con.close(); \n } catch (SQLException e) { \n e.printStackTrace(); \n } \n } \n\t\n}", "@Override\r\n\tpublic void persist() {\n\t}", "static long insert(SQLiteDatabase db, Topic topic, StoredMessage msg) {\n if (msg.id > 0) {\n return msg.id;\n }\n\n db.beginTransaction();\n try {\n if (msg.topicId <= 0) {\n msg.topicId = TopicDb.getId(db, msg.topic);\n }\n if (msg.userId <= 0) {\n msg.userId = UserDb.getId(db, msg.from);\n }\n\n if (msg.userId <= 0 || msg.topicId <= 0) {\n Log.d(TAG, \"Failed to insert message \" + msg.seq);\n return -1;\n }\n\n int status;\n if (msg.seq == 0) {\n msg.seq = TopicDb.getNextUnsentSeq(db, topic);\n status = msg.status == BaseDb.STATUS_UNDEFINED ? BaseDb.STATUS_QUEUED : msg.status;\n } else {\n status = BaseDb.STATUS_SYNCED;\n }\n\n // Convert message to a map of values\n ContentValues values = new ContentValues();\n values.put(COLUMN_NAME_TOPIC_ID, msg.topicId);\n values.put(COLUMN_NAME_USER_ID, msg.userId);\n values.put(COLUMN_NAME_STATUS, status);\n values.put(COLUMN_NAME_SENDER, msg.from);\n values.put(COLUMN_NAME_TS, msg.ts.getTime());\n values.put(COLUMN_NAME_SEQ, msg.seq);\n values.put(COLUMN_NAME_CONTENT, BaseDb.serialize(msg.content));\n\n msg.id = db.insertOrThrow(TABLE_NAME, null, values);\n db.setTransactionSuccessful();\n } catch (Exception ex) {\n Log.e(TAG, \"Insert failed\", ex);\n } finally {\n db.endTransaction();\n }\n\n return msg.id;\n }", "public void save() {\t\n\t\n\t\n\t}", "int insert(CmsVoteTitle record);", "int insert(Teacher record);", "public boolean save();", "int insert(AnnouncementDO record);", "public void save() {\n }", "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}", "@Override\n\tpublic void save() {\n\t\t\n\t}", "@Override\n\tpublic void save() {\n\t\t\n\t}", "public static void save() {\n if (instance != null) {\n // -> SyncedDatabases.syncAll();\n instance.markDirty();\n }\n }", "int insert(NewsInfo record);", "@Override\r\n public Kiosque insertKiosque(Kiosque obj) {\r\n em.persist(obj);\r\n return obj;\r\n //To change body of generated methods, choose Tools | Templates.\r\n }", "public Post save(Post t) {\n\t\tSession session;\n\t\ttry {\n\t\t\tsession = sessfact.getCurrentSession();\n\t\t} catch (HibernateException e) {\n\t\t\tsession = sessfact.openSession();\n\t\t}\n\t\tTransaction trans = session.beginTransaction();\n\t\tsession.save(t);\n\t\ttrans.commit();\n\t\treturn t;\n\t}", "@Override\n\tpublic void saveAnnounce(Announcement a) {\n\t\t\n\t}", "boolean saveTerm(Term tt) {\n\t\tsession.beginTransaction();\n\t\tboolean b = checkTerm(session, tt);\n\t\tif (b == false) {\n\t\t\tInteger lastUpdatedId = (Integer) session.save(tt);\n\t\t\tTermService ts = new TermService();\n\t\t\tts.setLastUpdatedId(lastUpdatedId);\n\t\t\tsession.getTransaction().commit();\n\t\t\tsession.close();\n\t\t}\n\t\tSystem.out.println(\"the term is saved succesfully:\" + b);\n\t\treturn b;\n\t}", "public void save() {\n MainActivity.db.updateWord(this);\n }", "@Override\n public int save( Mention obj ) {\n return 0;\n }", "int insert(Discuss record);", "public void saveAuthor(Author authorObject);", "@Override\n\tpublic void saveEntry(T t) {\n\t\tthis.hibernateTemplate.save(t);\n\t}", "@Override\r\n\tpublic void onMessage(ConsumerRecord<String, String> record) {\n\t\t\r\n\t\tString key = record.key();\r\n\t\tString value = record.value();\r\n\t\tif(key!=null && key.equals(\"addarticle\")) {\r\n\t\t\tArticle article = JSONObject.parseObject(value,Article.class);\r\n\t\t\t//新增到数据库\r\n\t\t\tarticleService.save(article);\r\n\t\t}\t\r\n\t}", "@Override\r\n\tpublic void save(TQssql sql) {\n\r\n\t}", "public void saveAnswer(Answer answer) throws Exception {\n DataBaseBroker dbb = new DataBaseBroker();\n dbb.loadDriver();\n dbb.establishConnection();\n dbb.saveAnswer(answer);\n dbb.commit();\n dbb.closeConnection();\n }", "public static void saveRecord(Instance ins) throws SQLException {\n String myDriver = \"com.mysql.jdbc.Driver\";\n String myUrl = \"jdbc:mysql://localhost/SSO\";\n Connection conn = null;\n\n try {\n Class.forName(myDriver);\n conn = DriverManager.getConnection(myUrl, \"root\", \"1235s2gip-\");\n\n // the mysql insert statement\n String query = \" insert into Driller (survey, creationDate, consecutive, section, location, answer, questionOrder,question, question_type, question_allowedValues)\"\n + \" values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\";\n\n // create the mysql insert preparedstatement\n PreparedStatement preparedStmt = conn.prepareStatement(query);\n preparedStmt.setString(1, ins.getSurvey());\n preparedStmt.setDate(2, new java.sql.Date(ins.getCreationDate().getTime()));\n preparedStmt.setInt(3, ins.getConsecutive());\n preparedStmt.setString(4, ins.getSection());\n preparedStmt.setString(5, ins.getLocation());\n preparedStmt.setString(6, ins.getAnswer());\n preparedStmt.setString(7, ins.getQuestionOrder());\n preparedStmt.setString(8, ins.getQuestion());\n preparedStmt.setString(9, ins.getQuestion_type());\n preparedStmt.setString(10, ins.getQuestion_allowedValues());\n\n // execute the preparedstatement\n preparedStmt.execute();\n } catch (Exception e) {\n System.err.println(\"Got an exception!\");\n System.err.println(e.getMessage());\n e.printStackTrace();\n }\n finally {\n if(conn != null){\n conn.close();\n }\n }\n }", "public void saveOneWord(Pojo.OneWord e){ \n template.save(e); \n}", "public void putTopic(Topic topic) {\n\t\ttopics.add(topic) ;\n\t}", "int insert(BlogDetails record);", "int insert(Question record);", "int insert(Question record);", "int insert(Question record);", "int insert(Question record);" ]
[ "0.7102271", "0.6824671", "0.6824671", "0.6626413", "0.65123457", "0.6419849", "0.63937205", "0.63863367", "0.6209771", "0.61045295", "0.61016506", "0.60936433", "0.6062764", "0.6049376", "0.59957117", "0.5990639", "0.5982388", "0.5982388", "0.59737533", "0.5964732", "0.58946615", "0.5893517", "0.58724076", "0.58578223", "0.58578223", "0.5842522", "0.58195084", "0.5764148", "0.5734902", "0.5717318", "0.57170355", "0.57068783", "0.5689381", "0.56701165", "0.56701165", "0.56701165", "0.56701165", "0.5646805", "0.56356454", "0.562366", "0.5618135", "0.56027186", "0.55982286", "0.55871755", "0.5564958", "0.55399597", "0.55328625", "0.5529422", "0.55186594", "0.5516578", "0.5504533", "0.55039614", "0.5497782", "0.54963654", "0.5477291", "0.547702", "0.5470663", "0.5468483", "0.5467609", "0.5465893", "0.5458238", "0.545359", "0.54434866", "0.5443311", "0.5440277", "0.5434546", "0.54180104", "0.54159254", "0.540869", "0.5402617", "0.5402246", "0.54021454", "0.53926957", "0.53923386", "0.53909135", "0.5390297", "0.53773946", "0.53773946", "0.53631747", "0.5360565", "0.5359235", "0.53577", "0.5355504", "0.5354717", "0.5340788", "0.53393215", "0.53356457", "0.5329646", "0.5329367", "0.53264517", "0.5325802", "0.53222626", "0.53134775", "0.53108925", "0.5310286", "0.53065", "0.5305351", "0.5305351", "0.5305351", "0.5305351" ]
0.61284316
9
/ Same method save() checks the primary key existence, and creates or updates accordingly
public void updateTopic(Topic topic, String id) { if (Objects.nonNull(getTopic(id))) topicRepository.save(topic); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void testSave() throws SQLException\n\t{\n\t\tint id = assign_hand.saveOrUpdate(\"Super Ultra Hard Assignment\",true);\n\t\tassertTrue(id != -1);\n\t}", "@Override\n public void save(HorseRace horseRace) throws PersistentException {\n HorseRaceDao dao = factory.createDao(HorseRaceDao.class);\n if (horseRace.getId() != null) {\n dao.update(horseRace);\n } else {\n horseRace.setId(dao.create(horseRace));\n }\n }", "public boolean save() {\n\t\tboolean isCreate = false;\n\t\tif(!validate() || !beforeSave(isCreate)){\n\t\t\treturn false;\n\t\t}\n\t\ttry {\n\t\t\tupdate();\n\t\t} catch (SQLException e) {\n\t\t\tnew Event(Event.getLeafLevelClassName(this), \"save\",\n\t\t\t\t\t\"SQL error while saving: \" + e.toString(), Event.ERROR);\n\t\t\treturn false;\n\t\t}\n\t\tthis.setPersisted(true);\n\t\tafterSave(isCreate);\n\t\treturn true;\n\t}", "protected void saveRecord() throws DAOException {\r\n\t\t// Prepara para actualizar\r\n\t\tobject.prepareToUpdate();\r\n\t\t// Guarda objecto\r\n\t\tobjectDao.save(object);\r\n\t\t// Guarda registros de relaciones\r\n\t\tfor (Sedrelco relco : object.getRelcos()) {\r\n\t\t\t// Asigna Id padre\r\n\t\t\trelco.getId().setDconsecnk(object.getDconsecnk());\r\n\t\t\tsedrelcoDao.save(relco);\r\n\t\t}\r\n\t}", "public boolean save() {\n executeCallbacks(CallbackType.BEFORE_SAVE);\n if (readOnly) throw new ReadOnlyException(getClass().getName() + \" is read only\");\n createOrUpdate();\n executeCallbacks(CallbackType.AFTER_SAVE);\n return true;\n }", "@PrePersist\n private void onSave()\n {\n this.lastUpdateDateTime = new Date();\n if(this.registerDateTime == null)\n {\n this.registerDateTime = new Date();\n }\n \n if(this.personKey == null || this.personKey.isEmpty())\n {\n this.personKey = UUID.randomUUID().toString();\n }\n \n if(this.activationDate == null && (this.activationKey == null || this.activationKey.isEmpty()))\n {\n this.activationKey = UUID.randomUUID().toString();\n this.activationDate = new Date();\n }\n \n // O ID só será 0 (zero) se for a criação do registro no banco\n if(this.id == 0)\n {\n this.isValid = false;\n }\n }", "@Override\n\tpublic void saveOrUpdateRecord(Record record) {\n\t\t Session session=HibernateSessionFactory.getSession();\n\t\t\tTransaction tx=session.beginTransaction();\t\t\n\t\t\tRecordDAO recordDAO=new RecordDAO();\n\t\t\t\n\t\t\ttry{\n\t\t\t\trecordDAO.attachDirty(record);\n\t\t\t\ttx.commit();\n\t\t\t}catch(RuntimeException e){\n\t\t\t\te.printStackTrace();\n\t\t\t\ttx.rollback();\n\t\t\t}finally{\n\t\t\t\tsession.close();\n\t\t\t}\n\t\t}", "PrimaryKey createPrimaryKey();", "@Override\n public void save() {\n String query = null;\n super.save();\n ((DataUser) user).save();\n\n if (getId() == 0) {\n String[] values = {super.getId() + \"\", \"\" + getUser().getId()};\n\n query = Database.compose(\n \"INSERT INTO case_workers (person_id, user_id)\",\n \"VALUES('\" + String.join(\"','\", values) + \"')\",\n \"RETURNING id\"\n );\n } else {\n query = Database.compose(\n \"UPDATE case_workers SET\",\n \"person_id = \" + super.getId() + \",\",\n \"user_id = \" + getUser().getId() + \"\",\n \"WHERE id = \" + getId()\n );\n\n }\n\n Database.getInstance().query(query, rs -> {\n if (id == 0) {\n id = rs.getInt(1);\n }\n });\n }", "private void addOrUpdateAssessment() {\n if (thisAssessmentId < 0) {\n addNewAssessment();\n } else {\n updateAssessment();\n }\n }", "public boolean put() {\n return db.insert (TABLE, createColumns(), createValues());\n }", "boolean hasInsertOrUpdate();", "int updateByPrimaryKey(Prueba record);", "public final Long save() {\n\t\tid = Ollie.save(this);\n\t\tOllie.putEntity(this);\n\t\tnotifyChange();\n\t\treturn id;\n\t}", "public int save(SaveQuery saveQuery, EntityDetails entityDetails, ObjectWrapper<Object> idGenerated);", "public void SaveVsPersist() {\n\t\tSession session = HibernateUtil.getSession();\n\t\tTransaction tx = null;\n\t\t\n\t\ttry{\n\t\t\ttx = session.beginTransaction();\n//\t\t\tItem item = new Item(\"Premium Water\", 900);\n//\t\t\titem.setShops(((Item)session.get(Item.class, 1)).getShops());\n//\t\t\t\n//\t\t\t\n//\t\t\tSystem.out.println( \"BEFORE SAVE: \" + item.getId());\n//\t\t\tSystem.out.println(\"-----SAVE-----\");\n//\t\t\tSystem.out.println(\"ID IS:\" + session.save(item));\n//\t\t\t//When saving we are returned the id.\n//\t\t\tSystem.out.println(\"AFTER SAVE:\" + item.getId());\n\t\t\t\n\n\t\t\t\n\t\t\tItem item2 = new Item(\"Deluxe Premium Super Awesome Bargain Water\", 12);\n\t\t\tSystem.out.println(\"-----persist-----\");\n\t\t\tSystem.out.println( \"BEFORE Persist: \" + item2.getId());\n\t\t\tsession.persist(item2);\n\t\t\tSystem.out.println(\"AFTER PERSIST:\" + item2.getId());\n\n\t\t\t//We are not guaranteed an ID right away, so we have to return nothing.\n\t\t\t\n\t\t\ttx.commit();\n\t\t\t\n\t\t}catch(HibernateException e){\n\t\t\tif(tx!=null){\n\t\t\t\ttx.rollback();\n\t\t\t}\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\tsession.close(); \n\t\t}\n\t}", "@Override\r\n\tpublic int save() throws NotesApiException {\n\t\treturn 0;\r\n\t}", "int updateByPrimaryKey(Dormitory record);", "Product save(Product product);", "EmployeeDetail save(EmployeeDetail detail) throws DBException;", "int updateByPrimaryKey(ProEmployee record);", "int updateByPrimaryKey(Salaries record);", "public Resourcesvalue save(Resourcesvalue record){\n \tif(record==null)\n \t\treturn null;\n\t\tif(record.getRescvalueid()==null||record.getRescvalueid().intValue()==0){\n\t\t\tLong pkValue = this.insert(record);\n\t\t\trecord.setRescvalueid(pkValue);\n \t\treturn record;\n\t\t}else{\n\t\t\tthis.updateByPK(record);\n\t\t\treturn record;\n\t\t}\n }", "int updateByPrimaryKey(Dress record);", "int updateByPrimaryKey(Disease record);", "int updateByPrimaryKey(AutoAssessDetail record);", "@Override\r\n\tpublic void save() {\n\r\n\t\ts.save();\r\n\r\n\t}", "int updateByPrimaryKey(PrhFree record);", "int updateByPrimaryKey(QuestionOne record);", "private void saveStudent() {\n // Check that every required field has been filled in with valid parameters\n if (!checkUserInputValidity()) {\n return;\n }\n\n // Insert the new student info into the database\n if (isEditStudent) {\n updateStudentOnFirebaseDatabase();\n } else {\n // Make a unique id for the student\n String studentId = UUID.randomUUID().toString();\n saveNewStudentToFirebaseDatabase(studentId);\n }\n }", "int updateByPrimaryKey(SysId record);", "@Override\n public CerereDePrietenie save(CerereDePrietenie entity) {\n\n String SQL = \"INSERT INTO cereredeprietenie(id, id_1,id_2,status,datac) VALUES(?,?,?,?,?)\";\n\n long id = 0;\n\n\n try (Connection conn = connect();\n PreparedStatement pstmt = conn.prepareStatement(SQL,\n Statement.RETURN_GENERATED_KEYS)) {\n\n\n pstmt.setInt(1, Math.toIntExact(entity.getId()));\n pstmt.setInt(2, Math.toIntExact(entity.getTrimite().getId()));\n pstmt.setInt(3, Math.toIntExact(entity.getPrimeste().getId()));\n pstmt.setString(4, entity.getStatus());\n pstmt.setObject(5, entity.getData());\n\n\n int affectedRows = pstmt.executeUpdate();\n // check the affected rows\n if (affectedRows > 0) {\n // get the ID back\n try (ResultSet rs = pstmt.getGeneratedKeys()) {\n if (rs.next()) {\n id = rs.getLong(1);\n }\n } catch (SQLException ex) {\n System.out.println(ex.getMessage());\n }\n }\n } catch (SQLException ex) {\n System.out.println(ex.getMessage());\n }\n\n\n return entity;\n\n }", "public boolean saveOrUpdate(Data model);", "int updateByPrimaryKey(SupplyNeed record);", "Patient save(Patient patient);", "int updateByPrimaryKey(Trueorfalse record);", "public Ware save(Ware record){\n \tif(record==null)\n \t\treturn null;\n\t\tif(record.getWareid()==null||record.getWareid().intValue()==0){\n\t\t\tLong pkValue = this.insert(record);\n\t\t\trecord.setWareid(pkValue);\n \t\treturn record;\n\t\t}else{\n\t\t\tthis.updateByPK(record);\n\t\t\treturn record;\n\t\t}\n }", "int updateByPrimaryKey(Commet record);", "int updateByPrimaryKey(Resource record);", "int updateByPrimaryKey(GirlInfo record);", "public void storeAndCommit() {\n \tsynchronized(mDB.lock()) {\n \t\ttry {\n \t \t\tstoreWithoutCommit();\n \t \t\tcheckedCommit(this);\n \t\t}\n \t\tcatch(RuntimeException e) {\n \t\t\tcheckedRollbackAndThrow(e);\n \t\t}\n \t}\n }", "int updateByPrimaryKey(Question record);", "int updateByPrimaryKey(Question record);", "int updateByPrimaryKey(Question record);", "int updateByPrimaryKey(Question record);", "int updateByPrimaryKey(Question record);", "int updateByPrimaryKey(Engine record);", "int updateByPrimaryKey(Forumpost record);", "int updateByPrimaryKey(Factory record);", "public void save() {\r\n\t\tCampLeaseDAO leaseDao = (CampLeaseDAO) getApplicationContext().getBean(\"leaseDaoBean\", CampLeaseDAO.class);\r\n\t\tleaseDao.save(this);\r\n\t}", "int updateByPrimaryKey(ResPartnerBankEntity record);", "public boolean save();", "int updateByPrimaryKey(Owner record);", "int updateByPrimaryKey(Model record);", "@Override\r\n\tpublic int updateByPrimaryKey(PayRecord record) {\n\t\treturn 0;\r\n\t}", "int updateByPrimaryKey(HomeWork record);", "@Override\n\tpublic boolean isPersistent() {\n\t\treturn id != -1;\n\t}", "Department createOrUpdate(Department department);", "int updateByPrimaryKey(Assist_table record);", "int updateByPrimaryKey(PracticeClass record);", "int updateByPrimaryKey(AccessModelEntity record);", "@Override\n public int save(T entity) {\n return mapper.insert(entity);\n }", "public void save() {\n //write lift information to datastore\n LiftDataAccess lda = new LiftDataAccess();\n ArrayList<Long>newKeys = new ArrayList<Long>();\n for (Lift l : lift) {\n newKeys.add(lda.insert(l));\n }\n\n //write resort information to datastore\n liftKeys = newKeys;\n dao.update(this);\n }", "@Test\r\n\tpublic void addToDb() {\r\n\t\tservice.save(opinion);\r\n\t\tassertNotEquals(opinion.getId(), 0);\r\n\t\tassertTrue(service.exists(opinion.getId()));\r\n\t}", "int updateByPrimaryKey(SPerms record);", "void saveOrUpdate(Product product);", "int updateByPrimaryKey(Storage record);", "int updateByPrimaryKey(Storage record);", "private void saveObject(Object object) {\n Connection connection = ConnectionPoll.getConnection();\n CRUDService crudService = new CRUDService(connection, object.getClass());\n try {\n Field[] fields = object.getClass().getDeclaredFields();\n Field id = null;\n for (Field f : fields) {\n if (f.isAnnotationPresent(Id.class)) {\n id = f;\n }\n }\n id.setAccessible(true);\n\n if (Integer.parseInt(id.get(object).toString()) != 0 && !id.get(object).equals(null)) {\n crudService.update((SimpleORMInterface) object);\n } else {\n crudService.insert((SimpleORMInterface) object);\n }\n id.setAccessible(false);\n ConnectionPoll.releaseConnection(connection);\n\n } catch (IllegalAccessException | NoSuchFieldException e) {\n e.printStackTrace();\n }\n }", "int updateByPrimaryKey(SpecialCircumstance record);", "int updateByPrimaryKey(TCar record);", "int updateByPrimaryKey(SysCode record);", "public boolean save(Carro carro){\n\t\t\n\t\ttry {\n\t\t\tdb.save(carro);\n\t\t\treturn true;\n\t\t\t\n\t\t} catch(SQLException ex) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}", "int updateByPrimaryKey(Book record);", "int updateByPrimaryKey(Book record);", "int updateByPrimaryKey(Clazz record);", "int updateByPrimaryKey(Employee record);", "public void saveOrUpdatePosPay(PosPay posPay) throws DataAccessException;", "protected boolean save() {\r\n\t\tboolean saved=true;\r\n\t\tif(validated()){\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tsaved=false;\r\n\t\t}\r\n\t\treturn saved;\r\n\t}", "int updateByPrimaryKey(TrainingCourse record);", "int updateByPrimaryKey(Basicinfo record);", "@Test\n public void testUpdate() {\n int resultInt = disciplineDao.insert(disciplineTest);\n \n boolean result = false;\n \n if(resultInt > 0){\n disciplineTest.setId(resultInt);\n \n disciplineTest.setName(\"matiere_test2\");\n \n result = disciplineDao.update(disciplineTest);\n \n disciplineDao.delete(disciplineTest);\n }\n \n assertTrue(result);\n }", "int updateByPrimaryKey(Dish record);", "Account save(Account account);", "public int saveCheck(Object obj) throws SQLException {\n\t\treturn dao.insertCheck(obj);\n\t}", "public void saveOrUpdate(Transaction transaction) throws Exception;", "@Override\n\tpublic long store() {\n\t\tlong existence = exists(this.nompId);\n\t\tif (existence != -1) {\n\t\t\treturn existence;\n\t\t}\n\t\t\n\t\t// build the content values for insert\n\t\tContentValues mContentValues = getBaseContentValues();\n\t\tmContentValues.put(NOMPDataContract.Need.COLUMN_NAME_BUDGET, budget);\n\n\t\t// insert\n\t\tSQLiteDatabase writable = this.getWritableDatabase();\n\t\t_id = writable.insert(NOMPDataContract.Need.TABLE_NAME, null,\n\t\t\t\tmContentValues);\n\n\t\twritable.close();\n\t\treturn _id;\n\t}", "@Override\r\n\tpublic void save() throws SaveException {\n\t\t\r\n\t}", "int updateByPrimaryKey(Yqbd record);", "public void save() throws InvalidIDException, SQLException {\r\n\t\t// Whether or not this is a new project being added to the database\r\n\t\tboolean newProject;\r\n\r\n\t\tif (super.id == 0) { newProject = true; }\r\n\t\telse { newProject = false; }\r\n\r\n\t\t// Call save in the Project class first. This will save general project data.\r\n\t\tsuper.save();\r\n\r\n\t\t// Get our connection to the database.\r\n\t\tConnection conn = DBConnectionManager.getPrConnection();\r\n\t\tStatement stmt = null;\r\n\t\tResultSet rs = null;\r\n\r\n\t\ttry {\r\n\t\t\tstmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);\r\n\r\n\t\t\t// Get our updatable result set\r\n\t\t\tString sqlStr = \"SELECT * FROM tblTechnology WHERE projectID = \" + super.id;\r\n\t\t\trs = stmt.executeQuery(sqlStr);\r\n\r\n\t\t\t// See if we're updating a row or adding a new row.\r\n\t\t\tif (newProject == false) {\r\n\r\n\t\t\t\t// Make sure this row is actually in the database. This shouldn't ever happen.\r\n\t\t\t\tif (!rs.next()) {\r\n\t\t\t\t\tthrow new InvalidIDException(\"ID was set in Technology, but not found in database on save()\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Make sure the result set is set up w/ current values from this object\r\n\t\t\t\tif (this.groups == null) { rs.updateNull(\"techGroups\"); }\r\n\t\t\t\telse { rs.updateString(\"techGroups\", StringUtils.join(this.groups.toArray(), \",\")); }\r\n\r\n\t\t\t\t// Update the row\r\n\t\t\t\trs.updateRow();\r\n\r\n\t\t\t} else {\r\n\t\t\t\t// We're adding a new row.\r\n\r\n\t\t\t\trs.moveToInsertRow();\r\n\r\n\t\t\t\trs.updateInt(\"projectID\", super.id);\r\n\r\n\t\t\t\tif (this.groups == null) { rs.updateNull(\"techGroups\"); }\r\n\t\t\t\telse { rs.updateString(\"techGroups\", StringUtils.join(this.groups.toArray(), \",\")); }\r\n\r\n\t\t\t\trs.insertRow();\r\n\t\t\t}\r\n\r\n\t\t\trs.close();\r\n\t\t\trs = null;\r\n\t\t\t\r\n\t\t\tstmt.close();\r\n\t\t\tstmt = null;\r\n\t\t\t\r\n\t\t\tconn.close();\r\n\t\t\tconn = null;\r\n\t\t}\r\n\t\tcatch(SQLException e) { throw e; }\r\n\t\tcatch(InvalidIDException e) { throw e; }\r\n\t\tfinally {\r\n\r\n\t\t\t// Always make sure result sets and statements are closed,\r\n\t\t\t// and the connection is returned to the pool\r\n\t\t\tif (rs != null) {\r\n\t\t\t\ttry { rs.close(); } catch (SQLException e) { ; }\r\n\t\t\t\trs = null;\r\n\t\t\t}\r\n\t\t\tif (stmt != null) {\r\n\t\t\t\ttry { stmt.close(); } catch (SQLException e) { ; }\r\n\t\t\t\tstmt = null;\r\n\t\t\t}\r\n\t\t\tif (conn != null) {\r\n\t\t\t\ttry { conn.close(); } catch (SQLException e) { ; }\r\n\t\t\t\tconn = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "int updateByPrimaryKey(Body record);", "private static CompletionStage<Void> persistOrUpdate(ReactiveMongoCollection collection, Object entity) {\n BsonDocument document = getBsonDocument(collection, entity);\n\n //then we get its id field and create a new Document with only this one that will be our replace query\n BsonValue id = document.get(ID);\n if (id == null) {\n //insert with autogenerated ID\n return collection.insertOne(entity);\n } else {\n //insert with user provided ID or update\n BsonDocument query = new BsonDocument().append(ID, id);\n return collection.replaceOne(query, entity, ReplaceOptions.createReplaceOptions(new UpdateOptions().upsert(true)))\n .thenApply(u -> null);\n }\n }", "@Override\n public Building save(Building entity) {\n return dao.save(entity);\n }", "int updateByPrimaryKey(Register record);", "public abstract boolean saveRequired();", "int updateByPrimaryKey(IntegralBook record);", "int updateByPrimaryKey(ResourcePojo record);", "@Override\n\tpublic int updateByPrimaryKey(Checkingin record) {\n\t\treturn 0;\n\t}", "public PreferenceBean save(PreferenceBean pObject) throws SQLException\n {\n Connection c = null;\n PreparedStatement ps = null;\n StringBuffer _sql = null;\n\n try\n {\n c = getConnection();\n if (pObject.isNew())\n { // SAVE \n if (!pObject.isPreferenceidModified())\n {\n ps = c.prepareStatement(\"SELECT nextval('preferenceid_seq')\");\n ResultSet rs = null;\n try\n {\n rs = ps.executeQuery();\n if(rs.next())\n pObject.setPreferenceid(Manager.getInteger(rs, 1));\n else\n getManager().log(\"ATTENTION: Could not retrieve generated key!\");\n }\n finally\n {\n getManager().close(ps, rs);\n ps=null;\n }\n }\n beforeInsert(pObject); // listener callback\n int _dirtyCount = 0;\n _sql = new StringBuffer(\"INSERT into preference (\");\n \n if (pObject.isPreferenceidModified()) {\n if (_dirtyCount>0) {\n _sql.append(\",\");\n }\n _sql.append(\"preferenceid\");\n _dirtyCount++;\n }\n\n if (pObject.isNameModified()) {\n if (_dirtyCount>0) {\n _sql.append(\",\");\n }\n _sql.append(\"name\");\n _dirtyCount++;\n }\n\n if (pObject.isPreferencetypeidModified()) {\n if (_dirtyCount>0) {\n _sql.append(\",\");\n }\n _sql.append(\"preferencetypeid\");\n _dirtyCount++;\n }\n\n if (pObject.isRegbyidModified()) {\n if (_dirtyCount>0) {\n _sql.append(\",\");\n }\n _sql.append(\"regbyid\");\n _dirtyCount++;\n }\n\n if (pObject.isRegdateModified()) {\n if (_dirtyCount>0) {\n _sql.append(\",\");\n }\n _sql.append(\"regdate\");\n _dirtyCount++;\n }\n\n if (pObject.isActiveModified()) {\n if (_dirtyCount>0) {\n _sql.append(\",\");\n }\n _sql.append(\"active\");\n _dirtyCount++;\n }\n\n if (pObject.isDeletedModified()) {\n if (_dirtyCount>0) {\n _sql.append(\",\");\n }\n _sql.append(\"deleted\");\n _dirtyCount++;\n }\n\n if (pObject.isReservationidModified()) {\n if (_dirtyCount>0) {\n _sql.append(\",\");\n }\n _sql.append(\"reservationid\");\n _dirtyCount++;\n }\n\n if (pObject.isIsstandartModified()) {\n if (_dirtyCount>0) {\n _sql.append(\",\");\n }\n _sql.append(\"isstandart\");\n _dirtyCount++;\n }\n\n _sql.append(\") values (\");\n if(_dirtyCount > 0) {\n _sql.append(\"?\");\n for(int i = 1; i < _dirtyCount; i++) {\n _sql.append(\",?\");\n }\n }\n _sql.append(\")\");\n\n ps = c.prepareStatement(_sql.toString(), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n _dirtyCount = 0;\n\n if (pObject.isPreferenceidModified()) {\n Manager.setInteger(ps, ++_dirtyCount, pObject.getPreferenceid());\n }\n \n if (pObject.isNameModified()) {\n ps.setString(++_dirtyCount, pObject.getName());\n }\n \n if (pObject.isPreferencetypeidModified()) {\n Manager.setInteger(ps, ++_dirtyCount, pObject.getPreferencetypeid());\n }\n \n if (pObject.isRegbyidModified()) {\n Manager.setInteger(ps, ++_dirtyCount, pObject.getRegbyid());\n }\n \n if (pObject.isRegdateModified()) {\n ps.setTimestamp(++_dirtyCount, pObject.getRegdate());\n }\n \n if (pObject.isActiveModified()) {\n Manager.setBoolean(ps, ++_dirtyCount, pObject.getActive());\n }\n \n if (pObject.isDeletedModified()) {\n Manager.setBoolean(ps, ++_dirtyCount, pObject.getDeleted());\n }\n \n if (pObject.isReservationidModified()) {\n Manager.setInteger(ps, ++_dirtyCount, pObject.getReservationid());\n }\n \n if (pObject.isIsstandartModified()) {\n Manager.setBoolean(ps, ++_dirtyCount, pObject.getIsstandart());\n }\n \n ps.executeUpdate();\n \n pObject.isNew(false);\n pObject.resetIsModified();\n afterInsert(pObject); // listener callback\n }\n else \n { // UPDATE \n beforeUpdate(pObject); // listener callback\n _sql = new StringBuffer(\"UPDATE preference SET \");\n boolean useComma=false;\n\n if (pObject.isPreferenceidModified()) {\n if (useComma) {\n _sql.append(\",\");\n } else {\n useComma=true;\n }\n _sql.append(\"preferenceid\").append(\"=?\");\n }\n\n if (pObject.isNameModified()) {\n if (useComma) {\n _sql.append(\",\");\n } else {\n useComma=true;\n }\n _sql.append(\"name\").append(\"=?\");\n }\n\n if (pObject.isPreferencetypeidModified()) {\n if (useComma) {\n _sql.append(\",\");\n } else {\n useComma=true;\n }\n _sql.append(\"preferencetypeid\").append(\"=?\");\n }\n\n if (pObject.isRegbyidModified()) {\n if (useComma) {\n _sql.append(\",\");\n } else {\n useComma=true;\n }\n _sql.append(\"regbyid\").append(\"=?\");\n }\n\n if (pObject.isRegdateModified()) {\n if (useComma) {\n _sql.append(\",\");\n } else {\n useComma=true;\n }\n _sql.append(\"regdate\").append(\"=?\");\n }\n\n if (pObject.isActiveModified()) {\n if (useComma) {\n _sql.append(\",\");\n } else {\n useComma=true;\n }\n _sql.append(\"active\").append(\"=?\");\n }\n\n if (pObject.isDeletedModified()) {\n if (useComma) {\n _sql.append(\",\");\n } else {\n useComma=true;\n }\n _sql.append(\"deleted\").append(\"=?\");\n }\n\n if (pObject.isReservationidModified()) {\n if (useComma) {\n _sql.append(\",\");\n } else {\n useComma=true;\n }\n _sql.append(\"reservationid\").append(\"=?\");\n }\n\n if (pObject.isIsstandartModified()) {\n if (useComma) {\n _sql.append(\",\");\n } else {\n useComma=true;\n }\n _sql.append(\"isstandart\").append(\"=?\");\n }\n _sql.append(\" WHERE \");\n _sql.append(\"preference.preferenceid=?\");\n ps = c.prepareStatement(_sql.toString(),ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n int _dirtyCount = 0;\n\n if (pObject.isPreferenceidModified()) {\n Manager.setInteger(ps, ++_dirtyCount, pObject.getPreferenceid());\n }\n\n if (pObject.isNameModified()) {\n ps.setString(++_dirtyCount, pObject.getName());\n }\n\n if (pObject.isPreferencetypeidModified()) {\n Manager.setInteger(ps, ++_dirtyCount, pObject.getPreferencetypeid());\n }\n\n if (pObject.isRegbyidModified()) {\n Manager.setInteger(ps, ++_dirtyCount, pObject.getRegbyid());\n }\n\n if (pObject.isRegdateModified()) {\n ps.setTimestamp(++_dirtyCount, pObject.getRegdate());\n }\n\n if (pObject.isActiveModified()) {\n Manager.setBoolean(ps, ++_dirtyCount, pObject.getActive());\n }\n\n if (pObject.isDeletedModified()) {\n Manager.setBoolean(ps, ++_dirtyCount, pObject.getDeleted());\n }\n\n if (pObject.isReservationidModified()) {\n Manager.setInteger(ps, ++_dirtyCount, pObject.getReservationid());\n }\n\n if (pObject.isIsstandartModified()) {\n Manager.setBoolean(ps, ++_dirtyCount, pObject.getIsstandart());\n }\n \n if (_dirtyCount == 0) {\n return pObject;\n }\n \n Manager.setInteger(ps, ++_dirtyCount, pObject.getPreferenceid());\n ps.executeUpdate();\n pObject.resetIsModified();\n afterUpdate(pObject); // listener callback\n }\n \n return pObject;\n }\n finally\n {\n getManager().close(ps);\n freeConnection(c);\n }\n }", "public boolean save(Product product);", "int updateByPrimaryKey(ParkCurrent record);" ]
[ "0.6895387", "0.6720568", "0.6672563", "0.6531327", "0.6452081", "0.6378222", "0.6222855", "0.6217946", "0.6201273", "0.6198916", "0.6196918", "0.618495", "0.6173395", "0.61561394", "0.6132216", "0.61257684", "0.6116042", "0.6110897", "0.610414", "0.6080452", "0.60741603", "0.6051628", "0.6046601", "0.604229", "0.60397434", "0.6031715", "0.60295045", "0.6026365", "0.60156065", "0.6013184", "0.59953606", "0.59920454", "0.59874153", "0.59654075", "0.5952484", "0.5949237", "0.59428304", "0.5935596", "0.593314", "0.592169", "0.5915066", "0.59104085", "0.59104085", "0.59104085", "0.59104085", "0.59104085", "0.59078866", "0.59062797", "0.590614", "0.59054434", "0.5905248", "0.59044325", "0.59025186", "0.59014", "0.5898179", "0.58954954", "0.58893317", "0.5882762", "0.5881697", "0.58807325", "0.5879396", "0.5878447", "0.58784354", "0.5873122", "0.5867284", "0.5862646", "0.58625615", "0.58625615", "0.5861039", "0.58587134", "0.58587027", "0.5857616", "0.58573925", "0.5850223", "0.5850223", "0.58502066", "0.5849141", "0.58491194", "0.5846327", "0.5841487", "0.5834214", "0.5832888", "0.5830823", "0.5825696", "0.5825508", "0.5824444", "0.58224154", "0.5821951", "0.5820965", "0.58173394", "0.5816195", "0.58161116", "0.5810339", "0.58101505", "0.58092046", "0.5806189", "0.58054787", "0.58041424", "0.58019465", "0.5800614", "0.58001095" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { ListNode head = ListNode.getAnExampleList(); ListNode.printList(head); deleteDuplicates(head); System.out.println(); ListNode.printList(head); }
{ "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
Given a sorted linked list, delete all duplicates such that each element appear only once. Given 1>1>2, return 1>2.
public static ListNode deleteDuplicates(ListNode head) { HashSet<Integer> allVals = new HashSet<Integer>(); ListNode temp = head; ListNode before = head; ListNode next = head; while(temp!=null){ if(allVals.contains(temp.val)){ before.next = next; // delete current node if(next == null ) return head; temp = next; next = temp.next; }else{ allVals.add(temp.val); before = temp; temp = next; if(temp == null ) return head; next =next.next; } } return head; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void removeDuplicates() {\n ListNode current = head;\n while (current != null && current.next != null) {\n if (current.data == current.next.data) {\n current.next = current.next.next;\n } else {\n current = current.next;\n }\n }\n }", "public static ListNode deleteDuplicates(ListNode head) {\n\n if(head == null || head.next == null)\n return head;\n\n ListNode fakehead = new ListNode(0);\n fakehead.next = head;\n ListNode p1 = fakehead;\n ListNode p2 = head;\n\n while(p2 != null && p2.next != null){\n if(p2.val != p2.next.val){\n p1 = p1.next;\n p2 = p2.next;\n }\n else{\n while(p2 != null && p2.next != null && p2.val == p2.next.val){\n p2 = p2.next;\n }\n p2 = p2.next;\n p1.next = p2;\n }\n }\n\n return fakehead.next;\n }", "public ListNode deleteDuplicates(ListNode head) {\n if (head == null || head.next == null)\n return head;\n Set<Integer> hs = new HashSet();\n ListNode temp = head;\n ListNode prev = head;\n \n while (temp != null) {\n if (!hs.contains(temp.val)) {\n hs.add(temp.val);\n prev = temp;\n } else {\n prev.next = temp.next;\n }\n temp = temp.next;\n }\n return head;\n }", "public ListNode deleteDuplicates(ListNode head) {\n if(head==null) return null;\n ListNode p=head,q=head.next,r=new ListNode(-1);\n r.next=head;\n head=r;\n int count=1;\n while(q!=null)\n {\n if(p.val==q.val){\n q=q.next;\n count++;\n }\n else{\n if(count>=2){\n r.next=q;\n p=q;\n q=q.next;\n count=1;\n }\n else{\n r=r.next;\n p=q;\n q=q.next;\n }\n }\n }\n if(count>=2) r.next=q;\n return head.next;\n }", "public void deleteDuplicates() {\n if (head == null)\n throw new RuntimeException(\"List is empty\");\n Node<Integer> previous = head;\n Node<Integer> current = previous.getNextNode();\n while (current != null) {\n Node<Integer> temp = head;\n while (temp != current) { //skips if its the current and node is same\n if (temp.getData() == current.getData()) {\n previous.setNextNode(current.getNextNode());\n current = current.getNextNode();\n break;\n }\n temp = temp.getNextNode();\n }\n if (temp == current) { // move the node pointer\n previous = current;\n current = current.getNextNode();\n }\n }\n }", "public ListNode deleteDuplicates(ListNode head) {\n\t\tif(head == null)\n\t\t\treturn null;\n\t\tListNode res = head;\n\t\tSet<Integer> dedupSet = new HashSet<Integer>();\n\t\tListNode pre = head;\n\t\tdedupSet.add(head.val);\n\t\thead = head.next;\n\t\twhile(head != null){\n\t\t\tif(!dedupSet.contains(head.val)){\n\t\t\t\tdedupSet.add(head.val);\n\t\t\t\tpre = head;\n\t\t\t}else{\n\t\t\t\tpre.next = head.next;\n\t\t\t}\n\t\t\thead = head.next;\n\t\t}\n return res;\n }", "public ListNode deleteDuplicates(ListNode head) {\n if (head == null || head.next == null) {\n return head;\n }\n ListNode pointer1 = head;\n ListNode pointer2 = head.next;\n while (pointer2 != null) {\n while (pointer2 != null && pointer2.val == pointer1.val) {\n pointer2 = pointer2.next;\n }\n pointer1.next = pointer2;\n pointer1 = pointer2;\n if (pointer2 != null) {\n pointer2 = pointer2.next;\n }\n }\n return head;\n }", "public ListNode deleteDuplicates2(ListNode head) {\n if (head == null || head.next == null) {\n return head;\n }\n // 0 - 1 - 2 - 3 - 3 - null\n // s\n //. 2 - 3 - 3 - null\n // f\n ListNode slow = head;\n ListNode fast = slow.next;\n while (fast != null) {\n if (slow.val != fast.val) {\n slow = slow.next;\n } else {\n slow.next = fast.next;\n }\n fast = fast.next;\n }\n return head;\n }", "public static ListNode deleteDuplicates(ListNode head) {\n \tif(head == null) return null;\n ListNode nd = head;\n HashSet hs = new HashSet();\n hs.add(nd.val);\n while(nd.next!=null){\n \tif(! hs.add(nd.next.val)){\n \t\tnd.next = nd.next.next;\n \t}\n \telse\n \t\tnd = nd.next;\n }\n return head;\n \n }", "public ListNode deleteDuplicates(ListNode head) {\r\n\t\tListNode node = head;\r\n\t\twhile (node != null) {\r\n\t\t\tListNode next = node.next;\r\n\t\t\tif (next != null && node.val == next.val) {\r\n\t\t\t\tnode.next = next.next;\r\n\t\t\t} else {\r\n\t\t\t\tnode = next;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn head;\r\n\t}", "public ListNode deleteDuplicates(ListNode head) {\n HashSet<Integer> set = new HashSet<>();\n ListNode node = head;\n ListNode before = null;\n while (head != null) {\n if (set.contains(head.val)) {\n if (head.next != null) {\n head.next = head.next.next;\n } else {\n before.next = null;\n head = null;\n }\n } else {\n set.add(head.val);\n before = head;\n head = head.next;\n }\n }\n return node;\n }", "public ListNode deleteDuplicates(ListNode head) {\n ListNode curr=head;\n if(curr==null) return null;\n while(curr!=null && curr.next!=null){\n ListNode next = curr.next;\n if(curr.next.val == curr.val){\n curr.next = curr.next.next;\n continue;\n }\n curr = next;\n }\n return head;\n }", "public ListNode deleteDuplicates(ListNode head) {\n if (head == null)\n return null;\n ListNode itr = head;\n while (itr != null && itr.next != null) {\n ListNode ahead = itr;\n while (ahead.next != null && ahead.next.val == ahead.val)\n ahead = ahead.next;\n itr.next = ahead.next;\n itr = itr.next;\n }\n return head;\n }", "public ListNode deleteDuplicates(ListNode head) {\n\n if (head == null || head.next == null) {\n return head;\n }\n\n ListNode prev = head;\n ListNode node = head;\n\n while (node.next != null) {\n node = node.next;\n if (prev.val == node.val) {\n prev.next = node.next;\n }\n else {\n prev = node;\n }\n }\n\n return head;\n }", "public static ListNode deleteDuplicates(ListNode head) {\n if(head == null || head.next == null) return head;\n boolean flag = false;\n if(head.next!=null && head.val == head.next.val) flag = true;\n int ahead = head.val;\n ListNode ptr = head.next;\n ListNode new_head = new ListNode(head.val);\n ListNode cur = new_head;\n while(ptr != null) {\n if(ptr.val != ahead) {\n if(ptr.next == null || ptr.next.val != ptr.val) {\n cur.next = new ListNode(ptr.val);\n cur = cur.next;\n }\n ahead = ptr.val;\n }\n ptr = ptr.next;\n }\n if(flag) return new_head.next;\n return new_head;\n }", "public ListNode deleteDuplicates(ListNode head) {\n ListNode newhead = new ListNode(0);\n ListNode curr=head;\n ListNode prev = newhead;\n newhead.next = curr;\n if(curr==null) return null;\n while(curr!=null && curr.next!=null){\n ListNode next = curr.next;\n if(next.val == curr.val){\n while(next!=null && next.val == curr.val){\n next = next.next;\n }\n prev.next = next;\n }\n else{\n prev = curr;\n }\n curr = next;\n \n }\n return newhead.next;\n }", "private static ListNode removeDuplicates(ListNode head) {\n\n if (head == null)\n return head;\n\n // Initialize result node\n ListNode result = new ListNode(0);\n\n // Assuming that, if LinkedList has no duplicates\n result.next = head;\n\n //Iterate curr and next values.\n ListNode curr = result;\n ListNode next = result.next;\n\n boolean isDupFound = false;\n while (next != null) {\n\n //if next value is same as curr value. don't update current\n if (next.next != null && next.val == next.next.val) {\n isDupFound = true;\n }\n else if(isDupFound){\n curr.next = next.next;\n isDupFound = false;\n }\n else {\n curr = curr.next;\n }\n next = next.next;\n\n }\n return result.next;\n }", "public ListNode LCdeleteDuplicates(ListNode head) {\n // use two pointers, slow - track the node before the dup nodes,\n \t// fast - to find the last node of dups.\n\n // Raz:\n // the idea is really hard to think of\n // just add the fast.next to slow first.\n // if the fast is duplicate, then remove it, change the slow.next to now fast.next\n // not easy enough as the solution above I think.\n\n ListNode dummy = new ListNode(0), fast = head, slow = dummy;\n slow.next = fast;\n while(fast != null) {\n \twhile (fast.next != null && fast.val == fast.next.val) {\n \t\tfast = fast.next; //while loop to find the last node of the dups.\n \t}\n \tif (slow.next != fast) { //duplicates detected.\n \t\tslow.next = fast.next; //remove the dups.\n \t\tfast = fast.next; //reposition the fast pointer.\n \t} else { //no dup, move down both pointer.\n \t\tslow = slow.next;\n \t\tfast = fast.next;\n \t}\n }\n return dummy.next;\n }", "private static void removeDuplicates(Node head) {\n if (head == null)\n return;\n\n Node current = head;\n while (current != null) {\n Node runner = current;\n while (runner.next != null) {\n if (runner.next.value == current.value)\n runner.next = runner.next.next;\n else\n runner = runner.next;\n }\n current = current.next;\n }\n }", "public static void removeDuplicates(Node head)\n {\n HashSet<Integer> seen = new HashSet<Integer>();\n Node curr = head;\n while (curr.next != null)\n {\n seen.add(curr.data);\n if (seen.contains(curr.next.data))\n {\n curr.next = deleteNode(curr.next);\n }\n curr = curr.next;\n }\n }", "static void deleteDup(Linkedlists list){\r\n\tif(list.head==null){\r\n\t\tSystem.out.println(\"enmpty list\");\r\n\t\treturn;\r\n\t}\r\n\telse{\r\n\t\tNode current=list.head;\r\n\t\twhile(current != null){\r\n\t\t\tNode runner=current;\r\n\t\twhile(runner.next != null){\r\n\t\t\tif(runner.next.data==current.data){\r\n\t\t\t\trunner.next=runner.next.next;\r\n\t\t\t\tlist.removeNode(current.data);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\trunner=runner.next;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcurrent=current.next;\r\n\t\t}\r\n\t}\r\n\r\n\tSystem.out.println(\"list after duplicate removal\");\r\n\tlist.printList();\r\n}", "public void removeDuplicates() {\n if (head == null) {\n return;\n }\n Node currentNode = this.head;\n Node nextNode = this.head.next;\n while (nextNode != null) {\n if (currentNode.data == nextNode.data) {\n currentNode.next = nextNode.next;\n nextNode = nextNode.next;\n } else {\n currentNode = nextNode;\n nextNode = nextNode.next;\n }\n }\n }", "public Node removeDups(Node head) {\n if (head != null) {\n Node current = head;\n Set<Integer> set = new HashSet<>();\n set.add(current.data);//IMP step\n\n while (current.next != null) {\n if (set.contains(current.next.data)) {\n //found the dup, leave it out\n current.next = current.next.next;\n } else {\n set.add(current.data);\n current = current.next;\n }\n }\n }\n return head;\n }", "public static void removeDups (Node head){\n\n Node i = head;\n Node j;\n Node previous;\n\n while (i != null) {\n previous = i;\n j = i.next;\n while (j != null) {\n if (i.val == j.val){\n previous.next = j.next;\n } else {\n previous = j;\n }\n j = j.next;\n }\n\n i = i.next;\n }\n }", "public static void removeDuplicateSample() {\n Node ll1 = new Node(1, new Node(2, new Node(3, new Node(4, new Node(5, null)))));\n Node ll2 = new Node(1, new Node(2, new Node(3, new Node(4, new Node(4, null)))));\n Node ll3 = new Node(1, new Node(1, new Node(3, new Node(4, new Node(5, null)))));\n Node ll4 = new Node(1, new Node(1, new Node(1, new Node(4, new Node(5, null)))));\n\n System.out.println(\"1===\");\n ll1.printList();\n ll1 = ll1.removeDuplicate();\n ll1.printList();\n\n System.out.println(\"2===\");\n ll2.printList();\n ll2 = ll2.removeDuplicate();\n ll2.printList();\n\n System.out.println(\"3===\");\n ll3.printList();\n ll3 = ll3.removeDuplicate();\n ll3.printList();\n\n System.out.println(\"4===\");\n ll4.printList();\n ll4 = ll4.removeDuplicate();\n ll4.printList();\n\n }", "public ListNode deleteDuplicates(ListNode p, int val, boolean first) {\n if(p == null) {\n return null;\n }\n if(p.next == null) {\n if(p.val == val && !first) {\n return null;\n } else {\n return p;\n }\n }\n //p.next != null\n if(first) {\n // p.val == val\n if(p.next.val == val) {\n return deleteDuplicates(p.next.next,val,false);\n } else {\n p.next = deleteDuplicates(p.next,p.next.val,true);\n return p;\n }\n } else {\n if(p.val == val){\n return deleteDuplicates(p.next,val,false);\n } else {\n return deleteDuplicates(p,p.val,true);\n }\n }\n }", "public Node removeDuplicates(Node head) {\n Node S = head;\n Node P = head.next;\n while (P != null) {\n if (S.data == P.data) {\n P = P.next;\n } else {\n S.next = P;\n S = S.next;\n P = P.next;\n }\n }\n S.next = P;\n return S;\n }", "public static void removeDuplicatesWithoutBuffer(LinkedList list)\n\t{\n\t\t//**Needs only two pointers**//\n\t\tNode current = list.getHead();\n\t\twhile(current != null && current.getNext() != null)\n\t\t{\n\t\t\tNode temp = current;\n\t\t\twhile(temp.getNext() != null)\n\t\t\t{\n\t\t\t\tif(current.getData() == temp.getNext().getData())\n\t\t\t\t{\n\t\t\t\t\ttemp.setNext(temp.getNext());\n\t\t\t\t\ttemp.setNext(temp.getNext().getNext());;\n\t\t\t\t} \n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttemp = temp.getNext();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcurrent = current.getNext();\n\t\t}\n\t}", "Node removeDuplicates(Node head)\n {\n \tNode cur = head;\n \tNode next = null;\n \twhile(cur.next!=null ){\n \t if(cur.data == cur.next.data){\n \t next = cur.next.next;\n \t cur.next = next;\n \t }else cur = cur.next;\n \t}return head;\n }", "public void removeDuplicates(){\n HashSet<Object> elements = new HashSet<>();\n Node n = head;\n int i=0;\n while(n!=null){\n if(elements.contains(n.getData())){\n if (size == 1) {\n this.head.setData(null);\n } else {\n if (n == this.head) {\n this.head = n.next;\n this.head.prev = this.head;\n } else if (n == this.tail) {\n this.tail = n.prev;\n this.tail.next = this.tail;\n } else {\n n.prev.next = n.next;\n n.next.prev = n.prev;\n }\n }\n size--;\n }else{\n elements.add(n.getData());\n }\n n=n.next;\n }\n }", "public void removeDups() {\n Node curr = head;\n Node prev = head;\n Set<Integer> integers = new HashSet<>();\n while (curr != null) {\n if (integers.contains(curr.getValue())) {\n prev.setNext(curr.getNext());\n } else {\n integers.add(curr.getValue());\n prev = curr;\n }\n curr = curr.getNext();\n }\n }", "public static void main(String[] args) {\n ArrayList<Integer> nums = new ArrayList<>();\n nums.addAll( Arrays.asList(100, 2000, 50, 50, 100, 200, 300, 50));\n nums=new ArrayList<>(new TreeSet<>(nums));\n System.out.println(nums);\n\n String str1 = \"babababC\";\n str1 = new TreeSet<>( Arrays.asList(str1.split(\"\")) ).toString();\n System.out.println(str1);\n\n\n System.out.println(\"=========================================================================================\");\n\n /**\n * - 2. Write a program that can REMOVE THE DUPLICATES from an ArrayList. DO NOT change the ORDER\n * -> LinkedHashSet -> Remove Duplicates and Keeps the Insertion Order\n */\n ArrayList<Integer> list = new ArrayList<>(Arrays.asList(6,6,6,6,5,5,5,4,4,4,4));\n list=new ArrayList<>(new LinkedHashSet<>(list));\n System.out.println(list);\n\n\n /**\n * - 1. Write a program that can remove the duplicated characters from String and store them into variable\n */\n String str = \"ABABABCDEF\";\n String[] arr = str.split(\"\");\n str = new LinkedHashSet<>(Arrays.asList(arr)).toString().replace(\", \", \"\");\n System.out.println(str);\n\n\n System.out.println(\"=========================================================================================\");\n\n /**\n * -> Does not accept duplicates, and sort the objects\n * -> HashSet accepts null\n * -> HashSet is faster than TreeSet\n */\n HashSet<Integer> numbers = new HashSet<>(Arrays.asList(10,9,10, 9, 8, 7, 8, 7, 6, 5, 6, 1));\n System.out.println(numbers ); // -> [1, 5, 6, 7, 8, 9, 10]\n\n\n System.out.println(\"=========================================================================================\");\n\n /**\n * - ITERATOR: -> is the only way to remove duplicates from collection\n * - removeIf -> removes numbers because it is uses the iterator interface internally. Iterator implicitly\n *\n * - hasNext() method only can go forward cant go backward. it stars from next index\n * - when we use it our loop hasNext() iterates from the next index\n * - iterator(); - hasNext(); - next(); - remove();\n */\n ArrayList<Integer> list2 = new ArrayList<>(Arrays.asList(1,1,2,2,3,3,4,4,5,5));\n list2.removeIf( p -> p < 4 );\n System.out.println(list2);\n\n\n ArrayList<Integer> list3 = new ArrayList<>(Arrays.asList(1,1,2,2,3,3,4,4,5,5));\n Iterator<Integer> it =list3.iterator(); // - this method will return iterator\n while( it.hasNext() ){ // - iterator explicitly. While loop only accept boolean\n if( it.next() < 4 ){\n it.remove();\n }\n }\n System.out.println(list3);\n\n\n ArrayList<Integer> list4 = new ArrayList<>(Arrays.asList(1,1,2,3,3,4,4,5,5));\n // - hasNext(); will iterate all the indexes. We do not need extra iterator in the loop\n for(Iterator<Integer> I = list4.iterator(); I.hasNext(); ){\n if( I.next() < 4) {\n I.remove();\n }\n }\n System.out.println(list4);\n\n\n\n LinkedHashSet<String> names = new LinkedHashSet<>();\n names.addAll(Arrays.asList( \"Mehmet\",\"Mohammed\",\"Yucel\",\"Sha\",\"Ozgur\", \"Ahmet\",\"Osmanj\",\"Ozgur\",\"Ozgur\",\"Irina\"));\n System.out.println(names);\n Iterator<String> it3 = names.iterator();\n while( it3.hasNext() ){\n String s = it3.next();\n if(s.contains(\"m\") || s.contains(\"M\")){ // - s.toLowerCase.contains(\"m\")\n it3.remove();\n }\n }\n System.out.println(names);\n\n /*\n ===============================================================\n for(Iterator<String> it3 = names.iterator(); it3.hasNext() ; ){\n String s = it3.next();\n if(s.toLowerCase().contains(\"m\")){\n it3.remove();\n }\n }\n ================================================================\n names.removeIf( s -> s.contains(\"m\") || s.contains(\"M\") );\n ================================================================\n names.removeAll( Arrays.asList( \"Mehmet\", \"Ozgur\", \"Mohammed\" ));\n ================================================================\n names.retainAll( Arrays.asList( \"Yucel\", \"Sha\", \"Ahmet\" ) );\n ================================================================\n boolean result = list.containsAll( Arrays.asList(5, 6, 9, 8, 11 ));\n */\n\n\n\n\n\n\n\n System.out.println(\"=========================================================================================\");\n\n\n\n\n\n }", "private Node removeDuplicate() {\n ArrayList<Integer> values = new ArrayList<Integer>();\n int len = this.getlength();\n Node result = this;\n\n if (len == 1) {\n System.out.println(\"only one element can't duplicate\");\n return result;\n } else {\n Node current = result;\n\n for (int i = 0; i < len; i++) {\n if (values.contains(current.value)) {\n result = result.remove(i);\n len = result.getlength();\n i--; // reset the loop back\n current = current.nextNode;\n } else {\n values.add(current.value);\n current = current.nextNode;\n }\n }\n return result;\n }\n }", "static LinkedListNode removeDuplicates(LinkedListNode n) {\n\t\tif(n == null || n.nextNode == null)\n\t\t\treturn n;\n\t\telse\n\t\t\tif(listContainsVal(n.val, n.nextNode)) \n\t\t\t\treturn removeDuplicates(n.nextNode);\n\t\t\telse {\n\t\t\t\tn.nextNode=removeDuplicates(n.nextNode);\n\t\t\t\treturn n;\n\t\t\t}\n\t}", "public static void removeDuplicatesInPlace(LinkedList linkedList) {\r\n\t\tif (linkedList == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tIntegerNode toMatch = linkedList.getHead();\r\n\r\n\t\twhile (toMatch != null) {\r\n\t\t\tIntegerNode current = toMatch;\r\n\t\t\twhile (current.getNext() != null) {\r\n\t\t\t\tif (current.getNext().equals(toMatch)) {\r\n\t\t\t\t\tIntegerNode matchedNode = current.getNext();\r\n\t\t\t\t\tcurrent.setNext(matchedNode.getNext());\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcurrent = current.getNext();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\ttoMatch = toMatch.getNext();\r\n\t\t}\r\n\t}", "public static Node removeDuplicates(Node head) {\n\tif(head == null){\n\t return null;\n\t}\n Node traverser = head;\n while(traverser != null && traverser.next != null) { // While not reached end of list\n if(traverser.data == traverser.next.data) { // If current node = next node\n Node secondNode = traverser.next; \n if(secondNode.next != null) { // If next node is not the tail\n traverser.next = secondNode.next; // Connect current node to the next next\n }\n else { // If it was the tail\n traverser.next = null; // Just remove the tail\n }\n }\n\t if(traverser.next != null && traverser.data != traverser.next.data) { // If the new next is also repeated, dont advance the traverser\n traverser = traverser.next;\n\t }\n }\n return head;\n }", "public static void removeDuplicatesWithBuffer(LinkedList list)\n\t{\n\t\tHashSet<Integer> unique = new HashSet<Integer>();\n\t\tNode current = list.getHead(), prev = null;\n\t\twhile(current != null)\n\t\t{\n\t\t\tif(!unique.add(current.getData()))\n\t\t\t{\n\t\t\t\t//**Do not move the previous node to current if there is a duplicate**//\n\t\t\t\tprev.setNext(current.getNext());\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tprev = current;\n\t\t\t}\n\t\t\tcurrent = current.getNext();\n\t\t}\n\t}", "public void removeDuplicate(Node head){\r\n\t\tMap<Integer, Boolean> buffer = new HashMap<Integer, Boolean>();\r\n\t\tNode previous = null;\r\n\t\twhile(head != null){\r\n\t\t\tif(buffer.get(head.data)){\r\n\t\t\t\tprevious.next = head.next;\r\n\t\t\t}else{\r\n\t\t\t\tprevious = head;\r\n\t\t\t\tbuffer.put(head.data, true);\r\n\t\t\t}\r\n\t\t\thead = head.next;\r\n\t\t}\r\n\t}", "public Node removeDuplicates(Node head) \n {\n // Your code here\n HashSet<Integer>hs = new HashSet<>();\n Node curr=head;\n Node prev=null;\n while(curr!=null){\n if(hs.contains(curr.data)){\n prev.next = curr.next;\n }else{\n hs.add(curr.data);\n prev = curr;\n }\n curr = curr.next;\n }\n return head;\n }", "protected void removeDuplicates() {\n log.trace(\"Removing duplicated\");\n long startTime = System.currentTimeMillis();\n int initial = size();\n E last = null;\n int index = 0;\n while (index < size()) {\n E current = get(index);\n if (last != null && last.equals(current)) {\n if (log.isTraceEnabled()) {\n log.trace(\"Removing duplicate '\" + current + \"'\");\n }\n remove(index);\n } else {\n index++;\n }\n last = current;\n }\n log.debug(String.format(\"Removed %d duplicates from a total of %d values in %dms\",\n initial - size(), initial, System.currentTimeMillis() - startTime));\n }", "public static void deleteDuplicatesNoBuffer(LinkedListNode head){\n LinkedListNode current = head;\n\n while ( current != null ) {\n LinkedListNode runner = current;\n\n while ( runner.next != null ) {\n if ( current.data == runner.next.data ) {\n // skip the runner's next node\n runner.next = runner.next.next;\n } else {\n runner = runner.next;\n }\n }\n\n current = current.next;\n }\n }", "public void removeDupsMtd2() {\n Node curr = head;\n Node prev = head;\n while (curr != null) {\n Node runner = curr.getNext();\n while(runner != null) {\n if (runner.getValue() == curr.getValue()) {\n curr.setNext(runner.getNext());\n }\n runner = runner.getNext();\n }\n curr = curr.getNext();\n }\n }", "private ListNode deleteReplicateNode(ListNode head) {\n\n if (head == null || head.next == null) {\n System.out.println(\"Head is null or there is only one node\");\n return head;\n }\n\n ListNode preNode = null;\n ListNode node = head;\n while (node != null) {\n\n ListNode nextNode = node.next;\n boolean deleteFlag = false;\n if (nextNode != null && node.val == nextNode.val) {\n deleteFlag = true;\n }\n\n if (!deleteFlag) {\n preNode = node;\n } else {\n int value = node.val;\n ListNode toBeDeleted = node;\n\n while (toBeDeleted != null && toBeDeleted.val == value) {\n nextNode = toBeDeleted.next;\n\n toBeDeleted.next = null;\n\n toBeDeleted = nextNode;\n }\n\n // when old head node is duplicated, we need to assign the new head.\n if (preNode == null) {\n head = nextNode;\n } else {\n // use preNode to connect these non-duplicate nodes.\n preNode.next = nextNode;\n }\n }\n\n node = nextNode;\n }\n\n return head;\n }", "public static void collapseDuplicates( ArrayList<Integer> L ) { \n\tfor (int i = 1; i < L.size();) {\n\t if (L.get(i).equals(L.get(i - 1))) {\n\t\tL.remove(i - 1);\n\t } else {\n\t\ti++;\n\t }\n\t}\n }", "public static void testDedupe(){\n LinkedList<String> list = new LinkedList<String>();\n \n for(int i = 0; i < 10; i++)\n list.add(\"Number \" + i);\n for(int j = 0; j < 5; j++)\n list.add(\"Number \" + j);\n \n //print test list\n for (String num : list)\n System.out.print(num + \" \");\n \n //Call deDupe and reprint list\n LinkedLists.deDupe(list);\n System.out.println(\"List after removing dupes: \" + '\\n');\n for (String num : list)\n System.out.print(num + \" \");\n }", "public Node removeNonDups(Node head) {\n if (head == null) {\n return null;\n }\n HashMap<Integer, Integer> countMap = new HashMap<>();\n while (head != null) {\n if (countMap.containsKey(head.data)) {\n Integer currentCount = countMap.get(head.data);\n countMap.put(head.data, ++currentCount);\n } else {\n countMap.put(head.data, 1);\n }\n head = head.next;\n }\n Node newHead = null;\n for (Map.Entry<Integer, Integer> entry : countMap.entrySet()) {\n if (entry.getValue() > 1) {\n Node node = new Node(entry.getKey());\n if (newHead == null) {\n newHead = node;\n } else {\n newHead.next = node;\n }\n }\n }\n return newHead;\n }", "public static void removeDuplicate(ArrayList<Integer>list) {\n \n //create a temporary arraylist\n ArrayList<Integer> tempList = new ArrayList<>();\n \n //loop thru the list and check if list contains the same integer/number/value as tempList\n for (int i = 0; i < list.size(); i++) {\n if (!tempList.contains(list.get(i))) {\n tempList.add(list.get(i));\n }\n }\n \n //clear the list\n list.clear();\n \n //add all integers/numbers/value from tempList into list\n list.addAll(tempList);\n \n }", "public static void removeDuplicates(LinkedList linkedList) {\r\n\t\tif (linkedList == null || linkedList.getHead() == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tHashMap<Integer, IntegerNode> table = new HashMap<Integer, IntegerNode>();\r\n\t\tIntegerNode current = linkedList.getHead();\r\n\r\n\t\ttable.put(current.getData(), current);\r\n\r\n\t\twhile (current.getNext() != null) {\r\n\t\t\tif (table.containsKey(current.getNext().getData())) {\r\n\t\t\t\t// We've accessed this node before, so we're going\r\n\t\t\t\t// to go ahead and delete it\r\n\t\t\t\tIntegerNode matchedNode = current.getNext();\r\n\t\t\t\tcurrent.setNext(matchedNode.getNext());\r\n\t\t\t} else {\r\n\t\t\t\ttable.put(current.getNext().getData(), current);\r\n\t\t\t\tcurrent = current.getNext();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n public LinkedList removeDuplicates() {\n ArrayList<String> itemList = new ArrayList(Arrays.asList(\"\"));\n LinkedList newLinkedList = new LinkedList();\n Node currNode = this.head;\n while(true){\n if(!itemList.contains(currNode.getItem())){\n itemList.add(currNode.getItem());\n newLinkedList.addNode(currNode.getItem());\n }\n if(currNode.getNextNode() == null){\n break;\n }\n currNode = currNode.getNextNode();\n }\n return newLinkedList;\n }", "public void removeDuplication() {\r\n\t\t//checks if the array contains any elements\r\n\t\tif (!isEmpty()) {\t//contains elements\r\n\t\t\t//loop to execute for every element in the array\r\n\t\t\tfor (int i=0;i<size-1;i++) {\r\n\t\t\t\tObject element=list[i];\t//to store value of element in array\r\n\t\t\t\t//loop to execute for every element after the current element in the list\r\n\t\t\t\tfor (int j=i+1;j<size;j++) {\r\n\t\t\t\t\t//checks if there is are 2 elements in the list with the same value\r\n\t\t\t\t\tif (element==list[j]) {\r\n\t\t\t\t\t\tremove(j);\t//calls function to remove that element from array\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\telse {\t//contains 0 elements\r\n\t\t\tSystem.out.println(\"List is empty!\");\r\n\t\t}\r\n\t}", "public ArrayList<Person> allPairsDeduplication(){\n\tArrayList<Person> unduplicated = new ArrayList<>();\n\tfor (int i=0;i<this.lst.size();i++){\n\t int dup =0;\n\t //compare each element to elements after it in the list\n\t for(int j=i+1; j< this.lst.size();j++){\n\t\tif (lst.get(i).compareTo(lst.get(j)) == 0 ) dup++;\n\t }\n\t if (dup == 0) unduplicated.add(lst.get(i));\n\t}\n\treturn unduplicated;\n }", "public static void main(String[] args) {\n\n ListNode head = new ListNode(1);\n ListNode node2 = new ListNode(1);\n ListNode node3 = new ListNode(1);\n ListNode node4 = new ListNode(1);\n ListNode node5 = new ListNode(1);\n ListNode node6 = new ListNode(2);\n\n node5.next = node6;\n node4.next = node5;\n node3.next = node4;\n node2.next = node3;\n head.next = node2;\n\n removeDuplicateNodes(head);\n\n return;\n }", "private ArrayList<Integer> remove_duplicates(ArrayList<Integer> l) {\n ArrayList<Integer> res = new ArrayList<Integer>();\n for (int i=0; i< l.size(); i++) {\n if (!(in(l.get(i), res))) {\n res.add(l.get(i));\n }\n }\n return res;\n }", "public static void main(String[] args) {\n LinkRemoveDuplicates2 ll=new LinkRemoveDuplicates2();\r\n\r\n ll.insertFirst(40);\r\n\r\n ll.insertFirst(30);\r\n \r\n ll.insertFirst(20);\r\n ll.insertFirst(20);\r\n ll.insertFirst(10);\r\n ll.insertFirst(10);\r\n System.out.println(\"Initial List->\");\r\n ll.printList();\r\n ll.head=ll.remove(ll.head);\r\n System.out.println(\"\\n\\nAfter removing duplicates->\");\r\n ll.printList();\r\n\t}", "public void removeDuplitcate(List<Integer> a)\n\t{\n\t\tif(a==null ||a.size()==0 ) return ;\n\t\t\n\t\tHashMap<Integer, Integer> hm = new HashMap<Integer, Integer>();\n\t\t\n\t\tfor(int i=a.size()-1;i>=0;i--)\n\t\t{\n\t\t\tif(hm.containsKey(a.get(i)))\n\t\t\t{\n\t\t\t\ta.remove(i);\n\t\t\t}\n\t\t\telse hm.put(a.get(i), 1);\n\t\t}\n\t}", "public ArrayList<Person> quicksortDeduplication(){\n\t//copy data from list to array arr\n\tPerson[] arr = new Person[this.lst.size()];\n\tfor(int i=0; i< lst.size();i++){\n\t arr[i] = this.lst.get(i);\n\t}\n\t//sort array => see QuickSort class\n\tQuickSort.sort(arr,0,arr.length-1);\n\t//create list to store singular data\n\tArrayList<Person> unduplicated2 = new ArrayList<>();\n\t//compare successive elements of array to find duplicates\n\tint limit =0;\n\tif (arr.length ==0 || arr.length==1) limit =arr.length;\n\tint j=0;\n\t//store only singular data in the beginning of the array\n\tfor (int i = 0; i < arr.length-1; i++) \n if (arr[i].compareTo( arr[i+1]) != 0) \n arr[j++] = arr[i]; \n\t// add last element to array\n arr[j++] = arr[arr.length-1];\n\t//record last index of singular element\n\tlimit =j;\n\t//copy elements up to the singularity index to the list\n\tfor(int k=0; k< limit; k++){\n\t unduplicated2.add(arr[k]);\n\t}\n\treturn unduplicated2;\n }", "public int removeDuplicates(int[] nums) {\n int n = nums.length;\n if (n == 0 || n == 1) {\n return n;\n }\n int i = 1;\n int j = i;\n int last = nums[i - 1]; //Starting with the second pointer to avoid edge cases.\n while (i < n && j < n) {\n if (last == nums[j]) { //Comparing last seen.\n j++;\n } else {\n last = nums[j];\n nums[i] = last;\n i++;\n j++;\n }\n }\n return i; //i tracks the current location and hence the end of the array.\n }", "public static void removeDuplicates(HeapIntPriorityQueue dupes){\n //Auxillery queue to hold the non-dupes\n Queue <Integer> holder = new LinkedList<Integer>();\n //Exception clause\n if(dupes.isEmpty()){\n throw new IllegalArgumentException();\n //Test parameter, if the PriorityQueue only has one int it falls through\n }else if (dupes.size()>1){\n int first = dupes.remove();\n int second = 0;\n //If we are not at the end, keep going\n while(!dupes.isEmpty()){\n second = dupes.remove();\n if(first!=second){\n holder.add(first);\n first=second;\n }\n }\n //Move the remaining int to the holder\n holder.add(first);\n }\n //Shift everything from the holder back to the parameter PriorityQueue\n while (!holder.isEmpty()){\n dupes.add(holder.remove());\n }\n }", "public int removeDuplicates(int[] nums) {\n int repeat = 2;\n if (nums.length <= 2) {\n return nums.length;\n }\n int i = 1, j = 1;\n int count = 1;\n while (j < nums.length) {\n if (nums[j] != nums[j - 1]) {\n count = 1;\n nums[i] = nums[j];\n i++;\n } else {\n if (count < repeat) {\n nums[i] = nums[j];\n i++;\n count++;\n }\n }\n j++;\n }\n return i;\n }", "public MyLinkedList removeDuplicates() {\n this.removeDuplicates(this.head);\n return this;\n }", "public static List removeDuplicatesFromList(List intList){\n\n for (int i = 0; i < intList.size() ; i++) {\n for (int j = 0; j < intList.size(); j++) {\n if (intList.get(i) == intList.get(j) && (i != j)) {\n intList.remove(j);\n }\n\n }\n\n }\n return intList;\n\n }", "public void removeDuplicates()\n\t{\n\t\tComparator<Point> comp = new Comparator<Point>() \n\t\t{\n @Override\n public int compare(Point p, Point q) \n {\n \t return p.compareTo(q);\n }\n };\n\t\tquicksorter.quickSort(comp);\n\t\tquicksorter.getSortedPoints(points);\n\t\t\n\t\tArrayList<Point> pts = new ArrayList<Point>();\n\t\tfor(int a = 0; a < points.length; a++) //copy points into temp array\n\t\t{\n\t\t\tif(!pts.contains(points[a]))\n\t\t\t{\n\t\t\t\tpts.add(points[a]);\n\t\t\t}\n\t\t}\n\t\tpointsNoDuplicate = new Point[pts.size()]; //insert into pointsNoDuplicate\n\t\tfor(int i = 0; i < pts.size(); i++)\n\t\t{\n\t\t\tpointsNoDuplicate[i] = pts.get(i);\n\t\t}\n\t}", "public static <T> List<T> removeDuplicates (List<T> initialList, Comparator<T> comparator){\r\n List<T> finalList = new ArrayList<T>();\r\n \r\n for (int i = 0; i<initialList.size(); i++){\r\n if (i == 0){\r\n finalList.add(initialList.get(i));\r\n continue;\r\n }\r\n \r\n if (comparator.compare(initialList.get(i-1), initialList.get(i)) == 0){\r\n continue;\r\n }else{\r\n finalList.add(initialList.get(i));\r\n }\r\n }\r\n \r\n return finalList;\r\n }", "public int removeDuplicates(int[] nums) {\r\n int length = nums.length;\r\n int j = 1;\r\n for(int i = 1; i < length; i++) {\r\n if(nums[i] != nums[i - 1]) {\r\n nums[j] = nums[i];\r\n j++;\r\n } \r\n }\r\n \r\n return j;\r\n }", "public int removeDuplicates(int[] nums) {\n if (nums.length == 0) return 0;\n int i = 0;\n for (int j = 1; j < nums.length; j++) {\n if (nums[j] != nums[i]) {\n i++;\n nums[i] = nums[j];\n }\n }\n return i + 1;\n}", "public static <T> Set<T> duplicatedElementsOf(List<T> input) {\n int count = input.size();\n if (count < 2) {\n return ImmutableSet.of();\n }\n Set<T> duplicates = null;\n Set<T> elementSet = CompactHashSet.createWithExpectedSize(count);\n for (T el : input) {\n if (!elementSet.add(el)) {\n if (duplicates == null) {\n duplicates = new HashSet<>();\n }\n duplicates.add(el);\n }\n }\n return duplicates == null ? ImmutableSet.of() : duplicates;\n }", "public ArrayList<Person> builtinSortDeduplication(){\n\t//copy data from list to array arr\n\tPerson[] arr = new Person[this.lst.size()];\n\tfor(int i=0; i< lst.size();i++){\n\t arr[i] = this.lst.get(i);\n\t}\n\t// use java's built-in sort\n\tArrays.sort(arr);\n\t//create list to store singular data\n\tArrayList<Person> unduplicated3 = new ArrayList<>();\n\t//compare successive elements of array to find duplicates\n\tint limit =0;\n\tif (arr.length ==0 || arr.length==1) limit =arr.length;\n\tint j=0;\n\t//store only singular data in the beginning of the array\n\tfor (int i = 0; i < arr.length-1; i++) \n if (arr[i].compareTo( arr[i+1]) != 0) \n arr[j++] = arr[i]; \n\t// add last element to array\n\tarr[j++] = arr[arr.length-1];\n\t//record last index of singular element\n\tlimit =j;\n\t//copy elements up to the singularity index to the list\n\tfor(int k=0; k< limit; k++){\n\t unduplicated3.add(arr[k]);\n\t}\n\treturn unduplicated3;\n }", "public int removeDuplicates(int[] nums) {\n if (nums.length == 0) {\n return 0;\n }\n int j = 0;\n for (int i = 1; i < nums.length; i++) {\n if (nums[i] != nums[j]) {\n j++;\n nums[j] = nums[i];\n }\n }\n return j + 1;\n }", "static void findDuplicate()\n\t{\n\n\t\tList<String> oList = null;\n\t\tSet<String> oSet = null;\n\t\ttry {\n\t\t\toList = new ArrayList<String>();\n\t\t\toList.add(\"Apple\");\n\t\t\toList.add(\"Boy\");\n\t\t\toList.add(\"Frog\");\n\t\t\toList.add(\"Dog\");\n\t\t\toList.add(\"Eagle\");\n\t\t\toList.add(\"Frog\");\n\t\t\toList.add(\"Apple\");\n\t\t\toList.add(\"Boy\");\n\t\t\toList.add(\"Apple\");\n\t\t\toList.add(\"Boy\");\n\t\t\tSystem.out.println(oList);\n\t\t\t\n\t\t\toSet = new TreeSet<>();\n\t\t\t\n\t\t\tString s = \"\";\n\t\t\tfor(int i=0;i<oList.size();i++)\n\t\t\t{\n\t\t\t\tif((oSet.add(oList.get(i))==false) && (!s.contains(oList.get(i))))\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Duplicate: \"+oList.get(i));\n\t\t\t\t\ts+=oList.get(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}catch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\toList = null;\n\t\t\toSet = null;\n\t\t}\n\t}", "public static void main(String [] args)\n {\n \n //creates a linkedlist using a constructor that takes arguments\n TLinkedList list = new TLinkedList(4);\n //additonal nodes added\n // values do not have to be in order\n list.addNode(11);\n list.addNode(26);\n list.addNode(3);\n list.addNode(1);\n list.addNode(5);\n list.addNode(8);\n list.addNode(3);\n list.addNode(6);\n list.addNode(3);\n //prints linked list after initial nodes added\n System.out.print(\"Initial LinkedList: \" );\n list.printList();\n //deletes node at middle\n list.delNode(3);\n System.out.print(\"LinkedList after first deletion: \" );\n list.printList();\n //deletes node at start\n list.delNode(4);\n System.out.print(\"LinkedList after second deletion: \" );\n list.printList();\n //delets node at end\n list.delNode(6);\n //prints list after deletions\n System.out.print(\"LinkedList after third deletion: \" );\n list.printList();\n // searchs for values which are not in the linked list\n list.delNode(10);\n list.delNode(-2);\n // the remaining values in the linkedlist are reverse \n TLinkedList re = list.reverse();\n System.out.print(\"LinkedList before reversal: \");\n re.printList();\n System.out.print(\"LinkedList after reversal: \");\n list.printList();\n // deletes repeated values\n re.delRepeated(3);\n System.out.print(\" LinkedList after removing repeated values: \" );\n list.printList();\n \n // add a method to remove all repeating\n \n \n \n }", "public int removeDuplicates(int[] nums){\n if(nums.length <=1) return 1; \n \n\t\tint j =0;\n\t\tfor(int i =1; i < nums.length; i++){\n\t\t\tif(nums[i] !=nums[j]){\n\t\t\t\tj++;\n\t\t\t\tnums[j] = nums[i];\n\t\t\t}\n\t\t}\n\t\treturn j+1;\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tRemoveDuplicates r=new RemoveDuplicates();\r\n\t\tNode4 n1=new Node4(3);\r\n\t\tn1.next=null;\r\n\t\t//n1.next.next=new Node4(7);\r\n\t//\tn1.next.next.next=new Node4(6);\r\n\t\t//n1.next.next.next.next=new Node4(7);\r\n\t n1=r.removingDuplicates(n1);\r\n\twhile(n1!=null)\r\n\t\t{\tSystem.out.print(n1.val+\"->\");\r\n\t\t\tn1=n1.next;}\r\n\t\r\n\t\t\r\n\t}", "public static void deleteAlternateNodes(Node<Integer> head) {\n int size=0;\n Node temp=head;\n while(head!=null && head.next!=null )\n {\n if(size%2!=0)\n {\n Node t=head.next;\n head.next=t.next;\n head=t.next;\n }\n size++;\n }\n }", "public static <T> ArrayList<T> removeDuplicates(ArrayList<T> list)\n {\n ArrayList<T> newList = new ArrayList<T>();\n\n // Traverse through the first list\n for (T element : list) {\n\n // If this element is not present in newList\n // then add it\n if (!newList.contains(element)) {\n\n newList.add(element);\n }\n }\n\n // return the new list\n return newList;\n }", "public static <T> ArrayList<T> removeDuplicates(ArrayList<T> list)\n {\n ArrayList<T> newList = new ArrayList<T>();\n\n // Traverse through the first list\n for (T element : list) {\n\n // If this element is not present in newList\n // then add it\n if (!newList.contains(element)) {\n\n newList.add(element);\n }\n }\n\n // return the new list\n return newList;\n }", "public static <T> ArrayList<T> removeDuplicates(ArrayList<T> list)\n {\n\n // Create a new ArrayList\n ArrayList<T> newList = new ArrayList<T>();\n\n // Traverse through the first list\n for (T element : list) {\n\n // If this element is not present in newList\n // then add it\n if (!newList.contains(element)) {\n\n newList.add(element);\n }\n }\n\n // return the new list\n return newList;\n }", "public void testFindDuplicates() {\r\n System.out.println(\"findDuplicates\");\r\n \r\n List<String> elements = new ArrayList<>();\r\n elements.add(\"foo\");\r\n elements.add(\"bar\");\r\n elements.add(\"abc\");\r\n elements.add(\"foo\");\r\n elements.add(\"cde\");\r\n elements.add(\"cde\");\r\n elements.add(\"efg\");\r\n elements.add(\"cde\");\r\n \r\n Set<String> expResult = new LinkedHashSet<>();\r\n expResult.add(\"foo\");\r\n \r\n LexicalChecker instance = new LexicalChecker();\r\n Set<String> result = instance.findDuplicates(elements);\r\n \r\n assertNotSame(expResult, result);\r\n \r\n expResult.add(\"cde\");\r\n assertEquals(expResult, result);\r\n }", "@Test\n public void testRemoveDuplicates() {\n System.out.println(\"removeDuplicates\");\n ArrayList<String> array = new ArrayList<>(Arrays.asList(\n \"A.example.COM,1.1.1.1,NO,11,Faulty fans\",\n \"b.example.com,1.1.1.2,no,13,Behind the other routers so no one sees it\",\n \"C.EXAMPLE.COM,1.1.1.3,no,12.1,\",\n \"d.example.com,1.1.1.4,yes,14,\",\n \"c.example.com,1.1.1.5,no,12,Case a bit loose\",\n \"e.example.com,1.1.1.6,no,12.3,\",\n \"f.example.com,1.1.1.7,No,12.200,\",\n \"g.example.com,1.1.1.6,no,15.0,Guarded by sharks with lasers on their heads\"\n ));\n ArrayList<String> expResult = new ArrayList<>(Arrays.asList(\n \"A.example.COM,1.1.1.1,NO,11,Faulty fans\",\n \"b.example.com,1.1.1.2,no,13,Behind the other routers so no one sees it\",\n \"d.example.com,1.1.1.4,yes,14,\",\n \"f.example.com,1.1.1.7,No,12.200,\"\n ));\n ArrayList<String> result = BTRouterPatch.removeDuplicates(array);\n assertEquals(expResult, result);\n }", "public int removeDuplicates(int[] nums) {\n int integer=0;\n for (int i=0; i<nums.length; i++){\n if (nums[i]!=nums[integer]){\n integer++;\n nums[integer]=nums[i];\n }\n }\n return integer+1;\n }", "public static <T> List<T> eliminateDuplicates(final List<T> list) {\n return list.stream().distinct().collect(Collectors.toList());\n }", "public static void main(String args[]){\n MyLinkedList<Integer> mine = new MyLinkedList<Integer>();\n boolean success;\n\n // Insert 10 ints at the beginning (twice)\n for (int i=0; i< 10; i++){\n mine.insert(i);\n mine.insert(i);\n }\n\n System.out.println(\"Test: deleting first occurrence of a value\");\n //Print the whole list\n mine.print();\n\n System.out.print(\"Deleting 9: \");\n success = mine.deleteFirstOccurrence(9);\n if (success){\n System.out.println(\"First occurence deleted\");\n }else{\n System.out.println(\"Element with that info not found\");\n }\n mine.print();\n\n System.out.print(\"Deleting 9: \");\n success = mine.deleteFirstOccurrence(9);\n if (success){\n System.out.println(\"First occurence deleted\");\n }else{\n System.out.println(\"Element with that info not found\");\n }\n mine.print();\n\n System.out.print(\"Deleting 9: \");\n success = mine.deleteFirstOccurrence(9);\n if (success){\n System.out.println(\"First occurence deleted\");\n }else{\n System.out.println(\"Element with that info not found\");\n }\n mine.print();\n\n System.out.print(\"Deleting 5: \");\n success = mine.deleteFirstOccurrence(5);\n if (success){\n System.out.println(\"First occurence deleted\");\n }else{\n System.out.println(\"Element with that info not found\");\n }\n mine.print();\n\n System.out.print(\"Deleting 5: \");\n success = mine.deleteFirstOccurrence(5);\n if (success){\n System.out.println(\"First occurence deleted\");\n }else{\n System.out.println(\"Element with that info not found\");\n }\n mine.print();\n\n System.out.print(\"Deleting 5: \");\n success = mine.deleteFirstOccurrence(5);\n if (success){\n System.out.println(\"First occurence deleted\");\n }else{\n System.out.println(\"Element with that info not found\");\n }\n mine.print();\n\n System.out.print(\"Deleting 0: \");\n success = mine.deleteFirstOccurrence(0);\n if (success){\n System.out.println(\"First occurence deleted\");\n }else{\n System.out.println(\"Element with that info not found\");\n }\n mine.print();\n\n System.out.print(\"Deleting 0: \");\n success = mine.deleteFirstOccurrence(0);\n if (success){\n System.out.println(\"First occurence deleted\");\n }else{\n System.out.println(\"Element with that info not found\");\n }\n mine.print();\n\n System.out.print(\"Deleting 0: \");\n success = mine.deleteFirstOccurrence(0);\n if (success){\n System.out.println(\"First occurence deleted\");\n }else{\n System.out.println(\"Element with that info not found\");\n }\n mine.print();\n\n\n mine = new MyLinkedList<Integer>();\n int numberdeleted;\n\n // Insert 10 ints at the beginning (twice)\n for (int i=0; i< 10; i++){\n mine.insert(i);\n mine.insert(i);\n }\n System.out.println(\"Test: deleting of all the occurrences of a value\");\n //Print the whole list\n mine.print();\n\n System.out.print(\"Deleting 9: \");\n numberdeleted = mine.deleteAll(9);\n System.out.println(numberdeleted + \" deleted nodes\");\n mine.print();\n System.out.print(\"Deleting 0: \");\n numberdeleted = mine.deleteAll(0);\n System.out.println(numberdeleted + \" deleted nodes\");\n mine.print();\n System.out.print(\"Deleting 5: \");\n numberdeleted = mine.deleteAll(5);\n System.out.println(numberdeleted + \" deleted nodes\");\n mine.print();\n System.out.print(\"Deleting 100: \");\n numberdeleted = mine.deleteAll(100);\n System.out.println(numberdeleted + \" deleted nodes\");\n mine.print();\n }", "private static ListNode removeElements(ListNode head, int val) {\n ListNode dummy = new ListNode(0);\n dummy.next = head;\n ListNode curr = dummy;\n // Iterate till current.next is null. Keep checking next with value\n while (curr.next != null) {\n // next element is a match so skip pointing to next element.\n if (curr.next.value == val) {\n curr.next = curr.next.next;\n } else {\n curr = curr.next; // else keep moving ahead.\n }\n }\n return dummy.next; \n }", "public int removeDuplicatesMethod1(int[] nums) {\n \tif(nums == null) {\n \t\treturn 0;\n \t}\n int len = nums.length;\n if(len == 0) {\n \treturn 0;\n }\n int endOfNewArray = 0;\n int cnt = 1;\n int temp = nums[0];\n for(int i = 1; i < len; i++) {\n \tif(nums[i] == temp) {\n \t\tif(cnt < 2) {\n \t\t\tcnt++;\n \t\t\tnums[++endOfNewArray] = nums[i];\n \t\t}\n \t}else {\n \t\tcnt = 1;\n \t\tnums[++endOfNewArray] = nums[i];\n \t\ttemp = nums[i];\n \t}\n }\n return ++endOfNewArray;\n }", "public static void main(String[] args) {\n\t\tListNode head = new ListNode(1);\n\t\tListNode nodeA = new ListNode(2);\n\t\tListNode nodeB = new ListNode(2);\n\t\tListNode nodeC = new ListNode(3);\n\t\t\n\t\thead.next = nodeA;\n\t\tnodeA.next = nodeB;\n\t\tnodeB.next = nodeC;\n\t\t\n\t\tDeleteDuplicates instance = new DeleteDuplicates();\n\t\thead = instance.solution(head);\n\t\twhile(head != null)\n\t\t{\n\t\t\tSystem.out.println(head.val);\n\t\t\thead = head.next;\n\t\t}\n\t}", "public static void removeDuplicates(int[] a)\r\n\t\t{\r\n\t\t\tLinkedHashSet<Integer> set\r\n\t\t\t\t= new LinkedHashSet<Integer>();\r\n\r\n\t\t\t// adding elements to LinkedHashSet\r\n\t\t\tfor (int i = 0; i < a.length; i++)\r\n\t\t\t\tset.add(a[i]);\r\n\r\n\t\t\t// Print the elements of LinkedHashSet\r\n\t\t\tSystem.out.print(set);\r\n\t\t}", "private static Node deleteFirst(Node head) {\n if (head == null) {\n return null;\n }\n Node current = head;\n\n // only one element\n if (current.next == head) {\n head.next = null; // or head = null is fine for GC\n return null;\n }\n\n while(current.next != head) {\n current = current.next;\n }\n // removing head from list\n current.next = head.next;\n // prevent memory leak\n head.next = null;\n head = current.next;\n return head;\n }", "public static void main(String[] args) {\n Set<Integer> S1 = new TreeSet<>();\r\n // add objects\r\n S1.add(65); S1.add(36); S1.add(24); S1.add(36);\r\n \r\n // show the content and assert they are sorted and no duplications\r\n System.out.println(\"set = \" + S1); \r\n //remove elements\r\n S1.remove(36); S1.remove(24);\r\n System.out.println(S1); //assert set = 65\r\n S1.add(15); S1.add(24); S1.add(80); // add 15, 24, 80\r\n System.out.println(\"set = \" +S1); //assert set = 15, 24, 65, 80\r\n \r\n System.out.println(\"Does S1 contain 10?\"\r\n + S1.contains(10)); // assert false\r\n System.out.println(\"S1 has \" + S1.size() +\" objects\"); // assert 4\r\n\r\n // create another Set object implemented using HashSet\r\n Set<Integer> S2 = new HashSet<>();\r\n // add all objects in S1 to S2\r\n S2.addAll(S1);\r\n System.out.println(\"hashset = \" +S2); //assert they may not be ordered\r\n\r\n // create another Set object implemented using LinkedHashSet\r\n Set<Integer> S3 = new LinkedHashSet<>();\r\n S3.add(150); // add 150\r\n S3.addAll(S1);// add all objects in S1 to S2\r\n System.out.println(\"LinkedHashSet = \" +S3);//assert s3=[150,15,24,65,80]\r\n \r\n S3.removeAll(S3); // remove all items\r\n System.out.println(\"LinkedHashSet = \" +S3);//assert s3=[]\r\n }", "public static Node copyRandomList2(Node head) {\n\n\t\t//setting up duplicate nodes in between\n\t\tif (head == null) return head;\n\t\tNode curr = head;\n\t\twhile (curr != null) {\n\t\t\tNode node = new Node(curr.val);\n\t\t\tNode next = curr.next;\n\t\t\tcurr.next = node;\n\t\t\tnode.next = next;\n\t\t\tcurr = next;\n\t\t}\n\n\t\t//setting up random for duplicates\n\t\tNode p = head;\n\t\twhile (p != null) {\n\t\t\tcurr = p.next;\n\t\t\tcurr.random = p.random == null ? null : p.random.next;\n\t\t\tp = curr.next;\n\t\t}\n\n\t\t//removing the duplicate list of nodes from the modified\n\t\tNode res = new Node(-1), prev = res;\n\t\tp = head;\n\t\twhile (p != null) {\n\t\t\tcurr = p.next;\n\t\t\tprev.next = curr;\n\t\t\tprev = curr;\n\t\t\tp.next = p.next.next;\n\t\t\tp = p.next;\n\t\t}\n\t\treturn res.next;\n\t}", "public static void main(String[] args) {\n\t\tNode n = new Node(0);\r\n\t\tNode dummy = n;\r\n\t\tn.next = new Node(1);\r\n\t\tn = n.next;\r\n\t\tn.next = new Node(1);\r\n\t\tn = n.next;\r\n\t\tfor (int i = 1; i < 10; i ++) {\r\n\t\t\tn.next = new Node(i);\r\n\t\t\tn = n.next;\r\n\t\t}\r\n\t\tremoveDuplicate(dummy);\r\n\t\twhile(dummy != null) {\r\n\t\t\tSystem.out.println(dummy.val);\r\n\t\t\tdummy = dummy.next;\r\n\t\t}\r\n\t\t\r\n\t}", "public void removeDuplicates(ArrayList<Edge> edges) {\n\t\tfor (int i = 0; i < edges.size(); i++) {\r\n\t\t\tfor (int j = i + 1; j < edges.size(); j++) {\r\n\t\t\t\tString v11 = edges.get(i).vertex1;\r\n\t\t\t\tString v12 = edges.get(i).vertex2;\r\n\t\t\t\tString v21 = edges.get(j).vertex1;\r\n\t\t\t\tString v22 = edges.get(j).vertex2;\r\n\t\t\t\tif ((v11.equals(v21) && v12.equals(v22)) || (v11.equals(v22) && v12.equals(v21))) {\r\n\t\t\t\t\tedges.remove(j);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public int removeDuplicatesMethod2(int[] nums) {\n \tint len = 0;\n \tfor(int num : nums) {\n \t\tif(len < 2 || num > nums[len - 2]) {\n \t\t\tnums[len++] = num;\n \t\t}\n \t}\n \treturn len;\n }", "public static void main(String[] args) throws IOException {\n File file = new File(\"E:\\\\MyOwnProject\\\\data\\\\test.txt\");\n Scanner scanner = new Scanner(file);\n \t\n// \tint[] values = {1,2,2,3,4,5,5,5,6,7,7,7,8,9,9,9,9,10};\n// \tSinglyLinkedList llist = new SinglyLinkedList();\n// for (int val:values){\n// llist.insertNode(val);\n// }\n// SinglyLinkedListNode result = removeDuplicates(llist.head);\n// printSinglyLinkedList(result);\n //BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv(\"OUTPUT_PATH\")));\n\n// int tests = scanner.nextInt();\n// scanner.skip(\"(\\r\\n|[\\n\\r\\u2028\\u2029\\u0085])?\");\n//\n// for (int testsItr = 0; testsItr < tests; testsItr++) {\n// int index = scanner.nextInt();\n// scanner.skip(\"(\\r\\n|[\\n\\r\\u2028\\u2029\\u0085])?\");\n//\n// SinglyLinkedList llist1 = new SinglyLinkedList();\n//\n// int llist1Count = scanner.nextInt();\n// scanner.skip(\"(\\r\\n|[\\n\\r\\u2028\\u2029\\u0085])?\");\n//\n// for (int i = 0; i < llist1Count; i++) {\n// int llist1Item = scanner.nextInt();\n// scanner.skip(\"(\\r\\n|[\\n\\r\\u2028\\u2029\\u0085])?\");\n//\n// llist1.insertNode(llist1Item);\n// }\n// \n// \tSinglyLinkedList llist2 = new SinglyLinkedList();\n//\n// int llist2Count = scanner.nextInt();\n// scanner.skip(\"(\\r\\n|[\\n\\r\\u2028\\u2029\\u0085])?\");\n//\n// for (int i = 0; i < llist2Count; i++) {\n// int llist2Item = scanner.nextInt();\n// scanner.skip(\"(\\r\\n|[\\n\\r\\u2028\\u2029\\u0085])?\");\n//\n// llist2.insertNode(llist2Item);\n// }\n// \n// \tSinglyLinkedListNode ptr1 = llist1.head;\n// SinglyLinkedListNode ptr2 = llist2.head;\n//\n// for (int i = 0; i < llist1Count; i++) {\n// if (i < index) {\n// ptr1 = ptr1.next;\n// }\n// }\n//\n// for (int i = 0; i < llist2Count; i++) {\n// if (i != llist2Count-1) {\n// ptr2 = ptr2.next;\n// }\n// }\n//\n// ptr2.next = ptr1;\n//// printSinglyLinkedList(llist1.head);\n//// printSinglyLinkedList(llist2.head);\n// int result = findMergeNode(llist1.head, llist2.head);\n// System.out.println(String.valueOf(result));\n// }\n// scanner.close();\n// int[] arr = {3,-7,0};\n// System.out.println(minimumAbsoluteDifference(arr));\n// int money = 5;\n// int[] cost = {2, 1, 3, 5, 6};\n// whatFlavors(cost,money);\n// List<List<Integer>> queries = new ArrayList<>();\n// List<Integer> query = new ArrayList<>();\n// query.add(1);query.add(3);\n// queries.add(query);\n// query = new ArrayList<>();\n// query.add(2);query.add(3);\n// queries.add(query);\n// query = new ArrayList<>();\n// query.add(3);query.add(2);\n// queries.add(query);\n// query = new ArrayList<>();\n// query.add(1);query.add(4);\n// queries.add(query); \n// query = new ArrayList<>();\n// query.add(1);query.add(5);\n// queries.add(query); \n// query = new ArrayList<>();\n// query.add(1);query.add(5);\n// queries.add(query);\n// query = new ArrayList<>();\n// query.add(1);query.add(4);\n// queries.add(query);\n// query = new ArrayList<>();\n// query.add(3);query.add(2);\n// queries.add(query);\n// query = new ArrayList<>();\n// query.add(2);query.add(4);\n// queries.add(query);\n// query = new ArrayList<>();\n// query.add(3);query.add(2);\n// queries.add(query);\n// int[][] queries = {{1, 5},{1, 6},{3, 2},{1, 10},{1, 10},{1, 6},{2, 5},{3, 2}};\n// List<Integer> res = freqQuery(queries);\n// for(Integer i:res){\n// \t System.out.println(i);\n// }\n String s1 = \"OUDFRMYMAW\";\n String s2 = \"AWHYFCCMQX\";\n System.out.println(commonChild(s1,s2));\n \n \n }", "public static List<Integer> findDuplicates(List<Integer> numbers) {\n Integer[] cloneArray = new Integer[numbers.size()];\n Integer[] repeatNums = new Integer[numbers.size()-1];\n\n\n for (int i = 0; i < numbers.size(); i++){\n cloneArray[i] = numbers.get(i);\n }\n\n //I checked the big notation of this method is O(log(n) )\n // source https://docs.oracle.com/javase/7/docs/api/java/util/Arrays.html#sort(int[])\n Arrays.sort(cloneArray);\n\n for (int i = 0; i < cloneArray.length -1 ; i++) {\n if (cloneArray[i] == cloneArray[i+1]){\n repeatNums[i] = Integer.valueOf(cloneArray[i]);\n }\n }\n\n\n for (int i = 1; i < repeatNums.length; i++){\n if (repeatNums[i-1] == null){\n repeatNums[i-1] = repeatNums[i];\n repeatNums[i] = null;\n }\n }\n\n //Removing any nulls.\n Integer[] outArray = Arrays.stream(repeatNums).filter(Objects::nonNull).toArray(Integer[]::new);\n\n List<Integer> duplicateList = Arrays.asList(outArray);\n\n return duplicateList;\n }", "public ListNode removeElements(ListNode head, int val) {\n ListNode dummyNode = new ListNode(-1);\n dummyNode.next = head;\n ListNode pre = dummyNode;\n ListNode cur = pre.next;\n while(cur != null){\n if(cur.val == val){\n cur = cur.next;\n pre.next = cur;\n }else{\n pre = pre.next;\n cur = cur.next;\n }\n }\n return dummyNode.next;\n }", "public ListNode removeElements(ListNode head, int val) {\n ListNode fakeHead = new ListNode(0);\n fakeHead.next = head;\n head = fakeHead;\n while (head != null && head.next != null)\n {\n if (head.next.val == val)\n head.next = head.next.next;\n else {\n head = head.next;\n }\n }\n return fakeHead.next;\n }", "public static ListNode removeElements1(ListNode head, int val) {\n if (head == null) {\n return null;\n }\n\n head.next = removeElements1(head.next, val);\n\n return head.val == val ? head.next : head;\n }", "static List<String> removeDuplicates(List<String> list) {\n // Store unique items in result.\n List<String> result = new ArrayList<String>();\n // Loop over argument list.\n for (String token : list) {\n if (result.indexOf(token) == -1) { \n result.add(token);\n }\n }\n return result;\n }", "public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tList<Integer> nums = new ArrayList<>();\r\n\t\t\r\n\t\tnums.add(10);nums.add(10);nums.add(10);nums.add(8);\r\n\t\tnums.add(11);nums.add(10);nums.add(10);nums.add(10);\r\n\r\n\t\tSystem.out.println(nums);\r\n\t\t\r\n\t\tList<Integer> unique1 = new ArrayList<>(); \r\n\t\t\r\n\t\t\r\n\t\t // find unique NON DUPLICATE VALUES\r\n\t\tfor(Integer num: nums) {\r\n\t\t\tif(!unique1.contains(num)) { // if unique1 doesn't contains num add it\r\n\t\t\t\tunique1.add(num); //<<<<<======= adding to unique1 num one by one\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(unique1.toString());\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t \r\n\t\t\r\n\t\tList<Integer> unique2 = new ArrayList<>();\r\n\t\t\r\n\t\tfor(int i =0; i<nums.size(); i++) { // find unique ( appearence once)\r\n\t\t\tint count=0;\r\n\t\t\t\r\n\t\t\tInteger value = nums.get(i);\r\n\t\t\tfor(int k =0; k<nums.size(); k++) {\r\n\t\t\t\tif(nums.get(k)== value && i != k) {\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(count == 0) {\r\n\t\t\t\tunique2.add(value);\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(unique2);\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tArrayList<Integer> al=new ArrayList<>();\n\t\tal.add(34);\n\t\tal.add(64);\n\t\tal.add(13);\n\t\tal.add(34);\n\t\tal.add(98);\n\t\tal.add(78);\n\t\tSystem.out.println(al.size());\n\t\tSet<Integer> s=new LinkedHashSet<Integer>(al);\n\t\tSystem.out.println(s);\n\t\tCollections.sort(al);\n\t\tSystem.out.println(al);\n\t}", "public static void deleteAllOddPositionNodes(Node head) {\n int len = length(head);\n if (len < 2) {\n return;\n }\n Node current = head;\n do {\n Node toBeDeleted = current.next;\n // Note: current.next.next can not be null in circular list.\n current.next = current.next.next;\n toBeDeleted.next = null;\n current = current.next;\n } while(current != head && current.next != head);\n }" ]
[ "0.751588", "0.7481238", "0.7467128", "0.7410982", "0.7397762", "0.7367075", "0.73567516", "0.7351947", "0.73442936", "0.7334643", "0.73185277", "0.73062575", "0.7235143", "0.7176971", "0.71644974", "0.7161466", "0.71380013", "0.71311283", "0.70554435", "0.70527494", "0.7016813", "0.6917401", "0.68474066", "0.68472016", "0.68322086", "0.6818394", "0.679519", "0.6782482", "0.6763273", "0.67537993", "0.6741128", "0.6708648", "0.6608858", "0.6608182", "0.6594052", "0.6590484", "0.6579395", "0.65352124", "0.6488485", "0.6479568", "0.6445149", "0.63797283", "0.63649315", "0.6330969", "0.6295031", "0.6272628", "0.6235505", "0.6225445", "0.6180619", "0.61510956", "0.6086693", "0.6051854", "0.6021921", "0.5986468", "0.5904309", "0.58986783", "0.589832", "0.5890385", "0.586209", "0.5849553", "0.5848436", "0.5832033", "0.5755898", "0.5748894", "0.57382846", "0.568318", "0.5644764", "0.5641867", "0.56328005", "0.56294084", "0.5609461", "0.5606716", "0.55840445", "0.556984", "0.556984", "0.55663466", "0.5538277", "0.55006236", "0.5495324", "0.54720366", "0.5468518", "0.546685", "0.5465148", "0.5462087", "0.544482", "0.5440509", "0.5414244", "0.5391305", "0.5386513", "0.53836936", "0.5380149", "0.53793705", "0.5369495", "0.5346441", "0.53457475", "0.53434867", "0.5332519", "0.5329248", "0.5308139", "0.5306819" ]
0.72853786
12
Gets the CardVisual by goalValue
public static CardVisual getByGoalValue(final String goalValue) { final CardVisual cardVisual = MAP_BY_GOAL_VALUE.get(goalValue); if (cardVisual == null) { return UNKNOWN; } return cardVisual; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String GetHumanCard(int value){\n return handHuman.get(value);\n }", "public static VisualizationType get(int value) {\n\t\tswitch (value) {\n\t\t\tcase HISTOGRAM_VALUE: return HISTOGRAM;\n\t\t\tcase SCATTERPLOT_VALUE: return SCATTERPLOT;\n\t\t}\n\t\treturn null;\n\t}", "public String GetComputerCard(int value){\n return handComputer.get(value);\n }", "public String GetDeckCard(int value){\n return deck.get(value);\n }", "Object getValue(VisualPropertyType calcType);", "public Card showCard()\r\n {\r\n return pile.peek();\r\n }", "public ImageIcon getTopCardImage() {\r\n return new ImageIcon(validColor + \"_\" + validValue + \".png\");\r\n }", "public static RepresentacionGrafica get(int value) {\n\t\tswitch (value) {\n\t\tcase TEXT_VALUE:\n\t\t\treturn TEXT;\n\t\tcase COMBO_VALUE:\n\t\t\treturn COMBO;\n\t\tcase RADIO_VALUE:\n\t\t\treturn RADIO;\n\t\tcase CHECKBOX_VALUE:\n\t\t\treturn CHECKBOX;\n\t\tcase DATE_VALUE:\n\t\t\treturn DATE;\n\t\t}\n\t\treturn null;\n\t}", "public VisObject getVis();", "private JComboBox getCardValue() {\n\t\tif (cardValue == null) {\n\t\t\tcardValue = new JComboBox();\n\t\t\tcardValue.setModel(new TypeModel(TypeModel.valueType_cards));\n\t\t\tcardValue.setSelectedIndex(5);\n\t\t}\n\t\treturn cardValue;\n\t}", "int compareValue(Card c);", "int getAssetValue();", "public void displayValueComparison()\n {\n System.out.println(\"Player card value \" + Card.valueOfCard(playerCard));\n System.out.println(\"Computer card value \" + Card.valueOfCard(computerCard));\n }", "public UnoCard getCardByName(String cardName){\n Drawable color_change_plus4 = this.appContext.getResources().getDrawable(R.drawable.color_change_plus4);\n Drawable card_back = this.appContext.getResources().getDrawable(R.drawable.card_back);\n UnoCard card = new UnoCard(this.appContext, deckPos, new Point(20, 20), color_change_plus4, card_back, \"Color Change Plus 4\", \"\", \"COLOR CHANGE PLUS 4\", \"COLOR CHANGE PLUS 4\");\n for (UnoCard c : this.cards){\n if (c.getName().equals(cardName)){\n card = c;\n break;\n }\n }\n return card;\n }", "public TopoDS_Face Value() {\n TopoDS_Face ret = new TopoDS_Face(OCCwrapJavaJNI.StepToTopoDS_TranslateCurveBoundedSurface_Value(swigCPtr, this), true);\n return ret;\n }", "public static VisualAlpha get(Visualization vis) {\n return (VisualAlpha)findNamed(VISUAL, vis);\n }", "public org.omg.uml.behavioralelements.commonbehavior.Instance getValue();", "public Card.Face getHighestCard(){\n return uniqueFaces.getFirst();\n }", "public Card getCard(int i) {\n\t\treturn cards.get(i);\n\t}", "String getColour(int winningNumber);", "public Card getWinningCard() {\n return winningCard;\n }", "public Card getCard(int idx) {\n return deck[idx];\n }", "public static VisualizationType getByName(String name) {\n\t\tfor (int i = 0; i < VALUES_ARRAY.length; ++i) {\n\t\t\tVisualizationType result = VALUES_ARRAY[i];\n\t\t\tif (result.getName().equals(name)) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private Tile getTileByValue(int value) {\n\t\tfor (int i = 0; i < gameSize; i++)\n\t\t\tfor (int j = 0; j < gameSize; j++)\n\t\t\t\tif (gameTiles.getTile(i, j).getValue() == value)\n\t\t\t\t\treturn gameTiles.getTile(i, j);\n\n\t\treturn null;\n\t}", "public Card getCard(int idx) {\r\n\t\tif (idx < 0 || idx >= cards.size()) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn cards.get(idx);\r\n\t}", "private int getGoalValue(Proposition goalProposition) {\r\n \tGdlRelation relation = (GdlRelation) goalProposition.getName();\r\n GdlConstant constant = (GdlConstant) relation.get(1);\r\n return Integer.parseInt(constant.toString());\r\n }", "public static RepresentacionGrafica getByName(String name) {\n\t\tfor (int i = 0; i < VALUES_ARRAY.length; ++i) {\n\t\t\tRepresentacionGrafica result = VALUES_ARRAY[i];\n\t\t\tif (result.getName().equals(name)) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public String get_card(int index){\r\n return String.valueOf(hand.get(index).get_value()) + hand.get(index).get_suit() + \".jpg\";\r\n }", "public Card inspectCard(int k) {\n if (k >= this.numCards || k < 0)\n return new Card('0', Card.Suit.spades);\n else\n return new Card(this.myCards[k]);\n }", "public Card getCard(){\n return cards.get(0);\n }", "public V getCValue();", "com.google.wireless.android.sdk.stats.FilterMetadata.View getActiveView();", "int getDisplayValue();", "public Image getCardPlayer1() {\n Random rand = new Random();\r\n randomNum = rand.nextInt((52 - 1) + 1) + 1;\r\n Image p1 = new Image(\"/Images/cards/Card\" + randomNum + \".png\");\r\n return p1;\r\n }", "@Test\n\tpublic void getDisplayValueShouldReturnNullWhenValueIsNull(){\n\t\tVitalsResult l = new VitalsResult();\n\t\tassertNull(l.getDisplayValue());\n\t}", "public Card getCardAtIndex(int i)\n {\n return cards.get(i);\n }", "public AbsBuilderLevelPanel getCurrentLevelPanel()\n\t{\n\t\tAbsBuilderLevelPanel card = null;\n\n\t\t//find the component that is set to visible (will be a JPanel\n\t\tfor (Component comp : pnlLevelSwitch.getComponents() ) {\n\t\t\tif (comp.isVisible() == true) {\n\t\t\t\tcard = (AbsBuilderLevelPanel)comp;\n\t\t\t}\n\t\t}\n\n\t\treturn card;\n\t}", "@Override\n public Card getCard(int i) {\n return this.cards.get(i);\n }", "public abstract Object getDecisionValue();", "public Card getCard(int index)\n\t{\n\t\treturn hand[index];\n\t}", "public static RefinementPhases get(int value) {\n\t\tswitch (value) {\n\t\t\tcase CHOREOGRAPHY_MODELING_VALUE: return CHOREOGRAPHY_MODELING;\n\t\t\tcase WORKFLOW_MODELING_VALUE: return WORKFLOW_MODELING;\n\t\t\tcase PROVISION_VALUE: return PROVISION;\n\t\t\tcase EXECUTION_VALUE: return EXECUTION;\n\t\t}\n\t\treturn null;\n\t}", "public ArrayList<Drawable> getConstantDisplay(){return this.toDisplay;}", "public ImageFlowItem getSelectedValue()\r\n {\r\n if (getAvatars() == null || getAvatars().isEmpty() || getSelectedIndex() >= getAvatars().size() || getSelectedIndex() < 0)\r\n {\r\n return null;\r\n }\r\n\r\n return getAvatars().get(getSelectedIndex());\r\n }", "protected Visualizer getVis() {\n\t\treturn myVis;\n\t}", "public VisualProperty getVisualProperty() {\n \t\treturn vizProp;\n \t}", "public int getCardValue()\n {\n return cardValue; \n }", "public Card getCard(int index){\n return cards.get(index - 1);\n }", "public BoardView getActiveBoard() {\n if (activePlayer == Piece.COLOR.RED)\n return getRedBoard();\n else\n return getWhiteBoard();\n }", "public pb4client.ValueChange getVc(int index) {\n return vc_.get(index);\n }", "for (Card c : humanPlayerHand.getAllCards) {\n StackPane cardGrouping = new StackPane; // used to center the rectangle and text\n Rectangle card = new Rectangle(width, height); // where width and height are defined elsewhere\n card.setArcWidth(arcSize); // where arcSize is defined elsewhere\n card.setArcHeight(arcSize);\n card.setFill(c.getSuit); // color will be based on suit but implementation will differ slightly - different method will pull the colors matched to suits from data file\n cardGrouping.add(card);\n Text cardText = new Text();\n\n if (c.getValue < 10) {\n cardText.setText(c.getValue);\n }\n // also need cases for special cards\n cardGrouping.add(cardText);\n\n HBox.add(cardGrouping);\n }", "public static TypeDictionaryDicoDomaineProjetCimic get(int value) {\n\t\tswitch (value) {\n\t\t\tcase AGRI_VALUE: return AGRI;\n\t\t\tcase WATER_VALUE: return WATER;\n\t\t\tcase ECONM_VALUE: return ECONM;\n\t\t\tcase EDUCT_VALUE: return EDUCT;\n\t\t\tcase ELEC_VALUE: return ELEC;\n\t\t\tcase BRDG_VALUE: return BRDG;\n\t\t\tcase ROAD_VALUE: return ROAD;\n\t\t\tcase HEALTH_VALUE: return HEALTH;\n\t\t\tcase PUBL_VALUE: return PUBL;\n\t\t\tcase SPORTS_VALUE: return SPORTS;\n\t\t\tcase TRSPT_VALUE: return TRSPT;\n\t\t}\n\t\treturn null;\n\t}", "public Card getCardAt( int index ) {\n return this.cards[index];\n }", "public Visualization getVisualization() {\r\n return this.vis;\r\n }", "public Card getCard(int index)\n {\n if( index <0 || index >=52)\n return null;\n\n return cardAry[index];\n }", "public int topCardVal(){\n if(pile.size() == 0)\n return 0;\n int val = pile.get(pile.size() - 1).getVal();\n return val;\n }", "public Image getCardCroupier1() {\n Random rand2 = new Random();\r\n randomNum2 = rand2.nextInt((52 - 1) + 1) + 1;\r\n Image c1 = new Image(\"/Images/cards/Card\" + randomNum2 + \".png\");\r\n return c1;\r\n }", "int getCategoryValue();", "public Card getPresentCard() {\n return storageCards.peek();\n }", "public static TypeDictionaryDicoActionQualificatifActivite get(int value) {\n\t\tswitch (value) {\n\t\t\tcase UNIQUE_VALUE: return UNIQUE;\n\t\t\tcase MINIMAL_VALUE: return MINIMAL;\n\t\t\tcase MAXIMAL_VALUE: return MAXIMAL;\n\t\t\tcase POSSIBLE_VALUE: return POSSIBLE;\n\t\t}\n\t\treturn null;\n\t}", "public VDimension getBlueprint();", "Symbol getActiveCard();", "public Card viewTopCardInPlay(){\n if(cardsInPlayStack.isEmpty()) {\n return null;\n }\n return cardsInPlayStack.peek();\n }", "public PropertyCard findCheapest() {\r\n\t\t\r\n\t\t\r\n\t\tif(this.properties.size() == 0) {\r\n\t\t\t//System.out.println(\"returning null\");\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tPropertyCard lowestCard = this.properties.get(0).getLowest();\r\n\t\tint lowest = lowestCard.getValue();\r\n\t\t\r\n\t\tfor(CardStack c: this.properties) {\r\n\t\t\tif(c.getLowest().getValue() < lowest) {\r\n\t\t\t\tlowestCard = c.getLowest();\r\n\t\t\t\tlowest = c.getLowest().getValue();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn lowestCard;\r\n\t}", "public CardView getTopCardView() {\n return cards.get(cards.size() - 1);\n }", "protected CardUI getFirstCardUI() {\n\t\tif (this.cards.isEmpty()) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this.cards.keySet().iterator().next();\n\t}", "com.ctrip.ferriswheel.proto.v1.Display getDisplay();", "public static DistributionState get(int value) {\r\n switch(value) {\r\n case CALCULATING_VALUE:\r\n return CALCULATING;\r\n case DONE_VALUE:\r\n return DONE;\r\n }\r\n return null;\r\n }", "public Card getTopCard() {\r\n\t\tthis.sort();\r\n\t\treturn this.getCard(2); //Center card will always be part of quad after sorting, so has to be highest card\r\n\t}", "Card getCard(UUID cardId);", "public Card getClickedCardFromHand(int X, int Y){\n // Cek kartu apa yang di klik dari tangan player saat itu\n // Return null kalo gak ada kartu yang di klik\n // Caranya loop untuk setiap kartu di hand kalo Sprite.OverlapPoint\n for (Card kartu : this.currentPlayer.getPlayerHands()){\n if (kartu.getSprite().isPointOverlap(X, Y)){\n return kartu;\n }\n }\n return null;\n }", "public String getTurnoVisita() {\n return turnoVisita.get();\n }", "Quantity getComparisonValue();", "@Override\n public Player getPlayerFor(int cardValue, Set<Player> availablePlayers) {\n return getRandomPlayer(availablePlayers);\n }", "ICard getCard(int cardIndex) throws IllegalArgumentException;", "public static CoverageType get(int value) {\n\t\tswitch (value) {\n\t\t\tcase PATIENT_GENDER_VALUE: return PATIENT_GENDER;\n\t\t\tcase PATIENT_AGE_GROUP_VALUE: return PATIENT_AGE_GROUP;\n\t\t\tcase CLINICAL_FOCUS_VALUE: return CLINICAL_FOCUS;\n\t\t\tcase TARGET_USER_VALUE: return TARGET_USER;\n\t\t\tcase WORKFLOW_SETTING_VALUE: return WORKFLOW_SETTING;\n\t\t\tcase WORKFLOW_TASK_VALUE: return WORKFLOW_TASK;\n\t\t\tcase CLINICAL_VENUE_VALUE: return CLINICAL_VENUE;\n\t\t}\n\t\treturn null;\n\t}", "List<ChargeSummary> value();", "public Card getCardAtLocation(Point p)\n {\n if (cards.isEmpty())\n return null;\n \n if (isValidClick(p))\n {\n int index;\n int y = (int) p.getY();\n \n // top card is selected\n if (y > OFFSET_PIXELS * (cards.size() - 1))\n index = cards.size() - 1;\n else // card below top card selected\n index = y / OFFSET_PIXELS;\n \n if (isValidCard(index))\n return cards.get(index);\n }\n \n return null;\n }", "public Card getCard() {\n return this.card;\n }", "CompositeValueType getCompositeValue();", "public Card inspectCard(int k)\r\n {\r\n if (0 <= k && k < numCards && myCards[k] != null && \r\n myCards[k].getErrorFlag() == true)\r\n {\r\n return myCards[k];\r\n }\r\n return new Card('E', Card.Suit.valueOf(\"SPADES\"));\r\n }", "public Card inspectCard(int k) {\n //If k is invalid, return an invalid card.\n if (k >= this.topCard || k < 0)\n return new Card('0', Card.Suit.spades);\n else\n //Otherwise, return a copy of the card in position k.\n return new Card(this.cards[k]);\n }", "public Image getCardCroupier2() {\n Random rand3 = new Random();\r\n randomNum3 = rand3.nextInt((52 - 1) + 1) + 1;\r\n Image c2 = new Image(\"/Images/cards/Card\" + randomNum3 + \".png\");\r\n return c2;\r\n }", "public Playboard getPlayboard();", "private com.google.protobuf.SingleFieldBuilderV3<\n godot.wire.Wire.Plane, godot.wire.Wire.Plane.Builder, godot.wire.Wire.PlaneOrBuilder> \n getPlaneValueFieldBuilder() {\n if (planeValueBuilder_ == null) {\n if (!(typeCase_ == 10)) {\n type_ = godot.wire.Wire.Plane.getDefaultInstance();\n }\n planeValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<\n godot.wire.Wire.Plane, godot.wire.Wire.Plane.Builder, godot.wire.Wire.PlaneOrBuilder>(\n (godot.wire.Wire.Plane) type_,\n getParentForChildren(),\n isClean());\n type_ = null;\n }\n typeCase_ = 10;\n onChanged();;\n return planeValueBuilder_;\n }", "double getBasedOnValue();", "int getBlue(){\n return getPercentageValue(\"blue\");\n }", "public ArrayList<Card> create(){\n \n ArrayList<Card> deck = new ArrayList<Card>();\n \n // If the value enum class implements the Special interface, the \n // method will generate objects of the SpecialCard class.\n boolean specialDeck = Special.class.isAssignableFrom(this.value);\n \n // Loop through all the constants in the value enum class\n for(Object o: value.getEnumConstants()) {\n Value cardValue = (Value)o;\n \n // How many sets of each suit will this value have?\n int numSets = cardValue.getNumSuitSets();\n \n // Generate all the necessary copies of each suit for that value\n for (int i = 1; i <= numSets; i++) {\n \n for(Object p: suit.getEnumConstants()) {\n Suit cardSuit = (Suit)p;\n Card card = specialDeck? \n new SpecialCard(cardValue, cardSuit, this.game) : \n new NumberedCard(cardValue, cardSuit, this.game);\n deck.add(card);\n } \n }\n \n }\n \n return deck;\n }", "public Card playerPlayCard(Integer choice){\n if(!(playerHand.isEmpty())){\n return playerHand.get(choice);\n } else {\n return null;\n }\n }", "private PlayingCard chooseCard(HeartsGraphics g){\t\t\n\t\tHearts.setCurrentPlayer(this);\n\t\t\n\t\tif(number != PLAYER_ONE){\n\t\t\t// A.I. code\n\t\t\tint index;\n\t\t\t\n\t\t\tRandom r = new Random();\n\t\t\tindex = r.nextInt(hand.size());\t\t\t\n\t\t\t\n\t\t\treturn hand.get(index);\t\t\t\n\t\t} else {\n\t\t\treturn getCard(g);\n\t\t}\t\t\n\t}", "public static EstimatingTechnique get(int value) {\r\n\t\tswitch (value) {\r\n\t\t\tcase COST_VALUE: return COST;\r\n\t\t\tcase TIME_VALUE: return TIME;\r\n\t\t\tcase SKILLS_VALUE: return SKILLS;\r\n\t\t\tcase DEFECTS_VALUE: return DEFECTS;\r\n\t\t\tcase OTHER_VALUE: return OTHER;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public int getFaceValue ()\n {\n return faceValue;\n }", "public String lookupDisplay(String value) {\n\t\tT paper = null;\n\t\tif (cached != null) {\n\t\t\tpaper = cached.get(value);\n\t\t}\n\t\tif (paper == null) {\n\t\t\tload(Collections.singletonList(value));\n\t\t}\n\t\tpaper = cached.get(value);\n\t\treturn (paper != null)?display(paper):null;\n\t}", "public Cards get(int i) {\r\n\t\treturn seedCards.get(i);\r\n\t}", "public Card getCard() {\n return this.card;\n }", "public int getPlayerVisiblePosition(Colour colour);", "public SpadeCard(int value)\n\t{\n\t\tsuper(value);\n\t\tweight = 0;\n\t\t\n\t\tswitch(value)\n\t\t{\n\t\tcase 0:\n\t\t\tpicPath = \"pictures/cards_PNG/3_of_spades.png\";\n\t\t\tbreak;\t\t\n\t\tcase 1:\n\t\t\tpicPath = \"pictures/cards_PNG/4_of_spades.png\";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tpicPath = \"pictures/cards_PNG/5_of_spades.png\";\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tpicPath = \"pictures/cards_PNG/6_of_spades.png\";\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tpicPath = \"pictures/cards_PNG/7_of_spades.png\";\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tpicPath = \"pictures/cards_PNG/8_of_spades.png\";\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\tpicPath = \"pictures/cards_PNG/9_of_spades.png\";\n\t\t\tbreak;\n\t\tcase 7:\n\t\t\tpicPath = \"pictures/cards_PNG/10_of_spades.png\";\n\t\t\tbreak;\n\t\t\n\t\t\t\n\t\tcase 8:\n\t\t\tpicPath = \"pictures/cards_PNG/jack_of_spades.png\";\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\tpicPath = \"pictures/cards_PNG/queen_of_spades.png\";\n\t\t\tbreak;\n\t\tcase 10:\n\t\t\tpicPath = \"pictures/cards_PNG/king_of_spades.png\";\n\t\t\tbreak;\n\t\tcase 11:\n\t\t\tpicPath = \"pictures/cards_PNG/ace_of_spades.png\";\n\t\t\tbreak;\n\t\t\t\n\t\tcase 12:\n\t\t\tpicPath = \"pictures/cards_PNG/2_of_spades.png\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tpicPath = \"pictures/cards_PNG/black_joker.png\";\n\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\ttry {\n\t\t\timg = ImageIO.read(new File(picPath));\n\t\t}catch (IOException e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public float getVisibleMagnitude() {\n\n return visibleMagnitude;\n\n }", "public boolean isVisible(Visibility v);", "public VisualState getVisualState(Integer numPosition) {\r\n\t\treturn visualStates.get(numPosition);\r\n\t}", "public Image getCardPlayer3() {\n Random rand5 = new Random();\r\n randomNum5 = rand5.nextInt((52 - 1) + 1) + 1;\r\n Image p3 = new Image(\"/Images/cards/Card\" + randomNum5 + \".png\");\r\n return p3;\r\n }" ]
[ "0.5251317", "0.52274877", "0.5180882", "0.5146788", "0.51357824", "0.49718043", "0.49067432", "0.48861986", "0.48248684", "0.48044488", "0.47700837", "0.472244", "0.4715157", "0.46843475", "0.46481302", "0.4641503", "0.46210572", "0.46196696", "0.4618273", "0.4610533", "0.45921308", "0.45717603", "0.45681024", "0.45596817", "0.45481062", "0.4510901", "0.4492179", "0.4488741", "0.448862", "0.4486073", "0.44813508", "0.44802958", "0.4474817", "0.4469202", "0.44687304", "0.44654214", "0.44626164", "0.44602516", "0.44600478", "0.44472635", "0.44430354", "0.44417146", "0.4439187", "0.44375968", "0.4432983", "0.44326922", "0.44294474", "0.4426868", "0.4425255", "0.44111645", "0.44032407", "0.44029468", "0.44002086", "0.4382386", "0.43740994", "0.43708465", "0.43659317", "0.43629602", "0.43379292", "0.43329448", "0.43308368", "0.43255463", "0.43229404", "0.43221903", "0.43174613", "0.4313451", "0.43099546", "0.4307296", "0.43051255", "0.4303208", "0.42958093", "0.42916372", "0.42875114", "0.42844132", "0.42841107", "0.4271606", "0.42715865", "0.42701334", "0.42641613", "0.42633778", "0.42583528", "0.42568132", "0.42563507", "0.42560184", "0.4255998", "0.42513272", "0.42497998", "0.4249497", "0.4236907", "0.42366424", "0.42328367", "0.42327115", "0.42282704", "0.4226853", "0.42248458", "0.42233497", "0.4221347", "0.4218595", "0.42179748", "0.42156902" ]
0.8195817
0
Immediately before any instruction is executed a second time, what value is in the accumulator?
private static void part1() { List<String> instructions = FileUtils.readFile(INPUT_TXT); int instructionPointer = 0; int accumulator = 0; Set<Integer> executedLines = new HashSet<>(); // Run the instructions until a duplicate is found String instruction; do { instruction = instructions.get(instructionPointer); switch (instruction.substring(0, 3)) { case "acc": accumulator += Integer.parseInt(instruction.substring(4)); case "nop": instructionPointer++; break; case "jmp": instructionPointer += Integer.parseInt(instruction.substring(4)); break; } } while (instructionPointer < instructions.size() && executedLines.add(instructionPointer)); System.out.println("The accumulator = " + accumulator); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final private void accumulate()\n\t{\n\t\tfinal int argb = target.get().get();\n\t\taccA += ( ( argb >> 24 ) & 0xff ) * weights[ code ];\n\t\taccR += ( ( argb >> 16 ) & 0xff ) * weights[ code ];\n\t\taccG += ( ( argb >> 8 ) & 0xff ) * weights[ code ];\n\t\taccB += ( argb & 0xff ) * weights[ code ];\n\n//\t\tSystem.out.print( \"accumulating value at \" + target );\n//\t\tSystem.out.print( \"with weights [\" );\n//\t\tprintCode();\n//\t\tSystem.out.printf( \"] = %f\" + \"\\n\", weights[ code ] );\n\t}", "public int step() {\n ArrayList<Integer> copy = new ArrayList<Integer>();\n for (int i = 1; i < register.size(); i++) { \n copy.add(register.get(i));\n }\n int tapNum = register.get(register.size()-tap-1);\n int begin = register.get(0);\n if (tapNum == 1 ^ begin == 1) {\n copy.add(1);\n }\n else {\n copy.add(0);\n }\n register.clear();\n register.addAll(copy);\n return register.get(register.size()-1);\n }", "@Override\n public long[] createAccumulator() {\n return new long[] {0};\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 }", "protected final void operationLSRAccumulator() {\r\n this.carryFlag = (this.ac & 0x01) != 0;\r\n this.ac >>= 1;\r\n this.zeroFlag = (this.ac == 0);\r\n this.signFlag = false;\r\n }", "public static void main(String[] args) {\n\tint result =10;\n\tresult += 1;//result = result +1;\n\tSystem.out.println(result);\n\t}", "protected void assignCurrentValue() {\n\t\tcurrentValue = new Integer(counter + incrValue);\n\t}", "public final long getAndIncrement() {\n\t\treturn value++;\n\t}", "private static void calc1(int x) {\n\t\tx+=1;\n\t}", "int calculate() {\n return getSum() + b1;\n }", "public static int addOne( int a){\n int b;\n //System.out.println(b+1);\n return a += 1;\n}", "public int nextValue() {\n\t\tint temp = counter;\n\t\tcounter++;\n\t\treturn temp;\n\t}", "public int valueAndIncrement() {\n\t\tint x = offset;\n\t\tnext();\n\t\treturn x;\n\t}", "@Override public void postGlobal() {\n for(int i=1;i<_chkSums.length;++i) _chkSums[i] += _chkSums[i-1];\n }", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tcounter.accumulate(1);\n\t\t\t\t}", "public int getNextUnSafeSequence(){ return value++;}", "@Override\n public Integer reduceInit() { return 0; }", "void recalc() {\n\t\tthis.currentValue = baseValue;\n\t\tthis.modifiers.stream().forEach(a -> this.currentValue += a.getValue());\n\t}", "@Override\n public BiConsumer<List<Integer>, Employee> accumulator() {\n return (resultList, employee) -> {\n if (resultList.isEmpty()) resultList.add(employee.getSalary());\n else {\n Integer currentTotal = resultList.get(0);\n currentTotal += employee.getSalary();\n resultList.set(0, currentTotal);\n }\n };\n }", "synchronized public long peek() {\n return currValue;\n }", "@Test\n public void testCurrentOperationCountedInNextSample() throws IOException {\n NameContext step = createStep(\"A\");\n tracker.enter(step);\n tracker.takeSample(20); // Journal: IDLE A1\n tracker.takeSample(10); // Journal: A1\n tracker.exit();\n tracker.takeSample(20); // Journal: A1 IDLE\n\n assertThat(getCounterValue(step), equalTo(distribution(30)));\n }", "@Override\n public void step(final EvaluationContext theContext)\n {\n // pop the top 2 values and add them\n // and push the result onto the value stack\n //\n final Double theSecondOperand = theContext.popValue();\n final Double theFirstOperand = theContext.popValue();\n theContext.pushValue(theFirstOperand + theSecondOperand);\n }", "@Override\n public StringBuilder createAccumulator() {\n return null;\n }", "public void intermediateProcessing() {\n //empty\n }", "private static void add() {\n\tcount.incrementAndGet();\n}", "private int scoreCounter(int result) {\n result +=1;\n return result;\n }", "private int caculate(Operation opt, int t1, int t2) {\n\t\tint res;\n\t\tswitch (opt) {\n\t\tcase ADD:\n\t\t\tres = t1 + t2;\n\t\t\tbreak;\n\t\tcase SUB:\n\t\t\tres = t1 - t2;\n\t\t\tbreak;\n\t\tcase MUL:\n\t\t\tres = t1 * t2;\n\t\t\tbreak;\n\t\tcase DIV:\n\t\t\tres = t1 / t2;\n\t\t\tbreak;\n\t\tcase NULL:\n\t\t\terr.error(\"No operation in caculating.\");\n\t\t\tres = 0;\n\t\tdefault:\n\t\t\tres = 0;\n\t\t\tbreak;\n\t\t}\n\t\treturn res;\n\t\t/*\n\t\t * lex.intHolder.add(res); return lex.intHolder.lastIndexOf(res);\n\t\t */\n\t}", "@Override\r\n\tpublic int computeNextVal(boolean prediction, Instance inst) {\n\t\treturn 0;\r\n\t}", "public int value(){ // no input , some output\n\t\t\tSystem.out.println(\"value method\");\n\n\t\t\tint a = 10;\n\t\t\tint b = 20;\n\t\t\tint c = a+b;\n\t\t\treturn c ;\n\t\t}", "@Override\n public void step(final EvaluationContext theContext)\n {\n // pop the top 2 values and add them\n // and push the result onto the value stack\n //\n final Double theSecondOperand = theContext.popValue();\n final Double theFirstOperand = theContext.popValue();\n theContext.pushValue(theFirstOperand - theSecondOperand);\n }", "@Override\r\n\t\tvoid calculate() {\r\n\t\t\tnum3=num1+num2;\r\n\t\t\t\r\n\t\t}", "public final int accumulateAndGet(int x,\n IntBinaryOperator accumulatorFunction) {\n int prev, next;\n do {\n prev = get();\n next = accumulatorFunction.applyAsInt(prev, x);\n } while (!compareAndSet(prev, next));\n return next;\n }", "public void add1() {\r\n value++;\r\n }", "public final long incrementAndGet() {\n\t\treturn ++value;\n\t}", "public final int getAndAccumulate(int x,\n IntBinaryOperator accumulatorFunction) {\n int prev, next;\n do {\n prev = get();\n next = accumulatorFunction.applyAsInt(prev, x);\n } while (!compareAndSet(prev, next));\n return prev;\n }", "Measurement getAccumulation();", "public BigInteger getCurrentValue()\r\n { \t\r\n \tlog.debug(\"counter: \" + currentValue.intValue() );\r\n return this.currentValue;\r\n }", "void incUsage() {\n incUsage(1);\n }", "public int run() { return this.value.run(); }", "public int loadAccumulatorImmediateZeroRegisterInstructionCollapse(LinkedList<Assembly> ll, int reductionLevel)\n\t{\n\t\tint reductionCounter = 0;\n\t\t\n\t\tfor (Iterator<Assembly> i = ll.iterator(); i.hasNext(); )\n\t\t{\n\t\t\tAssembly as = i.next();\n\t\t\t\n\t\t\tfor (int h = 0; h < as.size(); h++)\n\t\t\t{\n\t\t\t\tAsmLine l1 = as.get(h);\n\t\t\t\tif (l1.opcode == \"\") continue;\n\t\t\t\t\n\t\t\t\t// look for ld[abefdw] #0\n\t\t\t\tif (l1.opcode.substring(0,2).equals(\"ld\") && l1.operand.substring(0,1).equals(\"#\"))\n\t\t\t\t{\n\t\t\t\t\tStringBuffer error = new StringBuffer();\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tint value = as.evaluate(l1, l1.expression);\n\t\t\t\t\t\tif (error.toString().equals(\"\") && value == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tString reg = l1.opcode.substring(2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (reg.equals(\"a\") ||\n\t\t\t\t\t\t\t\treg.equals(\"b\") ||\n\t\t\t\t\t\t\t\treg.equals(\"e\") ||\n\t\t\t\t\t\t\t\treg.equals(\"f\") ||\n\t\t\t\t\t\t\t\treg.equals(\"d\") ||\n\t\t\t\t\t\t\t\treg.equals(\"w\")\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tBoolean applyTheReduction = false;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// replacing ld? with clr? means that the carry bit will always be cleared\n\t\t\t\t\t\t\t\t// we can only apply this reduction if we find a subsequent instruction that affects the carry BEFORE any instruction reads the carry\n\t\t\t\t\t\t\t\t// this loop goes through subsequent lines searching for instructions that will either read the carry bit (which invalidates the reduction)\n\t\t\t\t\t\t\t\t// or sets the carry bit (which affirms the reduction, thus we apply it)\n\t\t\t\t\t\t\t\tfor (int j = h + 1; j < as.size(); j++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// l2 holds the subsequent line\n\t\t\t\t\t\t\t\t\tAsmLine l2 = as.get(j);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// if we encounter a blank or comment line, continue on...\n\t\t\t\t\t\t\t\t\tif (l2.isBlankLine() == true || l2.isCommentLine() == true || l2.opcode.equals(\"\")) continue;\n\t\t\n\t\t\t\t\t\t\t\t\t// if we encounter a pseudo instruction, abandon since we don't know how it will affect the subsequent code\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tString instructionClass = l2.instruction.getClass().getName();\n\t\t\t\t\t\t\t\t\tinstructionClass = instructionClass.substring(instructionClass.lastIndexOf('.') + 1);\n\t\t\t\t\t\t\t\t\tif (instructionClass.equals(\"CPU$H6309Instruction\") == false)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// this is probably a pseudo instruction; abort the reduction attempt\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\n\t\t\t\t\t\t\t\t\t// if the instruction can alter flow (branch, swi, etc), we don't attempt to follow\n\t\t\t\t\t\t\t\t\tCPU.H6309Instruction ins = (CPU.H6309Instruction)l2.instruction;\n\t\t\t\t\t\t\t\t\tif (ins.canAlterFlow == true)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// this instruction is a control altering instruction (branch, etc); abort the reduction attempt\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (reductionLevel == 1 && ins.read != null && ins.read.contains(CPU.CCF.C))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// this instruction may read the carry bit; abort the reduction attempt \n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\n\t\t\t\t\t\t\t\t\tif (reductionLevel > 1 || ins.set != null && ins.set.contains(CPU.CCF.C))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// this instruction alters the carry bit; allow the reduction to proceed\n\t\t\t\t\t\t\t\t\t\tapplyTheReduction = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (applyTheReduction == true)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tl1.replaceLine(l1.label + \" \" + \"clr\" + reg + l1.comment + \" * ECOAS REDUCTION *\", CPU.instructionTable);\n\t\t\t\t\t\t\t\t\tas.loadAccumulatorImmediateZeroRegisterInstructionCollapseCount++;\n\t\t\t\t\t\t\t\t\treductionCounter++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn reductionCounter;\n\t}", "public void inc() {\n inc(1);\n }", "public void increment(){\n value+=1;\n }", "public void add()\r\n {\r\n resultDoubles = Operations.addition(leftOperand, rightOperand);\r\n resultResetHelper();\r\n }", "private int flushValue() {\n int flushValue = 0;\n if (inSameSuit()) {\n flushValue += 4;\n \n char firstCardSuit = cards[0].charAt(1);\n char StartCardSuit = cards[cards.length-1].charAt(1);\n \n if(firstCardSuit==StartCardSuit){\n flushValue +=1;\n }\n } \n return flushValue;\n }", "private double individualEvaluation() {\n\t\t//System.out.println(\"indE\"+ myValues.get(myAction.getPurpose()).getStrength(null));\n\t\treturn myValues.get(myAction.getPurpose()).getStrength(null);\n\t}", "public Integer getAccload() {\r\n return accload;\r\n }", "static void m1318a() {\n f1109a++;\n }", "@Override\n public void step(final EvaluationContext theContext)\n {\n // pop the top 2 values and add them\n // and push the result onto the value stack\n //\n final Double theSecondOperand = theContext.popValue();\n final Double theFirstOperand = theContext.popValue();\n theContext.pushValue(theFirstOperand * theSecondOperand);\n }", "private int pc() {\r\n\t\t// PC incremented prior to instruction simulation, so need to adjust for\r\n\t\t// that.\r\n\t\treturn RegisterFile.getProgramCounter() - Instruction.INSTRUCTION_LENGTH;\r\n\t}", "public void mo33138e() {\n this.f23891d++;\n }", "public void inc(){\n this.current += 1;\n }", "@Override\n public BiConsumer<ObjectNode, Map.Entry<String, JsonNode>> accumulator() {\n return (acc, entry) -> acc.set(entry.getKey(), entry.getValue());\n }", "public Object currValue();", "@CallSuper\n public long incrementAndGet() {\n return addAndGet(1);\n }", "public int add(intHolder op)\n {\n int sum = op.getInt()+storageInt;\n return sum;\n }", "public int evaluate() {\n\t\treturn history + heuristic;\n\t}", "public final void m14223a(R r) {\n synchronized (this.f11863a) {\n if (this.f11874m || this.f11873l) {\n m14216b((Result) r);\n return;\n }\n m14229d();\n ad.m9051a(m14229d() ^ 1, (Object) \"Results have already been set\");\n ad.m9051a(this.f11872k ^ 1, (Object) \"Result has already been consumed\");\n m14217c(r);\n }\n }", "public int getResult(){\n return localResult;\n }", "public static void main(String[] args) {\n\tint a = 10; \n\tint b = ++a; \n\t\n\t// post increment--->first assign --> increment \n\tint c = 10; //11\n\tint d = c++; //10 \n\t\n\tSystem.out.println(a);//11\n\tSystem.out.println(b);//11\n\t\n\tSystem.out.println();\n\t\n\tSystem.out.println(c);\n\tSystem.out.println(d);\n\t\n}", "public double recallMemory() {\n return memoryValue;\n }", "@Override\n public double getResult()\n {\n double result = this.factor1 + this.factor2;\n return result;\n }", "void increase()\n {\n a++;\n b++ ;\n }", "private static int runStateOf(int c) { return c & ~CAPACITY; }", "@Override\n public void run() {\n aia.addAndGet(1,15);\n aia.decrementAndGet(1);\n\n //weakly compare the first args to current value and sets\n aia.compareAndSet(1,14,20);\n System.out.println(aia.get(1));\n }", "public boolean getAccumulativity() {\n return accumulativity;\n }", "@Override\n\tpublic int evaluate(){\n\t\treturn term.evaluate() + exp.evaluate();\n\t}", "@Override\n public void step(final EvaluationContext theContext)\n {\n // pop the top 2 values and add them\n // and push the result onto the value stack\n //\n final Double theSecondOperand = theContext.popValue();\n final Double theFirstOperand = theContext.popValue();\n theContext.pushValue(theFirstOperand / theSecondOperand);\n }", "public final void mo36647a() {\n if (getAndIncrement() == 0) {\n mo36650b();\n }\n }", "@Override\n\tpublic void execute(Machine m) {\n\t\tint value1 = m.getRegisters().getRegister(op1);\n\t\tint value2 = m.getRegisters().getRegister(op2);\n\t\tm.getRegisters().setRegister(result, value1 + value2);\n\t}", "@Override\n\tpublic void visit(NextValExpression arg0) {\n\t\t\n\t}", "public synchronized int getSynchronisedNext() {\n value++;\n return value;\n }", "@Override\n public int accion() {\n return this.alcance*2/3*3;\n }", "public void calcOutput()\n\t{\n\t}", "private void Perform_ADC()\n {\n d = Utils.GetOperand_XXXXXXX11111XXXX(mMBR);\n r = Utils.GetOperand_XXXXXX1XXXXX1111(mMBR);\n\n dvalue = get_reg(d);\n rvalue = get_reg(r);\n result = dvalue + rvalue;\n if (get_cflag()) result+=1;\n\n set_hflag(CarryFromBit3(dvalue, rvalue, result));\n set_nflag(Utils.bit7(result));\n set_vflag(Overflow(dvalue, rvalue, result));\n set_sflag(get_nflag() ^ get_vflag());\n set_zflag(result == 0);\n set_cflag(CarryFromResult(dvalue, rvalue, result));\n\n try {set_reg(d,result); }\n catch (RuntimeException e) { }\n\n return;\n }", "private int getCurrentValue()\n {\n return\n // Overall wait time...\n _countdownValue -\n // ...minus the time we waited so far.\n (int)(_clock.currentTime() - _startWait);\n }", "@Override\n\tprotected Integer compute() {\n\t\treturn 3;\n\t}", "@Override\n\t\tpublic void reduce() {\n\t\t\t\n\t\t}", "long getAndIncrement();", "private static int stateCount(int out, int in, int ret) {\n\t\tret -= out;\n\t\tret += in;\n\t\t\n\t\treturn ret;\n\t}", "private synchronized void increment() {\n count++;\n atomicInteger.incrementAndGet();\n }", "double getActiveOperand();", "public int[] reduceInit() {\n return null;\n }", "public static void main(String[] args) {\n\t\t// +=:\n\t\tint a=9;\n\t\t//\ta = a+3; //12\n\t\t\n\t\t\ta += 3; // a = a+3 \n\t\t\n\t\t\tSystem.out.println(a); //12\n\t\t\n\t\tint b = \ta += 5 ; // a=17\n\t\t\t//\t\t17 \n\t\tSystem.out.println(b); \n\t\t// a=17 , b= 17 \n\t\t\n\t\t\n\t\tint c = a += b ; // a= 34, c=34 , b=17\n\t\t//\t\t 17 += 17 = 34\n\t\tSystem.out.println(c);\n\t\t\n\t\tint d = a += c; // a= 68, d=68, c= 34, b=17\n\t\t\t\t//34+=34\n\t\tSystem.out.println(d);\n\t\t\n\t\t\n\t\tint e = (d+=b) * 2;\n\t\t//\t\t (68+17) *2\n\t\t//\t\t 85 *2 = 170\n\t\t\n\t\tSystem.out.println(e); // d = 85, b 17, e= 170, c=34\n\t\tSystem.out.println(d); // 85\n\t\tSystem.out.println(c); // 34\n\t\tSystem.out.println(b); //17\n\t\t\n\t\t// d= 85 , b=17, e = 170, c= 34\n\t\tint f = b += d * 2;\t\t\n\t\t// b += 170;\n\t\t//\t 17 +=170 ==> 187\n\t\t\n\t\tSystem.out.println(f);\n\t\t// b= 187\n\t\t\n\n\t// -=: \n\t\t\n\t\tint g = 101;\n\t\tint h = g -= 1; // g = 100, h=100\n\t//\t\t\t101 -=1 ==> 100\t\n\t\tSystem.out.println(h); \n\t\t\n\t\t\n\t\tint i = g+=h+5 ; // g=205, i=205, h=100;\n\t\t//\t\t100+=100 + 5 ==> 205\n\t\tSystem.out.println(i);\n\t\t\n\t\tint j = h+= g % i ; // h =100 , j= 100;\n\t\t//\t\t100 += 205 % 205\n\t\t//\t\t100 += 0 \n\t\tSystem.out.println(j);\n\t\t\n\t\t\n\t\tint k = j -= h * 2 % 5; // j= 100\n\t\t//\t\tj -= 200 % 5\n\t\t// 100 -= 0 \n\t\tSystem.out.println(k);\n\t\t\n\t\t\n\t// *=:\t\n\t\tint A = 100;\n\t\tA *= 200; // A = A*200\n\t\tSystem.out.println(A);\n\t\t//A = 20000;\n\t\t\n\t\tint B = 100;\n\t\t\tB *= 100 / 10;\n\t//\t\tB *=100 / 10\n\t\t\n\t\t\tSystem.out.println(B); // B=1000\n\t\t\t\n\t\tB *= B - 1000; \n\t\t//\tB *= 1000 -1000 = 0\n\t\tSystem.out.println(B);\n\t\t\n\t\t\n\t// /=:\n\t\tint C = 1000;\n\t\t\tC /= 5;\n\t\t\tSystem.out.println(C);\n\t\t\t\n\t\tint D =10;\t \n\t\t\t\n\t//\tC /= D-10; denominator can't be zero\n\t\tSystem.out.println(C); // C =200\n\t\t\n\t\tC /=D+10; // C /20 ==> 200/20 ==>10\n\t\tSystem.out.println(C );\n\t\t\n\t\t\n\t// %=:\n\t\tint z = 10%3;// ==> 10/3 =3. ... remainder: 10 - 3*3 =1\n\t\t\n\t\t\n\t\t\n\t\tint E = 10;\n\t\tE %= 2; // E = 10%2\n\t\tSystem.out.println(E);\n\t\t\n\t\tint F = 100;\n\t\t\tF %=2; // F = F%2; ==>0\n\t\tSystem.out.println(F); // if it's 0 it means it's even number\n\t\t\n\t\t\n\t\tSystem.out.println(-100%3);\n\t\tSystem.out.println( 10.5% 3 ); \n\t\t//\t\t\t\t10.5 /3 = 3 reminder: 10.5 - 3*3 = 1.5\n\t\t\n\t\t\n\t\tint J = 300;\n\t\tint K =10;\n\t\t\n\t\t J += J %= K ;\n\t\t// j += 0\n\t\t// 300 +=0 ==>300\n\t\t\n\t\tSystem.out.println(J); // 300\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public void b() {\n if (getAndIncrement() == 0) {\n c();\n }\n }", "@Override\r\n\tpublic double calculate() {\n\r\n\t\treturn n1 + n2;\r\n\t}", "static void add() {\r\n\t\t\r\n\t\tint a = 500;\r\n\t\tint b = 300;\r\n\t\t\r\n\t\tint s = a +b;\r\n\t\tSystem.out.println(s);\r\n\t}", "public void executeAdd(){\n\t\tBitString destBS = mIR.substring(4, 3);\n\t\tBitString firstOperand = mIR.substring(7, 3);\n\t\tint sum;\n\t\tif(mIR.substring(10, 1).getValue() == 1){\n\t\t\tint imma5 = mIR.substring(11, 5).getValue2sComp();\n\t\t\tsum = imma5 + mRegisters[firstOperand.getValue()].getValue2sComp();\n\t\t} else {\n\t\t\tBitString secondOperand = mIR.substring(13, 3);\n\t\t\tsum = mRegisters[secondOperand.getValue()].getValue2sComp() + mRegisters[firstOperand.getValue()].getValue2sComp();\n\t\t}\n\n\t\tmRegisters[destBS.getValue()].setValue(sum);\n\n\t\tsetConditionalCode(mRegisters[destBS.getValue()]);\n\n\n\t}", "static void aci_data_with_acc(String passed){\n\t\tint sum = hexa_to_deci(registers.get('A'));\n\t\tsum+=(CS?1:0);\n\t\tsum+=hexa_to_deci(passed.substring(4));\n\t\tCS = sum>255?true:false;\n\t\tregisters.put('A',decimel_to_hexa_8bit(sum));\n\t\tmodify_status(registers.get('A'));\n\t}", "boolean incLowValue() { return true; }", "@Override\n\tpublic Long get() {\n\t\tlong f=f3+f2+f1;\n\t\tf3=f2;\n\t\tf2=f1;\n\t\tf1=f;\n\t\treturn f;\n\t}", "void add(double val) {\r\n\t\tresult = result + val;\r\n\t}", "public int peek() {\n int result;\n while(!stack.isEmpty()){\n cache.add(stack.removeLast());\n }\n result = cache.getLast();\n while(!cache.isEmpty()){\n stack.add(cache.removeLast());\n }\n System.out.println(result);\n return result;\n }", "static void opration(){ \n System.out.println(\"Final veriable value l:\"+l+\"\\nj:\"+j);\n // l=l+2; erorr it can't change it's value\n \n }", "public int getInitialValue()\n {\n return _init;\n }", "public static void main(String[] args) {\n\n AtomicInteger i1 = new AtomicInteger(10);\n int res = i1.addAndGet(10);\n\n System.out.println(res);\n }", "@Override\n public int peek() {\n int result = 0;\n if (first != null) {\n result = first.value;\n }\n return result;\n }", "manExp15(){ \r\n\r\n\tcount++; \r\n\r\n\tSystem.out.println(count); \r\n\r\n\t}", "public static void main(String[] args) {\n\t\tint a;\r\n\t\tint b;\r\n\t\ta=1;\r\n\t\tb=++a+a++;\r\n\t\tSystem.out.println(a);\r\n\t\tSystem.out.println(b);\r\n\r\n\t}", "private void nextState() {\n int x;\n int y;\n y = st3;\n x = (st0 & MASK) ^ st1 ^ st2;\n x ^= (x << SH0);\n y ^= (y >>> SH0) ^ x;\n st0 = st1;\n st1 = st2;\n st2 = x ^ (y << SH1);\n st3 = y;\n st1 ^= parameter.getMat1(y);\n st2 ^= parameter.getMat2(y);\n }", "public void sum()\n {\n int a=5;\n int b=10;\n int c=a+b;\n\n System.out.println(c);\n }" ]
[ "0.6066812", "0.5897535", "0.58116406", "0.57979405", "0.5778944", "0.5723307", "0.56948256", "0.55911595", "0.5507337", "0.5505674", "0.549772", "0.54432476", "0.5431278", "0.5427391", "0.53957504", "0.5383174", "0.53714174", "0.5368811", "0.53627944", "0.5347988", "0.534396", "0.5333698", "0.5331939", "0.5311902", "0.53033125", "0.52980065", "0.52808315", "0.52383554", "0.5225999", "0.5209249", "0.5207449", "0.5201606", "0.51847595", "0.51821744", "0.51724565", "0.5171774", "0.51625735", "0.5161777", "0.51390517", "0.5138234", "0.5131233", "0.51167136", "0.51161605", "0.5104306", "0.5099869", "0.50900465", "0.50838333", "0.50815946", "0.50814784", "0.5077313", "0.5070778", "0.50694114", "0.5069249", "0.5067314", "0.506369", "0.5057368", "0.5050434", "0.5050035", "0.50455004", "0.5043739", "0.50361353", "0.50281924", "0.50266004", "0.5025386", "0.50228286", "0.5022454", "0.5020496", "0.50193584", "0.50164884", "0.50156444", "0.50139904", "0.5007089", "0.49956754", "0.4986703", "0.49824068", "0.49810475", "0.4979096", "0.49778754", "0.49697998", "0.49616063", "0.495806", "0.49556744", "0.49486345", "0.49343622", "0.4934099", "0.49325147", "0.4932273", "0.49292362", "0.49268508", "0.4925722", "0.49241564", "0.492167", "0.49154243", "0.4914191", "0.491266", "0.49073777", "0.48924798", "0.48897845", "0.48802206", "0.48782116" ]
0.5942106
1
Fix the program, what is the accumulator value at the end?
private static void part2() { List<String> instructions = FileUtils.readFile(INPUT_TXT); int accumulator = 0; Set<Integer> executedLines = new HashSet<>(); // Try changing each "nop"/"jmp" until something works int operationToChange = 0; // There are only so many "nop"/"jmp" instructions long totalOperations = instructions.stream().filter(i -> !i.startsWith("acc")).count(); while (++operationToChange < totalOperations) { // Reset, re-run accumulator = 0; executedLines.clear(); int instructionPointer = 0; String instruction; int currentOperation = 0; // Run the instructions until a duplicate is found do { instruction = instructions.get(instructionPointer); String operation = instruction.substring(0, 3); // If this is the n-th "nop"/"jmp" operation, switch it. if (operationToChange > currentOperation && ("nop".equals(operation) || "jmp".equals(operation))) { currentOperation++; if (operationToChange == currentOperation) operation = "nop".equals(operation) ? "jmp" : "nop"; } // Execute the operation switch (operation) { case "acc": accumulator += Integer.parseInt(instruction.substring(4)); case "nop": instructionPointer++; break; case "jmp": instructionPointer += Integer.parseInt(instruction.substring(4)); break; } } while (instructionPointer < instructions.size() && executedLines.add(instructionPointer)); if (instructionPointer == instructions.size()) { System.out.println("The program terminated successfully!"); System.out.println("Changed instruction: " + instructions.stream() .filter(i -> !i.startsWith("acc")) .collect(Collectors.toList()) .get(operationToChange)); break; } } System.out.println("The accumulator = " + accumulator); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final private void accumulate()\n\t{\n\t\tfinal int argb = target.get().get();\n\t\taccA += ( ( argb >> 24 ) & 0xff ) * weights[ code ];\n\t\taccR += ( ( argb >> 16 ) & 0xff ) * weights[ code ];\n\t\taccG += ( ( argb >> 8 ) & 0xff ) * weights[ code ];\n\t\taccB += ( argb & 0xff ) * weights[ code ];\n\n//\t\tSystem.out.print( \"accumulating value at \" + target );\n//\t\tSystem.out.print( \"with weights [\" );\n//\t\tprintCode();\n//\t\tSystem.out.printf( \"] = %f\" + \"\\n\", weights[ code ] );\n\t}", "public static void main(String[] args) {\n\tint result =10;\n\tresult += 1;//result = result +1;\n\tSystem.out.println(result);\n\t}", "public void reduce(Text prefix, Iterator<IntWritable> iter,\n OutputCollector<Text, IntWritable> output, Reporter reporter) throws IOException {\nint a000 = 0;\nint a001 = 0;\nint a002 = 0;\nint a003 = 0;\nint a004 = 0;\nint a005 = 0;\nint a006 = 0;\nint a007 = 0;\nint a008 = 0;\nint a009 = 0;\nint a010 = 0;\nint a011 = 0;\nint a012 = 0;\nint a013 = 0;\nint a014 = 0;\nint a015 = 0;\nint a016 = 0;\nint a017 = 0;\nint a018 = 0;\nint a019 = 0;\nint a020 = 0;\nint a021 = 0;\nint a022 = 0;\nint a023 = 0;\nint a024 = 0;\nint cur = 0;\n\nwhile (iter.hasNext()) {\ncur = iter.next().get();\na003 += a021;\na011 += a023;\na017 -= -2;\na003 += a009;\na018 += a016;\na015 -= a004;\na020 -= a018;\na007 = a015 - a024;\na006 = a017 - a023;\na006 -= a024;\na019 += a014;\na008 = a015 - a023;\na015 += a024;\na004 += a004;\na021 -= a018;\na008 = a024 - a010;\na011 = a020 + a019;\na023 = a004 - a018;\ncur = a024 - a015;\na007 += a014;\na002 = a014 + a000;\na010 = a010 - a013;\na022 = a010 - a023;\na016 -= a014;\na004 -= a024;\na004 -= a005;\na014 = a005 + a012;\na001 = a018 + a018;\nif (a014 != a017) {\na019 = a023 + a007;\na000 -= cur;\na011 = a016 + a024;\na003 = a000 + a008;\na001 -= a012;\na011 = a016 + a022;\na009 += a011;\na012 -= a002;\na007 += a012;\n} else {\na003 -= a002;\na011 = a022 + a012;\na022 = a004 - a018;\na001 += a022;\na018 -= a005;\na001 = a004 - a017;\na021 = a011 + a021;\na005 -= a010;\na011 += a002;\na016 = a016 - a018;\na006 = a000 - a006;\na019 -= a002;\na009 -= a003;\na016 -= a019;\na013 = a000 + a005;\na008 += a002;\na013 = a002 + a007;\na010 += a018;\na005 -= a022;\na015 = a021 + a018;\na000 = a019 - a001;\nif (a005 == a018) {\nif (a011 >= a018) {\na018 += a005;\na012 -= a005;\na007 = a007 - a004;\n} else {\na015 = a017 + a022;\na022 += a015;\na019 += a010;\na014 -= cur;\na023 += a008;\na015 = a013 - a014;\nif (a011 != -2) {\na013 = a021 - a019;\na016 -= a010;\na000 = a021 + a024;\na009 = a009 + a015;\na005 = a018 + a002;\na004 = a021 * 4;\na008 = a018 + a007;\na021 = a011 + a013;\na015 = a002 + a023;\na022 = a007 - a012;\na005 -= a021;\na022 = a015 - a015;\na007 = a007 + a020;\na001 = a013 - a002;\na015 += a011;\na011 -= a002;\na010 = a015 * -2;\na020 -= a011;\na023 -= a013;\na013 = a004 - a023;\na023 = a023 - a017;\na016 = a008 + a014;\na015 -= cur;\na023 -= a022;\na005 -= a011;\na002 = a009 + a008;\na023 = a015 * 4;\na014 = 0 - a010;\na012 = a016 - a024;\na004 += a000;\na022 = a010 - a022;\na013 += a015;\na016 = a020 - a023;\nif (a012 < -4) {\na019 -= a019;\na015 -= a005;\na023 = a007 - a018;\na013 = a015 - a017;\na021 -= a013;\na005 = a004 - a020;\na004 = 0 - a022;\na021 -= a013;\na004 += a004;\na012 = a022 + a022;\n} else {\na018 = a013 + a014;\na004 += a017;\na007 = a021 + a009;\na009 -= a019;\na024 -= a000;\na001 = a001 - a021;\na001 = a011 + a001;\na005 = a003 + a006;\na012 -= a000;\na016 = a004 - a019;\na010 = a007 - a013;\na011 += cur;\na020 -= a021;\na024 = a015 - cur;\na000 = a012 - a015;\na011 -= a015;\na022 = a007 - a019;\na004 -= a013;\na016 = a015 - a016;\na022 = a023 + a006;\n}\na019 -= a000;\na000 = a012 - a019;\na005 = a014 + a004;\na022 -= a021;\na006 = a009 + a011;\na001 = a007 + a006;\na013 = a009 - a021;\na006 = a004 - a000;\na011 += a020;\na012 -= cur;\na010 -= a011;\na000 = a009 + cur;\na013 += a002;\na019 -= a013;\na021 -= a011;\na005 = 2 + a009;\na023 = a007 - a016;\na009 -= a024;\na024 -= a019;\n} else {\na010 -= cur;\na018 -= a001;\na007 -= a022;\na022 += a005;\na022 = a006 + a020;\na013 = cur - a001;\n}\na003 = a013 + a010;\na023 -= a010;\na011 = a002 - a015;\na017 = a010 + a008;\ncur = a020 - a018;\na011 += a009;\na018 = a012 + a017;\na000 += a023;\na012 = a001 - a007;\na009 += a005;\na018 += a006;\na020 = a016 - a016;\na007 = a007 + a002;\na005 = a021 - a018;\na023 = a006 - a002;\na006 = cur - a016;\na007 = a007 + a013;\ncur += a021;\na014 += -3;\na013 -= a007;\na016 += a012;\ncur += a005;\na007 += a018;\na013 = a006 - a022;\na008 -= a008;\na000 = a006 - a011;\ncur += a023;\na002 = a005 - a024;\na022 -= a019;\na016 = a007 - a002;\na002 = a012 + a020;\n}\na003 += a004;\na005 = a022 - a000;\na004 = a003 - a021;\na011 -= a009;\na000 -= a024;\na019 += a012;\na024 = a021 + a020;\na016 -= a005;\na024 += a006;\na006 = a005 - a008;\na003 = a021 + a000;\na012 -= a012;\na012 += a003;\na002 += a013;\na020 = 0 + a007;\na013 -= a006;\na022 = a020 - a010;\n} else {\na002 -= a002;\na017 = a000 + a018;\na012 += cur;\na014 -= a006;\na024 += a000;\na008 = a023 - a009;\na009 += a012;\na013 += a007;\na001 += a011;\na020 += 1;\na011 = a006 + a023;\na017 += a024;\na002 = a014 + a014;\na016 = a012 - a009;\n}\na018 -= a010;\na023 += a020;\na012 = a013 - a012;\na015 -= a021;\na004 = a001 - a016;\na001 += a004;\na023 -= a021;\na014 += a002;\na001 = a007 - a006;\na007 = a022 - -5;\na012 -= a006;\na022 += a010;\na007 = a001 + -2;\na016 = a015 + a005;\na021 += a004;\na006 -= a023;\na017 += a013;\na012 -= a010;\na018 -= 0;\na023 = -3 - a006;\na012 -= a014;\n}\na005 += a020;\na016 = a012 - a008;\na016 = a012 + a002;\na019 = a007 + a017;\na009 = a009 + a009;\na001 += 1;\na020 = a021 + a024;\na001 = a020 - a011;\na015 = a011 - a013;\na003 += a021;\na004 -= a009;\na014 -= a022;\n}\noutput.collect(prefix, new IntWritable(a015));\n}", "public void reduce(Text prefix, Iterator<IntWritable> iter,\n OutputCollector<Text, IntWritable> output, Reporter reporter) throws IOException {\nint a000_ = 0;\nint a001_ = 0;\nint a002_ = 0;\nint a003_ = 0;\nint a004_ = 0;\nint a005_ = 0;\nint a006_ = 0;\nint a007_ = 0;\nint a008_ = 0;\nint a009_ = 0;\nint a010_ = 0;\nint a011_ = 0;\nint a012_ = 0;\nint a013_ = 0;\nint a014_ = 0;\nint a015_ = 0;\nint a016_ = 0;\nint a017_ = 0;\nint a018_ = 0;\nint a019_ = 0;\nint cur_ = 0;\n\nwhile (iter.hasNext()) {\ncur_ = iter.next().get();\na011_ = a015_ - a008_;\na003_ = a000_ + a003_;\na005_ = a005_ + a006_;\na015_ = a012_ + a011_;\na008_ = a014_ + a001_;\na007_ = a005_ + a015_;\na002_ = a000_ - a009_;\na012_ = a005_ + a012_;\na010_ = a018_ + a003_;\na014_ = a014_ + a004_;\ncur_ = a002_ + a004_;\na017_ = a007_ + a009_;\na005_ = cur_ - a014_;\na000_ = a012_ - a006_;\na006_ = a013_ - a011_;\na000_ = 0 - a008_;\na006_ = a007_ + a003_;\na015_ = a014_ - a019_;\na004_ = a012_ + cur_;\na005_ = a018_ - a017_;\na007_ = a006_ + a000_;\na005_ = cur_ - a009_;\na001_ = a009_ + a008_;\na015_ = cur_ + a010_;\na013_ = a018_ * -2;\ncur_ = a013_ - a012_;\na019_ = a002_ - a001_;\na017_ = a014_ + a004_;\na005_ = a017_ - a006_;\na016_ = a019_ - a019_;\na009_ = a000_ + cur_;\na013_ = a003_ * -1;\nif (a010_ >= a004_) {\na015_ = a018_ + a015_;\na010_ = a009_ - a010_;\na012_ = a011_ - a005_;\na014_ = a002_ - a012_;\nif (a000_ != a013_) {\na004_ = a015_ + cur_;\na013_ = a019_ + a016_;\na013_ = a012_ + a009_;\na016_ = a014_ - -5;\na001_ = a002_ - a004_;\n} else {\na007_ = a013_ - a003_;\na016_ = a007_ - a018_;\na016_ = a013_ + a011_;\na013_ = a013_ - a012_;\na013_ = -1 + a006_;\ncur_ = a002_ - a017_;\na007_ = a002_ + a018_;\ncur_ = a002_ + a015_;\na003_ = a015_ + a007_;\na017_ = a005_ + a009_;\na013_ = a006_ - -2;\na008_ = a005_ - a003_;\na002_ = a017_ - a014_;\na006_ = a006_ + a010_;\na008_ = a018_ + a010_;\na000_ = a015_ + -4;\na014_ = a004_ - a010_;\na012_ = a009_ - a016_;\na008_ = a002_ - a019_;\na015_ = a007_ + a005_;\na004_ = cur_ + a018_;\na011_ = a007_ + a012_;\na007_ = 4 - a011_;\na001_ = a012_ + cur_;\na011_ = a010_ - a013_;\na003_ = a006_ - a011_;\na006_ = a012_ - a008_;\na015_ = a010_ - a013_;\na019_ = a012_ + a011_;\nif (a017_ != a015_) {\ncur_ = a010_ - cur_;\na013_ = a009_ - a002_;\na008_ = a011_ - a008_;\na019_ = a005_ - a000_;\na010_ = a019_ + a010_;\na002_ = a004_ - 1;\na017_ = a015_ - cur_;\ncur_ = 1 - a005_;\na004_ = a000_ + a003_;\na001_ = a012_ + 2;\na004_ = a003_ - 2;\na003_ = a010_ - -4;\na019_ = a014_ - a002_;\na011_ = a002_ - a007_;\na000_ = a007_ + a015_;\na018_ = a009_ + cur_;\na006_ = a003_ - a017_;\nif (a008_ == a013_) {\na005_ = a017_ + a016_;\na005_ = a005_ + a013_;\na017_ = a015_ + a007_;\na016_ = a016_ + a018_;\na016_ = a014_ - a015_;\na003_ = a019_ - a018_;\ncur_ = a010_ + a005_;\na003_ = a001_ + a010_;\na016_ = -4 + a003_;\na002_ = a017_ + a008_;\na016_ = a003_ - a009_;\na003_ = a009_ + a015_;\na016_ = a004_ - a000_;\na005_ = a015_ + cur_;\na018_ = a010_ + a003_;\na016_ = a017_ - a004_;\n} else {\na018_ = a019_ + a009_;\na015_ = a004_ + a018_;\na019_ = a005_ - a003_;\na009_ = -5 + a008_;\na010_ = a000_ + a000_;\na009_ = a009_ - a011_;\na005_ = a006_ - cur_;\na019_ = a018_ + a009_;\na014_ = a005_ + cur_;\na004_ = a010_ + a008_;\na000_ = a015_ - a018_;\na015_ = a017_ - a017_;\na008_ = a001_ + a008_;\na002_ = a009_ - a012_;\na010_ = a006_ - a012_;\na014_ = a009_ + a001_;\na016_ = a000_ - a016_;\na004_ = a018_ - a019_;\na007_ = a003_ + a011_;\na019_ = a004_ - a017_;\na015_ = a018_ - a017_;\na003_ = a000_ + a002_;\na005_ = a007_ - a014_;\na001_ = cur_ + a017_;\n}\na012_ = a012_ + cur_;\n} else {\na010_ = a018_ + a000_;\na002_ = a000_ - a003_;\na005_ = a012_ + a012_;\na015_ = a004_ + a004_;\na008_ = a013_ - a019_;\na004_ = a002_ + a015_;\na011_ = a014_ + a012_;\na004_ = a019_ + a010_;\na002_ = a018_ + a010_;\ncur_ = a017_ + a019_;\na017_ = a013_ + a005_;\na013_ = a008_ - a012_;\na004_ = a012_ + a007_;\n}\na009_ = a015_ - a016_;\na000_ = a006_ + a008_;\na003_ = a008_ - a011_;\na001_ = a016_ - a006_;\na016_ = a014_ + a016_;\na000_ = a011_ + a003_;\na004_ = a010_ + a019_;\na013_ = a008_ + cur_;\na016_ = a016_ + a015_;\n}\na010_ = a003_ + a007_;\na006_ = a009_ - a000_;\na002_ = a017_ - a001_;\na013_ = a016_ + a019_;\na013_ = a009_ - a015_;\na005_ = a002_ - a018_;\na009_ = a002_ + a007_;\na008_ = a008_ + a002_;\na007_ = a005_ + a009_;\na017_ = a019_ + a013_;\na012_ = a003_ + a004_;\na008_ = a012_ + a012_;\na003_ = a007_ + a005_;\ncur_ = a014_ + a007_;\na009_ = a016_ + a010_;\na006_ = a005_ - a003_;\na014_ = a019_ + cur_;\na006_ = a007_ + a000_;\na013_ = a011_ - a011_;\na018_ = a009_ - 1;\na002_ = a004_ - a014_;\n} else {\na004_ = a006_ - a014_;\na016_ = a017_ + 2;\na014_ = a006_ - a002_;\na002_ = a016_ + cur_;\na014_ = -3 + a018_;\n}\ncur_ = a017_ + a015_;\na005_ = a003_ - a015_;\na014_ = a019_ + a009_;\ncur_ = cur_ + a005_;\na009_ = a007_ - a004_;\ncur_ = a014_ + a006_;\na013_ = a002_ - a012_;\na002_ = a008_ + a014_;\na000_ = a006_ + a004_;\na017_ = 1 - a009_;\na012_ = a017_ + a001_;\na011_ = a009_ - a010_;\na011_ = a018_ - a014_;\na016_ = a003_ - cur_;\na013_ = cur_ + a012_;\na015_ = a012_ + a010_;\na017_ = a007_ + a017_;\na000_ = -1 + a008_;\na010_ = a008_ + a003_;\na016_ = a009_ + a010_;\na002_ = a011_ + a008_;\na016_ = a015_ + a016_;\na002_ = a012_ + a008_;\na017_ = a013_ + a004_;\n}\noutput.collect(prefix, new IntWritable(a005_));\n}", "public void reduce(Text prefix, Iterator<IntWritable> iter,\n OutputCollector<Text, IntWritable> output, Reporter reporter) throws IOException {\nint a000 = 0;\nint a001 = 0;\nint a002 = 0;\nint a003 = 0;\nint a004 = 0;\nint a005 = 0;\nint a006 = 0;\nint a007 = 0;\nint a008 = 0;\nint a009 = 0;\nint a010 = 0;\nint a011 = 0;\nint a012 = 0;\nint a013 = 0;\nint a014 = 0;\nint a015 = 0;\nint a016 = 0;\nint a017 = 0;\nint a018 = 0;\nint a019 = 0;\nint a020 = 0;\nint a021 = 0;\nint a022 = 0;\nint a023 = 0;\nint a024 = 0;\nint cur = 0;\n\nwhile (iter.hasNext()) {\ncur = iter.next().get();\na014 = a022 - a006;\na013 = -2 - a022;\na018 += a003;\na011 -= a011;\na011 += a018;\na009 -= cur;\nif (a019 <= a021) {\na014 = a003 + a003;\na011 = a021 + 4;\na017 -= a002;\na005 = -5 - a019;\na004 = a003 - a016;\ncur += a017;\na013 += a010;\ncur -= a012;\na006 = a000 + a015;\na017 = a014 + a022;\na011 = a020 + a013;\na014 += a001;\na005 = a016 + a007;\ncur = 2 + a011;\na020 = a023 - a006;\na007 += a021;\na021 = a021 + a008;\na000 += a008;\na024 = a024 - a009;\na017 += 4;\na013 = a006 - a023;\na013 = a009 + a008;\na010 += a001;\na003 = a018 - a018;\na015 = a023 + a023;\na016 = a009 - a002;\na003 += -1;\na013 = a022 + a014;\na018 -= a020;\na001 = a003 + a009;\na024 += a015;\n} else {\nif (a017 > a011) {\na009 -= a001;\na024 -= a007;\na005 = a017 - a007;\na020 += a020;\nif (a003 != a001) {\na009 += a006;\na006 += a017;\na016 -= a004;\na024 = a008 + a002;\na014 -= a024;\na017 -= a010;\na012 -= a003;\na005 += a002;\na005 = a007 - a014;\na013 = a013 - a001;\na005 = a019 + a016;\na024 -= a014;\ncur = a005 - a010;\na004 = a003 - a001;\na000 = a021 - -1;\na019 = a006 - a008;\na006 = a018 + a009;\na015 -= a013;\na017 = a019 - a022;\na004 += a019;\na023 += a016;\na010 += a000;\na003 += a011;\na011 += a019;\na009 += a014;\na018 = a012 + a001;\ncur = -4 + 3;\na021 = a017 - a001;\na004 += a002;\na020 = -5 + a024;\na023 = a020 + a018;\na024 += a018;\n} else {\na017 = -5 - a012;\na013 = a023 - a018;\na020 = a020 - a017;\na003 += a013;\na004 = a019 - cur;\na016 += a010;\na021 += a018;\na008 = a010 - a012;\na010 -= a019;\na007 -= a013;\na015 -= a019;\na019 = a004 + a021;\na011 = a013 + a006;\na005 += a004;\na015 -= a016;\na017 = a002 - a024;\na002 -= a007;\na022 = a004 - cur;\na011 = a021 + a014;\na004 += a020;\na020 = a020 + a009;\na007 = a012 - a002;\na018 = a003 - a001;\na011 = a000 + a009;\na019 = a021 + a017;\na017 = a022 - a013;\na014 = a018 - a020;\na009 -= a023;\na007 -= a008;\na020 = 2 + a011;\na009 = cur + a010;\na015 -= a018;\na010 = a024 + a014;\n}\ncur -= a020;\n} else {\na008 = a003 - a017;\na024 -= a004;\nif (a014 >= a018) {\na005 = a000 + a021;\na003 = a006 + a002;\na009 = a021 + a023;\na003 += -5;\na022 += a024;\na010 = a014 + a016;\na024 = a008 + a010;\na008 = 2 - a003;\na014 -= a002;\na007 = a006 - a023;\na014 += a018;\na001 = a009 + a016;\na018 += a022;\na001 = a019 - a018;\na008 -= a011;\na019 -= a001;\na010 += a014;\ncur += a011;\na024 = a022 - a018;\na014 = a003 - a023;\na004 -= a002;\n} else {\na020 += a017;\na001 = a012 + a009;\na015 += a013;\na018 += a003;\na013 += a009;\na007 = a015 + a019;\na012 += a001;\na009 = a010 + -1;\na023 -= a017;\na020 = a017 + a004;\na005 = a011 - a001;\ncur -= a000;\na020 = a002 + a002;\na004 += a017;\na022 = a017 + a024;\na001 -= a016;\na012 = a021 + 0;\na002 -= a018;\na011 += a001;\na024 = a001 + a002;\na003 -= a015;\na016 = a022 - a014;\na008 = a002 - a001;\na006 += a009;\na018 -= a000;\na008 = a000 - a004;\na019 += a021;\na009 = a021 - a011;\na000 += a020;\na002 += a009;\nif (a024 == a022) {\ncur = a012 + a009;\na007 = a002 + a012;\na015 += a001;\na022 = a007 + a011;\na012 += a021;\na003 -= cur;\na018 -= a011;\na012 = a019 - a013;\na000 = a010 - a005;\na004 = a014 - a009;\na001 = a000 + a005;\na010 += a004;\na008 = a023 - 3;\na009 += a022;\na005 -= a018;\na004 += a003;\na018 = a001 + a001;\na010 = a003 + a014;\na011 -= a003;\na000 += 1;\na006 -= a018;\na008 = a011 - a009;\na008 = a013 - a009;\na011 = a016 + a009;\na008 -= a011;\na024 = a000 + a003;\na015 -= 4;\ncur = a008 - a024;\na024 = a012 - a008;\na005 = a023 + a020;\na024 -= a003;\n} else {\na017 = a012 + a013;\na017 = a019 - a000;\n}\na018 -= a005;\na006 = a021 + a019;\na005 += a007;\na018 += cur;\na005 += a008;\na008 += a017;\na019 = a002 - a006;\na005 = a000 + a011;\na003 = a021 - a005;\na019 = a014 + a006;\na018 -= a010;\na006 = 1 + a023;\na024 += a016;\na018 += a022;\na011 += a024;\na003 = a007 - a010;\na001 = a019 + a013;\na022 += a013;\na017 += a008;\na006 = a010 + a011;\na023 += a006;\na009 = a011 + a002;\na022 -= a015;\na024 = a012 - a019;\na001 -= a023;\na010 = a019 + cur;\na002 -= a009;\na012 -= a010;\na001 -= a006;\na021 = a000 - a000;\n}\na000 += a008;\na010 = a004 + a013;\na001 += cur;\na004 += a010;\na022 = a020 + a016;\na016 -= a008;\na010 = 4 - a018;\na007 = a021 - a011;\na010 -= a006;\na011 = a018 + a008;\na002 -= a000;\na004 -= a016;\na012 = a018 - a003;\na010 = a005 + a012;\na013 -= a005;\na011 = a010 - a001;\na007 -= a000;\na001 = a014 + a013;\na008 += a002;\na017 = a011 - a020;\na009 -= a013;\na022 -= a010;\na022 = a011 - a010;\n}\na005 = a021 - a002;\n}\na003 += a010;\na012 = cur - a021;\ncur += a017;\n}\noutput.collect(prefix, new IntWritable(a003));\n}", "@Override\n public BiConsumer<List<Integer>, Employee> accumulator() {\n return (resultList, employee) -> {\n if (resultList.isEmpty()) resultList.add(employee.getSalary());\n else {\n Integer currentTotal = resultList.get(0);\n currentTotal += employee.getSalary();\n resultList.set(0, currentTotal);\n }\n };\n }", "public void reduce(Text prefix, Iterator<IntWritable> iter,\n OutputCollector<Text, IntWritable> output, Reporter reporter) throws IOException {\nint a000_ = 0;\nint a001_ = 0;\nint a002_ = 0;\nint a003_ = 0;\nint a004_ = 0;\nint a005_ = 0;\nint a006_ = 0;\nint a007_ = 0;\nint a008_ = 0;\nint a009_ = 0;\nint a010_ = 0;\nint a011_ = 0;\nint a012_ = 0;\nint a013_ = 0;\nint a014_ = 0;\nint a015_ = 0;\nint a016_ = 0;\nint a017_ = 0;\nint a018_ = 0;\nint a019_ = 0;\nint a020_ = 0;\nint a021_ = 0;\nint a022_ = 0;\nint a023_ = 0;\nint a024_ = 0;\nint cur_ = 0;\n\nwhile (iter.hasNext()) {\ncur_ = iter.next().get();\na012_ = a000_ - a017_;\na004_ = cur_ - 2;\na008_ = a018_ - a009_;\na020_ = a020_ - cur_;\na021_ = a001_ - a009_;\na010_ = a002_ + a004_;\na013_ = a005_ + a005_;\na009_ = a019_ + a012_;\na008_ = a008_ * -5;\na021_ = a022_ - a023_;\na002_ = a020_ - a022_;\na019_ = cur_ + a020_;\ncur_ = cur_ + a008_;\na020_ = a006_ + a021_;\na021_ = a008_ - a017_;\na017_ = a021_ - a009_;\ncur_ = a011_ - a005_;\nif (a004_ == a007_) {\na007_ = -2 - a015_;\na022_ = a005_ - a019_;\na013_ = a010_ - a022_;\na024_ = a009_ + a000_;\na018_ = a003_ - 3;\na019_ = a021_ - a002_;\na000_ = a017_ + cur_;\na010_ = a020_ - 1;\na000_ = a020_ - a024_;\na017_ = a004_ + a007_;\na009_ = a001_ - a010_;\na015_ = a018_ + a022_;\na023_ = a013_ + a016_;\na024_ = cur_ - a019_;\na015_ = a013_ - a017_;\na024_ = a003_ - a021_;\na018_ = a003_ - a023_;\n} else {\na011_ = a006_ + a023_;\na018_ = a003_ - a015_;\na022_ = a008_ - a007_;\na005_ = a001_ - cur_;\na007_ = a000_ + a012_;\na000_ = a007_ + a023_;\na009_ = cur_ + a010_;\na018_ = -1 + a001_;\na003_ = -2 + a005_;\na006_ = a009_ + a020_;\na001_ = a017_ + a022_;\na024_ = a009_ + a006_;\na005_ = a017_ - a023_;\na004_ = a017_ - a019_;\na015_ = a018_ - a018_;\na021_ = a019_ + a011_;\na024_ = a009_ - a014_;\na009_ = 0 + a023_;\na020_ = a011_ + a006_;\na012_ = a005_ - a011_;\na010_ = a001_ - a018_;\na012_ = a002_ - a003_;\ncur_ = a006_ - a013_;\n}\na000_ = a023_ + a012_;\na008_ = a016_ - a018_;\na024_ = a018_ + a010_;\na013_ = a018_ + a002_;\na009_ = a016_ + a015_;\na005_ = a002_ + a009_;\na004_ = a009_ + a011_;\na011_ = a011_ + a013_;\na022_ = a019_ + a008_;\na017_ = a016_ + a010_;\na014_ = a012_ - a023_;\na005_ = a019_ - a001_;\na005_ = a013_ * -4;\na009_ = a020_ + a008_;\na012_ = a020_ - a001_;\na013_ = a016_ - a000_;\na012_ = a003_ + a000_;\na022_ = a001_ + a002_;\na001_ = a010_ - a024_;\na003_ = a008_ + a015_;\na012_ = a012_ - a020_;\na001_ = a019_ + a015_;\na009_ = a002_ + a018_;\na021_ = a024_ - a006_;\nif (a024_ == a014_) {\na006_ = a002_ + a016_;\na003_ = a020_ - 2;\na008_ = a020_ - a018_;\na015_ = a012_ + a001_;\na008_ = cur_ - a014_;\na001_ = a002_ - a008_;\na004_ = a015_ + a011_;\na024_ = -4 + a020_;\na021_ = a013_ + a012_;\na005_ = a012_ + a001_;\na009_ = a012_ + a018_;\na023_ = a016_ - a003_;\na011_ = a019_ - a012_;\na005_ = a000_ - a008_;\na004_ = a024_ - a011_;\na022_ = a024_ - a009_;\na005_ = a007_ + a011_;\na001_ = a012_ + a000_;\na006_ = a020_ - cur_;\na015_ = a020_ - 1;\n} else {\na001_ = a006_ - a019_;\na019_ = 2 - a014_;\ncur_ = a021_ + a009_;\na023_ = a010_ + 3;\na005_ = a018_ + a019_;\na015_ = cur_ + a020_;\na001_ = a009_ - a021_;\na016_ = a009_ - a004_;\na005_ = a003_ + a023_;\na006_ = a008_ - a008_;\ncur_ = a013_ - -3;\na018_ = a007_ + a009_;\nif (a011_ <= a024_) {\na001_ = a001_ - a007_;\na018_ = a001_ - a010_;\na015_ = a016_ + a008_;\na009_ = a013_ - a015_;\na001_ = a018_ + a001_;\na001_ = a024_ - a002_;\na018_ = a006_ + a015_;\na001_ = a000_ - 0;\na022_ = a024_ - a009_;\na011_ = a008_ - a015_;\na009_ = a017_ + a000_;\na016_ = a005_ + a023_;\na001_ = a007_ - a023_;\na008_ = a023_ - a020_;\na023_ = a005_ - a016_;\na020_ = a024_ + a008_;\na005_ = a008_ - a003_;\na016_ = a006_ + a011_;\na006_ = a004_ + a014_;\na013_ = -2 - a001_;\na021_ = a008_ - a005_;\na000_ = a011_ - a016_;\na024_ = a008_ - a000_;\na007_ = a008_ + a013_;\n} else {\na021_ = a010_ + a018_;\na005_ = a013_ - a023_;\na012_ = a011_ - a024_;\na014_ = a002_ + a009_;\na022_ = a022_ + a015_;\na024_ = a008_ + a021_;\ncur_ = a014_ + a009_;\na018_ = a004_ + a015_;\na004_ = a018_ + a004_;\na020_ = a013_ + a005_;\na017_ = a012_ - a007_;\na011_ = a017_ - a005_;\na015_ = a012_ - a014_;\na020_ = 2 - a009_;\na019_ = a001_ + a023_;\na003_ = a008_ - a020_;\ncur_ = a005_ - a001_;\na016_ = a011_ + a022_;\na005_ = a010_ + cur_;\na018_ = a021_ - a016_;\na022_ = a005_ - a016_;\n}\nif (a011_ == a020_) {\na017_ = a007_ + a006_;\na017_ = a001_ - a002_;\na003_ = a005_ + a023_;\na012_ = a007_ + a021_;\na005_ = a020_ + a005_;\na023_ = a019_ + a003_;\na019_ = a016_ - a013_;\na013_ = a008_ + a002_;\na023_ = a004_ - a020_;\na014_ = a000_ + a013_;\na015_ = a008_ + a011_;\na010_ = a004_ - a014_;\na020_ = a022_ - a013_;\na020_ = a011_ + a015_;\na021_ = a021_ + a021_;\na024_ = a009_ - 2;\na012_ = a014_ - a018_;\na014_ = a009_ + a024_;\na021_ = a019_ - a007_;\nif (a006_ <= a022_) {\ncur_ = a004_ - a006_;\na022_ = a021_ - a003_;\na013_ = a023_ - a001_;\na011_ = a017_ - a009_;\na002_ = a000_ + a005_;\na019_ = a005_ + a023_;\na007_ = a024_ + a013_;\na014_ = a001_ - a003_;\na007_ = 3 + a003_;\na000_ = a002_ + a011_;\na000_ = a004_ + a012_;\na018_ = a013_ + a024_;\na024_ = a023_ - cur_;\na001_ = a007_ + a008_;\ncur_ = a008_ + a000_;\na012_ = a013_ + a000_;\na001_ = a008_ - a021_;\na013_ = a006_ + a018_;\na024_ = a004_ - a001_;\na014_ = a000_ - a006_;\na008_ = a010_ * 2;\na000_ = a019_ + a011_;\na000_ = a019_ + a000_;\n} else {\na014_ = a010_ - a009_;\na007_ = a009_ + a004_;\na019_ = a017_ + a006_;\na001_ = a019_ + a005_;\na015_ = a000_ - a006_;\na002_ = a011_ + a011_;\na013_ = a013_ + a015_;\na005_ = a014_ + a015_;\na017_ = a000_ + a000_;\na015_ = a019_ - a013_;\na007_ = a021_ + a005_;\na020_ = -4 + a007_;\na007_ = a022_ + a003_;\na009_ = a021_ - a001_;\na002_ = a009_ + a004_;\na016_ = a018_ + a022_;\na008_ = a007_ - a001_;\na007_ = a010_ + a010_;\na012_ = a020_ + a013_;\na006_ = a011_ + a011_;\na023_ = a021_ + a002_;\na023_ = a015_ + a011_;\na008_ = a005_ - a024_;\na019_ = a000_ - a015_;\na007_ = a022_ - a003_;\na023_ = a008_ - a007_;\na007_ = a008_ - a023_;\na024_ = a018_ + a005_;\na001_ = a013_ - a002_;\na017_ = a023_ - a011_;\na022_ = a003_ + a004_;\n}\na010_ = a017_ - a010_;\na012_ = a013_ - a019_;\na001_ = cur_ + a012_;\na017_ = a015_ + a002_;\na018_ = a023_ + a020_;\na020_ = a012_ + a022_;\ncur_ = a023_ - a005_;\na000_ = a019_ - a022_;\na002_ = a006_ + a015_;\na022_ = a015_ - a003_;\na016_ = a013_ + -1;\na010_ = a016_ - a002_;\na021_ = a009_ - a008_;\na021_ = a002_ + a003_;\na013_ = a004_ - a008_;\n} else {\na015_ = a019_ + a023_;\na001_ = a014_ - a000_;\n}\na015_ = a014_ + a023_;\n}\na002_ = a014_ + a010_;\n}\noutput.collect(prefix, new IntWritable(a023_));\n}", "private static void part1() {\n List<String> instructions = FileUtils.readFile(INPUT_TXT);\n int instructionPointer = 0;\n int accumulator = 0;\n Set<Integer> executedLines = new HashSet<>();\n\n // Run the instructions until a duplicate is found\n String instruction;\n do {\n instruction = instructions.get(instructionPointer);\n switch (instruction.substring(0, 3)) {\n case \"acc\":\n accumulator += Integer.parseInt(instruction.substring(4));\n case \"nop\":\n instructionPointer++;\n break;\n case \"jmp\":\n instructionPointer += Integer.parseInt(instruction.substring(4));\n break;\n }\n } while (instructionPointer < instructions.size() && executedLines.add(instructionPointer));\n\n System.out.println(\"The accumulator = \" + accumulator);\n }", "public void exercise_4_31()\n {\n int index = 0;\n int sum = 0;\n \n while (index < 10) {\n index++;\n sum += index;\n }\n System.out.println(sum);\n }", "@Override\n public long[] createAccumulator() {\n return new long[] {0};\n }", "public static void main(String[] args)\r\n\t{\r\n\t\tlong result = 0;\r\n\r\n\t\tfor (int i = 1; i <= 10; i++)\r\n\t\t{\r\n\t\t\tresult += firstIncorrectTerm(i);\r\n\t\t}\r\n\t\tSystem.out.println(result);\r\n\t}", "public static void main(String[] args) {\n System.out.println(accum(\"abcd\"));\n System.out.println(accum(\"RqaEzty\"));\n System.out.println(accum(\"cwAt\"));\n }", "@Override\n\t\tpublic void reduce() {\n\t\t\t\n\t\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\t\n\t\tint a= 50;\n\t\ta= --a + a++ + a-- + a++;// pre hemen post bir sonrakinde\n\n\t\t//a= 49+49+50+49 = 197\n\t\t\n\t\t\n\t\tSystem.out.println(a);\n\n\t\t\n\t\t\n\n\t}", "public static void main(String[] args)\n\t{\n\t\tdouble incrementee = Math.pow(2, 53) - 100000.0;;\n\n\t\t// Stop counting when we lose resolution of 1.0\n\t\twhile((incrementee + 1.0) - incrementee > 0.999999999) {\n\t\t\tincrementee += 1.0;\n\t\t}\n\n\t\tSystem.out.printf(\"%f\\n\", incrementee);\n\t}", "public static void main(String[] args) {\n\t\t// +=:\n\t\tint a=9;\n\t\t//\ta = a+3; //12\n\t\t\n\t\t\ta += 3; // a = a+3 \n\t\t\n\t\t\tSystem.out.println(a); //12\n\t\t\n\t\tint b = \ta += 5 ; // a=17\n\t\t\t//\t\t17 \n\t\tSystem.out.println(b); \n\t\t// a=17 , b= 17 \n\t\t\n\t\t\n\t\tint c = a += b ; // a= 34, c=34 , b=17\n\t\t//\t\t 17 += 17 = 34\n\t\tSystem.out.println(c);\n\t\t\n\t\tint d = a += c; // a= 68, d=68, c= 34, b=17\n\t\t\t\t//34+=34\n\t\tSystem.out.println(d);\n\t\t\n\t\t\n\t\tint e = (d+=b) * 2;\n\t\t//\t\t (68+17) *2\n\t\t//\t\t 85 *2 = 170\n\t\t\n\t\tSystem.out.println(e); // d = 85, b 17, e= 170, c=34\n\t\tSystem.out.println(d); // 85\n\t\tSystem.out.println(c); // 34\n\t\tSystem.out.println(b); //17\n\t\t\n\t\t// d= 85 , b=17, e = 170, c= 34\n\t\tint f = b += d * 2;\t\t\n\t\t// b += 170;\n\t\t//\t 17 +=170 ==> 187\n\t\t\n\t\tSystem.out.println(f);\n\t\t// b= 187\n\t\t\n\n\t// -=: \n\t\t\n\t\tint g = 101;\n\t\tint h = g -= 1; // g = 100, h=100\n\t//\t\t\t101 -=1 ==> 100\t\n\t\tSystem.out.println(h); \n\t\t\n\t\t\n\t\tint i = g+=h+5 ; // g=205, i=205, h=100;\n\t\t//\t\t100+=100 + 5 ==> 205\n\t\tSystem.out.println(i);\n\t\t\n\t\tint j = h+= g % i ; // h =100 , j= 100;\n\t\t//\t\t100 += 205 % 205\n\t\t//\t\t100 += 0 \n\t\tSystem.out.println(j);\n\t\t\n\t\t\n\t\tint k = j -= h * 2 % 5; // j= 100\n\t\t//\t\tj -= 200 % 5\n\t\t// 100 -= 0 \n\t\tSystem.out.println(k);\n\t\t\n\t\t\n\t// *=:\t\n\t\tint A = 100;\n\t\tA *= 200; // A = A*200\n\t\tSystem.out.println(A);\n\t\t//A = 20000;\n\t\t\n\t\tint B = 100;\n\t\t\tB *= 100 / 10;\n\t//\t\tB *=100 / 10\n\t\t\n\t\t\tSystem.out.println(B); // B=1000\n\t\t\t\n\t\tB *= B - 1000; \n\t\t//\tB *= 1000 -1000 = 0\n\t\tSystem.out.println(B);\n\t\t\n\t\t\n\t// /=:\n\t\tint C = 1000;\n\t\t\tC /= 5;\n\t\t\tSystem.out.println(C);\n\t\t\t\n\t\tint D =10;\t \n\t\t\t\n\t//\tC /= D-10; denominator can't be zero\n\t\tSystem.out.println(C); // C =200\n\t\t\n\t\tC /=D+10; // C /20 ==> 200/20 ==>10\n\t\tSystem.out.println(C );\n\t\t\n\t\t\n\t// %=:\n\t\tint z = 10%3;// ==> 10/3 =3. ... remainder: 10 - 3*3 =1\n\t\t\n\t\t\n\t\t\n\t\tint E = 10;\n\t\tE %= 2; // E = 10%2\n\t\tSystem.out.println(E);\n\t\t\n\t\tint F = 100;\n\t\t\tF %=2; // F = F%2; ==>0\n\t\tSystem.out.println(F); // if it's 0 it means it's even number\n\t\t\n\t\t\n\t\tSystem.out.println(-100%3);\n\t\tSystem.out.println( 10.5% 3 ); \n\t\t//\t\t\t\t10.5 /3 = 3 reminder: 10.5 - 3*3 = 1.5\n\t\t\n\t\t\n\t\tint J = 300;\n\t\tint K =10;\n\t\t\n\t\t J += J %= K ;\n\t\t// j += 0\n\t\t// 300 +=0 ==>300\n\t\t\n\t\tSystem.out.println(J); // 300\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "@Override\n public Integer reduceInit() { return 0; }", "private static void test() {\n\t\tint i = 0;\n\t\tArrays.fill(arr, -1);\n\t\tarr[++i] = 0;\n\t\tprintArray(arr);\n\t\ti = 0;\n\t\tArrays.fill(arr, -1);\n\t\tarr[i++] = 0;\n\t\tprintArray(arr);\n\t\t\n\t}", "@Override public void postGlobal() {\n for(int i=1;i<_chkSums.length;++i) _chkSums[i] += _chkSums[i-1];\n }", "public static void main(String[] args) {\n\t\tint array[] = { 5, 2, 3, 6, 1 };\n\t\tint total = ((array.length + 1) * (array.length + 2)) / 2;\n\t\tSystem.out.println(total);\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\ttotal -= array[i];\n\t\t}\n\t\tSystem.out.println(\"Missing number=\" + total);\n\t}", "private int flushValue() {\n int flushValue = 0;\n if (inSameSuit()) {\n flushValue += 4;\n \n char firstCardSuit = cards[0].charAt(1);\n char StartCardSuit = cards[cards.length-1].charAt(1);\n \n if(firstCardSuit==StartCardSuit){\n flushValue +=1;\n }\n } \n return flushValue;\n }", "public static void main(String[] args) {\n\t\tint[] a = {38, 27, 43, 3, 9, 82, 10};\n\t System.out.println(\"Add after forloop: \"+ sumByForloop(a));\n\t System.out.println(\"Add after while: \"+ sumByWhile(a));\n\t System.out.println(\"Add after rec: \"+ sumByRec(a,a.length-1));\n\n\t}", "public static void main(String[] args) {\n\t\tint loopidx = 1\r\n\t\tint sum =0;\r\n\t\tfinal LAST_loop_IDX =10;\r\n\t}", "public static void main(String[] args) {\n\t\tint i = 10;\r\n\t\t// i++;\r\n\t\t i=i+1;\r\n\t\t System.out.println(i);\r\n\t\t i=i+2;\r\n\t\t System.out.println(i);\r\n\t\t \r\n\t\t i+=3;\r\n\t\t System.out.println(i);\r\n\t\t \r\n\t\t i++;\r\n\t\t System.out.println(i);\r\n\t\t \r\n\t\t/* j=j+1;\r\n\t\t System.out.println(j); because we did not declare any variable*/\r\n\r\n\t}", "public static void main(String[] args) \n\t{\n\t\tint[][] rez=(sumsUp(new int[]{7,6,5,4,3,2,1}));\n\t\tSystem.out.println(Arrays.deepToString(rez));\n\t\t\n\t}", "@Override\n public int accion() {\n return this.alcance*2/3*3;\n }", "private static void calc1(int x) {\n\t\tx+=1;\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tint a=299;\n\t\tint b=a++;//first assing__>incremet(int b=a; a=a+1)\n\t\t\n\t\tSystem.out.println(a);//300\n System.out.println(b);//299\n \n \n //post decrement x--;\n \n \n \n //int x=10;\n // int y=x;\n //System.out.println(x+\" \"+y);\n\tint z=10;\n int c=z--;//first assing -->decrement(int c=z;z=z-1)\n\tSystem.out.println(z);//9\n\tSystem.out.println(c);//10\n\t\n\t\n\t\n\t}", "private int scoreCounter(int result) {\n result +=1;\n return result;\n }", "@Override\n public void reduce() {\n if(null != getState())\n switch(getState()) {\n case OPERATOR:\n if (getDispenser().tokenIsOperator() && numOpNumOnStack())\n priorityReduce();\n break;\n case RIGHT_PAREN:\n if (getDispenser().tokenIsRightParen()) {\n if (!getStack().contains('('))\n throw new RuntimeException(\"Error -- mismatched parentheses\");\n while ((char)getStack().get(getStack().size() - 2) != '(')\n reduceNumOpNum();\n double aNum = (double)getStack().pop();\n getStack().pop();\n getStack().push(aNum);\n }\n break;\n case END:\n if (getDispenser().tokenIsEOF()) {\n if(getStack().contains('('))\n throw new RuntimeException(\"Error -- mismatched parentheses\");\n while(numOpNumOnStack())\n reduceNumOpNum();\n if(getStack().size() != 1)\n throw new RuntimeException(\"Error -- mismatched parentheses\");\n }\n break;\n }\n }", "public static void main(String[] args) {\n\t\tint a = 10;\n\t\tSystem.out.println(\"the score is\" + a);\n\t\t\n\t\t\n\t\t// a = a + 2\n\t\ta+=2;\n\t\tSystem.out.println(a);\n\t\t\t\t\n\t\t\n\t\t\n\t\tint k = 10;\n\t\t\n\t\tk -= 1; // k = k - 1;\n\t\t\n\t\tSystem.out.println(k);\n\t\t\n\t\tk/= 2; // k = k/2\n\t\tSystem.out.println(k);\n\t\t\n\t\tint j = 10;\n\t\tj = j + 2;\n\t\tj += 2;\n\t\tj++; // ++j;\n\t\tSystem.out.println(j);\n\t\tint c = 10;\n\t\tc++;\n\t\tSystem.out.println(\"c++ is \" + c);\n\t\tint d = 10;\n\t\t++d;\n\t\tSystem.out.println(\"s++ is \" + d);\n\t\t\n\t}", "public static void main(String[] args){\n int i = 0;\n int sum = 0;\n while (sum <= 10){\n i++;\n sum += i;\n System.out.println(i+ \",\" + sum);\n }\n }", "void recalc() {\n\t\tthis.currentValue = baseValue;\n\t\tthis.modifiers.stream().forEach(a -> this.currentValue += a.getValue());\n\t}", "public static void main(String[] args) {\n\n\t\tint result = 1 + 2 ; // 1 + 2 = 3\n\t\tSystem.out.println(\" 1 + 2 = \" + result );\n\t\tint previousResult = result ;\n\t\tSystem.out.println(\" previousResult = \" + previousResult );\n\t\t\n\t\tresult = result - 1; // 3 - 1 = 2\n\t\tSystem.out.println(\" 3 - 1 = \" + result );\n\t\tSystem.out.println(\" previousResult = \" + previousResult );\n\t\t \n\t\tresult = result * 10; // 2 * 10 = 20\n\t System.out.println(\" 2 * 10 = \" + result );\n\t \n\t result = result / 5; // 20 / 5 = 4\n\t System.out.println(\" 20 / 5 = \" + result );\n\t \n\t result = result % 3; // the reminder of(4 % 3)\n\t System.out.println(\" 4 % 3 = \" + result );\n\t \n\t // result = result + 1;\n\t result++; // 1 + 1 = 2\n\t System.out.println(\" 1 + 1 = \" + result );\n\t \n\t // result = result - 1;\n\t result--; // 2 - 1 = 2\n\t System.out.println(\" 2 - 1 = \" + result );\n\t \n\t //result = result + 2;\n\t result += 2; // 1 + 2 = 3\n\t System.out.println(\" 1 + 2 = \" + result );\n\t \n\t //result = result * 10;\n\t result *= 10; // 3 * 10 = 30\n\t System.out.println(\" 3 * 10 = \" + result );\n\t \n\t //result = result / 3\n\t result /= 3; // 30 / 3 = 10\n\t System.out.println(\" 30 / 3 = \" + result );\n\t \n\t //result = result - 2\n\t result -= 2; // 10 - 2 = 8\n\t System.out.println(\" 10 - 2 =\" + result );\n\t \t\t\n// IF THEN STATEMENT\n\t \n\t boolean isAlien = false;\n\t if (isAlien == false) {\n\t System.out.println(\"It is not an alien!\");\n\t System.out.println(\" And I am scared of aliens\");\n\t \n\t }\n\t \n\t int topscore = 100;\n\t if (topscore >= 100){\n\t System.out.println(\" you got the high score\");\n\t \n\t }\n\t \n\t int secondtopscore = 90;\n\t if (topscore > secondtopscore && topscore > 90) {\n\t System.out.println(\"topscore is greater than secondtopscore and equal to topscore\");\n\t }\n\n\t \n\t \n\t if ((topscore > 100 ) || (secondtopscore < 100 ) ) {\n\t\t System.out.println(\"Either or both of the condition are true\");\n\t }\n\t \n\t \n\t ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t \n\t \n\t \n\t \n\t \n\t \t\t\n\t \t\n\n\n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t}", "public static void main(String[] args) {\n\n int finalNumber = 8;\n\n sum(finalNumber);\n System.out.println(sum(finalNumber));\n }", "public static void main(String[] args) {\n\n printResult(2 + 3);\n int a = 2 + 4;\n printResult(a);\n int result = add(2, 5);\n printResult(result);\n printResult(add(2, 6));\n schreibHallo();\n int ten = returnTen();\n System.out.println(ten);\n }", "static void opration(){ \n System.out.println(\"Final veriable value l:\"+l+\"\\nj:\"+j);\n // l=l+2; erorr it can't change it's value\n \n }", "public static void main(String[] args) {\n\t\t\r\n\t\tint arradd = 0 ; \r\n\t\t\r\n\t\tint[] arr = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 , 11, 12 ,\r\n\t\t\t\t13,14 , 15, 16, 17 , 18 , 19 , 20 , 21,22,\r\n\t\t\t\t23 ,24,25,26,27,28,29,30,31,33,32,35};//new int[]{1,2,3,4,6 } ;\r\n\t\t\r\n\t\tint n = arr.length+1 ;\r\n\t\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\tint sum = n * (n+1)/2 ;\r\n\t\t\r\n\t\tSystem.out.println(sum);\r\n\t\t\r\n\t\tfor(int a = 0 ; a <arr.length ; a ++){\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t arradd = arradd + arr[a];\r\n\t\t}\r\n\r\n\t\tSystem.out.println(arradd);\r\n\t\t\r\n\t int m = sum- arradd ; \r\n\t \r\n\t System.out.println(m + \" - is the missing array\");\r\n\t}", "private void increment() {\r\n salary = (int) (salary + salary * 0.2);\r\n }", "@Override\n public StringBuilder createAccumulator() {\n return null;\n }", "public int step() {\n ArrayList<Integer> copy = new ArrayList<Integer>();\n for (int i = 1; i < register.size(); i++) { \n copy.add(register.get(i));\n }\n int tapNum = register.get(register.size()-tap-1);\n int begin = register.get(0);\n if (tapNum == 1 ^ begin == 1) {\n copy.add(1);\n }\n else {\n copy.add(0);\n }\n register.clear();\n register.addAll(copy);\n return register.get(register.size()-1);\n }", "public static void main(String[] args) {\nint a=10;\nSystem.out.println(a);\na+=2;\nSystem.out.println(a);\na-=2;\nSystem.out.println(a);\na*=2;\nSystem.out.println(a);\na/=2;\nSystem.out.println(a);\na%=2;\nSystem.out.println(a);\n\t}", "public static void main(String[] args) {\n\t\tint[] arr={1,2,3,4,5,7,8,9,10};\n\t\tint missingNumber=0;\n\t\tint n=arr.length+1;\n\t\tint sum=n*(n+1)/2;\n\t\tint restSum=0;\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\trestSum=restSum + arr[i];\n\t\t\t missingNumber=sum-restSum;\t\n\t}\n\t\tSystem.out.println(missingNumber);\n//------------------------------------------------------//\n\t}", "@Test\n public void countDistinctUpToAlgebraicTest() throws IOException\n {\n\t countDistinctUpToAlgebraic(\"50\", 20); \n\t \n\t // check flow in which Intermediate passes the max count as a null in its result\n\t countDistinctUpToAlgebraic(\"5\", 5);\n }", "public static void main(String[] args) {\n\t\tint sum = 0;\n\t\tint sum1 = 0;\n\t\tint sum2 = 1;\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tsum = sum1 + sum2;\n\t\t\t\n\t\t\t// the purpose of that, storing the sum into the prev index.\n\t\t\t// in that way we can store the old values\n\t\t\tsum1 = sum2;\n\t\t\tsum2 = sum;\n\t\t\tSystem.out.print(sum + \" \");\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tint[]a=new int[10];\n\t\tfor(int i=0;i<a.length;++i){\n\t\t\ta[i]=i;\n\t\t}\n\t\tprint(a,0);\n\t\tSystem.out.println();\n\t\tSystem.out.println(sum(a,0));\n\t}", "public static void main(String[] args) {\nint sum=0,a=0;\r\n\t\t\r\n\t\tfor(int i=2;i<=8;i++){\r\n\t\t\tif(i%2==0){\r\n\t\t\tsum=sum+i;\r\n\t\t\t\r\n\t\t\tSystem.out.println(sum);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(judgeSquareSum(1));//10000000001000000001\n\t}", "public static int Main()\n\t {\n\t\t int x;\n\t\t int j;\n\t\t int[] a = new int[16];\n\t\t x = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t int i = 1;\n\t\t int k = 0;\n\t\t while (x != -1)\n\t\t {\n\t\t\ta[i] = x;\n\t\t\ti++;\n\t\t if (x != 0)\n\t\t {\n\t\t\t k = i;\n\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\tint sum = 0;\n\t\t\t for (i = 1;i <= k;i++)\n\t\t\t {\n\t\t\t\t for (j = 1;j <= k ;j++)\n\t\t\t\t {\n\t\t\t\t if (a[i] == 2 * a[j])\n\t\t\t\t {\n\t\t\t\t\t sum++;\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t }\n\t\t\t\t\tSystem.out.print((sum - 1));\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t\ti = 1;\n\t\t\t }\n\t\t\tx = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t }\n\t\t\treturn 0;\n\t }", "public static void main(String[] args) {\n\n\t\tint a = 100;\n\t\ta += 3; //a= a + 3;\n\t\tSystem.out.println(\"a: \"+a); // 103\n\t\ta -= 10; // == a = a - 10;\n\t\tSystem.out.println(\"a: \"+a); // 93\n\t\ta*=3; //== a=a*3;\n\t\tSystem.out.println(\"a: \"+a); // 279\n\t\ta /=10; // == a=a/10;\n\t\tSystem.out.println(\"a: \"+a); // 27\n\t\ta%=5;\n\t\tSystem.out.println(\"a: \"+a); // 2\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t int m= 9, n= 1,x=0 ;\n\t\t \n\t\t while (m>n) {\n\t\t\t m--;\n\t\t\t n+=2;\n\t\t\t x+=m+n;\n\t\t\t \n\t\t\t \n\t\t\t \n\t\t\t \n\t\t }\n\t\t System.out.println(x);\n\t\t \n\t\t \n\t\t \n\t\t // a) 11\n\t \t// b) 13\n //c) 23\n //d) 36\n //e) 50\n\t\t\n\n\t}", "public static void main(String[] args) {\n\t\tint num=666;\r\n\t\t//declr 3 more\r\n\t\tint calculated=0;\r\n\t\tint remainder;\r\n\t\tint original;\r\n\t\t//Assign i/p into variable orignal\r\n\t\tSystem.out.println(\"ip - \"+num);\r\n\t\toriginal=num;\r\n\t\t//use loop to calculate:use while loop to set condn until the num is > 0\r\n\t\twhile (num>0) {\r\n\t\t\t//get the remainder done when divided by 10\r\n\t\t\tremainder=num%10;\r\n\t\t\tnum=num/10;\r\n\t\t\t//use formula\r\n\t\t\tcalculated=calculated+((remainder)*(remainder)*(remainder));\r\n\t\t\tSystem.out.println(calculated);\r\n\t\t}\r\n\t\t\t//check wheather cal & orgil r same\r\n\t\tif(calculated==original)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Armstrong\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Not an Armstrong\");\r\n\t\t}\r\n\t}", "public static void main (String [] args){\n int a = 0;\n int b = 1;\n int c;\n \n for (int n = 0; n <= 30; n++) {\n if(n == 0){\n System.out.println(\"n=\"+n+\" -> \"+a);\n }else if (n == 1){\n System.out.println(\"n=\"+n+\" -> \"+b);\n }else{\n c = b + a;\n a = b;\n b = c;\n System.out.println(\"n=\"+n+\" -> \"+c);\n }\n \n }\n \n }", "public static void main(String[] args) {\n\t\tint arr[] = { 0, 3, 7, 6, 4, 0, 5, 5, 5 };\n\t\tplusOne(arr);\n\t\tplusOne1(new ArrayList<Integer>(Arrays.asList(0, 3, 7, 6, 4, 0, 5, 5, 5)));\n\t}", "public static void main(String[] args) {\n\n for(int i=1;i<0;i++)\n {\n System.out.println(i);\n }\n\n System.out.println(\"program ended\");\n\n // int i=1;\n // System.out.println(i);\n // i++;\n\n // System.out.println(i);\n // i++;\n\n // System.out.println(i);\n // i++;\n\n // System.out.println(i);\n // i++;\n\n // System.out.println(i);\n }", "public static void main(String[] args) {\n\t\tScanner scn=new Scanner(System.in);\r\n\t\tint num=scn.nextInt();\r\n\t\tint arr[]={1,2,4,5};\r\n\t\tint actualsum=0;\r\n\t\tint expectsum=0;\r\n\t\tfor(int i=0;i<num;i++){\r\n\t\t\texpectsum=expectsum+(i+1);\r\n\t\t}\r\n\t\t\r\n\t\tfor(int j=0;j<arr.length;j++){\r\n\t\t\tactualsum=actualsum+arr[j];\r\n\t\t}\r\n\t\tSystem.out.println(expectsum-actualsum);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\nint n1=20;\r\nn1 =50;\r\nSystem.out.println(n1);\r\nn1+=50;\r\nSystem.out.println(n1);\r\nn1-=30;\r\nSystem.out.println(n1);\r\nn1*=2;\r\nSystem.out.println(n1);\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\tint a=3;\r\n\tint b=2;\r\n\tint c=0;\r\n\t\r\n\t\tfor(int i=1;i<=10;i++)\r\n\t\t{\r\n\t\t\tc=a+b;\r\n\t\t\ta=b;\r\n\t\t\tb=c;\r\n\t\t\tSystem.out.println(c);\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\tint[] arr = { 2, 3, -8, 100, -4, 6, 7 };\n\t\tSystem.out.println(CircularSum(arr));\n \n\t}", "public static void main(String[] args){\n\t\t\n\t\tfor (int i = 0; i<999999;i++) results.add(0);\t\n\n\t\tsetChain(1L);\n\t\tboolean switcher = true;\n\t\t//while switch=true ... and once chain length is added to, switch = false\n \t\tlong best = 0L;\n\t\tint index=0;\n\t\t\t\n\t\tfor (long j = 1L; j < 1000000L; j++) {\n\n\t\t\tsetCur((int)j);\n\n\t\t\tfindChain(j);//} catch(Exception e){System.out.println(\"stackOverFlow :D\");}\n\t\t\tif (getChain() > best) {best = getChain(); index=getCur();}\n\t\t\t//now store results for later use if we come across that number.\n\t\t\tresults.set(getCur()-1, (int)getChain());\t\n\t\t\tsetChain(1L); //reset\n\t\t\t/* \t\n\t\t\tswitcher=true;\n\t\t\tint i = j;\n\t\t\twhile (switcher) {\n\n\t\t\t\tif (i==1) {//results.add(chainLength); \n\t\t\t\t\tif (chainLength > best) { best=chainLength; index = j;}\n\t\t\t \tchainLength=1; switcher=false;}\n\t\n\t\t\t\telse { i=recurse(i); chainLength++; }\t\n\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t*/\n//\t\t }\n\t\t}\n\t\tSystem.out.println(index);\n\t}", "public static void main(String[] args) {\n\t\tfor (int i = 0; i < memo.length; i++)\n\t\t\tmemo[i] = -1;\n\t\tSystem.out.println(memoFib(7));\n\n\t}", "private final int m28109e(int i) {\n return i + i;\n }", "static void problemEight() {\n int i = 0;\n int prevNum = 1;\n System.out.println(i);\n while (i < 50) {\n int temp = i + prevNum;\n if (temp < 50) System.out.println(temp);\n prevNum = i;\n i = temp;\n }\n }", "public static void main(String[] args) \n\t{\n\t\t\n\t\tint sum = 153;\n\t\tint num1 = 0;\n\t\t\n\t\twhile(sum>0)\n\t\t{\n\t\t\tint num = sum%10; //3\n\t\t\tnum1 = num1+num*num*num;\n\t\t\tsum = sum/10;\n\t\t}\n\t\t\n\t\tSystem.out.println(num1);\n\t\t\n\n\t}", "static void compute(List<Integer> slate, int[] input) {\n if (input.length == 0)\n System.out.println(slate);\n else {\n int[] copy = Arrays.copyOfRange(input, 1, input.length);\n compute(slate, copy);\n slate.add(input[0]);\n compute(slate, copy);\n slate.remove(slate.size() - 1);\n }\n }", "private double noBranch() {\n\t\treturn num * configMap.get('r') + (num-1) * configMap.get('l') + num * configMap.get('f') + configMap.get('a');\n\t}", "private static int calc(int c) {\n\t\treturn 1;\n\t}", "protected void assignCurrentValue() {\n\t\tcurrentValue = new Integer(counter + incrValue);\n\t}", "public static void main(String[] args) \n { \n \n System.out.println(\"Maximum water that can be accumulated is \" + \n \t\tanswer(arr)); \n }", "public static void main(String[] args) {\n\t\tint a;\r\n\t\tint b;\r\n\t\ta=1;\r\n\t\tb=++a+a++;\r\n\t\tSystem.out.println(a);\r\n\t\tSystem.out.println(b);\r\n\r\n\t}", "public static void main(String[] args) {\n int arr[]= new int[100];\n for(int i=0;i<=99;i++)\n {\n \t if(i!=55)\n \t\t arr[i]=i+1;\n \t System.out.print(arr[i]+\" \");\n }\n int sum=0,sum1=0;\n for(int i=0;i<100;i++)\n {\n \t sum=sum+(i+1);\n \t sum1=sum1+arr[i];\n \t \n }\n System.out.println(\"\\n\"+(sum-sum1));\n\t}", "public static void main(String[] args) {\n\t\tint sum = 0;\n\t\tint cnt = 1;\n\t\tfor(int i = 77; i >= 1; i--) {\n\t\t\tsum = sum + (i*cnt);\n\t\t\tcnt++;\n\t\t}\n\t\tSystem.out.println(sum);\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tint little = 0;\n\t\tint zero = 1;\n\t\tint one = 0;\n\t\tint big = 0;\n\t\tint total = 0;\n\t\tfor (int i = 0; i<12;i++){\n\t\t\tbig += one;\n\t\t\tone = zero;\n\t\t\tzero = big;\n\t\t\t\n\t\t}\n\n\t\ttotal = big+one+zero;\n\t\tlittle = zero+one;\n//\t\tSystem.out.println(zero);\n//\t\tSystem.out.println(one);\n\t\tSystem.out.println(little);\n\t\tSystem.out.println(big);\n\t\tSystem.out.println(total);\n\t}", "public static void main(String[] args) throws Exception {\n int arr[]= {7,9,88,-33,2,12,6,1};\n Arrays.sort(arr);\n /*for(int i=0; i<arr.length; i++)\n \t System.out.print(arr[i]+\", \");\n System.out.println(\"\\n DESC\");\n System.out.print(\"{ \");\n for(int i=arr.length-1; i>=0; i--) {\n \t if(arr[i]==arr[0])\n \t System.out.print(arr[i]);\n \t else \n \t\t System.out.print(arr[i]+\", \");\n }*/\n // System.out.print(\" }\");\n \n int[] ar= {6,2,2,5,2,2,1};\n int startIndex=0;\n int lastIndex=ar.length-1;\n //a is sumRight,b = sumLeft\n int a=0,b=0;\n /* while(true) {\n \t \n \t if(b>a) \n \t\t //1+2+2=+5\n \t\t a+=ar[lastIndex--];\n \t else \n \t\t //6+2+2\n \t\t\t b+=ar[startIndex++];\n \t\tif(startIndex>lastIndex) {\n \t\t\tSystem.out.println(startIndex);\n \t\t\tif(a==b)\n \t\t\t\tbreak;\n \t\t\t else\n \t\t\t throw new Exception(\"not a valid array\");\n \t\t\t\n \t\t}\n \t\t\t \n \t\t\n }\n System.out.println(lastIndex);\n */\n \n \n while(true) {\n \t \n \t if(b>a)\n \t\t a+= ar[lastIndex--];\n \t else\n b+=ar[startIndex++];\n \t if(startIndex>lastIndex) {\n \t\t if(a==b)\n \t\t\t break;\n \t }\n }\n System.out.println(lastIndex);\n\t}", "public static void main(String[] args) {\n // initialize number to sum up to.\n int x = 3792;\n // Display the summation result.\n System.out.println(\"The sum of integers from 1 to \" + x +\n \" is \" + summation(x) + \".\");\n }", "private int caculate(Operation opt, int t1, int t2) {\n\t\tint res;\n\t\tswitch (opt) {\n\t\tcase ADD:\n\t\t\tres = t1 + t2;\n\t\t\tbreak;\n\t\tcase SUB:\n\t\t\tres = t1 - t2;\n\t\t\tbreak;\n\t\tcase MUL:\n\t\t\tres = t1 * t2;\n\t\t\tbreak;\n\t\tcase DIV:\n\t\t\tres = t1 / t2;\n\t\t\tbreak;\n\t\tcase NULL:\n\t\t\terr.error(\"No operation in caculating.\");\n\t\t\tres = 0;\n\t\tdefault:\n\t\t\tres = 0;\n\t\t\tbreak;\n\t\t}\n\t\treturn res;\n\t\t/*\n\t\t * lex.intHolder.add(res); return lex.intHolder.lastIndexOf(res);\n\t\t */\n\t}", "public static int addOne( int a){\n int b;\n //System.out.println(b+1);\n return a += 1;\n}", "public static void main(String[] args) {\n // System.out.println(carry);\n // System.out.println(carry <<= 1);\n // System.out.println(carry >>= 1);\n int[] digits = {1,2,3};\n digits = new int[digits.length + 1];\n digits[0] = 1;\n System.out.println(digits[0]);\n System.out.println(digits[1]);\n System.out.println(digits[2]);\n System.out.println(digits[3]);\n\n }", "public static void main(String[] args) {\n long x1= 0;\r\n long x2= 1;\r\n long x3= 0;\r\n long reihe =2;\r\n \r\n System.out.println(\". Fibonacci zahl ist: \" +x1);\r\n System.out.println(\". Fibonacci zahl ist: \" +x2);\r\n \r\n while(x3<=400){ \r\n \t x3= x1+x2;\r\n \t x1= x2;\r\n \t x2=x3;\r\n \t \r\n \t reihe++;\r\n \t System.out.println(reihe+ \". Fibonacci zahl ist= \" +x3);\r\n }\r\n \r\n \r\n\t\r\n\r\n\t}", "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 run() {\n BigInteger answer = BigInteger.valueOf(0);\n String stringInt;\n List<Integer> list = new ArrayList<Integer>();\n int sum = 0;\n\n answer = MathFunctions.numberFactorial(100);\n\n stringInt = answer.toString();\n\n\n\n list = MathFunctions.addStringToArray(stringInt);\n\n for (int i = 0; i < list.size(); i++)\n sum += list.get(i);\n\n this.answer = sum;\n }", "public static void main(String[] args) {\n Long sum = 0L;\n for (long i = 0; i < Integer.MAX_VALUE; i++) {\n sum += i;\n }\n System.out.println(sum);\n}", "protected final void operationLSRAccumulator() {\r\n this.carryFlag = (this.ac & 0x01) != 0;\r\n this.ac >>= 1;\r\n this.zeroFlag = (this.ac == 0);\r\n this.signFlag = false;\r\n }", "public void doAll() {\n for (int i = 0; i < Integer.MAX_VALUE; i++) {\n sum += sumLoop(sumLoopArray);\n sum += sumIfEvenLoop(sumLoopArray);\n sum += sumIfPredicate(sumLoopArray);\n sum += sumShifted(3, 0x7f, sumLoopArray);\n addXtoArray(i, addXArray);\n sum += sumLoop(addXArray);\n addArraysIfEven(addArraysIfEvenArrayA, addArraysIfEvenArrayB);\n addArraysIfPredicate(addArraysIfEvenArrayA, addArraysIfEvenArrayB);\n sum += sumLoop(addArraysIfEvenArrayA);\n }\n }", "private static void evaluateCase() {\n try {\n int n = SYS_IN.nextInt();\n int m = SYS_IN.nextInt();\n SYS_IN.nextLine();\n int mn = Integer.MAX_VALUE;\n long sum = 0L;\n int num;\n int sign = 1;\n for (int ni = 0; ni < n; ni++) {\n for (int mi = 0; mi < m; mi++) {\n num = SYS_IN.nextInt();\n if (num < 0) {\n sign *= -1;\n num = -num;\n }\n sum += num;\n mn = Math.min(mn, num);\n }\n SYS_IN.nextLine();\n }\n if (sign == -1) {\n sum -= 2 * mn;\n }\n System.out.println(sum);\n } catch (Exception e) {}\n }", "public static void main(String[] args) {\n\t\tint[] c = new int[]{9,9};\r\n\t\tint[] s = plusOne(c);\r\n\t\tfor(int i=0;i<s.length;i++)\r\n\t\t\tSystem.out.println(s[i]);\r\n\t}", "private static void backTrack(String num, long target, int start, long sum, long subSum,\n char[] exp, int expLen, List<String> result) {\n if (start >= num.length()) {\n if ((sum + subSum) == target) {\n result.add(new String(exp, 0, expLen));\n }\n return;\n }\n long curNum = 0;\n int expId = (start == 0) ? expLen : expLen + 1;\n for (int i = start; i < num.length(); ++i) {\n curNum = 10 * curNum + (int)(num.charAt(i) - '0');\n exp[expId++] = num.charAt(i);\n if (start == 0) {\n backTrack(num, target, i+1, sum + subSum, curNum, exp, expId, result);\n } else {\n exp[expLen] = '+';\n backTrack(num, target, i+1, sum + subSum, curNum, exp, expId, result);\n exp[expLen] = '-';\n backTrack(num, target, i+1, sum + subSum, -curNum, exp, expId, result);\n exp[expLen] = '*';\n backTrack(num, target, i+1, sum, subSum * curNum, exp, expId, result);\n }\n if (i == start && num.charAt(i) == '0') {\n break;\n }\n }\n }", "public static void main(String[] args) {\n\t\tint[] arr = new int[] {1,4,20,3,10,5};\n\t\tint givenSum = 33;\n\t\tint sum = 0;\n\t\tint left = 0,right = left;\n\t\tboolean flag = false;\n\t\twhile(left<=(arr.length-1)) {\n\t\t\tsum = sum + arr[left];\n\t\t\tif(sum == givenSum) {\n\t\t\t\tSystem.out.println(left +\"\\t\"+right);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tright++;\n\t\t\twhile(right<=(arr.length-1)) {\n\t\t\t\tsum = sum + arr[right];\n\t\t\t\tif(sum == givenSum) {\n\t\t\t\t\tSystem.out.println(left +\"\\t\"+right);\n\t\t\t\t\tflag = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tright++;\t\n\t\t\t}\n\t\t\tif(flag)\n\t\t\t\tbreak;\n\t\t\tsum = 0;\n\t\t\tleft++;\n\t\t\tright=left;\n\t\t}\n\t\t\n\t}", "public static void main(String[] args) {\n BigInteger count1 = hanoiIteration(5);\r\n\r\n BigInteger count2 = hanoiIteration(64);\r\n// System.out.println(count);\r\n System.out.println(count1);\r\n System.out.println(count2);\r\n\r\n System.out.println(showStep2(5, \"A\", \"B\", \"C\"));\r\n }", "private void addition()\n {\n\tint tempSum = 0;\n\tint carryBit = 0;\n\tsum = new Stack<String>();\n\tStack<String> longerStack = pickLongerStack(number, otherNumber);\n\twhile(!longerStack.isEmpty())\n\t{\n\t tempSum = digitOf(number) + digitOf(otherNumber) + carryBit; //adding\n\t carryBit = tempSum / 10;\n\t sum.push((tempSum % 10) + \"\"); //store the digit which is not carryBit\n\t}\n\tif(carryBit == 1) sum.push(\"1\"); //the last carry bit need to be add as very first digit of sum if there is carry bit\n }", "static void cma_with_acc(String passed){\n\t\tint val = hexa_to_deci(registers.get('A'));\n\t\tString bin = Integer.toBinaryString(val);\n\t\tfor(int i=bin.length();i<8;i++)\n\t\t\tbin = \"0\"+bin;\n\t\tval=0;\n\t\tfor(int i=7;i>=0;i--)\n\t\t\tif(bin.charAt(i)=='0')\n\t\t\t\tval+=(Math.pow(2,7-i));\n\t\tregisters.put('A',decimel_to_hexa_8bit(val));\n\t}", "public static void main(String[] args) {\nint a = 4;\n\na += 2;\na -= 2;\na %= 2;\n\n\nSystem.out.println(a);\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tint a[]= {2,3,4,5,6,5,4,3,2};\r\n\t\tfor(int i:a) {\r\n \t\t\tSystem.out.print(\" \"+i);\r\n \t\t}\r\n \t\tSystem.out.println();\r\n \t\tSystem.out.print(\"Missing number \");\r\n \t\tint single=a[0];\r\n \t\tfor(int i=1;i<a.length;i++) {\r\n \t\t single=single^a[i];\r\n \t\t}\r\n \t\tSystem.out.print(single);\r\n \t\t\r\n \r\n\t}", "public static void main(String[] args){\n\t\tint[] intArr = new int[100];\n\t\tfor(int i = 0; i < 100; i++){\n\t\t\tintArr[i] = i + 1;\n\t\t}\n\t\t\n\t\t// use tail recursion\n\t\tint tSum = tailSum(intArr);\n\t\tSystem.out.println(\"Tail recursion sum: \" + tSum);\n\t\t\n\t\t// use normal recursion\n\t\tint nSum = sum(intArr);\n\t\tSystem.out.println(\"Normal recursion sum: \" + nSum);\n\t}", "static int addOne(int[] a, int offset, int mlen, int carry) {\n offset = a.length-1-mlen-offset;\n long t = (a[offset] & LONG_MASK) + (carry & LONG_MASK);\n\n a[offset] = (int)t;\n if ((t >>> 32) == 0)\n return 0;\n while (--mlen >= 0) {\n if (--offset < 0) { // Carry out of number\n return 1;\n } else {\n a[offset]++;\n if (a[offset] != 0)\n return 0;\n }\n }\n return 1;\n }", "protected int algo() {\r\n result = algo(root, -2000000000, 2000000000);\r\n\r\n // Nach Terminierung des Algorithmus\r\n lang.nextStep();\r\n setExplain(200, result, 0);\r\n colorNode(root, seenNodeColor);\r\n code.unhighlight(14);\r\n return result;\r\n }", "public static void main(String[] args) {\n int a = 20;\n System.out.println(a++); // will output 20, then the next time a is used,\n // value is 21\n System.out.println(a++); // now 21 and next will be 22 and etc.\n\n int e = 20;\n System.out.println(a--); // will output 20, then the next time a is used,\n // value is 19\n System.out.println(a--); // now 19 and next will be 18 and etc.\n\n\n int b = 30; // will output 30 - 1, since it is assigning it to another data\n // right away\n int c = b--; // will output 30 ,\n\n System.out.println(b); // 29\n System.out.println(c); // 30\n /* PRE Increment / Decrement: Outputs the CURRENT VALUE, and\n Changes number of the value by + or - 1 IMMEDIATELY\n */\n int x = 200;\n System.out.println( --x);\n // ^ outputs 199\n System.out.println(++x);\n // ^ outputs 200; it took 199 & then added 1\n\n int z = 100;\n // Post + Pre - Post + Pre\n // Value of z = 100 + 101 - 100 + 99\n z = z++ + --z - z-- + ++z;\n //Post/Pre z = 100 + 100 - 100 + 100 = 200\n System.out.println(z);\n\n int u = 900;\n // value of u = 901 , 902 , 903\n int r = - ++u + ++u + -u++;\n //Post/Pre zu = -901 + 902 + -902 = - 901\n System.out.println(r);\n\n\n }", "public static void main(String[] args) {\n int i=12;\n i=i++;\n System.out.println(i);\n }", "protected static void performReduceWithABinaryOperator() {\n Integer sum = Stream.of(1, 2, 3, 4, 5).reduce(0, Integer::sum);\n\n Integer minValue = Stream.of(5, 4, 9, 2, 1).reduce(Integer.MIN_VALUE, Integer::max);\n\n String concatenation = Stream.of(\"str \", \"= \", \"alt \", \"string\")\n // the first parameter becomes the target of the concat method and the second one is the argument to concat\n // the target, the parameter and the result are of the same type and this can be considered a binary\n // operator for the reduce method\n .reduce(\"\", String::concat);\n System.out.println(concatenation);\n }", "@Override\n public Integer reduce(Integer value, Integer sum) {\n return value + sum;\n }" ]
[ "0.6204647", "0.60452706", "0.6044147", "0.59945023", "0.59425944", "0.5931767", "0.5870402", "0.57875896", "0.5736564", "0.57040256", "0.56936944", "0.5664742", "0.56570977", "0.5635074", "0.5626135", "0.56261295", "0.55828494", "0.5573674", "0.5560427", "0.5559996", "0.5548436", "0.55376947", "0.5501727", "0.5454725", "0.54382414", "0.54316145", "0.53920513", "0.53913593", "0.53568697", "0.5343742", "0.53370404", "0.53353864", "0.53296417", "0.532916", "0.5328611", "0.5328352", "0.5326825", "0.5324804", "0.5323119", "0.5321798", "0.5308983", "0.5297199", "0.52874553", "0.52863914", "0.5275625", "0.5265178", "0.52461135", "0.5233161", "0.5227446", "0.5220645", "0.52202094", "0.51992196", "0.5195854", "0.5190603", "0.5175674", "0.5174791", "0.5167381", "0.51664627", "0.5166229", "0.516363", "0.5159706", "0.51595694", "0.5157242", "0.5156507", "0.51554894", "0.51510006", "0.51468736", "0.5138704", "0.5138345", "0.513736", "0.5130937", "0.5130681", "0.5128151", "0.5127899", "0.5120973", "0.51181436", "0.5114178", "0.5107511", "0.5106447", "0.51043916", "0.510074", "0.5098488", "0.5087685", "0.50867784", "0.50813127", "0.5073913", "0.50724965", "0.50717324", "0.5066678", "0.5063688", "0.5061167", "0.50599366", "0.5057491", "0.50570315", "0.50548697", "0.5046491", "0.5046416", "0.5044906", "0.50427437", "0.50418174" ]
0.5404147
26
System.out.println("id is: " + id);
public static Joke getJoke(String id) { return allJokes.get(Integer.parseInt(id) - 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int id() {return id;}", "public String getId(){\n return id;\n }", "public String getId(){\n return id;\n }", "public int getId(){ return id; }", "public String getId() {\n return id;\r\n }", "public int getId()\n {\n return id;\n }", "public String getId(){return id;}", "public String toString() {\n return id;\n }", "public String getID()\n {\n return this.id;\n }", "public String getId()\n {\n return _id ;\n }", "public int getId(){return id;}", "@Override\n public String toString() {\n return id;\n }", "public String id()\n {\n return id;\n }", "public int getId ()\r\n {\r\n return id;\r\n }", "@Override\n public String toString() {\n return id.toString();\n }", "public String getId() { return id; }", "public String getId() { return id; }", "public String getId() { return id; }", "public String getID()\r\n {\r\n return id;\r\n }", "public String getId() {\n\treturn id;\n}", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int id()\n {\n return myId;\n }", "public int getID(){\n return id;\n }", "public int getId()\n {\n\treturn id;\n }", "public int getId() {\n/* 35 */ return this.id;\n/* */ }", "public String getID()\r\n {\r\n return this.id;\r\n }", "public int getId() {return id;}", "public String getId()\r\n {\r\n return id;\r\n }", "public int getId() {\n\treturn id;\n}", "public int getId() {\n\treturn id;\n}", "public String getId()\n {\n return id;\n }", "public String getId()\n {\n return id;\n }", "public String getId(){ return ID; }", "public int getId()\r\n {\r\n return id;\r\n }", "public int getID() {return id;}", "public int getID() {return id;}", "public long getId(){return this.id;}", "@Override\n\tpublic String toString() {\n\t\treturn id;\n\t}", "String getID();", "String getID();", "String getID();", "String getID();", "public int getID()\n {\n return id;\n }", "public String getId(){\n\t\treturn id;\n\t}", "public int getID(){\n return id;\n }", "public static String id()\n {\n return _id;\n }", "public String id() {\r\n return id;\r\n }", "@Override\n public String toString() {\n return id.toString();\n }", "public String getId()\n {\n return id;\n }", "public int getId() {\n return id;\n }", "public int getId()\n {\n return id;\n }", "public int getId()\n {\n return id;\n }", "public int getId()\n {\n return id;\n }", "public int getId()\n {\n return id;\n }", "public String getId(){\r\n\t\treturn id;\r\n\t}", "public String getId(){\r\n\t\treturn id;\r\n\t}", "public int getID() {\r\n return id;\r\n }", "int id();", "public int getId(){\r\n return this.id;\r\n }", "private int getId() {\r\n\t\treturn id;\r\n\t}", "public int getId()\n {\n return id;\n }", "public String id() {\n return id;\n }", "public String id() {\n return id;\n }", "public int getId() {\n return id;\n }", "public int getId() {\n return id;\n }", "public int getId() {\n return id;\n }", "public int getId() {\n return id;\n }", "public int getId() {\n return id;\n }", "public int getId() {\n return id;\n }", "public String getId() {\n return id;\n }", "public String getId() {\n return id;\n }", "public String getId() {\n return id;\n }", "public String getId() {\n return id;\n }", "public String getId() {\n return id;\n }", "public String getId() {\n return id;\n }", "public String getId() {\n return id;\n }", "public String getId() {\n return id;\n }", "public String getId() {\n return id;\n }", "public String getId() {\r\n \t\treturn id;\r\n \t}", "public String getId()\n {\n return _id;\n }", "public int getId(){\n\t\treturn id;\n\t}", "public int getId(){\n\t\treturn id;\n\t}", "public int getId(){\n\t\treturn id;\n\t}", "public int getId(){\n\t\treturn id;\n\t}", "public int getId(){\n\t\treturn id;\n\t}", "public String getId(){ return id.get(); }", "public String id() {\n return this.id;\n }", "public String id() {\n return this.id;\n }", "public String id() {\n return this.id;\n }", "public String id() {\n return this.id;\n }", "public String id() {\n return this.id;\n }", "public String id() {\n return this.id;\n }", "public int getId() {\n return id_;\n }", "public int getId() {\n return id_;\n }", "public int getId() {\r\n return id;\r\n }", "public int getId(){\r\n\t\treturn id;\r\n\t}" ]
[ "0.7743374", "0.76163626", "0.76163626", "0.7595222", "0.75524086", "0.75459784", "0.75388855", "0.7526734", "0.74924266", "0.7482951", "0.7463804", "0.7463662", "0.7460921", "0.74538404", "0.7451127", "0.74503946", "0.74503946", "0.74503946", "0.744705", "0.74297535", "0.7421331", "0.7421331", "0.7421331", "0.7421331", "0.7421331", "0.7421331", "0.7419347", "0.7417877", "0.74142843", "0.7410706", "0.73946595", "0.7389322", "0.7383215", "0.7382256", "0.7382256", "0.7380476", "0.7380476", "0.73552936", "0.7350686", "0.73506594", "0.73506594", "0.7349647", "0.7342745", "0.7342592", "0.7342592", "0.7342592", "0.7342592", "0.7341352", "0.7340434", "0.7335318", "0.73343307", "0.7329663", "0.73215574", "0.73185724", "0.73182386", "0.731734", "0.731734", "0.731734", "0.731734", "0.7312712", "0.7312712", "0.7304994", "0.7299627", "0.72980124", "0.72934276", "0.7285478", "0.7280045", "0.7280045", "0.7260561", "0.7260561", "0.7260561", "0.7260561", "0.7260561", "0.7260561", "0.7252373", "0.7252373", "0.7252373", "0.7252373", "0.7252373", "0.7252373", "0.7252373", "0.7252373", "0.7252373", "0.72495395", "0.72477955", "0.72474664", "0.72474664", "0.72474664", "0.72474664", "0.72474664", "0.72469336", "0.72463024", "0.72463024", "0.72463024", "0.72463024", "0.72463024", "0.72463024", "0.72402674", "0.72402674", "0.7239314", "0.72365576" ]
0.0
-1
NOSONAR Constructor de clase Registo
public Registro(List<Double> d) { this.setContenido((ArrayList<Double>) d); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public FiltroMicrorregiao() {\r\n }", "public Alojamiento() {\r\n\t}", "public Carrera(){\n }", "public AntrianPasien() {\r\n\r\n }", "public Pasien() {\r\n }", "public Aritmetica(){ }", "public Regla2(){ /*ESTE ES EL CONSTRUCTOR POR DEFECTO */\r\n\r\n /* TODAS LAS CLASES TIENE EL CONSTRUCTOR POR DEFECTO, A VECES SE CREAN AUTOMATICAMENTE, PERO\r\n PODEMOS CREARLOS NOSOTROS TAMBIEN SI NO SE HUBIERAN CREADO AUTOMATICAMENTE\r\n */\r\n \r\n }", "public Caso_de_uso () {\n }", "public Corso() {\n\n }", "protected Asignatura()\r\n\t{}", "public TCubico(){}", "public prueba()\r\n {\r\n }", "public Vehiculo() {\r\n }", "public PersonaFisica() {}", "private BaseDatos() {\n }", "public Respuesta() {\n }", "public MorteSubita() {\n }", "public Clade() {}", "public AfiliadoVista() {\r\n }", "public Busca(){\n }", "public SlanjePoruke() {\n }", "private UsineJoueur() {}", "public Funcionario() {\r\n\t\t\r\n\t}", "public Firma() {\n }", "public Kullanici() {}", "private ControleurAcceuil(){ }", "public Recursos() {\n }", "public Cgg_jur_anticipo(){}", "public Troco() {\n }", "public Veiculo() {\r\n\r\n }", "public Persona() {\n\t}", "public TebakNusantara()\n {\n }", "public CorreoElectronico() {\n }", "public Persona() {\n \t\n }", "public Funcionaria(){\n\n }", "public Transportista() {\n }", "public Aktie() {\n }", "private GrupoCuenta(String nombre, int operacion)\r\n/* 11: */ {\r\n/* 12:31 */ this.nombre = nombre;\r\n/* 13:32 */ this.operacion = operacion;\r\n/* 14: */ }", "public Sistema(){\r\n\t\t\r\n\t}", "public Candidatura (){\n \n }", "public AvaliacaoRisco() {\n }", "public Curso() {\r\n }", "public Persona() {\n }", "public Odontologo() {\n }", "public CCuenta()\n {\n }", "public Exercicio(){\n \n }", "public Persona(){\n \n }", "public Persona(){\n \n }", "public Corrida(){\n\n }", "public Contato() {\n }", "public REGISTRARSE()\n {\n \t this.datos=new DATOS();\n }", "public Supercar() {\r\n\t\t\r\n\t}", "public Achterbahn() {\n }", "public CrearQuedadaVista() {\n }", "public Manusia() {}", "public Sobre() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "public Constructor(){\n\t\t\n\t}", "public Producto() {\r\n }", "public Ciudad()\n {\n\n }", "public Valvula(){}", "public Documento() {\n\n\t}", "Casilla(String nombre){\n this.nombre=nombre; \n }", "public Prova() {}", "public Nota() {\n }", "public Plato(){\n\t\t\n\t}", "public AgenteEstAleatorio() {\r\n }", "public Gasto() {\r\n\t}", "public Classe() {\r\n }", "public Venda() {\n }", "public RegCita() {\n\t\tinitialize();\n\t}", "public Carrinho() {\n\t\tsuper();\n\t}", "public NhanVien()\n {\n }", "public ControladorUsuario() {\n }", "public MPaciente() {\r\n\t}", "public RegistroSensor() \n {\n\n }", "private QuadradoPerfeito() {\n }", "public Erreur() {\n\t}", "public OmsUsuario() {\n\t}", "public Empleado() { }", "public CampoModelo(String valor, String etiqueta, Integer longitud)\n/* 10: */ {\n/* 11:17 */ this.valor = valor;\n/* 12:18 */ this.etiqueta = etiqueta;\n/* 13:19 */ this.longitud = longitud;\n/* 14: */ }", "public ContaBancaria() {\n }", "public Laboratorio() {}", "public Tecnico(){\r\n\t\tthis.matricula = 0;\r\n\t\tthis.nome = \"NULL\";\r\n\t\tthis.email = \"NULL\";\r\n\t\tthis.telefone = \"TELEFONE\";\r\n\t\tlistaDeServicos = new ArrayList<Servico>();\r\n\t}", "public Propuestas() {}", "protected Approche() {\n }", "private TIPO_REPORTE(String nombre)\r\n/* 55: */ {\r\n/* 56: 58 */ this.nombre = nombre;\r\n/* 57: */ }", "public Simulador(){\n }", "public Libro() {\r\n }", "public Producto (){\n\n }", "public Doc_estado() {\n }", "public RegistroTest()\n {\n }", "public Chauffeur() {\r\n\t}", "public Reserva(){super();}", "public ValorVariavel() {\r\n }", "public Oveja() {\r\n this.nombreOveja = \"Oveja\";\r\n }", "public telefono(){\n this.telefono =\"00000000\";\n this.saldo = 0.0;\n this.marca= \"Sin Marca\";\n }", "public solicitudControlador() {\n }", "private Validador() {\r\n }", "public Fruitore()\r\n\t{\r\n\t\tthis.nomeUtente = Costanti.STRINGA_VUOTA;\r\n\t}", "public RptPotonganGaji() {\n }", "public Pila () {\n raiz=null; //Instanciar un objeto tipo nodo;\n }" ]
[ "0.76978385", "0.7612185", "0.75999266", "0.75446194", "0.7540902", "0.7514906", "0.7487344", "0.747493", "0.746068", "0.7420199", "0.74098253", "0.73784983", "0.7376946", "0.73304427", "0.7303451", "0.7301586", "0.7296875", "0.7277814", "0.72506434", "0.72482044", "0.72421664", "0.72404546", "0.72182864", "0.71869004", "0.7176736", "0.7174903", "0.71732265", "0.715375", "0.7097839", "0.70923066", "0.7090186", "0.7090179", "0.70708215", "0.706762", "0.70614433", "0.7040269", "0.7037547", "0.7033019", "0.70274144", "0.70267195", "0.70074594", "0.7007173", "0.700184", "0.69888186", "0.6987706", "0.6986184", "0.6974917", "0.6974917", "0.69738054", "0.6970096", "0.69549227", "0.6950744", "0.6934043", "0.6930517", "0.69258547", "0.691835", "0.69094956", "0.68852097", "0.6884593", "0.6880759", "0.68704426", "0.686799", "0.6864911", "0.68601835", "0.6858253", "0.6852505", "0.683635", "0.68304986", "0.6824713", "0.6823745", "0.68144685", "0.68125546", "0.67976546", "0.6795795", "0.6788901", "0.6788866", "0.6783784", "0.6782832", "0.6782542", "0.67805946", "0.6779762", "0.6779051", "0.6776622", "0.6773591", "0.6772709", "0.67638505", "0.67453027", "0.67439264", "0.6738641", "0.67364967", "0.67232555", "0.67225605", "0.67184734", "0.6712473", "0.6712184", "0.671019", "0.67085177", "0.6708186", "0.6706315", "0.6701705", "0.66985446" ]
0.0
-1
obtener el contenido del registro
public List<Double> getContenido() { return this.contenido; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Blob getContentBlob() {\n return Hibernate.createBlob(this.content);\n }", "@Override\n protected Serializable getContentObject() {\n return result;\n }", "Reserva Obtener();", "Serializable getContent();", "byte[] getContent();", "public byte[] getContent();", "@Override\n public String toTxt() {\n return this.content;\n }", "Documento getDocumento();", "public byte[] getContent() {\r\n return content;\r\n }", "public byte[] getBytes()\n {\n try { return getRepo().newObjectReader().open(_entry.getObjectId()).getBytes(); }\n catch(Exception e) { throw new RuntimeException(e); }\n }", "public byte[] getContent() {\n return content;\n }", "public BbsDto getContent(long bbs_seq) {\n\t\tBbsDto bbsDto = bDao.findBySeqForFile(bbs_seq);\n\t\treturn bbsDto;\n\t}", "public String getContent() {\n return instance.getContent();\n }", "public String getContent() {\n return instance.getContent();\n }", "public T getContent() {\n return content;\n }", "public String getContent() {\n return instance.getContent();\n }", "public String getContent() {\n return instance.getContent();\n }", "public java.lang.String getEntidad() {\n return entidad;\n }", "public String getContent() throws IOException {\r\n\t\tlogger.trace(\"getContent() - start\");\r\n\t\tif (status.contains(DatasetStatus.STATUS_CONTENT)) {\r\n\t\t\tlogger.trace(\"getContent() - {}\", DatasetStatus.STATUS_CONTENT);\r\n\t\t\tlogger.debug(\"getContent() - content\");\r\n\t\t\tlogger.trace(\"getContent() - end\");\r\n\t\t\treturn content;\r\n\t\t}\r\n\t\tlogger.trace(\"getContent() - end\");\r\n\t\treturn null;\r\n\t}", "public Registro getRegistro();", "@Override\n\tpublic void read(Object entidade) {\n\t\t\n\t}", "public String LeerDatos() \r\n {\r\n try \r\n {\r\n return _reader.readLine();\r\n }\r\n catch(IOException e)\r\n {\r\n return null;\r\n }\r\n\r\n }", "public String getBaseDatos() {\n return baseDatos;\n }", "public String get() {\n return content;\n }", "@Column(name = \"FILE_CONTENT\" )\n @Lob\n public Byte[] getFileContent() {\n return fileContent;\n }", "public String getContent() {\n\t\treturn content.toString();\n\t}", "@Override\n\tpublic\n\tObject getContent() {\n\t\treturn this.content;\n\t}", "public String getContent() {\n\t return content;\n }", "public String getContent();", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "public Object getContent() {\n/* 112 */ return this.buf;\n/* */ }", "@Transactional(readOnly = true)\n public byte[] getFormContent(SavedSearch savedSearch) {\n if (!savedSearch.isIdSet()) {\n return savedSearch.getFormContent();\n }\n\n try {\n return savedSearch.getFormContent();\n } catch (LazyInitializationException lie) { // _HACK_ as we still rely on hibernate here\n return get(savedSearch).getFormContent();\n }\n }", "@Override\r\npublic Detalle_pedido read(int id) {\n\treturn detalle_pedidoDao.read(id);\r\n}", "public String getContent() {\n return this.m_content;\n }", "public String getData() {\n\t\t\tString[] columns = new String[] { KEY_ID, KEY_IMAGE, KEY_NAME ,KEY_DES};\n\t\t\tCursor c = ourDatabase.query(DATABASE_NAME, columns, null, null, null, null, null);\n\t\t\tString result = \"\";\n\n\t\t\tint irow = c.getColumnIndex(KEY_ID);\n\t\t\tint iimg = c.getColumnIndex(KEY_IMAGE);\n\t\t\tint iname = c.getColumnIndex(KEY_NAME);\n\t\t\tint ides = c.getColumnIndex(KEY_DES);\n\n\t\t\tfor (c.moveToFirst(); !c.isAfterLast(); c.moveToNext()) {\n\t\t\t\tresult = result + c.getString(irow) + \" \"+c.getString(iimg) + \" \"+c.getString(iname) + \" \"+c.getString(ides) + \" \"+\"\\n\";\n\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}", "public String getContent() {\n return this.content;\n }", "public String toString()\n {\n return content.toString();\n }", "public String getCuenta() {\r\n return cuenta;\r\n }", "public String getContent() {\r\n return content;\r\n }", "public String getContent() {\r\n return content;\r\n }", "public String getDataCandidatura(){\n return dataCandidatura;\n }", "public String getContent() {\n return content_;\n }", "public String getContent() {\n return content_;\n }", "public String getContent() {\r\n\t\treturn this.content;\r\n\t}", "public String getContent() {\n return this.content;\n }", "public String getContent() {\n return this.content;\n }", "public String getContent() {\n return this.content;\n }", "public String getContent() {\n return this.content;\n }", "@JsonIgnore public Mass getSodiumContent() {\n return (Mass) getValue(\"sodiumContent\");\n }", "public String obtenerDetalles(){\r\n return \"Nombre: \" + this.nombre + \", sueldo = \" + this.sueldo;\r\n }", "public String geteContent() {\n return eContent;\n }", "public T getContent();", "public String getContent() {\n return content;\n }", "public String getContent() {\n return content;\n }", "public String getContent() {\n return content;\n }", "public String getContent() {\n return content;\n }", "public String getContent() {\n return content;\n }", "public String getContent() {\n return content;\n }", "public String getContent() {\n return content;\n }", "public String getContent() {\n return content;\n }", "public String getContent() {\n return content;\n }", "public String getContent() {\n return content;\n }", "public String getContent() {\n return content;\n }", "public String getContent() {\n return content;\n }", "public String getContent() {\n return content;\n }", "public String getContent() {\n return content;\n }", "public String getContent() {\n return content;\n }", "public String getContent() {\n return content;\n }", "public String getContent() {\n return content;\n }", "public biz.belcorp.www.canonico.ffvv.vender.TMotivoRechazo getMotivoRechazo(){\n return localMotivoRechazo;\n }", "public Cuenta obtenerCuenta(String codigo_cuenta) {\n Cuenta cuenta = new Cuenta();\n try {\n PreparedStatement PrSt;\n ResultSet rs = null;\n String Query = \"SELECT * FROM Cuenta WHERE Codigo = ?\";\n PrSt = conexion.prepareStatement(Query);\n PrSt.setString(1, codigo_cuenta);\n rs = PrSt.executeQuery();\n while (rs.next()) {\n cuenta.setCodigo(rs.getString(\"Codigo\"));\n cuenta.setCreacion(rs.getDate(\"Creacion\"));\n cuenta.setCredito(rs.getDouble(\"Credito\"));\n cuenta.setCodigo_cliente(rs.getString(\"Codigo_Cliente\"));\n }\n PrSt.close();\n rs.close();\n } catch (SQLException e) {\n System.out.println(e.toString());\n }\n return cuenta;\n }", "public String borra() { \n clienteDAO.borra(c.getId());\n return \"listado\";\n }", "java.lang.String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "public String getTitulo(int codProva) {\n\t\tTransactionManager txManager = new TransactionManager();\n\t return txManager.doInTransactionWithReturn((connection) -> {\n\t \t\n\t\t\tps = connection.prepareStatement(\n\t\t\t\t\t\"SELECT codigo, titulo FROM prova WHERE codigo=?\");\n\t\t\tps.setInt(1, codProva);\n\t\t\trs = ps.executeQuery();\n\t\t\t\n\t\t\treturn (rs.next()) ? rs.getString(2) : \"\";\n\t\t});\n\t}", "public String getContent() { return this.content; }", "public String toString() {\n\t\treturn content;\n\t}", "public String getContent() {\r\n \r\n return text;\r\n }", "@Override\n\tpublic String getObjetivo() {\n\t\treturn model.getObjetivo();\n\t}", "String getEntity();", "String getEntity();", "String getDataNascimento();", "public String getContrasena() {return contrasena;}", "public String readtexto() {\n String texto=\"\";\n try\n {\n BufferedReader fin =\n new BufferedReader(\n new InputStreamReader(\n openFileInput(\"datos.json\")));\n\n texto = fin.readLine();\n fin.close();\n }\n catch (Exception ex)\n {\n Log.e(\"Ficheros\", \"Error al leer fichero desde memoria interna\");\n }\n\n\n\n return texto;\n }", "private String getEntityContent(HttpEntity entity) throws IOException {\n return getEntityContent(entity, \"utf-8\");\n }", "@JsonIgnore public Mass getTransFatContent() {\n return (Mass) getValue(\"transFatContent\");\n }", "@Override\r\npublic List<Map<String, Object>> readAll() {\n\treturn detalle_pedidoDao.realAll();\r\n}", "@Override\n\tpublic String readBlob() throws PersistBlobException {\n\t\tlog.debug(\"readString: \");\n\t\ttry {\n\t\t\tString contents = FileUtils.readFileToString(new File(full_file_name), \"UTF-8\");\n\t\t\tlog.debug(\"returned string: \"+contents);\n\t\t\treturn contents;\n\t\t} catch (IOException e) {\n\t\t\tthrow new PersistBlobException(\"can not read string\",e);\n\t\t}\n\n\t}", "public String RespuestaCliente()\n{\tString Muestra=\"\";\n\t\n\tMuestra+=\"DATOS DEL CLIENTE\\n\"\n\t\t\t+ \"Nombre: \"+getNombre()+\"\\n\"\n\t\t\t+ \"DNI: \"+getDni()+\"\\n\"\n\t\t\t+ \"Salario: �\"+String.format(\"%.1f\",getSalario())+\"\\n\\n\";\n\t\n\treturn Muestra;\n\t\n\t}", "@Override\r\n public String toString() {\n return this.descripcion;\r\n }" ]
[ "0.6454671", "0.62658805", "0.6228843", "0.6222073", "0.61908466", "0.6100254", "0.60313314", "0.6007011", "0.5989128", "0.5955487", "0.5903409", "0.5900148", "0.5880702", "0.5880702", "0.5865475", "0.5863962", "0.5863962", "0.58625364", "0.58411515", "0.5833673", "0.58096457", "0.5801811", "0.57965946", "0.5770655", "0.57703835", "0.57678175", "0.575912", "0.5748524", "0.5730954", "0.57307225", "0.57307225", "0.57307225", "0.57307225", "0.57307225", "0.57307225", "0.57307225", "0.57307225", "0.5724177", "0.5697722", "0.5687691", "0.5675809", "0.5674586", "0.5669494", "0.566693", "0.5664395", "0.5661978", "0.5661978", "0.5650759", "0.5636447", "0.5636447", "0.56317407", "0.56198984", "0.56198984", "0.56198984", "0.56198984", "0.56126183", "0.560973", "0.56045705", "0.5603276", "0.55978745", "0.55978745", "0.55978745", "0.55978745", "0.55978745", "0.55978745", "0.55978745", "0.55978745", "0.55978745", "0.55978745", "0.55978745", "0.55978745", "0.55978745", "0.55978745", "0.55978745", "0.55978745", "0.55978745", "0.5597128", "0.5596171", "0.5593053", "0.55920875", "0.55920875", "0.55920875", "0.55920875", "0.55920875", "0.55920875", "0.5576051", "0.5574568", "0.5570942", "0.5569845", "0.55688906", "0.5555729", "0.5555729", "0.5550775", "0.5543298", "0.5540071", "0.5532256", "0.5524592", "0.55244195", "0.5523597", "0.55211866", "0.5520189" ]
0.0
-1
Muestra por salida estandar el contenido del registro
public void show() { System.out.println(this.getContenido().toString());//NOSONAR }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void salvar(Registro registro) {\n\t\t\r\n\t}", "@Override\n public int getSalida() {\n return 0;\n }", "public long obtenerNoSalida() throws GenericPersistenceEAOException;", "public EncabezadoRespuesta salidaAsistencia(AsistenciaDTO asistencia) {\n\t\t//Primero generamos el identificador unico de la transaccion\n\t\tString uid = GUIDGenerator.generateGUID(asistencia);\n\t\t//Mandamos a log el objeto de entrada\n\t\tLogHandler.debug(uid, this.getClass(), \"salidaAsistencia - Datos Entrada: \" + asistencia);\n\t\t//Variable de resultado\n\t\tEncabezadoRespuesta respuesta = new EncabezadoRespuesta();\n\t\ttry {\n\t\t\tif (asistencia.getIdEmpleado() == null) {\n \t\tthrow new ExcepcionesCuadrillas(\"Es necesario el id del empleado.\");\n \t}\n \tif (asistencia.getUsuarioUltMod() == null || asistencia.getUsuarioUltMod().trim().isEmpty())\n \t{\n \t\tthrow new ExcepcionesCuadrillas(\"Es necesario el usuario.\");\n \t}\n \tAsistenciaDAO dao = new AsistenciaDAO();\n \trespuesta = dao.salidaAsistencia(uid, asistencia);\n\t\t} catch (ExcepcionesCuadrillas ex) {\n\t\t\tLogHandler.error(uid, this.getClass(), \"salidaAsistencia - Error: \" + ex.getMessage(), ex);\n\t\t\trespuesta.setUid(uid);\n\t\t\trespuesta.setEstatus(false);\n\t\t\trespuesta.setMensajeFuncional(ex.getMessage());\n\t\t\trespuesta.setMensajeTecnico(ex.getMessage());\n\t\t}\n\t\tcatch (Exception ex) {\n\t\t\tLogHandler.error(uid, this.getClass(), \"salidaAsistencia - Error: \" + ex.getMessage(), ex);\n\t\t\trespuesta.setUid(uid);\n\t\t\trespuesta.setEstatus(false);\n\t\t\trespuesta.setMensajeFuncional(ex.getMessage());\n\t\t\trespuesta.setMensajeTecnico(ex.getMessage());\n\t\t}\n\t\tLogHandler.debug(uid, this.getClass(), \"salidaAsistencia - Datos Salida: \" + respuesta);\n\t\treturn respuesta;\n\t}", "boolean agregarSalida(Salida s) {\n boolean hecho = false;\n try {\n operacion = ayudar.beginTransaction();\n ayudar.save(s);\n operacion.commit();\n } catch (Exception e) {\n operacion.rollback();\n System.out.println(e);\n }\n return hecho;\n }", "private void salvar() {\n setaCidadeBean();\n //Instanciamos o DAO\n CidadeDAO dao = new CidadeDAO();\n //verifica qual será a operação de peristência a ser realizada\n if (operacao == 1) {\n dao.inserir(cidadeBean);\n }\n if (operacao == 2) {\n dao.alterar(cidadeBean);\n }\n habilitaBotoesParaEdicao(false);\n reiniciaTela();\n }", "@Override\n\tpublic int insertarSalida(AlmacenDTO obj) {\n\t\tint rs=-1;\n\t\tConnection con=null;\n\t\tPreparedStatement pst=null;\n\t\ttry {\n\t\t\tcon=new MySqlDbConexion().getConexion();\n\t\t\tString sql=\"insert into MATERIAL_SALIDA values (null,?,?,?)\";\n\t\t\tpst=con.prepareStatement(sql);\n\t\t\t\n\t\t\tpst.setInt(1,obj.getCodigo_producto());\n\t\t\tpst.setInt(2,obj.getCantidad_salida());\n\t\t\tpst.setDate(3,obj.getFecha_salida());\n\t\t\t\n\t\t\trs=pst.executeUpdate();\n\t\t \n\t\t\t\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\tSystem.out.println(\"Error en la Sentencia\"+e.getMessage());\n\t\t\t\n\t\t}\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tif(pst!=null) pst.close();\n\t\t\t\tif(con!=null) con.close();\n\t\t\t}\n\t\t\tcatch (SQLException e) {\n\t\t\t\tSystem.out.println(\"Error al cerrar\");\n\t\t\t}\n\t\t}\n\t\treturn rs;\n\t}", "@Override\r\n public Resultado salvar(EntidadeDominio entidade) {\n String nmClass = entidade.getClass().getName();\r\n //executando validações de regras de negocio \r\n String msg = executarRegras(entidade, \"SALVAR\");\r\n //chamando DAO em caso de todas as validações atendidas\r\n if (msg.isEmpty()) {\r\n IDAO dao = daos.get(nmClass);\r\n dao.salvar(entidade);\r\n resultado.setMsg(\"Dados salvos no Banco de Dados\");\r\n List<EntidadeDominio> entidades = new ArrayList<>();\r\n entidades.add(entidade);\r\n resultado.setEntidades(entidades);\r\n // retornando msg de falha de validação sem poder acessar o DAO\r\n } else {\r\n resultado.setMsg(msg.toString());\r\n }\r\n return resultado;\r\n }", "public void salvar() throws Exception {\n if(stb == null)\n throw new Exception(Main.recursos.getString(\"bd.objeto.nulo\"));\n\n // Restrição provisória para aumentar a performance do programa\n if(stb.getIdSubTipoBanca() != -1)\n return;\n\n // Primeiro verifica se existe o subtipo de banca\n Transacao.consultar(\"SELECT idSubTipoBanca FROM subTipoBanca WHERE nome LIKE '\"+ stb.getNome() +\"'\");\n if(Transacao.getRs().first())\n stb.setIdSubTipoBanca(Transacao.getRs().getInt(\"idSubTipoBanca\"));\n\n String sql = \"\";\n\n if(stb.getIdSubTipoBanca() == -1)\n sql = \"INSERT INTO subTipoBanca VALUES(null, '\"+ stb.getNome() +\"')\";\n else\n sql = \"UPDATE subTipoBanca SET nome = '\"+ stb.getNome() +\"' WHERE idSubTipoBanca = \" + stb.getIdSubTipoBanca();\n\n \n Transacao.executar(sql);\n \n // Se foi uma inserção, deve trazer o id do subtipo para o objeto\n if(stb.getIdSubTipoBanca() == -1){\n Transacao.consultar(\"SELECT LAST_INSERT_ID() AS ultimo_id\");\n if(Transacao.getRs().first())\n stb.setIdSubTipoBanca(Transacao.getRs().getInt(\"ultimo_id\"));\n }\n }", "@Override\n\tpublic void salvaSuFile() {\n\t\tString path = \"alimenti.txt\";\n\t\tString allergeni = Alimento.getStringaAllergeni(getElencoAllergeni());\n\t\ttry {\n\t\t\tFile file = new File(path);\n\t\t\tFileWriter fw = new FileWriter(file, true);\n\t\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\t\tbw.write(getNome() + \" - \" + getPrezzo() + \"€\\n\");\n\t\t\tbw.write(\"Adatto a vegani: \" + (getVegano() ? \"sì\\n\" : \"no\\n\"));\n\t\t\tbw.write(\"Adatto a vegetariani: \" + (getVegetariano() ? \"sì\\n\" : \"no\\n\"));\n\t\t\tbw.write(\"Tipologia: \" + getTipoPortata().getNome().toUpperCase() + \"\\n\");\n\t\t\tbw.write(\"Cottura: \" + getTipoCottura().getNome().toUpperCase() + \"\\n\");\n\t\t\tbw.write(\"Allergeni: \" + (allergeni.isEmpty() ? \"--\" : allergeni) + \"\\n\\n\");\n\t\t\tbw.flush();\n\t\t\tbw.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n\tpublic void salvaRisposta(Risposta risposta) {\n\t\tint lastID = getLastIDRisposte()+1;\n\t\trisposta.setId(lastID);\n\t\tDB db = getDB();\n\t\tMap<Long, Risposta> risposte = db.getTreeMap(\"risposte\");\n\t\tlong hash = (long) risposta.getId().hashCode();\n\t\trisposte.put(hash, risposta);\n\t\tdb.commit();\n\t}", "@Override\r\n\tpublic Sexo salvar(Sexo entidade) throws Exception {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic void salvar() {\n\t\t\n\t\tPedidoCompra PedidoCompra = new PedidoCompra();\n\t\t\n\t\tPedidoCompra.setAtivo(true);\n//\t\tPedidoCompra.setNome(nome.getText());\n\t\tPedidoCompra.setStatus(StatusPedido.valueOf(status.getSelectionModel().getSelectedItem().name()));\n//\t\tPedidoCompra.setSaldoinicial(\"0.00\");\n\t\t\n\t\tPedidoCompra.setData(new Date());\n\t\tPedidoCompra.setIspago(false);\n\t\tPedidoCompra.setData_criacao(new Date());\n\t\tPedidoCompra.setFornecedor(cbfornecedores.getSelectionModel().getSelectedItem());\n\t\tPedidoCompra.setTotal(PedidoCompra.CalcularTotal(PedidoCompra.getItems()));\n\t\tPedidoCompra.setTotalpago(PedidoCompra.CalculaTotalPago(PedidoCompra.getFormas()));\n\t\t\n\t\tgetservice().save(PedidoCompra);\n\t\tsaveAlert(PedidoCompra);\n\t\tclearFields();\n\t\tdesligarLuz();\n\t\tloadEntityDetails();\n\t\tatualizar.setDisable(true);\n\t\tsalvar.setDisable(false);\n\t\t\n\t\tsuper.salvar();\n\t}", "@Override\n\tpublic void salir() {\n\t\t\n\t}", "@Override\n public void salvar(EntidadeDominio entidade) throws SQLException\n {\n\t\n }", "public void salvar() throws Exception {\t\r\n\t\t\t\t\r\n\t\tDate date = new Date();\r\n\t\tString url = evento.getUrl();\r\n\t\tevento.setNmStatus(EventoService.getStatus(url));\r\n\t\tevento.setDataHora(date);\r\n\t\teventoRepository.save(evento); // COLOCAMOS NO BANCO\r\n\t\tFacesContext.getCurrentInstance().addMessage(null, new FacesMessage(\"Cadastro inserido\"));\r\n\t\tif (!modoEdicao)\r\n\t\t\teventos.add(evento); // COLOCAMOS NA LISTA\r\n\t\tevento = new Evento();\r\n\t\tmodoEdicao = false;\r\n\t}", "public abstract void leerPersistencia();", "public void almacenoDatos(){\n BaseDatosSecundaria administrador= new BaseDatosSecundaria(this);\n SQLiteDatabase bdsecunadaria= administrador.getWritableDatabase();\n _valuesPedido.put(\"Producto\", this._productoNombre);\n _valuesPedido.put(\"Precio\",this._productoPrecio);\n _valuesPedido.put(\"Cantidad\",this._etAdquirir.getText().toString());\n _valuesPedido.put(\"Vendedor\",this.username);\n _valuesPedido.put(\"Id_Producto\",this._productoId);\n bdsecunadaria.insert(\"DATOS\",null,this._valuesPedido);\n bdsecunadaria.close();\n }", "public void GuardarSerologia(RecepcionSero obj)throws Exception{\n Session session = sessionFactory.getCurrentSession();\n session.saveOrUpdate(obj);\n }", "@Override\n void procesarSalida(Simulacion s, Evento e) {\n e.consulta.estadistEjec_Sentencias.tiempoSalidaModulo = e.tiempo;\n e.consulta.estadistEjec_Sentencias.tiempoEnModulo = e.tiempo - e.consulta.estadistEjec_Sentencias.tiempoLlegadaModulo;\n Evento evento = new Evento(e.consulta);\n evento.tipoE = Evento.TipoEvento.ENTRADA;\n evento.modulo = Evento.TipoModulo.ADM_CONEXIONES;\n evento.tiempo = e.tiempo;\n numServOcupados--;\n s.listaE.add(evento);\n\n if (!colaC.isEmpty()) { //Si despues de una salida hay algo en cola\n Consulta consulta = colaC.remove();\n consulta.estadistEjec_Sentencias.tiempoSalidaCola = e.tiempo - consulta.estadistEjec_Sentencias.tiempoLlegadaModulo;\n s.estadisticasT.promedioColaES += colaC.size();\n Evento eventoS = new Evento(consulta);\n eventoS.tipoE = Evento.TipoEvento.SALIDA;\n eventoS.modulo = Evento.TipoModulo.EJEC_SENTENCIAS;\n ejecucionSentencia(consulta);\n eventoS.tiempo = e.tiempo + tiempoEjecucion;\n s.listaE.add(eventoS);\n numServOcupados++;\n }\n\n }", "public void salvar() {\n\n try {\n ClienteDao fdao = new ClienteDao();\n fdao.Salvar(cliente);\n\n cliente = new Cliente();\n//mesagem para saber se foi salvo com sucesso\n JSFUtil.AdicionarMensagemSucesso(\"Clente salvo com sucesso!\");\n\n } catch (RuntimeException e) {\n JSFUtil.AdicionarMensagemErro(\"ex.getMessage()\");\n e.printStackTrace();\n }\n }", "@Override\n\tpublic long actualizar(Account entidad) {\n\t\treturn 0;\n\t}", "public void salvar(Filme f) {\r\n\r\n //Pegando o gerenciador de acesso ao BD\r\n EntityManager gerenciador = JPAUtil.getGerenciador();\r\n\r\n //Iniciar a transação\r\n gerenciador.getTransaction().begin();\r\n\r\n //Mandar persistir o ator\r\n gerenciador.persist(f);\r\n\r\n //Commit\r\n gerenciador.getTransaction().commit();\r\n\r\n }", "@Override\n\tpublic Parcela salvar(Parcela entidade) {\n\t\treturn null;\n\t}", "public void salvarAluno() {\n \n this.aluno.setName(nome);\n this.aluno.setEmail(email);\n this.aluno.setSenha(senha);\n\n try {\n \n this.alunoServico.persistence(this.aluno);\n \n } catch (CadastroUsuarioException ex) {\n \n //Precisa tratar aqui!\n }\n \n setNome(null);\n setEmail(null);\n setSenha(null);\n\n }", "public long save(Registro r) {\n\n long id = r.getCodigo();\n SQLiteDatabase db = banco.getWritableDatabase();\n try {\n\n\n ContentValues values = new ContentValues();\n\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-M-d\");\n String dateString = sdf.format(r.getData());\n values.put(\"data\", dateString);\n values.put(\"distancia\", r.getDistancia());\n values.put(\"consumo\", r.getConsumo());\n values.put(\"mediaAceleracao\", r.getMediaAberturaBorboleta());\n values.put(\"mediaConsumo\", r.getMediaConsumo());\n values.put(\"codTipoCombustivel\", r.getTipoCombustivel().getCodigo());\n values.put(\"codCarro\", r.getCarro().getCodigo());\n values.put(\"codUsuario\", r.getUsuario().getCodigo());\n\n if (id != 0) {//SE O ID É DIFERENTE DE 0 ATUALIZA,\n\n System.out.println(\"Entrou !!\");\n String _id = String.valueOf(r.getCodigo());\n String[] whereArgs = new String[]{_id};\n\n // update registro set values = ... where _id=?\n int count = db.update(TABELA, values, \"codigo=?\", whereArgs);\n\n return count;\n } else {\n\n id = db.insert(TABELA, \"\", values);\n System.out.println(\"Deu certo !! \\n \" + values);\n return id;\n }\n } finally {\n db.close();\n }\n }", "void modificarSaldo(int cantidad){\n this.saldo = this.saldo + cantidad;\n }", "public void salvarProfessor(){\n \n this.professor.setName(nome);\n this.professor.setEmail(email);\n this.professor.setSenha(senha);\n\n try {\n \n this.professorServico.persistence(this.professor);\n \n } catch (CadastroUsuarioException ex) {\n \n //Precisa tratar aqui!\n }\n \n setNome(null);\n setEmail(null);\n setSenha(null);\n }", "@Override\r\n\t@Transactional\r\n\tpublic Integer sumaPedidoEventual() {\n\t\treturn dao.sumaPedidoEventual();\r\n\t}", "@Override\r\n public void salir() {\n }", "public void salvarDadosUsuario(String idUsuario){\n editor.putString(CHAVE_ID, idUsuario);\n editor.commit();\n }", "@Override\n\tpublic int save(CursoAsignatura ca) {\n\t\treturn 0;\n\t}", "@Override\r\n\t@Transactional\r\n\tpublic Integer restaPrestadoEventual() {\n\t\treturn dao.restaPrestadoEventual();\r\n\t}", "public ResponseEntity salvar(ContaUsuario contaUsuario, ERole role, HttpServletRequest request, MultipartFile foto, Boolean trocarSenha) {\r\n\t\t\r\n\t\tMap<String, Object> data = new HashMap<>();\r\n\t\tContaUsuario contaUsuarioSalvar = new ContaUsuario();\r\n\t\t\r\n\t\t/* Se a cona já estiver cadastrada busca as informaçoes dela */\r\n\t\tif(contaUsuario.getId() == null){\r\n\t\t\tcontaUsuarioSalvar = contaUsuario;\r\n\t\t}else{\r\n\t\t\tcontaUsuarioSalvar = contaUsuarioRepository.findOne(contaUsuario.getId());\r\n\t\t}\r\n\t\t\r\n\t\tif(trocarSenha){\r\n\t\t\tString encodedPassword = contaUsuario.getEncodedPassword(contaUsuario.getPassword());\r\n\t\t\tcontaUsuarioSalvar.setSenha(encodedPassword);\r\n\t\t}\r\n\t\t\r\n\t\tif ((!foto.isEmpty()) && ((ERole.ROLE_ADMIN == role) || (ERole.ROLE_CANDIDATO == role) || (ERole.ROLE_EMPREGADOR == role))) {\r\n\t\t\tString caminho = prepararAnexo(request, contaUsuario.getId(), foto);\r\n\t\t\tcontaUsuarioSalvar.setPathImagem(caminho);\r\n\t\t}\r\n\t\tcontaUsuarioSalvar.addPermissao(getPermissao(role));\r\n\t\t\r\n\t\tcontaUsuarioRepository.save(contaUsuarioSalvar);\r\n\t\t\r\n\t\tdata.put(\"msg\", \"Conta de usuário salva com sucesso!\");\r\n\t\tdata.put(\"contaUsuario\", contaUsuarioSalvar);\r\n\t\treturn new ResponseEntity(data, HttpStatus.OK);\r\n\t}", "@Transactional\n DataRistorante insert(DataRistorante risto);", "@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\tMasterAEnt masterAEnt = (MasterAEnt) ss.get(MasterAEnt.class, 1);\r\n\t\t\t\t//doing lazy-load\r\n\t\t\t\tmasterAEnt.getDetailAEntCol().size();\r\n\t\t\t\t\r\n\t\t\t\tPlayerManagerTest.this\r\n\t\t\t\t\t.manager\r\n\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(true));\r\n\t\t\t\t\r\n\t\t\t\tSignatureBean signatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQUVudCIsImlzQ29sbCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoiZGV0YWlsQUVudENvbCIsInJhd0tleVZhbHVlcyI6WyIxIl0sInJhd0tleVR5cGVOYW1lcyI6WyJqYXZhLmxhbmcuSW50ZWdlciJdfQ\");\r\n\t\t\t\tCollection<DetailAEnt> detailAEntCol = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\t\t\t\tArrayList<DetailAEnt> detailAEntCuttedCol = new ArrayList<>();\r\n\t\t\t\tdetailAEntCuttedCol.add(new ArrayList<>(detailAEntCol).get(1));\r\n\t\t\t\tdetailAEntCuttedCol.add(new ArrayList<>(detailAEntCol).get(2));\r\n\t\t\t\tPlayerSnapshot<Collection<DetailAEnt>> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(detailAEntCuttedCol);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\t\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}", "@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\tMasterAEnt masterAEnt = (MasterAEnt) ss.get(MasterAEnt.class, 1);\r\n\t\t\t\t//doing lazy-load\r\n\t\t\t\tmasterAEnt.getDetailAEntCol().size();\r\n\t\t\t\t\r\n\t\t\t\tPlayerManagerTest.this\r\n\t\t\t\t\t.manager\r\n\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(true));\r\n\t\t\t\t\r\n\t\t\t\tSignatureBean signatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQUVudCIsImlzQ29sbCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoiZGV0YWlsQUVudENvbCIsInJhd0tleVZhbHVlcyI6WyIxIl0sInJhd0tleVR5cGVOYW1lcyI6WyJqYXZhLmxhbmcuSW50ZWdlciJdfQ\");\r\n\t\t\t\tCollection<DetailAEnt> detailAEntCol = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\t\t\t\tArrayList<DetailAEnt> detailAEntCuttedCol = new ArrayList<>();\r\n\t\t\t\tdetailAEntCuttedCol.add(new ArrayList<>(detailAEntCol).get(0));\r\n\t\t\t\tdetailAEntCuttedCol.add(new ArrayList<>(detailAEntCol).get(1));\r\n\t\t\t\tPlayerSnapshot<Collection<DetailAEnt>> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(detailAEntCuttedCol);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\t\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}", "@Override\n\tpublic void saveData()\n\t{\n ssaMain.d1.pin = ssaMain.tmp_pin1;\n ssaMain.d1.balance = ssaMain.tmp_balance1;\n System.out.println(\"Your account has been established successfully.\");\n\t}", "@Override\n public void salvar(Object pacienteParametro) {\n Paciente paciente;\n paciente = (Paciente) pacienteParametro;\n EntityManagerFactory factory = Persistence.createEntityManagerFactory(\"vesaliusPU\"); \n EntityManager em = factory.createEntityManager();\n em.getTransaction().begin();\n if(paciente.getIdPaciente() == 0){\n em.persist(paciente);\n }else{\n em.merge(paciente);\n }\n em.getTransaction().commit();\n em.close();\n factory.close();\n }", "public void salvaDati(Object dati){\n\t\ttry{\n\t\t\tFileOutputStream fos = new FileOutputStream(file);\n\t\t\tObjectOutputStream oos = new ObjectOutputStream(fos);\n\t\t\toos.writeObject(dati);\n\t\t\toos.close();\n\t\t\tfos.close();\n\t\t\tSystem.out.println(\"File \" + file + \" salvato\");\n\t\t} catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\t\n\t}", "private void doSalvar() {\n populaContato();\n dispatcher.execute(new SalvarContatoAction(contato),\n new AsyncCallback<SalvarContatoResult>() {\n @Override\n public void onFailure(Throwable caught) {\n ShowMsgEvent.fire(CadastroContatoPresenter.this, \"Erro: \" + caught.getLocalizedMessage(),\n AlertType.ERROR);\n }\n\n @Override\n public void onSuccess(SalvarContatoResult result) {\n for (String msg : result.getMensagem()) {\n ShowMsgEvent.fire(CadastroContatoPresenter.this, msg,\n result.isOk() ? AlertType.SUCCESS : AlertType.ERROR);\n }\n contato = result.getContatoAtualizado();\n AtualizarListaDeContatosEvent.fire(CadastroContatoPresenter.this);\n }\n });\n }", "public void salvarDadosNaTela(){\n SharedPreferences sharedPreferences = this.getActivity().getSharedPreferences(SHARED_PREFS, MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n\n editor.putString(TVHORAUM, tvHoraUm.getText().toString());\n editor.putString(TVHORADOIS, tvHoraDois.getText().toString());\n editor.putString(TVHORATRES, tvHoraTres.getText().toString());\n editor.putString(TVHORAQUATRO, tvHoraQuatro.getText().toString());\n\n editor.apply();\n\n }", "@Override\n\tpublic void registrarSalida() {\n\n\t}", "Lancamento persistir(Lancamento lancamento);", "int updateNavegacionSalida(final Long srvcId);", "Persistencia() {\n\t}", "private void persistirRemessaC17() throws Exception {\n if (this.remessa == null || this.remessa.getId() == null) { \n this.remessa = new RemessaVO();\n this.remessa.setDataHoraAbertura(new Date());\n this.remessa.setCodigoUsuarioAbertura(this.usuario.getNuMatricula());\n this.remessa.setUnidadeSolicitante(unidadeServiceRef.findUnidadeLotacaoUsuarioLogado());\n this.remessa = remessaService.salvarRascunhoRemessaAB(this.remessa);\n }\n }", "@Override\n\tpublic void registrarSalida() {\n\t\t\n\t}", "@Override\n\tpublic void registrarSalida() {\n\t\t\n\t}", "@Transactional\n\tpublic Interesado save(Interesado interesado) {\n\t\treturn this.interesadoDao.save(interesado);\n\t}", "@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\tMasterAEnt masterAEnt = (MasterAEnt) ss.get(MasterAEnt.class, 1);\r\n\t\t\t\t//doing lazy-load\r\n\t\t\t\tmasterAEnt.getDetailAEntCol().size();\r\n\t\t\t\t\r\n\t\t\t\tPlayerManagerTest.this\r\n\t\t\t\t\t.manager\r\n\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(true));\r\n\t\t\t\t\r\n\t\t\t\tSignatureBean signatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQUVudCIsImlzQ29sbCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoiZGV0YWlsQUVudENvbCIsInJhd0tleVZhbHVlcyI6WyIxIl0sInJhd0tleVR5cGVOYW1lcyI6WyJqYXZhLmxhbmcuSW50ZWdlciJdfQ\");\r\n\t\t\t\tCollection<DetailAEnt> detailAEntCol = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\t\t\t\tPlayerSnapshot<Collection<DetailAEnt>> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(detailAEntCol);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\t\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}", "public EncabezadoRespuesta entradaAsistencia(AsistenciaDTO asistencia) {\n\t\t//Primero generamos el identificador unico de la transaccion\n\t\t\t\tString uid = GUIDGenerator.generateGUID(asistencia);\n\t\t\t\t//Mandamos a log el objeto de entrada\n\t\t\t\tLogHandler.debug(uid, this.getClass(), \"entradaAsistencia - Datos Entrada: \" + asistencia);\n\t\t\t\t//Variable de resultado\n\t\t\t\tEncabezadoRespuesta respuesta = new EncabezadoRespuesta();\n\t\t try {\n\t\t \tif (asistencia.getIdEmpleado() == null) {\n\t\t \t\tthrow new ExcepcionesCuadrillas(\"Es necesario el id del empleado.\");\n\t\t \t}\n\t\t \tif (asistencia.getUsuarioAlta() == null || asistencia.getUsuarioAlta().trim().isEmpty()) {\n\t\t \t\tthrow new ExcepcionesCuadrillas(\"Es necesario el usuario.\");\n\t\t \t}\n\t\t \tAsistenciaDAO dao = new AsistenciaDAO();\n\t\t \trespuesta = dao.entradaAsistencia(uid, asistencia);\n\n\t\t } catch (ExcepcionesCuadrillas ex) {\n\t\t\t\t\tLogHandler.error(uid, this.getClass(), \"entradaAsistencia - Error: \" + ex.getMessage(), ex);\n\t\t\t\t\trespuesta.setUid(uid);\n\t\t\t\t\trespuesta.setEstatus(false);\n\t\t\t\t\trespuesta.setMensajeFuncional(ex.getMessage());\n\t\t\t\t\trespuesta.setMensajeTecnico(ex.getMessage());\n\t\t\t\t}\n\t\t\t\tcatch (Exception ex) {\n\t\t\t\t\tLogHandler.error(uid, this.getClass(), \"entradaAsistencia - Error: \" + ex.getMessage(), ex);\n\t\t\t\t\trespuesta.setUid(uid);\n\t\t\t\t\trespuesta.setEstatus(false);\n\t\t\t\t\trespuesta.setMensajeFuncional(ex.getMessage());\n\t\t\t\t\trespuesta.setMensajeTecnico(ex.getMessage());\n\t\t\t\t}\n\t\t\t\tLogHandler.debug(uid, this.getClass(), \"entradaAsistencia - Datos Salida: \" + respuesta);\n\t\t\t\treturn respuesta;\n\t}", "@Override\n public void subirArchivo(ArchivoPOJO arch, int claveExp) throws Exception{\n Connection con = null;\n String sql = \"INSERT INTO Archivo VALUES (NULL,?,?,?,?);\";\n PreparedStatement ps = null;\n ConexionDB cc = new ConexionDB();\n try {\n con = cc.conectarMySQL();\n //stm = con.createStatement();\n ps = con.prepareStatement(sql);\n ps.setBytes(1, arch.getArchivo());\n ps.setInt(2, claveExp);\n ps.setString(3, arch.getTitulo());\n ps.setString(4, arch.getFechaEntrega().toString());\n ps.executeUpdate();\n } catch (SQLException e) {\n throw new Exception(\"Error en Clase ArchivoDAO, metodo \"\n + \"subirArchivo: \" + e.getMessage());\n }finally{\n try { if (ps != null) ps.close(); } catch (Exception e) {};\n try { if (con!= null) con.close(); } catch (Exception e) {};\n }\n }", "public int modificar(TratamientoVO tratamiento) {\n\t\treturn 0;\n\t}", "public void salvarNoBanco() {\n\n try {\n ofertaDisciplinaFacade.save(oferta);\n// JsfUtil.addSuccessMessage(\"Pessoa \" + pessoa.getNome() + \" criado com sucesso!\");\n oferta= null;\n// recriarModelo();\n } catch (Exception e) {\n JsfUtil.addErrorMessage(e, \"Ocorreu um erro de persistência\");\n }\n }", "public void salvar() throws Exception {\n // Verifica se o bean existe\n if(b == null)\n throw new Exception(Main.recursos.getString(\"bd.objeto.nulo\"));\n\n // Primeiro salva o subtipo de banca\n new SubTipoBancaBD(b.getSubTipoBanca()).salvar();\n\n String sql = \"INSERT INTO banca (idBanca, idTipoBanca, idSubTipoBanca, descricao, ano, idCurriculoLattes, idLattes) \" +\n \"VALUES (null, \"+ b.getTipoBanca().getIdTipoBanca() +\", \"+ b.getSubTipoBanca().getIdSubTipoBanca() +\", \" +\n \"'\"+ b.getDescricao() +\"', \"+ b.getAno() +\", \"+ idCurriculoLattes + \" , \"+ b.getIdLattes() +\")\";\n\n\n Transacao.executar(sql);\n }", "public String salirEdPerfil() {\n\t\tofer_id = null;\n\t\tofer_valor_oferta = null;\n\t\tofer_fecha_oferta = null;\n\t\titem = null;\n\t\tpostulante = null;\n\t\titem_nombre = \"\";\n\t\titem_caracteristicas = \"\";\n\t\titem_imagen = \"\";\n\t\tpos_nombre = \"\";\n\t\tpos_apellido = \"\";\n\t\tpos_direccion = \"\";\n\t\tpos_correo = \"\";\n\t\tpos_telefono = \"\";\n\t\tpos_password = \"\";\n\t\tpos_celular = \"\";\n\t\tpos_institucion = \"\";\n\t\tpos_gerencia = \"\";\n\t\tpos_area = \"\";\n\t\tgetListaItems().clear();\n\t\tgetListaItems().addAll(managergest.findAllItems());\n\t\treturn \"home?faces-redirect=true\";\n\t}", "public int getSaldo() {\r\n return this.contaCorrente.getSaldo();\r\n }", "ParqueaderoEntidad actualizar(ParqueaderoEntidad parqueadero);", "public EncabezadoRespuesta bajaAsistencia(AsistenciaDTO asistencia) {\n\t\t//Primero generamos el identificador unico de la transaccion\n\t\tString uid = GUIDGenerator.generateGUID(asistencia);\n\t\t//Mandamos a log el objeto de entrada\n\t\tLogHandler.debug(uid, this.getClass(), \"bajaAsistencia - Datos Entrada: \" + asistencia);\n\t\t//Variable de resultado\n\t\tEncabezadoRespuesta respuesta = new EncabezadoRespuesta();\n\t\ttry {\n\t\t\tif (asistencia.getIdEmpleado() == null) {\n \t\tthrow new ExcepcionesCuadrillas(\"Es necesario el id del empleado.\");\n \t}\n \tif (asistencia.getUsuarioBaja() == null || asistencia.getUsuarioBaja().trim().isEmpty())\n \t{\n \t\tthrow new ExcepcionesCuadrillas(\"Es necesario el usuario para la baja.\");\n \t}\n \tif (asistencia.getUsuarioUltMod() == null || asistencia.getUsuarioUltMod().trim().isEmpty())\n \t{\n \t\tthrow new ExcepcionesCuadrillas(\"Es necesario el usuario para la modificacion.\");\n \t}\n \tAsistenciaDAO dao = new AsistenciaDAO();\n \trespuesta = dao.bajaAsistencia(uid, asistencia);\n\t\t}\n\t\tcatch (ExcepcionesCuadrillas ex) {\n\t\t\tLogHandler.error(uid, this.getClass(), \"bajaAsistencia - Error: \" + ex.getMessage(), ex);\n\t\t\trespuesta.setUid(uid);\n\t\t\trespuesta.setEstatus(false);\n\t\t\trespuesta.setMensajeFuncional(ex.getMessage());\n\t\t\trespuesta.setMensajeTecnico(ex.getMessage());\n\t\t}\n\t\tcatch (Exception ex) {\n\t\t\tLogHandler.error(uid, this.getClass(), \"bajaAsistencia - Error: \" + ex.getMessage(), ex);\n\t\t\trespuesta.setUid(uid);\n\t\t\trespuesta.setEstatus(false);\n\t\t\trespuesta.setMensajeFuncional(ex.getMessage());\n\t\t\trespuesta.setMensajeTecnico(ex.getMessage());\n\t\t}\n\t\tLogHandler.debug(uid, this.getClass(), \"bajaAsistencia - Datos Salida: \" + respuesta);\n\t\treturn respuesta;\n\t}", "Lembretes persistir(Lembretes lembretes);", "@Override\r\n\tpublic void validarSaldo() {\n\t\tSystem.out.println(\"Transaccion exitosa\");\r\n\t}", "public void salir() {\n LoginManager.getInstance().logOut();\n irInicio();\n }", "public boolean salvar()\r\n\t{\n\t\ttry \r\n\t\t{\r\n\t\t\tif(caixaCpf.getText()!=null)\r\n\t\t\t{\r\n\t\t\t\tTecnico tecnico = new Tecnico();\r\n\t\t\t\tUnidade unidade = new UnidadeDAO().buscaSigla(comboUnidadeTrab.getSelectedItem().toString());\r\n\t\t\t\t\r\n\t\t\t\tDate data = new Date (Integer.parseInt(caixaAno.getText())-1900,Integer.parseInt(caixaMes.getText()) -1 , \r\n\t\t\t\t\t\t\t\t\t Integer.parseInt(caixaDia.getText()));\r\n\t\t\t\t\r\n\t\t\t\ttecnico.setCpf(caixaCpf.getText());\r\n\t\t\t\ttecnico.setNome(caixaNome.getText());\r\n\t\t\t\ttecnico.setNascimento(data);\r\n\t\t\t\ttecnico.setEmailInstitucional(caixaEmailInstitucional.getText());\r\n\t\t\t\ttecnico.setEmailSecundario(caixaEmailSecundario.getText());\r\n\t\t\t\ttecnico.setSiape(caixaSiape.getText());\r\n\t\t\t\ttecnico.setUnidade(unidade);\r\n\r\n\t\t\t\t\r\n\t\t\t\tTecnicoDAO tecnicoInsere = new TecnicoDAO();\r\n\t\t\t\t\r\n\t\t\t\tif(tecnicoInsere.insereTecnico(tecnico))\r\n\t\t\t\t\treturn true;\r\n\t\t\t\telse\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Ops algo deu erroado, confirme seus dados!\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t} \r\n\t\tcatch (ClassNotFoundException e1) \r\n\t\t{\r\n\t\t\t\r\n\t\t\te1.printStackTrace();\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Ops algo deu erroado, confirme seus dados!\");\r\n\t\t} \r\n\t\tcatch (SQLException e1) \r\n\t\t{\r\n\t\t\te1.printStackTrace();\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Ops algo deu erroado, confirme seus dados!\");\r\n\t\t}\r\n\t\tcatch (NumberFormatException e)\r\n\t\t{\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Ops algo deu erroado, confirme seus dados!\");\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private void salir(){\r\n\t\tif(Gestion.isModificado()){\r\n\t\t\tint opcion = JOptionPane.showOptionDialog(null, \"¿Desea guardar los cambios?\", \"Salir\", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null,null, null);\r\n\t\t\tswitch(opcion){\r\n\t\t\tcase JOptionPane.YES_OPTION:\r\n\t\t\t\tguardar();\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t\tbreak;\r\n\t\t\tcase JOptionPane.NO_OPTION:\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t\tbreak;\r\n\t\t\tcase JOptionPane.CANCEL_OPTION:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t\tSystem.exit(0);\r\n\t}", "@Override\r\n\t\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\r\n\t\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\t\tsqlLogInspetor.enable();\r\n\r\n\t\t\t\t\tMasterAEnt masterAEnt = (MasterAEnt) ss.get(MasterAEnt.class, 1);\r\n\t\t\t\t\tSystem.out.println(\"$$$$: \" + masterAEnt.getDatetimeA());\r\n\t\t\t\t\tSystem.out.println(\"$$$$: \" + masterAEnt.getDatetimeA().getTime());\r\n\r\n\t\t\t\t\tPlayerManagerTest.this.manager.overwriteConfigurationTemporarily(PlayerManagerTest.this.manager\r\n\t\t\t\t\t\t\t.getConfig().clone().configSerialiseBySignatureAllRelationship(true));\r\n\r\n\t\t\t\t\tPlayerSnapshot<MasterAEnt> playerSnapshot = PlayerManagerTest.this.manager\r\n\t\t\t\t\t\t\t.createPlayerSnapshot(masterAEnt);\r\n\r\n\t\t\t\t\tFileOutputStream fos;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\t\tPlayerManagerTest.this.manager.getConfig().getObjectMapper().writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tsqlLogInspetor.disable();\r\n\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}", "int insert(Salaries record);", "public void save() {\n super.storageSave(listPedidosAssistencia.toArray());\n }", "@Override\r\n public ExpedienteGSMDTO veriActuFlgTramFinalizadoDsr(Long idExpediente,Long idOrdenServicio,Long idResultadoSupervision,UsuarioDTO usuarioDTO) throws ExpedienteException{\r\n LOG.info(\"veriActuFlgTramFinalizadoDsr\");\r\n ExpedienteGSMDTO retorno=null;\r\n try{\r\n PghResultadoSupervision resSup = crud.find(idResultadoSupervision, PghResultadoSupervision.class);\r\n \r\n PghExpediente expe = crud.find(idExpediente, PghExpediente.class);\r\n if(resSup.getCodigo().equals(Constantes.CODIGO_RESULTADO_SUPERVISION_CUMPLE) || resSup.getCodigo().equals(Constantes.CODIGO_RESULTADO_SUPERVISION_CUMPLE_OBSTACULIZADO)){\r\n expe.setFlagTramiteFinalizado(Constantes.ESTADO_ACTIVO);\r\n }else if(resSup.getCodigo().equals(Constantes.CODIGO_RESULTADO_SUPERVISION_NOCUMPLE) || resSup.getCodigo().equals(Constantes.CODIGO_RESULTADO_SUPERVISION_NOCUMPLE_OBSTACULIZADO)){\r\n expe.setFlagTramiteFinalizado(Constantes.ESTADO_INACTIVO);\r\n }else{\r\n throw new ExpedienteException(\"Casuistica no encontrada para Finalizar la Orden de Servicio. Revisar Supervision.\",null);\r\n }\r\n expe.setDatosAuditoria(usuarioDTO);\r\n crud.update(expe);\r\n retorno=ExpedienteGSMBuilder.toExpedienteDto(expe);\r\n }catch(Exception e){\r\n LOG.error(\"error en veriActuFlgTramFinalizadoDsr\",e);\r\n ExpedienteException ex = new ExpedienteException(e.getMessage(), e);\r\n throw ex;\r\n }\r\n return retorno;\r\n }", "@Override\n\tpublic int insertarEntrada(AlmacenDTO obj) {\n\t\tint rs=-1;\n\t\tConnection con=null;\n\t\tPreparedStatement pst=null;\n\t\ttry {\n\t\t\tcon=new MySqlDbConexion().getConexion();\n\t\t\tString sql=\"insert into MATERIAL_ENTRADA values (null,?,?,?)\";\n\t\t\tpst=con.prepareStatement(sql);\n\t\t\t\n\t\t\tpst.setInt(1,obj.getCodigo_producto());\n\t\t\tpst.setInt(2,obj.getCantidad_entrada());\n\t\t\tpst.setDate(3,obj.getFecha_entrada());\n\t\t\t\n\t\t\trs=pst.executeUpdate();\n\t\t \n\t\t\t\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\tSystem.out.println(\"Error en la Sentencia\"+e.getMessage());\n\t\t\t\n\t\t}\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tif(pst!=null) pst.close();\n\t\t\t\tif(con!=null) con.close();\n\t\t\t}\n\t\t\tcatch (SQLException e) {\n\t\t\t\tSystem.out.println(\"Error al cerrar\");\n\t\t\t}\n\t\t}\n\t\treturn rs;\n\t}", "private void salvarXML(){\r\n\t\tarquivo.setLista(listaDeUsuarios);\r\n\t\tarquivo.finalizarXML();\r\n\t}", "public boolean insertarCreacionHistorialCliente(Cliente cliente) {\n String queryDividido1 = \"INSERT INTO Historial_Cliente(Usuario_Codigo, Nombre, DPI, Direccion, Sexo, Password, Nacimiento, DPI_Escaneado, Tipo, Fecha_Cambio) \"\n + \"VALUES(?,?,?,?,?,aes_encrypt(?,'AES'),?,?,?,?)\";\n java.sql.Date fechaCreacion = new java.sql.Date(Calendar.getInstance().getTime().getTime());\n\n try {\n\n PreparedStatement enviarDividido1 = Conexion.conexion.prepareStatement(queryDividido1);\n\n //Envio de los Datos de Creacion de un Nuevo Cliente a la Tabla Historial_Cliente\n enviarDividido1.setInt(1, cliente.getCodigo());\n enviarDividido1.setString(2, cliente.getNombre());\n enviarDividido1.setString(3, cliente.getDPI());\n enviarDividido1.setString(4, cliente.getDireccion());\n enviarDividido1.setString(5, cliente.getSexo());\n enviarDividido1.setString(6, cliente.getPassword());\n enviarDividido1.setString(7, cliente.getNacimiento());\n enviarDividido1.setBlob(8, cliente.getDPIEscaneado());\n enviarDividido1.setString(9, \"Creacion\");\n enviarDividido1.setString(10, fechaCreacion.toString());\n enviarDividido1.executeUpdate();\n\n \n return true;\n\n } catch (SQLException ex) {\n ex.printStackTrace(System.out);\n return false;\n }\n\n }", "private void salvarVenda(String nomeCliente, double precoFinal, double desconto ,String mesAnoAt,String dataCompra,String formaDePagamento) {\n\n\t\tFirebaseAuth autenticacion = configFireBase.getFireBaseAutenticacao();\n\n\t\tString idUsuario = Base64Custom.codificarBase64(autenticacion.getCurrentUser().getEmail());\n\t\tDatabaseReference VendaRef=mDatabase.child(\"vendas\");\n\n\n\t\tvenda.setIdVenda(VendaRef.push().getKey());\n\t\tvenda.setNomeCliente(nomeCliente);\n\t\tvenda.setValorTotal(precoFinal);\n\t\tvenda.setMesAno(mesAnoAt);\n\t\tvenda.setDesconto(desconto);\n\t\tvenda.setDataCompra(dataCompra);\n\t\tvenda.setLista(ListagemDeProdutosParaCompras.produtosSelecionados);\n\t\tvenda.setFormaDePagamento(formaDePagamento);\n\n\t\tmDatabase.child(\"armazenamento\").child(idUsuario).child(\"vendas\").child(venda.getIdVenda()).setValue(venda).addOnCompleteListener(new OnCompleteListener<Void>() {\n\n\t\t\t@Override\n\t\t\tpublic void onComplete(@NonNull Task<Void> task) {\n\n\t\t\t}\n\n\t\t});\n\n\t\tToast.makeText(CadastrarVendaActivity.this, \"Venda Realizada\", Toast.LENGTH_SHORT).show();\n\t\tstartActivity(new Intent(getApplicationContext(), ListagemDeVendasRealizadas.class));\n\t\tvenda.subtrairVendas();\n\n\t\tthis.finish();\n\t}", "public int getSistemaSalud() {\r\n\t\treturn sistemaSalud;\r\n\t}", "boolean agregarIngreso(Ingreso i) {\n boolean hecho = false;\n try {\n operacion = ayudar.beginTransaction();\n ayudar.save(i);\n operacion.commit();\n } catch (Exception e) {\n operacion.rollback();\n System.out.println(e);\n }\n return hecho;\n }", "@Override\r\n\tpublic TraitSalaire save(@Context HttpHeaders headers , TraitSalaire entity) {\n\t\t processBeforeSave(entity);\r\n\t\t // controle si préparation \r\n\t\t RestrictionsContainer container = RestrictionsContainer.newInstance();\r\n\t\t container.addEq(\"periode.id\", entity.getPeriode().getId());\r\n\t\t List<BulletinPaie> datas = managerbul.filter(container.getPredicats(), null, new HashSet<String>(), 0, -1);\r\n\t\t if(datas==null||datas.isEmpty()||datas.size()==0){\r\n\t\t\t throw new KerenExecption(\"OPERATION IMPOSSIBLE ::Bien vouloir effectu&eacute; la pr&eacute;paration de la paie de cette p&eacute;riode !!\");\r\n\t\t }\r\n\t\t managerbul.validerSalaire(entity);\r\n\t\tCacheMemory.insert(BuilderHttpHeaders.getidUsers(headers), TypeCacheMemory.PERIODE, entity.getPeriode());\r\n\t\tprocessAfterSave(entity);\r\n\t\treturn entity;\r\n\t}", "public void save() {\n sessionBean.saveStudent();\n success = true;\n }", "public void salvarProdutos(Produto produto){\n }", "@Override\r\n\tpublic int registrarSalidaVehiculo(Vehiculo vehiculo) {\r\n\r\n\t\tSitioParqueoEntidad sitParEntidad = sitioParqueoEntidadService.obtenerSitioParqueo(vehiculo);\r\n\r\n\t\tsitParEntidad.setActivo(false);\r\n\t\tsitParEntidad.setFechaFin(new Date());\r\n\t\tSitioParqueoEntidad sitParEntRet = sitioParqueoEntidadService.liberar(sitParEntidad);\r\n\r\n\t\tadminEstacionamiento.removerSitioParqueo(sitParEntRet);\r\n\r\n\t\tTiempoEstadia tiempoEstadia = Temporizador.calcularTiempoEstadia(sitParEntidad.getFechaInicio());\r\n\t\treturn ReglaEstacionamiento.calcularPrecioParqueo(\r\n\t\t\t\tVehiculoAdapter.getVehiculo(sitParEntRet.getVehiculo()), tiempoEstadia);\r\n\r\n\t}", "@Override\r\n\tpublic void save() {\n\r\n\t\ts.save();\r\n\r\n\t}", "public void insercionMasiva() {\r\n\t\tif (!precondInsert())\r\n\t\t\treturn;\r\n\t\tUploadItem fileItem = seleccionUtilFormController.crearUploadItem(\r\n\t\t\t\tfName, uFile.length, cType, uFile);\r\n\t\ttry {\r\n\t\t\tlLineasArch = FileUtils.readLines(fileItem.getFile(), \"ISO-8859-1\");\r\n\t\t} catch (IOException e) {\r\n\t\t\tstatusMessages.add(Severity.INFO, \"Error al subir el archivo\");\r\n\t\t}\r\n\r\n\t\tStringBuilder cadenaSalida = new StringBuilder();\r\n\t\tString estado = \"EXITO\";\r\n\t\tcantidadLineas = 0;\r\n\t\t//Ciclo para contar la cantdad de adjudicados o seleccionados que se reciben\r\n\t\tfor (String linea : lLineasArch) {\r\n\t\t\tcantidadLineas++;\r\n\t\t\tif(cantidadLineas > 1){\r\n\t\t\t\tseleccionados++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Condicion para verificar si la cantidad de seleccionados es mayor a la cantidad de vacancias (en cuyo caso se procede a abortar el proceso e imprimir\r\n\t\t//un mensaje de error) o verificar si esta es menor (se imprime el mensaje pero se continua)\r\n\t\t\r\n\t\tif(seleccionados > concursoPuestoAgrNuevo.getCantidadPuestos()){\r\n\t\t\testado = \"FRACASO\";\r\n\t\t\tcadenaSalida.append(estado + \" - CANTIDAD DE AJUDICADOS ES SUPERIOR A LA CANTIDAD DE PUESTOS VACANTES PARA EL GRUPO\");\r\n\t\t\tcadenaSalida.append(System.getProperty(\"line.separator\"));\r\n\t\t}\r\n\t\telse if(seleccionados < concursoPuestoAgrNuevo.getCantidadPuestos()){\r\n\t\t\tcadenaSalida.append(\"ADVERTENCIA - CANTIDAD DE ADJUDICADOS ES INFERIOR A LA CANTIDAD DE PUESTOS VACANTES PARA EL GRUPO\");\r\n\t\t\tcadenaSalida.append(System.getProperty(\"line.separator\"));\r\n\t\t}\r\n\t\tseleccionados = 0;\r\n\t\t\r\n\t\tif(!estado.equals(\"FRACASO\")){\r\n\r\n\t\tcantidadLineas = 0;\r\n\t\tfor (String linea : lLineasArch) {\r\n\r\n\t\t\tcantidadLineas++;\r\n\t\t\testado = \"EXITO\";\r\n\t\t\tString observacion = \"\";\r\n\t\t\tFilaPostulante fp = new FilaPostulante(linea);\r\n\t\t\tList<Persona> lista = null;\r\n\t\t\tif (cantidadLineas > 1 && fp != null && fp.valido) {\r\n\t\t\t\t//Verifica si la persona leida en el registro del archivo CSV existe en la Tabla Persona\r\n\t\t\t\tString sqlPersona = \"select * from general.persona where persona.documento_identidad = '\"+fp.getDocumento()+ \"'\";\r\n\t\t\t\tQuery q1 = em.createNativeQuery(sqlPersona, Persona.class);\r\n\t\t\t\tPersona personaLocal = new Persona();\r\n\t\t\t\tint banderaEncontroPersonas = 0;\r\n\t\t\t\t//Si existe, se almacena el registro de la tabla\r\n\t\t\t\tif(!q1.getResultList().isEmpty()){\r\n\t\t\t\t\tlista = q1.getResultList();\r\n\t\t\t\t\tif (compararNomApe(lista.get(0).getNombres(), removeCadenasEspeciales(fp.getNombres()))\r\n\t\t\t\t\t\t\t&& compararNomApe(lista.get(0).getApellidos(), removeCadenasEspeciales(fp.getApellidos())) ) {\r\n\t\t\t\t\t\t\tbanderaEncontroPersonas = 1;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\testado = \"FRACASO\";\r\n\t\t\t\t\t\t\tobservacion += \" PERSONA NO REGISTRADA EN LA BASE DE DATOS LOCAL\";\r\n\t\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\testado = \"FRACASO\";\r\n\t\t\t\t\tobservacion += \" PERSONA NO REGITRADA EN LA BASE DE DATOS LOCAL\";\r\n\t\t\t\t}\r\n\t\t\t\t//Verificamos que la persona figure en la lista corta como seleccionado\r\n\t\t\t\tif(!estado.equals(\"FRACASO\")){\r\n\t\t\t\t\tint banderaExisteEnListaCorta = 0;\t\t\t\t\t\r\n\t\t\t\t\tint i=0;\r\n\t\t\t\t\tif (banderaEncontroPersonas == 1) {\r\n\t\t\t\t\t\twhile(i<lista.size()){\r\n\t\t\t\t\t\t\tpersonaLocal = (Persona) lista.get(i);\r\n\t\t\t\t\t\t\tQuery p = em.createQuery(\"select E from EvalReferencialPostulante E \"\r\n\t\t\t\t\t\t\t\t\t+ \"where E.postulacion.personaPostulante.persona.idPersona =:id_persona and E.concursoPuestoAgr.idConcursoPuestoAgr =:id_concurso_puesto_agr and E.listaCorta=:esta_en_lista_corta\");\r\n\t\t\t\t\t\t\t\t\tp.setParameter(\"id_persona\", personaLocal.getIdPersona());\r\n\t\t\t\t\t\t\t\t\tp.setParameter(\"id_concurso_puesto_agr\", this.idConcursoPuestoAgr);\r\n\t\t\t\t\t\t\t\t\tp.setParameter(\"esta_en_lista_corta\", true);\r\n\t\t\t\t\t\t\tList<EvalReferencialPostulante> listaEvalRefPost = p.getResultList();\r\n\t\t\t\t\t\t\tif (!listaEvalRefPost.isEmpty()) {\r\n\t\t\t\t\t\t\t\tbanderaExisteEnListaCorta = 1;\r\n\t\t\t\t\t\t\t\ti = lista.size();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ti++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (banderaExisteEnListaCorta == 0) {\r\n\t\t\t\t\t\testado = \"FRACASO\";\r\n\t\t\t\t\t\tobservacion += \" NO SELECCIONADO/ELEGIBLE EN LISTA CORTA\";\r\n\t\t\t\t\t} else if (banderaExisteEnListaCorta == 1){\r\n\t\t\t\t\t\tobservacion += \" SELECCIONADO/ELEGIBLE EN LISTA CORTA\";\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tQuery p = em.createQuery(\"select E from EvalReferencialPostulante E \"\r\n\t\t\t\t\t\t\t\t+ \"where E.postulacion.personaPostulante.persona.idPersona =:id_persona and E.concursoPuestoAgr.idConcursoPuestoAgr =:id_concurso_puesto_agr and E.listaCorta=:esta_en_lista_corta\");\r\n\t\t\t\t\t\t\t\tp.setParameter(\"id_persona\", personaLocal.getIdPersona());\r\n\t\t\t\t\t\t\t\tp.setParameter(\"id_concurso_puesto_agr\", this.idConcursoPuestoAgr);\r\n\t\t\t\t\t\t\t\tp.setParameter(\"esta_en_lista_corta\", true);\r\n\t\t\t\t\t\tEvalReferencialPostulante auxEvalReferencialPostulante = (EvalReferencialPostulante) p.getResultList().get(0);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Validaciones para actualizaciones\r\n\t\t\t\t\t\t//Bandera indicadora de actualizaciones hechas\r\n\t\t\t\t\t\tint bandera = 0;\r\n\t\t\t\t\t\tif(auxEvalReferencialPostulante.getSelAdjudicado() == null){\r\n\t\t\t\t\t\t\testado = \"EXITO\";\r\n\t\t\t\t\t\t\tauxEvalReferencialPostulante.setSelAdjudicado(true);;\r\n\t\t\t\t\t\t\tbandera = 1;\r\n\t\t\t\t\t\t\tem.merge(auxEvalReferencialPostulante);\r\n\t\t\t\t\t\t\tem.flush();\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\tagregarEstadoMotivo(linea, estado, observacion, cadenaSalida);\r\n\t\t\t}\r\n\t\t\tif (cantidadLineas > 1 && !fp.valido) {\r\n\t\t\t\testado = \"FRACASO\";\r\n\t\t\t\tcadenaSalida\r\n\t\t\t\t\t\t.append(estado\r\n\t\t\t\t\t\t\t\t+ \" - ARCHIVO INGRESADO CON MENOS CAMPOS DE LOS NECESARIOS. DATOS INCORRECTOS EN ALGUNA COLUMNA.\");\r\n\t\t\t\tcadenaSalida.append(System.getProperty(\"line.separator\"));\r\n\t\t\t}\r\n\r\n\t\t\t// FIN FOR\r\n\t\t}\r\n\t\t//FIN IF\r\n\t\t}\r\n\t\tif (lLineasArch.isEmpty()) {\r\n\t\t\tstatusMessages.add(Severity.INFO, \"Archivo inválido\");\r\n\t\t\treturn;\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\tSimpleDateFormat sdf2 = new SimpleDateFormat(\"dd_MM_yyyy_HH_mm_ss\");\r\n\t\t\tString nArchivo = sdf2.format(new Date()) + \"_\" + fName;\r\n\t\t\tString direccion = System.getProperty(\"jboss.home.dir\") + System.getProperty(\"file.separator\") + \"temp\" + System.getProperty(\"file.separator\");\r\n\t\t\tFile archSalida = new File(direccion + nArchivo);\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tFileUtils\r\n\t\t\t\t\t\t.writeStringToFile(archSalida, cadenaSalida.toString());\r\n\t\t\t\tif (archSalida.length() > 0) {\r\n\t\t\t\t\tstatusMessages.add(Severity.INFO, \"Insercion Exitosa\");\r\n\t\t\t\t}\r\n\t\t\t\tJasperReportUtils.respondFile(archSalida, nArchivo, false,\r\n\t\t\t\t\t\t\"application/vnd.ms-excel\");\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tstatusMessages.add(Severity.ERROR, \"IOException\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void salir() {\n if (bandera == 1) {\n altoTabla = \"310\";\n formulaProceso = (Column) FacesContext.getCurrentInstance().getViewRoot().findComponent(\"form:datosFormulaProceso:formulaProceso\");\n formulaProceso.setFilterStyle(\"display: none; visibility: hidden;\");\n\n formulaPeriodicidad = (Column) FacesContext.getCurrentInstance().getViewRoot().findComponent(\"form:datosFormulaProceso:formulaPeriodicidad\");\n formulaPeriodicidad.setFilterStyle(\"display: none; visibility: hidden;\");\n\n RequestContext.getCurrentInstance().update(\"form:datosFormulaProceso\");\n bandera = 0;\n filtrarListFormulasProcesos = null;\n tipoLista = 0;\n }\n listFormulasProcesosBorrar.clear();\n listFormulasProcesosCrear.clear();\n listFormulasProcesosModificar.clear();\n index = -1;\n secRegistro = null;\n k = 0;\n listFormulasProcesos = null;\n guardado = true;\n RequestContext.getCurrentInstance().update(\"form:ACEPTAR\");\n formulaActual = null;\n lovProcesos = null;\n }", "@Override\r\n\t\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\t\r\n\t\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\t\r\n\t\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\t\tList<MasterAEnt> masterAEntList = hbSupport.createCriteria(ss, MasterAEnt.class)\r\n\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"id\")).list();\r\n\t\t\t\t\t\r\n\t\t\t\t\tPlayerManagerTest.this.manager\r\n\t\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\t\tPlayerManagerTest.this.manager.getConfig().clone()\r\n\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(true));\r\n\t\t\t\t\t\r\n\t\t\t\t\tPlayerSnapshot<List<MasterAEnt>> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(masterAEntList);\r\n\t\t\t\t\t\r\n\t\t\t\t\tFileOutputStream fos;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}", "@Override\n\tpublic void guardar() {\n\t\tLOG.info(\"El usuario fue guardado \"+ usuario.getApellido()+\", \"+ usuario.getNombre());\n\t}", "private static void registrarAuditoriaDetallesClienteArchivo(Connexion connexion,ClienteArchivo clientearchivo)throws Exception {\n\t\t\r\n\t\tString strValorActual=null;\r\n\t\tString strValorNuevo=null;\r\n\t\t\r\n\t\t\t\r\n\t\t\tif(clientearchivo.getIsNew()||!clientearchivo.getid_cliente().equals(clientearchivo.getClienteArchivoOriginal().getid_cliente()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(clientearchivo.getClienteArchivoOriginal().getid_cliente()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=clientearchivo.getClienteArchivoOriginal().getid_cliente().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(clientearchivo.getid_cliente()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=clientearchivo.getid_cliente().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),ClienteArchivoConstantesFunciones.IDCLIENTE,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(clientearchivo.getIsNew()||!clientearchivo.getid_tipo_archivo().equals(clientearchivo.getClienteArchivoOriginal().getid_tipo_archivo()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(clientearchivo.getClienteArchivoOriginal().getid_tipo_archivo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=clientearchivo.getClienteArchivoOriginal().getid_tipo_archivo().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(clientearchivo.getid_tipo_archivo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=clientearchivo.getid_tipo_archivo().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),ClienteArchivoConstantesFunciones.IDTIPOARCHIVO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(clientearchivo.getIsNew()||!clientearchivo.getnombre().equals(clientearchivo.getClienteArchivoOriginal().getnombre()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(clientearchivo.getClienteArchivoOriginal().getnombre()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=clientearchivo.getClienteArchivoOriginal().getnombre();\r\n\t\t\t\t}\r\n\t\t\t\tif(clientearchivo.getnombre()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=clientearchivo.getnombre() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),ClienteArchivoConstantesFunciones.NOMBRE,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(clientearchivo.getIsNew()||!clientearchivo.getarchivo().equals(clientearchivo.getClienteArchivoOriginal().getarchivo()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(clientearchivo.getClienteArchivoOriginal().getarchivo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=clientearchivo.getClienteArchivoOriginal().getarchivo().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(clientearchivo.getarchivo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=clientearchivo.getarchivo().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),ClienteArchivoConstantesFunciones.ARCHIVO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(clientearchivo.getIsNew()||!clientearchivo.getdescripcion().equals(clientearchivo.getClienteArchivoOriginal().getdescripcion()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(clientearchivo.getClienteArchivoOriginal().getdescripcion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=clientearchivo.getClienteArchivoOriginal().getdescripcion();\r\n\t\t\t\t}\r\n\t\t\t\tif(clientearchivo.getdescripcion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=clientearchivo.getdescripcion() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),ClienteArchivoConstantesFunciones.DESCRIPCION,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t}", "public void salida(String k_idparqueadero) throws CaException {\n try {\n String strSQL = \"UPDATE servicio SET f_fycsalida=?, q_valorapagar=? WHERE k_idservicio =?\";\n Connection conexion = ServiceLocator.getInstance().tomarConexion();\n PreparedStatement prepStmt = conexion.prepareStatement(strSQL);\n prepStmt.setDate(1, Date.valueOf(servicio.getF_fycsalida()));\n prepStmt.setInt(2, servicio.getQ_valorapagar());\n prepStmt.setInt(3, servicio.getK_idservicio());\n prepStmt.executeUpdate();\n prepStmt.close();\n ServiceLocator.getInstance().commit();\n } catch (SQLException e) {\n throw new CaException(\"ServicioDAO\", \"No pudo actualizar el servicio\" + e.getMessage());\n } finally {\n ServiceLocator.getInstance().liberarConexion();\n }\n this.actualizarDatosSalida(String.valueOf(servicio.getK_idservicio()), k_idparqueadero);\n }", "public void encerrarSistema() {\r\n\t\tthis.salvarXML();\r\n\t}", "public void saveData(){\n SerializableManager.saveSerializable(this,user,\"userInfo.data\");\n SerializableManager.saveSerializable(this,todayCollectedID,\"todayCollectedCoinID.data\");\n SerializableManager.saveSerializable(this,CollectedCoins,\"collectedCoin.data\");\n uploadUserData uploadUserData = new uploadUserData(this);\n uploadUserData.execute(this.Uid);\n System.out.println(Uid);\n\n }", "@Override\r\n\tpublic int save(SpUser t) {\n\t\treturn 0;\r\n\t}", "Reserva Obtener();", "private void registroProcesado(InterfazParams interfazParams) {\n\t\tLong registrosProcesados = (Long) interfazParams.getQueryParams().get(\n\t\t\t\t\"registrosProcesados\");\n\t\tregistrosProcesados = new Long(registrosProcesados.longValue() + 1);\n\t\tinterfazParams.getQueryParams().put(\"registrosProcesados\",\n\t\t\t\tregistrosProcesados);\n\t}", "@Override\r\n\t@Transactional\r\n\tpublic void doService() {\n\t\tTbookingrecord booking = new Tbookingrecord();\r\n\t\tbooking.setId(Long.valueOf(31622L));\r\n\t\tbooking.setInstrumentid(2);\r\n\t\tbooking.setUserid(3);\r\n\t\tmappper.insertSelective(booking);\r\n\t\tlogger.debug(booking);\r\n\t\t//int i = 1/0;\r\n\t}", "public void salvaProduto(Produto produto){\n conecta = new Conecta();\n conecta.iniciaConexao();\n\n String sql = \"INSERT INTO `JoalheriaJoia`.`Produto` (`codigo`, `nome`, `valorCusto`, `valorVenda`, `idTipoJoia` , `quantidadeEstoque`) VALUES (?, ?, ?, ?, ?, ?);\";\n\n try {\n PreparedStatement pstm;\n pstm = conecta.getConexao().prepareStatement(sql); \n \n pstm.setString(1, produto.getCodigo());\n pstm.setString(2, produto.getNome());\n pstm.setFloat(3, produto.getValorCusto());\n pstm.setFloat(4, produto.getValorVenda());\n pstm.setInt(5, produto.getTipoJoia().getIdTipoJoia());\n pstm.setInt(6, produto.getQuantidadeEstoque());\n pstm.execute();\n } catch (SQLException ex) {\n Logger.getLogger(ProdutoDao.class.getName()).log(Level.SEVERE, null, ex);\n }\n conecta.fechaConexao(); \n \n }", "private void grabarArchivo() {\n\t\tPrintWriter salida;\n\t\ttry {\n\t\t\tsalida = new PrintWriter(new FileWriter(super.salida));\n\t\t\tsalida.println(this.aDevolver);\n\t\t\tsalida.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public Actividad buscarSalida (String actividad) {\r\n Actividad act = new Actividad();\r\n String query = \"SELECT * FROM actividad WHERE id_salida = \\\"\" + actividad + \"\\\"\";\r\n try {\r\n Statement st = con.createStatement();\r\n ResultSet rs = st.executeQuery(query);\r\n if (rs.next()) {\r\n act.setIdentificacionSalida(rs.getInt(\"id_salida\"));\r\n act.setIdentificacionNavegante(rs.getString(\"identificacion_navegate\"));\r\n act.setNumeroMatricula(rs.getInt(\"numero_matricula\"));\r\n act.setFecha(rs.getDate(\"fecha\").toString());\r\n act.setHora(rs.getTime(\"hora\").toString());\r\n act.setDestino(rs.getString(\"destino\"));\r\n }\r\n st.close();\r\n rs.close();\r\n } catch (SQLException ex) {\r\n Logger.getLogger(PActividad.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n return act;\r\n }", "public void guardar() {\n String msj = \"\";\n int idpagoanulado = daoPagoCuotaAnulado.nuevoID();\n Date SYSDATE = new Date();\n java.sql.Timestamp fechaPagoCuotaAnuladoSQL = new java.sql.Timestamp(SYSDATE.getTime());\n String observacion = txtObservacion.getText();\n int idmotivo = Integer.parseInt(txtCodigoMotivo.getText());\n int idusuario = appLogin.IDUSUARIO;\n int idpago =Integer.parseInt(txtNumeroPago.getText());\n Date fechapago = daoCotizacion.parseFecha(txtFechaPago.getText());\n java.sql.Date fechapagoSQL = new java.sql.Date(fechapago.getTime());\n double mPago = montoPago;\n String numerocomprobante = txtComprobante.getText();\n String numerorecibo = txtRecibo.getText();\n //VALIDACIONES\n if (idmotivo == 0) {\n msj += \"CODIGO DEL MOTIVO DE ANULACION ESTA VACIO.\\n\";\n }\n if (idpago == 0) {\n msj += \"NO HA SELECCIONADO NINGUN PAGO PARA LA ANULACIÓN.\\n\";\n }\n if (msj.isEmpty()) {\n cpca.setIdpagoanulado(idpagoanulado);\n cpca.setFechahoranulado(fechaPagoCuotaAnuladoSQL);\n cpca.setObservacion(observacion);\n cpca.setIdmotivo(idmotivo);\n cpca.setIdusuario(idusuario);\n cpca.setIdpago(idpago);\n cpca.setFechapago(fechapagoSQL);\n cpca.setMonto(mPago);\n cpca.setNumerocomprobante(numerocomprobante);\n cpca.setNumerorecibo(numerorecibo);\n daoPagoCuotaAnulado.agregar(cpca);\n } else {\n JOptionPane.showMessageDialog(null, msj, \"ERRORES\", JOptionPane.ERROR_MESSAGE);\n }\n }", "public void guardar(Dia dia) {\n Session session = sessionFactory.openSession();\n //la transaccion a relizar\n Transaction tx = null;\n try {\n tx = session.beginTransaction();\n //guardamos el Dia\n session.persist(dia);\n \n tx.commit();\n }\n catch (Exception e) {\n //Se regresa a un estado consistente \n if (tx!=null){ \n tx.rollback();\n }\n e.printStackTrace(); \n } finally {\n //cerramos simpre la sesion\n session.close();\n }\n }", "@Override\n\tpublic void actualizar(Seccion seccion) {\n\n\t\tentity.getTransaction().begin();\n\t\tentity.merge(seccion);\n\t\tentity.getTransaction().commit();\n\n\t}", "@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\tMasterAEnt masterAEnt = (MasterAEnt) ss.get(MasterAEnt.class, 1);\r\n\t\t\t\tSystem.out.println(\"$$$$: \" + masterAEnt.getDatetimeA());\r\n\t\t\t\tSystem.out.println(\"$$$$: \" + masterAEnt.getDatetimeA().getTime());\r\n\t\t\t\r\n\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t.this\r\n\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(true));\r\n\t\t\t\t\r\n\t\t\t\tPlayerSnapshot<MasterAEnt> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(masterAEnt);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}", "@Override\r\n\tpublic void save(PembayaranObat pembayaranObat) {\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\tsession.save(pembayaranObat);\r\n\t\tsession.flush();\r\n\t}", "private void agregarARegistro(int numeroCuenta){\n try{\n RegistroSerializado registro = new RegistroSerializado(\n numeroCuenta, \"Hay un registro de transacciones no asociado para ese numero de cliente...\");\n salRegistro.writeObject(registro);\n }\n catch(NoSuchElementException noSuchElementException){\n System.err.println(\"Entrada invalida. Intente de nuevo.\");\n }\n catch(IOException iOException){\n System.err.println(\"Error al escribir en el archivo. Terminado.\");\n System.exit(1);\n }\n }" ]
[ "0.6928929", "0.6606031", "0.6466492", "0.64456534", "0.64117324", "0.6299348", "0.6149753", "0.60689414", "0.6042051", "0.60099953", "0.59932715", "0.59709287", "0.59707785", "0.591341", "0.590152", "0.5898064", "0.5892623", "0.58892125", "0.5880403", "0.58775246", "0.5865639", "0.58538985", "0.58122885", "0.5809297", "0.5780543", "0.57697964", "0.5750333", "0.5739327", "0.569844", "0.56942767", "0.5683736", "0.56823623", "0.5672198", "0.5654473", "0.5653331", "0.56362766", "0.56342703", "0.56330067", "0.56202054", "0.5616986", "0.56109005", "0.56026524", "0.5598965", "0.5596584", "0.5587815", "0.55852294", "0.5582672", "0.55785435", "0.55785435", "0.55734485", "0.55694586", "0.55609536", "0.55601484", "0.55467993", "0.5537214", "0.5536701", "0.5527568", "0.5518801", "0.5511753", "0.550325", "0.5501072", "0.5492382", "0.54913443", "0.5486042", "0.54809695", "0.5470059", "0.54678375", "0.54676104", "0.5450811", "0.5440194", "0.54396284", "0.5438265", "0.5432017", "0.5426326", "0.54239416", "0.5419116", "0.5418264", "0.5410078", "0.5409488", "0.54008585", "0.53972626", "0.5393817", "0.5388984", "0.5387845", "0.5387373", "0.5386845", "0.5386124", "0.53847206", "0.5375388", "0.5371856", "0.53676647", "0.5367081", "0.5364216", "0.5361736", "0.53611434", "0.5358413", "0.535696", "0.5351447", "0.53505087", "0.53488255", "0.53480124" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { SendFactory sf = new SendFactory(); Sender sender = sf.produce("sms"); sender.Send(); System.out.println("=================="); SendFactory sf2 = new SendFactory(); Sender sender2 = sf2.produceMail(); sender2.Send(); System.out.println("=================="); Sender sender3 = StaticSendFactory.produceMail(); sender3.Send(); }
{ "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}", "private stendhal() {\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "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\tprotected void initialize() {\n\n\t}", "@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}", "public void mo55254a() {\n }", "@Override\n\tprotected void initValue()\n\t{\n\n\t}" ]
[ "0.66730285", "0.65698135", "0.6524193", "0.64818907", "0.6477969", "0.6459897", "0.64150065", "0.6378023", "0.62785167", "0.6256323", "0.62391806", "0.6225302", "0.6203955", "0.6196986", "0.6196986", "0.6193411", "0.6188864", "0.6175446", "0.61352557", "0.6129083", "0.6081512", "0.6078478", "0.604346", "0.6027257", "0.6019896", "0.6001062", "0.5969694", "0.5969694", "0.59695363", "0.5950136", "0.5940857", "0.5923273", "0.59109026", "0.5904841", "0.58943695", "0.58871347", "0.5884626", "0.5871665", "0.5857174", "0.58529896", "0.58477926", "0.5827649", "0.58111745", "0.5810771", "0.58093345", "0.58093345", "0.58016413", "0.5792614", "0.57915145", "0.57915145", "0.57915145", "0.57915145", "0.57915145", "0.57915145", "0.579047", "0.5788485", "0.5783461", "0.5783461", "0.57756454", "0.57756454", "0.57756454", "0.57756454", "0.57756454", "0.5762863", "0.57603353", "0.57603353", "0.5751224", "0.5751224", "0.5751224", "0.5751004", "0.573491", "0.573491", "0.573491", "0.572175", "0.5717107", "0.5717079", "0.5717079", "0.5717079", "0.5717079", "0.5717079", "0.5717079", "0.5717079", "0.5716174", "0.5715048", "0.5704484", "0.5700041", "0.5699844", "0.56887585", "0.56792545", "0.5674781", "0.56728446", "0.56702185", "0.5662837", "0.5657697", "0.56568635", "0.56568635", "0.56568635", "0.5656818", "0.5655768", "0.56533396", "0.56532913" ]
0.0
-1
Created by lining on 2019/6/18.
@Repository public interface MemberDao { Member findByMobile(@Param("mobile") String mobile); Member findByCode(@Param("member_code") String code); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\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 final void mo51373a() {\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "private void poetries() {\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 anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "public void mo38117a() {\n }", "Petunia() {\r\n\t\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n protected void initialize() {\n\n \n }", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n public int getSize() {\n return 1;\n }", "@Override\n public void init() {\n }", "@Override\n protected void initialize() \n {\n \n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n void init() {\n }", "@Override\n public void memoria() {\n \n }", "private Rekenhulp()\n\t{\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "private UsineJoueur() {}", "public Pitonyak_09_02() {\r\n }", "private TMCourse() {\n\t}", "protected MetadataUGWD() {/* intentionally empty block */}", "@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() {}", "public void mo4359a() {\n }", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override public int describeContents() { return 0; }", "@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\tpublic void jugar() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\r\n\tpublic void init() {}", "@Override\n\tprotected void initialize() {\n\n\t}", "Consumable() {\n\t}", "private MetallicityUtils() {\n\t\t\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n public void initialize() { \n }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void initialize() {\n \n }", "@Override\n protected void init() {\n }", "private void m50366E() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "protected boolean func_70814_o() { return true; }", "@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 int mettreAJour() {\n\t\treturn 0;\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 public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public String toString() {\n return \"\";\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\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "public void mo6081a() {\n }", "@Override\n\tpublic void create() {\n\t\t\n\t}", "@Override\n public int retroceder() {\n return 0;\n }" ]
[ "0.59652686", "0.57452154", "0.56249064", "0.55800456", "0.5527677", "0.5527677", "0.54960215", "0.54839814", "0.5480082", "0.54399407", "0.54006314", "0.538248", "0.53329676", "0.5332637", "0.5332637", "0.5332637", "0.5332637", "0.5332637", "0.5332637", "0.5326149", "0.5319702", "0.53077924", "0.5300406", "0.52952063", "0.52928483", "0.5291884", "0.52889407", "0.5280408", "0.5279997", "0.52719223", "0.5266127", "0.5262116", "0.5256049", "0.5251174", "0.52496487", "0.52476925", "0.5244611", "0.5234834", "0.5204882", "0.52046025", "0.5199165", "0.5195185", "0.5194933", "0.5194173", "0.51916873", "0.51888674", "0.51888674", "0.51886296", "0.51802737", "0.517355", "0.5170922", "0.51700217", "0.51700217", "0.51700217", "0.51700217", "0.51700217", "0.5169258", "0.5164714", "0.51456064", "0.51456064", "0.51456064", "0.5143608", "0.51408136", "0.51342446", "0.51302767", "0.51278836", "0.5119344", "0.51152074", "0.5109582", "0.5105812", "0.5105165", "0.5093956", "0.5092253", "0.5092253", "0.5092253", "0.5092253", "0.5092253", "0.5092253", "0.5092253", "0.50811243", "0.50811243", "0.50811243", "0.5070382", "0.5067207", "0.5067207", "0.5063796", "0.50606966", "0.50598294", "0.50598294", "0.5052249", "0.50499505", "0.5044916", "0.5043894", "0.5043894", "0.5043894", "0.5039788", "0.5029298", "0.5029298", "0.5028792", "0.5028424", "0.5023875" ]
0.0
-1
constructor it initialize the hash table
public QuantDataHashTable() { quantData = new Hashtable<String, Double>(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public HashTable()\n\t{\n\t\tthis(NUM_BUCKETS);\n\t}", "public HashTable() {\n\t\tthis(DEFAULT_TABLE_SIZE);\n\t}", "public void instantiateTable(){\n hashTable = new LLNodeHash[16];\n }", "public MyHashTable( )\r\n\t{\r\n\t\tthis(DEFAULTTABLESIZE);\r\n\t\t\r\n\t\t\t\r\n\t}", "public HashTable( )\n\t{\n\t\tthis ( DEFAULT_TABLE_SIZE );\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tpublic HashTable()\r\n\t{\r\n\t\ttable = new HashEntry[SIZES[sizeIdx]];\r\n\t}", "public HashTableChained() {\r\n num_buckets = 101; //prime number close to 100\r\n hash_table = new DList[num_buckets]; \r\n }", "HashTable() {\n int trueTableSize = nextPrime(tableSize);\n HT = new FlightDetails[nextPrime(trueTableSize)];\n }", "public MyHashTable( )\n {\n this( DEFAULT_TABLE_SIZE );\n }", "public BVHashtable()\n {\n super();\n }", "public HashTable()\n\t{\n\t\tthis(START_TABELLENGROESSE);\n\t}", "public HashTable(int size){\n\n arraySize = size;\n hashArray = new Elements[arraySize];\n nullement = new Elements(\" -1 \"); \n }", "QHT() {\r\n /*\r\n ***TO-DO***\r\n Default constructor\r\n should initialize the hash table with default capacity\r\n */\r\n initCap = 2;\r\n for (int i = 1; i < DEFAULT_EXP; i++) {\r\n initCap *= 2;\r\n }\r\n htable = new KVPair[initCap];\r\n }", "@SuppressWarnings(\"unchecked\")\r\n\tpublic HashTableMap() {\r\n\t\tK = new LinkedList[10];\r\n\t\tV = new LinkedList[10];\r\n\t}", "public MyHashTable() {\n\t\tthis(DefaultCapacity);\n\t}", "public HashTable(int s){\n\t\tthis.table = new Record[s];\n\t\tthis.contains = 0;\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tpublic HashMap()\r\n\t{\r\n\t\ttable = new MapEntry[7];\r\n\t\tcount = 0;\r\n\t\tmaxCount = table.length - table.length/3;\r\n\t\tDUMMY = new MapEntry<>(null, null);\r\n\t}", "public HashTable(int size) {\n\t\tarraySize = size;\n\t\thashArray = new DataItem[arraySize];\n\t\tnonItem = new DataItem(-1);\n\t}", "public ChainedHashTable()\n {\n this(DEFAULT_CAPACITY);\n }", "public MyHashMap() {\n\n }", "public HashTableChained() {\r\n tableSize = 101;\r\n table = new DList[tableSize];\r\n for (int i = 0; i < tableSize; i++) {\r\n table[i] = new DList<Entry<K, V>>();\r\n }\r\n size = 0;\r\n }", "public HashTableChained() {\n sizeBucket = 101;\n defTable = new DList[sizeBucket];\n for(int i=0; i<sizeBucket; i++) {\n defTable[i] = new DList();\n }\n size = 0;\n }", "public DesignHashmap() {\n\t\ttable = new boolean[buckets][];\n\t}", "public MyHashMap() {\n this.key_space = 2069;\n this.hash_table = new ArrayList<Bucket>();\n for (int i = 0; i < this.key_space; ++i) {\n this.hash_table.add(new Bucket());\n }\n }", "public HashTable(int size) {\n logicalSize = 0;\n defaultSize = size;\n table = new Handle[size];\n }", "public HashTableMap() {\r\n this.capacity = 10; // with default capacity = 10\r\n this.size = 0;\r\n this.array = new LinkedList[capacity];\r\n\r\n }", "public HashMap(){\n\t\tthis.numOfBins=10;\n\t\tthis.size=0;\n\t\tinitializeMap();\n\t}", "private void initialize() {\n first = null;\n last = null;\n size = 0;\n dictionary = new Hashtable();\n }", "public SimpleHashtable() {\r\n\t\tthis(DEFAULT_TABLE_SIZE);\r\n\t}", "public HashTableChained() {\n size = 0;\n buckets = new SList[107];\n largePrime = findPrime(10000);\n for (int i = 0; i < 107; i++) {\n buckets[i] = new SList();\n }\n }", "public MyHashMap() {\n\t\tthis(INIT_CAPACITY);\n\t}", "public HashArray(){\n this(10);\n }", "public BVHashtable(Hashtable hashtable)\n {\n super(hashtable);\n }", "public MyHashMap() {\r\n data = new Node[DEFAULT_CAPACITY];\r\n }", "public HashTable(int initSize, double loadFactor) \r\n {\r\n \tif(initSize <= 0)\r\n \t{\r\n \t\tthrow new IllegalArgumentException();\r\n \t}\r\n \tif(loadFactor <= 0.0)\r\n \t{\r\n \t\tthrow new IllegalArgumentException();\r\n \t}\r\n \t\r\n \tsize = initSize;\r\n \tthis.loadFactor = loadFactor;\r\n \thashTable = (LinkedList<T>[])(new LinkedList[size]);\r\n \tnumItems = 0;\r\n \t\r\n \t// Instantiate the LinkedList buckets\r\n \tfor(int i = 0; i < hashTable.length; i++)\r\n \t{\r\n \t\thashTable[i] = new LinkedList<T>();\r\n \t}\r\n }", "public HashGraph()\n {\n graph = new HashMap <>();\n }", "public OmaHashMap() {\n this.values = new OmaLista[32];\n this.numberOfValues = 0;\n }", "public ChainedHashDictionary() {\r\n this.capacity = 31;\r\n this.load = 0;\r\n this.chains = makeArrayOfChains(capacity);\r\n }", "public SymbolTable(){\r\n\t\tthis(INIT_CAPACITY);\r\n\t}", "public ProbingHashClass()\n {\n tableSize = DEFAULT_TABLE_SIZE;\n probeFlag = LINEAR_PROBING;\n tableArray = new StudentClass[tableSize];\n }", "public HashTable(int size) {\n \tnumElements = 0;\n Table = new ArrayList<>();\n for (int i = 0; i < size; i++) {\n \tTable.add(new List<>());\n } \n }", "public HashDictionary (int size) {\r\n\t\tthis.size = size;\r\n\t\ttable = new Node[size];\r\n\t\tfor (int i=0;i<size;i++) {\r\n\t\t\ttable[i]=null;\r\n\t\t}\r\n\t}", "private static java.util.Hashtable init() {\n Hashtable members = new Hashtable();\n members.put(\"fork\", FORK);\n members.put(\"lsf\", LSF);\n members.put(\"pbs\", PBS);\n members.put(\"condor\", CONDOR);\n members.put(\"sge\", SGE);\n members.put(\"ccs\", CCS);\n\n return members;\n }", "public ProductDaoHash() {\n\t\tproductTable = new HashMap<Integer, Product>();\n\t}", "public MyHashMap() {\n\n }", "public HashTable(int tableSize){\n this.tableSize = tableSize;\n }", "public MyHashMap() {\n map = new HashMap();\n }", "public HashTable(int buckets)\n\t{\n\t\tentries = new LinkedList[buckets];\n\t}", "public MyHashMap() {\n hashMap = new ArrayList<>();\n }", "public GiftHashTable() {\r\n GiftList = new HashTableMap<>(20);\r\n names = new LinkedList<>();\r\n totalCost = 0;\r\n totalGifts = 0;\r\n }", "public MyHashMap() {\r\n\t\tloadFactor = DEFAULT_LOAD_FACTOR;\r\n\t\tcapacity = DEFAULT_CAPACITY;\r\n\t\thashMapArray = new LinkedList[capacity];\r\n\t}", "@SuppressWarnings(\"unchecked\")\n public HashtableChain() {\n table = new LinkedList[CAPACITY];\n }", "public HashMultiSet() {\n\t\thMap = new HashMap<T, Integer>();\n\t\tsize = 0;\n\t}", "public ArrayHashMap() {\n super();\n }", "private void initialise() {\n \thashFamily = new Hash[this.r];\n for(int i= 0; i < this.r;i++)\n {\n \tthis.hashFamily[i] = new Hash(this.s * 2);\n }\n this.net = new OneSparseRec[this.r][this.s *2];\n for(int i = 0 ; i < this.r; i++)\n \tfor(int j =0 ; j< this.s * 2 ; j++)\n \t\tthis.net[i][j] = new OneSparseRec();\n \n }", "public HashMultiSet() {\r\n\t\tbaseMap = new HashMap<>();\r\n\t}", "public Q706DesignHashMap() {\n keys = new ArrayList<>();\n values = new ArrayList<>();\n\n }", "public MyHashTable( int tableSize )\r\n\t{\r\n\t\tthis.size = 0;\r\n\t\tthis.tableSize = nextPrime(tableSize);\r\n\t\ttable = new Object[this.tableSize];\r\n\t\tfor ( int i =0; i< this.tableSize; i++)\r\n\t\t{ this.table[i] = new LinkedArrays<T>(); }\r\n\t\r\n\t}", "public HashEntityMap()\n\t\t{\n\t\t\tmapNameToValue = new HashMap<String, Integer>();\n\t\t}", "public HashMap() {\n this.capacity = 100;\n this.hashMap = new LinkedList[capacity];\n }", "private static int initHash() {\n return 0x811c9DC5; // unsigned 2166136261\n }", "public static void main(String[] args) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tHashtable<Temp, String> h = new Hashtable<>();\r\n\t\th.put(new Temp(1), \"A\");\r\n\t\th.put(new Temp(25), \"B\");\r\n\t\th.put(new Temp(30), \"C\");\r\n\t\th.put(new Temp(10), \"D\");\r\n\t\tSystem.out.println(h);\r\n\t\t//{30=C, 10=D, 25=B, 1=A}---when hashcode returns i\r\n\t\t//{25=B, 30=C, 1=A, 10=D}---when hashcode returns i%9\r\n\t\t\r\n\t\t//constructor with initial capacity\r\n\t\t//here if hashcode exceeds 4 then, modules of 5 is done. \r\n\t\tHashtable<Temp1, String> h1 = new Hashtable<>(5);\r\n\t\th1.put(new Temp1(1), \"A\");\r\n\t\th1.put(new Temp1(25), \"B\");\r\n\t\th1.put(new Temp1(30), \"C\");\r\n\t\th1.put(new Temp1(10), \"D\");\r\n\t\tSystem.out.println(h1);\r\n\t\t//{25=B, 10=D, 1=A, 30=C}\r\n\t\t\r\n\t\t//constructor using initial capacity and fill ratio.\r\n\t\tHashtable<Temp1, String> h2 = new Hashtable<>(5,0.4f);\r\n\t\th2.put(new Temp1(1), \"A\");\r\n\t\th2.put(new Temp1(25), \"B\");\r\n\t\th2.put(new Temp1(30), \"C\");\r\n\t\th2.put(new Temp1(10), \"D\");\r\n\t\tSystem.out.println(h2);\r\n\t\t//{30=C, 1=A, 10=D, 25=B}\r\n\t\t//{25=B, 10=D, 1=A, 30=C}\r\n\t\t\r\n\t\t//constructor using Map\r\n\t\tHashtable<Temp1, String> h3 = new Hashtable<>(h2);\r\n\t\tSystem.out.println(h3);\r\n\t}", "private void createHashtable()\n {\n int numLanguages = languages.length;\n mapping = new Hashtable(numLanguages, 1.0f);\n for (int i = 0; i < numLanguages; i++)\n mapping.put(languages[i], values[i]);\n }", "public MyHashMap() {\n keys = new MapNode[n];\n vals = new MapNode[n];\n for (int i=0; i < n ; ++i) {\n keys[i] = new MapNode();\n vals[i] = new MapNode();\n }\n }", "public MyHashMap() {\n map = new ArrayList<>();\n for (int i = 0;i<255;i++)\n map.add(new Entry());\n }", "public MyHashMap() {\n arr = new int[100000];\n \n //To initialize the value with -1\n Arrays.fill(arr,-1);\n \n }", "@Before\n public void setUp() {\n hashTable = new HashTable();\n hashTable.put(\"Savon\", \"Yuliya\");\n hashTable.put(\"Blue\", \"lake\");\n hashTable.put(\"math\", \"camp\");\n }", "public HashTable(int tableSize) {\n\t\ttable = new ArrayList<>(tableSize);\n\t\tcapacity = tableSize;\n\t\tfor (int i = 0; i < tableSize; i++) {\n\t\t\ttable.add(new SequentialSearchSymbolTable<K, V>());\n\t\t}\n\t}", "public VehicleType(Hashtable hash) {\r\n super(hash);\r\n }", "public Hashtable<String,Stock> createMap(){\n\tHashtable table = new Hashtable<String, Stock>();\n\treturn table;\n}", "@SuppressWarnings(\"unchecked\")\r\n\tpublic HashMap() {\r\n\t\tdata = (Node<MapEntry<K, V>>[])new Node[INITIAL_SIZE];\r\n\t\tfor(int i = 0; i < data.length; i++)\t\t\t\t\t\t\t//For every element in data...\r\n\t\t\tdata[i] = new Node<MapEntry<K,V>>(new MapEntry<K,V>(null));\t//Add a head node to it.\r\n\t\t\r\n\t\t//TODO: May have to just default as null and in the put method, if the slot is null, then put a head node in it. The post-ceding code after that is logically correct!\r\n\t\r\n\t\tsize = 0;\t//Redundant but helpful to see that the size is 0\r\n\t}", "public RoutingTable() {\n for(int i = 0; i < addressLength; i++) {\n routingTable[i] = new HashTable();\n bloomFilters[i] = new BloomFilter(k, m);\n }\n }", "public HashTable( int size )\n\t{\n\t\ttheLists = new WordList[ size ];\n\t\tfor (int i = 0; i < theLists.length; i++)\n\t\t\ttheLists[i] = new WordList();\n\t}", "public SeparateChainingHashST() {\n this(INIT_CAPACITY);\n }", "public ObservableHashMap()\n {\n super();\n }", "MyHashMap(int initialCapacity) {\r\n data = new Node[initialCapacity];\r\n }", "public MyHashMap() {\n store = new int[1000001]; // Max number of key-value pairs allowed in the HashMap, cant exceed it.\n Arrays.fill(store, -1); // we have to anyways return -1 if key doesn't exists.\n }", "public HashTableMap(int capacity) {\r\n \r\n this.capacity = capacity; \r\n this.size = 0;\r\n \r\n this.array = new LinkedList[capacity];\r\n \r\n }", "@Override\n public void initialize(Object entity) {\n entity.hashCode();\n }", "public MyHashTableCC(){\n\t\tm_arraylists = new MyArraylist[DIFF_CHARACTERS];\n\n\t\tfor (int i = 0; i < m_arraylists.length; i++){\n\t\t\tm_arraylists[i] = new MyArraylist();\n\t\t}\n\t}", "public MyHashTable( int size )\n {\n allocateArray( size );\n doClear( );\n }", "private HashNode() {\r\n key = null;\r\n value = null;\r\n }", "public HashTable(int size) {\n\t\tallocateArray(size);\n\t\tclear();\n\t}", "public Dictionary () {\n list = new DoubleLinkedList<>();\n this.count = 0;\n }", "void initTable();", "public HashTag() {}", "public SymbolTable()\r\n {\r\n // Create the tables stack and add the top level\r\n tables = new ArrayDeque<HashMap<String,T>>();\r\n tables.add( new HashMap<String,T>() );\r\n \r\n // Ditto with the counts\r\n counts = new ArrayDeque<Integer>();\r\n counts.add( 0 );\r\n }", "public AbstractIntHashMap() {\n this(DEFAULT_CAPACITY, DEFAULT_LOADFACTOR);\n }", "private SequentialSearchSymbolTable() {\n\t\t\tkeySet = new ArrayList<>();\n\t\t\tvalueSet = new ArrayList<>();\n\t\t\tsize = 0;\n\t\t}", "public Ledger() {\n\tH = new TreeMap<String, Integer>();\n }", "private THashIterator() {\n\t\t\t_expectedSize = TOrderedHashMap.this.size();\n\t\t\t_index = -1;\n\t\t}", "public TreeDictionary() {\n\t\t\n\t}", "private void init() {\n\t\tmap = new LinkedHashMap<String, HeaderData>();\r\n\t\tList<HeaderData> list = config.getColumns();\r\n\t\tfor(HeaderData info: list){\r\n\t\t\tString id = info.getId();\r\n\t\t\tif(id == null) throw new IllegalArgumentException(\"Null id found for \"+info.getClass().getName());\r\n\t\t\t// Map the id to info\r\n\t\t\tmap.put(info.getId(), info);\r\n\t\t}\r\n\t}", "public MyHashMap() {\n array = new TreeNode[1024];\n\n }", "public FileInfo()\r\n {\r\n hash = new HashInfo();\r\n }", "public SegmentInformationTable()\n\t{\n\n\t}", "@Ponder2op(\"create\")\n\tpublic HashInspector() {\n\t\tinitialise(\"Hash Inspector\");\n\t}", "public CompactHashMap() {\n\t\tthis(INITIAL_SIZE);\n\t}", "public Basket(){\r\n\r\n basket = new Hashtable();\r\n keys = new Vector();\r\n }", "public _No_706_DesignHashMap() {\n// Arrays.fill(arr, -1);\n }" ]
[ "0.7947004", "0.7820937", "0.7800907", "0.7728568", "0.7646251", "0.7630314", "0.7599368", "0.75831616", "0.7481381", "0.73999274", "0.7398224", "0.73793745", "0.7362315", "0.73236567", "0.7313204", "0.7309408", "0.7229562", "0.71627617", "0.71486264", "0.71461886", "0.7122787", "0.7071782", "0.7070485", "0.7070333", "0.7065648", "0.7058105", "0.70390034", "0.70198816", "0.6997815", "0.6994783", "0.6985562", "0.6944657", "0.69291896", "0.6920906", "0.6889411", "0.6886808", "0.68754476", "0.68738174", "0.68737286", "0.68717235", "0.6870543", "0.6867174", "0.6861256", "0.68590677", "0.68451655", "0.68450975", "0.68051165", "0.6790839", "0.6789718", "0.6788838", "0.6785396", "0.6754937", "0.67440945", "0.67307395", "0.6684057", "0.6680652", "0.66498375", "0.6645663", "0.66397744", "0.6637282", "0.6631853", "0.6606612", "0.6600677", "0.6585332", "0.65773445", "0.6575426", "0.6572978", "0.6560739", "0.65545434", "0.6543241", "0.6540958", "0.64874464", "0.64826834", "0.6479231", "0.64685494", "0.6460119", "0.6458205", "0.64483917", "0.6444568", "0.6442608", "0.6437674", "0.643657", "0.64326763", "0.6425485", "0.6409493", "0.64020795", "0.6400982", "0.6399959", "0.6386637", "0.63716877", "0.6353245", "0.6350796", "0.6329698", "0.632938", "0.63197356", "0.6273451", "0.62705183", "0.62664676", "0.6265667", "0.62610054" ]
0.68519366
44
add an entry inside the hash table
public void addQuantData(String k, double value) { if (!quantData.containsKey(k)) { quantData.put(k, value); } else { System.out.println("value " + k + " already in memory"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override void addNewEntry(K key, V value, int hash, int index) {\n LinkedEntry<K, V> header = this.header;\n\n // Remove eldest entry if instructed to do so.\n LinkedEntry<K, V> eldest = header.nxt;\n if (eldest != header && removeEldestEntry(eldest)) {\n remove(eldest.key);\n }\n\n // Create new entry, link it on to list, and put it into table\n LinkedEntry<K, V> oldTail = header.prv;\n LinkedEntry<K, V> newTail = new LinkedEntry<K,V>(\n key, value, hash, table[index], header, oldTail);\n table[index] = oldTail.nxt = header.prv = newTail;\n }", "private void put(PrimitiveEntry entry) {\n int hashIndex = findHashIndex(entry.getKey());\n entries[hashIndex] = entry;\n }", "@Override\r\n\tpublic void add(CourseDBElement element) {\r\n\t\tint key = element.hashCode()%getTableSize();\r\n\t\t\r\n\t\tif(hashTable[key] == null) {\r\n\t\t\tLinkedList<CourseDBElement> newList = new LinkedList<CourseDBElement>();\r\n\t\t\tnewList.add(element);\r\n\t\t\thashTable[key] = newList;\r\n\t\t}\r\n\t\telse hashTable[key].add(element);\r\n\t}", "@Override\n synchronized public void addEntry(Entry e) throws RemoteException {\n if (this.map.containsKey(e.getHash())) {\n return;\n }\n //System.out.println(\"Mapper.addEntry() :: entry=\"+e.getHash()+\",\"+e.getLocation());\n this.map.put(e.getHash(), e.getLocation());\n printAct(\">added entry:\" + e.hash);\n }", "public boolean add(String key, String value){\r\n // takes a key and turns it into a hashed thing\r\n int arrIndex = hash(key);\r\n\r\n Entry entry = new Entry(key, value);\r\n\r\n if (hashTableArray[arrIndex] == null){\r\n hashTableArray[arrIndex] = new LinkedList<>();\r\n }\r\n if(contains(key)) {\r\n return false; // the key is already in use, so don't use it.\r\n } else {\r\n hashTableArray[arrIndex].add(entry); // add the key and value pair to the linked list.\r\n }\r\n return true;\r\n }", "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 add(String key,String value){\n int index=hash(key);\n if (arr[index] == null)\n {\n arr[index] = new Llist();\n }\n arr[index].add(key, value);\n\n\n }", "public Entry insert(Object key, Object value) {\r\n if (size / num_buckets > 0.75) { //table must be resized if load factor is too great\r\n this.resize();\r\n }\r\n Entry new_entry = new Entry();\r\n new_entry.key = key;\r\n new_entry.value = value;\r\n int comp_hash = compFunction(new_entry.key.hashCode()); //compresses key hash code\r\n if (hash_table[comp_hash] == null) { \r\n hash_table[comp_hash] = new DList();\r\n hash_table[comp_hash].insertFront(new_entry);\r\n } else {\r\n hash_table[comp_hash].insertFront(new_entry);\r\n }\r\n size++;\r\n return new_entry;\r\n }", "public void add(Object key, Object value){\n\t\tint bucketLoc = key.hashCode() % _numBuckets;\r\n\t\tif(_locate(key) == null){\r\n\t\t\tNode newNode = new Node(key,value,_buckets[bucketLoc]);\r\n\t\t\t_buckets[bucketLoc] = newNode;\r\n\t\t\t_count++;\r\n\t\t\t_loadFactor = (double) _count / (double) _numBuckets;\r\n\t\t\tif(_loadFactor > _maxLoadFactor){\r\n\t\t\t\t_increaseTableSize();\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t_buckets[bucketLoc]._value = value;\r\n\t\t}\r\n\t}", "public void add(E e){\n int target = e.hashCode() % this.buckets;\n if(!data[target].contains(e)){\n data[target].add(e);\n }\n }", "public void insertEntry(int entryIndex, E object, int hash) {\n this.entries[entryIndex] = (((long) hash) << 32) | NEXT_MASK;\n this.elements[entryIndex] = object;\n }", "void add(ThreadLocal<?> key, Object value) {\n for (int index = key.hash & mask;; index = next(index)) {\n Object k = table[index];\n if (k == null) {\n table[index] = key.reference;\n table[index + 1] = value;\n return;\n }\n }\n }", "@SuppressWarnings(\"unchecked\")\n public MapEntryImpl addEntry(MapEntryImpl newEntry, Object key, int hash) {\n int i = indexOfKey(key, hash);\n MapEntryImpl entry = entries[i];\n if (entry != null) return entry; // Entry exists\n entries[i] = newEntry;\n newEntry.key = key;\n newEntry.hash = hash;\n // Check if we need to resize.\n if ((++count << EMPTINESS_LEVEL) > entries.length) {\n resize(entries.length << 1);\n }\n return newEntry;\n }", "void addEntry(K key, V value);", "public void add(K key, V value) {\r\n if(this.table.containsKey(key)){\r\n BloomFilterUtil bf = (BloomFilterUtil)table.get(key).getHash();\r\n bf.put(value);\r\n Node<V> node = (Node<V>) table.get(key);\r\n node.getValues().add(value);\r\n }else {\r\n BloomFilterUtil bf = BloomFilterUtil.create(funnel,\r\n expectedInsertions,\r\n fpp,\r\n (BloomFilterUtil.Strategy) hashStrategy);\r\n bf.put(value);\r\n Node<V> node = new Node<V>(value, bf);\r\n table.put(key, node);\r\n }\r\n }", "public boolean add(E e) {\n if (contains(e)) {\n return false;\n }\n int i = hash(e);\n table[i] = new HashNode<E>(e, table[i]);\n size++;\n return true;\n }", "private HashEntry(K insertKey, V insertValue)\r\n\t\t{\r\n\t\t\tkey = insertKey;\r\n\t\t\tvalue.add(insertValue);\r\n\t\t}", "public void add(T item, int hashFunction) {\n int itemIndex = 0;\r\n boolean noDuplicates = true;\r\n //determines which hash function to call\r\n if (hashFunction == 1) {\r\n itemIndex = hash1(item);\r\n } else if (hashFunction == 2) {\r\n itemIndex = hash2(item);\r\n } else if (hashFunction == 3) {\r\n itemIndex = hash3(item);\r\n }\r\n\r\n //creating new node\r\n NGen newItem = new NGen(item, null);\r\n NGen currNode = newTable[itemIndex];\r\n\r\n if(newTable[itemIndex] != null) { //checks if index already has a key placed in it\r\n while (currNode.getNext() != null) {\r\n if (currNode.getData().equals(newItem.getData())) {\r\n noDuplicates = false;\r\n break;\r\n }\r\n currNode = currNode.getNext();\r\n }\r\n\r\n if (noDuplicates){ //only adds the item if there are no duplicates\r\n currNode.setNext(newItem);\r\n }\r\n } else { //creates node if there is not one existing\r\n newTable[itemIndex]= new NGen(item, null);\r\n }\r\n\r\n }", "public void insert(T t) { \n int bucket = hash(t);\n Table.get(bucket).addLast(t);\n numElements++;\n }", "void insert(EntryPair entry);", "public void insert(DataItem item){\n\t\tint key = item.getKey();\n\t\tint hashVal = hashFunc(key);\n\t\tint stepSize = hashFunc2(key); //get step size until empty cell or -1;\n\t\t\n\t\twhile(hashArray[hashVal] != null &&\n\t\t\t\thashArray[hashVal].getKey() != -1){\n\t\t\thashVal += stepSize; // go to the next cell\n\t\t\thashVal %= arraySize;\t\t\t\t\t//wrap around if necessary\n\t\t}\n\t\thashArray[hashVal] = item;\n\t}", "public boolean add(T newEntry);", "void add(String key);", "private void addTableEntry(TableEntry<K, V> entry, TableEntry<K, V>[] newTable) {\r\n\r\n\t\tint slotIndex = Math.abs(entry.key.hashCode()) % newTable.length;\r\n\r\n\t\tif (newTable[slotIndex] == null) {\r\n\t\t\tnewTable[slotIndex] = entry;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tTableEntry<K, V> currentElement = newTable[slotIndex];\r\n\r\n\t\twhile (currentElement.next != null) {\r\n\t\t\tcurrentElement = currentElement.next;\r\n\t\t}\r\n\r\n\t\tcurrentElement.next = entry;\r\n\t}", "public boolean add(int key) {\n Entry tab[] = table;\n int index = (key & 0x7FFFFFFF) % tab.length;\n for (Entry e = tab[index]; e != null; e = e.next) {\n if (e.key == key) {\n return false;\n }\n }\n\n if (count >= threshold) {\n // Rehash the table if the threshold is exceeded\n rehash();\n\n tab = table;\n index = (key & 0x7FFFFFFF) % tab.length;\n }\n\n // Creates the new entry.\n Entry e = new Entry(key, tab[index]);\n tab[index] = e;\n count++;\n return true;\n }", "private void addTableEntry(HashMap<Integer,Integer> map, int key){\n int count = map.containsKey(key) ? map.get(key) : 0;\n map.put(key, count + 1); //If wasn't present, this is set to 1, else its incremented\n\n return;\n }", "public boolean add( String key, T value )\r\n {\r\n HashMap<String,T> top = tables.peekFirst();\r\n T result = top.get( key );\r\n top.put( key, value );\r\n return result==null;\r\n }", "public void add(Key key, Value value) {\n\n\t\tif (2 * this.size > this.capacity) {\n\t\t\tresize(2 * this.capacity);\n\t\t}\n\n\t\t// Add this item to the hash table in the expected location.\n\n\t\tint index = locate(key);\n\t\tthis.keys[index] = key;\n\t\tthis.values[index] = value;\n\t\tthis.size++;\n\t}", "private void insertEntry() {\n String desiredId = idField.getText();\n String desiredName = nameField.getText();\n String desiredMajor = majorField.getText();\n\n if (studentHashMap.containsKey(desiredId)) {\n this.displayStatusPanel(\n \"Error: A student with this information already exists.\",\n \"Error\",\n JOptionPane.WARNING_MESSAGE\n );\n } else {\n studentHashMap.put(desiredId, new Student(desiredName, desiredMajor));\n\n this.displayStatusPanel(\n \"Success: \" + desiredName + \" has been added.\",\n \"Success\",\n JOptionPane.INFORMATION_MESSAGE\n );\n }\n }", "public void add2Hash( Hashtable h, String source ) {\n \n AstCursor c = new AstCursor();\n \n for ( c.FirstElement( this ); c.MoreElement(); c.NextElement() ) {\n Es es = ( Es ) c.node;\n es.add2Hash( h, source );\n }\n }", "private void insertItem(Hashtable<String, List<Integer>> h, Element e) {\n\t\tString key = e.attribute(\"sourcefilepath\").getValue().replace('/', '\\\\') + e.attribute(\"sourcefile\").getValue();\r\n\t\tint line = Integer.parseInt(e.attribute(\"line\").getValue().trim());\r\n\t\tList<Integer> l = h.get(key);\r\n\t\tif(l==null){\r\n\t\t\tl = new ArrayList<Integer>();\r\n\t\t\th.put(key, l);\r\n\t\t}\r\n\t\tl.add(line);\r\n\t}", "public void add(G item,String key){\n int chain=hashFunction(key);\r\n if (electionTable[chain] != null) {\r\n System.out.println(\"input repeated key!!!\");\r\n return;\r\n }\r\n ElectionNode x=new ElectionNode(item);\r\n System.out.println(\"-----------add-------------- \" + chain);\r\n x.next=electionTable[chain];\r\n electionTable[chain]=x;\r\n }", "void insert(){\n \tFIR fir = new FIR();\r\n \tfir_id++;\r\n \tfir = fir.accept(fir_id);\r\n \thashaddress = hash(fir.category);\r\n \tFIR ptr;\r\n\t if(hashtable[hashaddress]==null){\r\n\t hashtable[hashaddress]=fir;\r\n\t }\r\n\t else{\r\n\t ptr=hashtable[hashaddress];\r\n\t while(ptr.next!=null){\r\n\t ptr=ptr.next;\r\n\t }\r\n\t ptr.next=fir;\r\n\t }\r\n\t //Time Complexity: O(n)\r\n }", "public boolean add(K key, V val){\n\t\tint idx=getIndex(key);\n\t\tHashNode< K,V> head = myHashTable.get(idx);\n\t\twhile(head!=null){\n\t\t\tif(head.isKey(key)){\n\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\thead=head.next();\n\t\t}\n\t\tsize++;\n\t\thead=myHashTable.get(idx);\n\t\tHashNode<K,V> newNode = new HashNode<K,V>(key,val);\n\t\tnewNode.setNext(head);\n\t\tmyHashTable.set(idx, newNode);\n\t\t if ((1.0*size)/numOfBins >= 0.7)\n\t {\n\t ArrayList<HashNode<K, V>> temp = myHashTable;\n\t myHashTable = new ArrayList<>();\n\t numOfBins = 2 * numOfBins;\n\t size = 0;\n\t for (int i = 0; i < numOfBins; i++)\n\t \tmyHashTable.add(null);\n\t \n\t for (HashNode<K, V> headNode : temp)\n\t {\n\t while (headNode != null)\n\t {\n\t add(headNode.getKey(), headNode.getValue());\n\t headNode = headNode.next();\n\t }\n\t }\n\t }\n\t\treturn true;\n\t}", "private void addToHashmap(String key, Long timestamp){\r\n\t\tkeyHashMap.putIfAbsent(key, new PriorityQueue<Long>());\r\n\t\tsynchronized(keyHashMap.get(key)){\r\n\t\t\tSystem.out.println(\"Added Key: \" + key + \" Time: \" + timestamp);\r\n\t\t\tkeyHashMap.get(key).add(timestamp);\r\n\t\t}\r\n\t}", "public String addEntry(Entry e)\r\n\t{\r\n\t\tfor (Entry ent : tr)\r\n\t\t{\r\n\t\t\tif (e.getEntry().equals(ent.getEntry()))\r\n\t\t\t{\r\n\t\t\t\treturn \"Entry not unique. Try again.\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\ttr.add(e);\r\n\t\treturn \"Record added\\n\";\r\n\t}", "public void put(LLNodeHash word){\n int h = hash(word.getKey());\n if (hashTable[h] == null){\n hashTable[h] = new LLNodeHash(word.getKey(), word.getFreq(), null);\n }\n else{\n LLNodeHash ptr = hashTable[h];\n //while loop to traverse the linked list till the last node\n while (ptr.getNext() != null){\n ptr = ptr.getNext();\n }\n //sets the next node to the new inserted word\n ptr.setNext(new LLNodeHash(word.getKey(), 1, null));\n }\n //checks the load factor after each addition to the hashtable to see\n //if there is a need to rehash based on the load factor\n checkLoadFactor();\n }", "public void add(T newEntry) {\r\n add(size(), newEntry);\r\n }", "void addEntry(String key, Object value) {\n this.storageInputMap.put(key, value);\n }", "public boolean add (T item){\n\t\t\t\tint index = (item.hashCode() & Integer.MAX_VALUE) % table.length;\n\t\t\t\t\n\t\t\t\t// find the item and return false if item is in the AVLTree\n\t\t\t\tif (table[index].contains((T)item))\n\t\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t\tif (!table[index].add(item))\n\t\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t\t// we will add item, so increment modCount\n\t\t\t\tmodCount++;\n\n\t\t\t\thashTableSize++;\n\n\t\t\t\tif (hashTableSize >= tableThreshold)\n\t\t\t\t\trehash(2 * table.length + 1);\n\n\t\t\t\treturn true;\n\t}", "public void insert(SymbolTableEntry newEntry) {\n if (table.containsKey(newEntry.getName())) {\n table.remove(newEntry.getName());\n }\n table.put(newEntry.getName(), newEntry);\n }", "public HashEntry( AnyType e )\n {\n \tkey = e;\n }", "public void add(GameObject go) {\r\n table[go.hashCode() % table.length].add(go);\r\n }", "public Entry insert(Object key, Object value) {\n int hashCode = key.hashCode();\n int index = compFunction(hashCode);\n\n Entry entry = new Entry();\n entry.key = key;\n entry.value = value;\n\n defTable[index].insertFront(entry);\n size++;\n return entry;\n }", "public V add(K key, V value)\r\n\t{\r\n\t\tint slot = findSlot(key, false); // check if key already exists\r\n\t\tV oldVal = null;\r\n\t\t\r\n\t\tif (slot >= 0)\r\n\t\t{\r\n\t\t\tMapEntry<K, V> e = table[slot];\r\n\t\t\toldVal = e.setValue(value);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tslot = findSlot(key, true); // find empty slot for adding\r\n\t\t\ttable[slot] = new MapEntry<>(key, value);\r\n\t\t\tcount++;\r\n\t\t\tif (count >= maxCount)\r\n\t\t\t{\r\n\t\t\t\trehash();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn oldVal;\r\n\t}", "ValueType put(long key, ValueType entry);", "public void insert( int key, Integer data ){\n if (data == null) data = key;\n\n int index = computeHash(key);\n Node head = list[index];\n while( head != null ){ // Collision : key already in hashtable, put it in the linked list\n \n if(compare(head.key, key) == 0){ // Update : In case key is already present in list : exit\n head.data = data;\n return;\n }\n head = head.next; // put it at the end of the list\n }\n\n // No collision, new key; list.get(index) = null because that node at that index is not present\n list[index] = new Node(key, data, list[index]);\n }", "protected UUID add(E entry) {\n\t\treturn add(entry, true);\n\t}", "public void addEmployee(EmployeeInfo theEmployee) {\n int targetBucket = calcBucket(theEmployee.getEmployeeNum());\n buckets[targetBucket].add(theEmployee);\n numInTable++;\n }", "public boolean add(T entry) {\n return false;\n }", "static void insert(Item x) {\n int i = hash(x.sum);\n while (st[i] != null) {\n i++;\n if (i >= st.length) i -= st.length;\n }\n st[i] = x;\n }", "protected boolean add(TreeNode n) {\n name = n.getTitle();\n address = n.getAddress();\n\n //List of current values to the name key\n if (map.get(name) != null) {\n addresses = map.get(name);\n } else {\n addresses = new ArrayList<>();\n }\n\n //Then it'll have to check if that add entry already exits. Although it never should.\n //TODO THIS IS WHERE ITS SLOW\n// if (addresses.contains(name)) {\n// logger.debug(\"HashBrowns: addresses already contained: \" + name);\n// return false;\n// }\n\n //Then it adds this new address entry. Order of addresses doesn't matter for the time being.\n addresses.add(address);\n\n //Replace the old hash key (name) with the update list of addresses\n map.put(name, addresses);\n\n return true;\n }", "public void add(K key,V value) {\n DictionaryPair pair = new DictionaryPair(key,value);\n int index = findPosition(key);\n\n if (index!=DsConst.NOT_FOUND) {\n list.set(index,pair);\n } else {\n list.addLast(pair);\n this.count++;\n }\n }", "public void add(String word) {\n if (hashTable.contains(word)) {\n hashTable.put(word, hashTable.get(word) + 1);\n }\n else {\n hashTable.put(word,1);\n }\n }", "public void addEntry(Entry e) {\n entries.put(e.getName(), e);\n }", "@Test(timeout=1000)\n\tpublic void testAddElementTwice() {\n\t\texception.expect(RuntimeException.class);\n\t\texception.reportMissingExceptionWithMessage(\"Student 2 is already in the HashMap and a RuntimeException should be thrown\");\n\t\tStudent[] array = new Student[7];\n\t\tarray[5] = s2; // This is the correct hash position of this student\n\t\tarray[6] = s4;\n\t\tarray[0] = s5;\n\t\tarray[3] = s1;\n\t\tarray[4] = s3;\n\t\tarray[1] = s7;\n\t\thashmap.setArray(array);\n\t\thashmap.add(s2);\n\t}", "public void put(int key, int value) {\n int hashedKey = hash(key);\n Entry entry = map.get(hashedKey);\n if (entry.key == -1){\n // empty entry, insert entry\n entry.key = key;\n entry.value = value;\n }else if (entry.key == key){\n // target entry\n entry.value = value;\n }else{\n // in list, find target entry\n while(entry.key != key && entry.next!=null){\n entry = entry.next;\n }\n if (entry.key == key)\n entry.value = value;\n else\n entry.next = new Entry(key, value);\n }\n }", "public void add(T x) // O(n/M) nel caso medio e peggiore\n {\n // precondizioni\n if (x == null || contains(x)) \n return;\n \n // calcolo della chiave ridotta\n int kr = hash(x);\n \n // inserimento nel bucket di chiave ridotta calcolata\n ListNode n = (ListNode)v[kr]; // nodo header del bucket\n n.setElement(x); // inserimento nel nodo header\n v[kr] = new ListNode(null, n); // nuovo nodo header\n \n // incremento del numero di elementi\n size++; \n }", "void add(KeyType key, ValueType value);", "public void addKey(int par1, Object par2Obj)\n {\n this.keySet.add(Integer.valueOf(par1));\n int j = computeHash(par1);\n int k = getSlotIndex(j, this.slots.length);\n\n for (IntHashMapEntry inthashmapentry = this.slots[k]; inthashmapentry != null; inthashmapentry = inthashmapentry.nextEntry)\n {\n if (inthashmapentry.hashEntry == par1)\n {\n inthashmapentry.valueEntry = par2Obj;\n return;\n }\n }\n\n ++this.versionStamp;\n this.insert(j, par1, par2Obj, k);\n }", "@Override\r\n public boolean put(KeyType key, ValueType value) {\r\n // if the table's capacity is 0, expand the table first\r\n if (capacity == 0) {\r\n expand();\r\n }\r\n\r\n int index = hashFunction(key); // the index of the pair in the hashTable\r\n\r\n // If the linked list is null, initialize one. Otherwise, check whether the key has been exist\r\n if (hashTable[index] == null) {\r\n hashTable[index] = new LinkedList<>();\r\n } else {\r\n for (HashNode node : hashTable[index]) {\r\n if (node.key.equals(key)) {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n // Put the pair, and check whether expand() is needed\r\n hashTable[index].add(new HashNode(key, value));\r\n size++;\r\n if ((double) size / capacity >= 0.8) {\r\n expand();\r\n }\r\n return true;\r\n }", "public Entry<K, V> insert(K key, V value) {\r\n try {\r\n int hash = key.hashCode();\r\n Entry<K, V> entry = new Entry<K, V>();\r\n entry.key = key;\r\n entry.value = value;\r\n table[compFunction(hash)].insertFront(entry);\r\n return entry;\r\n } catch (Exception e) {\r\n System.out.println(\"Unhashable key: \" + e);\r\n return null;\r\n }\r\n }", "public void addToMap(){\n\t\tInteger hc = currentQuery.hashCode();\n\t\tif (!hmcache.containsKey(hc)) {\n\t\t\thmcache.put(hc, 0);\n\t\t}else{\n\t\t\tInteger val = hmcache.get(hc) + (currentQuery.getWords().size());\n\t\t\thmcache.put(hc, val);\n\t\t}\n\t}", "public void addEntry(Entry entry) {\n entries.add(entry);\n }", "public Entry insert(Object key, Object value) {\n resize();//only if it needs to.\n Entry e = new Entry();\n e.key = key;\n e.value = value;\n int i = compFunction(key.hashCode());\n buckets[i].insertFront(e);\n size++;\n return e;\n }", "public void addItem(Item item) {\n\t\thashOperations.put(KEY, item.getId(), item);\n\t\t//valueOperations.set(KEY + item.getId(), item);\n\t}", "public void insert(T item) \r\n {\r\n \t// This begins the process of resizing the hashTable\r\n \tif(((double)numItems) /((double) size) >= loadFactor)\r\n \t{\r\n \t\t\r\n \t\tint newSize = (size * 2) + 1; // The new size for the hashTable\r\n \t\t\r\n \t\tLinkedList<T>[] hashTable2 = (LinkedList<T>[])(new LinkedList[newSize]);;\r\n \t\t\r\n \t\t// Instantiate the LinkedList \"buckets\" in the hashTable\r\n \t\tfor(int i = 0; i < hashTable2.length; i++)\r\n \t\t{\r\n \t\t\thashTable2[i] = new LinkedList<T>();\r\n \t\t}\r\n \t\t\r\n \t\t// Begin the process of reentering the items with new hashcodes\r\n \t\tfor(int i = 0; i < size; i++)\r\n \t\t{\r\n \t\t\tif(!hashTable[i].isEmpty())\r\n \t\t\t{\r\n \t\t\t\tfor(int j = 0; j < hashTable[i].size(); j++)\r\n \t\t\t\t{\r\n \t\t\t\t\t\r\n \t\t\t\t\tint code2 = hashTable[i].get(j).hashCode(); // The new hashCode\r\n \t\t\t\t\t\r\n \t\t\t\t\t// If the new hashcode is negative\r\n \t\t\t\t\tif(code2 < 0)\r\n \t\t\t\t\t{\r\n \t\t\t\t\t\tcode2 = -code2;\r\n \t\t\t\t\t}\r\n \t\t\t\t\t\r\n \t\t\t\t\tcode2 = code2 % newSize;\r\n \t\t\t\t\thashTable2[code2].add(hashTable[i].get(j));\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\thashTable = hashTable2;\r\n \t\tsize = newSize;\r\n \t}\r\n \t\r\n \t// The hashcode for the new item to be added\r\n \tint code = item.hashCode();\r\n \t\r\n \t// If the hashcode is negative\r\n \tif(code < 0)\r\n \t{\r\n \t\tcode = -code;\r\n \t}\r\n \t\r\n\t\tcode = code % size;\r\n\t\thashTable[code].add(item);\r\n\t\tnumItems++;\r\n }", "@Test(timeout=1000)\n\tpublic void testSimpleAdd() {\n\t\thashmap.add(s1);\n\t\tStudent[] array = hashmap.getArray();\n\t\tboolean success = false;\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tStudent s = array[i];\n\t\t\tif (s1.equals(s)){\n\t\t\t\tsuccess = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tassertTrue(\"add() failed. Element not found in array\", success);\n\t}", "public void put(DNA key, long value) {\n total_in++;\n if(this.debug)\n System.out.println(\"ExtHash::put >> insertando cadena: \" + key.toString() + \", hashCode: \" + key.hashCode());\n\n Node actual_node = this.getReference(key);\n if(this.debug)\n System.out.println(\"ExtHash::put >> altura del nodo: \" + actual_node.getAltura());\n\n int reference_page = actual_node.getReference();\n ArrayList<Integer> content = this.fm.read(reference_page); this.in_counter++;\n\n int last_page = reference_page;\n ArrayList<Integer> last_content = content;\n\n int total_elements = 0, altura = actual_node.getAltura();\n while(true) {\n\n if(this.debug)\n System.out.println(\"ExtHash::put >> referencia a pagina: \" + reference_page);\n\n if(this.debug) {\n System.out.println(\"ExtHash::put >> contenido de la pagina:\");\n for(int i=0; i<content.size(); i++)\n System.out.println(\" \" + content.get(i));\n }\n\n total_elements += last_content.get(0);\n if(last_content.get(0) != B-2) {\n if(this.debug)\n System.out.println(\"ExtHash::put >> insertando en: \" + last_page);\n\n ArrayList<Integer> new_content = new ArrayList<>();\n\n new_content.add(last_content.get(0) + 1);\n for(int i=1; i<=last_content.get(0); i++)\n new_content.add(last_content.get(i));\n\n new_content.add(key.hashCode());\n\n if(new_content.get(0) == B-2) {\n total_active_block++;\n new_content.add(this.last);\n\n ArrayList<Integer> last = new ArrayList<>();\n last.add(0);\n this.fm.write(last, this.last); this.out_counter++;\n\n this.last++;\n\n }\n\n if(this.debug) {\n System.out.println(\"ExtHash::put >> contenido en pagina despues de insercion:\");\n for(int i=0; i<new_content.size(); i++)\n System.out.println(\" \" + new_content.get(i));\n }\n\n this.fm.write(new_content, reference_page); this.out_counter++;\n\n total_elements++; // por el elmento que se inserto.\n break;\n\n }\n if(this.debug)\n System.out.println(\"ExtHash::put >> acceciendo a siguiente pagina\");\n\n last_page = last_content.get(B-1);\n last_content = this.fm.read(last_page); this.in_counter++;\n }\n\n // se lleno la pagina y aun no se llega al final del hashing.\n if(total_elements >= B - 2 && altura < 30){\n if(this.debug)\n System.out.println(\"ExtHash::put >> limite de pagina, iniciando duplicacion\");\n\n this.duplicate(actual_node);\n }\n }", "public void add(FileSystemEntry entry);", "boolean add(Object key, Object value);", "public void insert(K key, E val) {\n MapEntry<K, E> newEntry = new MapEntry<K, E>(key, val);\n int b = hash(key);\n for (SLLNode<MapEntry<K,E>> curr = buckets[b]; curr != null; curr = curr.succ) {\n if (key.equals(((MapEntry<K, E>) curr.element).key)) {\n curr.element = newEntry;\n return;\n }\n }\n buckets[b] = new SLLNode<MapEntry<K,E>>(newEntry, buckets[b]);\n }", "public boolean add(T val) {\n Integer idx = hmap.get(val);\n if (idx == null) {\n int i = list.size();\n list.add(val);\n idx = new Integer(i);\n hmap.put(val, idx);\n return true;\n }\n return false;\n }", "public void add(int key) {\n int index = getIndex(key);\n if(buckets[index] == null){\n buckets[index] = new boolean[bucketItem];\n }\n int index2 = getIndex2(key);\n buckets[index][index2] = true;\n }", "public boolean insert(int val) {\n if(hm.containsKey(val)){\n return false;\n }\n else{\n sub.add(val);\n hm.put(val,sub.size()-1);\n return true;\n }\n\n\n\n }", "public boolean put( AnyType key , AnyType value)\n { \n int currentPos = findPos( key );\t//TODO: test this\n \n if( array[ currentPos ] == null )\n ++occupied;\n array[ currentPos ] = new HashEntry<>(key, value);\n \n theSize++;\n \n // Rehash\n if( occupied > array.length / 2 )\n rehash( );\n \n return true;\n }", "@Override\n\tpublic void addEntry(E entry) {\n\n\t\t// Determine if the entry already exists in the list\n\t\tE current = this.getHead();\n\t\twhile (current != null) {\n\t\t\tif (this.isEqual(current, entry)) {\n\t\t\t\t// Already in list\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcurrent = current.getNext();\n\t\t}\n\n\t\t// Not in list, so add the entry\n\t\tsuper.addEntry(entry);\n\t}", "public void add(G item, int key){ //it adds methods using the int key\r\n int chain=hashFunction(key);\r\n ElectionNode x=new ElectionNode(item);\r\n x.next=electionTable[chain];\r\n electionTable[chain]=x;\r\n }", "int insert(TDictAreas record);", "@Override\r\n\tpublic int insert(KfExaminememo record) {\n\t\treturn mapper.insert(record);\r\n\t}", "public void push(T newEntry);", "int insert(Lbt72TesuryoSumDPkey record);", "public void insert(KeyedItem newItem);", "void add(K key, V value);", "public void add(K key, E e){\n\t\tremove(key);\n\t\tnewestIndex = (newestIndex+1)%keys.length;\n\t\tif(keys[newestIndex] == null)\n\t\t\thowMany = howMany + 1;\n\t\tkeys[newestIndex] = key;\n\t\telem[newestIndex] = e;\n\t}", "private V put(K key, V value, Chain<K, V>[] table) {\r\n int index = key.hashCode() % table.length;\r\n if (index < 0)\r\n index += table.length;\r\n if (table[index]== null)\r\n {\r\n table[index] =new Chain<>(key,value) ;\r\n numKeys++;\r\n return null;\r\n }\r\n else if(table[index].data.equals(key))\r\n return table[index].data.setValue(value);\r\n else if (table[index].next==null)\r\n {\r\n table[index].next=new HashtableChain<>(prime);\r\n prime=previousPrime(prime-1);\r\n numKeys++;\r\n return table[index].next.put(key,value);\r\n }else\r\n return put(key,value,table[index].next.table);\r\n }", "@Override\n\tpublic void insert(String value) {\n\t\tif (value == null)\n\t\t\treturn;\n\t\tint hashVal = hashFunc(value);\n\t\tboolean collisionFlag = false;\n\t\twhile (hashArray[hashVal] != null\n\t\t\t\t&& !hashArray[hashVal].value.equals(deleted.value)) {\n\t\t\tif (hashArray[hashVal].value.equals(value)) {\n\t\t\t\thashArray[hashVal].addFrequency();\n\t\t\t\tif (collisionFlag)\n\t\t\t\t\tthis.collision--;\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!collisionFlag) {\n\t\t\t\tif (hashFunc(hashArray[hashVal].value) == hashFunc(value)) {\n\t\t\t\t\tthis.collision++;\n\t\t\t\t\tcollisionFlag = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\thashVal++;\n\t\t\thashVal = hashVal % size;\n\t\t}\n\t\tthis.numOfItems++;\n\t\thashArray[hashVal] = new DataItem(value);\n\n\t\tdouble loadFactor = (double) this.numOfItems / (double) this.size;\n\t\tif (loadFactor >= LoadFactor)\n\t\t\trehash();\n\n\t}", "@Override\n public void insert(Node item) {\n int hash = getHash(item.getState().getName());\n Node temp = hashTable[hash];\n\n if (isEmpty(hash)) { // Check to see if the hashed index of the array is empty\n hashTable[hash] = item;\n } else if (item.getState().getName().compareTo(temp.getState().getName()) < 0) { // Should the value be inserted at the front\n item.setNext(temp);\n hashTable[hash] = item;\n } else {\n temp = findNode(hashTable[hash], item.getState().getName());\n item.setNext(temp.getNext());\n temp.setNext(item);\n }\n }", "public void add(int number) {\n if (hash.containsKey(number)) {\n hash.put(number, 2);\n } else {\n hash.put(number, 1);\n }\n }", "public void addRow(String tableName, String key, String columnFam, String columnName, String val)\r\n\t\t\tthrows IOException {\n\t\tHTableInterface table = con.getTable(tableName);\r\n\t\tPut row = new Put(Bytes.toBytes(key));\r\n\t\trow.add(Bytes.toBytes(columnFam.replaceAll(\"[^A-Za-z0-9 ]\", \"\")),\r\n\t\t\t\tBytes.toBytes(columnName.replaceAll(\"[^A-Za-z0-9 ]\", \"\")), Bytes.toBytes(val));\r\n\t\ttable.put(row);\r\n\r\n\t\t// store full predicate URI\r\n\t\tString pred;\r\n\t\tif (columnFam.compareTo(\"literal\") != 0) {\r\n\t\t\tpred = columnFam;\r\n\t\t} else {\r\n\t\t\tpred = columnName;\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"PRED ENTRY: \" + pred + \" \" + pred.replaceAll(\"[^A-Za-z0-9 ]\", \"\"));\r\n\t\ttable = con.getTable(\"predicates\");\r\n\t\trow = new Put(Bytes.toBytes(pred.replaceAll(\"[^A-Za-z0-9 ]\", \"\")));\r\n\t\trow.add(Bytes.toBytes(\"URI\"), Bytes.toBytes(\"\"), Bytes.toBytes(pred));\r\n\t\ttable.put(row);\r\n\t}", "Object insert(String key, Object param);", "private void insert(ByteBuffer rowKey,\n Clustering<?> clustering,\n Cell<?> cell,\n LivenessInfo info,\n WriteContext ctx)\n {\n DecoratedKey valueKey = getIndexKeyFor(getIndexedValue(rowKey,\n clustering,\n cell));\n Row row = BTreeRow.noCellLiveRow(buildIndexClustering(rowKey, clustering, cell), info);\n PartitionUpdate upd = partitionUpdate(valueKey, row);\n indexCfs.getWriteHandler().write(upd, ctx, false);\n logger.debug(\"Inserted entry into index for value {}\", valueKey);\n }", "protected void addEntry(CacheEntry entry) {\n if (_first == null) {\n _first = entry;\n _last = entry;\n } else {\n _last.setNext(entry);\n entry.setPrevious(_last);\n _last = entry;\n }\n }", "public void add(long key, C value) {\n if(Long.toString(key).length() != 8) {\n \t//System.out.println(\"Sequence Error: Length is not 8.\\n\");\n return;\n }\n\n //clear the old key\n try {\n this.remove(key); \n } catch(Exception e) {\n sequence.add(new Entry<C>(key, value));\n size++;\n return;\n }\n //System.out.println(\"Found duplicate for key \" + key + \".\\n\"); \n sequence.add(new Entry<C>(key, value));\n size++;\n }", "public static void main(String[] args) {\n Hash myHashTable = new Hash(7);\n for(int i = 0; i<15; i++){\n int a=(int)(Math.random()*100);\n System.out.print( a+\" \");\n myHashTable.insert(a);\n \n }\n myHashTable.print();\n }", "public void add(byte[] hash) {\n byte[] firstHash = new byte[4];\n added++;\n for (int i = 0; i < 3; i++) {\n System.arraycopy(hash, i * 4, firstHash, 0, 4);\n setBit(firstHash);\n }\n }", "public void put(K key, V value) {\n int counter = 0;\n for (Table.Entry e : entries) {\n if (e.getKey().equals(key)) {\n entries.set(counter, new Table.Entry<>(key, value));\n return;\n }\n }\n entries.add(new Table.Entry<>(key, value));\n }", "public V put(K key,V value) {\n\tif(key==null||value==null) {\n\t throw new NullPointerException();\n\t}\n\telse {\n\tMyEntry addvalue=new MyEntry();\n\taddvalue.key=key;\n\taddvalue.value=value;\n\t\n\tint bucket=Math.abs(key.hashCode()%capacity);\n\t\n\t\n\t//what happens if the same key already exists\n\tfor(MyEntry i:table[bucket]) { \n\t if(i.key==key) {\n\t\tV previousvalue=i.value;\n\t\ttable[bucket].add(addvalue);\n\t\tsize++;\n\t\tif(((float)size/(float)capacity)>loadFactor) {\n\t\t resize();\n\t\t}\n\t\treturn previousvalue;\n\t }\n\t}\n\t\n\t//what happens if the key does not exist\n\ttable[bucket].add(addvalue);\n\tsize++;\n\tif(((float)size/(float)capacity)>loadFactor) {\n\t resize();\n\t}\n\treturn null;\n\t}\n }", "public void insert(Key key, Value value) {\r\n root.insert(key,value);\r\n size++;\r\n }", "public boolean add(int paramInt)\n/* */ {\n/* 179 */ ensureCapacity(this.m_entryCount + 1);\n/* 180 */ int i = -internalFind(paramInt) - 1;\n/* 181 */ if (i >= 0) {\n/* 182 */ this.m_entryCount += 1;\n/* 183 */ this.m_flagTable[i] = true;\n/* 184 */ this.m_keyTable[i] = paramInt;\n/* 185 */ return true;\n/* */ }\n/* 187 */ return false;\n/* */ }", "public void addEntry(Entry entry) {\n getEntryList().addEntry(entry);\n }" ]
[ "0.7422924", "0.733151", "0.7111498", "0.70708174", "0.70301914", "0.6956844", "0.6949403", "0.6945106", "0.6853781", "0.6841915", "0.68151194", "0.6810219", "0.6809436", "0.68039465", "0.6788615", "0.6784541", "0.67597544", "0.67551905", "0.6748409", "0.6642826", "0.66270393", "0.65755534", "0.6538252", "0.65302265", "0.6512972", "0.64998007", "0.64988095", "0.6477147", "0.6471593", "0.64701104", "0.6461532", "0.6435119", "0.6434789", "0.643095", "0.63664633", "0.6364987", "0.63567746", "0.63533634", "0.63454", "0.6328133", "0.6312894", "0.6308981", "0.62969834", "0.6287729", "0.6278518", "0.6269751", "0.624979", "0.6247919", "0.6241035", "0.6235242", "0.62300843", "0.62209195", "0.6219845", "0.6213203", "0.62063587", "0.620594", "0.6204012", "0.61963546", "0.6194802", "0.61919856", "0.6176594", "0.6171468", "0.61702067", "0.615854", "0.6158418", "0.6156599", "0.61505014", "0.6143884", "0.61398304", "0.6112644", "0.61078715", "0.60857", "0.6083417", "0.60744745", "0.606442", "0.60643196", "0.6057336", "0.605656", "0.6050493", "0.60443175", "0.6041849", "0.6040287", "0.6038191", "0.60361946", "0.60329425", "0.60263604", "0.601633", "0.60129005", "0.6009711", "0.60067886", "0.6002545", "0.5982588", "0.5981277", "0.59808856", "0.5979265", "0.5965363", "0.5956749", "0.5955846", "0.59552985", "0.5951676", "0.59471023" ]
0.0
-1
return the input quant value for the specified key
public double getInput(String k) { double value=0; if (quantData.containsKey(k)) { value = quantData.get(k); } else { System.out.println("Key not found"); value = 0.0; } return value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double getExp(String k) {\n\t\t\n\t\tdouble value=0;\n\t\t\n\t\tif (quantData.containsKey(k)) {\n\t\t\tvalue = quantData.get(k);\n\t\t} else {\n\t\t\tSystem.out.println(\"Key not found\");\n\t\t\tvalue = 0.0;\n\t\t}\n\t\t\n\t\treturn value;\n\t\t\t\n\t}", "public double getControl(String k) {\n\t\t\n\t\tdouble value=0;\n\t\t\n\t\tif (quantData.containsKey(k)) {\n\t\t\tvalue = quantData.get(k);\n\t\t} else {\n\t\t\tSystem.out.println(\"Key not found\");\n\t\t\tvalue = 0.0;\n\t\t}\n\t\t\n\t\treturn value;\n\t\t\t\n\t}", "org.hl7.fhir.Quantity getValueQuantity();", "public CompoundValue getValue(Object key);", "Quantity getComparisonValue();", "public QxType getValue( final String key ) {\n return getValue( key, null );\n }", "String getValue(String type, String key);", "public abstract <T> MarketDataBox<T> getValue(MarketDataKey<T> key);", "public V getValue(K key);", "public V getValue(K key);", "public float getFloat(String key)\n {\n return getFloat(key, 0);\n }", "public V getCarta(K key);", "Quantity getQuantity();", "BigDecimal getQuantity();", "int getQuantite();", "int getQuantite();", "<T> T getValue(DataKey<T> key);", "private int calculateInputStock_Items() {\n\t\tint total = 0;\n\t\tArrayList<Integer> stock = getAllStockValues();\n\t\tif (!stock.isEmpty()) {\n\t\t\t// get for all K\n\t\t\ttotal += (stock.get(0) * getSetUpMachine().getVending_item().get(\"K\"));\n\t\t\t// get for all S\n\t\t\ttotal += (stock.get(1) * getSetUpMachine().getVending_item().get(\"S\"));\n\t\t\t// get for all F\n\t\t\ttotal += (stock.get(2) * getSetUpMachine().getVending_item().get(\"F\"));\n\t\t\t// get for all N\n\t\t\ttotal += (stock.get(3) * getSetUpMachine().getVending_item().get(\"N\"));\n\t\t}\n\t\treturn total;\n\t}", "public Integer getQuantity();", "Money getItemValue();", "private BigDecimal getQty(Map<Integer, BigDecimal[]> planQtyMap, int qtyType, Integer mapKey) {\n\n BigDecimal ret = null;\n BigDecimal[] qtyArray = planQtyMap.get(mapKey);\n if (qtyArray != null) {\n ret = qtyArray[qtyType];\n }\n if (ret == null && QTY_TYPE_PLAN == qtyType) {\n ret = BigDecimal.ZERO;\n }\n\n return ret;\n }", "public int getKeyBuyItem() {\r\n return getKeyShoot();\r\n }", "int getBuyQuantity();", "public String getValue() {\r\n\t\tAllowedKey tp = this.getAllowedKey();\r\n\t\tKeyMask km = this.getKeyMask();\r\n\r\n\t\tif (tp == TextFieldExt.AllowedKey.AK_SOLO_NUMEROS) {\r\n\t\t\tif (km == TextFieldExt.KeyMask.KM_Moneda)\r\n\t\t\t\treturn StringTools.parseFromQuantityToNumber(this.getText().trim());\r\n\t\t\telse {\r\n\t\t\t\tif (km == TextFieldExt.KeyMask.KM_Numero)\r\n\t\t\t\t\treturn StringTools.parseFromQuantityToNumber(this.getText().trim());\r\n\t\t\t\telse\r\n\t\t\t\t\treturn this.getText().trim();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (tp == TextFieldExt.AllowedKey.AK_NUMEROS_CON_FRACCION) {\r\n\t\t\t\tif (km == TextFieldExt.KeyMask.KM_Moneda)\r\n\t\t\t\t\treturn StringTools.parseFromQuantityToNumber(this.getText().trim());\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (km == TextFieldExt.KeyMask.KM_Numero)\r\n\t\t\t\t\t\treturn StringTools.parseFromQuantityToNumber(this.getText().trim());\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\treturn this.getText().trim();\r\n\t\t\t\t}\r\n\t\t\t} else\r\n\t\t\t\treturn this.getText().trim();\r\n\t\t}\r\n\t}", "long getQuantite();", "public double getVariableValue(){\n\t\tObject valueKey = getEntries().keySet().stream().findFirst().orElseGet(()->{return 0d;});\n\t\tif (valueKey instanceof Double){\n\t\t\treturn (Double) valueKey;\n\t\t}\n\t\ttry {\n\t\t\tdouble value = Double.parseDouble(valueKey+\"\");\n\t\t\treturn value;\n\t\t}\n\t\tcatch (NumberFormatException ex){\n\t\t\treturn 0d;\n\t\t}\n\t}", "MeasureType getQuantity();", "private int getValue(final String name, final String key) {\n\t\treturn Integer.parseInt(bundleConstants.getString(name + SEPERATOR + key));\n\t}", "public Float F(String key) throws AgentBuilderRuntimeException {\n\t\treturn getFloat(key);\n\t}", "int getQuantity();", "int getSellQuantity();", "public float getMandatoryFloat(String key) throws ConfigNotFoundException;", "long getQuantity();", "long getQuantity();", "public float f(String key) throws AgentBuilderRuntimeException {\n\t\treturn getFloat(key).floatValue();\n\t}", "double getDouble(String key) throws KeyValueStoreException;", "public BigDecimal getProductQty() \n{\nBigDecimal bd = (BigDecimal)get_Value(\"ProductQty\");\nif (bd == null) return Env.ZERO;\nreturn bd;\n}", "public Value get(Key key);", "private String getQuantityFromWeighScale() {\r\n // Read data from weigh scale through serial port\r\n\r\n // Convert data to string and return the value to calling function\r\n\r\n return \"1\";\r\n }", "@Override\n\tpublic int getQuantidade() {\n\t\treturn hamburguer.getQuantidade();\n\t}", "public static double getDouble(Key key) {\n return getDouble(key, 0);\n }", "public int get(String key) {\n\n // Hold the tmpNode node\n FreqNode tmpNode;\n\n //calculate the index by hashcode mod table length \n int index = Math.abs(key.hashCode()) % (frequencyTable.length);\n\n //if mapped location is empty\n if (frequencyTable[index] == null) {\n return 0; //does not effect the cosine similarity \n } else {\n //value is at the tmpNode \n tmpNode = frequencyTable[index];\n //for each value in table \n while (true) {\n //if tmpNode is null \n if (tmpNode == null) {\n return 0;\n } //else if the key is equal to this nodes key \n else if (key.equals(tmpNode.getKey())) {\n //return the value of this key \n return tmpNode.getValue();\n } else {\n //grab the next element as a last resort \n tmpNode = tmpNode.getNext();\n }//end else \n }//end else if \n }//end else\n }", "public Value get(Key key) ;", "public int getQuantite() {\r\n return quantite;\r\n }", "public double getDouble(String key)\n {\n return getDouble(key, 0);\n }", "public Float getFloatData(String key) {\n return pref.getFloat(key, 0);\n }", "public int getQuantity();", "public BigDecimal getConvertedProductQty() \n{\nBigDecimal bd = (BigDecimal)get_Value(\"ConvertedProductQty\");\nif (bd == null) return Env.ZERO;\nreturn bd;\n}", "int getInt(String key);", "protected int queryPrice(int id, String key) {\n Trace.info(\"RM::queryCarsPrice(\" + id + \", \" + key + \") called\" );\n ReservableItem curObj = (ReservableItem) readData( id, key);\n int value = 0; \n if ( curObj != null ) {\n value = curObj.getPrice();\n } // else\n Trace.info(\"RM::queryCarsPrice(\" + id + \", \" + key + \") returns cost=$\" + value );\n return value; \n }", "double getStockValue(String date) throws IllegalArgumentException;", "public BigDecimal getShrinkQty() \n{\nBigDecimal bd = (BigDecimal)get_Value(\"ShrinkQty\");\nif (bd == null) return Env.ZERO;\nreturn bd;\n}", "float getValue();", "float getValue();", "float getValue();", "public double getKey() {\n\t\treturn key;\n\t}", "private Double conversionElectric(Double quant) {\n return quant;\n }", "public BigDecimal getConvertedShrinkQty() \n{\nBigDecimal bd = (BigDecimal)get_Value(\"ConvertedShrinkQty\");\nif (bd == null) return Env.ZERO;\nreturn bd;\n}", "public int getQuantidade();", "public int calculateUnits(Object oKey, Object oValue);", "private DataValue getValueForKey(String key) {\n DataValue value = valueMap.get(key);\n if (value == null) {\n return DataValue.NO_VALUE;\n } else {\n return value;\n }\n }", "public int get(int key) {\n return 1;\n }", "public V getValue(K key)\n {\n V result = null;\n int keyIndex = locateIndex(key);\n if ((keyIndex < numberOfEntries) && \n key.equals(dictionary[keyIndex].getKey()))\n result = dictionary[keyIndex].getValue();\n return result;\n }", "public int getKeySellItem() {\r\n return getKeyShoot();\r\n }", "V getValue(final E key) {\r\n for (int i=0;i<kcount;i++) {\r\n if (equal(key, (E)k[i])) return (V)v[i];\r\n }\r\n return null;\r\n }", "public int get(int key) {\n return data[key % KEY];\n }", "public Number getValue(Comparable rowKey, Comparable columnKey) {\n/* 260 */ int r = getRowIndex(rowKey);\n/* 261 */ int c = getColumnIndex(columnKey);\n/* 262 */ if (c != -1) {\n/* 263 */ return this.underlying.getValue(r, c + this.firstCategoryIndex);\n/* */ }\n/* */ \n/* 266 */ throw new UnknownKeyException(\"Unknown columnKey: \" + columnKey);\n/* */ }", "String getValue(Key key) {\n return this.parameters.get(key);\n }", "public java.math.BigDecimal getQty() throws java.rmi.RemoteException;", "public double getTotalValue(){\r\n return this.quantity * this.price;\r\n }", "public int get(int key) {\n return store[key]; // get the value for the key\n }", "BigDecimal getValue();", "double getValue();", "double getValue();", "double getValue();", "public abstract int getAmount(Fluid fluid);", "public Float getFloat(String key) throws AgentBuilderRuntimeException {\n\t\tif (!extContainsKey(key))\n\t\t\tthrow new AgentBuilderRuntimeException(\n\t\t\t\t\t\"Dictionary does not contain key \\\"\" + key + \"\\\"\");\n\t\treturn (Float) extGet(key);\n\t}", "public int get(int symbol);", "public int get(int key) {\n if(arr[key] == -1)\n return 0;\n else if(arr[key] == 0)\n return -1;\n else return arr[key];\n }", "public int q(int t) {\n return map.get(map.floorKey(t));\n }", "public double getPrice(String isInStock){\n Scanner scn = new Scanner(System.in);\n if(isInStock.equalsIgnoreCase(\"Available\")) {\n System.out.println(\"Enter quantity: \");\n int quantity = scn.nextInt();\n price *= quantity;\n }\n else{\n System.out.println(\"Currently \"+isInStock);\n }\n return price;\n }", "public float getQuantity() {\n return quantity;\n }", "public Float getQuantity() {\n return quantity;\n }", "BigDecimal getOriginalQuantity();", "@Override\n public UInt256 getPriorStorageValue(final Address address, final UInt256 key) {\n return getStorageValue(address, key);\n }", "Optional<ValueType> getSingle(KeyType key);", "String get(Integer key);", "TickerPrice getPrice(String symbol);", "public int getkValue() {\n return kValue;\n }", "public Value get(final Key key) {\n int r = rank(key);\n if (r < size && (keys[r].compareTo(key) == 0)) {\n return values[r];\n }\n return null;\n }", "public String getParameterValue(int key){\n return parameters.get(key).value;\n }", "public float getFloat(String key, float defaultValue);", "public V get(K key) throws InvalidKeyException;", "BigDecimal getDisplayQuantity();", "public float getFloat(short dictionaryKey) {\n\t\treturn floatsMap.get(dictionaryKey);\n\t}", "public abstract float getValue();", "public double getTotalCartValue();", "BigDecimal getTermValue();", "public abstract V get(K key);", "public BigDecimal getSplitQty() \n{\nBigDecimal bd = (BigDecimal)get_Value(\"SplitQty\");\nif (bd == null) return Env.ZERO;\nreturn bd;\n}" ]
[ "0.70461345", "0.70003736", "0.6575812", "0.6162555", "0.6123325", "0.6063843", "0.6050749", "0.6021153", "0.6009052", "0.6009052", "0.6001432", "0.5980048", "0.5929527", "0.59249026", "0.5912836", "0.5912836", "0.5903691", "0.58543044", "0.58340627", "0.5799121", "0.5791833", "0.5783634", "0.57731444", "0.57559043", "0.573516", "0.5694079", "0.56627405", "0.5647948", "0.564279", "0.560973", "0.56095964", "0.5607595", "0.56005526", "0.56005526", "0.55885375", "0.55830514", "0.55689895", "0.55639094", "0.5561311", "0.5537733", "0.5534852", "0.5534623", "0.55341953", "0.5533426", "0.5525185", "0.55175096", "0.55014366", "0.5500865", "0.54840225", "0.5471215", "0.54690015", "0.5463651", "0.5461335", "0.5461335", "0.5461335", "0.54591227", "0.54353726", "0.54351497", "0.54305536", "0.54244417", "0.54240286", "0.5417144", "0.5409743", "0.5399693", "0.53864574", "0.537934", "0.53722036", "0.5369001", "0.5367295", "0.53594255", "0.53539145", "0.53517824", "0.5349764", "0.5349764", "0.5349764", "0.534606", "0.53389215", "0.53240645", "0.5318481", "0.5297864", "0.5296734", "0.5294671", "0.529392", "0.5291705", "0.528509", "0.52765626", "0.5274604", "0.5272777", "0.52713495", "0.52704966", "0.52699876", "0.52672195", "0.5265054", "0.526323", "0.5258628", "0.52487737", "0.52462626", "0.52432925", "0.5238162", "0.5231605" ]
0.7768951
0
return the control quant value for the specified key
public double getControl(String k) { double value=0; if (quantData.containsKey(k)) { value = quantData.get(k); } else { System.out.println("Key not found"); value = 0.0; } return value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double getKControl(int index) {\n return this.kControl[index];\n }", "public double getInput(String k) {\n\t\t\n\t\tdouble value=0;\n\t\t\n\t\tif (quantData.containsKey(k)) {\n\t\t\tvalue = quantData.get(k);\n\t\t} else {\n\t\t\tSystem.out.println(\"Key not found\");\n\t\t\tvalue = 0.0;\n\t\t}\n\t\t\n\t\treturn value;\n\t\t\t\n\t}", "public double getExp(String k) {\n\t\t\n\t\tdouble value=0;\n\t\t\n\t\tif (quantData.containsKey(k)) {\n\t\t\tvalue = quantData.get(k);\n\t\t} else {\n\t\t\tSystem.out.println(\"Key not found\");\n\t\t\tvalue = 0.0;\n\t\t}\n\t\t\n\t\treturn value;\n\t\t\t\n\t}", "public String getValue() {\r\n\t\tAllowedKey tp = this.getAllowedKey();\r\n\t\tKeyMask km = this.getKeyMask();\r\n\r\n\t\tif (tp == TextFieldExt.AllowedKey.AK_SOLO_NUMEROS) {\r\n\t\t\tif (km == TextFieldExt.KeyMask.KM_Moneda)\r\n\t\t\t\treturn StringTools.parseFromQuantityToNumber(this.getText().trim());\r\n\t\t\telse {\r\n\t\t\t\tif (km == TextFieldExt.KeyMask.KM_Numero)\r\n\t\t\t\t\treturn StringTools.parseFromQuantityToNumber(this.getText().trim());\r\n\t\t\t\telse\r\n\t\t\t\t\treturn this.getText().trim();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (tp == TextFieldExt.AllowedKey.AK_NUMEROS_CON_FRACCION) {\r\n\t\t\t\tif (km == TextFieldExt.KeyMask.KM_Moneda)\r\n\t\t\t\t\treturn StringTools.parseFromQuantityToNumber(this.getText().trim());\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (km == TextFieldExt.KeyMask.KM_Numero)\r\n\t\t\t\t\t\treturn StringTools.parseFromQuantityToNumber(this.getText().trim());\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\treturn this.getText().trim();\r\n\t\t\t\t}\r\n\t\t\t} else\r\n\t\t\t\treturn this.getText().trim();\r\n\t\t}\r\n\t}", "public CompoundValue getValue(Object key);", "public V getCarta(K key);", "public int getkValue() {\n return kValue;\n }", "org.hl7.fhir.Quantity getValueQuantity();", "Quantity getComparisonValue();", "public double[] getKControl() {\n return kControl;\n }", "public HTMLInputElement getElementValorKey() { return this.$element_ValorKey; }", "public Value getSucc(Key key) {\r\n return root.getSucc(key);\r\n }", "public V getValue(K key);", "public V getValue(K key);", "public QxType getValue( final String key ) {\n return getValue( key, null );\n }", "BigDecimal getDisplayQuantity();", "public int getControlValue() {\n\t\treturn d_controlValue;\n\t}", "Quantity getQuantity();", "public abstract <T> MarketDataBox<T> getValue(MarketDataKey<T> key);", "BigDecimal getQuantity();", "public String getParameterValue(int key){\n return parameters.get(key).value;\n }", "public double getKey() {\n\t\treturn key;\n\t}", "private int getValue(final String name, final String key) {\n\t\treturn Integer.parseInt(bundleConstants.getString(name + SEPERATOR + key));\n\t}", "public Integer getQuantity();", "String getValue(Key key) {\n return this.parameters.get(key);\n }", "public int get(int key) {\n return 1;\n }", "MeasureType getQuantity();", "String getValue(String type, String key);", "public int getKeyAmount() {\n return keyAmount;\n }", "public int getKeyBuyMenu() {\r\n return Input.Keys.valueOf(getKeyBuyMenuName());\r\n }", "<T> T getValue(DataKey<T> key);", "@Override\n\tpublic int getQuantidade() {\n\t\treturn hamburguer.getQuantidade();\n\t}", "public int get(int key) {\n return data[key % KEY];\n }", "int getQuantity();", "public int get(int key) {\n return store[key]; // get the value for the key\n }", "private DataValue getValueForKey(String key) {\n DataValue value = valueMap.get(key);\n if (value == null) {\n return DataValue.NO_VALUE;\n } else {\n return value;\n }\n }", "public CommandWord getVal( String pKey )\n {\n CommandWord vRet = validCommands.get( pKey );\n \n if( vRet == null )\n {\n return CommandWord.UNKNOWN;\n }\n else\n return vRet;\n }", "public V getValue(Object key) {\n\t\treturn super.get(key);\n\t}", "public Value get(Key key) ;", "private BigDecimal getQty(Map<Integer, BigDecimal[]> planQtyMap, int qtyType, Integer mapKey) {\n\n BigDecimal ret = null;\n BigDecimal[] qtyArray = planQtyMap.get(mapKey);\n if (qtyArray != null) {\n ret = qtyArray[qtyType];\n }\n if (ret == null && QTY_TYPE_PLAN == qtyType) {\n ret = BigDecimal.ZERO;\n }\n\n return ret;\n }", "int getQuantite();", "int getQuantite();", "public double getVariableValue(){\n\t\tObject valueKey = getEntries().keySet().stream().findFirst().orElseGet(()->{return 0d;});\n\t\tif (valueKey instanceof Double){\n\t\t\treturn (Double) valueKey;\n\t\t}\n\t\ttry {\n\t\t\tdouble value = Double.parseDouble(valueKey+\"\");\n\t\t\treturn value;\n\t\t}\n\t\tcatch (NumberFormatException ex){\n\t\t\treturn 0d;\n\t\t}\n\t}", "public int getQuantite() {\r\n return quantite;\r\n }", "public int getKeyBuyItem() {\r\n return getKeyShoot();\r\n }", "public int getQuantity();", "int getBuyQuantity();", "public int getQuantidade();", "public Value get(Key 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 }", "long getQuantity();", "long getQuantity();", "public String getValue(String key) {\r\n\t\t\treturn prop.getProperty(key);\r\n\t\t}", "public float getFloat(String key)\n {\n return getFloat(key, 0);\n }", "public String getfirstVolumeDiscountQuantity()\n\t{\n\t\twaitForVisibility(firstVolumeDiscountQuantity);\n\t\treturn firstVolumeDiscountQuantity.getText();\n\t}", "Money getItemValue();", "private void getK(){\r\n if(txtK.getText() != \"\"){\r\n interpretador.setK(Integer.parseInt(txtK.getText()));\r\n in.setK(Integer.parseInt(txtK.getText()));\r\n }\r\n }", "V getValue(final E key) {\r\n for (int i=0;i<kcount;i++) {\r\n if (equal(key, (E)k[i])) return (V)v[i];\r\n }\r\n return null;\r\n }", "public V get(K key) throws InvalidKeyException;", "public V get(K key) {\n\t\treturn table.get(calcIndex(key)).get(key);\n\t}", "BigDecimal getTermValue();", "public SCDataSpec get(String key) throws IOException;", "public double getTotalValue(){\r\n return this.quantity * this.price;\r\n }", "public byte getByte(String key) {\n Object value = get(key);\n return ((value instanceof Long) ? (byte)((Long)value).intValue() : 0);\n }", "public String getKV(String key) throws Exception;", "public Integer getIntegerData(String key) {\n return pref.getInt(key, 0);\n }", "public double getTotalCartValue();", "Short getValue();", "public V psyGet(final K oKey)\n\t\tthrows PsyRangeCheckException, PsyUndefinedException;", "public byte getValueInRowKey() {\n return valueInRowKey;\n }", "public float getMandatoryFloat(String key) throws ConfigNotFoundException;", "public int get(int key) {\n if(arr[key] == -1)\n return 0;\n else if(arr[key] == 0)\n return -1;\n else return arr[key];\n }", "public String getKey() {\r\n return this.buttonKey;\r\n }", "private static int value(char r) {\n if (r == 'I')\n return 1;\n if (r == 'V')\n return 5;\n if (r == 'X')\n return 10;\n if (r == 'L')\n return 50;\n if (r == 'C')\n return 100;\n if (r == 'D')\n return 500;\n if (r == 'M')\n return 1000;\n return -1;\n }", "public String getDicValue(String key)\n {\n String lang_code;\n if(key.indexOf(\"_\")==2)\n {\n lang_code = key.substring(0,2);\n key = key.substring(3,key.length());\n }\n else\n {\n return null;\n }\n return getTranslation(lang_code,key);\n }", "private String getQuantityFromWeighScale() {\r\n // Read data from weigh scale through serial port\r\n\r\n // Convert data to string and return the value to calling function\r\n\r\n return \"1\";\r\n }", "public Float getFloatData(String key) {\n return pref.getFloat(key, 0);\n }", "public BigDecimal getProductQty() \n{\nBigDecimal bd = (BigDecimal)get_Value(\"ProductQty\");\nif (bd == null) return Env.ZERO;\nreturn bd;\n}", "public int getQuantidade() {\r\n return quantidade;\r\n }", "public int getQuantidade() {\r\n return quantidade;\r\n }", "public static synchronized int getKeyClickVolume() {\r\n\t\treturn Button.keys.getKeyClickVolume();\r\n\t}", "public String getKcUnit() {\n return kcUnit;\n }", "String get(Integer key);", "public CQ getProductServiceQuantity() { \r\n\t\tCQ retVal = this.getTypedField(12, 0);\r\n\t\treturn retVal;\r\n }", "public int getValue();", "public int getValue();", "public int get(int key) {\n int index = keys.indexOf(key);\n return index < 0? -1 : values.get(index);\n }", "public float getTcintmquantity()\r\n {\r\n return _tcintmquantity;\r\n }", "public String getConfigurationValue(Enum<?> key) {\n // get string key\n String keyStr = key.toString();\n\n // get value\n String value = this.getConfigurationValue(keyStr);\n\n return value;\n }", "@Override\n\tpublic java.lang.String getNeedQuantity() {\n\t\treturn _lineaGastoCategoria.getNeedQuantity();\n\t}", "public static byte getB(final short key)\n {\n return (byte) (key & BITS);\n }", "public CQ getPsl12_ProductServiceQuantity() { \r\n\t\tCQ retVal = this.getTypedField(12, 0);\r\n\t\treturn retVal;\r\n }", "public Integer getpQuantity() {\n return pQuantity;\n }", "public BigDecimal getShrinkQty() \n{\nBigDecimal bd = (BigDecimal)get_Value(\"ShrinkQty\");\nif (bd == null) return Env.ZERO;\nreturn bd;\n}", "public V getCValue();", "public int calculateUnits(Object oKey, Object oValue);", "public abstract V get(K key);", "public java.lang.String getControlNumber() {\n return controlNumber;\n }", "@Override\n public double getValue() {\n return healthPackAmount;\n }", "public double getQuantidade() {\n return quantidade;\n }" ]
[ "0.6686203", "0.62798256", "0.5981293", "0.59734756", "0.5934626", "0.5922522", "0.5825676", "0.5797324", "0.5705272", "0.5662648", "0.5552005", "0.5550999", "0.5529924", "0.5529924", "0.5507921", "0.550453", "0.5504201", "0.54904556", "0.5487728", "0.5466123", "0.54502356", "0.544137", "0.5431081", "0.54300326", "0.5408864", "0.5404476", "0.53750795", "0.5367098", "0.5341691", "0.53362966", "0.53315216", "0.5328685", "0.5279186", "0.52623844", "0.52617484", "0.523695", "0.52328575", "0.52209336", "0.5218562", "0.5199455", "0.5191293", "0.5191293", "0.5180842", "0.51750034", "0.51740384", "0.5164851", "0.5162225", "0.51514673", "0.5149835", "0.51479125", "0.5124519", "0.5124519", "0.51244", "0.5113389", "0.5104793", "0.5094611", "0.50942165", "0.50853467", "0.50828326", "0.50775045", "0.50756615", "0.5074254", "0.50716203", "0.50685734", "0.50684863", "0.50611085", "0.5042714", "0.50421095", "0.5021331", "0.5021178", "0.50186974", "0.5017052", "0.5016216", "0.5005267", "0.5003309", "0.50024885", "0.50004506", "0.4994035", "0.49918517", "0.49918517", "0.4990648", "0.49870023", "0.49866787", "0.49851546", "0.49818057", "0.49818057", "0.49785402", "0.49760893", "0.4975092", "0.49747455", "0.49744368", "0.49705133", "0.49693662", "0.49682376", "0.49660572", "0.49625176", "0.49625117", "0.49587837", "0.49585223", "0.49528566" ]
0.7779981
0
return the exp quant value for the specified key
public double getExp(String k) { double value=0; if (quantData.containsKey(k)) { value = quantData.get(k); } else { System.out.println("Key not found"); value = 0.0; } return value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public T exp(T value);", "public double getExp() {\n return exp;\n }", "public int getExp() {\n \t\treturn exp;\n \t}", "public double getInput(String k) {\n\t\t\n\t\tdouble value=0;\n\t\t\n\t\tif (quantData.containsKey(k)) {\n\t\t\tvalue = quantData.get(k);\n\t\t} else {\n\t\t\tSystem.out.println(\"Key not found\");\n\t\t\tvalue = 0.0;\n\t\t}\n\t\t\n\t\treturn value;\n\t\t\t\n\t}", "public String get_exponent_part();", "public float getFloat(String key)\n {\n return getFloat(key, 0);\n }", "public float getExp ( ) {\n\t\treturn extract ( handle -> handle.getExp ( ) );\n\t}", "public static double getDouble(Key key) {\n return getDouble(key, 0);\n }", "int getCurEXP();", "int getCurEXP();", "public abstract String getExponent();", "public Expressao getExp() {\n\t\treturn exp;\n\t}", "public Float F(String key) throws AgentBuilderRuntimeException {\n\t\treturn getFloat(key);\n\t}", "public double getDouble(String key)\n {\n return getDouble(key, 0);\n }", "public static double exp() {\r\n System.out.println(\"What is your base?\");\r\n int b = Main.sc.nextInt();\r\n System.out.println(\"What is your power?\");\r\n int p = Main.sc.nextInt();\r\n double answer = Math.pow((double) b, (double) p);\r\n return answer;\r\n }", "static double k0exp(final double x) {\n if (x <= 0) {\n return Double.NaN;\n }\n if (x <= 2) {\n return (chebyshev(x * x - 2, KA) - Math.log(0.5 * x) * Bessel.i0(x)) * Math.exp(x);\n }\n return chebyshev(8 / x - 2, KB) / Math.sqrt(x);\n }", "public static float exp(float x) {\n\n return 0;\n }", "public Float getFloat(String key) throws AgentBuilderRuntimeException {\n\t\tif (!extContainsKey(key))\n\t\t\tthrow new AgentBuilderRuntimeException(\n\t\t\t\t\t\"Dictionary does not contain key \\\"\" + key + \"\\\"\");\n\t\treturn (Float) extGet(key);\n\t}", "double getDouble(String key) throws KeyValueStoreException;", "public void setExp(int exp) {\r\n\t\tthis.exp = exp;\r\n\t}", "public Integer getExponent();", "static double k1exp(final double x) {\n final double z = 0.5 * x;\n if (z <= 0) {\n return Double.NaN;\n }\n if (x <= 2) {\n return (Math.log(z) * Bessel.i1(x) + chebyshev(x * x - 2, K1A) / x) * Math.exp(x);\n }\n return chebyshev(8 / x - 2, K1B) / Math.sqrt(x);\n }", "public double getControl(String k) {\n\t\t\n\t\tdouble value=0;\n\t\t\n\t\tif (quantData.containsKey(k)) {\n\t\t\tvalue = quantData.get(k);\n\t\t} else {\n\t\t\tSystem.out.println(\"Key not found\");\n\t\t\tvalue = 0.0;\n\t\t}\n\t\t\n\t\treturn value;\n\t\t\t\n\t}", "public float f(String key) throws AgentBuilderRuntimeException {\n\t\treturn getFloat(key).floatValue();\n\t}", "public double powE(double exp) {\n return Double.parseDouble(String.format(\"%.8f\", Math.pow(StrictMath.E, exp)));\n }", "public double d(String key) throws AgentBuilderRuntimeException {\n\t\treturn getDouble(key).doubleValue();\n\t}", "public int getExponent();", "Expression getExp();", "public int getCurEXP() {\n return curEXP_;\n }", "public int getCurEXP() {\n return curEXP_;\n }", "public float getUserExponent() {\n/* 195 */ return this.userExponent;\n/* */ }", "int getMaxEXP();", "int getMaxEXP();", "public int getCurEXP() {\n return curEXP_;\n }", "public int getCurEXP() {\n return curEXP_;\n }", "public double getExpModifier()\r\n\t{\treturn this.expModifier;\t}", "public void setExp(int exp) {\n \t\tthis.exp = exp;\n \t}", "public Double D(String key) throws AgentBuilderRuntimeException {\n\t\treturn getDouble(key);\n\t}", "org.hl7.fhir.Quantity getValueQuantity();", "@Nullable\r\n public Float getFloat(String key) {\r\n return getFloat(key, null);\r\n }", "BigDecimal getValue();", "public Expression getGammaValue();", "public double exponent()\n\t{\n\t\treturn _dblExponent;\n\t}", "public long priceExponent() {\n\t\treturn message.getBasePriceExponent();\n\t}", "private double _evaluate(String exp) throws NumberFormatException, ArithmeticException {\r\n return _evaluate(exp,0,(exp.length()-1));\r\n }", "private double procesarOperadorExponente() throws Exception {\r\n double resultado = procesarCoeficientesFuncionesParentesis();\r\n while (!colaDeTokens.isEmpty()) {\r\n switch (colaDeTokens.element().tipoToken) {\r\n case EXPONENTE:\r\n \r\n colaDeTokens.remove();\r\n resultado = Math.pow(resultado, procesarCoeficientesFuncionesParentesis());\r\n continue;\r\n }\r\n break;\r\n }\r\n return resultado;\r\n }", "LocalDateTime getExpiration(K key);", "public BigInteger getExponent() {\n return this.exponent;\n }", "public double evaluate(String exp) throws NumberFormatException, ArithmeticException {\r\n isConstant=true;\r\n return _evaluate(exp);\r\n }", "protected Double generateNumericValue(final String key) {\n Number genValue = !seqGenerators.containsKey(key) ? 0 : seqGenerators.get(key).nextValue();\n if (genValue == null) {\n return null;\n } else {\n return Math.max(0, genValue.doubleValue());\n }\n }", "public Float getFloatData(String key) {\n return pref.getFloat(key, 0);\n }", "BigDecimal getQuantity();", "@SuppressWarnings(\"unchecked\")\r\n \tpublic IMeasure<? extends IMeasure<Q>> pow(int exp) {\r\n \t\tif (exp < 0)\r\n \t\t\treturn (IMeasure<? extends IMeasure<Q>>) this.pow(-exp).inverse();\r\n \t\tif (exp == 0)\r\n \r\n \t\t\treturn (IMeasure<? extends IMeasure<Q>>) ONE;\r\n \r\n \t\tIMeasure<? extends IMeasure<Q>> pow2 = (IMeasure<? extends IMeasure<Q>>) this;\r\n \t\tIMeasure<? extends IMeasure<Q>> result = null;\r\n \t\twhile (exp >= 1) { // Iteration.\r\n \r\n \t\t\tif ((exp & 1) == 1) {\r\n \t\t\t\tresult = (IMeasure<? extends IMeasure<Q>>) ((result == null) ? pow2\r\n \t\t\t\t\t\t: result.multiply(pow2));\r\n \r\n \t\t\t}\r\n \r\n \t\t\tpow2 = (IMeasure<? extends IMeasure<Q>>) pow2.multiply(pow2);\r\n \r\n \t\t\texp >>>= 1;\r\n \r\n \t\t}\r\n \r\n \t\treturn result;\r\n \r\n \t}", "public Float getFloat(String key)\n\t{\n\t\tDouble d = getDouble(key);\n\t\tif(d == null)\n\t\t\treturn null;\n\t\treturn d.floatValue();\n\t}", "public double getTotalExp() {\n double exp = this.exp;\n for (int i = 1; i < level; i++)\n exp += classData.getRequiredExp(i);\n return exp;\n }", "Money getItemValue();", "public double getKey() {\n\t\treturn key;\n\t}", "public void setExp ( float exp ) {\n\t\texecute ( handle -> handle.setExp ( exp ) );\n\t}", "public Integer getExpLevel()\n\t{\n\t\treturn expLevel;\n\t}", "public double getVariableValue(){\n\t\tObject valueKey = getEntries().keySet().stream().findFirst().orElseGet(()->{return 0d;});\n\t\tif (valueKey instanceof Double){\n\t\t\treturn (Double) valueKey;\n\t\t}\n\t\ttry {\n\t\t\tdouble value = Double.parseDouble(valueKey+\"\");\n\t\t\treturn value;\n\t\t}\n\t\tcatch (NumberFormatException ex){\n\t\t\treturn 0d;\n\t\t}\n\t}", "public static Float parseJsonTogetValue(Response response,String key) {\n\t\tJsonPath js= new JsonPath(response.asString());\n\t\treturn js.get(key);\n\t}", "public double getDouble(String key) {\n\t\treturn Double.parseDouble(get(key));\n\t}", "public float getFloat(String key, float defaultValue);", "public int getRequiredExp() {\n return classData.getRequiredExp(level);\n }", "double getValue();", "double getValue();", "double getValue();", "public float getMandatoryFloat(String key) throws ConfigNotFoundException;", "public Iterable<Float> getFloats(String key);", "public Double getDouble(String key) throws AgentBuilderRuntimeException {\n\t\tif (!extContainsKey(key))\n\t\t\tthrow new AgentBuilderRuntimeException(\n\t\t\t\t\t\"Dictionary does not contain key \\\"\" + key + \"\\\"\");\n\t\treturn (Double) extGet(key);\n\t}", "public double evaluar(String cadenaExp) throws Excepciones{\n double resultado;\n exp = cadenaExp;\n expIndice = 0;\n obtieneToken();\n if(token.equals(FINEXP)){\n obtieneError(SINEXP); // no hay expresion presente\n } \n // analiza y evalua la expresion\n resultado = evaluarExp2();\n if(!token.equals(FINEXP)){ // el ultimo token debe ser FINEXP\n obtieneError(SYNTAXIS);\n }\n return resultado;\n }", "public BigDecimal getEXCH_RATE() {\r\n return EXCH_RATE;\r\n }", "double getDouble(String key) {\n double value = 0.0;\n try {\n value = mConfigurations.getDouble(key);\n } catch (JSONException e) {\n sLogger.error(\"Error retrieving double from JSONObject. @ \" + key);\n }\n return value;\n }", "public Float getFloat(String key, Float defaultValue);", "public V getValue(K key);", "public V getValue(K key);", "public CompoundValue getValue(Object key);", "public double visit(MoneyMarket moneyMarket) {\n\t\treturn (double) moneyMarket.getQuantity();\n\t}", "private double f(double x) {\n return (1 / (1 + Math.exp(-x)));\n }", "Double getValue();", "float getBonusExp();", "public Date getExpDate() {\n return this.expDate;\n }", "float getValue();", "float getValue();", "float getValue();", "public int getExponent( double f ) {\r\n \r\n int exp = (int)( Math.log( f ) / Math.log( 2 ) );\r\n \r\n return exp;\r\n \r\n }", "public int getExpId() {\n return expId;\n }", "public float getFloat(short dictionaryKey) {\n\t\treturn floatsMap.get(dictionaryKey);\n\t}", "public int getMaxEXP() {\n return maxEXP_;\n }", "public int getMaxEXP() {\n return maxEXP_;\n }", "private Double conversionElectric(Double quant) {\n return quant;\n }", "public void setExp(double exp) {\n this.exp = Math.max(Math.min(exp, getRequiredExp() - 1), 0);\n }", "public double getExpLoss()\r\n\t{\treturn this.expLoss;\t}", "@Column(name = \"exp_gained\", precision = 10)\n\t@Override\n\tpublic Integer getExpGained() {\n\t\treturn (Integer) getValue(3);\n\t}", "public BigDecimal getShrinkQty() \n{\nBigDecimal bd = (BigDecimal)get_Value(\"ShrinkQty\");\nif (bd == null) return Env.ZERO;\nreturn bd;\n}", "public BigDecimal getProductQty() \n{\nBigDecimal bd = (BigDecimal)get_Value(\"ProductQty\");\nif (bd == null) return Env.ZERO;\nreturn bd;\n}", "public boolean get_exponent_sign();", "public static double exp(double a, double b){\r\n\t\treturn Math.pow(a,b);\r\n\t}", "String getValue(String type, String key);", "public QxType getValue( final String key ) {\n return getValue( key, null );\n }" ]
[ "0.64677775", "0.63790965", "0.6200923", "0.61416805", "0.599901", "0.59593683", "0.59484637", "0.58441657", "0.58037746", "0.58037746", "0.5800627", "0.5753775", "0.5700917", "0.5690104", "0.5685562", "0.5681117", "0.5666013", "0.56603163", "0.5653643", "0.56464636", "0.55944276", "0.5586835", "0.55857575", "0.5581562", "0.55534637", "0.5534954", "0.54935837", "0.5491654", "0.5459887", "0.54590994", "0.5454551", "0.5445291", "0.5445291", "0.5443752", "0.54433644", "0.5404229", "0.539748", "0.5375788", "0.53672135", "0.53606784", "0.5357622", "0.5347804", "0.5334799", "0.53310317", "0.53005177", "0.52875185", "0.5285796", "0.5276563", "0.5258688", "0.52421093", "0.52350426", "0.5234075", "0.52317214", "0.5224702", "0.5215011", "0.51907784", "0.5182651", "0.5143655", "0.5131328", "0.51275116", "0.51217526", "0.5089298", "0.5081516", "0.50765705", "0.5061433", "0.5061433", "0.5061433", "0.5059025", "0.5051145", "0.5043664", "0.5040512", "0.50307876", "0.50277835", "0.50238097", "0.5019936", "0.5019936", "0.5004902", "0.5000599", "0.49985215", "0.49809924", "0.49656805", "0.49567756", "0.49517697", "0.49517697", "0.49517697", "0.49504042", "0.49494812", "0.4946697", "0.49327734", "0.49317658", "0.4929271", "0.49279663", "0.4923323", "0.49224475", "0.49223763", "0.4913023", "0.49126306", "0.49118313", "0.49111024", "0.49081144" ]
0.81022644
0
The main usage method, returns a Image object corresponding to the Sprite object
public Image getSpriteImage(Sprite sprite){ if(sprite == null){ return sprites.get(1); } return sprites.get(sprite.getSpriteIndex()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Image sprite(){\n\t\treturn (face);\n\t}", "abstract public void loadSprite();", "public Sprite getSprite() {\n\t\treturn image;\n\t}", "@Override\n\tpublic final Image getImage() {\n\t\treturn this.getSprite().getImage();\n\t}", "public Java2DSprite getSprite(Image ref) {\r\n\t\tif (window == null) {\r\n\t\t\tthrow new RuntimeException(\"Attempt to retrieve sprite before game window was created\");\r\n\t\t}\r\n\t\treturn new Java2DSprite((Java2DGameWindow) window,ref);\r\n\t}", "ImageView getRepresentationFromSpriteId(int spriteId);", "private Sprite createSprite(Image image)\n\t{\n\t\tSprite sprite = new Sprite(image, image.getWidth(), image.getHeight());\n\t\treturn sprite;\n\t}", "public BufferedImage getSpriteImage(String ref) {\n\t\treturn sprites.get(ref);\n\t}", "public void evaluateSprite(){\n if(this.orientation == Orientation.FACING_NORTH) {\n texture = new Texture(Gdx.files.internal(\"/assets/gameObjects/playerFacingNorth.png\"));\n }\n if(this.orientation == Orientation.FACING_WEST){\n texture = new Texture(Gdx.files.internal(\"/assets/gameObjects/playerFacingWest.png\"));\n }\n if(this.orientation == Orientation.FACING_SOUTH){\n texture = new Texture(Gdx.files.internal(\"/assets/gameObjects/playerFacingSouth.png\"));\n }\n if(this.orientation == Orientation.FACING_EAST){\n texture = new Texture(Gdx.files.internal(\"/assets/gameObjects/playerFacingEast.png\"));\n }\n\n this.sprite = new Sprite(texture);\n }", "public static ImageIcon getSprite(String name)\n\t{\n\t\tImageIcon img = sprites.get(name);\n\t\tif (img == null)\n\t\t{\n\t\t\tDebug.println(\"Image \"+name+ \" loaded\");\n\t\t\ttry{\n\t\t\t\tURL url = new URL(\"https://deanattali.com/files/java/Scrabble/\" + name);\n\t\t\t img = new ImageIcon(url);\n\t\t\t}catch(Exception ex){}\n\t\t\tsprites.put(name,img);\n\t\t}\n\n\t\treturn img;\n\t}", "protected abstract void chooseSprite();", "public Image getImage(String token) {\n\t\tImage image = spriteMap.get(token);\n\t\tif (image == null) {\n\t\t\tSystem.out.println(\"null image on input \" + token);\n\t\t}\n\t\treturn image;\n\t}", "public MyAnimation getSprite();", "@Override\n public Sprite createSprite(SnakeSmash game) {\n Texture texture = game.getAssetManager().get(\"pinkSquare.png\");\n return new Sprite(texture, texture.getWidth(), texture.getHeight());\n }", "public Sprite() {}", "@Override\n\tpublic final Sprite getSprite() {\n\t\treturn this.sprite;\n\t}", "public synchronized Sprite getSprite(String ref) {\n\t\t// if we've already got the sprite in the cache\n\t\t// then just return the existing version\n\t\tif (sprites.get(ref) != null) {\n\t\t\treturn sprites.get(ref);\n\t\t}\n\t\t\n\t\t// otherwise, go away and grab the sprite from the resource\n\t\t// loader\n\t\t\n\t\t// The ClassLoader.getResource() ensures we get the sprite\n\t\t// from the appropriate place, this helps with deploying the game\n\t\t// with things like webstart. You could equally do a file look\n\t\t// up here.\n\t\ttry (InputStream imgStr = this.getClass().getClassLoader().getResourceAsStream(ref)) {\n\t\t\tif (imgStr == null) {\n\t\t\t\tfail(\"Can't find ref: \"+ref);\n\t\t\t}\n\t\t\t\n\t\t\t// use ImageIO to read the image in\n\t\t\t// create a sprite, add it the cache then return it\n\t\t\tSprite sprite = new Sprite(new Image(imgStr));\n\t\t\t\n\t\t\tsprites.put(ref,sprite);\n\t\t\tnewSprites.put(ref, sprite);\n\t\t\t\n\t\t\treturn sprite;\n\t\t} catch (IOException e) {\n\t\t\tthrow new UncheckedIOException(e);\n\t\t}\n\t\t\n\t}", "public Sprite getSprite()\n\t{\n\t\treturn sprite;\n\t}", "@Override\n public Sprite createSprite(TSSGame game) {\n return new Sprite();\n }", "public Image getBulletImg(){ \n return SpriteSheet.playerProjectileSprites[this.frameNumber]; \n }", "WorldImage getImage();", "Sprite(String url, float x, float y, float w, float h) {\n _img = loadImage(url);\n _x = x;\n _y = y;\n _w = w;\n _h = h;\n _rotVector = new PVector(1, 0, 0);\n resetRectHitbox();\n }", "public Sprite(double x, double y, String imageName) {\n\n this.x = x;\n this.y = y;\n visible = true;\n\n // set the image\n ImageIcon ii = new ImageIcon(imageName);\n image = ii.getImage();\n\n r = image.getHeight(null);\n }", "public Sprite getSprite() {\n\t\treturn sprite;\n\t}", "public Sprite getSprite() {\n\t\treturn sprite;\n\t}", "public Sprite getCurrentSprite() {\n\t\tif (this.getVx() <= 0) {\n\t\t\treturn getImages()[0];\n\t\t}\n\t\treturn getImages()[1];\n\t}", "Sprite getBackground();", "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}", "private Image addImageToGameObject(Class gameObject, double width, double height) {\n InputStream inputStream;\n imageWidth = 64;\n imageHeight = 64;\n if (gameObject.equals(Asteroid.class)) {\n inputStream = getClass().getClassLoader().getResourceAsStream(mediumAsteroidFilePath);\n assert inputStream != null;\n image = new Image(inputStream);\n if (width > 32) {\n imageWidth = 100;\n imageHeight = 100;\n }\n } else if (gameObject.equals(HealthPowerUp.class)) {\n inputStream = getClass().getClassLoader().getResourceAsStream(shieldFilePath);\n assert inputStream != null;\n image = new Image(inputStream);\n } else if (gameObject.equals(ShieldPowerUp.class)) {\n inputStream = getClass().getClassLoader().getResourceAsStream(hpFilePath);\n assert inputStream != null;\n image = new Image(inputStream);\n } else if (gameObject.equals(Spaceship.class)) {\n inputStream = getClass().getClassLoader().getResourceAsStream(spaceshipImageName);\n assert inputStream != null;\n image = new Image(inputStream);\n } else if (gameObject.equals(SlowDebuff.class)) {\n imageWidth = 32;\n imageHeight = 32;\n inputStream = getClass().getClassLoader().getResourceAsStream(timeDebuffPath);\n assert inputStream != null;\n image = new Image(inputStream);\n } else if (gameObject.equals(LaserBeam.class)) {\n laserGUI.setIsVertical(width < height);\n image = laserGUI.getFrame(animationTime);\n imageWidth = image.getWidth();\n imageHeight = image.getHeight();\n }\n return image;\n }", "public Sprite(String newSpriteLocation){\n\t\timages = new Texture[1];\n\t\timages[0] = new Texture(newSpriteLocation);\n\t}", "public abstract TextureObject getTexture();", "public native Sprite copy(Sprite sprite);", "@Override\r\n public Sprite build() {\r\n return new Sprite(imageView, totalNbrFrames, columns, offsetX, offsetY, widthFrame, heightFrame);\r\n }", "Image createImage();", "IMG createIMG();", "Sprite(float x, float y, float w, float h) {\n _img = createImage(1, 1, RGB);\n _x = x;\n _y = y;\n _w = w;\n _h = h;\n _rotVector = new PVector(1, 0, 0);\n resetRectHitbox();\n }", "public MyAnimation getFrontSprite();", "private void createImage()\n {\n GreenfootImage image = new GreenfootImage(width, height);\n setImage(\"Player.png\");\n }", "public abstract Image getImage();", "public abstract Image getImage();", "public static Bitmap GetDealSpriteBitmap()\r\n\t{\r\n\t\t// Load background desktop image from resouce\r\n\t\tBitmap image = null;\r\n\t\tif(CGameHelper.m_GameContext != null)\r\n\t\t{\r\n\t\t\tResources res = CGameHelper.m_GameContext.getResources();\r\n\t\t\tif(res == null)\r\n\t\t\t\treturn image; \r\n\r\n\t\t\tif(m_DealSpriteBitmap == null)\r\n\t\t\t{\r\n\t\t\t\tm_DealSpriteBitmap = BitmapFactory.decodeResource(res, R.drawable.face);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\timage = m_DealSpriteBitmap;\r\n\t\t} \r\n\t\treturn image;\r\n\t}", "public void addSprite(Scene pScene, int x, int y) {\n\t\t\r\n\t}", "@Override\n\tpublic void draw(Graphics2D g2) {\n\t\tBufferedImage subImage = getSprite().getSubimage(0*128,0,128,193);\n\t\tg2.drawImage(subImage,getPositionX(),getPositionY(),null);\n\t}", "public Sprite getSprite(String ref) {\n\t\tif (ref.equals(\"boss\")) {\n\t\t\treturn sprite.get(\"bossSprite\");\n\t\t} else if (ref.equals(\"boss_bullet\")) {\n\t\t\treturn sprite.get(\"bossBulletSprite\");\n\t\t} else if (ref.equals(\"boss_explosion\")) {\n\t\t\treturn sprite.get(\"bossExplosionSprite\");\n\t\t} else if (ref.equals(\"boss_hit\")) {\n\t\t\treturn sprite.get(\"bossHitSprite\");\n\t\t} else if (ref.equals(\"bullet\")) {\n\t\t\treturn sprite.get(\"bulletSprite\");\n\t\t} else if (ref.equals(\"enemy_bullet\")) {\n\t\t\treturn sprite.get(\"enemyBulletSprite\");\n\t\t} else if (ref.equals(\"enemy_explosion\")) {\n\t\t\treturn sprite.get(\"enemyExplosionSprite\");\n\t\t} else if (ref.equals(\"enemy_hit\")) {\n\t\t\treturn sprite.get(\"enemyHitSprite\");\n\t\t} else if (ref.equals(\"green_box\")) {\n\t\t\treturn sprite.get(\"greenBoxSprite\");\n\t\t} else if (ref.equals(\"laser\")) {\n\t\t\treturn sprite.get(\"laserSprite\");\n\t\t} else if (ref.equals(\"player\")) {\n\t\t\treturn sprite.get(\"playerSprite\");\n\t\t} else if (ref.equals(\"player_explosion\")) {\n\t\t\treturn sprite.get(\"playerExplosionSprite\");\n\t\t} else if (ref.equals(\"player_hit\")) {\n\t\t\treturn sprite.get(\"playerHitSprite\");\n\t\t} else if (ref.equals(\"powerup_explosion\")) {\n\t\t\treturn sprite.get(\"powerupExplosionSprite\");\n\t\t} else if (ref.equals(\"red_box\")) {\n\t\t\treturn sprite.get(\"redBoxSprite\");\n\t\t} else {\n\t\t\tSystem.out.println(\"fatal error\");\n\t\t\tSystem.out.println(ref);\n\t\t\treturn null;\n\t\t}\n\t}", "public CroppableAtlasSprite obtainSprite(ETexture texture) {\n\t\treturn obtainSprite(ResourceCache.getTexture(texture));\n\t}", "@Override\n public Sprite getHurtSprite() {\n return Assets.getInstance().getSprite(\"entity/zombie_blood0.png\");\n }", "public abstract void createSprites() throws FileNotFoundException;", "public Hero(int x, int y) {\r\n this.centerX = x;\r\n this.centerY = y;\r\n this.currentHealth = 100;\r\n rect1 = new FloatRect (100,630,80,110);\r\n imgTexture = new Texture ();\r\n try {\r\n imgTexture.loadFromFile (Paths.get (ImageFile));\r\n } catch (IOException ex) {\r\n ex.printStackTrace ();\r\n }\r\n imgTexture.setSmooth (true);\r\n\r\n img = new Sprite (imgTexture);\r\n img.setOrigin (Vector2f.div (new Vector2f (imgTexture.getSize ()), 2));\r\n img.setPosition (x, y);\r\n // Store references to object and key methods\r\n obj = img;\r\n setPosition = img::setPosition;\r\n\r\n background = new Sprite (bg.loadTextures ());\r\n background.setOrigin(Vector2f.div(new Vector2f(bg.getTexture1 ()), 1000000));\r\n background.setPosition (0,0);\r\n }", "@Override\n public Sprite createSprite(DeathmatchMania game) {\n Animation = createAnimation(game);\n return new Sprite(Animation.getKeyFrame(0, true));\n }", "Sprite(Sprite s) {\n _img = s._img;\n _x = s._x;\n _y = s._y;\n _w = s._w;\n _h = s._h;\n _rotVector = new PVector(s._rotVector.x, s._rotVector.y, 0);\n _front = s._front;\n _hitboxCenter = new PVector(s._hitboxCenter.x, s._hitboxCenter.y);\n _hitbox = new PVector[s._hitbox.length];\n for (int i = 0; i < _hitbox.length; i++) {\n _hitbox[i] = new PVector(s._hitbox[i].x, s._hitbox[i].y);\n }\n _flipped = s._flipped;\n }", "public Texture getImage(){\n\t\treturn images[0];\t\t\n\t}", "public Sprite getSprite() {\n\t\tlong currTime = System.currentTimeMillis();\n\t\tif(currTime - lastUpdate > timeEach) {\n\t\t\tlastUpdate = currTime;\n\t\t\tcurrSprite++;\n\t\t\tif(currSprite >= sprites.length)\n\t\t\t\tcurrSprite = 0;\n\t\t}\n\t\treturn sprites[currSprite];\n\t}", "@Override\n public Sprite createSprite(MyCumulusGame game) {\n walkingAnimation = createWalkingAnimation(game);\n jumpingAnimation = createJumpingAnimation(game);\n\n return new Sprite(jumpingAnimation);\n }", "private Sprite getIdeaSprite() {\n\t\tfinal String idea = entity.getIdea();\n\n\t\tif (idea == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn SpriteStore.get().getSprite(\n\t\t\t\t\"data/sprites/ideas/\" + idea + \".png\");\n\t}", "public Image getOne();", "public abstract Image gen();", "public static Image target()\n\t{\n\t\treturn targetImg;\n\t}", "Texture getIcon();", "ArrayList<Sprite> getSpriteArray();", "private AnimatedImage healthSprite() throws FileNotFoundException {\n\n\t\tString[] imageArray = new String[4];\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\timageArray[i] = \"sprites/Heart\" + i + \".png\";\n\t\t}\n\n\t\tAnimatedImage health = new AnimatedImage(imageArray, 0.125, 90, 90);\n\n\t\treturn health;\n\n\t}", "private AnimatedImage armorSprite() throws FileNotFoundException {\n\n\t\tString[] imageArray = new String[4];\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\timageArray[i] = \"sprites/BluePotion\" + i + \".png\";\n\t\t}\n\n\t\tAnimatedImage armor = new AnimatedImage(imageArray, 0.125, 70, 70);\n\n\t\treturn armor;\n\n\t}", "void turnToSprite(Sprite s) {\n turnToPoint(s._x, s._y);\n }", "@Override\n\tpublic Image getImage() {\n\t\treturn img;\n\t}", "protected abstract Image loadImage();", "public JewelSprite(int type, int x, int y) {\n\t this.type = type;\n\t setxPos(x);\n\t setyPos(y);\n\n\t String imagePath = \"/\" + Integer.toString(type) + \".png\";\n\t jewelImage = new Image(Jewel.class.getResourceAsStream(imagePath));\n\t ImageView jewelImageView = new ImageView();\n\t jewelImageView.setImage(jewelImage);\n\t jewelImageView.setStyle(\"-fx-background-color:transparent;\");\n\n\t setNode(jewelImageView);\n\t }", "public MyAnimation getRearSprite();", "public Sprite(Image img){\n\t\tsuper();\n\t\t_img = img;\n\t\tsetOrigin(_img.getWidth()/2,_img.getHeight()/2);\n\t\ttranslate(0, 0);\n\t}", "public SpriteSheet(BufferedImage sheet){\n this.sheet = sheet;\n }", "private Group renderSprite(Sprite sprite) {\n//\t\tSystem.out.println(\"Rendering a sprite at\" + sprite.transform().getPosX() + \", height \" + sprite.transform().getHeight());\n\t\tGroup spriteGroup = new Group();\t\n\t\t\ttry{\n\t\t\t\tImage spriteImg = myImageManager.getImageForString(sprite.getImagePath());\n\t\t\t\tImageView spriteImageView = null;\n\t\t\t\tif(spriteImg !=null){\n\t\t\t\t\tspriteImageView = new ImageView(spriteImg);\n\t\t\t\t\tif(sprite.facesLeft()) spriteImageView.setScaleX(-1.0);\n\t\t\t\t\tspriteImageView.setX(sprite.transform().getPosX());\n\t\t\t\t\tspriteImageView.setY(sprite.transform().getPosY());\n\t\t\t\t\tspriteImageView.setFitWidth(sprite.transform().getWidth());\n\t\t\t\t\tspriteImageView.setFitHeight(sprite.transform().getHeight());\n\t\t\t\t\tspriteGroup.getChildren().add(spriteImageView);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tRectangle r = new Rectangle(sprite.transform().getPosX(), sprite.transform().getPosY(), \n\t\t\t\t\t\t\tsprite.transform().getWidth(), sprite.transform().getHeight());\n\t\t\t\t\tspriteGroup.getChildren().add(r);\n\t\t\t\t} \n\t\t\t\tsprite.emissionList().stream()\n\t\t\t\t.forEach(emission -> spriteGroup.getChildren().add(renderSprite(emission)));\n\t\t\t\tif (editMode == EditMode.EDIT_MODE_ON) {\n\t\t\t\t\tconfigureMouseHandlersOnSpriteImageView(spriteImageView);\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tcatch (Exception e){\n\t\t\t\t DialogUtil.displayMessage(\"Error Sprite Rendering\", \"Sprite Rendering\");\n\t\t\t}\n\t\treturn spriteGroup;\n\n\t}", "public SpriteBase getSpriteBase() {\n return spriteBase;\n }", "public static Image loadImage(String filename) {\n\t\t// using the URL means the image loads when stored\n\t\t// in a jar or expanded into individual files.\n\t\tjava.net.URL imageURL = SpriteMap.class.getResource(IMAGE_PATH + filename);\n\t\ttry {\n\t\t\tImage img = ImageIO.read(imageURL);\n\t\t\treturn img;\n\t\t} catch (IOException e) {\n\t\t\t// we've encountered an error loading the image. There's not much we\n\t\t\t// can actually do at this point, except to abort the game.\n\t\t\tthrow new RuntimeException(\"Unable to load image: \" + filename);\n\t\t}\n\t}", "public void initSpriteSheet() {\n\t\tString url = \"https://amiealbrecht.files.wordpress.com/2016/08/set-cards.jpg?w=1250\";\n\n\t\tcimg = loadImage(url, \"png\");\n\t}", "private void generate() {\n preGenerate();\n\n SpriteGrid grid = new SpriteGrid(specState);\n IOHelper.pixelsToBitmap(grid.draw(), sprite);\n\n }", "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}", "@Override\n\tpublic Image getImage() {\n\t\treturn image;\n\t}", "private static void loadSprites(){\n \t\tshipSprites.put(\"SCOUT_BLUE\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/blue/scout.png\"), 0, 0.5f));\n \t\tshipSprites.put(\"HUNTER_BLUE\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/blue/hunter.png\"), 0, 0.5f));\n \t\tshipSprites.put(\"DESTROYER_BLUE\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/blue/destroyer.png\"), 0, 0.5f));\n \t\tshipSprites.put(\"COLONIZER_BLUE\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/blue/colonizer.png\"), 0.5f, 0.5f));\n \t\t\n \t\t/*\n \t\t * Ships Red Player\n \t\t */\n \t\tshipSprites.put(\"SCOUT_RED\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/red/scout.png\"), 0, 0.5f));\n \t\tshipSprites.put(\"HUNTER_RED\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/red/hunter.png\"), 0, 0.5f));\n \t\tshipSprites.put(\"DESTROYER_RED\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/red/destroyer.png\"), 0, 0.5f));\n \t\tshipSprites.put(\"COLONIZER_RED\", new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/red/colonizer.png\"), 0.5f, 0.5f));\n \n \t\t/*\n \t\t * Path Arrows\n \t\t */\n\t\tpathTextures.put(\"HEAD\", Toolkit.getDefaultToolkit().getImage(\"res/path/head.png\"));\n\t\tpathTextures.put(\"START\", Toolkit.getDefaultToolkit().getImage(\"res/path/start.png\"));\n\t\tpathTextures.put(\"STRAIGHT\", Toolkit.getDefaultToolkit().getImage(\"res/path/straight.png\"));\n\t\tpathTextures.put(\"TURN\", Toolkit.getDefaultToolkit().getImage(\"res/path/turn.png\"));\n \t\t\n \t\t/*\n \t\t * Planets\n \t\t */\n \t\tmetalplanets.put(0, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/metalplanet_0.png\"), 0.5f, 0));\n \t\tmetalplanets.put(1, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/metalplanet_1.png\"), 0.5f, 0));\n \t\tmetalplanets.put(2, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/metalplanet_2.png\"), 0.5f, 0));\n \t\tmetalplanets.put(3, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/metalplanet_3.png\"), 0.5f, 0));\n \t\tgasplanets.put(0, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/gasplanet_0.png\"), 0.5f, 0));\n \t\tgasplanets.put(1, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/gasplanet_1.png\"), 0.5f, 0));\n \t\tgasplanets.put(2, new Sprite(Toolkit.getDefaultToolkit().getImage(\"res/icons/planets/gasplanet_2.png\"), 0.5f, 0));\n \t\t\n \t\t/*\n \t\t * Colony Sprite\n \t\t */\n \t\tloadColonySprites(Color.RED, \"RED\");\n \t\tloadColonySprites(Color.BLUE, \"BLUE\");\n \t}", "public Mario(){\n setImage(\"06.png\");\n \n }", "public int getSpriteID() {\n return spriteID;\n }", "public interface ISprite\r\n{\r\n\t/*\r\n\t * By defining types, we hope to optimise collision detection.\r\n\t */\r\n\tpublic enum Type{OBSTACLE, GOODIE, USER_MOVEABLE, ENEMY, DECORATION, PLATFORM};\r\n\tpublic enum Collision{LEFT, RIGHT, TOP, BOTTOM,NONE};\r\n\t/**\r\n\t * Find out the current Position of this Sprite.\r\n\t * @return Point GWT Point location object.\r\n\t */\r\n\tpublic Vector getLocation();\r\n\t/**\r\n\t * Inform the Sprite of it's new location\r\n\t * @param point\r\n\t */\r\n\tpublic void setLocation(Vector location);\r\n\t\r\n\t/**\r\n\t * A flag to determine a Sprites selection state.\r\n\t * @return\r\n\t */\r\n\tpublic boolean isSelected();\r\n\t\r\n\t/**\r\n\t * Render this Sprite.\r\n\t * We have a back and front context to facilitate double buffering.\r\n\t * \r\n\t * @param context\r\n\t */\r\n\tpublic void draw(Canvas canvas);\r\n\t\r\n\t/**\r\n\t * Update this Sprites model data.\r\n\t */\r\n\tpublic void update(InputEvent event);\r\n\t\r\n\t/*\r\n\t * Every ISprite type will handle obstacles differently.\r\n\t * Examples: <Comments here to help design implementation>\r\n\t * \r\n\t * Obstacle: Prevents colliding sprite from moving in one direction.\r\n\t * Goodie: Increases points, disposes\r\n\t * Enemy: Removes a life or kills user sprite\r\n\t * Decoration: Does nothing\r\n\t * Platform: Sprites falling down wards are stopped. Sprites can jump through (up).\r\n\t */\r\n\tpublic void handleCollision(ISprite collisionSprite, Collision collisionType);\t\r\n\t\r\n\t/**\r\n\t * Checks if the two sprites collide. \r\n\t * The return value describes the direction of\r\n\t * the collision. Collision.NONE means there\r\n\t * was no collision detected.\r\n\t * \r\n\t * @param sprite\r\n\t * @return Collision.LEFT, Collision.RIGHT etc...\r\n\t */\r\n\tpublic Collision getCollisionType(ISprite sprite);\r\n\t\r\n\t/**\r\n\t * A layer dictates a Sprites paint order. Those at the back are painted\r\n\t * first. Those in the from painted last. A Z order in a way.\r\n\t * @return\r\n\t */\r\n\tpublic Layer.Layers getLayer();\r\n\t\r\n\tpublic void dispose();\r\n\t\r\n\tpublic boolean isDisposed();\r\n\t\r\n\tpublic Type getType();\r\n\t\r\n\tpublic Rectangle getBounds();\r\n}", "String getImage();", "public Sprite getSprite(String spriteName)\n {\n if (this.sprites.containsKey(spriteName))\n return this.sprites.get(spriteName);\n else\n {\n \tSystem.out.println(\"Sprite \" + spriteName + \"does not exist in the bank\");\n return null;\n }\n }", "private void populateFromSprite() {\n long start = System.currentTimeMillis();\n int bitSetIndex = 0;\n BufferedImage bImage = (BufferedImage) sprite.m_image;\n //BufferedImage img = ImageIO.read(new File(\"assets/LoopBitmap.bmp\"));\n int color;\n // Loop through image according to scale\n for(int i = 0; i < sprite.getWidth(); i+=scale) {\n for(int j = 0; j < sprite.getHeight(); j+= scale) {\n // Get color at pixel i, j, if black set Bitmap index to true.\n color = bImage.getRGB(i, j);\n if(color == Color.BLACK.getRGB()) { //tempColor.equals(Color.black)) {\n this.set(bitSetIndex, true);\n //System.out.println(\"'BLACK' Color = \"+color + \" i=\"+ i + \", j=\"+j);\n }\n bitSetIndex++;\n }\n }\n long end = System.currentTimeMillis();\n// System.out.println(\">>>>>>>>>>>>>>>>>>>>>>>>>>>>\");\n// System.out.println(\"BITMAP DONE :)\");\n// System.out.println(\"Time to build = \"+(end-start)+\"ms\");\n// System.out.println(\">>>>>>>>>>>>>>>>>>>>>>>>>>>>\");\n }", "public Image getInstanceImage() {\r\n return this.image;\r\n }", "Ground(Sprite sprite) {Collect.Hit(\"BoardFactory.java\",\"Ground(Sprite sprite)\");this.background = sprite; Collect.Hit(\"BoardFactory.java\",\"Ground(Sprite sprite)\", \"3015\");}", "public BufferedImage[] powerSprite(){\n\t\tBufferedImage arr[] = new BufferedImage[4];\n\t\tarr[0] = img.getSubimage(724, 283, 71, 67);\n\t\tarr[1] = img.getSubimage(650, 286, 72, 64);\n\t\tarr[2] = img.getSubimage(484, 292, 83, 58);\n\t\tarr[3] = img.getSubimage(257, 281, 71, 69);\n\t\treturn arr;\n\t\t\t\n\t}", "@Override\n\tpublic SpriteType getSpriteType() {\n\t\treturn null;\n\t}", "public GameObject(String name, int x, int y) {\n this.image = GameObject.processing.loadImage(\"images\" + File.separator + name + \".png\");\n this.xPosition = x;\n this.yPosition = y;\n this.active = true;\n }", "public HashMap<String, BufferedImage> getSprites() {\n \t\treturn sprites;\n \t}", "public Sprite(Texture newImage){\n\t\timages = new Texture[1];\n\t\timages[0] = newImage;\n\t}", "public interface SpriteInterface {\n\n\n void start();\n\n\n void update(double timeChange);\n\n\n void draw();\n\n void changeLocation(float xPos, float yPos, float rotation, float scaleX, float scaleY);\n\n\n}", "public native Sprite clone();", "public Sprite getBattleSprite()\n {\n return battleSprite;\n }", "protected Image drawAsset(String asset, int x, int y) {\n // Generate texture\n Texture texture = null;\n\n // Make sure the asset is loaded\n if (!assets.contains(asset)) {\n logger.error(\"Lazy loading asset: \" + asset);\n assets.load(asset, Texture.class, GamePart.MENU);\n }\n if (assets.isLoaded(asset)) {\n texture = assets.get(asset, Texture.class);\n } else {\n assets.finishLoadingAsset(asset);\n texture = assets.get(asset, Texture.class);\n }\n texture.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);\n\n // Generate image\n Image image = new Image(texture);\n image.setPosition(x, y);\n\n // Add to screen\n stage.addActor(image);\n\n return image;\n }", "@Override\n\tpublic final IRenderable load() {\n\t\tImage img = loadImage();\n\t\tassertImageIsValid(img);\n\t\treturn new ImageRenderable(img);\n\t}", "public Sprite makeSprite(String name, List<String> assignments) {\n\t\tSpriteConstructor factory = spriteFactoryMap.get(name);\n\t\treturn factory.construct(assignments);\n\t}", "public int getImage();", "java.lang.String getImage();", "@Override\n public Action update() {\n // draws the image \"image\" at position \"this.x\" and \"this.y\" and then returns null\n Thing.getProcessing().image(this.image, this.x, this.y);\n return null;\n }", "public Sprite loadBitmap(Context context, GL10 gl, int resourceId)\r\n\t{\r\n\t if(context != null && gl != null)\r\n\t {\r\n\t \t//Generate one texture pointer...\r\n\t gl.glGenTextures(1, mTexture, 0);\r\n\t \r\n\t //grab location index\r\n\t int textureID = mTexture[0];\r\n\t \r\n\t\t\t//...and bind it to our array\r\n\t gl.glBindTexture(GL10.GL_TEXTURE_2D, textureID);\r\n\t \r\n\t\t\t//Create Nearest Filtered Texture //GL_NEAREST\r\n\t gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);\r\n\t gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);\r\n\t\r\n\t\t\t//Different possible texture parameters, e.g. GL10.GL_CLAMP_TO_EDGE\r\n\t gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_REPEAT);\r\n\t gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);\r\n\t\t\t\r\n\t // select modulate to mix texture with color for shading\r\n\t gl.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE, /*GL10.GL_REPLACE*/ GL10.GL_MODULATE);\r\n\t\r\n\t InputStream is = context.getResources().openRawResource(resourceId);\r\n\t Bitmap bitmap;\r\n\t try\r\n\t {\r\n\t bitmap = BitmapFactory.decodeStream(is, null, sBitmapOptions);\r\n\t }\r\n\t finally\r\n\t {\r\n\t try\r\n\t {\r\n\t is.close();\r\n\t }\r\n\t catch(IOException e)\r\n\t {\r\n\t //Log.e(\"ImageLoaderIO\", \"DecodeStreamError: \" + e);\r\n\t }\r\n\t }\r\n\t\r\n\t GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);\r\n\t int width = bitmap.getWidth();\r\n\t int height = bitmap.getHeight();\r\n\t \r\n\t // clean up\r\n\t bitmap.recycle();\r\n\t\r\n\t return new Sprite(textureID,width,height);\r\n\t }\r\n\t return null;\r\n\t}", "public void addSprite(Sprite s) {\n sprites.addSprite(s);\n }" ]
[ "0.7513949", "0.7247523", "0.7227119", "0.714569", "0.70526373", "0.70082384", "0.69464403", "0.68842316", "0.6824607", "0.6776593", "0.6740323", "0.6728011", "0.6726", "0.6717261", "0.66275847", "0.66109735", "0.6601521", "0.6548771", "0.6537383", "0.6456581", "0.64270175", "0.64186084", "0.64101607", "0.6390343", "0.6390343", "0.6355995", "0.6342598", "0.62185144", "0.61527896", "0.614993", "0.61492056", "0.6135983", "0.61348194", "0.61334234", "0.61232865", "0.6122978", "0.6113874", "0.6095177", "0.6089523", "0.6089523", "0.60729736", "0.6064476", "0.6051831", "0.6036166", "0.6032384", "0.60306615", "0.6004483", "0.5992124", "0.598306", "0.5969403", "0.5962677", "0.59444994", "0.5943194", "0.5939878", "0.5932641", "0.592437", "0.5923293", "0.5922896", "0.5916488", "0.5910843", "0.59096706", "0.59093285", "0.58927256", "0.5883926", "0.5879971", "0.5876829", "0.58705837", "0.58527154", "0.5851645", "0.584639", "0.5831568", "0.5831144", "0.58303124", "0.5824766", "0.5824516", "0.5819944", "0.58191586", "0.5813334", "0.58072805", "0.5803987", "0.5800343", "0.57992834", "0.5798805", "0.5795253", "0.5793964", "0.57915354", "0.5786809", "0.5783329", "0.57832855", "0.57831717", "0.5775502", "0.57544506", "0.5736196", "0.57307315", "0.5730408", "0.5721477", "0.57180524", "0.57169616", "0.5699232", "0.56899935" ]
0.68763435
8
separates the master team into individual players for comaprison
private Vector<String> separateLineup(){ Vector<String> lineup = new Vector<String>(); StringTokenizer st = new StringTokenizer(masterLineup, ","); while(st.hasMoreTokens()){ lineup.add(st.nextToken().toLowerCase()); } return lineup; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void sendMessagetoRespectivePlayer(int num) {\n Message msg1;\n if(flag == \"player1\"){\n prevP1 = num;\n int newPositionGroup = num / 10;\n if(winningHoleGroup == newPositionGroup){\n msg1 = p1Handler.obtainMessage(3);\n }\n else if((winningHoleGroup == newPositionGroup-1) || (winningHoleGroup == newPositionGroup+1)){\n msg1 = p1Handler.obtainMessage(4);\n }\n else{\n msg1 = p1Handler.obtainMessage(5);\n }\n p1Handler.sendMessage(msg1);\n }\n else{\n prevP2 = num;\n int newPositionGroup = num / 10;\n if(winningHoleGroup == newPositionGroup){\n msg1 = p2Handler.obtainMessage(3);\n }\n else if((winningHoleGroup == newPositionGroup-1) || (winningHoleGroup == newPositionGroup+1)){\n msg1 = p2Handler.obtainMessage(4);\n }\n else{\n msg1 = p2Handler.obtainMessage(5);\n }\n p2Handler.sendMessage(msg1);\n }\n }", "public 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}", "protected abstract void gatherTeam();", "private void getPlayers() {\r\n\t\tSystem.out.println(\"How Many Players: \");\r\n\t\tpnum = getNumber(1, 3);\r\n\r\n\t\tfor(int i=0; i < pnum; i++){\r\n\t\t\tSystem.out.println(\"What is player \" + (i + 1) + \"'s name? \");\r\n\t\t\tString name = sc.next();\r\n\t\t\tboolean dupe = true;\r\n\t\t\twhile(dupe){\r\n\t\t\t\tint samecounter = 0;\r\n\t\t\t\tfor(Player p : players){\r\n\t\t\t\t\tif(name.equals(p.getName())){\r\n\t\t\t\t\t\tsamecounter += 1;\r\n\t\t\t\t\t\tSystem.out.println(\"Name is the same as another players. Please choose another name: \");\r\n\t\t\t\t\t\tname = sc.next();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(samecounter == 0){\r\n\t\t\t\t\tdupe = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tplayers.add(new Player(name));\r\n\r\n\t\t}\r\n\t}", "public BasketballPlayer getPlayer(String player){\n\t\tfor(int i=0; i<5; i++){\n\t\t\tif(player.equals(_homeTeam.getPlayer(i).getpname())){\n\t\t\t\treturn _homeTeam.getPlayer(i);\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<5; i++){\n\t\t\tif(player.equals(_awayTeam.getPlayer(i).getpname())){\n\t\t\t\treturn _awayTeam.getPlayer(i);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public List<Player> playMatch(List<Player> arrayListPlayers) {\n\n //instantiate Lists for winners / losers\n List<Player> winners = new ArrayList<>();\n List<Player> losers = new ArrayList<>();\n\n //Pairing up - each Player with the next Player, iterator runs for every 2\n for (int i = 0; i < arrayListPlayers.size(); i += 2) {\n\n System.out.println(arrayListPlayers.get(i).printName() + \" (\" + arrayListPlayers.get(i).score + \") vs \"\n + arrayListPlayers.get((i + 1) % arrayListPlayers.size()).printName() + \" (\" + arrayListPlayers.get(i + 1).score + \")\");\n\n //Extra layer of random scoring, so calculateScore is run with each round\n //Without this, players get an initial score that stay with them through the tournament\n arrayListPlayers.get(i).calculateScore();\n\n //Use score to decipher winner, if (i) score is greater than (i +1) score then add (i) to winners List\n if (arrayListPlayers.get(i).score > arrayListPlayers.get(i + 1).score) {\n winners.add(arrayListPlayers.get(i));\n }\n //And if (i) score is less than (i + 1) score add (i + 1) to winners List\n if (arrayListPlayers.get(i).score < arrayListPlayers.get(i + 1).score) {\n winners.add(arrayListPlayers.get(i + 1));\n\n\n //extra if statement to handle draws, if score is equal add player [0] to winners List, could randomise this?\n } else if\n (arrayListPlayers.get(i).score == arrayListPlayers.get(i + 1).score) {\n winners.add(arrayListPlayers.get(i));\n }\n\n /**\n * Additional if statements for adding Player objects to new List 'losers'\n */\n //Create List of losers (not output)\n if (arrayListPlayers.get(i).score < arrayListPlayers.get(i + 1).score) {\n winners.remove(arrayListPlayers.get(i));\n losers.add(arrayListPlayers.get(i));\n\n } else if (arrayListPlayers.get(i).score > arrayListPlayers.get(i + 1).score) {\n winners.remove(arrayListPlayers.get(i + 1));\n losers.add(arrayListPlayers.get(i + 1));\n }\n }\n\n /**\n * This section of the playRound method outputs the list of winners for each round\n * A sleep function was added in attempt to slow down the output\n */\n\n System.out.println(\"\\n-x-x-x-x-x-x-x W I N N E R S x-x-x-x-x-x-x-\\n\");\n //Loop through winners and attach names\n try {\n sleep(10);\n for (int i = 0; i < winners.size(); i++) {\n //SysOut to console the winners\n System.out.println(winners.get(i).printName() + \" won with \" + winners.get(i).score + \" points\");\n }\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n //Execution completed return winners List<>\n return winners;\n\n }", "public void startNewMatch() {\n // Limpia el score de cada jugador y los pone en no listo\n for (Player p : players) {\n p.resetScore();\n p.setReady(false);\n }\n }", "public void Players()\n\t{\n\t\tSystem.out.println(\"What team are you looking for?: \");\n\t\tSystem.out.println(\"1: Soccer\\n2: Basketball\\n3: Football\\n4: RETURN\");\n\t\tint choice1 = input.nextInt();\n\t\tswitch (choice1) {\n\t\t\n\t\tcase 1:\n\t\t\t\n\t\t\tString name = \"GB Soccer\";\n\t\t\tSelectTeam(name);\n\t\t\t\n\t\t\tSystem.out.println(\"\\nTo view player's full Bio, type Last Name\");\n\t\t\t\n\t\t\tScanner input = new Scanner(System.in);\n\t\t\tString Spname = input.nextLine();\n\t\t\tSelectPlayer(Spname);\n\t\t\tSystem.out.println(\"To return to teams list press 1, to exit press 2\");\n\t\t\tint choice2 = input.nextInt();\n\t\t\tswitch(choice2)\n\t\t\t{\n\t\t\tcase 1: Players(); break; case 2: System.exit(2); break;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Yet to be implemented\");\n\t\t\t\tbreak; \n\t\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tString name1 = \"GB Basketball\";\n\t\t\tSelectTeam(name1);\n\t\t\t\n\t\t\tSystem.out.println(\"\\nTo view player's full Bio, type Last Name\");\n\t\t\t\n\t\t\tScanner input1 = new Scanner(System.in);\n\t\t\tString Bpname = input1.nextLine();\n\t\t\tSelectPlayer(Bpname);\n\t\t\tSystem.out.println(\"To return to teams list press 1, to exit press 2\");\n\t\t\tint choice3 = input1.nextInt();\n\t\t\tswitch(choice3)\n\t\t\t{\n\t\t\tcase 1: Players(); break; case 2: System.exit(0); break;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Yet to be implemented\");\n\t\t\t\tbreak; \n\t\t\t\t}\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tString name2 = \"GB Football\";\n\t\t\tSelectTeam(name2);\n\t\t\t\n\t\t\tSystem.out.println(\"\\nTo view player's full Bio, type Last Name\");\n\t\t\t\n\t\t\tScanner input2 = new Scanner(System.in);\n\t\t\tString Fpname = input2.nextLine();\n\t\t\tSelectPlayer(Fpname);\n\t\t\tSystem.out.println(\"To return to teams list press 1, to exit press 2\");\n\t\t\tint choice4 = input2.nextInt();\n\t\t\tswitch(choice4)\n\t\t\t{\n\t\t\tcase 1: Players(); break; case 2: System.exit(0); break;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Yet to be implemented\");\n\t\t\t\tbreak; \n\t\t\t\t}\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tquestion();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.out.println(\"Yet to be implemented\");\n\t\t\tbreak;\n\t\t}\n\t\t\n\t}", "private static void divideDeck(int numPlayers) {\n\t\tint i = 0;\n\t\tfor (Card card : deck)\n\t\t{\n\t\t\tplayers.get(i % numPlayers).addCardToDeck(card);\n\t\t\ti++;\n\t\t}\n\t}", "public void startGame(){\n\n AgentAddress coordinatorAddressPre = getAgentWithRole(\"investment_game\", \"tout_le_monde\", \"coordinator\");\n\n if (coordinatorAddressPre==null){\n Coordinator coordinator = new Coordinator();\n\n launchAgent(coordinator);\n\n pause(1000);\n }\n\n Set<Player> players = new HashSet<Player>();\n Player primaryPlayer = null;\n\n //now launch all human player avatar agents, each of them will be initialized as agent having a GUI frame\n Iterator<GameSpecification.PlayerSpecification> playerSpecs = gameSpecification.getPlayerSpecifications().iterator();\n\n int launchedHumanPlayers = 0;\n\n while (playerSpecs.hasNext()){\n GameSpecification.PlayerSpecification spec = playerSpecs.next();\n\n if (spec instanceof GameSpecification.HumanPlayerSpecification){\n\n HumanPlayerAvatar humanPlayerAvatar = new HumanPlayerAvatar(spec.getName());\n\n launchAgent(humanPlayerAvatar,true);\n\n players.add(humanPlayerAvatar);\n\n launchedHumanPlayers++;\n\n if (null == primaryPlayer){\n primaryPlayer=humanPlayerAvatar;\n }\n\n }\n }\n\n //launch computer player agents. If no human players have been launched, the first computer player will display a GUI frame.\n playerSpecs = gameSpecification.getPlayerSpecifications().iterator();\n\n boolean first = true;\n\n while (playerSpecs.hasNext()){\n GameSpecification.PlayerSpecification spec = playerSpecs.next();\n\n if (spec instanceof GameSpecification.ComputerPlayerSpecification){\n\n ChooseAmountStrategy chooseAmountStrategy = ((GameSpecification.ComputerPlayerSpecification) spec).getChooseAmountStrategy();\n\n SelectOpponentStrategy selectOpponentStrategy = ((GameSpecification.ComputerPlayerSpecification) spec).getSelectOpponentStrategy();\n \n ComputerPlayer computerPlayer = new ComputerPlayer(spec.getName(),spec.getPictureFileName(), chooseAmountStrategy, selectOpponentStrategy);\n\n chooseAmountStrategy.setPlayer(computerPlayer);\n\n selectOpponentStrategy.setPlayer(computerPlayer);\n\n launchAgent(computerPlayer, launchedHumanPlayers == 0 && first);\n\n players.add(computerPlayer);\n\n if (null == primaryPlayer){\n primaryPlayer=computerPlayer;\n }\n\n first = false;\n\n }\n }\n\n //request new game from coordinator\n AgentAddress coordinatorAddress;\n\n while((coordinatorAddress = getAgentWithRole(\"investment_game\",\"tout_le_monde\",\"coordinator\"))==null){\n pause(750);\n }\n\n String requestGameSpec = \"<new_game> <for> \"+gameSpecification.getPlayerSpecifications().size()+\" <players> <having> \"+gameSpecification.getRounds()+\" <rounds> <invite> 0 <computer_players>\";\n\n ActMessage reply = (ActMessage)sendMessageWithRoleAndWaitForReply(coordinatorAddress,new ActMessage(\"request_game\",requestGameSpec),\"jeromes_assistant\");\n\n if (reply.getAction().equals(\"game_initialized\")){\n\n final String gameId = reply.getContent();\n\n //let players join the game\n Iterator<Player> playerIterator = players.iterator();\n\n while (playerIterator.hasNext()){\n\n final Player player = playerIterator.next();\n final boolean isPrimaryPlayer = player.equals(primaryPlayer);\n\n new Thread(){\n @Override\n public void run() {\n player.joinGame(gameId,isPrimaryPlayer,player.getPicturePath());\n }\n }.start();\n\n }\n }else{\n //TODO throw Exception\n }\n\n }", "void addTeam1Members() {\n\n String pname, pinit;\n String[] aname;\n for (int x = 0; x < team1Players; x++) {\n switch (x) {\n case 0:\n aname = spnPlayer1.getSelectedItem().toString().split(\"-\");\n pname = aname[0].trim();\n pinit = aname[1].trim();\n\n setTeam1PlayerNames(pname, x);\n sT1P1 = pname;\n\n setTeam1PlayerInit(pinit, x);\n\n break;\n case 1:\n aname = spnPlayer2.getSelectedItem().toString().split(\"-\");\n pname = aname[0].trim();\n pinit = aname[1].trim();\n\n setTeam1PlayerNames(pname, x);\n sT1P2 = pname;\n\n setTeam1PlayerInit(pinit, x);\n\n break;\n case 2:\n aname = spnPlayer3.getSelectedItem().toString().split(\"-\");\n pname = aname[0].trim();\n pinit = aname[1].trim();\n\n setTeam1PlayerNames(pname, x);\n sT1P3 = pname;\n\n setTeam1PlayerInit(pinit, x);\n break;\n case 3:\n aname = spnPlayer4.getSelectedItem().toString().split(\"-\");\n pname = aname[0].trim();\n pinit = aname[1].trim();\n\n setTeam1PlayerNames(pname, x);\n sT1P4 = pname;\n\n setTeam1PlayerInit(pinit, x);\n break;\n case 4:\n aname = spnPlayer5.getSelectedItem().toString().split(\"-\");\n pname = aname[0].trim();\n pinit = aname[1].trim();\n\n setTeam1PlayerNames(pname, x);\n sT1P5 = pname;\n\n setTeam1PlayerInit(pinit, x);\n break;\n case 5:\n aname = spnPlayer6.getSelectedItem().toString().split(\"-\");\n pname = aname[0].trim();\n pinit = aname[1].trim();\n\n setTeam1PlayerNames(pname, x);\n sT1P6 = pname;\n\n setTeam1PlayerInit(pinit, x);\n break;\n\n }\n\n }\n\n }", "private void setupPlayers() {\n\t\tuserData=(UserData) Main.currentStage.getUserData();\n\t\tnumberPlayers=userData.getNumberPlayers();\n\t\tplayerNames=userData.getPlayerNames();\n\t\tcurrentPlayer=userData.getFirstPlayer();\n\t\tlb_currentplayername.setText(playerNames[currentPlayer]);\n\t\tplayers =new Player[4];\n\t\tfor(int i=0;i<4;i++) {\n\t\t\tif(i<numberPlayers) {\n\t\t\t\tplayers[i]=new Player(playerNames[i], false, i) {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void rollDices() {\n\t\t\t\t\t\trotatedDice1();\n\t\t\t\t\t\trotatedDice2();\n\t\t\t\t\t\t//waiting for player choose what way to go then handler that choice\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t\telse {\n\t\t\t\tplayers[i]=new Player(playerNames[i], true, i) {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void rollDices() {\n\t\t\t\t\t\trotatedDice1();\n\t\t\t\t\t\trotatedDice2();\n\t\t\t\t\t\t//randomchoice and next player rolldice\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t\tswitch (i) {\n\t\t\t\tcase 0:{\n\t\t\t\t\tplayers[i].setHorseColor(yh0, yh1, yh2, yh3);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 1:{\n\t\t\t\t\tplayers[i].setHorseColor(bh0, bh1, bh2, bh3);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 2:{\n\t\t\t\t\tplayers[i].setHorseColor(rh0, rh1, rh2, rh3);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 3:{\n\t\t\t\t\tplayers[i].setHorseColor(gh0, gh1, gh2, gh3);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "private void switchPlayer(Player opponentPlayer, Match match) {\r\n if(opponentPlayer.getPlayerId().equals(match.getPlayer1().getPlayerId())){\r\n setCurrentPlayer(match, 1);\r\n } else if (opponentPlayer.getPlayerId().equals(match.getPlayer2().getPlayerId())){\r\n setCurrentPlayer(match, 2);\r\n } else {\r\n LOGGER.error(\"Player not found\");\r\n }\r\n }", "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 void selectAttackerPlayer(Player[] players){\n int x,xTemp;\n Player playerSelected;\n if( team == 0){\n xTemp = 0;\n for(Player p : players ){\n x = (int) p.getPosition().getX();\n if( x > xTemp ){\n xTemp = x;\n playerSelected = p;\n }\n }\n playerOne = playerSelected;\n }else{\n xTemp = 14;\n for(Player p : players ){\n x = (int) p.getPosition().getX();\n if( x < xTemp ){\n xTemp = x;\n playerSelected = p;\n }\n }\n playerOne = playerSelected;\n }\n }", "private GameDTO alignPlayers(IGame game, GameDTO dto) {\n\n if (game.getPlayer1().getId() == dto.getPlayer1Id()\n && game.getPlayer2().getId() == dto.getPlayer2Id()) {\n return dto;\n }\n\n GameDTO alignedDTO = new GameDTO(dto);\n // vice versa\n alignedDTO.setPlayer1Id(dto.getPlayer2Id());\n alignedDTO.setPlayer1Name(dto.getPlayer2Name());\n alignedDTO.setPlayer2Id(dto.getPlayer1Id());\n alignedDTO.setPlayer2Name(dto.getPlayer1Name());\n // align set list\n ArrayList<GameSetDTO> alignedSets = new ArrayList<>();\n for (GameSetDTO set : dto.getSets()) {\n logger.debug(\"Unaligned set: \" + set);\n // vice versa\n // we have to set any winner to null\n GameSetDTO alignedSet = new GameSetDTO(set.getId(),\n set.getGameId(), 0, set.getPlayer2Score(),\n set.getPlayer1Score(), null, set.getNumber());\n logger.debug(\"Aligned set: \" + alignedSet);\n\n alignedSets.add(alignedSet);\n }\n\n alignedDTO.setSets(alignedSets);\n logger.debug(\"Aligned DTO: \" + alignedDTO);\n\n return alignedDTO;\n }", "Match getTeam1LooserOfMatch();", "public void divideDomain(){\n \tfor (int i = 0 ; i < getBoardSize() ; i++)\n \t\tfor (int j = 0 ; j < getBoardSize() ; j++){\n\t\t\tgetPoint(i, j).setHolder(GoPlayer.UNKNOWN);\n\t\t}\n\n \t\tfor (int i = 0 ; i < getBoardSize() ; i++)\n \t\tfor (int j = 0 ; j < getBoardSize() ; j++){\n if (getPoint(i, j).getHolder() == GoPlayer.UNKNOWN){\n \tif (getPoint(i, j).getState() == GoPoint.BLACK){\n getPoint(i, j).setHolder(GoPlayer.BLACK);\n \t}\n \telse if (getPoint(i, j).getState() == GoPoint.WHITE){\n getPoint(i, j).setHolder(GoPlayer.WHITE);\n \t}\n \telse {\n \t\tVector v = getBody(i,j);\n \t\tfindSpaceHolder(v);\n \t}\n }\n\t\t}\n }", "private void addPlayerToGroup(Scoreboard board, Player player) {\n String playername = player.getName();\n board.registerNewTeam(playername);\n board.getTeam(playername).addPlayer(player);\n }", "public void setUpPlayers(){\n\t\tTreeMap<String,Integer> turnsDetails = new TreeMap<>();\n\t\tint e = 0;\n\t\tfor(Player i : allplayers) {\n\t\t\ti.fillHand();\n\t\t\tturnsDetails.put(i.getFirstLetter()+String.valueOf(e),e);\n\t\t\te++;\n\t\t}\n\t\t// populate the turn list\n //entryset returns a set view of mappings contained\n\t\tfor(Map.Entry<String,Integer> i : turnsDetails.entrySet())\n\t\t\tturns.add(i.getValue());\n\t}", "private void createPlayers() {\n // create human player first\n Player human = new Player(\"Player 1\", true);\n players.add(human);\n \n // create remaining AI Players\n for (int i = 0; i < numAIPlayers; i++) {\n Player AI = new Player(\"AI \" + (i + 1), false);\n players.add(AI);\n }\n }", "private void eliminatePlayers() {\n \n Iterator<Player> iter = players.iterator();\n\n while (iter.hasNext()) {\n Player player = iter.next();\n\n if (player.getList().isEmpty()) {\n iter.remove();\n if (player.getIsHuman()) {\n setGameState(GameState.HUMAN_OUT);\n }\n // need to remember that due to successive draws, the active player could run\n // out of cards\n // select a new random player if player gets eliminated\n if (!players.contains(activePlayer)) {\n selectRandomPlayer();\n }\n }\n }\n }", "public static void addPlayer(League theLeague, Team theTeam, Scanner keyboard) {\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"---Add Player---\");\r\n\t\ttheTeam.teamToString();\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"--Top 20 Free Agents--\");\r\n\t\ttheLeague.getFreeAgents(20);\r\n\r\n\t\tint playerChoice;\r\n\t\tdo {\r\n\t\t\tdo {\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t\tSystem.out.println(\" 0 - Filter Free Agents by Position\");\r\n\t\t\t\tSystem.out.println(\" -1 - View All Free Agents\");\r\n\t\t\t\tSystem.out.println(\"1-\" + theLeague.playerList().size() + \" - Select a Player\");\r\n\t\t\t\tplayerChoice = Input.validInt(-1, theLeague.playerList().size(), keyboard);\r\n\t\t\t\t\r\n\t\t\t\tif (playerChoice == -1) {\r\n\t\t\t\t\ttheLeague.getFreeAgents();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (playerChoice == 0) {\r\n\t\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t\t\tSystem.out.println(\"Which position would you like to view?\");\r\n\t\t\t\t\tSystem.out.println(\"1 - QB\");\r\n\t\t\t\t\tSystem.out.println(\"2 - WR\");\r\n\t\t\t\t\tSystem.out.println(\"3 - RB\");\r\n\t\t\t\t\tSystem.out.println(\"4 - TE\");\r\n\t\t\t\t\tswitch (Input.validInt(1, 4, keyboard)) {\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\tSystem.out.println(\"\\n--Top 20 Free Agent QBs--\\n\");\r\n\t\t\t\t\t\ttheLeague.getFreeAgents(20, \"QB\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\tSystem.out.println(\"\\n--Top 20 Free Agent WRs--\\n\");\r\n\t\t\t\t\t\ttheLeague.getFreeAgents(20, \"WR\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\tSystem.out.println(\"\\n--Top 20 Free Agent RBs--\\n\");\r\n\t\t\t\t\t\ttheLeague.getFreeAgents(20, \"RB\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 4:\r\n\t\t\t\t\t\tSystem.out.println(\"\\n--Top 20 Free Agent TEs--\\n\");\r\n\t\t\t\t\t\ttheLeague.getFreeAgents(20, \"TE\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\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} while (playerChoice < 1);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif (theLeague.playerList().get(playerChoice - 1).getIsOwned()) {\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t\tSystem.out.println(theLeague.playerList().get(playerChoice - 1).playerToString() + \" is not available\");\r\n\t\t\t}\r\n\t\t} while (theLeague.playerList().get(playerChoice - 1).getIsOwned());\r\n\r\n\t\tPlayer thePlayer = theLeague.playerList().get(playerChoice - 1);\r\n\t\tthePlayer.setIsOwned();\r\n\t\ttheTeam.getRoster().add(thePlayer);\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"***\" + theTeam.getManagerName() + \" has added \" + thePlayer.playerToString() + \"***\");\r\n\t}", "private void loadPlayers() {\r\n this.passive_players.clear();\r\n this.clearRoster();\r\n //Map which holds the active and passive players' list\r\n Map<Boolean, List<PlayerFX>> m = ServiceHandler.getInstance().getDbService().getPlayersOfTeam(this.team.getID())\r\n .stream().map(PlayerFX::new)\r\n .collect(Collectors.partitioningBy(x -> x.isActive()));\r\n this.passive_players.addAll(m.get(false));\r\n m.get(true).stream().forEach(E -> {\r\n //System.out.println(\"positioning \"+E.toString());\r\n PlayerRosterPosition pos = this.getPlayerPosition(E.getCapnum());\r\n if (pos != null) {\r\n pos.setPlayer(E);\r\n }\r\n });\r\n }", "public List<Player> lookForShootPeople(Player player)\n {\n List<Player> playerList = new LinkedList<>();\n\n playerList.addAll(player.getSquare().getRoom().getPlayerRoomList()); //adds all the players in the room\n\n /*\n * Now i have to check if the player is close to a door. In this case i can see all the players in this adiacent room.\n * I will implement the method in this way:\n * 1. I check if the player can move to a different room with a distance 1 using the method squareReachableNoWall\n * 2. If the player can effectively move to a different room it means it is close to a door\n * 3. I will add to the list all the players in this different room\n */\n\n for (Square square : player.getSquare().getGameBoard().getArena().squareReachableNoWall(player.getSquare().getX(), player.getSquare().getY(), 1))\n {\n if (!(player.getSquare().getColor().equals(square.getColor()))) // if the color of the reachable square is different from the color of the square\n // where the player is this means player can see in a different room\n {\n playerList.addAll(player.getSquare().getRoom().getPlayerRoomList()); //adds all the players in the room\n }\n\n }\n\n Set<Player> playerSet = new HashSet<>();\n playerSet.addAll(playerList);\n\n playerList.clear();\n\n playerList.addAll(playerSet);\n playerList.remove(player);\n\n\n return playerList;\n }", "public static ArrayList<Match> generateMatch(String season){\n LeagueManager premierLeagueManagerService = PremierLeagueManager.getInstance();\n int numberOfClubsPresent = PremierLeagueManager.getPremierLeagueFootballClubList().size();\n\n // This condition is to make sure that there is at least 2 clubs to play a match\n if(numberOfClubsPresent > 1){\n\n // there 2 or more clubs present so we can generate a match\n // loading the data from the file\n PremierLeagueManager.loadingData();\n\n // getting the clubs with the filtered matches by season\n guiSeasonFilteredClubs = getGuiSeasonFilteredClubs(season);\n\n Random random = new Random();\n\n // step 01: randomly select 2 clubs\n int randomClub_01 = random.nextInt(guiSeasonFilteredClubs.size());\n FootballClub selectedClub_O1 = guiSeasonFilteredClubs.get(randomClub_01);\n int randomClub_02 = random.nextInt(guiSeasonFilteredClubs.size());\n\n // This is to make sure that the same club is not selected again for the match\n while (randomClub_02==randomClub_01){\n randomClub_02 = random.nextInt(guiSeasonFilteredClubs.size());\n }\n FootballClub selectedClub_O2 = guiSeasonFilteredClubs.get(randomClub_02);\n\n // step 02: randomly generate the necessary data\n int numberGoalScored_club_1 = random.nextInt(7);\n int numberGoalScored_club_2 = random.nextInt(7);\n\n // setting the random date and random season depending on the randomly selected year\n int[] possibleYears = new int[2];\n\n int seasonYear = Integer.parseInt(season.split(\"-\")[0]);\n\n possibleYears[0] = seasonYear;\n possibleYears[1] = seasonYear + 1;\n\n // making sure that the months are in given range for the year select for the season\n // premier league happens every year from August to next May\n int day = random.nextInt(30)+1;\n int randomYearIndexSelected = random.nextInt(2);\n int year = possibleYears[randomYearIndexSelected];\n int month;\n\n // if randomYearIndexSelected = 0, then the months have to be in the range from 8 to 12 else 1 to 5\n if(randomYearIndexSelected==0){\n // 8 to 12\n month = random.nextInt(5) + 8;\n\n }else{\n // 1 to 5\n month = random.nextInt(5) + 1;\n\n }\n\n DateMatch date = new DateMatch(day, month, year);\n String[] matchTypes = new String[]{\"Home\", \"Away\"};\n String matchType = matchTypes[random.nextInt(2)];\n\n // step 03: call the addPlayedMatch() wisely by passing all the generated random data\n premierLeagueManagerService.addPlayedMatch(season,selectedClub_O1.getName(), selectedClub_O2.getName(),\n numberGoalScored_club_1, numberGoalScored_club_2, date, matchType);\n\n // step 04: call the save file method\n premierLeagueManagerService.saveDataIntoFile();\n\n // step 05: call the load file method\n PremierLeagueManager.loadingData();\n\n // getting the clubs with the filtered matches by season\n guiSeasonFilteredClubs = getGuiSeasonFilteredClubs(season);\n\n // getting the matches for a season and returning\n return getMatchesForSeason(guiSeasonFilteredClubs);\n }\n // if there are less than 2 clubs we can't generate a match\n return null;\n }", "public void run() {\r\n for(int i = group; i < 64; i += 4) {\r\n if(!m_teams[i].isOut()) {\r\n setSurvivingTeam(m_teams[i]);\r\n return;\r\n }\r\n }\r\n\r\n m_botAction.sendArenaMessage(\"No one won for Base \" + (group + 1));\r\n }", "void addEventPlayers(Player player, boolean team);", "public void selectProtectPlayer(Player[] players){\n int x,xTemp;\n Player playerSelected;\n if( team == 0){\n xTemp = 0;\n for(Player p : players ){\n x = (int) p.getPosition().getX();\n if( x > xTemp && p != playerOne ){\n xTemp = x;\n playerSelected = p;\n }\n }\n playerOne = playerSelected;\n }else{\n xTemp = 14;\n for(Player p : players ){\n x = (int) p.getPosition().getX();\n if( x < xTemp && p != playerOne ){\n xTemp = x;\n playerSelected = p;\n }\n }\n playerOne = playerSelected;\n }\n }", "public void processPlayerCollision(ArrayList<Player> players) {\n for(Player p : players) {\n boolean collided = collision.generalCollision(this, p); //Test for general collision\n if(collided) //if general collision occurs\n {\n int collisionY = collision.testCollisionY(this, p); //change collision state for y axis\n int cornerCollision = collision.testCornerCollision(this, p);\n\n if(collisionY == Collision.COLLISION_TOP || cornerCollision == Collision.TOP_CORNERS) {\n if(p.getState() != DYING_STATE && getState() != DESTROYED_STATE) {\n setState(KOOPA_STUNNED);\n setVelocityX(0f);\n hitCounter++;\n shelled = true;\n if(pointsCollected == false) {\n game.scoreBoard.addScorePoints(100);\n pointsCollected = true;\n }\n }\n }\n else {\n if(getState() != DYING_STATE && getState() != DESTROYED_STATE && getState() != KOOPA_STUNNED && shelled == false && hitCounter == 0) //if enemy isn't dying or dead, kill player\n p.die();\n }\n }\n }\n }", "private void gameStart() {\n\tready.clear();\r\n\r\n\tplayers = new TreeBidiMap<>();\r\n\tmafia = new ArrayList<>();\r\n\tinnocentIDs = new ArrayList<>();\r\n\r\n\tfor (int i = 0; i < votedStart.size(); i++) {\r\n\t int id = votedStart.get(i);\r\n\t // playerIDs.add(id);\r\n\t players.put(id, server.getUsername(id));\r\n\r\n\t}\r\n\r\n\tint numMafia = (int) Math.round((double) votedStart.size() / 3);\r\n\tmafiaAtStart = new String[numMafia];\r\n\r\n\tfor (int j = 0; j < numMafia; j++) {\r\n\t // int index = mafiaPicker.nextInt(votedStart.size());\r\n\t int index = ThreadLocalRandom.current().nextInt(votedStart.size());\r\n\t int id = votedStart.get(index);\r\n\r\n\t mafia.add(id);\r\n\t mafiaAtStart[j] = server.getUsername(id);\r\n\t votedStart.remove(index);\r\n\t}\r\n\r\n\tfor (int k = 0; k < votedStart.size(); k++) {\r\n\r\n\t int id = votedStart.get(k);\r\n\r\n\t innocentIDs.add(id);\r\n\t}\r\n\r\n\tvotedStart.clear();\r\n\r\n\tint[] innocentIDArray = innocentIDs.stream().mapToInt(i -> i).toArray();\r\n\tserver.privateMessage(\"you are an innocent\", innocentIDArray);\r\n\r\n\tint[] mafiaIDArray = innocentIDs.stream().mapToInt(i -> i).toArray();\r\n\tString[] mafiaNameArray = new String[mafiaIDArray.length];\r\n\r\n\tfor (int l = 0; l < mafiaIDArray.length; l++) {\r\n\t mafiaNameArray[l] = server.getUsername(mafiaIDArray[l]);\r\n\t}\r\n\r\n\t// currently uses the default toSting method for array. Also i think it\r\n\t// will display the id numbers rather than the players names - need to\r\n\t// convert if so would be good to only show only the other mafia members\r\n\t// rather than including the players own name in the list\r\n\tserver.privateMessage(\"you are one of the mafia, the mafia members (including \" + \"you) are \" + mafiaIDArray,\r\n\t\tmafiaIDArray);\r\n\r\n\tday = true;\r\n\tgameInProgress = true;\r\n }", "@Test\n void testNextPlayerWhenPlayerHas2Clubs() {\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n \n ArrayList<Card> clubCards;\n clubCards = new ArrayList <Card>();\n\n for (Rank rank : Rank.values()) {\n clubCards.add(new Card(Suit.CLUBS, rank, true));\n }\n \n testDealer.getUser().fillHandCards(clubCards);\n testDealer.setPlayerStarter(); \n testDealer.getTrickPlayer();\n assertEquals(testDealer.getBotA().getId(), testDealer.getNextPlayer());\n }", "private void computePresentPleyers() {\n\t\tthis.presentPlayerKeys = new ArrayList<>();\n\t\tList<ChesspairingPlayer> players = mTournament.getPlayers();\n\t\tfor (ChesspairingPlayer player : players) {\n\t\t\tif (player.isPresent()) {\n\t\t\t\tthis.presentPlayerKeys.add(player.getPlayerKey());\n\t\t\t}\n\t\t}\n\t}", "private void assignCards(Pile wholeDeck, Player[] players) {\n ArrayList<Pile> setOfDecks = wholeDeck.split(players.length);\n for (int i = 0; i < players.length; i++) {\n Player player = players[i];\n Pile playerDeck = setOfDecks.get(i);\n player.addToDeck(playerDeck);\n\n // --- DEBUG LOG ---\n // The contents of the user’s deck and the computer’s deck(s) once they have been\n // allocated.\n String isAILabel = player instanceof AIPlayer ? \"AI\" : \"USER\";\n Logger.log(String.format(\"(%s) %s's DECK AFTER ALLOCATION:\", isAILabel, player),\n playerDeck.toString());\n\n }\n communalPile = setOfDecks.get(players.length);\n\n // --- DEBUG LOG ---\n // Initial communal deck contents.\n Logger.log(\"INITIAL COMMUNAL DECK CONTENTS\", communalPile.toString());\n }", "PlayerGroup createPlayerGroup();", "@Test\n void testBotBIsNextPlayerWhenBotAHas2Clubs() {\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n \n ArrayList<Card> clubCards;\n clubCards = new ArrayList <Card>();\n\n for (Rank rank : Rank.values()) {\n clubCards.add(new Card(Suit.CLUBS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(clubCards);\n testDealer.setPlayerStarter(); //botA is nextPlayer\n testDealer.getTrickPlayer();\n assertEquals(testDealer.getBotB().getId(), testDealer.getNextPlayer());\n }", "private void createPlayers() {\n\tGlobal.camera_player1 = new Camera(new OrthographicCamera());\n\tGlobal.camera_player2 = new Camera(new OrthographicCamera());\n\tGlobal.camera_ui = new OrthographicCamera();\n\tGlobal.player1 = new Plane(Global.player1_respawn.x,\n\t\tGlobal.player1_respawn.y, 0, new Planetype(PlaneTypes.F35),\n\t\tEntityType.PLAYER1);\n\tGlobal.player2 = new Plane(Global.player2_respawn.x,\n\t\tGlobal.player2_respawn.y, 0, new Planetype(PlaneTypes.F35),\n\t\tEntityType.PLAYER2);\n }", "private void addPlayers(@NotNull MapHandler map, @NotNull NewGameDto newGameDto) {\n ComparableTuple<Integer, Stack<SpawnTile>> result = analyseMap(map);\n flagCount = result.key;\n Stack<SpawnTile> spawnTiles = result.value;\n if (!spawnTiles.isEmpty()) {\n for (PlayerDto player : newGameDto.players) {\n SpawnTile spawnTile = spawnTiles.pop();\n if (player.id == newGameDto.userId) {\n user = new Player(spawnTile.getX(), spawnTile.getY(), Direction.NORTH, map, new ComparableTuple<>(GameGraphics.mainPlayerName + \" (you)\", player.color), player.id);\n user.setDock(spawnTile.getSpawnNumber());\n players.add(user);\n } else {\n IPlayer onlinePlayer = new OnlinePlayer(spawnTile.getX(), spawnTile.getY(), Direction.NORTH, map, new ComparableTuple<>(player.name, player.color), player.id);\n onlinePlayer.setDock(spawnTile.getSpawnNumber());\n players.add(onlinePlayer);\n }\n }\n } else {\n for (int i = 0; i < playerCount; i++) {\n NonPlayer nonPlayer = new NonPlayer(i, 0, Direction.NORTH, map, new ComparableTuple<>(\"blue\", Color.BLUE));\n nonPlayer.setDock(i);\n players.add(nonPlayer);\n }\n }\n }", "public void selectCloserPlayer(Player[] players){\n Point ball = this.engine.getGameInformation().getBallPosition();\n int diff = 100;\n for ( Player p : players ){\n if( playerOne == null ){\n int resTemp = p.getPosition().getX()-ball.getX() + p.getPosition().getY()-ball.getY() - move;\n if (resTemp < 0 ) resTemp = -resTemp;\n resTemp = resTemp - this.getGameInformation().cells[p.getPosition().getX()][p.getPosition().getY()].playerMoves;\n if ( resTemp < diff ){\n diff = resTemp;\n playerOne = p;\n }\n }else if (p != playerOne){\n int resTemp = (int) p.getPosition().getX()-ball.getX() + p.getPosition().getY()-ball.getY() - move;\n if (resTemp < 0 ) resTemp = -resTemp;\n resTemp = resTemp - this.getGameInformation().cells[(int) p.getPosition().getX()][(int) p.getPosition().getY()].playerMoves;\n if ( resTemp < diff ){\n diff = resTemp;\n playerTwo = p;\n }\n }\n \n }\n }", "void setVisiblePlayers() {\n\n switch (team1Players) {\n\n case 6:\n\n tvt1p6.setVisibility(View.VISIBLE);\n\n spnPlayer6.setVisibility(View.VISIBLE);\n\n case 5:\n\n tvt1p5.setVisibility(View.VISIBLE);\n\n spnPlayer5.setVisibility(View.VISIBLE);\n\n case 4:\n\n tvt1p4.setVisibility(View.VISIBLE);\n\n spnPlayer4.setVisibility(View.VISIBLE);\n\n case 3:\n\n tvt1p3.setVisibility(View.VISIBLE);\n\n spnPlayer3.setVisibility(View.VISIBLE);\n\n case 2:\n\n tvt1p2.setVisibility(View.VISIBLE);\n\n spnPlayer2.setVisibility(View.VISIBLE);\n\n case 1:\n\n tvt1p1.setVisibility(View.VISIBLE);\n\n spnPlayer1.setVisibility(View.VISIBLE);\n\n break;\n\n }\n\n }", "private void moveTheCardsTotheWinner(int winPlayer,Player tempPlayer)\n {\n for(int i=0;i<tempPlayer.getLastIndex();i++)\n if(winPlayer == 1)\n FirstPlayer.addCardToBegining(tempPlayer.removeTheCard());\n else if (winPlayer == 2) \n SecondPlayer.addCardToBegining(tempPlayer.removeTheCard()); \n }", "public void assignAndStartInitialProjects() {\n\t\tfor(Player p:players) {\n\t\t\tSubproject sp=drawProject();\n\t\t\tSubprojectField result=sp.setChip(p.removeChip());\n\t\t\tp.raiseScore(result.getAmountSZT());\n\t\t}\n\t}", "@Test\n void testUserIsNextPlayerWhenBotCHas2Clubs() {\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n \n ArrayList<Card> clubCards;\n clubCards = new ArrayList <Card>();\n\n for (Rank rank : Rank.values()) {\n clubCards.add(new Card(Suit.CLUBS, rank, true));\n }\n \n testDealer.getBotC().fillHandCards(clubCards);\n testDealer.setPlayerStarter(); \n testDealer.getTrickPlayer();\n assertEquals(testDealer.getUser().getId(), testDealer.getNextPlayer());\n }", "private Point move(Point[] players, int[] chat_ids, Point self)\n\t{\n\t\t//Move to a new position within the room anywhere within 6 meters of your current position. Any conversation you were previously engaged in is terminated: you have to be stationary to chat.\n\t\t//Initiate a conversation with somebody who is standing at a distance between 0.5 meters and 2 meters of you. In this case you do not move. You can only initiate a conversation with somebody on the next turn if they and you are both not currently engaged in a conversation with somebody else. \t\n\t\tint i = 0, target = 0;\n\t\twhile (players[i].id != self_id) i++;\n\t\t//look through players who are within 6 meters => Point[] players\n\t\tPoint p = self;\n for (target = 0; target<players.length; ++target) {\n\t\t\t//if we do not contain any information on them, they are our target => W[]\n\t\t\tif (W[p.id] != -1 || p.id == self.id) continue;\n p = players[target];\n }\n if (p.equals(self)) {\n for (target = 0; target < players.length; ++target) {\n if (W[p.id] == 0 || p.id == self.id) continue;\n p = players[target];\n }\n }\n if (!p.equals(self)) {\n\t\t\t// compute squared distance\n\t\t\tdouble dx1 = self.x - p.x;\n\t\t\tdouble dy1 = self.y - p.y;\n\t\t\tdouble dd1 = dx1 * dx1 + dy1 * dy1;\n\t\t\t//check if they are engaged in conversations with someone\n\t\t\tint chatter = 0;\n\t\t\twhile (chatter<players.length && players[chatter].id != chat_ids[target]) chatter++;\n\n\t\t\t//check if they are engaged in conversations with someone and whether that person is in our vicinity\n\t\t\tif(chat_ids[target]!=p.id && chatter!=players.length)\n\t\t\t{\n\t\t\t\t//if they are, we want to stand in front of them, .5 meters in the direction of who they're conversing with => check if result is within 6meters\n\t\t\t\tPoint other = players[chatter];\n\t\t\t\tdouble dx2 = self.x - other.x;\n\t\t\t\tdouble dy2 = self.y - other.y;\n\t\t\t\tdouble dd2 = dx2 * dx2 + dy2 * dy2;\n\n\t\t\t\tdouble dx3 = dx2-dx1;\n\t\t\t\tdouble dy3 = dy2-dy1;\n\t\t\t\tdouble dd3 = Math.sqrt(dx3 * dx3 + dy3 * dy3);\n\n\t\t\t\tdouble dx4 = (dx2 - 0.5*(dx3/dd3)) * -1;\n\t\t\t\tdouble dy4 = (dy2 - 0.5*(dy3/dd3)) * -1;\n\t\t\t\tdouble dd4 = dx4 * dx4 + dy4 * dy4;\n\n\t\t\t\tif (dd4 <= 2.0)\n\t\t\t\t\treturn new Point(dx4, dy4, self.id);\n }\n\t\t\t//if not chatting to someone or don't know position of chatter, just get as close to them as possible\n\t\t\telse return new Point((dx1-0.5*(dx1/dd1)) * -1, (dy1-0.5*(dy1/dd1)) * -1, self.id);\t\t\t\t\n\t\t}\n\n\t\t\tdouble dir = random.nextDouble() * 2 * Math.PI;\n\t\t\tdouble dx = 6 * Math.cos(dir);\n\t\t\tdouble dy = 6 * Math.sin(dir);\n\t\t\treturn new Point(dx, dy, self_id);\n\t}", "@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 }", "Match getTeam2LooserOfMatch();", "public static void initial()\n\t{\n\t\tscoreteam1 = 0; scoreteam2 = 0;\n\t\tdelayed = 0;\n\t\tplayers = new Player[5];\n\t\tfor (int i = 0; i < 5; i++) \n\t\t{\n\t\t\tplayers[i] = new Player();\n\t\t}\n\n\t\t// finding how many players there are (2, 3, or 4) and initializing status\n\t\tplayerNum = 0;\n\t\tfor (int i = 0; i < 5; i++)\n\t\t{\n\t\t\tif (Selection.exist[i])\n\t\t\t{\n\t\t\t\tplayerNum++;\n\t\t\t}\n\t\t\tplayers[i].exist = Selection.exist[i]; \n\t\t\tplayers[i].ai = Selection.ai[i];\n\t\t\tplayers[i].name = Selection.name[i];\t\t \n\t\t}\n\n\n\t\tplayers[3].keyDown = KeyEvent.VK_SEMICOLON;\n\t\tplayers[3].keyLeft = KeyEvent.VK_L;\n\t\tplayers[3].keyRight = KeyEvent.VK_QUOTE;\n\t\tplayers[3].keyUp = KeyEvent.VK_P;\n\t\tplayers[2].keyDown = KeyEvent.VK_H;\n\t\tplayers[2].keyLeft = KeyEvent.VK_G;\n\t\tplayers[2].keyRight = KeyEvent.VK_J;\n\t\tplayers[2].keyUp = KeyEvent.VK_Y;\n\t\tplayers[1].keyDown = KeyEvent.VK_S;\n\t\tplayers[1].keyLeft = KeyEvent.VK_A;\n\t\tplayers[1].keyRight = KeyEvent.VK_D;\n\t\tplayers[1].keyUp = KeyEvent.VK_W;\n\t\tplayers[4].keyDown = KeyEvent.VK_DOWN;\n\t\tplayers[4].keyLeft = KeyEvent.VK_LEFT;\n\t\tplayers[4].keyRight = KeyEvent.VK_RIGHT;\n\t\tplayers[4].keyUp = KeyEvent.VK_UP;\n\t\tplayers[1].color = Color.red;\n\t\tplayers[3].color = Color.green;\n\n\t\tif (Selection.team)\n\t\t{\n\t\t\tplayers[2].color = Color.red;\n\t\t\tplayers[4].color = Color.green;\n\t\t} \n\t\telse\n\t\t{\n\t\t\tplayers[2].color = Color.blue;\n\t\t\tplayers[4].color = Color.yellow;\n\t\t}\n\n\t}", "public void createPlayers() {\n\t\t\n\t\twhite = new Player(Color.WHITE);\n\t\twhite.initilizePieces();\n\t\tcurrentTurn = white;\n\t\t\n\t\tblack = new Player(Color.BLACK);\n\t\tblack.initilizePieces();\n\t}", "public static void createPlayers() {\n\t\tcomputer1 = new ComputerSpeler();\n\t\tspeler = new PersoonSpeler();\n//\t\tif (Main.getNumberOfPlayers() >= 3) { \n//\t\t\tSpeler computer2 = new ComputerSpeler();\n//\t\t}\n//\t\tif (Main.getNumberOfPlayers() == 4) {\n//\t\t\tSpeler computer3 = new ComputerSpeler();\n//\t\t}\n\n\n\t}", "private PlayerModel getPlayerModel(boolean isMaster) {\n PlayerModel playerModel = new PlayerModel();\n if(isMaster) {\n playerModel.setName(mGameWaitModel.getGameMaster());\n } else {\n playerModel.setName(mGameWaitModel.getGameSlave());\n }\n playerModel.setScore(0);\n return playerModel;\n }", "protected abstract void assignTeam(boolean playerR, boolean playerB);", "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}", "private void startMultiPlayerGame() {\n Intent intent = Games.RealTimeMultiplayer.getSelectOpponentsIntent(getApiClient(), 1, 1);\n startActivityForResult(intent, RC_SELECT_PLAYERS);\n }", "public void switchPlayer(){\n // Menukar giliran player dalam bermain\n Player temp = this.currentPlayer;\n this.currentPlayer = this.oppositePlayer;\n this.oppositePlayer = temp;\n }", "public abstract PlayerMove toPlayerMove(Player player, Match match);", "public Bot startGame(){\n\t\t\n\t\ttable.addObserver(this); //to keep scores.\n\t\ttable.addObserver(players.get(0)); //observer pattern to notify players via events.\n\t\ttable.addObserver(players.get(1));\n\t\ttable.addObserver(players.get(2));\n\t\ttable.addObserver(players.get(3));\n\t\t\n\t\ttable.putInitialCards(deck.getFourCards());\n\t\t\n\t\twhile(!deck.isEmpty()){\n\t\t\t//deal cards\n\t\t\tfor(Bot bot : players){\n\t\t\t\tbot.setHand(deck.getFourCards());\n\t\t\t}\n\t\t\t\n\t\t\t//start playing\n\t\t\tfor(int i = 0 ; i < 4 ; i++){\n\t\t\t\tfor(Bot bot : players){\n\t\t\t\t\tcurrentPlayer = bot;\n\t\t\t\t\tCard cardToThrow = currentPlayer.throwACard();\n//\t\t\t\t\tSystem.out.println(\"Bot \"+ currentPlayer.toString() + \" threw \" + cardToThrow.toString());\n\t\t\t\t\ttable.putOnPile(cardToThrow);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//award last pile winner\n\t\tplayers.get(lastWinnerId).addPoints(Table.calculatePoints(table.getCardsOnPile()));\n\t\tplayers.get(lastWinnerId).addWonCards(table.getCardsOnPile().size());\n//\t\tSystem.out.println(\"Last pile goes to [\"+players.get(lastWinnerId).toString()+\"]\");\n\t\ttable.clearPile();\n\t\t\n\t\t\n\t\t//award most card winner\n\t\tCollections.sort(players, new CompareByWonCardSize()); // sort players by most cards won.\n\t\tplayers.get(3).addPoints(3); // last one has most cards.\n//\t\tSystem.out.println(\"The bot [\"+players.get(3).toString()+\"] won the most cards so it gets bonus 3 points!\");\n\t\t\t\t\n//\t\tSystem.out.println(\"### SCORES ###\");\n\t\tCollections.sort(players, new CompareByPoints()); // sort by points\n\t\t\n\t\tBot winner = players.get(3);\n//\t\tSystem.out.println(\"WINNER IS: \"+ winner);\n\t\t\n\t\treturn winner;\n\t}", "protected void startTracking(final Team team){\n \t\tfor (ArenaPlayer p: team.getPlayers()){\n \t\t\tstartTracking(p);}\n \t}", "private void initializePlayers()\n\t{\n\t\tfor(Player player : playerList)\n\t\t{\n\t\t\t// Distribute personality cards\n\t\t\tplayer.setPersonalityCard(board.getPersonalityCardDeck().pickTopCard());\n\t\t\t\n\t\t\t// Distribute money\n\t\t\tboard.getBankAccount().transfertAmountTo(player, nbGoldStartPerPlayer, false);\n\t\t\t\n\t\t\t// Distribute minions\n\t\t\tfor(int i = 0; i < nbMinionsPerPlayer; i++)\n\t\t\t{\n\t\t\t\tplayer.addMinion(new Minion());\n\t\t\t}\n\t\t\t\n\t\t\t// Distribute buildings\n\t\t\tfor(int i = 0; i < nbBuildingsPerPlayer; i++)\n\t\t\t{\n\t\t\t\tplayer.addBuilding(new Building());\n\t\t\t}\n\t\t}\n\n\t\t// Distribute player cards\n\t\tfor(int i = 0; i < nbInitCards; i++)\n\t\t{\n\t\t\tfor(Player player : playerList)\n\t\t\t{\n\t\t\t\tplayer.getPlayerCardDeck().addCard(board.getPlayerCardDeck().pickTopCard());\n\t\t\t}\n\t\t}\n\t}", "void play() {\n\n ArrayList<Card> cardsInMiddle = new ArrayList<>();\n\n Card[] lastCardsPlayed = new Card[numOfPlayers];\n\n //simulation of each player flipping their next card\n for (int i = 0; i < players.length; i++) {\n lastCardsPlayed[i] = players[i].getNextCard();\n cardsInMiddle.add(lastCardsPlayed[i]);\n\n }\n\n //if there's a tie\n while (tieForCards(lastCardsPlayed)) {\n //check to see if players have enough cards to continue\n //if not, then clear that players hand and game will end\n WarPlayer lessThan3Cards = tryGetPlayerWithLessThanThreeCards();\n if (lessThan3Cards != null) {\n lessThan3Cards.getHand().clear();\n return;\n }\n\n //simulation of flipping 2 extra cards\n for (int i = 0; i < players.length; i++) {\n cardsInMiddle.add(players[i].getNextCard());\n cardsInMiddle.add(players[i].getNextCard());\n\n Card lastCard = players[i].getNextCard();\n cardsInMiddle.add(lastCard);\n lastCardsPlayed[i] = lastCard;\n }\n }\n setLastCardsPlayed(lastCardsPlayed);\n\n //determining who gets all the cards played for the round\n int highestCardIndex = largestCard(lastCardsPlayed);\n players[highestCardIndex].addCards(cardsInMiddle);\n players[highestCardIndex].addPoints(cardsInMiddle.size() / numOfPlayers);\n }", "@Override\n public List<Set<String>> getPlayersVisibleTo(){\n Set<String> players = new HashSet<String>();\n players.add(destination.getOwner().getName());\n for(Region adj : destination.getAdjRegions()){\n players.add(adj.getOwner().getName());\n }\n //All adjacent can see cloaking happened\n return Arrays.asList(players);\n }", "public Player playGame() {\r\n\r\n\t\tfor(int season = 0; season < 4; season++) {\r\n\r\n\t\t\t//deal out cards\r\n\t\t\tfor(int i = 0; i < state.dealAmounts[season]; i++) {\r\n\t\t\t\tfor(Player p : players) {\r\n\t\t\t\t\tp.deal(state.drawCard());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//debug\r\n\t\t\t//show money amounts\r\n\t\t\tfor(Player p : players) {\r\n\t\t\t\tif(debugPrinting)\r\n\t\t\t\tSystem.out.println(p.name + \" : \" + p.getMoney());\r\n\t\t\t}\r\n\r\n\t\t\tstate.resetSeason();\r\n\r\n\t\t\tfor(int turn = 0; true; turn = (turn+1)%players.length) {\r\n\t\t\t\t//have a player play a card\r\n\t\t\t\tCard card = players[turn].chooseCard();\r\n\t\t\t\tCard second = null;\r\n\t\t\t\t\r\n\t\t\t\t//TODO this should be fixed to include if no players have cards\r\n\t\t\t\tif(card == null) {\r\n\t\t\t\t\tint hasHands = 0;\r\n\t\t\t\t\tfor(Player p : players) {\r\n\t\t\t\t\t\tif(p.getHand().size() != 0) {\r\n\t\t\t\t\t\t\thasHands++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//if no players have anything in their hand\r\n\t\t\t\t\tif(hasHands == 0) {\r\n\t\t\t\t\t\tendSeason();\r\n\t\t\t\t\t\tbreak;//break out of the season\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tint secondPlayer = -1;\r\n\r\n\t\t\t\tif(card.getAuctionType() == AuctionType.DOUBLE) {\r\n\t\t\t\t\tsecond = card;\r\n\t\t\t\t\tcard = players[turn].chooseSecondCard(second.getArtist());\r\n\r\n\t\t\t\t\tif(card == null) {\r\n\t\t\t\t\t\tfor(int i = 0; i < players.length-1 && card == null; i++) {\r\n\t\t\t\t\t\t\tcard = players[(turn+i)%players.length].chooseSecondCard(second.getArtist());\r\n\t\t\t\t\t\t\tsecondPlayer = (turn+i)%players.length;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(card == null) {\r\n\t\t\t\t\t\t\tcard = second;\r\n\t\t\t\t\t\t\tsecond = null;\r\n\t\t\t\t\t\t\tsecondPlayer = -1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//card(s) selected\r\n\r\n\t\t\t\t//let the GameState know\r\n\t\t\t\tstate.sell(card.getArtist(), second != null);\r\n\r\n\t\t\t\t//check to see if the season has ended\r\n\t\t\t\t//System.out.println(state.seasonEnded());\r\n\t\t\t\tif(state.seasonEnded()) {\r\n\t\t\t\t\tendSeason();\r\n\t\t\t\t\tbreak;//this break will break out of the season\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//announce card(s)\r\n\t\t\t\tfor(Player p : players) {\r\n\t\t\t\t\tp.announceCard(card, !(second == null));\r\n\t\t\t\t}\r\n\t\t\t\tif(debugPrinting)\r\n\t\t\t\tSystem.out.println(\"Player : \" + players[turn].name + \" :: \" + card + \" :: \" + second);\r\n\r\n\t\t\t\t//card(s) are ready for auction\r\n\t\t\t\tBid winningBid = null;\r\n\t\t\t\tif(card.getAuctionType() == AuctionType.FIXED_PRICE) {\r\n\t\t\t\t\twinningBid = fixedPrice(turn, players[turn].getFixedPrice());\r\n\t\t\t\t} else if(card.getAuctionType() == AuctionType.ONCE_AROUND) {\r\n\t\t\t\t\twinningBid = onceAround(turn);\r\n\t\t\t\t} else if(card.getAuctionType() == AuctionType.SEALED) {\r\n\t\t\t\t\twinningBid = sealed(turn);\r\n\t\t\t\t} else {\r\n\t\t\t\t\twinningBid = standardBidding(turn);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//let everybody know who won the auction\r\n\t\t\t\tfor(Player p : players) {\r\n\t\t\t\t\tp.announceAuctionWinner(winningBid.index, players[winningBid.index].name, winningBid.price);\r\n\t\t\t\t}\r\n\t\t\t\tif(debugPrinting)\r\n\t\t\t\tSystem.out.println(\"Auction winner: \" + players[winningBid.index].name + \":: Price : \" + winningBid.price);\r\n\r\n\t\t\t\t//The auction has been won, time to execute the order (66)\r\n\t\t\t\tif(winningBid.index == turn) {\r\n\t\t\t\t\tplayers[turn].pay(winningBid.price);\r\n\t\t\t\t\tplayers[turn].givePainting(card);\r\n\t\t\t\t\tif(second != null) {\r\n\t\t\t\t\t\tplayers[turn].givePainting(second);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(secondPlayer != -1) {\r\n\t\t\t\t\t\tplayers[secondPlayer].recive(winningBid.price/2);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tplayers[winningBid.index].pay(winningBid.price);\r\n\t\t\t\t\tif(secondPlayer != -1) {\r\n\t\t\t\t\t\tif(secondPlayer != winningBid.index) {\r\n\t\t\t\t\t\t\tplayers[secondPlayer].recive(winningBid.price/2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tplayers[turn].recive(winningBid.price/2);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tplayers[turn].recive(winningBid.price);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tplayers[winningBid.index].givePainting(card);\r\n\t\t\t\t\tif(second != null) {\r\n\t\t\t\t\t\tplayers[winningBid.index].givePainting(second);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//debug\r\n\t\t//show money amounts\r\n\t\tfor(Player p : players) {\r\n\t\t\tif(debugPrinting)\r\n\t\t\tSystem.out.println(p.name + \" : \" + p.getMoney());\r\n\t\t}\r\n\t\t\r\n\t\tPlayer winner = null;\r\n\t\tfor(Player p : players) {\r\n\t\t\tif(winner == null || winner.getMoney() < p.getMoney()) {\r\n\t\t\t\twinner = p;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn winner;\r\n\t}", "public List<Player> getAllPlayers() {\r\n // TODO fix actual order of players in the List.\r\n\r\n List<Player> players = new ArrayList<>();\r\n players.addAll(teamRed.getPlayers());\r\n players.addAll(teamBlue.getPlayers());\r\n\r\n return players;\r\n }", "public void calculatePausedPlayers(Tournament tournament, Round round) {\r\n\t\t// this is the number of players in one match\r\n\t\tint numberOfMatchPlayers = tournament.getTeamSize() * 2; // home and away team\r\n\t\t// this is the maximum number of players in one round\r\n\t\tint maxNumberOfActivePlayers = tournament.getCourts() * numberOfMatchPlayers;\r\n\r\n\t\twhile (round.getPlayers().size() > maxNumberOfActivePlayers) {\r\n\t\t\taddPausedPlayer(tournament.getRounds(), round);\r\n\t\t}\r\n\r\n\t\twhile ((round.getPlayers().size() % numberOfMatchPlayers) != 0) {\r\n\t\t\taddPausedPlayer(tournament.getRounds(), round);\r\n\t\t}\r\n\t}", "public void determineNextPlayer() {\r\n\t\t// Calculate next player\r\n\t\tSystem.out.println(\"[DEBUG LOG/Game.java] Current player number before getting next: \"+currentPlayer.getNumber());\r\n//\t\tif (currentPlayer.getNumber() == 0) {\r\n//\t\t\tif (p2 == null) {currentPlayer = p1;} else {currentPlayer = p2;}\r\n//\t\t} else if (currentPlayer.getNumber() == 1) {\r\n//\t\t\tif (p3 == null) {currentPlayer = p1;} else {currentPlayer = p3;}\r\n//\t\t} else if (currentPlayer.getNumber() == 2) {\r\n//\t\t\tif (p4 == null) {currentPlayer = p1;} else {currentPlayer = p4;}\r\n//\t\t} else {\r\n//\t\t\tcurrentPlayer = p1;\r\n//\t\t}\r\n\t\tcurrentPlayer = currentPlayer.getNextPlayer(); // Method already deals with quit\r\n\t\t\r\n\t\t// Player is alive and not free\r\n\t\tif (!currentPlayer.isFree() && !currentPlayer.isDead()) { \r\n\t\t\tSystem.out.println(\"[DEBUG LOG/Game.java] Next player is not dead and not free: \"+currentPlayer.getNumber());\r\n\t\t\tturnIsEnding = false;\r\n\t\t\tnewTurn();\r\n\t\t// Player is dead\r\n\t\t} else if (currentPlayer.isDead()) {\r\n\t\t\tif (!checkIfGameIsOver()) {\r\n\t\t\t\tSystem.out.println(\"[DEBUG LOG/Game.java] Player is dead, game is not over so skipping\");\r\n\t\t\t\tendTurn(); // DEATH CONDITION 1.5 & 2 & 2.5\r\n\t\t\t}\r\n\t\t// Player is free\r\n\t\t} else {\r\n\t\t\t// Check if game is over\r\n\t\t\tif (!checkIfGameIsOver()) {\r\n\t\t\t\t// End Game Dragon\r\n\t\t\t\tSystem.out.println(\"[DEBUG LOG/Game.java] Player is free, game is not over\");\r\n\t\t\t\t// Check if this is the first escaped player\r\n\t\t\t\tif (currentPlayer.getPlayerID().contentEquals(firstEscapee.getPlayerID())) {\r\n\t\t\t\t\t// Advance the room and draw next sprite\r\n\t\t\t\t\tcurrentPlayer.setCurrentRoom(currentPlayer.getCurrentRoom()+1);\r\n\t\t\t\t\tint room = currentPlayer.getCurrentRoom();\r\n\t\t\t\t\tcurrentPlayer.getPiece().setX(GlobalVars.playerCoordsPerRoom[room][0]+GlobalVars.playersOffset[currentPlayer.getNumber()][0]);\r\n\t\t\t\t\tcurrentPlayer.getPiece().setY(GlobalVars.playerCoordsPerRoom[room][1]+GlobalVars.playersOffset[currentPlayer.getNumber()][1]);\r\n\t\t\t\t\t// If last room, kill the rest of the players\r\n\t\t\t\t\tif (room == 43) {\r\n\t\t\t\t\t\tSystem.out.println(\"[DEBUG LOG/Game.java] First escapee has reached last room. Killing all other players\");\r\n\t\t\t\t\t\tfor (int i = 0; i < players.size(); i++) {\r\n\t\t\t\t\t\t\tif (!players.get(i).isDead() && !players.get(i).isFree()) {\r\n\t\t\t\t\t\t\t\tdeath(players.get(i)); // DEATH CONDITION 3.5\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Not run through death because turnIsEnding = true\r\n\t\t\t\t\t\tif (!status.contentEquals(\"over\")) {\r\n\t\t\t\t\t\t\tgameOver();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// Not last stage so keep going\r\n\t\t\t\t\t\tSystem.out.println(\"[DEBUG LOG/Game.java] Advanced room in end sequence\");\r\n\t\t\t\t\t\tgameChannel.sendMessage(\":skull: Only **\"+(43-room)+\"** turn(s) left!\").queueAfter(2000,TimeUnit.MILLISECONDS);\r\n\t\t\t\t\t\t// Increased cube dragon attack\r\n\t\t\t\t\t\tdragonAttack(cubesPerLevel[attackLevel]+room-39);\r\n\t\t\t\t\t\t// Even if the last player died, should pass and then end game\r\n\t\t\t\t\t\tendTurn();\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Not first escapee but also free\r\n\t\t\t\t\tendTurn();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void nextPlayer() {\n\t\tif (currentPlayer.equals(vServerThread.get(0))){\n\t\t\tcurrentPlayer=vServerThread.get(1);\n\t\t} else if (currentPlayer.equals(vServerThread.get(1))){\n\t\t\tcurrentPlayer=vServerThread.get(0);\n\t\t}\n\t}", "public static void WorkAtCompany(Player gamer){\r\n gamer.zen = gamer.zen-30;\r\n gamer.money = gamer.money+10;\r\n gamer.turn = gamer.turn+1; \r\n }", "public void generatePlayer()\n {\n board.getTile(8,0).insertPlayer(this.player);\n }", "public void setTeam(String team) {\n\t\tthis.teamOfPlayer = team;\n\t}", "@Test\n public void partyTour() throws FileNotFoundException, URISyntaxException,\n DisconnectedException {\n MatchController matchController = new MatchController() {\n @Override\n public void initMatch(PartyController partyController)\n throws FileNotFoundException, URISyntaxException {\n this.partyController = partyController;\n this.match = new Match();\n this.turnController = new TurnController(this) {\n @Override\n protected boolean isPlayerOffline(Player player) {\n return false;\n }\n\n @Override\n protected void notify(Player nextPlayer) {\n }\n\n };\n ZoneFactory zf = new TemplateZoneFactory(\n EftaiosGame.DEFAULT_MAP);\n this.zoneController = new ZoneController(zf);\n }\n\n @Override\n public void checkEndGame() {\n }\n\n };\n PlayerCard alien = new PlayerCard(PlayerRace.ALIEN, null);\n PlayerCard human = new PlayerCard(PlayerRace.HUMAN, null);\n Party party = new Party(\"test\", new EftaiosGame(), false);\n PartyController partyController = PartyController.createNewParty(party);\n party.addToParty(UUID.randomUUID(), \"player1\");\n party.addToParty(UUID.randomUUID(), \"player2\");\n party.addToParty(UUID.randomUUID(), \"player3\");\n party.addToParty(UUID.randomUUID(), \"player4\");\n party.addToParty(UUID.randomUUID(), \"player5\");\n party.addToParty(UUID.randomUUID(), \"player6\");\n party.addToParty(UUID.randomUUID(), \"player7\");\n List<Player> players = new ArrayList<Player>(party.getMembers()\n .keySet());\n Player player1 = players.get(0);\n Player player2 = players.get(1);\n Player player3 = players.get(2);\n Player player4 = players.get(3);\n Player player5 = players.get(4);\n Player player6 = players.get(5);\n Player player7 = players.get(6);\n player1.setIdentity(alien);\n player2.setIdentity(alien);\n player3.setIdentity(alien);\n player4.setIdentity(alien);\n player5.setIdentity(human);\n player6.setIdentity(human);\n player7.setIdentity(human);\n matchController.initMatch(partyController);\n\n // turno di partenza\n Player startPlayer = new Player(\"\", 9);\n for (Player nextPlayer : players) {\n if (nextPlayer.getIndex() == 7) {\n startPlayer = nextPlayer;\n }\n }\n Turn turn = new Turn(startPlayer, matchController.getMatch()\n .getTurnCount());\n matchController.getTurnController().setTurn(turn);\n assertTrue(matchController.getTurnController().getTurn()\n .getCurrentPlayer().equals(startPlayer));\n int num = matchController.getMatch().getTurnCount();\n\n // cerco il player successivo\n Player endPlayer = new Player(\"\", 9);\n for (Player nextPlayer : players) {\n if (nextPlayer.getIndex() == 1) {\n endPlayer = nextPlayer;\n }\n }\n\n // eseguo\n matchController.getTurnController().nextTurn();\n\n // verifico\n assertTrue(matchController.getTurnController().getTurn()\n .getCurrentPlayer().equals(endPlayer));\n assertTrue(matchController.getMatch().getTurnCount() == num + 1);\n }", "private void startMatch() {\n game = new Match(players.get(0), players.get(1), \"Nueva Partida\");\n showMatch();\n state = 1;\n }", "public void addPlayer(String playerID) {\r\n\t\tplayerCount++;\r\n\t\tString name = guild.getMemberById(playerID).getEffectiveName();\r\n\t\t// Set up each player uniquely\r\n\t\tif (p2 == null) {\r\n\t\t\tp2 = new Player(1,playerID,GlobalVars.pieces.get(\"blue\"));\r\n\t\t\tp2.getPiece().setX(GlobalVars.playerCoordsPerRoom[0][0]+GlobalVars.playersOffset[1][0]);\r\n\t\t\tp2.getPiece().setY(GlobalVars.playerCoordsPerRoom[0][1]+GlobalVars.playersOffset[1][1]);\r\n\t\t\tplayers.add(p2);\r\n\t\t\tp1.setNextPlayer(p2);\r\n\t\t\tp2.setNextPlayer(p1);\r\n\t\t\tgameChannel.sendMessage(\"**\"+name+\"** has reincarnated as the BLUE adventurer\").queue();\r\n\t\t} else if (p3 == null) {\r\n\t\t\tp3 = new Player(2,playerID,GlobalVars.pieces.get(\"yellow\"));\r\n\t\t\tp3.getPiece().setX(GlobalVars.playerCoordsPerRoom[0][0]+GlobalVars.playersOffset[2][0]);\r\n\t\t\tp3.getPiece().setY(GlobalVars.playerCoordsPerRoom[0][1]+GlobalVars.playersOffset[2][1]);\r\n\t\t\tplayers.add(p3);\r\n\t\t\tp2.setNextPlayer(p3);\r\n\t\t\tp3.setNextPlayer(p1);\r\n\t\t\tgameChannel.sendMessage(\"**\"+name+\"** has reincarnated as the YELLOW adventurer\").queue();\r\n\t\t} else if (p4 == null) {\r\n\t\t\tp4 = new Player(3,playerID,GlobalVars.pieces.get(\"green\"));\r\n\t\t\tp4.getPiece().setX(GlobalVars.playerCoordsPerRoom[0][0]+GlobalVars.playersOffset[3][0]);\r\n\t\t\tp4.getPiece().setY(GlobalVars.playerCoordsPerRoom[0][1]+GlobalVars.playersOffset[3][1]);\r\n\t\t\tplayers.add(p4);\r\n\t\t\tp3.setNextPlayer(p4);\r\n\t\t\tp4.setNextPlayer(p1);\r\n\t\t\tgameChannel.sendMessage(\"**\"+name+\"** has reincarnated as the GREEN adventurer\").queue();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void execute()\n\t{\n\t\tSortedSet<String> active_agent_ids = sim.getactiveParticipantIdSet(\"group\");\n\t\tIterator<String> iter = active_agent_ids.iterator();\n\t\tString name;\n\t\tupdateLoanPlayers(active_agent_ids, iter);\n\n\t\tif (en.getRoundsPassed() == rounds)\n\t\t{\n\t\t\tdata.add(\n\t\t\t\t\t\t\t\" ==== Cycle \" + sim.getTime() + \" Begins (\" + en.getRoundsPassed() + ':' + en.getCurrentTurnType() + \") ==== \");\n\t\t\tdata.add(\n\t\t\t\t\t\t\t\"************************************************************************************************************ \");\n\t\t\tfor (Map.Entry<String, PoliticalGroup> entry : p_players.entrySet())\n\t\t\t{\n\t\t\t\twhile (iter.hasNext())\n\t\t\t\t{\n\t\t\t\t\tString id = iter.next();\n\t\t\t\t\tif (p_players.get(id) != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tname = p_players.get(id).getDataModel().getName();\n\t\t\t\t\t\tdata.add(\n\t\t\t\t\t\t\t\t\t\t\"===============================\" + name + \"===============================\");\n\t\t\t\t\t\tdata.add(\n\t\t\t\t\t\t\t\t\t\t\"Group population: \" + p_players.get(id).getDataModel().getMemberList().size());\n\t\t\t\t\t\tdata.add(\n\t\t\t\t\t\t\t\t\t\t\"Current reserve: \" + p_players.get(id).getDataModel().getCurrentReservedFood());\n\t\t\t\t\t\tdata.add(\"Greediness: \" + PoliticalGroup.getGreediness(p_players.get(\n\t\t\t\t\t\t\t\t\t\tid).getDataModel()));\n\t\t\t\t\t\tdata.add(\"++++++LOAN HISTORY OF THIS GROUP++++++\");\n\n\t\t\t\t\t\t//Display debtors / loans given\n\t\t\t\t\t\tdata.add(\"Debtors History-------------------------------\");\n\t\t\t\t\t\tMap<String, List<Tuple<Double, Double>>> loansGiven = PoliticalGroup.getLoansGiven(p_players.get(\n\t\t\t\t\t\t\t\t\t\tid).getDataModel());\n\t\t\t\t\t\tif (loansGiven != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSet<String> debtors = loansGiven.keySet();\n\t\t\t\t\t\t\tfor (String deb : debtors)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tString gname;\n\t\t\t\t\t\t\t\tif (PublicEnvironmentConnection.getInstance().getGroupById(deb) == null)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tgname = \"A DEAD GROUP\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tgname = PublicEnvironmentConnection.getInstance().getGroupById(\n\t\t\t\t\t\t\t\t\t\t\t\t\tdeb).getName();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdata.add(\"---->Debtor: \" + gname + \" has been given: \" + loansGiven.get(\n\t\t\t\t\t\t\t\t\t\t\t\tdeb).size() + \" loans from this group!\");\n\t\t\t\t\t\t\t\tdouble amountBorrowed = 0;\n\t\t\t\t\t\t\t\tfor (Tuple<Double, Double> t : loansGiven.get(deb))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tamountBorrowed += t.getKey() * (1 + t.getValue());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdata.add(\n\t\t\t\t\t\t\t\t\t\t\t\t\" This debtor has borrowed \" + amountBorrowed + \" units of food\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdata.add(\"No loans given at the moment!\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdata.add(\"Creditors History-------------------------------\");\n\t\t\t\t\t\t//Display debtors / loans given\n\t\t\t\t\t\tMap<String, List<Tuple<Double, Double>>> loansTaken = PoliticalGroup.getLoansTaken(p_players.get(\n\t\t\t\t\t\t\t\t\t\tid).getDataModel());\n\t\t\t\t\t\tif (loansTaken != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSet<String> creditors = loansTaken.keySet();\n\t\t\t\t\t\t\tfor (String cred : creditors)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tString gname;\n\t\t\t\t\t\t\t\tif (PublicEnvironmentConnection.getInstance().getGroupById(cred) == null)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tgname = \"A DEAD GROUP\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tgname = PublicEnvironmentConnection.getInstance().getGroupById(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcred).getName();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdata.add(\"---->Creditor: \" + gname + \" has given this group: \" + loansTaken.get(\n\t\t\t\t\t\t\t\t\t\t\t\tcred).size() + \" loans!\");\n\t\t\t\t\t\t\t\tdouble amountBorrowed = 0;\n\t\t\t\t\t\t\t\tfor (Tuple<Double, Double> t : loansTaken.get(cred))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tamountBorrowed += t.getKey() * (1 + t.getValue());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdata.add(\n\t\t\t\t\t\t\t\t\t\t\t\t\" This group has been given \" + amountBorrowed + \" units of food from this creditor\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdata.add(\"No loans taken at the moment!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdata.add(\" \");\n\t\t\t\titer = active_agent_ids.iterator();\n\t\t\t}\n\t\t\trounds++;\n\t\t}\n\t}", "private void assignPlayerNames() {\n\t\tSystem.out.print(\"What is the name of the first player? \");\n\t\tplayer1.setName(sc.nextLine());\n\n\t\t// Read the second player's name\n\t\tSystem.out.print(\"What is the name of the second player? \");\n\t\tplayer2.setName(sc.nextLine());\n\n\t\twhile (player2.getName().toLowerCase()\n\t\t\t\t.equals(player1.getName().toLowerCase())) {\n\t\t\tSystem.out.print(\"Both players cannot be named \"\n\t\t\t\t\t+ player2.getName() + \".\" + \" Enter a different name: \");\n\t\t\tplayer2.setName(sc.nextLine());\n\t\t}\n\t}", "public void playRound(List<Player> players) {\n\n //winners ArrayList initializer\n List<Player> winners = new ArrayList<>();\n\n //When the tournament started\n start = System.currentTimeMillis();\n\n //Main loop for running rounds, loop x numberOfRounds\n for (int i = 0; i < numberOfRounds; i++) {\n //Loop for titles, if not the last iteration then roundTitle\n if (i != numberOfRounds - 1) {\n roundTitle();\n //else display finalTitle\n } else {\n finalTitle();\n }\n //winners List is passed as the players to run through the round\n winners = playMatch(players);\n players = winners;\n\n //for each loop that calls on Player object method calculateScore, this happens with each round iteration\n for (Player player : players) {\n player.calculateScore();\n }\n\n //Output for the champion\n if (i == numberOfRounds - 1) {\n lineDivider();\n //With numberOfRounds - 1, append remaining winner in the List output as Champion\n String champion = \"\\n\" + winners.get(0).printName() + \" is the champion !!\";\n //Convert string to uppercase for increased impact\n String championUpper = champion.toUpperCase();\n System.out.println(championUpper);\n lineDivider();\n System.out.println(\"******************************************************\");\n\n }\n\n\n }\n //Small method to calculate/sys out time taken to complete the tournament\n end = System.currentTimeMillis();\n timeTaken = start - end;\n System.out.println(\"\\n\\n This Tournament took\" + timeTaken + \" milliseconds to complete\");\n\n }", "@Override\n public void lastMove( PlayerMove playerMove ) {\n int row = playerMove.getCoordinate().getRow();\n int col = playerMove.getCoordinate().getCol();\n int team = playerMove.getPlayerId();\n if(row%2 == 0 && col%2 == 0){\n if(team == 1){\n Dot n1 = board.getNode(new Coordinate(row+1,col));\n Dot n2 = board.getNode(new Coordinate(row -1,col));\n n1.addNeighbor(n2);\n n2.addNeighbor(n1);\n }\n else {\n Dot n1 = board.getNode(new Coordinate(row, col + 1));\n Dot n2 = board.getNode(new Coordinate(row, col - 1));\n n1.addNeighbor(n2);\n n2.addNeighbor(n1);\n }\n }\n else{\n if(team == 1){\n Dot n1 = board.getNode(new Coordinate(row,col+1));\n Dot n2 = board.getNode(new Coordinate(row ,col-1));\n n1.addNeighbor(n2);\n n2.addNeighbor(n1);\n }\n else {\n Dot n1 = board.getNode(new Coordinate(row+1, col));\n Dot n2 = board.getNode(new Coordinate(row-1, col));\n n1.addNeighbor(n2);\n n2.addNeighbor(n1);\n }\n }\n\n }", "@Override\n\tpublic void start() \n\t{\n\t\tServerPoller.getServerPoller().setObserver(this);\n\t\tList<Game> gamelist = Reference.GET_SINGLETON().proxy.getGameList();\n\t\tGameInfo[] games = new GameInfo[gamelist.size()];\n\t\tint counter = 0;\n\t\tfor(Game game: gamelist)\n\t\t{\n\t\t\tGameInfo thisgame = new GameInfo();\n\t\t\tthisgame.setId(game.getId());\n\t\t\tthisgame.setTitle(game.getTitle());\n\t\t\tfor(Player player : game.getPlayers())\n\t\t\t{\n\t\t\t\tPlayerInfo player_info = new PlayerInfo(player);\n\t\t\t\tplayer_info.setColor(player.getColor());\n\t\t\t\tif(!(player.color == null))thisgame.addPlayer(player_info);\n\t\t\t}\n\t\t\tgames[counter] = thisgame;\n\t\t\tcounter++;\n\t\t}\n\n\t\tif (Reference.GET_SINGLETON().getPlayer_color() != null) return;\n\t\tif (!hasChanged(games, oldGames)) return;\n\t\toldGames = games;\n\t\t\n\t\tReference ref = Reference.GET_SINGLETON();\n\t\t\n\t\tPlayerInfo ourguy = new PlayerInfo();\n\t\t\n\t\tourguy.setId(ref.player_id);\n\t\tourguy.setName(ref.name);\n\t\t\n\t\tgetJoinGameView().setGames(games, ourguy);\n\n\t\tif (getJoinGameView().isModalShowing()) getJoinGameView().closeModal();\n\t\tif(!getJoinGameView().isModalShowing())\n\t\t{\n\t\t\tgetJoinGameView().showModal();\n\t\t}\n\t}", "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 }", "private void setInfoPlayers() {\n\n\t\t//PLAYER 1\n\t\tlblPlayer1name.setText(players.get(0).getName());\n\t\tlblCashP1.setText(\"\" + players.get(0).getMoney());\n\t\tlblBuildP1.setText(\"\" + players.get(0).getNumberBuildings());\n\t\tlblPropP1.setText(\"\" + players.get(0).getOwnproperties().size());\n\t\tlblPosP1.setText(\"\"+ players.get(0).getPosition());\n\n\t\t//PLAYER 2\n\t\tlblPlayer2name.setText(players.get(1).getName());\n\t\tlblCashP2.setText(\"\" + players.get(1).getMoney());\n\t\tlblBuildP2.setText(\"\" + players.get(1).getNumberBuildings());\n\t\tlblPropP2.setText(\"\" + players.get(1).getOwnproperties().size());\n\t\tlblPosP2.setText(\"\"+ players.get(1).getPosition());\n\t\t\n\t\tif(players.size() > 2){\n\t\t\t//PLAYER 3\n\t\t\tlblPlayerName3.setText(players.get(2).getName());\n\t\t\tlblCashP3.setText(\"\" + players.get(2).getMoney());\n\t\t\tlblBuildP3.setText(\"\" + players.get(2).getNumberBuildings());\n\t\t\tlblPropP3.setText(\"\" + players.get(2).getOwnproperties().size());\n\t\t\tlblPosP3.setText(\"\"+ players.get(2).getPosition());\n\n\t\t\tif(players.size() > 3){\n\t\t\t\t//PLAYER 4\n\t\t\t\tlblPlayerName4.setText(players.get(3).getName());\n\t\t\t\tlblCashP4.setText(\"\" + players.get(3).getMoney());\n\t\t\t\tlblBuildP4.setText(\"\" + players.get(3).getNumberBuildings());\n\t\t\t\tlblPropP4.setText(\"\" + players.get(3).getOwnproperties().size());\n\t\t\t\tlblPosP4.setText(\"\"+ players.get(3).getPosition());\n\t\t\t}\n\t\t}\n\t\t\n\t}", "private void getTeam() {\n Set<Integer> set = getRandomNumberSet();\n // clear new team list each time to allow for serial clicks on \"Generate New Random Team\"\n team.clear();\n for (Integer i : set) {\n getPokemon(i);\n }\n }", "public String[] getNearestPlayer(Player p, PlayerData pd)\r\n/* 60: */ {\r\n/* 61:58 */ Game g = pd.getGame();\r\n/* 62: */ \r\n/* 63:60 */ int x = p.getLocation().getBlockX();\r\n/* 64:61 */ int y = p.getLocation().getBlockY();\r\n/* 65:62 */ int z = p.getLocation().getBlockZ();\r\n/* 66: */ \r\n/* 67:64 */ int i = 200000;\r\n/* 68: */ \r\n/* 69:66 */ Player player = null;\r\n/* 70:68 */ for (String s : g.getPlayers())\r\n/* 71: */ {\r\n/* 72:70 */ Player p2 = Bukkit.getPlayer(s);\r\n/* 73:72 */ if ((p2 != null) && (!p2.equals(p)) && (!pd.isOnTeam(s)))\r\n/* 74: */ {\r\n/* 75:74 */ Location l = p2.getLocation();\r\n/* 76: */ \r\n/* 77:76 */ int c = cal((int)(x - l.getX())) + cal((int)(y - l.getY())) + cal((int)(z - l.getZ()));\r\n/* 78:78 */ if (i > c)\r\n/* 79: */ {\r\n/* 80:79 */ player = p2;\r\n/* 81:80 */ i = c;\r\n/* 82: */ }\r\n/* 83: */ }\r\n/* 84: */ }\r\n/* 85:84 */ if (player != null) {\r\n/* 86:84 */ p.setCompassTarget(player.getLocation());\r\n/* 87: */ }\r\n/* 88:86 */ return new String[] { player == null ? \"none\" : player.getName(), String.valueOf(i) };\r\n/* 89: */ }", "protected Player getOpponentPlayer(Match match) {\r\n LOGGER.debug(\"--> getOpponentPlayer: match=\" + match);\r\n Player opponentPlayer;\r\n\r\n if (match.getCurrentPlayer() == 2) {\r\n opponentPlayer = match.getPlayer1();\r\n } else if (match.getCurrentPlayer() == 1) {\r\n opponentPlayer = match.getPlayer2();\r\n } else {\r\n throw new GeneralException(\"match has no defined opponentPlayer!\");\r\n }\r\n\r\n LOGGER.debug(\"<-- getOpponentPlayer\");\r\n return opponentPlayer;\r\n }", "private void updateTokens(ArrayList<Player> winners) {\r\n // le joueur courant a-t-il été traité ? (gagné ou perdu)\r\n boolean done;\r\n for(Player player : players) {\r\n if( ! player.isDealer()) {\r\n done = false;\r\n for(Player winner : winners) {\r\n if(winner == player) {\r\n done = true;\r\n int gain = player.getStake();\r\n String txt = \"\";\r\n if(total(player).max() == 32) {\r\n gain = (int) (gain * 1.5);\r\n txt = \"avec un blackjack\";\r\n }\r\n player.addTokens(gain);\r\n Logger.write(player.getName() + \" a gagné \" + txt + \", il reçoit \" + gain + \" jetons [\" + player.getTokens() + \"]\");\r\n }\r\n }\r\n if(! done) {\r\n player.removeTokens(player.getStake());\r\n Logger.write(player.getName() + \" a perdu, il donne \" + player.getStake() + \" au croupier. [\" + player.getTokens() + \"]\");\r\n // si le joueur n'a plus de jetons, il quitte la partie.\r\n if(player.getTokens() <= 0) {\r\n players.remove(player);\r\n Logger.write(player.getName() + \" n'a plus de jetons, il quitte la partie.\");\r\n }\r\n }\r\n }\r\n }\r\n }", "public void sendGameInfoToAll(){\r\n\t\t\r\n\t\tVector<Player> players = lobby.getLobbyPlayers();\t\r\n\t\tString message = \"UDGM\" + lobby.getGameString();\r\n\t\t\r\n\t\tif(!players.isEmpty()){\r\n\t \tfor(int i=0; i<players.size(); i++){\t \t\t\r\n\t \t\tsendOnePlayer(players.get(i), message);\t \t\t\r\n\t \t}\r\n\t\t}\r\n\t}", "public Tournament(){\n simplePlayer = new SimpleFakeGinRummyPlayer(new ParamList(new double[]{}));\n\n knockOnGinPlayer = new EnsembleHandEvalPlayer(ParamList.getRandomParamList(1), new DeadwoodHandEvaluator());\n knockOnGinPlayer.setKnockDecider(new KnockOnGinKnockDecider() );\n knockOnGinPlayer.setDrawDecider(new MeldOnlyDrawDecider());\n\n ExperimentalRuns.fixTwoStageKnockDecider101();\n // paramOfTunedTwoStagePlayer.set(ParamList.TS_KNOCK_THRESHOLD_EARLY, 0);\n // paramOfTunedTwoStagePlayer.set(ParamList.TS_KNOCK_THRESHOLD_LATE, 0);\n // paramOfTunedTwoStagePlayer.set(ParamList.TS_KNOCK_MIDDLE, 6);\n ParamList.setFixedValue(ParamList.TS_DRAW_MIDDLE, 14);\n ParamList paramOfTunedTwoStagePlayer = ParamList.getRandomParamList(1);\n System.out.println(paramOfTunedTwoStagePlayer);\n tunedTwoStagePlayer = new IndexEnsembleHandEvalPlayer(paramOfTunedTwoStagePlayer, new DeadwoodHandEvaluator());\n tunedTwoStagePlayer.setKnockDecider(new TwoStageKnockDecider(paramOfTunedTwoStagePlayer) );\n tunedTwoStagePlayer.setDrawDecider(new MeldOnlyDrawDecider());\n tunedTwoStagePlayer.setDrawDecider(new TwoStageDrawDecider(paramOfTunedTwoStagePlayer));\n\n resultSimpleVsKnockGin = 0;\n resultKnockGinVsTwoStage = 0;\n resultTwoStageVsSimple = 0;\n\n numGamePerPair = 2000;\n\n }", "private List<String> validatePlayer(String playerName, CommandSender sender) {\n\n\t\tList<Player> players = new ArrayList<Player>();\n\t\tList<String> match = new ArrayList<String>();\n\n\t\tplayers = this.getServer().matchPlayer(playerName);\n\t\tif (players.isEmpty()) {\n\t\t\t// Check for an offline player (exact match).\n\t\t\tfor (OfflinePlayer player : Bukkit.getOfflinePlayers()) {\n\t\t\t\tif (player.getName().equals(playerName)) {\n\t\t\t\t\tmatch.add(player.getUniqueId().toString());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/*\n\t\t\tif (Arrays.asList(this.getServer().getOfflinePlayers()).contains(Bukkit.getOfflinePlayer(playerName))) {\n\t\t\t\tmatch.add(Bukkit.getOfflinePlayer(playerName).getName()); //.getUniqueId().toString());\n\t\t\t\t//match.add(Bukkit.getOfflinePlayer(Bukkit.getPlayer(playerName).getUniqueId()).getName()); //.getUniqueId().toString());\n\t\t\t} else {\n\t\t\t\t// look for partial matches\n\t\t\t\tfor (OfflinePlayer offline : this.getServer().getOfflinePlayers()) {\n\t\t\t\t\tif (offline.getName().toLowerCase().startsWith(playerName.toLowerCase()))\n\t\t\t\t\t\tmatch.add(offline.getName()); //.getUniqueId().toString());\n\t\t\t\t}\n\t\t\t}\n\t\t\t*/\n\n\t\t} else {\n\t\t\tfor (Player player : players) {\n\t\t\t\tmatch.add(player.getUniqueId().toString());\n\t\t\t}\n\t\t}\n\n\t\tif (match.isEmpty()) {\n\t\t\tsender.sendMessage(ChatColor.RED + \"Player not found!\");\n\t\t\treturn null;\n\t\t} else if (match.size() > 1) {\n\t\t\tsender.sendMessage(ChatColor.RED + \"Too many matches found! (\" + match.toString() + \")\");\n\t\t\treturn null;\n\t\t}\n\n\t\treturn match;\n\n\t}", "private void findFirstPlayer() { \n if(isFirstTurn) {\n for(PlayerId p: PlayerId.ALL) {\n if(handsOfCards.get(p).contains(Card.of(Color.DIAMOND, Rank.SEVEN))) {\n firstPlayer = p;\n }\n }\n }\n else {\n firstPlayer = PlayerId.ALL.get((firstPlayer.ordinal()+1)%PlayerId.COUNT);\n }\n }", "public void play() {\n Player playerOne = preparePlayer(getUserName(scanner, validator, shipsGameText.getMessage(\"show.player.one\"), null));\n Player currentPlayer = playerOne;\n ShipsGameBoard playerOneGameBoard = new ShipsGameBoard(playerOne, playerOneFleet);\n ShipsGameBoard playerOneCheckBoard = new ShipsGameBoard(playerOne, playerOneFleetToCheck);\n playerOneCheckBoard.setup();\n\n TreeMap<Character, Integer> lettersAndDigits = lettersAndDigits(playerOneGameBoard.getLength());\n ShipCreator threeMastShipCreatorPlayerOne = new ShipCreator(THREE_MASTS_SHIP,\n null,\n playerOne,\n ShipGameBoardMark.THREE_MASTS,\n playerOneGameBoard,\n playerOneShipsGameLogic);\n\n playerOneGameBoard.print();\n shipsDeployment(playerOneGameBoard,\n lettersAndDigits,\n threeMastShipCreatorPlayerOne,\n playerOneShipsGameLogic,\n playerOneFleet,\n NUMBER_OF_SHIPS);\n\n// playerOneShipsGameLogic.clearConsole();\n\n Player playerTwo = preparePlayer(getUserName(scanner, validator, shipsGameText.getMessage(\"show.player.two\"), playerOne.getName()));\n ShipsGameBoard playerTwoGameBoard = new ShipsGameBoard(playerTwo, playerTwoFleet);\n ShipsGameBoard playerTwoCheckBoard = new ShipsGameBoard(playerTwo, playerTwoFleetToCheck);\n playerTwoCheckBoard.setup();\n\n ShipCreator threeMastShipCreatorPlayerTwo = new ShipCreator(THREE_MASTS_SHIP,\n null,\n playerTwo,\n ShipGameBoardMark.THREE_MASTS,\n playerTwoGameBoard,\n playerTwoShipsGameLogic);\n\n playerTwoGameBoard.print();\n shipsDeployment(playerTwoGameBoard,\n lettersAndDigits,\n threeMastShipCreatorPlayerTwo,\n playerTwoShipsGameLogic,\n playerTwoFleet,\n NUMBER_OF_SHIPS);\n\n\n boolean isAWinner = false;\n do {\n int userRow;\n int userCol;\n// playerOneGameBoard.clearConsole();\n showCurrentPlayerBoards(playerOne, currentPlayer, playerOneGameBoard, playerTwoGameBoard, playerOneCheckBoard,\n playerTwoCheckBoard, shipsGameText);\n System.out.println(shipsGameText.getMessage(\"show.witch.player.move\", currentPlayer.getName()));\n\n System.out.println(shipsGameText.getMessage(\"show.input.row\", Integer.toString(playerOneGameBoard.getLength())));\n userRow = getPlayerRowChoice(scanner, validator, playerOneGameBoard.getLength());\n\n System.out.println(shipsGameText.getMessage(\"show.input.col\",\n Character.toString(playerOneGameBoard.generateLastLetterOfColumn('A', playerOneGameBoard.getLength()))));\n userCol = convertLetterToDigit(lettersAndDigits, getPlayerColChoice(scanner, validator,\n lettersAndDigits));\n\n if (currentPlayer.equals(playerOne)) {\n if (playerTwoShipsGameLogic.checkForHit(userRow, userCol)) {\n playerOneShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n playerTwoShipsGameLogic.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n if (playerTwoShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n playerTwoShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerTwo);\n playerOneShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerTwoFleet, playerOne);\n System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n playerOneCheckBoard.print();\n System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerTwo.getName()));\n playerTwoGameBoard.print();\n } else {\n System.out.println(shipsGameText.getMessage(\"show.player.hit.ship\", playerOne.getName()));\n }\n } else {\n System.out.println(shipsGameText.getMessage(\"show.player.miss\"));\n playerOneShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.MISS);\n playerTwoShipsGameLogic.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.MISS);\n }\n\n// if (playerTwoShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n// playerTwoShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerTwo);\n// playerOneShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerTwoFleet, playerOne);\n// System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n// System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n// playerOneCheckBoard.print();\n// System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerTwo.getName()));\n// playerTwoGameBoard.print();\n// }\n\n\n if (playerTwoShipsGameLogic.isPlayerLoose()) {\n System.out.println(shipsGameText.getMessage(\"show.player.win\", playerOne.getName()));\n isAWinner = true;\n }\n\n } else {\n if (playerOneShipsGameLogic.checkForHit(userRow, userCol)) {\n playerTwoShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n playerOneShipsGameLogic.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n if (playerOneShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n playerOneShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerOne);\n playerTwoShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerOneFleet, playerTwo);\n System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n playerTwoCheckBoard.print();\n System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerOne.getName()));\n playerOneGameBoard.print();\n }\n else {\n System.out.println(shipsGameText.getMessage(\"show.player.hit.ship\", playerOne.getName()));\n }\n } else {\n playerTwoShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne,\n ShipGameBoardMark.MISS);\n playerOneShipsGameLogic.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.MISS);\n System.out.println(shipsGameText.getMessage(\"show.player.miss\"));\n }\n if (playerOneShipsGameLogic.isPlayerLoose()) {\n System.out.println(shipsGameText.getMessage(\"show.player.win\", playerTwo.getName()));\n isAWinner = true;\n }\n }\n\n currentPlayer = swapPlayers(playerOne, currentPlayer, playerTwo);\n }\n while (!isAWinner);\n }", "public static void startGame() {\r\n\t\tfor (MovingUnit mu : _players) {\r\n\t\t\t((WinningInterface) mu).startUnit();\r\n\t\t}\r\n\t}", "public Pit getMancala(String owner) {\n\t\t// If the owner is\n\t\tif (this.player1Name.equalsIgnoreCase(owner)) {\n\t\t\treturn this.Player1Mancala;\n\t\t}\n\t\treturn this.Player2Mancala;\n\t}", "public void setUpPlayers() {\n this.players.add(new Player(\"Diogo\"));\n this.players.add(new Player(\"Hayden\"));\n this.players.add(new Player(\"Gogo\"));\n }", "@Test\n public void alienAttacksMultipleTargets() throws FileNotFoundException,\n URISyntaxException, DisconnectedException {\n // preparo il terreno\n MatchController matchController = new MatchController() {\n @Override\n public void initMatch(PartyController partyController)\n throws FileNotFoundException, URISyntaxException {\n this.partyController = partyController;\n this.match = new Match();\n this.turnController = new TurnController(this);\n ZoneFactory zf = new TemplateZoneFactory(\n EftaiosGame.DEFAULT_MAP);\n this.zoneController = new ZoneController(zf);\n\n }\n\n @Override\n public void checkEndGame() {\n }\n\n @Override\n protected void notifyAPlayerAbout(Player player, String about) {\n }\n\n @Override\n protected void showCardToParty(Card card) {\n }\n\n @Override\n protected void updateDeckView(Player player) {\n }\n\n @Override\n protected void sendMapVariationToPlayer(Player player, Sector sec,\n SectorHighlight highlight) {\n }\n\n @Override\n protected void sendViewModelToAPlayer(Player p, ViewModel content) {\n }\n };\n\n PlayerCard alien = new PlayerCard(PlayerRace.ALIEN, null);\n PlayerCard human = new PlayerCard(PlayerRace.HUMAN, null);\n Party party = new Party(\"test\", new EftaiosGame(), false);\n PartyController partyController = PartyController.createNewParty(party);\n party.addToParty(UUID.randomUUID(), \"player1\");\n party.addToParty(UUID.randomUUID(), \"player2\");\n party.addToParty(UUID.randomUUID(), \"player3\");\n party.addToParty(UUID.randomUUID(), \"player4\");\n party.addToParty(UUID.randomUUID(), \"player5\");\n party.addToParty(UUID.randomUUID(), \"player6\");\n List<Player> players = new ArrayList<Player>(party.getMembers()\n .keySet());\n Player player1 = players.get(0);\n Player player2 = players.get(1);\n Player player3 = players.get(2);\n Player player4 = players.get(3);\n Player player5 = players.get(4);\n Player player6 = players.get(5);\n player1.setIdentity(alien);// attaccante\n player2.setIdentity(alien);// alieno in loco\n player3.setIdentity(alien);// alieno difeso\n player4.setIdentity(human);// umano indifeso\n player5.setIdentity(human);// umano altrove\n player6.setIdentity(human);// umano difeso\n ItemCard defenseCard1 = new ItemCard(Item.DEFENSE);\n ItemCard defenseCard2 = new ItemCard(Item.DEFENSE);\n ItemCard spotlightCard = new ItemCard(Item.SPOTLIGHT);\n ItemCard card2 = new ItemCard(Item.SEDATIVES);\n ItemCard card3 = new ItemCard(Item.ATTACK);\n player3.getItemsDeck().getCards().add(defenseCard1);\n player4.getItemsDeck().getCards().add(spotlightCard);\n player4.getItemsDeck().getCards().add(card2);\n player4.getItemsDeck().getCards().add(card3);\n player6.getItemsDeck().getCards().add(defenseCard2);\n\n matchController.initMatch(partyController);\n\n Turn turn = new Turn(player1, matchController.getMatch().getTurnCount());\n matchController.getTurnController().setTurn(turn);\n matchController.getTurnController().getTurn().setMustMove(false);\n HexPoint point = HexPoint.fromOffset(1, 1);\n Sector sec = new Sector(null, point);\n HexPoint point2 = HexPoint.fromOffset(2, 3);\n Sector sec2 = new Sector(null, point2);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player1, sec);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player2, sec);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player3, sec);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player4, sec);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player5, sec2);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player6, sec);\n matchController.getTurnController().getTurn().setCanAttack(true);\n ActionRequest action = new ActionRequest(ActionType.ATTACK, null, null);\n // eseguo l'azione\n Attack atk = new Attack() {\n @Override\n protected void notifyInChatByCurrentPlayer(String what) {\n }\n\n @Override\n protected void notifyCurrentPlayerByServer(String what) {\n }\n };\n atk.initAction(matchController, action);\n if (atk.isValid())\n atk.processAction();\n // verifico gli esiti\n assertTrue(player1.getKillsCount() == 1);\n assertTrue(matchController.getZoneController().getCurrentZone()\n .getCell(player1).equals(sec));\n assertTrue(matchController.getZoneController().getCurrentZone()\n .getCell(player2) == matchController.endingSector);\n assertTrue(matchController.getZoneController().getCurrentZone()\n .getCell(player3) == matchController.endingSector);\n assertTrue(matchController.getZoneController().getCurrentZone()\n .getCell(player4) == matchController.endingSector);\n assertTrue(matchController.getZoneController().getCurrentZone()\n .getCell(player5).equals(sec2));\n assertTrue(matchController.getZoneController().getCurrentZone()\n .getCell(player6).equals(sec));\n assertFalse(matchController.getMatch().getDeadPlayer()\n .contains(player1));\n assertTrue(matchController.getMatch().getDeadPlayer().contains(player2));\n assertTrue(matchController.getMatch().getDeadPlayer().contains(player3));\n assertTrue(matchController.getMatch().getDeadPlayer().contains(player4));\n assertFalse(matchController.getMatch().getDeadPlayer()\n .contains(player5));\n assertFalse(matchController.getMatch().getDeadPlayer()\n .contains(player6));\n assertTrue(matchController.getMatch().getDeadPlayer().size() == 3);\n assertTrue(matchController.getMatch().getItemsDeck().getBucket()\n .contains(defenseCard1));\n assertTrue(matchController.getMatch().getItemsDeck().getBucket()\n .contains(defenseCard2));\n assertTrue(matchController.getMatch().getItemsDeck().getBucket()\n .contains(spotlightCard));\n assertTrue(matchController.getMatch().getItemsDeck().getBucket()\n .contains(card2));\n assertTrue(matchController.getMatch().getItemsDeck().getBucket()\n .contains(card3));\n assertTrue(matchController.getMatch().getItemsDeck().getBucket().size() == 5);\n assertFalse(player3.getItemsDeck().getCards().contains(defenseCard1));\n assertFalse(player4.getItemsDeck().getCards().contains(spotlightCard));\n assertFalse(player4.getItemsDeck().getCards().contains(card2));\n assertFalse(player4.getItemsDeck().getCards().contains(card3));\n assertFalse(player6.getItemsDeck().getCards().contains(defenseCard2));\n }", "@Test\n void testBotCIsNextPlayerWhenBotBHas2Clubs() {\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n \n ArrayList<Card> clubCards;\n clubCards = new ArrayList <Card>();\n \n for (Rank rank : Rank.values()) {\n clubCards.add(new Card(Suit.CLUBS, rank, true));\n }\n \n testDealer.getBotB().fillHandCards(clubCards);\n testDealer.setPlayerStarter(); \n testDealer.getTrickPlayer();\n assertEquals(testDealer.getBotC().getId(), testDealer.getNextPlayer());\n }", "public static HoldemPlayerDecider[] initTestPlayers(Scanner inTestRun, String line, HoldemServerMiddleMan middleMan) {\n\t\tString players[] = line.split(\" \");\n\t\tHoldemPlayerDecider playerDecider[] = new HoldemPlayerDecider[players.length];\n\t\tfor(int i=0; i<players.length; i++) {\n\t\t\tplayerDecider[i] = new HoldemTestCasePlayer(players[i], inTestRun, middleMan);\n\t\t}\n\t\t\n\t\treturn playerDecider;\n\t}", "public static String BeforeSplitStrategyHints(Player Gamer, Player Dealer){\n\t\tString ReturnString = \"\";\n\t\tif(Gamer.Hand[0].getValue() == 1 && Gamer.Hand[1].getValue() == 1){\n\t\t\t// Pair of Aces\n\t\t\tif(Dealer.Score >= 2 && Dealer.Score <= 7){\n\t\t\t\tReturnString = Gamer.Name+\" should split\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t\t}\n\t\t}\n\t\telse if((Gamer.Hand[0].getValue() == 2 && Gamer.Hand[1].getValue() == 2) \n\t\t\t|| (Gamer.Hand[0].getValue() == 3 && Gamer.Hand[1].getValue() == 3)){\n\t\t\tif(Dealer.Score >= 2 && Dealer.Score <= 7){\n\t\t\t\tReturnString = Gamer.Name+\" should split\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t\t}\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 4 && Gamer.Hand[1].getValue() == 4){\n\t\t\tif(Dealer.Score >= 5 && Dealer.Score <= 6){\n\t\t\t\tReturnString = Gamer.Name+\" should split\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t\t}\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 5 && Gamer.Hand[1].getValue() == 5){\n\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 6 && Gamer.Hand[1].getValue() == 6){\n\t\t\tif(Dealer.Score >= 2 && Dealer.Score <= 6){\n\t\t\t\tReturnString = Gamer.Name+\" should split\";\n\t\t\t}\n\t\t\telse{\n\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t\t}\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 7 && Gamer.Hand[1].getValue() == 7){\n\t\t\tif(Dealer.Score >= 2 && Dealer.Score <= 7){\n\t\t\t ReturnString = Gamer.Name+\" should split\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t\t}\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 8 && Gamer.Hand[1].getValue() == 8){\n\t\t\tReturnString = Gamer.Name+\" should split\";\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 9 && Gamer.Hand[1].getValue() == 9){\n\t\t\tif((Dealer.Score >= 2 && Dealer.Score <= 6) || (Dealer.Score >= 8 && Dealer.Score <= 9)){\n\t\t\t\tReturnString = Gamer.Name+\" should split\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t\t}\n\t\t}\n\t\telse if(Gamer.Hand[0].getValue() == 10 && Gamer.Hand[1].getValue() == 10){\n\t\t\tReturnString = Gamer.Name+\" should not split\";\n\t\t}\n\t\treturn ReturnString;\n\t}", "private void createPlayers() {\n\t\t//Randomize roles\n\t\tArrayList<AdventurerEnum> randomisedRoles = getRandomisedRoles();\n\t\tfor(int i=0; i<numPlayers; i++) \n\t\t\tcreateOnePlayer(randomisedRoles.get(i), i+1);\n\t}", "private void getPlayerList(){\r\n\r\n PlayerDAO playerDAO = new PlayerDAO(Statistics.this);\r\n players = playerDAO.readListofPlayerNameswDefaultFirst();\r\n\r\n }", "public List<Player> getAvailablePlayers(Round round) {\r\n\t\tList<Player> availablePlayers = playerLogic.createNew(round.getPlayers());\r\n\r\n\t\tfor (Match match : round.getMatches()) {\r\n\t\t\tavailablePlayers.removeAll(match.getHomeTeam());\r\n\t\t\tavailablePlayers.removeAll(match.getAwayTeam());\r\n\t\t}\r\n\t\treturn availablePlayers;\r\n\t}", "public Matchdata(Match match, long _matchID, String _summonerName, long _playerID)\n {\n matchID = _matchID;\n summonerName = _summonerName;\n playerID = _playerID;\n\n \n participantID = getIdentityFromSummonerID(match);\n totalGoldEachMinute = goldEachMinute(match, participantID);\n minutes = totalGoldEachMinute.length;\n \n individualGEM = new int[totalGoldEachMinute.length];\n for(int i = totalGoldEachMinute.length-1; i>0; i--)\n {\n individualGEM[i] = totalGoldEachMinute[i]-totalGoldEachMinute[i-1];\n }\n individualGEM[0] = totalGoldEachMinute[0];\n \n \n totalCreepsEachMinute = creepsEachMinute(match, participantID);\n \n individualCEM = new int[totalCreepsEachMinute.length];\n for(int i = totalCreepsEachMinute.length-1; i>0; i--)\n {\n individualCEM[i] = totalCreepsEachMinute[i]-totalCreepsEachMinute[i-1];\n }\n individualCEM[0] = totalCreepsEachMinute[0];\n \n \n \n gpm = totalGoldEachMinute[totalGoldEachMinute.length-1]/totalGoldEachMinute.length;\n cpm = totalCreepsEachMinute[totalCreepsEachMinute.length-1]/totalCreepsEachMinute.length;\n \n //get(participantID-1) might seem weird, but it's how getParticipants is stored.\n victory = match.getParticipants().get(participantID-1).getStats().getWinner();\n champion = match.getParticipants().get(participantID-1).getChampionID();\n time = match.getCreation().getTime();\n \n lane = match.getParticipants().get(participantID-1).getTimeline().getLane();\n role = match.getParticipants().get(participantID-1).getTimeline().getRole();\n \n roleSanity = sanityCheck(match);\n \n map = match.getMap();\n \n }", "public void setPlayersAtGo()\n {\n for(int i = 0; i < m_numPlayers; i++)\n {\n m_gameBoard.addPlayerToSpace(i + 1, 0);\n }\n }", "public static void makeEnemyMove() { //all players after index 1 are enemies\n if (gameMode == EARTH_INVADERS) {//find leftmost and rightmost vehicle columns to see if we need to move down\n int leftMost = board[0].length;\n int rightMost = 0;\n int lowest = 0;\n for (int i = FIRST_VEHICLE; i < players.length; i++) {//find left-most, right-most and lowest most vehicles (non aircraft/train) to determine how formation should move\n Player curr = players[i];\n if (curr == null)\n continue;\n String name = curr.getName();\n if (name.equals(\"NONE\") || curr.isFlying() || name.startsWith(\"TRAIN\") || (curr instanceof Monster))\n continue;\n if (curr.getCol() < leftMost)\n leftMost = curr.getCol();\n if (curr.getCol() > rightMost)\n rightMost = curr.getCol();\n if (curr.getRow() > lowest)\n lowest = curr.getRow();\n curr.setHeadDirection(DOWN);\n }\n for (int i = FIRST_VEHICLE; i < players.length; i++) {//***move aircraft and trains\n Player curr = players[i];\n if (curr == null)\n continue;\n String name = curr.getName();\n if (name.equals(\"NONE\") || curr.isFlying() || name.startsWith(\"TRAIN\") || (curr instanceof Monster)) {\n if (curr.isMoving())\n continue;\n ArrayList<Integer> dirs = new ArrayList(); //array of preferred directions - everything but the reverse of their body position\n int bodyDir = curr.getBodyDirection();\n curr.clearDirections();\n int r = curr.getRow();\n int c = curr.getCol();\n if (bodyDir == UP) {\n if (isValidMove(curr, r - 1, c))\n dirs.add(UP);\n if (isValidMove(curr, r, c + 1))\n dirs.add(RIGHT);\n if (!name.startsWith(\"TRAIN\")) //trains need to follow the track circuit - only straight and right turns\n {\n if (isValidMove(curr, r, c - 1))\n dirs.add(LEFT);\n }\n } else if (bodyDir == RIGHT) {\n if (!name.startsWith(\"TRAIN\")) //trains need to follow the track circuit - only straight and right turns\n {\n if (isValidMove(curr, r - 1, c))\n dirs.add(UP);\n }\n if (isValidMove(curr, r, c + 1))\n dirs.add(RIGHT);\n if (isValidMove(curr, r + 1, c))\n dirs.add(DOWN);\n } else if (bodyDir == DOWN) {\n if (isValidMove(curr, r + 1, c))\n dirs.add(DOWN);\n if (!name.startsWith(\"TRAIN\")) //trains need to follow the track circuit - only straight and right turns\n {\n if (isValidMove(curr, r, c + 1))\n dirs.add(RIGHT);\n }\n if (isValidMove(curr, r, c - 1))\n dirs.add(LEFT);\n } else //if(curr.getBodyDirection()==LEFT)\n {\n if (isValidMove(curr, r - 1, c))\n dirs.add(UP);\n if (!name.startsWith(\"TRAIN\")) //trains need to follow the track circuit - only straight and right turns\n {\n if (isValidMove(curr, r + 1, c))\n dirs.add(DOWN);\n }\n if (isValidMove(curr, r, c - 1))\n dirs.add(LEFT);\n }\n int rand = 0;\n if (dirs.size() > 0)\n rand = dirs.get((int) (Math.random() * dirs.size()));\n if (curr.isFlying()) { //if aircraft is flying in the visible board, don't change direction\n if (r == 1 && (c == 0 || c == board[0].length - 1)) //we are in the first row but behind a border\n { //we only want aircraft to appear in row 1 in EARTH INVADERS (like the UFO in space invaders)\n if (bodyDir == LEFT || bodyDir == RIGHT) {\n rand = UP;\n if (Math.random() < .5)\n rand = DOWN;\n } else if (c == 0)\n rand = RIGHT;\n else if (c == board[0].length - 1)\n rand = LEFT;\n else\n //if(dirs.contains(bodyDir))\n rand = bodyDir;\n } else if (r == 0 || c == 0 || r == board.length - 1 || c == board[0].length - 1) {\n rand = bodyDir;\n if (r == 0 && c == 0) {\n rand = RIGHT;\n if (Math.random() < .5)\n rand = DOWN;\n } else if (r == 0 && c == board[0].length - 1) {\n rand = LEFT;\n if (Math.random() < .5)\n rand = DOWN;\n } else if (r == board.length - 1 && c == 0) {\n rand = RIGHT;\n if (Math.random() < .5)\n rand = UP;\n } else if (r == board.length - 1 && c == board[0].length - 1) {\n rand = LEFT;\n if (Math.random() < .5)\n rand = UP;\n }\n } else if (/*dirs.contains(bodyDir) && */(r > 0 && c > 0 && r < board.length - 1 && c < board[0].length - 1))\n rand = bodyDir; //make it so aircraft prefer to keep going the same direciton\n\n } else if (name.startsWith(\"TRAIN\")) {//make it so trains prefer to follow the right wall\n for (int j = 0; j < dirs.size(); j++)\n if (dirs.get(j) != bodyDir) {\n rand = dirs.get(j);\n break;\n }\n }\n curr.setDirection(rand);\n curr.setBodyDirection(rand);\n }\n }//***end aircraft/train movement\n if (leftMost == 1) //move vehicles down and start them moving right\n {\n if (EI_moving == LEFT) {\n EI_moving = DOWN;\n for (int i = FIRST_VEHICLE; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n if (lowest < board.length - 3 && !curr.isFlying() && !curr.getName().startsWith(\"TRAIN\"))\n curr.setRow(curr.getRow() + 1);\n }\n } else if (EI_moving == DOWN) {\n EI_moving = RIGHT;\n for (int i = FIRST_VEHICLE; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n if (!curr.isFlying() && !curr.getName().startsWith(\"TRAIN\")) {\n curr.setDirection(RIGHT);\n curr.setBodyDirection(RIGHT);\n }\n }\n } else if (EI_moving == RIGHT)\n for (int i = FIRST_VEHICLE; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n if (!curr.isFlying() && !curr.getName().startsWith(\"TRAIN\"))\n curr.setDirection(RIGHT);\n }\n }//***end leftmost is first col\n else if (rightMost == board[0].length - 2) //move vehicles down and start them moving left\n {\n if (EI_moving == RIGHT) {\n EI_moving = DOWN;\n for (int i = FIRST_VEHICLE; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n if (lowest < board.length - 3 && !curr.isFlying() && !curr.getName().startsWith(\"TRAIN\"))\n curr.setRow(curr.getRow() + 1);\n }\n } else if (EI_moving == DOWN) {\n EI_moving = LEFT;\n for (int i = FIRST_VEHICLE; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n if (!curr.isFlying() && !curr.getName().startsWith(\"TRAIN\")) {\n curr.setDirection(LEFT);\n curr.setBodyDirection(LEFT);\n }\n }\n } else if (EI_moving == LEFT)\n for (int i = FIRST_VEHICLE; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n\n if (!curr.isFlying() && !curr.getName().startsWith(\"TRAIN\"))\n curr.setDirection(LEFT);\n }\n }//***end rightmost is last col\n else if (EI_moving == LEFT)\n for (int i = FIRST_VEHICLE; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n if (!curr.isFlying() && !curr.getName().startsWith(\"TRAIN\"))\n curr.setDirection(LEFT);\n }\n else if (EI_moving == RIGHT)\n for (int i = FIRST_VEHICLE; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n if (!curr.isFlying() && !curr.getName().startsWith(\"TRAIN\"))\n curr.setDirection(RIGHT);\n }\n return;\n }//***end EARTH INVADERS enemy movements\n for (int i = 2; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n String name = curr.getName();\n int r = curr.getRow();\n int c = curr.getCol();\n if (r > 0 && c > 0 && r < board.length - 1 && c < board[0].length - 1 && (curr instanceof Vehicle))\n ((Vehicle) (curr)).setOnField(true);\n\n if (curr.isFlying() && webs[panel].size() > 0) {\n int x = curr.findX(cellSize);\n int y = curr.findY(cellSize);\n for (int p = 0; p < webs[panel].size(); p++) {\n int[] ray = webs[panel].get(p);\n if (Utilities.isPointOnRay(x, y, ray[0], ray[1], ray[2], ray[3])) {\n explosions.add(new Explosion(\"BIG\", x, y, explosionImages, animation_delay));\n Ordinance.radiusDamage(-1, x, y, 25, panel, .5);\n Spawner.resetEnemy(i);\n webs[panel].remove(p);\n p--;\n Structure str1 = structures[ray[4]][ray[5]][panel];\n Structure str2 = structures[ray[6]][ray[7]][panel];\n if (str1 != null)\n str1.setWebValue(0);\n if (str2 != null)\n str2.setWebValue(0);\n Utilities.updateKillStats(curr);\n break;\n }\n }\n }\n //reset any ground vehicle that ended up in the water\n //reset any train not on tracks - we need this because a player might change panels as a vehicle spawns\n if (name.startsWith(\"TRAIN\")) {\n Structure str = structures[r][c][panel];\n if (str != null && str.getName().equals(\"hole\") && str.getHealth() != 0) {\n explosions.add(new Explosion(\"BIG\", curr.getX() - (cellSize / 2), curr.getY() - (cellSize / 2), puffImages, animation_delay));\n Utilities.updateKillStats(curr);\n Spawner.resetEnemy(i);\n continue;\n } else if (board[r][c][panel].startsWith(\"~\")) {\n explosions.add(new Explosion(\"BIG\", curr.getX() - (cellSize / 2), curr.getY() - (cellSize / 2), puffImages, animation_delay));\n Spawner.resetEnemy(i);\n continue;\n } else if (!board[r][c][panel].startsWith(\"T\")) {\n explosions.add(new Explosion(\"SMALL\", curr.getX() - (cellSize / 2), curr.getY() - (cellSize / 2), puffImages, animation_delay));\n Spawner.resetEnemy(i);\n continue;\n }\n } else //ground vehicles\n if (!curr.isFlying() && !curr.getName().startsWith(\"BOAT\") && (curr instanceof Vehicle)) {\n\n if (((Vehicle) (curr)).getStunTime() > numFrames) //ground unit might be stunned by WoeMantis shriek\n continue;\n if (board[r][c][panel].startsWith(\"~\")) {\n explosions.add(new Explosion(\"SMALL\", curr.getX() - (cellSize / 2), curr.getY() - (cellSize / 2), puffImages, animation_delay));\n Spawner.resetEnemy(i);\n continue;\n }\n } else //reset any water vehicle that ended up on land\n if (name.startsWith(\"BOAT\")) {\n if (!board[r][c][panel].startsWith(\"~\")) {\n explosions.add(new Explosion(\"SMALL\", curr.getX() - (cellSize / 2), curr.getY() - (cellSize / 2), puffImages, animation_delay));\n Spawner.resetEnemy(i);\n continue;\n }\n } else if (curr.getHealth() <= 0) {\n Spawner.resetEnemy(i);\n continue;\n }\n\n //if a ground unit has been on the playable field and leaves it, respawn them\n if (!curr.isFlying() && !name.startsWith(\"TRAIN\") && (curr instanceof Vehicle)) {\n if ((r == 0 || c == 0 || r == board.length - 1 || c == board[0].length - 1) && ((Vehicle) (curr)).getOnField()) {\n ((Vehicle) (curr)).setOnField(false);\n Spawner.resetEnemy(i);\n continue;\n }\n }\n if (name.endsWith(\"nukebomber\")) {//for the nukebomber, set the detonation coordinates so nuke fires when the plane exits the field\n int dr = curr.getDetRow();\n int dc = curr.getDetCol();\n int bd = curr.getBodyDirection();\n int dd = curr.getDetDir();\n if (bd == dd && (((bd == LEFT || bd == RIGHT) && c == dc) || (bd == UP || bd == DOWN) && r == dr)) {\n Ordinance.nuke();\n curr.setDetRow(-1);\n curr.setDetCol(-1);\n }\n }\n\n if (curr.isMoving())\n continue;\n int bodyDir = curr.getBodyDirection();\n curr.clearDirections();\n int[] target = isMonsterInSight(curr);\n int mDir = target[0]; //direction of the monster, -1 if none\n int monsterIndex = target[1]; //index of the monster in the players array, -1 if none\n ArrayList<Integer> dirs = new ArrayList(); //array of preferred directions - everything but the reverse of their body position\n if (bodyDir == UP) {\n if (isValidMove(curr, r - 1, c)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == UP) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(UP);\n }\n if (isValidMove(curr, r, c + 1)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == RIGHT) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(RIGHT);\n }\n if (!name.startsWith(\"TRAIN\")) //trains need to follow the track circuit - only straight and right turns\n {\n if (isValidMove(curr, r, c - 1)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == LEFT) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(LEFT);\n }\n }\n } else if (bodyDir == RIGHT) {\n if (!name.startsWith(\"TRAIN\")) //trains need to follow the track circuit - only straight and right turns\n {\n if (isValidMove(curr, r - 1, c)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == UP) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(UP);\n }\n }\n if (isValidMove(curr, r, c + 1)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == RIGHT) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(RIGHT);\n }\n if (isValidMove(curr, r + 1, c)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == DOWN) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(DOWN);\n }\n } else if (bodyDir == DOWN) {\n if (isValidMove(curr, r + 1, c)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == DOWN) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(DOWN);\n }\n if (!name.startsWith(\"TRAIN\")) //trains need to follow the track circuit - only straight and right turns\n {\n if (isValidMove(curr, r, c + 1)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == RIGHT) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(RIGHT);\n }\n }\n if (isValidMove(curr, r, c - 1)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == LEFT) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(LEFT);\n }\n } else //if(curr.getBodyDirection()==LEFT)\n {\n\n if (isValidMove(curr, r - 1, c)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == UP) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(UP);\n }\n if (!name.startsWith(\"TRAIN\")) //trains need to follow the track circuit - only straight and right turns\n {\n if (isValidMove(curr, r + 1, c)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == DOWN) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(DOWN);\n }\n }\n if (isValidMove(curr, r, c - 1)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == LEFT) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(LEFT);\n }\n }\n\n if (dirs.size() > 0) {\n if (curr instanceof Monster) {//***MONSTER AI*******************\n double headTurnProb = 0.25;\n double stompProb = 0.5;\n int vDir = isVehicleInSight(curr);\n if (vDir >= 0) {\n boolean airShot = false;\n int vD = vDir;\n if (vD >= 10) {\n airShot = true;\n vD -= 10;\n }\n if (curr.head360() || !Utilities.oppositeDirections(vD, curr.getHeadDirection())) {\n curr.setHeadDirection(vD);\n if ((curr.getName().startsWith(\"Gob\") || curr.getName().startsWith(\"Boo\")) && numFrames >= curr.getLastShotTime() + curr.getReloadTime()) {\n Bullet temp = null;\n if (curr.getName().startsWith(\"Boo\")) {\n temp = new Bullet(curr.getName() + vD, curr.getX(), curr.getY(), 50, beamImages, SPEED, \"BEAM\", SPEED * 10, airShot, i, -1, -1);\n } else if (curr.getName().startsWith(\"Gob\")) {\n temp = new Bullet(\"flame\" + vD, curr.getX(), curr.getY(), 15, monsterFireImages, SPEED, \"FIRE\", SPEED * 4, airShot, i, -1, -1);\n }\n if (temp != null) {\n temp.setDirection(vD);\n bullets.add(temp);\n curr.setLastShotTime(numFrames);\n continue;\n }\n }\n }\n } else if (Math.random() < headTurnProb) {\n String hd = \"right\";\n if (Math.random() < .5)\n hd = \"left\";\n Utilities.turnHead(curr, hd);\n }\n Structure str = structures[r][c][panel];\n if (str != null && str.getHealth() > 0 && str.isDestroyable() && !str.getName().startsWith(\"FUEL\") && Math.random() < stompProb)\n playerMove(KeyEvent.VK_SPACE, i);\n else {\n int dir = dirs.get((int) (Math.random() * dirs.size()));\n if (dir == UP) {\n if (curr.getBodyDirection() != UP) {\n curr.setBodyDirection(UP);\n curr.setHeadDirection(UP);\n } else {\n if (!curr.isSwimmer() && board[r - 1][c][panel].equals(\"~~~\") && !board[r][c][panel].equals(\"~~~\")) {\n continue;\n }\n if (r - 1 >= 1) {\n str = structures[r - 1][c][panel]; //don't walk into a fire\n if (str != null && str.onFire())\n continue;\n }\n playerMove(KeyEvent.VK_UP, i);\n }\n } else if (dir == DOWN) {\n if (curr.getBodyDirection() != DOWN) {\n curr.setBodyDirection(DOWN);\n curr.setHeadDirection(DOWN);\n } else {\n if (!curr.isSwimmer() && board[r + 1][c][panel].equals(\"~~~\") && !board[r][c][panel].equals(\"~~~\")) {\n continue;\n }\n if (r + 1 <= structures.length - 1) {\n str = structures[r + 1][c][panel]; //don't walk into a fire\n if (str != null && str.onFire())\n continue;\n }\n playerMove(KeyEvent.VK_DOWN, i);\n }\n } else if (dir == LEFT) {\n if (curr.getBodyDirection() != LEFT) {\n curr.setBodyDirection(LEFT);\n curr.setHeadDirection(LEFT);\n } else {\n if (!curr.isSwimmer() && board[r][c - 1][panel].equals(\"~~~\") && !board[r][c][panel].equals(\"~~~\")) {\n continue;\n }\n if (c - 1 >= 1) {\n str = structures[r][c - 1][panel]; //don't walk into a fire\n if (str != null && str.onFire())\n continue;\n }\n playerMove(KeyEvent.VK_LEFT, i);\n }\n } else if (dir == RIGHT) {\n if (curr.getBodyDirection() != RIGHT) {\n curr.setBodyDirection(RIGHT);\n curr.setHeadDirection(RIGHT);\n } else {\n if (!curr.isSwimmer() && board[r][c + 1][panel].equals(\"~~~\") && !board[r][c][panel].equals(\"~~~\")) {\n continue;\n }\n if (c + 1 <= board[0].length - 1) {\n str = structures[r][c + 1][panel]; //don't walk into a fire\n if (str != null && str.onFire())\n continue;\n }\n playerMove(KeyEvent.VK_RIGHT, i);\n }\n }\n }\n continue;\n }//end monster AI movement\n else //shoot at a target\n if (name.endsWith(\"troops\") || name.endsWith(\"jeep\") || name.endsWith(\"police\") || name.startsWith(\"TANK\") || name.endsWith(\"coastguard\") || name.endsWith(\"destroyer\") || name.endsWith(\"fighter\") || name.equals(\"AIR bomber\")) {\n boolean airShot = false;\n if (gameMode == EARTH_INVADERS) //we don't want vehicles to shoot each other\n {\n airShot = true;\n curr.setHeadDirection(DOWN);\n }\n if (monsterIndex >= 0 && monsterIndex < players.length && players[monsterIndex].isFlying())\n airShot = true;\n if (curr.getName().endsWith(\"fighter\"))\n curr.setDirection(bodyDir); //keep moving while shooting\n if (mDir != -1 && curr.getRow() > 0 && curr.getCol() > 0 && curr.getRow() < board.length - 1 && curr.getCol() < board[0].length - 1) { //don't shoot from off the visible board\n if ((mDir == bodyDir || ((curr.getName().startsWith(\"TANK\") || curr.getName().endsWith(\"jeep\") || name.equals(\"AIR bomber\")) && (mDir == curr.getHeadDirection() || name.equals(\"AIR bomber\")))) && numFrames >= curr.getLastShotTime() + curr.getReloadTime()) { //AIR bomber needs to be able to drop bombs if they see the monster in front of them or behind them, so we need to check the name in two conditions\n Bullet temp;\n if (name.endsWith(\"jeep\") || name.endsWith(\"coastguard\")) {\n channels[0].programChange(instr[GUNSHOT].getPatch().getProgram());\n channels[0].noteOn((int) (Math.random() * 6) + 65, (int) (Math.random() * 10) + 30);\n temp = new Bullet(\"jeep\" + mDir, curr.getX(), curr.getY(), 5, machBulletImages, SPEED, \"BULLET\", SPEED * 6, airShot, i, -1, -1);\n } else if (name.endsWith(\"troops\") || name.endsWith(\"police\")) {\n channels[0].programChange(instr[GUNSHOT].getPatch().getProgram());\n channels[0].noteOn((int) (Math.random() * 6) + 70, (int) (Math.random() * 10) + 20);\n temp = new Bullet(\"troops\" + mDir, curr.getX(), curr.getY(), 3, bulletImages, SPEED, \"BULLET\", SPEED * 6, airShot, i, -1, -1);\n } else if (name.endsWith(\"destroyer\") || name.endsWith(\"artillery\")) {\n channels[0].programChange(instr[GUNSHOT].getPatch().getProgram());\n channels[0].noteOn((int) (Math.random() * 6) + 45, (int) (Math.random() * 10) + 85);\n temp = new Bullet(\"destroyer\" + mDir, curr.getX(), curr.getY(), 15, shellImages, SPEED, \"SHELL\", SPEED * 3, true, i, players[monsterIndex].findX(cellSize), players[monsterIndex].findY(cellSize));\n } else if (name.endsWith(\"fighter\")) {\n channels[0].programChange(instr[TAIKO].getPatch().getProgram());\n channels[0].noteOn((int) (Math.random() * 10) + 5, (int) (Math.random() * 10) + 40);\n temp = new Bullet(\"fighter\" + mDir, curr.getX(), curr.getY(), 30, rocketImages, SPEED, \"SHELL\", SPEED * 8, true, i, players[monsterIndex].findX(cellSize), players[monsterIndex].findY(cellSize));\n } else if (name.endsWith(\"missile\")) {\n temp = new Bullet(\"missile\" + mDir, curr.getX(), curr.getY(), 50, rocketImages, SPEED, \"SHELL\", SPEED * 3, true, i, players[monsterIndex].findX(cellSize), players[monsterIndex].findY(cellSize));\n channels[0].programChange(instr[TAIKO].getPatch().getProgram());\n channels[0].noteOn((int) (Math.random() * 10) + 5, (int) (Math.random() * 10) + 40);\n } else if (name.endsWith(\"flame\")) {\n temp = new Bullet(\"flame\" + mDir, curr.getX(), curr.getY(), 15, monsterFireImages, SPEED, \"FIRE\", SPEED * 4, airShot, i, -1, -1);\n channels[0].programChange(instr[TAIKO].getPatch().getProgram());\n channels[0].noteOn((int) (Math.random() * 10) + 5, (int) (Math.random() * 10) + 40);\n } else if (name.equals(\"AIR bomber\")) {\n temp = null;\n if (!DISABLE_BOMBERS) {\n int mR = players[PLAYER1].getRow(); //main player row & col\n int mC = players[PLAYER1].getCol();\n int mR2 = -99; //possible 2nd monster row & col\n int mC2 = -99;\n if (p1partner) {\n mR2 = players[PLAYER2].getRow();\n mC2 = players[PLAYER2].getCol();\n }\n if (players[PLAYER1].getHealth() > 0 && (Math.abs(r - mR) <= 2 || Math.abs(c - mC) <= 2 || Math.abs(r - mR2) <= 2 || Math.abs(c - mC2) <= 2)) {//our bomber is in the same row & col as a monster + or - 1\n if (bodyDir == UP && r < board.length - 1) {\n Ordinance.bigExplosion(curr.getX(), curr.getY() + (cellSize * 2), panel);\n Ordinance.radiusDamage(-1, curr.getX(), curr.getY() + (cellSize * 2), 50, panel, .25);\n } else if (bodyDir == DOWN && r > 1) {\n Ordinance.bigExplosion(curr.getX(), curr.getY() - (cellSize * 2), panel);\n Ordinance.radiusDamage(-1, curr.getX(), curr.getY() - (cellSize * 2), 50, panel, .25);\n } else if (bodyDir == RIGHT && c < board[0].length - 1) {\n Ordinance.bigExplosion(curr.getX() - (cellSize * 2), curr.getY(), panel);\n Ordinance.radiusDamage(-1, curr.getX() - (cellSize * 2), curr.getY(), 50, panel, .25);\n } else if (bodyDir == LEFT && c > 1) {\n Ordinance.bigExplosion(curr.getX() + (cellSize * 2), curr.getY(), panel);\n Ordinance.radiusDamage(-1, curr.getX() + (cellSize * 2), curr.getY(), 50, panel, .25);\n }\n }\n }\n } else {\n channels[0].programChange(instr[GUNSHOT].getPatch().getProgram());\n channels[0].noteOn((int) (Math.random() * 6) + 45, (int) (Math.random() * 10) + 85);\n temp = new Bullet(\"\" + mDir, curr.getX(), curr.getY(), 15, shellImages, SPEED, \"SHELL\", SPEED * 5, airShot, i, -1, -1);\n }\n if (temp != null)\n temp.setDirection(mDir);\n\n if (name.endsWith(\"troops\") || name.endsWith(\"police\") && Math.random() < .5) //make the police move towards the monster half the time\n {\n if (mDir == UP && isValidMove(curr, curr.getRow() - 1, curr.getCol()))\n curr.setDirection(UP);\n else if (mDir == DOWN && isValidMove(curr, curr.getRow() + 1, curr.getCol()))\n curr.setDirection(DOWN);\n else if (mDir == LEFT && isValidMove(curr, curr.getRow(), curr.getCol() - 1))\n curr.setDirection(LEFT);\n else if (mDir == RIGHT && isValidMove(curr, curr.getRow(), curr.getCol() + 1))\n curr.setDirection(RIGHT);\n else\n curr.setDirection(-1);\n }\n if (temp != null && players[PLAYER1].getHealth() > 0) {\n if (gameMode == EARTH_INVADERS && !curr.isFlying()) {\n } else {\n if (numFrames >= ceaseFireTime + ceaseFireDuration || gameMode == EARTH_INVADERS) {\n bullets.add(temp);\n curr.setLastShotTime(numFrames);\n continue;\n }\n }\n }\n } else //change to face the monster to line up a shot\n {\n if (name.endsWith(\"troops\") || name.endsWith(\"police\") || name.endsWith(\"destroyer\") || name.endsWith(\"coastguard\") || name.endsWith(\"artillery\")) {\n curr.setDirection(-1); //stop to shoot\n curr.setBodyDirection(mDir);\n } else if (curr.getName().startsWith(\"TANK\") || curr.getName().endsWith(\"jeep\"))\n curr.setHeadDirection(mDir);\n continue;\n }\n }\n }\n int rand = dirs.get((int) (Math.random() * dirs.size()));\n if (curr.isFlying() && (r > 0 && c > 0 && r < board.length - 1 && c < board[0].length - 1)) {\n rand = bodyDir; //make it so aircraft prefer to keep going the same direciton\n } else if (name.startsWith(\"TRAIN\")) {//make it so trains prefer to follow the right wall\n for (int j = 0; j < dirs.size(); j++)\n if (dirs.get(j) != bodyDir) {\n rand = dirs.get(j);\n break;\n }\n }\n curr.setDirection(rand);\n curr.setBodyDirection(rand);\n\n continue;\n }\n //if no preferred direction, include the option to turn around\n //civilians should prefer to turn around rather than approach the monster\n if (name.endsWith(\"civilian\") || name.endsWith(\"bus\")) {\n if (bodyDir == mDir) //if we are facing the same direction as the monster, turn around\n {\n if (bodyDir == UP && isValidMove(curr, curr.getRow() + 1, curr.getCol())) {\n curr.setDirection(DOWN);\n curr.setBodyDirection(DOWN);\n continue;\n } else if (bodyDir == DOWN && isValidMove(curr, curr.getRow() - 1, curr.getCol())) {\n curr.setDirection(UP);\n curr.setBodyDirection(UP);\n continue;\n } else if (bodyDir == LEFT && isValidMove(curr, curr.getRow(), curr.getCol() + 1)) {\n curr.setDirection(RIGHT);\n curr.setBodyDirection(RIGHT);\n continue;\n } else if (bodyDir == RIGHT && isValidMove(curr, curr.getRow(), curr.getCol() - 1)) {\n curr.setDirection(LEFT);\n curr.setBodyDirection(LEFT);\n continue;\n }\n }\n }\n int rand = (int) (Math.random() * 4);\n if (rand == UP && isValidMove(curr, curr.getRow() - 1, curr.getCol())) {\n curr.setDirection(UP);\n curr.setBodyDirection(UP);\n continue;\n }\n if (rand == DOWN && isValidMove(curr, curr.getRow() + 1, curr.getCol())) {\n curr.setDirection(DOWN);\n curr.setBodyDirection(DOWN);\n continue;\n }\n if (rand == LEFT && isValidMove(curr, curr.getRow(), curr.getCol() - 1)) {\n curr.setDirection(LEFT);\n curr.setBodyDirection(LEFT);\n continue;\n }\n if (rand == RIGHT && isValidMove(curr, curr.getRow(), curr.getCol() + 1)) {\n curr.setDirection(RIGHT);\n curr.setBodyDirection(RIGHT);\n continue;\n }\n\n }\n }", "public static void main(String[] args) \n {\n \n Team j = new Team(\"SaPKo\"); \n Player p = new Player(\"Sasf\"); \n Player a = new Player (\"gds\");\n Player s = new Player (\"asjkdh\");\n j.addPlayer(p);\n j.addPlayer(a);\n j.addPlayer(s);\n \n// System.out.println(\"array size: \" + j.getArraySize());\n \n j.printPlayers();\n }" ]
[ "0.60447186", "0.5985905", "0.5857759", "0.58509487", "0.58005714", "0.578988", "0.5785244", "0.5781883", "0.57714385", "0.57569885", "0.57300293", "0.571208", "0.56697685", "0.5668102", "0.5663324", "0.56579536", "0.5654685", "0.56500167", "0.5648448", "0.56432706", "0.5641145", "0.5622779", "0.5615498", "0.56097263", "0.5594362", "0.5589126", "0.5575994", "0.5568137", "0.5558198", "0.5553458", "0.55483556", "0.5539531", "0.5537626", "0.55372745", "0.5531126", "0.55240655", "0.5514205", "0.5512414", "0.5506226", "0.5500455", "0.5493984", "0.5491175", "0.5487541", "0.54849684", "0.54790944", "0.54701734", "0.5470004", "0.54675996", "0.54669255", "0.54525757", "0.5451905", "0.54415303", "0.5438375", "0.543183", "0.54305583", "0.54298985", "0.542766", "0.54245615", "0.5421013", "0.5406792", "0.54032034", "0.53968704", "0.539146", "0.539121", "0.5387244", "0.5385709", "0.5381037", "0.5381004", "0.53793126", "0.53791994", "0.537627", "0.5371366", "0.5368526", "0.53648025", "0.53597236", "0.5359642", "0.5357101", "0.5356741", "0.534758", "0.5346263", "0.5346111", "0.53433406", "0.533669", "0.5336395", "0.53301954", "0.53242075", "0.5323423", "0.5315005", "0.5313183", "0.5304875", "0.53044176", "0.5304009", "0.5303886", "0.53012216", "0.5296206", "0.52943695", "0.52872914", "0.52869946", "0.5279714", "0.52779275", "0.527576" ]
0.0
-1
separates the master subs into individual players for comaprison
private Vector<String> separateSubs(){ Vector<String> subs = new Vector<String>(); StringTokenizer st = new StringTokenizer(masterSubs, ","); while(st.hasMoreTokens()){ subs.add(st.nextToken().toLowerCase()); } return subs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void sendMessagetoRespectivePlayer(int num) {\n Message msg1;\n if(flag == \"player1\"){\n prevP1 = num;\n int newPositionGroup = num / 10;\n if(winningHoleGroup == newPositionGroup){\n msg1 = p1Handler.obtainMessage(3);\n }\n else if((winningHoleGroup == newPositionGroup-1) || (winningHoleGroup == newPositionGroup+1)){\n msg1 = p1Handler.obtainMessage(4);\n }\n else{\n msg1 = p1Handler.obtainMessage(5);\n }\n p1Handler.sendMessage(msg1);\n }\n else{\n prevP2 = num;\n int newPositionGroup = num / 10;\n if(winningHoleGroup == newPositionGroup){\n msg1 = p2Handler.obtainMessage(3);\n }\n else if((winningHoleGroup == newPositionGroup-1) || (winningHoleGroup == newPositionGroup+1)){\n msg1 = p2Handler.obtainMessage(4);\n }\n else{\n msg1 = p2Handler.obtainMessage(5);\n }\n p2Handler.sendMessage(msg1);\n }\n }", "private static void findLongCommSubs() {\n\n for(Player player : inputPlayersList){\n player.setLongCommSubsCounter(LongCommSubsForTwoStrings(player.getTicketNumber(), winningNumber).length());\n }\n }", "private void gameStart() {\n\tready.clear();\r\n\r\n\tplayers = new TreeBidiMap<>();\r\n\tmafia = new ArrayList<>();\r\n\tinnocentIDs = new ArrayList<>();\r\n\r\n\tfor (int i = 0; i < votedStart.size(); i++) {\r\n\t int id = votedStart.get(i);\r\n\t // playerIDs.add(id);\r\n\t players.put(id, server.getUsername(id));\r\n\r\n\t}\r\n\r\n\tint numMafia = (int) Math.round((double) votedStart.size() / 3);\r\n\tmafiaAtStart = new String[numMafia];\r\n\r\n\tfor (int j = 0; j < numMafia; j++) {\r\n\t // int index = mafiaPicker.nextInt(votedStart.size());\r\n\t int index = ThreadLocalRandom.current().nextInt(votedStart.size());\r\n\t int id = votedStart.get(index);\r\n\r\n\t mafia.add(id);\r\n\t mafiaAtStart[j] = server.getUsername(id);\r\n\t votedStart.remove(index);\r\n\t}\r\n\r\n\tfor (int k = 0; k < votedStart.size(); k++) {\r\n\r\n\t int id = votedStart.get(k);\r\n\r\n\t innocentIDs.add(id);\r\n\t}\r\n\r\n\tvotedStart.clear();\r\n\r\n\tint[] innocentIDArray = innocentIDs.stream().mapToInt(i -> i).toArray();\r\n\tserver.privateMessage(\"you are an innocent\", innocentIDArray);\r\n\r\n\tint[] mafiaIDArray = innocentIDs.stream().mapToInt(i -> i).toArray();\r\n\tString[] mafiaNameArray = new String[mafiaIDArray.length];\r\n\r\n\tfor (int l = 0; l < mafiaIDArray.length; l++) {\r\n\t mafiaNameArray[l] = server.getUsername(mafiaIDArray[l]);\r\n\t}\r\n\r\n\t// currently uses the default toSting method for array. Also i think it\r\n\t// will display the id numbers rather than the players names - need to\r\n\t// convert if so would be good to only show only the other mafia members\r\n\t// rather than including the players own name in the list\r\n\tserver.privateMessage(\"you are one of the mafia, the mafia members (including \" + \"you) are \" + mafiaIDArray,\r\n\t\tmafiaIDArray);\r\n\r\n\tday = true;\r\n\tgameInProgress = true;\r\n }", "private void enterMultiPlayerMode(Game game) {\n initSubSystems(game);\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}", "public void playSubRound(int index) {\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"PRINTING ARRAY OF PLAYERS:\");\n\t\tSystem.out.println(gameLogic.getArrayOfPlayers().getArrayOfPlayers());\n\n\t\tdisplayPositionUI();\n\t\tdisplayBidsWonUI();\n\n\t\tif (currentPlayer == gameLogic.getArrayOfPlayers().getArrayOfPlayers().get( gameLogic.getArrayOfPlayers().getArrayOfPlayers().size()-1).getPlayerId()){\n\t\t\tsubRound += 1;\n\t\t}\n\n\t\tfor (Player p: gameLogic.getArrayOfPlayers().getArrayOfPlayers()) {\n\t\t\tif (currentPlayer == p.getPlayerId()) {\n\t\t\t\tif (currentPlayer == 3){\n\t\t\t\t\tcurrentPlayer = 0;\n\t\t\t\t} else {\n\t\t\t\t\tcurrentPlayer += 1;\n\t\t\t\t}\n\n\t\t\t\t/* Get the highest card in the hand */\n\t\t Card highestPlayedCard;\n\t\t Suit leadSuit2;\n\n\t\t if (gameLogic.getLeadSuitCard() == null) {\n\t\t leadSuit2 = null;\n\t\t } else {\n\t\t leadSuit2 = gameLogic.getLeadSuitCard().getSuit();\n\t\t }\n\n\t\t if (gameLogic.getTableHand().sortedTableHand( gameLogic.getTrumpCard().getSuit(), leadSuit2 ).size() == 0 ) {\n\t\t highestPlayedCard = null;\n\t\t } else {\n\t\t highestPlayedCard = gameLogic.getTableHand().sortedTableHand(gameLogic.getTrumpCard().getSuit(), gameLogic.getLeadSuitCard().getSuit()).get(0).getPlayerCard();\n\t\t }\n\n\t\t\t\t/* if first player is a computer, play the first card and set the lead suit */\n\t\t if (p instanceof Computer) {\n\t Computer pComputer = (Computer) p;\n\t System.out.println(\"Printing computer: \" + pComputer);\n\n\t Card cardForCompToPlay = pComputer.playCard(gameLogic.getTrumpCard().getSuit(), leadSuit2, highestPlayedCard);\n\t System.out.println(\"Computer's Hand\" + p.getHand() + \"\\n\");\n\n\t if (p.getPosition() == 0) {\n\t gameLogic.setLeadSuitCard(cardForCompToPlay);\n\t \tString leadSuitString = \"\" + gameLogic.getLeadSuitCard().getSuit();\n\t displayLead(leadSuitString);\n\t }\n\n\t gameLogic.getTableHand().addCard(p, p.removeFromHand(cardForCompToPlay));\n\n\t\t\t\t\t/* Display Table Hand */\n\t\t\t\t\tdisplayTableHandUI();\n\t System.out.println(gameLogic.getTableHand().toString());\n\t break;\n\n\t } else {\n\t\t\t\t\t/* if first player is the player, play the first card and set the lead suit */\n\n\t\t\t\t\t/* Display Hand to user */\n\t System.out.println(\"Player's Hand: \" + p.getHand());\n\n\t\t\t\t\t/* Get input from user */\n\t displayCardUI();\n\n\t try {\n\t\t if (p.getPosition() == 0) {\n\t\t gameLogic.setLeadSuitCard(p.getHand().getCard(index));\n\t\t \tString leadSuitString = \"\" + gameLogic.getLeadSuitCard().getSuit();\n\t\t displayLead(leadSuitString);\n\t\t }\n \t\tgameLogic.getTableHand().addCard(p,p.removeFromHand(p.getHand().getCard(index)));\n\t\t } catch (IndexOutOfBoundsException error){\n\t\t }\n\n\t displayTableHandUI();\n\t // Display Table Hand\n \t\tbreak;\n\t }\n\t }\n\t }\n\t}", "public final void addPlayer(Player player) {\n\n\t\tif (player instanceof CulturePlayer) {\t\t\t\t\t\t\t\t// not too pretty but simple\n\t\t\tif (((CulturePlayer)player).isDissect()) { // instead of the culture player\n\t\t\t\tplayers.addAll(((CulturePlayer)player).getCulture()); // add all masters of the culture\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tplayers.add(player);\n\t}", "private void setupPlayers() {\n\t\tuserData=(UserData) Main.currentStage.getUserData();\n\t\tnumberPlayers=userData.getNumberPlayers();\n\t\tplayerNames=userData.getPlayerNames();\n\t\tcurrentPlayer=userData.getFirstPlayer();\n\t\tlb_currentplayername.setText(playerNames[currentPlayer]);\n\t\tplayers =new Player[4];\n\t\tfor(int i=0;i<4;i++) {\n\t\t\tif(i<numberPlayers) {\n\t\t\t\tplayers[i]=new Player(playerNames[i], false, i) {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void rollDices() {\n\t\t\t\t\t\trotatedDice1();\n\t\t\t\t\t\trotatedDice2();\n\t\t\t\t\t\t//waiting for player choose what way to go then handler that choice\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t\telse {\n\t\t\t\tplayers[i]=new Player(playerNames[i], true, i) {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void rollDices() {\n\t\t\t\t\t\trotatedDice1();\n\t\t\t\t\t\trotatedDice2();\n\t\t\t\t\t\t//randomchoice and next player rolldice\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t\tswitch (i) {\n\t\t\t\tcase 0:{\n\t\t\t\t\tplayers[i].setHorseColor(yh0, yh1, yh2, yh3);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 1:{\n\t\t\t\t\tplayers[i].setHorseColor(bh0, bh1, bh2, bh3);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 2:{\n\t\t\t\t\tplayers[i].setHorseColor(rh0, rh1, rh2, rh3);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 3:{\n\t\t\t\t\tplayers[i].setHorseColor(gh0, gh1, gh2, gh3);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void processPlayer(Player sender, CDPlayer playerData, String[] args) {\n }", "public static void createPlayers() {\n\t\tcomputer1 = new ComputerSpeler();\n\t\tspeler = new PersoonSpeler();\n//\t\tif (Main.getNumberOfPlayers() >= 3) { \n//\t\t\tSpeler computer2 = new ComputerSpeler();\n//\t\t}\n//\t\tif (Main.getNumberOfPlayers() == 4) {\n//\t\t\tSpeler computer3 = new ComputerSpeler();\n//\t\t}\n\n\n\t}", "public void gestionDeSonido() {\n if (surface.escenas == 0) {\n if (surface.sonido.players[1].isPlaying()) {\n surface.sonido.players[1].pause();\n surface.sonido.players[0].start();\n } else {\n surface.sonido.players[0].start();\n }\n\n } else if (surface.escenas >= 1 && surface.escenas < 21 && surface.escenas != 8) {\n if (!surface.sonido.players[1].isPlaying() || surface.sonido.players[2].isPlaying()) {\n surface.sonido.players[2].pause();\n surface.sonido.players[0].pause();\n surface.sonido.players[1].start();\n\n }else if(surface.sonido.players[0].isPlaying()){\n surface.sonido.players[0].pause();\n surface.sonido.players[1].start();\n\n }else{\n if(!surface.sonido.players[1].isPlaying()) {\n surface.sonido.players[1].start();\n }\n }\n } else if (surface.escena instanceof Batalla || surface.escena instanceof BatallaFinal) {\n /*if (!surface.sonido.players[2].isPlaying()) {\n surface.sonido.players[1].pause();\n\n surface.sonido.players[2] = new MediaPlayer();\n try {\n surface.sonido.players[2] = MediaPlayer.create(surface.getContext(), R.raw.darkambienceloop);\n } catch (NullPointerException e) {\n\n }\n surface.sonido.players[2].setOnPreparedListener(new MediaPlayer.OnPreparedListener() {\n\n public void onPrepared(MediaPlayer mp) {\n surface.sonido.players[2].start();\n }\n });\n }*/\n if(surface.sonido.players[1].isPlaying()&&!surface.sonido.players[2].isPlaying()){\n surface.sonido.players[1].pause();\n surface.sonido.players[2] = new MediaPlayer();\n try {\n surface.sonido.players[2] = MediaPlayer.create(surface.getContext(), R.raw.darkambienceloop);\n } catch (NullPointerException e) {\n\n }\n surface.sonido.players[2].setOnPreparedListener(new MediaPlayer.OnPreparedListener() {\n\n public void onPrepared(MediaPlayer mp) {\n surface.sonido.players[2].start();\n }\n });\n }else if(!surface.sonido.players[2].isPlaying()){\n surface.sonido.players[2].start();\n }\n\n }\n }", "private void loadPlayers() {\r\n this.passive_players.clear();\r\n this.clearRoster();\r\n //Map which holds the active and passive players' list\r\n Map<Boolean, List<PlayerFX>> m = ServiceHandler.getInstance().getDbService().getPlayersOfTeam(this.team.getID())\r\n .stream().map(PlayerFX::new)\r\n .collect(Collectors.partitioningBy(x -> x.isActive()));\r\n this.passive_players.addAll(m.get(false));\r\n m.get(true).stream().forEach(E -> {\r\n //System.out.println(\"positioning \"+E.toString());\r\n PlayerRosterPosition pos = this.getPlayerPosition(E.getCapnum());\r\n if (pos != null) {\r\n pos.setPlayer(E);\r\n }\r\n });\r\n }", "void addTeam1Members() {\n\n String pname, pinit;\n String[] aname;\n for (int x = 0; x < team1Players; x++) {\n switch (x) {\n case 0:\n aname = spnPlayer1.getSelectedItem().toString().split(\"-\");\n pname = aname[0].trim();\n pinit = aname[1].trim();\n\n setTeam1PlayerNames(pname, x);\n sT1P1 = pname;\n\n setTeam1PlayerInit(pinit, x);\n\n break;\n case 1:\n aname = spnPlayer2.getSelectedItem().toString().split(\"-\");\n pname = aname[0].trim();\n pinit = aname[1].trim();\n\n setTeam1PlayerNames(pname, x);\n sT1P2 = pname;\n\n setTeam1PlayerInit(pinit, x);\n\n break;\n case 2:\n aname = spnPlayer3.getSelectedItem().toString().split(\"-\");\n pname = aname[0].trim();\n pinit = aname[1].trim();\n\n setTeam1PlayerNames(pname, x);\n sT1P3 = pname;\n\n setTeam1PlayerInit(pinit, x);\n break;\n case 3:\n aname = spnPlayer4.getSelectedItem().toString().split(\"-\");\n pname = aname[0].trim();\n pinit = aname[1].trim();\n\n setTeam1PlayerNames(pname, x);\n sT1P4 = pname;\n\n setTeam1PlayerInit(pinit, x);\n break;\n case 4:\n aname = spnPlayer5.getSelectedItem().toString().split(\"-\");\n pname = aname[0].trim();\n pinit = aname[1].trim();\n\n setTeam1PlayerNames(pname, x);\n sT1P5 = pname;\n\n setTeam1PlayerInit(pinit, x);\n break;\n case 5:\n aname = spnPlayer6.getSelectedItem().toString().split(\"-\");\n pname = aname[0].trim();\n pinit = aname[1].trim();\n\n setTeam1PlayerNames(pname, x);\n sT1P6 = pname;\n\n setTeam1PlayerInit(pinit, x);\n break;\n\n }\n\n }\n\n }", "public void switchPlayer(){\n // Menukar giliran player dalam bermain\n Player temp = this.currentPlayer;\n this.currentPlayer = this.oppositePlayer;\n this.oppositePlayer = temp;\n }", "public void start() {\n\n // Get the players' names\n System.out.print(\"Please enter Player 1's name : \");\n String pname1 = sc.next();\n System.out.print(\"Please enter Player 2's name : \");\n String pname2 = sc.next();\n\n // totalTimes is to record how many times they played\n int totalTimes = 0;\n\n // Initialize two players\n NimPlayer player1 = new NimPlayer(pname1);\n NimPlayer player2 = new NimPlayer(pname2);\n\n // a flag to mark which player is playing, 1 means player1\n int flag = 1;\n\n // A temp player to hold two players\n NimPlayer playerTemp;\n\n // create five variables to hold upper bound, current number of\n // stones, the number of stones removal and stone symbol\n int bound;\n int currNum;\n int removeNum;\n\n // a flag to check if start the game\n boolean play = true;\n\n while (play) {\n\n // increment the total playing times\n player1.setTotalTimes(++totalTimes);\n player2.setTotalTimes(totalTimes);\n\n // enter the upper bound and initial number of stones\n System.out.print(\"Enter upper bound : \");\n bound = sc.nextInt();\n System.out.print(\"Enter initial number of stones : \");\n currNum = sc.nextInt();\n\n while (currNum != 0) {\n\n System.out.println();\n\n // show the stones\n System.out.print(currNum + \" stones left :\");\n showStone(currNum);\n\n // player1 starts playing\n if (flag == 1) {\n playerTemp = player1;\n flag = 2;\n } else {\n\n // player2 starts playing\n playerTemp = player2;\n flag = 1;\n }\n\n System.out.println();\n\n // Player1 starts playing\n removeNum = playerTemp.removeStone(currNum, bound);\n while (invalid(removeNum, bound, currNum)) {\n removeNum = playerTemp.removeStone(currNum, bound);\n }\n\n // update the current number after one round playing\n currNum -= removeNum;\n }\n\n System.out.println();\n System.out.println(\"Game Over\");\n\n // playerTemp is stored the last player\n if (flag == 1) {\n playerTemp = player1;\n } else {\n playerTemp = player2;\n }\n\n // output the winner info\n playerTemp.setWinTimes(playerTemp.getWinTimes() + 1);\n System.out.println(playerTemp.getName() + \" wins!\\n\");\n\n // set flag back to 1, which will still start from player1\n flag = 1;\n\n // Asking if they want to continue\n System.out.print(\"Do you want to play again (Y/N): \");\n\n // if no, end of start() method, back to main method\n if (sc.next().equalsIgnoreCase(\"n\")) {\n\n play = false;\n\n // show the game result\n showResult(player1, player2);\n\n // absorb the \\n\n sc.nextLine();\n }\n }\n }", "public void sp(){\r\n afcconferencefinal[0] = afcplayoff[0];\r\n afcconferencefinal[1] = afcplayoff[1];\r\n for (int c=2;c<4;c++){\r\n int b = 7-c;\r\n int a = 5-c;\r\n int cscore;\r\n int bscore;\r\n cscore = afcplayoff[c].playoffscoregenerator(afcplayoff[c].displaypf());\r\n bscore = afcplayoff[b].playoffscoregenerator(afcplayoff[b].displaypf());\r\n if (cscore > bscore){\r\n afcconferencefinal[a] = afcplayoff[c];\r\n }\r\n else if (cscore == bscore && \r\n afcplayoff[c].playoffscoregenerator(afcplayoff[c].displaypf()) > afcplayoff[b].playoffscoregenerator(afcplayoff[b].displaypf()) ) {\r\n afcconferencefinal[a] = afcplayoff[c];\r\n }\r\n else {\r\n afcconferencefinal[a] = afcplayoff[b];\r\n }\r\n\r\n }\r\n\r\n for (int c=0;c<afcconferencefinal.length;c++){\r\n if(YourTeam.getName().equals(afcconferencefinal[c].getName()))\r\n afcplayoffconferencefinalt = true;\r\n }\r\n\r\n nfcconferencefinal[0] = nfcplayoff[0];\r\n nfcconferencefinal[1] = nfcplayoff[1];\r\n for (int c=2;c<4;c++){\r\n int b = 7-c;\r\n int a = 5-c;\r\n int cscore;\r\n int bscore;\r\n cscore = nfcplayoff[c].playoffscoregenerator(nfcplayoff[c].displaypf());\r\n bscore = nfcplayoff[b].playoffscoregenerator(nfcplayoff[b].displaypf());\r\n if (cscore > bscore){\r\n nfcconferencefinal[a] = nfcplayoff[c];\r\n }\r\n else if (cscore == bscore && \r\n nfcplayoff[c].playoffscoregenerator(nfcplayoff[c].displaypf()) > nfcplayoff[b].playoffscoregenerator(nfcplayoff[b].displaypf()) ) {\r\n nfcconferencefinal[a] = nfcplayoff[c];\r\n }\r\n else {\r\n nfcconferencefinal[a] = nfcplayoff[b];\r\n }\r\n\r\n }\r\n\r\n for (int c=0;c<nfcconferencefinal.length;c++){\r\n if(YourTeam.getName().equals(nfcconferencefinal[c].getName()))\r\n nfcplayoffconferencefinalt = true;\r\n }\r\n\r\n System.out.println(\"Now for the second round of the playoffs:\"+ \"\\n\"); \r\n try\r\n {\r\n Thread.sleep(3000);\r\n }\r\n catch (Exception e)\r\n {}\r\n System.out.println(afcconferencefinal[0].getName());\r\n System.out.println(\" \\\\-----\\\\\");\r\n System.out.println(\" )\" );\r\n System.out.println(\" /-----/\");\r\n System.out.println(afcconferencefinal[3].getName() + \"\\n\");\r\n\r\n System.out.println(afcconferencefinal[1].getName());\r\n System.out.println(\" \\\\-----\\\\\");\r\n System.out.println(\" )\" );\r\n System.out.println(\" /-----/\");\r\n System.out.println(afcconferencefinal[2].getName() + \"\\n\" );\r\n\r\n System.out.println(\"\\n\"); \r\n System.out.println(nfcconferencefinal[0].getName());\r\n System.out.println(\" \\\\-----\\\\\");\r\n System.out.println(\" )\" );\r\n System.out.println(\" /-----/\");\r\n System.out.println(nfcconferencefinal[3].getName() + \"\\n\");\r\n\r\n System.out.println(nfcconferencefinal[1].getName());\r\n System.out.println(\" \\\\-----\\\\\");\r\n System.out.println(\" )\" );\r\n System.out.println(\" /-----/\");\r\n System.out.println(nfcconferencefinal[2].getName() + \"\\n\" );\r\n\r\n for (int c=0;c<2;c++){ // Here all of the teams in the conference final play each other\r\n int t = 3-c;\r\n int firstscore = afcconferencefinal[c].playoffscoregenerator(afcconferencefinal[c].displaypf());\r\n int secondscore = afcconferencefinal[t].playoffscoregenerator(afcconferencefinal[t].displaypf());\r\n if (secondscore > firstscore){\r\n Temp = afcconferencefinal[c];\r\n afcconferencefinal[c] = afcconferencefinal[t];\r\n afcconferencefinal[t] = afcconferencefinal[c];\r\n }\r\n else if (secondscore == firstscore &&\r\n afcconferencefinal[t].playoffscoregenerator(afcconferencefinal[t].displaypf()) > afcconferencefinal[c].playoffscoregenerator(afcconferencefinal[c].displaypf())){\r\n Temp = afcconferencefinal[c];\r\n afcconferencefinal[c] = afcconferencefinal[t];\r\n afcconferencefinal[t] = afcconferencefinal[c];\r\n }\r\n }\r\n for (int c=0;c<2;c++){ // Here all of the teams in the conference final play each other\r\n int t = 3-c;\r\n int firstscore = nfcconferencefinal[c].playoffscoregenerator(nfcconferencefinal[c].displaypf());\r\n int secondscore = nfcconferencefinal[t].playoffscoregenerator(nfcconferencefinal[t].displaypf());\r\n if (secondscore > firstscore){\r\n Temp = nfcconferencefinal[c];\r\n nfcconferencefinal[c] = nfcconferencefinal[t];\r\n nfcconferencefinal[t] = nfcconferencefinal[c];\r\n }\r\n else if (secondscore == firstscore &&\r\n nfcconferencefinal[t].playoffscoregenerator(nfcconferencefinal[t].displaypf()) > nfcconferencefinal[c].playoffscoregenerator(nfcconferencefinal[c].displaypf())){\r\n Temp = nfcconferencefinal[c];\r\n nfcconferencefinal[c] = nfcconferencefinal[t];\r\n nfcconferencefinal[t] = nfcconferencefinal[c];\r\n }\r\n }\r\n for (int c=0;c<1;c++){\r\n if (YourTeam.getName().equals(afcconferencefinal[c].getName())){\r\n afcpresuperbowl = true; \r\n }\r\n }\r\n for (int c=0;c<1;c++){\r\n if (YourTeam.getName().equals(nfcconferencefinal[c].getName())){\r\n nfcpresuperbowl = true; \r\n }\r\n }\r\n try\r\n {\r\n Thread.sleep(3000);\r\n }\r\n catch (Exception e)\r\n {}\r\n System.out.println(\"...\"+\"\\n\");\r\n try\r\n {\r\n Thread.sleep(3000);\r\n }\r\n catch (Exception e)\r\n {}\r\n System.out.println(\"In the conference finals we have the following teams playing each other in the afc and in the nfc\" + \"\\n\");\r\n try\r\n {\r\n Thread.sleep(3000);\r\n }\r\n catch (Exception e)\r\n {}\r\n // More demonstration to user on how the playoffs are progressing\r\n System.out.println(\"AFC:\" + \"\\n\");\r\n System.out.println(afcconferencefinal[0].getName());\r\n System.out.println(\" \\\\-----\\\\\");\r\n System.out.println(\" )\" );\r\n System.out.println(\" /-----/\");\r\n System.out.println(afcconferencefinal[1].getName()+ \"\\n\");\r\n\r\n System.out.println(\"NFC:\" + \"\\n\");\r\n\r\n System.out.println(nfcconferencefinal[0].getName());\r\n System.out.println(\" \\\\-----\\\\\");\r\n System.out.println(\" )\" );\r\n System.out.println(\" /-----/\");\r\n System.out.println(nfcconferencefinal[1].getName());\r\n\r\n { int firstscore = nfcconferencefinal[0].playoffscoregenerator(nfcconferencefinal[0].displaypf());\r\n int secondscore = nfcconferencefinal[1].playoffscoregenerator(nfcconferencefinal[1].displaypf());\r\n if (firstscore > secondscore){\r\n superbowl[0] = nfcconferencefinal[0];\r\n }\r\n else if (firstscore > secondscore &&\r\n nfcconferencefinal[0].playoffscoregenerator(nfcconferencefinal[0].displaypf()) > nfcconferencefinal[1].playoffscoregenerator(nfcconferencefinal[1].displaypf())){\r\n superbowl[0] = nfcconferencefinal[0];\r\n }\r\n else {\r\n superbowl[0] = nfcconferencefinal[1]; \r\n }\r\n }\r\n\r\n { int firstscore = afcconferencefinal[0].playoffscoregenerator(afcconferencefinal[0].displaypf());\r\n int secondscore = afcconferencefinal[1].playoffscoregenerator(afcconferencefinal[1].displaypf());\r\n if (firstscore > secondscore){\r\n superbowl[1] = afcconferencefinal[0];\r\n }\r\n else if (firstscore > secondscore &&\r\n afcconferencefinal[0].playoffscoregenerator(afcconferencefinal[0].displaypf()) > afcconferencefinal[1].playoffscoregenerator(afcconferencefinal[1].displaypf())){\r\n superbowl[1] = afcconferencefinal[0];\r\n }\r\n else {\r\n superbowl[1] = afcconferencefinal[1]; \r\n }\r\n }\r\n for (int c=0;c<superbowl.length;c++){\r\n if(YourTeam.getName().equals(superbowl[c].getName()))\r\n superbowlt = true;\r\n }\r\n try\r\n {\r\n Thread.sleep(3000);\r\n }\r\n catch (Exception e)\r\n {}\r\n System.out.println(\"\\n\"+ \"...\");\r\n System.out.println(\"\\n\"+\"Now for this years long awaited Super bowl; the competing teams are:\"+ \"\\n\");\r\n try\r\n {\r\n Thread.sleep(3000);\r\n }\r\n catch (Exception e)\r\n {}\r\n System.out.println(superbowl[0].getName());\r\n System.out.println(\" \\\\-----\\\\\");\r\n System.out.println(\" ) V.S\" );\r\n System.out.println(\" /-----/\");\r\n System.out.println(superbowl[1].getName()+\"\\n\");\r\n System.out.println(\"...\" + \"\\n\");\r\n try\r\n {\r\n Thread.sleep(3000);\r\n }\r\n catch (Exception e)\r\n {}\r\n { int firstscore = superbowl[0].playoffscoregenerator(superbowl[0].displaypf());\r\n int secondscore = superbowl[1].playoffscoregenerator(superbowl[1].displaypf());\r\n if (firstscore > secondscore){\r\n Champs = superbowl[0];\r\n }\r\n else if (firstscore > secondscore &&\r\n superbowl[0].playoffscoregenerator(superbowl[0].displaypf()) > superbowl[1].playoffscoregenerator(superbowl[1].displaypf())){\r\n Champs = superbowl[0];\r\n }\r\n else {\r\n Champs = superbowl[1];\r\n }\r\n }\r\n System.out.println(\"In the final minutes of the game the \" + Champs.getName() + \" pull off multiple miraculous passes to win the game.\" + \"\\n\");\r\n for (int c=0;c<league.length;c++){\r\n for (int p=0;p<31;p++) {\r\n int a = p+1;\r\n if (league[a].displaywins() > league[p].displaywins()){\r\n Temp = league[p];\r\n league[p] = league[a];\r\n league[a] = Temp;\r\n }\r\n else if (league[a].displaywins() == league[p].displaywins() && league[a].displaypf() > league[p].displaypf()){\r\n Temp = league[p];\r\n league[p] = league[a];\r\n league[a] = Temp;\r\n }\r\n\r\n }\r\n }\r\n for (int c=0;c<league.length;c++){\r\n if (league[c].getName().equals(selected)){\r\n System.out.println(\"Your team finished number \" + c + \" out of 32 teams, the number 1 team being the best team in the regular season.\" + \"\\n\");\r\n break;\r\n }\r\n\r\n } \r\n // Here I let the user know how his team did.\r\n if(afcplayofft == true){\r\n System.out.println(\"Your team made the playoffs.\"); \r\n }\r\n else if(nfcplayofft == true){\r\n System.out.println(\"Your team made the playoffs.\"); \r\n }\r\n else{\r\n System.out.println(\"Your team did not make the playoffs.\"); \r\n }\r\n if(afcplayoffconferencefinalt == true){\r\n System.out.println(\"Your team made wild card round.\");\r\n }\r\n else if (nfcplayoffconferencefinalt == true){\r\n System.out.println(\"Your team made the wild card round.\");\r\n }\r\n else{\r\n System.out.println(\"Your team did not make the wild card round.\");\r\n }\r\n if(afcpresuperbowl == true){\r\n System.out.println(\"Your team made the conference finals.\");\r\n }\r\n else if (nfcpresuperbowl == true){\r\n System.out.println(\"Your team made the conference finals.\");\r\n }\r\n else{\r\n System.out.println(\"Your team did not make the conference finals.\");\r\n }\r\n if(superbowlt == true){\r\n System.out.println(\"Your team made the super bowl final.\");\r\n }\r\n else{ \r\n System.out.println(\"Your team did not make the super bowl final.\");\r\n }\r\n if (selected.equals(Champs.getName())){\r\n System.out.println(\"Your team won the super bowl!\");\r\n }\r\n else{\r\n System.out.println(\"Your team did not win the super bowl.\" + \"\\n\");\r\n }\r\n System.out.println(\"Simulation Terminated!\");\r\n\r\n }", "public void masterProg() {\n\t\tmoveObjsToGoals();\r\n\t}", "private void getPlayers() {\r\n\t\tSystem.out.println(\"How Many Players: \");\r\n\t\tpnum = getNumber(1, 3);\r\n\r\n\t\tfor(int i=0; i < pnum; i++){\r\n\t\t\tSystem.out.println(\"What is player \" + (i + 1) + \"'s name? \");\r\n\t\t\tString name = sc.next();\r\n\t\t\tboolean dupe = true;\r\n\t\t\twhile(dupe){\r\n\t\t\t\tint samecounter = 0;\r\n\t\t\t\tfor(Player p : players){\r\n\t\t\t\t\tif(name.equals(p.getName())){\r\n\t\t\t\t\t\tsamecounter += 1;\r\n\t\t\t\t\t\tSystem.out.println(\"Name is the same as another players. Please choose another name: \");\r\n\t\t\t\t\t\tname = sc.next();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(samecounter == 0){\r\n\t\t\t\t\tdupe = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tplayers.add(new Player(name));\r\n\r\n\t\t}\r\n\t}", "@Override\n public void run(){\n ServerConnection[] clients = new ServerConnection[]{client2, client3, client1};\n\n for( ServerConnection c : clients ) {\n if ( c != null ){\n if ( client3 == null ){\n c.send(\"Game has started with code:\" + gameID + \".\\n\" + \"Current players are \" +\n client1.getName() + \", \" + client2.getName());\n }\n else {\n c.send(\"Game has started with code:\" + gameID + \".\\n\" + \"Current players are \" +\n client1.getName() + \", \" + client2.getName() + \", \" + client3.getName());\n }\n c.setGameID(gameID);\n }\n }\n\n String[] gods = readChallengerMessage();\n\n for (int i=0; i<2 && currClient != client1; i++){\n currClient.send(Arrays.toString(gods) );\n clientMessage = readClientMessage();\n if (i == 0) {\n gameMessage.setGod2(clientMessage.getGod());\n gameMessage.setName2(clientMessage.getName());\n } else if (i == 1) {\n gameMessage.setGod3(clientMessage.getGod());\n gameMessage.setName3(clientMessage.getName());\n }\n List<String> list = new ArrayList<String>(Arrays.asList(gods));\n list.remove( clientMessage.getGod().name());\n gods = list.toArray(new String[0]);\n currClient.send(\"Choice confirmed\");\n updateCurrClient();\n }\n\n currClient.send(gods[0]);\n gameMessage.setGod1(God.valueOf(gods[0]));\n gameMessage.setName1(client1.getName());\n updateCurrClient();\n resetUpdate();\n gameMessage.notify(gameMessage);\n sendLiteGame();\n\n for( ServerConnection c : clients ) {\n resetUpdate();\n if ( c != null ) {\n while ( !updateModel) {\n sendToCurrClient(\"Placing workers\");\n clientMessage = readClientMessage();\n gameMessage.setSpace1(clientMessage.getSpace1());\n gameMessage.setSpace2(clientMessage.getSpace2());\n gameMessage.notify(gameMessage);\n if (!updateModel) {\n sendLiteGame();\n }\n }\n updateCurrClient();\n liteGame.setPlayer(currClient.getName());\n sendLiteGame();\n }\n }\n\n\n while ( !endOfTheGame ) {\n sendToCurrClient(\"Next action\");\n clientMessage = readClientMessage();\n\n if ( \"Choose Worker\".equals(clientMessage.getAction()) ) {\n chooseWorker();\n }\n else if ( \"Charon Switch\".equals(clientMessage.getAction()) ) {\n charonSwitch();\n }\n else if ( \"Prometheus Build\".equals(clientMessage.getAction()) ) {\n build();\n }\n else if ( \"Move\".equals(clientMessage.getAction()) ) {\n move();\n }\n else if ( \"Build\".equals(clientMessage.getAction()) ) {\n build();\n }\n\n if ( \"End\".equals(clientMessage.getAction()) ) {\n gameMessage.resetGameMessage();\n updateCurrClient();\n liteGame.setCurrWorker(5,5);\n liteGame.setPlayer(currClient.getName());\n sendLiteGame();\n }\n else {\n sendLiteGame();\n if ( !endOfTheGame && !playerRemoved ) {\n if (!updateModel) {\n currClient.send(\"Invalid action\");\n } else currClient.send(\"Action performed\");\n }\n else playerRemoved = false;\n }\n }\n\n sendToCurrClient(\"You won the match.\");\n server.endMatch(gameID, null);\n }", "private void assignCards(Pile wholeDeck, Player[] players) {\n ArrayList<Pile> setOfDecks = wholeDeck.split(players.length);\n for (int i = 0; i < players.length; i++) {\n Player player = players[i];\n Pile playerDeck = setOfDecks.get(i);\n player.addToDeck(playerDeck);\n\n // --- DEBUG LOG ---\n // The contents of the user’s deck and the computer’s deck(s) once they have been\n // allocated.\n String isAILabel = player instanceof AIPlayer ? \"AI\" : \"USER\";\n Logger.log(String.format(\"(%s) %s's DECK AFTER ALLOCATION:\", isAILabel, player),\n playerDeck.toString());\n\n }\n communalPile = setOfDecks.get(players.length);\n\n // --- DEBUG LOG ---\n // Initial communal deck contents.\n Logger.log(\"INITIAL COMMUNAL DECK CONTENTS\", communalPile.toString());\n }", "private void specialPowersPhase() {\n \tSpecialCharacter tmpPiece = null;\n \tTerrain theHex = null;\n\n for (Player p : playerList) {\n pause();\n this.player = p;\n player.flipAllUp();\n ClickObserver.getInstance().setActivePlayer(this.player);\n \n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n Game.getRackGui().setOwner(player);\n }\n });\n /*\n * Loops through all of the hexes that the player has pieces on.\n * If one of the pieces is either Master Thief or Assassin Primus, perform their\n * special ability.\n */\n for (Terrain hex : player.getHexesWithPiece()) {\n for (Piece pc : hex.getContents(player.getName()).getStack()) {\n if (pc.getName().equals(\"Master Thief\") || pc.getName().equals(\"Assassin Primus\")) { \n ((Performable)pc).specialAbility();\n if (MasterThief.isReturnPiece() || AssassinPrimus.isReturnPiece()) {\n \ttmpPiece = (SpecialCharacter)pc;\n \ttheHex = hex;\n \ttmpPiece.returnToBank(theHex);\n \tbreak;\n }\n }\n }\n }\n player.flipAllDown();\n }\n ClickObserver.getInstance().setPlayerFlag(\"\");\n\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n DiceGUI.getInstance().setFaceValue(0);\n DiceGUI.getInstance().cover();\n }\n });\n }", "public void parseSubs(){\n\t\t\n\t\t\n\t}", "private void startUpPhase()\n\t{\n\t\tmap.distributeCountries(); /* Randomly split the countries between the players */\n\t\tArrayList<Player> remainingPlayers = new ArrayList<Player>(map.players);\n\t\t\n\t\tdo \n\t\t{\n\t\t\tIterator<Player> i = remainingPlayers.iterator();\n\t\t\t\n\t\t\twhile (i.hasNext()) \n\t\t\t{\n\t\t\t\tPlayer p = i.next();\n\t\t\t\tif(p.getArmies() == 0) \n\t\t\t\t{\n\t\t\t\t\ti.remove();\n\t\t\t\t} \n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\tp.placeOneArmy();\n\t\t\t\t}\n\t\t\t}\n\t\t}while(remainingPlayers.size() != 0);\n\t}", "void subMenuCommand(String command){\n\t\tString[] strArray=command.split(\"\\\\s\");\n\t\tString mainCommand=strArray[0];\n\t\t\n\t\t// if - else if - else loop to check for the particular command and take actions according those commands\n\t\t\n\t\t// Block to delete the given song id from the current playlist\n\t\tif(mainCommand.equals(\"delete\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length==2){\n\t\t\t\t\tint songID=Integer.parseInt(strArray[1]);\n\t\t\t\t\tPlaylist pl=songFile.playlistArray.get(currentPlaylistID);\n\t\t\t\t\tpl.deleteSong(new Integer(songID));\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid delete command!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Block to insert the given song id to current playlist\n\t\telse if(mainCommand.equals(\"insert\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length==2){\n\t\t\t\t\tint songID=Integer.parseInt(strArray[1]);\n\t\t\t\t\tif(songFile.isSongIdAvailable(songID)){//songID<songFile.songID){\n\t\t\t\t\t\tPlaylist pl=songFile.playlistArray.get(currentPlaylistID);\n\t\t\t\t\t\tpl.insertSong(new Integer(songID));\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tSystem.out.println(\"Song with the given ID does not exists!!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid insert command!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Block to print the current playlist \n\t\telse if(mainCommand.equals(\"print\")){\n\t\t\tif(strArray.length==1){\n\t\t\t\tsongFile.printPlaylist(currentPlaylistID);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t// Block to sort and print the songs of the current playlist by the given song attribute \n\t\telse if(mainCommand.equals(\"sort\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length==2){\n\t\t\t\t\tString subCommand=strArray[1];\n\t\t\t\t\tif(subCommand.equals(\"artist\") || subCommand.equals(\"title\")){\n\t\t\t\t\t\tsongFile.sortPlaylistSongs(currentPlaylistID, subCommand);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid sort command!!\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t// Block to search the playlist for the songs with user given attributes and search terms\n\t\telse if(mainCommand.equals(\"search\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length>2){\n\t\t\t\t\tString subCommand=strArray[1];\n\t\t\t\t\t// Get search string from command\n\t\t\t\t\tString songAttributeValue=command.substring(command.indexOf(\"\\\"\")+1,command.lastIndexOf(\"\\\"\")).toLowerCase();\n\t\t\t\t\tif(subCommand.equals(\"artist\") || subCommand.equals(\"title\")){\n\t\t\t\t\t\tArrayList<Song> list=songFile.searchPlaylist(currentPlaylistID, subCommand, songAttributeValue);\n\t\t\t\t\t\tsongFile.printArrayList(list);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!! No search terms\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid search command!!\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t// Block to search the for the songs and insert to the current playlist\n\t\telse if(mainCommand.equals(\"insert_search\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length>2){\n\t\t\t\t\tString subCommand=strArray[1];\n\t\t\t\t\t// Get search string from command\n\t\t\t\t\tString songAttributeValue=command.substring(command.indexOf(\"\\\"\")+1,command.lastIndexOf(\"\\\"\")).toLowerCase();\n\t\t\t\t\tif(subCommand.equals(\"artist\") || subCommand.equals(\"title\")){\n\t\t\t\t\t\tArrayList<Song> list=songFile.searchSong(subCommand, songAttributeValue);\n\t\t\t\t\t\tPlaylist playlist=songFile.playlistArray.get(currentPlaylistID);\n\t\t\t\t\t\tif(list!= null && list.size()>0){\n\t\t\t\t\t\t\tfor(Song s:list){\n\t\t\t\t\t\t\t\tSystem.out.println(\"Inserting song:\"+s.getSongArtist());\n\t\t\t\t\t\t\t\tplaylist.insertSong(s.getSongId());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tSystem.out.println(\"No matching songs found!!\");\n\t\t\t\t\t\t}\n\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(\"Invalid Command!!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!! No search terms\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid insert_search command!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Block for other invalid commands\n\t\telse{\n\t\t\tSystem.out.println(\"Please enter a valid command.\");\n\t\t}\n\t\t\n\t\n\t}", "private void processPacket(DatagramPacket packet) {\n String data = new String(packet.getData());\n if (data.startsWith(\"/c/\")) {\n int ID = UniqueIdentifier.getIdentifier();\n clients.add(new ServerClient(data.split(\"/c/|/e/\")[1], packet.getAddress(), packet.getPort(), ID));\n System.out.println(\"Client connected with the name: '\" + data.split(\"/c/|/e/\")[1] + \"' @ \" + packet.getAddress() + \":\" + packet.getPort() + \" and is now using the ID: \" + ID);\n send((\"/c/\" + ID + \"/e/\").getBytes(), packet.getAddress(), packet.getPort());\n } else if (data.startsWith(\"/d/\")) {\n disconnect(Integer.parseInt(data.split(\"/d/|/e/\")[1]), true);\n } else if (data.startsWith(\"/sa/\")) {\n sendToAll((\"/m/\" + data.split(\"/sa/|/e/\")[1] + \"/e/\").getBytes());\n } else if (data.startsWith(\"/s/\")) { //TODO - FIX INDIVIDUAL PACKET SENDING\n String decodedData = data.split(\"/s/|/e/\")[1];\n String targetID = decodedData;\n targetID = targetID.substring(targetID.indexOf(\"&\") + 1);\n targetID = targetID.substring(0, targetID.indexOf(\"&\"));\n int id = Integer.parseInt(targetID);\n decodedData = decodedData.replace(\"&\" + id + \"&\", \"\");\n ServerClient targetClient = null;\n for (ServerClient item : clients) {\n if (item.getID() == id) {\n targetClient = item;\n break;\n }\n }\n assert targetClient != null;\n send(decodedData.getBytes(), targetClient.getAddress(), targetClient.getPort());\n } else if (data.startsWith(\"/p/\")) {\n clientResponse.add(Integer.parseInt(data.split(\"/p/|/e/\")[1]));\n } else if (data.startsWith(\"/dp/\")) {\n sendToAll(data.substring(0, data.length() - 3).getBytes());\n } else {\n System.out.println(packet.getAddress() + \":\" + packet.getPort() + \" sent an unknown packet: \" + data);\n }\n }", "protected void updatePlayer(Player player, PacketBuilder packet) {\n\n /*\n * The update block packet holds update blocks and is send after the\n * master packet.\n */\n PacketBuilder updateBlock = new PacketBuilder();\n\n /*\n * Updates this player.\n */\n manageMovement(true, player, packet);\n masks(player, updateBlock, false);\n\n /*\n * Write the current size of the player list.\n */\n packet.putBits(8, player.getLocalPlayers().size());\n\n /*\n * Iterate through the local player list.\n */\n for (Iterator<Player> it$ = player.getLocalPlayers().iterator(); it$.hasNext(); ) {\n /*\n * Get the next player.\n */\n Player otherPlayer = it$.next();\n\n /*\n * If the player should still be in our list.\n */\n if (WorldModule.getLogic().getPlayers().contains(otherPlayer)\n && !otherPlayer.basicSettings().isTeleporting()\n && otherPlayer.getLocation().withinRange(\n player.getLocation())) {\n /*\n * Update the movement.\n */\n manageMovement(false, otherPlayer, packet);\n\n /*\n * Check if an update is required, and if so, send the update.\n */\n if (otherPlayer.getMasks().requiresUpdate()) {\n masks(otherPlayer, updateBlock, false);\n }\n } else {\n /*\n * Otherwise, remove the player from the list.\n */\n it$.remove();\n\n /*\n * Tell the client to remove the player from the list.\n */\n packet.putBits(1, 1);\n packet.putBits(2, 3);\n }\n }\n\n /*\n * Loop through every player.\n */\n for (Player otherPlayer : WorldModule.getLogic().getLocalPlayers(player.getLocation())) {\n /*\n * Check if there is room left in the local list.\n */\n if (player.getLocalPlayers().size() >= 255) {\n /*\n * There is no more room left in the local list. We cannot\n * add more players, so we just ignore the extra ones. They\n * will be added as other players get removed.\n */\n break;\n }\n\n /*\n * If they should not be added ignore them.\n */\n if (otherPlayer == null || otherPlayer == player\n || player.getLocalPlayers().contains(otherPlayer) || otherPlayer.isReleased()) {\n continue;\n }\n\n /*\n * Add the player to the local list if it is within distance.\n */\n player.getLocalPlayers().add(otherPlayer);\n\n /*\n * Add the player in the packet.\n */\n addPlayer(packet, player, otherPlayer);\n\n /*\n * Update the player, forcing the appearance flag.\n */\n masks(otherPlayer, updateBlock, true);\n }\n\n /*\n * Check if the update block is not empty.\n */\n if (updateBlock.getPosition() != 0) {\n /*\n * Write a magic id indicating an update block follows.\n */\n packet.putBits(11, 2047);\n packet.recalculateBitPosition();\n\n /*\n * Add the update block at the end of this packet.\n */\n packet.put(updateBlock.toPacket().getBytes());\n } else {\n /*\n * Terminate the packet normally.\n */\n packet.recalculateBitPosition();\n }\n /*\n * Write the packet.\n */\n player.write(packet.toPacket());\n }", "public void addPlayer(String playerID) {\r\n\t\tplayerCount++;\r\n\t\tString name = guild.getMemberById(playerID).getEffectiveName();\r\n\t\t// Set up each player uniquely\r\n\t\tif (p2 == null) {\r\n\t\t\tp2 = new Player(1,playerID,GlobalVars.pieces.get(\"blue\"));\r\n\t\t\tp2.getPiece().setX(GlobalVars.playerCoordsPerRoom[0][0]+GlobalVars.playersOffset[1][0]);\r\n\t\t\tp2.getPiece().setY(GlobalVars.playerCoordsPerRoom[0][1]+GlobalVars.playersOffset[1][1]);\r\n\t\t\tplayers.add(p2);\r\n\t\t\tp1.setNextPlayer(p2);\r\n\t\t\tp2.setNextPlayer(p1);\r\n\t\t\tgameChannel.sendMessage(\"**\"+name+\"** has reincarnated as the BLUE adventurer\").queue();\r\n\t\t} else if (p3 == null) {\r\n\t\t\tp3 = new Player(2,playerID,GlobalVars.pieces.get(\"yellow\"));\r\n\t\t\tp3.getPiece().setX(GlobalVars.playerCoordsPerRoom[0][0]+GlobalVars.playersOffset[2][0]);\r\n\t\t\tp3.getPiece().setY(GlobalVars.playerCoordsPerRoom[0][1]+GlobalVars.playersOffset[2][1]);\r\n\t\t\tplayers.add(p3);\r\n\t\t\tp2.setNextPlayer(p3);\r\n\t\t\tp3.setNextPlayer(p1);\r\n\t\t\tgameChannel.sendMessage(\"**\"+name+\"** has reincarnated as the YELLOW adventurer\").queue();\r\n\t\t} else if (p4 == null) {\r\n\t\t\tp4 = new Player(3,playerID,GlobalVars.pieces.get(\"green\"));\r\n\t\t\tp4.getPiece().setX(GlobalVars.playerCoordsPerRoom[0][0]+GlobalVars.playersOffset[3][0]);\r\n\t\t\tp4.getPiece().setY(GlobalVars.playerCoordsPerRoom[0][1]+GlobalVars.playersOffset[3][1]);\r\n\t\t\tplayers.add(p4);\r\n\t\t\tp3.setNextPlayer(p4);\r\n\t\t\tp4.setNextPlayer(p1);\r\n\t\t\tgameChannel.sendMessage(\"**\"+name+\"** has reincarnated as the GREEN adventurer\").queue();\r\n\t\t}\r\n\t}", "public static void savePlayerNames() {\r\n\t\tMain.player1 = GameSetup.choiceBoxPlayer1.getSelectedItem();\r\n\t\tMain.player2 = GameSetup.choiceBoxPlayer2.getSelectedItem();\r\n\t\tMain.player3 = GameSetup.choiceBoxPlayer3.getSelectedItem();\r\n\t\t\r\n\t\t//Don't show fourth player if playing 3 handed game.\r\n\t\tif (!Main.isThreeHanded) {\r\n\t\t\tMain.player4 = GameSetup.choiceBoxPlayer4.getSelectedItem();\r\n\t\t}\r\n\t}", "private void eliminatePlayers() {\n \n Iterator<Player> iter = players.iterator();\n\n while (iter.hasNext()) {\n Player player = iter.next();\n\n if (player.getList().isEmpty()) {\n iter.remove();\n if (player.getIsHuman()) {\n setGameState(GameState.HUMAN_OUT);\n }\n // need to remember that due to successive draws, the active player could run\n // out of cards\n // select a new random player if player gets eliminated\n if (!players.contains(activePlayer)) {\n selectRandomPlayer();\n }\n }\n }\n }", "private void transferCards(Player player) {\r\n\t\twhile(warPile.size() > 0) {\r\n\t\t\tplayer.addToWinningsPile(warPile.remove(0));\r\n\t\t}\r\n\t}", "public void startNewMatch() {\n // Limpia el score de cada jugador y los pone en no listo\n for (Player p : players) {\n p.resetScore();\n p.setReady(false);\n }\n }", "public void nextPlayer() {\n\t\tif (currentPlayer.equals(vServerThread.get(0))){\n\t\t\tcurrentPlayer=vServerThread.get(1);\n\t\t} else if (currentPlayer.equals(vServerThread.get(1))){\n\t\t\tcurrentPlayer=vServerThread.get(0);\n\t\t}\n\t}", "private void moveTheCardsTotheWinner(int winPlayer,Player tempPlayer)\n {\n for(int i=0;i<tempPlayer.getLastIndex();i++)\n if(winPlayer == 1)\n FirstPlayer.addCardToBegining(tempPlayer.removeTheCard());\n else if (winPlayer == 2) \n SecondPlayer.addCardToBegining(tempPlayer.removeTheCard()); \n }", "public void cardToAll() {\n\t\tfor(ClientThread player: players) {\n\t\t\tcardToOne(player);\n\t\t\ttry {Thread.sleep(200);}catch(Exception exc) {exc.printStackTrace();}\n\t\t}\n\t}", "public void updateMasterFromHW() {\n\t\tnew subControlOperator() {\n @Override\n\t\t\tpublic void operate(Control c) {\n\t\t\t\tif (c instanceof SubZoneVolumeControl) {\n\t\t\t\t\tSubZoneVolumeControl vc = (SubZoneVolumeControl) c;\n\t\t\t\t\tvc.updateValuesFromHardware();\n\t\t\t\t}\n\t\t\t}\n\t\t}.iterate();\n\n\t\t// Update the master control for Volume\n\t\tGetVolumeFromHWOperator volOp = new GetVolumeFromHWOperator();\n\t\tvolOp.iterate();\n\t\tmaster.forceVolume(volOp.volume);\n\n\t\t// Update the master control for Mute\t\t\n\t\tGetMuteFromHWOperator muteOp = new GetMuteFromHWOperator();\n\t\tmuteOp.iterate();\n\t\tmaster.forceMute(muteOp.mute);\n\t}", "public static void startMultiMod() {\n System.out.println(\"Starting MultiMode!\");\n System.out.println(\"Human 1 discs are showed: \" + '\\u26AA');\n System.out.println(\"Human 2 discs are showed: \" + '\\u26AB');\n Board board = new Board();\n Human human1 = new Human(1);\n Human human2 = new Human(2);\n //if non of two players has a turn the game will be finished\n boolean human1HasTurn = true;\n boolean human2HasTurn = true;\n while (true) {\n while (true) {\n //checking if the player can have any putting if not the turn will be passed to the next one\n boolean passTurn = human1.checkCanPut();\n if (!passTurn) {\n human1HasTurn = false;\n System.out.println(\"Pass!\");\n break;\n }\n board.printBoard();\n System.out.println(\"Human 1 turn \"+ '\\u26AA');\n String string1 = scanner.nextLine();\n int x=-1, y=-1;\n try {\n x = string1.charAt(0) - 48;\n y = string1.charAt(2) - 64;\n } catch (StringIndexOutOfBoundsException e) {\n System.out.println(\"Wrong input , try again\");\n continue;\n }\n\n // if the player did not put the disc successfully, get another coordinate\n if (human1.putDisc(true, x, y)) {\n human1HasTurn = true;\n break;\n } else System.out.println(\"Can not put here choose another coordinate\");\n }\n while (true) {\n //checking if the player can have any putting if not the turn will be passed to the next one\n\n boolean passTurn = human2.checkCanPut();\n if (!passTurn) {\n human2HasTurn = false;\n System.out.println(\"Pass!\");\n break;\n }\n board.printBoard();\n System.out.println(\"Human 2 turn \"+ '\\u26AB');\n String string2 = scanner.nextLine();\n int x=-1, y=-1;\n try {\n x = string2.charAt(0) - 48;\n y = string2.charAt(2) - 64;\n\n } catch (StringIndexOutOfBoundsException e) {\n System.out.println(\"Wrong input , try again\");\n continue;\n }\n\n // if the player did not put the disc successfully, get another coordinate\n\n if (human2.putDisc(true, x, y)) {\n human2HasTurn = true;\n break;\n } else System.out.println(\"Can not put here choose another coordinate\");\n }\n //checking the end of game\n if (!(human1HasTurn || human2HasTurn)) {\n System.out.println(\"The game has finished!\");\n System.out.println(\"Human 1 caught \" + Board.pointCounter(1) + \" points\");\n System.out.println(\"Human 2 caught \" + Board.pointCounter(2) + \" points\");\n\n if (Board.pointCounter(1) > Board.pointCounter(2))\n System.out.println(\"Human 1 won the game!\");\n else if (Board.pointCounter(1) < Board.pointCounter(2))\n System.out.println(\"Human 2 won the game!\");\n else if (Board.pointCounter(1) == Board.pointCounter(2))\n System.out.println(\"The game drew!\");\n break;\n }\n }\n }", "public void sendNameInfoToAll(){\r\n\t\t\r\n\t\tVector<Player> players = lobby.getLobbyPlayers();\t\r\n\t\tString message = \"UDNM\" + lobby.getNameString();\r\n\t\t\r\n\t\tif(!players.isEmpty()){\r\n\t \tfor(int i=0; i<players.size(); i++){\t \t\t\r\n\t \t\tsendOnePlayer(players.get(i), message);\t \t\t\r\n\t \t}\r\n\t\t}\r\n\t}", "public void setSinglePlayer(){\n isSinglePlayer = true;\n }", "private void registerPlayers(SantaConfig sc) {\n // Second try.\n Set<String> keys = sc.getBaseKeys(\"registered\");\n for(String key : keys) {\n String name = sc.getBaseString(\"registered.\" + key);\n UUID id = UUID.fromString(key);\n playerRegistry.put(id, name);\n }\n }", "private void removePlayerFromTheGame(){\n ServerConnection toRemove = currClient;\n\n currClient.send(\"You have been removed from the match!\");\n updateCurrClient();\n server.removePlayerFromMatch(gameID, toRemove);\n\n if ( toRemove == client1 ){\n this.client1 = null;\n }\n else if ( toRemove == client2 ){\n this.client2 = null;\n }\n else {\n client3 = null;\n }\n gameMessage.notify(gameMessage);\n\n if ( (client1 == null && client2 == null) || (client2 == null && client3 == null) || (client1 == null && client3 == null) ){\n gameMessage.notify(gameMessage);\n }\n if ( liteGame.isWinner() ) endOfTheGame = true;\n playerRemoved = true;\n }", "public void receiveMessage(String line)\n \t{\n \t\t\tString[] msg = line.split(\" \", 4);\n \t\t\tString user = \"#UFPT\";\n \n \t\t\t//this is kind of a nasty solution...\n \n \t\t\tif(msg[0].indexOf(\"!\")>1)\n \t\t\t\tuser = msg[0].substring(1,msg[0].indexOf(\"!\"));\n \t\t\t\n \t\t\tPlayer temp = new Player(user);\n \t\t\tint index = players.indexOf(temp);\n \t\t\t\n \t\t\tString destination = msg[2];\n \t\t\tString command = msg[3].toLowerCase();\n \t\t\tif(command.equalsIgnoreCase(\":!start\"))\n \t\t\t{\n \t\t\t\tif(user.equals(startName))\t\t\n \t\t\t\t{\n \t\t\t\t\tinputThread.sendMessage(destination, \"The game has begun!\");\n\t\t\t\t\treturn;\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t\tinputThread.sendMessage(destination, \"Only \" + startName + \" can start the game!\");\n \t\t\t}\t\n \t\t\tif(command.equalsIgnoreCase(\":!join\"))\n \t\t\t{\n \t\t\t\tSystem.out.println(index);\n \t\t\t\tif(index == -1)\n \t\t\t\t{\n \t\t\t\t\tplayers.add(new Player(user));\n \t\t\t\t\tinputThread.sendMessage(destination, user + \" has joined the game!\");\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t\tinputThread.sendMessage(destination, user + \" has already joined the game!\");\n \t\t\t}\n \t\t\t\n \t\t\tif(command.equalsIgnoreCase(\":!quit\"))\n \t\t\t{\n \t\t\t\tSystem.out.println(index);\n \t\t\t\tif(index == -1)\n \t\t\t\t\tinputThread.sendMessage(destination, user + \" is not part of the game!\");\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tplayers.remove(index);\n \t\t\t\t\tinputThread.sendMessage(destination, user + \" has quit the game!\");\n \t\t\t\t}\n \t\t\t\t\n \t\t\t}\t\n \t\t\t\n \t\t\tif (command.equalsIgnoreCase(\":!end\"))\n \t\t\t{\n \t\t\t\tif (user.equals(startName))\n \t\t\t\t{\n \t\t\t\t\tinputThread.sendMessage(destination, user + \" has ended the game. Aww :(\");\n \t\t\t\t\treturn;\n \t\t\t\t\t//does this acceptably end the game? I think so but not positive\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t\tinputThread.sendMessage(destination, \"Only \" + startName + \" can end the game!\");\n \t\t\t}\n\t\t\n\t\n \t\n \t\t//assigning roles\n \t\tint numMafia = players.size()/3;\n \t\t//create the Mafia team\n \t\tfor(int a = 0; a < numMafia; ++a)\n \t\t{\n \t\t\tmafiaRoles.add(new Mafia(new MafiaTeam()));\n \t\t}\n \t\t\n \t\t//create the Town team\n \t\tfor(int a = 0; a < (players.size() - numMafia); ++a)\n \t\t{\n \t\t\ttownRoles.add(new Citizen(new Town()));\n \t\t}\n \t\tCollections.shuffle(mafiaRoles);\n \t\tCollections.shuffle(townRoles);\n \t\tfor(int a = 0; a < numMafia; ++a)\n \t\t{\n \t\t\troles.add(mafiaRoles.get(a));\n \t\t}\n \t\tfor(int a = 0; a < players.size() - numMafia; ++a)\n \t\t{\n \t\t\troles.add(townRoles.get(a));\n \t\t}\n \t\tfor(int a = 0; a < players.size(); ++a)\n \t\t{\n \t\t\tplayers.get(a).role = roles.get(a);\n \t\t\tinputThread.sendMessage(players.get(a).name, \"your role is \" + roles.get(a).name);\n \t\t}\n \t\t\n \t\t//TODO tell game that a day or night needs to start? should this method have a return type?\n \t\t\n \t}", "public static void processPlayer(String[] picks)\n\t{\n\t\tString[] playerPicks = new String[picks.length-1];\n\t\tplayerPicks = Arrays.copyOfRange(picks, 1, picks.length);\n\n\t\tallPicks.add(playerPicks);\n\t}", "private void loadPlayerPanel(Player player) {\n\t\tCustomButton nullButton = new CustomButton() {\n\t\t\tprivate static final long serialVersionUID = 1L;\n\t\t\tpublic void buttonPressed() {}\n\t\t};\n\t\tnullButton.setVisible(false);\n\t\t\n\t\tLinkedList<Card> cards = new LinkedList<Card>();\n\t\tcards.addAll(player.getAllItems());\n\t\tMultiSelectCardPanel playerPanel = new MultiSelectCardPanel(cards, 3, nullButton, null) {\n\t\t\tprivate static final long serialVersionUID = 1L;\n\t\t\tpublic void setCheckedInfoText() {}\n\t\t};\n\t\tplayerPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.BLACK), player.getName()));\n\t\t\n\t\tif (player == initiator) {\n\t\t\tif (initiatorPanel != null)\n\t\t\t\tgetContentPane().remove(initiatorPanel);\n\t\t\t\n\t\t\tc.gridx = 0;\n\t\t\tinitiatorPanel = playerPanel;\n\t\t}\n\t\telse {\n\t\t\tif (otherPlayerPanel != null)\n\t\t\t\tgetContentPane().remove(otherPlayerPanel);\n\t\t\t\n\t\t\tc.gridx = 2;\n\t\t\totherPlayerPanel = playerPanel;\n\t\t}\n\t\t\n\t\tc.gridheight = 3;\n\t\tc.gridy = 0;\n\t\tgetContentPane().add(playerPanel, c);\n\t\trefresh();\n\t\tc.gridheight = 1;\n\t}", "private static void divideDeck(int numPlayers) {\n\t\tint i = 0;\n\t\tfor (Card card : deck)\n\t\t{\n\t\t\tplayers.get(i % numPlayers).addCardToDeck(card);\n\t\t\ti++;\n\t\t}\n\t}", "public void consolidate()\n { \n if (WarCW.p1.cardsRemaining() < 2)\n {\n if ((WarCW.p1.isEmpty()) && (WarCW.p1e.cardsRemaining() == 0))\n {\n //YOU LOSE\n //end game \n temp = (\"P2 WINS! It took \" + WarCW.round + \". There were \" + WarCW.warNum + \" wars.\");\n \n sup = new JLabel(\"\");\n sup.setFont(new Font(\"ARIAL\",Font.BOLD,46));\n sup.setText(temp);\n \n button.setEnabled(false);\n }\n else\n {\n while (!(WarCW.p1e.isEmpty())) \n {\n WarCW.p1e.shuffle();\n WarCW.temp = WarCW.p1e.useCard();\n WarCW.p1.addCard(WarCW.temp);\n }\n }\n }\n if (WarCW.p2.cardsRemaining() < 2)\n {\n if ((WarCW.p2.isEmpty()) && (WarCW.p2e.cardsRemaining() == 0))\n {\n //YOU WIN\n //end game\n temp = (\"P1 WINS! It took \" + WarCW.round + \". There were \" + WarCW.warNum + \" wars.\");\n \n sup = new JLabel(\"\");\n sup.setFont(new Font(\"ARIAL\",Font.BOLD,46));\n sup.setText(temp);\n \n button.setEnabled(false);\n }\n else\n {\n while (!(WarCW.p2e.isEmpty())) \n {\n WarCW.p2e.shuffle();\n WarCW.temp = WarCW.p2e.useCard();\n WarCW.p2.addCard(WarCW.temp);\n }\n }\n }\n }", "public void finishSubRound(){\n\n\t\t/* sorts the cards on in the table pool in a decsending order */\n List<PlayerCardArray> sortedTableHand =\n\t\t\t\tgameLogic.getTableHand().sortedTableHand(gameLogic.getTrumpCard().getSuit(),\n gameLogic.getLeadSuitCard().getSuit());\n\n System.out.println(sortedTableHand);\n\n PlayerCardArray winner = sortedTableHand.get(0);\n\n\t\t/* Display winner of the round */\n System.out.println(\"The winner of this round is player ID: \" + winner.getPlayerId());\n gameLogic.getScoreboard().addTricksWon(round, winner.getPlayerId());\n\n\t\t/* Get the winner name */\n\t\tif (winner.getPlayerId() == 0){\n\t\t\twinnerName = lblNameA.getText();\n\t\t} else if (winner.getPlayerId() == 1){\n\t\t\twinnerName = lblNameB.getText();\n\t\t}else if (winner.getPlayerId() == 2){\n\t\t\twinnerName = lblNameC.getText();\n\t\t}else if (winner.getPlayerId() == 3){\n\t\t\twinnerName = lblNameD.getText();\n\t\t}\n\n\t\t/* displays the message dialog box informing winner of the round */\n JOptionPane.showMessageDialog(null, \"Round: \" + round + \"\\nSubround: \" + (roundCounter+1) + \"\\nWinner is: \" + winnerName);\n\n\t\t/* set Winner for player */\n for (Player p : gameLogic.getArrayOfPlayers().getArrayOfPlayers()) {\n if ( p.getPlayerId() == winner.getPlayerId() ) {\n p.setTrickWinner(true);\n } else {\n p.setTrickWinner(false);\n }\n }\n\n\t\t/* updates the UI informing play how many tricks won so far */\n\t\tfor (Player p : gameLogic.getArrayOfPlayers().getArrayOfPlayers()) {\n\t\t\tif (winner.getPlayerId() == 0){\n\t\t\t\troundBidsWon += 1;\n\t\t\t\tbreak;\n\t\t\t} else if (winner.getPlayerId() == 1){\n\t\t\t\troundBidsWon1 += 1;\n\t\t\t\tbreak;\n\t\t\t} else if (winner.getPlayerId() == 2){\n\t\t\t\troundBidsWon2 += 1;\n\t\t\t\tbreak;\n\t\t\t} else if (winner.getPlayerId() == 3){\n\t\t\t\troundBidsWon3 += 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* Set position for players */\n System.out.println(\"OLD PLAYER ORDER: \" + gameLogic.getArrayOfPlayers().getArrayOfPlayers());\n if (round != 11) {\n gameLogic.setPlayerOrder(round);\n currentPlayer = gameLogic.getArrayOfPlayers().getArrayOfPlayers().get(0).getPlayerId();\n if (currentPlayer == 0){\n \tSystem.out.println(\"YOU ARE NOW THE FIRST PERSON TO PLAY\");\n \twaitingUser = true;\n } else {\n \twaitingUser = false;\n }\n System.out.println(\"NEW PLAYER ORDER: \" + gameLogic.getArrayOfPlayers().getArrayOfPlayers());\n }\n\n\t\t/* Clear tableHand at end of subround */\n gameLogic.getTableHand().clearTableHand();\n\t}", "private void getPlayerList(){\r\n\r\n PlayerDAO playerDAO = new PlayerDAO(Statistics.this);\r\n players = playerDAO.readListofPlayerNameswDefaultFirst();\r\n\r\n }", "public void processMessage(String s, Player plr){\r\n\t\t\t\t\r\n\t\tPattern p = Pattern.compile(\"#\");\r\n\t String[] items = p.split(s);\t\r\n\t \r\n \tString cmd = items[0]; \t\r\n \r\n \tif(cmd.equals(\"NAME\")){\r\n \t\tsetPlayerName(items, plr);\r\n \t}else if(cmd.equals(\"CRGM\")){\r\n \t\tcreateGame(items);\r\n \t}else if(cmd.equals(\"JOGM\")){\r\n \t\tjoinGame(items, plr);\r\n \t}else if(cmd.equals(\"DISCONNECT\")){\r\n \t\tremovePlayer(plr);\r\n \t}else\r\n \t\treturn;\r\n }", "private void initPlayers() {\n this.playerOne = new Player(1, 5, 6);\n this.playerTwo = new Player(2, 0, 1);\n this.currentPlayer = playerOne;\n\n }", "private void initializePlayers()\n\t{\n\t\tfor(Player player : playerList)\n\t\t{\n\t\t\t// Distribute personality cards\n\t\t\tplayer.setPersonalityCard(board.getPersonalityCardDeck().pickTopCard());\n\t\t\t\n\t\t\t// Distribute money\n\t\t\tboard.getBankAccount().transfertAmountTo(player, nbGoldStartPerPlayer, false);\n\t\t\t\n\t\t\t// Distribute minions\n\t\t\tfor(int i = 0; i < nbMinionsPerPlayer; i++)\n\t\t\t{\n\t\t\t\tplayer.addMinion(new Minion());\n\t\t\t}\n\t\t\t\n\t\t\t// Distribute buildings\n\t\t\tfor(int i = 0; i < nbBuildingsPerPlayer; i++)\n\t\t\t{\n\t\t\t\tplayer.addBuilding(new Building());\n\t\t\t}\n\t\t}\n\n\t\t// Distribute player cards\n\t\tfor(int i = 0; i < nbInitCards; i++)\n\t\t{\n\t\t\tfor(Player player : playerList)\n\t\t\t{\n\t\t\t\tplayer.getPlayerCardDeck().addCard(board.getPlayerCardDeck().pickTopCard());\n\t\t\t}\n\t\t}\n\t}", "private static void formResultLongCommSubs() {\n\n int counterCredits = 0;\n streamPlayerList = new ArrayList<>();\n for (int i=0; i < inputPlayersList.size(); i++) {\n\n //check if we have seen the player\n if(inputPlayersList.get(i).isChecked() == false) {\n // first credit of player\n counterCredits = inputPlayersList.get(i).getLongCommSubsCounter();\n\n // check in the List for matching the players\n for (int j = i + 1; j < inputPlayersList.size(); j++) {\n if (i < inputPlayersList.size() - 1) {\n if (inputPlayersList.get(i).getLastName().equals(inputPlayersList.get(j).getLastName())\n && inputPlayersList.get(i).getFirstName().equals(inputPlayersList.get(j).getFirstName())\n && inputPlayersList.get(i).getCountry().equals(inputPlayersList.get(j).getCountry())\n && inputPlayersList.get(j).isChecked() == false) {\n\n counterCredits += inputPlayersList.get(j).getLongCommSubsCounter();\n inputPlayersList.get(j).setChecked(true);\n }\n }else {\n continue;\n }\n }\n inputPlayersList.get(i).setLongCommSubsCounter(counterCredits);\n // entry the user with updated lcs value in Final List\n if(inputPlayersList.get(i).getLongCommSubsCounter() != 0)\n streamPlayerList.add(inputPlayersList.get(i));\n counterCredits = 0;\n }else {\n continue;\n }\n }\n }", "public void play() {\n Player playerOne = preparePlayer(getUserName(scanner, validator, shipsGameText.getMessage(\"show.player.one\"), null));\n Player currentPlayer = playerOne;\n ShipsGameBoard playerOneGameBoard = new ShipsGameBoard(playerOne, playerOneFleet);\n ShipsGameBoard playerOneCheckBoard = new ShipsGameBoard(playerOne, playerOneFleetToCheck);\n playerOneCheckBoard.setup();\n\n TreeMap<Character, Integer> lettersAndDigits = lettersAndDigits(playerOneGameBoard.getLength());\n ShipCreator threeMastShipCreatorPlayerOne = new ShipCreator(THREE_MASTS_SHIP,\n null,\n playerOne,\n ShipGameBoardMark.THREE_MASTS,\n playerOneGameBoard,\n playerOneShipsGameLogic);\n\n playerOneGameBoard.print();\n shipsDeployment(playerOneGameBoard,\n lettersAndDigits,\n threeMastShipCreatorPlayerOne,\n playerOneShipsGameLogic,\n playerOneFleet,\n NUMBER_OF_SHIPS);\n\n// playerOneShipsGameLogic.clearConsole();\n\n Player playerTwo = preparePlayer(getUserName(scanner, validator, shipsGameText.getMessage(\"show.player.two\"), playerOne.getName()));\n ShipsGameBoard playerTwoGameBoard = new ShipsGameBoard(playerTwo, playerTwoFleet);\n ShipsGameBoard playerTwoCheckBoard = new ShipsGameBoard(playerTwo, playerTwoFleetToCheck);\n playerTwoCheckBoard.setup();\n\n ShipCreator threeMastShipCreatorPlayerTwo = new ShipCreator(THREE_MASTS_SHIP,\n null,\n playerTwo,\n ShipGameBoardMark.THREE_MASTS,\n playerTwoGameBoard,\n playerTwoShipsGameLogic);\n\n playerTwoGameBoard.print();\n shipsDeployment(playerTwoGameBoard,\n lettersAndDigits,\n threeMastShipCreatorPlayerTwo,\n playerTwoShipsGameLogic,\n playerTwoFleet,\n NUMBER_OF_SHIPS);\n\n\n boolean isAWinner = false;\n do {\n int userRow;\n int userCol;\n// playerOneGameBoard.clearConsole();\n showCurrentPlayerBoards(playerOne, currentPlayer, playerOneGameBoard, playerTwoGameBoard, playerOneCheckBoard,\n playerTwoCheckBoard, shipsGameText);\n System.out.println(shipsGameText.getMessage(\"show.witch.player.move\", currentPlayer.getName()));\n\n System.out.println(shipsGameText.getMessage(\"show.input.row\", Integer.toString(playerOneGameBoard.getLength())));\n userRow = getPlayerRowChoice(scanner, validator, playerOneGameBoard.getLength());\n\n System.out.println(shipsGameText.getMessage(\"show.input.col\",\n Character.toString(playerOneGameBoard.generateLastLetterOfColumn('A', playerOneGameBoard.getLength()))));\n userCol = convertLetterToDigit(lettersAndDigits, getPlayerColChoice(scanner, validator,\n lettersAndDigits));\n\n if (currentPlayer.equals(playerOne)) {\n if (playerTwoShipsGameLogic.checkForHit(userRow, userCol)) {\n playerOneShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n playerTwoShipsGameLogic.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n if (playerTwoShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n playerTwoShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerTwo);\n playerOneShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerTwoFleet, playerOne);\n System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n playerOneCheckBoard.print();\n System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerTwo.getName()));\n playerTwoGameBoard.print();\n } else {\n System.out.println(shipsGameText.getMessage(\"show.player.hit.ship\", playerOne.getName()));\n }\n } else {\n System.out.println(shipsGameText.getMessage(\"show.player.miss\"));\n playerOneShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.MISS);\n playerTwoShipsGameLogic.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.MISS);\n }\n\n// if (playerTwoShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n// playerTwoShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerTwo);\n// playerOneShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerTwoFleet, playerOne);\n// System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n// System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n// playerOneCheckBoard.print();\n// System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerTwo.getName()));\n// playerTwoGameBoard.print();\n// }\n\n\n if (playerTwoShipsGameLogic.isPlayerLoose()) {\n System.out.println(shipsGameText.getMessage(\"show.player.win\", playerOne.getName()));\n isAWinner = true;\n }\n\n } else {\n if (playerOneShipsGameLogic.checkForHit(userRow, userCol)) {\n playerTwoShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n playerOneShipsGameLogic.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n if (playerOneShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n playerOneShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerOne);\n playerTwoShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerOneFleet, playerTwo);\n System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n playerTwoCheckBoard.print();\n System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerOne.getName()));\n playerOneGameBoard.print();\n }\n else {\n System.out.println(shipsGameText.getMessage(\"show.player.hit.ship\", playerOne.getName()));\n }\n } else {\n playerTwoShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne,\n ShipGameBoardMark.MISS);\n playerOneShipsGameLogic.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.MISS);\n System.out.println(shipsGameText.getMessage(\"show.player.miss\"));\n }\n if (playerOneShipsGameLogic.isPlayerLoose()) {\n System.out.println(shipsGameText.getMessage(\"show.player.win\", playerTwo.getName()));\n isAWinner = true;\n }\n }\n\n currentPlayer = swapPlayers(playerOne, currentPlayer, playerTwo);\n }\n while (!isAWinner);\n }", "private String run(String[] args) {\n\n\t\tif (args.length < 1) {\n\n\t\t\treturn match.getPlayerStatusReport();\n\t\t\t\n\t\t}\n\t\tif (args[0].equalsIgnoreCase(\"add\")) {\n\t\t\tif (args.length < 2)\n\t\t\t\treturn ERROR_COLOR + \"Specify player to add!\";\n\t\t\t\n\t\t\tString response = \"\";\n\t\t\t\n\t\t\tUhcPlayer pl = match.getPlayer(args[1]);\n\t\t\t\n\t\t\tif (!pl.isOnline())\n\t\t\t\tresponse += WARN_COLOR + \"Warning: adding a player who is not currently online\\n\";\n\n\t\t\t\n\t\t\t\n\t\t\tif (config.isFFA()) {\n\t\t\t\tif (!match.addSoloParticipant(pl))\n\t\t\t\t\treturn ERROR_COLOR + \"Failed to add player\";\n\t\t\t\t\n\t\t\t\treturn response + OK_COLOR + \"Player added\";\n\t\t\t} else {\n\t\t\t\tif (args.length < 3)\n\t\t\t\t\treturn ERROR_COLOR + \"Please specify the team! /players add NAME TEAM\";\n\t\t\t\tif (!match.addParticipant(pl, args[2]))\n\t\t\t\t\treturn ERROR_COLOR + \"Failed to add player \" + args[1] + \" to team \" + args[2];\n\t\t\t\t\n\t\t\t\treturn response + OK_COLOR + \"Player added\";\n\t\t\t}\n\t\t\t\t\n\t\t} else if (args[0].equalsIgnoreCase(\"addall\")) {\n\t\t\tif (!config.isFFA())\n\t\t\t\treturn ERROR_COLOR + \"Cannot auto-add players in a team match\";\n\t\t\t\n\t\t\tint added = 0;\n\t\t\tfor (UhcPlayer pl : match.getOnlinePlayers()) {\n\t\t\t\tif (!pl.isSpectator())\n\t\t\t\t\tif (match.addSoloParticipant(pl)) added++;\n\t\t\t}\n\t\t\tif (added > 0)\n\t\t\t\treturn \"\" + OK_COLOR + added + \" player\" + (added == 1? \"\" : \"s\") + \" added\";\n\t\t\telse\n\t\t\t\treturn ERROR_COLOR + \"No players to add!\";\n\t\t\t\n\t\t\t\n\t\t} else if (args[0].equalsIgnoreCase(\"remove\") || args[0].equalsIgnoreCase(\"rm\")) {\n\t\t\tif (args.length < 2)\n\t\t\t\treturn ERROR_COLOR + \"Specify player to remove!\";\n\t\t\tif (!match.removeParticipant(args[1]))\n\t\t\t\treturn ERROR_COLOR + \"Player could not be removed!\";\n\n\t\t\treturn OK_COLOR + \"Player removed\";\n\t\t}\n\t\treturn null;\n\t}", "void chooseStarterPlayer() {\n\t\tSystem.out.println(\"\\nWer beginnt?\");\n\t\tSystem.out.println(\"1 - Computer\");\n\t\tSystem.out.println(\"2 - Human\");\n\t}", "private void assignPlayerNames() {\n\t\tSystem.out.print(\"What is the name of the first player? \");\n\t\tplayer1.setName(sc.nextLine());\n\n\t\t// Read the second player's name\n\t\tSystem.out.print(\"What is the name of the second player? \");\n\t\tplayer2.setName(sc.nextLine());\n\n\t\twhile (player2.getName().toLowerCase()\n\t\t\t\t.equals(player1.getName().toLowerCase())) {\n\t\t\tSystem.out.print(\"Both players cannot be named \"\n\t\t\t\t\t+ player2.getName() + \".\" + \" Enter a different name: \");\n\t\t\tplayer2.setName(sc.nextLine());\n\t\t}\n\t}", "private List<String> validatePlayer(String playerName, CommandSender sender) {\n\n\t\tList<Player> players = new ArrayList<Player>();\n\t\tList<String> match = new ArrayList<String>();\n\n\t\tplayers = this.getServer().matchPlayer(playerName);\n\t\tif (players.isEmpty()) {\n\t\t\t// Check for an offline player (exact match).\n\t\t\tfor (OfflinePlayer player : Bukkit.getOfflinePlayers()) {\n\t\t\t\tif (player.getName().equals(playerName)) {\n\t\t\t\t\tmatch.add(player.getUniqueId().toString());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/*\n\t\t\tif (Arrays.asList(this.getServer().getOfflinePlayers()).contains(Bukkit.getOfflinePlayer(playerName))) {\n\t\t\t\tmatch.add(Bukkit.getOfflinePlayer(playerName).getName()); //.getUniqueId().toString());\n\t\t\t\t//match.add(Bukkit.getOfflinePlayer(Bukkit.getPlayer(playerName).getUniqueId()).getName()); //.getUniqueId().toString());\n\t\t\t} else {\n\t\t\t\t// look for partial matches\n\t\t\t\tfor (OfflinePlayer offline : this.getServer().getOfflinePlayers()) {\n\t\t\t\t\tif (offline.getName().toLowerCase().startsWith(playerName.toLowerCase()))\n\t\t\t\t\t\tmatch.add(offline.getName()); //.getUniqueId().toString());\n\t\t\t\t}\n\t\t\t}\n\t\t\t*/\n\n\t\t} else {\n\t\t\tfor (Player player : players) {\n\t\t\t\tmatch.add(player.getUniqueId().toString());\n\t\t\t}\n\t\t}\n\n\t\tif (match.isEmpty()) {\n\t\t\tsender.sendMessage(ChatColor.RED + \"Player not found!\");\n\t\t\treturn null;\n\t\t} else if (match.size() > 1) {\n\t\t\tsender.sendMessage(ChatColor.RED + \"Too many matches found! (\" + match.toString() + \")\");\n\t\t\treturn null;\n\t\t}\n\n\t\treturn match;\n\n\t}", "private void setInfoPlayers() {\n\n\t\t//PLAYER 1\n\t\tlblPlayer1name.setText(players.get(0).getName());\n\t\tlblCashP1.setText(\"\" + players.get(0).getMoney());\n\t\tlblBuildP1.setText(\"\" + players.get(0).getNumberBuildings());\n\t\tlblPropP1.setText(\"\" + players.get(0).getOwnproperties().size());\n\t\tlblPosP1.setText(\"\"+ players.get(0).getPosition());\n\n\t\t//PLAYER 2\n\t\tlblPlayer2name.setText(players.get(1).getName());\n\t\tlblCashP2.setText(\"\" + players.get(1).getMoney());\n\t\tlblBuildP2.setText(\"\" + players.get(1).getNumberBuildings());\n\t\tlblPropP2.setText(\"\" + players.get(1).getOwnproperties().size());\n\t\tlblPosP2.setText(\"\"+ players.get(1).getPosition());\n\t\t\n\t\tif(players.size() > 2){\n\t\t\t//PLAYER 3\n\t\t\tlblPlayerName3.setText(players.get(2).getName());\n\t\t\tlblCashP3.setText(\"\" + players.get(2).getMoney());\n\t\t\tlblBuildP3.setText(\"\" + players.get(2).getNumberBuildings());\n\t\t\tlblPropP3.setText(\"\" + players.get(2).getOwnproperties().size());\n\t\t\tlblPosP3.setText(\"\"+ players.get(2).getPosition());\n\n\t\t\tif(players.size() > 3){\n\t\t\t\t//PLAYER 4\n\t\t\t\tlblPlayerName4.setText(players.get(3).getName());\n\t\t\t\tlblCashP4.setText(\"\" + players.get(3).getMoney());\n\t\t\t\tlblBuildP4.setText(\"\" + players.get(3).getNumberBuildings());\n\t\t\t\tlblPropP4.setText(\"\" + players.get(3).getOwnproperties().size());\n\t\t\t\tlblPosP4.setText(\"\"+ players.get(3).getPosition());\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public void distributeCurrentPlayerTokens() {\n\t\t// implemented in part (b)\n\t}", "@Override\n\tpublic void playerJoining(String playerID) {\n\t}", "public static void main(String[] args) {\n\t\t\t\tArrayList<String> rezultat = new ArrayList<String>();\r\n\r\n\t\t\t\tPisiCitaj pisiCitaj = new PisiCitaj();\r\n\t\t\t\tArrayList<String> procitanFajl = pisiCitaj.procitajFajl(\"src\\\\konverzijaFajlova1709\\\\fajlovi\\\\Primer.sub\");\r\n\t\t\t\tint slucaj = 1;\r\n\r\n\t\t\t\tswitch (slucaj) {\r\n\t\t\t\tcase 0:\r\n\t\t\t\t\tMicroDVD micro0 = new MicroDVD();\r\n\t\t\t\t\trezultat = micro0.ulazMPlayerSUB(procitanFajl);\r\n\t\t\t\t\tmicro0.ispisiFajl(args[2], rezultat);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\tSubRipSRT SubRip1 = new SubRipSRT();\r\n\t\t\t\t\trezultat = SubRip1.ulazMPlayerSUB(procitanFajl);\r\n\t\t\t\t\tSubRip1.ispisiFajl(\"src\\\\konverzijaFajlova1709\\\\fajlovi\\\\MplayerToSubRip.srt\", rezultat);\r\n//\t\t\t\t\tfor (String string : rezultat) {\r\n//\t\t\t\t\t\tSystem.out.println(string);\r\n//\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\tMicroDVD micro2 = new MicroDVD();\r\n\t\t\t\t\trezultat = micro2.ulazSubRipSRT(procitanFajl);\r\n\t\t\t\t\tmicro2.ispisiFajl(args[2], rezultat);\r\n//\t\t\t\t\tfor (String string : rezultat) {\r\n//\t\t\t\t\t\tSystem.out.println(string);\r\n//\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3:\r\n\t\t\t\t\tMPlayerSUB mPlayer3 = new MPlayerSUB();\r\n\t\t\t\t\trezultat = mPlayer3.ulazSubRipSRT(procitanFajl);\r\n\t\t\t\t\tmPlayer3.ispisiFajl(args[2], rezultat);\r\n//\t\t\t\t\tfor (String string : rezultat) {\r\n//\t\t\t\t\t\tSystem.out.println(string);\r\n//\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 4:\r\n\t\t\t\t\tSubRipSRT SubRip4 = new SubRipSRT();\r\n\t\t\t\t\trezultat = SubRip4.ulazMicroDVDtxt(procitanFajl);\r\n//\t\t\t\t\tSubRip4.ispisiFajl(args[2], rezultat);\r\n//\t\t\t\t\tfor (String string : rezultat) {\r\n//\t\t\t\t\t\tSystem.out.println(string);\r\n//\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 5:\r\n\t\t\t\t\tMPlayerSUB mPlayer5 = new MPlayerSUB();\r\n\t\t\t\t\trezultat = mPlayer5.ulazMicroDVDtxt(procitanFajl);\r\n//\t\t\t\t\tmPlayer5.ispisiFajl(args[2], rezultat);\r\n//\t\t\t\t\tfor (String string : rezultat) {\r\n//\t\t\t\t\t\tSystem.out.println(string);\r\n//\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t}", "public void sendGameInfoToAll(){\r\n\t\t\r\n\t\tVector<Player> players = lobby.getLobbyPlayers();\t\r\n\t\tString message = \"UDGM\" + lobby.getGameString();\r\n\t\t\r\n\t\tif(!players.isEmpty()){\r\n\t \tfor(int i=0; i<players.size(); i++){\t \t\t\r\n\t \t\tsendOnePlayer(players.get(i), message);\t \t\t\r\n\t \t}\r\n\t\t}\r\n\t}", "protected void treatSpeakers()\n\t{\n\t\tint nHP = (Integer) results[0];\n\t\tdouble Xdist = (Double)results[1];\n\t\tdouble Ydist = (Double)results[2];\n\t\tdouble shift = (Double)results[3];\n\t\tfloat height = (Float) results[4];\n\t\tint numHP1 = (Integer) results[5];\n\t\tboolean stereoOrder = (Boolean)results[6];\n\t\tint lastHP = (replace ? 0 : gp.speakers.size()-1);\n\t\tint numHP;\n\t\tint rangees = (nHP / 2);\n\t\tfloat X, Y;\n\t\tif(replace) gp.speakers = new Vector<HoloSpeaker>(nHP);\n\t\tnumHP1 = (evenp(nHP) ? numHP1 : 1 + numHP1);\n\t\t// Creation des HPs en fonction de ces parametres\n\t\tfor (int i = 1; i <= rangees; i++)\n\t\t\t{\n\t\t\t\t// on part du haut a droite, on descend puis on remonte\n\t\t\t\t\n\t\t\t\tX = (float) (-Xdist);\n\t\t\t\tY = (float) (shift + (Ydist * (rangees - 1) * 0.5) - (Ydist * (i - 1)));\n\t\t\t\tif(stereoOrder)\n\t\t\t\t\tnumHP = numHP1+(i-1)*2;\n\t\t\t\telse\n\t\t\t\t\tnumHP = (numHP1 + rangees + rangees - i) % nHP + 1;\n\t\t\t\tgp.speakers.add(new HoloSpeaker(X, Y, height, numHP+lastHP,-1));\n\t\t\t\t\n\t\t\t\tX = (float) (Xdist);\n\t\t\t\tY = (float) (shift + (Ydist * (rangees - 1) * 0.5) - (Ydist * (i - 1)));\n\t\t\t\tif(stereoOrder)\n\t\t\t\t\tnumHP = numHP1+(i-1)*2+1;\n\t\t\t\telse\n\t\t\t\t\tnumHP = (numHP1 + i - 1) % nHP + 1;\n\t\t\t\tgp.speakers.add(new HoloSpeaker(X, Y, height, numHP+lastHP,-1));\n\t\t\t\tinc();\n\t\t\t}\n\n\t\t\tif (!evenp(nHP))\n\t\t\t{\n\t\t\tX = 0;\n\t\t\tY = (float) (shift + (Ydist * (rangees - 1) * 0.5));\n\t\t\tnumHP = ((numHP1 - 1) % nHP) + 1;\n\t\t\tgp.speakers.add(new HoloSpeaker(X, Y, height, numHP+lastHP,-1));\n\t\t}\n\t}", "public void updateMountedMovingPlayer(EntityPlayerMP player)\r\n {\r\n int var2 = (int)player.posX >> 4;\r\n int var3 = (int)player.posZ >> 4;\r\n double var4 = player.managedPosX - player.posX;\r\n double var6 = player.managedPosZ - player.posZ;\r\n double var8 = var4 * var4 + var6 * var6;\r\n\r\n if (var8 >= 64.0D)\r\n {\r\n int var10 = (int)player.managedPosX >> 4;\r\n int var11 = (int)player.managedPosZ >> 4;\r\n int var12 = this.playerViewRadius;\r\n int var13 = var2 - var10;\r\n int var14 = var3 - var11;\r\n\r\n if (var13 != 0 || var14 != 0)\r\n {\r\n for (int var15 = var2 - var12; var15 <= var2 + var12; ++var15)\r\n {\r\n for (int var16 = var3 - var12; var16 <= var3 + var12; ++var16)\r\n {\r\n if (!this.overlaps(var15, var16, var10, var11, var12))\r\n {\r\n this.getPlayerInstance(var15, var16, true).addPlayer(player);\r\n }\r\n\r\n if (!this.overlaps(var15 - var13, var16 - var14, var2, var3, var12))\r\n {\r\n PlayerManager.PlayerInstance var17 = this.getPlayerInstance(var15 - var13, var16 - var14, false);\r\n\r\n if (var17 != null)\r\n {\r\n var17.removePlayer(player);\r\n }\r\n }\r\n }\r\n }\r\n\r\n this.filterChunkLoadQueue(player);\r\n player.managedPosX = player.posX;\r\n player.managedPosZ = player.posZ;\r\n }\r\n }\r\n }", "private void createPlayers() {\n // create human player first\n Player human = new Player(\"Player 1\", true);\n players.add(human);\n \n // create remaining AI Players\n for (int i = 0; i < numAIPlayers; i++) {\n Player AI = new Player(\"AI \" + (i + 1), false);\n players.add(AI);\n }\n }", "private void botLogic(){\n synchronized (lock){Collections.sort(playerList);}\n botTrading();\n botVoting();\n waitPrint();\n await();\n }", "public List<Player> lookForShootPeople(Player player)\n {\n List<Player> playerList = new LinkedList<>();\n\n playerList.addAll(player.getSquare().getRoom().getPlayerRoomList()); //adds all the players in the room\n\n /*\n * Now i have to check if the player is close to a door. In this case i can see all the players in this adiacent room.\n * I will implement the method in this way:\n * 1. I check if the player can move to a different room with a distance 1 using the method squareReachableNoWall\n * 2. If the player can effectively move to a different room it means it is close to a door\n * 3. I will add to the list all the players in this different room\n */\n\n for (Square square : player.getSquare().getGameBoard().getArena().squareReachableNoWall(player.getSquare().getX(), player.getSquare().getY(), 1))\n {\n if (!(player.getSquare().getColor().equals(square.getColor()))) // if the color of the reachable square is different from the color of the square\n // where the player is this means player can see in a different room\n {\n playerList.addAll(player.getSquare().getRoom().getPlayerRoomList()); //adds all the players in the room\n }\n\n }\n\n Set<Player> playerSet = new HashSet<>();\n playerSet.addAll(playerList);\n\n playerList.clear();\n\n playerList.addAll(playerSet);\n playerList.remove(player);\n\n\n return playerList;\n }", "public static void clearPlayerNames() {\r\n\t\tif (GameSetup.choiceBoxPlayer1.isEnabled()) {\r\n\t\t\tGameSetup.choiceBoxPlayer1.select(0);\r\n\t\t\tMain.player1 = \"\";\r\n\t\t}\r\n\r\n\t\tif (GameSetup.choiceBoxPlayer2.isEnabled()) {\r\n\t\t\tGameSetup.choiceBoxPlayer2.select(0);\r\n\t\t\tMain.player2 = \"\";\r\n\t\t}\r\n\r\n\t\tif (GameSetup.choiceBoxPlayer3.isEnabled()) {\r\n\t\t\tGameSetup.choiceBoxPlayer3.select(0);\r\n\t\t\tMain.player3 = \"\";\r\n\t\t}\r\n\t\t\r\n\t\t//Don't show fourth player if playing 3 handed game.\r\n\t\tif (!Main.isThreeHanded) {\r\n\t\t\tif (GameSetup.choiceBoxPlayer4.isEnabled()) {\r\n\t\t\t\tGameSetup.choiceBoxPlayer4.select(0);\r\n\t\t\t\tMain.player4 = \"\";\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected void syncNewContainer(EntityPlayerMP player) {\n\t}", "void subscribe(Player player);", "@Override\n public List<Set<String>> getPlayersVisibleTo(){\n Set<String> players = new HashSet<String>();\n players.add(destination.getOwner().getName());\n for(Region adj : destination.getAdjRegions()){\n players.add(adj.getOwner().getName());\n }\n //All adjacent can see cloaking happened\n return Arrays.asList(players);\n }", "public void divideDomain(){\n \tfor (int i = 0 ; i < getBoardSize() ; i++)\n \t\tfor (int j = 0 ; j < getBoardSize() ; j++){\n\t\t\tgetPoint(i, j).setHolder(GoPlayer.UNKNOWN);\n\t\t}\n\n \t\tfor (int i = 0 ; i < getBoardSize() ; i++)\n \t\tfor (int j = 0 ; j < getBoardSize() ; j++){\n if (getPoint(i, j).getHolder() == GoPlayer.UNKNOWN){\n \tif (getPoint(i, j).getState() == GoPoint.BLACK){\n getPoint(i, j).setHolder(GoPlayer.BLACK);\n \t}\n \telse if (getPoint(i, j).getState() == GoPoint.WHITE){\n getPoint(i, j).setHolder(GoPlayer.WHITE);\n \t}\n \telse {\n \t\tVector v = getBody(i,j);\n \t\tfindSpaceHolder(v);\n \t}\n }\n\t\t}\n }", "void play() {\n\n ArrayList<Card> cardsInMiddle = new ArrayList<>();\n\n Card[] lastCardsPlayed = new Card[numOfPlayers];\n\n //simulation of each player flipping their next card\n for (int i = 0; i < players.length; i++) {\n lastCardsPlayed[i] = players[i].getNextCard();\n cardsInMiddle.add(lastCardsPlayed[i]);\n\n }\n\n //if there's a tie\n while (tieForCards(lastCardsPlayed)) {\n //check to see if players have enough cards to continue\n //if not, then clear that players hand and game will end\n WarPlayer lessThan3Cards = tryGetPlayerWithLessThanThreeCards();\n if (lessThan3Cards != null) {\n lessThan3Cards.getHand().clear();\n return;\n }\n\n //simulation of flipping 2 extra cards\n for (int i = 0; i < players.length; i++) {\n cardsInMiddle.add(players[i].getNextCard());\n cardsInMiddle.add(players[i].getNextCard());\n\n Card lastCard = players[i].getNextCard();\n cardsInMiddle.add(lastCard);\n lastCardsPlayed[i] = lastCard;\n }\n }\n setLastCardsPlayed(lastCardsPlayed);\n\n //determining who gets all the cards played for the round\n int highestCardIndex = largestCard(lastCardsPlayed);\n players[highestCardIndex].addCards(cardsInMiddle);\n players[highestCardIndex].addPoints(cardsInMiddle.size() / numOfPlayers);\n }", "@Override\n public void run() {\n if (plugin.getGm().getPlayersInGame().size() < plugin.getAm().getMinPlayers()) {\n plugin.getGm().setCheckStart(true);\n plugin.getServer().getOnlinePlayers().forEach(pl -> pl.setLevel(0));\n GameState.state = GameState.LOBBY;\n cancel();\n return;\n }\n \n plugin.getGm().getPlayersInGame().stream().forEach(players -> {\n plugin.getMsg().sendActionBar(players, \"&a&lEl juego empieza en: \" + count);\n });\n\n switch (count){\n case 30:\n plugin.getMsg().sendBroadcast(\"&7El juego empezará en &c30 &7segundos\");\n break;\n case 5:\n GameState.state = GameState.GAME;\n plugin.getGm().getPlayersInGame().forEach(p -> {\n plugin.getAm().teleport(p);\n TntWars.getPlayer(p).setCleanPlayer(GameMode.SURVIVAL);\n });\n break;\n case 4:\n case 3:\n case 2:\n case 1:\n plugin.getMsg().sendBroadcast(\"&7El juego empezará en &c\" + count + \" &7segundos\");\n plugin.getGm().getPlayersInGame().forEach(p -> p.playSound(p.getLocation(), Sound.NOTE_PLING, 1F, 1F));\n break;\n case 0:\n plugin.getGm().setDañoEnCaida(false);\n\n //Iniciar hilo de la fase de esconder (Ja, still nope)\n new GameTask(plugin).runTaskTimer(plugin, 20, 20);\n cancel();\n break;\n }\n --count; \n }", "private void startNextPlayer() {\n if(flag.equals(\"player1\")){\n p2Handler.post(new Runnable() {\n @Override\n public void run() {\n try {\n Thread.sleep(3000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n Message msg = maHandler.obtainMessage(2);\n maHandler.sendMessage(msg);\n }\n });\n }\n if(flag.equals(\"player2\")){\n p1Handler.post(new Runnable() {\n @Override\n public void run() {\n try {\n Thread.sleep(3000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n Message msg = maHandler.obtainMessage(1);\n maHandler.sendMessage(msg);\n }\n });\n }\n }", "@Override\n public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {\n List<String> players = new ArrayList<>();\n List<String> completions = new ArrayList<>();\n for (Player player : Bukkit.getOnlinePlayers())\n players.add(player.getName());\n if (args.length == 1) {\n StringUtil.copyPartialMatches(args[0], players, completions);\n }\n return completions;\n }", "private void movementPhase() {\n ClickObserver.getInstance().setCreatureFlag(\"\");\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n GUI.getDoneButton().setDisable(false);\n TheCupGUI.update();\n Board.removeCovers();\n }\n });\n for (Player p : playerList) {\n \tplayer = p;\n player.flipAllUp();\n\t ClickObserver.getInstance().setActivePlayer(player);\n\t ClickObserver.getInstance().setCreatureFlag(\"Movement: SelectMovers\");\n\t InfoPanel.uncover(player.getName());\n\t if (p.getHexesWithPiece().size() > 0) {\n\t \tClickObserver.getInstance().setClickedTerrain(p.getHexesWithPiece().get(0));\n\t }\n\t pause();\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n \tClickObserver.getInstance().whenTerrainClicked();\n \t GUI.getHelpText().setText(\"Movement Phase: \" + player.getName()\n + \", Move your armies\");\n \t Game.getRackGui().setOwner(player);\n }\n });\n\t \n\t while (isPaused) {\n \ttry { Thread.sleep(100); } catch( Exception e ){ return; } \n\t }\n\t InfoPanel.cover(player.getName());\n player.flipAllDown();\n }\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n GUI.getDoneButton().setDisable(true);\n }\n });\n ClickObserver.getInstance().setCreatureFlag(\"\");\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 }", "private void autoCommand(String player) {\n try {\n Piece s = Piece.playerValueOf(player);\n _playing = false;\n _players[s.ordinal()] = new MachinePlayer(s, this);\n } catch (IllegalArgumentException excp) {\n error(\"unknown player: %s\", player);\n System.out.println();\n }\n }", "public void handleDominoes() {\r\n int n = 0;\r\n List<Domino> aux = new ArrayList<>();\r\n for (Player player : this.players) {\r\n player.setDominoes(shuffledDominoes.subList(n, n += 7), true);\r\n }\r\n\r\n if (n < shuffledDominoes.size()) {\r\n stack.addAll(shuffledDominoes.subList(n, shuffledDominoes.size()));\r\n System.out.println(\"LAST DOMINO OF STACK\" + stack.get(stack.size() - 1));\r\n }\r\n }", "public void chooseWorker(){\n resetUpdate();\n\n gameMessage.setSpace1(clientMessage.getSpace1());\n gameMessage.notify(gameMessage);\n\n if ( liteGame.getCurrWorker() == null ){\n removePlayerFromTheGame();\n }\n }", "public void moveEverythingALittle(){\n //ponieważ wszystko idealnie jest zsynchronizowane to else nie wykona sie gdy current = getDestination\n if(player.getCurrentX()<player.getDestinationX())\n player.currentX += 1;\n else if(player.getCurrentX()>player.getDestinationX())\n player.currentX -= 1;\n\n if( player.getCurrentY()<player.getDestinationY())\n player.currentY += 1;\n else if( player.getCurrentY()>player.getDestinationY())\n player.currentY -= 1;\n\n for(int i = 0; i < boxes.size(); i++){\n Box item = boxes.get(i);\n if(item.getCurrentX()<item.getDestinationX())\n item.currentX += 1;\n else if(item.getCurrentX()>item.getDestinationX())\n item.currentX -= 1;\n\n if( item.getCurrentY()<item.getDestinationY())\n item.currentY += 1;\n else if ( item.getCurrentY()>item.getDestinationY())\n item.currentY -= 1;\n }\n }", "private void addCapturedHoles(int num){\n if(flag.equals(\"player1\")){\n player1Holes.add(num);\n Message msg = p1Handler.obtainMessage(2);\n msg.arg1 = num;\n p1Handler.sendMessage(msg);\n }\n else {\n player2Holes.add(num);\n Message msg = p2Handler.obtainMessage(2);\n msg.arg1 = num;\n p2Handler.sendMessage(msg);\n }\n }", "private void otherdetails(String otherplayermsg, int commandlength) {\n // decode variable that came with message\n String variables[] = new String[12];\n for (int i = 0; i < 12; i++) {\n int varlength = 0;\n for (int n = commandlength + 1; n < otherplayermsg.length(); n++) {\n char extract = otherplayermsg.charAt(n);\n if (extract == (':')) {\n varlength = n;\n break;\n }\n }\n variables[i] = otherplayermsg.substring(commandlength + 1, varlength);\n commandlength = varlength;\n }\n\n // adding other players details to storage arrays\n for (int n = 0; n < 3; n++) {\n otherNames[n] = variables[4 * n];\n score.addName(variables[4 * n]);\n // sh.addMsg(\"Test - othername \" + otherNames[n] + \" severname \" +\n // servername);//--------------------TEST\n if (otherNames[n].equals(servername)) whosturn = n;\n cardcount[n] = 3;\n carddowncount[n] = 3;\n try {\n for (int i = 0; i < 3; i++) {\n Card card = new Card(Integer.parseInt(variables[4 * n + 1 + i]));\n faceup[n][i] = card;\n }\n } catch (NumberFormatException b) {\n sh.addMsg(\"otherdetails - variable to Int error: \" + b);\n }\n }\n deck = 16;\n if (fastgame) deck = 0;\n displayTable();\n if (swap && !swapdone) { // if performing card swap\n Card inhand[] = new Card[3];\n Card ontable[] = new Card[3];\n for (int n = 0; n < 3; n++) {\n inhand[n] = hand.getCard(n);\n ontable[n] = hand.getFaceUp(n);\n }\n SwapD swapD = new SwapD(sh, inhand, ontable);\n if (swapD.display()) {\n inhand = swapD.getInHand();\n ontable = swapD.getOnTable();\n hand.swap(inhand, ontable);\n displayTable();\n }\n sendCommand(\n \"swap:\"\n + inhand[0].getNumber()\n + \":\"\n + inhand[1].getNumber()\n + \":\"\n + inhand[2].getNumber()\n + \":\"\n + ontable[0].getNumber()\n + \":\"\n + ontable[1].getNumber()\n + \":\"\n + ontable[2].getNumber()\n + \":\");\n swapdone = true;\n }\n }", "default void doPreProcessing(INetHandlerPlayServer server, boolean callingFromSponge) {\n if (isPacketOnMainThread(server, callingFromSponge)) {\n // System.out.println(\"Pre packet process\");\n NetHandlerPlayServer serverHandler = (NetHandlerPlayServer) server;\n EntityPlayerMP player = serverHandler.player;\n PhysicsWrapperEntity wrapper = getPacketParent(serverHandler);\n if (wrapper != null\n && wrapper.getPhysicsObject().getShipTransformationManager() != null) {\n ISubspaceProvider worldProvider = (ISubspaceProvider) player.getServerWorld();\n ISubspace worldSubspace = worldProvider.getSubspace();\n worldSubspace.snapshotSubspacedEntity((ISubspacedEntity) player);\n wrapper.getPhysicsObject().getShipTransformationManager()\n .getCurrentTickTransform().transform(player,\n TransformType.GLOBAL_TO_SUBSPACE);\n }\n\n }\n }", "private void othersturn(String otherplayermsg, int commandlength) {\n boolean burn = false;\n // decode variable that came with message\n int varlength = 0;\n for (int n = commandlength + 1; n < otherplayermsg.length(); n++) {\n char extract = otherplayermsg.charAt(n);\n if (extract == (':')) {\n varlength = n;\n break;\n }\n }\n String name = otherplayermsg.substring(commandlength + 1, varlength);\n int varlength2 = 0;\n for (int n = varlength + 1; n < otherplayermsg.length(); n++) {\n char extract = otherplayermsg.charAt(n);\n if (extract == (':')) {\n varlength2 = n;\n break;\n }\n }\n String cardno = otherplayermsg.substring(varlength + 1, varlength2);\n\n // determining which player just had a turn\n int playernumber = 0;\n for (int n = 0; n < 3; n++)\n if (name.equals(otherNames[n])) {\n playernumber = n;\n break;\n }\n\n if (cardno.equals(\"pickup\")) { // other players picks up pile\n cardcount[playernumber] = cardcount[playernumber] + pile.size();\n pile.clear();\n sh.addMsg(otherNames[playernumber] + \" picked up the pile\");\n } else if (cardno.equals(\"burn\")) { // other player burns the pile\n burnPile();\n burn = true;\n // removing cards from pile\n sh.addMsg(name + \" burnt the pile.\");\n if (deck == 0 || cardcount[playernumber] > 3) {\n if (cardcount[playernumber] > 0) cardcount[playernumber]--;\n } else deck--;\n } else if (cardno.equals(\"faceup\")) { // otherplayer plays a faceup card\n int varlength3 = 0;\n for (int n = varlength2 + 1; n < otherplayermsg.length(); n++) {\n char extract = otherplayermsg.charAt(n);\n if (extract == (':')) {\n varlength3 = n;\n break;\n }\n }\n String cardno2 = otherplayermsg.substring(varlength2 + 1, varlength3);\n if (cardno2.equals(\"multi\")) {\n burn = faceupmulti(otherplayermsg, varlength3, playernumber);\n } else {\n try {\n Card card = new Card(Integer.parseInt(cardno2));\n // adding card to pile\n pile.add(card);\n // burning pile if a 10 is played\n if (pile.topValue() == 10 || pile.isFourOfAKind()) {\n burnPile();\n burn = true;\n // removing cards from pile\n sh.addMsg(name + \" burnt the pile.\");\n }\n // removing card from table\n for (int n = 0; n < 3; n++)\n if (faceup[playernumber][n] != null)\n if (faceup[playernumber][n].getNumber() == card.getNumber()) {\n faceup[playernumber][n] = null;\n break;\n }\n } catch (NumberFormatException b) {\n sh.addMsg(\"Otherplayer - variable to Int error: \" + b);\n }\n }\n } else if (cardno.equals(\"facedown\")) { // if player plays one of there face down cards\n int varlength3 = 0;\n for (int n = varlength2 + 1; n < otherplayermsg.length(); n++) {\n char extract = otherplayermsg.charAt(n);\n if (extract == (':')) {\n varlength3 = n;\n break;\n }\n }\n String cardno2 = otherplayermsg.substring(varlength2 + 1, varlength3);\n if (cardno2.equals(\"pickup\")) {\n for (int n = varlength3 + 1; n < otherplayermsg.length(); n++) {\n char extract = otherplayermsg.charAt(n);\n if (extract == (':')) {\n varlength2 = n;\n break;\n }\n }\n String cardplayed = otherplayermsg.substring(varlength3 + 1, varlength2);\n int numPlayed = 0;\n try {\n numPlayed = Integer.parseInt(cardplayed);\n } catch (NumberFormatException b) {\n sh.addMsg(\"processTurn - facedown pickup - variable to Int error: \" + b);\n }\n cardcount[playernumber] = cardcount[playernumber] + pile.size() + 1;\n pile.clear();\n sh.addMsg(\n otherNames[playernumber]\n + \" played a \"\n + Card.getCardStringValue(numPlayed)\n + \" and had to picked up the pile\");\n } else {\n try {\n Card card = new Card(Integer.parseInt(cardno2));\n pile.add(card);\n // burning pile if a 10 is played\n if (pile.topValue() == 10 || pile.isFourOfAKind()) {\n burnPile();\n burn = true;\n // removing cards from pile\n sh.addMsg(name + \" burnt the pile.\");\n }\n } catch (NumberFormatException b) {\n sh.addMsg(\"Otherplayer - variable to Int error: \" + b);\n }\n }\n carddowncount[playernumber]--;\n } else if (cardno.equals(\"multi\")) { // if more than 1 card is played at a time\n // determining how many card where played\n int varlength3 = 0;\n for (int n = varlength2 + 1; n < otherplayermsg.length(); n++) {\n char extract = otherplayermsg.charAt(n);\n if (extract == (':')) {\n varlength3 = n;\n break;\n }\n }\n String numPlayedString = otherplayermsg.substring(varlength2 + 1, varlength3);\n // converting string to int for processing\n int numPlayed = 0;\n try {\n numPlayed = Integer.parseInt(numPlayedString);\n } catch (NumberFormatException b) {\n sh.addMsg(\"processTurn - multi - variable to Int error: \" + b);\n }\n for (int n = 0; n < numPlayed; n++) {\n varlength2 = varlength3;\n // determining how many card where played\n varlength3 = 0;\n for (int i = varlength2 + 1; i < otherplayermsg.length(); i++) {\n char extract = otherplayermsg.charAt(i);\n if (extract == (':')) {\n varlength3 = i;\n break;\n }\n }\n String cardnoString = otherplayermsg.substring(varlength2 + 1, varlength3);\n // converting string to int for processing\n try {\n Card card = new Card(Integer.parseInt(cardnoString));\n pile.add(card);\n } catch (NumberFormatException b) {\n sh.addMsg(\"processTurn - multi - variable to Int error: \" + b);\n }\n\n if (deck == 0 || cardcount[playernumber] > 3) {\n if (cardcount[playernumber] > 0) cardcount[playernumber]--;\n } else deck--;\n }\n\n // burning pile if a 10 is played or 4 of a kind\n if (pile.topValue() == 10 || pile.isFourOfAKind()) {\n burnPile();\n burn = true;\n // removing cards from pile\n sh.addMsg(name + \" burnt the pile.\");\n }\n\n } else {\n // adding card to pile\n try {\n Card card = new Card(Integer.parseInt(cardno));\n pile.add(card);\n // burning pile if a 10 is played\n if (pile.topValue() == 10 || pile.isFourOfAKind()) {\n burn = true;\n burnPile();\n // removing cards from pile\n sh.addMsg(name + \" burnt the pile.\");\n }\n } catch (NumberFormatException b) {\n sh.addMsg(\"Otherplayer else - variable to Int error: \" + b);\n }\n if (deck == 0 || cardcount[playernumber] > 3) {\n if (cardcount[playernumber] > 0) cardcount[playernumber]--;\n } else deck--;\n }\n if (!burn) nextTurn();\n displayTable();\n }", "private List<String> receiveConnectedPlayers(@NotNull String data) {\n ConnectedPlayersDto result = GameGraphics.gson.fromJson(data, ConnectedPlayersDto.class);\n if (result.players != null) {\n players = result.players.stream()\n .filter(Objects::nonNull)\n .map(player -> player.name)\n .collect(Collectors.toList());\n return players;\n }\n return null;\n }", "private Point move(Point[] players, int[] chat_ids, Point self)\n\t{\n\t\t//Move to a new position within the room anywhere within 6 meters of your current position. Any conversation you were previously engaged in is terminated: you have to be stationary to chat.\n\t\t//Initiate a conversation with somebody who is standing at a distance between 0.5 meters and 2 meters of you. In this case you do not move. You can only initiate a conversation with somebody on the next turn if they and you are both not currently engaged in a conversation with somebody else. \t\n\t\tint i = 0, target = 0;\n\t\twhile (players[i].id != self_id) i++;\n\t\t//look through players who are within 6 meters => Point[] players\n\t\tPoint p = self;\n for (target = 0; target<players.length; ++target) {\n\t\t\t//if we do not contain any information on them, they are our target => W[]\n\t\t\tif (W[p.id] != -1 || p.id == self.id) continue;\n p = players[target];\n }\n if (p.equals(self)) {\n for (target = 0; target < players.length; ++target) {\n if (W[p.id] == 0 || p.id == self.id) continue;\n p = players[target];\n }\n }\n if (!p.equals(self)) {\n\t\t\t// compute squared distance\n\t\t\tdouble dx1 = self.x - p.x;\n\t\t\tdouble dy1 = self.y - p.y;\n\t\t\tdouble dd1 = dx1 * dx1 + dy1 * dy1;\n\t\t\t//check if they are engaged in conversations with someone\n\t\t\tint chatter = 0;\n\t\t\twhile (chatter<players.length && players[chatter].id != chat_ids[target]) chatter++;\n\n\t\t\t//check if they are engaged in conversations with someone and whether that person is in our vicinity\n\t\t\tif(chat_ids[target]!=p.id && chatter!=players.length)\n\t\t\t{\n\t\t\t\t//if they are, we want to stand in front of them, .5 meters in the direction of who they're conversing with => check if result is within 6meters\n\t\t\t\tPoint other = players[chatter];\n\t\t\t\tdouble dx2 = self.x - other.x;\n\t\t\t\tdouble dy2 = self.y - other.y;\n\t\t\t\tdouble dd2 = dx2 * dx2 + dy2 * dy2;\n\n\t\t\t\tdouble dx3 = dx2-dx1;\n\t\t\t\tdouble dy3 = dy2-dy1;\n\t\t\t\tdouble dd3 = Math.sqrt(dx3 * dx3 + dy3 * dy3);\n\n\t\t\t\tdouble dx4 = (dx2 - 0.5*(dx3/dd3)) * -1;\n\t\t\t\tdouble dy4 = (dy2 - 0.5*(dy3/dd3)) * -1;\n\t\t\t\tdouble dd4 = dx4 * dx4 + dy4 * dy4;\n\n\t\t\t\tif (dd4 <= 2.0)\n\t\t\t\t\treturn new Point(dx4, dy4, self.id);\n }\n\t\t\t//if not chatting to someone or don't know position of chatter, just get as close to them as possible\n\t\t\telse return new Point((dx1-0.5*(dx1/dd1)) * -1, (dy1-0.5*(dy1/dd1)) * -1, self.id);\t\t\t\t\n\t\t}\n\n\t\t\tdouble dir = random.nextDouble() * 2 * Math.PI;\n\t\t\tdouble dx = 6 * Math.cos(dir);\n\t\t\tdouble dy = 6 * Math.sin(dir);\n\t\t\treturn new Point(dx, dy, self_id);\n\t}", "void updateOnlinePlayers(String skipone) { \r\n DynmapPlayer[] players = server.getOnlinePlayers();\r\n DynmapPlayer[] pl = new DynmapPlayer[players.length];\r\n System.arraycopy(players, 0, pl, 0, pl.length);\r\n if(skipone != null) {\r\n for(int i = 0; i < pl.length; i++)\r\n if(pl[i].getName().equals(skipone))\r\n pl[i] = null;\r\n }\r\n online = pl;\r\n }", "public void setUpPlayers(){\n\t\tTreeMap<String,Integer> turnsDetails = new TreeMap<>();\n\t\tint e = 0;\n\t\tfor(Player i : allplayers) {\n\t\t\ti.fillHand();\n\t\t\tturnsDetails.put(i.getFirstLetter()+String.valueOf(e),e);\n\t\t\te++;\n\t\t}\n\t\t// populate the turn list\n //entryset returns a set view of mappings contained\n\t\tfor(Map.Entry<String,Integer> i : turnsDetails.entrySet())\n\t\t\tturns.add(i.getValue());\n\t}", "public War(String name) {\n // contructs the parent class\n super(name);\n // initialize the game deck\n gameDeck = new GeneralDeck(52);\n // create array of players\n players = new ArrayList<>();\n \n // creates a new player\n System.out.print(\"Enter player name: \");\n player = new WarPlayer(in.nextLine());\n \n // adds the player and the cpu to the players ArrayList\n players.add(cpu);\n players.add(player);\n // adds the players to the list of players\n super.setPlayers(players);\n \n // populates the gameDeck with PokerCards\n System.out.println(\"Initializing game deck\");\n for (int i = 0; i < 4; i++) {\n for (int j = 0; j < 13; j++) {\n Card card = new PokerCard(j, i);\n gameDeck.addCard(card);\n }\n\n }\n \n //shuffles the game deck\n gameDeck.shuffle();\n System.out.println(\"Finished initializing game deck\");\n System.out.println(\"Initializing Player decks\");\n \n // adding cards to both the player and the cpu decks\n player.getDeck().addCards(gameDeck.showCards().subList(0, \n gameDeck.getSize() / 2));\n\n cpu.getDeck().addCards(gameDeck.showCards().subList(gameDeck.getSize() \n / 2, gameDeck.getSize()));\n\n gameDeck.clearDeck();\n System.out.println(\"Finished initializing Player decks\");\n \n //prompts the user to start the game with enter\n System.out.println(\"Press enter to start the game\");\n in.nextLine();\n }", "private void addPlayerToGroup(Scoreboard board, Player player) {\n String playername = player.getName();\n board.registerNewTeam(playername);\n board.getTeam(playername).addPlayer(player);\n }", "public void testStagesSession() {\n\n resetCounter();\n\n try {\n FixedResolver tr0 = new FixedResolver(\"127.0.0.1\", 54222);\n FixedTransportManager ftm0 = new FixedTransportManager(tr0);\n TestMediaManager tmm0 = new TestMediaManager(ftm0);\n tmm0.setPayloads(getTestPayloads1());\n List<JingleMediaManager> trl0 = new ArrayList<JingleMediaManager>();\n trl0.add(tmm0);\n\n FixedResolver tr1 = new FixedResolver(\"127.0.0.1\", 54567);\n FixedTransportManager ftm1 = new FixedTransportManager(tr1);\n TestMediaManager tmm1 = new TestMediaManager(ftm1);\n tmm1.setPayloads(getTestPayloads2());\n List<JingleMediaManager> trl1 = new ArrayList<JingleMediaManager>();\n trl1.add(tmm1);\n\n JingleManager man0 = new JingleManager(getConnection(0), trl0);\n JingleManager man1 = new JingleManager(getConnection(1), trl1);\n\n man1.addJingleSessionRequestListener(new JingleSessionRequestListener() {\n /**\n * Called when a new session request is detected\n */\n public void sessionRequested(final JingleSessionRequest request) {\n System.out.println(\"Session request detected, from \" + request.getFrom() + \": accepting.\");\n try {\n // We accept the request\n JingleSession session1 = request.accept();\n\n session1.addListener(new JingleSessionListener() {\n public void sessionClosed(String reason, JingleSession jingleSession) {\n System.out.println(\"sessionClosed().\");\n }\n\n public void sessionClosedOnError(XMPPException e, JingleSession jingleSession) {\n System.out.println(\"sessionClosedOnError().\");\n }\n\n public void sessionDeclined(String reason, JingleSession jingleSession) {\n System.out.println(\"sessionDeclined().\");\n }\n\n public void sessionEstablished(PayloadType pt, TransportCandidate rc, final TransportCandidate lc,\n JingleSession jingleSession) {\n incCounter();\n System.out.println(\"Responder: the session is fully established.\");\n System.out.println(\"+ Payload Type: \" + pt.getId());\n System.out.println(\"+ Local IP/port: \" + lc.getIp() + \":\" + lc.getPort());\n System.out.println(\"+ Remote IP/port: \" + rc.getIp() + \":\" + rc.getPort());\n }\n\n public void sessionMediaReceived(JingleSession jingleSession, String participant) {\n // Do Nothing\n }\n\n public void sessionRedirected(String redirection, JingleSession jingleSession) {\n }\n });\n\n session1.startIncoming();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n });\n\n // Session 0 starts a request\n System.out.println(\"Starting session request, to \" + getFullJID(1) + \"...\");\n JingleSession session0 = man0.createOutgoingJingleSession(getFullJID(1));\n\n session0.addListener(new JingleSessionListener() {\n public void sessionClosed(String reason, JingleSession jingleSession) {\n }\n\n public void sessionClosedOnError(XMPPException e, JingleSession jingleSession) {\n }\n\n public void sessionDeclined(String reason, JingleSession jingleSession) {\n }\n\n public void sessionEstablished(PayloadType pt, TransportCandidate rc, TransportCandidate lc,\n JingleSession jingleSession) {\n incCounter();\n System.out.println(\"Initiator: the session is fully established.\");\n System.out.println(\"+ Payload Type: \" + pt.getId());\n System.out.println(\"+ Local IP/port: \" + lc.getIp() + \":\" + lc.getPort());\n System.out.println(\"+ Remote IP/port: \" + rc.getIp() + \":\" + rc.getPort());\n }\n\n public void sessionRedirected(String redirection, JingleSession jingleSession) {\n }\n\n public void sessionMediaReceived(JingleSession jingleSession, String participant) {\n // Do Nothing\n }\n });\n session0.startOutgoing();\n\n Thread.sleep(20000);\n\n assertTrue(valCounter() == 2);\n\n } catch (Exception e) {\n e.printStackTrace();\n fail(\"An error occured with Jingle\");\n }\n }", "@Override\r\n public void addPlayerHandler(Player player) {\r\n // add new player to current TreeSet\r\n playerByIdTreeSet.add(player);\r\n\r\n if(successor!=null){\r\n // there are more handlers - trigger them to add this player as well\r\n successor.addPlayerHandler(player);\r\n }\r\n }", "@Override\n public void landedOn(Player player) {}", "@Override\n public void playWithTwoPlayers(Player player1, Player player2) {\n int[] combinationPlayer;\n int counter = config.getMaxTries();\n config.getMsgInfo().choiceGameBonus();\n config.getMsgInfo().counter(counter);\n\n // initialize a random number that both players will try to find\n IAPlayer ia = new IAPlayer(config);\n int[] defenseCombination = ia.initialiseCombination();\n if (config.isDevMode())\n config.getMsgCombination().devMode(defenseCombination);\n config.getMsgInfo().computer();\n\n // Proposition player1\n config.getMsgInfo().player1();\n combinationPlayer = player1.research(null);\n config.getMsgCombination().newAnswer(combinationPlayer);\n String[] clues = ia.clues(combinationPlayer);\n if (IsWin.winIf(clues)) {\n config.getMsgInfo().isWin();\n return;\n }\n config.getMsgCombination().cluesAre(clues);\n\n // Proposition player2\n config.getMsgInfo().player2();\n combinationPlayer = player2.research(null);\n config.getMsgCombination().newAnswer(combinationPlayer);\n String[] clews = ia.clues(combinationPlayer);\n if (IsWin.winIf(clews)) {\n config.getMsgInfo().isWin();\n return;\n }\n config.getMsgCombination().cluesAre(clews);\n\n counter--;\n config.getMsgInfo().counterLess(counter);\n\n do {\n // Proposition player1\n config.getMsgInfo().player1();\n combinationPlayer = player1.research(clues);\n config.getMsgCombination().newAnswer(combinationPlayer);\n clues = ia.clues(combinationPlayer);\n if (IsWin.winIf(clues)) {\n config.getMsgInfo().isWin();\n return;\n } else if (counter > 1) {\n config.getMsgCombination().cluesAre(clues);\n } else if (counter == 1) {\n if (!Arrays.equals(combinationPlayer, defenseCombination))\n config.getMsgInfo().notGood();\n }\n\n // Proposition player2\n config.getMsgInfo().player2();\n combinationPlayer = player2.research(clews);\n config.getMsgCombination().newAnswer(combinationPlayer);\n clews = ia.clues(combinationPlayer);\n if (IsWin.winIf(clews)) {\n config.getMsgInfo().isWin();\n return;\n } else if (counter > 1) {\n config.getMsgCombination().cluesAre(clews);\n } else if (counter == 1) {\n if (!Arrays.equals(combinationPlayer, defenseCombination))\n config.getMsgInfo().notGood();\n }\n\n counter--;\n if (counter >= 1)\n config.getMsgInfo().counterLess(counter);\n else {\n config.getMsgInfo().endGameDuel();\n config.getMsgCombination().finallyRevealSecretCombination(defenseCombination);\n break;\n }\n } while (true);\n }", "public void Players()\n\t{\n\t\tSystem.out.println(\"What team are you looking for?: \");\n\t\tSystem.out.println(\"1: Soccer\\n2: Basketball\\n3: Football\\n4: RETURN\");\n\t\tint choice1 = input.nextInt();\n\t\tswitch (choice1) {\n\t\t\n\t\tcase 1:\n\t\t\t\n\t\t\tString name = \"GB Soccer\";\n\t\t\tSelectTeam(name);\n\t\t\t\n\t\t\tSystem.out.println(\"\\nTo view player's full Bio, type Last Name\");\n\t\t\t\n\t\t\tScanner input = new Scanner(System.in);\n\t\t\tString Spname = input.nextLine();\n\t\t\tSelectPlayer(Spname);\n\t\t\tSystem.out.println(\"To return to teams list press 1, to exit press 2\");\n\t\t\tint choice2 = input.nextInt();\n\t\t\tswitch(choice2)\n\t\t\t{\n\t\t\tcase 1: Players(); break; case 2: System.exit(2); break;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Yet to be implemented\");\n\t\t\t\tbreak; \n\t\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tString name1 = \"GB Basketball\";\n\t\t\tSelectTeam(name1);\n\t\t\t\n\t\t\tSystem.out.println(\"\\nTo view player's full Bio, type Last Name\");\n\t\t\t\n\t\t\tScanner input1 = new Scanner(System.in);\n\t\t\tString Bpname = input1.nextLine();\n\t\t\tSelectPlayer(Bpname);\n\t\t\tSystem.out.println(\"To return to teams list press 1, to exit press 2\");\n\t\t\tint choice3 = input1.nextInt();\n\t\t\tswitch(choice3)\n\t\t\t{\n\t\t\tcase 1: Players(); break; case 2: System.exit(0); break;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Yet to be implemented\");\n\t\t\t\tbreak; \n\t\t\t\t}\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tString name2 = \"GB Football\";\n\t\t\tSelectTeam(name2);\n\t\t\t\n\t\t\tSystem.out.println(\"\\nTo view player's full Bio, type Last Name\");\n\t\t\t\n\t\t\tScanner input2 = new Scanner(System.in);\n\t\t\tString Fpname = input2.nextLine();\n\t\t\tSelectPlayer(Fpname);\n\t\t\tSystem.out.println(\"To return to teams list press 1, to exit press 2\");\n\t\t\tint choice4 = input2.nextInt();\n\t\t\tswitch(choice4)\n\t\t\t{\n\t\t\tcase 1: Players(); break; case 2: System.exit(0); break;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Yet to be implemented\");\n\t\t\t\tbreak; \n\t\t\t\t}\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tquestion();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.out.println(\"Yet to be implemented\");\n\t\t\tbreak;\n\t\t}\n\t\t\n\t}", "public void multiPlayerChosen(){\n IP = view.ipTF.getText();\n ConnectingViewController connecting = new ConnectingViewController(this, IP);\n connecting.showView();\n this.hideView();\n }", "private static void getMessagesFromMaster() {\r\n while (true) {\r\n SocketMessage sm = socket_to_master.getMessage();\r\n\r\n /* GC debugging: report GC usage: */\r\n GcTracker.report();\r\n\r\n if (sm.getMessageNum() == SocketMessage.WORK_TO_SLAVE) {\r\n /* Start the thread that processes the Work list: */\r\n new SlaveWorker((Work) sm.getData()).start();\r\n }\r\n\r\n else if (sm.getMessageNum() == SocketMessage.REQUEST_SLAVE_STATISTICS) {\r\n /* Data received from master: */\r\n /* long[0]: request_sequence_number */\r\n /* long[1]: last_interval */\r\n /* long[2]: last_warmup */\r\n long[] info = (long[]) sm.getData();\r\n long request_number = info[0];\r\n boolean last_interval = info[1] != 0;\r\n boolean last_warmup = info[2] != 0;\r\n\r\n Fifo.printFifoStatuses();\r\n\r\n if (ThreadMonitor.active()) {\r\n ThreadMonitor.reportAllDetail(ThreadMonitor.getAllData());\r\n ThreadMonitor.saveAllPrevious();\r\n }\r\n\r\n /* Check with the UserClass code: */\r\n Vector userdata = User.ControlUsers.getIntervalDataForMaster();\r\n\r\n /* Forcing delay in the return of statistics: */\r\n if (common.get_debug(common.HOLD_UP_STATISTICS) && request_number % 5 == 0)\r\n common.sleep_some(3000);\r\n\r\n /* Send all data to the master: */\r\n SlaveStats sts = CollectSlaveStats.getStatsForMaster(request_number, last_interval, last_warmup);\r\n sts.setUserData(userdata);\r\n sm = new SocketMessage(SocketMessage.SLAVE_STATISTICS, sts);\r\n socket_to_master.putMessage(sm);\r\n\r\n if (common.get_debug(common.PRINT_MEMORY)) {\r\n common.memory_usage();\r\n Native.printMemoryUsage();\r\n }\r\n }\r\n\r\n else if (sm.getMessageNum() == SocketMessage.USER_DATA_TO_SLAVES)\r\n ControlUsers.receivedIntervalDataFromMaster((UserData[]) sm.getData());\r\n\r\n else if (sm.getMessageNum() == SocketMessage.GET_LUN_INFO_FROM_SLAVE) {\r\n InfoFromHost hinfo = (InfoFromHost) sm.getData();\r\n InfoFromHost.getInfoForMaster(hinfo);\r\n\r\n /* This call assures that remote clients also have their maps cleaned up: */\r\n if (hinfo.validate)\r\n MapFile.cleanupOrphanMapFiles();\r\n }\r\n\r\n else if (sm.getMessageNum() == SocketMessage.SLAVE_GO) {\r\n if (SlaveWorker.work == null)\r\n common.failure(\"Received 'SLAVE_GO' message without first receiving Work\");\r\n\r\n /* Before we start all work, get the thread monitor baselines: */\r\n if (ThreadMonitor.active()) {\r\n ThreadMonitor.getAllData();\r\n ThreadMonitor.saveAllPrevious();\r\n }\r\n\r\n wait_to_run.release();\r\n\r\n /* Get starting stats to prepare for first interval: */\r\n if ((common.onSolaris() || common.onWindows()) && SlaveJvm.isFirstSlaveOnHost()) {\r\n CpuStats.getNativeCpuStats();\r\n CollectSlaveStats.getAllKstatData();\r\n\r\n if (common.onSolaris())\r\n NfsStats.getAllNfsDeltasFromKstat();\r\n\r\n if (SlaveWorker.work.nw_monitor_now)\r\n NwStats.loadStatistics();\r\n }\r\n\r\n }\r\n\r\n else if (sm.getMessageNum() == SocketMessage.WORKLOAD_DONE) {\r\n SlaveJvm.setWorkloadDone(true);\r\n SlaveJvm.setMasterDone();\r\n Fifo.printQueues();\r\n }\r\n\r\n else if (sm.getMessageNum() == SocketMessage.CLEAN_SHUTDOWN_SLAVE) {\r\n common.ptod(\"Master is requesting slave shutdown\");\r\n break;\r\n }\r\n\r\n else if (sm.getMessageNum() == SocketMessage.MASTER_ABORTING) {\r\n master_aborting = true;\r\n\r\n /* Is it really worth it trying to shut down everything nicely? No! */\r\n common.failure(master_abort_msg);\r\n\r\n }\r\n\r\n else if (sm.getMessageNum() == SocketMessage.HEARTBEAT_MESSAGE) {\r\n SlaveJvm.sendMessageToMaster(SocketMessage.HEARTBEAT_MESSAGE);\r\n }\r\n\r\n else if (sm.getMessageNum() == SocketMessage.STOP_NEW_IO)\r\n stopWork();\r\n\r\n else\r\n common.failure(\"Unknown socket message: \" + sm.getMessageText());\r\n }\r\n\r\n }", "@Override\n public void execute(Player player, String[] args) {\n ProfileManager manager = ProfileManager.getInstance();\n\n ClaimProfile profile = null;\n\n if (!player.isOp() || args.length == 0) {\n // Chunk information\n Chunk chunk = player.getLocation().getChunk();\n\n player.sendMessage(ClaimPlugin.PREFIX + \"Informationen zu diesem Chunk:\");\n player.sendMessage(ClaimPlugin.PREFIX + \"Koordinaten: §6\" + chunk.getX() + \"§7, §6\" + chunk.getZ());\n player.sendMessage(ClaimPlugin.PREFIX + \"Welt-Koordinaten: §6\" + (chunk.getX() * 16) + \"§7, §6?§7, §6\"\n + (chunk.getZ() * 16) + \"\");\n\n switch (manager.getClaimType(player.getLocation().getChunk())) {\n case PLAYER:\n profile = manager.getProfile(chunk);\n break;\n case CITY:\n player.sendMessage(ClaimPlugin.PREFIX + \"Besitzer: §6Stadt\");\n player.sendMessage(ClaimPlugin.PREFIX + \"Bebaubar: §6\"\n + (manager.getCityChunk(chunk).isInteractable() ? \"ja\" : \"nein\"));\n return;\n case UNCLAIMED:\n for (ClaimProfile single : manager.getProfiles()) {\n for (ChunkData singleChunk : single.getClaimedChunks()) {\n for (int x = -1; x <= 1; x++) {\n for (int z = -1; z <= 1; z++) {\n ChunkWrapper nextChunk = new ChunkWrapper(chunk.getWorld().getName(), chunk.getX() + x,\n chunk.getZ() + z);\n\n if (singleChunk.getWrapper().equals(nextChunk) && !singleChunk.isGroupChunk()) {\n player.sendMessage(ClaimPlugin.PREFIX + \"Besitzer: §6frei §7(protected)\");\n return;\n }\n }\n }\n }\n }\n\n player.sendMessage(ClaimPlugin.PREFIX + \"Besitzer: §6frei §7(unclaimed)\");\n return;\n default:\n throw new IllegalStateException(\"Unhandled enum type\");\n }\n } else {\n OfflinePlayer target = Bukkit.getOfflinePlayer(args[0]);\n\n if (manager.doesProfileExist(target.getUniqueId())) {\n profile = manager.getProfile(target.getUniqueId());\n } else {\n player.sendMessage(ClaimPlugin.PREFIX + \"§cEs konnte kein Profil zu \" + args[0] + \" gefunden werden.\");\n return;\n }\n }\n\n // Get information\n OfflinePlayer owner = Bukkit.getOfflinePlayer(profile.getUuid());\n String name = owner.getName() == null ? \"(keinen Namen gefunden)\" : owner.getName();\n\n int[] counts = countClaimedChunks(profile);\n\n // Print information\n player.sendMessage(ClaimPlugin.PREFIX + \"Besitzer: §6\" + name);\n\n if (player.isOp()) {\n player.sendMessage(ClaimPlugin.PREFIX + \"zuletzt online: §6\"\n + InfoCommand.DATE_FORMAT.format(new Date(owner.getLastPlayed())));\n player.sendMessage(ClaimPlugin.PREFIX + \"Anzahl der (Gruppen-)Chunks: (§6\"\n + counts[0] + \"§7) §6\" + counts[1]);\n player.sendMessage(ClaimPlugin.PREFIX + \"Anzahl der gekauften Claimer: §6\"\n + profile.getClaimer());\n player.sendMessage(ClaimPlugin.PREFIX + \"Geclaimte Chunks:\");\n\n for (ChunkData claimedChunk : profile.getClaimedChunks()) {\n ChunkWrapper wrapper = claimedChunk.getWrapper();\n player.sendMessage(ClaimPlugin.PREFIX + \" - §6\" + wrapper.getX() + \"§7, §6\"\n + wrapper.getZ());\n }\n\n player.sendMessage(ClaimPlugin.PREFIX + \"Anzahl der Rechte auf Gruppen-Chunks: §6\"\n + profile.getAccess().size());\n }\n }", "public void giveOutCards() {\n boolean shared = false;\n while (!shared) {\n for (Player player : this.players) {\n if (this.cards.size() == 0) {\n shared = true;\n } else {\n Card card = this.cards.get(0);\n this.cards.remove(0);\n if (!envelope.has(card)) {\n player.addCard(card);\n }\n }\n }\n }\n }" ]
[ "0.57936865", "0.5652221", "0.5642283", "0.55888087", "0.55807847", "0.5466654", "0.53439885", "0.5341786", "0.53325623", "0.5326312", "0.5293489", "0.5293277", "0.5265271", "0.52613", "0.52535045", "0.5243485", "0.5242119", "0.52393275", "0.52216023", "0.5220887", "0.5218126", "0.51981014", "0.5180915", "0.51728326", "0.5159934", "0.5157572", "0.5149908", "0.5136378", "0.5126855", "0.51235867", "0.5117414", "0.5115925", "0.50945276", "0.50883555", "0.5077962", "0.50688094", "0.50540984", "0.5053259", "0.50524527", "0.5046266", "0.5040816", "0.50394803", "0.50366044", "0.5021383", "0.5017602", "0.5013811", "0.501036", "0.50034004", "0.5000178", "0.49976304", "0.49968907", "0.49957883", "0.49936485", "0.4992572", "0.49860564", "0.49855766", "0.49764633", "0.49680877", "0.49597585", "0.49594396", "0.49545443", "0.49525526", "0.49509674", "0.49473152", "0.49462032", "0.4945531", "0.49455297", "0.49435893", "0.49423164", "0.4928147", "0.49240428", "0.49182934", "0.49176934", "0.4905841", "0.49029443", "0.49001575", "0.48936152", "0.48896867", "0.4888754", "0.48858732", "0.48835924", "0.48799747", "0.48790854", "0.48690167", "0.48623094", "0.4861242", "0.48601025", "0.48596975", "0.48568192", "0.48568165", "0.48560414", "0.48547468", "0.48541376", "0.48534438", "0.48526272", "0.48463425", "0.4844416", "0.48421878", "0.48421243", "0.48370054" ]
0.5870421
0
Releases a composite byte buffer. All the chunks in the buffer are reused.
public synchronized void release(CompositeByteBuffer cbb) { for (ByteBuffer buffer : cbb.buffers) { buffer.clear(); buffers.add(buffer); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void releaseBuffer() {\n }", "@SuppressWarnings(\"unchecked\") \n /* #end */\n public void release()\n {\n buffers = (KType[][]) EMPTY;\n blockLen = 0;\n elementsCount = 0;\n }", "@Override\n protected final void deallocate() {\n ByteBuf wrapped = unwrap();\n recyclerHandle.recycle(this);\n wrapped.release();\n }", "public void release() {\n this.buffer = EMPTY_ARRAY;\n this.elementsCount = 0;\n }", "public void release() {\n if (this.compositeDisposable != null) {\n this.compositeDisposable.clear();\n }\n }", "public void releaseReadIOBuffer(byte[] buf)\n/* */ {\n/* 207 */ if (buf != null)\n/* */ {\n/* */ \n/* */ \n/* 211 */ _verifyRelease(buf, this._readIOBuffer);\n/* 212 */ this._readIOBuffer = null;\n/* 213 */ this._bufferRecycler.releaseByteBuffer(0, buf);\n/* */ }\n/* */ }", "public void free() {\n byteBase.free();\n byteBase = null;\n }", "public final void release() {\n explicitlyLocked = false;\n byteBase.unlock();\n }", "protected void releaseBuffer()\n {\n interlock.endReading();\n // System.out.println(\"endReading: 2\");\n }", "final void internalRelease() {\n if(!explicitlyLocked) {\n byteBase.unlock();\n }\n }", "public final void freeBuffers()\n {\n if (_ioContext != null) {\n byte[] buf = _inputBuffer;\n if (buf != null) {\n _inputBuffer = null;\n _ioContext.releaseReadIOBuffer(buf);\n }\n }\n }", "static native void free(long buffer);", "public void release()\n {\n \n release_0(nativeObj);\n \n return;\n }", "public void release() throws IOException;", "void freeArray(byte[] array) {}", "public final void release() { \n native_release();\n }", "final void release() {\n mem.release();\n }", "public void freeBuffer() {\n if(allocatedBufferSource.get() != null) {\n allocatedBufferSource.getAndSet(null).freeVideo(this);\n }\n }", "@Override\n public void dispose(){\n if(handle <= 0) return;\n free(handle);\n handle = 0;\n }", "final void internalReleaseNoCopy() {\n if(!explicitlyLocked) {\n byteBase.unlockNoCopy();\n }\n }", "public GlBuffer free(){\n\t\t//android.util.//Log.d(TAG,\"free()\");\n final int[] handles = new int[1];\n if(this.handle != UNBIND_HANDLE){\n handles[0] = this.handle;\n this.handle = UNBIND_HANDLE;\n GLES20.glDeleteBuffers(1, handles, 0);\n GlOperation.checkGlError(TAG, \"glDeleteBuffers\");\n }\n\n if(mVaoHandle != UNBIND_HANDLE){\n handles[0] = mVaoHandle;\n mVaoHandle = UNBIND_HANDLE;\n GLES30.glDeleteVertexArrays(1, handles, 0);\n GlOperation.checkGlError(TAG, \"glDeleteVertexArrays\");\n }\n\n\t\tif(mManagedBuffer && this.buffer != null){\n\t\t\tswitch(this.datatype){\n\t\t\t\tcase TYPE_BYTE :\n\t\t\t\t\tByteBufferPool.getInstance().returnDirectBuffer((ByteBuffer)this.buffer);\n\t\t\t\t\tmManagedBuffer = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TYPE_SHORT :\n\t\t\t\t\tByteBufferPool.getInstance().returnDirectBuffer((ShortBuffer)this.buffer);\n\t\t\t\t\tmManagedBuffer = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TYPE_INT :\n\t\t\t\t\tByteBufferPool.getInstance().returnDirectBuffer((IntBuffer)this.buffer);\n\t\t\t\t\tmManagedBuffer = false;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\tByteBufferPool.getInstance().returnDirectBuffer((FloatBuffer)this.buffer);\n\t\t\t\t\tmManagedBuffer = false;\n\t\t\t}\n\t\t\tthis.buffer = null;\n\t\t}\n\t\tthis.size = 0;\n\t\treturn this;\n\t}", "@Override\n public void release() {\n }", "@Override\n public void release() {\n output = null;\n super.release();\n }", "public static native void release();", "public final void releaseNoCopy() {\n explicitlyLocked = false;\n byteBase.unlockNoCopy();\n }", "@Override\n public void release() {\n }", "public void finalize() {\r\n byteBuffer2 = null;\r\n byteBuffer4 = null;\r\n byteBuffer8 = null;\r\n progressBar = null;\r\n tagBuffer = null;\r\n\r\n if (raFile != null) {\r\n\r\n try {\r\n raFile.close();\r\n } catch (final IOException ioe) {\r\n // Do nothing\r\n }\r\n }\r\n\r\n raFile = null;\r\n }", "public void finalize() {\r\n destImage = null;\r\n srcImage = null;\r\n sliceBuffer = null;\r\n super.finalize();\r\n }", "@Override\r\n\tpublic void release()\r\n\t{\n\t}", "public void dispose() {\n\t\twhile(unackHead != null) {\n\t\t\tcancel(unackHead);\n\t\t\tunackHead = unackHead.next;\n\t\t}\n\t\tif(curChunker != null)\n\t\t\tcurChunker.dispose();\n\t}", "void _release();", "public native void free();", "@Override\n\tpublic void release() {\n\t}", "public void release();", "public void release();", "public void release()\n \t{\n \t\tif( iterator == null )\n \t\t{\n \t\t\tindex = new SpatialIndex();\n \t\t\tedgeAllocator = 0;\n \t\t\tmergeOps = null;\n \t\t\t\n \t\t\tSystem.gc();\n \t\t}\n \t}", "@Override\n\tpublic void release() {\n\t\t\n\t}", "public ByteBuf remove(int bytes, ChannelPromise aggregatePromise)\r\n/* 31: */ {\r\n/* 32:63 */ return remove(this.channel.alloc(), bytes, aggregatePromise);\r\n/* 33: */ }", "public void release() {\n }", "public void release() {\r\n return;\r\n }", "public void finalize() {\r\n srcImage = null;\r\n destImage = null;\r\n buffer = null;\r\n validBuffer = null;\r\n idealBuffer = null;\r\n objectBuffer = null;\r\n super.finalize();\r\n }", "@Override\n protected void doRelease() {\n if (mNativePtr != 0) {\n nativeRelease(mNativePtr);\n mNativePtr = 0;\n }\n }", "public void release() {\n\t\tsuper.release();\r\n\t\tinnerContent = null;\r\n\t\tlabelHead = null;\r\n\t\tscroll = null;\r\n\t}", "public void release() {\n\n mTextureRender = null;\n mSurfaceTexture = null;\n }", "@Override\n\tpublic void release() {\n\n\t}", "@Override\n\tpublic void release() {\n\n\t}", "public void release() {\n }", "@Override\n public void release() {\n \n }", "public void release() {\n\t\t\n\t}", "private static void buffer() {\n\t\tSystem.out.println(\"bafor\"+Runtime.getRuntime().freeMemory());\n\t\tByteBuffer mBuffer=ByteBuffer.allocate(10240000);\n\t\tSystem.out.println(\"bafor\"+Runtime.getRuntime().freeMemory());\n// mBuffer.clear();\n System.out.println(\"bafor\"+Runtime.getRuntime().freeMemory());\n\t}", "@Override\n\tpublic void releaseBuffer() {\n\t\tr.clear();\n\t\toriginRange = \"\";\n\t\tr = XStaticFixedValue.nullList;\n\t}", "public abstract void release();", "public abstract void release();", "public abstract void release();", "public void release()\r\n throws IOException\r\n {\r\n // nothing needs to be done\r\n }", "public void close() throws IOException {\n for(IoBuffer buf : data) {\n buf.free();\n }\n data.clear();\n super.close();\n }", "public ResourceHolder<ByteBuffer> getMergeBuffer()\n {\n final ByteBuffer buffer = mergeBuffers.pop();\n return new ResourceHolder<ByteBuffer>()\n {\n @Override\n public ByteBuffer get()\n {\n return buffer;\n }\n\n @Override\n public void close()\n {\n mergeBuffers.add(buffer);\n }\n };\n }", "@Override\r\n\tpublic void release() {\n\r\n\t}", "private synchronized void popBuffer() {\n IoBuffer buf = data.removeFirst();\n if(marked) {\n resetCache.push(buf);\n if(!data.isEmpty()) {\n data.getFirst().mark();\n }\n } else {\n buf.free();\n }\n }", "public void release()\r\n\t{\r\n\t\tsuper.release();\r\n\t\t_href = null;\r\n\t\t_box = null;\r\n\t\t_bracket = null;\r\n\t\t_bracketFont = null;\r\n\r\n\t}", "public void release() {\n super.release();\n _gboss = null;\n }", "@Override\n public void release() {\n\n if(trackerResultOverlay != null) {\n overlay.remove(trackerResultOverlay);\n trackerResultOverlay.clear();\n }\n\n if(detectorResultOverlay != null) {\n overlay.remove(detectorResultOverlay);\n detectorResultOverlay.clear();\n textBlockBuffer.clear();\n }\n\n }", "@Override\n\tprotected void disposeBlob() {\n\t\t\n\t}", "public static void destroy(mpjbuf.RawBuffer buffer) {\r\n if(factory != null) { \t \r\n factory.destroyBuffer( buffer ); \r\n } else {\r\n throw new MPIException(\"BufferFactory has not been initialized\") ; \r\n }\r\n }", "protected void release()\n {\n }", "public void release() {\r\n if (BuildConfig.DEBUG) {\r\n HiLog.debug(LABEL, \"release()\", new Object[0]);\r\n }\r\n if (!this.mNativeSurfaceHandle.equals(BigInteger.ZERO)) {\r\n this.mAgpContext.getEngine().destroySwapchain();\r\n Core.destroyAndroidSurface(this.mAgpContext.getDevice(), this.mNativeSurfaceHandle);\r\n this.mNativeSurfaceHandle = BigInteger.ZERO;\r\n }\r\n this.mAgpContext = null;\r\n }", "protected void deallocate()\r\n/* 541: */ {\r\n/* 542:554 */ freeArray(this.array);\r\n/* 543:555 */ this.array = null;\r\n/* 544: */ }", "public static void bgfx_destroy_indirect_buffer(@NativeType(\"bgfx_indirect_buffer_handle_t\") short _handle) {\n long __functionAddress = Functions.destroy_indirect_buffer;\n invokeCV(_handle, __functionAddress);\n }", "public void release() {\n nRelease(mNativeInstance);\n mNativeInstance = 0;\n }", "public void release() {\n HiLog.info(LOG_LABEL, \"release.\", new Object[0]);\n this.mCallMapById.clear();\n this.mRemote = null;\n disconnect();\n destroyHandler();\n this.mContext = null;\n this.mPendingCallAudioState = null;\n this.mCurrentCallAudioState = null;\n this.mPendingCanAddCall = null;\n this.mPreAddedCall = null;\n this.mPendingDisconnectPreAddedCall = null;\n this.mIsConnected = false;\n this.mIsBound = false;\n this.mIsInCallServiceBinded = false;\n this.mIsPreConnected = false;\n Listener listener = this.mListener;\n if (listener != null) {\n listener.onReleased(this);\n this.mListener = null;\n }\n }", "public static void bgfx_destroy_frame_buffer(@NativeType(\"bgfx_frame_buffer_handle_t\") short _handle) {\n long __functionAddress = Functions.destroy_frame_buffer;\n invokeCV(_handle, __functionAddress);\n }", "public void free();", "public synchronized void freeAllBuffers() {\n\t\tIterator<Integer> iter = _bufferMap.keySet().iterator();\n\t\twhile (iter.hasNext()) {\n\t\t\tint bufNum = iter.next();\n\t\t\tsendMessage(\"/b_free\", new Object[] { bufNum });\n\t\t\titer.remove();\n\t\t}\n\t}", "public static void release() {\n\t}", "public static native void free(long handle);", "@DISPID(1) //= 0x1. The runtime will prefer the VTID if present\r\n @VTID(7)\r\n int freeBufferSpace();", "protected abstract void deAllocateNativeResource();", "@Override\n\tpublic void close() throws IOException {\n\t\tiOBuffer = new IOBuffer();\n\t}", "Buffer copy();", "public void cleanup() {\n sendBuffer(baos);\n shutdown();\n }", "void release();", "void release();", "void release(PooledObject<T> t);", "int release();", "abstract void free();", "public static ByteBuf readBytes(ByteBufAllocator alloc, ByteBuf buffer, int length) {\n boolean release = true;\n ByteBuf dst = alloc.buffer((int)length);\n try {\n buffer.readBytes((ByteBuf)dst);\n release = false;\n ByteBuf byteBuf = dst;\n return byteBuf;\n }\n finally {\n if (release) {\n dst.release();\n }\n }\n }", "public final void dispose() {\n lock.writeLock().lock();\n try {\n if (available) {\n available = false;\n _dispose();\n }\n } finally {\n lock.writeLock().unlock();\n }\n }", "public void free(){\n\t\t\t\tif(this.handle != GlBuffer.UNBIND_HANDLE){\n\t\t\t\t\tfinal int[] handles = new int[]{this.handle};\n\t\t\t\t\tthis.handle = GlBuffer.UNBIND_HANDLE;\n\t\t\t\t\tGLES20.glDeleteBuffers(1, handles, 0);\n\t\t\t\t}\n\t\t\t}", "ByteBuf allocate(ByteBufAllocator alloc);", "public void release() {\r\n pageEL = null;\r\n params = null;\r\n super.release();\r\n }", "static void readBytes(ByteBufAllocator allocator, ByteBuffer buffer, int position, int length, OutputStream out) throws IOException {\n if (buffer.hasArray()) {\n out.write((byte[])buffer.array(), (int)(position + buffer.arrayOffset()), (int)length);\n return;\n }\n int chunkLen = Math.min((int)length, (int)8192);\n buffer.clear().position((int)position);\n if (length <= 1024 || !allocator.isDirectBufferPooled()) {\n ByteBufUtil.getBytes((ByteBuffer)buffer, (byte[])ByteBufUtil.threadLocalTempArray((int)chunkLen), (int)0, (int)chunkLen, (OutputStream)out, (int)length);\n return;\n }\n ByteBuf tmpBuf = allocator.heapBuffer((int)chunkLen);\n try {\n byte[] tmp = tmpBuf.array();\n int offset = tmpBuf.arrayOffset();\n ByteBufUtil.getBytes((ByteBuffer)buffer, (byte[])tmp, (int)offset, (int)chunkLen, (OutputStream)out, (int)length);\n return;\n }\n finally {\n tmpBuf.release();\n }\n }", "public void finalize() {\n AppMethodBeat.i(66593);\n if (this.mJitterBuffer != 0) {\n nativeDestoryJitterBuffer(this.mJitterBuffer);\n this.mJitterBuffer = 0;\n }\n AppMethodBeat.o(66593);\n }", "public synchronized void freeBuf(int bufNum) {\n\t\t// if it's a valid remove request:\n\t\tif (_bufferMap.containsKey(bufNum)) {\n\t\t\t// remove it from the buffer map\n\t\t\t_bufferMap.remove(bufNum);\n\t\t\t// free it on the server\n\t\t\tsendMessage(\"/b_free\", new Object[] { bufNum });\n\t\t}\n\t}", "public void dispose() {\r\n\r\n// ByteBuffer tmp = ByteBuffer.allocateDirect(4);\r\n// tmp.order(ByteOrder.nativeOrder());\r\n// IntBuffer handle = tmp.asIntBuffer();\r\n IntBuffer handle = BufferUtils.createIntBuffer(1);\r\n\r\n// colorTexture.dispose();\r\n if (hasDepth) {\r\n handle.put(depthbufferHandle);\r\n handle.flip();\r\n glDeleteRenderbuffersEXT(handle);\r\n }\r\n\r\n handle.put(framebufferHandle);\r\n handle.flip();\r\n glDeleteFramebuffersEXT(handle);\r\n\r\n }", "@Override\n\t public void onRelease() {\n\n\t }", "public void _release() {\n throw new NO_IMPLEMENT(reason);\n }", "@Override\n\tpublic void release() {\n\t\tif (!bullet.isRecycled()) {\n\t\t\tbullet.recycle();\n\t\t}\n\t}", "void releaseKey(int entryIndex) {\n long keyReference = getKeyReference(entryIndex);\n int[] keyArray = longToInts(keyReference);\n int blockID = keyArray[BLOCK_ID_LENGTH_ARRAY_INDEX] >> KEY_BLOCK_SHIFT;\n int keyPosition = keyArray[POSITION_ARRAY_INDEX];\n int length = keyArray[BLOCK_ID_LENGTH_ARRAY_INDEX] & KEY_LENGTH_MASK;\n Slice s = new Slice(blockID, keyPosition, length, memoryManager);\n\n memoryManager.releaseSlice(s);\n }", "public void release() {\n super.release();\n this.name = null;\n this.originalName = null;\n this.originalNesting = null;\n this.originalNestingName = null;\n }", "@Override\n\tpublic void Close()\n\t{\n\t\ttarBuffer.Close();\n\t}" ]
[ "0.66262686", "0.65566415", "0.6468972", "0.64550686", "0.6302731", "0.62264097", "0.6156302", "0.61151564", "0.604456", "0.5943465", "0.5883981", "0.588258", "0.5798555", "0.5788191", "0.5747282", "0.5746386", "0.56709504", "0.56574994", "0.555795", "0.55504936", "0.5541282", "0.55129695", "0.549974", "0.54898816", "0.54780865", "0.54758185", "0.5466138", "0.54504794", "0.5446013", "0.543913", "0.54277045", "0.5424033", "0.5421264", "0.54157734", "0.54157734", "0.5412196", "0.5405787", "0.54032594", "0.5395717", "0.53936654", "0.53822976", "0.5375917", "0.5360855", "0.5349377", "0.53381884", "0.53381884", "0.5333674", "0.53271186", "0.5324192", "0.5311609", "0.53023565", "0.52929324", "0.52929324", "0.52929324", "0.5292525", "0.52923393", "0.52901137", "0.52648103", "0.52632344", "0.5255544", "0.52495617", "0.5240982", "0.5236714", "0.5223384", "0.5211723", "0.5193093", "0.51688206", "0.5118119", "0.5111906", "0.5109422", "0.5105109", "0.51020515", "0.50986946", "0.5092404", "0.5083265", "0.50731695", "0.50517386", "0.5051104", "0.50406146", "0.50303084", "0.5023222", "0.5023222", "0.5016892", "0.50105584", "0.50048524", "0.50018096", "0.49992418", "0.49977636", "0.49937528", "0.49932006", "0.4978762", "0.49685895", "0.4960634", "0.49544728", "0.49470064", "0.49353898", "0.492987", "0.49271083", "0.49218443", "0.49134657" ]
0.6823934
0
Execute an Rbased dvn statistical analysis request
public Map<String, String> execute(DvnRJobRequest sro) { // set the return object Map<String, String> result = new HashMap<String, String>(); try { // Set up an Rserve connection dbgLog.fine("sro dump:\n"+ToStringBuilder.reflectionToString(sro, ToStringStyle.MULTI_LINE_STYLE)); RConnection c = new RConnection(RSERVE_HOST, RSERVE_PORT); dbgLog.fine("hostname="+RSERVE_HOST); c.login(RSERVE_USER, RSERVE_PWD); dbgLog.fine(">" + c.eval("R.version$version.string").asString() + "<"); // save the data file at the Rserve side String infile = sro.getSubsetFileName(); InputStream inb = new BufferedInputStream( new FileInputStream(infile)); int bufsize; byte[] bffr = new byte[1024]; RFileOutputStream os = c.createFile(tempFileName); while ((bufsize = inb.read(bffr)) != -1) { os.write(bffr, 0, bufsize); } os.close(); inb.close(); // Rserve code starts here dbgLog.fine("wrkdir="+wrkdir); historyEntry.add(librarySetup); c.voidEval(librarySetup); // variable type /* vartyp <-c(1,1,1) */ // java side // int [] jvartyp = {1,1,1};// = mp.get("vartyp").toArray() int [] jvartyp = sro.getVariableTypes(); StringBuilder sb = new StringBuilder(); for (int i = 0 ; i< jvartyp.length; i++){ if (i == (jvartyp.length -1)){ sb.append(String.valueOf(jvartyp[i])); } else { sb.append(String.valueOf(jvartyp[i])+", "); } } // R side historyEntry.add("vartyp<-c(" + sb.toString()+")"); c.assign("vartyp", new REXPInteger(jvartyp)); String [] tmpt = c.eval("vartyp").asStrings(); dbgLog.fine("vartyp length="+ tmpt.length + "\t " + StringUtils.join(tmpt,",")); // variable format (date/time) /* varFmt<-list(); c.voidEval("varFmt<-list()"); */ Map<String, String> tmpFmt = sro.getVariableFormats(); if (tmpFmt != null){ Set<String> vfkeys = tmpFmt.keySet(); String[] tmpfk = (String[]) vfkeys.toArray(new String[vfkeys.size()]); String[] tmpfv = getValueSet(tmpFmt, tmpfk); historyEntry.add("tmpfk<-c(" + StringUtils.join(tmpfk,", ")+")"); c.assign("tmpfk", new REXPString(tmpfk)); historyEntry.add("tmpfv<-c(" + StringUtils.join(tmpfv,", ")+")"); c.assign("tmpfv", new REXPString(tmpfv)); String fmtNamesLine = "names(tmpfv)<- tmpfk"; historyEntry.add(fmtNamesLine); c.voidEval(fmtNamesLine); String fmtValuesLine ="varFmt<- as.list(tmpfv)"; historyEntry.add(fmtValuesLine); c.voidEval(fmtValuesLine); } else { String [] varFmtN ={}; List<String> varFmtV = new ArrayList<String>(); historyEntry.add("varFmt <- list()"); c.assign("varFmt", new REXPList(new RList(varFmtV, varFmtN))); } /* vnames<-c("race","age","vote") */ // variable names // String [] jvnames = {"race","age","vote"}; String [] jvnamesRaw = sro.getVariableNames(); String [] jvnames = null; //VariableNameFilterForR nf = new VariableNameFilterForR(jvnamesRaw); if (sro.hasUnsafedVariableNames){ // create list jvnames = sro.safeVarNames; dbgLog.fine("renamed="+StringUtils.join(jvnames,",")); } else { jvnames = jvnamesRaw; } //historyEntry.add("vnamnes<-c("+ StringUtils.join(jvnames, ", ")+")"); String vnQList = DvnDSButil.joinNelementsPerLine(jvnames,true); historyEntry.add("vnames<-c("+ vnQList+")"); c.assign("vnames", new REXPString(jvnames)); // confirmation String [] tmpjvnames = c.eval("vnames").asStrings(); dbgLog.fine("vnames:"+ StringUtils.join(tmpjvnames, ",")); /* x<-read.table141vdc(file="/tmp/VDC/t.28948.1.tab", col.names=vnames, colClassesx=vartyp, varFormat=varFmt) */ //String datafilename = "/nfs/home/A/asone/java/rcode/t.28948.1.tab"; // tab-delimited file name = tempFileName String readtableline = "x<-read.table141vdc(file='"+tempFileName+ "', col.names=vnames, colClassesx=vartyp, varFormat=varFmt )"; historyEntry.add(readtableline); dbgLog.fine("readtable="+readtableline); c.voidEval(readtableline); // safe-to-raw variable name /* attr(x, "Rsafe2raw")<-list(); */ //if (nf.hasRenamedVariables()){ if (sro.hasUnsafedVariableNames){ dbgLog.fine("unsafeVariableNames exist"); // create list //jvnames = nf.getFilteredVarNames(); jvnames = sro.safeVarNames; String[] rawNameSet = sro.renamedVariableArray; String[] safeNameSet = sro.renamedResultArray; historyEntry.add("tmpRN<-c("+StringUtils.join(rawNameSet,", ")+")"); c.assign("tmpRN", new REXPString(rawNameSet)); historyEntry.add("tmpSN<-c("+StringUtils.join(safeNameSet,", ")+")"); c.assign("tmpSN", new REXPString(safeNameSet)); String raw2safevarNameTableLine = "names(tmpRN)<- tmpSN"; historyEntry.add(raw2safevarNameTableLine); c.voidEval(raw2safevarNameTableLine); String attrRsafe2rawLine = "attr(x, 'Rsafe2raw')<- as.list(tmpRN)"; historyEntry.add(attrRsafe2rawLine); c.voidEval(attrRsafe2rawLine); } else { String attrRsafe2rawLine = "attr(x, 'Rsafe2raw')<-list();"; historyEntry.add(attrRsafe2rawLine); c.voidEval(attrRsafe2rawLine); } //Map<String, String> Rsafe2raw = sro.getRaw2SafeVarNameTable(); // asIs /* for (i in 1:dim(x)[2]){if (attr(x,"var.type")[i] == 0) { x[[i]]<-I(x[[i]]); x[[i]][ x[[i]] == '' ]<-NA }} */ String asIsline = "for (i in 1:dim(x)[2]){ "+ "if (attr(x,'var.type')[i] == 0) {" + "x[[i]]<-I(x[[i]]); x[[i]][ x[[i]] == '' ]<-NA }}"; historyEntry.add(asIsline); c.voidEval(asIsline); // variable Id /* attr(x, "var.nmbr")<-c("v198057","v198059","v198060") */ // String[] jvarnmbr = {"v198057","v198059","v198060"}; String[] jvarnmbr = sro.getVariableIds(); String viQList = DvnDSButil.joinNelementsPerLine(jvarnmbr,true); historyEntry.add("varnmbr <-c("+viQList +")"); c.assign("varnmbr",new REXPString(jvarnmbr)); String attrVarNmbrLine = "attr(x, 'var.nmbr')<-varnmbr"; historyEntry.add(attrVarNmbrLine); c.voidEval(attrVarNmbrLine); // confrimation String [] vno = c.eval("attr(x, 'var.nmbr')").asStrings(); dbgLog.fine("varNo="+StringUtils.join(vno, ",")); // variable labels /* attr(x, "var.labels")<-c("race","age","vote") */ // String[] jvarlabels = {"race","age","vote"}; String[] jvarlabels = sro.getVariableLabels(); String vlQList = DvnDSButil.joinNelementsPerLine(jvarlabels,true); historyEntry.add("varlabels <-c("+ vlQList +")"); c.assign("varlabels", new REXPString(jvarlabels)); String attrVarLabelsLine = "attr(x, 'var.labels')<-varlabels"; historyEntry.add(attrVarLabelsLine); c.voidEval(attrVarLabelsLine); // confirmation String [] vlbl = c.eval("attr(x, 'var.labels')").asStrings(); dbgLog.fine("varlabels="+StringUtils.join(vlbl, ",")); // --------- block to be used for the production code // value-label table /* VALTABLE<-list() VALTABLE[["1"]]<-list( "2"="white", "1"="others") attr(x, 'val.table')<-VALTABLE */ // create the VALTABLE String vtFirstLine = "VALTABLE<-list()"; historyEntry.add(vtFirstLine); c.voidEval(vtFirstLine); Map<String, Map<String, String>> vltbl = sro.getValueTable(); Map<String, String> rnm2vi = sro.getRawVarNameToVarIdTable(); for (int j=0;j<jvnamesRaw.length;j++){ // if this variable has its value-label table, // pass its key and value arrays to the Rserve // and finalize a value-table at the Rserve String varId = rnm2vi.get(jvnamesRaw[j]); if (vltbl.containsKey(varId)){ Map<String, String> tmp = (HashMap<String, String>)vltbl.get(varId); Set<String> vlkeys = tmp.keySet(); String[] tmpk = (String[]) vlkeys.toArray(new String[vlkeys.size()]); String[] tmpv = getValueSet(tmp, tmpk); // debug dbgLog.fine("tmp:k="+ StringUtils.join(tmpk,",")); dbgLog.fine("tmp:v="+ StringUtils.join(tmpv,",")); // index number starts from 1(not 0) int indx = j +1; dbgLog.fine("index="+indx); if (tmpv.length > 0){ historyEntry.add("tmpk<-c("+ DvnDSButil.joinNelementsPerLine(tmpk, true) +")"); c.assign("tmpk", new REXPString(tmpk)); historyEntry.add("tmpv<-c("+ DvnDSButil.joinNelementsPerLine(tmpv, true) +")"); c.assign("tmpv", new REXPString(tmpv)); String namesValueLine = "names(tmpv)<- tmpk"; historyEntry.add(namesValueLine); c.voidEval(namesValueLine); String sbvl = "VALTABLE[['"+ Integer.toString(indx)+"']]" + "<- as.list(tmpv)"; dbgLog.fine("frag="+sbvl); historyEntry.add(sbvl); c.voidEval(sbvl); // confirmation test for j-th variable name REXP jl = c.parseAndEval(sbvl); dbgLog.fine("jl("+j+") = "+jl); } } } // debug: confirmation test for value-table dbgLog.fine("length of vl="+ c.eval("length(VALTABLE)").asInteger()); String attrValTableLine = "attr(x, 'val.table')<-VALTABLE"; historyEntry.add(attrValTableLine); c.voidEval(attrValTableLine); // --------- block to be used for the production code // missing-value list: TO DO /* MSVLTBL<-list(); attr(x, 'missval.table')<-MSVLTBL */ String msvStartLine = "MSVLTBL<-list();"; historyEntry.add(msvStartLine); c.voidEval(msvStartLine); // data structure String attrMissvalLine = "attr(x, 'missval.table')<-MSVLTBL"; historyEntry.add(attrMissvalLine); c.voidEval(attrMissvalLine); // attach attributes(tables) to the data.frame /* x<-createvalindex(dtfrm=x, attrname='val.index') x<-createvalindex(dtfrm=x, attrname='missval.index') */ String createVIndexLine = "x<-createvalindex(dtfrm=x, attrname='val.index');"; historyEntry.add(createVIndexLine); c.voidEval(createVIndexLine); String createMVIndexLine = "x<-createvalindex(dtfrm=x, attrname='missval.index');"; historyEntry.add(createMVIndexLine); c.voidEval(createMVIndexLine); // reflection block: start ------------------------------------------> String requestTypeToken = sro.getRequestType();// (Download|EDA|Xtab|Zelig) dbgLog.fine("requestTypeToken="+requestTypeToken); historyEntry.add("#### The Request is "+ requestTypeToken +" ####"); // get a test method Method mthd = runMethods.get(requestTypeToken); dbgLog.fine("method="+mthd); try { // invoke this method result = (Map<String, String>) mthd.invoke(this, sro, c); } catch (InvocationTargetException e) { //Throwable cause = e.getCause(); //err.format(cause.getMessage()); e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } // add the variable list result.put("variableList", joinNelementsPerLine(jvnamesRaw, 5, null, false, null, null)); //result.put("variableList",StringUtils.join(jvnamesRaw, ", ")); // calculate the file-leve UNF String fileUNFline = "fileUNF <- paste(summary(unf(x, version=3)))"; c.voidEval(fileUNFline); String fileUNF = c.eval("fileUNF").asString(); if (fileUNF == null){ fileUNF = "NA"; } String RversionLine = "R.Version()$version.string"; String Rversion = c.eval(RversionLine).asString(); String zeligVersionLine = "packageDescription('Zelig')$Version"; String zeligVersion = c.eval(zeligVersionLine).asString(); String RexecDate = c.eval("date()").asString(); /* if (result.containsKey("option")){ result.put("R_run_status", "T"); } else { result.put("option", requestTypeToken.toLowerCase()); //download zelig eda xtab result.put("R_run_status", "F"); } */ if (sro.hasRecodedVariables()){ // TODO result.put("subsettingCriteria", ""); } else { result.put("subsettingCriteria", ""); } result.put("fileUNF",fileUNF); result.put("dsbHost", RSERVE_HOST); result.put("dsbPort", DSB_HOST_PORT); result.put("dsbContextRootDir", DSB_CTXT_DIR ); result.put("PID", PID); result.put("Rversion", Rversion); result.put("zeligVersion", zeligVersion); result.put("RexecDate", RexecDate); result.put("RCommandHistory", StringUtils.join(historyEntry,"\n")); dbgLog.fine("result object (before closing the Rserve):\n"+result); // reflection block: end // close the Rserve connection c.close(); } catch (RserveException rse) { // RserveException (Rserve is not running) rse.printStackTrace(); result.put("dsbContextRootDir", DSB_CTXT_DIR ); result.put("PID", PID); result.put("RCommandHistory", StringUtils.join(historyEntry,"\n")); result.put("option",sro.getRequestType().toLowerCase()); result.put("RexecError", "true"); return result; } catch (REXPMismatchException mme) { // REXP mismatch exception (what we got differs from what we expected) mme.printStackTrace(); result.put("dsbContextRootDir", DSB_CTXT_DIR ); result.put("PID", PID); result.put("RCommandHistory", StringUtils.join(historyEntry,"\n")); result.put("option",sro.getRequestType().toLowerCase()); result.put("RexecError", "true"); return result; } catch (IOException ie){ ie.printStackTrace(); result.put("dsbContextRootDir", DSB_CTXT_DIR ); result.put("PID", PID); result.put("RCommandHistory", StringUtils.join(historyEntry,"\n")); result.put("option",sro.getRequestType().toLowerCase()); result.put("RexecError", "true"); return result; } catch (Exception ex){ ex.printStackTrace(); result.put("dsbContextRootDir", DSB_CTXT_DIR ); result.put("PID", PID); result.put("RCommandHistory", StringUtils.join(historyEntry,"\n")); result.put("option",sro.getRequestType().toLowerCase()); result.put("RexecError", "true"); return result; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Map<String, String> runEDARequest(DvnRJobRequest sro, RConnection c){\n String optionBanner = \"########### EDA option ###########\\n\";\n dbgLog.fine(optionBanner);\n historyEntry.add(optionBanner);\n \n Map<String, String> sr = new HashMap<String, String>();\n sr.put(\"requestdir\", requestdir);\n sr.put(\"option\", \"eda\");\n sr.put(\"type\", sro.getEDARequestType()); // 1=(1,0), 2=(0,1), 3=(1,1)\n \n String ResultHtmlFile = \"Rout.\"+PID+\".html\" ;\n sr.put(\"html\", \"/\"+requestdir+ \"/\" +ResultHtmlFile);\n \n String RcodeFile = \"Rcode.\" + PID + \".R\";\n \n try {\n String univarStatLine = \"try(x<-univarStat(dtfrm=x))\";\n \n \n \n //String vdcUtilLibLine = \"library(VDCutil)\";\n \n //c.voidEval(\"dol<-''\");\n \n dbgLog.fine(\"aol=\"+ sro.getEDARequestParameter());\n String aol4EDA = \"aol<-c(\"+ sro.getEDARequestParameter() +\")\";\n \n dbgLog.fine(\"aolLine=\"+ aol4EDA);\n historyEntry.add(aol4EDA);\n c.voidEval(aol4EDA);\n \n // create a manifest page for this job request\n String homePageTitle = \"Dataverse Analysis: Request #\"+PID ;\n \n // create a temp dir\n String createTmpDir = \"dir.create('\"+wrkdir +\"')\";\n dbgLog.fine(\"createTmpDir=\"+createTmpDir);\n historyEntry.add(createTmpDir);\n c.voidEval(createTmpDir);\n \n String ResultHtmlFileBase = \"Rout.\"+PID ;\n String openHtml = \"htmlsink<-HTMLInitFile(outdir = '\"+\n wrkdir +\"', filename='\"+ResultHtmlFileBase+\n \"', extension='html', CSSFile='R2HTML.css', Title ='\"+\n homePageTitle+\"')\";\n dbgLog.fine(\"openHtml=\"+openHtml);\n historyEntry.add(openHtml);\n c.voidEval(openHtml);\n \n String StudyTitle = sro.getStudytitle();\n String pageHeaderContents = \"hdrContents <- \\\"<h1>Dataverse Analysis</h1><h2>Results</h2><p>Study Title:\"+\n StudyTitle+\"</p><hr />\\\"\";\n \n dbgLog.fine(\"pageHeaderContents=\"+pageHeaderContents);\n historyEntry.add(pageHeaderContents);\n c.voidEval(pageHeaderContents);\n \n String pageHeader = \"HTML(file=htmlsink,hdrContents)\";\n dbgLog.fine(\"pageHeader=\"+pageHeader);\n historyEntry.add(pageHeader);\n c.voidEval(pageHeader);\n \n // create visuals directory for an EDA case\n String createVisualsDir = \"dir.create('\"+ wrkdir +\n \"/\" + \"visuals\" +\"')\";\n dbgLog.fine(\"visualsDir=\"+createVisualsDir);\n historyEntry.add(createVisualsDir);\n c.voidEval(createVisualsDir);\n \n // command lines\n dbgLog.fine(\"univarStatLine=\"+univarStatLine);\n c.voidEval(univarStatLine);\n historyEntry.add(univarStatLine);\n String univarChart = \"try({x<-univarChart(dtfrm=x, \" +\n \"analysisoptn=aol, \" +\n \"imgflprfx='\" + wrkdir + \"/\" + \n \"visuals\" + \"/\" + \"Rvls.\" + PID +\n \"',standalone=F)})\";\n dbgLog.fine(\"univarChart=\"+univarChart);\n historyEntry.add(univarChart);\n c.voidEval(univarChart);\n \n String univarStatHtmlBody = \"try(univarStatHtmlBody(dtfrm=x,\"+\n \"whtml=htmlsink, analysisoptn=aol))\";\n dbgLog.fine(\"univarStatHtmlBody=\"+univarStatHtmlBody);\n historyEntry.add(univarStatHtmlBody);\n c.voidEval(univarStatHtmlBody);\n \n String closeHtml = \"HTMLEndFile()\";\n historyEntry.add(closeHtml);\n c.voidEval(closeHtml);\n \n // save workspace\n String objList = \"objList<-ls()\";\n dbgLog.fine(\"objList=\"+objList);\n c.voidEval(objList);\n \n String RdataFileName = \"Rworkspace.\"+PID+\".RData\";\n sr.put(\"Rdata\", \"/\"+requestdir+ \"/\" + RdataFileName);\n \n String saveWS = \"save(list=objList, file='\"+ wrkdir +\"/\"+ RdataFileName +\"')\";\n dbgLog.fine(\"save the workspace=\"+saveWS);\n c.voidEval(saveWS);\n \n \n \n \n \n // write back the R workspace to the dvn \n \n String wrkspFileName = wrkdir +\"/\"+ RdataFileName;\n dbgLog.fine(\"wrkspFileName=\"+wrkspFileName);\n \n int wrkspflSize = getFileSize(c,wrkspFileName);\n \n File wsfl = writeBackFileToDvn(c, wrkspFileName, RWRKSP_FILE_PREFIX,\"RData\", wrkspflSize);\n \n if (wsfl != null){\n sr.put(\"wrkspFileName\", wsfl.getAbsolutePath());\n dbgLog.fine(\"wrkspFileName=\"+wsfl.getAbsolutePath());\n } else {\n dbgLog.fine(\"wrkspFileName is null\");\n }\n \n \n \n // command history\n String[] ch = (String[])historyEntry.toArray(new String[historyEntry.size()]);\n c.assign(\"ch\", new REXPString(ch));\n String saveRcodeFile = \"cat(file='\"+ wrkdir +\"/\"+ RcodeFile +\"',paste(ch,collapse='\\n'))\";\n dbgLog.fine(saveRcodeFile);\n c.voidEval(saveRcodeFile);\n \n // copy the dvn-patch css file to the wkdir\n // file.copy(from, to, overwrite = FALSE)\n String cssFile = R2HTML_CSS_DIR + \"/\" +\"R2HTML.css\";\n String cpCssFile = \"file.copy('\"+cssFile+\"','\"+wrkdir+\"')\";\n c.voidEval(cpCssFile);\n \n // tab data file\n String mvTmpTabFile = \"file.rename('\"+ tempFileName +\"','\"+ tempFileNameNew +\"')\";\n c.voidEval(mvTmpTabFile);\n dbgLog.fine(\"move temp file=\"+mvTmpTabFile);\n \n \n \n \n \n \n \n \n \n \n \n // move the temp dir to the web-temp root dir\n String mvTmpDir = \"file.rename('\"+wrkdir+\"','\"+webwrkdir+\"')\";\n dbgLog.fine(\"web-temp_dir=\"+mvTmpDir);\n c.voidEval(mvTmpDir);\n \n } catch (RserveException rse) {\n rse.printStackTrace();\n sr.put(\"RexecError\", \"true\");\n return sr;\n }\n \n sr.put(\"RexecError\", \"false\");\n return sr;\n }", "public Map<String, String> runZeligRequest(DvnRJobRequest sro, RConnection c){\n String optionBanner = \"########### zelig option ###########\\n\";\n dbgLog.fine(optionBanner);\n historyEntry.add(optionBanner);\n \n Map<String, String> sr = new HashMap<String, String>();\n sr.put(\"requestdir\", requestdir);\n sr.put(\"option\", \"zelig\");\n \n String RcodeFile = \"Rcode.\" + PID + \".R\";\n \n \n String modelname = sro.getZeligModelName();\n dbgLog.fine(\"modelname=\"+modelname);\n sr.put(\"model\", modelname);\n \n try {\n \n String univarStatLine = \"try(x<-univarStat(dtfrm=x))\";\n String ResultHtmlFile = null; //\"Rout.\"+PID+\".html\" ;\n String RdataFileName = null;\n String vdcUtilLibLine = \"library(VDCutil)\";\n \n //c.voidEval(\"dol<-''\");\n String aol4Zelig = \"aol<-c(0,0,0)\";\n historyEntry.add(aol4Zelig);\n c.voidEval(aol4Zelig);\n \n historyEntry.add(vdcUtilLibLine);\n c.voidEval(vdcUtilLibLine);\n \n /* \n ########## Code listing ##########\n library(VDCutil)\n ########## Requested option = logit ##########\n bnryVarTbl <-attr(table(x[[3]]), 'dimnames')[[1]];\n \n x[[3]]<- checkBinaryResponse(x[[3]])\n \n try( {zlg.out<- VDCgenAnalysis(\n outDir=\"/tmp/VDC/DSB/zlg_28948/rqst_1\",\n vote ~ age+race,\n model=\"logit\",\n data=x,\n wantSummary=T,wantPlots=T,wantSensitivity=F,wantSim=F,wantBinOutput=F,\n setxArgs=list(), setx2Args=list(),\n HTMLInitArgs=list(Title=\"Dataverse Analysis\")\n , HTMLnote= \"<em>The following are the results of your requested analysis.\n </em><br/><a href='javascript:window.history.go(-1);\n '>Go back to the previous page</a>\")} )\n \n ########## Code listing: end ##########\n \n */\n \n // Additional coding required here\n /*\n x[[3]]<- checkBinaryResponse(x[[3]])\n * 3 must be parameterized for binary response models\n */\n if (sro.isOutcomeBinary()){\n int bcol = sro.getOutcomeVarPosition();\n dbgLog.fine(\"col:pos=\"+bcol);\n String binaryResponseVar = null;\n \n if (sro.IsOutcomeVarRecoded) {\n String col = sro.getRecodedVarNameSet()[bcol];\n binaryResponseVar = \"x[['\" +col +\"']]\";\n dbgLog.fine(\"col:name=\"+col);\n } else {\n binaryResponseVar = \"x[[\" + (bcol+1) +\"]]\";\n dbgLog.fine(\"col:pos(1 added)=\"+bcol);\n }\n \n String checkBinaryVarLine= binaryResponseVar +\n \"<- checkBinaryResponse(\"+binaryResponseVar+\")\";\n dbgLog.fine(checkBinaryVarLine);\n historyEntry.add(checkBinaryVarLine);\n c.voidEval(checkBinaryVarLine);\n }\n \n Map<String, String> ZlgModelParam = new HashMap<String, String>();\n \n // create a temp dir\n String createTmpDir = \"dir.create('\"+wrkdir +\"')\";\n historyEntry.add(createTmpDir);\n c.voidEval(createTmpDir);\n \n // output option: sum plot Rdata\n String[] zeligOptns = sro.getZeligOutputOptions();\n \n String simOptn = sro.getZeligSimulationOption();\n String setxType= null;\n String setxArgs = null;\n String setx2Args = null;\n \n if (simOptn.equals(\"T\")){\n // simulation was requested\n setxType= sro.getZeligSetxType();\n dbgLog.fine(\"setxType=\"+setxType);\n if (setxType == null){\n setxArgs = \"NULL\";\n setx2Args= \"NULL\";\n } else {\n if (setxType.equals(\"0\")) {\n // default case\n setxArgs = \"NULL\";\n setx2Args= \"NULL\";\n } else if (setxType.equals(\"1\")){\n // non-default cases\n if ( (sro.getSetx1stSet() != null) && (sro.getSetx2ndSet() != null)){\n // first diff case\n setxArgs = sro.getSetx1stSet();\n setx2Args= sro.getSetx2ndSet();\n \n } else if (sro.getSetx2ndSet() == null){\n // single condition\n setxArgs = sro.getSetx1stSet();\n setx2Args= \"NULL\";\n } else {\n setxArgs = \"NULL\";\n setx2Args= \"NULL\";\n }\n \n }\n }\n }else {\n setxArgs = \"NULL\";\n setx2Args= \"NULL\";\n }\n \n // Additional coding required here\n \n String lhsTerm = sro.getLHSformula();\n String rhsTerm = sro.getRHSformula();\n \n String VDCgenAnalysisline = \n \"try( { zlg.out<- VDCgenAnalysis(\" +\n \"outDir='\" + wrkdir +\"',\"+\n lhsTerm + \"~\" + rhsTerm + \",\"+\n \"model='\" + modelname +\"',\"+\n \"data=x,\" +\n \"wantSummary=\" + zeligOptns[0] + \",\"+\n \"wantPlots=\" + zeligOptns[1] + \",\"+\n \"wantSensitivity=F\" + \",\"+\n \"wantSim=\" + simOptn + \",\"+\n \"wantBinOutput=\" + zeligOptns[2] + \",\"+\n \"setxArgs=\" + setxArgs + \",\"+\n \"setx2Args=\" + setx2Args + \",\"+\n \"HTMLInitArgs= list(Title='Dataverse Analysis')\"+ \",\" +\n \"HTMLnote= '<em>The following are the results of your requested analysis.</em>'\"+\n \") } )\";\n \n /*\n o: sum(T), Plot(T), BinOut(F)\n a: sim (F), sen(always F)\n \n \"TMLInitArgs=list(Title='Dataverse Analysis'),\"+\n \"HTMLnote= '<em>The following are the results of your\n requested analysis.</em><br/>\n <a href=\\\"javascript:window.history.go(-1);\n \\\">Go back to the previous page</a>'\"+\n \n */\n dbgLog.fine(\"VDCgenAnalysis=\"+VDCgenAnalysisline);\n historyEntry.add(VDCgenAnalysisline);\n c.voidEval(VDCgenAnalysisline);\n \n RList zlgout = c.parseAndEval(\"zlg.out\").asList();\n //String strzo = c.parseAndEval(\"str(zlg.out)\").asString();\n \n String[] kz = zlgout.keys();\n dbgLog.fine(\"zlg.out:no of keys=\"+kz.length );// \"\\t\"+kz[0]+\"\\t\"+kz[1]\n \n for (int i=0; i<kz.length; i++){\n String [] tmp = zlgout.at(kz[i]).asString().split(\"/\");\n dbgLog.fine(kz[i]+\"=\"+tmp[tmp.length-1]);\n if (kz[i].equals(\"html\")){\n ResultHtmlFile = tmp[tmp.length-1];\n } else if (kz[i].equals(\"Rdata\")){\n RdataFileName = tmp[tmp.length-1];\n }\n }\n /*\n outDir = '/tmp/VDC/DSB/Zlg_562491' <= wrkdir\n html = index1214813662.23516A14671A1080869822.html\n Rdata = binfile1214813662.23516A14671A1080869822.Rdata\n */\n \n sr.put(\"html\", \"/\"+requestdir+ \"/\" +ResultHtmlFile);\n sr.put(\"Rdata\", \"/\"+requestdir+ \"/\" + RdataFileName);\n \n // write back the R workspace to the dvn \n \n String wrkspFileName = wrkdir +\"/\"+ RdataFileName;\n dbgLog.fine(\"wrkspFileName=\"+wrkspFileName);\n \n int wrkspflSize = getFileSize(c,wrkspFileName);\n \n File wsfl = writeBackFileToDvn(c, wrkspFileName, RWRKSP_FILE_PREFIX,\"RData\", wrkspflSize);\n \n if (wsfl != null){\n sr.put(\"wrkspFileName\", wsfl.getAbsolutePath());\n dbgLog.fine(\"wrkspFileName=\"+wsfl.getAbsolutePath());\n } else {\n dbgLog.fine(\"wrkspFileName is null\");\n }\n \n \n \n \n \n \n \n \n \n \n // copy the dvn-patch css file to the wkdir\n // file.copy(from, to, overwrite = FALSE)\n String cssFile = R2HTML_CSS_DIR + \"/\" +\"R2HTML.css\";\n String cpCssFile = \"file.copy('\"+cssFile+\"','\"+wrkdir+\"')\";\n c.voidEval(cpCssFile);\n \n // command history\n String[] ch = (String[])historyEntry.toArray(new String[historyEntry.size()]);\n c.assign(\"ch\", new REXPString(ch));\n String saveRcodeFile = \"cat(file='\"+ wrkdir +\"/\"+ RcodeFile +\"',paste(ch,collapse='\\n'))\";\n dbgLog.fine(saveRcodeFile);\n c.voidEval(saveRcodeFile);\n \n // tab data file\n String mvTmpTabFile = \"file.rename('\"+ tempFileName +\"','\"+ tempFileNameNew +\"')\";\n c.voidEval(mvTmpTabFile);\n dbgLog.fine(\"move temp file=\"+mvTmpTabFile);\n \n \n // move the temp dir to the web-temp root dir\n String mvTmpDir = \"file.rename('\"+wrkdir+\"','\"+webwrkdir+\"')\";\n dbgLog.fine(\"web-temp_dir=\"+mvTmpDir);\n c.voidEval(mvTmpDir);\n \n } catch (REngineException ree){\n ree.printStackTrace();\n sr.put(\"RexecError\", \"true\");\n return sr;\n } catch (RserveException rse) {\n rse.printStackTrace();\n sr.put(\"RexecError\", \"true\");\n return sr;\n } catch (REXPMismatchException mme) {\n mme.printStackTrace();\n sr.put(\"RexecError\", \"true\");\n return sr;\n }\n sr.put(\"RexecError\", \"false\");\n \n return sr;\n }", "public Map<String, String> runDownloadRequest(DvnRJobRequest sro, RConnection c){\n \n String optionBanner = \"########### downloading option ###########\\n\";\n dbgLog.fine(optionBanner);\n historyEntry.add(optionBanner);\n \n Map<String, String> sr = new HashMap<String, String>();\n sr.put(\"requestdir\", requestdir);\n sr.put(\"option\", \"download\");\n \n String RcodeFile = \"Rcode.\" + PID + \".R\";\n \n try {\n // create a temp dir\n String createTmpDir = \"dir.create('\"+wrkdir +\"')\";\n dbgLog.fine(\"createTmpDir=\"+createTmpDir);\n historyEntry.add(createTmpDir);\n c.voidEval(createTmpDir);\n \n \n String dwnldOpt = sro.getDownloadRequestParameter();\n String dwnldFlxt = dwlndParam.get(dwnldOpt);\n \n sr.put(\"format\", dwnldFlxt); \n \n String dataFileName = \"Data.\" + PID + \".\" + dwnldFlxt;\n \n sr.put(\"subsetfile\", \"/\"+requestdir+ \"/\" +dataFileName);\n \n // data file to be copied back to the dvn\n String dsnprfx = wrkdir + \"/\" + dataFileName;\n \n String univarDataDwnld = \"univarDataDwnld(dtfrm=x,\"+\n \"dwnldoptn='\"+dwnldOpt+\"'\"+\n \", dsnprfx='\"+dsnprfx+\"')\";\n \n dbgLog.fine(\"univarDataDwnld=\"+univarDataDwnld);\n historyEntry.add(univarDataDwnld);\n c.voidEval(univarDataDwnld);\n \n int wbFileSize = getFileSize(c,dsnprfx);\n \n dbgLog.fine(\"wbFileSize=\"+wbFileSize);\n \n // write back the data file to the dvn\n \n String dtflprefix = \"tmpDataFile\";\n \n File dtfl = writeBackFileToDvn(c, dsnprfx, dtflprefix, dwlndParam.get(dwnldOpt), wbFileSize);\n if (dtfl != null){\n sr.put(\"wbDataFileName\", dtfl.getAbsolutePath());\n dbgLog.fine(\"wbDataFileName=\"+dtfl.getAbsolutePath());\n } else {\n dbgLog.fine(\"wbDataFileName is null\");\n }\n \n // save workspace\n String objList = \"objList<-ls()\";\n dbgLog.fine(\"objList=\"+objList);\n c.voidEval(objList);\n \n String RdataFileName = \"Rworkspace.\"+PID+\".RData\";\n \n sr.put(\"Rdata\", \"/\"+requestdir+ \"/\" + RdataFileName);\n \n String saveWS = \"save(list=objList, file='\"+wrkdir +\"/\"+ RdataFileName +\"')\";\n dbgLog.fine(\"save the workspace=\"+saveWS);\n c.voidEval(saveWS);\n \n // write back the R workspace to the dvn \n \n String wrkspFileName = wrkdir +\"/\"+ RdataFileName;\n dbgLog.fine(\"wrkspFileName=\"+wrkspFileName);\n \n int wrkspflSize = getFileSize(c,wrkspFileName);\n \n File wsfl = writeBackFileToDvn(c, wrkspFileName, RWRKSP_FILE_PREFIX ,\"RData\", wrkspflSize);\n \n if (wsfl != null){\n sr.put(\"wrkspFileName\", wsfl.getAbsolutePath());\n dbgLog.fine(\"wrkspFileName=\"+wsfl.getAbsolutePath());\n } else {\n dbgLog.fine(\"wrkspFileName is null\");\n }\n \n // command history\n String[] ch = (String[])historyEntry.toArray(new String[historyEntry.size()]);\n c.assign(\"ch\", new REXPString(ch));\n String saveRcodeFile = \"cat(file='\"+ wrkdir +\"/\"+ RcodeFile +\"',paste(ch,collapse='\\n'))\";\n dbgLog.fine(saveRcodeFile);\n c.voidEval(saveRcodeFile);\n \n \n // tab data file\n String mvTmpTabFile = \"file.rename('\"+ tempFileName +\"','\"+ tempFileNameNew +\"')\";\n c.voidEval(mvTmpTabFile);\n dbgLog.fine(\"move temp file=\"+mvTmpTabFile);\n \n // move the temp dir to the web-temp root dir\n String mvTmpDir = \"file.rename('\"+wrkdir+\"','\"+webwrkdir+\"')\";\n dbgLog.fine(\"web-temp_dir=\"+mvTmpDir);\n c.voidEval(mvTmpDir);\n \n } catch (RserveException rse) {\n rse.printStackTrace();\n sr.put(\"RexecError\", \"true\");\n return sr;\n }\n \n sr.put(\"RexecError\", \"false\");\n return sr;\n }", "R execute();", "R request();", "private static void runRankBasedSVD(int loss, int rank, double learningRate, boolean verbose) {\n\t\tint maxIter = 20;\r\n\t\tdouble regularizer = 1E-6;\r\n\t\t\r\n\t\tRankBasedSVD rsvd = new RankBasedSVD(\r\n\t\t\tuserCount, itemCount, maxValue, minValue,\r\n\t\t\trank, learningRate, regularizer, 0, maxIter,\r\n\t\t\tloss, testMatrix, null, null, verbose);\r\n\t\t\t\r\n\t\tSystem.out.println(\"RSVD\" + \"\\t\" + loss + \"\\t\" + rank + \"\\t\" + testRecommender(\"RSVD\", rsvd));\r\n\t}", "public Map<String, String> runXtabRequest(DvnRJobRequest sro, RConnection c){\n String optionBanner = \"########### xtab option ###########\\n\";\n dbgLog.fine(optionBanner);\n historyEntry.add(optionBanner);\n \n Map<String, String> sr = new HashMap<String, String>();\n sr.put(\"requestdir\", requestdir);\n sr.put(\"option\", \"xtab\");\n \n String ResultHtmlFile = \"Rout.\"+PID+\".html\" ;\n sr.put(\"html\", \"/\"+requestdir+ \"/\" +ResultHtmlFile);\n \n String RcodeFile = \"Rcode.\" + PID + \".R\";\n \n try {\n String univarStatLine = \"try(x<-univarStat(dtfrm=x))\";\n String vdcUtilLibLine = \"library(VDCutil)\";\n \n //c.voidEval(\"dol<-''\");\n \n String aol4xtab = \"aol<-c(0,0,1)\";\n historyEntry.add(aol4xtab);\n c.voidEval(aol4xtab);\n \n // create a manifest page for this job request\n String homePageTitle = \"Dataverse Analysis: Request #\"+PID ;\n \n // create a temp dir\n String createTmpDir = \"dir.create('\"+wrkdir +\"')\";\n dbgLog.fine(\"createTmpDir=\"+createTmpDir);\n historyEntry.add(createTmpDir);\n c.voidEval(createTmpDir);\n \n \n String ResultHtmlFileBase = \"Rout.\"+PID ;\n String openHtml = \"htmlsink<-HTMLInitFile(outdir = '\"+\n wrkdir +\"', filename='\"+ResultHtmlFileBase+\n \"', extension='html', CSSFile='R2HTML.css', Title ='\"+\n homePageTitle+\"')\";\n dbgLog.fine(\"openHtml=\"+openHtml);\n historyEntry.add(openHtml);\n c.voidEval(openHtml);\n \n String StudyTitle = sro.getStudytitle();\n String pageHeaderContents = \"hdrContents <- \\\"<h1>Dataverse Analysis</h1><h2>Results</h2><p>Study Title:\"+\n StudyTitle+\"</p><hr />\\\"\";\n \n dbgLog.fine(\"pageHeaderContents=\"+pageHeaderContents);\n historyEntry.add(pageHeaderContents);\n c.voidEval(pageHeaderContents);\n \n String pageHeader = \"HTML(file=htmlsink,hdrContents)\";\n dbgLog.fine(\"pageHeader=\"+pageHeader);\n historyEntry.add(pageHeader);\n c.voidEval(pageHeader);\n \n /*\n aol<-c(0,0,1)\n dol<-\"\"\n try(x<-univarStat(dtfrm=x))\n library(VDCutil);\n try(VDCcrossTabulation(HTMLfile=\"/tmp/VDC/Rout.6769.html\",\n data=x,\n classificationVars=c('NAThex5FDISChex5Fnew','LOChex5FINThex5Fnew'),\n wantPercentages=F, wantTotals=T, wantStats=T, wantExtraTables=T));\n */\n \n // command lines\n dbgLog.fine(\"univarStatLine=\"+univarStatLine);\n historyEntry.add(univarStatLine);\n c.voidEval(univarStatLine);\n \n historyEntry.add(vdcUtilLibLine);\n c.voidEval(vdcUtilLibLine);\n \n String[] classVar = sro.getXtabClassVars();\n historyEntry.add(\"classVar<-c(\"+ DvnDSButil.joinNelementsPerLine(classVar, true)+\")\");\n c.assign(\"classVar\", new REXPString(classVar));\n \n String[] freqVar = sro.getXtabFreqVars();\n \n if (freqVar != null){\n historyEntry.add(\"freqVar<-c(\"+ DvnDSButil.joinNelementsPerLine(freqVar, true) +\")\");\n c.assign(\"freqVar\", new REXPString(freqVar));\n }else {\n historyEntry.add(\"freqVar<-c()\");\n c.voidEval(\"freqVar<-c()\");\n }\n \n String[] xtabOptns= sro.getXtabOutputOptions();// {\"F\", \"T\", \"T\", \"T\"};\n \n //\"HTMLfile='\"+wrkdir+ \"/\" +ResultHtmlFile+\"'\"+\n \n String VDCxtab = \"try(VDCcrossTabulation(\"+\n \"HTMLfile=htmlsink\"+\n \", data=x\"+ \n \", classificationVars=classVar\"+\n \", freqVars=freqVar\" +\n \", wantPercentages=\"+xtabOptns[2]+\n \", wantTotals=\"+xtabOptns[0]+\n \", wantStats=\"+xtabOptns[1]+\n \", wantExtraTables=\"+xtabOptns[3]+\"))\";\n \n dbgLog.fine(\"VDCxtab=\"+VDCxtab);\n historyEntry.add(VDCxtab);\n c.voidEval(VDCxtab);\n \n String closeHtml = \"HTMLEndFile()\";\n historyEntry.add(closeHtml);\n c.voidEval(closeHtml);\n \n // save workspace\n String objList = \"objList<-ls()\";\n dbgLog.fine(\"objList=\"+objList);\n c.voidEval(objList);\n \n String RdataFileName = \"Rworkspace.\"+PID+\".RData\";\n \n sr.put(\"Rdata\", \"/\"+requestdir+ \"/\" + RdataFileName);\n \n String saveWS = \"save(list=objList, file='\"+wrkdir +\"/\"+ RdataFileName +\"')\";\n dbgLog.fine(\"save the workspace=\"+saveWS);\n c.voidEval(saveWS);\n \n \n \n \n \n \n \n // write back the R workspace to the dvn \n \n String wrkspFileName = wrkdir +\"/\"+ RdataFileName;\n dbgLog.fine(\"wrkspFileName=\"+wrkspFileName);\n \n int wrkspflSize = getFileSize(c,wrkspFileName);\n \n File wsfl = writeBackFileToDvn(c, wrkspFileName, RWRKSP_FILE_PREFIX ,\"RData\", wrkspflSize);\n \n if (wsfl != null){\n sr.put(\"wrkspFileName\", wsfl.getAbsolutePath());\n dbgLog.fine(\"wrkspFileName=\"+wsfl.getAbsolutePath());\n } else {\n dbgLog.fine(\"wrkspFileName is null\");\n }\n \n \n \n \n \n \n \n \n \n \n // command history\n String[] ch = (String[])historyEntry.toArray(new String[historyEntry.size()]);\n c.assign(\"ch\", new REXPString(ch));\n String saveRcodeFile = \"cat(file='\"+ wrkdir +\"/\"+ RcodeFile +\"',paste(ch,collapse='\\n'))\";\n dbgLog.fine(saveRcodeFile);\n c.voidEval(saveRcodeFile);\n \n // copy the dvn-patch css file to the wkdir\n // file.copy(from, to, overwrite = FALSE)\n String cssFile =R2HTML_CSS_DIR + \"/\" +\"R2HTML.css\";\n String cpCssFile = \"file.copy('\"+cssFile+\"','\"+wrkdir+\"')\";\n c.voidEval(cpCssFile);\n \n // tab data file\n String mvTmpTabFile = \"file.rename('\"+ tempFileName +\"','\"+ tempFileNameNew +\"')\";\n c.voidEval(mvTmpTabFile);\n dbgLog.fine(\"move temp file=\"+mvTmpTabFile);\n \n // move the temp dir to the web-temp root dir\n String mvTmpDir = \"file.rename('\"+wrkdir+\"','\"+webwrkdir+\"')\";\n dbgLog.fine(\"web-temp_dir=\"+mvTmpDir);\n c.voidEval(mvTmpDir);\n \n } catch (RserveException rse) {\n rse.printStackTrace();\n sr.put(\"RexecError\", \"true\");\n return sr;\n }\n \n sr.put(\"RexecError\", \"false\");\n \n return sr;\n }", "ServiceResponse execute(RequestParameters request);", "@Override\n\tpublic void run( String arg )\n\t{\n\t\tfinal LoadParseQueryXML result = new LoadParseQueryXML();\n\n\t\tif ( !result.queryXML( \"Dataset Quality Estimation\", true, true, true, true, true ) )\n\t\t\treturn;\n\n\t\testimateFRC( result.getData(), SpimData2.getAllViewIdsSorted( result.getData(), result.getViewSetupsToProcess(), result.getTimePointsToProcess() ) );\n\t}", "@Override\n\tpublic void execute() {\n\t\tDMNModel model = getDmnRuntime().getModels().get(0); // assuming there is only one model in the KieBase\n\t\t\n\t\t// setting input data\n\t\tDMNContext dmnContext = createDmnContext(\n\t\t\t\tImmutablePair.of(\"customerData\", new CustomerData(\"Silver\", new BigDecimal(15)))\n\t\t);\n\t\t\n\t\t// executing decision logic\n\t\tDMNResult topLevelResult = getDmnRuntime().evaluateAll(model, dmnContext);\n\t\t\n\t\t// retrieving execution results\n\t\tSystem.out.println(\"--- results of evaluating all ---\");\n\t\ttopLevelResult.getDecisionResults().forEach(this::printAsJson);\n\t}", "@Override\n\tpublic void execute() {\n\t\tSystem.out.println(\"==STATISTICS FOR THE RESTAURANT==\");\n\t\tSystem.out.println(\"Most used Ingredients:\");\n\t\tmanager.printIngredients();\n\t\tSystem.out.println(\"Most ordered items:\");\n\t\tmanager.printMenuItems();\n\t\tSystem.out.println(\"==END STATISTICS==\");\n\t}", "public void incomingSearchRequest(APDUEvent e)\n {\n LOGGER.finer(\"Processing incomingSearch_Request\");\n \n SearchRequest_type search_request = (SearchRequest_type) (e.getPDU().o);\n \n // Create a search response\n PDU_type pdu = new PDU_type();\n pdu.which=PDU_type.searchresponse_CID;\n SearchResponse_type response = new SearchResponse_type();\n pdu.o = response;\n \n int ssub = search_request.smallSetUpperBound.intValue();\n int lslb = search_request.largeSetLowerBound.intValue();\n int mspn = search_request.mediumSetPresentNumber.intValue();\n \n LOGGER.finer(\"ssub = \" + ssub + \" lslb = \" + lslb + \" mspn = \" + mspn);\n \n response.referenceId = search_request.referenceId; \n \n // Assume failure unless something below sets to true\n response.searchStatus = Boolean.FALSE;\n \n RootNode rn = null;\n \n try\n {\n switch(search_request.query.which)\n {\n case Query_type.type_0_CID:\n LOGGER.finer(\"Processing Any Query\");\n // Any\n break;\n case Query_type.type_1_CID:\n case Query_type.type_101_CID:\n // RPN query\n LOGGER.finer(\"Processing RPN Query\");\n rn = com.k_int.z3950.util.RPN2Internal.zRPNStructure2RootNode\n \t ((RPNQuery_type)(search_request.query.o));\n break;\n case Query_type.type_2_CID:\n case Query_type.type_100_CID:\n case Query_type.type_102_CID:\n LOGGER.finer(\"Processing OctetString Query\");\n // Octet String\n break;\n }\n \n if ( rn != null )\n {\n LOGGER.finer(\"Got root node\");\n \n IRQuery q = new IRQuery();\n q.collections = search_request.databaseNames;\n q.query = new com.k_int.IR.QueryModels.RPNTree(rn);\n \n // Process the query\n LOGGER.finer(\"Create Search Task with query:\" + q);\n SearchTask st = search_service.createTask\n \t (q, search_request.referenceId);\n \t\n \n // Evaluate the query, waiting 10 seconds for the task to complete. \n \t//We really want to be\n // able to pass in a predicate to wait for here, \n \t//e.g. evaluate(10000, \"NumHits > 100 OR Status=Complete\");\n LOGGER.finer(\"Evaluate Search Task\");\n try\n {\n st.evaluate(10000);\n }\n catch ( TimeoutExceededException tee )\n {\n LOGGER.finer(\"Timeout exceeded waiting for search to complete\");\n }\n \n if ( search_request.resultSetName != null ) {\n \t LOGGER.finer(\"putting st with name \" + \n \t\t\t search_request.resultSetName);\n \t active_searches.put(search_request.resultSetName, st);\n \t}\n \tactive_searches.put(\"Default\", st);\n \t\n // Result records processing\n int result_count = st.getTaskResultSet().getFragmentCount();\n LOGGER.finer(\"result count is \"+result_count);\n \n // Number of hits\n response.resultCount = BigInteger.valueOf(result_count);\n \n // Figure out Search Status\n if ( ( st.getTaskStatusCode() != SearchTask.TASK_FAILURE ) )\n {\n response.searchStatus = Boolean.TRUE;\n }\n else\n {\n // Figure out Result Set Status\n switch ( st.getTaskStatusCode() )\n {\n case SearchTask.TASK_EXECUTING_ASYNC:\n case SearchTask.TASK_EXECUTING_SYNC:\n // resultSetStatus = 2 (interim) Partial results available, \n \t\t//not necessarily valid\n response.resultSetStatus = BigInteger.valueOf(2);\n break;\n case SearchTask.TASK_FAILURE:\n // resultSetStatus = 3 (none) No result set\n response.resultSetStatus = BigInteger.valueOf(3);\n break;\n }\n }\n \n LOGGER.finer(\"Is \"+result_count+\" <= \"+lslb +\" or <= \"+ssub);\n \n if ( ( result_count <= lslb ) || ( result_count <= ssub ) )\n {\n LOGGER.finer(\"Yep\");\n \n int start = 1;\n int count = ( result_count <= ssub ? result_count : mspn );\n \n if ( count > 0 )\n \t {\n \t\t LOGGER.finer(\"Asking for \"+count+\n \t\t\t \" response records from \"+start);\n \t\t LOGGER.finer(\"Search request default = \" \n \t\t\t + search_request.preferredRecordSyntax);\n \t\t response.records = createRecordsFor\n \t\t (st, search_request.preferredRecordSyntax, start, \n \t\t count, GeoProfile.BREIF_SET);\n \t\t \n \n \t\t if (response.records.which == \n \t\t Records_type.responserecords_CID ){\n \t\t LOGGER.finer(\"We have records\");\n \t\t \n \t\t // Looks like we managed to present some records OK..\n \t\t response.numberOfRecordsReturned = \n \t\t\t BigInteger.valueOf(((Vector)\n \t\t\t\t\t (response.records.o)).size());\n \t\t response.nextResultSetPosition = \n \t\t\t BigInteger.valueOf(count+1);\n \t\t response.presentStatus = BigInteger.valueOf(0);\n \t\t } else { // Non surrogate diagnostics ( Single or Multiple )\n \t\t \n \t\t LOGGER.finer(\"Diagnostics\");\n \t\t response.presentStatus = BigInteger.valueOf(5);\n \t\t response.numberOfRecordsReturned = \n \t\t\t BigInteger.valueOf(0);\n \t\t response.nextResultSetPosition = \n \t\t\t BigInteger.valueOf(1);\n \t\t }\n \t } else {\n \t\t LOGGER.finer(\"No need to piggyback records....\");\n \t\t response.numberOfRecordsReturned = BigInteger.valueOf(0);\n \t\t response.nextResultSetPosition = BigInteger.valueOf(1);\n \t\t response.presentStatus = BigInteger.valueOf(0);\n \t }\n } else {\n \t response.presentStatus = BigInteger.valueOf(5);\n \t response.numberOfRecordsReturned = BigInteger.valueOf(0);\n \t response.nextResultSetPosition = BigInteger.valueOf(1); \t\n \t}\n }\n else\n \t LOGGER.finer(\"Unable to process query into root node\");\n }\n catch ( com.k_int.IR.InvalidQueryException iqe )\n \t{\n \t // Need to send a diagnostic\n \t iqe.printStackTrace();\n \t response.resultCount = BigInteger.valueOf(0);\n \t response.presentStatus = BigInteger.valueOf(5); // Failure\n \t response.numberOfRecordsReturned = BigInteger.valueOf(0);\n \t response.nextResultSetPosition = BigInteger.valueOf(0);\n \t response.resultSetStatus = BigInteger.valueOf(3);\n \t // No result set available\n \t response.records = createNSD(null, iqe.toString());\n \t}\n catch ( SearchException se )\n \t{\n \t // We need to populate a diagnostic here\n \t LOGGER.finer(\"Search returning diagnostic. Reason:\"+se.toString());\n \t se.printStackTrace();\n \t response.resultCount = BigInteger.valueOf(0);\n \t response.presentStatus = BigInteger.valueOf(5); // Failure\n \t response.numberOfRecordsReturned = BigInteger.valueOf(0);\n \t response.nextResultSetPosition = BigInteger.valueOf(0);\n \t response.resultSetStatus = BigInteger.valueOf(3); \n \t // No result set available\n \t response.records = createNSD((String)(se.additional), \n \t\t\t\t\t se.toString());\n \t}\n \n LOGGER.finer(\"Send search response : \");\n try\n \t{\n \t assoc.encodeAndSend(pdu);\n \t}\n catch ( java.io.IOException ioe )\n \t{\n \t ioe.printStackTrace();\n \t} \n }", "public static void main(String[] args) {\n ExecuteParams executeParams1 = new ExecuteParams();\n ExecuteParams executeParams2 = new ExecuteParams();\n ExecuteParams executeParams30 = new ExecuteParams();\n ExecuteParams executeParams31 = new ExecuteParams();\n ExecuteParams executeParams32 = new ExecuteParams();\n ExecuteParams executeParams33 = new ExecuteParams();\n ExecuteParams executeParams34 = new ExecuteParams();\n ExecuteParams executeParams41 = new ExecuteParams();\n\n //*** PARAMS\n executeParams1.DeviationPredictor_CosineMetric();\n executeParams2.DeviationPredictor_PearsonMetric();\n executeParams30.DeviationPredictor_PearsonSignifianceWeightMetric(1);\n executeParams31.DeviationPredictor_PearsonSignifianceWeightMetric(5);\n executeParams32.DeviationPredictor_PearsonSignifianceWeightMetric(50);\n executeParams33.DeviationPredictor_PearsonSignifianceWeightMetric(100);\n executeParams34.DeviationPredictor_PearsonSignifianceWeightMetric(200);\n executeParams41.DeviationPredictor_JaccardMetric();\n //***\n\n computeOne(executeParams1);\n computeOne(executeParams2);\n computeOne(executeParams30,\"N = 1\");\n computeOne(executeParams31,\"N = 5\");\n computeOne(executeParams32,\"N = 50\");\n computeOne(executeParams33,\"N = 100\");\n computeOne(executeParams34,\"N = 200\");\n computeOne(executeParams41);\n }", "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2014-03-25 14:24:54.438 -0400\", hash_original_method = \"FB10554031D1BCD284B50199483C1FBD\", hash_generated_method = \"FEDA725AF6571E04608EDC1D440697C2\")\n \n public static String scanResultsCommand(){\n \tdouble taintDouble = 0;\n \n \tString retObj = new String(); \n \tretObj.addTaint(taintDouble);\n \treturn retObj;\n }", "public static void main(String[] args) {\n\t\tRetsHttpClient httpClient = new CommonsHttpClient();\n\t\tRetsVersion retsVersion = RetsVersion.v1_7_2;\n\t\tString loginUrl = \"http://theurloftheretsserver.com\";\n\n\t\t//Create a RetesSession with RetsHttpClient\n\t\tRetsSession session = new RetsSession(loginUrl, httpClient, retsVersion); \n\n\t\tString username = \"username\";\n\t\tString password = \"password\";\n\n\t\t//Set method as GET or POST\n\t\tsession.setMethod(\"POST\");\n\t\ttry {\n\t\t\t//Login\n\t\t\tsession.login(username, password);\n\t\t} catch (RetsException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\ttry {\n\t\t\tRetsSystem system = session.getMetadata().getSystem();\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"SYSTEM: \" + system.getSystemID() + \n\t\t\t\t\t\" - \" + system.getSystemDescription());\n\n\t\t\tfor(RetsResource resource: system.getRetsResources()) {\n\n\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\" RESOURCE: \" + resource.getResourceID());\n\n\t\t\t\tfor(RetsClass classification: resource.getRetsClasses()) {\n\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\" CLASS: \" + classification.getClassName() +\n\t\t\t\t\t\t\t\" - \" + classification.getDescription());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (RetsException e) {\n\t\t\te.printStackTrace();\n\t\t} \t\n\t\tfinally {\n\t\t\tif(session != null) { \n\t\t\t\ttry {\n\t\t\t\t\tsession.logout(); \n\t\t\t\t} \n\t\t\t\tcatch(RetsException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected void execute() {\n\t\tdouble error = -1;\n\t\tdouble proportion = 1;\n\t\tdouble coefficient = 1;\n\n\t\tif(vision.equalsIgnoreCase(SocketVisionSender.StartDepth)) { error = Robot.depth_.get_degrees_x(); }\n\t\tif(vision.equalsIgnoreCase(SocketVisionSender.StartCubeSearch)) { error = Robot.cube_.get_degrees_x(); }\n\t\tif(vision.equalsIgnoreCase(SocketVisionSender.StartRFT)) { error = Robot.rft_.get_degrees_x(); }\n\t\tif(vision.equalsIgnoreCase(SocketVisionSender.PlatformBlueSearch) || \n\t\t\t\tvision.equalsIgnoreCase(SocketVisionSender.PlatformRedSearch)) { error = Robot.platform_.get_degrees_x(); }\n\t\t\n\t\tif(error == -1) {\n\t\t\tproportion = Drivetrain.kPGyroConstant * (Robot.drivetrain.getGyroHeading() - initHeading);\n\n\t\t} else {\n\t\t\tproportion = error * kP;\n\t\t\t//drive vision\n\t\t\tif(error == 0) initHeading = Robot.drivetrain.getGyroHeading();\n\t\t}\n\n\t\tcoefficient = (initDistance - Robot.drivetrain.getRightEncoderPos(0)) / initDistance;\n\t\tcoefficient = Robot.drivetrain.thresholdVBus(coefficient);\n\n\t\tRobot.drivetrain.tankDrive(coefficient * (vBus - proportion), -coefficient * (vBus + proportion));\n\n\t}", "public static void main(String[] args) throws Exception {\n SourceRconQueryEx c = new SourceRconQueryEx();\n c.run();\n }", "private Response performDT_training(String model_name, String data) {\n \tSimpleDateFormat sdf = new SimpleDateFormat(\"dd-MMM-yyyy_HmsS\");\n \tJSONObject summary = new JSONObject();\n \t\n \tif(model_name.trim().length()< 1) {\n \t\tmodel_name = \"DTree_Model_\" + sdf.format(Calendar.getInstance().getTime());\n \t}\n \t\n \t// check if the model name is already present\n \tif(utilObj.isModelNameUnique(model_name)) {\n \t\tsummary = new JSONObject();\n \t\tsummary.put(\"Error\", \"Duplicate model name : \" + model_name);\n \t\tlog.error(\"Duplicate model name\");\n \t\treturn Response.status(200).entity(summary.toString()).build();\n \t}\n \t\n \tlog.info(String.format(\"model_Name: %s\", model_name ));\n \tString modelFilePath = Util.CurrentDir+\"/models/\"+model_name;\n \t\n \ttry {\n\n \t\t// write the data to the disk\n \t\tfinal String inputFileName = \"TrainData_DT_\" + sdf.format(Calendar.getInstance().getTime()) + \".csv\";\n \t\tfinal String inputFilePath = Util.CurrentDir+\"/\"+Util.DataDir+\"/\"+inputFileName;\n \t\tFileWriter writer = new FileWriter(inputFilePath);\n \t\twriter.write(data);\n \t\twriter.flush();\n \t\twriter.close();\n \t\tlog.info(\"File created : \" + inputFilePath);\n \t\t\n \t\tString cmd = String.format(\"Rscript \"+Util.CurrentDir+\"/Rscripts/DTTraining.R %s %s \",inputFilePath, model_name);\n \t\tlog.info(cmd);\n\t \tProcess pr = Runtime.getRuntime().exec(cmd);\n\t\t\t\n\t\t\tBufferedReader results = new BufferedReader(new InputStreamReader(pr.getInputStream()));\n\t\t\tString line = null;\n\t\t\t\n\t\t\tStringBuilder buf = new StringBuilder();\n\t\t\twhile((line=results.readLine()) != null) {\n\t\t\t\tbuf.append(line);\n\t\t\t\tif(line.trim().isEmpty()) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(line.trim().equalsIgnoreCase(\"Primary splits:\")) {\n\t\t\t\t\tline = results.readLine().trim();\n\t\t\t\t\tbuf.append(line);\n\t\t\t\t\tsummary.put(\"summary\", line);\n\t\t\t\t} \n\t\t\t\telse if(line.trim().equalsIgnoreCase(\"Primary splits:\")) {\n\t\t\t\t\tline = results.readLine();\n\t\t\t\t\tbuf.append(line);\n\t\t\t\t\tJSONArray Psplits = new JSONArray();\t\t\t\t\t\n\t\t\t\t\twhile(!line.trim().equalsIgnoreCase(\"Surrogate splits:\")) {\n\t\t\t\t\t\tString s[] = line.split(\"\\t\");\n\t\t\t\t\t\tfor(String s1 : s) {\n\t\t\t\t\t\t\tSystem.out.println(s1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tJSONArray splitCols = new JSONArray(s);\n\t\t\t\t\t\tline = results.readLine();\n\t\t\t\t\t\tbuf.append(line);\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\tsummary.put(\"model_name\", model_name + \".RData\");\n\t\t\t\tsummary.put(\"InputFile\", inputFileName);\n\t\t\t\tsummary.put(\"CommandName\", \"Rscripts/DTTraining.R\");\n\t\t\t}\n\t\t\tsummary.put(\"raw\", buf.toString());\n\t\t\t\n\t\t\t// format the summary json as params { [key : val] }\n\t\t\tJSONArray finalSummary = new JSONArray();\n\t\t\tIterator<String> keys = summary.keySet().iterator();\n\t\t\twhile(keys.hasNext()) {\n\t\t\t\tJSONObject row = new JSONObject();\n\t\t\t\trow.put(\"attribute\", keys.next());\n\t\t\t\trow.put(\"value\", summary.get(row.getString(\"attribute\")));\n\t\t\t\tfinalSummary.put(row);\n\t\t\t}\n\t\t\treturn Response.status(200).entity(new JSONObject().put(\"summary\", finalSummary).toString()).build();\n\t\t\t\n \t} catch (Exception e) {\n \t\te.printStackTrace();\n \t}\n\t\t\n \treturn Response.status(200).entity(summary.toString()).build();\n }", "@Override\n\t\tpublic void run() {\n\t\t\tExecutor executor = new Executor(this.env);\n\n\t\t\t// control loop\n\t\t\t//String dataFileName = monitorLog.monitor();\n\t\t\t//AnalysisStatus analysisStatus = analyser.analyse(dataFileName, args);\n\t\t\t// AdaptationPlan adaptationPlan =\n\t\t\t// planner.selectPlan(analysisStatus);\n\t\t\t//executor.execute(adaptationPlan);\n\t\t\t//System.out.println(this.getClass()+\" **************** CHANGE **************\"+System.nanoTime());\n\t\t\texecutor.executeFake(this.env);\n\t\t\t//executeFake();\n\t\t}", "public int executeNativeDml(String queryName, Object context);", "@Test\n public void runSimpleReqRes() throws Exception {\n List<String> args = getBasicArgsStr();\n args.add(\"-r\");\n args.add(\"^(?<VTIME>)(?<TYPE>)$\");\n args.add(\"-r\");\n args.add(\"^(?<VTIME>)(?<TYPE>)#.*$\");\n args.add(\"-s\");\n args.add(\"^--$\");\n args.add(\"-q\");\n args.add(\"A:0->1;B:1->0\");\n args.add(\"-i\");\n args.add(\"-d\");\n args.add(\"-minimize\");\n args.add(\"../traces/abstract/request-response-po/trace.txt\");\n runDynFromFileArgs(args);\n }", "public static void main(String[]args) throws IOException {\n searchHistoryList();\n// queryGroup();\n// testgson();\n// queryLevelCode();\n// queryCode(\"queryAlertLevels\");\n// queryCode(\"queryAlertCategories\");\n// queryCode(\"queryAlertTypes\");\n// queryCode(\"queryAlertCode\");\n// sendPostNotify(\"http://10.138.16.192:8080/api/queryAlertingList\",\"{pageinfo:{currentPage:1,pageSize:10}}\");\n }", "public void execute() throws NbaBaseException {\n\t\tboolean isSuccess = false;\t\t\n\t\tif (performingRequirementsEvaluation()) { //SPR2652\n\t\t\tsetPartyID(work); //ACN024\n\t\t\tisSuccess = processRequirementSummary();\n\t\t\tif (!isSuccess) {\t\t\t\t\n\t\t\t\tthrow new NbaVpmsException(NbaVpmsException.VPMS_RESULTS_ERROR + NbaVpmsAdaptor.ACREQUIREMENTSUMMARY);\t//SPR2652\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic String execute() throws Exception {\n\n\t\tProfilingHelper p_helper = new ProfilingHelper();\n\t\ttry {\n\t\t\tp_helper.deleteResearches(rModel);\n\t\t\treturn SUCCESS;\n\t\t} catch (Exception e) {\n\t\t\treturn INPUT;\n\t\t}\n\t}", "public IOgcResponse executeRequest(Map<String, String> params);", "public static void main(String[] args) { \n\t\tDiversityBuilder builder = new DiversityBuilder();\n\t\tString filePath = builder.readFileNameFromArgs(args);\n\t\tMovieDataPreProcessor mdpp = new MovieDataPreProcessor(filePath);\n\t\tmdpp.readDataFiles();\n\t\tBayesianClassifier bc = new BayesianClassifier();\n\t\t// hard wired the executions - to reduce the output generations\n\t\tint[] k = new int[]{10};\n\t\tint[] l = new int[]{20};\n\t\tfor(int x: k){\n\t\t\tfor (int y :l){\n\t\t\t\tRelevanceOptimizer.getDiversifiedResults(bc,mdpp, x,y);\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\tRelevanceOptimizer.getPRPResults(bc,mdpp, 30);\n\t\t\n\t}", "public static void main(String arg[]) {\n\n try {\n\n // use the default character set for VR encoding - override this as necessary\n SpecificCharacterSet specificCharacterSet = new SpecificCharacterSet((String[]) null);\n AttributeList identifier = new AttributeList();\n\n // build the attributes that you would like to retrieve as well as passing in\n // any search criteria\n identifier.putNewAttribute(TagFromName.QueryRetrieveLevel).addValue(\"STUDY\"); // specific query root\n identifier.putNewAttribute(TagFromName.PatientName, specificCharacterSet).addValue(\"Bowen*\");\n identifier.putNewAttribute(TagFromName.PatientID, specificCharacterSet);\n identifier.putNewAttribute(TagFromName.PatientBirthDate);\n identifier.putNewAttribute(TagFromName.PatientSex);\n identifier.putNewAttribute(TagFromName.StudyInstanceUID);\n identifier.putNewAttribute(TagFromName.SOPInstanceUID);\n identifier.putNewAttribute(TagFromName.StudyDescription);\n identifier.putNewAttribute(TagFromName.StudyDate);\n identifier.putNewAttribute(TagFromName.SOPClassesInStudy);\n\n // retrieve all studies belonging to patient with name 'Bowen'\n new FindSOPClassSCU(\n \t\t\"www.dicomserver.co.uk\",\n \t\t104,\n \t\t\"MEDCONN\",\n \t\t\"OurFindScu\",\n SOPClass.StudyRootQueryRetrieveInformationModelFind,\n identifier,\n new OurFindHandler()\n );\n \n\n } catch (Exception e) {\n e.printStackTrace(System.err); // in real life, do something about this exception\n System.exit(0);\n }\n }", "public static void main (String[] args) {\n\t\tboolean verbose = true;\n\t\t\t\t\n\t\tString dir = args[0]; // args[0] should include the trailing \"/\"\n\t\t\n\t\tArrayList <String> files = new ArrayList <String> ();\n\t\tfiles.add(dir + \"BCO-DMO_examples/552076/DigitalObject_552076.owl\");\n\t\tfiles.add(dir + \"BCO-DMO_examples/552076/PersistentID_552076.owl\");\n\t\tfiles.add(dir + \"BCO-DMO_examples/552076/MetadataDescription_552076.owl\");\n\t\t\n\t\t// this factory will be used to create our data cubes\n\t\tDataCubeFactory dcFactory = new DataCubeFactory ();\n\t\t\t\t\n\t\t// create the in-memory ontology model from the provided files\n\t\tMergedModel model = new MergedModel();\n\t\tOntModel ontModel = model.readFromFiles(files);\n\t\t\n\t\t// get the instances of the classes we are interested in\n\t\tInstances instances = new Instances ();\n\t\tString doClassUri = Namespaces.digitalObject + \"DigitalObject\";\n\t\tArrayList <Individual> digitalObjects = instances.getInstancesFromClass(ontModel, doClassUri);\n\t\t\n\t\t// print out a status update\n\t\tint size = digitalObjects.size();\n\t\tif ( verbose ) { System.out.println(\"Number of Digital Objects found: \" + size + \"\\n\"); }\n\t\t\n\t\t// loop over all the Digital Objects\n\t\tString pidUri;\n\t\tString accessPathUri;\n\t\tProperty rdfType = ontModel.getOntProperty( \"http://www.w3.org/1999/02/22-rdf-syntax-ns#type\" );\n\t\tProperty isIdentifiedBy = ontModel.getOntProperty( Namespaces.digitalObject + \"isIdentifiedBy\" );\n\t\tProperty hasAccessPath = ontModel.getOntProperty( Namespaces.pid + \"hasAccessPath\" );\n\t\tfor ( int index=0; index<size; index++ ) {\n\n\t\t\t// get the Persistent ID associated with this Digital Object\n\t\t\tif ( verbose ) { System.out.println(\"Getting Persistent ID from Digital Object...\"); }\n\t\t\tpidUri = instances.getObjectPropertyUri( digitalObjects.get(index), ontModel, isIdentifiedBy );\n\t\t\tSystem.out.println( pidUri );\n\n\t\t\t// get the Access Path from the Persistent ID individual\n\t\t\tif ( verbose ) { System.out.println(\"Getting Access Path from Persistent ID...\"); }\n\t\t\tIndividual pidIn = instances.getIndividualFromUri( pidUri, ontModel );\n\t\t\taccessPathUri = instances.getObjectPropertyUri( pidIn, ontModel, hasAccessPath );\n\n\t\t\t// get the type of Access Path\n\t\t\tif ( verbose ) { System.out.println(\"Getting Type of Access Path...\"); }\n\t\t\tIndividual accessPathIn = instances.getIndividualFromUri( accessPathUri, ontModel );\n\t\t\tString accessPathType = instances.getObjectPropertyUri( accessPathIn, ontModel, rdfType );\n\t\t\t\n\t\t\t// use the Access Path Type to create and populate DataCube\n\t\t\tif ( verbose ) { System.out.println(\"Creating DataCube...\"); }\n\t\t\tDataCube datacube = dcFactory.createDataCube( digitalObjects.get(index), accessPathType, accessPathUri, \n\t\t\t\t\tontModel, verbose );\n\t\t\t\t\t\t\n\t\t\t// try a SPARQL query over the datacube\n\t\t\tif ( verbose ) { System.out.println(\"Generating ontology model from DataCube...\"); }\n\t\t\tOntModel cubeOntModel = datacube.getOntModel();\n\t\t\tQueries query = new Queries ();\n\t\t\tArrayList <String> results = \n\t\t\t\t\tquery.hasExactValue( \"Calanus_finmarchicus\", cubeOntModel, \"?obs\", true );\n\t\t\tfor ( int i=0; i<results.size(); i++ ) {\n\t\t\t\tSystem.out.println(\"Calanus finmarchicus found in observation: \" + results.get(i));\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "@Test\n\tpublic void execute() {\n\t\tcommand.execute(request);\n\t}", "public static void main(String[] args) throws IOException{\n \n List<List<String>> results;\n String query = \"ADD QUERY OR CATEGORY FOR SEARCH\";\n \n //ADD USER ID WHO SEARCHES\n Long userId = 1;\n PersonalizedSearch searchObj = new PersonalizedSearch();\n \n final CredentialsProvider credsProvider = new BasicCredentialsProvider();\n credsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(\"elastic\",\"elastic\"));\n \n \n RestHighLevelClient client = new RestHighLevelClient(\n RestClient.builder(\n new HttpHost(\"localhost\",9200),\n new HttpHost(\"localhost\",9201))\n .setHttpClientConfigCallback(new RestClientBuilder.HttpClientConfigCallback() {\n @Override\n public HttpAsyncClientBuilder customizeHttpClient(HttpAsyncClientBuilder hacb) {\n return hacb.setDefaultCredentialsProvider(credsProvider);\n }\n }));\n \n /**\n * ---------COMMENT OUT ONE OF THE FOLLOWING TO DO A PERSONALIZED SEARCH FOR A SIGNED IN OR/AND AN ANONYMOUS USER--------\n */\n\n System.out.println(\"Starting collecting queryless/queryfull submissions...\");\n System.out.println(\"\");\n// searchObj.performQuerylessSearchWithPersonalization(client);\n// searchObj.performQueryfullSearchWithPersonalization(client);\n// results = searchObj.performPharm24PersonalizedQueryfullSearch(client, userId, query);\n// results = searchObj.performPharm24PersonalizedQuerylessSearch(client, userId, query);\n \n for(int i=0; i<results.size(); i++){\n for(int j = 0; j<results.get(i).size();j++){\n System.out.println(results.get(i).get(j));\n }\n System.out.println(\"-------RERANKED---------\");\n }\n\n System.out.println(\"\");\n System.out.println(\"I\\'m done!\");\n \n \n }", "public static void main(String[] args) {\n if (!(args.length == 1 || args.length == 2)) {\n System.err.println(\"USAGE: \" + DCQLQueryRunner.class.getName() + \" <dcql_query.xml> [aggregate]\");\n System.exit(1);\n }\n String queryFileName = args[0];\n System.out.println(\"Executing query \" + queryFileName);\n try {\n long start = System.currentTimeMillis();\n System.out.println(\"Loading query from disk\");\n DCQLQuery query = QueryLoader.loadDcqlQuery(queryFileName);\n System.out.println(\"Query loaded in \" + (System.currentTimeMillis() - start) + \" ms\");\n start = System.currentTimeMillis();\n if (args.length == 2 && \"aggregate\".equals(args[1])) {\n System.out.println(\"Executing Aggregation query\");\n CQLQueryResults results = executeAndAggregateQuery(query);\n System.out.println(\"Query executed in \" + (System.currentTimeMillis() - start) + \" ms\");\n QueryResultPrinter.printCqlQueryResults(results);\n } else {\n System.out.println(\"Executing query\");\n DCQLQueryResultsCollection results = executeDcqlQuery(query);\n System.out.println(\"Query executed in \" + (System.currentTimeMillis() - start) + \" ms\");\n QueryResultPrinter.printDcqlQueryResults(results);\n }\n System.out.println(\"DONE\");\n } catch (FederatedQueryProcessingException ex) {\n ex.printStackTrace();\n System.exit(1);\n }\n }", "@RequestMapping(value = \"/queryrdf\", method = {RequestMethod.GET, RequestMethod.POST})\n public void queryRdf(@RequestParam(\"query\") final String query,\n @RequestParam(value = RdfCloudTripleStoreConfiguration.CONF_QUERY_AUTH, required = false) String auth,\n @RequestParam(value = RdfCloudTripleStoreConfiguration.CONF_CV, required = false) final String vis,\n @RequestParam(value = RdfCloudTripleStoreConfiguration.CONF_INFER, required = false) final String infer,\n @RequestParam(value = \"nullout\", required = false) final String nullout,\n @RequestParam(value = RdfCloudTripleStoreConfiguration.CONF_RESULT_FORMAT, required = false) final String emit,\n @RequestParam(value = \"padding\", required = false) final String padding,\n @RequestParam(value = \"callback\", required = false) final String callback,\n final HttpServletRequest request,\n final HttpServletResponse response) {\n SailRepositoryConnection conn = null;\n final Thread queryThread = Thread.currentThread();\n auth = StringUtils.arrayToCommaDelimitedString(provider.getUserAuths(request));\n final Timer timer = new Timer();\n timer.schedule(new TimerTask() {\n\n @Override\n public void run() {\n log.debug(\"interrupting\");\n queryThread.interrupt();\n\n }\n }, QUERY_TIME_OUT_SECONDS * 1000);\n\n try {\n final ServletOutputStream os = response.getOutputStream();\n conn = repository.getConnection();\n\n final Boolean isBlankQuery = StringUtils.isEmpty(query);\n final ParsedOperation operation = QueryParserUtil.parseOperation(QueryLanguage.SPARQL, query, null);\n\n final Boolean requestedCallback = !StringUtils.isEmpty(callback);\n final Boolean requestedFormat = !StringUtils.isEmpty(emit);\n\n if (!isBlankQuery) {\n if (operation instanceof ParsedGraphQuery) {\n // Perform Graph Query\n final RDFHandler handler = new RDFXMLWriter(os);\n response.setContentType(\"text/xml\");\n performGraphQuery(query, conn, auth, infer, nullout, handler);\n } else if (operation instanceof ParsedTupleQuery) {\n // Perform Tuple Query\n TupleQueryResultHandler handler;\n\n if (requestedFormat && emit.equalsIgnoreCase(\"json\")) {\n handler = new SPARQLResultsJSONWriter(os);\n response.setContentType(\"application/json\");\n } else {\n handler = new SPARQLResultsXMLWriter(os);\n response.setContentType(\"text/xml\");\n }\n\n performQuery(query, conn, auth, infer, nullout, handler);\n } else if (operation instanceof ParsedUpdate) {\n // Perform Update Query\n performUpdate(query, conn, os, infer, vis);\n } else {\n throw new MalformedQueryException(\"Cannot process query. Query type not supported.\");\n }\n }\n\n if (requestedCallback) {\n os.print(\")\");\n }\n } catch (final Exception e) {\n log.error(\"Error running query\", e);\n throw new RuntimeException(e);\n } finally {\n if (conn != null) {\n try {\n conn.close();\n } catch (final RepositoryException e) {\n log.error(\"Error closing connection\", e);\n }\n }\n }\n\n timer.cancel();\n }", "public static void main(String[] args) {\n String adeViewRoot = args[1].trim();\n String filelistpath=args[0].trim();\n String[] files=FamilyModuleHelper.getFileList(filelistpath, adeViewRoot); \n String label = args[2].trim();\n String family = args[3];\n\n String release = FamilyModuleHelper.getRelease(label);\n\n int releaseNum;\n\n try {\n releaseNum = Integer.parseInt(release);\n //run votuing_v2 on R9 and R10 branch, votuning_v3 on R11+ branches\n if (releaseNum < 11){\n System.out.println(\"Running votuing_v2 scan.\");\n oracle.apps.votuning_v3.JarAnalyzerPMC.process(files, adeViewRoot, label, family);\n }\n else{\n System.out.println(\"R11+ branch found. Running votuing_v3 scan.\");\n oracle.apps.votuning_v4.JarAnalyzerPMC.process(files, adeViewRoot, label, family);\n }\n } catch (NumberFormatException e) {\n System.out.println(\"Could not determine release. Skipping VOTuning_V3 check...\");\n return;\n }\n\n }", "protected abstract DataSet parseQueryResultsIntoDataSet(DataSet dataSet, \n HashMap<String,String> params,\n String searchGene,\n int radius,\n GeneSourceOption geneSourceOption,\n DbSnpSourceOption dbSnpOption,\n String xmlResult) throws RetrievalException;", "public static void main(String[] args) {\n\t\t\n String root_GUID_string = CommandLineArgs.getArg(args, \"-r\");\n \n // Can't continue if no root GUID string supplied.\n if (root_GUID_string != null) {\n \t\n // ********************************************************************************\n\n \t// Read diagnostic level from the console if not already specified in command line argument.\n \t\tDiagnostic.setLevel(Diagnostic.FULL);\n\n \t\tif (CommandLineArgs.getArg(args, \"-D\") == null) {\n \t\t\n \t\t\tOutput.getSingleton().print(\"Enter D<return> for diagnostics, anything else for no diagnostics: \");\n \t\t\tString input = CommandLineInput.readLine();\n\n \t if (! input.equalsIgnoreCase(\"D\")) Diagnostic.setLevel(Diagnostic.NONE);\n \t\t}\n \t\t\n // ********************************************************************************\n\n \t\t// Get port number.\n \t int port = 0;\n \t String port_string = CommandLineArgs.getArg(args, \"-w\");\t // Get port argument.\n \t if (port_string != null){\n try {\n port = Integer.parseInt(port_string); // Try to extract port number.\n } catch (NumberFormatException e) {\n Error.errorExplicitLocalReport(\"invalid port specification for WebDAV service (\"+port_string+\")\");\n usage();\n }\n }\n\t \t\t \n // ********************************************************************************\n\n String localAddress=null;\n String localPort=null;\n String knownNodeAddress=null;\n String knownNodePort=null;\n \n String knownNodeParameter = CommandLineArgs.getArg(args,\"-k\");\n String P2PServiceAddressParameter = CommandLineArgs.getArg(args,\"-s\");\n String portParameter = CommandLineArgs.getArg(args,\"-p\");\n \n if (knownNodeParameter != null){\n knownNodeAddress = Network.extractHostName(knownNodeParameter);\n knownNodePort = Network.extractPortNumber(knownNodeParameter);\n }\n \n if (P2PServiceAddressParameter != null){\n localAddress = Network.extractHostName(P2PServiceAddressParameter);\n localPort = Network.extractPortNumber(P2PServiceAddressParameter);\n }\n \n if (portParameter != null) {\n if(localPort==null){\n localPort = portParameter;\n }else{\n //ignore -p parameter\n }\n }\n \n \t\t\ttry {\n\t\t\t\tIGUID root_GUID = GUIDFactory.recreateGUID(root_GUID_string);\n\n\t\t\t\t// Initialise the store.\n\t\t\t\tIGUIDStore store = new JChordRRT_Distributed_IGUIDStoreFactory(knownNodeAddress,knownNodePort,localAddress,localPort).makeStore();\n\t \n\t\t // Initialise a file system using the store.\n\t\t IFileSystem file_system = new StoreBasedFileSystemFactory(store, root_GUID).makeFileSystem();\n\t\n\t\t // Run the WebDAV server.\n\t\t WebDAVServer server;\n\t\t \n\t\t if (port == 0) server = new WebDAVServer(file_system);\n\t\t else server = new WebDAVServer(file_system, port);\n\t\t \n\t\t server.run();\n\t\t\t}\n\t\t\tcatch (FileSystemCreationException e) { Error.exceptionError(\"couldn't create file system\", e); }\n\t\t\tcatch (IOException e) { Error.exceptionError(\"socket error\", e); }\n }else{\n usage();\n }\n\t}", "public void doSearch(int referenceId, int smallSetUpperBound,\n\t\tint largeSetLowerBound, int mediumSetPresentNumber,\n\t\tint replaceIndicator, String resultSetName, \n\t\tString databaseNames, String smallSetElementSetNames, \n\t\tString mediumSetElementSetNames, String preferredRecordSyntax, \n\t\tString query, int query_type, String searchResultsOID,\n\t \tDataDir Z39attributesPlusTerm, DataDir oclcUserInfo,\n String oclcUserInfoOID, Object rankQuery, String rankOID,\n boolean fMakeDataDir) \n throws Exception, Diagnostic1, AccessControl {\n\n \n BerString zRequest=null, zResponse=null;\n BerConnect zConnection;\n\n if (zsession == null) \n throw new Diagnostic1(Diagnostic1.temporarySystemError, \n \"User's Z39.50 session is not initialized\");\n\n // Re-init to the server\n if (zsession.isConnected() == false) {\n try {\n\n zsession.init.reInit();\n\n if (zsession.connection == null)\n throw new Diagnostic1(Diagnostic1.databaseUnavailable, \n \"Unable to connect to the Z39.50 server\");\n }\n catch (Exception e) {\n throw new Diagnostic1(Diagnostic1.databaseUnavailable, \n \"Unable to connect to the Z39.50 server\");\n } \n catch (Diagnostic1 d) {\n throw d;\n } \n } \n\n\n zConnection = (BerConnect)zsession.connection;\n\n zRequest = Request(referenceId, smallSetUpperBound,\n\t\tlargeSetLowerBound, mediumSetPresentNumber,\n\t\treplaceIndicator, resultSetName, \n\t\tdatabaseNames, smallSetElementSetNames, \n\t\tmediumSetElementSetNames, preferredRecordSyntax, \n\t\tquery, query_type, searchResultsOID,\n Z39attributesPlusTerm, oclcUserInfo, oclcUserInfoOID,\n rankQuery, rankOID, 0, 0);\n \n if (zRequest == null) {\n throw new Diagnostic1(Diagnostic1.malformedQuery, \"Unable to create search request\");\n\n// System.out.println(\"unable to build search request\");\n }\n\n try {\n zResponse = zConnection.doRequest(zRequest); \n }\n\t catch (InterruptedIOException ioe) { \n\t if (zsession.doTRC) { \n\t\t try {\n\t\t if (zsession.logger != null && \n\t\t\t zsession.logger.getLevel() != Z39logging.OFF) {\n\t\t\t synchronized (zsession.logger) {\n\t\t\t zsession.logger.println(\"Sending TRC to search\");\n\t\t\t }\n\t\t } \n\t\t zsession.trc.doTriggerResourceControl(0, 3);\n\t\t }\n\t\t catch (Exception trce) {\n\t\t // trce.printStackTrace();\n\t\t }\n\t\t catch (Diagnostic1 trcd) {\n\t\t // System.out.println(trcd);\n\t\t }\n\t }\n\n //differentiate between 105 and 109 diagnostics\n if (ioe.getMessage().endsWith(\"user\"))\n throw new Diagnostic1(Diagnostic1.terminatedAtOriginRequest,\n \"Unable to send request to the Z39.50 server\");\n else\n throw new Diagnostic1(Diagnostic1.databaseUnavailable,\n \"Unable to send request to the Z39.50 server\");\n\n } \n catch (Exception e1) {\n zsession.reset();\n throw new Diagnostic1(Diagnostic1.databaseUnavailable, \n \"Unable to send request to the Z39.50 server\");\n }\n\n if (zResponse == null) {\n throw new Diagnostic1(Diagnostic1.temporarySystemError,\n \"Invalid search response received from the Z39.50 Server\");\n }\n\n\n Response(zResponse);\n\n // If flag is set to decode recs into datadir and we\n // got records back, then decode and make sure we got\n // all we wanted \n if (resultCount > 0 && \n Present.numberOfRecordsReturned > 0) {\n\n if (fMakeDataDir) \n Present.decodeRecords();\n\n\n if(Present.numberOfRecordsReturned != mediumSetPresentNumber &&\n resultCount > Present.numberOfRecordsReturned) {\n \n int numrecs = mediumSetPresentNumber - \n Present.numberOfRecordsReturned;\n //System.out.println(\"Numrecs returned = \" + numrecs +\n //\" asked for: \" + mediumSetPresentNumber);\n\n try {\n\n zsession.present.doPresent(zsession.refId > 0 ? \n zsession.refId++ : 0,\n resultSetName, Present.numberOfRecordsReturned+1,\n numrecs, resultCount, \n mediumSetElementSetNames, preferredRecordSyntax, \n fMakeDataDir);\n }\n catch (Exception e) {\n // Don't barf good results received.\n }\n catch (Diagnostic1 d) {\n // Don't barf good results received.\n }\n // If we got the records back. add them to the\n // Present Vector or the BerString\n saveGoodRecords(fMakeDataDir);\n }\n }\n }", "void analyze(int nthread,boolean update,ReportOption opt);", "public static void main(String[] args) {\n \t\tSystem.out.println(I18n.tr(\"StatCvs-XML - CVS statistics generation\")+\"\\n\");\n \t\tSystem.setProperty(\"java.awt.headless\", \"true\");\n \t\t\n\t\tif (args.length == 0) {\n\t\t\tprintProperUsageAndExit();\n\t\t}\n \t\tif (args.length == 1) {\n \t\t\tString arg = args[0].toLowerCase();\n \t\t\tif (arg.equals(\"-h\") || arg.equals(\"-help\")) {\n \t\t\t\tprintProperUsageAndExit();\n \t\t\t} else if (arg.equals(\"-version\")) {\n \t\t\t\tprintVersionAndExit();\n \t\t\t}\n \t\t}\n \n \t\ttry {\n \t\t\tReportSettings settings = readSettings(args);\n \t\t\tinitLogger();\n \t\t\tgenerateSuite(settings);\n \t\t} catch (InvalidCommandLineException e) {\n \t\t\tSystem.err.println(e.getMessage());\n \t\t\tprintProperUsageAndExit();\n \t\t} catch (IOException e) {\n \t\t\tprintErrorMessageAndExit(e.getMessage());\n \t\t} catch (LogSyntaxException lex) {\n \t\t\tprintLogErrorMessageAndExit(lex.getMessage());\n \t\t} catch (OutOfMemoryError oome) {\n \t\t\tprintOutOfMemMessageAndExit();\n \t\t} catch (Exception ioex) {\n \t\t\tioex.printStackTrace();\n \t\t\tprintErrorMessageAndExit(ioex.getMessage());\n \t\t}\n \n \t\tSystem.exit(0);\n \t}", "public void request(String[] args) {\n String queryByDate = CLIHelper.extractOptionRawValue(QUERY_BY_DATE, args);\n String queryByYearMonth = CLIHelper.extractOptionRawValue(QUERY_BY_YEAR_MONTH, args);\n\n if (!queryByDate.isEmpty()) {\n queryBySpecificDates(queryByDate);\n }\n if (!queryByYearMonth.isEmpty()) {\n queryBySpecificYearMonths(queryByYearMonth);\n }\n if (CLIHelper.optionIsPresent(HELP, args)) {\n printUsage();\n }\n }", "public Object run(Object parameter) throws Exception {\n ZsrdApplyDynamic model = (ZsrdApplyDynamic) parameter;String ss = \"\";String uname = UserUtil.getKMSSUser().getUserName();\n lbpmProcessCoreService.initModelSetting(model,\"zsrdApplyDynamicDoc\", null,\n \"zsrdApplyDynamicDoc\");\n return null;\n }", "@WebMethod(operationName=\"executeDrillthroughVanaVolga\")\r\n\tpublic @WebResult(name=\"drillthroughResult\") DrillthroughResultDTO execute(@WebParam(name=\"query\") IDrillthroughQuery query);", "public static void main(String[] args) throws IOException, ParserConfigurationException, SAXException {\n\t\tif(args[1].contains(\".xml\")){\n\t\t\tXMLBIFParser parser=new XMLBIFParser();\n\t\t\tBayesianNetwork bn=parser.readNetworkFromFile(args[1]);\n\t\t\tAssignment asgm=new Assignment();\n\t\t\tfor(int i=3;i<args.length;i=i+2){\n\t\t\t\tRandomVariable r=bn.getVariableByName(args[i]);\n\t\t\t\tasgm.put(r,args[i+1]);\n\t\t\t}\n\t\t\tbn.getVariableListTopologicallySorted();\n\t\t\tRandomVariable query=bn.getVariableByName(args[2]);\n\t\t\tRejectionSampling rejection=new RejectionSampling();\n\t\t\tDistribution output=new Distribution();\n\t\t\tfor(Object x:query.getDomain()){\n\t\t\t\toutput.put(x, 0);\n\t\t\t}\n\t\t\tlong startTime = System.currentTimeMillis();\n\t\t\tint count=Integer.valueOf(args[0]);\n\t\t\tSystem.out.println(rejection.rejection(query, bn, asgm, output, count).toString());\n\t\t\tlong endtime = System.currentTimeMillis();\n\t\t\tSystem.out.println(\"Runtime:\" + (endtime-startTime) + \"ms\");\n\t\t}\n\n\t}", "public abstract IStatus performQuery(AbstractRepositoryQuery query, TaskRepository repository,\n \t\t\tIProgressMonitor monitor, ITaskCollector resultCollector);", "@Override\n public void run() {\n if (checkParameters()) {\n notifyError();\n } else {\n ADRepository repository = new ADRepository(schema);\n\n List<ADEntity> entities = repository.fetchQuery(buildQuery(), getOrder());\n nofityEntitiesLoaded(processResult(entities));\n }\n }", "Object executeQuery(String sparqlQuery);", "static void perform_dcx(String passed){\n\t\tint type = type_of_inx(passed);\n\t\tswitch(type){\n\t\tcase 1:\n\t\t\tdcx_rp(passed);\n\t\t\tbreak;\n\t\t}\n\t}", "void validate(N ndcRequest, ErrorsType errorsType);", "public static void main(String[] args) {\n\t\tTestingPerformanceCalculator obj= new TestingPerformanceCalculator(\"./data/gitInfoNew.txt\", \"data/Results/FinalResultSidTest1.txt\");\n\t\t//Read Gold set\n\t\tobj.goldStMap=obj.LoadGoldSet();\n\t\t//MiscUtility.showResult(10, obj.goldStMap);\n\t\t//Resd output file/ test result file\n\t\tobj.finalResult=obj.LoadTestingResult();\n\t\t//MiscUtility.showResult(20, obj.finalResult);\n\t\t\n\t\t\n\t\t//Create a ranked list\n\t\t//obj.produceRankedResult(10);\n\t\tArrayList<String> rankedFinalTestingResult=obj.produceRankedResult(10);\n\t\tContentWriter.writeContent(\"./data/testing1RankedResult.txt\", rankedFinalTestingResult);\n\t\t//call another class BLPerformanceCalc to compute\n\t\t\n\t\t\n\t}", "public static void main(String[] args) throws Exception {\n\t\tString matlabLocation = \"/usr/local/MATLAB/R2012a/bin/matlab\";\n\t\tMatlabProxyFactoryOptions options = new MatlabProxyFactoryOptions.Builder()\n\t\t\t\t.setProxyTimeout(30000L).setMatlabLocation(matlabLocation)\n\t\t\t\t.setHidden(true).build();\n\n\t\tMatlabProxyFactory factory = new MatlabProxyFactory(options);\n\t\tMatlabProxy proxy = factory.getProxy();\n\n\t\tSAXBuilder builder = new SAXBuilder();\n\t\tString inputCorpusDir = \"../data/ACL2015/testData\";\n\t\tDocument doc = builder.build(inputCorpusDir + \"/\"\n\t\t\t\t+ \"GuidedSumm_topics.xml\");\n\t\tElement root = doc.getRootElement();\n\t\tList<Element> corpusList = root.getChildren();\n\n\t\tString outputSummaryDir = \"../data/ACL2015/Output\";\n\t\tString confFilePath = \"../data/ACL2015/ROUGE/conf.xml\";\n\t\t\n\n\t\tint iterTime = 3;\n\t\t\t\t\n\t\t///////////////////////////////////////////////\t\n\t\t\n\t\tint[] numberClusters_DCNN = {7, 8};\n\t\t\n\n\t\t//////////////////////////////////////////////////////\n\t\tPrintWriter out_DCNN_Spe_H_Har_H_110 = FileOperation.getPrintWriter(new File(\n\t\t\t\toutputSummaryDir), \"experiment_result_DCNN_Spe_H_Har_H_110\");\n\t\tfor (int j = 0; j < numberClusters_DCNN.length; j++) {\n\t\t\tint numberCluster = numberClusters_DCNN[j];\n\t\t\tdouble averageMetric_1 = 0.0;\n\t\t\tdouble averageMetric_2 = 0.0;\n\t\t\tdouble averageMetric_SU4 = 0.0;\n\n\t\t\tfor (int k = 0; k < iterTime; k++) {\n\t\t\t\tfor (int i = 0; i < corpusList.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"Corpus id is \" + i);\n\t\t\t\t\tElement topic = corpusList.get(i);\n\t\t\t\t\tList<Element> docSets = topic.getChildren();\n\t\t\t\t\tElement docSetA = docSets.get(1);\n\t\t\t\t\tString corpusName = docSetA.getAttributeValue(\"id\");\n\t\t\t\t\tAbstractiveGenerator sg = new AbstractiveGenerator();\n\t\t\t\t\tsg.DCNN_Spe_H_Har_H_110(inputCorpusDir + \"/\" +topic.getAttributeValue(\"id\"), outputSummaryDir, corpusName, numberCluster, proxy);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tHashMap map_1 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-1\");\n\t\t\t\tDouble met_1 = (Double) map_1.get(\"ROUGE-1\");\n\t\t\t\tSystem.out.println(\"ROUGE-1\" + \" \" + numberCluster + \" \" + met_1);\n\t\t\t\taverageMetric_1 += met_1;\n\n\t\t\t\tHashMap map_2 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-2\");\n\t\t\t\tDouble met_2 = (Double) map_2.get(\"ROUGE-2\");\n\t\t\t\tSystem.out.println(\"ROUGE-2\" + \" \" + numberCluster + \" \" + met_2);\n\t\t\t\taverageMetric_2 += met_2;\n\n\t\t\t\tHashMap map_SU4 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-SU4\");\n\t\t\t\tDouble met_SU4 = (Double) map_SU4.get(\"ROUGE-SU4\");\n\t\t\t\tSystem.out.println(\"ROUGE-SU4\" + \" \" + numberCluster + \" \" + met_SU4);\n\t\t\t\taverageMetric_SU4 += met_SU4;\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_Har_H_110.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_Har_H_110.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \"\n\t\t\t\t\t+ averageMetric_SU4 / iterTime);\n\t\t\tout_DCNN_Spe_H_Har_H_110.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \" + averageMetric_SU4\n\t\t\t\t\t/ iterTime);\n\t\t}\n\t\tout_DCNN_Spe_H_Har_H_110.close();\n\t\t\n\t\t/////////////////////////////////////////////\n\t\t\n\t\tPrintWriter out_DCNN_Spe_H_Har_C_110 = FileOperation.getPrintWriter(new File(\n\t\t\t\toutputSummaryDir), \"experiment_result_DCNN_Spe_H_Har_C_110\");\n\t\tfor (int j = 0; j < numberClusters_DCNN.length; j++) {\n\t\t\tint numberCluster = numberClusters_DCNN[j];\n\t\t\tdouble averageMetric_1 = 0.0;\n\t\t\tdouble averageMetric_2 = 0.0;\n\t\t\tdouble averageMetric_SU4 = 0.0;\n\n\t\t\tfor (int k = 0; k < iterTime; k++) {\n\t\t\t\tfor (int i = 0; i < corpusList.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"Corpus id is \" + i);\n\t\t\t\t\tElement topic = corpusList.get(i);\n\t\t\t\t\tList<Element> docSets = topic.getChildren();\n\t\t\t\t\tElement docSetA = docSets.get(1);\n\t\t\t\t\tString corpusName = docSetA.getAttributeValue(\"id\");\n\t\t\t\t\tAbstractiveGenerator sg = new AbstractiveGenerator();\n\t\t\t\t\tsg.DCNN_Spe_H_Har_C_110(inputCorpusDir + \"/\" +topic.getAttributeValue(\"id\"), outputSummaryDir, corpusName, numberCluster, proxy);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tHashMap map_1 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-1\");\n\t\t\t\tDouble met_1 = (Double) map_1.get(\"ROUGE-1\");\n\t\t\t\tSystem.out.println(\"ROUGE-1\" + \" \" + numberCluster + \" \" + met_1);\n\t\t\t\taverageMetric_1 += met_1;\n\n\t\t\t\tHashMap map_2 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-2\");\n\t\t\t\tDouble met_2 = (Double) map_2.get(\"ROUGE-2\");\n\t\t\t\tSystem.out.println(\"ROUGE-2\" + \" \" + numberCluster + \" \" + met_2);\n\t\t\t\taverageMetric_2 += met_2;\n\n\t\t\t\tHashMap map_SU4 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-SU4\");\n\t\t\t\tDouble met_SU4 = (Double) map_SU4.get(\"ROUGE-SU4\");\n\t\t\t\tSystem.out.println(\"ROUGE-SU4\" + \" \" + numberCluster + \" \" + met_SU4);\n\t\t\t\taverageMetric_SU4 += met_SU4;\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_Har_C_110.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_Har_C_110.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \"\n\t\t\t\t\t+ averageMetric_SU4 / iterTime);\n\t\t\tout_DCNN_Spe_H_Har_C_110.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \" + averageMetric_SU4\n\t\t\t\t\t/ iterTime);\n\t\t}\n\t\tout_DCNN_Spe_H_Har_C_110.close();\n\t\t\n\t\t////////////////////////////////////\n\t\tPrintWriter out_DCNN_Spe_C_Gre_H_110 = FileOperation.getPrintWriter(new File(\n\t\t\t\toutputSummaryDir), \"experiment_result_DCNN_Spe_C_Gre_H_110\");\n\t\tfor (int j = 0; j < numberClusters_DCNN.length; j++) {\n\t\t\tint numberCluster = numberClusters_DCNN[j];\n\t\t\tdouble averageMetric_1 = 0.0;\n\t\t\tdouble averageMetric_2 = 0.0;\n\t\t\tdouble averageMetric_SU4 = 0.0;\n\n\t\t\tfor (int k = 0; k < iterTime; k++) {\n\t\t\t\tfor (int i = 0; i < corpusList.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"Corpus id is \" + i);\n\t\t\t\t\tElement topic = corpusList.get(i);\n\t\t\t\t\tList<Element> docSets = topic.getChildren();\n\t\t\t\t\tElement docSetA = docSets.get(1);\n\t\t\t\t\tString corpusName = docSetA.getAttributeValue(\"id\");\n\t\t\t\t\tAbstractiveGenerator sg = new AbstractiveGenerator();\n\t\t\t\t\tsg.DCNN_Spe_C_Gre_H_110(inputCorpusDir + \"/\" +topic.getAttributeValue(\"id\"), outputSummaryDir, corpusName, numberCluster, proxy);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tHashMap map_1 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-1\");\n\t\t\t\tDouble met_1 = (Double) map_1.get(\"ROUGE-1\");\n\t\t\t\tSystem.out.println(\"ROUGE-1\" + \" \" + numberCluster + \" \" + met_1);\n\t\t\t\taverageMetric_1 += met_1;\n\n\t\t\t\tHashMap map_2 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-2\");\n\t\t\t\tDouble met_2 = (Double) map_2.get(\"ROUGE-2\");\n\t\t\t\tSystem.out.println(\"ROUGE-2\" + \" \" + numberCluster + \" \" + met_2);\n\t\t\t\taverageMetric_2 += met_2;\n\n\t\t\t\tHashMap map_SU4 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-SU4\");\n\t\t\t\tDouble met_SU4 = (Double) map_SU4.get(\"ROUGE-SU4\");\n\t\t\t\tSystem.out.println(\"ROUGE-SU4\" + \" \" + numberCluster + \" \" + met_SU4);\n\t\t\t\taverageMetric_SU4 += met_SU4;\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_C_Gre_H_110.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_C_Gre_H_110.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \"\n\t\t\t\t\t+ averageMetric_SU4 / iterTime);\n\t\t\tout_DCNN_Spe_C_Gre_H_110.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \" + averageMetric_SU4\n\t\t\t\t\t/ iterTime);\n\t\t}\n\t\tout_DCNN_Spe_C_Gre_H_110.close();\n\t\t\n\t\t//////////////////////////////\n\t\tPrintWriter out_DCNN_Spe_C_Gre_C_110 = FileOperation.getPrintWriter(new File(\n\t\t\t\toutputSummaryDir), \"experiment_result_DCNN_Spe_C_Gre_C_110\");\n\t\tfor (int j = 0; j < numberClusters_DCNN.length; j++) {\n\t\t\tint numberCluster = numberClusters_DCNN[j];\n\t\t\tdouble averageMetric_1 = 0.0;\n\t\t\tdouble averageMetric_2 = 0.0;\n\t\t\tdouble averageMetric_SU4 = 0.0;\n\n\t\t\tfor (int k = 0; k < iterTime; k++) {\n\t\t\t\tfor (int i = 0; i < corpusList.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"Corpus id is \" + i);\n\t\t\t\t\tElement topic = corpusList.get(i);\n\t\t\t\t\tList<Element> docSets = topic.getChildren();\n\t\t\t\t\tElement docSetA = docSets.get(1);\n\t\t\t\t\tString corpusName = docSetA.getAttributeValue(\"id\");\n\t\t\t\t\tAbstractiveGenerator sg = new AbstractiveGenerator();\n\t\t\t\t\tsg.DCNN_Spe_C_Gre_C_110(inputCorpusDir + \"/\" +topic.getAttributeValue(\"id\"), outputSummaryDir, corpusName, numberCluster, proxy);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tHashMap map_1 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-1\");\n\t\t\t\tDouble met_1 = (Double) map_1.get(\"ROUGE-1\");\n\t\t\t\tSystem.out.println(\"ROUGE-1\" + \" \" + numberCluster + \" \" + met_1);\n\t\t\t\taverageMetric_1 += met_1;\n\n\t\t\t\tHashMap map_2 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-2\");\n\t\t\t\tDouble met_2 = (Double) map_2.get(\"ROUGE-2\");\n\t\t\t\tSystem.out.println(\"ROUGE-2\" + \" \" + numberCluster + \" \" + met_2);\n\t\t\t\taverageMetric_2 += met_2;\n\n\t\t\t\tHashMap map_SU4 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-SU4\");\n\t\t\t\tDouble met_SU4 = (Double) map_SU4.get(\"ROUGE-SU4\");\n\t\t\t\tSystem.out.println(\"ROUGE-SU4\" + \" \" + numberCluster + \" \" + met_SU4);\n\t\t\t\taverageMetric_SU4 += met_SU4;\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_C_Gre_C_110.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_C_Gre_C_110.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \"\n\t\t\t\t\t+ averageMetric_SU4 / iterTime);\n\t\t\tout_DCNN_Spe_C_Gre_C_110.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \" + averageMetric_SU4\n\t\t\t\t\t/ iterTime);\n\t\t}\n\t\tout_DCNN_Spe_C_Gre_C_110.close();\n\t\t////////////////////////////////\n\t\tPrintWriter out_DCNN_Spe_H_Gre_H_110 = FileOperation.getPrintWriter(new File(\n\t\t\t\toutputSummaryDir), \"experiment_result_DCNN_Spe_H_Gre_H_110\");\n\t\tfor (int j = 0; j < numberClusters_DCNN.length; j++) {\n\t\t\tint numberCluster = numberClusters_DCNN[j];\n\t\t\tdouble averageMetric_1 = 0.0;\n\t\t\tdouble averageMetric_2 = 0.0;\n\t\t\tdouble averageMetric_SU4 = 0.0;\n\n\t\t\tfor (int k = 0; k < iterTime; k++) {\n\t\t\t\tfor (int i = 0; i < corpusList.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"Corpus id is \" + i);\n\t\t\t\t\tElement topic = corpusList.get(i);\n\t\t\t\t\tList<Element> docSets = topic.getChildren();\n\t\t\t\t\tElement docSetA = docSets.get(1);\n\t\t\t\t\tString corpusName = docSetA.getAttributeValue(\"id\");\n\t\t\t\t\tAbstractiveGenerator sg = new AbstractiveGenerator();\n\t\t\t\t\tsg.DCNN_Spe_H_Gre_H_110(inputCorpusDir + \"/\" +topic.getAttributeValue(\"id\"), outputSummaryDir, corpusName, numberCluster, proxy);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tHashMap map_1 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-1\");\n\t\t\t\tDouble met_1 = (Double) map_1.get(\"ROUGE-1\");\n\t\t\t\tSystem.out.println(\"ROUGE-1\" + \" \" + numberCluster + \" \" + met_1);\n\t\t\t\taverageMetric_1 += met_1;\n\n\t\t\t\tHashMap map_2 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-2\");\n\t\t\t\tDouble met_2 = (Double) map_2.get(\"ROUGE-2\");\n\t\t\t\tSystem.out.println(\"ROUGE-2\" + \" \" + numberCluster + \" \" + met_2);\n\t\t\t\taverageMetric_2 += met_2;\n\n\t\t\t\tHashMap map_SU4 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-SU4\");\n\t\t\t\tDouble met_SU4 = (Double) map_SU4.get(\"ROUGE-SU4\");\n\t\t\t\tSystem.out.println(\"ROUGE-SU4\" + \" \" + numberCluster + \" \" + met_SU4);\n\t\t\t\taverageMetric_SU4 += met_SU4;\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_Gre_H_110.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_Gre_H_110.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \"\n\t\t\t\t\t+ averageMetric_SU4 / iterTime);\n\t\t\tout_DCNN_Spe_H_Gre_H_110.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \" + averageMetric_SU4\n\t\t\t\t\t/ iterTime);\n\t\t}\n\t\tout_DCNN_Spe_H_Gre_H_110.close();\n\t\t\n\t\t////////////////////////\n\t\tPrintWriter out_DCNN_Spe_H_Gre_C_110 = FileOperation.getPrintWriter(new File(\n\t\t\t\toutputSummaryDir), \"experiment_result_DCNN_Spe_H_Gre_C_110\");\n\t\tfor (int j = 0; j < numberClusters_DCNN.length; j++) {\n\t\t\tint numberCluster = numberClusters_DCNN[j];\n\t\t\tdouble averageMetric_1 = 0.0;\n\t\t\tdouble averageMetric_2 = 0.0;\n\t\t\tdouble averageMetric_SU4 = 0.0;\n\n\t\t\tfor (int k = 0; k < iterTime; k++) {\n\t\t\t\tfor (int i = 0; i < corpusList.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"Corpus id is \" + i);\n\t\t\t\t\tElement topic = corpusList.get(i);\n\t\t\t\t\tList<Element> docSets = topic.getChildren();\n\t\t\t\t\tElement docSetA = docSets.get(1);\n\t\t\t\t\tString corpusName = docSetA.getAttributeValue(\"id\");\n\t\t\t\t\tAbstractiveGenerator sg = new AbstractiveGenerator();\n\t\t\t\t\tsg.DCNN_Spe_H_Gre_C_110(inputCorpusDir + \"/\" +topic.getAttributeValue(\"id\"), outputSummaryDir, corpusName, numberCluster, proxy);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tHashMap map_1 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-1\");\n\t\t\t\tDouble met_1 = (Double) map_1.get(\"ROUGE-1\");\n\t\t\t\tSystem.out.println(\"ROUGE-1\" + \" \" + numberCluster + \" \" + met_1);\n\t\t\t\taverageMetric_1 += met_1;\n\n\t\t\t\tHashMap map_2 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-2\");\n\t\t\t\tDouble met_2 = (Double) map_2.get(\"ROUGE-2\");\n\t\t\t\tSystem.out.println(\"ROUGE-2\" + \" \" + numberCluster + \" \" + met_2);\n\t\t\t\taverageMetric_2 += met_2;\n\n\t\t\t\tHashMap map_SU4 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-SU4\");\n\t\t\t\tDouble met_SU4 = (Double) map_SU4.get(\"ROUGE-SU4\");\n\t\t\t\tSystem.out.println(\"ROUGE-SU4\" + \" \" + numberCluster + \" \" + met_SU4);\n\t\t\t\taverageMetric_SU4 += met_SU4;\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_Gre_C_110.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_Gre_C_110.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \"\n\t\t\t\t\t+ averageMetric_SU4 / iterTime);\n\t\t\tout_DCNN_Spe_H_Gre_C_110.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \" + averageMetric_SU4\n\t\t\t\t\t/ iterTime);\n\t\t}\n\t\tout_DCNN_Spe_H_Gre_C_110.close();\n\t\t\n\t\t////////////////////////////\n\t\tPrintWriter out_DCNN_Spe_H_LGC_C_110 = FileOperation.getPrintWriter(new File(\n\t\t\t\toutputSummaryDir), \"experiment_result_DCNN_Spe_H_LGC_C_110\");\n\t\tfor (int j = 0; j < numberClusters_DCNN.length; j++) {\n\t\t\tint numberCluster = numberClusters_DCNN[j];\n\t\t\tdouble averageMetric_1 = 0.0;\n\t\t\tdouble averageMetric_2 = 0.0;\n\t\t\tdouble averageMetric_SU4 = 0.0;\n\n\t\t\tfor (int k = 0; k < iterTime; k++) {\n\t\t\t\tfor (int i = 0; i < corpusList.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"Corpus id is \" + i);\n\t\t\t\t\tElement topic = corpusList.get(i);\n\t\t\t\t\tList<Element> docSets = topic.getChildren();\n\t\t\t\t\tElement docSetA = docSets.get(1);\n\t\t\t\t\tString corpusName = docSetA.getAttributeValue(\"id\");\n\t\t\t\t\tAbstractiveGenerator sg = new AbstractiveGenerator();\n\t\t\t\t\tsg.DCNN_Spe_H_LGC_C_110(inputCorpusDir + \"/\" +topic.getAttributeValue(\"id\"), outputSummaryDir, corpusName, numberCluster, proxy);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tHashMap map_1 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-1\");\n\t\t\t\tDouble met_1 = (Double) map_1.get(\"ROUGE-1\");\n\t\t\t\tSystem.out.println(\"ROUGE-1\" + \" \" + numberCluster + \" \" + met_1);\n\t\t\t\taverageMetric_1 += met_1;\n\n\t\t\t\tHashMap map_2 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-2\");\n\t\t\t\tDouble met_2 = (Double) map_2.get(\"ROUGE-2\");\n\t\t\t\tSystem.out.println(\"ROUGE-2\" + \" \" + numberCluster + \" \" + met_2);\n\t\t\t\taverageMetric_2 += met_2;\n\n\t\t\t\tHashMap map_SU4 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-SU4\");\n\t\t\t\tDouble met_SU4 = (Double) map_SU4.get(\"ROUGE-SU4\");\n\t\t\t\tSystem.out.println(\"ROUGE-SU4\" + \" \" + numberCluster + \" \" + met_SU4);\n\t\t\t\taverageMetric_SU4 += met_SU4;\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_LGC_C_110.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_LGC_C_110.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \"\n\t\t\t\t\t+ averageMetric_SU4 / iterTime);\n\t\t\tout_DCNN_Spe_H_LGC_C_110.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \" + averageMetric_SU4\n\t\t\t\t\t/ iterTime);\n\t\t}\n\t\tout_DCNN_Spe_H_LGC_C_110.close();\n\t\t\n\t\t///////////////////////\n\t\t\n\t\tPrintWriter out_DCNN_Spe_C_LGC_C_110 = FileOperation.getPrintWriter(new File(\n\t\t\t\toutputSummaryDir), \"experiment_result_DCNN_Spe_C_LGC_C_110\");\n\t\tfor (int j = 0; j < numberClusters_DCNN.length; j++) {\n\t\t\tint numberCluster = numberClusters_DCNN[j];\n\t\t\tdouble averageMetric_1 = 0.0;\n\t\t\tdouble averageMetric_2 = 0.0;\n\t\t\tdouble averageMetric_SU4 = 0.0;\n\n\t\t\tfor (int k = 0; k < iterTime; k++) {\n\t\t\t\tfor (int i = 0; i < corpusList.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"Corpus id is \" + i);\n\t\t\t\t\tElement topic = corpusList.get(i);\n\t\t\t\t\tList<Element> docSets = topic.getChildren();\n\t\t\t\t\tElement docSetA = docSets.get(1);\n\t\t\t\t\tString corpusName = docSetA.getAttributeValue(\"id\");\n\t\t\t\t\tAbstractiveGenerator sg = new AbstractiveGenerator();\n\t\t\t\t\tsg.DCNN_Spe_C_LGC_C_110(inputCorpusDir + \"/\" +topic.getAttributeValue(\"id\"), outputSummaryDir, corpusName, numberCluster, proxy);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tHashMap map_1 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-1\");\n\t\t\t\tDouble met_1 = (Double) map_1.get(\"ROUGE-1\");\n\t\t\t\tSystem.out.println(\"ROUGE-1\" + \" \" + numberCluster + \" \" + met_1);\n\t\t\t\taverageMetric_1 += met_1;\n\n\t\t\t\tHashMap map_2 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-2\");\n\t\t\t\tDouble met_2 = (Double) map_2.get(\"ROUGE-2\");\n\t\t\t\tSystem.out.println(\"ROUGE-2\" + \" \" + numberCluster + \" \" + met_2);\n\t\t\t\taverageMetric_2 += met_2;\n\n\t\t\t\tHashMap map_SU4 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-SU4\");\n\t\t\t\tDouble met_SU4 = (Double) map_SU4.get(\"ROUGE-SU4\");\n\t\t\t\tSystem.out.println(\"ROUGE-SU4\" + \" \" + numberCluster + \" \" + met_SU4);\n\t\t\t\taverageMetric_SU4 += met_SU4;\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_C_LGC_C_110.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_C_LGC_C_110.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \"\n\t\t\t\t\t+ averageMetric_SU4 / iterTime);\n\t\t\tout_DCNN_Spe_C_LGC_C_110.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \" + averageMetric_SU4\n\t\t\t\t\t/ iterTime);\n\t\t}\n\t\tout_DCNN_Spe_C_LGC_C_110.close();\n\t\t\n\t\t\n\t\tproxy.disconnect();\n\t}", "CommandResult execute();", "@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}", "String execute(HttpServletRequest req, HttpServletResponse res);", "public void receiveResultExecuteRSDocument(\r\n\t\t\tcom.autometrics.analytics.v9.j2ee.webservices.v1_0.ExecuteRSDocumentResponse result) {\r\n\t}", "public abstract void execute(String correlationId, ServiceRegistration sr, ServiceInput input);", "public void runStatisticsCommand(List<Object> Command) throws Exception {\r\n if (Command.isEmpty()) {\r\n throw new Exception(\"Statistics command must be non-empty\");\r\n }\r\n String Action = Command.get(0).toString().toLowerCase();\r\n switch (Action) {\r\n case \"ntop\": {\r\n // Usage: ntop <number>\r\n Integer value;\r\n try {\r\n value = Integer.parseInt(Command.get(1).toString());\r\n } catch (Exception e) {\r\n throw new Exception(\"Usage: stats ntop <#>\");\r\n }\r\n Statistics.setNumberTopEntries(value);\r\n System.out.println(\"\\tSet number of top entries to \" + value);\r\n evaluate();\r\n }\r\n break;\r\n case \"success\": {\r\n boolean ToExclude;\r\n\t\t\t\tString FilterMethod;\r\n\t\t\t\tList<Object> FilterOptions;\r\n try {\r\n if (Command.get(1).toString().equalsIgnoreCase(\"include\")) {\r\n\t\t\t\t\t\tToExclude = false;\r\n\t\t\t\t\t} else if (Command.get(1).toString().equalsIgnoreCase(\"exclude\")) {\r\n\t\t\t\t\t\tToExclude = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthrow new Exception();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tFilterMethod = Command.get(2).toString();\r\n\t\t\t\t\tif (FilterMethod.equalsIgnoreCase(\"?\")) {\r\n\t\t\t\t\t\tSystem.out.println(\"Available Filters:\");\r\n\t\t\t\t\t\tSystem.out.println(printImplmentingClasses(BaseDatasetFilter.class, false));\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tFilterOptions = Command.subList(3, Command.size());\r\n } catch (Exception e) {\r\n throw new Exception(\"Usage: stats success <include|exclude> <filter method> <filter options...>\");\r\n }\r\n\t\t\t\tBaseDatasetFilter filter = (BaseDatasetFilter) instantiateClass(\r\n\t\t\t\t\t\t\"data.utilities.filters.\" + FilterMethod, FilterOptions);\r\n\t\t\t\tfilter.setExclude(ToExclude);\r\n\t\t\t\tStatistics.setSuccessFilter(filter);\r\n System.out.println(\"\\tDefined a \" + FilterMethod + \" as the success filter\");\r\n evaluate();\r\n }\r\n break;\r\n default:\r\n throw new Exception(\"Statistics have no such option: \" + Action);\r\n }\r\n }", "@Api(1.1)\n public Response execute() throws HaloNetException {\n return mBuilder.mClient.request(mRequest);\n }", "protected void execute() {\n \tRobot.telemetry.setAutonomousStatus(\"Running \" + commandName + \": \" + distance);\n \tRobot.drivetrain.arcadeDrive(Robot.driveDistancePID.getOutput(), 0.0, false);\n }", "public abstract Rank<String,String> query(String input) throws ClassificationException;", "void execute();", "void execute();", "void execute();", "void execute();", "void execute();", "void execute();", "void execute();", "public static void operation() {\n try ( QueryExecution qExec = QueryExecutionHTTP.service(dataURL).query(\"ASK{}\").build() ) {\n qExec.execAsk();\n System.out.println(\"Operation succeeded\");\n } catch (QueryException ex) {\n System.out.println(\"Operation failed: \"+ex.getMessage());\n }\n System.out.println();\n }", "protected void runQuery()\n throws DavException {\n if (info.getDepth() == DEPTH_0)\n return;\n \n doQuery(resource, info.getDepth() == DEPTH_INFINITY);\n }", "@Override\n\tpublic void action() {\n\n\t\tif(this.step.equals(STATE_INIT))\n\t\t{\n\t\t\tthis.nbVoters = 0;\n\t\t\tthis.nbAsynchronousPlayers = 0;\n\t\t\tthis.globalResults = new VoteResults();\n\t\t\tthis.agentSender = null;\n\t\t\tthis.request = null;\n\t\t\tthis.currentTime = -1;\n\t\t\tthis.results = new VoteResults();\n\t\t\tthis.nextStep = STATE_RECEIVE_REQUEST;\n\n\n\t\t}\n\n\t\telse if(this.step.equals(STATE_RECEIVE_REQUEST))\n\t\t{\n\t\t\t/*** reception demande de vote **/\n\t\t\tMessageTemplate mt = MessageTemplate.and(\n\t\t\t\t\tMessageTemplate.MatchPerformative(ACLMessage.REQUEST),\n\t\t\t\t\tMessageTemplate.MatchConversationId(\"VOTE_REQUEST\"));\n\n\t\t\tACLMessage message = this.myAgent.receive(mt);\n\t\t\tif(message != null)\n\t\t\t{\n\t\t\t\tthis.agentSender = message.getSender();\n\n\t\t\t\tObjectMapper mapper = new ObjectMapper();\n\t\t\t\ttry {\n\n\t\t\t\t\t//System.err.println(\"[RQST INITIAL] \"+message.getContent());\n\n\t\t\t\t\tthis.request = mapper.readValue(message.getContent(), VoteRequest.class);\n\t\t\t\t\tthis.request.setLocalVoteResults(this.results);\n\t\t\t\t\tthis.results.initWithChoice(this.request.getChoices());\n\n\t\t\t\t\tFunctions.newActionToLog(\"Début vote \"+this.request.getRequest(),this.myAgent, this.controllerAgent.getGameid());\n\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\tthis.nextStep = SEND_REQUEST_GLOBAL_VOTE_RESULTS;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tblock(1000);\n\t\t\t}\n\n\t\t}\n\t\telse if(this.step.equals(SEND_REQUEST_GLOBAL_VOTE_RESULTS))\n\t\t{\n\t\t\tList<AID> agents = DFServices.findGameControllerAgent(\"ENVIRONMENT\", this.myAgent, this.controllerAgent.getGameid());\n\t\t\tif(!agents.isEmpty())\n\t\t\t{\n\t\t\t\tACLMessage message = new ACLMessage(ACLMessage.REQUEST);\n\t\t\t\tmessage.setSender(this.myAgent.getAID());\n\t\t\t\tfor(AID aid : agents)\n\t\t\t\t{\n\t\t\t\t\tmessage.addReceiver(aid);\n\t\t\t\t}\n\t\t\t\tmessage.setConversationId(\"GLOBAL_VOTE_RESULTS\");\n\n\t\t\t\tthis.myAgent.send(message);\n\t\t\t}\n\n\t\t\tthis.nextStep = RECEIVE_REQUEST_GLOBAL_VOTE_RESULTS;\n\t\t}\n\t\telse if(this.step.equals(RECEIVE_REQUEST_GLOBAL_VOTE_RESULTS))\n\t\t{\n\t\t\t/*** reception demande de vote **/\n\t\t\tMessageTemplate mt = MessageTemplate.and(\n\t\t\t\t\tMessageTemplate.MatchPerformative(ACLMessage.REQUEST),\n\t\t\t\t\tMessageTemplate.MatchConversationId(\"GLOBAL_VOTE_RESULTS\"));\n\n\t\t\tACLMessage message = this.myAgent.receive(mt);\n\t\t\tif(message != null)\n\t\t\t{\n\n\t\t\t\t//System.out.println(\"CTRL Reception de global results\");\n\t\t\t\tObjectMapper mapper = new ObjectMapper();\n\t\t\t\ttry {\n\t\t\t\t\tthis.globalResults = mapper.readValue(message.getContent(), VoteResults.class);\n\t\t\t\t\tthis.request.setGlobalCitizenVoteResults(this.globalResults);\n\t\t\t\t} \n\t\t\t\tcatch (IOException e) \n\t\t\t\t{\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tthis.nextStep = STATE_GET_SIMPLE_SUSPICION;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tblock(1000);\n\t\t\t}\n\t\t}\t\t\n\t\telse if(this.step.equals(STATE_SEND_REQUEST))\n\t\t{\n\t\t\tACLMessage messageRequest = new ACLMessage(ACLMessage.REQUEST);\n\t\t\tmessageRequest.setSender(this.myAgent.getAID());\n\t\t\tmessageRequest.setConversationId(\"VOTE_REQUEST\");\n\n\t\t\tint reste = this.request.getAIDVoters().size()-this.nbVoters;\n\t\t\tif(false )// reste >= Data.MAX_SYNCHRONOUS_PLAYERS)\n\t\t\t{\n\t\t\t\t/** hybrid synchronous mode **/\n\t\t\t\tthis.nbAsynchronousPlayers = (int) (Math.random()*Math.min(Data.MAX_SYNCHRONOUS_PLAYERS-1, (reste-1)))+1;\n\t\t\t\t//System.err.println(\"HYDBRID ASYNCRHONOUS ENABLED BECAUSE TOO MANY PARTICIPANTS \"+this.nbAsynchronousPlayers+\" in //\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.nbAsynchronousPlayers = 1;\n\t\t\t}\n\n\t\t\tObjectMapper mapper = new ObjectMapper();\n\n\t\t\tString json =\"\";\n\n\t\t\ttry {\t\t\n\t\t\t\tjson = mapper.writeValueAsString(this.request);\t\n\t\t\t\tSystem.err.println(\"[RQST] \"+json);\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\tmessageRequest.setContent(json);\n\t\t\tfor(int i = 0; i<this.nbAsynchronousPlayers; ++i)\n\t\t\t{\n\t\t\t\t//System.err.println(\"DK ENVOI REQUEST \"+this.request.getAIDVoters().get(this.nbVoters+i).getLocalName());\n\t\t\t\tmessageRequest.addReceiver(this.request.getAIDVoters().get(this.nbVoters+i));\t\n\t\t\t}\n\n\t\t\tthis.myAgent.send(messageRequest);\n\n\t\t\tthis.nextStep = STATE_RECEIVE_INFORM;\n\t\t}\n\t\telse if(this.step.equals(STATE_RECEIVE_INFORM))\n\t\t{\n\t\t\tif(this.currentTime == -1)\n\t\t\t{\n\t\t\t\tthis.currentTime = System.currentTimeMillis();\n\t\t\t}\n\n\t\t\tif(System.currentTimeMillis() - this.currentTime > 3000)\n\t\t\t{\n\t\t\t\tthis.currentTime = -1;\n\t\t\t\tACLMessage wakeup = new ACLMessage(ACLMessage.UNKNOWN);\n\t\t\t\twakeup.setSender(this.myAgent.getAID());\n\t\t\t\tif(nbVoters < this.request.getVoters().size())\n\t\t\t\t{\n\t\t\t\t\twakeup.addReceiver(this.request.getAIDVoters().get(nbVoters));\n\t\t\t\t\twakeup.setConversationId(\"WAKEUP\");\n\t\t\t\t\tthis.myAgent.send(wakeup);\n\n\t\t\t\t\tSystem.out.println(\"Relance du joueur \"+this.request.getAIDVoters().get(nbVoters).getLocalName()+\" ...\");\n\t\t\t\t}\n\n\n\t\t\t}\n\n\t\t\tMessageTemplate mt = MessageTemplate.and(\n\t\t\t\t\tMessageTemplate.MatchPerformative(ACLMessage.INFORM),\n\t\t\t\t\tMessageTemplate.MatchConversationId(\"VOTE_INFORM\"));\n\n\t\t\tACLMessage message = this.myAgent.receive(mt);\n\t\t\tif(message!=null)\n\t\t\t{\n\t\t\t\tthis.currentTime = -1;\n\t\t\t\t++this.nbVoters;\n\t\t\t\t--this.nbAsynchronousPlayers;\n\n\t\t\t\tObjectMapper mapper = new ObjectMapper();\n\t\t\t\tVoteResults res = new VoteResults();\n\t\t\t\ttry {\n\t\t\t\t\tres = mapper.readValue(message.getContent(), VoteResults.class);\n\t\t\t\t} \n\t\t\t\tcatch (IOException e) \n\t\t\t\t{\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\tAID aidPlayer = message.getSender();\n\n\t\t\t\tthis.results.add(res);\n\n\t\t\t\tif(this.request.getRequest().equals(\"CITIZEN_VOTE\")&&\n\t\t\t\t\t\tDFServices.containsGameAgent(aidPlayer, \"PLAYER\", \"MAYOR\", this.myAgent, this.controllerAgent.getGameid()))\n\t\t\t\t{\n\t\t\t\t\t/** poids double **/\n\t\t\t\t\tthis.results.add(res);\n\t\t\t\t\tthis.globalResults.add(res);\n\t\t\t\t}\n\n\n\t\t\t\t//envoi du resultat partiel \n\t\t\t\tString json = \"\";\n\t\t\t\tmapper = new ObjectMapper();\n\t\t\t\ttry {\n\t\t\t\t\tjson = mapper.writeValueAsString(this.results);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\tACLMessage msg = new ACLMessage(ACLMessage.AGREE);\n\t\t\t\tmsg.setContent(json);\n\t\t\t\tmsg.setSender(this.myAgent.getAID());\n\t\t\t\tmsg.setConversationId(\"NEW_VOTE_RESULTS\");\n\n\t\t\t\tList<AID> agents = DFServices.findGameControllerAgent(\"ENVIRONMENT\", this.myAgent, this.controllerAgent.getGameid());\n\t\t\t\tif(!agents.isEmpty())\n\t\t\t\t{\n\t\t\t\t\tfor(AID aid : agents)\n\t\t\t\t\t{\n\t\t\t\t\t\tmsg.addReceiver(aid);\n\t\t\t\t\t}\n\t\t\t\t\tthis.myAgent.send(msg);\n\t\t\t\t}\n\n\t\t\t\t///\tSystem.err.println(\"\\nSV : \"+this.nbVoters+\"/\"+this.request.getAIDVoters().size());\n\n\t\t\t\tif(this.nbVoters >= this.request.getAIDVoters().size())\n\t\t\t\t{\n\t\t\t\t\tthis.nbVoters = 0;\n\t\t\t\t\t//System.err.println(\"SV next step\");\n\t\t\t\t\tthis.nextStep = STATE_RESULTS;\n\t\t\t\t}\n\t\t\t\telse if(this.nbAsynchronousPlayers > 0)\n\t\t\t\t{\n\t\t\t\t\t//System.err.println(\"SV waiting other\");\n\t\t\t\t\tthis.nextStep = STATE_RECEIVE_INFORM;\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\tSystem.err.println(\"SV send request to other\");\n\t\t\t\t\tthis.nextStep = STATE_SEND_REQUEST;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tblock(1000);\t\n\t\t\t}\n\t\t}\n\n\n\t\telse if(this.step.equals(STATE_GET_SIMPLE_SUSPICION))\n\t\t{\n\t\t\tACLMessage messageRequest = new ACLMessage(ACLMessage.REQUEST);\n\t\t\tmessageRequest.setSender(this.myAgent.getAID());\n\t\t\tmessageRequest.setConversationId(\"GET_SIMPLE_SUSPICION\");\n\n\t\t\tObjectMapper mapper = new ObjectMapper();\n\n\t\t\tString json =\"\";\n\n\t\t\ttry {\t\t\n\t\t\t\tjson = mapper.writeValueAsString(this.request);\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\tmessageRequest.setContent(json);\n\t\t\tfor(AID aid : this.request.getAIDVoters()){\n\t\t\t\tmessageRequest.addReceiver(aid);\t\n\t\t\t}\n\n\t\t\tthis.nbVoters = 0;\n\t\t\tthis.myAgent.send(messageRequest);\n\t\t\tthis.nextStep = STATE_ADD_SIMPLE_SUSPICION;\n\t\t}\n\t\telse if(this.step.equals(STATE_ADD_SIMPLE_SUSPICION))\n\t\t{\n\t\t\tMessageTemplate mt = MessageTemplate.and(\n\t\t\t\t\tMessageTemplate.MatchPerformative(ACLMessage.INFORM),\n\t\t\t\t\tMessageTemplate.MatchConversationId(\"GET_SIMPLE_SUSPICION\"));\n\n\t\t\tACLMessage message = this.myAgent.receive(mt);\n\t\t\tif(message!=null)\n\t\t\t{\n\t\t\t\t++this.nbVoters;\n\n\t\t\t\tObjectMapper mapper = new ObjectMapper();\n\t\t\t\tSuspicionScore suspicionScore = new SuspicionScore();\n\t\t\t\ttry {\n\t\t\t\t\tsuspicionScore = mapper.readValue(message.getContent(), SuspicionScore.class);\n\t\t\t\t\t//System.err.println(\"ADD PARTIAL SUSPICION \\n\"+message.getContent());\n\t\t\t\t} \n\t\t\t\tcatch (IOException e) \n\t\t\t\t{\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\tAID aidPlayer = message.getSender();\n\t\t\t\tthis.request.getCollectiveSuspicionScore().addSuspicionScoreGrid(aidPlayer.getName(), suspicionScore);\n\n\t\t\t\tif(this.nbVoters>= this.request.getAIDVoters().size())\n\t\t\t\t{\n\t\t\t\t\tthis.nbVoters = 0;\n\t\t\t\t\tSystem.err.println(\"SUSPICION COLLECTIVE \\n \"+this.request.getCollectiveSuspicionScore().getScore());\n\n\t\t\t\t\t//sort random\n\t\t\t\t\tCollections.shuffle(this.request.getVoters());\n\t\t\t\t\tthis.nextStep = STATE_SEND_REQUEST;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.nextStep = STATE_ADD_SIMPLE_SUSPICION;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.nextStep = STATE_ADD_SIMPLE_SUSPICION;\n\t\t\t\tblock(1000);\n\t\t\t}\n\t\t}\n\n\t\telse if(this.step.equals(STATE_RESULTS))\n\t\t{\n\t\t\tthis.finalResults = this.results.getFinalResults();\n\n\t\t\t/** equality ? **/\n\t\t\tif(this.finalResults.size() == 1)\n\t\t\t{\n\t\t\t\tthis.nextStep = STATE_SEND_RESULTS;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//defavorisé le bouc emmissaire\n\t\t\t\tList<AID> scapegoats = DFServices.findGamePlayerAgent(Roles.SCAPEGOAT, this.myAgent, this.controllerAgent.getGameid());\n\t\t\t\tList<String> nameScapegoats = new ArrayList<String>();\n\t\t\t\tfor(AID scapegoat : scapegoats)\n\t\t\t\t{\n\t\t\t\t\tnameScapegoats.add(scapegoat.getName());\n\t\t\t\t}\n\t\t\t\tfor(String scapegoat : nameScapegoats)\n\t\t\t\t{\n\t\t\t\t\tif(this.finalResults.contains(scapegoat))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this.request.isVoteAgainst())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.finalResults = nameScapegoats;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(this.finalResults.size()>1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.finalResults.remove(scapegoat);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(this.lastResults != null && this.lastResults.equals(this.finalResults))\n\t\t\t\t{\n\t\t\t\t\t/** interblocage **/\n\t\t\t\t\tArrayList<String> tmp = new ArrayList<String>();\n\n\t\t\t\t\t//System.err.println(\"INTERBLOCAGE\");\n\n\t\t\t\t\t/** random choice **/\n\t\t\t\t\ttmp.add(this.finalResults.get((int)Math.random()*this.finalResults.size()));\t\t\t\t\n\t\t\t\t\tthis.finalResults = tmp;\n\n\t\t\t\t\tthis.nextStep = STATE_SEND_RESULTS;\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// new vote with finalists\n\t\t\t\t\tthis.request.setChoices(this.finalResults);\n\n\t\t\t\t\t//sort random\n\t\t\t\t\tCollections.shuffle(this.request.getVoters());\n\n\t\t\t\t\tthis.results = new VoteResults();\n\t\t\t\t\tthis.results.initWithChoice(this.request.getChoices());\n\t\t\t\t\tthis.request.setLocalVoteResults(this.results);\n\t\t\t\t\tthis.lastResults = this.finalResults;\n\t\t\t\t\tthis.nbVoters = 0;\n\t\t\t\t\tthis.nextStep = STATE_SEND_REQUEST;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if(this.step.equals(STATE_SEND_RESULTS))\n\t\t{\n\t\t\tif(this.finalResults.isEmpty())\n\t\t\t{\n\t\t\t\tSystem.err.println(\"ERROR\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"RESULTS => \"+this.finalResults.get(0));\n\t\t\t}\n\n\t\t\t//envoi resultat final + maj global vote\n\t\t\tif(this.request.getRequest().equals(\"CITIZEN_VOTE\"))\n\t\t\t{\n\t\t\t\tString json = \"\";\n\t\t\t\tObjectMapper mapper = new ObjectMapper();\n\t\t\t\ttry {\n\t\t\t\t\tjson = mapper.writeValueAsString(this.results);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\tACLMessage message = new ACLMessage(ACLMessage.AGREE);\n\t\t\t\tmessage.setContent(json);\n\t\t\t\tmessage.setSender(this.myAgent.getAID());\n\t\t\t\tmessage.setConversationId(\"NEW_CITIZEN_VOTE_RESULTS\");\n\n\t\t\t\tList<AID> agents = DFServices.findGameControllerAgent(\"ENVIRONMENT\", this.myAgent, this.controllerAgent.getGameid());\n\t\t\t\tif(!agents.isEmpty())\n\t\t\t\t{\n\t\t\t\t\tfor(AID aid : agents)\n\t\t\t\t\t{\n\t\t\t\t\t\tmessage.addReceiver(aid);\n\t\t\t\t\t}\n\t\t\t\t\tthis.myAgent.send(message);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tACLMessage message = new ACLMessage(ACLMessage.INFORM);\n\t\t\tmessage.setSender(this.myAgent.getAID());\n\t\t\tmessage.addReceiver(this.agentSender);\n\t\t\tmessage.setConversationId(\"VOTE_RESULTS\");\n\t\t\tmessage.setContent(this.finalResults.get(0));\n\n\n\t\t\tString name = this.finalResults.get(0);\n\n\t\t\tif(!this.request.isAskRequest()){\n\t\t\t\tint index = name.indexOf(\"@\");\n\t\t\t\tname = name.substring(0, index);\n\t\t\t\tFunctions.newActionToLog(\"Vote : \"+name, this.getAgent(), this.controllerAgent.getGameid());\n\t\t\t}\n\t\t\t\n\n\t\t\tthis.myAgent.send(message);\t\n\t\t\tthis.nextStep = STATE_INIT;\n\t\t}\n\n\n\n\t\tif(!this.nextStep.isEmpty())\n\t\t{\n\t\t\tthis.step = this.nextStep;\n\t\t\tthis.nextStep =\"\";\n\t\t}\n\n\n\t}", "public void doOslcGet(HttpServletRequest request, HttpServletResponse response,\n\t\t\tList<String> oslcCommand, ISmService smService) throws Exception {\n\n\t\tDatabase db = getDatabase();\n\t\tString query = smService.getParam(request, \"query\");\n\t\tif (oslcCommand.size() == 1 && Strings.isNullOrEmpty(query)) { // This is a repository/<accessName> case (but not query) - it is an OSLC repository, and we respond with\n\t\t\t// a description of this service provider.\n\t\t\tnew OSLCHelper(getDatabase()).respondForServiceProvider(oslcCommand.get(0), request, response, smService);\n\t\t\treturn;\n\t\t}\n\t\tString id = \"\";\n\t\tString version = null;\n\t\tString versionInfo = \"\";\n\t\tif (null != smService) {\n\t\t\tid = smService.getParam(request, \"id\");\n\t\t\tversion = smService.getParam(request, \"version\");\n\t\t\tif (false == Strings.isNullOrEmpty(version) && false == \"current\".equals(version))\n\t\t\t\tversionInfo = \"&nbsp;&nbsp;[ For version \" + Repository.dateOfVersion(version).toString() + \"]\";\n\t\t}\n if (oslcCommand.size() < 1)\n {\n response.setStatus(HttpStatus.SC_NOT_ACCEPTABLE);\n Utils.respondWithText(response, \"No API found for unspecific repository\");\n return;\n }\n\n String contentType = smService.getParam(request, Database.Vars.contentType.toString());\n if (Strings.isNullOrEmpty(contentType)) {\n \tcontentType = db.getVar(Database.Vars.contentType.toString());\n } else\n \tdb.setVar(Database.Vars.contentType.toString(), contentType);\n\n if ((false == Utils.willAccept(IConstants.HTML, request) && false == Utils.willAccept(IConstants.PLAIN_TEXT_TYPE, request)) || \n \t\tStrings.isNullOrEmpty(contentType)) {\n \tcontentType = Utils.formatFromAcceptType4Jena(request);\n }\n\n\t\tADatabaseRow row = db.getItem(id);\n String domain = oslcCommand.get(0);\n if (null == row && null != domain)\n \trow = db.getPort4Domain(domain);\n try\n {\n Repository repository = (Repository) row.getModelRepository(); // This is a model repository.// Repository.create(row);\n Model model = repository.getModelForVersion(version, null);\n if (null == model)\n \tmodel = repository.getModel();\n\n \tString select = smService.getParam(request, \"select\");\n \tString where = smService.getParam(request, \"where\");\n \tString orderBy = smService.getParam(request, \"orderBy\");\n \tString restore = smService.getParam(request, \"restore\");\n \tString name = smService.getParam(request, \"name\");\n \tString save = smService.getParam(request, \"save\");\n \tString deleteSaved = smService.getParam(request, \"deleteSaved\");\n\n\n if (false == Strings.isNullOrEmpty(query)) {\n \tJSONObject contents = makeInitialJsonForSparql(query, repository, id, version);\n \tJSONObject jo = getQueryParams(smService, request);\n \tIterator<?> keys = jo.keys();\n \twhile (keys.hasNext()) {\n \t\tString key = (String)keys.next(); // JSONObject.getNames(jo)) {\n \t\tcontents.put(key, Utils.safeGet(jo, key));\n// \t\tcontents.putAll(getQueryParams(smService, request));\n \t}\n Utils.respondGetWithTemplateAndJson(contents, \"/templates/sparql.html\", response);\n \treturn;\n } else if (oslcCommand.size() == 2 && \"sparql\".equals(oslcCommand.get(1))) {\n \t \n \tif (Strings.isNullOrEmpty(select) || Strings.isNullOrEmpty(where)) {\n \t\tUtils.respondWithText(response, \"Illegal query, no SELECT or WHERE\");\n \t\treturn;\n \t}\n \tselect = select.trim();\n \twhere = where.trim();\n \tif (Strings.isNullOrEmpty(orderBy))\n \t\torderBy = \"\";\n \torderBy = orderBy.trim();\n \tJSONObject contents = getSparqlContents(request, repository, select, where, orderBy, id, smService,\n \t\t\tname, false == Strings.isNullOrEmpty(restore),\n \t\t\tfalse == Strings.isNullOrEmpty(save),\n \t\t\tfalse == Strings.isNullOrEmpty(deleteSaved));\n \tcontents.put(\"moreOrLess\", smService.getParam(request, \"moreOrLess\"));\n// \t\tSystem.out.println(\"Contents for the SPARQL query page:\\n[\" + contents.toString() + \"]\");\n \tUtils.respondGetWithTemplateAndJson(contents, \"/templates/sparql.html\", response);\n \treturn;\n }\n\n String base = repository.getBase(); //getModel().getNsPrefixURI(\"base\");\n List<Resource> R = new ArrayList<Resource>();\n \tboolean isSingleResource = false;\n \n String title = \"\";\n if (oslcCommand.size() == 2 && null != smService.getParam(request, \"sparql\")) {\n \t// do sparql instead of standard oslc query\n \tif (Strings.isNullOrEmpty(select) || Strings.isNullOrEmpty(where)) {\n \t\tUtils.respondWithText(response, \"Illegal query, no SELECT or WHERE\");\n \t\treturn;\n \t}\n \tselect = select.trim();\n \twhere = \"{ \" + where.trim() + \" } \";\n \tif (Strings.isNullOrEmpty(orderBy))\n \t\torderBy = \"\";\n \torderBy = orderBy.trim();\n \tJSONObject contents = getSparqlContents(request, repository, select, where, orderBy, id, smService,\n \t\t\tname, false == Strings.isNullOrEmpty(restore),\n \t\t\tfalse == Strings.isNullOrEmpty(save),\n \t\t\tfalse == Strings.isNullOrEmpty(deleteSaved));\n \tif (Utils.willAccept(IConstants.PLAIN_TEXT_TYPE, request)) { // This is an AJAX query to get list of resources,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t// yet the list needs to be formatted according to the contentType\n \t\tString resOpen = \"\\\"\", resClose = \"\\\"\";\n \t\tif (contentType.equals(IConstants.N_TRIPLE) || \n// \t\t\tcontentType.equals(IConstants.NTRIPLE) ||\n \t\t\tcontentType.equals(IConstants.TURTLE) ||\n \t\t\tcontentType.equals(IConstants.N3)\n \t\t\t) {\n \t\t\t\tresOpen = \"<\";\n \t\t\t\tresClose = \">\";\n \t\t}\n\n \t\tStringBuffer sb = new StringBuffer();\n \t\tJSONArray rows = (JSONArray) Utils.safeGet(contents, \"rows\");\n \t\tif (rows.length() < 1)\n \t\t\tsb.append(\"No resources reference url for \" + where.split(\" \")[3].trim());\n \t\telse { \n \t\t\tsb.append(\"Following resources reference \" + where.split(\" \")[3].trim());\n \t\t\tfor (int i=0; i < rows.length(); i++) {\n \t\t\t\tJSONObject theRow = (JSONObject) rows.get(i); \n \t\t\t\tJSONArray values = (JSONArray) Utils.safeGet(theRow, \"values\");\n \t\t\t\tfor (int j=0; j < values.length(); j++) {\n \t\t\t\t\tJSONObject val = (JSONObject) values.get(j);\n \t\t\t\t\tsb.append(\"\\n\").append(resOpen).append(base).append(Utils.safeGet(val, \"td\").toString().split(\":\")[1]).append(resClose);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\tUtils.respondWithText(response, sb.toString());\n \t} else {\n// \t\tSystem.out.println(\"Contents for the SPARQL query page:\\n[\" + contents + \"]\");\n \tcontents.put(\"moreOrLess\", smService.getParam(request, \"moreOrLess\"));\n \tUtils.respondGetWithTemplateAndJson(contents, \"/templates/sparql.html\", response);\n \t}\n \treturn;\n } else if (oslcCommand.size() > 2 && \"resource\".equals(oslcCommand.get(1))) { // single resource\n// boolean isSingleResource = (oslcCommand.size() > 2 && \"resource\".equals(oslcCommand.get(1)));\n// if (isSingleResource) {\n \tResource r = model.getResource(base + oslcCommand.get(2));\n \ttitle = \"Resource [\" + r.getURI() + \"] in Domain [\" + domain + \"]\";\n \tR.add(r);\n \tisSingleResource = true;\n \t//getOslcresourcdeNew(base, repository, oslcCommand.get(2));\n } else {\n \n \ttitle = \"Resources in \" + ((\"\".equals(id))?\"\":\"[\" + id + \"], \") + \"Domain [\" + domain + \"]\";\n \tif (oslcCommand.size() <= 2) {\n \t\tString oslcWhere = smService.getParam(request, \"oslc.where\");\n \t\tString oslcPrefix = smService.getParam(request, \"oslc.prefix\");\n// \t\tString oslcProperties = smService.getParam(request, \"oslc.properties\");\n// \t\tString oslcOrderBy = smService.getParam(request, \"oslc.orderBy\");\n\n \t\t// Handle the oslc prefixes:\n \t\tMap<String, String> prefixMap = new HashMap<String, String>();\n\n \t\tif (false == Strings.isNullOrEmpty(oslcPrefix))\n \t\t\ttry {\n \t\t\t\tprefixMap = QueryUtils.parsePrefixes(oslcPrefix);\n \t\t\t} catch (org.eclipse.lyo.core.query.ParseException e) {\n \t\t\t\tthrow new IOException(e.getMessage());\n \t\t\t}\n\n\n \t\t\t// Handle the oslc properties part:\n// \t\t\tProperties properties = null;\n//\n// \t\t\ttry {\n// \t\t\t\tif (Strings.isNullOrEmpty(oslcProperties)) {\n// \t\t\t\t\tproperties = QueryUtils.WILDCARD_PROPERTY_LIST;\n// \t\t\t\t} else\n// \t\t\t\t\tproperties = QueryUtils.parseSelect(oslcProperties, prefixMap);\n// \t\t\t} catch (org.eclipse.lyo.core.query.ParseException e) {\n// \t\t\t\tthrow new IOException(e.getMessage());\n// \t\t\t} catch (RuntimeException e) {\n// \t\t\t\te.printStackTrace();\n// \t\t\t}\n\n// \t\t\t// Handle the oslc where clause:\n// \t\t\tWhereClause whereClause = null;\n//\n// \t\t\tif (false == Strings.isNullOrEmpty(oslcWhere)) {\n// \t\t\t\ttry {\n// \t\t\t\t\twhereClause = QueryUtils.parseWhere(oslcWhere, prefixMap);\n// \t\t\t\t} catch (org.eclipse.lyo.core.query.ParseException e) {\n// \t\t\t\t\tthrow new IOException(e.getMessage());\n// \t\t\t\t}\n// \t\t\t}\n\n// \t\t\t// Handle the oslc order by clause:\n// \t\t\tOrderByClause orderByClause = null;\n//\n// \t\t\tif (false == Strings.isNullOrEmpty(oslcOrderBy)) {\n// \t\t\t\ttry {\n// \t\t\t\t\torderByClause = QueryUtils.parseOrderBy(oslcOrderBy, prefixMap);\n// \t\t\t\t} catch (org.eclipse.lyo.core.query.ParseException e) {\n// \t\t\t\t\tthrow new IOException(e.getMessage());\n// \t\t\t\t}\n// \t\t\t}\n\n// \t\t\tModel model = repository.getModel();\n \t\t\tif (Strings.isNullOrEmpty(oslcWhere)) {\n \t\t\t\tResIterator it = model.listSubjects();\n \t\t\t\twhile (it.hasNext()) {\n \t\t\t\t\tResource res = it.next();\n \t\t\t\t\tif (res.getURI().startsWith(base))\n \t\t\t\t\t\tR.add(res);\n \t\t\t\t}\n \t\t\t} else {\n \t\t\t\tprefixMap.putAll(model.getNsPrefixMap());\n \t\t\t\tprefixMap = Utils.fixNsPrefixes(prefixMap);\n \t\t\t\tString prefix = Utils.makePrefix4Query(prefixMap);\n \t\t\t\tString sparql = \"SELECT ?r WHERE + { ?r ?p ?v }\";\n \t\t\t\tString t[] = oslcWhere.split(\"=\");\n \t\t\t\tif (t.length > 1) {\n \t\t\t\t\tString pred = t[0].trim();\n \t\t\t\t\tString value = t[1].trim();\n \t\t\t\t\tsparql = prefix + \"SELECT ?r WHERE { ?r \" + pred + \" \" + value + \". }\";\n \t\t\t\t\tQueryExecution qexec = QueryExecutionFactory.create(sparql, model);\n \t\t\t\t\tResultSet rslt = qexec.execSelect();\n \t\t\t\t\twhile (rslt.hasNext()) {\n \t\t\t\t\t\tQuerySolution soltn = rslt.next();\n \t\t\t\t\t\tRDFNode r = (RDFNode) soltn.get(\"r\");\n \t\t\t\t\t\tif (r.toString().startsWith(base))\n \t\t\t\t\t\t\tR.add((Resource)r);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\tnew OSLCHelper(getDatabase()).repsondForOslcQuery(R, request, response, smService, id);\n \t\t\treturn;\n \t} else {\n \t\tString resource = oslcCommand.get(1), N = \"\";\n \t\tif (resource.startsWith(\"resource#\"))\n \t\t\tN = resource.substring(\"resource#\".length());\n \t\telse if (resource.startsWith(\"resource/\"))\n \t\t\tN = resource.substring(\"resource/\".length());\n \t\tR.add(model.getResource(base + N));\n \t}\n }\n Model tmpModel = ModelFactory.createDefaultModel();\n // \tmodel.setNsPrefixes(Utils.fixNsPrefixes(repository.getModel().getNsPrefixMap()));\n for (Resource res : R) {\n \tStmtIterator it = res.listProperties();\n \twhile (it.hasNext()) {\n \t\tStatement stmt = it.next();\n \t\ttmpModel.add(stmt);\n \t}\n }\n\n// \tString type = Utils.formatFromAcceptType4Jena(request);\n// \tif (Utils.willAccept(ContentTypes.HTML, request)) {\n// \t\ttype = db.getVar(Database.Vars.contentType.toString());\n// \t}\n \tString output = Utils.modelToText(tmpModel, contentType);\n\n response.setHeader(HttpHeaders.ETAG, repository.getEtag());\n\n JSONObject contents = new JSONObject();\n contents.put(\"rdf\", output);\n contents.put(\"id\", id);\n String url = request.getRequestURL().toString(); //.getUri();\n if (url.indexOf('?') >=0)\n \turl = url.substring(0, url.indexOf('?'));\n contents.put(\"url\", url);\n contents.put(Database.Vars.contentType.toString(), db.getVar(Database.Vars.contentType.toString()));\n contents.put(\"header\", title);\n \t\tcontents.put(\"canDownload\", isSingleResource?\"false\":\"true\");\n \t\tcontents.put(\"host\", db.getHost(true, true));// db.getBaseURL()); //Utils.getHost(null, true));\n \t\tcontents.put(\"canmodify\", \"true\");\n \t\tcontents.put(\"version\", Strings.isNullOrEmpty(version)?\"\":version);\n contents.put(\"versionInfo\", versionInfo);\n //.processModelForJson(domain, \"ShowRDF\", repository, title, id, R);\n\n// \t\tString acceptType = Utils.formatFromAcceptType4Jena(request);\n\n \tif (Utils.willAccept(IConstants.HTML, request)) {\n// \t\tJSONObject contents = SmManager.processModelForJson(domain, \"ShowRDF\", model, title, id, true);\n// \t\tcontents.put(\"canDownload\", isSingleResource?\"false\":\"true\");\n \t\tcontents.put(\"hideGraphics\", \"\");\n \t\tUtils.respondGetWithTemplateAndJson(contents, \"/templates/rdf4oslc.html\", response);\n \t} else if (Utils.willAccept(IConstants.JSON, request)){\n// \t\tJSONObject contents = SmManager.processModelForJson(domain, \"ShowRDF\", model, title, id, true);\n// \t\tcontents.put(\"canDownload\", isSingleResource?\"false\":\"true\");\n \t\tUtils.respondWithJson(response, contents);\n \t} else {\n \t\tUtils.respondWithText(response, output, contentType);\n \t}\n }\n catch (Exception e)\n {\n e.printStackTrace();\n throw new Exception(\"OSLC failed [\" + e.getMessage() + \"].\");\n }\n\t}", "HarvestingStatus getHarvestingStatus(String dsID) throws RepoxException;", "public void execute() {\n //this.$context.$Request.initialize();\n this.$context.$Request.extractAllVars();\n\n this.$context.$Response.writeHeader(\"Content-type\", \"text/html; charset=UTF-8\");\n\n // Check security code\n if (!this.$context.$Request.contains(\"code\")) {\n this.$context.$Response.end(\"Code is required!\");\n return;\n }\n String $code = this.$context.$Request.get(\"code\");\n if (!EQ($code, Config.SECURITY_CODE)) {\n this.$context.$Response.end(\"Incorrect code!\");\n return;\n }\n\n // Check package\n if (!this.$context.$Request.contains(\"package\")) {\n this.$context.$Response.end(\"Package is required!\");\n return;\n }\n String $package = this.$context.$Request.get(\"package\");\n if (BLANK($package)) {\n this.$context.$Response.end(\"Empty package!\");\n return;\n }\n String[] $packageChunks = Strings.split(\"-\", $package);\n for (int $n = 0; $n < SIZE($packageChunks); $n++)\n $packageChunks[$n] = Strings.firstCharToUpper($packageChunks[$n]);\n $package = Strings.join(\"/\", $packageChunks);\n\n // Check class\n if (!this.$context.$Request.contains(\"class\")) {\n this.$context.$Response.end(\"Class is required!\");\n return;\n }\n String $className = this.$context.$Request.get(\"class\");\n if (BLANK($className)) {\n this.$context.$Response.end(\"Empty class!\");\n return;\n }\n\n // Check method\n if (!this.$context.$Request.contains(\"method\")) {\n this.$context.$Response.end(\"Method is required!\");\n return;\n }\n String $method = this.$context.$Request.get(\"method\");\n if (BLANK($method)) {\n this.$context.$Response.end(\"Empty method!\");\n return;\n }\n\n // Fill array with parameters\n int $count = 0;\n TArrayList $pars = new TArrayList();\n for (int $n = 1; $n <= 6; $n++) {\n String $parName = CAT(\"par\", $n);\n if (!this.$context.$Request.contains($parName))\n break;\n String $parValue = this.$context.$Request.get($parName);\n if (EQ($parValue, \"_\"))\n $parValue = \"\";\n //$parsArray[] = $parValue;\n $pars.add($parValue);\n $count++;\n }\n\n String $buffer = null;\n Object $result = null;\n\n String $fullClass = CAT($package, \"/\", $className);\n\n $fullClass = Strings.replace(\"/\", \".\", $fullClass);\n TArrayList $pars0 = new TArrayList(new Object[] { this.$context.$Connection });\n $result = Bula.Internal.callMethod($fullClass, $pars0, $method, $pars);\n\n if ($result == null)\n $buffer = \"NULL\";\n else if ($result instanceof DataSet)\n $buffer = ((DataSet)$result).toXml(EOL);\n else\n $buffer = STR($result);\n this.$context.$Response.write($buffer);\n this.$context.$Response.end();\n }", "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2014-03-25 14:24:54.432 -0400\", hash_original_method = \"33E79C141DA6BAC5AB89BF248B2B71FA\", hash_generated_method = \"E65225020E4ABF61E62BA1FB15CFE2E8\")\n \n public static String statusCommand(){\n \tdouble taintDouble = 0;\n \n \tString retObj = new String(); \n \tretObj.addTaint(taintDouble);\n \treturn retObj;\n }", "@Override\r\n\tpublic double execute(Scanner scanner) {\r\n\t\tint[] params = new int[parameterCount]; \r\n\t\tfor (int i = 0; i < parameterCount; i++) {\r\n\t\t\tSystem.out.println(operationName + \" yapılacak \" + i + \". değer : \");\r\n\t\t\tparams[i] = scanner.nextInt();\r\n\t\t}\r\n\t\treturn op.exec(params);\r\n\t}", "public static void main(String[] args) {\n\t\tString dataFileName = DATA_PATH + \"icecreamSummary2NA.csv\";\n\t\tString categoryName = \"numScoops\";\n\t\tString responseColumnName = \"Count3\";\n\t\tString groupingName = null; // NULL\n\t\tint groupingNameLevelsCount = 1; //3; //\n\t\tint[] result;\n\n//\t\t//EXAMPLE 2\n//\t\t//supply path and name of rda data\n//\t\tString dataFileName = DATA_PATH + \"icecreamSummary2NA.csv\";\n//\t\tString categoryName = \"numScoops\";\n//\t\tString responseColumnName = \"Count2\";\n//\t\tString groupingName = \"brand\"; //null; // NULL\n//\t\tint groupingNameLevelsCount = 4; //1; //\n//\t\tint[] result;\n\n\t\tRJavaManager rJavaManager= new RJavaManager();\n\t\trJavaManager.initStar();\n\t\tresult=rJavaManager.getRJavaDataManipulationManager().howManyLevelsHaveOneDatum(dataFileName, categoryName, responseColumnName, groupingName);\n\t\tfor (int i=0; i<groupingNameLevelsCount;i++) System.out.println(i + \":\" + result[i]);\n\t}", "protected abstract void analyzeSystem(PipelineData data) throws Exception;", "public static void main(String[] args) {\n\t\tVector<Edge> edges = GraphReader.readFromFile(\"/tmp/tinyG.txt\",2);\r\n\t\tGraph G = new Graph(edges);\r\n int s = Integer.parseInt(\"1\");\r\n DepthFirstSearch search = new DepthFirstSearch(G.getNodeNum());\r\n Path res = search.dfs(G, s);\r\n res.packetToJson();\r\n //System.out.print(\"success!\");\r\n }", "public AnalyticsInformation execCommand(String user, String pass,\r\n\t\t\t\tString sql) {\n\t\t\tAnalyticsInformation ai = new AnalyticsInformation();\r\n\t\t\tai.setResponseTime(\"00:00:00.01\");\r\n\t\t\tStatistics s = new Statistics();\r\n\t\t\ts.setRecursiveCalls(1900);\r\n\t\t\tai.setStatistics(s);\r\n\t\t\t\r\n\t\t\treturn ai;\r\n\t\t}", "public static void main(String[] args) {\n\t\tDDEDataDownloadHelper ins = new DDEDataDownloadHelper();\n\t\tins.fetchDataFromWeb(\"600175\");\n\t}", "public static void main(String [] args) throws Exception {\n Server fnServer = new Server(new URL(\"https://fno.io/hub/api\"));\n\n double totalArea = 30528.0;\n double populationTotal = 11099981;\n\n QueryParam[] params = {new QueryParam(\"float\", new String[]{\"total population\"}), new QueryParam(\"float\", new String[]{\"area\"})};\n Query query = new Query(new String[]{\"population density\"}, params, null, null, ImplementationType.WEB_API);\n Function function = fnServer.query(query)[0];\n FunctionInstance calculatePopulationDensity = ImplementationHandler.instantiateFunctionImplementation(function, function.implementationMappings[0]);\n System.out.println(\"The population density of Belgium is: \" + calculatePopulationDensity.executeFunction((float)populationTotal, (float)totalArea));\n\n QueryParam[] reversedParams = {new QueryParam(\"float\", new String[]{\"area\"}), new QueryParam(\"float\", new String[]{\"total population\"})};\n query = new Query(new String[]{\"population density\"}, reversedParams, null, null, ImplementationType.LOCAL);\n function = fnServer.query(query)[0];\n calculatePopulationDensity = ImplementationHandler.instantiateFunctionImplementation(function, function.implementationMappings[0]);\n System.out.println(\"The population density of Belgium is: \" + calculatePopulationDensity.executeFunction((float)totalArea, (float)populationTotal));\n\n query = new Query(new String[]{\"hello world\"}, null, null, null);\n function = fnServer.query(query)[0];\n FunctionInstance helloWorld = ImplementationHandler.instantiateFunctionImplementation(function, function.implementationMappings[0]);\n System.out.println(\"Output: \" + helloWorld.executeFunction());\n\n\n }", "@SuppressWarnings(\"unchecked\")\n\t\tpublic void run() {\n long throughputMeasurementStartTime = System.currentTimeMillis();\n\n byte[] reply;\n int reqId;\n int req = 0;\n\n Storage st = new Storage(nTXs);\n\n System.out.println(\"Executing experiment for \" + nTXs + \" ops\");\n\n for (int i = 0; i < nTXs; i++, req++) {\n long last_send_instant = System.nanoTime();\n if (dos) {\n reqId = proxy.generateRequestId((readOnly) ? TOMMessageType.UNORDERED_REQUEST : TOMMessageType.ORDERED_REQUEST); \n proxy.TOMulticast(request, reqId, (readOnly) ? TOMMessageType.UNORDERED_REQUEST : TOMMessageType.ORDERED_REQUEST); \n\n } else {\n \tif(readOnly) {\n \t\treply = proxy.invokeUnordered(request);\n \t} else {\n \t\treply = proxy.invokeOrdered(request);\n \t}\n }\n st.store(System.nanoTime() - last_send_instant);\n\n if (timeout > 0) {\n //sleeps timeout ms before sending next request\n try {\n\t\t\t\t\t\tThread.sleep(timeout);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n } \n\n } \n writeReportJSON(throughputMeasurementStartTime, st); \n }", "private void go(String[] args) {\n System.setProperty(\"jsse.enableSNIExtension\", \"false\");\n\n // process command line arguments\n options = new SampleCommandLineOptions();\n options.parseOptions(args);\n\n // Log in to vCHS API, getting a session in response if login is successful\n System.out.print(\"\\nConnecting to vCHS...\");\n\n authToken = IAM.login(options.hostname, options.username, options.password, options.version);\n\n System.out.println(\"Success\\n\");\n\n // Retrieve the collection of compute services which can be of type dedicated cloud or vpc\n // and has VDC in it.\n List<PlanType> plans = ServiceController.getPlans(options.hostname, options.version,\n authToken);\n if (null != plans && plans.size() > 0) {\n System.out.println(\"PLANS\");\n System.out.println(\"-----\");\n System.out.println();\n\n System.out.printf(\"%-40s %-40s %-50s %-30s %-20s\\n\", \"Name\", \"Id\", \"Region\",\n \"Service Name\", \"Plan Version\");\n System.out.printf(\"%-40s %-40s %-50s %-30s %-20s\\n\",\n \"----------------------------------------\",\n \"----------------------------------------\",\n \"--------------------------------------------------\",\n \"------------------------------\", \"-------------------\");\n\n for (PlanType plan : plans) {\n System.out.printf(\"%-40s %-40s %-50s %-30s %-20s\\n\", plan.getName(), plan.getId(),\n plan.getRegion(), plan.getServiceName(), plan.getPlanVersion());\n }\n }\n\n List<InstanceType> instances = ServiceController.getInstances(options.hostname,\n options.version, authToken);\n System.out.println(\"\\n\");\n\n if (null != instances && instances.size() > 0) {\n System.out.println(\"INSTANCES\");\n System.out.println(\"---------\");\n System.out.println();\n\n System.out.printf(\"%-40s %-40s %-50s %-50s\\n\", \"Name\", \"Id\", \"Region\", \"Plan Id\");\n System.out.printf(\"%-40s %-40s %-50s %-50s\\n\",\n \"----------------------------------------\",\n \"----------------------------------------\",\n \"--------------------------------------------------\",\n \"--------------------------------------------------\");\n\n for (InstanceType instance : instances) {\n System.out.printf(\"%-40s %-40s %-50s %-50s\\n\", instance.getName(),\n instance.getId(), instance.getRegion(), instance.getPlanId());\n }\n }\n\n System.out.println(\"\\n\\n\");\n }", "@SuppressWarnings(\"deprecation\")\n\tprotected void execute() {\n \t\n \n \t \n\t \t/*\n\t SmartDashboard.putDouble(\"Encoder Period: \", ExampleSubsystem.encoder.getPeriod());\n\t SmartDashboard.putDouble(\"Encoder Get: \", ExampleSubsystem.encoder.get());\n\t SmartDashboard.putDouble(\"Encoder RAW: \", ExampleSubsystem.encoder.getRaw());\n\t SmartDashboard.putDouble(\"Encoder Distance\", ExampleSubsystem.encoder.getDistance());\n\t SmartDashboard.putDouble(\"Encoder PID: \", ExampleSubsystem.encoder.pidGet());\n */\n \t\n \t/* System out println with Riolog\n \t \n\t \tSystem.out.println(\"Encoder Rate: \" + ExampleSubsystem.encoder.pidGet());\n\t \tSystem.out.println(\"Encoder Period: \" + ExampleSubsystem.encoder.getPeriod());\n\t \tSystem.out.println(\"Encoder Get: \" + ExampleSubsystem.encoder.get());\n\t \tSystem.out.println(\"Encoder RAW: \" + ExampleSubsystem.encoder.getRaw());\n\t \tSystem.out.println(\"Encoder Distance\" + ExampleSubsystem.encoder.getDistance());\n\t \tSystem.out.println(\"Encoder PID: \" + ExampleSubsystem.encoder.pidGet());\n \t*/\n \t\n }", "public void receiveResultSimpleExecuteRSDocument(\r\n\t\t\tcom.autometrics.analytics.v9.j2ee.webservices.v1_0.SimpleExecuteRSDocumentResponse result) {\r\n\t}", "public ComputingResponse call(){\n\t\tlong tiempoini =System.nanoTime();\n\t\tlog.info(\"Starting DynamicRSA Algorithm\");\n\t\t//Create the response message\n\t\t//It will contain either the path or noPath\n\t\tComputingResponse m_resp=new ComputingResponse();\n\t\tm_resp.setEncodingType(pathReq.getEcodingType());\n\t\t//The request that needs to be solved\n\t\tRequest req=pathReq.getRequestList().get(0);\n\t\t\n\t\t//Request Id, needed for the response\n\t\tlong reqId=req.getRequestParameters().getRequestID();\n\t\tlog.info(\"Request id: \"+reqId+\", getting endpoints\");\n\t\t//Start creating the response\n\t\tResponse response=new Response();\n\t\tRequestParameters rp = new RequestParameters();\n\t\trp.setRequestID(reqId);\n\t\tresponse.setRequestParameters(rp);\n\t\tm_resp.addResponse(response);\n\t\tSSONInfo= new SSONInformation();\n\t\tSSONInfo=((DomainTEDB)ted).getSSONinfo();\n\t\t\n\t\t//esto hay que cambiarlo para poder leer del GENERALIZED END POINTS\n\t\t//if (getObjectType(req.getEndPoints()))\n\t\tEndPoints EP= req.getEndPoints();\n\t\tBandwidthRequested Bw= (BandwidthRequested)req.getBandwidth(); // Objeto bandwidth para saber la demanda de la peticion.\n\t\tObject source_router_id_addr = null;\n\t\tObject dest_router_id_addr = null;\n\n\t\tGraphPath<Object,IntraDomainEdge> gp_chosen=null;\n\t\n\t\tint cs;\n\t\tboolean end=false;//The search has not ended yet\n\t\tint num_labels=0;\n\t\tint m=0;\n\t\tint Bmod=0; // Spectrum efficiency b/s/Hz (Modulation formats: 16-QAM, QPSK)\n\t\t\n\t\tnum_labels = SSONInfo.getNumLambdas();\n\t\tlog.info(\"Num_lambdas \"+num_labels);\n\t\t\n\n\t\tbandwidthToSlotConversion conversion= new bandwidthToSlotConversion();\n\t\t\n\t\t// Conversión Bw a numero de slots en función de la grid.\t\n\t\tif (Bw.getBw()!=0){\n\t\t\tSSONInfo=((DomainTEDB)ted).getSSONinfo();\n\t\t\tcs = SSONInfo.getCs();\n\t\t\tnum_slots=conversion.getNumSlots(Bw.getBw(), cs);\n\t\t}\n\t\t\t\n\t\t/* The set of request-channels will be bounded by the total number of frequency slots\n\t\t* less the number of contiguous frequency slot required for serve the demand plus one.\n\t\t*/\n\t\tlog.info(\"Request num_slots: \"+num_slots);\n\t\tsetChannels = preComp.getTotalSetChannels().get(num_slots-1);\n\n\t\t\n\t\tif (EP.getOT()==ObjectParameters.PCEP_OBJECT_TYPE_ENDPOINTS_IPV4){\n\t\t\tEndPointsIPv4 ep=(EndPointsIPv4) req.getEndPoints();\n\t\t\tsource_router_id_addr=ep.getSourceIP();\n\t\t\tdest_router_id_addr=ep.getDestIP();\n\t\t}else if (EP.getOT()==ObjectParameters.PCEP_OBJECT_TYPE_ENDPOINTS_IPV6){\n\n\t\t}else if (EP.getOT()==ObjectParameters.PCEP_OBJECT_TYPE_GENERALIZED_ENDPOINTS){\n\t\t\tGeneralizedEndPoints gep=(GeneralizedEndPoints) req.getEndPoints();\n\t\t\tif(gep.getGeneralizedEndPointsType()==ObjectParameters.PCEP_GENERALIZED_END_POINTS_TYPE_P2P){\n\t\t\t\tP2PEndpoints p2pep= gep.getP2PEndpoints();\n\t\t\t\tEndPoint sourceep=p2pep.getSourceEndPoint();\n\t\t\t\tEndPoint destep=p2pep.getDestinationEndPoint();\n\t\t\t\tsource_router_id_addr=sourceep.getEndPointIPv4TLV().IPv4address;\n\t\t\t\tdest_router_id_addr=destep.getEndPointIPv4TLV().IPv4address;\n\t\t\t}\n\t\t\tif(gep.getGeneralizedEndPointsType()==ObjectParameters.PCEP_GENERALIZED_END_POINTS_TYPE_P2MP_NEW_LEAVES){\n\t\t\t\tP2MPEndpoints p2mpep= gep.getP2MPEndpoints();\n\t\t\t\tEndPointAndRestrictions epandrest=p2mpep.getEndPointAndRestrictions();\n\t\t\t\tEndPoint sourceep=epandrest.getEndPoint();\n\t\t\t\tsource_router_id_addr=sourceep.getEndPointIPv4TLV().IPv4address;\n\t\t\t\tint cont=0;\n\t\t\t\twhile (cont<=p2mpep.getEndPointAndRestrictionsList().size()){ //esto est� mal\n\t\t\t\t\tepandrest=p2mpep.getEndPointAndRestrictionsList().get(cont);\n\t\t\t\t\tEndPoint destep=epandrest.getEndPoint();\n\t\t\t\t\tsource_router_id_addr=sourceep.getEndPointIPv4TLV().IPv4address;\n\t\t\t\t\tdest_router_id_addr=destep.getEndPointIPv4TLV().IPv4address;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//Now, check if the source and destination are in the TED.\n\t\tlog.info(\"Source: \"+source_router_id_addr+\"; Destination:\"+dest_router_id_addr);\n\t\tif (!(((ted.containsVertex(source_router_id_addr))&&(ted.containsVertex(dest_router_id_addr))))){\n\t\t\tlog.warn(\"Source or destination are NOT in the TED\");\t\n\t\t\tNoPath noPath= new NoPath();\n\t\t\tnoPath.setNatureOfIssue(ObjectParameters.NOPATH_NOPATH_SAT_CONSTRAINTS);\n\t\t\tNoPathTLV noPathTLV=new NoPathTLV();\n\t\t\tif (!((ted.containsVertex(source_router_id_addr)))){\n\t\t\t\tlog.debug(\"Unknown source\");\t\n\t\t\t\tnoPathTLV.setUnknownSource(true);\t\n\t\t\t}\n\t\t\tif (!((ted.containsVertex(dest_router_id_addr)))){\n\t\t\t\tlog.debug(\"Unknown destination\");\n\t\t\t\tnoPathTLV.setUnknownDestination(true);\t\n\t\t\t}\n\n\t\t\tnoPath.setNoPathTLV(noPathTLV);\n\t\t\tresponse.setNoPath(noPath);\n\t\t\treturn m_resp;\n\t\t}\n\t\t// check if src and dst are the same \n\t\tif (source_router_id_addr.equals(dest_router_id_addr)){\n\t\t\tlog.info(\"Source and destination are the same!\");\n\t\t\tPath path=new Path();\n\t\t\tExplicitRouteObject ero= new ExplicitRouteObject();\n\t\t\tIPv4prefixEROSubobject eroso= new IPv4prefixEROSubobject();\n\t\t\teroso.setIpv4address((Inet4Address)source_router_id_addr);\n\t\t\teroso.setPrefix(32);\n\t\t\tero.addEROSubobject(eroso);\n\t\t\tpath.setEro(ero);\n\t\t\t\n\t\t\tif (req.getMetricList().size()!=0){\n\t\t\t\tMetric metric=new Metric();\n\t\t\t\tmetric.setMetricType(req.getMetricList().get(0).getMetricType() );\n\t\t\t\tlog.debug(\"Number of hops \"+0);\n\t\t\t\tfloat metricValue=0;\n\t\t\t\tmetric.setMetricValue(metricValue);\n\t\t\t\tpath.getMetricList().add(metric);\n\t\t\t}\n\t\t\tresponse.addPath(path);\n\t\t\tlong tiempofin =System.nanoTime();\n\t\t\tlong tiempotot=tiempofin-tiempoini;\n\t\t\tlog.info(\"Ha tardado \"+tiempotot+\" nanosegundos\");\n\t\t\tMonitoring monitoring=pathReq.getMonitoring();\n\t\t\tif (monitoring!=null){\n\t\t\t\tif (monitoring.isProcessingTimeBit()){\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tm_resp.addResponse(response);\n\t\t\treturn m_resp;\n\t\t\t\n\t\t}\n\n\n\t\tboolean nopath=true;//Initially, we still have no path\n\n\t\tint central_freq=0; // It represents the central frequency slot n.\n\t\t\n\t\tdouble max_metric=Integer.MAX_VALUE;\t\n\t\t\n\t\tpreComp.getGraphLock().lock();\n\t\ttry{\n\t\t\twhile (!end){\n\t\t\t\t//SimpleDirectedWeightedGraph<Object,IntraDomainEdge> graphLambda=preComp.getNetworkGraphs().get(0);\n\t\t\t\tSimpleDirectedWeightedGraph<Object,IntraDomainEdge> graphLambda=preComp.getbaseSimplegraph();\n\t\t\t\t\n\t\t\t\t//networkGraph=PCEPUtils.duplicateTEDDB(((SimpleTEDB)ted).getNetworkGraph());\n//\t\t\t\tSet<IntraDomainEdge> fiberEdges= preComp.getNetworkGraphs().get(0).edgeSet();\n//\t\t\t\tIterator<IntraDomainEdge> Iterator = fiberEdges.iterator();\n//\t\t\t\twhile(Iterator.hasNext()){\n//\t\t\t\tIntraDomainEdge fiberEdge =Iterator.next();\n//\t\t\t\tFuncionesUtiles.printByte(((BitmapLabelSet)fiberEdge.getTE_info().getAvailableLabels().getLabelSet()).getBytesBitMap(), \"Bitmap edge \"+fiberEdge.toString()+\".\", log);\n//\t\t\t\t}\n\t\t\t\tlog.info(\"Antes de DSP\"+preComp.printTopology(0));\n\t\t\t\tModifiedDijkstraSP dsp=new ModifiedDijkstraSP(graphLambda, source_router_id_addr, dest_router_id_addr, Double.POSITIVE_INFINITY, setChannels, num_slots);\n\t\t\t\tlog.info(\"Fin MDSP\");\n\t\t\t\tGraphPath<Object,IntraDomainEdge> gp=dsp.getPath();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (gp==null){\n\t\t\t\t\tlog.debug(\"No path found\");\n\t\t\t\t\tNoPath noPath= new NoPath();\n\t\t\t\t\tnoPath.setNatureOfIssue(ObjectParameters.NOPATH_NOPATH_SAT_CONSTRAINTS);\n\t\t\t\t\tNoPathTLV noPathTLV=new NoPathTLV();\n\t\t\t\t\tnoPath.setNoPathTLV(noPathTLV);\t\t\t\t\n\t\t\t\t\tresponse.setNoPath(noPath);\n\t\t\t\t\tnopath=true;\n\t\t\t\t\treturn m_resp;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tBitmapChannelState valid_channels = new BitmapChannelState(dsp.getVertexSpectrumState().get(dest_router_id_addr).getLength());\n\t\t\t\t\tvalid_channels.setBytesBitmap(dsp.getVertexSpectrumState().get(dest_router_id_addr).getBytesBitmap());\n\t\t\t\t\t\n\t\t\t\t\tfor (int i=0; i<valid_channels.getLength(); i++){\n\t\t\t\t\t\tif ((valid_channels.getBytesBitmap()[i/8]&(0x80>>(i%8))) == (0x80>>i%8)){\n\t\t\t\t\t\t\tBitmapLabelSet chosen_channel=setChannels.get(i);\n\t\t\t\t\t\t\tUtilsFunctions.printByte(chosen_channel.getBytesBitMap(),\"Bitmap Channel \"+i+\">>\", log);\n\t\t\t\t\t\t\tcentral_freq=i+(num_slots+1)/2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (central_freq!=0){\n\t\t\t\t\t\tgp_chosen=gp;\n\t\t\t\t\t\tmax_metric=gp.getWeight();\n\t\t\t\t\t\tm=(num_slots)/2;\n\t\t\t\t\t\tlog.info(\"Central Frequency\"+central_freq);\n\t\t\t\t\t\tlog.info(\"Frequency width\"+m);\n\t\t\t\t\t\tlog.info(\"Path\"+gp_chosen);\n\t\t\t\t\t\tnopath=false;\n\t\t\t\t\t\tend=true;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tthrow new IllegalArgumentException(\"Invalid central frequency for this request\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfinally{\n\t\t\tpreComp.getGraphLock().unlock();\t\n\t\t}\n\n\t\tif (nopath==false){\n\n\t\t\tPath path=new Path();\n\t\t\tExplicitRouteObject ero= new ExplicitRouteObject();\n\t\t\tList<IntraDomainEdge> edge_list= gp_chosen.getEdgeList();\n\t\t\tint i;\n\t\t\t\n\t\t\tfor (i=0;i<edge_list.size();i++){\n\t\t\t\tUnnumberIfIDEROSubobject eroso= new UnnumberIfIDEROSubobject();\n\t\t\t\teroso.setRouterID((Inet4Address)edge_list.get(i).getSource());\n\t\t\t\teroso.setInterfaceID(edge_list.get(i).getSrc_if_id());\n\t\t\t\teroso.setLoosehop(false);\n\t\t\t\tero.addEROSubobject(eroso);\n\t\t\t\t\n\t\t\t\t//FIXME: Temp, only for HPCE algorithms\n\t\t\t\tpreComp.setReservation(m, (central_freq)+preComp.getWSONInfo().getnMin(), edge_list.get(i).getSource(), edge_list.get(i).getTarget());\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//ITU-T Format\n\t\t\t\tDWDMWavelengthLabel WDMlabel=new DWDMWavelengthLabel();\n\t\t\t\tWDMlabel.setGrid(preComp.getWSONInfo().getGrid());\n\t\t\t\tWDMlabel.setChannelSpacing(preComp.getWSONInfo().getCs());\n\t\t\t\tWDMlabel.setN((central_freq)+preComp.getWSONInfo().getnMin());\n\t\t\t\tWDMlabel.setIdentifier(0);\n\t\t\t\tWDMlabel.setM(m);\n\t\t\t\ttry {\n\t\t\t\t\tWDMlabel.encode();\n\t\t\t\t} catch (RSVPProtocolViolationException 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\tGeneralizedLabelEROSubobject genLabel= new GeneralizedLabelEROSubobject();\n\t\t\t\tero.addEROSubobject(genLabel);\n\t\t\t\tgenLabel.setLabel(WDMlabel.getBytes());\t\n\t\t\t}\n\t\t\t\n\t\t\t//log.info(\"Label bit map: \"+ted.getWSONinfo().getCommonAvailableLabels().getLabelSet().toString());\n\t\t\tBandwidthRequestedGeneralizedBandwidth gb = new BandwidthRequestedGeneralizedBandwidth ();\n\t\t\tpreComp.setTotalBandwidth((m*2*6.25)+preComp.getTotalBandwidth());\n\t\t\t\n\t\t\tGeneralizedBandwidthSSON GB_SSON = new GeneralizedBandwidthSSON(); \n\t GB_SSON.setM(m);\n\t gb.setGeneralizedBandwidth(GB_SSON);\n\n\t\t\t\n\t\t\tIPv4prefixEROSubobject eroso= new IPv4prefixEROSubobject();\n\t\t\teroso.setIpv4address((Inet4Address)edge_list.get(edge_list.size()-1).getTarget());\n\t\t\teroso.setPrefix(32);\n\t\t\tero.addEROSubobject(eroso);\n\t\t\tpath.setEro(ero);\n\t\t\tpath.setBandwidth(gb);\n\t\t\tPCEPUtils.completeMetric(path, req, edge_list);\n\t\t\tresponse.addPath(path);\n\t\t\t\n\t\t\t//FIXME: RESERVATION NEEDS TO BE IMPROVED!!!\n\t\t\tLinkedList<Object> sourceVertexList=new LinkedList<Object>();\n\t\t\tLinkedList<Object> targetVertexList=new LinkedList<Object>();\n\t\t\t\n\t\t\tfor (i=0;i<edge_list.size();i++){\n\t\t\t\tsourceVertexList.add(edge_list.get(i).getSource());\n\t\t\t\ttargetVertexList.add(edge_list.get(i).getTarget());\n\t\t\t}\t\n\t\t\tsourceVertexList.add(edge_list.get(i-1).getSource());\n\t\t\ttargetVertexList.add(edge_list.get(i-1).getTarget());\n\t\t\t\n\t\t\tif (req.getReservation()!=null){\n\t\t\t reserv= new GenericLambdaReservation();\n\t\t\t reserv.setResp(m_resp);\n\t\t\t reserv.setLambda_chosen(central_freq);\n\t\t\t reserv.setBidirectional(req.getRequestParameters().isBidirect());\n\t\t\t reserv.setReservation(req.getReservation());\n\t\t\t reserv.setSourceVertexList(sourceVertexList);\n\t\t\t reserv.setTargetVertexList(targetVertexList);\n\t\t\t //log.info(\"Bidirect = \" +req.getRequestParameters().isBidirect());\n\t\t\t reserv.setReservationManager(reservationManager);\n\t\t\t}\n\t\t\n\t\t}\n\t\tlong tiempofin =System.nanoTime();\n\t\tlong tiempotot=tiempofin-tiempoini;\n\t\tlog.info(\"Ha tardado \"+tiempotot+\" nanosegundos\");\n\t\tlog.info(\"RESPONSE: \"+m_resp.toString());\n\t\treturn m_resp;\n\t}", "public String executeSearch(final String uid) \n\t\t\tthrows Exception {\n\t\tbuildQuerySubject(this.termsList);\n\t\tbuildQueryAuthor(this.termsList); \n\t\tbuildQueryTaxon(this.termsList);\n\t\tbuildQueryIdentifier(this.termsList);\n\t\tbuildQueryGeographicDescription(this.locationName, this.termsList);\n\t\tbuildQueryFilterTemporal(this.dateField, this.startDate,\n\t\t this.endDate, this.isDatesContainedChecked, this.namedTimescale,\n\t\t this.namedTimescaleQueryType, this.termsList);\n\t\tbuildQueryFilterSite(this.termsList);\n\t\tbuildQueryFilterSpatial(this.northBound, this.southBound, this.eastBound,\n\t\t\t\t this.westBound, this.isBoundaryContainedChecked);\n\t\n\t\tqueryString = String.format(\n\t\t\t\t\"defType=%s&q=%s&%s&fl=%s&debug=%s\",\n\t\t\t\tDEFAULT_DEFTYPE, this.qString.trim(), this.fqString.trim(),\n\t\t\t\tDEFAULT_FIELDS, DEFAULT_DEBUG\n\t\t);\n\n\t\tDataPackageManagerClient dpmClient = new DataPackageManagerClient(uid);\n\t\tString extendedQueryString = String.format(\"%s&start=%d&rows=%d&sort=%s\", queryString, DEFAULT_START, DEFAULT_ROWS, DEFAULT_SORT);\n\t\tString resultsetXML = dpmClient.searchDataPackages(extendedQueryString);\n\t\tlogger.warn(String.format(\"query:\\n%s\", extendedQueryString));\n\n\t\treturn resultsetXML;\n\t}", "public abstract double getLikelihood(String command);", "public void processResults() {\r\n try {\r\n rm5 = new Process(new File(_corePath.RAPID_MINER_PROCESS_XML));\r\n IOContainer ioResult = rm5.run();\r\n ExampleSet resultSet;\r\n int num_rules = 0;\r\n if (ioResult.getElementAt(0) instanceof ExampleSet) {\r\n resultSet = (ExampleSet) ioResult.getElementAt(0);\r\n for (int i = 0; i <= resultSet.size() - 1; i++) {\r\n if ((resultSet.getExample(i).get(\"Premise Items\").equals(1)) && (resultSet.getExample(i).get(\"Conclusion Items\").equals(1))) {\r\n num_rules++;\r\n results += \"<ul><li title=\\\"Premise\\\">\" + resultSet.getExample(i).get(\"Premise\") + \"</li>\"\r\n + \"<li title=\\\"Conclusion\\\">\" + resultSet.getExample(i).get(\"Conclusion\") + \"</li>\"\r\n + \"<li title=\\\"Confidence\\\" class=\\\"metrics\\\">\" + String.format(\"%f%n\", resultSet.getExample(i).get(\"Confidence\")) + \"</li>\"\r\n + \"<li title=\\\"Conviction\\\" class=\\\"metrics\\\">\";\r\n\r\n if (resultSet.getExample(i).get(\"Conviction\").equals(\"Infinity\")) {\r\n results += resultSet.getExample(i).get(\"Conviction\");\r\n } else {\r\n results += String.format(\"%f%n\", resultSet.getExample(i).get(\"Conviction\"));\r\n }\r\n\r\n results += \"</li>\"\r\n + \"<li title=\\\"Gain\\\" class=\\\"metrics\\\">\" + String.format(\"%f%n\", resultSet.getExample(i).get(\"Gain\")) + \"</li>\"\r\n + \"<li title=\\\"Laplace\\\" class=\\\"metrics\\\">\" + String.format(\"%f%n\", resultSet.getExample(i).get(\"Laplace\")) + \"</li>\"\r\n + \"<li title=\\\"Lift\\\" class=\\\"metrics\\\">\" + String.format(\"%f%n\", resultSet.getExample(i).get(\"Lift\")) + \"</li>\"\r\n + \"<li title=\\\"Ps\\\" class=\\\"metrics\\\">\" + String.format(\"%f%n\", resultSet.getExample(i).get(\"Ps\")) + \"</li>\"\r\n + \"<li title=\\\"Total Support\\\" class=\\\"metrics\\\">\" + String.format(\"%f%n\", resultSet.getExample(i).get(\"Total Support\")) + \"</li><li class=\\\"num_rules\\\">\" + num_rules + \"</li></ul>\";\r\n } else {\r\n break;\r\n }\r\n }\r\n } else {\r\n results = \"No results found.\";\r\n }\r\n\r\n results = results.replace(\"[\", \"\");\r\n results = results.replace(\"]\", \"\");\r\n\r\n\r\n } catch (OperatorException ex) {\r\n Logger.getLogger(Core.class.getName()).log(Level.SEVERE, null, ex);\r\n } catch (IOException ex) {\r\n Logger.getLogger(Core.class.getName()).log(Level.SEVERE, null, ex);\r\n } catch (XMLException ex) {\r\n Logger.getLogger(Core.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "public static void main(String[] args) throws Exception {\n\tinitXMLdoc();\n\n\t// get a Dryad ID\n\tString itemID = args[0];\n\tSystem.out.println(\"processing \" + itemID);\n\n\t// retrieve the object from Dryad (in OAI_DC format)\n\tString accessURL = OAI_BASE + itemID + OAI_APPEND;\n\tSystem.out.println(\"retrieving \" + accessURL);\n\tDocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\n\tDocumentBuilder db = dbf.newDocumentBuilder();\n\tDocument userdoc = db.parse(new URL(accessURL).openStream());\n\t\n\t// extract its DOI\n\tNodeList nl = userdoc.getElementsByTagName(\"dc:relation\");\n\tString targetDOI = null;\n\tfor(int i=0; i < nl.getLength(); i++){\n\t String rel = nl.item(i).getTextContent();\n\t System.out.println(\"relation \" + rel);\n\t if (rel.startsWith(\"doi\")) {\n\t\ttargetDOI = rel.substring(\"doi:\".length()); // skip \"doi:\"\n\t }\n\t}\n\tSystem.out.println(\"doi is \" + targetDOI);\n\n\t// get the corresponding record from crossref\n\tString authURL = CROSSREF_URL + targetDOI + \".xml\";\n\tSystem.out.println(\"retrieving \" + authURL);\n\tDocumentBuilderFactory authdbf = DocumentBuilderFactory.newInstance();\n\tDocumentBuilder authdb = authdbf.newDocumentBuilder();\n\tDocument authdoc = authdb.parse(new URL(authURL).openStream());\n\n\t// compute title match\n\tNodeList titles = userdoc.getElementsByTagName(\"dc:title\");\n\tString doctitle = titles.item(0).getTextContent().substring(\"Data from: \".length()); // remove the Data from:\n\tSystem.out.println(\"doctitle \" + doctitle);\n\t\n\tNodeList authtitles = authdoc.getElementsByTagName(\"title\");\n\tString authtitle = authtitles.item(0).getTextContent();\n\tSystem.out.println(\"authtitle \" + authtitle);\n\t\n\tgenerateMatchXML(doctitle, authtitle, \"dc:title\");\n\n\n\t// render the XML into pretty HTML\t\n\toutputXMLdoc();\n\t\n\t// display\n\t\n }", "public RequestResult getData(Map<String, String> params) {\n\t\t\n\t\tString action = params.get(\"action\");\n\t\t\n\t\tif (action == null) {\n\t\t\treturn null;\t\t\n\n\t\t} else if (action.equals(\"ranks\")) {\n\t\t\treturn new TextResult(defaultGetRanks());\n\t\t\t\n\t\t} else if (action.equals(REMARK) || action.equals(MAGTYPE)) {\n\t\t\treturn new TextResult(defaultGetOptions(action));\n\t\t\t\n\t\t} else if (action.equals(\"data\")) {\n\t\t\tint rid\t\t\t\t= Integer.parseInt(params.get(\"rk\"));\n\t\t\tdouble st\t\t\t= Double.parseDouble(params.get(\"st\"));\n\t\t\tdouble et\t\t\t= Double.parseDouble(params.get(\"et\"));\n\t\t\tdouble west\t\t\t= Double.parseDouble(params.get(\"west\"));\n\t\t\tdouble east\t\t\t= Double.parseDouble(params.get(\"east\"));\n\t\t\tdouble south\t\t= Double.parseDouble(params.get(\"south\"));\n\t\t\tdouble north\t\t= Double.parseDouble(params.get(\"north\"));\n\t\t\tdouble minDepth\t\t= Double.parseDouble(params.get(\"minDepth\"));\n\t\t\tdouble maxDepth\t\t= Double.parseDouble(params.get(\"maxDepth\"));\n\t\t\tdouble minMag\t\t= Double.parseDouble(params.get(\"minMag\"));\n\t\t\tdouble maxMag\t\t= Double.parseDouble(params.get(\"maxMag\"));\n\t\t\tInteger minNPhases\t= Integer.parseInt(params.get(\"minNPhases\"));\n\t\t\tInteger maxNPhases\t= Integer.parseInt(params.get(\"maxNPhases\"));\n\t\t\tdouble minRMS\t\t= Double.parseDouble(params.get(\"minRMS\"));\n\t\t\tdouble maxRMS\t\t= Double.parseDouble(params.get(\"maxRMS\"));\n\t\t\tdouble minHerr\t\t= Double.parseDouble(params.get(\"minHerr\"));\n\t\t\tdouble maxHerr\t\t= Double.parseDouble(params.get(\"maxHerr\"));\n\t\t\tdouble minVerr\t\t= Double.parseDouble(params.get(\"minVerr\"));\n\t\t\tdouble maxVerr\t\t= Double.parseDouble(params.get(\"maxVerr\"));\n\t\t\tString rmk\t\t\t= params.get(\"rmk\");\n\t\t\tHypocenterList data = null;\n\t\t\ttry{\n\t\t\t\tdata = getHypocenterData(rid, st, et, west, east, south, north, minDepth, maxDepth, minMag, maxMag,\n\t\t\t\t\tminNPhases, maxNPhases, minRMS, maxRMS, minHerr, maxHerr, minVerr, maxVerr, rmk, getMaxRows());\n\t\t\t} catch (UtilException e){\n\t\t\t\treturn getErrorResult(e.getMessage());\n\t\t\t}\n\t\t\tif (data != null)\n\t\t\t\treturn new BinaryResult(data);\n\t\t}\n\t\treturn null;\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n LOG.debug(\"Received new update request\");\n \n String modelerName = request.getParameter(\"name\");\n String originalModelerName = request.getParameter(\"originalName\");\n String modelId = request.getParameter(\"modelId\");\n String modelType = request.getParameter(\"modeltype\");\n // Currently not being used since we don't update the modelVersion \n // String modelVersion = request.getParameter(\"version\");\n String originalModelVersion = request.getParameter(\"originalModelVersion\");\n String runIdent = request.getParameter(\"runIdent\");\n String originalRunIdent = request.getParameter(\"originalRunIdent\");\n String runDate = request.getParameter(\"creationDate\");\n String originalRunDate = request.getParameter(\"originalCreationDate\");\n String scenario = request.getParameter(\"scenario\");\n String originalScenario = request.getParameter(\"originalScenario\");\n String comments = request.getParameter(\"comments\");\n String originalComments = request.getParameter(\"originalComments\");\n String email = request.getParameter(\"email\");\n String wfsUrl = request.getParameter(\"wfsUrl\");\n String layer = request.getParameter(\"layer\");\n String commonAttr = request.getParameter(\"commonAttr\");\n Boolean updateAsBest = \"on\".equalsIgnoreCase(request.getParameter(\"markAsBest\")) ? Boolean.TRUE : Boolean.FALSE;\n Boolean rerun = Boolean.parseBoolean(request.getParameter(\"rerun\")); // If this is true, we only re-run the R processing \n \n String responseText;\n RunMetadata newRunMetadata;\n \n ModelType modelTypeEnum = null;\n if (\"prms\".equals(modelType.toLowerCase())) {\n modelTypeEnum = ModelType.PRMS;\n }\n if (\"afinch\".equals(modelType.toLowerCase())) {\n modelTypeEnum = ModelType.AFINCH;\n }\n if (\"waters\".equals(modelType.toLowerCase())) {\n modelTypeEnum = ModelType.WATERS;\n }\n if (\"sye\".equals(modelType.toLowerCase())) {\n modelTypeEnum = ModelType.SYE;\n }\n \n RunMetadata originalRunMetadata = new RunMetadata(\n modelTypeEnum,\n modelId,\n originalModelerName,\n originalModelVersion,\n originalRunIdent,\n originalRunDate,\n originalScenario,\n originalComments,\n email,\n wfsUrl,\n layer,\n commonAttr,\n updateAsBest);\n \n if (rerun) {\n String sosEndpoint = props.getProperty(\"watersmart.sos.model.repo\") + originalRunMetadata.getTypeString() + \"/\" + originalRunMetadata.getFileName();\n WPSImpl impl = new WPSImpl();\n String implResponse = impl.executeProcess(sosEndpoint, originalRunMetadata);\n Boolean processStarted = implResponse.toLowerCase().equals(\"ok\");\n responseText = \"{success: \"+processStarted.toString()+\", message: '\" + implResponse + \"'}\";\n } else {\n newRunMetadata = new RunMetadata(\n modelTypeEnum,\n modelId,\n modelerName,\n originalModelVersion,\n runIdent,\n runDate,\n scenario,\n comments,\n email,\n wfsUrl,\n layer,\n commonAttr,\n updateAsBest);\n \n CSWTransactionHelper helper = new CSWTransactionHelper(newRunMetadata, null, new HashMap<String, String>());\n try {\n String results = helper.updateRunMetadata(originalRunMetadata);\n // TODO- parse xml, make sure stuff happened alright, if so don't say success\n responseText = \"{success: true, msg: 'The record has been updated'}\";\n } catch (IOException ex) {\n responseText = \"{success: false, msg: '\" + ex.getMessage() + \"'}\";\n } catch (URISyntaxException ex) {\n responseText = \"{success: false, msg: '\" + ex.getMessage() + \"'}\";\n }\n \n }\n \n response.setContentType(\"application/json\");\n response.setCharacterEncoding(\"utf-8\");\n \n try {\n Writer writer = response.getWriter();\n writer.write(responseText);\n writer.close();\n } catch (IOException ex) {\n LOG.warn(\"An error occurred while trying to send response to client. \", ex);\n }\n \n }", "public QueryController(String[] args){\n // Parse Args\n QueryArgs queryArgs = new QueryArgs();\n try {\n queryArgs.parseArgs(args);\n } catch (FileNotFoundException e) {\n //e.printStackTrace();\n System.err.println(\"Invalid Arguments received. Please check your arguments passed to ./search\");\n return;\n }\n\n // Run the Term Normaliser\n TermNormalizer normalizer = new TermNormalizer();\n String[] queryTerms = normalizer.transformedStringToTerms(queryArgs.queryString);\n\n //create the model\n Model model = new Model();\n model.loadCollectionFromMap(queryArgs.mapPath);\n model.loadLexicon(queryArgs.lexiconPath);\n model.loadInvertedList(queryArgs.invlistPath);\n if(queryArgs.stopListEnabled)\n {\n model.loadStopList(queryArgs.stopListPath);\n }\n if(queryArgs.printSummary && queryArgs.collectionPath != \"\")\n {\n model.setPathToCollection(queryArgs.collectionPath);\n }\n\n\n //fetch the top results from the query module\n QueryModule queryModule = new QueryModule();\n queryModule.doQuery(queryTerms, model, queryArgs.bm25Enabled);\n List<QueryResult> topResults = queryModule.getTopResult(queryArgs.maxResults);\n\n\n\n ResultsView resultsView = new ResultsView();\n if(queryArgs.printSummary)\n {\n\n DocSummary docSummary = new DocSummary();\n for(QueryResult result:topResults)\n {\n // retrieve the actualy text from the document collection\n result.setDoc(model.getDocumentCollection().getDocumentByIndex(result.getDoc().getIndex(), true));\n\n //set the summary on the result object by fetching it from the docSummary object\n result.setSummaryNQB(docSummary.getNonQueryBiasedSummary(result.getDoc(), model.getStopListModule()));\n result.setSummaryQB(docSummary.getQueryBiasedSummary(result.getDoc(), model.getStopListModule(), Arrays.asList(queryTerms)));\n }\n resultsView.printResultsWithSummary(topResults,queryArgs.queryLabel);\n }else\n {\n resultsView.printResults(topResults,queryArgs.queryLabel);\n }\n\n }", "public void run() throws Exception {\n try {\n\t System.out.println(\"SSVD start!\");\n FileSystem fs = FileSystem.get(conf);\n\n Path qPath = new Path(outputPath, \"Q-job\");\n Path btPath = new Path(outputPath, \"Bt-job\");\n Path yPath = new Path(outputPath, \"Y-job\"); //tetst phase\n Path uHatPath = new Path(outputPath, \"UHat\");\n Path svPath = new Path(outputPath, \"Sigma\");\n Path uPath = new Path(outputPath, \"U\");\n Path vPath = new Path(outputPath, \"V\");\n\n if (overwrite) {\n fs.delete(outputPath, true);\n }\n\n\t int[] iseed = {0,0,0,1};\n\t double[] x = new double[1];\n\t Dlarnv.dlarnv(2,iseed,0,1,x,0);\n\t long seed = (long)(x[0]*(double)Long.MAX_VALUE);\n\n\t long start, end;\n\t \t\t\n\tstart = new Date().getTime();\n\tQJob.run(conf,\n inputPath,\n qPath.toString(),\n\t\treduceSchedule,\n k,\n p,\n seed,\n\t\tmis);\n\tend = new Date().getTime();\n\tSystem.out.println(\"Q-Job done \"+Long.toString(end-start));\n\tLogger LOG = LoggerFactory.getLogger(SSVDSolver.class);\n\t \n /*\n * restrict number of reducers to a reasonable number so we don't have to\n * run too many additions in the frontend when reconstructing BBt for the\n * last B' and BB' computations. The user may not realize that and gives a\n * bit too many (I would be happy i that were ever the case though).\n */\n\t \n start = new Date().getTime();\n\t BtJob.run(conf,\n inputPath,\n\t\t\t\tbtPath,\n\t\t\t\tqPath.toString(),\n\t\t\t\tk,\n p,\n outerBlockHeight,\n\t\t\t\tq <= 0 ? Math.min(1000, reduceTasks) : reduceTasks,\n\t\t\t\tq <= 0,\n\t\t\t\treduceSchedule,\n\t\t\t\tmis);\n\n\t end = new Date().getTime();\n System.out.println(\"Bt-Job done \"+Long.toString(end-start));\n\t \n // power iterations is unnecessary in application of recommendation system \t \n\t /*for (int i = 0; i < q; i++) {\n\t Path btPathGlob = new Path(btPath, BtJob.OUTPUT_BT + \"-*\");\n\t\tPath aBtPath = new Path(outputPath, String.format(\"ABt-job-%d\", i + 1)); \n qPath = new Path(outputPath, String.format(\"ABtQ-job-%d\", i + 1));\t\t\n ABtDenseOutJob.run(conf,\n inputPath,\n btPathGlob,\n aBtPath,//qPath,\n //ablockRows,\n //minSplitSize,\n k,\n p,\n //abtBlockHeight,\n reduceTasks,\n //broadcast\n\t\t\t\t\t\t mis);\n\t\t\n\t\tToolRunner.run(conf, new QRFirstJob(), new String[]{\n \"-input\", aBtPath.toString(),\n \"-output\", qPath.toString(),\n\t\t\t \"-mis\",Integer.toString(mis),\n\t\t\t \"-colsize\", Integer.toString(k+p),\n \"-reduceSchedule\", reduceSchedule});\n\t\t\t \n btPath = new Path(outputPath, String.format(\"Bt-job-%d\", i + 1));\n\n BtJob.run(conf,\n inputPath,\n\t\t\t\t btPath,\n qPath.toString(), \n k,\n p,\n outerBlockHeight,\n i == q - 1 ? Math.min(1000, reduceTasks) : reduceTasks,\n i == q - 1,\n\t\t\t\t reduceSchedule,\n\t\t\t\t mis);\n }*/\n\t \n cmUpperTriangDenseMatrix bbt =\n loadAndSumUpperTriangMatrices(fs, new Path(btPath, BtJob.OUTPUT_BBT\n + \"-*\"), conf);\n\n // convert bbt to something our eigensolver could understand\n assert bbt.numColumns() == k + p;\n\n double[][] bbtSquare = new double[k + p][];\n for (int i = 0; i < k + p; i++) {\n bbtSquare[i] = new double[k + p];\n }\n\n for (int i = 0; i < k + p; i++) {\n for (int j = i; j < k + p; j++) {\n bbtSquare[i][j] = bbtSquare[j][i] = bbt.get(i, j);\n }\n }\n\n svalues = new double[k + p];\n\n // try something else.\n EigenSolver eigenWrapper = new EigenSolver(bbtSquare);\n double[] eigenva2 = eigenWrapper.getWR();\n\t \n for (int i = 0; i < k + p; i++) {\n svalues[i] = Math.sqrt(eigenva2[i]); // sqrt?\n }\n // save/redistribute UHat\n double[][] uHat = eigenWrapper.getVL();\n\t //double[][] uHat = eigenWrapper.getUHat();\n\t \n fs.mkdirs(uHatPath);\n SequenceFile.Writer uHatWriter =\n SequenceFile.createWriter(fs,\n conf,\n uHatPath = new Path(uHatPath, \"uhat.seq\"),\n IntWritable.class,\n VectorWritable.class,\n CompressionType.BLOCK);\n\t \n int m = uHat.length;\n IntWritable iw = new IntWritable();\n VectorWritable vw = new VectorWritable();\n\t \n for (int i = 0; i < m; i++) {\n vw.set(new DenseVector(uHat[i],true));\n iw.set(i);\n uHatWriter.append(iw, vw);\n }\n\t uHatWriter.close();\n\n SequenceFile.Writer svWriter =\n SequenceFile.createWriter(fs,\n conf,\n svPath = new Path(svPath, \"svalues.seq\"),\n IntWritable.class,\n VectorWritable.class,\n CompressionType.BLOCK);\n\n vw.set(new DenseVector(svalues, true));\n svWriter.append(iw, vw);\n\n svWriter.close();\n\n\t start = new Date().getTime();\n UJob ujob = null;\t \n if (computeU) {\n ujob = new UJob();\n\t\tujob.start(conf,\n new Path(btPath, BtJob.Q_MAT+ \"-*\"),\n uHatPath,\n svPath,\n uPath,\n k,\n cUHalfSigma,\n\t\t\t\t mis);\t\t\t\t \n // actually this is map-only job anyway\n }\n\n VJob vjob = null;\n if (computeV) {\n vjob = new VJob();\n vjob.start(conf,\n new Path(btPath, BtJob.OUTPUT_BT + \"-*\"),\n uHatPath,\n svPath,\n vPath,\n k,\n reduceTasks,\n\t\t\t\t subRowSize,\n cVHalfSigma,\n\t\t\t\t mis);\n }\n\n if (ujob != null) {\n ujob.waitForCompletion();\n this.uPath = uPath.toString();\n }\n\t System.out.println(\"U-Job done \");\n\t \n if (vjob != null) {\n vjob.waitForCompletion();\n this.vPath = vPath.toString();\n }\n\tend = new Date().getTime();\n\tSystem.out.println(\"U-Job+V-Job done \"+(end-start));\n\t\n } catch (InterruptedException exc) {\n throw new IOException(\"Interrupted\", exc);\n } catch (ClassNotFoundException exc) {\n throw new IOException(exc);\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}", "protected void execute() {\n\t\tSystem.out.println(\"Vision error: \" + RobotMap.VisionDistanceLeftPIDController.getError() + \" , \" + RobotMap.VisionDistanceRightPIDController.getError());\n\t\tSystem.out.println(\"vision, pidcontroller output: \" + RobotMap.VisionDistanceLeftPIDController.get() + \" , \" + RobotMap.VisionDistanceRightPIDController.get());\n\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {\n\t\t/* make sure that this request is authenticated through the portal before proceeding */\n\t\tif (SecurityUtils.isPortalMode(request) && !SecurityUtils.isAuthenticated(request)) {\n\t\t\t/* not authenticated send not authorized status */\n\t\t\tresponse.sendError(HttpServletResponse.SC_FORBIDDEN);\n\t\t\treturn;\n\t\t}\n\n\t\t//get the run id\n\t\tString runIdString = request.getParameter(\"runId\");\n\t\t\n\t\tLong runId = null;\n\t\tString statusString = null;\n\t\t\n\t\ttry {\n\t\t\t//get the run id as a Long\n\t\t\trunId = new Long(runIdString);\n\t\t} catch(NumberFormatException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tif(runId != null) {\n\t\t\t//try to retrieve the run status for the run id\n\t\t\tRunStatus runStatus = RunStatus.getByRunId(runId);\n\t\t\t\n\t\t\tif(runStatus == null) {\n\t\t\t\t//the run status for the run id has not been created yet so we will create it\n\t\t\t\ttry {\n\t\t\t\t\t//create a JSONObject for the status\n\t\t\t\t\tJSONObject status = new JSONObject();\n\t\t\t\t\t\n\t\t\t\t\t//put the run id into the status\n\t\t\t\t\tstatus.put(\"runId\", runId);\n\t\t\t\t\t\n\t\t\t\t\t//get the status as a string\n\t\t\t\t\tstatusString = status.toString();\n\t\t\t\t\t\n\t\t\t\t\t//create the new run status\n\t\t\t\t\trunStatus = new RunStatus(runId, statusString);\n\t\t\t\t\trunStatus.saveOrUpdate();\n\t\t\t\t} catch (JSONException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//we have a run status so we will ge the status string\n\t\t\t\tstatusString = runStatus.getStatus();\n\t\t\t}\n\t\t} else {\n\t\t\t//run id is null so we will send an error\n\t\t\tresponse.sendError(HttpServletResponse.SC_BAD_REQUEST, \"\");\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t//write the status string to the response\n\t\t\tresponse.getWriter().print(statusString);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void main(String args[]){\n\t\tString uri;\r\n\t\ttry{\r\n\t\t\turi = args[0];\r\n\t\t\tSystem.out.print(\"LOADING....\");\r\n\t\t\tPhase2Search search = new Phase2Search(uri);\r\n\t\t\tSystem.out.println(\"COMPLETED\\n\");\r\n\t\t\t\r\n\t\t\tString query;\r\n\t\t\tboolean flag = false;\r\n\t\t\tdo{\r\n\t\t\t in = new Scanner(System.in);\r\n\t\t\t System.out.print(\"ENTER QUERY : \");\r\n\t\t\t query = in.nextLine();\r\n\t\t\t//query = \"roann indiana\";\r\n\t\t\t//query = \"imdb\";\r\n\t\t\t //query = \"aalburg\";\r\n\t\t\t System.out.println(\"QUERY: \" + query);\r\n\t\t\tdouble startTime = System.currentTimeMillis();\r\n\t\t\t\tsearch.searchFunc(query);\r\n\t\t\tdouble endTime = System.currentTimeMillis();\r\n\t\t\tdouble totalTime = endTime - startTime;\r\n\t\t\tSystem.out.println(\"SEARCH TIME : \"+ totalTime/1000 + \" sec\");\r\n\t\t\t\r\n\t\t\t System.out.print(\"Want another Query (1 for YES) : \");\r\n\t\t\t if(!(in.nextLine()).equalsIgnoreCase(\"1\")){\r\n\t\t\t\t flag = true;\r\n\t\t\t }\r\n\t\t\t}while(flag == false);\r\n//\t\t\t\r\n\t\t\tSystem.out.println();\r\n\t\t\t}\r\n\t\tcatch(ArrayIndexOutOfBoundsException e){\r\n\t\t\tSystem.out.println(\"EXCEPTION : Command Line Arguments are Missing.\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(\"EXCEPTION : Exception Occur.\");\r\n\t\t}\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n CORSFilter corsFilter = new CORSFilter();\n corsFilter.apply();\n Timer timer = new Timer();\n timer.schedule(new TimerTask() {\n @Override\n public void run() {\n System.out.println(\"Reindexing\");\n Thread t = new Thread(new HelperThread());\n t.start();\n }\n }, 0, REINDEX_TIMER);\n\n SearchEngine sE = new SearchEngine();\n Gson g = new Gson();\n // Get the person's name from the query string if available.\n Spark.get(\"/search/:query\", (req, res) -> {\n System.out.println(\"Got request: \" + req.params(\":query\"));\n res.type(\"text/html\");\n ArrayList<SearchEngine.SearchResult> result = sE.search(req.params(\":query\"));\n res.status(200);\n return g.toJson(result);\n });\n\n }", "@Override\r\n\tpublic int collect(Map<String, String> arguments) {\r\n\t\tinitialize(arguments);\r\n\t\tint count = 0;\r\n\r\n\t\t// Setup the authorization\r\n\t\tinitializeAuthorizationData();\r\n\r\n\t\tReportingServiceManager reportingManager = new ReportingServiceManager(authorizationData);\r\n\t\treportingManager.setStatusPollIntervalInMilliseconds(5000);\r\n\r\n\t\t// Setup the observable window range\r\n\t\tCalendar minRange = Calendar.getInstance();\r\n\t\tminRange.add(Calendar.HOUR, 0-lag-obsWindow);\r\n\t\tCalendar maxRange = Calendar.getInstance();\r\n\t\tmaxRange.add(Calendar.HOUR, 0-lag);\r\n\t\tLOG(\"Query range from: (\"+minRange.getTime()+\" - \"+maxRange.getTime()+\")\");\r\n\r\n\t\t// collect the data\r\n\t\t// do we load from offline or online source ?\r\n\t\tboolean bLoadFromFile = false;\r\n\t\tFile fromFile = null;\r\n\t\tif (loadFromFile != null) {\r\n\t\t\ttry {\r\n\t\t\t\tString[] files = loadFromFile.split(\";\");\r\n\t\t\t\tfromFile = new File(files[files.length-1]);\r\n\t\t\t\tbLoadFromFile = fromFile.exists() && fromFile.isFile();\r\n\t\t\t\tif (files.length > 1) {\r\n\t\t\t\t\tfor (int f = 0; f < files.length - 1; f++) {\r\n\t\t\t\t\t\tprocessFile(new File(files[f]), minRange, maxRange, false, false, null);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t} catch (Exception ea) {\r\n\t\t\t\tbLoadFromFile = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (!bLoadFromFile) {\r\n\t\t\t// Load From API (online)\r\n\t\t\t\r\n\t\t\t// 1. Prepare report request for AdPerformance\r\n\t\t\tReportRequest reportRequest = getAdReport(minRange, maxRange);\r\n\t\t\t// 2. Set Download options\r\n\t\t\tReportingDownloadParameters reportingDownloadParameters = new ReportingDownloadParameters();\r\n\t\t\treportingDownloadParameters.setReportRequest(reportRequest);\r\n\t\t\treportingDownloadParameters.setResultFileDirectory(new File(reportDirectory));\r\n\t\t\treportingDownloadParameters.setResultFileName(System.currentTimeMillis()+\"_AdReport.csv\");\r\n\t\t\treportingDownloadParameters.setOverwriteResultFile(true);\r\n\t\t\t// 3. Download report file from BingAds API (unfortunately Microsoft insists on using the file, there is no stream option)\r\n\t\t\t// We may optionally cancel the downloadFileAsync operation after a specified time interval.\r\n\t\t\tFile resultAdReportFile = null;;\r\n\t\t\ttry {\r\n\t\t\t\tresultAdReportFile = reportingManager.downloadFileAsync(\r\n\t\t\t\t\t\treportingDownloadParameters, \r\n\t\t\t\t\t\tnull).get(3600000, TimeUnit.MILLISECONDS);\r\n\r\n\t\t\t} catch (InterruptedException | ExecutionException | TimeoutException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// 4. Prepare the AdGroupPerformance request\r\n\t\t\treportRequest = getAdGroupReport(minRange, maxRange);\r\n\t\t\tFile resultAdGroupReportFile = null;\r\n\r\n\t\t\t// 5. Set Download options\r\n\t\t\treportingDownloadParameters.setReportRequest(reportRequest);\r\n\t\t\treportingDownloadParameters.setResultFileName(System.currentTimeMillis()+\"_AdGroupReport.csv\");\r\n\t\t\t\r\n\t\t\t// 6. Download the report file\r\n\t\t\ttry {\r\n\t\t\t\tresultAdGroupReportFile = reportingManager.downloadFileAsync(\r\n\t\t\t\t\t\treportingDownloadParameters, \r\n\t\t\t\t\t\tnull).get(3600000, TimeUnit.MILLISECONDS);\r\n\r\n\t\t\t} catch (InterruptedException | ExecutionException | TimeoutException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t\t// 7. prepare the DB\r\n\t\t\tinitializeMongoDb();\r\n\r\n\t\t\t// 8. process downloaded files\r\n\t\t\tList<Document> adList = new ArrayList<>(32);\r\n\t\t\tcount += processFile(resultAdReportFile, minRange, maxRange, true, true, adList);\r\n\t\t\tList<Document> adGroupList = new ArrayList<>(32);\r\n\t\t\tcount += processFile(resultAdGroupReportFile, minRange, maxRange, false, true, adGroupList);\r\n\t\t\t\r\n\t\t\tList<Document> allDocs = extrapolateHourlyPerformance(adList, adGroupList);\r\n\t\t\tinsertDocuments(allDocs);\r\n\t\t\t// 9. cleanup\r\n\t\t\tmongoClient.close();\r\n\t\t\tif (removeDownloadedReportFile) {\r\n\t\t\t\tif (resultAdReportFile != null) {\r\n\t\t\t\t\tresultAdReportFile.deleteOnExit();\r\n\t\t\t\t}\r\n\t\t\t\tif (resultAdGroupReportFile != null) {\r\n\t\t\t\t\tresultAdGroupReportFile.deleteOnExit();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\t// 1. Prepare DB\r\n\t\t\tinitializeMongoDb();\r\n\t\t\t\r\n\t\t\t// 2. load from provided offline file\r\n\t\t\tList<Document> adGroupList = new ArrayList<>(32);\r\n\t\t\tcount += processFile(fromFile, minRange, maxRange, false, true, null);\r\n\t\t\t\r\n\t\t\t// 3. cleanup\r\n\t\t\tmongoClient.close();\r\n\t\t}\r\n\t\treturn count;\r\n\t}", "@Override\n protected Void doInBackground(Void... params) {\n ValResult = Shell.SU.run(new String[]{\n \"wm density | grep \\\"Override\\\"\"\n });\n if(ValResult.isEmpty()){\n System.out.println(\"Entered in isEmpty\");\n ValResult = Shell.SU.run(new String[]{\n \"wm density | grep \\\"Physical\\\"\"\n });\n }\n System.out.println(\"validate density executed ==> \" + ValResult.get(0));\n return null;\n }", "String runAlgo(THost host, String classname, String param);" ]
[ "0.6259815", "0.6039069", "0.602213", "0.56774795", "0.5525936", "0.54511344", "0.54289716", "0.5352808", "0.53443545", "0.5274378", "0.51178414", "0.504778", "0.5044023", "0.5024277", "0.4984765", "0.4978124", "0.49609274", "0.4948181", "0.4945607", "0.494163", "0.49381205", "0.49364346", "0.4926855", "0.490298", "0.48984754", "0.4885541", "0.48796004", "0.48701483", "0.48422027", "0.4829175", "0.48235664", "0.47800517", "0.4779138", "0.47611064", "0.4754516", "0.47239754", "0.47051767", "0.47046688", "0.47015515", "0.46842968", "0.4678082", "0.46780124", "0.46756214", "0.4668915", "0.46648982", "0.46550068", "0.4639412", "0.4638555", "0.46345606", "0.461991", "0.46190587", "0.46161616", "0.46096203", "0.4601482", "0.45999458", "0.45937312", "0.45925784", "0.4592167", "0.45834112", "0.45834112", "0.45834112", "0.45834112", "0.45834112", "0.45834112", "0.45834112", "0.45816308", "0.45785263", "0.45719504", "0.4571942", "0.45707625", "0.45693973", "0.45618019", "0.45592704", "0.4558419", "0.45576286", "0.4551859", "0.45504948", "0.45460066", "0.45459276", "0.45431125", "0.45423138", "0.45389315", "0.45363587", "0.45358247", "0.45321438", "0.452395", "0.4520811", "0.45180675", "0.451599", "0.45159107", "0.45068184", "0.4506771", "0.45018843", "0.44973418", "0.44970495", "0.44959256", "0.44915807", "0.44865707", "0.44820002", "0.44763342" ]
0.6455646
0
utilitiy methods Returns the array of values that corresponds the order of provided keys
public static String[] getValueSet(Map<String, String> mp, String[] keys) { List<String> tmpvl = new ArrayList<String>(); for (int i=0; i< keys.length; i++){ tmpvl.add(mp.get(keys[i])); } String[] tmpv = (String[])tmpvl.toArray(new String[tmpvl.size()]); return tmpv; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Integer[] getKeys();", "Listof<Pairof<K, V>> sortedKeyVals();", "public List<V> getMergedValues(Set<K> keys){\r\n List<V> mergedValues = new LinkedList<>();\r\n for(Object k : keys){\r\n mergedValues.addAll(getValues(k));\r\n }\r\n return mergedValues;\r\n }", "Listof<K> sortedKeys();", "public String[] getKeys() {\n Set keySet;\n if( defaultValues != null ) {\n keySet = defaultValues.keySet();\n } else {\n keySet = values.keySet();\n }\n return ( String[] )keySet.toArray( new String[ keySet.size() ] );\n }", "public String[] getKeysWithVariants() {\n Set keySet = new HashSet( values.keySet() );\n if( defaultValues != null ) {\n keySet.addAll( defaultValues.keySet() );\n }\n keySet.addAll( cssValues.keySet() );\n return ( String[] )keySet.toArray( new String[ keySet.size() ] );\n }", "int[] getGivenByOrder();", "public K[] keys(){\n\t\tK[] output = (K[]) new Object[howMany];\n\t\tint j = 0;\n\t\tfor (int i = 0; keys.length > i; i++)\n\t\t\tif (keys[i] != null){\n\t\t\t\toutput[j] = keys[i];\n\t\t\t\tj = j + 1;\n\t\t\t}\n\t\treturn output;\n\t}", "@Override\n\tpublic Collection<V> values() {\n\t\tList<V> list = Util.newList();\n\t\tfor (K key : keys) {\n\t\t\tlist.add(map.get(key));\n\t\t}\n\t\t\n\t\treturn list;\n\t}", "public int[] keysToArray() {\n\t\tif (this.empty()) {\n\t\t\treturn new int[0];\n\t\t}\n\t\tint[] inOrderKeys = new int[this.size()];\n\t\tAVLNode node = this.findMin();\n\t\tint index = 0;\n\t\twhile (index != inOrderKeys.length) {\n\t\t\tinOrderKeys[index] = node.getKey();\n\t\t\tnode = this.findSuccessor(node);\n\t\t\tindex += 1;\n\t\t}\n\t\treturn inOrderKeys;\n\t}", "CACHE_ELEMENT[] get(Key ... keys);", "List<String> getKeys();", "T[] getValues();", "private Object[] getKeys(IntArray rawKey) {\n Object[] groupKeys = new Object[_numGroupByExpressions];\n for (int i = 0; i < _numGroupByExpressions; i++) {\n groupKeys[i] = getRawValue(i, rawKey._elements[i]);\n }\n return groupKeys;\n }", "public String[] sortedStringKeys() {\n Set<String> keys = stringPropertyNames();\n String[] os = keys.toArray(new String[0]);\n Arrays.sort(os);\n return os;\n }", "Object[] getValues();", "Object[] getValues();", "public Long[] allKeys() {\n\t\tLong[] result = new Long[super.getSize()];\n int ctr = 0;\n for(Entry<C> each : sequence) {\n result[ctr] = each.getKey();\n ctr++;\n }\n insertionSort(result);\n return result;\n }", "public String[] getStringArray(String key);", "public Listof<Pairof<K, V>> sortedKeyVals() {\n return this.bst.toSortedList().map(i -> new Pairof<>(i.left, i.right));\n }", "static int[] getInverseOrder(int[] values) {\n if (values == null) {\n return null;\n }\n\n int[] result = new int[values.length];\n for (int i = 0; i < values.length; i++) {\n result[values[i]] = i;\n }\n\n return result;\n }", "public Iterable<Key> keys();", "public Iterable<Key> keys();", "public int[] keysToArray() // return a sorted array of the tree's keys, using the recursion method keysToArray2\r\n {\r\n int[] arr = new int[root.sizen]; \r\n if (empty()) {\r\n return arr;\r\n }\r\n int index = 0;\r\n keysToArray2(this.root, arr, index);\r\n return arr;\r\n }", "Listof<V> sortedVals();", "public static void iSort(int[]keys, double[] values){\n for(int j = 0;j<keys.length;j++){\n int k = keys[j];\n double v = values[j];\n int i = j - 1;\n while((i>=0)&&(values[i]>v)){\n keys[i+1] = keys[i];\n values[i+1] = values[i];\n i--;\n }\n keys[i+1] = k;\n values[i+1] = v;\n }\n }", "public String[] fetchAllKeys();", "public Iterable<K> keys(K lo, K hi);", "Set<String> getKeys();", "Set<Pairof<K, V>> keyVals();", "public K[] getKeys() {\n return keys.clone();\n }", "private Object[] getKeys(int rawKey) {\n // Specialize single group-by column case\n if (_numGroupByExpressions == 1) {\n return new Object[]{_dictionaries[0].getInternal(rawKey)};\n } else {\n Object[] groupKeys = new Object[_numGroupByExpressions];\n for (int i = 0; i < _numGroupByExpressions; i++) {\n int cardinality = _cardinalities[i];\n groupKeys[i] = getRawValue(i, rawKey % cardinality);\n rawKey /= cardinality;\n }\n return groupKeys;\n }\n }", "public Iterable<K> keys();", "public abstract String[] getValues();", "public Object[] getValues();", "public KeySet getKeys();", "private Object[] getKeys(long rawKey) {\n Object[] groupKeys = new Object[_numGroupByExpressions];\n for (int i = 0; i < _numGroupByExpressions; i++) {\n int cardinality = _cardinalities[i];\n groupKeys[i] = getRawValue(i, (int) (rawKey % cardinality));\n rawKey /= cardinality;\n }\n return groupKeys;\n }", "List getValues();", "protected List<?> keysToIds (List<Key<T>> keys){\n \tArrayList ids = new ArrayList(keys.size()*2);\n \tfor(Key<T> key : keys)\n \t\tids.add(key.getId());\n \treturn ids;\n }", "String[] getPropertyKeys();", "public Object[] getObjects(String... keys) {\r\n\t\tList<Object> objects = new ArrayList<>();\r\n\t\t\r\n\t\tfor (String key:keys) {\r\n\t\t\tobjects.add(this.getObject(key));\r\n\t\t}\r\n\t\t\r\n\t\treturn objects.toArray();\r\n\t}", "public String[] getKeys(){\n int paddingCount = 1;\n List<String> result = new ArrayList<String>();\n String lastKey = null;\n for (Property x : this.getProperties()) {\n String newKey = new String(x.getKey());\n if (lastKey != null && lastKey.equalsIgnoreCase(newKey)){\n newKey = newKey + \"_\" + paddingCount++;\n }\n result.add(newKey);\n lastKey = newKey;\n }\n return result.toArray(new String[]{});\n }", "public String[] getSortConditionTable()\n\t{\n\t\tKey[] karray = new Key[_searchKeyList.size()] ;\n\n\t\t_searchKeyList.copyInto(karray) ;\n\t\tfor (int i = 0; i < karray.length; i++)\n\t\t{\n\t\t\tfor (int j = i; j < karray.length; j++)\n\t\t\t{\n\t\t\t\tif (karray[i].getTableOrder() > karray[j].getTableOrder())\n\t\t\t\t{\n\t\t\t\t\tKey ktmp = karray[i] ;\n\t\t\t\t\tkarray[i] = karray[j] ;\n\t\t\t\t\tkarray[j] = ktmp ;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tString stbf = \"\" ;\n\t\tVector vec = new Vector();\n\t\t\n\n\t\tfor (int i = 0; i < karray.length; i++)\n\t\t{\n\t\t\tif (karray[i].getTableOrder() > 0)\n\t\t\t{\n\t\t\t\tstbf = Integer.toString(karray[i].getTableOrder()) + \",\" + karray[i].getTableColumn() ;\n\t\t\t\t//#CM708962\n\t\t\t\t// The descending key word is set for the descending order. \n\t\t\t\tif (karray[i].getTableDesc() == false)\n\t\t\t\t{\n\t\t\t\t\tstbf = stbf + \" DESC\" ;\n\t\t\t\t}\n\t\t\t\tvec.addElement(stbf);\n\t\t\t}\n\t\t}\n\n\t\t//#CM708963\n\t\t// Return the content of Vector. \n\t\tString[] rStr = new String[vec.size()];\n\t\tvec.copyInto(rStr);\n\t\treturn rStr ;\n\t}", "public static <K, V extends Comparable<? super V>> List<Entry<K, V>> getMapSortedByValue(Map<K, V> map) {\r\n\t\tfinal int size = map.size();\r\n\t\tfinal List<Map.Entry<K, V>> list = new ArrayList<Map.Entry<K, V>>(size);\r\n\t\tlist.addAll(map.entrySet());\r\n\t\tfinal ValueComparator<V> cmp = new ValueComparator<V>();\r\n\t\tCollections.sort(list, cmp);\r\n\t\treturn list;\r\n\t\t/*\r\n\t\tfinal List<K> keys = new ArrayList<K>(size);\r\n\t\tfor (int i = 0; i < size; i++) {\r\n\t\t\tkeys.set(i, list.get(i).getKey());\r\n\t\t}\r\n\t\treturn keys;\r\n\t\t*/\r\n\t}", "public ArrayList<Integer> sortKeysByValue(HashMap<Integer, Double> hm) {\n List<Map.Entry<Integer, Double>> list = new LinkedList<Map.Entry<Integer, Double>>(hm.entrySet());\n\n Collections.sort(list, new Comparator<Map.Entry<Integer, Double>>() {\n @Override\n public int compare(Map.Entry<Integer, Double> o1, Map.Entry<Integer, Double> o2) {\n return (o2.getValue()).compareTo(o1.getValue());\n }\n });\n ArrayList<Integer> keys = new ArrayList<Integer>();\n for (Map.Entry<Integer, Double> i : list) {\n keys.add(i.getKey());\n }\n return keys;\n }", "@SuppressWarnings(\"Duplicates\")\n private IntArray[] getIntArrayRawKeys(int index) {\n IntArray[] rawKeys = null;\n\n // Before having to transform to array, use single value raw key for better performance\n int[] dictIds = new int[_numGroupByExpressions];\n\n for (int i = 0; i < _numGroupByExpressions; i++) {\n if (_isSingleValueColumn[i]) {\n int dictId = _singleValueDictIds[i][index];\n if (rawKeys == null) {\n dictIds[i] = dictId;\n } else {\n for (IntArray rawKey : rawKeys) {\n rawKey._elements[i] = dictId;\n }\n }\n } else {\n int[] multiValueDictIds = _multiValueDictIds[i][index];\n int numValues = multiValueDictIds.length;\n\n // Specialize multi-value column with only one value inside\n if (numValues == 1) {\n int dictId = multiValueDictIds[0];\n if (rawKeys == null) {\n dictIds[i] = dictId;\n } else {\n for (IntArray rawKey : rawKeys) {\n rawKey._elements[i] = dictId;\n }\n }\n } else {\n if (rawKeys == null) {\n rawKeys = new IntArray[numValues];\n for (int j = 0; j < numValues; j++) {\n int dictId = multiValueDictIds[j];\n rawKeys[j] = new IntArray(dictIds.clone());\n rawKeys[j]._elements[i] = dictId;\n }\n } else {\n int currentLength = rawKeys.length;\n int newLength = currentLength * numValues;\n IntArray[] newRawKeys = new IntArray[newLength];\n System.arraycopy(rawKeys, 0, newRawKeys, 0, currentLength);\n for (int j = 1; j < numValues; j++) {\n int offset = j * currentLength;\n for (int k = 0; k < currentLength; k++) {\n newRawKeys[offset + k] = new IntArray(rawKeys[k]._elements.clone());\n }\n }\n for (int j = 0; j < numValues; j++) {\n int startOffset = j * currentLength;\n int dictId = multiValueDictIds[j];\n int endOffset = startOffset + currentLength;\n for (int k = startOffset; k < endOffset; k++) {\n newRawKeys[k]._elements[i] = dictId;\n }\n }\n rawKeys = newRawKeys;\n }\n }\n }\n }\n\n if (rawKeys == null) {\n return new IntArray[]{new IntArray(dictIds)};\n } else {\n return rawKeys;\n }\n }", "public abstract List<String> getAllKeys();", "public K[] keySet() {\n MyStack<K> result = new MyStack<>();\n\n for (Object entry : this.table) {\n if (entry != null) {\n Entry<K, V> current = (Entry<K, V>) entry;\n\n while (current.hasNext()) {\n result.push(current.getKey());\n current = current.getNext();\n }\n result.push(current.getKey());\n }\n }\n return result.toArray();\n }", "public List<K> keys();", "@Override\r\n\tpublic ArrayList<String> getValues(String key) {\r\n\t\tArrayList<String> vals = meta.get(key); \r\n\r\n\t\t// May be multiple sampleIDs per key separated by commas\r\n\t\tif (key.equals(\"sampleIDs\")) {\r\n\t\t\tArrayList<String> newVals = new ArrayList<String>();\r\n\t\t\tfor (String v: vals) {\r\n\t\t\t\tString[] parts = v.split(\",\");\r\n\t\t\t\tfor (String p: parts) {\r\n\t\t\t\t\t// Duplicates may occur\r\n\t\t\t\t\tString pt = p.trim();\r\n\t\t\t\t\tif (newVals.contains(pt) == false) {\r\n\t\t\t\t\t\tnewVals.add(pt);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn newVals;\r\n\t\t}\r\n\r\n\t\treturn vals;\r\n\t}", "public String[] getStrings(String mkey) {\n\t\tString last;\n\t\tint i = 0;\n\t\tArrayList<String> v = new ArrayList<>();\n\t\twhile (true) {\n\t\t\tlast = getString(mkey + i);\n\t\t\ti++;\n\t\t\tif (last == null)\n\t\t\t\tbreak;\n\t\t\tv.add(last);\n\t\t}\n\t\tif (v.size() != 0) {\n\t\t\tString[] str = new String[v.size()];\n\t\t\treturn v.toArray(str);\n\t\t} else {\n\t\t\treturn (String[]) getDefault(mkey);\n\t\t}\n\t}", "protected abstract Map<String, Object> _getMulti(Set<String> keys);", "public static String[] toStringArray(final HashMap<String, Integer> syms) {\n return syms.keySet().toArray(new String[syms.size()]);\n }", "public List<String> getKeys(){\n return Collections.unmodifiableList(keys);\n }", "public Map<Integer, Integer> getAllSortedCommittedValues() {\n\n LinkedHashMap<Integer, Integer> sortedMap = new LinkedHashMap<>();\n variables.entrySet()\n .stream()\n .sorted(Map.Entry.comparingByKey())\n .forEachOrdered(x -> sortedMap.put(x.getKey(), x.getValue().getKey()));\n\n return sortedMap;\n }", "public int[] keysToArray()\r\n\t {\r\n\t\t if(this.size() == 0)\r\n\t\t {\r\n\t\t\t return new int[0];\r\n\t\t }\r\n\t\t int[] arr = new int[this.size()]; \r\n\t\t return this.root.keysToArray(arr, 0);\r\n\t }", "private double[] getKeyValues(Example example, Attribute[] keyAttributes) {\n\t\tint numKeys = keyAttributes.length;\n\t\tdouble[] keyValues = new double[numKeys];\n\t\tfor (int i = 0; i < numKeys; ++i) {\n\t\t\tkeyValues[i] = example.getValue(keyAttributes[i]);\n\t\t}\n\t\treturn keyValues;\n\t}", "String[] getParameterValues(String key);", "public List<String> getKeys()\n\t{\n\t\treturn new ArrayList<>(pairs.keySet());\n\t}", "public List<String> getElements() {\r\n List<String> result = new ArrayList<String>();\r\n if (order == null) {\r\n return result;\r\n }\r\n result.addAll(order.keySet());\r\n Collections.sort(result, new Comparator<String>(){\r\n @Override public int compare(String arg0, String arg1) {\r\n return order.get(arg0).compareTo(order.get(arg1));\r\n }\r\n });\r\n return result;\r\n }", "public String[] getValues()\n\t{\n\t\tString[] retArr = new String[values.size()];\n\n\t\tvalues.toArray(retArr);\n\n\t\treturn retArr;\n\t}", "public abstract ArrayList<Key> toArrayList();", "public int[] keySet() {\n objectCounter++;\n int[] keys = new int[contents];\n int cnt = 0;\n MapElement me = null;\n\n for (int i = 0; i < capacity; i++) {\n if (map[i] != null) {\n me = map[i];\n while (null != me) {\n keys[cnt++] = me.getKey();\n me = me.getNext();\n }\n }\n }\n return keys;\n }", "String[] supportedKeys();", "StringList keys();", "@SuppressWarnings(\"Duplicates\")\n private int[] getIntRawKeys(int index) {\n int[] rawKeys = null;\n\n // Specialize single multi-value group-by column case\n if (_numGroupByExpressions == 1) {\n rawKeys = _multiValueDictIds[0][index];\n } else {\n // Before having to transform to array, use single value raw key for better performance\n int rawKey = 0;\n\n for (int i = _numGroupByExpressions - 1; i >= 0; i--) {\n int cardinality = _cardinalities[i];\n if (_isSingleValueColumn[i]) {\n int dictId = _singleValueDictIds[i][index];\n if (rawKeys == null) {\n rawKey = rawKey * cardinality + dictId;\n } else {\n int length = rawKeys.length;\n for (int j = 0; j < length; j++) {\n rawKeys[j] = rawKeys[j] * cardinality + dictId;\n }\n }\n } else {\n int[] multiValueDictIds = _multiValueDictIds[i][index];\n int numValues = multiValueDictIds.length;\n\n // Specialize multi-value column with only one value inside\n if (numValues == 1) {\n int dictId = multiValueDictIds[0];\n if (rawKeys == null) {\n rawKey = rawKey * cardinality + dictId;\n } else {\n int length = rawKeys.length;\n for (int j = 0; j < length; j++) {\n rawKeys[j] = rawKeys[j] * cardinality + dictId;\n }\n }\n } else {\n if (rawKeys == null) {\n rawKeys = new int[numValues];\n for (int j = 0; j < numValues; j++) {\n int dictId = multiValueDictIds[j];\n rawKeys[j] = rawKey * cardinality + dictId;\n }\n } else {\n int currentLength = rawKeys.length;\n int newLength = currentLength * numValues;\n int[] newRawKeys = new int[newLength];\n for (int j = 0; j < numValues; j++) {\n int startOffset = j * currentLength;\n System.arraycopy(rawKeys, 0, newRawKeys, startOffset, currentLength);\n int dictId = multiValueDictIds[j];\n int endOffset = startOffset + currentLength;\n for (int k = startOffset; k < endOffset; k++) {\n newRawKeys[k] = newRawKeys[k] * cardinality + dictId;\n }\n }\n rawKeys = newRawKeys;\n }\n }\n }\n }\n\n if (rawKeys == null) {\n rawKeys = new int[]{rawKey};\n }\n }\n\n return rawKeys;\n }", "public Set<v> getValues(k key) {\n\t\tint b = hash(key);\n\t\tNode<k,v> curr = buckets[b];\n\t\tSet<v> resultSet = new HashSet<v>();\n\t\t\n\t\twhile (curr != null) {\n\t\t\tif (curr.getKey().equals(key))\n\t\t\t\tresultSet.add(curr.getValue());\t\t\t\n\t\t\tcurr = curr.getNext();\n\t\t}\n\t\treturn resultSet;\n\t}", "private List<Object> naturalKeyValues() {\n\t\ttry {\n\t\t\tfinal List<Method> methods = keyGetters();\n\t\t\tfinal List<Object> values=new ArrayList<>(methods.size());\n\t\t\tfor(final Method method:methods) {\n\t\t\t\tvalues.add(method.invoke(this));\n\t\t\t}\n\t\t\treturn values;\n\t\t} catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {\n\t\t\tthrow new EntityException(e);\n\t\t}\n\t}", "@Override\n public Map<String, List<PairModel>> getPairValues(String[] keyArr) {\n return null;\n }", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\t\t\t\t@Override\n\t\t\t\tpublic List getSortKeys() {\n\t\t\t\t\treturn sortKeys.stream().filter(x -> x.getSortOrder() != SortOrder.UNSORTED)\n\t\t\t\t\t\t\t.collect(Collectors.toList());\n\n\t\t\t\t}", "public static List<KeyValue<String, String>> getAllKeyValues() {\n return keyValueList;\n }", "public List<ValueAndInfo> getOrderedValues(String betokened) {\n return getOrderedValues(betokened, new Resolver() {\n public String resolveToken(String token) {\n return tokenToResolved.get(token);\n }\n });\n }", "static int[] getContiguousOrder(int[] values) {\n if (values != null) {\n return computeContiguousOrder(values, 0, values.length);\n }\n\n return null;\n }", "public List<NeonKey> getKeys();", "public UnsortedList<Integer> listOfKeys() {\n\t\tUnsortedList<Integer> list \n\t\t= new UnsortedList<Integer>(new IntegerComparator());\n\t\treturn listOfKeys(list);\n\t}", "public Iterable<String> getPropertyKeys();", "Set<K> keys();", "private static String[] getNewArray(HashMap listas){\n ArrayList<String> result = new ArrayList<String>();\n for (int i = 0; i< listas.size(); i++ ){\n String key = \"L\" + i;\n ArrayList<String> itemsList = (ArrayList<String>) listas.get(key);\n result.addAll(itemsList);\n }\n return result.toArray(new String[0]);\n }", "public static <K, V extends Comparable<V>>\n List<Map.Entry<K, V>> entriesSortedByValues(Map<K, V> map) {\n\n List<Map.Entry<K, V>> entryList = new ArrayList<>(map.entrySet());\n entryList.sort((e1, e2) -> e2.getValue().compareTo(e1.getValue()));\n\n return entryList;\n }", "public Set<Pairof<K, V>> keyVals() {\n return this.bst.toSortedList().toset().map(i -> new Pairof<>(i.left, i.right));\n }", "@MethodSource\n\tstatic List<Arguments> keyPairs() {\n\t\t// m/44'/0'/0'/0/0 ~ 5:\n\t\treturn List.of(\n\t\t\t\t// L4c1iSf8e3gW3rEAbKktLhbCFuCWnFfVfsgQW26c6QoaHQGwthCG\n\t\t\t\tArguments.of(\"dc55bc0cbde942349d563b3f845f6fcec7362173442b27b70ae7b20d13325a82\",\n\t\t\t\t\t\t\"L4c1iSf8e3gW3rEAbKktLhbCFuCWnFfVfsgQW26c6QoaHQGwthCG\",\n\t\t\t\t\t\t\"02859a42554b255917b971c6d0e322651db76d8e33b7e6686b345f22e57048c750\",\n\t\t\t\t\t\t\"1KNdhXP6ZVPzEDBXtEfcJM8YcYiR4Ni8Qo\"),\n\t\t\t\t// KwUefgTV5FEmMkHtXteAPzNgmj26ayTTyZ5MuNMCC2mzUW14A7tD\n\t\t\t\tArguments.of(\"07af74bc9c0b73d84c24b2de0f82babcb8c208d142539c0776e5e29d9472cfe8\",\n\t\t\t\t\t\t\"KwUefgTV5FEmMkHtXteAPzNgmj26ayTTyZ5MuNMCC2mzUW14A7tD\",\n\t\t\t\t\t\t\"02bb6ae99eed56005ed7a49dfd0ba540f4592f050d8cb2bb9f6aa1c10d643d5362\",\n\t\t\t\t\t\t\"1CczufdcQFberpwi6umLA4aUShuWRV7BB8\"),\n\t\t\t\t// Ky2PYhNC7qs4SEBTQP6dAVozEQfu153CCn2Bd4BDAAoh1drYxSDQ\n\t\t\t\tArguments.of(\"35d9c595f126e0d3876609f46b274a24400cbbd82a61078178a4926d997d3b1a\",\n\t\t\t\t\t\t\"Ky2PYhNC7qs4SEBTQP6dAVozEQfu153CCn2Bd4BDAAoh1drYxSDQ\",\n\t\t\t\t\t\t\"03b91d0a4de9b893eb6f3693088540807a73467b82b1d370ba7e90b4d8dc675767\",\n\t\t\t\t\t\t\"12udDTnX1EhUa9YuQG3Qhto4VFaj4xD9Xy\"),\n\t\t\t\t// KxtiC1y1Nr1sRcFvyYJA1A3Vx3yzVyLfwf6kZwuNBrqNnY2b1a3W\n\t\t\t\tArguments.of(\"31e6890a53ff64e82ceffac238aa435e488ce552644693def445b80051da634f\",\n\t\t\t\t\t\t\"KxtiC1y1Nr1sRcFvyYJA1A3Vx3yzVyLfwf6kZwuNBrqNnY2b1a3W\",\n\t\t\t\t\t\t\"0254a58625017dd7339b17cd7d2a8468d28cfa0dcf5e3eee9198d776cd0faf0ad7\",\n\t\t\t\t\t\t\"14dMxhd2566hmtB4Q5hcPSiyiKpnCgR4RG\"),\n\t\t\t\t// Kwn2ofhF63ahDEU8LxsWAxP1BTrL9DLRgKY9vgeyMdJCEktwke34\n\t\t\t\tArguments.of(\"10a08e554cff37443a29e659feeb921d966baf4e4c079152f13820e31081e534\",\n\t\t\t\t\t\t\"Kwn2ofhF63ahDEU8LxsWAxP1BTrL9DLRgKY9vgeyMdJCEktwke34\",\n\t\t\t\t\t\t\"03ff345b530f24877f4db5405202497af5a263fe7ba0646444ef56f930eebd07a3\",\n\t\t\t\t\t\t\"1F1A5DFkrPiCZFSZLF6ocTAiarv5gFr4JW\"),\n\t\t\t\t// L26HpKaVXifDTEn11L4pQ7WJ2ZPY7jagyWsdQBrKZZW9cx1jXLTs\n\t\t\t\tArguments.of(\"915eaa2b553d7e4c8dd9823be0d0897cbb819ce5dd9bfc9eaa3142c527ec69a6\",\n\t\t\t\t\t\t\"L26HpKaVXifDTEn11L4pQ7WJ2ZPY7jagyWsdQBrKZZW9cx1jXLTs\",\n\t\t\t\t\t\t\"039ab753a8481d965af517e2c01db595b539398052404bc077ff798b8ddce49c94\",\n\t\t\t\t\t\t\"1CWHy4hSWz4YDjqYKpDMTopRkxuWMy84mp\"));\n\t}", "List<DTOKeyPair> getStochasticKeys();", "@Override\r\n\tpublic Collection<V> values() {\r\n\t\tCollection<V> valueList = new ArrayList<V>();\r\n\t\tfor (Object o : buckets) {\r\n\t\t\tBucket b = (Bucket) o;\r\n\t\t\tvalueList.addAll(b.values());\r\n\t\t}\r\n\t\treturn valueList;\r\n\t}", "public Iterable<String> getKeys(String keyPrefix);", "public Vector keys() {\n Vector<K> temp = new Vector<>(3);\n for (int i=0;i<this.count;i++) {\n DictionaryPair p = list.get(i);//(DictionaryPair) data.get(i);\n temp.addLast(p.getKey());\n }\n return temp;\n }", "public Iterable<Key> keys() {\n Queue<Key> queue = new Queue<Key>();\n for (int i = 0; i < m; i++) {\n for (Key key : st[i].keys())\n queue.enqueue(key);\n }\n return queue;\n }", "public long[] getAgentIds(String key);", "public Collection<String> getValues(String key) {\n\t\tfinal Collection<String> values = new ArrayList<>();\n\t\tfinal Iterator<Map.Entry<String, String>> iter = entries.iterator();\n\t\twhile (iter.hasNext()) {\n\t\t\tfinal Map.Entry<String, String> entry = iter.next();\n\t\t\tif (entry.getKey().equals(key)) {\n\t\t\t\tvalues.add(entry.getValue());\n\t\t\t}\n\t\t}\n\t\treturn values;\n\t}", "static List<Integer> getTestKeys() {\n var list = Arrays.asList(3, 8, 1, 9, 2, 4, 0, 5);\n\n return list;\n }", "public List<K> sortedKeyList() {\n return sortedKeyList( false );\n }", "public V[] values() {\n MyStack<V> result = new MyStack<>();\n\n for (Object entry : this.table) {\n if (entry != null) {\n Entry<K, V> current = (Entry<K, V>) entry;\n\n while (current.hasNext()) {\n result.push(current.getValue());\n current = current.getNext();\n }\n result.push(current.getValue());\n }\n }\n return result.toArray();\n }", "public String[] key_Array_list_rule() {\n String[] key_Array_list = {\"时间\", \"地点\", \"分类\"};\n return key_Array_list;\n }", "public Field[] getKeyFields();", "private int[] genKeys() {\n HashSet<Integer> set = new HashSet<Integer>();\n HashSet<int[]> next = new HashSet<int[]>();\n rowKeys = new HashMap<Integer, Integer>();\n int[] rowKeys2combo = new int[keySize];\n\n // 1st set starts with 0004, 0040, 0400, 4000\n int counter = 0;\n int key;\n for (int i = 0; i < rowSize; i++) {\n int[] temp = new int[rowSize];\n temp[i] = rowSize;\n key = rowCombo2Key(temp);\n rowKeys2combo[counter] = key;\n rowKeys.put(key, counter++);\n set.add(key);\n next.add(temp);\n }\n\n while (next.size() > 0) {\n HashSet<int[]> expand = next;\n next = new HashSet<int[]>();\n for (int[] combo : expand) {\n for (int i = 0; i < rowSize; i++) {\n if (combo[i] > 0) {\n for (int j = 0; j < rowSize; j++) {\n if (i != j) {\n int[] shift = new int[rowSize];\n System.arraycopy(combo, 0, shift, 0, rowSize);\n shift[i] = combo[i] - 1;\n shift[j] = combo[j] + 1;\n key = rowCombo2Key(shift);\n if (!set.contains(key)) {\n rowKeys2combo[counter] = key;\n rowKeys.put(key, counter++);\n set.add(key);\n next.add(shift);\n }\n }\n }\n }\n }\n }\n }\n\n final int splitIdx = counter;\n\n // 2nd set starts with 0003, 0030, 0300, 3000\n for (int i = 0; i < rowSize; i++) {\n int[] temp = new int[rowSize];\n temp[i] = rowSize - 1;\n key = rowCombo2Key(temp);\n rowKeys2combo[counter] = key;\n rowKeys.put(key, counter++);\n set.add(key);\n next.add(temp);\n }\n\n while (next.size() > 0) {\n HashSet<int[]> expand = next;\n next = new HashSet<int[]>();\n for (int[] combo : expand) {\n for (int i = 0; i < rowSize; i++) {\n if (combo[i] > 0) {\n for (int j = 0; j < rowSize; j++) {\n if (i != j) {\n int[] shift = new int[rowSize];\n System.arraycopy(combo, 0, shift, 0, rowSize);\n shift[i] = combo[i] - 1;\n shift[j] = combo[j] + 1;\n key = rowCombo2Key(shift);\n if (!set.contains(key)) {\n rowKeys2combo[counter] = key;\n rowKeys.put(key, counter++);\n set.add(key);\n next.add(shift);\n }\n }\n }\n }\n }\n }\n }\n return genKeyLink(splitIdx, rowKeys2combo);\n }", "@Override\n public Set keySet() {\n OmaLista palautettava = new OmaLista();\n\n for (int i = 0; i < this.values.length; i++) {\n if (this.values[i] != null) {\n for (int z = 0; z < this.values[i].size(); z++) {\n palautettava.add(this.values[i].value(z).getKey());\n }\n }\n }\n\n return palautettava;\n }", "Lista<K> keySet();", "@Override\n public int[] toArray() {\n int[] result = new int[size];\n Entry tmp = first;\n for (int i = 0; i < size; i++) {\n result[i] = tmp.value;\n tmp = tmp.next;\n }\n return result;\n }", "public IArtifactKey[] getArtifactKeys() {\n \t\tHashSet result = new HashSet(artifactDescriptors.size());\n \t\tfor (Iterator it = artifactDescriptors.iterator(); it.hasNext();)\n \t\t\tresult.add(((IArtifactDescriptor) it.next()).getArtifactKey());\n \t\treturn (IArtifactKey[]) result.toArray(new IArtifactKey[result.size()]);\n \t}", "public String[] getKeys() {\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}" ]
[ "0.66330713", "0.6354218", "0.624362", "0.62191635", "0.61964506", "0.6127242", "0.60940593", "0.6066445", "0.6031617", "0.5965885", "0.58465546", "0.5845037", "0.58350617", "0.5830394", "0.5816055", "0.57947856", "0.57947856", "0.57769686", "0.576046", "0.57354623", "0.57234", "0.5671235", "0.5671235", "0.5667734", "0.56625515", "0.5652055", "0.562601", "0.56117743", "0.56115085", "0.553964", "0.5535862", "0.55231726", "0.5509163", "0.55045444", "0.5498952", "0.5491159", "0.54883343", "0.5486362", "0.54832745", "0.5472999", "0.5455206", "0.5451211", "0.5449372", "0.542927", "0.5416457", "0.53969866", "0.53846747", "0.53745675", "0.53705025", "0.53704304", "0.53698885", "0.5331654", "0.5316752", "0.53149015", "0.5311606", "0.53015685", "0.52974045", "0.5278209", "0.527679", "0.5270707", "0.5259072", "0.52578324", "0.5230959", "0.5215635", "0.5215038", "0.5209725", "0.5199347", "0.5196638", "0.5191655", "0.5185912", "0.51808226", "0.5177705", "0.51673186", "0.5138956", "0.51159686", "0.51156116", "0.51105064", "0.5109725", "0.5105514", "0.5101183", "0.509778", "0.5079048", "0.50693893", "0.5068273", "0.5063469", "0.50573206", "0.50520897", "0.50515467", "0.5049286", "0.5049165", "0.50489444", "0.50451326", "0.5044003", "0.5038845", "0.5038803", "0.50326633", "0.50278103", "0.5027367", "0.5004136", "0.5001335" ]
0.66484207
0
Handles a downloading request
public Map<String, String> runDownloadRequest(DvnRJobRequest sro, RConnection c){ String optionBanner = "########### downloading option ###########\n"; dbgLog.fine(optionBanner); historyEntry.add(optionBanner); Map<String, String> sr = new HashMap<String, String>(); sr.put("requestdir", requestdir); sr.put("option", "download"); String RcodeFile = "Rcode." + PID + ".R"; try { // create a temp dir String createTmpDir = "dir.create('"+wrkdir +"')"; dbgLog.fine("createTmpDir="+createTmpDir); historyEntry.add(createTmpDir); c.voidEval(createTmpDir); String dwnldOpt = sro.getDownloadRequestParameter(); String dwnldFlxt = dwlndParam.get(dwnldOpt); sr.put("format", dwnldFlxt); String dataFileName = "Data." + PID + "." + dwnldFlxt; sr.put("subsetfile", "/"+requestdir+ "/" +dataFileName); // data file to be copied back to the dvn String dsnprfx = wrkdir + "/" + dataFileName; String univarDataDwnld = "univarDataDwnld(dtfrm=x,"+ "dwnldoptn='"+dwnldOpt+"'"+ ", dsnprfx='"+dsnprfx+"')"; dbgLog.fine("univarDataDwnld="+univarDataDwnld); historyEntry.add(univarDataDwnld); c.voidEval(univarDataDwnld); int wbFileSize = getFileSize(c,dsnprfx); dbgLog.fine("wbFileSize="+wbFileSize); // write back the data file to the dvn String dtflprefix = "tmpDataFile"; File dtfl = writeBackFileToDvn(c, dsnprfx, dtflprefix, dwlndParam.get(dwnldOpt), wbFileSize); if (dtfl != null){ sr.put("wbDataFileName", dtfl.getAbsolutePath()); dbgLog.fine("wbDataFileName="+dtfl.getAbsolutePath()); } else { dbgLog.fine("wbDataFileName is null"); } // save workspace String objList = "objList<-ls()"; dbgLog.fine("objList="+objList); c.voidEval(objList); String RdataFileName = "Rworkspace."+PID+".RData"; sr.put("Rdata", "/"+requestdir+ "/" + RdataFileName); String saveWS = "save(list=objList, file='"+wrkdir +"/"+ RdataFileName +"')"; dbgLog.fine("save the workspace="+saveWS); c.voidEval(saveWS); // write back the R workspace to the dvn String wrkspFileName = wrkdir +"/"+ RdataFileName; dbgLog.fine("wrkspFileName="+wrkspFileName); int wrkspflSize = getFileSize(c,wrkspFileName); File wsfl = writeBackFileToDvn(c, wrkspFileName, RWRKSP_FILE_PREFIX ,"RData", wrkspflSize); if (wsfl != null){ sr.put("wrkspFileName", wsfl.getAbsolutePath()); dbgLog.fine("wrkspFileName="+wsfl.getAbsolutePath()); } else { dbgLog.fine("wrkspFileName is null"); } // command history String[] ch = (String[])historyEntry.toArray(new String[historyEntry.size()]); c.assign("ch", new REXPString(ch)); String saveRcodeFile = "cat(file='"+ wrkdir +"/"+ RcodeFile +"',paste(ch,collapse='\n'))"; dbgLog.fine(saveRcodeFile); c.voidEval(saveRcodeFile); // tab data file String mvTmpTabFile = "file.rename('"+ tempFileName +"','"+ tempFileNameNew +"')"; c.voidEval(mvTmpTabFile); dbgLog.fine("move temp file="+mvTmpTabFile); // move the temp dir to the web-temp root dir String mvTmpDir = "file.rename('"+wrkdir+"','"+webwrkdir+"')"; dbgLog.fine("web-temp_dir="+mvTmpDir); c.voidEval(mvTmpDir); } catch (RserveException rse) { rse.printStackTrace(); sr.put("RexecError", "true"); return sr; } sr.put("RexecError", "false"); return sr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void download() {\n }", "void onDownloadComplete(EzDownloadRequest downloadRequest);", "@Override\r\n\tpublic void download() {\n\t\t\r\n\t}", "void downloadingFile(String path);", "protected void download() {\r\n\t\tsetState(DOWNLOADING);\r\n\t\t\r\n\t\tThread t = new Thread(this);\r\n\t\tt.start();\r\n\t}", "public void downloadStarted();", "private synchronized void executeDownload(DownloadRequest request, String downloadUrl) {\n HttpURLConnection conn = null;\n URL url;\n InputStream inputStream = null;\n RandomAccessFile randomAccessFile;\n\n try {\n url = new URL(downloadUrl);\n long localFileLength = FileUtils.getLocalFileSize(getFullFileName());\n long remoteFileLength = fileTotalSize;\n\n // 远程文件不存在\n if (remoteFileLength == -1l) {\n // Log.log(\"下载文件不存在...\");\n updateDownloadFailed(request, DownloadManager.ERROR_UNHANDLED_HTTP_CODE, \"Remote file not found\");\n return;\n }\n\n request.setFileFullName(getFullFileName());\n randomAccessFile = new RandomAccessFile(getFullFileName(), \"rwd\");\n\n\n conn = (HttpURLConnection) url.openConnection();\n conn.setInstanceFollowRedirects(false);\n conn.setConnectTimeout(request.getRetryPolicy().getCurrentTimeout());\n conn.setReadTimeout(request.getRetryPolicy().getCurrentTimeout());\n conn.setRequestMethod(\"GET\");\n\n // 本地文件存在\n randomAccessFile.seek(localFileLength);\n conn.setRequestProperty(\"Range\", \"bytes=\"\n + localFileLength + \"-\" + remoteFileLength);\n\n inputStream = conn.getInputStream();\n\n\n HashMap<String, String> customHeaders = request.getCustomHeaders();\n if (customHeaders != null) {\n for (String headerName : customHeaders.keySet()) {\n conn.addRequestProperty(headerName, customHeaders.get(headerName));\n }\n }\n\n // Status Connecting is set here before\n // urlConnection is trying to connect to destination.\n updateDownloadState(request, DownloadManager.STATUS_CONNECTING);\n\n final int responseCode = conn.getResponseCode();\n\n DownLoadLog.v(\"Response code obtained for downloaded Id \"\n + request.getDownloadId()\n + \" : httpResponse Code \"\n + responseCode);\n\n switch (responseCode) {\n case HTTP_PARTIAL:\n case HTTP_OK:\n shouldAllowRedirects = false;\n if (fileTotalSize > 1) {\n transferData(request, inputStream, randomAccessFile);\n } else {\n updateDownloadFailed(request, DownloadManager.ERROR_DOWNLOAD_SIZE_UNKNOWN, \"Transfer-Encoding not found as well as can't know size of download, giving up\");\n }\n break;\n case HTTP_MOVED_PERM:\n case HTTP_MOVED_TEMP:\n case HTTP_SEE_OTHER:\n case HTTP_TEMP_REDIRECT:\n // Take redirect url and call executeDownload recursively until\n // MAX_REDIRECT is reached.\n while (mRedirectionCount < MAX_REDIRECTS && shouldAllowRedirects) {\n mRedirectionCount++;\n DownLoadLog.v(TAG, \"Redirect for downloaded Id \" + request.getDownloadId());\n final String location = conn.getHeaderField(\"Location\");\n executeDownload(request, location);\n }\n\n if (mRedirectionCount > MAX_REDIRECTS && shouldAllowRedirects) {\n updateDownloadFailed(request, DownloadManager.ERROR_TOO_MANY_REDIRECTS, \"Too many redirects, giving up\");\n return;\n }\n break;\n case HTTP_REQUESTED_RANGE_NOT_SATISFIABLE:\n updateDownloadFailed(request, HTTP_REQUESTED_RANGE_NOT_SATISFIABLE, conn.getResponseMessage());\n break;\n case HTTP_UNAVAILABLE:\n updateDownloadFailed(request, HTTP_UNAVAILABLE, conn.getResponseMessage());\n break;\n case HTTP_INTERNAL_ERROR:\n updateDownloadFailed(request, HTTP_INTERNAL_ERROR, conn.getResponseMessage());\n break;\n default:\n updateDownloadFailed(request, DownloadManager.ERROR_UNHANDLED_HTTP_CODE, \"Unhandled HTTP response:\" + responseCode + \" message:\" + conn.getResponseMessage());\n break;\n }\n } catch (SocketTimeoutException e) {\n e.printStackTrace();\n // Retry.\n attemptRetryOnTimeOutException(request);\n } catch (ConnectTimeoutException e) {\n e.printStackTrace();\n attemptRetryOnTimeOutException(request);\n } catch (IOException e) {\n e.printStackTrace();\n updateDownloadFailed(request, DownloadManager.ERROR_HTTP_DATA_ERROR, \"IOException \" + e.getMessage());\n } finally {\n if (conn != null) {\n conn.disconnect();\n }\n }\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (ClassNotFoundException ex) {\r\n Logger.getLogger(download.class.getName()).log(Level.SEVERE, null, ex);\r\n } catch (SQLException ex) {\r\n Logger.getLogger(download.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "private void startDownload(){\n final DownloadCurrent downloadCurrent = new DownloadCurrent(this);\n downloadCurrent.execute(UpdateTalesData.sData_HTTP);\n sProgDialDownload.setOnCancelListener(new DialogInterface.OnCancelListener() {\n @Override\n public void onCancel(DialogInterface dialog) {\n downloadCurrent.cancel(true);\n }\n });\n\n }", "void fileDownloaded(String path);", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (ClassNotFoundException ex) {\r\n Logger.getLogger(download.class.getName()).log(Level.SEVERE, null, ex);\r\n } catch (SQLException ex) {\r\n Logger.getLogger(download.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "@Override\n @RequestMapping(\"download.feep\")\n public void download(HttpServletRequest request, HttpServletResponse response) throws FeepControllerException {\n\n }", "public void download() {\r\n\t\t\ttThread = new Thread(this);\r\n\t\t\ttThread.start();\r\n\t\t}", "void download(SearchResult result, String downloadPath);", "@Override\n public void passDownloadRequest(DownloadReq downloadReq) {\n\n// if (searchRequest.getCredential().getIp() == node.getCredential().getIp() && searchRequest.getCredential().getPort() == node.getCredential().getPort()) {\n if (downloadReq.getCred().equals(node.getCred())) {\n return; // search query loop has eliminated\n }\n List<String> mySearchResults = checkFilesInFileList(downloadReq.getFileName(), node.getFileList());\n\n File file = node.getDownloadTable().get(mySearchResults.get(0));\n\n DownloadRes downloadRes = new DownloadRes(downloadReq.getCred(), downloadReq.getFileName(), file.getFileHash(), file.getFileSize());\n downloadOk(downloadRes);\n }", "public CompletionStage<Result> download()\n {\n IRequestValidator requestValidator=new CertDownloadRequestValidator();\n return handleRequest(request(),requestValidator, JsonKeys.CERT_DOWNLOAD);\n }", "@Override\n public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype,\n long contentLength) {\n }", "@Override\n public void run() {\n downloadInfo.state = STATE_DOWNLOADING;\n notifyStateChange(downloadInfo);\n\n //6.specific download, two kinds of education\n // re-download and resume downloads\n Request request;\n File file = new File(downloadInfo.path);\n if (!file.exists() || file.length() != downloadInfo.currentLength) {\n //file is not exists, or file size in downloadInfo saved inconsistent\n //the file is invalid\n file.delete();\n downloadInfo.currentLength = 0;\n\n //need to re-download\n String url = String.format(Url.APP_DOWNLOAD, downloadInfo.downloadUrl);\n request = new Request.Builder().url(url).build();\n } else {\n //need to resume download\n String url = String.format(Url.APP_BREAK_DOWNLOAD, downloadInfo.downloadUrl, downloadInfo.currentLength);\n request = new Request.Builder().url(url).build();\n }\n\n Response response = null;\n InputStream is = null;\n FileOutputStream fos = null;\n\n try {\n response = okHttpClient.newCall(request).execute();\n is = response.body().byteStream();\n\n if (response != null && is != null) {\n fos = new FileOutputStream(file, true);\n\n byte[] buffer = new byte[1024 * 8];\n int len = -1;\n while ((len = is.read(buffer)) != -1 && downloadInfo.state == STATE_DOWNLOADING) {\n fos.write(buffer, 0, len);\n fos.flush();\n\n downloadInfo.currentLength = downloadInfo.currentLength + len;\n notifyProgressChange(downloadInfo);\n }\n } else {\n //the server return an error\n downloadInfo.state = STATE_ERROR;\n downloadInfo.currentLength = 0;\n file.delete();\n notifyStateChange(downloadInfo);\n }\n\n\n } catch (IOException e) {\n e.printStackTrace();\n\n downloadInfo.state = STATE_ERROR;\n downloadInfo.currentLength = 0;\n file.delete();\n notifyStateChange(downloadInfo);\n } finally {\n try {\n fos.close();\n is.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //handle the case did not come here,there are has three situation\n //1.download finish 2.download error 3.download pause\n if (file.length() == downloadInfo.currentLength && downloadInfo.state == STATE_DOWNLOADING) {\n //说明下载完成\n downloadInfo.state = STATE_FINISH;\n notifyStateChange(downloadInfo);\n } else if (downloadInfo.state == STATE_PAUSE) {\n notifyStateChange(downloadInfo);\n } else {\n downloadInfo.state = STATE_ERROR;\n downloadInfo.currentLength = 0;\n file.delete();\n notifyStateChange(downloadInfo);\n }\n\n //requires runnable is removed from the current from downloadTaskMap at the end of the task\n downloadTaskMap.remove(downloadInfo.id);\n }", "private void download()\n {\n if(mDownloadConnection!=null && mDownloadConnection.mBinder!=null)\n {\n if (mDownloadConnection.mBinder.download(\"file1\"))\n {\n mTvFilename.setText(\"file1\");\n }\n }\n }", "public void downloadFile(final Context context, final String fileKey, String pageFileKey, String fileType, final DownloadListener downloadListener) {\n\n final String pathName = Config.getPathName(context) + fileType + getFIleNameFromFileKEy(fileKey);\n final String pagePathName = Config.getPathName(context) + PAGES_FILE + getFIleNameFromFileKEy(pageFileKey);\n\n final long totalBytes = 0;\n TransferObserver downloadObserver = transferUtility.download(\n Config.BUCKET_NAME,\n fileKey,\n new File(pathName));\n\n\n // Attach a listener to the observer to get state update and progress notifications\n downloadObserver.setTransferListener(new TransferListener() {\n\n @Override\n public void onStateChanged(int id, TransferState state) {\n if (TransferState.COMPLETED == state) {\n\n downloadListener.onDownloadFinish(id, state.name(), pathName, pagePathName);\n }\n }\n\n @Override\n public void onProgressChanged(int id, long bytesCurrent,long bytesTotal) {\n\n\n if (bytesTotal == 0){\n\n bitesCorrent = bytesCurrent;\n\n Thread thread = new Thread(new Runnable() {\n @Override\n public void run() {\n\n URL url = null;\n try {\n url = new URL(S3_JABRUTOUCH + fileKey);\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n URLConnection conection = null;\n try {\n conection = url.openConnection();\n } catch (IOException e) {\n e.printStackTrace();\n }\n // getting file length\n int lengthOfFile = conection.getContentLength();\n\n float percentDonef = ((float) bitesCorrent / (float) lengthOfFile) * 100;\n final int percentDone = (int) percentDonef;\n\n new Handler(Looper.getMainLooper()).post(new Runnable() {\n @Override\n public void run() {\n downloadListener.onProgressChanged(percentDone);\n }\n });\n }\n });\n thread.start();\n\n }else {\n\n\n float percentDonef = ((float) bytesCurrent / (float) bytesTotal) * 100;\n int percentDone = (int) percentDonef;\n\n downloadListener.onProgressChanged(percentDone);\n }\n\n\n }\n\n @Override\n public void onError(int id, Exception ex) {\n\n Toast.makeText(context, \"Error downloading file \" + fileKey, Toast.LENGTH_LONG).show();\n downloadListener.onDownloadError();\n\n }\n\n });\n\n // If you prefer to poll for the data, instead of attaching a\n // listener, check for the state and progress in the observer.\n if (TransferState.COMPLETED == downloadObserver.getState()) {\n // Handle a completed upload.\n\n\n }\n\n\n }", "public void downloadCompleted(File f);", "@Override\n public void onReceive(Context context, Intent intent) {\n if (mDownloadedFileID == -1)\n return;\n Toast.makeText(getApplicationContext(), getString(R.string.atom_ui_tip_download_success), //To notify the Client that the file is being downloaded\n Toast.LENGTH_LONG).show();\n QunarWebActvity.this.finish();\n }", "@Override\n public boolean downloadFile(final String url, String fileID,\n final String path) {\n DownloadFileRequest request = RequestFactory.makeDownloadFileRequest(\n fileID, \".wig\");\n\n System.out.println(\"Test: \" + fileID);\n conn.sendRequest(request, userID, \"text/plain\");\n Gson gson = new Gson();\n DownloadFileResponse response = gson.fromJson(conn.getResponseBody(),\n DownloadFileResponse.class);\n System.out.println(conn.getResponseBody());\n final DownloadHandler handler = new DownloadHandler(\"pvt\", \"pvt\");\n new Thread(new Runnable() {\n @Override\n public void run() {\n handler.download(url, path);\n }\n }).start();\n\n System.out.println(\"Test\");\n return true;\n }", "void onProgress(EzDownloadRequest downloadRequest, long totalBytes, long downloadedBytes, int progress);", "@Override \r\n public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, \r\n\t long contentLength) {\n \tString filename = SDHelper.getAppDataPath() + File.separator \r\n\t\t\t\t\t+ getFilename(url);\r\n \tFile file =new File(filename);\r\n \tif (file.exists()) {\r\n\t\t\t\tIntent intent = new Intent(Intent.ACTION_VIEW);\r\n\t\t\t\tintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\r\n\t\t\t\tString ext = getExt(file);\r\n\t\t\t\tString mark = null;\r\n\t\t\t if (ext.equalsIgnoreCase(\"doc\")||ext.equalsIgnoreCase(\"docx\"))\r\n\t\t\t\t\tmark = \"application/msword\";\r\n\t\t\t\telse if (ext.equalsIgnoreCase(\"xls\")||ext.equalsIgnoreCase(\"xlsx\"))\r\n\t\t\t\t\tmark = \"application/vnd.ms-excel\";\r\n\t\t\t\telse if (ext.equalsIgnoreCase(\"ppt\")||ext.equalsIgnoreCase(\"pptx\"))\r\n\t\t\t\t\tmark = \"application/vnd.ms-powerpoint\";\r\n\t\t\t\telse if (ext.equalsIgnoreCase(\"pdf\"))\r\n\t\t\t\t\tmark = \"application/pdf\";\r\n\t\t\t\t\r\n\t\t\t\telse if (ext.equalsIgnoreCase(\"apk\"))\r\n\t\t\t\t\tmark = \t\"application/vnd.android.package-archive\"; \r\n\t\t\t\tintent.setDataAndType(Uri.fromFile(file), mark);\r\n\t\t\t\tmContext.startActivity(intent);\r\n\r\n \t}\r\n \telse \r\n \t new getFileAsync().execute(url);\r\n \t\r\n \t}", "public void handlerDownloadState(int status) {\n if (TvApplication.DEBUG_LOG) {\n JLog.d(TAG, \"deal download status in UpdateClient, status=\" + status);\n }\n if (status == STATUS_DOWNLOAD_SUCCESS) {\n // requestInstall();\n }\n }", "@Override\r\n protected void onPostExecute(String file_url) {\r\n System.out.println(\"Downloaded\");\r\n }", "void downloadCompleted(String blobId);", "private void DownloadFile(String url){\n ContentManager contentManager = ContentManager.getInstance();\n String fileName = contentManager.getCurrentPlayingSongTitle().trim();\n fileName = TextUtil.removeAccent(fileName);\n fileName += url.substring(url.length()-4, url.length());\n final FileDownloadWorker fileDownloadWorker = new FileDownloadWorker(getContext(), true, this);\n fileDownloadWorker\n .setDialogMessage(getContext().getString(R.string.wait_downloading))\n .setHorizontalProgressbar()\n .setDialogCancelCallback(getContext().getString(R.string.hide), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n fileDownloadWorker.showNotificationProgress();\n }\n });\n fileDownloadWorker.execute(url, fileName);\n }", "public void onFileDownloadComplete(String filePath, Object object);", "public void download(URL url, File location, HttpDownloadListener dl)\n\tthrows CanceledDownloadException, IOException {\n\tHttpResponse hr = _httpRequest.doGetRequest(url);\n\tdownload(hr, location, dl);\n }", "public interface FilePostDownloadHandler {\n void onPostDownload();\n}", "@Override\r\n public void onDownloading(String url, int progress) {\n DownloadInfo info = new DownloadInfo(url, callback).setProgress(progress);\r\n handleMessage(MSG_DOWNLOAD_ING, info);\r\n }", "public void download() {\n \n try {\n \n downloading = true;\n \n input = link.openStream(); \n output = new FileOutputStream(localFile);\n \n while ((bytes = input.read()) != -1) { // as long as there are bytes they will be copied to the local machine // enquanto houver bytes eles serao copiados para maquina local\n\n output.write(bytes);\n\n System.out.println(\"Tamanho: \" + sizeInMegaBytes(localFile) + \" MB\");\n\n }\n \n downloading = false;\n JOptionPane.showMessageDialog(null, \"Download do arquivo: \"+ localFile.getName() +\" Finalizado\");\n \n } catch (FileNotFoundException ex) {\n Logger.getLogger(Downloader.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IOException ex) {\n Logger.getLogger(Downloader.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void handlerDownloadProgress(int progress) {\n if (TvApplication.DEBUG_LOG) {\n JLog.d(TAG, \"deal download progress in UpdateClient, progress=\" + progress);\n }\n }", "public void download(BillDownloadEventNotification eventNotification) throws Exception {\n\t\tStopWatch timer = new StopWatch();\n\t\ttimer.start();\n\t\t\n\t\tOLBBillDownloadRequest request = null;\n\t\tboolean successful = false;\n\t\t//update status to processing\n\t\trequest = dao.getBillDownloadRequest(eventNotification.getRecordId());\n\t\tif (null == request) {\n\t\t\tthrow new Exception(\"BillDownloadRequest cannot be found: \" + eventNotification.getRecordId());\n\t\t}\n\t\trequest.setStatus(TelstraCBMConstants.DOWNLOAD_STATUS_PROCESSING);\n\t\tdao.update(request);\n\t\t\n\t\tDataHandler billContent = null;\n\t\tString extension = \".pdf\";\n\t\tsuccessful = true;\n\t\tString billSysId = getBillSysId(request.getDdn());\n\t\t\n\t\tString billNumber = \"\";\n\t\tif(billSysId.equals(BILL_SYS_ID_FLEXCAB)){\n\t\t\tbillNumber = request.getBillNumber();\n\t\t} else if(billSysId.equals(BILL_SYS_ID_MICA)){\n\t\t\tbillNumber = getMICABillNumber(request.getBillNumber());\t\t\t\n\t\t}\n\t\t\n\t\tDateFormat df = new SimpleDateFormat(\"yyyyMMdd\");\n\t\tString issueDate = df.format(request.getBillIssueDate());\n\t\tif (log.isDebugEnabled()) log.debug(\"Calling webservice client\");\n\t\ttry {\n\t\t\tString requestType = REQUEST_TYPE_BULK;\n\t\t\tif(eventNotification.getParentRecordId() == ONE_OFF_DOWNLOAD_BULK_ID){\n\t\t\t\trequestType = REQUEST_TYPE_ONEOFF;\n\t\t\t}\n\t\t\tbillContent = getDoc(requestType,billSysId,request.getAccountNumber(), billNumber, issueDate,PAGE_LIMIT, PAGE_RANGE, id, pw);\n\t\t} catch(TelJIesRpcServiceFault e){\n\t\t\tif (log.isDebugEnabled()) log.debug(\"Service Fault received: \",e);\t\t\t\n\t\t\tif(e.getFaultID().equals(TelstraCBMConstants.SALMAT_ERROR_CODE_001)){\n\t\t\t\trequest.setComments(TelstraCBMConstants.BILL_DOWNLOAD_COMMENT_NOT_FOUND);\n\t\t\t} else if(e.getFaultID().equals(TelstraCBMConstants.SALMAT_ERROR_CODE_008)){\n\t\t\t\trequest.setComments(TelstraCBMConstants.BILL_DOWNLOAD_COMMENT_TOO_LARGE);\n\t\t\t} else { \n\t\t\t\trequest.setComments(TelstraCBMConstants.BILL_DOWNLOAD_COMMENT_FAILED);\n\t\t\t}\n\t\t\tsuccessful = false;\n\t\t} catch(RemoteException re){\n\t\t\tif (log.isDebugEnabled()) log.debug(\"Remote exception occured: \",re);\n\t\t\trequest.setComments(TelstraCBMConstants.BILL_DOWNLOAD_COMMENT_FAILED);\n\t\t\tsuccessful = false;\n\t\t}\n\t\ttry {\n\t\t\teventNotification.setSuccessful(false);\n\t\t\tif (successful) {\n\t\t\t\t//save file to file system\n\t\t\t\tMessageFormat pathFormat = new MessageFormat(this.billsPath);\n\t\t\t\tString[] pathArgs = {eventNotification.getUserId(),eventNotification.getBulkReqestName()};\n\t\t\t\tStringBuffer path = new StringBuffer(pathFormat.format(pathArgs));\n\t\t\n\t\t\t\tpath.append(request.getAccountNumber()).append(\"_\")\n\t\t\t\t\t\t.append(request.getBillNumber()).append(\"_\")\n\t\t\t\t\t\t.append(df.format(request.getBillIssueDate())).append(extension);\n\t\t\t\tif (log.isDebugEnabled()) log.debug(\"Writing PDF to the location: \"+path.toString());\n\t\t\t\tFile file = new File(path.toString());\n\t\t\t\tif(!file.exists()){ file.createNewFile();}\n\t\t\t\tFileOutputStream fos = new FileOutputStream(file);\n\t\t\t\tbillContent.writeTo(fos);\n\t\t\t\tfos.close();\n\t\t\t\t\n\t\t\t\t//update status to complete\n\t\t\t\trequest.setBillFilePath(path.toString());\n\t\t\t\trequest.setStatus(TelstraCBMConstants.DOWNLOAD_STATUS_COMPLETE);\n\t\t\t\tdao.update(request);\n\t\t\t\tdao.flushToDatabase();\n\t\t\t\n\t\t\t\teventNotification.setSuccessful(true);\n\t\t\t} else {\n\t\t\t\tif (log.isDebugEnabled()) log.debug(\"Saving failed bill status to database\");\n\t\t\t\trequest.setStatus(TelstraCBMConstants.DOWNLOAD_STATUS_ERROR);\n\t\t\t\tdao.update(request);\n\t\t\t\tdao.flushToDatabase();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tlog.error(\"Exception caught while saving bill download request to file system: \", e);\n\t\t\tif (log.isDebugEnabled()) log.debug(\"Cleaning up bill download request\");\n\t\t\t//get fresh copy of request\n\t\t\trequest = dao.getBillDownloadRequest(eventNotification.getRecordId());\n\t\t\trequest.setComments(TelstraCBMConstants.BILL_DOWNLOAD_COMMENT_FAILED);\n\t\t\trequest.setStatus(TelstraCBMConstants.DOWNLOAD_STATUS_ERROR);\n\t\t\tdao.update(request);\n\t\t\tdao.flushToDatabase();\n\t\t}\n\t\t\n\t\ttimer.stop();\n\t\tOLBBillDownloadTime time = new OLBBillDownloadTime();\n\t\ttime.setCreated(new Date());\n\t\ttime.setGeneratorTypeId(getGeneratorType(request.getDownloadFormat()));\n\t\ttime.setElapsedSeconds((float)timer.getElapsedTime()/(float)1000);\n\t\ttime.setReference(request.getId()+\"\");\n\t\tif(log.isDebugEnabled()) { log.debug(\"Recording response time: \" + time.getElapsedSeconds()); }\n\t\tgetDao().recordTime(time);\n\t\t\n\t\tif(eventNotification.getParentRecordId() != ONE_OFF_DOWNLOAD_BULK_ID){\n\t\t\tjmsSender.sendMesage(eventNotification);\n\t\t}\n\t}", "@Override\n\t\t\t\t\t\tpublic void finish() {\n\t\t\t\t\t\t\tSystem.out.println(\"下载成功\");\n\t\t\t\t\t\t}", "@SuppressLint(\"NewApi\")\n\t\tpublic S<T> download(String url){\n\t\t \n\t\t// declare the dialog as a member field of your activity\n\t\t\t String fileName = url.substring( url.lastIndexOf('/')+1, url.length() );\n\n\t\t\t \n\t\t \n\t\t //if(!service){\n\t\t\t // instantiate it within the onCreate method\n\t\t\t mProgressDialog = new ProgressDialog(activity);\n\t\t\t mProgressDialog.setMessage(\"Downloading ...\");\n\t\t\t mProgressDialog.setIndeterminate(true);\n\t\t\t mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\n\t\t\t mProgressDialog.setCancelable(true);\n\t\t\t \n\t\t\t mProgressDialog.show(); \n\t\t\t Intent intent = new Intent(activity, DownloadService.class);\n\t\t\t intent.putExtra(\"url\", url);\n\t\t\t intent.putExtra(\"filename\", fileName);\n\t\t\t intent.putExtra(\"receiver\", new DownloadReceiver(new Handler()));\n\t\t\t activity.startService(intent);\n\t\t\t \n\t\t return this;\n\t }", "@Test\n public void downloadTest() throws ApiException {\n Integer devid = null;\n String path = null;\n File response = api.download(devid, path);\n\n // TODO: test validations\n }", "public void pressOnDownloadBtn() {\n Network.sendMsg(\n new FileRequest(\n serverFilesList.getSelectionModel().getSelectedItem()));\n }", "public void download() {\n // Attempt to perform the download\n Log.d(TAG, \"download\");\n try {\n // Open a connection to the PHP server.\n // Get the response code\n // Open an input stream as well as a buffered input reader\n try {\n // if (responseCode == HttpURLConnection.HTTP_OK) {\n // Attempt to parse the data from the server\n\n /* Add the crumb objects, but only add the coordinates, the rating,\n * the name, and the number of visits to the local database structure.\n */\n\n // Perhaps add a post method to add the crumbs to the hashmap\n\n // Post: Notify the UI thread that the markers are ready to be loaded.\n\n } catch (Exception e) {\n\n } finally {\n // Close the input streams\n }\n } catch(Exception e) {\n\n }\n }", "@RequestMapping(value = \"download.do\")\r\n\tpublic ModelAndView download(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows Exception {\n\t\tString storeName = request.getParameter(\"name\");\r\n\t\tString contentType = \"application/octet-stream\";\r\n\t\t// 获取项目根目录\r\n\t\tString ctxPath = request.getSession().getServletContext().getRealPath(\"\");\r\n\t\t// 获取下载文件露肩\r\n\t\tString downLoadPath = ctxPath + \"/data/\" + storeName;\r\n\t\tFileUploadController.download(request, response, storeName, downLoadPath, contentType);\r\n\t\treturn null;\r\n\t}", "@SuppressLint(\"NewApi\")\r\n\tprivate void downloadFile() {\n\t\tLog.d(TAG, \"In fuction downloadFile()\");\r\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"dd-MM-yy\");\r\n \tCalendar cal = Calendar.getInstance();\r\n \tString programmaNameUnderscore = mName.replace(\" \", \"_\");\r\n \tprogrammaNameUnderscore = programmaNameUnderscore.replace(\",\",\"\");\r\n \tString fileName = programmaNameUnderscore + \"_\" + dateFormat.format(cal.getTime())+\".mp3\";\r\n \t\r\n \t\r\n\t\tRequest request = new Request(Uri.parse(mDownloadUrl));\r\n\t\trequest.setDescription(mName);\r\n \t// in order for this if to run, you must use the android 3.2 to compile your app\r\n \tif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {\r\n \t request.allowScanningByMediaScanner();\r\n \t request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);\r\n \t}\r\n \trequest.setDestinationInExternalPublicDir(Environment.DIRECTORY_MUSIC, getString(R.string.download_subdir_test) + File.separator + fileName);\r\n\t}", "public void onFileDownloadComplete(String filePath);", "public interface DownloadListener {\n void onStart(String url,String savePath);\n void onProgress(String url, String savePath,long progress,long max);\n void onComplete(String url,String savePath);\n void onCancel(String url,String savePath);\n void onFail(String url,String savePath);\n\n // boolean isCanceled(String url,String savePath);\n String generalFileName(String url);\n long getMax(String url,String savePath);\n long getAvailable(String url,String savePath);\n}", "public void onDownloadSuccess(String fileInfo);", "@Override\n protected void onPostExecute(Integer downloadStatue) {\n if(downloadStatue == DOWNLOAD_SUCCESS)\n {\n this.setDownloadCanceled(false);\n this.setDownloadPaused(false);\n downloadListener.onSuccess();\n //scanFile();\n }else if(downloadStatue == DOWNLOAD_FAILED)\n {\n this.setDownloadCanceled(false);\n this.setDownloadPaused(false);\n downloadListener.onFailed();\n }else if(downloadStatue == DOWNLOAD_PAUSED)\n {\n downloadListener.onPaused();\n }else if(downloadStatue == DOWNLOAD_CANCELED)\n {\n downloadListener.onCanceled();\n }\n }", "void mo54428b(DownloadTask downloadTask);", "@Override\n public void serveDownload(ServletContext context, HttpServletResponse response, Download download)\n throws IOException {\n File file = FileUtility.getFromDrive(download);\n\n if (file != null) {\n try (FileInputStream inStream = new FileInputStream(file)) {\n String mimeType = context.getMimeType(file.getAbsolutePath());\n if (mimeType == null) {\n // set to binary type if MIME mapping not found\n mimeType = \"application/octet-stream\";\n }\n\n // modifies response\n response.setContentType(mimeType);\n response.setContentLength((int) file.length());\n\n // forces download\n String headerKey = \"Content-Disposition\";\n String headerValue = String.format(\"attachment; filename=\\\"%s\\\"\", download.getFilename());\n response.setHeader(headerKey, headerValue);\n\n // obtains response's output stream\n OutputStream outStream = response.getOutputStream();\n\n byte[] buffer = new byte[4096];\n int bytesRead = -1;\n\n while ((bytesRead = inStream.read(buffer)) != -1) {\n outStream.write(buffer, 0, bytesRead);\n }\n }\n }\n }", "@RequestMapping (value=\"/DownloadFileNote/{filename}\", method=RequestMethod.GET )\r\n public void doDownload(HttpServletRequest request,\r\n HttpServletResponse response, @PathVariable(value = \"filename\") String fileName ) throws IOException {\n ServletContext context = request.getServletContext();\r\n String appPath = context.getRealPath(\"\");\r\n System.out.println(\"filepath = \" + dirNotes);\r\n\r\n // construct the complete absolute path of the file\r\n\r\n File downloadFile = new File(dirNotes+fileName);\r\n FileInputStream inputStream = new FileInputStream(downloadFile);\r\n\r\n // get MIME type of the file\r\n String mimeType = context.getMimeType(dirNotes+fileName);\r\n if (mimeType == null) {\r\n // set to binary type if MIME mapping not found\r\n mimeType = \"application/octet-stream\";\r\n }\r\n System.out.println(\"MIME type: \" + mimeType);\r\n\r\n // set content attributes for the response\r\n response.setContentType(mimeType);\r\n response.setContentLength((int) downloadFile.length());\r\n\r\n // set headers for the response\r\n String headerKey = \"Content-Disposition\";\r\n String headerValue = String.format(\"attachment; filename=\\\"%s\\\"\",\r\n downloadFile.getName());\r\n response.setHeader(headerKey, headerValue);\r\n\r\n // get output stream of the response\r\n OutputStream outStream = response.getOutputStream();\r\n\r\n byte[] buffer = new byte[BUFFER_SIZE];\r\n int bytesRead = -1;\r\n\r\n // write bytes read from the input stream into the output stream\r\n while ((bytesRead = inputStream.read(buffer)) != -1) {\r\n outStream.write(buffer, 0, bytesRead);\r\n }\r\n\r\n inputStream.close();\r\n outStream.close();\r\n }", "@SuppressWarnings(\"resource\")\r\n\t@RestMethod(name=\"DOWNLOAD\")\r\n\tpublic void doDownload(RestRequest req, RestResponse res) throws Exception {\r\n\r\n\t\tif (! allowViews)\r\n\t\t\tthrow new RestException(SC_METHOD_NOT_ALLOWED, \"DOWNLOAD not enabled\");\r\n\r\n\t\tFile f = new File(rootDir.getAbsolutePath() + req.getPathInfo());\r\n\r\n\t\tif (!f.exists())\r\n\t\t\tthrow new RestException(SC_NOT_FOUND, \"File not found\");\r\n\r\n\t\tif (f.isDirectory())\r\n\t\t\tthrow new RestException(SC_METHOD_NOT_ALLOWED, \"DOWNLOAD not available on directories\");\r\n\r\n\t\tres.setOutput(new FileReader(f)).setContentType(\"application\");\r\n\t}", "String download(String path) throws IOException;", "@Override\n protected void onPostExecute(UserDetails userDetails) {\n listener.onDownload(userDetails);\n }", "private static void download(String arquivo, HttpServletRequest request, HttpServletResponse response) throws IOException {\n File f = new File(arquivo);\n response.setContentLength((int) f.length());\n response.setContentType(\"application/octet-stream\");\n response.setHeader(\"Content-Transfer-Encoding\", \"binary\");\n response.setHeader(\"Content-Disposition\", \"attachment; filename=\\\"\" + f.getName() + \"\\\"\");\n\n byte[] buf = new byte[4096];\n BufferedInputStream in = new BufferedInputStream(new FileInputStream(f));\n BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream());\n int i = 0;\n while ((i = in.read(buf)) > 0) {\n out.write(buf, 0, i);\n }\n out.close();\n in.close();\n }", "@Override\n public void onClick(DialogInterface dialog, int which)\n {\n DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));\n //cookie\n String cookie= CookieManager.getInstance().getCookie(url);\n //Add cookie and User-Agent to request\n request.addRequestHeader(\"Cookie\",cookie);\n request.addRequestHeader(\"User-Agent\",userAgent);\n\n //file scanned by MediaScannar\n request.allowScanningByMediaScanner();\n //Download is visible and its progress, after completion too.\n request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);\n //DownloadManager created\n DownloadManager downloadManager= (DownloadManager) getContext().getSystemService(Context.DOWNLOAD_SERVICE);\n //Saving file in Download folder\n request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, filename);\n //download enqued\n downloadManager.enqueue(request);\n }", "public void download(HttpResponse hr, File file, HttpDownloadListener dl)\n\tthrows CanceledDownloadException, IOException {\n\t// Tell delegate about loading\n\tint length = hr.getContentLength();\n\tif (dl != null) dl.downloadProgress(0, length);\n\t\n\tif (Globals.TraceDownload) Debug.println(\"Doing download\");\n\t\n\t\n\tInputStream in = null;\n\tOutputStream out = null;\n\ttry {\n\t in = hr.getInputStream();\n\t out = new FileOutputStream(file);\n\t int read = 0;\n\t int totalRead = 0;\n\t byte[] buf = new byte[BUF_SIZE];\n\t while ((read = in.read(buf)) != -1) {\n\t\tout.write(buf, 0, read);\n\t\t// Notify delegate\n\t\ttotalRead += read;\n\t\tif (totalRead > length && length != 0) totalRead = length;\n\t\tif (dl != null) dl.downloadProgress(totalRead, length);\n\t }\n\t if (Globals.TraceDownload) {\n\t\tDebug.println(\"Wrote URL \" + hr.getRequest() + \" to file \" + file);\n\t }\n\t in.close(); in = null;\n\t out.close(); out = null;\n\t} catch(IOException ioe) {\n\t if (Globals.TraceDownload) {\n\t\tDebug.println(\"Got exception while downloading resource: \" + ioe);\n\t }\n\t // Close before calling delete - otherwise it fails\n\t if (in != null) { in.close(); in = null; }\n\t if (out != null) { out.close(); out = null; }\n\t if (file != null) file.delete();\n\t // Rethrow exception\n\t throw ioe;\n\t}\n\t\n\t// Inform delegate about loading has completed\n\tif (dl != null) dl.downloadProgress(length, length);\n }", "@Override\n public void handle(ChannelHandlerContext ctx, String requestId, FileDownloadMessage message) {\n // if this message have searched before, ignore it\n String messageId = message.getMessageId();\n String filename = message.getFilename();\n String requestIp = message.getRequestIp();\n if (messageSearched.containsKey(messageId)) {\n ctx.writeAndFlush(new MessageOutput(requestId, \"save_res\", false));\n return;\n }\n messageSearched.put(messageId, 1);\n\n // download\n LOG.info(\"start send file : \" + filename);\n download(filename, requestIp);\n LOG.info(\"file send complete: \" + filename);\n ctx.writeAndFlush(new MessageOutput(requestId, \"save_res\", true));\n }", "entities.Torrent.DownloadRequest getDownloadRequest();", "public void downloadFile(String fileURL, String saveDir)\n throws IOException {\n URL url = new URL(fileURL);\n HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();\n int responseCode = httpConn.getResponseCode();\n\n // always check HTTP response code first\n if (responseCode == HttpURLConnection.HTTP_OK) {\n String fileName = \"\";\n String disposition = httpConn.getHeaderField(\"Content-Disposition\");\n String contentType = httpConn.getContentType();\n int contentLength = httpConn.getContentLength();\n\n if (disposition != null) {\n // extracts file name from header field\n int index = disposition.indexOf(\"filename=\");\n if (index > 0) {\n fileName = disposition.substring(index + 10,\n disposition.length() - 1);\n }\n } else {\n // extracts file name from URL\n fileName = fileURL.substring(fileURL.lastIndexOf(\"/\") + 1,\n fileURL.length());\n }\n\n System.out.println(\"Content-Type = \" + contentType);\n System.out.println(\"Content-Disposition = \" + disposition);\n System.out.println(\"Content-Length = \" + contentLength);\n System.out.println(\"fileName = \" + fileName);\n\n // opens input stream from the HTTP connection\n InputStream inputStream = httpConn.getInputStream();\n String saveFilePath = saveDir + File.separator + fileName;\n\n // opens an output stream to save into file\n FileOutputStream outputStream = new FileOutputStream(saveFilePath);\n\n\n int bytesRead = -1;\n byte[] buffer = new byte[BUFFER_SIZE];\n int progress = 0;\n while ((bytesRead = inputStream.read(buffer)) != -1) {\n outputStream.write(buffer, 0, bytesRead);\n progress += bytesRead;\n setChanged();\n notifyObservers((int) ((progress * 100) / contentLength));\n }\n\n outputStream.close();\n inputStream.close();\n\n System.out.println(\"File downloaded\");\n } else {\n System.out.println(\"No file to download. Server replied HTTP code: \" + responseCode);\n }\n httpConn.disconnect();\n }", "@Override\n public boolean isDownloadable() {\n return true;\n }", "public void postRequestDownloadProgress(Request<?> request, long transferredBytesSize, long totalSize);", "protected abstract File download(Exception previousException) throws Exception;", "public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {\n String filePath = \"/home/harun/Downloads/Q3.pdf\";\n File downloadFile = new File(filePath);\n FileInputStream inputStream = new FileInputStream(downloadFile);\n\n // Get the mimeType of the file\n ServletContext context = getServletContext();\n String mimeType = context.getMimeType(filePath);\n\n // Fetch file in binary there's no MimeType mapping\n if(mimeType==null) mimeType = \"application/octet-stream\";\n // Log the mimeType in the console\n System.out.println(mimeType);\n\n\n //Set the response mimeType/contentType and file length\n response.setContentType(\"Mime Tyoe: \" + mimeType);\n int fileLength = (int) downloadFile.length();\n response.setContentLength(fileLength);\n\n // Set the response header value// Force download\n String headerKey = \"Content-Disposition\";\n String headerValue = String.format(\"attachment; filename=\\\"%s\\\"\", downloadFile.getName());\n response.setHeader(headerKey,headerValue);\n\n // read the input stream in buffered chunks to the output stream\n OutputStream outputStream = response.getOutputStream();\n byte[] buffer = new byte[4096]; // Buffers of 4MB's\n int c = -1;\n\n while((c = inputStream.read(buffer)) != -1){\n outputStream.write(buffer, 0, c);\n }\n\n // Close the input and output streams\n inputStream.close();\n outputStream.close();\n\n }", "void onDownloadFailed(EzDownloadRequest downloadRequest, int errorCode, String errorMessage);", "public void onDownloadStart(String url, String userAgent,\n String contentDisposition, String mimeType,\n long contentLength) {\n\n DownloadManager.Request request = new DownloadManager.Request(\n Uri.parse(url));\n request.setMimeType(mimeType);\n String cookies = CookieManager.getInstance().getCookie(url);\n request.addRequestHeader(\"cookie\", cookies);\n request.addRequestHeader(\"User-Agent\", userAgent);\n request.setDescription(\"Downloading File...\");\n request.setTitle(URLUtil.guessFileName(url, contentDisposition, mimeType));\n request.allowScanningByMediaScanner();\n request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);\n request.setDestinationInExternalPublicDir(\n \"/MyUniversity\", URLUtil.guessFileName(\n url, contentDisposition, mimeType));\n DownloadManager dm = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);\n dm.enqueue(request);\n Toast.makeText(getApplicationContext(), \"Downloading File\", Toast.LENGTH_LONG).show();\n\n\n }", "@Override\n\t\t\t\t\tpublic void run() {\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tList<String> headers = readRequest(client);\n\t\t\t\t\t\t\tif (headers != null && headers.size() >= 1) {\n\t\t\t\t\t\t\t\tString requestURL = getRequestURL(headers.get(0));\n\t\t\t\t\t\t\t\tLog.d(TAG, requestURL);\n\n\t\t\t\t\t\t\t\tif (requestURL.startsWith(\"http://\")) {\n\n\t\t\t\t\t\t\t\t\t// HttpRequest request = new\n\t\t\t\t\t\t\t\t\t// BasicHttpRequest(\"GET\", requestURL);\n\n\t\t\t\t\t\t\t\t\tprocessHttpRequest(requestURL, client, headers);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tprocessFileRequest(requestURL, client, headers);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} catch (IllegalStateException 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} catch (IOException 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}", "public static void main(String[] args) throws IOException {\n\n downloadFileRequest();\n }", "public void reviewFileDownload(HttpServletRequest request, HttpServletResponse response, int reviewNum, int idx) throws Exception;", "@RequestMapping(value = \"/downloadGroupDownloadFiles\", method = RequestMethod.GET)\r\n\tpublic void downloadGroupDownloadFiles(HttpServletRequest request, HttpServletResponse response) {\r\n\t\tlogger.log(IAppLogger.INFO, \"Enter: Controller - downloadGroupDownloadFiles\");\r\n\t\tString jobId = (String) request.getParameter(\"jobId\");\r\n\t\tString filePath = (String) request.getParameter(\"filePath\");\r\n\t\tString fileName = FileUtil.getFileNameFromFilePath(filePath);\r\n\t\tString orgLevel = (String) request.getParameter(\"orgLevel\");\r\n\t\tString requestType = (String) request.getParameter(\"requestType\");\r\n\t\t\r\n\t\tlogger.log(IAppLogger.INFO, \"jobId = \" + jobId);\r\n\t\tlogger.log(IAppLogger.INFO, \"filePath = \" + filePath);\r\n\t\tlogger.log(IAppLogger.INFO, \"fileName = \" + fileName);\r\n\t\tlogger.log(IAppLogger.INFO, \"orgLevel = \" + orgLevel);\r\n\t\tlogger.log(IAppLogger.INFO, \"requestType = \" + requestType);\r\n\t\t\r\n\t\tString customer = (String) request.getSession().getAttribute(IApplicationConstants.CUSTOMER);\r\n\t\t\r\n\t\tString envString = null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\t// Get file bytes from Amazon S3\t\t\t\r\n\t\t\t\r\n\t\t\tif(fileName.endsWith(\".xml\")) {\r\n\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\tMap<String, Object> propertyMap = (Map<String,Object>)request.getSession().getAttribute(\"propertyMap\");\r\n\t\t\t\tif(propertyMap == null){\r\n\t\t\t\t\tMap<String, Object> tileParamMap = new HashMap<String, Object>();\r\n\t\t\t\t\ttileParamMap.put(\"contractName\", Utils.getContractName());\r\n\t\t\t\t\tpropertyMap = loginService.getContractProerty(tileParamMap);\r\n\t\t\t\t\trequest.getSession().setAttribute(\"propertyMap\", propertyMap);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tenvString = (String) propertyMap.get(IApplicationConstants.STATIC_PDF_LOCATION) + IApplicationConstants.SDF_XML_S3_LOCATION;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tbyte[] assetBytes = repositoryService.getAssetBytes(envString!=null ? envString + filePath: filePath);\r\n\t\t\tlogger.log(IAppLogger.INFO, \"Successfully read bytes from S3: \" + filePath);\r\n\r\n\t\t\t// For TASC Student Data File Download - the asset bytes are\r\n\t\t\t// converted to password protected zip bytes\r\n\t\t\tif (orgLevel.equals(\"1\") && requestType.equals(\"SDF\") && !fileName.endsWith(\".zip\") && !fileName.endsWith(\".xml\")) {\r\n\t\t\t\t// Save file in temp directory\r\n\t\t\t\tString fileLocation = CustomStringUtil.appendString(propertyLookup.get(\"pdfGenPathIC\"), File.separator, jobId, File.separator, fileName);\r\n\t\t\t\tfileLocation = fileLocation.replace(\"//\", \"/\");\r\n\r\n\t\t\t\tString tempDirectory = FileUtil.getDirFromFilePath(fileLocation);\r\n\t\t\t\tFile tempJobDirectory = new File(tempDirectory);\r\n\t\t\t\tif (!tempJobDirectory.exists()) {\r\n\t\t\t\t\tlogger.log(IAppLogger.INFO, \"Creating directory ... \" + tempJobDirectory);\r\n\t\t\t\t\tboolean status = tempJobDirectory.mkdir();\r\n\t\t\t\t\tlogger.log(IAppLogger.INFO, tempJobDirectory + \" : \" + status);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tlogger.log(IAppLogger.INFO, \"Directory exists: \" + tempJobDirectory);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tFileUtil.createFile(fileLocation, assetBytes);\r\n\t\t\t\tlogger.log(IAppLogger.INFO, \"File saved successfully from S3: \" + fileLocation);\r\n\t\t\t\tString newFilePath = fileLocation.replace(\".DAT\", \".zip\");\r\n\t\t\t\tlogger.log(IAppLogger.INFO, \"newFilePath = \" + newFilePath);\r\n\t\t\t\tString password = propertyLookup.get(\"gdfpassword\");\r\n\t\t\t\tlogger.log(IAppLogger.INFO, \"password = \" + password);\r\n\r\n\t\t\t\t// create password protected zip file in disk\r\n\t\t\t\tFileUtil.createPasswordProtectedZipFile(fileLocation, newFilePath, password);\r\n\t\t\t\tbyte[] zipBytes = FileUtil.getBytes(newFilePath);\r\n\t\t\t\t\r\n\t\t\t\t// Download file from browser\r\n\t\t\t\tFileUtil.browserDownload(response, zipBytes, FileUtil.getFileNameFromFilePath(newFilePath));\r\n\r\n\t\t\t\t// Delete temp Job Directory\r\n\t\t\t\t// FileUtils.deleteDirectory(tempJobDirectory);\r\n\t\t\t\t// logger.log(IAppLogger.INFO, \"Temp Directory Deleted Successfully: \" + tempJobDirectory);\r\n\t\t\t} else {\r\n\t\t\t\tlogger.log(IAppLogger.INFO, \"Not a district user and Student data file\");\r\n\t\t\t\t// Download file from browser\r\n\t\t\t\tFileUtil.browserDownload(response, assetBytes, fileName);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.log(IAppLogger.ERROR, \"downloadGroupDownloadFiles - \", e);\r\n\t\t\tlogger.log(IAppLogger.INFO, \"File not found so getting from DB - \");\r\n\t\t\tif(fileName.endsWith(\".xml\")) {\r\n\t\t\t\t/*File need to be created from studentdata_extract clob and upload into s3*/\r\n\t\t\t\tMap<String, Object> paramMap = new HashMap<String, Object>();\r\n\t\t\t\tparamMap.put(\"customer\", customer);\r\n\t\t\t\tparamMap.put(\"jobId\",jobId);\r\n\t\t\t\tStudentDataExtractTO studentDataExtractTO = usabilityService.getClobXMLFile(paramMap);\r\n\t\t\t\tString studentXML = studentDataExtractTO.getStudentDataXML();\r\n\r\n\t\t\t\tString fileLocation = CustomStringUtil.appendString(propertyLookup.get(\"xmlGenPath\"), fileName);\r\n\t\t\t\t\r\n\t\t\t\t//fileLocation = fileLocation.replace(\"//\", \"/\");\r\n\t\t\t\tString tempDirectory = FileUtil.getDirFromFilePath(fileLocation);\r\n\t\t\t\tFile tempJobDirectory = new File(tempDirectory);\r\n\t\t\t\t\r\n\t\t\t\tif (!tempJobDirectory.exists()) {\r\n\t\t\t\t\tlogger.log(IAppLogger.INFO, \"Creating directory ... \" + tempJobDirectory);\r\n\t\t\t\t\tboolean status = tempJobDirectory.mkdir();\r\n\t\t\t\t\tlogger.log(IAppLogger.INFO, tempJobDirectory + \" : \" + status);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tlogger.log(IAppLogger.INFO, \"Directory exists: \" + tempJobDirectory);\r\n\t\t\t\t}\r\n\t\t\t\tFile tempFile = new File(fileLocation);\r\n\t\t\t\tFileUtil.createFile(fileLocation, studentXML.getBytes());\r\n\t\t\t\trepositoryService.uploadAsset(envString, tempFile);\r\n\t\t\t\t\r\n\t\t\t\tcom.ctb.prism.core.transferobject.JobTrackingTO jobTrackingTO = new com.ctb.prism.core.transferobject.JobTrackingTO();\r\n\t\t\t\tjobTrackingTO.setJobId(Long.valueOf(jobId));\r\n\t\t\t\tjobTrackingTO.setFileSize(FileUtil.fileSize(studentXML.getBytes()));\r\n\t\t\t\tjobTrackingTO.setFilePath(envString+filePath);\r\n\t\t\t\tjobTrackingTO.setRequestFilename(fileName);\t\r\n\t\t\t\t\r\n\t\t\t\tjobTrackingTO = usabilityService.updateFileSize(jobTrackingTO);\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tboolean fileDeleteFlag = FileUtils.deleteQuietly(tempFile); //delete temp file\r\n\t\t\t\t//tempJobDirectory.delete(); //delete temp directory\r\n\t\t\t\tif(fileDeleteFlag){\r\n\t\t\t\t\tlogger.log(IAppLogger.INFO, \"Temp file has been deleted successfully: \" + fileName);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tlogger.log(IAppLogger.INFO, \"Unable to delete Temp file: \" + fileName);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tFileUtil.browserDownload(response, studentXML.getBytes(), fileName);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tlogger.log(IAppLogger.INFO, \"Exit: Controller - downloadGroupDownloadFiles\");\r\n\t}", "private void DownloadCompleted(ByteBuffer packet) throws RuntimeException, IOException{\n\t\t// (for download completion ack c->s) [header | file_id (4)]\n\t\t// no HEADER\n\t\t\n\t\t// parse the req\n\t\tif (packet.capacity() < 4)\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\"file not correctly specified\");\n\t\tint file_id = packet.getInt(0);\n\t\tfor (ServerFile f : totalFiles().keySet()){\n\t\t\tif (f.id() == file_id){\n\t\t\t\tclient.addUpload(f);\n\t\t\t\t// construct response\n\t\t\t\tString send_name = f.name() + '\\0';\n\t\t\t\tbuf = Utility.addHeader(Constants.DOWNLOAD_ACK, send_name.length(), client.getId());\n\t\t\t\t\n\t\t\t\tfor (int i = 0; i < send_name.length(); i++){\n\t\t\t\t\tbuf.put(Constants.HEADER_LEN + i, send_name.getBytes()[i]);\n\t\t\t\t}\n\t\t\t\tout.write(buf.array());\n\t\t\t\tout.flush();\n\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\": Correctly processed download ack for \" + file_id);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tthrow new RuntimeException(\"file id does not exist\");\n\t}", "void onDownloadFileCreated(DownloadFileInfo downloadFileInfo);", "@RequestMapping(value = \"/DownloadFile\" )\r\n\tpublic void doDownload(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response) throws IOException {\r\n\t\tint BUFFER_SIZE = 4096;\r\n\r\n\t\t/**\r\n\t\t * Path of the file to be downloaded, relative to application's directory\r\n\t\t */\r\n\t\tHttpSession session = request.getSession();\r\n\t\t//session.setAttribute(\"filePath\", filepath1);\r\n\t\t//String filePath =\"C:/Users/826862/Desktop/download.jsp\";\r\n\t\tString filePath =(String) session.getAttribute(\"docLink\");\r\n\r\n\t\tSystem.out.println(\"payth\" + filePath);\r\n\r\n\t\t/**\r\n\t\t * Method for handling file download request from client\r\n\t\t */\r\n\t\t// get absolute path of the application\r\n\t\tServletContext context = request.getServletContext();\r\n\t\tString appPath = context.getServerInfo();\r\n\r\n\t\tSystem.out.println(\"appPath = \" + appPath);\r\n\r\n\t\t// construct the complete absolute path of the file\r\n\t\tString fullPath = filePath;\t\t\r\n\t\tFile downloadFile = new File(fullPath);\r\n\t\tFileInputStream inputStream = new FileInputStream(downloadFile);\r\n\r\n\t\t// get MIME type of the file\r\n\t\tString mimeType = context.getMimeType(fullPath);\r\n\t\tif (mimeType == null) {\r\n\t\t\t// set to binary type if MIME mapping not found\r\n\t\t\tmimeType = \"application/octet-stream\";\r\n\t\t}\r\n\t\tSystem.out.println(\"MIME type: \" + mimeType);\r\n\r\n\t\t// set content attributes for the response\r\n\t\tresponse.setContentType(mimeType);\r\n\t\tresponse.setContentLength((int) downloadFile.length());\r\n\r\n\t\t// set headers for the response\r\n\t\tString headerKey = \"Content-Disposition\";\r\n\t\tString headerValue = String.format(\"attachment; filename=\\\"%s\\\"\",\r\n\t\t\t\tdownloadFile.getName());\r\n\t\tresponse.setHeader(headerKey, headerValue);\r\n\r\n\t\t// get output stream of the response\r\n\t\tOutputStream outStream = response.getOutputStream();\r\n\r\n\t\tbyte[] buffer = new byte[BUFFER_SIZE];\r\n\t\tint bytesRead = -1;\r\n\r\n\t\t// write bytes read from the input stream into the output stream\r\n\t\twhile ((bytesRead = inputStream.read(buffer)) != -1) {\r\n\t\t\toutStream.write(buffer, 0, bytesRead);\r\n\t\t}\r\n\r\n\t\tinputStream.close();\r\n\t\toutStream.close();\r\n\r\n\t}", "@Override\n protected void onPostExecute(String file_url) {\n Log.i(TAG,\"onPostExecute()\");\n download = null;\n // dismiss the dialog after the file was downloaded\n runOnUiThread(()->dismissDialog());\n }", "public void onDownloadProgress(int current, int total);", "@Override\n\t\tpublic void downloadCanceled() {\n\n\t\t}", "Mono<PieceEvent> downloadBlock(Link link, RequestMessage requestMessage);", "@Override\n public void run() {\n DownloadListener.getListener().execute();\n }", "@Override\n public void Download(DownloadBatchResult getBatchRes) {\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n if (intent.getAction() == DownloadManager.ACTION_DOWNLOAD_COMPLETE) {\n long id = intent\n .getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1);\n if (tag_id == id) {\n downOK();\n }\n }\n }", "@RequestMapping(\"api/admin/fileDownload.do\")\n\tpublic void fileDownload(HttpServletRequest request,HttpServletResponse response,@RequestParam(value=\"fileName\")String fileName) throws IOException{\n\t\tServletContext context = request.getServletContext();\n \n // construct the complete absolute path of the file\n String fullPath = boardPath+fileName; \n File downloadFile = new File(fullPath);\n FileInputStream inputStream = new FileInputStream(downloadFile);\n \n // get MIME type of the file\n String mimeType = context.getMimeType(fullPath);\n if (mimeType == null) {\n // set to binary type if MIME mapping not found\n mimeType = \"application/octet-stream\";\n }\n System.out.println(\"MIME type: \" + mimeType);\n \n // set content attributes for the response\n response.setContentType(mimeType);\n response.setContentLength((int) downloadFile.length());\n \n // set headers for the response\n String headerKey = \"Content-Disposition\";\n String headerValue = String.format(\"attachment; filename=\\\"%s\\\"\",\n URLEncoder.encode(downloadFile.getName(),\"UTF-8\"));\n System.out.println(downloadFile.getName());\n \n response.setHeader(headerKey, headerValue);\n \n // get output stream of the response\n OutputStream outStream = response.getOutputStream();\n \n byte[] buffer = new byte[BUFFER_SIZE];\n int bytesRead = -1;\n \n // write bytes read from the input stream into the output stream\n while ((bytesRead = inputStream.read(buffer)) != -1) {\n outStream.write(buffer, 0, bytesRead);\n }\n \n inputStream.close();\n outStream.close();\n \n \n \n\t}", "public interface FileDownloadListener {\n\n\t/**\n\t * Listener for the progress of downloadFile\n\t * @param current current file data offset\n\t * @param total total length of file data\n\t */\n\tpublic void onDownloadProgress(int current, int total);\n\t\n\tpublic boolean cancelDownload();\n}", "@Override\n public void run() {\n downloadFile(Const.MONITOR_SERVER_ADDRESS, downFilePath);\n }", "@Override\n protected String doInBackground(String... url) {\n String data = \"\";\n try {\n // Gui request len\n data = downloadUrl(url[0]);\n } catch (Exception e) {\n e.printStackTrace();\n }\n return data;\n }", "void mo54418a(DownloadTask downloadTask);", "public void onDownloadFile2(View view) {\n String url = \"http://txt.99dushuzu.com/download-txt/3/21068.txt\";\n EasyHttp.downLoad(url)\n .savePath(Environment.getExternalStorageDirectory().getPath()+\"/test/QQ\")\n .saveName(FileUtils.getFileName(url))\n .execute(new DownloadProgressCallBack<String>() {\n @Override\n public void update(long bytesRead, long contentLength, boolean done) {\n int progress = (int) (bytesRead * 100 / contentLength);\n HttpLog.e(progress + \"% \");\n dialog.setProgress(progress);\n if (done) {\n dialog.setMessage(\"下载完成\");\n }\n }\n\n @Override\n public void onStart() {\n dialog.show();\n }\n\n @Override\n public void onComplete(String path) {\n showToast(\"文件保存路径:\" + path);\n dialog.dismiss();\n }\n\n @Override\n public void onError(ApiException e) {\n showToast(e.getMessage());\n dialog.dismiss();\n }\n });\n }", "@RequestMapping(value = \"download\", method = RequestMethod.GET)\n\tpublic String getDownloadPage() {\n\t\tLOGGER.debug(\"Received request to show download page\");\n\t\tLOGGER.info(\"Received request to show download page\");\n\t\tSystem.out.println(\"---------------Received request to show download page\");\n\n\t\t// Do your work here. Whatever you like\n\t\t// i.e call a custom service to do your business\n\t\t// Prepare a model to be used by the JSP page\n\n\t\t// This will resolve to /WEB-INF/jsp/downloadpage.jsp\n\t\treturn \"downloadpage\";\n\t}", "@Override\r\n protected void onPreExecute() {\r\n super.onPreExecute();\r\n System.out.println(\"Starting download\");\r\n }", "private void btnDownloadActionPerformed(java.awt.event.ActionEvent evt) {\n path = JOptionPane.showInputDialog(\"Digite o local de destino do arquivo:\");\n System.out.println(\"Path\" + path);\n if (rbBpa.isSelected()) {\n site = \"ftp://arpoador.datasus.gov.br/siasus/BPA/\";\n } else {\n site = \"ftp://arpoador.datasus.gov.br/siasus/sia/\";\n }\n resposta = Download.terminou;\n System.out.println(\"Resposta \" + resposta);\n\n new Thread() {\n public void run() {\n progress.setValue(0);\n progress.setStringPainted(true);\n// Download.downloadArquivo(site, path);\n for (int i = 0; i < 101; i++) {\n progress.setValue(i);\n progress.setString(i + \"%\");\n try {\n Thread.sleep(100);\n } catch (InterruptedException err) {\n\n }\n if (i == 5) {\n lbMsg.setText(\"Baixando arquivo.\");\n }\n if (i > 5) {\n while (resposta != true) {\n Download.downloadArquivo(site, path);\n lbMsg.setText(\"Baixando arquivo....\");\n resposta = Download.terminou;\n }\n }\n if (i == 100) {\n lbMsg.setText(\"Arquivo baixado\");\n }\n }\n }\n }.start();\n\n }", "private void onDownloadComplete(String file_name, String downloadPath) {\n\n file_name_nv=file_name;\n getstartshow(file_name_nv);\n }", "public java.lang.CharSequence download(java.lang.String appId, java.lang.String url, long duration, java.lang.String folder) throws android.os.RemoteException;", "private static void onDownloadFinished(String id, Context context) {\n switch (id) {\n case Constants.WORDNET:\n Intent intent = new Intent(context, UnzipService.class);\n intent.putExtra(UnzipService.INTENT_KEY_DICT_NAME, id);\n context.startService(intent);\n break;\n default:\n Timber.w(\"No relevant download found for \" + id + \" doing nothing on download complete\");\n break;\n }\n }", "@SuppressWarnings(\"deprecation\")\r\n @Override\r\n public AvailableStatus requestFileInformation(final DownloadLink link) throws IOException, PluginException {\r\n br = new Browser();\r\n // need to correct links that are added prior to fixing!\r\n correctDownloadLink(link);\r\n prepBrowser(br);\r\n br.setFollowRedirects(true);\r\n final URLConnectionAdapter con = br.openGetConnection(link.getDownloadURL());\r\n if (con.getResponseCode() == 503 || con.getResponseCode() == 404) {\r\n con.disconnect();\r\n throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);\r\n }\r\n br.followConnection();\r\n if (br.containsHTML(\"<title>\\\\s*-\\\\s*(?:Yunfile|Dix3)[^<]*</title>\")) {\r\n throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);\r\n }\r\n // Access denied\r\n if (br.containsHTML(\"Access denied<|资源已被禁止访问</span>\")) {\r\n throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);\r\n }\r\n // Not found\r\n if (br.containsHTML(\"<span>(资源未找到|Not found)</span>\")) {\r\n throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);\r\n }\r\n /* Wrong link */\r\n if (br.containsHTML(\">Wrong</span>\")) {\r\n throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);\r\n }\r\n String filename = null, filesize = null;\r\n // if (br.getURL().matches(\"http://page\\\\d+\\\\.yunfile.com/fs/[a-z0-9]+/\")) ;\r\n filename = br.getRegex(\"Downloading:&nbsp;<a></a>&nbsp;([^<>]*) - [^<>]+<\").getMatch(0);\r\n if (filename == null) {\r\n filename = br.getRegex(\"<title>(.*?)\\\\s*-\\\\s*(?:Yunfile|Dix3)[^<]*</title>\").getMatch(0);\r\n }\r\n if (filename == null) {\r\n filename = br.getRegex(\"<h2 class=\\\"title\\\">文件下载\\\\&nbsp;\\\\&nbsp;([^<>\\\"]*?)</h2>\").getMatch(0);\r\n }\r\n filesize = br.getRegex(\"文件大小: <b>([^<>\\\"]*?)</b>\").getMatch(0);\r\n if (filesize == null) {\r\n filesize = br.getRegex(\"File Size: <b>([^<>\\\"]*?)</b>\").getMatch(0);\r\n }\r\n if (filesize == null) {\r\n filesize = br.getRegex(\"id=\\\"file_show_filename\\\">[^<>]+</span> \\\\- ([^<>\\\"]+) <\").getMatch(0);\r\n }\r\n if (filename == null) {\r\n throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);\r\n }\r\n link.setName(decode(\"111\", filename.trim()));\r\n link.setDownloadSize(SizeFormatter.getSize(filesize));\r\n return AvailableStatus.TRUE;\r\n }", "public static void httpDownload(String url, FileOutputStream file) throws Exception {\r\n \t\tDefaultHttpClient client = new DefaultHttpClient();\r\n \t\tHttpResponse response = client.execute(new HttpGet(url));\r\n \t\tif(response.getStatusLine().getStatusCode() < 400){\r\n \t\t\tBufferedOutputStream writer = null;\r\n \t\t\tBufferedInputStream reader = null;\r\n \t\t\ttry {\r\n \t\t\t\twriter = new BufferedOutputStream(file);\r\n \t\t\t\treader = new BufferedInputStream(response.getEntity().getContent());\r\n \r\n \t\t\t\tbyte[] buffer = new byte[BUF_SIZE];\r\n \t\t\t\tint bytesRead = reader.read(buffer);\r\n \r\n \t\t\t\twhile (bytesRead > 0) {\r\n \t\t\t\t\twriter.write(buffer, 0, bytesRead);\r\n \t\t\t\t\tbytesRead = reader.read(buffer);\r\n \t\t\t\t}\r\n \t\t\t} finally {\r\n \t\t\t\tif (writer != null) {\r\n \t\t\t\t\twriter.close();\r\n \t\t\t\t}\r\n \t\t\t\tif (reader != null) {\r\n \t\t\t\t\treader.close();\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t}", "public interface DownloadData {\n public void download();\n public String getFileLocation();\n}", "public interface Downloader {\n void download(String fileLink);\n\n}", "private void manageDownloadZipFile(HttpServletRequest request, HttpServletResponse response, String folderName, String exportFileName) {\n\t\tlogger.debug(\"IN\");\n\t\ttry {\n\t\t\tString fileExtension = \"zip\";\n\t\t\tmanageDownload(exportFileName, fileExtension, folderName, response, false);\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"Error while downloading importation log file\", e);\n\t\t} finally {\n\t\t\tlogger.debug(\"OUT\");\n\t\t}\n\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n try{\n final DownloadManager downloadManager = DownloadManager.getInstance();\n String downloadUrl = jTextField1.getText();\n String qQString = \"http://dldir1.qq.com/qqfile/qq/QQ2013/QQ2013Beta2.exe\";\n String fileName = jTextField2.getText();\n final DownloadMission downloadMission;\n downloadMission = new DownloadMission(qQString, jFileChooser1.getCurrentDirectory().getName(), \"Sample\");\n downloadManager.addMission(downloadMission);\n \n jButton2 = new JButton();\n jButton2.addActionListener(new ActionListener() {\n\n @Override\n public void actionPerformed(ActionEvent e) {\n downloadManager.start();\n }\n });\n add(jButton2);\n downloadManager.start();\n //initialise the progress bar with a counter\n int counter = 0;\n while(true){\n jProgressBar1.setMinimum(0);\n jProgressBar1.setMaximum(Integer.parseInt(downloadManager.getReadableDownloadSize()));\n \n jTextField3.setText(downloadManager.getReadableTotalSpeed());\n jTextField4.setText(downloadManager.getReadableDownloadSize());\n counter++;\n }\n \n \n } catch (IOException ex) {\n Logger.getLogger(DownloadInterface.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n int result;\n \n jFileChooser1 = new JFileChooser();\n jFileChooser1.setCurrentDirectory(new java.io.File(\" \"));\n jFileChooser1.setDialogTitle(chooserTitle);\n jFileChooser1.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n \n //disable all files option\n jFileChooser1.setAcceptAllFileFilterUsed(false);\n if (jFileChooser1.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) { \n System.out.println(\"getCurrentDirectory(): \" \n + jFileChooser1.getCurrentDirectory());\n System.out.println(\"getSelectedFile() : \" \n + jFileChooser1.getSelectedFile());\n }\n else {\n System.out.println(\"No Selection \");\n }\n }", "@Override\n public void onClick(View v) {\n \tIntent in = new Intent(getApplicationContext(), DownloadFile.class);\n in.putExtra(\"url\", url_get_file);\n startActivityForResult(in, 100);\n }", "public void processDownloadRequest(DownloadParams p_params)\n throws OfflineEditorManagerException, RemoteException\n {\n m_localInstance.processDownloadRequest(p_params);\n }", "@Override\n\tpublic void handleDownloadThreadUpdate(final DownloadTask dt) {\n\t\t// we want to modify the progress bar so we need to do it from the UI thread \n\t\t// how can we make sure the code runs in the UI thread? use the handler!\n\t\thandler.post(new Runnable() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tint total = downloadThread.getTotalQueued();\n\t\t\t\tint completed = downloadThread.getTotalCompleted();\n\n\t\t\t\t//System.out.println(\"progress so far: \" + completed + \" / \" + total);\n\n\t\t\t\tif(dt instanceof NfcTagServerTask)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\thandleBusStop((String) dt.getResult());\n\t\t\t\t\tsetProgressBarVisible(false);\n\t\t\t\t}\n\n\n\n\n\t\t\t}\n\t\t});\n\t}", "private void startDownload() {\n Uri uri = Uri.parse( data.getStringExtra(PARAM_URL) );\n dm = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);\n DownloadManager.Request request = new DownloadManager.Request( uri );\n request.setAllowedNetworkTypes( DownloadManager.Request.NETWORK_MOBILE | DownloadManager.Request.NETWORK_WIFI)\n //移动网络情况下是否允许漫游。\n .setAllowedOverRoaming(false)\n .setTitle(\"更新\") // 用于信息查看\n .setDescription(\"下载apk\"); // 用于信息查看\n //利用此属性下载后使用响应程序打开下载文件\n //request.setMimeType(\"application/vnd.android.package-archive\");\n request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, new Date().getTime()+\".apatch\");\n enqueue = dm.enqueue(request);\n }" ]
[ "0.73691773", "0.71886945", "0.7187271", "0.69529337", "0.69159573", "0.6835097", "0.6826852", "0.6756932", "0.667923", "0.66120476", "0.6570864", "0.6542778", "0.6541426", "0.65284246", "0.6465502", "0.64262384", "0.64221835", "0.6420958", "0.6385199", "0.6371847", "0.6339602", "0.63320756", "0.6319375", "0.63163084", "0.63149583", "0.62770826", "0.62583065", "0.6257935", "0.6242307", "0.6240008", "0.62372994", "0.6229856", "0.62173253", "0.62164485", "0.620974", "0.6200403", "0.61964774", "0.6179513", "0.6170306", "0.6150988", "0.61468625", "0.6129077", "0.61199486", "0.6116644", "0.6113927", "0.6108232", "0.61059356", "0.61040974", "0.61001056", "0.6099681", "0.60992193", "0.60852844", "0.6056516", "0.60342395", "0.60333157", "0.60273063", "0.602546", "0.6020828", "0.6009112", "0.59932137", "0.59927183", "0.59863347", "0.59838176", "0.5973441", "0.5969814", "0.59684217", "0.5965661", "0.5961344", "0.5954865", "0.5932458", "0.59292877", "0.5927217", "0.5925534", "0.5913911", "0.5904776", "0.59001374", "0.58762395", "0.58731544", "0.58695877", "0.58659583", "0.5865466", "0.5864383", "0.58642185", "0.5857663", "0.5856574", "0.5854598", "0.58504087", "0.585017", "0.58214176", "0.5812589", "0.58019286", "0.57758886", "0.5771281", "0.5766421", "0.57615054", "0.5761467", "0.5753195", "0.5750482", "0.5732618", "0.5730153", "0.57277846" ]
0.0
-1
Handles an EDA request
public Map<String, String> runEDARequest(DvnRJobRequest sro, RConnection c){ String optionBanner = "########### EDA option ###########\n"; dbgLog.fine(optionBanner); historyEntry.add(optionBanner); Map<String, String> sr = new HashMap<String, String>(); sr.put("requestdir", requestdir); sr.put("option", "eda"); sr.put("type", sro.getEDARequestType()); // 1=(1,0), 2=(0,1), 3=(1,1) String ResultHtmlFile = "Rout."+PID+".html" ; sr.put("html", "/"+requestdir+ "/" +ResultHtmlFile); String RcodeFile = "Rcode." + PID + ".R"; try { String univarStatLine = "try(x<-univarStat(dtfrm=x))"; //String vdcUtilLibLine = "library(VDCutil)"; //c.voidEval("dol<-''"); dbgLog.fine("aol="+ sro.getEDARequestParameter()); String aol4EDA = "aol<-c("+ sro.getEDARequestParameter() +")"; dbgLog.fine("aolLine="+ aol4EDA); historyEntry.add(aol4EDA); c.voidEval(aol4EDA); // create a manifest page for this job request String homePageTitle = "Dataverse Analysis: Request #"+PID ; // create a temp dir String createTmpDir = "dir.create('"+wrkdir +"')"; dbgLog.fine("createTmpDir="+createTmpDir); historyEntry.add(createTmpDir); c.voidEval(createTmpDir); String ResultHtmlFileBase = "Rout."+PID ; String openHtml = "htmlsink<-HTMLInitFile(outdir = '"+ wrkdir +"', filename='"+ResultHtmlFileBase+ "', extension='html', CSSFile='R2HTML.css', Title ='"+ homePageTitle+"')"; dbgLog.fine("openHtml="+openHtml); historyEntry.add(openHtml); c.voidEval(openHtml); String StudyTitle = sro.getStudytitle(); String pageHeaderContents = "hdrContents <- \"<h1>Dataverse Analysis</h1><h2>Results</h2><p>Study Title:"+ StudyTitle+"</p><hr />\""; dbgLog.fine("pageHeaderContents="+pageHeaderContents); historyEntry.add(pageHeaderContents); c.voidEval(pageHeaderContents); String pageHeader = "HTML(file=htmlsink,hdrContents)"; dbgLog.fine("pageHeader="+pageHeader); historyEntry.add(pageHeader); c.voidEval(pageHeader); // create visuals directory for an EDA case String createVisualsDir = "dir.create('"+ wrkdir + "/" + "visuals" +"')"; dbgLog.fine("visualsDir="+createVisualsDir); historyEntry.add(createVisualsDir); c.voidEval(createVisualsDir); // command lines dbgLog.fine("univarStatLine="+univarStatLine); c.voidEval(univarStatLine); historyEntry.add(univarStatLine); String univarChart = "try({x<-univarChart(dtfrm=x, " + "analysisoptn=aol, " + "imgflprfx='" + wrkdir + "/" + "visuals" + "/" + "Rvls." + PID + "',standalone=F)})"; dbgLog.fine("univarChart="+univarChart); historyEntry.add(univarChart); c.voidEval(univarChart); String univarStatHtmlBody = "try(univarStatHtmlBody(dtfrm=x,"+ "whtml=htmlsink, analysisoptn=aol))"; dbgLog.fine("univarStatHtmlBody="+univarStatHtmlBody); historyEntry.add(univarStatHtmlBody); c.voidEval(univarStatHtmlBody); String closeHtml = "HTMLEndFile()"; historyEntry.add(closeHtml); c.voidEval(closeHtml); // save workspace String objList = "objList<-ls()"; dbgLog.fine("objList="+objList); c.voidEval(objList); String RdataFileName = "Rworkspace."+PID+".RData"; sr.put("Rdata", "/"+requestdir+ "/" + RdataFileName); String saveWS = "save(list=objList, file='"+ wrkdir +"/"+ RdataFileName +"')"; dbgLog.fine("save the workspace="+saveWS); c.voidEval(saveWS); // write back the R workspace to the dvn String wrkspFileName = wrkdir +"/"+ RdataFileName; dbgLog.fine("wrkspFileName="+wrkspFileName); int wrkspflSize = getFileSize(c,wrkspFileName); File wsfl = writeBackFileToDvn(c, wrkspFileName, RWRKSP_FILE_PREFIX,"RData", wrkspflSize); if (wsfl != null){ sr.put("wrkspFileName", wsfl.getAbsolutePath()); dbgLog.fine("wrkspFileName="+wsfl.getAbsolutePath()); } else { dbgLog.fine("wrkspFileName is null"); } // command history String[] ch = (String[])historyEntry.toArray(new String[historyEntry.size()]); c.assign("ch", new REXPString(ch)); String saveRcodeFile = "cat(file='"+ wrkdir +"/"+ RcodeFile +"',paste(ch,collapse='\n'))"; dbgLog.fine(saveRcodeFile); c.voidEval(saveRcodeFile); // copy the dvn-patch css file to the wkdir // file.copy(from, to, overwrite = FALSE) String cssFile = R2HTML_CSS_DIR + "/" +"R2HTML.css"; String cpCssFile = "file.copy('"+cssFile+"','"+wrkdir+"')"; c.voidEval(cpCssFile); // tab data file String mvTmpTabFile = "file.rename('"+ tempFileName +"','"+ tempFileNameNew +"')"; c.voidEval(mvTmpTabFile); dbgLog.fine("move temp file="+mvTmpTabFile); // move the temp dir to the web-temp root dir String mvTmpDir = "file.rename('"+wrkdir+"','"+webwrkdir+"')"; dbgLog.fine("web-temp_dir="+mvTmpDir); c.voidEval(mvTmpDir); } catch (RserveException rse) { rse.printStackTrace(); sr.put("RexecError", "true"); return sr; } sr.put("RexecError", "false"); return sr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void incomingExtendedServicesRequest(APDUEvent e)\n {\n LOGGER.finer(\"Incoming extendedServicesRequest\");\n }", "protected void handleRequest(dk.i1.diameter.Message request, ConnectionKey connkey, Peer peer) {\n\n String log = \"\";\n Message answer = new Message();\n answer.prepareResponse(request);\n AVP avp;\n avp = request.find(ProtocolConstants.DI_SESSION_ID);\n if (avp != null)\n answer.add(avp);\n node().addOurHostAndRealm(answer);\n //avp = request.find(ProtocolConstants.DI_CC_REQUEST_TYPE); DIAMETER_COMMAND_AA\n avp = request.find(ProtocolConstants.DI_AUTH_REQUEST_TYPE);\n if (avp == null) {\n answerError(answer, connkey, ProtocolConstants.DIAMETER_RESULT_MISSING_AVP,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_FAILED_AVP, new AVP[]{new AVP(ProtocolConstants.DI_AUTH_REQUEST_TYPE, new byte[]{})})});\n return;\n }\n\n\n int aa_request_type = -1;\n try {\n aa_request_type = new AVP_Unsigned32(avp).queryValue();\n } catch (InvalidAVPLengthException ex) {\n }\n if (aa_request_type != ProtocolConstants.DI_AUTH_REQUEST_TYPE_AUTHENTICATE &&\n aa_request_type != ProtocolConstants.DI_AUTH_REQUEST_TYPE_AUTHENTICATE_ONLY &&\n aa_request_type != ProtocolConstants.DI_AUTH_REQUEST_TYPE_AUTHORIZE_ONLY) {\n answerError(answer, connkey, ProtocolConstants.DIAMETER_RESULT_INVALID_AVP_VALUE,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_FAILED_AVP, new AVP[]{avp})});\n return;\n }\n\n\n\n avp = request.find(ProtocolConstants.DI_AUTH_APPLICATION_ID);\n if (avp != null)\n answer.add(avp);\n avp = request.find(ProtocolConstants.DI_AUTH_REQUEST_TYPE);\n if (avp != null)\n answer.add(avp);\n\n\n switch (aa_request_type) {\n case ProtocolConstants.DI_AUTH_REQUEST_TYPE_AUTHENTICATE_ONLY:\n case ProtocolConstants.DI_AUTH_REQUEST_TYPE_AUTHENTICATE:\n //grant whatever is requested\n avp = request.find(ProtocolConstants.DI_USER_NAME);\n answer.add(avp);\n String userName = new AVP_UTF8String(avp).queryValue();\n avp = request.find(ProtocolConstants.DI_USER_PASSWORD);\n String userPassword = new AVP_UTF8String(avp).queryValue();\n\n\n synchronized (PrintedStrings.stringsToPrint) {\n System.out.println(log = \"UserName: \" + userName);\n PrintedStrings.stringsToPrint.add(log);\n System.out.println(log = \"password: \" + userPassword);\n PrintedStrings.stringsToPrint.add(log);\n\n //TODO Sprawdzic to jesli nie ma z w slowniku\n String pass = userToPasswordDict.get(userName);\n if (pass == null) {\n System.out.println(log=\"nie ma takiego uzytkownika\");\n\n PrintedStrings.stringsToPrint.add(log);\n }\n if (userPassword.equals(pass)) {\n\n avp = request.find(ProtocolConstants.DI_CHAP_AUTH);\n if (avp != null) {\n try {\n AVP_Grouped chapAuth = new AVP_Grouped(avp);\n AVP[] elements = chapAuth.queryAVPs();\n byte[] idBytes = new AVP_OctetString(elements[1]).queryValue();\n char id = (char) idBytes[0];\n System.out.println(log = \"id: \" + id);\n PrintedStrings.stringsToPrint.add(log);\n\n byte[] chapResponseBytes = new AVP_OctetString(elements[2]).queryValue();\n printBytesAsString(chapResponseBytes, \"odebrane rozwiazanie \");\n log = getBytesAsString(chapResponseBytes, \"odebrane rozwiazanie \");\n PrintedStrings.stringsToPrint.add(log);\n\n byte[] chapChallengeBytes = new AVP_OctetString(elements[3]).queryValue();\n printBytesAsString(chapChallengeBytes, \"odebrane zadanie \");\n log = getBytesAsString(chapResponseBytes, \"odebrane zadanie \");\n PrintedStrings.stringsToPrint.add(log);\n\n //sprawdzenie czy nie ma ataku przez odtwarzanie\n ServicingUserEntry sessionEntry = curentlyServicing.get(userName);\n if (sessionEntry == null) {\n System.out.println(log = \"Atak/ pakiet dotarl po upłynieciu czasu oczekiwania/ pakiet został powtórzony\");\n //w takiej sytuacji nie odpowiadamy wcale\n PrintedStrings.stringsToPrint.add(log);\n return;\n }\n Date now = new Date();\n if (id != sessionEntry.getId() ||\n !Arrays.equals(chapChallengeBytes, sessionEntry.getChallenge()) ||\n (now.getTime() - sessionEntry.getTime().getTime()) > 5000) {\n\n System.out.println(log = \"Atak/ pakiet dotarl po upłynieciu czasu oczekiwania/ przekłamanie pakietu\");\n //w takiej sytuacji nie odpowiadamy wcale\n PrintedStrings.stringsToPrint.add(log);\n return;\n }\n curentlyServicing.remove(userName);\n byte[] md5 = caluculateMD5(idBytes, userToSecretDict.get(userName).getBytes(\"ASCII\"), chapChallengeBytes);\n printBytesAsString(chapResponseBytes, \"obliczone rozwiazanie \");\n log = getBytesAsString(chapResponseBytes, \"obliczone rozwiazanie \");\n PrintedStrings.stringsToPrint.add(log);\n\n if (Arrays.equals(chapResponseBytes, md5)) {\n\n answer.add(new AVP_OctetString(ProtocolConstants.DI_FRAMED_IP_ADDRESS, clusterAddress.getBytes()));\n answer.add(new AVP_Unsigned32(ProtocolConstants.DI_RESULT_CODE, ProtocolConstants.DIAMETER_RESULT_SUCCESS));\n System.out.println(log = \"Uwierzytelnionio, pozwalam na dołaczenie do klastra\");\n PrintedStrings.stringsToPrint.add(log);\n } else {\n answer.add(new AVP_Unsigned32(ProtocolConstants.DI_RESULT_CODE, ProtocolConstants.DIAMETER_RESULT_AUTHENTICATION_REJECTED));\n System.out.println(log = \"Błędnie rozwiązane zadanie\");\n PrintedStrings.stringsToPrint.add(log);\n }\n } catch (InvalidAVPLengthException e) {\n e.printStackTrace();\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n\n } else {\n answer.add(new AVP_Unsigned32(ProtocolConstants.DI_RESULT_CODE, ProtocolConstants.DIAMETER_RESULT_MULTI_ROUND_AUTH));\n //zwiekszamy ostatnio uzywany index o 1 i korzystamy z niego\n incrementIndex();\n byte[] ind = new byte[]{(byte) lastId};\n byte[] challenge = generateChallenge();\n printBytesAsString(challenge, \"wygenerowane zadanie \");\n log = getBytesAsString(challenge, \"wygenerowane zadanie \");\n PrintedStrings.stringsToPrint.add(log);\n\n\n curentlyServicing.put(userName, new ServicingUserEntry(userName, challenge, lastId));\n //System.out.println(\"generated chalenge : \" + challenge.toString());\n answer.add(new AVP_Grouped(ProtocolConstants.DI_CHAP_AUTH,\n new AVP_Integer32(ProtocolConstants.DI_CHAP_ALGORITHM, 5),\n new AVP_OctetString(ProtocolConstants.DI_CHAP_IDENT, ind),\n new AVP_OctetString(ProtocolConstants.DI_CHAP_CHALLENGE, challenge)));\n\n\n if(lastId==34)\n serverGUIController.firstInClaster = true; //TODO obsluz wszsytkich\n if(lastId==35)\n serverGUIController.secondInClaster = true;\n if(lastId==36)\n serverGUIController.thirdInClaster = true;\n if(lastId==37)\n serverGUIController.fourthInClaster = true;\n }\n } else {\n answer.add(new AVP_Unsigned32(ProtocolConstants.DI_RESULT_CODE, ProtocolConstants.DIAMETER_RESULT_AUTHENTICATION_REJECTED));\n log=\"podane hasło jest niepoprawne\";\n PrintedStrings.stringsToPrint.add(log);\n }\n }\n case ProtocolConstants.DI_AUTH_REQUEST_TYPE_AUTHORIZE_ONLY:\n break;\n }\n\n Utils.setMandatory_RFC3588(answer);\n\n try {\n answer(answer, connkey);\n } catch (dk.i1.diameter.node.NotAnAnswerException ex) {\n }\n\n switch (lastId) {\n case 34: {\n serverGUIController.firstConnected = true;\n serverGUIController.firstTextClear = true;\n break;\n }\n case 35:{\n serverGUIController.secondConnected = true;\n serverGUIController.secondTextClear = true;\n break;\n }\n case 36:{\n serverGUIController.thirdConnected = true;\n serverGUIController.thirdTextClear = true;\n break;\n }\n case 37:{\n serverGUIController.fourthCOnnected = true;\n serverGUIController.fourthTextClear = true;\n break;\n }\n\n }\n\n }", "public void handle(Object e){\n\t\tif(e.getClass().equals(GetResultRequestEvent.class)){\n\t\t\tgetResults((GetResultRequestEvent)e);\n\t\t}else if(e.getClass().equals(RefreshAllDataEvent.class)){\n\t\t\ttf.getData(app);\n\t\t}else if(e.getClass().equals(ExportDataEvent.class)){\n\t\t\ttf.exportItemDB();\n\t\t}\n\t}", "public void incomingAccessControlRequest(APDUEvent e)\n {\n LOGGER.finer(\"Incoming accessControlRequest\");\n }", "public void incomingSegmentRequest(APDUEvent e)\n {\n LOGGER.finer(\"Incoming segmentRequest\");\n }", "public void incomingAccessControlResponse(APDUEvent e)\n {\n LOGGER.finer(\"Incoming AccessControlResponse\");\n }", "@SuppressWarnings(\"unchecked\")\n private <E> void handleRequest(ApiRequest<E> request) {\n\n try {\n apiAdapter\n .invokeAsync(request.target)\n .subscribe(new Responder<E>(request, this::writeResponse));\n } catch (Exception e) {\n System.out.println(\"Something went wrong while trying to invoke an ApiAdapter function\");\n e.printStackTrace();\n }\n }", "public void beginExecute(WebRequest request) throws Exception {\r\n request.addParameter(\"aid\", \"123\");\r\n }", "@Override\n protected void handleRequest(final Message request, final ConnectionKey connkey, final Peer peer) {\n final Message answer = new Message();\n answer.prepareResponse(request);\n AVP avp;\n avp = request.find(ProtocolConstants.DI_SESSION_ID);\n if (avp != null) {\n answer.add(avp);\n }\n node().addOurHostAndRealm(answer);\n avp = request.find(ProtocolConstants.DI_CC_REQUEST_TYPE);\n if (avp == null) {\n answerError(answer, connkey, ProtocolConstants.DIAMETER_RESULT_MISSING_AVP,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_FAILED_AVP,\n new AVP[]{new AVP(ProtocolConstants.DI_CC_REQUEST_TYPE, new byte[]{})})});\n return;\n }\n final int ccRequestType; // = -1;\n try {\n ccRequestType = new AVP_Unsigned32(avp).queryValue();\n } catch (final InvalidAVPLengthException ex) {\n throw new AssertionError(\"Unexpected exception: \" + ex, ex);\n }\n if (ccRequestType != ProtocolConstants.DI_CC_REQUEST_TYPE_INITIAL_REQUEST\n && ccRequestType != ProtocolConstants.DI_CC_REQUEST_TYPE_UPDATE_REQUEST\n && ccRequestType != ProtocolConstants.DI_CC_REQUEST_TYPE_TERMINATION_REQUEST\n && ccRequestType != ProtocolConstants.DI_CC_REQUEST_TYPE_EVENT_REQUEST) {\n answerError(answer, connkey, ProtocolConstants.DIAMETER_RESULT_INVALID_AVP_VALUE,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_FAILED_AVP, new AVP[]{avp})});\n return;\n }\n\n //This test server does not support multiple-services-cc\n avp = request.find(ProtocolConstants.DI_MULTIPLE_SERVICES_CREDIT_CONTROL);\n if (avp != null) {\n answerError(answer, connkey, ProtocolConstants.DIAMETER_RESULT_INVALID_AVP_VALUE,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_FAILED_AVP, new AVP[]{avp})});\n return;\n }\n avp = request.find(ProtocolConstants.DI_MULTIPLE_SERVICES_INDICATOR);\n if (avp != null) {\n int indicator = -1;\n try {\n indicator = new AVP_Unsigned32(avp).queryValue();\n } catch (final InvalidAVPLengthException ex) {\n throw new AssertionError(\"Unexpected exception: \" + ex, ex);\n }\n if (indicator != ProtocolConstants.DI_MULTIPLE_SERVICES_INDICATOR_MULTIPLE_SERVICES_NOT_SUPPORTED) {\n answerError(answer, connkey, ProtocolConstants.DIAMETER_RESULT_INVALID_AVP_VALUE,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_FAILED_AVP, new AVP[]{avp})});\n return;\n }\n }\n\n answer.add(new AVP_Unsigned32(ProtocolConstants.DI_RESULT_CODE, ProtocolConstants.DIAMETER_RESULT_SUCCESS));\n avp = request.find(ProtocolConstants.DI_AUTH_APPLICATION_ID);\n if (avp != null) {\n answer.add(avp);\n }\n avp = request.find(ProtocolConstants.DI_CC_REQUEST_TYPE);\n if (avp != null) {\n answer.add(avp);\n }\n avp = request.find(ProtocolConstants.DI_CC_REQUEST_NUMBER);\n if (avp != null) {\n answer.add(avp);\n }\n\n switch (ccRequestType) {\n case ProtocolConstants.DI_CC_REQUEST_TYPE_INITIAL_REQUEST:\n case ProtocolConstants.DI_CC_REQUEST_TYPE_UPDATE_REQUEST:\n case ProtocolConstants.DI_CC_REQUEST_TYPE_TERMINATION_REQUEST:\n //grant whatever is requested\n avp = request.find(ProtocolConstants.DI_REQUESTED_SERVICE_UNIT);\n if (avp != null) {\n final AVP g = new AVP(avp);\n g.code = ProtocolConstants.DI_GRANTED_SERVICE_UNIT;\n answer.add(avp);\n }\n break;\n case ProtocolConstants.DI_CC_REQUEST_TYPE_EVENT_REQUEST:\n //examine requested-action\n avp = request.find(ProtocolConstants.DI_REQUESTED_ACTION);\n if (avp == null) {\n answerError(answer, connkey, ProtocolConstants.DIAMETER_RESULT_MISSING_AVP,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_FAILED_AVP,\n new AVP[]{new AVP(ProtocolConstants.DI_REQUESTED_ACTION, new byte[]{})})});\n return;\n }\n int requestedAction = -1;\n try {\n requestedAction = new AVP_Unsigned32(avp).queryValue();\n } catch (final InvalidAVPLengthException ex) {\n throw new AssertionError(\"Unexpected exception: \" + ex, ex);\n }\n switch (requestedAction) {\n case ProtocolConstants.DI_REQUESTED_ACTION_DIRECT_DEBITING:\n //nothing. just indicate success\n break;\n case ProtocolConstants.DI_REQUESTED_ACTION_REFUND_ACCOUNT:\n //nothing. just indicate success\n break;\n case ProtocolConstants.DI_REQUESTED_ACTION_CHECK_BALANCE:\n //report back that the user has sufficient balance\n answer.add(new AVP_Unsigned32(ProtocolConstants.DI_CHECK_BALANCE_RESULT,\n ProtocolConstants.DI_DI_CHECK_BALANCE_RESULT_ENOUGH_CREDIT));\n break;\n case ProtocolConstants.DI_REQUESTED_ACTION_PRICE_ENQUIRY:\n //report back a price of DKK42.17 per kanelsnegl\n answer.add(new AVP_Grouped(ProtocolConstants.DI_COST_INFORMATION,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_UNIT_VALUE,\n new AVP[]{new AVP_Integer64(ProtocolConstants.DI_VALUE_DIGITS, 4217),\n new AVP_Integer32(ProtocolConstants.DI_EXPONENT, -2)\n }),\n new AVP_Unsigned32(ProtocolConstants.DI_CURRENCY_CODE, 208),\n new AVP_UTF8String(ProtocolConstants.DI_COST_UNIT, \"kanelsnegl\")\n }));\n break;\n default: {\n answerError(answer, connkey, ProtocolConstants.DIAMETER_RESULT_INVALID_AVP_VALUE,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_FAILED_AVP, new AVP[]{avp})});\n return;\n }\n\n }\n break;\n default:\n throw new AssertionError(\"Unexpected value:\" + ccRequestType);\n }\n\n Utils.setMandatory_RFC3588(answer);\n\n try {\n answer(answer, connkey);\n } catch (final NotAnAnswerException ex) {\n throw new AssertionError(\"Unexpected exception: \" + ex, ex);\n }\n }", "void handleRequest();", "public void incomingSearchRequest(APDUEvent e)\n {\n LOGGER.finer(\"Processing incomingSearch_Request\");\n \n SearchRequest_type search_request = (SearchRequest_type) (e.getPDU().o);\n \n // Create a search response\n PDU_type pdu = new PDU_type();\n pdu.which=PDU_type.searchresponse_CID;\n SearchResponse_type response = new SearchResponse_type();\n pdu.o = response;\n \n int ssub = search_request.smallSetUpperBound.intValue();\n int lslb = search_request.largeSetLowerBound.intValue();\n int mspn = search_request.mediumSetPresentNumber.intValue();\n \n LOGGER.finer(\"ssub = \" + ssub + \" lslb = \" + lslb + \" mspn = \" + mspn);\n \n response.referenceId = search_request.referenceId; \n \n // Assume failure unless something below sets to true\n response.searchStatus = Boolean.FALSE;\n \n RootNode rn = null;\n \n try\n {\n switch(search_request.query.which)\n {\n case Query_type.type_0_CID:\n LOGGER.finer(\"Processing Any Query\");\n // Any\n break;\n case Query_type.type_1_CID:\n case Query_type.type_101_CID:\n // RPN query\n LOGGER.finer(\"Processing RPN Query\");\n rn = com.k_int.z3950.util.RPN2Internal.zRPNStructure2RootNode\n \t ((RPNQuery_type)(search_request.query.o));\n break;\n case Query_type.type_2_CID:\n case Query_type.type_100_CID:\n case Query_type.type_102_CID:\n LOGGER.finer(\"Processing OctetString Query\");\n // Octet String\n break;\n }\n \n if ( rn != null )\n {\n LOGGER.finer(\"Got root node\");\n \n IRQuery q = new IRQuery();\n q.collections = search_request.databaseNames;\n q.query = new com.k_int.IR.QueryModels.RPNTree(rn);\n \n // Process the query\n LOGGER.finer(\"Create Search Task with query:\" + q);\n SearchTask st = search_service.createTask\n \t (q, search_request.referenceId);\n \t\n \n // Evaluate the query, waiting 10 seconds for the task to complete. \n \t//We really want to be\n // able to pass in a predicate to wait for here, \n \t//e.g. evaluate(10000, \"NumHits > 100 OR Status=Complete\");\n LOGGER.finer(\"Evaluate Search Task\");\n try\n {\n st.evaluate(10000);\n }\n catch ( TimeoutExceededException tee )\n {\n LOGGER.finer(\"Timeout exceeded waiting for search to complete\");\n }\n \n if ( search_request.resultSetName != null ) {\n \t LOGGER.finer(\"putting st with name \" + \n \t\t\t search_request.resultSetName);\n \t active_searches.put(search_request.resultSetName, st);\n \t}\n \tactive_searches.put(\"Default\", st);\n \t\n // Result records processing\n int result_count = st.getTaskResultSet().getFragmentCount();\n LOGGER.finer(\"result count is \"+result_count);\n \n // Number of hits\n response.resultCount = BigInteger.valueOf(result_count);\n \n // Figure out Search Status\n if ( ( st.getTaskStatusCode() != SearchTask.TASK_FAILURE ) )\n {\n response.searchStatus = Boolean.TRUE;\n }\n else\n {\n // Figure out Result Set Status\n switch ( st.getTaskStatusCode() )\n {\n case SearchTask.TASK_EXECUTING_ASYNC:\n case SearchTask.TASK_EXECUTING_SYNC:\n // resultSetStatus = 2 (interim) Partial results available, \n \t\t//not necessarily valid\n response.resultSetStatus = BigInteger.valueOf(2);\n break;\n case SearchTask.TASK_FAILURE:\n // resultSetStatus = 3 (none) No result set\n response.resultSetStatus = BigInteger.valueOf(3);\n break;\n }\n }\n \n LOGGER.finer(\"Is \"+result_count+\" <= \"+lslb +\" or <= \"+ssub);\n \n if ( ( result_count <= lslb ) || ( result_count <= ssub ) )\n {\n LOGGER.finer(\"Yep\");\n \n int start = 1;\n int count = ( result_count <= ssub ? result_count : mspn );\n \n if ( count > 0 )\n \t {\n \t\t LOGGER.finer(\"Asking for \"+count+\n \t\t\t \" response records from \"+start);\n \t\t LOGGER.finer(\"Search request default = \" \n \t\t\t + search_request.preferredRecordSyntax);\n \t\t response.records = createRecordsFor\n \t\t (st, search_request.preferredRecordSyntax, start, \n \t\t count, GeoProfile.BREIF_SET);\n \t\t \n \n \t\t if (response.records.which == \n \t\t Records_type.responserecords_CID ){\n \t\t LOGGER.finer(\"We have records\");\n \t\t \n \t\t // Looks like we managed to present some records OK..\n \t\t response.numberOfRecordsReturned = \n \t\t\t BigInteger.valueOf(((Vector)\n \t\t\t\t\t (response.records.o)).size());\n \t\t response.nextResultSetPosition = \n \t\t\t BigInteger.valueOf(count+1);\n \t\t response.presentStatus = BigInteger.valueOf(0);\n \t\t } else { // Non surrogate diagnostics ( Single or Multiple )\n \t\t \n \t\t LOGGER.finer(\"Diagnostics\");\n \t\t response.presentStatus = BigInteger.valueOf(5);\n \t\t response.numberOfRecordsReturned = \n \t\t\t BigInteger.valueOf(0);\n \t\t response.nextResultSetPosition = \n \t\t\t BigInteger.valueOf(1);\n \t\t }\n \t } else {\n \t\t LOGGER.finer(\"No need to piggyback records....\");\n \t\t response.numberOfRecordsReturned = BigInteger.valueOf(0);\n \t\t response.nextResultSetPosition = BigInteger.valueOf(1);\n \t\t response.presentStatus = BigInteger.valueOf(0);\n \t }\n } else {\n \t response.presentStatus = BigInteger.valueOf(5);\n \t response.numberOfRecordsReturned = BigInteger.valueOf(0);\n \t response.nextResultSetPosition = BigInteger.valueOf(1); \t\n \t}\n }\n else\n \t LOGGER.finer(\"Unable to process query into root node\");\n }\n catch ( com.k_int.IR.InvalidQueryException iqe )\n \t{\n \t // Need to send a diagnostic\n \t iqe.printStackTrace();\n \t response.resultCount = BigInteger.valueOf(0);\n \t response.presentStatus = BigInteger.valueOf(5); // Failure\n \t response.numberOfRecordsReturned = BigInteger.valueOf(0);\n \t response.nextResultSetPosition = BigInteger.valueOf(0);\n \t response.resultSetStatus = BigInteger.valueOf(3);\n \t // No result set available\n \t response.records = createNSD(null, iqe.toString());\n \t}\n catch ( SearchException se )\n \t{\n \t // We need to populate a diagnostic here\n \t LOGGER.finer(\"Search returning diagnostic. Reason:\"+se.toString());\n \t se.printStackTrace();\n \t response.resultCount = BigInteger.valueOf(0);\n \t response.presentStatus = BigInteger.valueOf(5); // Failure\n \t response.numberOfRecordsReturned = BigInteger.valueOf(0);\n \t response.nextResultSetPosition = BigInteger.valueOf(0);\n \t response.resultSetStatus = BigInteger.valueOf(3); \n \t // No result set available\n \t response.records = createNSD((String)(se.additional), \n \t\t\t\t\t se.toString());\n \t}\n \n LOGGER.finer(\"Send search response : \");\n try\n \t{\n \t assoc.encodeAndSend(pdu);\n \t}\n catch ( java.io.IOException ioe )\n \t{\n \t ioe.printStackTrace();\n \t} \n }", "public InternalResultsResponse<Eventos> fetchEventosByRequest(EventoInquiryRequest request);", "public void incomingDeleteResultSetRequest(APDUEvent e)\n {\n \tLOGGER.finer(\"Incoming deleteResultSetRequest\");\n \n \tDeleteResultSetRequest_type delete_request = \n \t (DeleteResultSetRequest_type) (e.getPDU().o);\n \t\n \t// Create a DeleteResultSetResponse\n \tPDU_type pdu = new PDU_type();\n \tpdu.which=PDU_type.deleteresultsetresponse_CID;\n \tDeleteResultSetResponse_type response = \n \t new DeleteResultSetResponse_type();\n \tpdu.o = response;\n \tresponse.referenceId = delete_request.referenceId;\n \t\n \t\n \tif ( delete_request.deleteFunction.intValue() == 0 )\n \t {\n \t\t// Delete the result sets identified by \n \t\t//delete_request.resultSetList\n \t\tfor ( Enumeration task_list = \n \t\t\t delete_request.resultSetList.elements(); \n \t\t task_list.hasMoreElements(); ) {\n \t\t String next_rs = (String) task_list.nextElement();\n \t\t active_searches.remove(next_rs);\n \t\t // search_service.deleteTask(st.getTaskIdentifier());\n \t\t}\n \t }\n \telse\n \t {\n \t\t// Function must be 1 : All sets in the association\n \t\t\n \t\tactive_searches.clear();\n \t }\n \t\n \tresponse.deleteOperationStatus=BigInteger.valueOf(0); // 0 = Success, \n \t//1=resultSetDidNotExist, 2=previouslyDeletedByTarget, \n \t//3=systemProblemAtTarget\n \t// 4 = accessNotAllowed, 5=resourceControlAtOrigin\n \ttry\n \t {\n \t\tassoc.encodeAndSend(pdu);\n }\n \tcatch ( java.io.IOException ioe )\n \t {\n \t\tioe.printStackTrace();\n \t }\n }", "public void incomingResourceControlRequest(APDUEvent e)\n {\n LOGGER.finer(\"Incoming resourceControlRequest\");\n }", "@Override\r\n\t\tpublic void action() {\n\t\t\t\r\n\t\t\tACLMessage request = new ACLMessage (ACLMessage.REQUEST);\r\n\t\t\trequest.setProtocol(FIPANames.InteractionProtocol.FIPA_REQUEST);\r\n\t\t\trequest.addReceiver(new AID(\"BOAgent\",AID.ISLOCALNAME));\r\n\t\t\trequest.setLanguage(new SLCodec().getName());\t\r\n\t\t\trequest.setOntology(RequestOntology.getInstance().getName());\r\n\t\t\tInformMessage imessage = new InformMessage();\r\n\t\t\timessage.setPrice(Integer.parseInt(price));\r\n\t\t\timessage.setVolume(Integer.parseInt(volume));\r\n\t\t\ttry {\r\n\t\t\t\tthis.agent.getContentManager().fillContent(request, imessage);\r\n\t\t\t} catch (CodecException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (OntologyException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tthis.agent.addBehaviour(new AchieveREInitiator(this.agent, request)\r\n\t\t\t{\t\t\t\r\n\t\t\t/**\r\n\t\t\t\t * \r\n\t\t\t\t */\r\n\t\t\t\tprivate static final long serialVersionUID = -8866775600403413061L;\r\n\r\n\t\t\t\tprotected void handleInform(ACLMessage inform)\r\n\t\t\t\t{\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}", "@Override\n\t\tpublic void action() {\n\t\t\tMessageTemplate mt = MessageTemplate.MatchPerformative(ACLMessage.REQUEST); \n\t\t\tACLMessage msg = receive(mt);\n\t\t\tif(msg != null){\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tContentElement ce = null;\n\t\t\t\t\tSystem.out.println(msg.getContent()); //print out the message content in SL\n\n\t\t\t\t\t// Let JADE convert from String to Java objects\n\t\t\t\t\t// Output will be a ContentElement\n\t\t\t\t\tce = getContentManager().extractContent(msg);\n\t\t\t\t\tSystem.out.println(ce);\n\t\t\t\t\tif(ce instanceof Action) {\n\t\t\t\t\t\tConcept action = ((Action)ce).getAction();\n\t\t\t\t\t\tif (action instanceof SupplierOrder) {\n\t\t\t\t\t\t\tSupplierOrder order = (SupplierOrder)action;\n\t\t\t\t\t\t\t//CustomerOrder cust = order.getItem();\n\t\t\t\t\t\t\t//OrderQuantity = order.getQuantity();\n\t\t\t\t\t\t\tif(!order.isFinishOrder()) {\n\t\t\t\t\t\t\tSystem.out.println(\"exp test: \" + order.getQuantity());\n\t\t\t\t\t\t\trecievedOrders.add(order);}\n\t\t\t\t\t\t\telse {orderReciever = true;}\n\t\t\t\t\t\t\t//Item it = order.getItem();\n\t\t\t\t\t\t\t// Extract the CD name and print it to demonstrate use of the ontology\n\t\t\t\t\t\t\t//if(it instanceof CD){\n\t\t\t\t\t\t\t\t//CD cd = (CD)it;\n\t\t\t\t\t\t\t\t//check if seller has it in stock\n\t\t\t\t\t\t\t\t//if(itemsForSale.containsKey(cd.getSerialNumber())) {\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Selling CD \" + cd.getName());\n\t\t\t\t\t\t\t\t//}\n\t\t\t\t\t\t\t\t//else {\n\t\t\t\t\t\t\t\t\t//System.out.println(\"You tried to order something out of stock!!!! Check first!\");\n\t\t\t\t\t\t\t\t//}\n\n\t\t\t\t\t\t\t//}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t}\n\t\t\t\t\t//deal with bool set here\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcatch (CodecException ce) {\n\t\t\t\t\tce.printStackTrace();\n\t\t\t\t}\n\t\t\t\tcatch (OntologyException oe) {\n\t\t\t\t\toe.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\tblock();\n\t\t\t}\n\t\t}", "private void handleEntitiesQuery(RoutingContext routingContext) {\n LOGGER.debug(\"Info:handleEntitiesQuery method started.;\");\n /* Handles HTTP request from client */\n JsonObject authInfo = (JsonObject) routingContext.data().get(\"authInfo\");\n LOGGER.debug(\"authInfo : \" + authInfo);\n HttpServerRequest request = routingContext.request();\n /* Handles HTTP response from server to client */\n HttpServerResponse response = routingContext.response();\n // get query paramaters\n MultiMap params = getQueryParams(routingContext, response).get();\n MultiMap headerParams = request.headers();\n // validate request parameters\n Future<Boolean> validationResult = validator.validate(params);\n validationResult.onComplete(validationHandler -> {\n if (validationHandler.succeeded()) {\n // parse query params\n NGSILDQueryParams ngsildquery = new NGSILDQueryParams(params);\n if (isTemporalParamsPresent(ngsildquery)) {\n ValidationException ex =\n new ValidationException(\"Temporal parameters are not allowed in entities query.\");\n ex.setParameterName(\"[timerel,time or endtime]\");\n routingContext.fail(ex);\n }\n // create json\n QueryMapper queryMapper = new QueryMapper();\n JsonObject json = queryMapper.toJson(ngsildquery, false);\n Future<List<String>> filtersFuture =\n catalogueService.getApplicableFilters(json.getJsonArray(\"id\").getString(0));\n /* HTTP request instance/host details */\n String instanceID = request.getHeader(HEADER_HOST);\n json.put(JSON_INSTANCEID, instanceID);\n LOGGER.debug(\"Info: IUDX query json;\" + json);\n /* HTTP request body as Json */\n JsonObject requestBody = new JsonObject();\n requestBody.put(\"ids\", json.getJsonArray(\"id\"));\n filtersFuture.onComplete(filtersHandler -> {\n if (filtersHandler.succeeded()) {\n json.put(\"applicableFilters\", filtersHandler.result());\n if (json.containsKey(IUDXQUERY_OPTIONS)\n && JSON_COUNT.equalsIgnoreCase(json.getString(IUDXQUERY_OPTIONS))) {\n executeCountQuery(json, response);\n } else {\n executeSearchQuery(json, response);\n }\n } else {\n LOGGER.error(\"catalogue item/group doesn't have filters.\");\n }\n });\n } else if (validationHandler.failed()) {\n LOGGER.error(\"Fail: Validation failed\");\n handleResponse(response, ResponseType.BadRequestData,\n validationHandler.cause().getMessage());\n }\n });\n }", "public boolean onRequestPerformed(E content);", "public Message handleRequest(Message request){\n\n Message error = new Message(Message.GENERIC_ERROR);\n\n switch (request.getId()){\n\n case Message.LOGIN:\n return handleLogin(request);\n case Message.CREATE_DOCUMENT:\n return handleCreate(request);\n case Message.REMOVE_INVITE:\n controlServer.removeInvite(request.getUserName(),request.getDocumentName());\n return request;\n case Message.PORTIONS:\n System.out.println(\"HANDLER pre-handle: \" +request.getDocumentName());\n request.setSectionNumbers(controlServer.getPortions(request.getDocumentName()));\n return request;\n case Message.ADMINS:\n Message response = new Message(Message.ADMINS);\n response.setStringVector(new Vector<>(controlServer.getAdmins(request.getDocumentName())));\n return response;\n case Message.USERS:\n request.setStringVector(controlServer.getUserNames());\n return request;\n case Message.INVITATION:\n controlServer.addAdmin(request.getDocumentName(),request.getReceiver());\n controlServer.addInvite(request.getReceiver(),request.getDocumentName());\n request.setId(Message.INVITE_SENT);\n return request;\n case Message.GET_INVITES:\n String owner = request.getUserName();\n request.setStringVector(controlServer.getUserData(owner).getInvites());\n return request;\n case Message.GET_USERDATA:\n return handleGetUserData(request);\n case Message.LOCK:\n if(!controlServer.lock(request.getDocumentName(),request.getSectionNumbers()))\n request.setId(Message.LOCK_NOK);\n else\n request.setId(Message.LOCK_OK);\n return request;\n case Message.UNLOCK:\n if(controlServer.unlock(request.getDocumentName(),request.getSectionNumbers()))\n request.setId(Message.UNLOCK_OK);\n return request;\n case Message.EDIT:\n String DocumentName = request.getDocumentName();\n int SectionNumbers = request.getSectionNumbers();\n request.setText(controlServer.getSection(DocumentName,SectionNumbers));\n return request;\n case Message.END_EDIT:\n controlServer.editDoc(request.getDocumentName(),request.getSectionNumbers(),request.getText());\n return request;\n case Message.PRINT:\n request.setText(controlServer.getDocumentString(request.getDocumentName()));\n return request;\n case Message.SHOW:\n String text = controlServer.getSection(request.getDocumentName(),request.getSectionNumbers());\n request.setText(text);\n return request;\n default:\n controlServer.showMessage(\"unknown request\");\n break;\n }return error;\n }", "public void handleMessageEvent(StunMessageEvent e) {\n delegate.processRequest(e);\n }", "Call mo35727a(Request request);", "public void incomingResourceReportRequest(APDUEvent e)\n {\n LOGGER.finer(\"Incoming resourceReportRequest\");\n }", "public void incomingTriggerResourceControlRequest(APDUEvent e)\n {\n LOGGER.finer(\"Incoming triggetResourceControlRequest\");\n }", "private void onRequestData(int tag) {\n \ttry {\n \t data = request.request();\n \t} catch(MatjiException e) {\n \t lastOccuredException = e;\n \t}\n }", "public void handleRequest(ExtractionRequest request);", "public void incomingSortRequest(APDUEvent e)\n {\n LOGGER.finer(\"Incoming sortRequest\");\n }", "public void handleRequest(String request) throws IOException {\n\n String method = getMethod(request);\n\n this.uri = ToolBox.getUri(request);\n this.url = ToolBox.getUrl(uri);\n this.extension = ToolBox.getExtension(url);\n\n System.out.println(\"method :\" + method);\n switch (method) {\n case \"GET\":\n doGet();\n break;\n case \"POST\":\n doPost();\n break;\n case \"HEAD\":\n doHead();\n break;\n case \"PUT\":\n doPut();\n break;\n case \"DELETE\":\n doDelete();\n break;\n default:\n statusCode = BAD_REQUEST;\n this.sendHeader(statusCode, \"text/html\", null);\n break;\n }\n this.out.flush();\n this.out.close();\n }", "public void request() {\n }", "@Override\r\n\tpublic String execute(HttpServletRequest request, HttpServletResponse response ) throws CmdException {\n\t\t\r\n\t \r\n\t\tString email = \"omy@naver.com\";\r\n//\t\tSystem.out.println(email);\r\n\t\tList<QA> answerList = CacaoAdminService.getInstance().getAnswerList();\r\n\t\t\r\n\t\trequest.setAttribute(\"answerList\", answerList);\r\n\t\t\r\n\t\t\r\n\t\treturn next;\t\t\t\r\n\t}", "public void setEadid(String eadid) {\n this.eadid = eadid;\n }", "private void processDialRequest(IQRequest request) throws Exception {\n\t\t\n\t\tif (getAdminService().isQuiesceMode()) {\n\t\t\tlog.warn(\"Gateway is on Quiesce mode. Discarding incoming dial request: [%s]\", request);\n\t\t\tsendIqError(request, Type.CANCEL, Condition.SERVICE_UNAVAILABLE, \"Gateway Server is on Quiesce Mode\");\n\t\t\treturn;\n\t\t}\n\t\t\t\t\t\t\n\t\tString platformId = gatewayStorageService.getPlatformForClient(request.getFrom());\n\t\tif (platformId != null) {\t\n\t\t\tsendDialRequest(request, platformId, new ArrayList<RayoNode>(), 0);\n\t\t} else {\n\t\t\tsendIqError(request, Type.CANCEL, Condition.SERVICE_UNAVAILABLE, \n\t\t\t\t\tString.format(\"Could not find associated platform for client JID %s\",request.getFrom()));\n\t\t}\n\t}", "@Override\r\n\tpublic boolean handleEvent(Event e) {\n\t\tConnection connection = (Connection) e.get(\"connection\");\r\n\t\tClient client = (Client) connection.getService();\r\n\t\tclient.clientTimeout.interrupt();\r\n\t\tString response = (String) e.get(\"response\");\r\n\r\n\t\tswitch (response) {\r\n\t\tcase \"blank_user\":\r\n\t\t\tService.logInfo(\"Please enter a username\");\r\n\t\t\tbreak;\r\n\t\tcase \"login_success\":\r\n\t\t\tclient.setPerson((Voter) e.get(\"person\"));\r\n\t\t\tclient.setCandidates((ArrayList<Candidate>) e.get(\"candidates\"));\r\n\t\t\tclient.vote();\r\n\t\t\tbreak;\r\n\t\tcase \"incorrect_password\":\r\n\t\t\tService.logInfo(\"Bad password\");\r\n\t\t\tbreak;\r\n\t\tcase \"registered_user\":\r\n\t\t\tService.logInfo(\"registered with server.\");\r\n\t\t\tbreak;\r\n\t\tcase \"user_unregistered\":\r\n\t\t\tService.logInfo(\"Please register with server.\");\r\n\t\t\tclient.enableReg();\r\n\t\t\tbreak;\r\n\t\tcase \"already_voted\":\r\n\t\t\tService.logInfo(\"You have already voted.\");\r\n\t\t\tbreak;\n\t\tcase \"district_mismatch\":\r\n\t\t\tService.logInfo(\"Attempt to log into incorrect district\");\r\n\t\t\tbreak;\n\t\tcase \"election_not_started\":\r\n\t\t\tService.logInfo(\"Election has not started\");\r\n\t\t\tbreak;\r\n\t\tcase \"election_ended\":\r\n\t\t\tService.logInfo(\"Election has ended\");\r\n\t\t\tbreak;\t\n\t\tdefault:\r\n\t\t\tService.logWarn(\"Unknown Login Response: \" + response);\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "public void incomingInitRequest(APDUEvent e)\n {\n LOGGER.finer(\"Incoming initRequest....\");\n \n /* Impl notes: So the way jzkit works is with this a2j method, \n * asn to java. It can run automatically which is nice, but\n * the objects it generates are a little different. Basically the\n * asn for z3950 is a specification of the various requests, what\n * exactly they are. It looks like this: \n * SearchRequest ::= SEQUENCE{\n * referenceId ReferenceId OPTIONAL,\n * smallSetUpperBound [13] IMPLICIT INTEGER,\n * replaceIndicator [16] IMPLICIT BOOLEAN,\n * resultSetName [17] IMPLICIT InternationalString,\n * etc... The way jzkit deals with this is that a2j generates\n * a bunch of classes, so there is a searchRequest_type and\n * searchRequest_codec class. The type is the useful one, where\n * one can actually work with it. Most of it makes sense, but\n * one confusing part is the choice object. Many of the classes\n * are derived from it, and basically they have two important\n * fields, which and o. Which says which of the choices is stored\n * in the class, and o is the Object of that choice. So to figure\n * out what's in a class, you need to first use which, and then\n * access the object stored based on the which value. Yeah, it's\n * pretty obscure, and jzkit documentation is not that good. But \n * read through the code and it might make a little more sense. I'll\n * try to point out a few examples. */\n InitializeRequest_type init_request = \n \t(InitializeRequest_type) (e.getPDU().o); \n /* Like here, we have to cast the object held in the PDU to the\n * InitializeRequest_type class, so we can use it.*/\n \n for ( int i=0; i<Z3950Constants.z3950_option_names.length; i++ ) {\n \tif ( init_request.options.isSet(i) )\n \t LOGGER.finer(\"Origin requested service: \"\n \t\t\t+Z3950Constants.z3950_option_names[i]);\n }\n \n // Did the origin request scan?\n if ( init_request.options.isSet(7) )\n {\n \t//the geo profile does not require support of scan.\n \tinit_request.options.clearBit(7);\n \t LOGGER.finer(\"Origin requested scan, not supported by\" + \n \t\t\t\"this backend realisation.\");\n }\n \n // If we are talking v2, userInformationField may contain \n //a character Set Negotiation field, if v3, \n //otherInfo may contain a charset/language negotiation feature.\n if ( init_request.userInformationField != null )\n {\n OIDRegisterEntry ent = reg.lookupByOID\n \t (init_request.userInformationField.direct_reference);\n if ( ent != null )\n LOGGER.finer(\"Init Request contains userInformationField oid=\"\n \t\t + ent.getName());\n else\n \t LOGGER.finer(\"Unkown external in userInformationField\");\n // The OID for the external should be found \n //in userInformationField.direct_reference\n }\n \n if ( init_request.otherInfo != null )\n {\n LOGGER.finer(\"Init Request contains otherInfo entries\");\n for ( Enumeration other_info_enum = init_request.otherInfo.elements(); \n \t other_info_enum.hasMoreElements(); )\n {\n \t LOGGER.finer(\"Processing otherInfo entry...\");\n \t // Process the external at other_info_enum.nextElement();\n \t OtherInformationItem43_type oit = \n \t (OtherInformationItem43_type)(other_info_enum.nextElement());\n \n LOGGER.finer(\"Processing OtherInformationItem43_type\");\n \n switch ( oit.information.which )\n {\n case information_inline45_type.externallydefinedinfo_CID:\n EXTERNAL_type et = (EXTERNAL_type)(oit.information.o);\n if ( et.direct_reference != null )\n {\n OIDRegisterEntry ent = reg.lookupByOID(et.direct_reference);\n LOGGER.finer(\"External with direct reference, oid=\"\n \t\t\t +ent.getName());\n \n // Are we dealing with character set negotiation.\n if ( ent.getName().equals(\"z_charset_neg_3\") )\n handleNLSNegotiation((CharSetandLanguageNegotiation_type)\n \t\t\t\t (et.encoding.o));\n }\n break;\n default:\n LOGGER.finer(\"Currently unhandled OtherInformationType\");\n break;\n }\n }\n }\n \n try\n {\n assoc.sendInitResponse(init_request.referenceId,\n init_request.protocolVersion,\n init_request.options,\n init_request.preferredMessageSize.longValue(),\n init_request.exceptionalRecordSize.longValue(),\n true,\n \"174\",\n \"TOPP Geoserver zserver module\",\n \"GeoServer 0.93\",\n null,\n null);\n }\n catch ( java.io.IOException ioe )\n {\n ioe.printStackTrace();\n }\n }", "@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) {\n System.out.println(\"[Servlet] GET request \" + request.getRequestURI());\n\n response.setContentType(FrontEndServiceDriver.APP_TYPE);\n response.setStatus(HttpURLConnection.HTTP_BAD_REQUEST);\n\n try {\n String url = FrontEndServiceDriver.primaryEventService +\n request.getRequestURI().replaceFirst(\"/events\", \"\");\n HttpURLConnection connection = doGetRequest(url);\n\n if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {\n PrintWriter pw = response.getWriter();\n JsonObject responseBody = (JsonObject) parseResponse(connection);\n\n response.setStatus(HttpURLConnection.HTTP_OK);\n pw.println(responseBody.toString());\n }\n }\n catch (Exception ignored) {}\n }", "@Override\n public void onNext(RequestData request) {\n System.out.println(\"Requestor:\" + request.getName());\n System.out.println(\"Request Message:\" + request.getMessage());\n }", "private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {\n\n if (discoveredEndpoint != null) {\n request.setEndpoint(discoveredEndpoint);\n request.getOriginalRequest().getRequestClientOptions().appendUserAgent(\"endpoint-discovery\");\n } else if (uriFromEndpointTrait != null) {\n request.setEndpoint(uriFromEndpointTrait);\n } else {\n request.setEndpoint(endpoint);\n }\n\n request.setTimeOffset(timeOffset);\n\n HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());\n\n return client.execute(request, responseHandler, errorResponseHandler, executionContext);\n }", "private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {\n\n if (discoveredEndpoint != null) {\n request.setEndpoint(discoveredEndpoint);\n request.getOriginalRequest().getRequestClientOptions().appendUserAgent(\"endpoint-discovery\");\n } else if (uriFromEndpointTrait != null) {\n request.setEndpoint(uriFromEndpointTrait);\n } else {\n request.setEndpoint(endpoint);\n }\n\n request.setTimeOffset(timeOffset);\n\n HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());\n\n return client.execute(request, responseHandler, errorResponseHandler, executionContext);\n }", "private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {\n\n if (discoveredEndpoint != null) {\n request.setEndpoint(discoveredEndpoint);\n request.getOriginalRequest().getRequestClientOptions().appendUserAgent(\"endpoint-discovery\");\n } else if (uriFromEndpointTrait != null) {\n request.setEndpoint(uriFromEndpointTrait);\n } else {\n request.setEndpoint(endpoint);\n }\n\n request.setTimeOffset(timeOffset);\n\n HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());\n\n return client.execute(request, responseHandler, errorResponseHandler, executionContext);\n }", "private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {\n\n if (discoveredEndpoint != null) {\n request.setEndpoint(discoveredEndpoint);\n request.getOriginalRequest().getRequestClientOptions().appendUserAgent(\"endpoint-discovery\");\n } else if (uriFromEndpointTrait != null) {\n request.setEndpoint(uriFromEndpointTrait);\n } else {\n request.setEndpoint(endpoint);\n }\n\n request.setTimeOffset(timeOffset);\n\n HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());\n\n return client.execute(request, responseHandler, errorResponseHandler, executionContext);\n }", "@Override\n\tpublic void action() {\n\t\tACLMessage msgRx = myAgent.receive();\n\t\tif (msgRx != null && msgRx.getPerformative() == ACLMessage.REQUEST) {\n\t\t\tContentManager contentManager = myAgent.getContentManager();\n\t\t\tSystem.out.println(\"RECEIVED = \" + msgRx.getContent());\n\t\t\tmsgRx.setLanguage(\"fipa-sl\");\n\t\t\tmsgRx.setOntology(\"blocks-ontology\");\n\t\t\t\n\t\t\ttry {\n\t\t\t\tContentElementList elementList = (ContentElementList) contentManager\n\t\t\t\t\t\t.extractContent(msgRx);\n\n\t\t\t\tIterator elementIterator = elementList.iterator();\n\n\t\t\t\twhile (elementIterator.hasNext()) {\n\t\t\t\t\tAction action = (Action) elementIterator.next();\n\t\t\t\t\t((Environment) myAgent).getWorld().getActionList().add((Executable) (action.getAction()));\n//\t\t\t\t\t((Executable) (action.getAction()))\n//\t\t\t\t\t\t\t.execute((Environment) myAgent);\n\t\t\t\t}\n\n\t\t\t} catch (UngroundedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (CodecException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (OntologyException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} else {\n\t\t\tblock();\n\t\t}\n\t\t\n\t}", "@Override\n public void action() {\n ACLMessage acl = receive();\n if (acl != null) {\n if (acl.getPerformative() == ACLMessage.REQUEST) {\n try {\n ContentElement elemento = myAgent.getContentManager().extractContent(acl);\n if (elemento instanceof PublicarServicio) {\n PublicarServicio publicar = (PublicarServicio) elemento;\n Servicio servicio = publicar.getServicio();\n jadeContainer.iniciarChat(servicio.getTipo(), servicio.getDescripcion());\n //myAgent.addBehaviour(new IniciarChatBehaviour(myAgent, servicio.getTipo(), servicio.getDescripcion()));\n } else if (elemento instanceof EnviarMensaje) {\n EnviarMensaje enviar = (EnviarMensaje) elemento;\n Mensaje mensaje = enviar.getMensaje();\n jadeContainer.enviarMensajeChatJXTA(mensaje.getRemitente(), mensaje.getMensaje());\n }\n } catch (CodecException ex) {\n System.out.println(\"CodecException: \" + ex.getMessage());\n } catch (UngroundedException ex) {\n System.out.println(\"UngroundedException: \" + ex.getMessage());\n } catch (OntologyException ex) {\n System.out.println(\"OntologyException: \" + ex.getMessage());\n }\n }\n } else {\n block();\n }\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tlog.info(\"Received a request to get all events that an event has invitations to.\");\n\t\t\n\t\t//Getting parameter, doing integer conversion, and initializing objects\n\t\tint accountID = Integer.parseInt(request.getParameter(\"accountID\"));\n\t\tList<EventDTO> events=null;\n\t\tObjectMapper om = new ObjectMapper();\n\t\tPrintWriter out = response.getWriter();\n\t\t\n\t\t//Accessing service layer to retrieve events\n\t\tevents = EventService.retrieveEventsByAccount(accountID);\n\t\t\n\t\t//Checking if unsuccessful\n\t\tif(events != null) {\n\t\t\tlog.debug(\"Accessing object mapper to convert event list into JSON string representation.\");\n\t\t\tout.print(om.writeValueAsString(events));\n\t\t}else {\n\t\t\tlog.warn(\"Sending back an error: Event retreival unsuccessful.\");\n\t\t\tresponse.sendError(400);\n\t\t}\n\t}", "public void handleRequest(Request request) {\n\t\tgetCityData(request.getCityName());\n\t\texportToFile(request.getCityName());\n\t}", "Object handle(Object request);", "@Override\n public void doPost(HttpServletRequest request, HttpServletResponse response) {\n System.out.println(\"[Servlet] POST request \" + request.getRequestURI());\n\n response.setContentType(FrontEndServiceDriver.APP_TYPE);\n response.setStatus(HttpURLConnection.HTTP_BAD_REQUEST);\n\n try {\n String requestBody = parseRequest(request);\n JsonObject body = (JsonObject) parseJson(requestBody);\n String[] arguments = request.getRequestURI().replace(\"/events/\", \"\").split(\"/\");\n int tickets = body.get(\"tickets\").getAsInt();\n\n String url = FrontEndServiceDriver.primaryEventService + \"/\" + arguments[1] + \"/\" + arguments[0];\n String uuid = UUID.randomUUID().toString();\n JsonObject newRequestBody = getNewRequestBody(arguments, tickets, uuid);\n\n int failure = 0;\n while (failure < 3) {\n try {\n HttpURLConnection connection = doPostRequest(url, newRequestBody);\n\n if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {\n response.setStatus(HttpURLConnection.HTTP_OK);\n System.out.println(\"[Servlet] request with uuid: \" + uuid + \" has been completed\");\n }\n else {\n System.out.println(\"[Servlet] request with uuid: \" + uuid + \" failed\");\n }\n\n break; // exit loop after completing the request without broken connection\n }\n catch (IOException ignored) {\n failure++;\n blockAndRetry(uuid, failure);\n }\n }\n }\n catch (Exception ignored) {\n // other failures like JsonParseException\n }\n }", "private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {\n\n if (discoveredEndpoint != null) {\n request.setEndpoint(discoveredEndpoint);\n request.getOriginalRequest().getRequestClientOptions().appendUserAgent(\"endpoint-discovery\");\n } else if (uriFromEndpointTrait != null) {\n request.setEndpoint(uriFromEndpointTrait);\n } else {\n request.setEndpoint(endpoint);\n }\n\n request.setTimeOffset(timeOffset);\n\n DefaultErrorResponseHandler errorResponseHandler = new DefaultErrorResponseHandler(exceptionUnmarshallersMap, defaultUnmarshaller);\n\n return client.execute(request, responseHandler, errorResponseHandler, executionContext);\n }", "@Override\n\t\t\tpublic void onResponseReceived(Request request, Response response) {\n\t\t\t\t\n\t\t\t}", "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 }", "private void handleRequestResponse(JSONObject answer) {\n\t\tJSONArray events = answer.optJSONArray(\"events\");\n\t\tif (events!=null) {\n\t\t\tlong time = System.currentTimeMillis();\n\t\t\tint length = events.length();\n\t\t\tfor (int i=0; i<length; i++) {\n\t\t\t\tLogEvent event = LogEvent.fromJSON(events.getJSONObject(i));\n\t\t\t\tevent.time = time;\n\t\t\t\tevent.ignore = true; // don't send back to logging server\n\t\t\t\tthis.plugin.postEvent(event);\n\t\t\t}\n\t\t}\n\t\tJSONObject plugins = answer.optJSONObject(\"plugins\");\n\t\tif (plugins!=null && !plugin.bukkitMode) {\n\t\t\tthis.plugin.updater.setAvailablePlugins(plugins);\n\t\t}\n\t}", "void onResponseTaskCompleted(Request request, Response response, OHException ohex, Object data);", "@Override\n\t\t\t\tpublic void onResponseReceived(Request request, Response response) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n\tpublic void processRequest(RequestEvent requestEvent) {\n\t\t requestEvent.getServerTransaction();\n\t\tSystem.out.println(\"Sending ------------------------------------------------------------------------------------------\");\n\t\tSystem.out.println(\"[]:\"+requestEvent.toString());\n\t}", "void executeEndpoint(DnCxt cxt, DnRequestHandler handler, DnEndpoint endpoint) throws DnException {\n DnSchemaService schemaService = DnSchemaService.get(cxt);\n if (schemaService == null) {\n // Not doing endpoints.\n return;\n }\n\n // Use input type to convert and coerce data.\n DnType in = endpoint.inType;\n var validator = new DnSchemaValidator(cxt, DnSchemaValidator.REQUEST_MODE);\n var data = cloneMap(handler.queryParams);\n if (handler.postData != null ) {\n data.putAll(handler.postData);\n }\n Map<String,Object> requestData;\n try {\n requestData = validator.validateAndCoerce(in, data);\n } catch (DnException e) {\n if (DnException.CONVERSION.equals(e.activity)) {\n throw DnException.mkInput(\"Validation failure in request data.\", e);\n } else {\n throw e;\n }\n }\n\n // Build up a request context.\n var requestCxt = new DnRequestCxt(cxt, requestData, endpoint);\n requestCxt.webRequest = handler;\n\n requestCxt.requestInfo = new DnRequestInfo(handler.userAgent, handler.forwardedFor, handler.isFromLoadBalancer,\n handler.queryParams, handler.postData);\n\n // Execute request.\n endpoint.endpointFunction.executeRequest(requestCxt);\n\n if (!handler.sentResponse) {\n prepareAndSendResponse(requestCxt, endpoint.outType, handler);\n if (!requestCxt.logRequest) {\n handler.logSuccess = false;\n }\n }\n }", "@Override\n\tpublic void handleEvent(EnOceanMessage data) {\n\t}", "public void handlePostEntitiesQuery(RoutingContext routingContext) {\n LOGGER.debug(\"Info: handlePostEntitiesQuery method started.\");\n HttpServerRequest request = routingContext.request();\n JsonObject requestJson = routingContext.getBodyAsJson();\n LOGGER.debug(\"Info: request Json :: ;\" + requestJson);\n HttpServerResponse response = routingContext.response();\n MultiMap headerParams = request.headers();\n // validate request parameters\n Future<Boolean> validationResult = validator.validate(requestJson);\n validationResult.onComplete(validationHandler -> {\n if (validationHandler.succeeded()) {\n // parse query params\n NGSILDQueryParams ngsildquery = new NGSILDQueryParams(requestJson);\n QueryMapper queryMapper = new QueryMapper();\n JsonObject json = queryMapper.toJson(ngsildquery, requestJson.containsKey(\"temporalQ\"));\n Future<List<String>> filtersFuture =\n catalogueService.getApplicableFilters(json.getJsonArray(\"id\").getString(0));\n String instanceID = request.getHeader(HEADER_HOST);\n json.put(JSON_INSTANCEID, instanceID);\n requestJson.put(\"ids\", json.getJsonArray(\"id\"));\n LOGGER.debug(\"Info: IUDX query json : ;\" + json);\n filtersFuture.onComplete(filtersHandler -> {\n if (filtersHandler.succeeded()) {\n json.put(\"applicableFilters\", filtersHandler.result());\n if (json.containsKey(IUDXQUERY_OPTIONS)\n && JSON_COUNT.equalsIgnoreCase(json.getString(IUDXQUERY_OPTIONS))) {\n executeCountQuery(json, response);\n } else {\n executeSearchQuery(json, response);\n }\n } else {\n LOGGER.error(\"catalogue item/group doesn't have filters.\");\n }\n });\n } else if (validationHandler.failed()) {\n LOGGER.error(\"Fail: Bad request\");\n handleResponse(response, ResponseType.BadRequestData,\n validationHandler.cause().getMessage());\n }\n });\n }", "@Override\n\tpublic boolean onEvent( HCI_Event evt) {\n\t\tif ( evt instanceof HCI_CommandComplete) {\n\t\t} else if ( evt instanceof HCI_CommandStatus) {\n\t\t} else if ( evt instanceof HCI_InquiryComplete) {\n\t\t} else if ( evt instanceof HCI_InquiryResult) {\n\t\t} else if ( evt instanceof HCI_ConnectionComplete) {\n\t\t} else if ( evt instanceof LE_AdvertisingReport) {\n\t\t\tfinal LE_AdvertisingReport le_ar = (LE_AdvertisingReport) evt;\n\t\t\tDate timeOfCapture = new Date(); // current time\n\t\t\treturn this.handle_LE_AdvertisingReport( le_ar, timeOfCapture);\n\t\t} else {\n\t\t\tlogger.warning( \"unhandled event: \" + evt.toString());\n\t\t}\n\t\treturn true;\n\t}", "public void handler(AbstractRequest request) {\n\t\tSystem.out.println(\"===handle1\" + request.getContent());\n\t}", "public static void main(String[] args) {\n EosApi api = EosApiFactory.create(\"https://api.jungle.alohaeos.com\");\n //EosApi api = EosApiFactory.create(\"https://jungle.cryptolions.io\");\n //EosApi api = EosApiFactory.create(\"https://eos.newdex.one\");\n //System.out.println(api.getChainInfo());\n //buyRam(api, \"5K3iYbkjpvZxxAJyHQVAtJmCi4CXetBKq3CfcboMz21Y5Pjvovo\", \"bihuexwallet\", \"bihuexwallet\",15000);\n //delegate(api, \"5KD2hyi84H46ND8citJr6L84mYegnX1UKw9osLnF3qpcjoeRAAn\", \"carilking111\", \"carilking444\",\"1.5000 EOS\",\"1.5000 EOS\");\n //updateAuth(api,\"5JhoFQMN9xWGMFfUDJHHPVsuSytSDot8Q5TNv3rN6VVGPbjTrGN\",\"carilking444\",\"EOS82Psyaqk86jbSdSmGzonNCUHsBp1Xj42q37g6UkiA1UhzLe57j\",\"active\");\n //updateAuth(api,\"5JrTcSsUmzoLDxsNFcpGBRt2Wd488qTmHp5yfBPy71MbxaqSJ4g\",\"carilking555\",\"EOS5X6Sbmbc2zaJ8EHNZmdSnA26DsuTim59pdUNiNd34HugzvTp5m\",\"active\");\n //transfer(api,\"5JhoFQMN9xWGMFfUDJHHPVsuSytSDot8Q5TNv3rN6VVGPbjTrGN\", \"carilking444\",\"carilking111\",BigDecimal.valueOf(0.01),\"喵喵喵~\");\n //Object obj=api.getTransaction(new TransactionRequest(\"e5aeee319e8c767cdda35a3b6d460328f958833e58723bc18581765494018700\"));\n //System.out.println(obj);\n List<String> accounts = new ArrayList<>();\n accounts.add(\"carilking111\");\n accounts.add(\"carilking444\");\n //updateMultipleAuth(api, \"5JPNqMSZ8M567hgDGW9CmD9vr2RaDm1eWpJqHaHa2S5xKTMmFKm\", \"heydoojqgege\", 2, accounts, \"active\");\n //proposeTransfer(api, \"5K3iYbkjpvZxxAJyHQVAtJmCi4CXetBKq3CfcboMz21Y5Pjvovo\", \"bihuexwallet\", \"firstmsig152\", \"heydoojqgege\", \"carilking222\", BigDecimal.valueOf(0.2), \"test1\", accounts);\n //approveTransfer(api,\"5KD2hyi84H46ND8citJr6L84mYegnX1UKw9osLnF3qpcjoeRAAn\",\"carilking111\",\"bihuexwallet\",\"firstmsig151\");\n //execPropose(api,\"5K3iYbkjpvZxxAJyHQVAtJmCi4CXetBKq3CfcboMz21Y5Pjvovo\",\"bihuexwallet\",\"bihuexwallet\",\"firstmsig151\");\n }", "public abstract void handle(Request request, Response response) throws Exception;", "public void onException(RequestException e);", "@Override\r\n\t\t\tpublic void onRequest() {\n\t\t\t\t\r\n\t\t\t}", "abstract public void onQueryRequestArrived(ClientQueryRequest request);", "public Eventos fetchEventosById(FetchByIdRequest request);", "public void handleRequest(Request req) {\n\n }", "private void handleRequest(Request request) throws IOException{\n switch (request){\n case NEXTODD:\n case NEXTEVEN:\n new LocalThread(this, request, nextOddEven).start();\n break;\n case NEXTPRIME:\n case NEXTEVENFIB:\n case NEXTLARGERRAND:\n new NetworkThread(this, userID, serverIPAddress, request).start();\n break;\n default:\n break;\n }\n }", "public String acceptRequest(String requestID) {\n Request accepted = getRequestById(requestID);\n if (accepted == null) {\n return \"Error: Request doesn't exist\";\n }\n accepted.accept();\n if (accepted instanceof AccountRequest) {\n User user = UserController.getInstance().getUserByUsername(((AccountRequest) accepted).getUser().getUsername());\n if (user instanceof Seller) ((Seller) user).validate();\n Database.getInstance().saveUser(user);\n } else if (accepted instanceof SaleRequest) {\n Sale sale=((SaleRequest) accepted).getNewSale();\n sale.acceptStatus();\n for (String id : sale.getAllItemId()) {\n Item item=ItemAndCategoryController.getInstance().getItemById(id);\n if(item==null) continue;\n item.setSale(sale.getId());\n Database.getInstance().saveItem(item);\n }\n Database.getInstance().saveSale(((SaleRequest) accepted).getNewSale());\n\n } else if (accepted instanceof ItemRequest) {\n Item item = ((ItemRequest) accepted).getNewItem();\n item.setAddedTime(LocalDateTime.now());\n Database.getInstance().saveItem(item);\n if(item.getCategoryName()!=null)\n ItemAndCategoryController.getInstance().addItemToCategory(item.getId(), item.getCategoryName());\n } else if (accepted instanceof ItemEdit) {\n requestController.ItemEditing((ItemEdit) accepted);\n } else if (accepted instanceof SaleEdit) {\n requestController.SaleEditing((SaleEdit) accepted);\n } else if (accepted instanceof CommentRequest) {\n //System.out.println(\"salam\");\n Comment comment = ((CommentRequest) accepted).getNewComment();\n //System.out.println(\"salam\");\n comment.accept();\n //System.out.println(\"salam\");\n Item item = ItemAndCategoryController.getInstance().getItemById(comment.getItemId());\n //System.out.println(\"salam\");\n item.addComment(comment);\n //System.out.println(\"salam\");\n Database.getInstance().saveItem(item);\n //System.out.println(\"salam\");\n } else if(accepted instanceof ItemDelete){\n String id=((ItemDelete) accepted).getItemId();\n Item removed=ItemAndCategoryController.getInstance().getItemById(id);\n if(removed!=null) {\n UserController.getInstance().deleteItemFromSeller(id, removed.getSellerName());\n ItemAndCategoryController.getInstance().removeItemFromCategory(removed.getCategoryName(),removed.getId());\n Database.getInstance().deleteItem(removed);\n }\n }\n else if(accepted instanceof AuctionRequest){\n Auction auction = ((AuctionRequest) accepted).getAuction();\n Database.getInstance().saveAuction(auction);\n }\n Database.getInstance().deleteRequest(accepted);\n return \"Successful: Request accepted\";\n }", "com.walgreens.rxit.ch.cda.EIVLEvent getEvent();", "private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext) {\n request.setEndpoint(endpoint);\n request.setTimeOffset(timeOffset);\n\n HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());\n\n return client.execute(request, responseHandler, errorResponseHandler, executionContext);\n }", "Acquest getAcquest(int Acquest_id);", "public void service_REQ(){\n if ((eccState == index_HasRequest) && (PEExit.value)) state_BagPassedEye();\n else if ((eccState == index_IDLE) && (TokenIn.value)) state_START();\n else if ((eccState == index_IDLE) && (PERequest.value)) state_NoTokenButRequest();\n else if ((eccState == index_NoTokenButRequest) && (TokenIn.value)) state_START();\n else if ((eccState == index_START) && (NoPERequest.value)) state_IDLE();\n }", "@Override\r\n\tpublic void service(AgiRequest request, AgiChannel channel)\r\n\t\t\tthrows AgiException {\n\t\t\r\n\t\tString numsel = getVariable(\"EXTEN\");\r\n\t\tif (numsel.endsWith(\"#\"))\r\n\t\t\tnumsel = numsel.substring(0, numsel.length()-1);\r\n\t\t\r\n\t\tString oilnum = getVariable(\"oilponum\");\r\n\t\t\r\n\t\t\r\n\t\tint iNumSel = Integer.parseInt(numsel);\r\n\t\tint ioilNum = Integer.parseInt(oilnum);\r\n\t\t\r\n\t\t\r\n\t\tif (iNumSel>ioilNum || iNumSel<1)\r\n\t\t{\r\n\t\t\tsetExtension(\"i\");\r\n\t\t\tsetPriority(\"1\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tString docid = getVariable(\"DOC\" + iNumSel);\r\n\t\tString phone = getVariable(\"PHONE\" + iNumSel);\r\n\t\t\r\n\t\t\r\n\t\tsetVariable(\"DOCID\", docid);\r\n\t\tsetVariable(\"oilcomphone\", phone);\r\n\t\t\r\n\t//\tString conPhone = getVariable(\"custphone\" + iNumSel);\r\n\t//\tString cellphone = getVariable(\"cellphone\" + iNumSel);\r\n\t\t\r\n\t//\tsetVariable(\"spphone\", conPhone);\r\n\t//\tsetVariable(\"SPDIALNUM\", conName);\r\n\t//\tsetVariable(\"spphone\", conPhone);\r\n\t//\tsetVariable(\"cellphone\", cellphone);\r\n\r\n\t}", "@Override\n public DataObjectResponse<Agenda> handlePOST(DataObjectRequest<Agenda> request)\n {\n if(getRequestValidator() != null) getRequestValidator().validatePOST(request);\n\n Agenda agendaToPersist = request.getDataObject();\n final String customerID = agendaToPersist.getCustomerId();\n\n ObjectTrackerManager trackerManager = new ObjectTrackerManager();\n trackerManager.register(new EndpointObjectTracker<>(agendaProgressClient, AgendaProgress.class, customerID));\n trackerManager.register(new EndpointObjectTracker<>(operationProgressClient, OperationProgress.class, customerID));\n trackerManager.register(new PersisterObjectTracker<>(getObjectPersister(), Agenda.class));\n\n // verify we have a valid insight for this agenda\n Insight insight = null;\n try\n {\n insight = getInsightSelector().select(agendaToPersist);\n } catch (ValidationException e)\n {\n return new DefaultDataObjectResponse<>(ErrorResponseFactory.buildErrorResponse(e, e.getResponseCode(), request.getCID()));\n }\n if(insight == null)\n {\n return new DefaultDataObjectResponse<>(ErrorResponseFactory.objectNotFound(\n \"No available insights for processing agenda\",\n request.getCID()));\n }\n\n // The Agenda id is generated up front for use on other object updates/creates\n agendaToPersist.setId(UUID.randomUUID().toString());\n AgendaInsight agendaInsight = new AgendaInsight();\n agendaInsight.setInsightId(insight.getId());\n agendaInsight.setResourcePoolId(insight.getResourcePoolId());\n agendaToPersist.setCid(agendaToPersist.getCid() == null ? UUID.randomUUID().toString() : agendaToPersist.getCid());\n agendaToPersist.setAgendaInsight(agendaInsight);\n agendaToPersist.setParams(agendaToPersist.getParams() == null ? new ParamsMap() : agendaToPersist.getParams());\n\n DataObjectResponse<AgendaProgress> progressResponse =\n agendaToPersist.getProgressId() == null ? postAgendaProgress(agendaToPersist, request.getCID()) : putAgendaProgress(agendaToPersist);\n if (progressResponse.isError())\n {\n trackerManager.cleanUp();\n return new DefaultDataObjectResponse<>(progressResponse.getErrorResponse());\n }\n final String agendaProgressId = progressResponse.getFirst().getId();\n trackerManager.track(progressResponse.getFirst());\n agendaToPersist.setProgressId(agendaProgressId);\n\n // always create new OperationProgress objects\n if (agendaToPersist.getOperations() != null)\n {\n DataObjectResponse<OperationProgress> persistResponse = persistOperationProgresses(agendaToPersist, request.getCID(), trackerManager);\n if (persistResponse.isError())\n {\n trackerManager.cleanUp();\n return new DefaultDataObjectResponse<>(persistResponse.getErrorResponse());\n }\n }\n\n DataObjectResponse<Agenda> agendaPersistResponse = super.handlePOST(request);\n if (agendaPersistResponse.isError())\n {\n trackerManager.cleanUp();\n return agendaPersistResponse;\n }\n\n Agenda agendaResp = agendaPersistResponse.getFirst();\n trackerManager.track(agendaResp);\n\n if (!(agendaToPersist.getParams().containsKey(GeneralParamKey.doNotRun)))\n {\n DataObjectResponse<ReadyAgenda> readyAgendaResponse = persistReadyAgenda(insight.getId(), agendaResp.getId(), agendaResp.getCustomerId(), request.getCID());\n if (readyAgendaResponse.isError())\n {\n trackerManager.cleanUp();\n return new DefaultDataObjectResponse<>(readyAgendaResponse.getErrorResponse());\n }\n }\n\n return agendaPersistResponse;\n }", "public void getEventDetails(String eventId,String venueId,String eventName,String venue,String date,String category){\n String url = \"https://eng-empire-315722.wl.r.appspot.com/eventDetails?event=\"+eventId;\n System.out.println(url);\n\n JsonObjectRequest request = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject response) {\n System.out.println(response);\n\n// res_list.add(response.toString());\n Intent intent = new Intent(context, EventDetails.class);\n intent.putExtra(\"eventdetails\", response.toString());\n intent.putExtra(\"eventId\",eventId);\n intent.putExtra(\"venueId\", venueId);\n intent.putExtra(\"venue\", venue);\n intent.putExtra(\"date\", date);\n intent.putExtra(\"category\", date);\n intent.putExtra(\"eventname\", eventName);\n context.startActivity(intent);\n\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n error.printStackTrace();\n\n }\n });\n mQueue.add(request);\n }", "private void postRequest() {\n\t\tSystem.out.println(\"post request, iam playing money\");\n\t}", "@ProcessAction(name=\"processEvent\")\n public void processEvent(ActionRequest request, ActionResponse response) {\n \n String sampleText = ParamUtil.getString(request, \"sampleText\",\"\");\n Employee employee = new Employee();\n //employee.name = \"Trung\";\n employee.name = sampleText;\n employee.address = \"Dong Anh\";\n /**\n * Refer portlet.xml\n */\n QName qName = new QName(\"http://proliferay.com/events\", \"ipc-text\");\n response.setEvent(qName, employee);\n }", "@Override\n public void onResponse(final Transaction transaction, final String requestId, final PoyntError poyntError) throws RemoteException {\n AdjustTransactionRequest adjustTransactionRequest = new AdjustTransactionRequest();\n adjustTransactionRequest.setEmvData(emvData1);\n\n final ElavonTransactionRequest request = convergeMapper.getTransactionUpdateRequest(\n transaction.getFundingSource().getEntryDetails(),\n transaction.getProcessorResponse().getRetrievalRefNum(),\n adjustTransactionRequest);\n convergeService.update(request, new ConvergeCallback<ElavonTransactionResponse>() {\n @Override\n public void onResponse(final ElavonTransactionResponse elavonResponse) {\n if (elavonResponse.isSuccess()) {\n Log.d(TAG, \"Successfully Captured EMV Data for: \" + transaction.getId());\n } else {\n Log.e(TAG, \"Failed to capture EMV Data for: \" + transaction.getId());\n }\n }\n\n @Override\n public void onFailure(final Throwable t) {\n Log.e(TAG, \"Failed to capture EMV Data for: \" + transaction.getId());\n }\n });\n }", "private void requestHandler(Object context)\n {\n final String funcName = \"requestHandler\";\n @SuppressWarnings(\"unchecked\")\n TrcRequestQueue<Request>.RequestEntry entry = (TrcRequestQueue<Request>.RequestEntry) context;\n Request request = entry.getRequest();\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.TASK, \"request=%s\", request);\n }\n\n request.canceled = entry.isCanceled();\n if (!request.canceled)\n {\n if (request.readRequest)\n {\n request.buffer = readData(request.address, request.length);\n if (debugEnabled)\n {\n if (request.buffer != null)\n {\n dbgTrace.traceInfo(funcName, \"readData(addr=0x%x,len=%d)=%s\",\n request.address, request.length, Arrays.toString(request.buffer));\n \n }\n }\n }\n else\n {\n request.length = writeData(request.address, request.buffer, request.length);\n }\n }\n\n if (request.completionEvent != null)\n {\n request.completionEvent.set(true);\n }\n\n if (request.completionHandler != null)\n {\n request.completionHandler.notify(request);\n }\n\n if (debugEnabled)\n {\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.TASK);\n }\n }", "@Override\n public void handle(RoutingContext routingContext) {\n\n var body = routingContext.getBodyAsJson();\n\n if (body == null) {\n routingContext.fail(400);\n return;\n }\n\n var data = body.mapTo(IssueRequest.class);\n Ed25519PublicKey publicKey;\n var amount = new BigInteger(data.amount);\n\n // validates the public key to ensure its 32-bytes and\n // optionally has the expected prefix\n\n try {\n publicKey = Ed25519PublicKey.fromString(data.address);\n } catch (IllegalStateException e) {\n routingContext.fail(400);\n return;\n }\n\n // FIXME: this is for exposition only; in a production system\n // there would be an exchange of payment before we move on\n // to the next step\n\n // TODO: An optimization would be to immediately return from the\n // request here and use push notifications to communicate\n // when its complete or failed\n\n // issue some money to the address\n\n routingContext.vertx().<String>executeBlocking(promise -> {\n try {\n executeMintTransaction(amount);\n\n var transactionId = executeTransferTransaction(publicKey, amount);\n\n promise.complete(transactionId);\n } catch (HederaStatusException e) {\n promise.fail(e);\n }\n }, v -> {\n if (v.failed()) {\n routingContext.fail(v.cause());\n return;\n }\n\n routingContext.response()\n .putHeader(\"content-type\", \"application/json\")\n .end(JsonObject.mapFrom(new HederaTransactionResponse(v.result())).encode());\n });\n }", "private void hitApiForActivateDeal() {\n appUtils.showProgressDialog(mActivity, false);\n HashMap<String, String> params = new HashMap<>();\n params.put(ApiKeys.DEAL_ID, dealData.getDealId());\n params.put(ApiKeys.DEAL_STATUS, \"1\");\n\n params.put(ApiKeys.DEAL_TITLE, etTitle.getText().toString().trim());\n params.put(ApiKeys.DEAL_DESCRIPTION, etDescription.getText().toString().trim());\n params.put(ApiKeys.TOTAL_ITEMS, etTotalItems.getText().toString().trim());\n params.put(ApiKeys.ORIGINAL_PRICE, etOriginalPrice.getText().toString().trim());\n params.put(ApiKeys.NEW_PRICE, tvNewPrice.getText().toString());\n params.put(ApiKeys.START_DATE_TIME, parseTime(etBeginTime.getText().toString().trim()));\n params.put(ApiKeys.END_DATE_TIME, parseTime(etEndTime.getText().toString().trim()));\n\n ApiInterface service = RestApi.createService(ApiInterface.class);\n Call<ResponseBody> call = service.deactivateDeal(AppSharedPrefs.getInstance(mActivity).\n getString(AppSharedPrefs.PREF_KEY.ACCESS_TOKEN, \"\"), appUtils.encryptData(params));\n ApiCall.getInstance().hitService(mActivity, call, new NetworkListener() {\n @Override\n public void onSuccess(int responseCode, String response) {\n try {\n JSONObject mainObject = new JSONObject(response);\n if (mainObject.getInt(\"CODE\") == 200) {\n appUtils.showToast(mActivity, getString(R.string.deal_activated));\n Intent intent = new Intent();\n intent.putExtra(Constants.DEAL_POSITION_KEY, position);\n intent.putExtra(Constants.DEAL_STATUS_KEY, \"1\");\n setResult(Constants.DEAL_ACTIVIATE_RESULT_CODE, intent);\n Intent intent1 = new Intent(Constants.REFRESH_RECCEIVER_KEY);\n // You can also include some extra data.\n intent1.putExtra(\"refresh\", true);\n LocalBroadcastManager.getInstance(mActivity).sendBroadcast(intent1);\n finish();\n } else if (mainObject.getInt(\"CODE\") == ApiKeys.UNAUTHORISED_CODE) {\n appUtils.logoutFromApp(mActivity, mainObject.optString(\"MESSAGE\"));\n } else {\n appUtils.showSnackBar(activityCreateDeal, mainObject.optString(\"MESSAGE\"));\n }\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n\n @Override\n public void onSuccessErrorBody(String response) {\n\n }\n\n @Override\n public void onFailure() {\n appUtils.showSnackBar(activityCreateDeal, getString(R.string.txt_something_went_wrong));\n }\n });\n\n }", "@Override\n public Optional<Response> handle(HandlerInput input) {\n log(input, \"Starting request\");\n logSlots(input); // NPE\n\n Map<String, Slot> slots = getSlots(input);\n\n // first part of the speechText, blank author & title variables\n String speechText = \"Your reading list has \" ;\n String title;\n String formattedTitle;\n String author;\n String formattedAuthor;\n\n // iterate through the DDB table\n ScanRequest scanRequest = new ScanRequest().withTableName(\"DefaultReadingList\");\n ScanResult result = client.scan(scanRequest);\n\n for (Map<String, AttributeValue> item : result.getItems()){\n // grab title & author from the item we are on\n title = item.get(\"Title\").toString();\n author = item.get(\"Author\").toString();\n\n // remove weird formatting on title and author strings and add to speechText\n formattedTitle = title.substring(4, title.length()-2);\n formattedAuthor = author.substring(4, author.length()-2);\n speechText = String.format((speechText + \"%s by %s, \"), formattedTitle, formattedAuthor);\n }\n\n log(input, \"Speech text response is \" + speechText);\n\n // response object with a card (shown on devices with a screen) and speech (what alexa says)\n return input.getResponseBuilder()\n .withSpeech(speechText) // alexa says this\n .withSimpleCard(\"GetFromReadingList\", speechText) // alexa will show this on a screen\n .build();\n }", "public void requestFailed(RequestFailureEvent e);", "@Api(1.1)\n public Response execute() throws HaloNetException {\n return mBuilder.mClient.request(mRequest);\n }", "private void doRequest() {\n\n try {\n JsonObject request = new JsonObject()\n .put(\"action\", Math.random() < 0.5 ? \"w\" : \"r\")\n .put(\"timeOfRequest\", System.currentTimeMillis());\n\n if (request.getString(\"action\") == \"w\") {\n request.put(\"data\", new JsonObject()\n .put(\"key\", \"value\")\n );\n logger.debug(\"requesting write: \" + request.toString());\n eb.send(\"storage-write-address\", request, new DeliveryOptions().setSendTimeout(1000), this);\n } else {\n Random random = new Random();\n List<String> keys = new ArrayList<String>(map.keySet());\n String randomKey = keys.get(random.nextInt(keys.size()));\n request.put(\"id\", randomKey);\n logger.debug(\"waiting for read: \" + request.toString());\n eb.send(\"storage-read-address\", request, new DeliveryOptions().setSendTimeout(1000), this);\n }\n } catch (Exception e) {\n logger.warn(\"Error\");\n makeRequest();\n }\n\n }", "private static HCI_Event handleHCIEvent( final String hciEvent) {\n\t\ttry {\n\t\t\t\n\t\t\tHCI_Event hciEvt = new HCI_Event(hciEvent).parse();\n\t\t\t// System.err.println(\"HCI_Event: \" + hciEvt.toString());\n\t\t\t\n\t\t\tif ( hciEvt instanceof HCI_CommandComplete) {\n\t\t\t\t\n\t\t\t\tbyte status = ((HCI_CommandComplete) hciEvt).getStatus();\n\t\t\t\tif ( status != 0x00) {\n\t\t\t\t\tHCI_Command.ErrorCode ec = HCI_Command.getErrorCode(status);\n\t\t\t\t\tlogger.severe( String.format( \"error 0x%02x, \\\"%s\\\" in HCI_CommandComplete: %s\", ec.code, ec.name, hciEvt.toString()));\n\t\t\t\t}\n\t\t\t\treturn null; // no further handling of event...\n\t\t\t\t\n\t\t\t} else if ( hciEvt instanceof HCI_CommandStatus) {\n\t\t\t\t\n\t\t\t\tbyte status = ((HCI_CommandStatus) hciEvt).getStatus();\n\t\t\t\tif ( status != 0x00) {\n\t\t\t\t\tHCI_Command.ErrorCode ec = HCI_Command.getErrorCode(status);\n\t\t\t\t\tlogger.severe( String.format( \"error 0x%02x, \\\"%s\\\" in HCI_CommandStatus: %s\", ec.code, ec.name, hciEvt.toString()));\n\t\t\t\t}\n\t\t\t\treturn null; // no further handling of event...\n\t\t\t\t\n\t\t\t} else if ( hciEvt instanceof HCI_InquiryComplete) {\n\t\t\t\tlogger.info( \"HCI_InquiryComplete: \" + hciEvt.toString());\n\t\t\t} else if ( hciEvt instanceof HCI_InquiryResult) {\n\t\t\t\tlogger.info( \"HCI_InquiryResult: \" + hciEvt.toString());\n\t\t\t} else if ( hciEvt instanceof HCI_ConnectionComplete) {\n\t\t\t\tlogger.info( \"HCI_ConnectionComplete: \" + hciEvt.toString());\n\t\t\t} else if ( hciEvt instanceof LE_AdvertisingReport) {\n\t\t\t\t// we get an incoming LE_AdvertisingReport while advertising?\n\t\t\t\tlogger.info( \"LE_AdvertisingReport: \" + hciEvt.toString());\n\t\t\t\tlogger.info( hciEvt.toString());\n\t\t\t} else {\n\t\t\t\tlogger.warning( \"No narrowing for HCI_Event in HCI response: \" + hciEvt.toString());\n\t\t\t}\n\t\t\treturn hciEvt;\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t\t\n\t}", "@Override \n public void run() {\n\t\tString path = Urls.URL_14;\n\t\t\n\t\tMap<String, String> map = new HashMap<String, String>();\n\n\t \tList<BasicNameValuePair> params = HttpUtils.setParams(map);\n\n\t \tLog.i(TAG, path);\n\t\t\n\t\tApkInfoItem apk = new ApkInfoItem();\n\t\ttry {\n\t\t\tString jsonStr = RequestService.getInstance().getRequest(params, path, new HashMap<String, String>());\n\t\t \tJSONObject jsonObject = new JSONObject(jsonStr);\n\t\t \t\n\t\t\tapk.setApkPath(jsonObject.getString(\"apkPath\"));\n\t\t\tapk.setVersion(jsonObject.getString(\"apkVersion\"));\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tMessage msg = new Message();\n\t\t\tmsg.obj = apk;\n\t\t\tmsg.what = Constants.GET_UPDATEINFO_ERROR;\n\t\t\thandler.sendMessage(msg);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tMessage msg = new Message();\n\t\tmsg.obj = apk;\n\t\tmsg.what = Constants.UPDATE_CLIENT;\n\t\thandler.sendMessage(msg);\n }", "@PostMapping(\"/event-actions/execute\")\n @Timed\n public ResponseEntity<EventActionDTO> executedEventAction(@RequestBody EventActionDTO eventActionDTO) throws URISyntaxException {\n log.debug(\"REST request to process EventAction : {}\", eventActionDTO);\n return new ResponseEntity<EventActionDTO>(eventActionDTO, null, HttpStatus.ACCEPTED);\n }", "void requestData();", "@Override\n\tpublic void processResponse(ResponseEvent responseEvent) {\n\t\tResponse response = responseEvent.getResponse();\n\t\ttry {\n\t\t\t// Display the response message in the text area.\n\t\t\t//printMessage(\"\\nReceived response: \" + response.toString());\n\n\t\t\tClientTransaction tid = responseEvent.getClientTransaction();\n\t\t\tCSeqHeader cseq = (CSeqHeader) response.getHeader(CSeqHeader.NAME);\n\t\t\tif (response.getStatusCode() == Response.OK) {\n\t\t\t\tif (cseq.getMethod().equals(Request.REGISTER)) {\n\t\t\t\t\tSystem.out.println(\"regist ACK OK\");\n\t\t\t\t\t//onInvite();\n\t\t\t\t} else if (cseq.getMethod().equals(Request.INVITE)) {\n\t\t\t\t\tDialog dialog = inviteTid.getDialog();\n\t\t\t\t\tRequest ackRequest = dialog.createAck(cseq.getSeqNumber());\n\t\t\t\t\tdialog.sendAck(ackRequest);\n\t\t\t\t\tSystem.out.println(\"Sending ACK\");\n\t\t\t\t} else if (cseq.getMethod().equals(Request.MESSAGE)) {\n\t\t\t\t\tSystem.out.println(\"Send OK !\");\n\t\t\t\t} else if (cseq.getMethod().equals(Request.CANCEL)) {\n\t\t\t\t\tSystem.out.println(\"Sending BYE -- cancel went in too late !!\");\n\t\t\t\t}\n\t\t\t} else if (response.getStatusCode() == Response.PROXY_AUTHENTICATION_REQUIRED\n\t\t\t\t\t|| response.getStatusCode() == Response.UNAUTHORIZED) {\n\t\t\t\tauthenticationHelper = ((SipStackExt) sipStack)\n\t\t\t\t\t\t.getAuthenticationHelper(new AccountManagerImpl(),\n\t\t\t\t\t\t\t\theaderFactory);\n\t\t\t\tinviteTid = authenticationHelper.handleChallenge(response, tid,\n\t\t\t\t\t\tsipProvider, 5);\n\t\t\t\tinviteTid.getRequest().addHeader(\n\t\t\t\t\t\theaderFactory.createExpiresHeader(3600));\n\t\t\t\tinviteTid.getRequest().setMethod(Request.REGISTER);\n\t\t\t\tinviteTid.sendRequest();\n\t\t\t\tinvco++;\n\t\t\t\tprintMessage(\"[processResponse] Request sent:\\n\" + inviteTid.getRequest().toString() + \"\\n\\n\");\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "public void fireEmergencyRequest() {\n\t\televatorManager.handleEmergency();\n\t}", "@Override\n\t\t\tpublic void onFailure(Request request, IOException e) {\n\t\t\t\t Log.i(\"info\",\"hehe\");\n\t\t\t}", "public void scanEid( View v){\n \n \t \ttag_type_spinner.setSelection(2);\n \t// Here is where I need to get a tag scanned and put the data into the variable LastEID\n\t\tif (mService != null) {\n\t\t\ttry {\n\t\t\t\t//Start eidService sending tags\n\t\t\t\tMessage msg = Message.obtain(null, eidService.MSG_SEND_ME_TAGS);\n\t\t\t\tmsg.replyTo = mMessenger;\n\t\t\t\tmService.send(msg);\n\t\t\t \t//\tmake the scan eid button green\n\t\t \tButton btn = (Button) findViewById( R.id.scan_eid_btn );\n\t\t \tbtn.getBackground().setColorFilter(new LightingColorFilter(0x0000FF00, 0xff00ff00));\n\t\t\t} catch (RemoteException e) {\n\t\t\t\t// In this case the service has crashed before we could even do anything with it\n\t\t\t}\n\t\t} \t \t\n }", "void onEntry(FilterContext ctx) throws SoaException;", "public void handle(HttpExchange exch) {\n\n }", "@Override\n\tpublic void processRequest() {\n\t\ttry {\n\t\t\tkoncept.setTextcat(getParams().get(PFCConstants.HTTP_REQUEST_PARAM_TEXT_CA)[0]);\n\t\t\tkoncept.setTextjap(getParams().get(PFCConstants.HTTP_REQUEST_PARAM_TEXT_JP)[0]);\n\t\t\tif (getParams().containsKey(PFCConstants.HTTP_REQUEST_PARAM_LLISTA_ESTUDI)) {\n\t\t\t\tkoncept.setIdLlista(getParams().get(PFCConstants.HTTP_REQUEST_PARAM_LLISTA_ESTUDI)[0]);\n\t\t\t}\n\n\t\t\tif (getParams().containsKey(PFCConstants.HTTP_REQUEST_PARAM_PRON_JAP)) {\n\t\t\t\tkoncept.setPronjap(getParams().get(PFCConstants.HTTP_REQUEST_PARAM_PRON_JAP)[0]);\n\t\t\t}\n\n\t\t\t// TODO Gestionar amb excepcions.\n\t\t\tboolean b = DBController.konceptExists(koncept);\n\t\t\tString id = null;\n\n\t\t\tif (!b) {\n\t\t\t\tid = DBController.createKoncept(koncept);\n\t\t\t\tkoncept.setId(id);\n\n\t\t\t\tlogger.info(\"Koncept created. ID = \" + id);\n\n\t\t\t\tif (getParams().containsKey(PFCConstants.HTTP_REQUEST_PARAM_AUDIO_JP)) {\n\t\t\t\t\tString pathJP = processAudio(getParams(), PFCConstants.LANG_JAP, koncept);\n\t\t\t\t\tkoncept.setAudioJapones(pathJP);\n\t\t\t\t}\n\n\t\t\t\tif (getParams().containsKey(PFCConstants.HTTP_REQUEST_PARAM_AUDIO_CA)) {\n\t\t\t\t\tString pathCA = processAudio(getParams(), PFCConstants.LANG_CAT, koncept);\n\t\t\t\t\tkoncept.setAudioCatala(pathCA);\n\t\t\t\t}\n\n\t\t\t\t// Actualitzem valor audio.\n\t\t\t\tDBController.update(koncept);\n\n\t\t\t\tKonceptIdResponseBean rb = new KonceptIdResponseBean(koncept.getId());\n\t\t\t\twriteResponse(rb);\n\t\t\t} else {\n\t\t\t\tResponseBean rb = new ErrorResponseBean(\"La paraula ja existeix\");\n\t\t\t\twriteResponse(rb);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"Error processing request!\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void realSubmitExcuse(){\r\n\t\ta.submitExcuse(userId, excuseTxt, excuseDesc, \r\n\t\t\t\tnew RestCallback(){\r\n\t\t\t@Override\r\n\t\t\tpublic void onTaskComplete(Object result) {\r\n\t\t\t\tIntent myIntent = new Intent(ExcuseCreate.this, RecordUpdated.class);\r\n\t\t\t\tmyIntent.putExtra(\"message\", \"Excuse Submitted\");\r\n\t\t\t\tstartActivity(myIntent);\r\n\t\t\t}\r\n\t\t});\r\n\t}", "protected abstract void nextRequest ();", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tString id_string = request.getParameter(\"id\");\n\t\tif(id_string != null) {\n//\t\t\tif the paremter is not null\n\t\t\tint id = Integer.valueOf(id_string);\n\t\t\tEvent event = EventService.findEventWith(id);\n\t\t\t\n\t\t\tif(event == null) {\n//\t\t\t\tif event does not exist\n\t\t\t\tresponse.sendRedirect(\"index.jsp\");\n\t\t\t} else {\n//\t\t\t\tif event exist\n\t\t\t\trequest.setAttribute(\"event\", event);\n\t\t\t\trequest.getRequestDispatcher(\"/detail_event.jsp\").forward(request, response);\n\t\t\t}\n\t\t} else {\n//\t\t\tif the parameter is null we will send them back to index.jsp\n\t\t\tresponse.sendRedirect(\"index.jsp\");\n\t\t}\n\t}", "@Override\r\n\tprotected boolean onDealRequest(YRequest request, YSystem system,\r\n\t\t\tYScene sceneCurrent, YBaseDomain domainContext) {\n\t\treturn false;\r\n\t}", "abstract public LoanApplicationResponse handleLoanRequest(LoanApplicationRequest loanRequest);", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String acao = request.getParameter(\"acao\");\n if (acao.equals(\"logar\")) {\n logar(request, response);\n } else if(acao.equals(\"logout\")) {\n logout(request, response);\n }\n }" ]
[ "0.63297045", "0.6251224", "0.62283283", "0.6191493", "0.5972256", "0.5955132", "0.5821009", "0.5645318", "0.5644383", "0.56406474", "0.5614731", "0.5510948", "0.54812443", "0.54742295", "0.54542637", "0.5408181", "0.5322171", "0.53219557", "0.53212553", "0.5308753", "0.52880466", "0.52876884", "0.52874464", "0.5276412", "0.52450424", "0.52328753", "0.5193344", "0.5189411", "0.5185694", "0.5182122", "0.5155725", "0.5151645", "0.5140092", "0.5120982", "0.51044446", "0.5101871", "0.5101871", "0.5101871", "0.5101871", "0.50950927", "0.50866747", "0.50806135", "0.50777346", "0.5068754", "0.5060118", "0.5045777", "0.5030771", "0.50294155", "0.5025461", "0.50188655", "0.5015219", "0.50093406", "0.49826312", "0.4978875", "0.49708033", "0.4967927", "0.49606284", "0.49481684", "0.4936531", "0.49324888", "0.49215755", "0.49214366", "0.4919785", "0.49078208", "0.48927924", "0.48905516", "0.48896646", "0.48878524", "0.48866096", "0.48865303", "0.48827928", "0.48696506", "0.48671317", "0.48587376", "0.48523563", "0.484794", "0.48359713", "0.48350817", "0.48342466", "0.4832011", "0.48255837", "0.48169953", "0.4812973", "0.4794184", "0.47909784", "0.47872487", "0.4783368", "0.47792184", "0.47718617", "0.47689304", "0.47670376", "0.4760111", "0.4759244", "0.4756764", "0.47564104", "0.47550273", "0.47538725", "0.475322", "0.4751426", "0.474639" ]
0.5964641
5
Handles an Xtab request
public Map<String, String> runXtabRequest(DvnRJobRequest sro, RConnection c){ String optionBanner = "########### xtab option ###########\n"; dbgLog.fine(optionBanner); historyEntry.add(optionBanner); Map<String, String> sr = new HashMap<String, String>(); sr.put("requestdir", requestdir); sr.put("option", "xtab"); String ResultHtmlFile = "Rout."+PID+".html" ; sr.put("html", "/"+requestdir+ "/" +ResultHtmlFile); String RcodeFile = "Rcode." + PID + ".R"; try { String univarStatLine = "try(x<-univarStat(dtfrm=x))"; String vdcUtilLibLine = "library(VDCutil)"; //c.voidEval("dol<-''"); String aol4xtab = "aol<-c(0,0,1)"; historyEntry.add(aol4xtab); c.voidEval(aol4xtab); // create a manifest page for this job request String homePageTitle = "Dataverse Analysis: Request #"+PID ; // create a temp dir String createTmpDir = "dir.create('"+wrkdir +"')"; dbgLog.fine("createTmpDir="+createTmpDir); historyEntry.add(createTmpDir); c.voidEval(createTmpDir); String ResultHtmlFileBase = "Rout."+PID ; String openHtml = "htmlsink<-HTMLInitFile(outdir = '"+ wrkdir +"', filename='"+ResultHtmlFileBase+ "', extension='html', CSSFile='R2HTML.css', Title ='"+ homePageTitle+"')"; dbgLog.fine("openHtml="+openHtml); historyEntry.add(openHtml); c.voidEval(openHtml); String StudyTitle = sro.getStudytitle(); String pageHeaderContents = "hdrContents <- \"<h1>Dataverse Analysis</h1><h2>Results</h2><p>Study Title:"+ StudyTitle+"</p><hr />\""; dbgLog.fine("pageHeaderContents="+pageHeaderContents); historyEntry.add(pageHeaderContents); c.voidEval(pageHeaderContents); String pageHeader = "HTML(file=htmlsink,hdrContents)"; dbgLog.fine("pageHeader="+pageHeader); historyEntry.add(pageHeader); c.voidEval(pageHeader); /* aol<-c(0,0,1) dol<-"" try(x<-univarStat(dtfrm=x)) library(VDCutil); try(VDCcrossTabulation(HTMLfile="/tmp/VDC/Rout.6769.html", data=x, classificationVars=c('NAThex5FDISChex5Fnew','LOChex5FINThex5Fnew'), wantPercentages=F, wantTotals=T, wantStats=T, wantExtraTables=T)); */ // command lines dbgLog.fine("univarStatLine="+univarStatLine); historyEntry.add(univarStatLine); c.voidEval(univarStatLine); historyEntry.add(vdcUtilLibLine); c.voidEval(vdcUtilLibLine); String[] classVar = sro.getXtabClassVars(); historyEntry.add("classVar<-c("+ DvnDSButil.joinNelementsPerLine(classVar, true)+")"); c.assign("classVar", new REXPString(classVar)); String[] freqVar = sro.getXtabFreqVars(); if (freqVar != null){ historyEntry.add("freqVar<-c("+ DvnDSButil.joinNelementsPerLine(freqVar, true) +")"); c.assign("freqVar", new REXPString(freqVar)); }else { historyEntry.add("freqVar<-c()"); c.voidEval("freqVar<-c()"); } String[] xtabOptns= sro.getXtabOutputOptions();// {"F", "T", "T", "T"}; //"HTMLfile='"+wrkdir+ "/" +ResultHtmlFile+"'"+ String VDCxtab = "try(VDCcrossTabulation("+ "HTMLfile=htmlsink"+ ", data=x"+ ", classificationVars=classVar"+ ", freqVars=freqVar" + ", wantPercentages="+xtabOptns[2]+ ", wantTotals="+xtabOptns[0]+ ", wantStats="+xtabOptns[1]+ ", wantExtraTables="+xtabOptns[3]+"))"; dbgLog.fine("VDCxtab="+VDCxtab); historyEntry.add(VDCxtab); c.voidEval(VDCxtab); String closeHtml = "HTMLEndFile()"; historyEntry.add(closeHtml); c.voidEval(closeHtml); // save workspace String objList = "objList<-ls()"; dbgLog.fine("objList="+objList); c.voidEval(objList); String RdataFileName = "Rworkspace."+PID+".RData"; sr.put("Rdata", "/"+requestdir+ "/" + RdataFileName); String saveWS = "save(list=objList, file='"+wrkdir +"/"+ RdataFileName +"')"; dbgLog.fine("save the workspace="+saveWS); c.voidEval(saveWS); // write back the R workspace to the dvn String wrkspFileName = wrkdir +"/"+ RdataFileName; dbgLog.fine("wrkspFileName="+wrkspFileName); int wrkspflSize = getFileSize(c,wrkspFileName); File wsfl = writeBackFileToDvn(c, wrkspFileName, RWRKSP_FILE_PREFIX ,"RData", wrkspflSize); if (wsfl != null){ sr.put("wrkspFileName", wsfl.getAbsolutePath()); dbgLog.fine("wrkspFileName="+wsfl.getAbsolutePath()); } else { dbgLog.fine("wrkspFileName is null"); } // command history String[] ch = (String[])historyEntry.toArray(new String[historyEntry.size()]); c.assign("ch", new REXPString(ch)); String saveRcodeFile = "cat(file='"+ wrkdir +"/"+ RcodeFile +"',paste(ch,collapse='\n'))"; dbgLog.fine(saveRcodeFile); c.voidEval(saveRcodeFile); // copy the dvn-patch css file to the wkdir // file.copy(from, to, overwrite = FALSE) String cssFile =R2HTML_CSS_DIR + "/" +"R2HTML.css"; String cpCssFile = "file.copy('"+cssFile+"','"+wrkdir+"')"; c.voidEval(cpCssFile); // tab data file String mvTmpTabFile = "file.rename('"+ tempFileName +"','"+ tempFileNameNew +"')"; c.voidEval(mvTmpTabFile); dbgLog.fine("move temp file="+mvTmpTabFile); // move the temp dir to the web-temp root dir String mvTmpDir = "file.rename('"+wrkdir+"','"+webwrkdir+"')"; dbgLog.fine("web-temp_dir="+mvTmpDir); c.voidEval(mvTmpDir); } catch (RserveException rse) { rse.printStackTrace(); sr.put("RexecError", "true"); return sr; } sr.put("RexecError", "false"); return sr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void handle(Element xmlRequest, HttpServletRequest req, HttpServletResponse res) throws IOException;", "public void handleXsp(HtmlObjects.Xsp t)\n {\n }", "void handleRequest();", "public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {\r\n\t\tEmployee myEmp = (Employee) applicationSecurityManager.getEmployee(request);\r\n\t\tList<Timesheet> timesheets = timesheetManager.getTimesheets(myEmp.getId());\r\n\t\ttimexJmxBean.setTimesheetsFetched(timexJmxBean.getTimesheetsFetched() + timesheets.size());\r\n\t\tlogger.debug(\"Showing timesheets for employee id = \" + myEmp.getId());\r\n\t\tModelAndView model = new ModelAndView(getSuccessView(), MAP_KEY, timesheets).addObject(EMP_KEY, myEmp).addObject(\"fileURL\", this.uploadFileURL);\r\n\t\tSource timesheetsXml = null;\r\n\t\ttimesheetsXml = xmlView.createXsltSource(model.getModel(), \"timesheets\", request, response);\r\n\t\treturn model.addObject(XML_KEY, timesheetsXml);\r\n\t}", "@RequestMapping(value = \"/specify/hbase/schema/ajax\", method = RequestMethod.GET)\n\tpublic void getStorageHBaseSchemaAjax(HttpServletResponse response, HttpServletRequest request) {\n\t\ttry {\n\t\t\tbyte[] output = storageService.getHBaseSchema(request.getParameter(\"sql\")).getBytes();;\n\t\t\tBaseController.response(output, response);\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t} finally {\n\t\t}\n\n\t}", "@Override\n\tprotected void handleTab() {\n\t\thandleSpace();\n\t}", "public void handleRequest(ExtractionRequest request);", "void xsetRequestID(org.apache.xmlbeans.XmlString requestID);", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, java.io.IOException {\n\n response.setContentType(\"application/x-msexcel\");\n Vector resultXLS = new Vector();\n Location location = new Location();\n\n long userId = JSPRequestValue.requestLong(request, \"user_id\");\n int type = JSPRequestValue.requestInt(request, \"type\");\n int invType = JSPRequestValue.requestInt(request, \"inv_type\");\n \n User u = new User();\n try {\n u = DbUser.fetch(userId);\n } catch (Exception e) {\n }\n\n Vector result = new Vector();\n ReportParameter rp = new ReportParameter();\n try {\n HttpSession session = request.getSession();\n resultXLS = (Vector) session.getValue(\"REPORT_INVENTORY_STOCK_SUMMARY\");\n result = (Vector) resultXLS.get(0);\n rp = (ReportParameter) resultXLS.get(1);\n } catch (Exception e) {\n }\n\n Company cmp = new Company();\n try {\n Vector listCompany = DbCompany.list(0, 0, \"\", \"\");\n if (listCompany != null && listCompany.size() > 0) {\n cmp = (Company) listCompany.get(0);\n }\n } catch (Exception ext) {\n System.out.println(ext.toString());\n }\n\n if (rp.getLocationId() != 0) {\n try {\n location = DbLocation.fetchExc(rp.getLocationId());\n } catch (Exception e) {\n }\n }\n\n boolean gzip = false;\n\n OutputStream gzo;\n if (gzip) {\n response.setHeader(\"Content-Encoding\", \"gzip\");\n gzo = new GZIPOutputStream(response.getOutputStream());\n } else {\n gzo = response.getOutputStream();\n }\n\n PrintWriter wb = new PrintWriter(new OutputStreamWriter(gzo, \"UTF-8\"));\n \n String title = \"\";\n if(invType==0){\n title = \"INVENTORY REPORT (VALUE)\";\n }else{\n title = \"INVENTORY REPORT (QUANTITY)\";\n }\n\n wb.println(\" <?xml version=\\\"1.0\\\"?>\");\n wb.println(\" <?mso-application progid=\\\"Excel.Sheet\\\"?>\");\n wb.println(\" <Workbook xmlns=\\\"urn:schemas-microsoft-com:office:spreadsheet\\\"\");\n wb.println(\" xmlns:o=\\\"urn:schemas-microsoft-com:office:office\\\"\");\n wb.println(\" xmlns:x=\\\"urn:schemas-microsoft-com:office:excel\\\"\");\n wb.println(\" xmlns:ss=\\\"urn:schemas-microsoft-com:office:spreadsheet\\\"\");\n wb.println(\" xmlns:html=\\\"http://www.w3.org/TR/REC-html40\\\">\");\n wb.println(\" <DocumentProperties xmlns=\\\"urn:schemas-microsoft-com:office:office\\\">\");\n wb.println(\" <Author>Roy</Author>\");\n wb.println(\" <LastAuthor>Roy</LastAuthor>\");\n wb.println(\" <Created>2015-01-25T05:27:31Z</Created>\");\n wb.println(\" <Version>12.00</Version>\");\n wb.println(\" </DocumentProperties>\");\n wb.println(\" <ExcelWorkbook xmlns=\\\"urn:schemas-microsoft-com:office:excel\\\">\");\n wb.println(\" <WindowHeight>8445</WindowHeight>\");\n wb.println(\" <WindowWidth>20055</WindowWidth>\");\n wb.println(\" <WindowTopX>240</WindowTopX>\");\n wb.println(\" <WindowTopY>105</WindowTopY>\");\n wb.println(\" <ProtectStructure>False</ProtectStructure>\");\n wb.println(\" <ProtectWindows>False</ProtectWindows>\");\n wb.println(\" </ExcelWorkbook>\");\n wb.println(\" <Styles>\");\n wb.println(\" <Style ss:ID=\\\"Default\\\" ss:Name=\\\"Normal\\\">\");\n wb.println(\" <Alignment ss:Vertical=\\\"Bottom\\\"/>\");\n wb.println(\" <Borders/>\");\n wb.println(\" <Font ss:FontName=\\\"Calibri\\\" x:Family=\\\"Swiss\\\" ss:Size=\\\"11\\\" ss:Color=\\\"#000000\\\"/>\");\n wb.println(\" <Interior/>\");\n wb.println(\" <NumberFormat/>\");\n wb.println(\" <Protection/>\");\n wb.println(\" </Style>\");\n \n wb.println(\" <Style ss:ID=\\\"s70\\\">\");\n wb.println(\" <Font ss:FontName=\\\"Calibri\\\" x:Family=\\\"Swiss\\\" ss:Size=\\\"11\\\" ss:Color=\\\"#000000\\\"\");\n wb.println(\" ss:Bold=\\\"1\\\"/>\");\n wb.println(\" </Style>\");\n \n wb.println(\" <Style ss:ID=\\\"s70i\\\">\");\n wb.println(\" <Alignment ss:Horizontal=\\\"Right\\\" ss:Vertical=\\\"Center\\\"/>\");\n wb.println(\" <Font ss:FontName=\\\"Calibri\\\" x:Family=\\\"Swiss\\\" ss:Size=\\\"11\\\" ss:Color=\\\"#000000\\\"\");\n wb.println(\" />\");\n wb.println(\" </Style>\");\n \n wb.println(\" <Style ss:ID=\\\"s81\\\">\");\n wb.println(\" <Borders>\");\n wb.println(\" <Border ss:Position=\\\"Bottom\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" <Border ss:Position=\\\"Left\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" <Border ss:Position=\\\"Right\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" <Border ss:Position=\\\"Top\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" </Borders>\");\n wb.println(\" </Style>\");\n wb.println(\" <Style ss:ID=\\\"s82\\\">\");\n wb.println(\" <Alignment ss:Horizontal=\\\"Center\\\" ss:Vertical=\\\"Center\\\"/>\");\n wb.println(\" <Borders>\");\n wb.println(\" <Border ss:Position=\\\"Bottom\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" <Border ss:Position=\\\"Left\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" <Border ss:Position=\\\"Right\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" <Border ss:Position=\\\"Top\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" </Borders>\");\n wb.println(\" </Style>\");\n wb.println(\" <Style ss:ID=\\\"s83\\\">\");\n wb.println(\" <Borders>\");\n wb.println(\" <Border ss:Position=\\\"Bottom\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" <Border ss:Position=\\\"Left\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" <Border ss:Position=\\\"Right\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" <Border ss:Position=\\\"Top\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" </Borders>\");\n wb.println(\" <NumberFormat ss:Format=\\\"Standard\\\"/>\");\n wb.println(\" </Style>\");\n wb.println(\" <Style ss:ID=\\\"s84\\\">\");\n wb.println(\" <Alignment ss:Horizontal=\\\"Center\\\" ss:Vertical=\\\"Center\\\"/>\");\n wb.println(\" <Borders>\");\n wb.println(\" <Border ss:Position=\\\"Bottom\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" <Border ss:Position=\\\"Left\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" <Border ss:Position=\\\"Right\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" <Border ss:Position=\\\"Top\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" </Borders>\");\n wb.println(\" <Font ss:FontName=\\\"Calibri\\\" x:Family=\\\"Swiss\\\" ss:Size=\\\"11\\\" ss:Color=\\\"#000000\\\"\");\n wb.println(\" ss:Bold=\\\"1\\\"/>\");\n wb.println(\" </Style>\");\n wb.println(\" <Style ss:ID=\\\"s85\\\">\");\n wb.println(\" <Alignment ss:Horizontal=\\\"Center\\\" ss:Vertical=\\\"Center\\\" ss:WrapText=\\\"1\\\"/>\");\n wb.println(\" <Borders>\");\n wb.println(\" <Border ss:Position=\\\"Bottom\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" <Border ss:Position=\\\"Left\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" <Border ss:Position=\\\"Right\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" <Border ss:Position=\\\"Top\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" </Borders>\");\n wb.println(\" <Font ss:FontName=\\\"Calibri\\\" x:Family=\\\"Swiss\\\" ss:Size=\\\"11\\\" ss:Color=\\\"#000000\\\"\");\n wb.println(\" ss:Bold=\\\"1\\\"/>\");\n wb.println(\" </Style>\");\n wb.println(\" <Style ss:ID=\\\"s86\\\">\");\n wb.println(\" <Alignment ss:Horizontal=\\\"Center\\\" ss:Vertical=\\\"Bottom\\\"/>\");\n wb.println(\" <Borders>\");\n wb.println(\" <Border ss:Position=\\\"Bottom\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" <Border ss:Position=\\\"Left\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" <Border ss:Position=\\\"Right\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" <Border ss:Position=\\\"Top\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" </Borders>\");\n wb.println(\" <Font ss:FontName=\\\"Calibri\\\" x:Family=\\\"Swiss\\\" ss:Size=\\\"11\\\" ss:Color=\\\"#000000\\\"\");\n wb.println(\" ss:Bold=\\\"1\\\"/>\");\n wb.println(\" </Style>\");\n wb.println(\" <Style ss:ID=\\\"s87\\\">\");\n wb.println(\" <Alignment ss:Horizontal=\\\"Center\\\" ss:Vertical=\\\"Bottom\\\"/>\");\n wb.println(\" <Borders>\");\n wb.println(\" <Border ss:Position=\\\"Bottom\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" <Border ss:Position=\\\"Left\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" <Border ss:Position=\\\"Right\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" <Border ss:Position=\\\"Top\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" </Borders>\");\n wb.println(\" <Font ss:FontName=\\\"Calibri\\\" x:Family=\\\"Swiss\\\" ss:Size=\\\"11\\\" ss:Color=\\\"#000000\\\"\");\n wb.println(\" ss:Bold=\\\"1\\\"/>\");\n wb.println(\" </Style>\");\n wb.println(\" <Style ss:ID=\\\"s92\\\">\");\n wb.println(\" <Borders>\");\n wb.println(\" <Border ss:Position=\\\"Bottom\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" <Border ss:Position=\\\"Left\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" <Border ss:Position=\\\"Right\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" <Border ss:Position=\\\"Top\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\" </Borders>\");\n wb.println(\" <Font ss:FontName=\\\"Calibri\\\" x:Family=\\\"Swiss\\\" ss:Size=\\\"11\\\" ss:Color=\\\"#000000\\\"\");\n wb.println(\" ss:Bold=\\\"1\\\"/>\");\n wb.println(\" <NumberFormat ss:Format=\\\"Standard\\\"/>\");\n wb.println(\" </Style>\");\n wb.println(\" <Style ss:ID=\\\"s94\\\">\");\n wb.println(\" <Font ss:FontName=\\\"Calibri\\\" x:Family=\\\"Swiss\\\" ss:Size=\\\"12\\\" ss:Color=\\\"#000000\\\"\");\n wb.println(\" ss:Bold=\\\"1\\\"/>\");\n wb.println(\" </Style>\");\n wb.println(\" </Styles>\");\n wb.println(\" <Worksheet ss:Name=\\\"Sheet1\\\">\");\n wb.println(\" <Table>\");\n wb.println(\" <Column ss:AutoFitWidth=\\\"0\\\" ss:Width=\\\"39.75\\\"/>\");\n wb.println(\" <Column ss:AutoFitWidth=\\\"0\\\" ss:Width=\\\"123\\\"/>\");\n if(type == 1){\n wb.println(\" <Column ss:AutoFitWidth=\\\"0\\\" ss:Width=\\\"123\\\"/>\");\n wb.println(\" <Column ss:AutoFitWidth=\\\"0\\\" ss:Width=\\\"80\\\"/>\");\n wb.println(\" <Column ss:AutoFitWidth=\\\"0\\\" ss:Width=\\\"123\\\"/>\");\n }\n \n wb.println(\" <Column ss:Width=\\\"84.75\\\" ss:Span=\\\"13\\\"/>\");\n wb.println(\" <Row>\");\n if(type == 0){\n wb.println(\" <Cell ss:MergeAcross=\\\"15\\\" ss:StyleID=\\\"s70i\\\"><Data ss:Type=\\\"String\\\">Print date : \" + JSPFormater.formatDate(new Date(), \"dd-MM-yyyy HH:mm:ss\") + \", by \" + u.getFullName() + \"</Data></Cell>\");\n }else{\n wb.println(\" <Cell ss:MergeAcross=\\\"18\\\" ss:StyleID=\\\"s70i\\\"><Data ss:Type=\\\"String\\\">Print date : \" + JSPFormater.formatDate(new Date(), \"dd-MM-yyyy HH:mm:ss\") + \", by \" + u.getFullName() + \"</Data></Cell>\"); \n }\n wb.println(\" </Row>\");\n wb.println(\" <Row ss:Height=\\\"18.75\\\">\");\n wb.println(\" <Cell ss:StyleID=\\\"s94\\\"><Data ss:Type=\\\"String\\\">\" + cmp.getName() + \"</Data></Cell>\");\n wb.println(\" </Row>\");\n wb.println(\" <Row ss:Height=\\\"18.75\\\">\");\n wb.println(\" <Cell ss:StyleID=\\\"s94\\\"><Data ss:Type=\\\"String\\\">\" + cmp.getAddress() + \"</Data></Cell>\");\n wb.println(\" </Row>\");\n wb.println(\" <Row>\");\n wb.println(\" <Cell ss:StyleID=\\\"s70\\\"><Data ss:Type=\\\"String\\\"></Data></Cell>\");\n wb.println(\" </Row>\");\n wb.println(\" <Row>\");\n wb.println(\" <Cell ss:StyleID=\\\"s70\\\"><Data ss:Type=\\\"String\\\">\"+title+\"</Data></Cell>\");\n wb.println(\" </Row>\");\n if (rp.getLocationId() != 0) {\n wb.println(\" <Row>\");\n wb.println(\" <Cell ss:StyleID=\\\"s70\\\"><Data ss:Type=\\\"String\\\">Location : \" + location.getName() + \"</Data></Cell>\");\n wb.println(\" </Row>\");\n }else{\n wb.println(\" <Row>\");\n wb.println(\" <Cell ss:StyleID=\\\"s70\\\"><Data ss:Type=\\\"String\\\">Location : All Location</Data></Cell>\");\n wb.println(\" </Row>\");\n }\n \n wb.println(\" <Row>\");\n wb.println(\" <Cell ss:StyleID=\\\"s70\\\"><Data ss:Type=\\\"String\\\">Period : \" + JSPFormater.formatDate(rp.getDateFrom(), \"dd MMM yyyy\") + \" - \" + JSPFormater.formatDate(rp.getDateTo(), \"dd MMM yyyy\") + \"</Data></Cell>\");\n wb.println(\" </Row>\");\n wb.println(\" <Row>\");\n wb.println(\" <Cell ss:StyleID=\\\"s70\\\"><Data ss:Type=\\\"String\\\"></Data></Cell>\");\n wb.println(\" </Row>\");\n \n wb.println(\" <Row >\");\n wb.println(\" <Cell ss:MergeDown=\\\"1\\\" ss:StyleID=\\\"s84\\\"><Data ss:Type=\\\"String\\\">Code </Data></Cell>\");\n wb.println(\" <Cell ss:MergeDown=\\\"1\\\" ss:StyleID=\\\"s84\\\"><Data ss:Type=\\\"String\\\">Category</Data></Cell>\");\n \n if(type == 1){\n wb.println(\" <Cell ss:MergeDown=\\\"1\\\" ss:StyleID=\\\"s84\\\"><Data ss:Type=\\\"String\\\">Sub Category</Data></Cell>\");\n wb.println(\" <Cell ss:MergeDown=\\\"1\\\" ss:StyleID=\\\"s84\\\"><Data ss:Type=\\\"String\\\">Sku </Data></Cell>\");\n wb.println(\" <Cell ss:MergeDown=\\\"1\\\" ss:StyleID=\\\"s84\\\"><Data ss:Type=\\\"String\\\">Item Name</Data></Cell>\");\n }\n \n wb.println(\" <Cell ss:MergeDown=\\\"1\\\" ss:StyleID=\\\"s84\\\"><Data ss:Type=\\\"String\\\">Begining </Data></Cell>\");\n wb.println(\" <Cell ss:MergeDown=\\\"1\\\" ss:StyleID=\\\"s84\\\"><Data ss:Type=\\\"String\\\">Incoming </Data></Cell>\");\n wb.println(\" <Cell ss:MergeDown=\\\"1\\\" ss:StyleID=\\\"s85\\\"><Data ss:Type=\\\"String\\\">Incoming &#10;Ajustment</Data></Cell>\");\n wb.println(\" <Cell ss:MergeDown=\\\"1\\\" ss:StyleID=\\\"s84\\\"><Data ss:Type=\\\"String\\\">RTV </Data></Cell>\");\n wb.println(\" <Cell ss:MergeAcross=\\\"1\\\" ss:StyleID=\\\"s86\\\"><Data ss:Type=\\\"String\\\">Transfer </Data></Cell>\");\n wb.println(\" <Cell ss:MergeDown=\\\"1\\\" ss:StyleID=\\\"s84\\\"><Data ss:Type=\\\"String\\\">Costing </Data></Cell>\");\n wb.println(\" <Cell ss:MergeAcross=\\\"1\\\" ss:StyleID=\\\"s86\\\"><Data ss:Type=\\\"String\\\">Repack </Data></Cell>\");\n wb.println(\" <Cell ss:MergeDown=\\\"1\\\" ss:StyleID=\\\"s84\\\"><Data ss:Type=\\\"String\\\">Shringkage </Data></Cell>\");\n wb.println(\" <Cell ss:MergeDown=\\\"1\\\" ss:StyleID=\\\"s84\\\"><Data ss:Type=\\\"String\\\">COGS </Data></Cell>\");\n wb.println(\" <Cell ss:MergeDown=\\\"1\\\" ss:StyleID=\\\"s84\\\"><Data ss:Type=\\\"String\\\">Net Sales </Data></Cell>\");\n wb.println(\" <Cell ss:MergeDown=\\\"1\\\" ss:StyleID=\\\"s84\\\"><Data ss:Type=\\\"String\\\">Ending </Data></Cell>\");\n wb.println(\" <Cell ss:MergeDown=\\\"1\\\" ss:StyleID=\\\"s84\\\"><Data ss:Type=\\\"String\\\">Inv. Turn Over</Data></Cell>\");\n wb.println(\" </Row>\");\n wb.println(\" <Row>\");\n if(type == 1){\n wb.println(\" <Cell ss:Index=\\\"10\\\" ss:StyleID=\\\"s87\\\"><Data ss:Type=\\\"String\\\">In </Data></Cell>\");\n }else{\n wb.println(\" <Cell ss:Index=\\\"7\\\" ss:StyleID=\\\"s87\\\"><Data ss:Type=\\\"String\\\">In </Data></Cell>\");\n }\n wb.println(\" <Cell ss:StyleID=\\\"s87\\\"><Data ss:Type=\\\"String\\\">Out </Data></Cell>\");\n if(type == 1){\n wb.println(\" <Cell ss:Index=\\\"13\\\" ss:StyleID=\\\"s87\\\"><Data ss:Type=\\\"String\\\">Stock Out </Data></Cell>\");\n }else{\n wb.println(\" <Cell ss:Index=\\\"10\\\" ss:StyleID=\\\"s87\\\"><Data ss:Type=\\\"String\\\">Stock Out </Data></Cell>\");\n }\n wb.println(\" <Cell ss:StyleID=\\\"s87\\\"><Data ss:Type=\\\"String\\\">Stock In</Data></Cell>\");\n wb.println(\" </Row>\");\n\n if (result != null && result.size() > 0) {\n\n double totBegining = 0;\n double totReceiving = 0;\n double totRecAdj = 0;\n double totRtv = 0;\n double totTrafIn = 0;\n double totTrafOut = 0;\n double totCosting = 0;\n double totMutation = 0;\n double totRepackOut = 0;\n double totAdjustment = 0;\n double totCogs = 0;\n double totNetSales = 0;\n double totEnding = 0;\n double totTurnOver = 0;\n\n for (int i = 0; i < result.size(); i++) {\n\n InvReport iReport = (InvReport) result.get(i);\n wb.println(\" <Row>\");\n wb.println(\" <Cell ss:StyleID=\\\"s82\\\"><Data ss:Type=\\\"String\\\">\" + iReport.getCode() + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s81\\\"><Data ss:Type=\\\"String\\\">\" + iReport.getSectionName() + \"</Data></Cell>\");\n if(type ==1){\n wb.println(\" <Cell ss:StyleID=\\\"s81\\\"><Data ss:Type=\\\"String\\\">\" + iReport.getCodeClass() + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s81\\\"><Data ss:Type=\\\"String\\\">\" + iReport.getSku() + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s81\\\"><Data ss:Type=\\\"String\\\">\" + iReport.getDesription() + \"</Data></Cell>\");\n }\n wb.println(\" <Cell ss:StyleID=\\\"s83\\\"><Data ss:Type=\\\"Number\\\">\" + iReport.getBegining() + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s83\\\"><Data ss:Type=\\\"Number\\\">\" + iReport.getReceiving() + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s83\\\"><Data ss:Type=\\\"Number\\\">\" + iReport.getReceivingAdjustment() + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s83\\\"><Data ss:Type=\\\"Number\\\">\" + iReport.getRtv() + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s83\\\"><Data ss:Type=\\\"Number\\\">\" + iReport.getTransferIn() + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s83\\\"><Data ss:Type=\\\"Number\\\">\" + iReport.getTransferOut() + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s83\\\"><Data ss:Type=\\\"Number\\\">\" + iReport.getCosting() + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s83\\\"><Data ss:Type=\\\"Number\\\">\" + iReport.getMutation() + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s83\\\"><Data ss:Type=\\\"Number\\\">\" + iReport.getRepackOut() + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s83\\\"><Data ss:Type=\\\"Number\\\">\" + iReport.getStockAdjustment() + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s83\\\"><Data ss:Type=\\\"Number\\\">\" + iReport.getCogs() + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s83\\\"><Data ss:Type=\\\"Number\\\">\" + iReport.getNetSales() + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s83\\\"><Data ss:Type=\\\"Number\\\">\" + iReport.getEnding() + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s83\\\"><Data ss:Type=\\\"Number\\\">\" + iReport.getTurnOvr() + \"</Data></Cell>\");\n wb.println(\" </Row>\");\n \n totBegining = totBegining + iReport.getBegining();\n totReceiving = totReceiving + iReport.getReceiving();\n totRecAdj = totRecAdj + iReport.getReceivingAdjustment();\n totRtv = totRtv + iReport.getRtv();\n totTrafIn = totTrafIn + iReport.getTransferIn();\n totTrafOut = totTrafOut + iReport.getTransferOut();\n totCosting = totCosting + iReport.getCosting();\n totMutation = totMutation + iReport.getMutation();\n totRepackOut = totRepackOut + iReport.getRepackOut();\n totAdjustment = totAdjustment + iReport.getStockAdjustment();\n totCogs = totCogs + iReport.getCogs();\n totNetSales = totNetSales + iReport.getNetSales();\n totEnding = totEnding + iReport.getEnding();\n totTurnOver = totTurnOver + iReport.getTurnOvr();\n }\n \n wb.println(\" <Row>\");\n wb.println(\" <Cell ss:MergeAcross=\\\"1\\\" ss:StyleID=\\\"s86\\\"><Data ss:Type=\\\"String\\\">Total</Data></Cell>\");\n if(type ==1){\n wb.println(\" <Cell ss:StyleID=\\\"s92\\\"><Data ss:Type=\\\"String\\\"></Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s92\\\"><Data ss:Type=\\\"String\\\"></Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s92\\\"><Data ss:Type=\\\"String\\\"></Data></Cell>\");\n }\n wb.println(\" <Cell ss:StyleID=\\\"s92\\\"><Data ss:Type=\\\"Number\\\">\" + totBegining + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s92\\\"><Data ss:Type=\\\"Number\\\">\" + totReceiving + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s92\\\"><Data ss:Type=\\\"Number\\\">\" + totRecAdj + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s92\\\"><Data ss:Type=\\\"Number\\\">\" + totRtv + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s92\\\"><Data ss:Type=\\\"Number\\\">\" + totTrafIn + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s92\\\"><Data ss:Type=\\\"Number\\\">\" + totTrafOut + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s92\\\"><Data ss:Type=\\\"Number\\\">\" + totCosting + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s92\\\"><Data ss:Type=\\\"Number\\\">\" + totMutation + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s92\\\"><Data ss:Type=\\\"Number\\\">\" + totRepackOut + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s92\\\"><Data ss:Type=\\\"Number\\\">\" + totAdjustment + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s92\\\"><Data ss:Type=\\\"Number\\\">\" + totCogs + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s92\\\"><Data ss:Type=\\\"Number\\\">\" + totNetSales + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s92\\\"><Data ss:Type=\\\"Number\\\">\" + totEnding + \"</Data></Cell>\");\n wb.println(\" <Cell ss:StyleID=\\\"s92\\\"><Data ss:Type=\\\"String\\\"></Data></Cell>\");\n wb.println(\" </Row>\");\n }\n wb.println(\" </Table>\");\n wb.println(\" <WorksheetOptions xmlns=\\\"urn:schemas-microsoft-com:office:excel\\\">\");\n wb.println(\" <PageSetup>\");\n wb.println(\" <Header x:Margin=\\\"0.3\\\"/>\");\n wb.println(\" <Footer x:Margin=\\\"0.3\\\"/>\");\n wb.println(\" <PageMargins x:Bottom=\\\"0.75\\\" x:Left=\\\"0.7\\\" x:Right=\\\"0.7\\\" x:Top=\\\"0.75\\\"/>\");\n wb.println(\" </PageSetup>\");\n wb.println(\" <Print>\");\n wb.println(\" <ValidPrinterInfo/>\");\n wb.println(\" <HorizontalResolution>300</HorizontalResolution>\");\n wb.println(\" <VerticalResolution>300</VerticalResolution>\");\n wb.println(\" </Print>\");\n wb.println(\" <Selected/>\");\n wb.println(\" <DoNotDisplayGridlines/>\");\n wb.println(\" <Panes>\");\n wb.println(\" <Pane>\");\n wb.println(\" <Number>3</Number>\");\n wb.println(\" <ActiveRow>20</ActiveRow>\");\n wb.println(\" <ActiveCol>2</ActiveCol>\");\n wb.println(\" </Pane>\");\n wb.println(\" </Panes>\");\n wb.println(\" <ProtectObjects>False</ProtectObjects>\");\n wb.println(\" <ProtectScenarios>False</ProtectScenarios>\");\n wb.println(\" </WorksheetOptions>\");\n wb.println(\" </Worksheet>\");\n wb.println(\" <Worksheet ss:Name=\\\"Sheet2\\\">\");\n wb.println(\" <Table>\");\n wb.println(\" </Table>\");\n wb.println(\" <WorksheetOptions xmlns=\\\"urn:schemas-microsoft-com:office:excel\\\">\");\n wb.println(\" <PageSetup>\");\n wb.println(\" <Header x:Margin=\\\"0.3\\\"/>\");\n wb.println(\" <Footer x:Margin=\\\"0.3\\\"/>\");\n wb.println(\" <PageMargins x:Bottom=\\\"0.75\\\" x:Left=\\\"0.7\\\" x:Right=\\\"0.7\\\" x:Top=\\\"0.75\\\"/>\");\n wb.println(\" </PageSetup>\");\n wb.println(\" <ProtectObjects>False</ProtectObjects>\");\n wb.println(\" <ProtectScenarios>False</ProtectScenarios>\");\n wb.println(\" </WorksheetOptions>\");\n wb.println(\" </Worksheet>\");\n wb.println(\" <Worksheet ss:Name=\\\"Sheet3\\\">\");\n wb.println(\" <Table>\");\n wb.println(\" </Table>\");\n wb.println(\" <WorksheetOptions xmlns=\\\"urn:schemas-microsoft-com:office:excel\\\">\");\n wb.println(\" <PageSetup>\");\n wb.println(\" <Header x:Margin=\\\"0.3\\\"/>\");\n wb.println(\" <Footer x:Margin=\\\"0.3\\\"/>\");\n wb.println(\" <PageMargins x:Bottom=\\\"0.75\\\" x:Left=\\\"0.7\\\" x:Right=\\\"0.7\\\" x:Top=\\\"0.75\\\"/>\");\n wb.println(\" </PageSetup>\");\n wb.println(\" <ProtectObjects>False</ProtectObjects>\");\n wb.println(\" <ProtectScenarios>False</ProtectScenarios>\");\n wb.println(\" </WorksheetOptions>\");\n wb.println(\" </Worksheet>\");\n wb.println(\" </Workbook>\");\n wb.println(\" \");\n wb.flush();\n }", "private void handleRequest(Request request) throws IOException{\n switch (request){\n case NEXTODD:\n case NEXTEVEN:\n new LocalThread(this, request, nextOddEven).start();\n break;\n case NEXTPRIME:\n case NEXTEVENFIB:\n case NEXTLARGERRAND:\n new NetworkThread(this, userID, serverIPAddress, request).start();\n break;\n default:\n break;\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String action = request.getParameter(\"action\");\n if (action == null) {\n response.setStatus(HttpServletResponse.SC_BAD_REQUEST);\n return;\n }\n \n HttpSession session = request.getSession();\n Integer userid = (Integer) session.getAttribute(\"userid\");\n if (userid == null) {\n response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);\n return;\n }\n \n /**\n * LOAD SHEET\n */\n if (action.equals(\"request\")) {\n try {\n int id = Integer.parseInt(request.getParameter(\"id\"));\n SheetUsuario sheet = SheetDAO.getSheet(id, userid);\n if (sheet != null) {\n if (sheet.getNome() != null) {\n response.setContentType(\"application/json;charset=UTF-8\");\n response.getWriter().print(\"[{\"\n + \"\\\"id\\\":\" + sheet.getId()\n + \",\\\"criador\\\":\" + sheet.getCriador()\n + \",\\\"idstyle\\\":\" + sheet.getIdstyle()\n + \",\\\"gameid\\\":\" + sheet.getGameid()\n + \",\\\"segura\\\":\" + (sheet.isSegura() ? \"true\" : \"false\")\n + \",\\\"visualizar\\\":\" + (sheet.isVisualizar()? \"true\" : \"false\")\n + \",\\\"editar\\\":\" + (sheet.isEditar()? \"true\" : \"false\")\n + \",\\\"deletar\\\":\" + (sheet.isDeletar()? \"true\" : \"false\")\n + \",\\\"values\\\":\" + sheet.getValues()\n + \",\\\"nome\\\":\" + GsonFactory.getFactory().getGson().toJson(sheet.getNome())\n + \"}]\");\n } else {\n response.setStatus(HttpServletResponse.SC_NOT_FOUND);\n }\n } else {\n response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);\n }\n } catch (NumberFormatException e) {\n response.setStatus(HttpServletResponse.SC_BAD_REQUEST);\n }\n return;\n }\n \n \n /**\n * LIST SHEETS\n */\n if (action.equals(\"list\")) {\n ArrayList<JogoUsuarioSheet> jogos = JogoDAO.getJogosSheets(userid);\n response.setContentType(\"application/json;charset=UTF-8\");\n GsonFactory.getFactory().getGson().toJson(jogos, response.getWriter());\n return;\n }\n \n /**\n * UPDATE SHEET\n */\n if (action.equals(\"update\")) {\n Validation valid = new Validation();\n String name = request.getParameter(\"name\");\n String values = request.getParameter(\"values\");\n if (!valid.validName(name) || values == null) {\n response.setStatus(HttpServletResponse.SC_BAD_REQUEST);\n return;\n }\n try {\n int id = Integer.parseInt(request.getParameter(\"id\"));\n Gson gson = GsonFactory.getFactory().getGson();\n JsonObject jvalues = gson.fromJson(values, JsonObject.class);\n\n kinds.Sheet sheet = new kinds.Sheet();\n sheet.setId(id);\n sheet.setNome(name);\n sheet.setValues(gson.toJson(jvalues));\n\n SheetDAO dao = new SheetDAO();\n int result = dao.updateSheet(sheet, userid);\n if (result == 2) {\n response.setStatus(HttpServletResponse.SC_NO_CONTENT);\n } else if (result == 1) {\n response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);\n } else if (result == 0) {\n response.setStatus(HttpServletResponse.SC_NOT_FOUND);\n } else if (result == -1) {\n response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);\n }\n } catch (NumberFormatException | JsonSyntaxException e) {\n response.setStatus(HttpServletResponse.SC_BAD_REQUEST);\n }\n return;\n }\n \n /**\n * LIST SHEET PERMISSIONS\n */\n if (action.equals(\"listPerm\")) {\n try {\n ArrayList<SheetPermissao> sp = SheetDAO.getPrivileges(Integer.parseInt(request.getParameter(\"id\")), userid);\n if (sp == null) {\n response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);\n } else if (sp.size() == 0) {\n response.setStatus(HttpServletResponse.SC_NOT_FOUND);\n } else {\n response.setContentType(\"application/json;charset=UTF-8\");\n GsonFactory.getFactory().getGson().toJson(sp, response.getWriter());\n }\n } catch (NumberFormatException e) {\n response.setStatus(HttpServletResponse.SC_BAD_REQUEST);\n }\n return;\n }\n \n /**\n * UPDATE PERMISSIONS\n */\n if (action.equals(\"updatePerm\")) {\n if (request.getParameter(\"id\") == null || request.getParameter(\"privileges\") == null) {\n response.setStatus(HttpServletResponse.SC_BAD_REQUEST);\n return;\n }\n try {\n int id = Integer.parseInt(request.getParameter(\"id\"));\n Gson gson = GsonFactory.getFactory().getGson();\n JsonArray privilegesJson = gson.fromJson(request.getParameter(\"privileges\"), JsonArray.class);\n SheetPermissao sp;\n ArrayList<SheetPermissao> sheets = new ArrayList<SheetPermissao>();\n JsonObject privilegeJson;\n for (int i = 0; i < privilegesJson.size(); i++) {\n privilegeJson = privilegesJson.get(i).getAsJsonObject();\n if (!privilegeJson.has(\"userid\") || !privilegeJson.has(\"visualizar\") || !privilegeJson.has(\"editar\")\n || !privilegeJson.has(\"deletar\")) {\n response.setStatus(HttpServletResponse.SC_BAD_REQUEST);\n return;\n }\n sp = new SheetPermissao();\n\n sp.setUserid(privilegeJson.get(\"userid\").getAsInt());\n sp.setVisualizar(privilegeJson.get(\"visualizar\").getAsBoolean());\n sp.setEditar(privilegeJson.get(\"editar\").getAsBoolean());\n sp.setDeletar(privilegeJson.get(\"deletar\").getAsBoolean());\n sp.setPromote(privilegeJson.get(\"promote\").getAsBoolean());\n\n sheets.add(sp);\n }\n int result = SheetDAO.updatePrivileges(sheets, id, userid);\n if (result == 1) {\n response.setStatus(HttpServletResponse.SC_NO_CONTENT);\n } else if (result == 0) {\n response.setStatus(HttpServletResponse.SC_NOT_FOUND);\n } else {\n response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR );\n }\n } catch (NumberFormatException | JsonSyntaxException e) {\n response.setStatus(HttpServletResponse.SC_BAD_REQUEST);\n }\n return;\n }\n \n /**\n * CREATE SHEET\n */\n if (action.equals(\"create\")) {\n try {\n Validation valid = new Validation();\n String name = request.getParameter(\"name\");\n if (!valid.validName(name)) {\n response.setStatus(HttpServletResponse.SC_BAD_REQUEST);\n return;\n }\n int idJogo = Integer.parseInt(request.getParameter(\"gameid\"));\n int idStyle = Integer.parseInt(request.getParameter(\"idstyle\"));\n boolean publica = request.getParameter(\"publica\") != null && request.getParameter(\"publica\").equalsIgnoreCase(\"true\");\n kinds.Sheet sheet = new kinds.Sheet();\n sheet.setCriador(userid);\n sheet.setIdstyle(idStyle);\n sheet.setNome(name);\n sheet.setValues(\"{}\");\n sheet.setPublica(publica);\n \n int creation = SheetDAO.createSheet(sheet, userid, idJogo);\n if (creation == 2) {\n response.setStatus(HttpServletResponse.SC_NO_CONTENT);\n } else if (creation == 1) {\n response.setStatus(HttpServletResponse.SC_NOT_FOUND);\n } else if (creation == 0) {\n response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);\n } else {\n response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);\n }\n } catch (NumberFormatException e) {\n response.setStatus(HttpServletResponse.SC_BAD_REQUEST);\n }\n return;\n }\n \n /**\n * DELETE SHEET\n */\n if (action.equals(\"delete\")) {\n try {\n int id = Integer.parseInt(request.getParameter(\"id\"));\n int result = SheetDAO.deleteSheet(id, userid);\n if (result == 1) {\n response.setStatus(HttpServletResponse.SC_NO_CONTENT);\n } else if (result == 0) {\n response.setStatus(HttpServletResponse.SC_NOT_FOUND);\n } else {\n response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);\n }\n } catch (NumberFormatException e) {\n response.setStatus(HttpServletResponse.SC_BAD_REQUEST);\n }\n return;\n }\n \n response.setStatus(HttpServletResponse.SC_NOT_IMPLEMENTED);\n }", "public void handleRequest(Request request) {\n\t\tgetCityData(request.getCityName());\n\t\texportToFile(request.getCityName());\n\t}", "void doHandle()\n\t{\n\t\t// should be at least on arg\n\t\tif (!hasMoreTokens())\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"argumentRequired\")); //$NON-NLS-1$\n\t\telse\n\t\t{\n\t\t\t// poor man's fix for supporting 'all' option\n\t\t\tString faultName = nextToken();\n\t\t\tObject[] names = new Object[] { faultName };\n\n\t\t\t// replace the single name with all of them\n\t\t\tif (faultName.equalsIgnoreCase(\"all\")) //$NON-NLS-1$\n\t\t\t\tnames = m_faultTable.names();\n\n\t\t\t// make sure we know about at least one\n\t\t if (!m_faultTable.exists((String)names[0]))\n\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"unrecognizedFault\")); //$NON-NLS-1$\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (!hasMoreTokens())\n\t\t\t\t\tlistFault((String)names[0]);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tString action = null;\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\twhile(hasMoreTokens())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\taction = nextToken();\n\t\t\t\t\t\t\tfor(int i=0; i<names.length; i++)\n\t\t\t\t\t\t\t\tm_faultTable.action((String)names[i], action);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(IllegalArgumentException iae)\n\t\t\t\t\t{\n\t\t\t\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\t\t\t\targs.put(\"action\", action); //$NON-NLS-1$\n\t\t\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"unrecognizedAction\", args)); //$NON-NLS-1$\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected void procActivos(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n\t\trequest.getRequestDispatcher(\"index.jsp\").forward(request, response);\n\t}", "public void handleRequest(String request) throws IOException {\n\n String method = getMethod(request);\n\n this.uri = ToolBox.getUri(request);\n this.url = ToolBox.getUrl(uri);\n this.extension = ToolBox.getExtension(url);\n\n System.out.println(\"method :\" + method);\n switch (method) {\n case \"GET\":\n doGet();\n break;\n case \"POST\":\n doPost();\n break;\n case \"HEAD\":\n doHead();\n break;\n case \"PUT\":\n doPut();\n break;\n case \"DELETE\":\n doDelete();\n break;\n default:\n statusCode = BAD_REQUEST;\n this.sendHeader(statusCode, \"text/html\", null);\n break;\n }\n this.out.flush();\n this.out.close();\n }", "public void handle(HttpExchange exch) {\n\n }", "Object handle(Object request);", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n String accion = request.getParameter(\"accion\");\n if (accion.equals(\"registroNuevo\")) {\n registroNuevo(request, response);\n } else {\n if (accion.equals(\"confirmacion\")) {\n confirmacion(request, response);\n } else {\n if (accion.equals(\"listaE\")) {\n listaDeEspecialidades(request, response);\n }\n }\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n response.setContentType(\"text/html;charset=UTF-8\");\n HttpSession session = request.getSession();\n String nextJSP = \"\";\n String action;\n int serviceId;\n try {\n /* TODO output your page here. You may use following sample code. */\n action = request.getParameter(CONFIG.PARAM_ACTION);\n if (CONFIG.ACTION_HATAXI.equals(action)) {\n String lang = \"en\";\n if (request.getSession().getAttribute(CONFIG.lang).equals(\"\")) {\n } else {\n lang = \"ar\";\n }\n serviceId = Integer.parseInt(request.getParameter(CONFIG.PARAM_SERVICE_ID));\n session.setAttribute(CONFIG.PARAM_SERVICE_ID, serviceId);\n nextJSP = CONFIG.HATAXI_PAGE;\n \n } else if (CONFIG.ACTION_HATAXI_CONFIRM.equals(action)) {\n String mobile = request.getParameter(\"DonatorPhone\");\n String amount = request.getParameter(\"donationValue\");\n\n String token = session.getAttribute(\"Token\").toString();\n HataxiClient hataxiClient = new HataxiClient();\n HataxiInquiryResponse resp = hataxiClient.hataxiInquiry(mobile, amount, \"en\", token, request.getRemoteAddr());\n session.setAttribute(\"validationResp\", resp);\n session.setAttribute(\"mobile\", mobile);\n nextJSP = CONFIG.HATAXI_CONFIRMATION;\n } else {\n String lang = \"en\";\n if (request.getSession().getAttribute(CONFIG.lang).equals(\"\")) {\n } else {\n lang = \"ar\";\n }\n String mobile = request.getParameter(\"DonatorPhone\");\n String amount = request.getParameter(\"txnValue\");\n\n HataxiPaymentRequest go = new HataxiPaymentRequest();\n go.setMobileNumber(mobile);\n go.setAmount(Double.parseDouble(amount));\n// go.setToken(request.getSession().getAttribute(\"Token\").toString());\n\n String token = session.getAttribute(\"Token\").toString();\n HataxiClient hataxiClient = new HataxiClient();\n HataxiPaymentResponse resp = hataxiClient.hataxiPayment(go, \"en\", token, request.getRemoteAddr());\n \n if(resp.getTransactionStatus().contains(\"SUCCEEDED\")){ \n session.setAttribute(\"payResponse\", resp);\n nextJSP = CONFIG.HATAXI_PAYMENT;\n }else{\n session.setAttribute(\"ErrorMessage\", resp.getTransactionStatus());\n nextJSP = CONFIG.PAGE_ERRPR; \n }\n\n }\n RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(\"/\" + nextJSP);\n dispatcher.forward(request, response);\n } catch (Exception e) {\n session.setAttribute(\"ErrorMessage\", e.getMessage());\n nextJSP = CONFIG.PAGE_ERRPR;\n RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(\"/\" + nextJSP);\n dispatcher.forward(request, response);\n } finally {\n out.close();\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n String xml = \"\";\n\n Document doc = dummy();\n xml = xml2String(doc);\n //response.setContentType(\"text/html;charset=UTF-8\");\n response.setContentType(\"text/xml\");\n\n //response.setHeader(\"Expires\", \"0\");\n //response.setHeader(\"Cache-Control\", \"no-cache\");\n //response.setHeader(\"Pragma\", \"public\");\n String fileName = \"dump.xml\";\n response.setHeader(\"Content-Disposition\", \"attachment; filename=\\\"\" + fileName + \"\\\"\");\n // response.setCharacterEncoding(\"utf-8\");\n //response.setHeader(\"Transfer-Encoding\", \"Chunked\");\n //response.setBufferSize(baos.size());\n //response.flushBuffer();\n\n PrintWriter out = response.getWriter();\n try {\n out.println(xml);\n } finally {\n out.close();\n }\n\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n String action = request.getParameter(\"btAction\");\n String title = request.getParameter(\"txtTitle\");\n String importDate = request.getParameter(\"txtDate\");\n String userId = request.getParameter(\"txtUserId\");\n String url = VIEW_HISTORY;\n try {\n if (action.equals(\"Search By Title\")) {\n\n Tbl_OrderDAO dao = new Tbl_OrderDAO();\n dao.searchHistoryByTitle(userId, title);\n List<History> result = dao.getListHistory();\n request.setAttribute(\"HISTORY\", result);\n\n } else if (action.equals(\"Search By Date\")) {\n boolean findError = false;\n Tbl_OrderDAO dao = new Tbl_OrderDAO();\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n sdf.setLenient(false);\n try {\n Date date = (Date) sdf.parse(importDate);\n } catch (ParseException ex) {\n findError = true;\n\n }\n if (findError && !importDate.trim().isEmpty()) {\n\n request.setAttribute(\"INVALIDDATE\", \"Invalid Date !\");\n dao.loadHistory(userId);\n List<History> result = dao.getListHistory();\n request.setAttribute(\"HISTORY\", result);\n } else {\n if (importDate.isEmpty()) {\n dao.loadHistory(userId);\n List<History> result = dao.getListHistory();\n request.setAttribute(\"HISTORY\", result);\n } else {\n dao.searchHistoryByDate(userId, importDate);\n List<History> result = dao.getListHistory();\n request.setAttribute(\"HISTORY\", result);\n }\n\n }\n\n }\n } catch (SQLException ex) {\n log(\"SearchHistoryServlet _ SQLException:\" + ex.getMessage());\n } catch (NamingException ex) {\n log(\"SearchHistoryServlet _ NamingException:\" + ex.getMessage());\n } finally {\n RequestDispatcher rd = request.getRequestDispatcher(url);\n rd.forward(request, response);\n out.close();\n }\n }", "@Override\n\t\tpublic void handle(final HttpRequest request, final HttpResponse response,\n\t\t\t\tfinal NHttpResponseTrigger trigger, HttpContext con)\n\t\t\t\tthrows HttpException, IOException {\n\t\t\t\n//\t\t\t\tHttpRequestProxy reqX = new HttpRequestProxy(request,generateMsgID());\t//create httprequestx to carry message-id \n\t\t\t\n\t\t\tURI uri = Mapper.getHttpRequestUri(request);\n\t\t\tif (uri == null){\n\t\t\t\ttrigger.submitResponse(new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_BAD_REQUEST, \"Bad Header: Host\"));\n\t\t\t} else {\n\n\t\t\t\tInetAddress remoteAddress = InetAddress.getByName(uri.getHost());\n\t\t\t\tint port = uri.getPort();\n\t\t\t\tif (port == -1) {\n\t\t\t\t\tport = Constants.COAP_DEFAULT_PORT;\n\t\t\t\t}\n\n\t\t\t\tProxyMessageContext context = new ProxyMessageContext(request, remoteAddress, 0, uri, trigger);\n\t\t\t\tMapper.getInstance().putHttpRequest(context); // put request\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// to mapper\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// for\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// processing/translating\n\t\t\t}\n\t\t}", "public ActionForward handleRequest( UserRequest request )\n throws IOException, ServletException\n {\n int pageNumber = request.getParameterAsInt( PAGE_KEY, 1 );\n ActionErrors errors = new ActionErrors();\n /*\n java.util.Enumeration enum = request.getParameterNames();\n while(enum.hasMoreElements()){\n String key = (String)enum.nextElement();\n String[] paramValues = request.getParameterValues(key);\n log.debug(\"request params\");\n for(int i=0;i < paramValues.length;i++){\n log.debug(key + \" : \" + paramValues[i]);\n }\n } \n */ \n if( buttonPressed( request, BUTTON_NEXT ) )\n {\n log.debug(\"Processing next button\");\n if (validatePage( request, pageNumber, BUTTON_NEXT ) )\n {\n log.debug(\"Showing next page\");\n onBeforeDisplayEvent( request, pageNumber, BUTTON_NEXT );\n return nextPage( request );\n }\n else\n {\n log.debug(\"Showing current page\");\n saveErrors(request);\n return currentPage( request );\n }\n }\n else if (buttonPressed( request, BUTTON_BACK ) )\n {\n log.debug(\"Processing back button\");\n if( validatePage( request, pageNumber, BUTTON_BACK ) )\n {\n log.debug(\"Showing previous page\");\n onBeforeDisplayEvent( request, pageNumber, BUTTON_BACK );\n return previousPage( request );\n }\n else\n {\n log.debug(\"Showing current page\");\n saveErrors(request);\n return currentPage( request );\n }\n \n }\n else if (buttonPressed( request, BUTTON_CREATE ) )\n {\n log.debug(\"Processing create button\");\n if( validatePage( request, pageNumber, BUTTON_CREATE ) )\n {\n log.debug(\"Processing create button\");\n return processCreate( request );\n }\n else\n {\n log.debug(\"Showing current page\");\n saveErrors(request);\n return currentPage( request );\n }\n }\n else if (buttonPressed( request, BUTTON_CANCEL ) )\n {\n log.debug(\"Processing cancel button\");\n return processCancel( request );\n }\n else\n {\n log.debug(\"Processing unknown button\");\n return processUnknownButton( request );\n }\n }", "public void handleRequest(Request req) {\n\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n try (PrintWriter out = response.getWriter()) {\n /* TODO output your page here. You may use following sample code. */\n String accion = request.getParameter(\"accion\");\n \n if(accion.equals(\"insertar\")){\n this.RegistrarSueloCancha(request, response);\n }\n if(accion.equals(\"actualizar\")){\n this.ActualizarSueloCancha(request, response);\n }\n if(accion.equals(\"eliminar\")){\n this.darBajaSueloCancha(request, response);\n }\n \n }\n }", "public ActionForward populateTransplantXenograft(ActionMapping mapping, ActionForm form,\n HttpServletRequest request, HttpServletResponse response) throws Exception {\n setCancerModel(request);\n \n setComments(request, Constants.Pages.XENOGRAFT);\n \n return mapping.findForward(\"viewTransplantXenograft\");\n }", "void requestReceived( C conn ) ;", "@And(\"^I clicked on \\\"([^\\\"]*)\\\" tab$\")\r\n\tpublic void clickonTab(String Acttab) throws Exception {\r\n\t\tenduser.click_Tab(Acttab);\r\n\t\tSystem.out.println(Acttab);\r\n\t \r\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n response.setContentType(\"text/html;charset=UTF-8\");\n\n SingletonFuncionLog singletonFuncionLog5 = InitialContext.doLookup(\"java:global/ASAPLICACIONCURSOSPRACTICA1/SingletonFuncionLog\");\n this.estadisticas = InitialContext.doLookup(\"java:global/ASAPLICACIONCURSOSPRACTICA1/Estadisticas\");\n \n estadisticas.nuevoAccesoCuestionarioCommand();\n\n singletonFuncionLog5.funcionLog(\"CuestionarioCommand\", \"processRequest\");\n } catch (NamingException ex) {\n singletonFuncionLog5.funcionLog(\"CuestionarioCommand\", \"NamingException ex\");\n\n Logger.getLogger(CuestionarioCommand.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n if(request.getParameter(\"action\")!=null){\n String action=request.getParameter(\"action\");\n switch(action){\n case \"Traducir\":\n validateNucleotid(request,response);\n break;\n }\n }else{\n response.sendRedirect(\"index.jsp\");\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n ServletConfig config = null;\n Vector card_list = null;\n\n try {\n response.setContentType(\"text/html;charset=UTF-8\");\n ServletContext context;\n String msg;\n response.setContentType(\"text/html;charset=UTF-8\");\n List list;\n try {\n config = getServletConfig();\n context = config.getServletContext();\n Constants.loadJDBCConstants(context);\n } catch (Exception e) {\n Constants.logger.error(e);\n }\n try {\n ServletInputStream in = request.getInputStream();\n SAXParserExample example = new SAXParserExample();\n\n int info;\n StringBuffer sb = new StringBuffer();\n while ((info = in.read()) != -1) {\n char temp;\n temp = (char) info;\n sb.append(temp);\n }\n Constants.logger.info(\"-------------paid_punch---------------\");\n Constants.logger.info(\"XML File\" + sb);\n String xmldata = new String(sb);\n xmldata = xmldata.trim();\n InputSource iSource = new InputSource(new StringReader(xmldata));\n\n example.parseDocument(iSource);\n list = example.getData();\n AccessRequest arz = (AccessRequest) list.get(0);\n String reqtype = arz.getTxType();\n\n if (reqtype.equalsIgnoreCase(\"SEARCHBYBUSINESSNAME-REQ\")) {\n Search_By_Busines_Name(list, response);\n }\n if (reqtype.equalsIgnoreCase(\"GETUSERPUCNHCARD-REQ\")) {\n Punch_Card_List(list, response);\n }\n if (reqtype.equalsIgnoreCase(\"MARKPUNCHUSED-REQ\")) {\n Mark_Punch_Card(list, response, request);\n }\n } catch (Exception e) {\n Punch_Card_List_XML_Response(card_list, \"01\", \"Failure\", response);\n Constants.logger.error(e);\n } finally {\n out.close();\n }\n } catch (Exception e) {\n Punch_Card_List_XML_Response(card_list, \"01\", \"Failure\", response);\n Constants.logger.error(e);\n } finally {\n out.close();\n }\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (EntityNotFoundException ex) {\n Logger.getLogger(Trash.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try ( PrintWriter out = response.getWriter()) {\n response.setContentType(\"application/xml;charset=UTF-8\");\n response.setCharacterEncoding(\"UTF-8\"); \n out.println(\"<?xml version=\\\"1.0\\\"?>\");\n \n HttpSession session = request.getSession();\n Store store = (Store) session.getAttribute(\"store\");\n try {\n SimpleDateFormat DF = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date date = DF.parse(request.getParameter(\"date\"));\n String startTime = request.getParameter(\"startTime\");\n\n if(startTime != null && store != null && date !=null) {\n HaveId haveId = new HaveId(startTime, 0, date);\n TimeSlot timeSlot = TimeSlotDAO.get(startTime);\n Have have = new Have(haveId, 0, timeSlot);\n session.setAttribute(\"have\", have);\n out.println(\"<msg>\" + DateUtil.dateOfHaveObject(have) + \"</msg>\");\n } else if(store != null && date != null) {\n out.println(\"<timeSlots>\");\n \n for (Have h : HaveDAO.getTimeSlotsByStoreId(store.getId(), date)) {\n out.println(\" <timeSlot>\");\n out.println(\" <startTime><![CDATA[\" + h.getTimeSlot().getStartTime() + \"]]></startTime>\");\n out.println(\" <endTime><![CDATA[\" + h.getTimeSlot().getEndTime() + \"]]></endTime>\");\n out.println(\" <capacity><![CDATA[\" + h.getCapacity() + \"]]></capacity>\");\n out.println(\" </timeSlot>\");\n }\n \n out.println(\"</timeSlots>\");\n } else {\n out.println(\"<msg>Requête inconnue !</msg>\");\n }\n } catch (Exception ex){\n out.print(\"<msg_error>\" + ex.getMessage() + \"</msg_error>\");\n }\n }\n }", "private void process(int request) {\n if (request < phase) {\n throw new RuntimeException();\n }\n\n switch (phase) {\n case 0: // START\n\n selenium.mouseDown(item);\n String moveCoords = coords((x < 0) ? FIRST_STEP : -FIRST_STEP, (y < 0) ? FIRST_STEP : -FIRST_STEP);\n selenium.mouseMoveAt(item, moveCoords);\n\n if (request < ++phase)\n break;\n case 1: // MOUSE OUT\n\n selenium.mouseOut(item);\n\n if (request < ++phase)\n break;\n case 2: // MOVE\n\n for (int i = 0; i < STEPS; i++) {\n selenium.mouseMoveAt(item, coords(x * i / STEPS, y * i / STEPS));\n wait.waitForTimeout();\n }\n\n if (request < ++phase)\n break;\n case 3: // ENTER\n\n selenium.mouseMoveAt(item, coords(x, y));\n selenium.mouseOver(target);\n\n if (request < ++phase)\n break;\n case 4: // DROP\n\n selenium.mouseUp(target);\n\n if (request < ++phase)\n break;\n }\n }", "@Override\n\t\t\tpublic void handle(MouseEvent event) {\n\t\t \t\t tabpane.getSelectionModel().select(transactionstab);\n\t\t\t}", "@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}", "public Object handleRequest(P request) throws Exception;", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String accion = request.getParameter(\"accion\");\n if(accion.equals(\"listaDeAlumnos\")){\n listaDeAlumnos(request, response);\n }else{\n if(accion.equals(\"nuevo\")){\n nuevoAlumno(request,response); \n }else{\n if(accion.equals(\"actualizar\")){\n actualizarAlumno(request,response);\n }else{\n if(accion.equals(\"eliminar\")){\n eliminarAlumno(request,response);\n }else{\n if(accion.equals(\"ver\")){\n verAlumno(request,response);\n }else{\n if(accion.equals(\"guardar\")){\n almacenarAlumno(request,response);\n }\n }\n }\n \n }\n }\n }\n /*response.setContentType(\"text/html;charset=UTF-8\");\n try ( PrintWriter out = response.getWriter()) {\n out.println(\"<!DOCTYPE html>\");\n out.println(\"<html>\");\n out.println(\"<head>\");\n out.println(\"<title>Servlet AlumnoServlet</title>\"); \n out.println(\"</head>\");\n out.println(\"<body>\");\n out.println(\"<h1>Servlet AlumnoServlet at \" + request.getContextPath() + \"</h1>\");\n out.println(\"</body>\");\n out.println(\"</html>\");\n }*/\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, java.io.IOException {\n System.out.println(\"---===| Excel Report |===---\");\n response.setContentType(\"application/x-msexcel\");\n \n Company cmp = new Company();\n try{\n Vector listCompany = DbCompany.list(0,0, \"\", \"\");\n if(listCompany!=null && listCompany.size()>0){\n cmp = (Company)listCompany.get(0);\n }\n }catch(Exception ext){\n System.out.println(ext.toString());\n }\n \n Vector result = new Vector();\n String userName = \"\";\n String filter = \"\";\n Vector temp = new Vector();\n Vector locations = DbLocation.list(0,0, \"\", \"name\");\n \n try{\n HttpSession session = request.getSession();\n \n temp = (Vector)session.getValue(\"REPORT_STOCK\");\n userName = (String)session.getValue(\"REPORT_STOCK_USER\");\n filter = (String)session.getValue(\"REPORT_STOCK_FILTER\");\n \n String srcCode = (String)temp.get(0);\n String srcName = (String)temp.get(1);\n int orderBy = Integer.parseInt((String)temp.get(2));\n int orderType = Integer.parseInt((String)temp.get(3));\n int supZero = Integer.parseInt((String)temp.get(4));\n \n String whereClause = \"\";\n String orderClause = \"\";\n\n if(srcCode!=null && srcCode.length()>0){\n whereClause = \" code like '%\"+srcCode+\"%'\"; \n }\n if(srcName!=null && srcName.length()>0){\n if(whereClause!=null && whereClause.length()>0){\n whereClause = whereClause + \" and \";\t\t\n }\n whereClause = whereClause + \" name like '%\"+srcName+\"%'\";\n }\n\n if(supZero==1){\n if(whereClause!=null && whereClause.length()>0){\n whereClause = whereClause + \" and \";\t\t\n }\n whereClause = whereClause + \" qtystock <> 0\";\n }\n\n if(orderBy==0){\n orderClause = \" name\";\n }\n else if(orderBy==1){\n orderClause = \" code\";\n }\n else{\n orderClause = \" qtystock\";\n }\n\n if(orderType==1){\n orderClause = orderClause + \" desc\";\n }\n \n \n result = SessStockReportView.getStockItemList(0, 0, whereClause, orderClause);\n\n \n }catch(Exception e){\n System.out.println(e.toString());\n }\n \n boolean gzip = false ;\n \n // response.setCharacterEncoding( \"UTF-8\" ) ;\n OutputStream gzo ;\n if ( gzip ) {\n response.setHeader( \"Content-Encoding\", \"gzip\" ) ;\n gzo = new GZIPOutputStream( response.getOutputStream() ) ;\n } else {\n gzo = response.getOutputStream() ;\n }\n PrintWriter wb = new PrintWriter( new OutputStreamWriter( gzo, \"UTF-8\" ) ) ;\n\n wb.println(\"<?xml version=\\\"1.0\\\"?>\");\n wb.println(\"<?mso-application progid=\\\"Excel.Sheet\\\"?>\");\n wb.println(\"<Workbook xmlns=\\\"urn:schemas-microsoft-com:office:spreadsheet\\\" \");\n wb.println(\" xmlns:o=\\\"urn:schemas-microsoft-com:office:office\\\" \");\n wb.println(\" xmlns:x=\\\"urn:schemas-microsoft-com:office:excel\\\" \");\n wb.println(\" xmlns:ss=\\\"urn:schemas-microsoft-com:office:spreadsheet\\\" \");\n wb.println(\" xmlns:html=\\\"http://www.w3.org/TR/REC-html40\\\">\");\n wb.println(\"<DocumentProperties xmlns=\\\"urn:schemas-microsoft-com:office:office\\\">\");\n wb.println(\" <Author>Eka D</Author>\");\n wb.println(\"<LastAuthor>Eka D</LastAuthor>\");\n wb.println(\"<Created>2014-09-10T15:22:44Z</Created>\");\n wb.println(\"<Company>Toshiba</Company>\");\n wb.println(\"<Version>14.00</Version>\");\n wb.println(\"</DocumentProperties>\");\n wb.println(\"<OfficeDocumentSettings xmlns=\\\"urn:schemas-microsoft-com:office:office\\\">\");\n wb.println(\"<AllowPNG/>\");\n wb.println(\"</OfficeDocumentSettings>\");\n wb.println(\"<ExcelWorkbook xmlns=\\\"urn:schemas-microsoft-com:office:excel\\\">\");\n wb.println(\"<WindowHeight>5190</WindowHeight>\");\n wb.println(\"<WindowWidth>13395</WindowWidth>\");\n wb.println(\"<WindowTopX>0</WindowTopX>\");\n wb.println(\"<WindowTopY>30</WindowTopY>\");\n wb.println(\"<ProtectStructure>False</ProtectStructure>\");\n wb.println(\"<ProtectWindows>False</ProtectWindows>\");\n wb.println(\"</ExcelWorkbook>\");\n wb.println(\"<Styles>\");\n wb.println(\"<Style ss:ID=\\\"Default\\\" ss:Name=\\\"Normal\\\">\");\n wb.println(\"<Alignment ss:Vertical=\\\"Bottom\\\"/>\");\n wb.println(\"<Borders/>\");\n wb.println(\"<Font ss:FontName=\\\"Calibri\\\" x:Family=\\\"Swiss\\\" ss:Size=\\\"11\\\" ss:Color=\\\"#000000\\\"/>\");\n wb.println(\"<Interior/>\");\n wb.println(\"<NumberFormat/>\");\n wb.println(\"<Protection/>\");\n wb.println(\"</Style>\");\n wb.println(\"<Style ss:ID=\\\"s16\\\" ss:Name=\\\"Comma\\\">\");\n wb.println(\"<NumberFormat ss:Format=\\\"_(* #,##0.00_);_(* \\\\(#,##0.00\\\\);_(* &quot;-&quot;??_);_(@_)\\\"/>\");\n wb.println(\"</Style>\");\n wb.println(\"<Style ss:ID=\\\"s62\\\">\");\n wb.println(\"<Interior/>\");\n wb.println(\"</Style>\");\n wb.println(\"<Style ss:ID=\\\"s64\\\" ss:Parent=\\\"s16\\\">\");\n wb.println(\"<Font ss:FontName=\\\"Calibri\\\" x:Family=\\\"Swiss\\\" ss:Size=\\\"11\\\" ss:Color=\\\"#000000\\\"/>\");\n wb.println(\"<Interior/>\");\n wb.println(\"<NumberFormat ss:Format=\\\"_(* #,##0_);_(* \\\\(#,##0\\\\);_(* &quot;-&quot;??_);_(@_)\\\"/>\");\n wb.println(\"</Style>\");\n wb.println(\"<Style ss:ID=\\\"s66\\\">\");\n wb.println(\"<Alignment ss:Horizontal=\\\"Center\\\" ss:Vertical=\\\"Bottom\\\"/>\");\n wb.println(\"<Font ss:FontName=\\\"Calibri\\\" x:Family=\\\"Swiss\\\" ss:Size=\\\"12\\\" ss:Color=\\\"#000000\\\" \");\n wb.println(\" ss:Bold=\\\"1\\\"/>\");\n wb.println(\"<Interior/>\");\n wb.println(\"</Style>\");\n wb.println(\"<Style ss:ID=\\\"s67\\\">\");\n wb.println(\"<Borders/>\");\n wb.println(\"<Font ss:FontName=\\\"Calibri\\\" x:Family=\\\"Swiss\\\" ss:Size=\\\"11\\\"/>\");\n wb.println(\"<Interior/>\");\n wb.println(\"</Style>\");\n wb.println(\"<Style ss:ID=\\\"s69\\\">\");\n wb.println(\"<Alignment ss:Horizontal=\\\"Center\\\" ss:Vertical=\\\"Center\\\" ss:WrapText=\\\"1\\\"/>\");\n wb.println(\"<Borders>\");\n wb.println(\"<Border ss:Position=\\\"Bottom\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\"<Border ss:Position=\\\"Left\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\"<Border ss:Position=\\\"Right\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\"<Border ss:Position=\\\"Top\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\"</Borders>\");\n wb.println(\"<Font ss:FontName=\\\"Tahoma\\\" x:Family=\\\"Swiss\\\" ss:Size=\\\"8\\\" ss:Bold=\\\"1\\\"/>\");\n wb.println(\"<Interior/>\");\n wb.println(\"</Style>\");\n wb.println(\"<Style ss:ID=\\\"s71\\\" ss:Parent=\\\"s16\\\">\");\n wb.println(\"<Alignment ss:Horizontal=\\\"Center\\\" ss:Vertical=\\\"Center\\\" ss:WrapText=\\\"1\\\"/>\");\n wb.println(\"<Borders>\");\n wb.println(\"<Border ss:Position=\\\"Bottom\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\"<Border ss:Position=\\\"Left\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\"<Border ss:Position=\\\"Right\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\"<Border ss:Position=\\\"Top\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\"</Borders>\");\n wb.println(\"<Font ss:FontName=\\\"Tahoma\\\" x:Family=\\\"Swiss\\\" ss:Size=\\\"8\\\" ss:Bold=\\\"1\\\"/>\");\n wb.println(\"<Interior/>\");\n wb.println(\"<NumberFormat ss:Format=\\\"_(* #,##0_);_(* \\\\(#,##0\\\\);_(* &quot;-&quot;??_);_(@_)\\\"/>\");\n wb.println(\"</Style>\");\n wb.println(\"<Style ss:ID=\\\"s72\\\" ss:Parent=\\\"s16\\\">\");\n wb.println(\"<Alignment ss:Horizontal=\\\"Center\\\" ss:Vertical=\\\"Center\\\" ss:WrapText=\\\"1\\\"/>\");\n wb.println(\"<Borders>\");\n wb.println(\"<Border ss:Position=\\\"Bottom\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\"<Border ss:Position=\\\"Left\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\"<Border ss:Position=\\\"Right\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\"<Border ss:Position=\\\"Top\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\"</Borders>\");\n wb.println(\"<Font ss:FontName=\\\"Tahoma\\\" x:Family=\\\"Swiss\\\" ss:Size=\\\"7.5\\\" ss:Bold=\\\"1\\\"/>\");\n wb.println(\"<Interior/>\");\n wb.println(\"<NumberFormat ss:Format=\\\"_(* #,##0_);_(* \\\\(#,##0\\\\);_(* &quot;-&quot;??_);_(@_)\\\"/>\");\n wb.println(\"</Style>\");\n wb.println(\"<Style ss:ID=\\\"s73\\\">\");\n wb.println(\"<Borders/>\");\n wb.println(\"<Interior/>\");\n wb.println(\"</Style>\");\n wb.println(\"<Style ss:ID=\\\"s75\\\">\");\n wb.println(\"<Alignment ss:Horizontal=\\\"Center\\\" ss:Vertical=\\\"Center\\\" ss:WrapText=\\\"1\\\"/>\");\n wb.println(\"<Borders>\");\n wb.println(\"<Border ss:Position=\\\"Bottom\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\"<Border ss:Position=\\\"Left\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\"<Border ss:Position=\\\"Right\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\"<Border ss:Position=\\\"Top\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\"</Borders>\");\n wb.println(\"<Font ss:FontName=\\\"Tahoma\\\" x:Family=\\\"Swiss\\\" ss:Size=\\\"7.5\\\" ss:Color=\\\"#333333\\\"/>\");\n wb.println(\"<Interior/>\");\n wb.println(\"</Style>\");\n wb.println(\"<Style ss:ID=\\\"s76\\\">\");\n wb.println(\"<Alignment ss:Horizontal=\\\"Left\\\" ss:Vertical=\\\"Center\\\" ss:Indent=\\\"1\\\"/>\");\n wb.println(\"<Borders>\");\n wb.println(\"<Border ss:Position=\\\"Bottom\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\"<Border ss:Position=\\\"Left\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\"<Border ss:Position=\\\"Right\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\"<Border ss:Position=\\\"Top\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\"</Borders>\");\n wb.println(\"<Font ss:FontName=\\\"Tahoma\\\" x:Family=\\\"Swiss\\\" ss:Size=\\\"7.5\\\" ss:Color=\\\"#333333\\\"/>\");\n wb.println(\"<Interior/>\");\n wb.println(\"</Style>\");\n wb.println(\"<Style ss:ID=\\\"s77\\\" ss:Parent=\\\"s16\\\">\");\n wb.println(\"<Alignment ss:Horizontal=\\\"Right\\\" ss:Vertical=\\\"Center\\\" ss:Indent=\\\"1\\\" ss:WrapText=\\\"1\\\"/>\");\n wb.println(\"<Borders>\");\n wb.println(\"<Border ss:Position=\\\"Bottom\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\"<Border ss:Position=\\\"Left\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\"<Border ss:Position=\\\"Right\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\"<Border ss:Position=\\\"Top\\\" ss:LineStyle=\\\"Continuous\\\" ss:Weight=\\\"1\\\"/>\");\n wb.println(\"</Borders>\");\n wb.println(\"<Font ss:FontName=\\\"Tahoma\\\" x:Family=\\\"Swiss\\\" ss:Size=\\\"7.5\\\" ss:Color=\\\"#333333\\\"/>\");\n wb.println(\"<Interior/>\");\n wb.println(\"<NumberFormat ss:Format=\\\"_(* #,##0_);_(* \\\\(#,##0\\\\);_(* &quot;-&quot;??_);_(@_)\\\"/>\");\n wb.println(\"</Style>\");\n wb.println(\"<Style ss:ID=\\\"s78\\\">\");\n wb.println(\"<Font ss:FontName=\\\"Calibri\\\" x:Family=\\\"Swiss\\\" ss:Size=\\\"11\\\" ss:Color=\\\"#000000\\\" ss:Bold=\\\"1\\\"/>\");\n wb.println(\"<Interior/>\");\n wb.println(\"</Style>\");\n wb.println(\"</Styles>\");\n wb.println(\"<Worksheet ss:Name=\\\"Stock Total\\\">\");\n wb.println(\"<Table x:FullColumns=\\\"1\\\" x:FullRows=\\\"1\\\" ss:StyleID=\\\"s62\\\" ss:DefaultRowHeight=\\\"15\\\">\");\n wb.println(\"<Column ss:StyleID=\\\"s62\\\" ss:AutoFitWidth=\\\"0\\\" ss:Width=\\\"29.25\\\"/>\");\n wb.println(\"<Column ss:StyleID=\\\"s62\\\" ss:AutoFitWidth=\\\"0\\\" ss:Width=\\\"63\\\"/>\");\n wb.println(\"<Column ss:StyleID=\\\"s62\\\" ss:Width=\\\"180\\\"/>\");\n wb.println(\"<Column ss:StyleID=\\\"s64\\\" ss:AutoFitWidth=\\\"0\\\" ss:Span=\\\"9\\\"/>\");\n wb.println(\"<Column ss:Index=\\\"14\\\" ss:StyleID=\\\"s64\\\" ss:Width=\\\"49.5\\\"/>\");\n wb.println(\"<Row ss:AutoFitHeight=\\\"0\\\" ss:Height=\\\"15.75\\\">\");\n wb.println(\"<Cell ss:MergeAcross=\\\"\"+(((locations!=null && locations.size()>0) ? locations.size() : 0)+3)+\"\\\" ss:StyleID=\\\"s66\\\"><Data ss:Type=\\\"String\\\">\"+cmp.getName().toUpperCase()+\"</Data></Cell>\");\n wb.println(\"</Row>\");\n wb.println(\"<Row ss:AutoFitHeight=\\\"0\\\" ss:Height=\\\"15.75\\\">\");\n wb.println(\"<Cell ss:MergeAcross=\\\"\"+(((locations!=null && locations.size()>0) ? locations.size() : 0)+3)+\"\\\" ss:StyleID=\\\"s66\\\"><Data ss:Type=\\\"String\\\">STOCK TOTAL BY LOCATION REPORT</Data></Cell>\");\n wb.println(\"</Row>\");\n wb.println(\"<Row ss:Index=\\\"4\\\" ss:AutoFitHeight=\\\"0\\\">\");\n wb.println(\"<Cell ss:StyleID=\\\"s78\\\"><Data ss:Type=\\\"String\\\">Date : \"+JSPFormater.formatDate(new Date(), \"dd/MM/yyyy\")+\", by : \"+userName+\"</Data></Cell>\");\n wb.println(\"</Row>\");\n wb.println(\"<Row ss:AutoFitHeight=\\\"0\\\">\");\n wb.println(\"<Cell ss:StyleID=\\\"s78\\\"><Data ss:Type=\\\"String\\\">\"+filter+\"</Data></Cell>\");\n wb.println(\"</Row>\");\n wb.println(\"<Row ss:AutoFitHeight=\\\"0\\\" ss:Height=\\\"42\\\" ss:StyleID=\\\"s67\\\">\");\n wb.println(\"<Cell ss:StyleID=\\\"s69\\\"><Data ss:Type=\\\"String\\\">NO</Data></Cell>\");\n wb.println(\"<Cell ss:StyleID=\\\"s69\\\"><Data ss:Type=\\\"String\\\">CODE</Data></Cell>\");\n wb.println(\"<Cell ss:StyleID=\\\"s69\\\"><Data ss:Type=\\\"String\\\">ITEM NAME</Data></Cell>\");\n if(locations!=null && locations.size()>0){\n for(int i=0; i<locations.size(); i++){\n Location d = (Location)locations.get(i);\n wb.println(\"<Cell ss:StyleID=\\\"s71\\\"><Data ss:Type=\\\"String\\\">\"+d.getName()+\"</Data></Cell>\");\n }\n }\n //wb.println(\"<Cell ss:StyleID=\\\"s71\\\"><Data ss:Type=\\\"String\\\">Coco Mart Bandara R19</Data></Cell>\");\n //wb.println(\"<Cell ss:StyleID=\\\"s71\\\"><Data ss:Type=\\\"String\\\">Coco Mart Bandara R22</Data></Cell>\");\n //wb.println(\"<Cell ss:StyleID=\\\"s71\\\"><Data ss:Type=\\\"String\\\">Coco Mart Bandara R28</Data></Cell>\");\n //wb.println(\"<Cell ss:StyleID=\\\"s71\\\"><Data ss:Type=\\\"String\\\">Coco Mart Blahkiuh</Data></Cell>\");\n //wb.println(\"<Cell ss:StyleID=\\\"s71\\\"><Data ss:Type=\\\"String\\\">Coco Mart Mas Ubud</Data></Cell>\");\n //wb.println(\"<Cell ss:StyleID=\\\"s71\\\"><Data ss:Type=\\\"String\\\">DC1</Data></Cell>\");\n //wb.println(\"<Cell ss:StyleID=\\\"s71\\\"><Data ss:Type=\\\"String\\\">Gudang Costing</Data></Cell>\");\n //wb.println(\"<Cell ss:StyleID=\\\"s71\\\"><Data ss:Type=\\\"String\\\">Gudang Retur</Data></Cell>\");\n //wb.println(\"<Cell ss:StyleID=\\\"s71\\\"><Data ss:Type=\\\"String\\\">xxx</Data></Cell>\");\n //wb.println(\"<Cell ss:StyleID=\\\"s71\\\"><Data ss:Type=\\\"String\\\">xxx</Data></Cell>\");\n //wb.println(\"<Cell ss:StyleID=\\\"s71\\\"><Data ss:Type=\\\"String\\\">xxx</Data></Cell>\");\n //wb.println(\"<Cell ss:StyleID=\\\"s71\\\"><Data ss:Type=\\\"String\\\">Office</Data></Cell>\");\n wb.println(\"<Cell ss:StyleID=\\\"s72\\\"><Data ss:Type=\\\"String\\\">TOTAL</Data></Cell>\");\n wb.println(\"</Row>\");\n \n String wherex = \"(\";\n if(locations!=null && locations.size()>0){\n for(int i=0; i<locations.size(); i++){\n Location d = (Location)locations.get(i);\n wherex = wherex +\" location_id=\"+d.getOID()+\" or\";\n }\n \n wherex = wherex.substring(0,wherex.length()-3)+\")\";\n }\n \n if(result!=null && result.size()>0){\n \n Hashtable hashQty = SessStockReportView.getStockByLocationByItem();//im.getOID(), wherex); \n \n for(int x=0; x<result.size(); x++){\n \n System.out.println(\"- processing line : \"+x);\n \n ItemMaster im = (ItemMaster)result.get(x);\n double totAv = 0;\n double totOtw = 0;\n double totSlp = 0;\n double tot = 0;\n wb.println(\"<Row ss:AutoFitHeight=\\\"0\\\" ss:StyleID=\\\"s73\\\">\");\n wb.println(\"<Cell ss:StyleID=\\\"s75\\\"><Data ss:Type=\\\"Number\\\">\"+(x+1)+\"</Data></Cell>\");\n wb.println(\"<Cell ss:StyleID=\\\"s76\\\"><Data ss:Type=\\\"String\\\">\"+im.getCode()+\"</Data></Cell>\");\n wb.println(\"<Cell ss:StyleID=\\\"s76\\\"><Data ss:Type=\\\"String\\\">\"+im.getName()+\"</Data></Cell>\");\n \n //Hashtable hashQty = SessStockReportView.getStockByLocationByItem();//im.getOID(), wherex);\n \n if(locations!=null && locations.size()>0){\n for(int i=0; i<locations.size(); i++){\n Location d = (Location)locations.get(i);\n double qty = 0;\n if((String)hashQty.get(im.getOID()+\"\"+d.getOID())!=null && ((String)hashQty.get(im.getOID()+\"\"+d.getOID())).length()>0){\n qty = Double.parseDouble((String)hashQty.get(im.getOID()+\"\"+d.getOID()));\n }\n //SessStockReportView.getStockByLocationByItem(im.getOID(), d.getOID(), \"APPROVED\");\n double qtyOtw = 0;//SessStockReportView.getStockByLocationByItem(im.getOID(), d.getOID(), \"DRAFT\");\n double qtySlp = 0;\n //if(displayPending){\n // qtySlp = 0;//SessStockReportView.getSalesPendingLocationByItem(im.getOID(), d.getOID());\n //}\n\n //if(qtyOtw < 0){\n // qtyOtw = qtyOtw * -1;\n //}\n\n //qty = qty - qtyOtw - qtySlp;\n\n totAv = totAv + qty;\n //totOtw = totOtw + qtyOtw;\n //totSlp = totSlp + qtySlp;\n //tot = tot + qty + qtyOtw + qtySlp;\n \n wb.println(\"<Cell ss:StyleID=\\\"s77\\\"><Data ss:Type=\\\"Number\\\">\"+qty+\"</Data></Cell>\");\n }\n }\n \n /*wb.println(\"<Cell ss:StyleID=\\\"s77\\\"><Data ss:Type=\\\"Number\\\">0</Data></Cell>\");\n wb.println(\"<Cell ss:StyleID=\\\"s77\\\"><Data ss:Type=\\\"Number\\\">0</Data></Cell>\");\n wb.println(\"<Cell ss:StyleID=\\\"s77\\\"><Data ss:Type=\\\"Number\\\">0</Data></Cell>\");\n wb.println(\"<Cell ss:StyleID=\\\"s77\\\"><Data ss:Type=\\\"Number\\\">0</Data></Cell>\");\n wb.println(\"<Cell ss:StyleID=\\\"s77\\\"><Data ss:Type=\\\"Number\\\">12345</Data></Cell>\");\n wb.println(\"<Cell ss:StyleID=\\\"s77\\\"><Data ss:Type=\\\"Number\\\">24</Data></Cell>\");\n wb.println(\"<Cell ss:StyleID=\\\"s77\\\"><Data ss:Type=\\\"Number\\\">0</Data></Cell>\");\n wb.println(\"<Cell ss:StyleID=\\\"s77\\\"><Data ss:Type=\\\"Number\\\">0</Data></Cell>\");\n wb.println(\"<Cell ss:StyleID=\\\"s77\\\"><Data ss:Type=\\\"Number\\\">0</Data></Cell>\");\n wb.println(\"<Cell ss:StyleID=\\\"s77\\\"><Data ss:Type=\\\"Number\\\">0</Data></Cell>\");\n wb.println(\"<Cell ss:StyleID=\\\"s77\\\"><Data ss:Type=\\\"Number\\\">0</Data></Cell>\");\n wb.println(\"<Cell ss:StyleID=\\\"s77\\\"><Data ss:Type=\\\"Number\\\">0</Data></Cell>\");\n */ \n wb.println(\"<Cell ss:StyleID=\\\"s77\\\"><Data ss:Type=\\\"Number\\\">\"+(totAv + totOtw +totSlp)+\"</Data></Cell>\");\n wb.println(\"</Row>\");\n \n wb.flush() ;\n }\n }\n \n wb.println(\"</Table>\");\n wb.println(\"<WorksheetOptions xmlns=\\\"urn:schemas-microsoft-com:office:excel\\\">\");\n wb.println(\"<PageSetup>\");\n wb.println(\"<Header x:Margin=\\\"0.3\\\"/>\");\n wb.println(\"<Footer x:Margin=\\\"0.3\\\"/>\");\n wb.println(\"<PageMargins x:Bottom=\\\"0.75\\\" x:Left=\\\"0.7\\\" x:Right=\\\"0.7\\\" x:Top=\\\"0.75\\\"/>\");\n wb.println(\"</PageSetup>\");\n wb.println(\"<Unsynced/>\");\n wb.println(\"<Print>\");\n wb.println(\"<ValidPrinterInfo/>\");\n wb.println(\"<PaperSizeIndex>9</PaperSizeIndex>\");\n wb.println(\"<VerticalResolution>0</VerticalResolution>\");\n wb.println(\"</Print>\");\n wb.println(\"<Selected/>\");\n wb.println(\"<Panes>\");\n wb.println(\"<Pane>\");\n wb.println(\"<Number>3</Number>\");\n wb.println(\"<ActiveRow>13</ActiveRow>\");\n wb.println(\"<ActiveCol>2</ActiveCol>\");\n wb.println(\"</Pane>\");\n wb.println(\"</Panes>\");\n wb.println(\"<ProtectObjects>False</ProtectObjects>\");\n wb.println(\"<ProtectScenarios>False</ProtectScenarios>\");\n wb.println(\"</WorksheetOptions>\");\n wb.println(\"</Worksheet>\");\n wb.println(\"<Worksheet ss:Name=\\\"Sheet2\\\">\");\n wb.println(\"<Table ss:ExpandedColumnCount=\\\"1\\\" ss:ExpandedRowCount=\\\"1\\\" x:FullColumns=\\\"1\\\" \");\n wb.println(\" x:FullRows=\\\"1\\\" ss:DefaultRowHeight=\\\"15\\\">\");\n wb.println(\"<Row ss:AutoFitHeight=\\\"0\\\"/>\");\n wb.println(\"</Table>\");\n wb.println(\"<WorksheetOptions xmlns=\\\"urn:schemas-microsoft-com:office:excel\\\">\");\n wb.println(\"<PageSetup>\");\n wb.println(\"<Header x:Margin=\\\"0.3\\\"/>\");\n wb.println(\"<Footer x:Margin=\\\"0.3\\\"/>\");\n wb.println(\"<PageMargins x:Bottom=\\\"0.75\\\" x:Left=\\\"0.7\\\" x:Right=\\\"0.7\\\" x:Top=\\\"0.75\\\"/>\");\n wb.println(\"</PageSetup>\");\n wb.println(\"<Unsynced/>\");\n wb.println(\"<ProtectObjects>False</ProtectObjects>\");\n wb.println(\"<ProtectScenarios>False</ProtectScenarios>\");\n wb.println(\"</WorksheetOptions>\");\n wb.println(\"</Worksheet>\");\n wb.println(\"<Worksheet ss:Name=\\\"Sheet3\\\">\");\n wb.println(\"<Table ss:ExpandedColumnCount=\\\"1\\\" ss:ExpandedRowCount=\\\"1\\\" x:FullColumns=\\\"1\\\"\");\n wb.println(\" x:FullRows=\\\"1\\\" ss:DefaultRowHeight=\\\"15\\\">\");\n wb.println(\"<Row ss:AutoFitHeight=\\\"0\\\"/>\");\n wb.println(\"</Table>\");\n wb.println(\"<WorksheetOptions xmlns=\\\"urn:schemas-microsoft-com:office:excel\\\">\");\n wb.println(\"<PageSetup>\");\n wb.println(\"<Header x:Margin=\\\"0.3\\\"/>\");\n wb.println(\"<Footer x:Margin=\\\"0.3\\\"/>\");\n wb.println(\"<PageMargins x:Bottom=\\\"0.75\\\" x:Left=\\\"0.7\\\" x:Right=\\\"0.7\\\" x:Top=\\\"0.75\\\"/>\");\n wb.println(\"</PageSetup>\");\n wb.println(\"<Unsynced/>\");\n wb.println(\"<ProtectObjects>False</ProtectObjects>\");\n wb.println(\"<ProtectScenarios>False</ProtectScenarios>\");\n wb.println(\"</WorksheetOptions>\");\n wb.println(\"</Worksheet>\");\n wb.println(\"</Workbook>\");\n\n wb.flush() ;\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException, InterruptedException, ParseException, SQLException, ParserConfigurationException, SAXException {\n\t\t// response.setStatus(HttpServletResponse.SC_NO_CONTENT);\n\t\tresponse.setContentType(\"text/html;charset=UTF-8\");\n\t\tPrintWriter out = response.getWriter();\n\t\tHttpSession session = request.getSession();\n \tServletContext sc = session.getServletContext();\n \tString file = sc.getRealPath(\"VM_Local.xml\");\n\t\tfinal DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n\n\t\tfinal DocumentBuilder builder = factory.newDocumentBuilder();\n\t\tfinal Document document = builder.parse(file);\n\t\tString export = document.getDocumentElement().getElementsByTagName(\"export\").item(0).getTextContent();\n\t\tString protocole =document.getDocumentElement().getElementsByTagName(\"protocole\").item(0).getTextContent();\t\n\t\tString hote =document.getDocumentElement().getElementsByTagName(\"hote\").item(0).getTextContent();\t\t\n\t\tString disc =document.getDocumentElement().getElementsByTagName(\"disc\").item(0).getTextContent();\n\t\tString geojsonpath =document.getDocumentElement().getElementsByTagName(\"geojsonpath\").item(0).getTextContent();\n\t\tString templatepath =document.getDocumentElement().getElementsByTagName(\"templatepath\").item(0).getTextContent();\n\t\tString featureAnalyzerURL =document.getDocumentElement().getElementsByTagName(\"featureAnalyzerURL\").item(0).getTextContent();\n\t\tString caractereAjoutParamURL =document.getDocumentElement().getElementsByTagName(\"caractereAjoutParamURL\").item(0).getTextContent();\n\t\t\n\t\tfeatureAnalyzerURL =featureAnalyzerURL.replace(caractereAjoutParamURL, \"&\");\n\t\t\n\t\tString hostURL = protocole +\"://\" +hote;\n\t\t\n\t\t/* CHOIX D'EXPORTATION POUR LA VM OU EN LOCAL */\n\t\t// String export = \"VM\";\n\t\t// String export = \"local\";\n\n\t\t/*\n\t\t * CHOIX DE CREER PLUSIEURS FICHIERS PAR RAPPORT A LA DATE OU UN SEUL FICHIER\n\t\t * GEOJSON\n\t\t */\n\t\tint date = 0; // UN SEUL FICHIER\n// int data = 1; // PLUSIEURS FICHIERS\n\n\t\t// MainApp.main(null);\n\t\tString typeCarte = MainApp.main(request, export,hote,disc,geojsonpath,templatepath, date, protocole);\n\t\t\n\t\tSystem.out.println(\"******************** TTTTTTTTT14/09/2021TTTTTTTTt **************************\");\n\t\tString templateAsJSON = iOServiceWithBuffered.read(templatepath);\n\t\tSystem.out.println(hostURL);\n\t\tSystem.out.println(templateAsJSON);\n\t\t\n\t\tSystem.out.println(\"******************** TTTTTTTTT14/09/2021TTTTTTTTt **************************\");\n\t\t\n\t\ttry {\n\n// \tCircles crl = new Circles();\n\n\t\t\t/* TODO output your page here. You may use following sample code. */\n\t\t\tout.println(\"<html>\");\n\t\t\tout.println(\"<head>\");\n\t\t\tout.println(\"<title>Servlet data processing</title>\");\n\t\t\tout.println(\"<script language=\\\"JavaScript\\\" >\");\n\t\t\tout.println(\"function OpenInNewTab(url) {\");\n\t\t\tout.println(\"var win = window.open(url, '_self');\");\n\t\t\tout.println(\"win.focus();\");\n\t\t\tout.println(\"}\");\n\t\t\tout.println(\"</script>\");\n\n\t\t\tout.println(\"</head>\");\n\t\t\t\t\t\t\t\t\t\n\t\t\tout.println(\"<body>\");\n\t\t\t\tout.println(\"<script language=\\\"JavaScript\\\" >\");\n\t\t\t\tout.println(\"var popup;\");\n\t\t\t\tout.println(\"window.addEventListener('message', (event) => {\");\n\t\t\t\t\tout.println(\"if (event.data === 'readyAnalyzer') {\");\n\t\t\t\t\t\tout.println(\"popup.postMessage({ type: 'solapdata', content:\"+ templateAsJSON +\"}, '\" +hostURL +\"')\");\n\t\t\t\t\tout.println(\"}\");\n\t\t\t\tout.println(\"});\");\n\t\t\t\tout.println(\"popup = window.open('\" + featureAnalyzerURL +\"');\");\n\t\t\t\tout.println(\"</script>\");\n\t\t\t\n\n\t\t\t\n\t\t\t\n\t\t\tout.println(\"</body>\");\n\t\t\tout.println(\"</html>\");\n\n\t\t} finally {\n\t\t\tout.close();\n\t\t}\n\n\t}", "@Override\n public void handleRequest(HttpServletRequest request,\n HttpServletResponse response) throws ServletException, IOException\n {\n response.setHeader(\"Expires\", \"Tue, 03 Jul 2001 06:00:00 GMT\");\n response.setHeader(\"Last-Modified\", new Date().toString());\n response.setHeader(\"Cache-Control\", \"no-store, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0\");\n response.setHeader(\"Pragma\", \"no-cache\");\n response.setContentType(\"application/json\");\n\n\n String format = (request.getParameter(\"format\") != null) ? request.getParameter(\"format\") : \"html\";\n\t\tString action = (request.getParameter(\"action\") != null) ? request.getParameter(\"action\") : \"view\";\n\n if (format.equals(\"json\")) {\n \tif (action.equals(\"load\")) {\n\t\t\t\tactionIsLoad(response);\n\t\t\t} else if (action.equals(\"clear\")) {\n \t\tactionIsClear(response);\n\t\t\t} else if (action.equals(\"showXML\")) {\n\t\t\t\tactionIsShowXml(response);\n\t\t\t} else {\n \t\tfinal PrintWriter writer = response.getWriter();\n \t\twriter.write(new Gson().toJson(\"Error\"));\n\t\t\t}\n } else {\n request.getRequestDispatcher(\"/WEB-INF/jsp/init.jsp\").forward(request, response);\n }\n\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (SQLException ex) {\n Logger.getLogger(indicatoractivities1.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (EntityNotFoundException ex) {\n Logger.getLogger(Trash.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n request.setCharacterEncoding(\"utf-8\");\n String method = (String) request.getAttribute(\"do\");\n if (method.equals(\"index\")) {\n index(request, response);\n }\n }", "public static void openTab(ClientContext ctx, Game.Tab tab) {\n if (ctx.game.tab() != tab) {\n\n if (tab == Game.Tab.INVENTORY) {\n ctx.input.send(\"{VK_F2 down}\");\n Condition.wait(new Callable<Boolean>() {\n @Override\n public Boolean call() throws Exception {\n return ctx.game.tab() == tab;\n }\n }, 250, 10);\n ctx.input.send(\"{VK_F2 up}\");\n\n } else if (tab == Game.Tab.MAGIC) {\n ctx.input.send(\"{VK_F4 down}\");\n\n Condition.wait(new Callable<Boolean>() {\n @Override\n public Boolean call() throws Exception {\n return ctx.game.tab() == tab;\n }\n }, 250, 10);\n ctx.input.send(\"{VK_F4 up}\");\n } else {\n ctx.game.tab(tab);\n\n Condition.wait(new Callable<Boolean>() {\n @Override\n public Boolean call() throws Exception {\n return ctx.game.tab() == tab;\n }\n }, 250, 10);\n }\n }\n }", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (SQLException ex) {\r\n Logger.getLogger(Readship.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "public void handler(AbstractRequest request) {\n\t\tSystem.out.println(\"===handle1\" + request.getContent());\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n try (PrintWriter out = response.getWriter()) {\n String codigo = request.getParameter(\"codigo\");\n String cedula = request.getParameter(\"cedula\");\n String nombre = request.getParameter(\"nombre\");\n String fechanacimiento = request.getParameter(\"fechaBorn\");\n String fechaingreso = request.getParameter(\"fechaIngreso\");\n String fecharetiro = request.getParameter(\"fechaRetiro\");\n \n Nomina nomina = new Nomina();\n if(nomina.insertarEmpleado(codigo, cedula, nombre, fechanacimiento, fechaingreso, fecharetiro)){\n request.getSession().setAttribute(\"nominaxd\", nomina);\n request.getRequestDispatcher(\"./JSP/exitoInsertarEmpleado.jsp\").forward(request, response);\n }else{\n request.getSession().setAttribute(\"error\", \"Ha ocurrido un error al insertar\");\n request.getRequestDispatcher(\"./JSP/ERROR/errorInsertarEmpleado.jsp\").forward(request, response);\n }\n\n } catch (Exception e) {\n }\n }", "@Override\n\tpublic void processRequest(HttpRequest request, HttpResponse response) throws Exception {\n\t\tresponse.setHeaderField( \"Server-Name\", \"Las2peer 0.1\" );\n\t\tresponse.setContentType( \"text/xml\" );\n\t\t\n\t\t\n\t\t\n\t\tif(authenticate(request,response))\n\t\t\tif(invoke(request,response));\n\t\t\t\t//logout(_currentUserId);\n\t \n\t\n\t\t//connector.logMessage(request.toString());\n\t\t\n\t\t\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (Exception ex) {\n Logger.getLogger(lib_barcode.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n String url = ERROR;\n try {\n String orderID = request.getParameter(\"orderID\");\n ErrorDTO error = new ErrorDTO();\n\n OrderDAO dao = new OrderDAO();\n List<OrderDetailDTO> list = dao.getListOrderDetail(orderID);\n Date smallest = list.get(0).getStartDate();\n for (int i = 0; i < list.size(); i++) {\n if (smallest.compareTo(list.get(i).getStartDate()) < 0) {\n smallest = list.get(i).getStartDate();\n }\n }\n long millis = System.currentTimeMillis();\n Date today = new Date(millis);\n if (today.compareTo(smallest) < 0) {\n dao.deleteItem(orderID, false);\n error.setLine1(\"delete success\");\n } else {\n error.setLine1(\"you cant delete order from past or being process\");\n }\n request.setAttribute(\"ERROR\", error);\n url = SUCCESS;\n\n } catch (Exception e) {\n LOG.error(e);\n } finally {\n request.getRequestDispatcher(url).forward(request, response);\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n String userPath = request.getServletPath();\r\n\r\n // para probar la conexion al ejb\r\n if(userPath.equals(\"/empleados\")){\r\n obtenerEmpleados(request, response);\r\n }\r\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n try (PrintWriter out = response.getWriter()) {\r\n HttpSession ses = request.getSession();\r\n String lan = (String) ses.getAttribute(\"Idioma\");\r\n String Acc = request.getParameter(\"Accion\");\r\n String v1 = request.getParameter(\"v1\");\r\n String v2 = request.getParameter(\"v2\");\r\n String v3 = request.getParameter(\"v3\");\r\n String material = request.getParameter(\"material\");\r\n String garticulo = request.getParameter(\"garticulo\");\r\n String almacen = request.getParameter(\"almacen\");\r\n String centro = request.getParameter(\"centro\");\r\n String lote = request.getParameter(\"lote\");\r\n String tipo = request.getParameter(\"tipo\");\r\n switch (Acc) {\r\n case \"ConsultaMateriales\":\r\n ArrayList<stock> mat = ACC_Stock.ObtenerInstancia().StockCargarMateriales(lan, v1, v2);\r\n if (mat.size() > 0) {\r\n out.println(\"<table>\");\r\n out.println(\"<tbody>\");\r\n if (v3.length() > 0) {\r\n for (int i = 0; i < Integer.parseInt(v3); i++) {\r\n out.println(\"<tr ondblclick=\\\"Select('\" + mat.get(i).getMaterial() + \"','material','VentanaModalMaterial','BuscarParamMaterial','ConsultaTablaMaterial','namemate')\\\">\");\r\n out.println(\"<td>\" + mat.get(i).getMaterial() + \"</td>\");\r\n out.println(\"<td>\" + mat.get(i).getDescripcion() + \"</td>\");\r\n out.println(\"</tr>\");\r\n }\r\n } else {\r\n for (int i = 0; i < mat.size(); i++) {\r\n out.println(\"<tr ondblclick=\\\"Select('\" + mat.get(i).getMaterial() + \"','material','VentanaModalMaterial','BuscarParamMaterial','ConsultaTablaMaterial','namemate')\\\">\");\r\n out.println(\"<td>\" + mat.get(i).getMaterial() + \"</td>\");\r\n out.println(\"<td>\" + mat.get(i).getDescripcion() + \"</td>\");\r\n out.println(\"</tr>\");\r\n }\r\n }\r\n out.println(\"</tbody>\");\r\n out.println(\"</table>\");\r\n } else {\r\n out.println(0);\r\n }\r\n break;\r\n case \"ConsultarAlmacen\":\r\n ArrayList<stock> alm = ACC_Stock.ObtenerInstancia().StockCargarAlmacen(lan);\r\n if (alm.size() > 0) {\r\n out.println(\"<table>\");\r\n out.println(\"<tbody>\");\r\n for (int i = 0; i < alm.size(); i++) {\r\n out.println(\"<tr ondblclick=\\\"Select('\" + alm.get(i).getAlmacen() + \"','almacen','VentanaModalAlmacen','','','')\\\">\");\r\n out.println(\"<td>\" + alm.get(i).getAlmacen() + \"</td>\");\r\n out.println(\"<td>\" + alm.get(i).getDescripcion() + \"</td>\");\r\n out.println(\"</tr>\");\r\n }\r\n out.println(\"</tbody>\");\r\n out.println(\"</table>\");\r\n } else {\r\n out.println(0);\r\n }\r\n case \"ConsultarCentro\":\r\n ArrayList<stock> ce = ACC_Stock.ObtenerInstancia().StockCargarCentro();\r\n if (ce.size() > 0) {\r\n out.println(\"<table>\");\r\n out.println(\"<tbody>\");\r\n for (int i = 0; i < ce.size(); i++) {\r\n out.println(\"<tr ondblclick=\\\"Select('\" + ce.get(i).getCentro() + \"','centro','VentanaModalCentro','','','')\\\">\");\r\n out.println(\"<td>\" + ce.get(i).getCentro() + \"</td>\");\r\n out.println(\"<td>\" + ce.get(i).getDescripcion() + \"</td>\");\r\n out.println(\"</tr>\");\r\n }\r\n out.println(\"</tbody>\");\r\n out.println(\"</table>\");\r\n } else {\r\n out.println(0);\r\n }\r\n break;\r\n case \"ValidarMaterial\":\r\n int m = ACC_Stock.ObtenerInstancia().StockValidarMaterial(material);\r\n out.println(m);\r\n break;\r\n case \"ValidarGArticulo\":\r\n int g = ACC_Stock.ObtenerInstancia().StockValidarGArticulo(garticulo);\r\n out.println(g);\r\n break;\r\n case \"ValidarAlmacen\":\r\n int a = ACC_Stock.ObtenerInstancia().StockValidarAlmacen(almacen);\r\n out.println(a);\r\n break;\r\n case \"ValidarCentro\":\r\n int c = ACC_Stock.ObtenerInstancia().StockValidarCentro(centro);\r\n out.println(c);\r\n break;\r\n case \"ValidarLote\":\r\n int l = ACC_Stock.ObtenerInstancia().StockValidarLote(lote);\r\n out.println(l);\r\n break;\r\n case \"ValidarQuery\":\r\n String data[] = {lan, material, almacen, centro};\r\n int q1 = ACC_Stock.ObtenerInstancia().StockValidarQueryTodoReservas(data);\r\n out.println(q1);\r\n break;\r\n case \"CargarTabla\":\r\n Properties props = new Properties();\r\n props.load(getServletContext().getResourceAsStream(\"/WEB-INF/Language\" + lan + \".properties\"));\r\n String materiallan = props.getProperty(\"etiqueta.GralMaterialAll\");\r\n String Descrlan = props.getProperty(\"etiqueta.GralDescripcion\");\r\n String Almaclan = props.getProperty(\"etiqueta.GralAlmacenAll\");\r\n String Centrolan = props.getProperty(\"etiqueta.GralCentroAll\");\r\n String lotelan = props.getProperty(\"etiqueta.STOCKNumLote\");\r\n String umlan = props.getProperty(\"etiqueta.CSPUM\");\r\n String galan = props.getProperty(\"etiqueta.STOCKGeupoArtc\");\r\n String stoklibre = props.getProperty(\"etiqueta.STOCKLibreUtili\");\r\n String stoktras = props.getProperty(\"etiqueta.STOCKStocktras\");\r\n\r\n String data1[] = {lan, material, garticulo, almacen, centro, lote};\r\n int tipc = Integer.parseInt(tipo);\r\n switch (tipc) {\r\n case 0:\r\n out.println(\"<section class=\\\"SecHead\\\">\");\r\n out.println(\"<table id=\\\"TabHead\\\">\");\r\n out.println(\"<thead>\");\r\n out.println(\"<tr>\");\r\n out.println(\"<td>\" + materiallan + \"</td>\");\r\n out.println(\"<td>\" + Descrlan + \"</td>\");\r\n out.println(\"<td>\" + Almaclan + \"</td>\");\r\n out.println(\"<td>\" + Centrolan + \"</td>\");\r\n out.println(\"<td>\" + lotelan + \"</td>\");\r\n out.println(\"<td>\" + umlan + \"</td>\");\r\n out.println(\"<td>\" + galan + \"</td>\");\r\n out.println(\"<td> Stk.E </td>\");\r\n out.println(\"<td>\" + stoklibre + \"</td>\");\r\n out.println(\"<td>\" + stoktras + \"</td>\");\r\n out.println(\"<td> Num.Doc. </td>\");\r\n out.println(\"<td> Pos. </td>\");\r\n out.println(\"</tr>\");\r\n out.println(\"</thead>\");\r\n out.println(\"</table>\");\r\n out.println(\"</section>\");\r\n out.println(\"<section class=\\\"SecBody\\\" id=\\\"SecCuerpo\\\">\");\r\n out.println(\"<table id=\\\"TabBody\\\">\");\r\n for (stock st : ACC_Stock.ObtenerInstancia().StockCargarQueryTodo(data1)) {\r\n out.println(\"<tr>\");\r\n out.println(\"<td>\" + st.getMaterial() + \"</td>\");\r\n out.println(\"<td>\" + st.getDescripcion() + \"</td>\");\r\n out.println(\"<td>\" + st.getAlmacen() + \"</td>\");\r\n out.println(\"<td>\" + st.getCentro() + \"</td>\");\r\n out.println(\"<td>\" + st.getLote() + \"</td>\");\r\n out.println(\"<td>\" + st.getUnidad_medida() + \"</td>\");\r\n out.println(\"<td>\" + st.getGrupoArticulos() + \"</td>\");\r\n out.println(\"<td>\" + st.getIndicador_se() + \"</td>\");\r\n out.println(\"<td>\" + st.getStocklibre_utilizacion() + \"</td>\");\r\n out.println(\"<td>\" + st.getStock_traslado() + \"</td>\");\r\n out.println(\"<td>\" + st.getNum_doc() + \"</td>\");\r\n out.println(\"<td>\" + st.getPos_doc() + \"</td>\");\r\n out.println(\"</tr>\");\r\n }\r\n out.println(\"<tr class=\\\"ocultar\\\">\");\r\n out.println(\"<td>00000000000000</td>\");//12\r\n out.println(\"<td>0000000000000000000000000000000000</td>\");//40\r\n out.println(\"<td>00000000000</td>\");//6\r\n out.println(\"<td>00000000000</td>\");//12\r\n out.println(\"<td>000000000000000</td>\");//12\r\n out.println(\"<td>000000000</td>\");//12\r\n out.println(\"<td>0000000000000000</td>\");//12\r\n out.println(\"<td>000000</td>\");//12\r\n out.println(\"<td>0000000000000</td>\");//12\r\n out.println(\"<td>0000000000000</td>\");//12\r\n out.println(\"<td>0000000000000</td>\");//12\r\n out.println(\"<td>0000000000</td>\");//12\r\n out.println(\"</tr>\");\r\n out.println(\"</table>\");\r\n out.println(\"</section>\");\r\n break;\r\n case 1:\r\n out.println(\"<section class=\\\"SecHead\\\">\");\r\n out.println(\"<table id=\\\"TabHead\\\">\");\r\n out.println(\"<thead>\");\r\n out.println(\"<tr>\");\r\n out.println(\"<td>\" + materiallan + \"</td>\");\r\n out.println(\"<td>\" + Descrlan + \"</td>\");\r\n out.println(\"<td>\" + Almaclan + \"</td>\");\r\n out.println(\"<td>\" + Centrolan + \"</td>\");\r\n out.println(\"<td>\" + umlan + \"</td>\");\r\n out.println(\"<td>\" + galan + \"</td>\");\r\n out.println(\"<td>\" + stoklibre + \"</td>\");\r\n out.println(\"</tr>\");\r\n out.println(\"</thead>\");\r\n out.println(\"</table>\");\r\n out.println(\"</section>\");\r\n out.println(\"<section class=\\\"SecBody\\\" id=\\\"SecCuerpo\\\">\");\r\n out.println(\"<table id=\\\"TabBody\\\">\");\r\n for (stock sti : ACC_Stock.ObtenerInstancia().StockCargarQuerySuma(data1)) {\r\n out.println(\"<tr>\");\r\n out.println(\"<td>\" + sti.getMaterial() + \"</td>\");\r\n out.println(\"<td>\" + sti.getDescripcion() + \"</td>\");\r\n out.println(\"<td>\" + sti.getAlmacen() + \"</td>\");\r\n out.println(\"<td>\" + sti.getCentro() + \"</td>\");\r\n out.println(\"<td>\" + sti.getUnidad_medida() + \"</td>\");\r\n out.println(\"<td>\" + sti.getGrupoArticulos() + \"</td>\");\r\n out.println(\"<td>\" + sti.getStocklibre_utilizacion() + \"</td>\");\r\n out.println(\"</tr>\");\r\n }\r\n out.println(\"<tr class=\\\"ocultar\\\">\");\r\n out.println(\"<td>00000000000000</td>\");//12\r\n out.println(\"<td>00000000000000000000000000</td>\");//40\r\n out.println(\"<td>00000000000</td>\");//6\r\n out.println(\"<td>00000000000</td>\");//12\r\n out.println(\"<td>0000000</td>\");//12\r\n out.println(\"<td>00000000000000000</td>\");//12\r\n out.println(\"<td>00000000000</td>\");//12\r\n out.println(\"</tr>\");\r\n out.println(\"</table>\");\r\n out.println(\"</section>\");\r\n break;\r\n case 2:\r\n out.println(\"<section class=\\\"SecHead\\\">\");\r\n out.println(\"<table id=\\\"TabHead\\\">\");\r\n out.println(\"<thead>\");\r\n out.println(\"<tr>\");\r\n out.println(\"<td>\" + materiallan + \"</td>\");\r\n out.println(\"<td>\" + Descrlan + \"</td>\");\r\n out.println(\"<td>\" + Almaclan + \"</td>\");\r\n out.println(\"<td>\" + Centrolan + \"</td>\");\r\n out.println(\"<td>\" + lotelan + \"</td>\");\r\n out.println(\"<td>\" + umlan + \"</td>\");\r\n out.println(\"<td>\" + galan + \"</td>\");\r\n out.println(\"<td> Stk.E </td>\");\r\n out.println(\"<td>\" + stoklibre + \"</td>\");\r\n out.println(\"<td>\" + stoktras + \"</td>\");\r\n out.println(\"<td> Num.Doc </td>\");\r\n out.println(\"<td> Pos. </td>\");\r\n out.println(\"</tr>\");\r\n out.println(\"</thead>\");\r\n out.println(\"</table>\");\r\n out.println(\"</section>\");\r\n out.println(\"<section class=\\\"SecBody\\\" id=\\\"SecCuerpo\\\">\");\r\n out.println(\"<table id=\\\"TabBody\\\">\");\r\n for (stock stic : ACC_Stock.ObtenerInstancia().StockCargarQueryTraslado(data1)) {\r\n out.println(\"<tr>\");\r\n out.println(\"<td>\" + stic.getMaterial() + \"</td>\");\r\n out.println(\"<td>\" + stic.getDescripcion() + \"</td>\");\r\n out.println(\"<td>\" + stic.getAlmacen() + \"</td>\");\r\n out.println(\"<td>\" + stic.getCentro() + \"</td>\");\r\n out.println(\"<td>\" + stic.getLote() + \"</td>\");\r\n out.println(\"<td>\" + stic.getUnidad_medida() + \"</td>\");\r\n out.println(\"<td>\" + stic.getGrupoArticulos() + \"</td>\");\r\n out.println(\"<td>\" + stic.getIndicador_se() + \"</td>\");\r\n out.println(\"<td>\" + stic.getStocklibre_utilizacion() + \"</td>\");\r\n out.println(\"<td>\" + stic.getStock_traslado()+ \"</td>\");\r\n out.println(\"<td>\" + stic.getNum_doc() + \"</td>\");\r\n out.println(\"<td>\" + stic.getPos_doc() + \"</td>\");\r\n out.println(\"</tr>\");\r\n }\r\n out.println(\"<tr class=\\\"ocultar\\\">\");\r\n out.println(\"<td>00000000000000</td>\");//12\r\n out.println(\"<td>0000000000000000000000000000000000</td>\");//40\r\n out.println(\"<td>00000000000</td>\");//6\r\n out.println(\"<td>00000000000</td>\");//12\r\n out.println(\"<td>0000000000000000000</td>\");//12\r\n out.println(\"<td>0000000</td>\");//12\r\n out.println(\"<td>0000000000000</td>\");//12\r\n out.println(\"<td>000000</td>\");//12\r\n out.println(\"<td>0000000000000</td>\");//12\r\n out.println(\"<td>0000000000000</td>\");//12\r\n out.println(\"<td>0000000000000</td>\");//12\r\n out.println(\"<td>000000000</td>\");//12\r\n out.println(\"</tr>\");\r\n out.println(\"</table>\");\r\n out.println(\"</section>\");\r\n break;\r\n }\r\n break;\r\n }\r\n }\r\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (Exception ex) {\n Logger.getLogger(lib_barcode.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private final void setXPTable()\n\t{\n\t\txpTable.put(0, 0);\n\t\txpTable.put(1, 1000);\n\t\txpTable.put(2, 3000);\n\t\txpTable.put(3, 6000);\n\t\txpTable.put(4, 10000);\n\t\txpTable.put(5, 15000);\n\t\txpTable.put(6, 20000);\n\t\txpTable.put(7, 26000);\n\t\txpTable.put(8, 33000);\n\t\txpTable.put(9, 40000);\n\t\t\n\t}", "@NotNull\n TabResult onTab(@NotNull Player player, @NotNull String[] params);", "private void requestHandler(Object context)\n {\n final String funcName = \"requestHandler\";\n @SuppressWarnings(\"unchecked\")\n TrcRequestQueue<Request>.RequestEntry entry = (TrcRequestQueue<Request>.RequestEntry) context;\n Request request = entry.getRequest();\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.TASK, \"request=%s\", request);\n }\n\n request.canceled = entry.isCanceled();\n if (!request.canceled)\n {\n if (request.readRequest)\n {\n request.buffer = readData(request.address, request.length);\n if (debugEnabled)\n {\n if (request.buffer != null)\n {\n dbgTrace.traceInfo(funcName, \"readData(addr=0x%x,len=%d)=%s\",\n request.address, request.length, Arrays.toString(request.buffer));\n \n }\n }\n }\n else\n {\n request.length = writeData(request.address, request.buffer, request.length);\n }\n }\n\n if (request.completionEvent != null)\n {\n request.completionEvent.set(true);\n }\n\n if (request.completionHandler != null)\n {\n request.completionHandler.notify(request);\n }\n\n if (debugEnabled)\n {\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.TASK);\n }\n }", "public void keyTab(){\n\n try {\n driver.switchTo().activeElement().sendKeys(Keys.TAB);\n\t\t\tLOGGER.info(\"Step : \"+Thread.currentThread().getStackTrace()[2].getMethodName()+\": Pass \");\n\n }catch(Exception e)\n {\n\t\t\tLOGGER.error(\"Step : \"+Thread.currentThread().getStackTrace()[2].getMethodName()+\": Fail \");\n\t\t\t//e.printStackTrace();\n\t\t\tthrow new NotFoundException(\"Exception while clicking on Tab button\");\n\t\t\n }\n }", "@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response)\n throws IOException, ServletException {\n boolean wasXmlRequested = isRequestedFormatXml(request);\n if( ! wasXmlRequested ){\n super.doGet(request,response);\n }else{\n try {\n VitroRequest vreq = new VitroRequest(request);\n Configuration config = getConfig(vreq); \n ResponseValues rvalues = processRequest(vreq);\n \n response.setCharacterEncoding(\"UTF-8\");\n response.setContentType(\"text/xml;charset=UTF-8\");\n writeTemplate(rvalues.getTemplateName(), rvalues.getMap(), config, request, response);\n } catch (Exception e) {\n log.error(e, e);\n }\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n PrintWriter out = response.getWriter();\n String msg = \"Invalid Session\";\n HttpSession session = request.getSession(false);\n if(session != null) {\n String cname = (String) session.getAttribute(\"username\");\n String firstname = request.getParameter(\"firstname\");\n String lastname = request.getParameter(\"lastname\");\n String address = request.getParameter(\"address\");\n// String state = request.getParameter(\"state\");\n// String zip = request.getParameter(\"zip\");\n String shippingaddr = firstname + \" \" + lastname + \", \" + address;\n CartDAO cartDAO = new CartDAO();\n OrderDAO orderDAO = new OrderDAO();\n CartBean[] list = cartDAO.getCart(cname);\n GetIndex a = new GetIndex();\n int ordernum = a.getOrderNum() + 1;\n for(CartBean aPid : list) {\n int pid = aPid.getPid();\n int quantity = aPid.getQuantity();\n cartDAO.deleteProduct(aPid);\n OrderBean order = new OrderBean(cname, pid, quantity, shippingaddr, \"online\", \"completed\", ordernum);\n if(orderDAO.submitOrder(order, ordernum)>=0){\n msg=\"Successfully placed order\";\n }else{\n msg=\"sql error.\";\n break;\n }\n }\n }\n out.write(msg);\n }", "private void commitTab(){\n if(mConnection != null){\n mConnection.commitText(\"\\t\", 0);\n }\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (NamingException | SQLException ex) {\n Logger.getLogger(Trascrizione.class.getName()).log(Level.SEVERE, null, ex);\n action_error(request, response);\n } catch (ParserConfigurationException | SAXException ex) {\n Logger.getLogger(Trascrizione.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n try (PrintWriter out = response.getWriter()) {\n /* TODO output your page here. You may use following sample code. */\n out.println(\"<!DOCTYPE html>\");\n out.println(\"<html>\");\n out.println(\"<head>\");\n out.println(\"<title>Servlet EntradaControl</title>\"); \n out.println(\"</head>\");\n out.println(\"<body>\");\n out.println(\"<h1>Servlet EntradaControl at \" + request.getContextPath() + \"</h1>\");\n out.println(\"</body>\");\n out.println(\"</html>\");\n }\n }", "public void processAction(ActionRequest request, ActionResponse response) throws PortletException, java.io.IOException {\r\n\r\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (SQLException ex) {\n Logger.getLogger(indicatoractivities1.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void doGet(HttpServletRequest request,\n HttpServletResponse response)\n throws IOException, ServletException {\n response.setContentType(TYPE_TEXT_HTML.label);\n response.setCharacterEncoding(UTF8.label);\n request.setCharacterEncoding(UTF8.label);\n String path = request.getRequestURI();\n logger.debug(RECEIVED_REQUEST + path);\n Command command = null;\n try {\n command = commands.get(path);\n command.execute(request, response);\n } catch (NullPointerException e) {\n logger.error(REQUEST_PATH_NOT_FOUND);\n request.setAttribute(JAVAX_SERVLET_ERROR_STATUS_CODE, 404);\n command = commands.get(EXCEPTION.label);\n command.execute(request, response);\n }\n }", "public void handle(HttpRequest request, HttpResponse response, HttpContext context)\n\t\t\t\tthrows HttpException, IOException {\n\t\t\tString method = request.getRequestLine().getMethod().toUpperCase(Locale.ROOT);\n\t\t\tif (!method.equals(\"GET\") && !method.equals(\"POST\") \n\t\t\t\t\t&& !method.equals(\"HEAD\") && !method.equals(\"DELETE\")) {\n\t\t\t\tthrow new MethodNotSupportedException(method + \" method not supported\");\n\t\t\t}\n\t\t\t\n\t\t\tif (method.equals(\"POST\") && request instanceof HttpEntityEnclosingRequest) {\n\t\t\t\tHttpEntity httpEntity = ((HttpEntityEnclosingRequest) request).getEntity();\n\t\t\t\tinsertToTable(httpEntity);\n\t\t\t}\n\t\t\t\n\t\t\tString message = getMessage(method);\n\t\t\t\n\t\t\tHttpCoreContext coreContext = HttpCoreContext.adapt(context);\n\t\t\tHttpConnection conn = coreContext.getConnection(HttpConnection.class);\n\t\t\tresponse.setStatusCode(HttpStatus.SC_OK);\n\t\t\tresponse.setEntity(new StringEntity(message, ContentType.TEXT_PLAIN));\n\t\t\tSystem.out.println(conn + \": send message \" + message);\n\t\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n {\r\n String idTemp = request.getParameter(\"id\");\r\n int id = Integer.parseInt(idTemp);\r\n request.setAttribute(\"obterCliente\", DAO.obterCliente(id));\r\n RequestDispatcher rd = request.getRequestDispatcher(\"EditarCliente.jsp\");\r\n try {\r\n rd.forward(request, response);\r\n } catch (ServletException | IOException ex) {\r\n Logger.getLogger(EditarCliente.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "public ActionForward populateXenograftDetails(ActionMapping mapping, ActionForm form, HttpServletRequest request,\n HttpServletResponse response) throws Exception {\n String modelID = request.getParameter(\"xModelID\");\n String nsc = request.getParameter(\"nsc\");\n \t\tif(nsc != null && nsc.length()==0) return mapping.findForward(\"viewModelCharacteristics\");\n log.info(\"<populateXenograftDetails> modelID:\" + modelID);\n log.info(\"<populateXenograftDetails> nsc:\" + nsc);\n \t\tXenograftManager mgr = (XenograftManager) getBean(\"xenograftManager\");\n \n Xenograft x = null;\n try {\n x = mgr.get(modelID);\n } catch (Exception e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n setCancerModel(request);\n request.getSession().setAttribute(Constants.XENOGRAFTMODEL, x);\n request.getSession().setAttribute(Constants.NSC_NUMBER, nsc);\n return mapping.findForward(\"viewInvivoDetails\");\n }", "public boolean onRequestPerformed(E content);", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String demande;\n String vueReponse = \"/home.jsp\";\n erreur = null;\n try {\n demande = getDemande(request);\n if (demande.equalsIgnoreCase(\"catalogue.oe\")) {\n vueReponse = getOeuvres(request);\n } else if (demande.equalsIgnoreCase(\"myCatalogue.oe\")) {\n vueReponse = getMyOeuvres(request);\n } else if (demande.equalsIgnoreCase(\"ajouter.oe\")) {\n vueReponse = creerOeuvre(request);\n } else if (demande.equalsIgnoreCase(\"enregistrer.oe\")) {\n vueReponse = enregistrerOeuvre(request);\n } else if (demande.equalsIgnoreCase(\"modifier.oe\")) {\n vueReponse = modifierOeuvre(request);\n } else if (demande.equalsIgnoreCase(\"supprimer.oe\")) {\n vueReponse = supprimerOeuvre(request);\n }\n } catch (Exception e) {\n erreur = Utilitaire.getExceptionCause(e);\n } finally {\n request.setAttribute(\"erreurR\", erreur);\n request.setAttribute(\"pageR\", vueReponse);\n RequestDispatcher dsp = request.getRequestDispatcher(\"/index.jsp\");\n if (vueReponse.contains(\".oe\")) {\n dsp = request.getRequestDispatcher(vueReponse);\n }\n dsp.forward(request, response);\n }\n }", "public void processRequest(String request) {\r\n // Request for closing connection\r\n if (request.equals(\"CLOSE\")) {\r\n isOpen = false;\r\n\r\n // Request for getting all of the text on the Server's text areas\r\n } else if (request.equals(\"GET ALL TEXT\")) {\r\n String [] array = FileIOFunctions.getAllTexts();\r\n\r\n sendMessage(\"GET ALL TEXT\");\r\n sendMessage(array[0]);\r\n sendMessage(array[1]);\r\n } else {}\r\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (SQLException ex) {\r\n Logger.getLogger(Readship.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "public void incomingSortRequest(APDUEvent e)\n {\n LOGGER.finer(\"Incoming sortRequest\");\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(Confirmation.class.getName()).log(Level.SEVERE, null, ex);\n } catch (SQLException ex) {\n Logger.getLogger(Confirmation.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(Confirmation.class.getName()).log(Level.SEVERE, null, ex);\n } catch (SQLException ex) {\n Logger.getLogger(Confirmation.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@RequestMapping(value = \"/hbase/query/result/ajax/\", method = RequestMethod.GET)\n\tpublic void getStorageHBaseDataAjax(HttpServletResponse response, HttpServletRequest request) {\n\t\tString aoData = request.getParameter(\"aoData\");\n\t\tJSONArray params = JSON.parseArray(aoData);\n\t\tint sEcho = 0, iDisplayStart = 0, iDisplayLength = 0;\n\t\tfor (Object object : params) {\n\t\t\tJSONObject param = (JSONObject) object;\n\t\t\tif (\"sEcho\".equals(param.getString(\"name\"))) {\n\t\t\t\tsEcho = param.getIntValue(\"value\");\n\t\t\t} else if (\"iDisplayStart\".equals(param.getString(\"name\"))) {\n\t\t\t\tiDisplayStart = param.getIntValue(\"value\");\n\t\t\t} else if (\"iDisplayLength\".equals(param.getString(\"name\"))) {\n\t\t\t\tiDisplayLength = param.getIntValue(\"value\");\n\t\t\t}\n\t\t}\n\n\t\tJSONArray results = storageService.getSpecifyHBase(request.getParameter(\"sql\"));\n\t\tJSONArray targets = new JSONArray();\n\t\tint offset = 0;\n\t\tif (results != null) {\n\t\t\tfor (Object object : results) {\n\t\t\t\tJSONObject result = (JSONObject) object;\n\t\t\t\tif (offset < (iDisplayLength + iDisplayStart) && offset >= iDisplayStart) {\n\t\t\t\t\tJSONObject obj = new JSONObject();\n\t\t\t\t\tfor (String key : result.keySet()) {\n\t\t\t\t\t\tobj.put(key, result.get(key));\n\t\t\t\t\t}\n\t\t\t\t\ttargets.add(obj);\n\t\t\t\t}\n\t\t\t\toffset++;\n\t\t\t}\n\t\t}\n\n\t\tJSONObject object = new JSONObject();\n\t\tobject.put(\"sEcho\", sEcho);\n\t\tobject.put(\"iTotalRecords\", results == null ? 0 : results.size());\n\t\tobject.put(\"iTotalDisplayRecords\", results == null ? 0 : results.size());\n\t\tobject.put(\"aaData\", targets);\n\t\ttry {\n\t\t\tbyte[] output = object.toJSONString().getBytes();\n\t\t\tBaseController.response(output, response);\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n String centro_trabajo = request.getParameter(\"centro_trabajo\");\r\n List<Centrodetrabajo> ces = new ArrayList<>();\r\n CentroDeTrabajoDAO dao = new CentroDeTrabajoDAO();\r\n Centrodetrabajo ce = new Centrodetrabajo();\r\n ce.setNombreCentroDeTrabajo(centro_trabajo);\r\n ce.setCarreras(new HashSet<>(0));\r\n \r\n dao.guardar(ce);\r\n \r\n try {\r\n ces = dao.readAll();\r\n } catch (NullPointerException e) {\r\n ces = null;\r\n }\r\n \r\n try {\r\n request.setAttribute(\"listaCES\", ces);\r\n RequestDispatcher vista = request.\r\n getRequestDispatcher(\"jsp/admin/centrosDeTrabajo.jsp\");\r\n vista.forward(request, response);\r\n } catch (ServletException | IOException ex) {\r\n System.out.println(\"Error de redireccion de pagina: \" + ex.getMessage());\r\n }\r\n \r\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (NamingException | SQLException ex) {\n Logger.getLogger(Trascrizione.class.getName()).log(Level.SEVERE, null, ex);\n action_error(request, response);\n } catch (ParserConfigurationException | SAXException ex) {\n Logger.getLogger(Trascrizione.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n response.setContentType(\"application/json;charset=UTF-8\");\r\n response.setHeader(\"Cache-Control\", \"no-cache, no-store, must-revalidate\"); // HTTP 1.1\r\n response.setHeader(\"Pragma\", \"no-cache\"); // HTTP 1.0\r\n response.setDateHeader(\"Expires\", 0); // Proxies.\r\n PrintWriter out = response.getWriter();\r\n\r\n try {\r\n String actionNameParam = request.getPathInfo().substring(1).split(\"/\")[0];\r\n if (actionNameParam != null) {\r\n Set<String> localAddresses = new HashSet<>();\r\n localAddresses.add(InetAddress.getLocalHost().getHostAddress());\r\n for (InetAddress inetAddress : InetAddress.getAllByName(\"localhost\")) {\r\n localAddresses.add(inetAddress.getHostAddress());\r\n }\r\n if (localAddresses.contains(request.getRemoteAddr())) {\r\n LOGGER.log(Level.FINE, \"running from local address\");\r\n isLocalhost = true;\r\n }\r\n\r\n Actions actionToDo = Actions.valueOf(actionNameParam.toUpperCase());\r\n if (UsersController.isLogged(request) || isLocalhost) {\r\n out.print(actionToDo.doPerform(request, response).toString(2));\r\n } else {\r\n JSONObject json = new JSONObject();\r\n json.put(\"error\", \"not logged\");\r\n out.print(json.toString());\r\n }\r\n\r\n } else {\r\n out.print(\"actionNameParam -> \" + actionNameParam);\r\n }\r\n } catch (IOException e1) {\r\n LOGGER.log(Level.SEVERE, e1.getMessage(), e1);\r\n response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);\r\n response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e1.toString());\r\n out.print(e1.toString());\r\n } catch (SecurityException e1) {\r\n LOGGER.log(Level.SEVERE, e1.getMessage(), e1);\r\n response.setStatus(HttpServletResponse.SC_FORBIDDEN);\r\n } catch (Exception e1) {\r\n LOGGER.log(Level.SEVERE, e1.getMessage(), e1);\r\n response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);\r\n response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e1.toString());\r\n out.print(e1.toString());\r\n }\r\n }", "org.apache.xmlbeans.XmlString xgetRequestID();", "private <X, Y extends AmazonWebServiceRequest> Response<X> invoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext) {\n\n return invoke(request, responseHandler, executionContext, null, null);\n }", "private <X, Y extends AmazonWebServiceRequest> Response<X> invoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext) {\n\n return invoke(request, responseHandler, executionContext, null, null);\n }", "private <X, Y extends AmazonWebServiceRequest> Response<X> invoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext) {\n\n return invoke(request, responseHandler, executionContext, null, null);\n }", "private <X, Y extends AmazonWebServiceRequest> Response<X> invoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext) {\n\n return invoke(request, responseHandler, executionContext, null, null);\n }", "private <X, Y extends AmazonWebServiceRequest> Response<X> invoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext) {\n\n return invoke(request, responseHandler, executionContext, null, null);\n }", "@Override\n\tpublic void handleResponse() {\n\t\t\n\t}", "public void playerSitRequest(TableEvent event) {\n super.sendXmlPackage(event);\n\n }", "private void handleOtherRequest(PortletRequest request,\n PortletResponse response, RequestType requestType,\n Application application, Window window,\n PortletApplicationContext2 applicationContext,\n PortletCommunicationManager applicationManager)\n throws PortletException, IOException, MalformedURLException {\n if (window == null) {\n throw new PortletException(ERROR_NO_WINDOW_FOUND);\n }\n \n /*\n * Sets terminal type for the window, if not already set\n */\n if (window.getTerminal() == null) {\n window.setTerminal(applicationContext.getBrowser());\n }\n \n /*\n * Handle parameters\n */\n final Map<String, String[]> parameters = request.getParameterMap();\n if (window != null && parameters != null) {\n window.handleParameters(parameters);\n }\n \n if (requestType == RequestType.APPLICATION_RESOURCE) {\n handleURI(applicationManager, window, (ResourceRequest) request,\n (ResourceResponse) response);\n } else if (requestType == RequestType.RENDER) {\n writeAjaxPage((RenderRequest) request, (RenderResponse) response,\n window, application);\n } else if (requestType == RequestType.EVENT) {\n // nothing to do, listeners do all the work\n } else if (requestType == RequestType.ACTION) {\n // nothing to do, listeners do all the work\n } else {\n throw new IllegalStateException(\n \"handleRequest() without anything to do - should never happen!\");\n }\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (JSONException ex) {\n Logger.getLogger(StartEditActiveTermDatesServlet.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n protected void doPost\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "private void orderItem(HttpServletRequest request, HttpServletResponse response) {\n\t\t\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n request.setCharacterEncoding(\"UTF-8\");\n response.setCharacterEncoding(\"UTF-8\");\n String action = this.readParameter(request, \"do\");\n String nextAction;\n\n switch (action) {\n case \"home\":\n nextAction = \"/WEB-INF/Views/index.jsp\";\n break;\n case \"lstusers\":\n nextAction = listarUsers(request, response);\n break;\n case \"lstfornecedor\":\n nextAction = listarFornecedor(request, response);\n break;\n case \"lstclient\":\n nextAction = listarClient(request, response);\n break;\n case \"lstprodutos\":\n nextAction = listarProduto(request, response);\n break;\n default:\n request.setAttribute(\"msg\", \"Erro na controller: \" + action);\n nextAction = \"login.jsp\";\n }\n request.getRequestDispatcher(nextAction).forward(request, response);\n }", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (SQLException ex) {\r\n Logger.getLogger(Extrato.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "private void processRequest(HttpServletRequest request, HttpServletResponse response) {\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n logger.log(Level.INFO, \"[GUI QUERY] {0}\", request.getRequestURI()+\"?\"+request.getQueryString());\n\n // check to find version and forward\n Map<String, String[]> params = request.getParameterMap(); // get map of parameters and their values\n String[] versions = params.get(\"version\");\n\n if (versions == null) {\n request.getRequestDispatcher(\"/v104GRs\").forward(request, response); \n } else if (versions[0].equals(\"103\")) {\n request.getRequestDispatcher(\"/v103GRs\").forward(request, response); \n } else {\n // otherwise forward to default\n request.getRequestDispatcher(\"/v104GRs\").forward(request, response);\n }\n }", "@Override\n\tpublic String handlerRequest(HttpRequest req, HttpResponse res) {\n\t\treturn \"board_list.jsp\";\n\t}", "private void HandleRQ(DatagramSocket sendSocket, String requestedFile, int opcode) throws IOException {\n if(opcode == OP_RRQ) {\n // See \"TFTP Formats\" in TFTP specification for the DATA and ACK packet contents\n boolean result = send_DATA_receive_ACK(requestedFile, opcode, sendSocket);\n }\n\n else if (opcode == OP_WRQ) {\n boolean result = receive_DATA_send_ACK(requestedFile, opcode, sendSocket);\n }\n\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String acao = request.getParameter(\"acao\");\n if (acao.equals(\"preparar\")) {\n preparar(request, response);\n } else {\n if (acao.equals(\"confirmar\")) {\n confirmar(request, response);\n }\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n //response.setContentType(\"text/html;charset=UTF-8\");\n response.setContentType(\"text/html;charset=UTF-8\");\n \n try (PrintWriter out = response.getWriter()) {\n request.getRequestDispatcher(\"/header.jsp\").include(request, response); \n out.println( \"<script>\\n\"\n + \"var YES = '\" + i18n.getString(\"tikYes\") + \"';\\n\"\n + \"var NO = '\" + i18n.getString(\"tikNo\") + \"';\\n\"\n + \"</script>\\n\" );\n out.println( \"<script src='\" + request.getContextPath() + \"/js/ConfirmDelete.js'></script>\\n\" );\n\n if (request.getParameter(\"deleteData\") != null) {\n Class.forName(\"org.postgresql.Driver\");\n String url = \"jdbc:postgresql://\" + Settings.getProperty(\"DB_HOST\") + \":5432/RA71T026\";\n //String url = \"jdbc:postgresql://localhost:5432/RA71T026\";\n Connection conn = null;\n Statement st = null;\n String msg = \"\";\n try {\n conn = DriverManager.getConnection(url, \"admin\", \"admin\");\n st = conn.createStatement();\n // Удаление данных\n st.executeUpdate(\"delete from voshod.xodgol\" +\n \" where vrntvd in (select vrn from voshod.tvd\" +\n \" where vrnvibref in (\" + Settings.getProperty(\"VRNVIBREF\") + \",\" + Settings.getProperty(\"VRNVIBREF2\") + \",\" + Settings.getProperty(\"VRNVIBREF3\") + \"))\");\n st.executeUpdate(\"delete from voshod.xod_end \" +\n \" where vrn in (select vrn from voshod.tvd\" +\n \" where vrnvibref in (\" + Settings.getProperty(\"VRNVIBREF\") + \",\" + Settings.getProperty(\"VRNVIBREF2\") + \",\" + Settings.getProperty(\"VRNVIBREF3\") + \"))\");\n st.executeUpdate( \"delete from voshod.pg where vrntvd in (select vrn from voshod.tvd\" +\n \" where vrnvibref in (\" + Settings.getProperty(\"VRNVIBREF\") + \",\" + Settings.getProperty(\"VRNVIBREF2\") + \",\" + Settings.getProperty(\"VRNVIBREF3\") + \"))\" );\n st.executeUpdate(\"update voshod.tvd \" +\n \" set prprot1=null, lastvrem=null\" +\n \" where vrnvibref in (\" + Settings.getProperty(\"VRNVIBREF\") + \",\" + Settings.getProperty(\"VRNVIBREF2\") + \",\" + Settings.getProperty(\"VRNVIBREF3\") + \")\");\n st.executeUpdate(\"delete from voshod.document_signers\");\n st.executeUpdate(\"delete from voshod.documents\");\n st.executeUpdate(\"COMMIT\");\n msg = i18n.getString(\"tikAllDataDeleted\");\n } catch (SQLException ex) {\n Logger.getLogger(Admin.class.getName()).log(Level.SEVERE, null, ex);\n msg = String.format( i18n.getString( \"tikErrorDeletingData\" ), ex.getMessage() );\n }\n \n if(!msg.equals(\"\")) {\n \n out.println( \"<script>$(function() {\" );\n out.println( \" $('#dialog-message').html(\\\"\" + msg + \"\\\");\" );\n out.println( \" $(\\\"#dialog-message\\\").dialog(\\\"open\\\");\" );\n out.println( \"});</script>\\n\" );\n }\n }\n out.println( \"<div id=\\\"dialog-confirm-delete\\\" title=\\\"\" + i18n.getString(\"tikDataDeletion\") + \"\\\">\\n\" +\n \" <p>\" + i18n.getString(\"tikAllDataWillBeDeleted\") + \"<br><br>\" + i18n.getString(\"tikAreYouShure\") + \"</p>\\n\" +\n \"</div>\" );\n out.println( \"<div id=\\\"dialog-message\\\" title=\\\"\" + i18n.getString(\"tikDataDeletion\") + \"\\\"></div>\" );\n out.println( \"<form id='deleteDataForm' action='\" + request.getRequestURI() + \"'>\" );\n out.println( \"<h3>\" + i18n.getString(\"tikClickDeleteButtonToDelete\") + \".</h3>\" );\n out.println( \" <input type='hidden' name='deleteData' value='1'>\" );\n out.println( \" <input type='button' class='deleteButton' value='\" + i18n.getString(\"tikDeleteData\") + \"'>\" );\n out.println( \"</form>\" );\n request.getRequestDispatcher(\"/footer.jsp\").include(request, response); \n } catch (ClassNotFoundException ex) {\n Logger.getLogger(Admin.class.getName()).log(Level.SEVERE, null, ex);\n }\n }" ]
[ "0.5218502", "0.5086557", "0.5055619", "0.48938662", "0.4835019", "0.4811664", "0.4798311", "0.47750062", "0.4684186", "0.46114522", "0.4602802", "0.45137835", "0.45100433", "0.4487549", "0.4476839", "0.44750673", "0.44732827", "0.44709706", "0.44692442", "0.44667062", "0.44494835", "0.4418593", "0.44175798", "0.44112453", "0.44066074", "0.44038913", "0.44031417", "0.44030318", "0.43918228", "0.43665224", "0.43649703", "0.43559813", "0.43232888", "0.4322126", "0.43153647", "0.43085697", "0.4308418", "0.43039855", "0.43032482", "0.42988658", "0.42898718", "0.4288811", "0.42858836", "0.42818978", "0.4271106", "0.42697987", "0.4267645", "0.42481744", "0.4243811", "0.42430514", "0.42334563", "0.42253447", "0.42179066", "0.4213614", "0.4211204", "0.42072898", "0.4197854", "0.4189453", "0.41880965", "0.4185631", "0.4185252", "0.41829613", "0.41778788", "0.41755825", "0.41751796", "0.41705558", "0.41700473", "0.41637558", "0.41569093", "0.41568783", "0.4153854", "0.4151166", "0.41509008", "0.41494942", "0.41489187", "0.41449413", "0.41444957", "0.4141977", "0.41388622", "0.41376317", "0.4137476", "0.41361105", "0.41361105", "0.41361105", "0.41361105", "0.41361105", "0.41340876", "0.4133488", "0.413273", "0.4128629", "0.41259688", "0.41217232", "0.4120611", "0.4112809", "0.41101083", "0.41075784", "0.41063097", "0.41048092", "0.41038918", "0.41030532" ]
0.62704855
0
Handles a Zelig request
public Map<String, String> runZeligRequest(DvnRJobRequest sro, RConnection c){ String optionBanner = "########### zelig option ###########\n"; dbgLog.fine(optionBanner); historyEntry.add(optionBanner); Map<String, String> sr = new HashMap<String, String>(); sr.put("requestdir", requestdir); sr.put("option", "zelig"); String RcodeFile = "Rcode." + PID + ".R"; String modelname = sro.getZeligModelName(); dbgLog.fine("modelname="+modelname); sr.put("model", modelname); try { String univarStatLine = "try(x<-univarStat(dtfrm=x))"; String ResultHtmlFile = null; //"Rout."+PID+".html" ; String RdataFileName = null; String vdcUtilLibLine = "library(VDCutil)"; //c.voidEval("dol<-''"); String aol4Zelig = "aol<-c(0,0,0)"; historyEntry.add(aol4Zelig); c.voidEval(aol4Zelig); historyEntry.add(vdcUtilLibLine); c.voidEval(vdcUtilLibLine); /* ########## Code listing ########## library(VDCutil) ########## Requested option = logit ########## bnryVarTbl <-attr(table(x[[3]]), 'dimnames')[[1]]; x[[3]]<- checkBinaryResponse(x[[3]]) try( {zlg.out<- VDCgenAnalysis( outDir="/tmp/VDC/DSB/zlg_28948/rqst_1", vote ~ age+race, model="logit", data=x, wantSummary=T,wantPlots=T,wantSensitivity=F,wantSim=F,wantBinOutput=F, setxArgs=list(), setx2Args=list(), HTMLInitArgs=list(Title="Dataverse Analysis") , HTMLnote= "<em>The following are the results of your requested analysis. </em><br/><a href='javascript:window.history.go(-1); '>Go back to the previous page</a>")} ) ########## Code listing: end ########## */ // Additional coding required here /* x[[3]]<- checkBinaryResponse(x[[3]]) * 3 must be parameterized for binary response models */ if (sro.isOutcomeBinary()){ int bcol = sro.getOutcomeVarPosition(); dbgLog.fine("col:pos="+bcol); String binaryResponseVar = null; if (sro.IsOutcomeVarRecoded) { String col = sro.getRecodedVarNameSet()[bcol]; binaryResponseVar = "x[['" +col +"']]"; dbgLog.fine("col:name="+col); } else { binaryResponseVar = "x[[" + (bcol+1) +"]]"; dbgLog.fine("col:pos(1 added)="+bcol); } String checkBinaryVarLine= binaryResponseVar + "<- checkBinaryResponse("+binaryResponseVar+")"; dbgLog.fine(checkBinaryVarLine); historyEntry.add(checkBinaryVarLine); c.voidEval(checkBinaryVarLine); } Map<String, String> ZlgModelParam = new HashMap<String, String>(); // create a temp dir String createTmpDir = "dir.create('"+wrkdir +"')"; historyEntry.add(createTmpDir); c.voidEval(createTmpDir); // output option: sum plot Rdata String[] zeligOptns = sro.getZeligOutputOptions(); String simOptn = sro.getZeligSimulationOption(); String setxType= null; String setxArgs = null; String setx2Args = null; if (simOptn.equals("T")){ // simulation was requested setxType= sro.getZeligSetxType(); dbgLog.fine("setxType="+setxType); if (setxType == null){ setxArgs = "NULL"; setx2Args= "NULL"; } else { if (setxType.equals("0")) { // default case setxArgs = "NULL"; setx2Args= "NULL"; } else if (setxType.equals("1")){ // non-default cases if ( (sro.getSetx1stSet() != null) && (sro.getSetx2ndSet() != null)){ // first diff case setxArgs = sro.getSetx1stSet(); setx2Args= sro.getSetx2ndSet(); } else if (sro.getSetx2ndSet() == null){ // single condition setxArgs = sro.getSetx1stSet(); setx2Args= "NULL"; } else { setxArgs = "NULL"; setx2Args= "NULL"; } } } }else { setxArgs = "NULL"; setx2Args= "NULL"; } // Additional coding required here String lhsTerm = sro.getLHSformula(); String rhsTerm = sro.getRHSformula(); String VDCgenAnalysisline = "try( { zlg.out<- VDCgenAnalysis(" + "outDir='" + wrkdir +"',"+ lhsTerm + "~" + rhsTerm + ","+ "model='" + modelname +"',"+ "data=x," + "wantSummary=" + zeligOptns[0] + ","+ "wantPlots=" + zeligOptns[1] + ","+ "wantSensitivity=F" + ","+ "wantSim=" + simOptn + ","+ "wantBinOutput=" + zeligOptns[2] + ","+ "setxArgs=" + setxArgs + ","+ "setx2Args=" + setx2Args + ","+ "HTMLInitArgs= list(Title='Dataverse Analysis')"+ "," + "HTMLnote= '<em>The following are the results of your requested analysis.</em>'"+ ") } )"; /* o: sum(T), Plot(T), BinOut(F) a: sim (F), sen(always F) "TMLInitArgs=list(Title='Dataverse Analysis'),"+ "HTMLnote= '<em>The following are the results of your requested analysis.</em><br/> <a href=\"javascript:window.history.go(-1); \">Go back to the previous page</a>'"+ */ dbgLog.fine("VDCgenAnalysis="+VDCgenAnalysisline); historyEntry.add(VDCgenAnalysisline); c.voidEval(VDCgenAnalysisline); RList zlgout = c.parseAndEval("zlg.out").asList(); //String strzo = c.parseAndEval("str(zlg.out)").asString(); String[] kz = zlgout.keys(); dbgLog.fine("zlg.out:no of keys="+kz.length );// "\t"+kz[0]+"\t"+kz[1] for (int i=0; i<kz.length; i++){ String [] tmp = zlgout.at(kz[i]).asString().split("/"); dbgLog.fine(kz[i]+"="+tmp[tmp.length-1]); if (kz[i].equals("html")){ ResultHtmlFile = tmp[tmp.length-1]; } else if (kz[i].equals("Rdata")){ RdataFileName = tmp[tmp.length-1]; } } /* outDir = '/tmp/VDC/DSB/Zlg_562491' <= wrkdir html = index1214813662.23516A14671A1080869822.html Rdata = binfile1214813662.23516A14671A1080869822.Rdata */ sr.put("html", "/"+requestdir+ "/" +ResultHtmlFile); sr.put("Rdata", "/"+requestdir+ "/" + RdataFileName); // write back the R workspace to the dvn String wrkspFileName = wrkdir +"/"+ RdataFileName; dbgLog.fine("wrkspFileName="+wrkspFileName); int wrkspflSize = getFileSize(c,wrkspFileName); File wsfl = writeBackFileToDvn(c, wrkspFileName, RWRKSP_FILE_PREFIX,"RData", wrkspflSize); if (wsfl != null){ sr.put("wrkspFileName", wsfl.getAbsolutePath()); dbgLog.fine("wrkspFileName="+wsfl.getAbsolutePath()); } else { dbgLog.fine("wrkspFileName is null"); } // copy the dvn-patch css file to the wkdir // file.copy(from, to, overwrite = FALSE) String cssFile = R2HTML_CSS_DIR + "/" +"R2HTML.css"; String cpCssFile = "file.copy('"+cssFile+"','"+wrkdir+"')"; c.voidEval(cpCssFile); // command history String[] ch = (String[])historyEntry.toArray(new String[historyEntry.size()]); c.assign("ch", new REXPString(ch)); String saveRcodeFile = "cat(file='"+ wrkdir +"/"+ RcodeFile +"',paste(ch,collapse='\n'))"; dbgLog.fine(saveRcodeFile); c.voidEval(saveRcodeFile); // tab data file String mvTmpTabFile = "file.rename('"+ tempFileName +"','"+ tempFileNameNew +"')"; c.voidEval(mvTmpTabFile); dbgLog.fine("move temp file="+mvTmpTabFile); // move the temp dir to the web-temp root dir String mvTmpDir = "file.rename('"+wrkdir+"','"+webwrkdir+"')"; dbgLog.fine("web-temp_dir="+mvTmpDir); c.voidEval(mvTmpDir); } catch (REngineException ree){ ree.printStackTrace(); sr.put("RexecError", "true"); return sr; } catch (RserveException rse) { rse.printStackTrace(); sr.put("RexecError", "true"); return sr; } catch (REXPMismatchException mme) { mme.printStackTrace(); sr.put("RexecError", "true"); return sr; } sr.put("RexecError", "false"); return sr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void handleRequest();", "public void request() {\n }", "public void handleRequest(String request) throws IOException {\n\n String method = getMethod(request);\n\n this.uri = ToolBox.getUri(request);\n this.url = ToolBox.getUrl(uri);\n this.extension = ToolBox.getExtension(url);\n\n System.out.println(\"method :\" + method);\n switch (method) {\n case \"GET\":\n doGet();\n break;\n case \"POST\":\n doPost();\n break;\n case \"HEAD\":\n doHead();\n break;\n case \"PUT\":\n doPut();\n break;\n case \"DELETE\":\n doDelete();\n break;\n default:\n statusCode = BAD_REQUEST;\n this.sendHeader(statusCode, \"text/html\", null);\n break;\n }\n this.out.flush();\n this.out.close();\n }", "public void handleRequest(Request req) {\n\n }", "Object handle(Object request);", "public void handleMessageEvent(StunMessageEvent e) {\n delegate.processRequest(e);\n }", "public void handleRequest(ExtractionRequest request);", "public void handleRequest(Request request) {\n\t\tgetCityData(request.getCityName());\n\t\texportToFile(request.getCityName());\n\t}", "private void requestHandler(Object context)\n {\n final String funcName = \"requestHandler\";\n @SuppressWarnings(\"unchecked\")\n TrcRequestQueue<Request>.RequestEntry entry = (TrcRequestQueue<Request>.RequestEntry) context;\n Request request = entry.getRequest();\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.TASK, \"request=%s\", request);\n }\n\n request.canceled = entry.isCanceled();\n if (!request.canceled)\n {\n if (request.readRequest)\n {\n request.buffer = readData(request.address, request.length);\n if (debugEnabled)\n {\n if (request.buffer != null)\n {\n dbgTrace.traceInfo(funcName, \"readData(addr=0x%x,len=%d)=%s\",\n request.address, request.length, Arrays.toString(request.buffer));\n \n }\n }\n }\n else\n {\n request.length = writeData(request.address, request.buffer, request.length);\n }\n }\n\n if (request.completionEvent != null)\n {\n request.completionEvent.set(true);\n }\n\n if (request.completionHandler != null)\n {\n request.completionHandler.notify(request);\n }\n\n if (debugEnabled)\n {\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.TASK);\n }\n }", "@Override\n public Object run() throws ZuulException {\n HttpServletRequest req = RequestContext.getCurrentContext().getRequest();\n logger.info(\">>> Request uri : {} \" , req.getRequestURL());\n return null;\n }", "@Override\r\n\t\t\tpublic void onRequest() {\n\t\t\t\t\r\n\t\t\t}", "public void handler(AbstractRequest request) {\n\t\tSystem.out.println(\"===handle1\" + request.getContent());\n\t}", "private void caseForfeit(Request request) {\n }", "@Override\n\tpublic void OnRequest() {\n\t\t\n\t}", "@Override\n public void handleClientRequest(User sender, ISFSObject params) {\n }", "public Message handleRequest(Message request){\n\n Message error = new Message(Message.GENERIC_ERROR);\n\n switch (request.getId()){\n\n case Message.LOGIN:\n return handleLogin(request);\n case Message.CREATE_DOCUMENT:\n return handleCreate(request);\n case Message.REMOVE_INVITE:\n controlServer.removeInvite(request.getUserName(),request.getDocumentName());\n return request;\n case Message.PORTIONS:\n System.out.println(\"HANDLER pre-handle: \" +request.getDocumentName());\n request.setSectionNumbers(controlServer.getPortions(request.getDocumentName()));\n return request;\n case Message.ADMINS:\n Message response = new Message(Message.ADMINS);\n response.setStringVector(new Vector<>(controlServer.getAdmins(request.getDocumentName())));\n return response;\n case Message.USERS:\n request.setStringVector(controlServer.getUserNames());\n return request;\n case Message.INVITATION:\n controlServer.addAdmin(request.getDocumentName(),request.getReceiver());\n controlServer.addInvite(request.getReceiver(),request.getDocumentName());\n request.setId(Message.INVITE_SENT);\n return request;\n case Message.GET_INVITES:\n String owner = request.getUserName();\n request.setStringVector(controlServer.getUserData(owner).getInvites());\n return request;\n case Message.GET_USERDATA:\n return handleGetUserData(request);\n case Message.LOCK:\n if(!controlServer.lock(request.getDocumentName(),request.getSectionNumbers()))\n request.setId(Message.LOCK_NOK);\n else\n request.setId(Message.LOCK_OK);\n return request;\n case Message.UNLOCK:\n if(controlServer.unlock(request.getDocumentName(),request.getSectionNumbers()))\n request.setId(Message.UNLOCK_OK);\n return request;\n case Message.EDIT:\n String DocumentName = request.getDocumentName();\n int SectionNumbers = request.getSectionNumbers();\n request.setText(controlServer.getSection(DocumentName,SectionNumbers));\n return request;\n case Message.END_EDIT:\n controlServer.editDoc(request.getDocumentName(),request.getSectionNumbers(),request.getText());\n return request;\n case Message.PRINT:\n request.setText(controlServer.getDocumentString(request.getDocumentName()));\n return request;\n case Message.SHOW:\n String text = controlServer.getSection(request.getDocumentName(),request.getSectionNumbers());\n request.setText(text);\n return request;\n default:\n controlServer.showMessage(\"unknown request\");\n break;\n }return error;\n }", "public void handleRequest(Request request)\n {\n Request proxied = new Request(extractMethodName(request.getMethodName()), request.getParams()).withResponseBlock(request.getResponseBlock());\n proxied.setIdentifier(request.getIdentifier());\n receiver.handleMessage(proxied.toJsonString());\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n HttpTransport HTTP_TRANSPORT = new NetHttpTransport();\r\n JsonFactory JSON_FACTORY = new JacksonFactory();\r\n HttpRequestFactory requestFactory\r\n = HTTP_TRANSPORT.createRequestFactory(new HttpRequestInitializer() {\r\n @Override\r\n public void initialize(HttpRequest request) {\r\n request.setParser(new JsonObjectParser(JSON_FACTORY));\r\n }\r\n });\r\n\r\n GenericUrl url = new GenericUrl(\"https://openbus.emtmadrid.es:9443/emt-proxy-server/last/geo/GetArriveStop.php\");\r\n\r\n GenericData data = new GenericData();\r\n data.put(\"idClient\",\"WEB.SERV.rafacanomo@gmail.com\");\r\n data.put(\"passKey\", \"3C162353-56FE-4572-9FB4-ED7D2D79E58E\");\r\n data.put(\"idStop\", \"3727\");\r\n\r\n HttpRequest requestGoogle = requestFactory.buildPostRequest(url, new UrlEncodedContent(data));\r\n\r\n\r\n GenericJson json = requestGoogle.execute().parseAs(GenericJson.class);\r\n\r\n \r\n ArrayList arrives = (ArrayList) json.get(\"arrives\");\r\n request.setAttribute(\"llegadas\", arrives);\r\n //para jsp\r\n //request.getRequestDispatcher(\"pintaremt.jsp\").forward(request, response);\r\n //para freemarker\r\n try {\r\n HashMap root = new HashMap();\r\n \r\n //root.put(\"content\",\"hola\");\r\n root.put(\"llegadas\",arrives);\r\n Template temp = Configuration.getInstance().getFreeMarker().getTemplate(\"Freebus.ftl\");\r\n temp.process(root, response.getWriter());\r\n } catch (TemplateException ex) {\r\n Logger.getLogger(GoogleHttpConsumingApi.class.getName()).log(Level.SEVERE, null, ex);\r\n } \r\n\r\n }", "void onHTTPRequest(HTTPRequest request, HTTPResponse response);", "public String handleRequest(String requestXmlString)\r\n\t\t\tthrows SpeedarException;", "public void run(){\n String searchResultString = getUrlContents(directionsRequestUrl);\n try {\n //Turns the response to a JSON object\n JSONObject directionsResultJSON = new JSONObject(searchResultString);\n\n //Parses the JSON object\n JSONArray routesArray = directionsResultJSON.getJSONArray(\"routes\");\n JSONObject route = routesArray.getJSONObject(0);\n\n //Extract the encodedPolylineString\n JSONObject overviewPolylines = route.getJSONObject(\"overview_polyline\");\n polylineEncodedString = overviewPolylines.getString(\"points\");\n\n //Extract the optimized order of the waypoints\n if(route.has(\"waypoint_order\")) {\n //uses this new order to build the orderedDestinations ArrayList\n JSONArray waypoint_order = route.getJSONArray(\"waypoint_order\");\n int[] order = new int[waypoint_order.length()];\n for(int i = 0; i < waypoint_order.length(); i++){\n order[i] = (Integer)waypoint_order.get(i);\n }\n orderedDestinations = calculateOrderedDestinations(order);\n } else {\n orderedDestinations = destinations;\n }\n\n //Inform the message handler that the request was a success\n Message msg = Message.obtain();\n msg.what = 0;\n handler.sendMessage(msg);\n } catch (JSONException e) {\n //error, probably network related\n e.printStackTrace();\n //inform the message handler that the request was a failure\n Message msg = Message.obtain();\n msg.what = 1;\n handler.sendMessage(msg);\n }\n }", "@Override\n public Object run() throws ZuulException {\n HttpServletRequest request = RequestContext.getCurrentContext().getRequest();\n logger.info(\"request-> {} request uri -> {}\", request, request.getRequestURI());\n\n return null;\n }", "public void processRequest(String request) {\r\n // Request for closing connection\r\n if (request.equals(\"CLOSE\")) {\r\n isOpen = false;\r\n\r\n // Request for getting all of the text on the Server's text areas\r\n } else if (request.equals(\"GET ALL TEXT\")) {\r\n String [] array = FileIOFunctions.getAllTexts();\r\n\r\n sendMessage(\"GET ALL TEXT\");\r\n sendMessage(array[0]);\r\n sendMessage(array[1]);\r\n } else {}\r\n }", "private void handleRequest(Request request) throws IOException{\n switch (request){\n case NEXTODD:\n case NEXTEVEN:\n new LocalThread(this, request, nextOddEven).start();\n break;\n case NEXTPRIME:\n case NEXTEVENFIB:\n case NEXTLARGERRAND:\n new NetworkThread(this, userID, serverIPAddress, request).start();\n break;\n default:\n break;\n }\n }", "Call mo35727a(Request request);", "private Response execute_work(Request request){\n if (request.getFname().equals(\"tellmenow\")){\n int returnValue = tellMeNow();\n }\n else if(request.getFname().equals(\"countPrimes\")){\n int returnValue = countPrimes(request.getArgs()[0]);\n }\n else if(request.getFname().equals(\"418Oracle\")){\n int returnValue = oracle418();\n }\n else{\n System.out.println(\"[Worker\"+String.valueOf(this.id)+\"] WARNING function name not recognized, dropping request\");\n }\n\n return new Response(id,request.getId(),request.getFname(),0);//0 meaning ok!\n }", "private void onRequestData(int tag) {\n \ttry {\n \t data = request.request();\n \t} catch(MatjiException e) {\n \t lastOccuredException = e;\n \t}\n }", "@Override\n protected ModelAndView handleRequestInternal(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws Exception {\n\t\t\t\n\t\tString result = \"indexAdmin\";\n\t\ttry {\n\t\t\tif(action.doWork(request))\n\t\t\t\tresult = \"viewFonti\";\n\t\t}catch(Exception e){e.printStackTrace();}\n\t\t\n\t\t/*Aggiungo la lista delle fonti alla pagina*/\n\t\tList<Fonte> listaFonti = (List<Fonte>)request.getAttribute(\"listaFonti\");\n\t\tList<Statistics> listaStatistiche = (List<Statistics>) request.getAttribute(\"listaStatistiche\");\n\t\tModelAndView m = new ModelAndView(result);\n\t\tm.addObject(\"listaFonti\", listaFonti);\n\t\tm.addObject(\"listaStatistiche\", listaStatistiche);\n\t\treturn m;\n\t}", "public Object handleRequest(P request) throws Exception;", "@SuppressWarnings(\"unchecked\")\n private <E> void handleRequest(ApiRequest<E> request) {\n\n try {\n apiAdapter\n .invokeAsync(request.target)\n .subscribe(new Responder<E>(request, this::writeResponse));\n } catch (Exception e) {\n System.out.println(\"Something went wrong while trying to invoke an ApiAdapter function\");\n e.printStackTrace();\n }\n }", "com.czht.face.recognition.Czhtdev.Request getRequest();", "@Override\n\tpublic void processRequest() {\n\t\ttry {\n\t\t\tkoncept.setTextcat(getParams().get(PFCConstants.HTTP_REQUEST_PARAM_TEXT_CA)[0]);\n\t\t\tkoncept.setTextjap(getParams().get(PFCConstants.HTTP_REQUEST_PARAM_TEXT_JP)[0]);\n\t\t\tif (getParams().containsKey(PFCConstants.HTTP_REQUEST_PARAM_LLISTA_ESTUDI)) {\n\t\t\t\tkoncept.setIdLlista(getParams().get(PFCConstants.HTTP_REQUEST_PARAM_LLISTA_ESTUDI)[0]);\n\t\t\t}\n\n\t\t\tif (getParams().containsKey(PFCConstants.HTTP_REQUEST_PARAM_PRON_JAP)) {\n\t\t\t\tkoncept.setPronjap(getParams().get(PFCConstants.HTTP_REQUEST_PARAM_PRON_JAP)[0]);\n\t\t\t}\n\n\t\t\t// TODO Gestionar amb excepcions.\n\t\t\tboolean b = DBController.konceptExists(koncept);\n\t\t\tString id = null;\n\n\t\t\tif (!b) {\n\t\t\t\tid = DBController.createKoncept(koncept);\n\t\t\t\tkoncept.setId(id);\n\n\t\t\t\tlogger.info(\"Koncept created. ID = \" + id);\n\n\t\t\t\tif (getParams().containsKey(PFCConstants.HTTP_REQUEST_PARAM_AUDIO_JP)) {\n\t\t\t\t\tString pathJP = processAudio(getParams(), PFCConstants.LANG_JAP, koncept);\n\t\t\t\t\tkoncept.setAudioJapones(pathJP);\n\t\t\t\t}\n\n\t\t\t\tif (getParams().containsKey(PFCConstants.HTTP_REQUEST_PARAM_AUDIO_CA)) {\n\t\t\t\t\tString pathCA = processAudio(getParams(), PFCConstants.LANG_CAT, koncept);\n\t\t\t\t\tkoncept.setAudioCatala(pathCA);\n\t\t\t\t}\n\n\t\t\t\t// Actualitzem valor audio.\n\t\t\t\tDBController.update(koncept);\n\n\t\t\t\tKonceptIdResponseBean rb = new KonceptIdResponseBean(koncept.getId());\n\t\t\t\twriteResponse(rb);\n\t\t\t} else {\n\t\t\t\tResponseBean rb = new ErrorResponseBean(\"La paraula ja existeix\");\n\t\t\t\twriteResponse(rb);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"Error processing request!\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n\t\t\tpublic void onResponseReceived(Request request, Response response) {\n\t\t\t\t\n\t\t\t}", "private void postRequest() {\n\t\tSystem.out.println(\"post request, iam playing money\");\n\t}", "void requestReceived( C conn ) ;", "@Override\n public void onNext(RequestData request) {\n System.out.println(\"Requestor:\" + request.getName());\n System.out.println(\"Request Message:\" + request.getMessage());\n }", "@Override\n\t\t\t\tpublic void onResponseReceived(Request request, Response response) {\n\t\t\t\t\t\n\t\t\t\t}", "private void inToTrinh(HttpServletRequest request, ApplicationContext appConText, GiaHanForm giaHanForm, HttpServletResponse reponse) throws Exception {\r\n\t\tCuocTtktService service = new CuocTtktService();\r\n\t\tString cuocTtktId=giaHanForm.getIdCuocTtKt();\r\n\t\tSystem.out.println(\"Id cuoc ttkt : \"+cuocTtktId );\r\n\t\tif(!Formater.isNull(cuocTtktId))\r\n\t\t{\r\n\t\t\tif(\"4\".equals(service.getDonVerionTtkt(appConText, cuocTtktId)))\r\n\t\t\t{\r\n\t\t\t\tinToTrinhv4(request, reponse, giaHanForm, appConText);\r\n\t\t\t}\r\n\t\t\telse inToTrinhv3(request, reponse, giaHanForm, appConText);\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\tif(\"4\".equals(Constants.APP_DEP_VERSION))\r\n\t\t\t\tinToTrinhv4(request, reponse, giaHanForm, appConText);\r\n\t\t\telse inToTrinhv3(request, reponse, giaHanForm, appConText);\r\n\t\t}\r\n\t}", "@Override\n\t\t\t\t\tpublic void run() {\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tList<String> headers = readRequest(client);\n\t\t\t\t\t\t\tif (headers != null && headers.size() >= 1) {\n\t\t\t\t\t\t\t\tString requestURL = getRequestURL(headers.get(0));\n\t\t\t\t\t\t\t\tLog.d(TAG, requestURL);\n\n\t\t\t\t\t\t\t\tif (requestURL.startsWith(\"http://\")) {\n\n\t\t\t\t\t\t\t\t\t// HttpRequest request = new\n\t\t\t\t\t\t\t\t\t// BasicHttpRequest(\"GET\", requestURL);\n\n\t\t\t\t\t\t\t\t\tprocessHttpRequest(requestURL, client, headers);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tprocessFileRequest(requestURL, client, headers);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} catch (IllegalStateException 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} catch (IOException 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}", "public void handle_request(Request request){\n currentRequest.add(request);\n System.out.println(\"[Worker\"+String.valueOf(id)+\"] Received request of client \"+String.valueOf(request.getId()));\n }", "@Override\n\tpublic void postHandle(WebRequest request, ModelMap model) throws Exception {\n\n\t}", "private void sendRequest(String orign,String destin) {\n stopTask();\n\n if (orign.isEmpty()) {\n Toast.makeText(this, \"Por favor ingrese la dirección de origen!\", Toast.LENGTH_SHORT).show();\n return;\n }\n if (destin.isEmpty()) {\n Toast.makeText(this, \"Por favor ingrese la dirección de destino!\", Toast.LENGTH_SHORT).show();\n return;\n }\n try {\n new DirectionFinder(this, orign, destin).execute();\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void visit(Request r) {\n\t\tif (!ph.getPeerChoked()) {\n\t\t\tSystem.out.println(\"requete rećue\");\n\t\t\tbyte[] body = r.getBody();\n\t\t\tbyte[] indexB = new byte[4], beginB = new byte[4], lengthB = new byte[4];\n\t\t\tTorrent torrent = ph.getTorrent();\n\t\t\tint index = 0, begin = 0, length = 0;\n\n\t\t\tindexB = Arrays.copyOfRange(body, 0, 4);\n\t\t\tindex = byteArrayToInt(indexB);\n\n\t\t\tbeginB = Arrays.copyOfRange(body, 4, 8);\n\t\t\tbegin = byteArrayToInt(beginB);\n\n\t\t\tlengthB = Arrays.copyOfRange(body, 8, body.length);\n\t\t\tlength = byteArrayToInt(lengthB);\n\n\t\t\tPiece piece = torrent.getPieces().get(index);\n\t\t\tif (index <= torrent.getPieces().size()) {\n\t\t\t\tbyte[] block = new byte[length];\n\t\t\t\tbyte[] pieceByte = piece.getData();\n\t\t\t\tfor (int i = 0; i < length; i++) {\n\t\t\t\t\tblock[i] = pieceByte[begin + i];\n\t\t\t\t}\n\t\t\t\tsb = new SendBlock(index, begin, block);\n\t\t\t\tthis.ph.addMessageQueue(sb);\n\t\t\t\tSystem.out.println(\"sendBlock envoyé\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Index trop grand\");\n\t\t\t}\n\t\t}\n\t}", "public abstract void handle(Request request, Response response) throws Exception;", "@Override\n\tpublic void processRequest(RequestEvent requestEvent) {\n\t\t requestEvent.getServerTransaction();\n\t\tSystem.out.println(\"Sending ------------------------------------------------------------------------------------------\");\n\t\tSystem.out.println(\"[]:\"+requestEvent.toString());\n\t}", "public void handleRequest () {\n\t// TODO: move this method to separate thread, \n\t// TODO: it may block in many places.\n\tRequestHandler rh = new RequestHandler ();\t\n\tCache<HttpHeader, HttpHeader> cache = proxy.getCache ();\n\tString method = request.getMethod ();\n\tif (!method.equals (\"GET\") && !method.equals (\"HEAD\"))\n\t cache.remove (request);\n\t\t\n\trh.entry = cache.getEntry (request);\n\tif (rh.entry != null)\n\t rh.dataHook = rh.entry.getDataHook (proxy.getCache ());\n\n\tcheckNoStore (rh.entry);\n\tif (!rh.cond.checkMaxStale (request, rh) && checkMaxAge (rh))\n\t setMayUseCache (false);\n\t\n\trh.conditional = rh.cond.checkConditional (this, request, rh);\n\tif (partialContent (rh)) \n\t fillupContent (rh);\n\tcheckIfRange (rh);\n\n\tboolean mc = getMayCache ();\n\tif (getMayUseCache ()) {\n\t // in cache?\n\t if (rh.entry != null) {\n\t\tCacheChecker cc = new CacheChecker ();\n\t\tif (cc.checkCachedEntry (this, request, rh)) {\n\t\t return;\n\t\t}\n\t }\n\t}\n\t\n\tif (rh.content == null) {\n\t // Ok cache did not have a usable resource, \n\t // so get the resource from the net.\n\t // reset value to one before we thought we could use cache...\n\t mayCache = mc;\n\t SWC swc = new SWC (this, proxy.getOffset (), request, requestBuffer,\n\t\t\t tlh, clientResourceHandler, rh);\n\t swc.establish ();\n\t} else {\n\t resourceEstablished (rh);\n\t}\n }", "public abstract boolean mo9094a(Request request);", "private void doRequest(String orden){\n if (method == 1){\n //EXECUTE RECIBIR PEDIDO\n doPost(orden, \"Recolectado por \" + usuario.getmUsuario(), VolleyController.RECIBIR_URL);\n } else if (method == 2){\n //EXECUTE ENTREGAR PEDIDO\n initComment(orden, \"Entregado por \" + usuario.getmUsuario() + \" a\", VolleyController.ENTREGAR_URL);\n } else if (method == 3){\n //GET COMMENT\n initComment(orden, usuario.getmUsuario(), VolleyController.INTENTAR_URL);\n } else if (method == 4){\n //EXECUTE DEVOLVER PRODUCTO\n initComment(orden, \"Se devuelve el pedido, \" + usuario.getmUsuario(), VolleyController.DEVOLVER_URL);\n }\n }", "@Override\n public Navigation run() throws Exception {\n Map<String, Object> input = null;\n Key cafeKey=null;\n String returnKey = null;\n \n //投稿ボタンを押した場合\n if(request.getParameter(\"dataPost\") != null){\n \n input = new RequestMap(request);\n \n //店舗名称をセット\n \n \n //エリア系のデータを取得\n String geohash4 = null;\n String geohash5 = null;\n String geohash6 = null;\n String geohash8 = null;\n String geohashAll = null;\n String geohashAround = null;\n String storeFullName = null;\n \n \n if(input.get(\"storeName\") != null && \n !\"\".equals(input.get(\"storeName\")) && \n !\"(null)\".equals(input.get(\"storeName\")) &&\n input.get(\"storeFlag\") != null && \n !\"\".equals(input.get(\"storeFlag\")) && \n !\"(null)\".equals(input.get(\"storeFlag\"))\n ){\n String storeMainName = CafeUtil.createStoreMainName(EscapeUtil.toHtmlStringForObject(input.get(\"storeFlag\")).trim());\n String storeSubName = EscapeUtil.toHtmlStringForObject(input.get(\"storeName\")).trim();\n storeFullName = storeMainName+\" \"+storeSubName;\n input.put(\"storeFullName\", storeFullName);\n }\n \n //住所から緯度経度を取得\n double lat = 0;\n double lng = 0;\n //時間を取得\n String nowTime = DateTimeUtil.getDateTimeString();\n if(request.getParameter(\"storeAddress\") != null && request.getParameter(\"storeAddress\") != \"\"){\n //エリア系データを取得して、DBにいるか問い合わせ\n String[] areaAry = AreaHandle.feedGeoHash(request.getParameter(\"storeAddress\"));\n if(areaAry != null){\n if(areaAry.length == 7){\n geohashAll = areaAry[0];\n geohash4 = areaAry[6];\n geohash5 = areaAry[5];\n geohash6 = areaAry[1];\n geohash8 = areaAry[2];\n lat = Double.valueOf(areaAry[3]);\n lng = Double.valueOf(areaAry[4]);\n }\n }\n //geohashの周りの値を取得\n geohashAround = CafeUtil.geohashAround(geohash6);\n \n input.put(\"lat\", String.valueOf(lat));\n input.put(\"lon\", String.valueOf(lng));\n input.put(\"geohash4\", geohash4);\n input.put(\"geohash5\", geohash5);\n input.put(\"geohash6\", geohash6);\n input.put(\"geohash8\", geohash8);\n input.put(\"geohashAround\", geohashAround);\n input.put(\"geohashAll\", geohashAll);\n input.put(\"deleteFlag\", \"0\");\n input.put(\"updateDateTime\", nowTime);\n }\n \n \n //更新の場合\n if(request.getParameter(\"key\") != null && request.getParameter(\"key\") != \"\"){\n \n //input.put(\"iine\", \"0\");\n input.put(\"key\",request.getParameter(\"key\"));\n //DBを更新\n cafeKey = service.updateData(input);\n }else{\n //フォームのパラメータを取得\n //String StoreName = (String )createStoreName(request.getParameter(\"storeName\"),request.getParameter(\"storeFlag\"));\n //input.put(\"storeName\", StoreName);\n \n //イイネ\n /*\n if(request.getParameter(\"iine\") != null && request.getParameter(\"iine\") != \"\"){\n input.put(\"iine\", 1);\n }\n */\n \n //DBに投入\n cafeKey = service.postData(input);\n \n }\n }\n \n //削除の場合\n if(request.getParameter(\"delete\") != null && request.getParameter(\"delete\") != \"\"){\n input = new RequestMap(request);\n input.put(\"deleteFlag\", \"1\");\n input.put(\"key\",request.getParameter(\"key\"));\n //DBを更新\n cafeKey = service.deleteData(input);\n }\n if(cafeKey != null){\n returnKey = String.valueOf(cafeKey.getId());\n } \n requestScope(\"returnKey\", returnKey);\n //nullがセットされないため対策\n input = notNullinput(input);\n requestScope(\"reqParam\", input);\n return forward(\"index.vm\");\n }", "@Override\r\n\tprotected byte[] handleSpecificRequest(String request) {\r\n\t\tif (!Utils.isEmpty(request)) {\r\n\t\t\tlogger.info(\"$$$$$$$$$$$$Message received at Tracking Server:\" + request);\r\n\t\t\tif (request.startsWith(NODE_REQUEST_TO_SERVER.FILE_LIST.name())) {\r\n\t\t\t\thandleFileUpdateMessage(request);\r\n\t\t\t\treturn Utils.stringToByte(SharedConstants.COMMAND_SUCCESS);\r\n\t\t\t} else if (request.startsWith(NODE_REQUEST_TO_SERVER.FIND.name())) {\r\n\t\t\t\tString peers = handleFindFileRequest(request);\r\n\t\t\t\treturn Utils.stringToByte((Utils.isEmpty(peers) ? SharedConstants.COMMAND_FAILED\r\n\t\t\t\t\t\t: SharedConstants.COMMAND_SUCCESS) + SharedConstants.COMMAND_PARAM_SEPARATOR + peers);\r\n\r\n\t\t\t} else if (request.startsWith(NODE_REQUEST_TO_SERVER.FAILED_PEERS.name())) {\r\n\t\t\t\thandleFailedPeerRequest(request);\r\n\t\t\t\treturn Utils.stringToByte(SharedConstants.COMMAND_SUCCESS);\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Utils.stringToByte(SharedConstants.INVALID_COMMAND);\r\n\r\n\t}", "@Override\n\t\t\t\tpublic void onNetworkError(Request request, IOException e) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\r\n JSONObject doPerform(HttpServletRequest req, HttpServletResponse response) throws Exception {\r\n JSONObject jo = new JSONObject();\r\n try {\r\n JSONObject json;\r\n if (req.getMethod().equals(\"POST\")) {\r\n String js = IOUtils.toString(req.getInputStream(), \"UTF-8\");\r\n json = new JSONObject(js);\r\n } else {\r\n json = new JSONObject(req.getParameter(\"json\"));\r\n }\r\n OfferRecord or = OfferRecord.fromJSON(json);\r\n JSONObject ret = new JSONObject(SolrIndexerCommiter.indexJSON(new JSONObject(JSON.toJSONString(or)), \"offersCore\"));\r\n\r\n// Indexer indexer = new Indexer();\r\n// indexer.indexWanted(or.doc_code,\r\n// UsersController.toKnihovna(req).getCode(),\r\n// or.chci);\r\n return ret;\r\n\r\n } catch (Exception ex) {\r\n LOGGER.log(Level.SEVERE, null, ex);\r\n jo.put(\"error\", ex.toString());\r\n }\r\n return jo;\r\n\r\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException, InterruptedException, ParseException, SQLException, ParserConfigurationException, SAXException {\n\t\t// response.setStatus(HttpServletResponse.SC_NO_CONTENT);\n\t\tresponse.setContentType(\"text/html;charset=UTF-8\");\n\t\tPrintWriter out = response.getWriter();\n\t\tHttpSession session = request.getSession();\n \tServletContext sc = session.getServletContext();\n \tString file = sc.getRealPath(\"VM_Local.xml\");\n\t\tfinal DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n\n\t\tfinal DocumentBuilder builder = factory.newDocumentBuilder();\n\t\tfinal Document document = builder.parse(file);\n\t\tString export = document.getDocumentElement().getElementsByTagName(\"export\").item(0).getTextContent();\n\t\tString protocole =document.getDocumentElement().getElementsByTagName(\"protocole\").item(0).getTextContent();\t\n\t\tString hote =document.getDocumentElement().getElementsByTagName(\"hote\").item(0).getTextContent();\t\t\n\t\tString disc =document.getDocumentElement().getElementsByTagName(\"disc\").item(0).getTextContent();\n\t\tString geojsonpath =document.getDocumentElement().getElementsByTagName(\"geojsonpath\").item(0).getTextContent();\n\t\tString templatepath =document.getDocumentElement().getElementsByTagName(\"templatepath\").item(0).getTextContent();\n\t\tString featureAnalyzerURL =document.getDocumentElement().getElementsByTagName(\"featureAnalyzerURL\").item(0).getTextContent();\n\t\tString caractereAjoutParamURL =document.getDocumentElement().getElementsByTagName(\"caractereAjoutParamURL\").item(0).getTextContent();\n\t\t\n\t\tfeatureAnalyzerURL =featureAnalyzerURL.replace(caractereAjoutParamURL, \"&\");\n\t\t\n\t\tString hostURL = protocole +\"://\" +hote;\n\t\t\n\t\t/* CHOIX D'EXPORTATION POUR LA VM OU EN LOCAL */\n\t\t// String export = \"VM\";\n\t\t// String export = \"local\";\n\n\t\t/*\n\t\t * CHOIX DE CREER PLUSIEURS FICHIERS PAR RAPPORT A LA DATE OU UN SEUL FICHIER\n\t\t * GEOJSON\n\t\t */\n\t\tint date = 0; // UN SEUL FICHIER\n// int data = 1; // PLUSIEURS FICHIERS\n\n\t\t// MainApp.main(null);\n\t\tString typeCarte = MainApp.main(request, export,hote,disc,geojsonpath,templatepath, date, protocole);\n\t\t\n\t\tSystem.out.println(\"******************** TTTTTTTTT14/09/2021TTTTTTTTt **************************\");\n\t\tString templateAsJSON = iOServiceWithBuffered.read(templatepath);\n\t\tSystem.out.println(hostURL);\n\t\tSystem.out.println(templateAsJSON);\n\t\t\n\t\tSystem.out.println(\"******************** TTTTTTTTT14/09/2021TTTTTTTTt **************************\");\n\t\t\n\t\ttry {\n\n// \tCircles crl = new Circles();\n\n\t\t\t/* TODO output your page here. You may use following sample code. */\n\t\t\tout.println(\"<html>\");\n\t\t\tout.println(\"<head>\");\n\t\t\tout.println(\"<title>Servlet data processing</title>\");\n\t\t\tout.println(\"<script language=\\\"JavaScript\\\" >\");\n\t\t\tout.println(\"function OpenInNewTab(url) {\");\n\t\t\tout.println(\"var win = window.open(url, '_self');\");\n\t\t\tout.println(\"win.focus();\");\n\t\t\tout.println(\"}\");\n\t\t\tout.println(\"</script>\");\n\n\t\t\tout.println(\"</head>\");\n\t\t\t\t\t\t\t\t\t\n\t\t\tout.println(\"<body>\");\n\t\t\t\tout.println(\"<script language=\\\"JavaScript\\\" >\");\n\t\t\t\tout.println(\"var popup;\");\n\t\t\t\tout.println(\"window.addEventListener('message', (event) => {\");\n\t\t\t\t\tout.println(\"if (event.data === 'readyAnalyzer') {\");\n\t\t\t\t\t\tout.println(\"popup.postMessage({ type: 'solapdata', content:\"+ templateAsJSON +\"}, '\" +hostURL +\"')\");\n\t\t\t\t\tout.println(\"}\");\n\t\t\t\tout.println(\"});\");\n\t\t\t\tout.println(\"popup = window.open('\" + featureAnalyzerURL +\"');\");\n\t\t\t\tout.println(\"</script>\");\n\t\t\t\n\n\t\t\t\n\t\t\t\n\t\t\tout.println(\"</body>\");\n\t\t\tout.println(\"</html>\");\n\n\t\t} finally {\n\t\t\tout.close();\n\t\t}\n\n\t}", "public synchronized void handle(PBFTRequest r){\n \n Object lpid = getLocalServerID();\n\n JDSUtility.debug(\"[handle(request)] s\" + lpid + \", at time \" + getClockValue() + \", received \" + r);\n\n StatedPBFTRequestMessage loggedRequest = getRequestInfo().getStatedRequest(r);\n \n /* if the request has not been logged anymore and it's a old request, so it was garbage by checkpoint procedure then I must send a null reply */\n if(loggedRequest == null && getRequestInfo().isOld(r)){\n IProcess client = new BaseProcess(r.getClientID());\n PBFTReply reply = new PBFTReply(r, null, lpid, getCurrentViewNumber());\n emit(reply, client);\n return;\n \n }\n \n try{\n /*if the request is new and hasn't added yet then it'll be added */\n if(loggedRequest == null){\n /* I received a new request so a must log it */\n loggedRequest = getRequestInfo().add(getRequestDigest(r), r, RequestState.WAITING);\n loggedRequest.setRequestReceiveTime(getClockValue());\n }\n\n /* if I have a entry in request log but I don't have the request then I must update my request log. */\n if(loggedRequest.getRequest() == null) loggedRequest.setRequest(r);\n \n /*if the request was served the I'll re-send the related reply if it has been logged yet.*/\n if(loggedRequest.getState().equals(RequestState.SERVED)){\n JDSUtility.debug(\"[handle(request)] s\" + lpid + \" has already served \" + r);\n\n /* retransmite the reply when the request was already served */\n PBFTReply reply = getRequestInfo().getReply(r);\n IProcess client = new BaseProcess(r.getClientID());\n emit(reply, client);\n return;\n }\n \n /* If I'm changing then I'll do nothing more .*/\n if(changing()) return;\n\n PBFTPrePrepare pp = getPrePreparebackupInfo().get(getCurrentViewNumber(), getCurrentPrimaryID(), loggedRequest.getDigest());\n\n if(pp != null && !isPrimary()){\n /* For each digest in backuped pre-prepare, I haven't all request then it'll be discarded. */\n DigestList digests = new DigestList();\n for(String digest : pp.getDigests()){\n if(!getRequestInfo().hasRequest(digest)){\n digests.add(digest);\n }\n }\n \n if(digests.isEmpty()){\n handle(pp);\n getPrePreparebackupInfo().rem(pp);\n return;\n } \n }\n\n boolean committed = loggedRequest.getState().equals( RequestState.COMMITTED );\n \n// /* if my request was commit and it hasn't been served yet I must check the stated of the request */\n if(committed){\n tryExecuteRequests();\n return;\n }\n \n /* performs the batch procedure if the server is the primary replica. */\n if(isPrimary()){\n JDSUtility.debug(\"[handle(request)] s\" + lpid + \" (primary) is executing the batch procedure for \" + r + \".\");\n batch();\n }else{\n /* schedules a timeout for the arriving of the pre-prepare message if the server is a secundary replica. */\n scheduleViewChange();\n }//end if is primary\n \n }catch(Exception e){\n e.printStackTrace();\n }\n }", "@Override\r\n\tpublic void exitRequest() {\n\t\t\r\n\t}", "@Override\n\tpublic void processRequest(HttpRequest request, HttpResponse response) throws Exception {\n\t\tresponse.setHeaderField( \"Server-Name\", \"Las2peer 0.1\" );\n\t\tresponse.setContentType( \"text/xml\" );\n\t\t\n\t\t\n\t\t\n\t\tif(authenticate(request,response))\n\t\t\tif(invoke(request,response));\n\t\t\t\t//logout(_currentUserId);\n\t \n\t\n\t\t//connector.logMessage(request.toString());\n\t\t\n\t\t\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n response.setContentType(\"text/html;charset=UTF-8\");\n\n SingletonFuncionLog singletonFuncionLog5 = InitialContext.doLookup(\"java:global/ASAPLICACIONCURSOSPRACTICA1/SingletonFuncionLog\");\n this.estadisticas = InitialContext.doLookup(\"java:global/ASAPLICACIONCURSOSPRACTICA1/Estadisticas\");\n \n estadisticas.nuevoAccesoCuestionarioCommand();\n\n singletonFuncionLog5.funcionLog(\"CuestionarioCommand\", \"processRequest\");\n } catch (NamingException ex) {\n singletonFuncionLog5.funcionLog(\"CuestionarioCommand\", \"NamingException ex\");\n\n Logger.getLogger(CuestionarioCommand.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n }", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (SQLException ex) {\r\n Logger.getLogger(Readship.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "@Override\n\tpublic void receiveRequest() {\n\n\t}", "@Override\n\t\tpublic void action() {\n\t\t\tMessageTemplate mt = MessageTemplate.MatchPerformative(ACLMessage.REQUEST); \n\t\t\tACLMessage msg = receive(mt);\n\t\t\tif(msg != null){\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tContentElement ce = null;\n\t\t\t\t\tSystem.out.println(msg.getContent()); //print out the message content in SL\n\n\t\t\t\t\t// Let JADE convert from String to Java objects\n\t\t\t\t\t// Output will be a ContentElement\n\t\t\t\t\tce = getContentManager().extractContent(msg);\n\t\t\t\t\tSystem.out.println(ce);\n\t\t\t\t\tif(ce instanceof Action) {\n\t\t\t\t\t\tConcept action = ((Action)ce).getAction();\n\t\t\t\t\t\tif (action instanceof SupplierOrder) {\n\t\t\t\t\t\t\tSupplierOrder order = (SupplierOrder)action;\n\t\t\t\t\t\t\t//CustomerOrder cust = order.getItem();\n\t\t\t\t\t\t\t//OrderQuantity = order.getQuantity();\n\t\t\t\t\t\t\tif(!order.isFinishOrder()) {\n\t\t\t\t\t\t\tSystem.out.println(\"exp test: \" + order.getQuantity());\n\t\t\t\t\t\t\trecievedOrders.add(order);}\n\t\t\t\t\t\t\telse {orderReciever = true;}\n\t\t\t\t\t\t\t//Item it = order.getItem();\n\t\t\t\t\t\t\t// Extract the CD name and print it to demonstrate use of the ontology\n\t\t\t\t\t\t\t//if(it instanceof CD){\n\t\t\t\t\t\t\t\t//CD cd = (CD)it;\n\t\t\t\t\t\t\t\t//check if seller has it in stock\n\t\t\t\t\t\t\t\t//if(itemsForSale.containsKey(cd.getSerialNumber())) {\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Selling CD \" + cd.getName());\n\t\t\t\t\t\t\t\t//}\n\t\t\t\t\t\t\t\t//else {\n\t\t\t\t\t\t\t\t\t//System.out.println(\"You tried to order something out of stock!!!! Check first!\");\n\t\t\t\t\t\t\t\t//}\n\n\t\t\t\t\t\t\t//}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t}\n\t\t\t\t\t//deal with bool set here\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcatch (CodecException ce) {\n\t\t\t\t\tce.printStackTrace();\n\t\t\t\t}\n\t\t\t\tcatch (OntologyException oe) {\n\t\t\t\t\toe.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\tblock();\n\t\t\t}\n\t\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String name = request.getParameter(GenericConstants.COMPONENT_PNAME);\n \n RealTimeSUStateHelper suRTHelper = new RealTimeSUStateHelper(name);\n String responseData = suRTHelper.getServiceUnitsState();\n response.setStatus(HttpServletResponse.SC_OK);\n response.setHeader(RealTimeStatisticServlet.CONTENT_TYPE_HEADER, \n RealTimeStatisticServlet.CONTENT_TYPE_VALUE);\n response.setHeader(RealTimeStatisticServlet.CACHE_CONTROL_HEADER, \n RealTimeStatisticServlet.CACHE_CONTROL_VALUE);\n \n // Write out the message on the response stream\n OutputStream outputStream = response.getOutputStream();\n try {\n outputStream.write(responseData.getBytes());\n } catch (IOException e2) {\n }\n outputStream.flush();\n \n }", "@Override\n\tpublic void handleResponse() {\n\t\t\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\n response.setContentType(\"application/json\");\r\n String username = SessionUtils.getUsername(request);\r\n if (username == null) {\r\n response.sendRedirect(\"index.html\");\r\n }\r\n try (PrintWriter out = response.getWriter()) {\r\n Gson gson = new Gson();\r\n GameManager gameManager = ServletUtils.getGameManager(getServletContext());\r\n int msgVersion = ServletUtils.getIntParameter(request, Constants.ALIES_MSG_VERSION_PARAMETER);\r\n if (msgVersion > Constants.INT_PARAMETER_ERROR) {\r\n Game game = gameManager.getGame(SessionUtils.getGameName(request));\r\n Alies alies = game.getAliesByName(username);\r\n List<CandidateForDecoding> agentList = alies.getCandidacies();\r\n if (agentList.size() != 0){\r\n MsgAndVersion mav = new MsgAndVersion(agentList, alies.getVersion());\r\n String json = gson.toJson(mav);\r\n out.println(json);\r\n out.flush();\r\n }\r\n }\r\n response.setStatus(200);\r\n }\r\n }", "public void handle(Element xmlRequest, HttpServletRequest req, HttpServletResponse res) throws IOException;", "private String ajax_called(String zip){\n\t\ttry{\r\n\t\t\tClientConfig config = new ClientConfig();\r\n\t Client client = ClientBuilder.newClient(config);\r\n\t WebTarget target = client.target(getBaseURI());\t\t\t\r\n\t\t\t//Form form =new Form();\r\n\t\t\t//form.param(\"zipcode\", zip);\r\n\t\t\t//String response = target.request().post(Entity.entity(form,MediaType.APPLICATION_FORM_URLENCODED),String.class);\r\n\t\t\t//Response response = target.path(zip).request().accept(MediaType.TEXT_PLAIN).get();\r\n\t\t\tString response = target.path(\"rest\").path(\"todos\").path(zip).request().accept(MediaType.TEXT_PLAIN).get(String.class);\r\n\t\t\t//System.out.println(response.toString());\t\t\t\t\r\n\t return response;\r\n\t\t}catch(Exception e){\r\n\t\t\treturn e.toString();\r\n\t\t}\r\n\t}", "@Override\r\n\t\tpublic void action() {\n\t\t\t\r\n\t\t\tACLMessage request = new ACLMessage (ACLMessage.REQUEST);\r\n\t\t\trequest.setProtocol(FIPANames.InteractionProtocol.FIPA_REQUEST);\r\n\t\t\trequest.addReceiver(new AID(\"BOAgent\",AID.ISLOCALNAME));\r\n\t\t\trequest.setLanguage(new SLCodec().getName());\t\r\n\t\t\trequest.setOntology(RequestOntology.getInstance().getName());\r\n\t\t\tInformMessage imessage = new InformMessage();\r\n\t\t\timessage.setPrice(Integer.parseInt(price));\r\n\t\t\timessage.setVolume(Integer.parseInt(volume));\r\n\t\t\ttry {\r\n\t\t\t\tthis.agent.getContentManager().fillContent(request, imessage);\r\n\t\t\t} catch (CodecException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (OntologyException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tthis.agent.addBehaviour(new AchieveREInitiator(this.agent, request)\r\n\t\t\t{\t\t\t\r\n\t\t\t/**\r\n\t\t\t\t * \r\n\t\t\t\t */\r\n\t\t\t\tprivate static final long serialVersionUID = -8866775600403413061L;\r\n\r\n\t\t\t\tprotected void handleInform(ACLMessage inform)\r\n\t\t\t\t{\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}", "@Override\n public void run() {\n handleClientRequest();\n }", "protected void onBeginRequest()\n\t{\n\t}", "void faild_response();", "public void onRequestResponse(Response response) { }", "@Override\n\t\t\t\t\tpublic void onReqStart() {\n\t\t\t\t\t}", "@Override\n\t\tvoid request(HttpURLConnection u, String prefix) {\n\t\t}", "@Override\r\n\tpublic void service(Request request,Response response) {\n\t\tresponse.print(\"lalaa\");\r\n\r\n\t\t\r\n\t}", "protected String processGongRequest(String request) {\r\n // Get a new handler\r\n ScriptHandler scriptHandler = getScriptHandler(request, null);\r\n if (scriptHandler == null) {\r\n try {\r\n Fault fault = Message.newFault(\"\", \"NanoGong is busy at the moment.\");\r\n return fault.toString();\r\n } catch (Exception e) {}\r\n }\r\n\r\n // Execute the request\r\n scriptHandler.execute();\r\n \r\n // Return the fault if there is any\r\n String response;\r\n Fault fault = (Fault) scriptHandler.getFault();\r\n if (fault != null)\r\n response = fault.toString();\r\n else\r\n response = scriptHandler.getResponse().toString();\r\n\r\n // Clear the handler\r\n clearScriptHandler();\r\n\r\n return response;\r\n }", "@Override\n public void onMoveLegRequest(MoveLegRequest ind) {\n\n }", "private void erweimaHttpPost() {\n\t\tHttpUtils httpUtils = new HttpUtils();\n\t\tUtils utils = new Utils();\n\t\tString[] verstring = utils.getVersionInfo(getActivity());\n\t\tRequestParams params = new RequestParams();\n\t\tparams.addHeader(\"ccq\", utils.getSystemVersion()+\",\"+ verstring[0]+\",\"+verstring[2]);\n\t\tparams.addBodyParameter(\"token\",\n\t\t\t\tnew DButil().gettoken(getActivity()));\n\t\tparams.addBodyParameter(\"member_id\",\n\t\t\t\tnew DButil().getMember_id(getActivity()));\n\t\thttpUtils.send(HttpMethod.POST, JiekouUtils.TUIGUANGERWEIMA, params,\n\t\t\t\tnew RequestCallBack<String>() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onFailure(HttpException arg0, String arg1) {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\tLog.e(\"ee\", \"失败:\" + arg1);\n\t\t\t\t\t\thandler.sendEmptyMessage(HANDLER_NET_FAILURE);\n\t\t\t\t\t\t// handler.sendEmptyMessage(HANDLER_NET_FAILURE);\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onSuccess(ResponseInfo<String> arg0) {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\terweimaJsonInfo(arg0.result);\n\t\t\t\t\t}\n\t\t\t\t});\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n \n List<Tuote> tuotteet = null;\n try {\n tuotteet = Tuote.haeTuotteet();\n } catch (SQLException ex) {\n Logger.getLogger(MenuServlet.class.getName()).log(Level.SEVERE, null, ex);\n request.setAttribute(\"virhe\", \"Virhe haettaessa tuotteiden tietoja!\");\n }\n \n if (tuotteet != null)\n request.setAttribute(\"tuotteet\", tuotteet);\n \n naytaJSP(\"menu.jsp\", request, response);\n }", "public void procRequest ()\r\n\t{\r\n\t\tthis.simTime = this.sim.getTimer();\r\n\t\tthis.request.setStartTime(simTime);\r\n\t\t//Debug/System.out.println(Fmt.time(simTime)\r\n\t\t//Debug/\t+ \": <procRequest> \" + request);\r\n\r\n\t\t//\tNeed to move from current cylinder to requested cylinder.\r\n\t\t//\tIf current == requested, no action.\r\n\t\tif (this.cylinder != this.request.getCylinder())\r\n\t\t\tthis.simTime += this.calcSeekTime(this.request.getCylinder());\r\n\t\tthis.sim.addEvent(new Event(Event.SEEK_SATISFIED, this.simTime));\r\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException, NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException\r\n {\r\n String message = request.getParameter(DATA_NAME);\r\n message = getPlainText(message);\r\n PrintWriter out = response.getWriter();\r\n out.print(prepareEnrcyptedJSONMessage(message)); \r\n }", "@Override\n public void run() {\n\n queryForRoutingManager();\n File f = IMbuffer.fetchFromIMInputBuffer();\n if (f.getName().startsWith(\"Responseto\")) {\n transfertopurge(f);\n }\n }", "KijiDataRequest getClientRequest();", "org.naru.park.ParkModel.UIParkRequest getRequest();", "@Override\n\t\tpublic void run() {\n\t\t\tMessage msg = new Message();\n\t\t\ttry {\n\t\t\t\tHippoWebService connect = new HippoWebService();\n\t\t\t\tString[] split = _queryString.split(\",\");\n\t\t\t\t_busStop = split[1];\n\t\t\t\tString api = \"http://pda.5284.com.tw/MQS/businfo4.jsp?SLID=\" + split[0];\n\t\t\t\tString ret = connect.getMethod(api, \"utf-8\");\n\t\t\t if(ret!=null)\n\t\t\t {\n\t\t\t \tmsg.what = 102;\n\t\t\t \tmsg.obj = ret;\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t \tmsg.what = 999;\n\t\t\t \tmsg.obj = \"Error\";\n\t\t\t }\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO: handle exception\n\t\t\t\tmsg.what = 999;\n\t\t\t\tmsg.obj = e.toString();\n\t\t\t}\n\t\t\tmHandler.sendMessage(msg);\n\t\t}", "@Override\n\t\tpublic void run() {\n\t\t\tMessage msg = new Message();\n\t\t\ttry {\n\t\t\t\tHippoWebService connect = new HippoWebService();\n\t\t\t\tString[] split = _queryString.split(\",\");\n\t\t\t\t_busStop = split[1];\n\t\t\t\tString api = \"http://pda.5284.com.tw/MQS/businfo4.jsp?SLID=\" + split[0];\n\t\t\t\tString ret = connect.getMethod(api, \"utf-8\");\n\t\t\t if(ret!=null)\n\t\t\t {\n\t\t\t \tmsg.what = 101;\n\t\t\t \tmsg.obj = ret;\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t \tmsg.what = 999;\n\t\t\t \tmsg.obj = \"Error\";\n\t\t\t }\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO: handle exception\n\t\t\t\tmsg.what = 999;\n\t\t\t\tmsg.obj = e.toString();\n\t\t\t}\n\t\t\tmHandler.sendMessage(msg);\n\t\t}", "void onResponse(String response, int requestId);", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String demande;\n String vueReponse = \"/home.jsp\";\n erreur = null;\n try {\n demande = getDemande(request);\n if (demande.equalsIgnoreCase(\"catalogue.oe\")) {\n vueReponse = getOeuvres(request);\n } else if (demande.equalsIgnoreCase(\"myCatalogue.oe\")) {\n vueReponse = getMyOeuvres(request);\n } else if (demande.equalsIgnoreCase(\"ajouter.oe\")) {\n vueReponse = creerOeuvre(request);\n } else if (demande.equalsIgnoreCase(\"enregistrer.oe\")) {\n vueReponse = enregistrerOeuvre(request);\n } else if (demande.equalsIgnoreCase(\"modifier.oe\")) {\n vueReponse = modifierOeuvre(request);\n } else if (demande.equalsIgnoreCase(\"supprimer.oe\")) {\n vueReponse = supprimerOeuvre(request);\n }\n } catch (Exception e) {\n erreur = Utilitaire.getExceptionCause(e);\n } finally {\n request.setAttribute(\"erreurR\", erreur);\n request.setAttribute(\"pageR\", vueReponse);\n RequestDispatcher dsp = request.getRequestDispatcher(\"/index.jsp\");\n if (vueReponse.contains(\".oe\")) {\n dsp = request.getRequestDispatcher(vueReponse);\n }\n dsp.forward(request, response);\n }\n }", "@Override\n public Object run() {\n System.out.println(\"[MyZuulFilter] This request has passed through the custom Zuul Filter...\");\n return null;\n }", "@Override\n\t\t\t\t\t\t public void run() {\n\t\t\t\t\t\t\t getResponse();\n\t\t\t\t\t\t }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (NamingException ex) {\n Logger.getLogger(UpdateLibro.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (NamingException ex) {\n Logger.getLogger(UpdateLibro.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n public void receiveRequest(final Request request) {\n\n }", "public Response sendRequest(Request request) {\n return null;\n }", "@Override\n\tpublic void action() {\n\t\tACLMessage msgRx = myAgent.receive();\n\t\tif (msgRx != null && msgRx.getPerformative() == ACLMessage.REQUEST) {\n\t\t\tContentManager contentManager = myAgent.getContentManager();\n\t\t\tSystem.out.println(\"RECEIVED = \" + msgRx.getContent());\n\t\t\tmsgRx.setLanguage(\"fipa-sl\");\n\t\t\tmsgRx.setOntology(\"blocks-ontology\");\n\t\t\t\n\t\t\ttry {\n\t\t\t\tContentElementList elementList = (ContentElementList) contentManager\n\t\t\t\t\t\t.extractContent(msgRx);\n\n\t\t\t\tIterator elementIterator = elementList.iterator();\n\n\t\t\t\twhile (elementIterator.hasNext()) {\n\t\t\t\t\tAction action = (Action) elementIterator.next();\n\t\t\t\t\t((Environment) myAgent).getWorld().getActionList().add((Executable) (action.getAction()));\n//\t\t\t\t\t((Executable) (action.getAction()))\n//\t\t\t\t\t\t\t.execute((Environment) myAgent);\n\t\t\t\t}\n\n\t\t\t} catch (UngroundedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (CodecException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (OntologyException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} else {\n\t\t\tblock();\n\t\t}\n\t\t\n\t}", "public void processRequest(StunMessageEvent evt)\n {\n if(messageSequence.isEmpty())\n return;\n Object obj = messageSequence.remove(0);\n\n if( !(obj instanceof Response) )\n return;\n\n Response res = (Response)obj;\n\n try\n {\n stunStack.sendResponse(evt.getMessage().getTransactionID(),\n res, serverAddress, evt.getRemoteAddress());\n }\n catch (Exception ex)\n {\n logger.log(Level.WARNING, \"failed to send a response\", ex);\n }\n\n }", "private String gatewayRequestCmd(String url) {\n final ProgressDialog pDialog = new ProgressDialog(mCtx);\n pDialog.setMessage(\"Sending...\");\n pDialog.show();\n\n JsonObjectRequest jsonObjReq = new JsonObjectRequest(Request.Method.GET,\n url, null,\n new Response.Listener<JSONObject>() {\n\n @Override\n public void onResponse(JSONObject response) {\n Log.d(TAG, \"Response\");\n Log.d(TAG, response.toString());\n pDialog.hide();\n }\n }, new Response.ErrorListener() {\n\n @Override\n public void onErrorResponse(VolleyError error) {\n Log.d(TAG, \"Error: \" + error.getMessage());\n // hide the progress dialog\n pDialog.hide();\n }\n });\n HttpHandler.getInstance(mCtx).addToRequestQueue(jsonObjReq);\n return \"\";\n\n }", "public InfoViajeResponse informarViaje(InfoViajeRequest request) {\n \n log.debug(\"infoviaje ws\");\n InfoViajeResponse response = new InfoViajeResponse();\n try { \n URL wsdlURL = new URL(trlService.getParamValue(\"WS_INF_VIAJE\"));\n QName SERVICE_NAME = new QName(\"http://tempuri.org/\", \"Service\");\n \n Service service = new Service(wsdlURL, SERVICE_NAME); \n ServiceSoap infoViajeSoap = service.getServiceSoap(); \n response.setResponse(\"\"+infoViajeSoap.inputViaje(request.getRequest()));\n \n } catch (Exception e) {\n log.debug(\"Error al informar viaje a GPS : \" + e.getMessage());\n response.setResponse(\"1\");\n }\n \n return response;\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 direction_call(LatLng orign, LatLng des) {\n\n String url = \"https://maps.googleapis.com/maps/api/directions/json?origin=\" + orign.latitude + \",\" + orign.longitude + \"&destination=\" + des.latitude + \",\" + des.longitude + \"&sensor=false\";\n RequestQueue requestQueue = Volley.newRequestQueue(getActivity());\n StringRequest objectRequest = new StringRequest(url, new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n Toast.makeText(getActivity(), response.toString(), 3).show();\n ParserTask parserTask = new ParserTask();\n parserTask.execute(response);\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n\n }\n });\n requestQueue.add(objectRequest);\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (BackException ex) {\n Logger.getLogger(GestionProductosServlet.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n long id = new Integer(request.getParameter(\"id\"));\n\n \n ResourcePOJO res = null;\n// try {\n res = manager.getResource(id, false);\n// } catch (JAXBException e) {\n// throw new IOException(e.getMessage());\n// }\n LayerManager layerBean = new LayerManager(res);\n \n try {\n \n request.setAttribute(\"layer\", layerBean);\n \n String layerName = layerBean.getName();\n \n List<ResourcePOJO> relatedStatsDefs = manager.searchStatsDefByLayer(layerName);\n request.setAttribute(\"statsDefs\", relatedStatsDefs);\n \n List<ResourcePOJO> relatedLayerUpdates = manager.searchLayerUpdatesByLayerName(layerName);\n request.setAttribute(\"layerUpdates\", relatedLayerUpdates);\n \n String data = manager.getData(id, MediaType.WILDCARD_TYPE.toString());\n layerBean.setData(data);\n \n request.setAttribute(\"storedData\", data);\n \n } catch (Exception ex) {\n Logger.getLogger(LayerShow.class.getName()).log(Level.SEVERE, null, ex);\n }\n String outputPage = getServletConfig().getInitParameter(\"outputPage\");\n RequestDispatcher rd = request.getRequestDispatcher(outputPage);\n rd.forward(request, response);\n }" ]
[ "0.6619353", "0.6233749", "0.6184268", "0.6150651", "0.602042", "0.59328115", "0.5919607", "0.59072405", "0.5903752", "0.5877953", "0.5848317", "0.58165276", "0.5813183", "0.5756176", "0.575243", "0.57427156", "0.5736497", "0.5732809", "0.5730267", "0.5711294", "0.57107735", "0.57095885", "0.56976634", "0.56574374", "0.5652788", "0.56324315", "0.5632101", "0.56160736", "0.56016225", "0.55980647", "0.55894905", "0.557527", "0.5574198", "0.5560098", "0.5555044", "0.5554238", "0.5541751", "0.5535748", "0.5529838", "0.552067", "0.55045253", "0.54928637", "0.54916286", "0.5471189", "0.54575735", "0.54333997", "0.54102737", "0.5407185", "0.5405912", "0.5402564", "0.54000944", "0.53979266", "0.5393002", "0.5392749", "0.5390371", "0.5387838", "0.5375394", "0.53668296", "0.5365071", "0.53605723", "0.53571296", "0.5353761", "0.5351513", "0.5350415", "0.5342009", "0.53419524", "0.5338983", "0.5319483", "0.53188705", "0.5316088", "0.53156596", "0.5315362", "0.53065544", "0.5300911", "0.5299488", "0.5293471", "0.5290117", "0.52900165", "0.5289812", "0.5288969", "0.5283231", "0.5282297", "0.52785546", "0.52784026", "0.52733386", "0.5268704", "0.52681637", "0.52543193", "0.52518684", "0.5250559", "0.524032", "0.5237862", "0.52372473", "0.52348435", "0.52260035", "0.5224632", "0.5222706", "0.5221217", "0.5216845", "0.52155316" ]
0.60449994
4
returns zeligconfiguration data as an XML string
public String getGUIconfigData(){ String zlgcnfg=null; try { // get connected to Rserve //String RSERVE_HOST = "vdc-build.hmdc.harvard.edu";//"140.247.115.232" //int RSERVE_PORT = 6311; RConnection c = new RConnection(RSERVE_HOST, RSERVE_PORT); // login(String user, String pwd) //String RSERVE_USER = "rserve"; //String RSERVE_PWD = "rserve"; c.login(RSERVE_USER, RSERVE_PWD); // get the hostname of the caller String hostname = null; Map<String, String> env = System.getenv(); for (String envName : env.keySet()) { if (envName.equals("HOST")){ hostname = env.get(envName); } } dbgLog.fine("hostname="+hostname); // set-up R command lines // temp file String R_TMP_DIR = "/tmp/VDC/"; //String cnfgfl = R_TMP_DIR +"configZeligGUI."+RandomStringUtils.randomNumeric(6)+ ".xml"; String cnfgfl = R_TMP_DIR +"configZeligGUI.xml"; dbgLog.fine("cnfgfl="+cnfgfl); // remove the existing config file if exists String removeOLdLine = "if (file.exists('"+cnfgfl+"')){file.remove('"+cnfgfl+"');}"; c.voidEval(removeOLdLine); // R code line part 1 String cmndline = "library(VDCutil); printZeligSchemaInstance('"+ cnfgfl + "')"; // cnfgfl + "'," + "'" + RSERVE_HOST + "')"; dbgLog.fine("comand line="+cmndline); // write zelig GUI-config data to the temp ifle c.voidEval(cmndline); //dbgLog.fine("commandline output="+outString); // check whether the temp file exists (Rserve is local) long filelength=0; try { if (RSERVE_HOST.equals("localhost") || RSERVE_HOST.equals(hostname)){ File flnm =new File(cnfgfl); boolean exists = flnm.exists(); if (exists) { dbgLog.fine("configuration xml file ("+cnfgfl+") was found"); filelength = flnm.length(); // Get the number of bytes in the file dbgLog.fine("The size of the file ="+filelength); } else { dbgLog.fine("configuration xml file ("+cnfgfl+") was not found"); } } } catch (NullPointerException e) { e.printStackTrace(); } //if (filelength > 0){ // read-back the config file c.voidEval("zz<-file('"+cnfgfl+"', 'r')"); c.voidEval("open(zz)"); zlgcnfg = c.eval("paste(readLines(zz),collapse='')").asString(); dbgLog.fine("string length="+zlgcnfg.length()); if (zlgcnfg.length()>0){ dbgLog.fine("first 72 bytes=[\n"+zlgcnfg.substring(0, 71) +"\n]\n"); } //} } catch (Exception ex){ ex.printStackTrace(); } return zlgcnfg; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String getAllConfigsAsXML() {\n StringBuilder configOutput = new StringBuilder();\n //getConfigParams\n configOutput.append(Configuration.getInstance().getXmlOutput());\n //getRocketsConfiguration\n configOutput.append(RocketsConfiguration.getInstance().getXmlOutput());\n //getCountries\n CountriesList countriesList = (CountriesList) AppContext.getContext().getBean(AppSpringBeans.COUNTRIES_BEAN);\n configOutput.append(countriesList.getListInXML());\n //getWeaponConfiguration\n configOutput.append(WeaponConfiguration.getInstance().getXmlOutput());\n //getPerksConfiguration\n configOutput.append(\"\\n\");\n configOutput.append(PerksConfiguration.getInstance().getXmlOutput());\n //getRankingRules\n ScoringRules scoreRules = (ScoringRules) AppContext.getContext().getBean(AppSpringBeans.SCORING_RULES_BEAN);\n configOutput.append(scoreRules.rankingRulesXml());\n\n configOutput.append(AchievementsConfiguration.getInstance().getXmlOutput());\n\n configOutput.append(\"\\n\");\n configOutput.append(AvatarsConfiguration.getInstance().getXmlOutput());\n\n\n return configOutput.toString();\n }", "public java.lang.String getXml();", "protected String getXML() {\n\n StringBuffer b = new StringBuffer(\"title =\\\"\");\n b.append(title);\n b.append(\"\\\" xAxisTitle=\\\"\");\n b.append(xAxisTitle);\n b.append(\"\\\" yAxisTitle=\\\"\");\n b.append(yAxisTitle);\n b.append(\"\\\" xRangeMin=\\\"\");\n b.append(xRangeMin);\n b.append(\"\\\" xRangeMax=\\\"\");\n b.append(xRangeMax);\n b.append(\"\\\" xRangeIncr=\\\"\");\n b.append(xRangeIncr);\n b.append(\"\\\" yRangeMin=\\\"\");\n b.append(yRangeMin);\n b.append(\"\\\" yRangeMax=\\\"\");\n b.append(yRangeMax);\n b.append(\"\\\" yRangeIncr=\\\"\");\n b.append(yRangeIncr);\n b.append(\"\\\" >\\n\");\n\n for (int i = 0, n = dataSources.size(); i < n; i++) {\n GuiChartDataSource ds = (GuiChartDataSource)dataSources.get(i);\n b.append(ds.toXML());\n b.append(\"\\n\");\n }\n\n return b.toString();\n }", "public XmlElement getConfig()\n {\n return m_xml;\n }", "public String getXML() //Perhaps make a version of this where the header DTD can be manually specified\n { //Also allow changing of generated tags to user specified values\n \n String xml = new String();\n xml= \"<?xml version = \\\"1.0\\\"?>\\n\";\n xml = xml + generateXML();\n return xml;\n }", "public String getXML() {\n\t\tString xml = \"\";\n\t\ttry {\n\t\t\tJAXBContext jc = JAXBContext.newInstance( VolumeRs.class );\n\t\t\tMarshaller m = jc.createMarshaller();\n\t\t\tStringWriter stringWriter = new StringWriter();\n\t\t\tm.marshal(this, stringWriter);\n\t\t\txml = stringWriter.toString();\n\t\t} catch (JAXBException ex) {}\n\t\treturn xml;\n\t}", "public String getXMLConfiguration()\n {\n return this.XMLConfiguration;\n }", "public Element toXml()\n {\n // Create the configuration.\n Element configuration = new Element(\"configuration\");\n configuration.setAttribute(\"name\", this.__profile_name);\n configuration.setAttribute(\"target\", this.getAddOnName());\n\n // Add the generic and the specialized configuration.\n configuration.addContent(this.getData());\n\n return configuration;\n }", "String getNegotiationXML();", "public String configurationInfo();", "public String createConfigXml(PentahoConfig config) throws ApsSystemException {\n\t\tElement root = this.createConfigElement(config);\n\t\tDocument doc = new Document(root);\n\t\tXMLOutputter out = new XMLOutputter();\n\t\tFormat format = Format.getPrettyFormat();\n\t\tformat.setIndent(\"\\t\");\n\t\tout.setFormat(format);\n\t\treturn out.outputString(doc);\n\t}", "public abstract String toXML();", "public abstract String toXML();", "public abstract String toXML();", "public static HashMap<String, String> OutputXml() {\n\t\treturn methodMap(\"xml\");\n\t}", "public String getXml()\n {\n StringBuffer result = new StringBuffer(256);\n\n result.append(\"<importOptions>\");\n\n result.append(m_fileOptions.asXML());\n result.append(getOtherXml());\n\n result.append(\"</importOptions>\");\n\n return result.toString();\n }", "public Element getConfig() {\n Element out = new Element(getElementName(),MarsModel.NAMESPACE);\n out.setAttribute(\"enabled\",String.valueOf(enabled));\n out.setAttribute(\"xmlfile\",xmlfile.getPath());\n out.setAttribute(\"period\",String.valueOf(period));\n out.setAttribute(\"xslthref\",xslthref);\n return out;\n }", "public String toXml() {\n\t\treturn(toString());\n\t}", "public String getXML() {\n\t\tString xml = \"\";\n\t\ttry {\n\t\t\tJAXBContext jc = JAXBContext.newInstance( QuotaUserRs.class );\n\t\t\tMarshaller m = jc.createMarshaller();\n\t\t\tStringWriter stringWriter = new StringWriter();\n\t\t\tm.marshal(this, stringWriter);\n\t\t\txml = stringWriter.toString();\n\t\t} catch (JAXBException ex) {}\n\t\treturn xml;\n\t}", "public String toXML() {\n StringBuilder xml = new StringBuilder();\n\n //just do the decomposition facts (not the surrounding element) - to keep life simple\n xml.append(super.toXML());\n\n for (YParameter parameter : _enablementParameters.values()) {\n xml.append(parameter.toXML());\n }\n for (YAWLServiceReference service : _yawlServices.values()) {\n xml.append(service.toXML());\n }\n return xml.toString();\n }", "public String getXML() {\n\t\treturn getXML(false);\n\t}", "@XmlAttribute(name=\"cfg\")\n\tpublic String getCfgAsString() {\n\t\tif(cfg != null)\n\t\t\treturn cfg.toString();\n\t\treturn null;\n\t}", "public String getXml() {\n return xml;\n }", "public String getKMLExtendedData(){\r\n String exData = \"\";\r\n for (int i = 0; i<attributes.size(); i++){\r\n String exDataRow = \"<Data name=\\\"\"+attributes.get(i).getAttName()+\"\\\"><value>\"+attributes.get(i).getAttValue()+\"</value></Data>\\n\";\r\n exData = exData+exDataRow;\r\n }\r\n return exData;\r\n }", "public final String toString() {\n StringBuffer sb = new StringBuffer();\n sb.append(\"<?xml version=\\\"1.0\\\"?>\").append(br());\n toXML(sb, 0);\n return sb.toString();\n }", "String toXmlString() throws IOException;", "public String toXML() {\n StringWriter stringWriter = new StringWriter();\n PrintWriter printWriter = new PrintWriter(stringWriter, true);\n toXML(printWriter);\n return stringWriter.toString();\n }", "public String toXML() {\n\t\tStringBuffer sb = new StringBuffer();\n\t\t\n\t\tsb.append(\"<logfilter>\\n\");\n\t\t// write description\n\t\tsb.append(\"<description>\" + description + \"</description>\\n\");\n\t\t// write logdata\n\t\tsb.append(\"<logdata>\" + logData + \"</logdata>\");\n\t\t// write accepted types\n\t\tsb.append(\"<acceptedtypes>\\n\");\n\t\tif (acceptedEventTypes != null) { \n\t\t\tSet<String> keys = acceptedEventTypes.keySet();\n\t\t\tfor (String key : keys) {\n\t\t\t\tsb.append(\"<class priority=\\\"\" + acceptedEventTypes.get(key) + \"\\\">\" + key + \"</class>\\n\");\n\t\t\t}\n\t\t}\n\t\tsb.append(\"</acceptedtypes>\\n\");\n\t\t\n\t\tsb.append(\"</logfilter>\");\n\t\t\n\t\treturn sb.toString();\n\t}", "public String getXml() {\n\t\treturn _xml;\n\t}", "String toXML() throws RemoteException;", "public String toXML() {\n return null;\n }", "protected String toXMLFragment() {\n StringBuffer xml = new StringBuffer();\n if (isSetStepConfig()) {\n StepConfig stepConfig = getStepConfig();\n xml.append(\"<StepConfig>\");\n xml.append(stepConfig.toXMLFragment());\n xml.append(\"</StepConfig>\");\n } \n if (isSetExecutionStatusDetail()) {\n StepExecutionStatusDetail executionStatusDetail = getExecutionStatusDetail();\n xml.append(\"<ExecutionStatusDetail>\");\n xml.append(executionStatusDetail.toXMLFragment());\n xml.append(\"</ExecutionStatusDetail>\");\n } \n return xml.toString();\n }", "private String generateConfigurationString() {\n\t\tStringBuilder configuration = new StringBuilder();\n\t\tconfigurationHolder.entrySet().stream().forEach(line -> {\n\t\t\tconfiguration.append(line.getKey()+\"=\"+line.getValue()+\"\\n\");\n\t\t});\n\t\treturn configuration.toString();\n\t}", "public String toXml()\n\t{\n\t\ttry {\n\t\t\tTransformer transformer = TransformerFactory.newInstance().newTransformer();\n\t\t\tStringWriter buffer = new StringWriter();\n\t\t\ttransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, \"yes\");\n\t\t\ttransformer.transform(new DOMSource(conferenceInfo), new StreamResult(buffer));\n\t\t\treturn buffer.toString();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\treturn null;\n\t\t}\n\t}", "public String toXML() {\n return null;\n }", "public String getConfig();", "@Get(\"xml\")\n public Representation toXml() {\n\n \tString status = getRequestFlag(\"status\", \"valid\");\n \tString access = getRequestFlag(\"location\", \"all\");\n\n \tList<Map<String, String>> metadata = getMetadata(status, access,\n \t\t\tgetRequestQueryValues());\n \tmetadata.remove(0);\n\n List<String> pathsToMetadata = buildPathsToMetadata(metadata);\n\n String xmlOutput = buildXmlOutput(pathsToMetadata);\n\n // Returns the XML representation of this document.\n StringRepresentation representation = new StringRepresentation(xmlOutput,\n MediaType.APPLICATION_XML);\n\n return representation;\n }", "public org.apache.axis2.databinding.types.soapencoding.String getRequestXml(){\n return localRequestXml;\n }", "public org.apache.axis2.databinding.types.soapencoding.String getRequestXml(){\n return localRequestXml;\n }", "public org.apache.axis2.databinding.types.soapencoding.String getRequestXml(){\n return localRequestXml;\n }", "public org.apache.axis2.databinding.types.soapencoding.String getRequestXml(){\n return localRequestXml;\n }", "public org.apache.axis2.databinding.types.soapencoding.String getRequestXml(){\n return localRequestXml;\n }", "public org.apache.axis2.databinding.types.soapencoding.String getRequestXml(){\n return localRequestXml;\n }", "public org.apache.axis2.databinding.types.soapencoding.String getRequestXml(){\n return localRequestXml;\n }", "public org.apache.axis2.databinding.types.soapencoding.String getRequestXml(){\n return localRequestXml;\n }", "public org.apache.axis2.databinding.types.soapencoding.String getRequestXml(){\n return localRequestXml;\n }", "public org.apache.axis2.databinding.types.soapencoding.String getRequestXml(){\n return localRequestXml;\n }", "public org.apache.axis2.databinding.types.soapencoding.String getRequestXml(){\n return localRequestXml;\n }", "@GET\n\t@Produces(MediaType.TEXT_XML)\n\tpublic String getXMLList()\n\t{\n\t\tString myStr = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" + \"<parent>\" + \"<policy>\" + \" Hello, World\" + \"</policy>\" + \"<hello>\" + \" Hello, World\" + \"</hello>\" + \"</parent>\";\n\t\t// iterate via \"New way to loop\"\n\t\t/*System.out.println(\"Looping through the list to build the xml string\");\n\t\tfor (String policy : _policyList) \n\t\t{\n\t\t\tmyStr += \"<Policy>\" + policy + \"</Policy>\";\n\t\t}*/\n\n\t\treturn myStr;\n\t}", "public Element getData()\n {\n // Ask the generic configuration's holder to export the list of specific\n // configuration's data.\n ArrayList<Element> specific_data = this._toXml_();\n\n // Build the specific configuration.\n Element generic = new Element(\"data\");\n for (int index = 0; index < specific_data.size(); index++)\n {\n generic.addContent(specific_data.get(index));\n }\n\n return generic;\n }", "public String toXML()\n {\n /* this is the kind of string that we will be generating here:\n *\n * <presence from='bard@shakespeare.lit/globe'>\n * <c xmlns='http://jabber.org/protocol/caps'\n * hash='sha-1'\n * node='http://jitsi.org'\n * ver='zHyEOgxTrkpSdGcQKH8EFPLsriY='/>\n * </presence>\n */\n\n StringBuilder bldr\n = new StringBuilder(\"<c xmlns='\" + getNamespace() + \"' \");\n\n if(getExtensions() != null)\n bldr.append(\"ext='\" + getExtensions() + \"' \");\n\n bldr.append(\"hash='\" + getHash() + \"' \");\n bldr.append(\"node='\" + getNode() + \"' \");\n bldr.append(\"ver='\" + getVersion() + \"'/>\");\n\n return bldr.toString();\n }", "public String toXml() {\n StringWriter outputStream = new StringWriter();\n try {\n PrintWriter output = new PrintWriter(outputStream);\n try {\n output.write(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\");\n toXml(output);\n return outputStream.toString();\n }\n catch (Exception ex) {\n Logger logger = Logger.getLogger(this.getClass());\n logger.error(ex);\n throw new EJBException(ex);\n }\n finally {\n output.close();\n }\n }\n finally {\n try {\n outputStream.close();\n }\n catch (IOException ex) {\n Logger logger = Logger.getLogger(this.getClass());\n logger.error(ex);\n throw new EJBException(ex);\n }\n }\n }", "public String exportXML() {\n\n\t\tXStream xstream = new XStream();\n\t\txstream.setMode(XStream.NO_REFERENCES);\n\n\t\treturn xstream.toXML(this);\n\t}", "@Override\n\tpublic String getFormat() {\n\t\treturn \"xml\";\n\t}", "public java.lang.String getResponseXml(){\n return localResponseXml;\n }", "public String\ttoXML()\t{\n\t\treturn toXML(0);\n\t}", "public String getReplicationXml();", "public String toXMLString() {\n\t\treturn toXMLString(XML_TAB, XML_NEW_LINE);\n\t}", "public String returnXml() {\n String result = String.format(\n \"<projects>\"\n + \"<id_pr>%s</id_pr>\"\n + \"<name_project>%s</name_project>\"\n + \"<description_project>%s</description_project>\"\n + \"<code_project>%s</code_project>\"\n + \"<creationdate_project>%s</creationdate_project>\"\n + \"</projects>\",\n getId_pr(), getName_project(), getDescription_project(), getCode_project(), getCreationdate_project());\n return result;\n }", "public String getConfig() {\n\t\treturn(config);\n\t}", "private String getConfigInfo(boolean verbose) {\r\n StringBuilder builder = new StringBuilder();\r\n\r\n GridHubConfiguration config = getRegistry().getConfiguration();\r\n builder.append(\"<b>Config for the hub :</b><br/>\");\r\n builder.append(prettyHtmlPrint(config));\r\n\r\n if (verbose) {\r\n\r\n GridHubConfiguration tmp = new GridHubConfiguration();\r\n\r\n builder.append(\"<b>Config details :</b><br/>\");\r\n builder.append(\"<b>hub launched with :</b>\");\r\n builder.append(tmp.hubConfig);\r\n\r\n\r\n builder.append(\"<br/><b>the final configuration comes from :</b><br/>\");\r\n builder.append(\"<b>the default :</b><br/>\");\r\n builder.append(prettyHtmlPrint(tmp));\r\n\r\n builder.append(prettyHtmlPrint(tmp));\r\n }\r\n return builder.toString();\r\n }", "public String getAuditXml();", "public java.lang.String toString() {\n // call toString() with includeNS true by default and declareNS false\n String xml = this.toString(true, false);\n return xml;\n }", "org.apache.xmlbeans.XmlString xgetSaltData();", "public java.lang.String getRequestXml(){\n return localRequestXml;\n }", "public java.lang.String getRequestXml(){\n return localRequestXml;\n }", "public java.lang.String getRequestXml(){\n return localRequestXml;\n }", "public java.lang.String getRequestXml(){\n return localRequestXml;\n }", "public java.lang.String getRequestXml(){\n return localRequestXml;\n }", "public java.lang.String getRequestXml(){\n return localRequestXml;\n }", "public java.lang.String getRequestXml(){\n return localRequestXml;\n }", "public java.lang.String getRequestXml(){\n return localRequestXml;\n }", "public java.lang.String getRequestXml(){\n return localRequestXml;\n }", "public String toXML()\n\t{\n\t\treturn toXML(0);\n\t}", "public String toXML()\n\t{\n\t\treturn toXML(0);\n\t}", "private String toXML(){\n\tString buffer = \"<xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\">\\n\";\n\tfor(Room[] r : rooms)\n\t for(Room s : r)\n\t\tif(s != null)\n\t\t buffer += s.toXML();\n\tbuffer += \"</xml>\";\n\treturn buffer;\n }", "@GET\r\n @Produces(\"application/xml\")\r\n public String getXml() {\r\n //TODO return proper representation object\r\n throw new UnsupportedOperationException();\r\n }", "ArrayList<ArrayList<String>> get_config(){\n return config_file.r_wartosci();\n }", "public String createConfigXml(WebMailConfig config) throws ApsSystemException {\n \t\tElement root = new Element(ROOT);\n \t\ttry {\n \t\t\tif (config.getLocalhost() != null && config.getLocalhost().trim().length() > 0) {\n \t\t\t\tElement localhostElem = new Element(LOCALHOST_ELEM);\n \t\t\t\tlocalhostElem.addContent(config.getLocalhost().trim());\n \t\t\t\troot.addContent(localhostElem);\n \t\t\t}\n \t\t\tif (config.getDomainName() != null && config.getDomainName().trim().length() > 0) {\n \t\t\t\tElement domainElem = new Element(DOMAIN_ELEM);\n \t\t\t\tdomainElem.addContent(new CDATA(config.getDomainName()));\n \t\t\t\troot.addContent(domainElem);\n \t\t\t}\n \t\t\t\n \t\t\tElement certificatesElem = new Element(CERTIFICATES_ELEM);\n \t\t\tElement enableElem = new Element(CERTIFICATES_ENABLE_CHILD);\n \t\t\tenableElem.addContent(String.valueOf(config.isCertificateEnable()));\n \t\t\tcertificatesElem.addContent(enableElem);\n \t\t\tElement lazyCheckElem = new Element(CERTIFICATES_LAZYCHECK_CHILD);\n \t\t\tlazyCheckElem.addContent(String.valueOf(config.isCertificateLazyCheck()));\n \t\t\tcertificatesElem.addContent(lazyCheckElem);\n \t\t\tElement certPathElem = new Element(CERTIFICATES_CERTPATH_CHILD);\n \t\t\tcertPathElem.addContent(new CDATA(config.getCertificatePath()));\n \t\t\tcertificatesElem.addContent(certPathElem);\n \t\t\tElement debugOnConsoleElem = new Element(CERTIFICATES_DEBUGONCONSOLE_CHILD);\n \t\t\tdebugOnConsoleElem.addContent(String.valueOf(config.isCertificateDebugOnConsole()));\n \t\t\tcertificatesElem.addContent(debugOnConsoleElem);\n \t\t\troot.addContent(certificatesElem);\n \t\t\t\n \t\t\tElement imapElem = new Element(IMAP_ELEM);\n \t\t\tElement imapHostElem = new Element(IMAP_HOST_CHILD);\n \t\t\timapHostElem.addContent(new CDATA(config.getImapHost()));\n \t\t\timapElem.addContent(imapHostElem);\n \t\t\tElement imapProtocolElem = new Element(IMAP_PROTOCOL_CHILD);\n \t\t\timapProtocolElem.addContent(config.getImapProtocol());\n \t\t\timapElem.addContent(imapProtocolElem);\n \t\t\tElement imapPortElem = new Element(IMAP_PORT_CHILD);\n \t\t\tInteger imapPort = config.getImapPort();\n \t\t\timapPortElem.addContent(imapPort==null ? \"\" : imapPort.toString());\n \t\t\timapElem.addContent(imapPortElem);\n \t\t\troot.addContent(imapElem);\n \t\t\t\n \t\t\tElement smtpElem = new Element(SMTP_ELEM);\n \t\t\tsmtpElem.setAttribute(SMTP_DEBUG_ATTR, String.valueOf(config.isDebug()));\n \t\t\tsmtpElem.setAttribute(SMTP_JAPS_USER_AUTH_ATTR, String.valueOf(config.isSmtpJapsUserAuth()));\n \t\t\tElement smtpHostElem = new Element(IMAP_HOST_CHILD);\n \t\t\tsmtpHostElem.addContent(new CDATA(config.getSmtpHost()));\n \t\t\tsmtpElem.addContent(smtpHostElem);\n \t\t\tElement smtpUserElem = new Element(SMTP_USER_CHILD);\n \t\t\tsmtpUserElem.addContent(config.getSmtpUserName());\n \t\t\tsmtpElem.addContent(smtpUserElem);\n \t\t\tElement smtpPasswordElem = new Element(SMTP_PASSWORD_CHILD);\n \t\t\tsmtpPasswordElem.addContent(config.getSmtpPassword());\n \t\t\tsmtpElem.addContent(smtpPasswordElem);\n \t\t\tElement smtpPortElem = new Element(SMTP_PORT_CHILD);\n \t\t\tInteger smtpPort = config.getSmtpPort();\n \t\t\tsmtpPortElem.addContent(smtpPort==null ? \"\" : smtpPort.toString());\n \t\t\tsmtpElem.addContent(smtpPortElem);\n \t\t\troot.addContent(smtpElem);\n \t\t\t\n \t\t\tElement folderElem = new Element(FOLDER_ELEM);\n \t\t\tElement trashFolderElem = new Element(FOLDER_TRASH_CHILD);\n \t\t\ttrashFolderElem.addContent(config.getTrashFolderName());\n \t\t\tfolderElem.addContent(trashFolderElem);\n \t\t\tElement sentFolderElem = new Element(FOLDER_SENT_CHILD);\n \t\t\tsentFolderElem.addContent(config.getSentFolderName());\n \t\t\tfolderElem.addContent(sentFolderElem);\n \t\t\troot.addContent(folderElem);\n \t\t} catch (Throwable t) {\n \t\t\tApsSystemUtils.logThrowable(t, this, \"createConfigXml\");\n \t\t\tthrow new ApsSystemException(\"Error creating config\", t);\n \t\t}\n \t\tDocument doc = new Document(root);\n\t\tXMLOutputter out = new XMLOutputter();\n\t\tFormat format = Format.getPrettyFormat();\n\t\tformat.setIndent(\"\\t\");\n\t\tout.setFormat(format);\n\t\treturn out.outputString(doc);\n \t}", "public String getStringConfiguration()\r\n\t{\r\n\t\treturn config;\r\n\t}", "@GET\r\n @Produces(MediaType.APPLICATION_XML)\r\n public String getXml() {\r\n //TODO return proper representation object\r\n throw new UnsupportedOperationException();\r\n }", "@GET\r\n @Produces(MediaType.APPLICATION_XML)\r\n public String getXml() {\r\n //TODO return proper representation object\r\n throw new UnsupportedOperationException();\r\n }", "@GET\n @Produces(MediaType.APPLICATION_XML)\n \n public String getXml() {\n \n return \"<gps_data>\"\n + \"<gps_id>1</gps_id>\"\n + \"<gps_coord>107,-40</gps_coord>\"\n + \"<gps_time>12:00</gps_time>\"\n + \"</gps_data>\";\n }", "public String toString() {\r\n\t\treturn configurationFileString;\r\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tpublic String getTOLookupsAsXML() {\r\n ITransferObject to = getController().getTo();\r\n\t\ttry {\t\t\r\n\t if (to != null) {\t\t\t\r\n\t \tMap<String, Object> map = getToMap(to, getAlias());\r\n\t \treturn LookupUtils.getResponseXML( map, getIds() );\r\n\t }\r\n\t\t} catch (Throwable th) {\r\n\t\t\tLOGGER.severe(th.getMessage());\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}", "public String configString() {\n return this.configString;\n }", "@GET\n @Produces(MediaType.APPLICATION_XML)\n public String getXml() {\n //TODO return proper representation object\n throw new UnsupportedOperationException();\n }", "public String getStringConfiguration() {\n\t\treturn config;\n\t}", "@Override\n public String toString()\n {\n StringBuilder sb = new StringBuilder();\n sb.append(\"<Merchant \");\n IContentGenerator dbaGenerator = m_pciMerchant.getDBAGenerator();\n IContentGenerator otherIndustriesGenerator = m_pciMerchant.getOtherIndustriesGenerator();\n sb.append(\"acquirer-relationship=\\\"\");\n sb.append(StringUtils.xmlEscape(m_pciMerchant.getAcquirerRelationship()));\n sb.append(\"\\\" agent-relationship=\\\"\");\n sb.append(StringUtils.xmlEscape(m_pciMerchant.getAgentRelationship()));\n sb.append(\"\\\" ecommerce=\\\"\");\n sb.append(StringUtils.xmlEscape(m_pciMerchant.getECommerce()));\n sb.append(\"\\\" grocery=\\\"\");\n sb.append(StringUtils.xmlEscape(m_pciMerchant.getGrocery()));\n sb.append(\"\\\" mail-order=\\\"\");\n sb.append(StringUtils.xmlEscape(m_pciMerchant.getMailOrder()));\n sb.append(\"\\\" payment-application=\\\"\");\n sb.append(StringUtils.xmlEscape(m_pciMerchant.getPaymentApplication()));\n sb.append(\"\\\" payment-version=\\\"\");\n sb.append(StringUtils.xmlEscape(m_pciMerchant.getPaymentVersion()));\n sb.append(\"\\\" petroleum=\\\"\");\n sb.append(StringUtils.xmlEscape(m_pciMerchant.getPetroleum()));\n sb.append(\"\\\" retail=\\\"\");\n sb.append(StringUtils.xmlEscape(m_pciMerchant.getRetail()));\n sb.append(\"\\\" telecommunication=\\\"\");\n sb.append(StringUtils.xmlEscape(m_pciMerchant.getTelecommunication()));\n sb.append(\"\\\" travel=\\\"\");\n sb.append(StringUtils.xmlEscape(m_pciMerchant.getTravel()));\n sb.append(\"\\\" company=\\\"\");\n sb.append(StringUtils.xmlEscape(m_pciMerchant.getCompany()));\n sb.append(\"\\\" email-address=\\\"\");\n sb.append(StringUtils.xmlEscape(m_pciMerchant.getEmailAddress()));\n sb.append(\"\\\" first-name=\\\"\");\n sb.append(StringUtils.xmlEscape(m_pciMerchant.getFirstName()));\n sb.append(\"\\\" last-name=\\\"\");\n sb.append(StringUtils.xmlEscape(m_pciMerchant.getLastName()));\n sb.append(\"\\\" phone-number=\\\"\");\n sb.append(StringUtils.xmlEscape(m_pciMerchant.getPhoneNumber()));\n sb.append(\"\\\" title=\\\"\");\n sb.append(StringUtils.xmlEscape(m_pciMerchant.getTitle()));\n sb.append(\"\\\">\");\n ContactAddress address = m_pciMerchant.getAddress();\n if (address != null)\n {\n sb.append(\"<Address city=\\\"\");\n sb.append(StringUtils.xmlEscape(address.getCity()));\n sb.append(\"\\\" country=\\\"\");\n sb.append(StringUtils.xmlEscape(address.getCountry()));\n sb.append(\"\\\" line1=\\\"\");\n sb.append(StringUtils.xmlEscape(address.getLine1()));\n sb.append(\"\\\" line2=\\\"\");\n sb.append(StringUtils.xmlEscape(address.getLine2()));\n sb.append(\"\\\" state=\\\"\");\n sb.append(StringUtils.xmlEscape(address.getState()));\n sb.append(\"\\\" zip=\\\"\");\n sb.append(StringUtils.xmlEscape(address.getZip()));\n sb.append(\"\\\"/>\");\n }\n if (dbaGenerator != null)\n {\n sb.append(dbaGenerator.toString());\n }\n if (otherIndustriesGenerator != null)\n {\n sb.append(otherIndustriesGenerator.toString());\n }\n sb.append(\"</Merchant>\");\n return sb.toString();\n }", "@Override\n public String toString() {\n\n // Add schema location attribute\n this.addSchemaLocation(\"http://www.w3.org/2001/XMLSchema-instance\", \"schemaLocation\", \"xsi\",\n \"http://xsd.sepamail.eu/1206/ xsd/sepamail_missive.xsd \");\n\n // XML options instance\n XmlOptions options = new XmlOptions();\n\n // Set the properties of the XML options\n options.setSavePrettyPrint();\n options.setSaveSuggestedPrefixes(this.suggestedPrefixes);\n options.setUseCDataBookmarks();\n\n try {\n\n // Build XML document using the constructed XML object\n SAXBuilder sxb = new SAXBuilder();\n Document xmlDocument =\n sxb.build(new InputStreamReader(new ByteArrayInputStream(missiveDocument.xmlText(options).getBytes()),\n \"UTF-8\"));\n\n // Pretty print the XML document\n XMLOutputter xmlOutputter = new XMLOutputter(Format.getPrettyFormat());\n ByteArrayOutputStream output = new ByteArrayOutputStream();\n xmlOutputter.output(xmlDocument, output);\n\n // String with XML content\n return new String(output.toByteArray());\n\n } catch ( JDOMException | IOException ex) {\n\n // TODO: error logging\n System.out.println(ex.getMessage());\n }\n\n return null;\n }", "@Override\n public String toXML() {\n if (_xml == null)\n _xml = String.format(XML, getStanzaId(), to);\n return _xml;\n }", "@Override\n public void toXml(XmlContext xc) {\n\n }", "public String generateXML() \n { \n \n String xml = new String();\n \n String nodetype = new String();\n if (type.equals(\"internal\")){\n nodetype = \"INTERNAL\"; //change this for change in XML node name\n }\n else {\n nodetype = \"LEAF\"; //change this for change in XML node name\n }\n \n xml = \"<\" + nodetype;\n if (!name.equals(\"\")){\n xml = xml + \" name = \\\"\" + name + \"\\\"\";\n }\n if (length >0){\n xml = xml + \" length = \\\"\" + length + \"\\\"\";\n }\n //Section below tests tree size and depths\n // if (level > 0){\n // xml = xml + \" level = \\\"\" + level + \"\\\"\";\n // }\n //if (depth > 0){\n // xml = xml + \" depth = \\\"\" + depth + \"\\\"\";\n //}\n //if (newicklength > 0){\n // xml = xml + \" newicklength = \\\"\" + newicklength + \"\\\"\";\n //}\n // if (treesize > 0){\n // xml = xml + \" treesize = \\\"\" + treesize + \"\\\"\";\n //}\n //if (startxcoord >= 0){\n // xml = xml + \" startx = \\\"\" + startxcoord + \"\\\"\";\n //}\n //if (endxcoord >= 0){\n // xml = xml + \" endx = \\\"\" + endxcoord + \"\\\"\";\n //}\n //Test section done\n xml = xml + \">\";\n \n if (!children.isEmpty()){ //if there are children in this node's arraylist\n Iterator it = children.iterator();\n while(it.hasNext()){\n Node child = (Node) it.next();\n xml = xml + child.generateXML(); //The recursive coolness happens here!\n }\n }\n xml = xml + \"</\" + nodetype + \">\";\n \n return xml;\n }", "public String getModuleInfo () {\n\t\treturn \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><D2K> <Info common=\\\"Prepare Data Module\\\"> <Text>This forms the training data from ranked individuals and the testing data from unranked indivs for Model (Decision Trees). </Text> </Info></D2K>\";\n\t}", "public String getInXml() {\n return inXml;\n }", "public String toXML(int indent) {\n StringBuffer xmlBuf = new StringBuffer();\n //String xml = \"\";\n \n synchronized(xmlBuf) {\n\t\tfor (int i=0;i<indent;i++)\n xmlBuf.append(\"\\t\");\n //xml += \"\\t\";\n\n\t\tString synopsisLengthAsString;\n\n\t\tswitch(length)\n\t\t{\n\t\t\tcase UNDEFINED:\n\t\t\t\tsynopsisLengthAsString = \"undefined\";\n\t\t\t\tbreak;\n\t\t\tcase SHORT:\n\t\t\t\tsynopsisLengthAsString = \"short\";\n\t\t\t\tbreak;\n\t\t\tcase MEDIUM:\n\t\t\t\tsynopsisLengthAsString = \"medium\";\n\t\t\t\tbreak;\n\t\t\tcase LONG:\n\t\t\t\tsynopsisLengthAsString = \"long\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tsynopsisLengthAsString = \"undefined\";\n\t\t\t\tbreak;\n\t\t}\n\n\t\txmlBuf.append(\"<Synopsis\");\n //xml += \"<Synopsis\";\n if (length!=UNDEFINED) {\n xmlBuf.append(\" length=\\\"\");\n xmlBuf.append(synopsisLengthAsString);\n xmlBuf.append(\"\\\"\");\n //xml = xml + \" length=\\\"\"+ synopsisLengthAsString + \"\\\"\";\n }\n if (language!=null) {\n xmlBuf.append(\" xml:lang=\\\"\");\n xmlBuf.append(language);\n xmlBuf.append(\"\\\"\");\n //xml = xml + \" xml:lang=\\\"\" + language + \"\\\"\";\n }\n xmlBuf.append(\">\");\n //xml += \">\";\n\t\txmlBuf.append(\"<![CDATA[\");\n xmlBuf.append(text);\n xmlBuf.append(\"]]>\");\n //xml = xml + \"<![CDATA[\" + text + \"]]>\";\n xmlBuf.append(\"</Synopsis>\");\n //xml += \"</Synopsis>\";\n\n\t\treturn xmlBuf.toString();\n }\n\t}", "@Override\n public String getXmlDocument( HttpServletRequest request )\n {\n return XmlUtil.getXmlHeader( ) + getXml( request );\n }", "abstract protected String getOtherXml();", "public String printToXml()\n {\n XMLOutputter outputter = new XMLOutputter();\n outputter.setFormat(org.jdom.output.Format.getPrettyFormat());\n return outputter.outputString(this.toXml());\n }", "public String generarMuestraDatosXML() {\r\n\r\n\t\tDocument doc = new Document();\r\n\t\tElement datosClearQuest = new Element(\"datosClearQuest\");\r\n\t\tdoc.setRootElement(datosClearQuest);\r\n\t\t\r\n\t\tgenerarConexion(datosClearQuest);\r\n\t\tgenerarLote(datosClearQuest);\r\n\r\n\t\treturn convertXMLToString(doc);\r\n\t}", "Element toXML();" ]
[ "0.72542834", "0.65799755", "0.6473544", "0.64155346", "0.63603956", "0.6350907", "0.6306807", "0.6287409", "0.6249692", "0.6226686", "0.62238985", "0.6202807", "0.6202807", "0.6202807", "0.61978114", "0.6175854", "0.6154168", "0.6142442", "0.61216164", "0.61091167", "0.60918725", "0.60895115", "0.6069958", "0.6068225", "0.6004564", "0.5928259", "0.59089744", "0.5878072", "0.58734405", "0.58580774", "0.5851866", "0.58353955", "0.581916", "0.58114", "0.58069", "0.5771927", "0.5747237", "0.5733426", "0.5733426", "0.5733426", "0.5733426", "0.5733426", "0.5733426", "0.5733426", "0.5733426", "0.5733426", "0.5733426", "0.5733426", "0.5720462", "0.57147765", "0.56963897", "0.5675253", "0.56628275", "0.5649133", "0.5648646", "0.56463844", "0.56325865", "0.5624715", "0.56222767", "0.55963814", "0.5580609", "0.55719", "0.55624205", "0.556073", "0.55589926", "0.55589926", "0.55589926", "0.55589926", "0.55589926", "0.55589926", "0.55589926", "0.55589926", "0.55589926", "0.555553", "0.555553", "0.5550982", "0.5550531", "0.5543884", "0.55393964", "0.55344284", "0.5532726", "0.5532726", "0.5532685", "0.5527262", "0.5517349", "0.5492293", "0.54835194", "0.54658973", "0.5457537", "0.54531175", "0.5449885", "0.54478914", "0.54422045", "0.544193", "0.5434291", "0.54211926", "0.53935105", "0.5392776", "0.53911555", "0.53887224", "0.53804046" ]
0.0
-1
set up a temp file
public File writeBackFileToDvn(RConnection c, String targetFilename, String tmpFilePrefix, String tmpFileExt, int fileSize){ File tmprsltfl = null; String resultFilePrefix = tmpFilePrefix + PID + "."; String rfsffx = "." + tmpFileExt; RFileInputStream ris = null; OutputStream outbr = null; try { tmprsltfl = File.createTempFile(resultFilePrefix, rfsffx); //outbr = new FileOutputStream(tmprsltfl); outbr = new BufferedOutputStream(new FileOutputStream(tmprsltfl)); //File tmp = new File(targetFilename); //long tmpsize = tmp.length(); // open the input stream ris = c.openFile(targetFilename); if (fileSize < 1024*1024*500){ int bfsize = fileSize +1; byte[] obuf = new byte[bfsize]; ris.read(obuf); //while ((obufsize =)) != -1) { outbr.write(obuf, 0, bfsize); //} } ris.close(); outbr.close(); return tmprsltfl; } catch (FileNotFoundException fe){ fe.printStackTrace(); dbgLog.fine("FileNotFound exception occurred"); return tmprsltfl; } catch (IOException ie){ ie.printStackTrace(); dbgLog.fine("IO exception occurred"); } finally { if (ris != null){ try { ris.close(); } catch (IOException e){ } } if (outbr != null){ try { outbr.close(); } catch (IOException e){ } } } return tmprsltfl; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setTmpFile(File tmpFile) {\n this.tmpFile = tmpFile;\n }", "private static File createTempDir() {\n\t\tFile baseDir = new File(\"/opt/tomcat7/temp\");\r\n\t\tString baseName = \"omicseq-TempStorage\" + \"-\";\r\n\r\n\t\tfor (int counter = 0; counter < 10000; counter++) {\r\n\t\t\tFile tempDir = new File(baseDir, baseName + counter);\r\n\t\t\tif (!tempDir.exists()) {\r\n\t\t\t\tif (tempDir.mkdir())\r\n\t\t\t\t\treturn tempDir;\r\n\t\t\t} else\r\n\t\t\t\treturn tempDir;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "String createTempFile(String text,String filename) {\r\n\t\tString tmpDirectory = Configuration.getConfiguration().getMpdTmpSubDir();\r\n\t\tif(!tmpDirectory.endsWith(java.io.File.separator)) {\r\n\t\t\ttmpDirectory += java.io.File.separator;\r\n\t\t}\r\n\t\tconvert(text,Configuration.getConfiguration().getMpdFileDirectory(),tmpDirectory+filename);\r\n\t\t\r\n\t\treturn tmpDirectory+filename;\r\n\t}", "public static File createTempFile() throws Exception {\n File dir = tempFileDirectory();\n dir.mkdirs();\n File tempFile = File.createTempFile(\"tst\", null, dir);\n dir.deleteOnExit(); // Not fail-safe on android )¬;\n return tempFile;\n }", "public final void setTemporaryFile(String tempFile) {\n\t\tm_tempFile = tempFile;\n\t}", "public void setTempPath(String tempPath) {\n this.tempPath = tempPath;\n }", "public static void createTempMapsetName() {\r\n UUID id;\r\n String tmpPrefix;\r\n String tmpSuffix;\r\n String tmpBase;\r\n String tmpFolder;\r\n\r\n id = UUID.randomUUID();\r\n tmpPrefix = new String(GrassUtils.TEMP_PREFIX);\r\n tmpSuffix = new String(\"_\" + id);\r\n tmpBase = new String(System.getProperty(\"java.io.tmpdir\"));\r\n if (tmpBase.endsWith(File.separator)) {\r\n tmpFolder = new String(tmpBase + tmpPrefix + tmpSuffix.replace('-', '_') + File.separator + \"user\");\r\n }\r\n else {\r\n tmpFolder = new String(tmpBase + File.separator + tmpPrefix + tmpSuffix.replace('-', '_') + File.separator + \"user\");\r\n }\r\n m_sGrassTempMapsetFolder = tmpFolder;\r\n\r\n }", "@BeforeClass\n public static void setup() {\n logger.info(\"setup: creating a temporary directory\");\n\n // create a directory for temporary files\n directory = new File(UUID.randomUUID().toString());\n directory.mkdir();\n }", "private TempTable createTempTable() throws Exception{\n\t\treturn new TempTableFile();\n\t}", "private File createTempFile(TransferSongMessage message)\n throws IOException {\n File outputDir = MessagingService.this.getCacheDir(); // context being the Activity pointer\n String filePrefix = UUID.randomUUID().toString().replace(\"-\", \"\");\n int inx = message.getSongFileName().lastIndexOf(\".\");\n String extension = message.getSongFileName().substring(inx + 1);\n File outputFile = File.createTempFile(filePrefix, extension, outputDir);\n return outputFile;\n }", "private File createTempFile(WorkDirectory workDir, BackupPolicy backupPolicy)\n throws IOException {\n int MAX_TRIES = 100; // absurdly big limit, but a limit nonetheless\n for (int i = 0; i < MAX_TRIES; i++) {\n File tempFile = new File(resultsFile.getPath() + \".\" + i + \".tmp\");\n if (tempFile.createNewFile()) {\n return tempFile;\n }\n }\n throw new IOException(\"could not create temp file for \" + resultsFile + \": too many tries\");\n }", "private void saveTempFile(DigitalObject object) {\n String tempFileName = tempDir.getAbsolutePath() + \"/\" + System.nanoTime();\n OutputStream fileStream;\n try {\n fileStream = new BufferedOutputStream(new FileOutputStream(tempFileName));\n if (object != null) {\n byte[] data = object.getData().getData();\n if (data != null) {\n\n fileStream.write(data);\n }\n }\n fileStream.close();\n tempFiles.put(object, tempFileName);\n } catch (FileNotFoundException e) {\n log.error(\"Failed to store tempfile\", e);\n } catch (IOException e) {\n log.error(\"Failed to store tempfile\", e);\n }\n }", "public boolean setTempFile() {\n try {\n tempFile = File.createTempFile(CleanupThread.DOWNLOAD_FILE_PREFIX_PR, FileExt);\n Log.getInstance().write(Log.LOGLEVEL_TRACE, \"RecordingEpisode.setTempFile: \" + tempFile.getAbsolutePath());\n } catch (IOException e) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.setTempFile: Exception creating tempfile. \" + e.getMessage());\n return false;\n }\n\n if (tempFile==null || !(tempFile instanceof File)) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.setTempFile: Failed to create valid tempFile.\");\n return false;\n }\n\n return true;\n }", "public interface TempFileManager {\n\n\t\tvoid clear();\n\n\t\tpublic TempFile createTempFile(String filename_hint) throws Exception;\n\t}", "private File createTempFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n File albumF = getAlbumDir();\n File mediaF = null;\n\n profile = IMG_FILE_PREFIX + timeStamp+\"_\";\n mediaF = File.createTempFile(profile, IMG_FILE_SUFFIX, albumF);\n\n return mediaF;\n }", "public static String setup(Task task) {\n\t\tString localTemp = task.getTaskType() + \"_\" + task.getTaskId();\n\t\ttry {\n\t\t\tFileUtils.forceMkdir(new File(localTemp));\n\t\t} catch (IOException e) {\n\t\t\tlogger.error(\"Exception occoured while creating local temporary directory \\n\" + e.getLocalizedMessage());\n\t\t\tstate.setErrCode(state.getTsk() == TaskType.MAP_TASK ? ERR_CODE.EXCEPTION_CREATING_TEMP_DIR_MAP\n\t\t\t : ERR_CODE.EXCEPTION_CREATING_TEMP_DIR_REDUCE);\n\t\t}\n\t\treturn localTemp;\n\t}", "private void setUp() {\n if (tempDir != null) {\n tearDown();\n }\n tempDir = new File(OS.getTmpPath() + \"imagecompare\" + System.nanoTime());\n tempDir.mkdir();\n tempDir.deleteOnExit();\n tempFiles.clear();\n log.debug(\"using temp directory \" + tempDir.getAbsolutePath());\n\n }", "public static void createTempFileForLinux() throws IOException {\n Path path = Files.createTempFile(\"temp_linux_file\", \".txt\",\n PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString(\"rw-------\")));\n System.out.println(\"Path is : \" + path.toFile().getAbsolutePath());\n }", "public static File CreateTempFile(String fileName, String resourcePath) throws IOException {\n \n /*if (tempDirectoryPath == null) {\n tempDirectoryPath = Files.createTempDirectory(null);\n System.getSecurityManager().checkDelete(tempDirectoryPath.toFile().toString());\n System.out.println(\"Temp path: \" + tempDirectoryPath);\n System.out.println(\"Temp path: \" + tempDirectoryPath.toString());\n System.out.println(\"Temp path: \" + tempDirectoryPath.toFile().toString());\n }*/\n \n File tempFile = null;\n InputStream input = null;\n OutputStream output = null;\n \n try {\n // Create temporary file\n //tempFile = File.createTempFile(tempDirectoryPath.getFileName() + File.separator + fileName , null);\n //System.out.println(\"Temp file: \" + tempFile);\n tempFile = File.createTempFile(filePrefix + fileName , null);\n tempFile.setReadable(false , false);\n tempFile.setReadable(true , true);\n tempFile.setWritable(true , true);\n tempFile.setExecutable(true , true);\n tempFile.deleteOnExit();\n \n // Read resource and write to temp file\n output = new FileOutputStream(tempFile);\n if (resourcePath != null) {\n input = Main.class.getClassLoader().getResourceAsStream(resourcePath);\n\n byte[] buffer = new byte[1024];\n int read;\n\n if (input == null) {\n Logger.log(\"Resource '\" + fileName + \"' at '\" + resourcePath + \"' not available!\");\n } else {\n while ((read = input.read(buffer)) != -1) {\n output.write(buffer , 0 , read);\n }\n }\n }\n } catch (IOException ex) {\n throw(ex);\n } finally {\n close(input);\n close(output);\n }\n return tempFile;\n }", "public interface TempFile {\n\n\t\tpublic void delete() throws Exception;\n\n\t\tpublic String getName();\n\n\t\tpublic OutputStream open() throws Exception;\n\t}", "public static Path createSimpleTmpFile( final Configuration conf, boolean deleteOnExit ) throws IOException\r\n\t{\r\n\t\t/** Make a temporary File, delete it, mark the File Object as delete on exit, and create the file with data using hadoop utils. */\r\n\t\tFile localTempFile = File.createTempFile(\"tmp-file\", \"tmp\");\r\n\t\tlocalTempFile.delete();\r\n\t\tPath localTmpPath = new Path( localTempFile.getName());\r\n\t\t\r\n\t\tcreateSimpleFile(conf, localTmpPath, localTmpPath.toString());\r\n\t\tif (deleteOnExit) {\r\n\t\t\tlocalTmpPath.getFileSystem(conf).deleteOnExit(localTmpPath);\r\n\t\t}\r\n\t\treturn localTmpPath;\r\n\t}", "private static File prepareTempFolder() {\n File result;\n try {\n result = java.nio.file.Files.createTempDirectory(\n DCOSService.class.getSimpleName()).toFile();\n System.out.println(result.toString());\n\n return result;\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "private void init() {\n\n DateFormat dateFormatter = new SimpleDateFormat(\"YYYY_MM_dd-HH_mm_ss_SSS\");\n String timeString = dateFormatter.format(new Date(System.currentTimeMillis()));\n urlsFile = new File(\"urls_\" + timeString + \".txt\");\n emailsFile = new File(\"emails_\" + timeString + \".txt\");\n\n try {\n urlsFile.createNewFile();\n emailsFile.createNewFile();\n urlsWriter = new PrintWriter(urlsFile.getPath(), \"UTF-8\");\n emailsWriter = new PrintWriter(emailsFile.getPath(), \"UTF-8\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public void newFile(int temp) {\n if(!doesExist(temp)){\n System.out.println(\"The Directory does not exist \");\n return;\n }\n\n directory nodeptr = root;\n for(int count = 0; count < temp; count++) {\n nodeptr = nodeptr.forward;\n }\n int space = nodeptr.f.createFile(nodeptr.count);\n nodeptr.count++;\n nodeptr.availableSpace = 512 - space;\n\n }", "public TorrentState() {\n tempDir = System.getProperty(property) + \"AStreamOfTorrents\";\n }", "public File getTmpFile() {\n return tmpFile;\n }", "public void init(String tmpInputFile)\r\n {\n readFile(tmpInputFile);\r\n writeInfoFile();\r\n }", "@Test\n\tpublic void testUsingTempFolder1() throws IOException {\n\t\tFile createdFile= temp.newFile(\"mytestfile.html\");\n\t\t\n\t\t// construct temp(test) html file\n\t\tString content = \"<title>This is title</title>\";\n\t\t\n\t\tPrintStream ps = new PrintStream(new FileOutputStream(createdFile));\n\t\tps.println(content); \n\t\t// what I think it should be\n\t\tString res = \"This is title\"; \n\n\t\t// what actually it is\n\t\tString result = extractTitleModule.WebPageExtraction(createdFile);\n\t\tassertEquals(res,result); \n\t}", "static File createTempImageFile(Context context)\n throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\",\n Locale.getDefault()).format(new Date());\n String imageFileName = \"AZTEK\" + timeStamp + \"_\";\n\n globalImageFileName = imageFileName;\n\n File storageDir = context.getExternalCacheDir();\n\n return File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n }", "File createFile(String name) throws IOException {\n File storageFile = File.createTempFile(FILE_PREFIX + name + \"_\", null, this.subDirectories[fileCounter.getAndIncrement()&(this.subDirectories.length-1)]); //$NON-NLS-1$\n if (LogManager.isMessageToBeRecorded(org.teiid.logging.LogConstants.CTX_BUFFER_MGR, MessageLevel.DETAIL)) {\n LogManager.logDetail(org.teiid.logging.LogConstants.CTX_BUFFER_MGR, \"Created temporary storage area file \" + storageFile.getAbsoluteFile()); //$NON-NLS-1$\n }\n return storageFile;\n }", "public TempFileGenerator(String nameBase, String nameSuffix) throws SOAPIException\r\n {\r\n try{\r\n properties = new Properties(); \r\n properties.load(getClass().getClassLoader().getResourceAsStream(\"soapi.properties\"));\r\n dir = properties.getProperty(\"tempDirectory\"); \r\n }\r\n catch(Exception e)\r\n {\r\n throw new SOAPIException(e);\r\n }\r\n \r\n if (!(new File(dir)).isDirectory()) \r\n dir = \"\";\r\n if (dir == null)\r\n dir = \"\";\r\n init(nameBase, nameSuffix);\r\n }", "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 }", "private static File generateTemp(Path path) {\n File tempFile = null;\n try {\n InputStream in = Files.newInputStream(path);\n String tDir = System.getProperty(\"user.dir\") + File.separator + ASSETS_FOLDER_TEMP_NAME;\n tempFile = new File(tDir + File.separator + path.getFileName());\n try (FileOutputStream out = new FileOutputStream(tempFile)) {\n IOUtils.copy(in, out);\n }\n album.addToImageList(tempFile.getAbsolutePath());\n } catch (Exception e) {\n e.printStackTrace();\n }\n return tempFile;\n }", "public void exitTemp() {\r\n tr.saveTempToFile(TemplateManager.IdToTemplate);\r\n }", "protected void createHMetisInFilePath() {\n\t\tString file = \"\";\n\t\tfile += this.getRuntimeEnv().getOptionValue(PTArgString.OUTPUTDIR);\n\t\tfile += Utils.getFileSeparator();\n\t\tfile += \"TEMP_GRAPH_FILE.hgr\";\n\t\tthis.setHMetisInFile(file);\n\t}", "private String getTmpPath() {\n return getExternalFilesDir(null).getAbsoluteFile() + \"/tmp/\";\n }", "public File makeTemporaryBAMFile() throws IOException{\n final File file = IOUtils.createTempFile(\"tempBAM\", \".bam\");\n return makeBAMFile(file);\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 }", "public static File writeObjectToTempFile(Serializable o, String filename)\n/* */ throws IOException\n/* */ {\n/* 76 */ File file = File.createTempFile(filename, \".tmp\");\n/* 77 */ file.deleteOnExit();\n/* 78 */ ObjectOutputStream oos = new ObjectOutputStream(new BufferedOutputStream(new GZIPOutputStream(new FileOutputStream(file))));\n/* 79 */ oos.writeObject(o);\n/* 80 */ oos.close();\n/* 81 */ return file;\n/* */ }", "private static void createTestFile(String path) throws IOException {\n\t\tFile file = new File(path);\n\t\tFileWriter writer = new FileWriter(file);\n\t\twriter.write(\"Jenkins Test : \"+new Date() + \" ==> Writing : \" + Math.random());\n\t\twriter.flush();\n\t\twriter.close();\n\t}", "@Test\n\tpublic void testUsingTempFolder2() throws IOException {\n\t\tFile createdFile1= temp.newFile(\"mytestfile.html\");\n\t\t\n\t\t// construct temp(test) html file\n\t\tString content = \"<title>This is title<title>\";\n\t\t\n\t\tPrintStream ps = new PrintStream(new FileOutputStream(createdFile1));\n\t\tps.println(content); \n\t\t// what I think it should be\n\t\tString res = null; \n\n\t\t// what actually it is\n\t\tString result = extractTitleModule.WebPageExtraction(createdFile1);\n\t\tassertEquals(res,result); \n\t}", "public void createStorageFile() throws IoDukeException {\n PrintWriter writer = null;\n try {\n writer = getStorageFile();\n } catch (IOException e) {\n throw new IoDukeException(\"Error opening task file for reading\");\n } finally {\n if (writer != null) {\n writer.close();\n }\n }\n }", "public static File createSmallFile() throws IOException{\n\t\tFile smallFile = File.createTempFile(\"TempFile\", \".txt\");\n\t\tsmallFile.deleteOnExit();\n\t\t\n\t\tWriter writer = new OutputStreamWriter(new FileOutputStream(smallFile));\n\t\twriter.write(\"0\");\n\t\twriter.close();\n\t\treturn smallFile;\n\t\t\t\t\n\t}", "private static Path saveTempFile(InputStream input) throws IOException {\n\t\tPath tempFile = Files.createTempFile(null, \".csv\");\n\t\tFiles.copy(input, tempFile, StandardCopyOption.REPLACE_EXISTING);\n\n\t\tinput.close();\n\n\t\t// TODO delete tempFile\n\t\treturn tempFile;\n\t}", "public static File createTemporaryCacheFile(CacheKey cacheKey) throws IOException {\n // Create a file in Java temp directory with cacheKey.toSting() as file name.\n\n File file = File.createTempFile(cacheKey.toString(), \".tmp\");\n if (null != file) {\n log.debug(\"Temp file created with the name - {}\", cacheKey.toString());\n }\n return file;\n }", "public static File getTempDirectory() {\r\n\t\treturn new File(System.getProperty(\"java.io.tmpdir\"));\r\n\t}", "public static void createTempMapset() throws IOException {\r\n\r\n final boolean bIsLatLon = new Boolean(SextanteGUI.getSettingParameterValue(SextanteGrassSettings.GRASS_LAT_LON_MODE)).booleanValue();\r\n final String tmpFolder = new String(getGrassMapsetFolder().substring(0, getGrassMapsetFolder().lastIndexOf(File.separator)));\r\n final boolean b = new File(tmpFolder).mkdir();\r\n new File(tmpFolder + File.separator + \"PERMANENT\").mkdir();\r\n new File(tmpFolder + File.separator + \"user\").mkdir();\r\n new File(tmpFolder + File.separator + \"PERMANENT\" + File.separator + \".tmp\").mkdir();\r\n writeGRASSWindow(tmpFolder + File.separator + \"PERMANENT\" + File.separator + \"DEFAULT_WIND\");\r\n new File(tmpFolder + File.separator + \"PERMANENT\" + File.separator + \"MYNAME\").createNewFile();\r\n try {\r\n final FileWriter fstream = new FileWriter(tmpFolder + File.separator + \"PERMANENT\" + File.separator + \"MYNAME\");\r\n final BufferedWriter out = new BufferedWriter(fstream);\r\n if (!bIsLatLon) {\r\n /* XY location */\r\n out.write(\"SEXTANTE GRASS interface: temporary x/y data processing location.\\n\");\r\n }\r\n else {\r\n /* lat/lon location */\r\n out.write(\"SEXTANTE GRASS interface: temporary lat/lon data processing location.\\n\");\r\n }\r\n out.close();\r\n }\r\n catch (final IOException e) {\r\n throw (e);\r\n }\r\n if (bIsLatLon) {\r\n new File(tmpFolder + File.separator + \"PERMANENT\" + File.separator + \"PROJ_INFO\").createNewFile();\r\n try {\r\n final FileWriter fstream = new FileWriter(tmpFolder + File.separator + \"PERMANENT\" + File.separator + \"PROJ_INFO\");\r\n final BufferedWriter out = new BufferedWriter(fstream);\r\n out.write(\"name: Latitude-Longitude\\n\");\r\n out.write(\"proj: ll\\n\");\r\n out.write(\"ellps: wgs84\\n\");\r\n out.close();\r\n }\r\n catch (final IOException e) {\r\n throw (e);\r\n }\r\n new File(tmpFolder + File.separator + \"PERMANENT\" + File.separator + \"PROJ_UNITS\").createNewFile();\r\n try {\r\n final FileWriter fstream = new FileWriter(tmpFolder + File.separator + \"PERMANENT\" + File.separator + \"PROJ_UNITS\");\r\n final BufferedWriter out = new BufferedWriter(fstream);\r\n out.write(\"unit: degree\\n\");\r\n out.write(\"units: degrees\\n\");\r\n out.write(\"meters: 1.0\\n\");\r\n out.close();\r\n }\r\n catch (final IOException e) {\r\n throw (e);\r\n }\r\n }\r\n writeGRASSWindow(tmpFolder + File.separator + \"PERMANENT\" + File.separator + \"WIND\");\r\n new File(tmpFolder + File.separator + \"user\" + File.separator + \"dbf\").mkdir();\r\n new File(tmpFolder + File.separator + \"user\" + File.separator + \".tmp\").mkdir();\r\n new File(tmpFolder + File.separator + \"user\" + File.separator + \"VAR\").createNewFile();\r\n try {\r\n final FileWriter fstream = new FileWriter(tmpFolder + File.separator + \"user\" + File.separator + \"VAR\");\r\n final BufferedWriter out = new BufferedWriter(fstream);\r\n out.write(\"DB_DRIVER: dbf\\n\");\r\n out.write(\"DB_DATABASE: $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/\\n\");\r\n out.close();\r\n }\r\n catch (final IOException e) {\r\n throw (e);\r\n }\r\n writeGRASSWindow(tmpFolder + File.separator + \"user\" + File.separator + \"WIND\");\r\n }", "protected void createHMetisOutFilePath() {\n\t\tString file = \"\";\n\t\tfile += \"TEMP_GRAPH_FILE.hgr.part.\";\n\t\tfile += this.getPartitioner().getPartition().getNumBlock();\n\t\tthis.setHMetisOutFile(file);\t\n\t}", "@Test\n public void testTempDirectory() {\n assertTrue(getTempDirPath().indexOf(File.separator\n\t+ \"TestSpringLockssTestCase\") > -1);\n assertTrue(getTempDirPath().endsWith(\".tmp\"));\n }", "public void create(int temp) {\n\n directory newFile = new directory();\n newFile.a = temp;\n\n directory FilePtr;\n\n\n if (root == null) {\n root = newFile;\n root.forward = null;\n root.back = null;\n return;\n }\n\n FilePtr = root;\n\n while (FilePtr.forward != null) {\n FilePtr = FilePtr.forward;\n }\n FilePtr.forward = newFile;\n FilePtr = FilePtr.forward;\n FilePtr.forward = null;\n\n return;\n\n }", "String prepareFile();", "public void makeSessionFile() {\n sessionData = new File(wnwData, \"session.dat\");\n try {\n sessionData.createNewFile();\n } catch (IOException e) {\n e.printStackTrace();\n }\n sessionData.setWritable(true);\n }", "public final String getTemporaryFile() {\n\t\treturn m_tempFile;\n\t}", "private void deleteTempHTMLFile()\n {\n File file = new File(\"resources/tempHTML\" +Thread.currentThread().getName() +\".html\");\n file.delete();\n }", "public static FileNode newTmpFile(FileNode parent) {\n FileNode file;\n\n while (true) {\n file = parent.join(\"_tmp_\" + tmpNo);\n try {\n file.mkfile();\n file.getWorld().onShutdown().deleteAtExit(file);\n return file;\n } catch (MkfileException e) {\n // continue\n tmpNo++;\n }\n }\n }", "public DiskBackedProjectFilePartSet() {\r\n // make two files to use\r\n fileA = TempFileUtil.createTemporaryFile();\r\n fileB = TempFileUtil.createTemporaryFile();\r\n }", "public File mo27424a(File file) throws IOException {\n return File.createTempFile(this.f17426b + \".\", \".tmp\", file);\n }", "public static Builder usingTempDir() throws IOException {\n File systemTempDir = FileUtils.getTempDirectory();\n return usingNewTempDirUnder(systemTempDir.toPath());\n }", "protected void fileSet() throws IOException {\n//\t\tfos = new FileOutputStream(outFile, false);\n//\t\tdos = new DataOutputStream(fos);\n\t\trealWriter = new BufferedWriter(new FileWriter(outFile.getAbsolutePath()));\n\t}", "private void deleteTempFiles() {\n\t\tfor (int i = 0; i < prevPrevTotalBuckets; i++) {\n\t\t\ttry {\n\t\t\t\tString filename = DatabaseCatalog.getInstance().getTempDirectory() + \"/\" + instanceHashcode + \"_\"\n\t\t\t\t\t\t+ (passNumber - 1) + \"_\" + i;\n\t\t\t\tFile file = new File(filename);\n\t\t\t\tfile.delete();\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "private final FileOutputStream zabz() {\n Serializable serializable = this.zalj;\n if (serializable == null) {\n serializable = new IllegalStateException(\"setTempDir() must be called before writing this object to a parcel\");\n throw serializable;\n }\n Object object = \"teleporter\";\n String string2 = \".tmp\";\n try {\n serializable = File.createTempFile((String)object, string2, (File)serializable);\n }\n catch (IOException iOException) {\n object = new IllegalStateException(\"Could not create temporary file\", iOException);\n throw object;\n }\n try {\n object = new FileOutputStream((File)serializable);\n int n10 = 0x10000000;\n string2 = ParcelFileDescriptor.open((File)serializable, (int)n10);\n this.zalg = string2;\n ((File)serializable).delete();\n return object;\n }\n catch (FileNotFoundException fileNotFoundException) {\n serializable = new IllegalStateException(\"Temporary file is somehow already deleted\");\n throw serializable;\n }\n }", "private String getTempFileString() {\n final File path = new File(getFlagStoreDir() + String.valueOf(lJobId) + File.separator);\n // // If this does not exist, we can create it here.\n if (!path.exists()) {\n path.mkdirs();\n }\n //\n return new File(path, Utils.getDeviceUUID(this)+ \".jpeg\")\n .getPath();\n }", "@BeforeEach\n public void setUp() throws IOException {\n logFiles = new ArrayList<>();\n logFiles.add(Paths.get(\"src/test/resources/logviewer-search-context-tests.log.test\"));\n logFiles.add(Paths.get(\"src/test/resources/logviewer-search-context-tests.log.gz\"));\n\n topoPath = Files.createTempDirectory(\"topoA\").toAbsolutePath().normalize();\n new File(topoPath.toFile(), \"6400\").createNewFile();\n new File(topoPath.toFile(), \"6500\").createNewFile();\n new File(topoPath.toFile(), \"6600\").createNewFile();\n new File(topoPath.toFile(), \"6700\").createNewFile();\n }", "private File getCameraTempFile() {\n\t\tFile dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM);\n\t\tFile output = new File(dir, SmartConstants.CAMERA_CAPTURED_TEMP_FILE);\n\n\t\treturn output;\n\t}", "public static File makeTempDir(String prefix){\n try {\n return Files.createTempDirectory(prefix).toFile();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "@Before\n public void setUpBeforeEachTest() throws IOException {\n setUpTempDirectory(\"TestSpringLockssTestCase\");\n }", "private static Path createTempFile(String folderName) throws IOException {\n while (true) {\n String fileName = UUID.randomUUID().toString();\n Path filePath = Paths.get(folderName + \"/\" + fileName);\n\n if (Files.notExists(filePath)) {\n Files.createFile(filePath);\n return filePath;\n }\n }\n }", "private void createHTMLFile(Webpage webpage) {\n String filepath = \"resources/tempHTML\" +Thread.currentThread().getName() +\".html\";\n\n try {\n //Create HTML file\n File file = new File(filepath);\n OutputStreamWriter fW = new OutputStreamWriter(new FileOutputStream(file), Charset.forName(\"UTF-8\").newEncoder());\n fW.write(webpage.getHTML());\n fW.flush();\n fW.close();\n\n //Set HTML file size\n webpage.setFileSize(Utils.getFileSize(filepath));\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "native void nativeSetJavaTmpDir(String path);", "private File writeMoleculeToTemp(IAtomContainer mol, String identifier, int globalCount, String bondEnergy, Integer treeDepth) throws IOException, CDKException\n {\n \tFile temp = File.createTempFile(identifier + \"_\" + globalCount, \".sdf\");\n // Delete temp file when program exits.\n temp.deleteOnExit();\n FileWriter out = new FileWriter(temp);\n SDFWriter mw = new SDFWriter(out);\n IAtomContainer tmp = mol;\n Map<Object, Object> props = mol.getProperties();\n IMolecule test = new Molecule(tmp);\n test.setProperties(props);\n test.setProperty(\"BondEnergy\", bondEnergy);\n test.setProperty(\"TreeDepth\", treeDepth.toString());\n mw.write(test);\n mw.close();\n \n return temp;\n }", "public static void init(){\n Path path = FileDirectoryUtil.getPath(\"src\", \"fileIO\", \"test.txt\");\n FileDirectoryUtil.tryCreateDirectory(path);\n\n // Try to create the file\n path = Paths.get(path.toAbsolutePath().toString(), \"test.txt\");\n FileDirectoryUtil.tryCreateFile(path);\n\n // Print out the final location of the file\n System.out.println(path.toAbsolutePath());\n\n // Try to write to the file\n IOUtil.tryWriteToFile(getContent(), path);\n\n // Try to print the content of the file\n IOUtil.tryPrintContents(path);\n\n }", "public File createTempDir(String prefix, String suffix) {\n try {\n // Create a tempfile, and delete it.\n File file = File.createTempFile(prefix, suffix, baseDir);\n\n if (!file.delete()) {\n throw new IOException(\"Unable to create temp file\");\n }\n\n // Create it as a directory.\n File dir = new File(file.getAbsolutePath());\n if (!dir.mkdirs()) {\n throw new UncheckedIOException(\n new IOException(\"Cannot create profile directory at \" + dir.getAbsolutePath()));\n }\n\n // Create the directory and mark it writable.\n FileHandler.createDir(dir);\n\n temporaryFiles.add(dir);\n return dir;\n } catch (IOException e) {\n throw new UncheckedIOException(\n new IOException(\"Unable to create temporary file at \" + baseDir.getAbsolutePath()));\n }\n }", "public String getTemporaryFilePath()\n {\n return callString(\"GetTemporaryFilePath\");\n }", "public static File getTempDirectory() {\r\n\t\tFile tempdir = new File(System.getProperty(\"java.io.tmpdir\"));\r\n\t\treturn tempdir;\r\n\t}", "private static File createTempStore(String storePath) {\n File f = null;\n Closer closer = Closer.create();\n try {\n InputStream trustStoreIs = CCMBridge.class.getResourceAsStream(storePath);\n closer.register(trustStoreIs);\n f = File.createTempFile(\"server\", \".store\");\n logger.debug(\"Created store file {} for {}.\", f, storePath);\n OutputStream trustStoreOs = new FileOutputStream(f);\n closer.register(trustStoreOs);\n ByteStreams.copy(trustStoreIs, trustStoreOs);\n } catch (IOException e) {\n logger.warn(\"Failure to write keystore, SSL-enabled servers may fail to start.\", e);\n } finally {\n try {\n closer.close();\n } catch (IOException e) {\n logger.warn(\"Failure closing streams.\", e);\n }\n }\n return f;\n }", "private File createImageFile() throws IOException\r\n {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\r\n String imageFileName = \"MYAPPTEMP_\" + timeStamp + \"_\";\r\n File storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);\r\n File image = File.createTempFile(imageFileName, /* prefix */\r\n \".jpg\", /* suffix */\r\n storageDir /* directory */\r\n );\r\n\r\n return image;\r\n }", "public static void writeTempFile(InputStream pInputStream, String pTempFilePath) throws IOException {\r\n FileOutputStream lOutputStream = null;\r\n try {\r\n lOutputStream = new FileOutputStream(pTempFilePath);\r\n\r\n byte[] bufferData = new byte[1024];\r\n int read = 0;\r\n\r\n //read employee data from byte stream\r\n while ((read = pInputStream.read(bufferData)) != -1) {\r\n //write file data in temp File output stream\r\n lOutputStream.write(bufferData, 0, read);\r\n }\r\n\r\n try {\r\n lOutputStream.flush();\r\n } catch (IOException e) {\r\n }\r\n } finally {\r\n //close output stream\r\n if (lOutputStream != null) {\r\n try {\r\n lOutputStream.close();\r\n } catch (Exception lEx) {\r\n }\r\n }\r\n }\r\n }", "private String saveTmpFile(ByteBuffer b, int offset, int len, String filename_hint) {\n\t\t\tString path = \"\";\n\t\t\tif (len > 0) {\n\t\t\t\tFileOutputStream fileOutputStream = null;\n\t\t\t\ttry {\n\t\t\t\t\tTempFile tempFile = this.tempFileManager.createTempFile(filename_hint);\n\t\t\t\t\tByteBuffer src = b.duplicate();\n\t\t\t\t\tfileOutputStream = new FileOutputStream(tempFile.getName());\n\t\t\t\t\tFileChannel dest = fileOutputStream.getChannel();\n\t\t\t\t\tsrc.position(offset).limit(offset + len);\n\t\t\t\t\tdest.write(src.slice());\n\t\t\t\t\tpath = tempFile.getName();\n\t\t\t\t} catch (Exception e) { // Catch exception if any\n\t\t\t\t\tthrow new Error(e); // we won't recover, so throw an error\n\t\t\t\t} finally {\n\t\t\t\t\tsafeClose(fileOutputStream);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn path;\n\t\t}", "private void storageTotemp(Workbook workbook,HttpServletRequest req,String username){\n try{\n if(workbook==null||req==null||username==null||username.equals(\"\"))\n return;\n String path=req.getSession().getServletContext().getRealPath(\"\\\\\")+\"\\\\\"+REPOSITORY+\"\\\\\"+username+\"\\\\\"+TEMP;\n File filePath=new File(path);\n File targetFile=new File(filePath,name);\n if(!filePath.exists()){\n filePath.mkdirs();\n }\n if(targetFile.exists()){\n return;\n }\n FileOutputStream out=new FileOutputStream(targetFile);\n workbook.write(out);\n out.close();\n workbook.close();\n }catch (Exception ex){\n ex.printStackTrace();\n }\n }", "public String getTempPath() {\n return tempPath;\n }", "void init() throws Exception\n\t {\n\t\t \n\t\t \n\t\t this.hdfsdir = new Path(job.config.hdfsdatadirpath);\n\t\t if(this.job.genlocalfile())\n\t\t {\n\t\t\t datafile = new File(localdir,taskInfo.filename);\n\t\t\t if(datafile.exists())\n\t\t\t\t datafile.delete();\n\t\t\t datafile.createNewFile();\n\t\t\t writer\n\t\t\t = new PrintWriter(new BufferedWriter(new FileWriter(datafile)));\n\t\t\t\n\t\t }\n\t\t else\n\t\t {\n\t\t\t hdfsdatafile = new Path(job.getHdfsdatadirpath(),taskInfo.filename);\n\t\t\t out=job.getFileSystem().create(hdfsdatafile);\n\t\t\t \n\t\t\t writer\n\t\t\t = new PrintWriter(new BufferedWriter(new OutputStreamWriter(out,\"UTF-8\")));\n\t\t\t \n\t\t }\n\t\t\n\t\t \n\t }", "@Before\n public void initTest() {\n tmpDir=new File(\"/tmp/luc/test\");\n //Setup System properties\n System.getProperties().remove(JNILoader.customPathKEY); //remove any \"old\" stuff\n System.setProperty(JNILoader.customPathKEY,tmpDir.getAbsolutePath());\n }", "public String getUserTempDir() throws IOException {\n\t\treturn \"/data/local/tmp/\";\n\t}", "public static Builder usingNewTempDirUnder(Path tempDir) throws IOException {\n Path child = java.nio.file.Files.createTempDirectory(tempDir, \"ServerReplay\");\n return builder(child);\n }", "public void makeSettingsFile() {\n settingsData = new File (wnwData,\"settings.dat\");\n try {\n if (!settingsData.exists()) {\n settingsData.createNewFile();\n BufferedWriter bufferedWriter = new BufferedWriter(\n new FileWriter(settingsData));\n bufferedWriter.write(\"1 0\");\n bufferedWriter.close();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n settingsData.setWritable(true);\n }", "public void createTempTable() throws Exception {\n Db db = getDb();\n try {\n db.enter();\n _logger.info(\"Creating temporary table t_http_log_data\");\n PreparedStatement createTable = db.prepareStatement(create_temp_table);\n db.executeUpdate(createTable);\n } catch (Exception e) {\n _logger.fatal(\"Error when creating temporary table t_http_log_data\", e);\n throw e;\n } finally {\n db.exit();\n }\n st_insert_temp_table = db.prepareStatement(sql_insert_temp_table);\n }", "public static String getTempDirectoryPath()\n {\n return System.getProperty( \"java.io.tmpdir\" );\n }", "@Override\n public String getTempDir() {\n return Comm.getAppHost().getTempDirPath();\n }", "private static void prepareOutputFile() {\n try {\n outputFileBuffer = new BufferedWriter(new FileWriter(PATH+OUTPUT_FILE_NAME));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Before\n\tpublic void init(){\n\t\tthis.sourceFolder =new File(\"/tmp/sourceTmpTest\");\n\t\tif(!sourceFolder.exists()){\n\t\t\tSystem.out.println(\"The source folder doesn't exist, is created now\");\n\t\t\tsourceFolder.mkdir();\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"The source folder already exist\");\n\t\t}\n\n\t\t/* Create source Temporary folder */\n\t\tthis.destinationFolder =new File(\"/tmp/destinationTmpTest\");\n\t\tif(!destinationFolder.exists()){\n\t\t\tSystem.out.println(\"The destination folder doesn't exist, is created now\");\n\t\t\tdestinationFolder.mkdir();\n\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"The destination folder already exist\");\n\t\t}\n\n\t\t/* Create 4 files to test it into the function */\n\t\tfor(int i=0;i<4;i++){\n\t\t\tFile testFile=new File (\"/tmp/sourceTmpTest/img-test_0_000\"+i+\".testexpsim\");\n\t\t\ttry {\n\t\t\t\tif (testFile.createNewFile()){\n\t\t\t\t\tSystem.out.println(\"Source file \"+i +\" is created!\");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(\"Source file \"+i +\" already exists.\");\n\t\t\t\t}\n\t\t\t} catch (IOException e1) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "private void removeTmpConfigFile() throws IOException {\n fileSystem.delete(tempConfigPath, true);\n LOG.info(\"delete temp configuration file: \" + tempConfigPath);\n }", "private void createFile(String outputData, File file) {\n try {\n FileWriter writer = new FileWriter(file);\n writer.write(outputData);\n writer.close();\n } catch (IOException e) {\n e.getSuppressed();\n }\n }", "private void initialise() throws IOException {\r\n //Initialise PrintWriter\r\n try {\r\n out = new PrintWriter(new File(CSV_FILE_NAME), \"UTF8\");\r\n } catch (FileNotFoundException ex) {\r\n System.out.println(ex.getMessage());\r\n if (out != null) {\r\n out.close();\r\n }\r\n System.exit(1);\r\n }\r\n }", "public static File writeObjectToTempFileNoExceptions(Serializable o, String filename)\n/* */ {\n/* */ try\n/* */ {\n/* 93 */ return writeObjectToTempFile(o, filename);\n/* */ } catch (Exception e) {\n/* 95 */ System.err.println(\"Error writing object to file \" + filename);\n/* 96 */ e.printStackTrace(); }\n/* 97 */ return null;\n/* */ }", "public static void main(String[] args) {\n\t\tFile file = new File(\"test/a.txt\");\r\n\t\tFileUtil.createFile(file);\r\n\t\t/*if(! file.exists()){\r\n\t\t\ttry {\r\n\t\t\t\tSystem.out.println(file.getAbsolutePath());\r\n\t\t\t\tfile.createNewFile();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\t*/\r\n\t}", "private static File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = JPEG_FILE_PREFIX + timeStamp + \"_\";\n File albumF = getAlbumDir();\n File imageF = File.createTempFile(imageFileName, JPEG_FILE_SUFFIX, albumF);\n return imageF;\n }", "private static File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = JPEG_FILE_PREFIX + timeStamp + \"_\";\n File albumF = getAlbumDir();\n File imageF = File.createTempFile(imageFileName, JPEG_FILE_SUFFIX, albumF);\n return imageF;\n }", "private void createTempDatabase() {\n\t\thandler = new ERXmlDocumentHandler(doc);\n\t\tList<String> filter = initFilter(subjectId);\n\t\tparseEntitys(filter);\n\t}", "public interface TempFileManagerFactory {\n\n\t\tpublic TempFileManager create();\n\t}", "private void startFresh() throws JournalException {\n try {\n this.log = this.node.getWriter(this.filename, false);\n } catch (IOException e) {\n throw new JournalException(\"Failed to create initial log file.\");\n }\n }", "private static void writeFile(String name, Trajectory t) {\n\t\ttry {\n\t\t\tFile directory = new File(cacheDirectory);\n\t\t\tif (!directory.exists()) {\n\t\t\t\tconsole.log(\"missing dir, making\");\n\t\t\t\tdirectory.mkdir();\n\t\t\t}\n\t\t\t\n\t\t\tFileOutputStream fos = new FileOutputStream(cacheDirectory + name);\n\t\t ObjectOutputStream oos = new ObjectOutputStream(fos);\n\t\t oos.writeObject(t);\n\t\t oos.close();\n\t\t fos.close();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tconsole.error(e);\n\t\t}\n\t}" ]
[ "0.6855447", "0.6825608", "0.66367614", "0.65714943", "0.65584326", "0.6520935", "0.64703405", "0.6467098", "0.6452173", "0.6421539", "0.63299215", "0.63228345", "0.6293895", "0.6281791", "0.62295073", "0.6205961", "0.61451334", "0.6132244", "0.6121004", "0.6118037", "0.6113273", "0.6106479", "0.6104957", "0.6101403", "0.604309", "0.60408044", "0.60349965", "0.6034801", "0.60335886", "0.60222036", "0.6010933", "0.60058224", "0.6004474", "0.59980816", "0.59755886", "0.5955815", "0.59458464", "0.5939496", "0.59251714", "0.58990246", "0.5874103", "0.58598554", "0.5858877", "0.5853293", "0.58375907", "0.5836736", "0.5834427", "0.5823622", "0.5786042", "0.57417333", "0.57164705", "0.5709667", "0.57040495", "0.5695322", "0.56900823", "0.5674758", "0.5671174", "0.56624144", "0.5649548", "0.56363285", "0.5635334", "0.56313694", "0.56195694", "0.5617268", "0.5614763", "0.56118953", "0.56077385", "0.558674", "0.55658895", "0.55654144", "0.5559584", "0.55580735", "0.5548678", "0.55342114", "0.5533746", "0.553167", "0.5528912", "0.5526163", "0.5518556", "0.5515261", "0.55041176", "0.5480292", "0.54732454", "0.5469842", "0.54612255", "0.5437029", "0.54325986", "0.54274845", "0.541429", "0.5408601", "0.54043347", "0.5390823", "0.5388743", "0.5388083", "0.53839326", "0.5368969", "0.5368969", "0.5368166", "0.5364365", "0.5352646", "0.5351647" ]
0.0
-1
Disable these tests for Redis 2 and below
@Test public void bitfieldOperations() throws Exception { assumeThat(getEnv().serverVersion[0], is(greaterThanOrEqualTo(3))); awaitIndefinitely(commandClient.del(key("bf"))); List<Long> results = awaitIndefinitely(commandClient.bitfield(key("bf"), asList(new Incrby(I05, 100L, 1L), new Get(U04, 0L)))); assertThat(results, contains(1L, 0L)); results.clear(); for (int i = 0; i < 4; i++) { results.addAll(awaitIndefinitely(commandClient.bitfield(key("bf"), asList( new Incrby(U02, 100L, 1L), new Overflow(SAT), new Incrby(U02, 102L, 1L))))); } assertThat(results, contains(1L, 1L, 2L, 2L, 3L, 3L, 0L, 3L)); results = awaitIndefinitely(commandClient.bitfield(key("bf"), asList(new Overflow(FAIL), new Incrby(U02, 102L, 1L)))); assertThat(results, contains(nullValue())); awaitIndefinitely(commandClient.del(key("bf"))); // bitfield doesn't support non-numeric offsets (which are used for bitsize-based offsets) // but it's possible to get the same behaviour by using the bit size provided by the type enum, // ie. the following is equivalent to: // BITFIELD <key> SET u8 #2 200 GET u8 #2 GET u4 #4 GET u4 #5 results = awaitIndefinitely(commandClient.bitfield(key("bf"), asList( new Set(U08, U08.getBitSize() * 2, 200L), new Get(U08, U08.getBitSize() * 2), new Get(U04, U04.getBitSize() * 4), new Get(U04, U04.getBitSize() * 5)))); assertThat(results, contains(0L, 200L, 12L, 8L)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test(groups = { \"Integration\" })\n public void testNonStandardPort() throws Exception {\n redis = app.createAndManageChild(EntitySpec.create(RedisStore.class)\n .configure(RedisStore.REDIS_PORT, PortRanges.fromString(\"10000+\")));\n app.start(ImmutableList.of(loc));\n\n EntityAsserts.assertAttributeEqualsEventually(redis, Startable.SERVICE_UP, true);\n JedisSupport support = new JedisSupport(redis);\n support.redisTest();\n\n // Increase timeout because test was failing on jenkins sometimes. The log shows only one \n // call to `info server` (for obtaining uptime) which took 26 seconds; then 4 seconds later \n // this assert failed (with it checking every 500ms). The response did correctly contain\n // `uptime_in_seconds:27`.\n EntityAsserts.assertPredicateEventuallyTrue(ImmutableMap.of(\"timeout\", Duration.FIVE_MINUTES), redis, new Predicate<RedisStore>() {\n @Override public boolean apply(@Nullable RedisStore input) {\n return input != null &&\n input.getAttribute(RedisStore.UPTIME) > 0 &&\n input.getAttribute(RedisStore.TOTAL_COMMANDS_PROCESSED) >= 0 &&\n input.getAttribute(RedisStore.TOTAL_CONNECTIONS_RECEIVED) >= 0 &&\n input.getAttribute(RedisStore.EXPIRED_KEYS) >= 0 &&\n input.getAttribute(RedisStore.EVICTED_KEYS) >= 0 &&\n input.getAttribute(RedisStore.KEYSPACE_HITS) >= 0 &&\n input.getAttribute(RedisStore.KEYSPACE_MISSES) >= 0;\n }\n });\n }", "@Test\n public void test2() { User user = new User();\n// user.setId(\"asdasd\");\n// user.setUserType(1);\n// user.setUpdateDate(new Date());\n// redisHelper.set(\"testKey\",user);\n// System.out.println(redisHelper.get(\"testKey\", User.class));\n//\n redisHelper.del(\"testKey\");\n System.out.println(redisHelper.get(\"testKey\", User.class));\n\n }", "@Test(groups = { \"Integration\" })\n public void testRedisConnection() throws Exception {\n redis = app.createAndManageChild(EntitySpec.create(RedisStore.class));\n app.start(ImmutableList.of(loc));\n\n EntityAsserts.assertAttributeEqualsEventually(redis, Startable.SERVICE_UP, true);\n\n JedisSupport support = new JedisSupport(redis);\n support.redisTest();\n }", "@Test\n @FixFor(\"DBZ-4509\")\n public void testRedisConnectionRetry() throws Exception {\n Testing.Print.enable();\n\n Jedis jedis = new Jedis(HostAndPort.from(RedisTestResourceLifecycleManager.getRedisContainerAddress()));\n // wait until the offsets are written for the first time\n TestUtils.awaitHashSizeGte(jedis, OFFSETS_HASH_NAME, 1);\n\n // clear the offsets key\n jedis.del(OFFSETS_HASH_NAME);\n\n // pause container\n Testing.print(\"Pausing container\");\n RedisTestResourceLifecycleManager.pause();\n\n final PostgresConnection connection = TestUtils.getPostgresConnection();\n Testing.print(\"Creating new redis_test table and inserting 5 records to it\");\n connection.execute(\n \"CREATE TABLE inventory.redis_test (id INT PRIMARY KEY)\",\n \"INSERT INTO inventory.redis_test VALUES (1)\",\n \"INSERT INTO inventory.redis_test VALUES (2)\",\n \"INSERT INTO inventory.redis_test VALUES (3)\",\n \"INSERT INTO inventory.redis_test VALUES (4)\",\n \"INSERT INTO inventory.redis_test VALUES (5)\");\n connection.close();\n\n Testing.print(\"Sleeping for 2 seconds to flush records\");\n Thread.sleep(2000);\n Testing.print(\"Unpausing container\");\n\n RedisTestResourceLifecycleManager.unpause();\n Testing.print(\"Sleeping for 2 seconds to reconnect to redis and write offset\");\n\n // wait until the offsets are re-written\n TestUtils.awaitHashSizeGte(jedis, OFFSETS_HASH_NAME, 1);\n\n Map<String, String> redisOffsets = jedis.hgetAll(OFFSETS_HASH_NAME);\n jedis.close();\n assertThat(redisOffsets.size() > 0).isTrue();\n }", "private RedisClient() {\n\n }", "void failedToStart(RedisServer redisServer);", "private static void test(Jedis jedis) {\n\n JedisProxyCglib jp = new JedisProxyCglib();\n Jedis je = jp.getInstance(jedis);\n je.set(\"uuu11\", \"x\");\n je.set(\"uuu12\", \"x2\");\n je.set(\"uuu13\", \"x2\");\n }", "public void testCheckAndRestoreIfNeeded_failure()\n {\n // SETUP\n String host = \"localhost\";\n int port = 1234;\n String service = \"doesn'texist\";\n MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();\n\n RegistryKeepAliveRunner runner = new RegistryKeepAliveRunner( host, port, service );\n runner.setCacheEventLogger( cacheEventLogger );\n\n // DO WORK\n runner.checkAndRestoreIfNeeded();\n\n // VERIFY\n // 1 for the lookup, one for the rebind since the server isn't created yet\n assertEquals( \"error tally\", 2, cacheEventLogger.errorEventCalls );\n //System.out.println( cacheEventLogger.errorMessages );\n }", "@Test(groups = \"testAuth\", dependsOnGroups = \"authEnable\", priority = 1)\n public void testKVWithoutAuth() throws InterruptedException {\n assertThatThrownBy(() -> this.authDisabledKVClient.put(rootRoleKey, rootRoleValue).get())\n .hasMessageContaining(\"etcdserver: user name is empty\");\n assertThatThrownBy(() -> this.authDisabledKVClient.put(userRoleKey, rootRoleValue).get())\n .hasMessageContaining(\"etcdserver: user name is empty\");\n assertThatThrownBy(() -> this.authDisabledKVClient.get(rootRoleKey).get())\n .hasMessageContaining(\"etcdserver: user name is empty\");\n assertThatThrownBy(() -> this.authDisabledKVClient.get(userRoleKey).get())\n .hasMessageContaining(\"etcdserver: user name is empty\");\n }", "private static void clearRedis() {\n StringRedisTemplate redisTemplate = getRedisTemplate();\n Set<String> keys = redisTemplate.keys(\"*\");\n for (String key : keys) {\n redisTemplate.delete(key);\n Assert.assertFalse(redisTemplate.hasKey(key));\n }\n }", "@Test\n public void skipSslTest() {\n // TODO: test skipSsl\n }", "@Override\n @Before\n public void setUp() throws Exception {\n System.setProperty(\"org.apache.activemq.transport.AbstractInactivityMonitor.keepAliveTime\", \"2\");\n this.realStore = true;\n super.setUp();\n }", "@org.junit.Test\r\n public void test() {\n Jedis jedis = new Jedis(\"16.186.75.216\");\r\n System.out.println(\"connected successfully\");\r\n //set redis string value\r\n jedis.set(\"runoobkey\", \"www.runoob.com\");\r\n // get the stored value based on the key\r\n System.out.println(\"redis store strings: \"+ jedis.get(\"runoobkey\"));\r\n }", "@Test\n public void testNonTransactional() throws Throwable {\n List<MagicKey> keys = init();\n\n log.info(\"Invoking rehash event\");\n performRehashEvent(false);\n\n waitForRehashCompletion();\n log.info(\"Rehash complete\");\n\n for (MagicKey key : keys) assertOnAllCachesAndOwnership(key, \"v0\");\n }", "@Test\n public void orgApacheFelixEventadminIgnoreTimeoutTest() {\n // TODO: test orgApacheFelixEventadminIgnoreTimeout\n }", "public boolean isReliable() {\n return false;\n }", "public boolean isReliable() {\n return false;\n }", "@Test\n public void testSet() throws InterruptedException {\n\n final String k = \"mLock\";\n final String v = \"mValue\";\n\n// long l = 10;\n// Boolean isGetLock = redisTemplate.opsForValue().setIfAbsent(k, v, l, TimeUnit.SECONDS);\n// if (isGetLock) {\n// System.out.println(Thread.currentThread().getName() + \"获得锁成功\");\n// }\n\n\n// redisTemplate.opsForValue().set(\"k6\", \"v6\");\n// Duration duration = Duration.ofSeconds(10);\n// redisTemplate.expire(k, duration);\n// TimeUnit.SECONDS.sleep(10);\n// for (int i = 0; i < 100; i++) {\n// new Thread(() -> {\n// Boolean isGetLock = redisTemplate.opsForValue().setIfAbsent(k, v, 100, TimeUnit.SECONDS);\n//\n// if (isGetLock) {\n// System.out.println(Thread.currentThread().getName() + \"获得锁成功\");\n// } else {\n// System.out.println(Thread.currentThread().getName() + \"获得锁失败\");\n// }\n// }, \"thread-\" + i).start();\n// }\n\n for (int i = 0; i < 100; i++) {\n String key = \"kk\" +i;\n String value = \"vv\" + i;\n\n redisTemplate.opsForValue().set(key, value);\n// new Thread(new Task(key, value, redisTemplate)).start();\n// new Thread(() -> {\n// System.out.println(\"set \" + key + \":\" +value);\n// redisTemplate.opsForValue().set(key, value);\n//\n// if(key.equals(\"kk99\")) {\n// System.out.println(\"haha\");\n// }\n// }).start();\n }\n }", "@RepeatedTest(value = Integer.MAX_VALUE)\n @Disabled\n void test() {\n\n long start = System.currentTimeMillis();\n\n SimpleClientImpl client = new SimpleClientImpl(Config.HOST, Config.PORT);\n\n assertNotNull(client);\n\n logger.info(\"Request Success : \" + counter.incrementAndGet() + \" \"\n + (System.currentTimeMillis() - start));\n\n }", "@Test\n public void testRouterAllServersDown() throws Exception {\n defaultServer1.cancelRegistration();\n defaultServer2.cancelRegistration();\n\n testSyncServiceUnavailable();\n Assert.assertEquals(0, defaultServer1.getNumRequests());\n Assert.assertEquals(0, defaultServer2.getNumRequests());\n\n defaultServer1.registerServer();\n defaultServer2.registerServer();\n }", "public RedisConnector() {\n super();\n\n ensureRedisClient();\n }", "@Test(expected = DataRetrievalFailureException.class)\n public void testGet() {\n // given\n // No current value\n\n // when\n redisAtomicIntegerExampleBean.get();\n }", "@Override\n public void enableDisableDiscrete() {\n // empty bc mock\n }", "@Test\n public void testMigrate() {\n log.info(\"test migrate slot\");\n Set<HostAndPort> jedisClusterNode = new HashSet<HostAndPort>();\n jedisClusterNode.add(nodeInfo1);\n JedisCluster jc = new JedisCluster(jedisClusterNode, DEFAULT_TIMEOUT, DEFAULT_TIMEOUT, DEFAULT_REDIRECTIONS, \"cluster\", DEFAULT_CONFIG);\n String node3Id = JedisClusterTestUtil.getNodeId(node3.clusterNodes());\n String node2Id = JedisClusterTestUtil.getNodeId(node2.clusterNodes());\n node3.clusterSetSlotMigrating(15363, node2Id);\n node2.clusterSetSlotImporting(15363, node3Id);\n try {\n node2.set(\"e\", \"e\");\n } catch (JedisMovedDataException jme) {\n assertEquals(15363, jme.getSlot());\n assertEquals(new HostAndPort(localHost, nodeInfo3.getPort()), jme.getTargetNode());\n }\n\n try {\n node3.set(\"e\", \"e\");\n } catch (JedisAskDataException jae) {\n assertEquals(15363, jae.getSlot());\n assertEquals(new HostAndPort(localHost, nodeInfo2.getPort()), jae.getTargetNode());\n }\n\n jc.set(\"e\", \"e\");\n\n try {\n node2.get(\"e\");\n } catch (JedisMovedDataException jme) {\n assertEquals(15363, jme.getSlot());\n assertEquals(new HostAndPort(localHost, nodeInfo3.getPort()), jme.getTargetNode());\n }\n try {\n node3.get(\"e\");\n } catch (JedisAskDataException jae) {\n assertEquals(15363, jae.getSlot());\n assertEquals(new HostAndPort(localHost, nodeInfo2.getPort()), jae.getTargetNode());\n }\n\n assertEquals(\"e\", jc.get(\"e\"));\n\n node2.clusterSetSlotNode(15363, node2Id);\n node3.clusterSetSlotNode(15363, node2Id);\n // assertEquals(\"e\", jc.get(\"e\"));\n assertEquals(\"e\", node2.get(\"e\"));\n\n // assertEquals(\"e\", node3.get(\"e\"));\n\n }", "@Test\n\tpublic void testReadTicketFail() {\n\t}", "public interface MainTestConfig {\n /**\n * hostname for the RabbitMQ server\n * should not be the same machine as the tests runner\n * @return host or ip for the target host\n */\n public String rabbitHost();\n\n /**\n * TCP port for RabbitMQ\n * @return\n */\n public Integer rabbitPort();\n\n /**\n * Should the tests use long lived TCP connections or not\n * @return true or false\n */\n public Boolean tcpReuseConn();\n\n /**\n * Should the tests reuse channels\n * @return true orr false\n */\n public Boolean tcpReuseChannel();\n\n /**\n * specifies the size for the messages enqueued before starting tests\n * @return\n */\n public Integer maxMessages();\n\n /**\n * name of the queue hosting messages\n * @return\n */\n public String queueName();\n\n /**\n * name of the exchange used to publish messages\n * @return\n */\n public String exchangeName();\n\n /**\n * routing key used to deliver messages through the exchange\n * @return\n */\n public String routingKey();\n\n /**\n * should the queue be created as a lazy one?\n * @return\n */\n public Boolean lazyQueue();\n\n /**\n * prefetch size\n * @return\n */\n public Integer prefetch();\n\n /**\n * shoud messages be persisted\n * @return\n */\n public Boolean persistent();\n\n /**\n * is the queue exclusive? shoud le always false\n * @return\n */\n public Boolean exclusive();\n\n /**\n * is the queue flagged as autodelete ? should be false\n * @return\n */\n public Boolean autodelete();\n\n /**\n * delays to sleep while consuming messages\n * @return\n */\n public Integer threadDelay();\n}", "@Test\n\tpublic void testSetIgnoreFlush() {\n\t}", "private void limitedMemoryWithoutEviction() {\n Jedis jedis = this.connector.connection();\n System.out.println(\"Collect: \" + jedis.get(\"0\")); // Redis still services read operations.\n System.out.println(jedis.set(\"0\", \"0\")); // Write operations will be refused.\n }", "@Override\n\tpublic BaseResponse setRedisTest(String key, String value) {\n\t\tbaseRedisService.setString(key, value);\n\t\treturn setResultSuccess();\n\t}", "@Test\n public void testZookeeperCacheLoader() throws InterruptedException, KeeperException, Exception {\n\n DiscoveryZooKeeperClientFactoryImpl.zk = mockZookKeeper;\n\n @SuppressWarnings(\"resource\")\n ZookeeperCacheLoader zkLoader = new ZookeeperCacheLoader(new DiscoveryZooKeeperClientFactoryImpl(), \"\", 30_000);\n\n List<String> brokers = Lists.newArrayList(\"broker-1:15000\", \"broker-2:15000\", \"broker-3:15000\");\n for (int i = 0; i < brokers.size(); i++) {\n try {\n LoadManagerReport report = i % 2 == 0 ? getSimpleLoadManagerLoadReport(brokers.get(i))\n : getModularLoadManagerLoadReport(brokers.get(i));\n zkLoader.getLocalZkCache().getZooKeeper().create(LOADBALANCE_BROKERS_ROOT + \"/\" + brokers.get(i),\n ObjectMapperFactory.getThreadLocal().writeValueAsBytes(report), ZooDefs.Ids.OPEN_ACL_UNSAFE,\n CreateMode.PERSISTENT);\n } catch (Exception e) {\n fail(\"failed while creating broker znodes\");\n }\n }\n\n // strategically wait for cache to get sync\n for (int i = 0; i < 5; i++) {\n if (zkLoader.getAvailableBrokers().size() == 3 || i == 4) {\n break;\n }\n Thread.sleep(1000);\n }\n\n // 2. get available brokers from ZookeeperCacheLoader\n List<LoadManagerReport> list = zkLoader.getAvailableBrokers();\n\n // 3. verify retrieved broker list\n Set<String> cachedBrokers = list.stream().map(loadReport -> loadReport.getWebServiceUrl())\n .collect(Collectors.toSet());\n Assert.assertEquals(list.size(), brokers.size());\n Assert.assertTrue(brokers.containsAll(cachedBrokers));\n\n // 4.a add new broker\n final String newBroker = \"broker-4:15000\";\n LoadManagerReport report = getSimpleLoadManagerLoadReport(newBroker);\n zkLoader.getLocalZkCache().getZooKeeper().create(LOADBALANCE_BROKERS_ROOT + \"/\" + newBroker,\n ObjectMapperFactory.getThreadLocal().writeValueAsBytes(report), ZooDefs.Ids.OPEN_ACL_UNSAFE,\n CreateMode.PERSISTENT);\n brokers.add(newBroker);\n\n Thread.sleep(100); // wait for 100 msec: to get cache updated\n\n // 4.b. get available brokers from ZookeeperCacheLoader\n list = zkLoader.getAvailableBrokers();\n\n // 4.c. verify retrieved broker list\n cachedBrokers = list.stream().map(loadReport -> loadReport.getWebServiceUrl()).collect(Collectors.toSet());\n Assert.assertEquals(list.size(), brokers.size());\n Assert.assertTrue(brokers.containsAll(cachedBrokers));\n\n }", "@Override\n\tpublic BaseResponse getRedis(String key) {\n\t\treturn null;\n\t}", "protected boolean disableEnableSvcs() throws Throwable {\n int i = ((int)(Math.random() * nodes));\n portString = \"\" + (i + NODE_PORT_OFFSET);\n \n return (verifySvcs(\"online\") &&\n changeSvcs(\"disable\") &&\n verifySvcs(\"disabled\") &&\n changeSvcs(\"enable\") &&\n verifySvcs(\"online\"));\n }", "private void workaroundCLICheckedExceptions() throws\n cli.Infinispan.HotRod.Exceptions.HotRodClientException,\n cli.Infinispan.HotRod.Exceptions.RemoteCacheManagerNotStartedException {\n }", "@Test(timeout = 4000)\n public void test56() throws Throwable {\n ConnectionFactories connectionFactories0 = new ConnectionFactories();\n connectionFactories0.removeXATopicConnectionFactory((XATopicConnectionFactory) null);\n QueueConnectionFactory queueConnectionFactory0 = new QueueConnectionFactory();\n connectionFactories0.addQueueConnectionFactory(queueConnectionFactory0);\n assertEquals(0, connectionFactories0.getXATopicConnectionFactoryCount());\n }", "@Override\n protected String getSubsystem() {\n return \"com.poesys.db.memcached_test\";\n }", "public interface RedisManager {\n /**\n * 得到json实例通过key\n *\n * @param key\n * @return\n */\n String getString(String key);\n\n /**\n * 从redis中解析并返回对象,如果获取和解析过程中出现异常,直接抛出\n * add by houenxun 2015.07.17\n *\n * @param key\n * @param clazz\n * @param <T>\n * @return\n */\n <T> T getObject(String key, Class<T> clazz);\n\n /**\n * 从redis中解析并返回对象,如果获取和解析过程中出现异常,忽略并返回null\n * add by houenxun 2015.07.17\n *\n * @param key\n * @param clazz\n * @param <T>\n * @return\n */\n <T> T getObjectSilently(String key, Class<T> clazz);\n\n /**\n * 从redis中解析并返回对象列表,如果获取和解析过程中出现异常,忽略并返回null\n *\n * @param key\n * @param clazz\n * @param <T>\n * @return\n */\n <T> List<T> getObjectListSilently(String key, Class<T> clazz);\n\n\n /**\n * 得到json实例通过keys\n *\n * @param keys\n * @return\n */\n List<String> getStrings(List<String> keys);\n\n /**\n * 给某个key赋值 加给予有效期\n *\n * @param key\n * @param second\n * @return\n */\n String put(String key, String json, int second);\n\n /**\n * 存储json文本通过key\n *\n * @param key\n * @param json\n * @return\n */\n String putJson(String key, String json);\n\n\n /**\n * 批量删除实例keys\n *\n * @param key\n * @return\n */\n Long delete(String key);\n\n /**\n * 批量删除\n *\n * @param keys\n * @return\n */\n boolean delete(List<String> keys);\n\n /**\n * 验证是否存在\n *\n * @param key\n * @return\n */\n boolean exists(String key);\n\n /**\n * 移除一个分数从一个key中\n *\n * @param key\n * @param value\n */\n void removeWithScore(String key, String... value);\n\n /**\n * 统计set集合中元素根据索引 score从低到高\n *\n * @param key\n * @param startIndex\n * @param pageSize\n * @return\n */\n Collection<String> getZrangeByIndex(String key, int startIndex, int pageSize);\n\n /**\n * 统计set集合中元素根据score score从低到高\n *\n * @param key\n * @param min\n * @param max\n * @return\n */\n Collection<String> getZrangeByScore(String key, Double min, Double max);\n\n /**\n * 统计set集合中元素根据索引 score从高到低\n *\n * @param key\n * @param startIndex\n * @param pageSize\n * @return\n */\n Collection<String> getZrevrangeByIndex(String key, int startIndex, int pageSize);\n\n /**\n * 统计set集合全部元素 根据分数从低到高\n *\n * @param key\n * @return\n */\n Collection<String> getZRevrangeAll(String key);\n\n /**\n * 获取总数\n *\n * @param key\n * @return\n */\n Long getZcard(String key);\n\n /**\n * 增加Hash属性\n *\n * @param key\n * @param field\n * @param value\n * @return\n */\n Long hash(String key, String field, String value);\n\n /**\n * 获取key对应hash域的值\n *\n * @param key\n * @param field\n * @return\n */\n String getHash(String key, String field);\n\n /**\n * 是否存在域\n *\n * @param key\n * @param field\n * @return\n */\n Boolean hasHashByKey(String key, String field);\n\n\n /**\n * 删除key对应hash域的值\n *\n * @param key\n * @param field\n * @return\n */\n Long delHash(String key, String field);\n\n /**\n * 批量获取key对应hash域的值\n *\n * @param key\n * @param field\n * @return\n */\n List<String> getHash(String key, String... field);\n\n\n /**\n * 获取key中的所有的hash值的key\n *\n * @param key\n * @return\n */\n Set<String> getAllHashKey(String key);\n\n\n /**\n * 获取key中的所有的hash值\n *\n * @param key\n * @return\n */\n Map<String, String> getAllHash(String key);\n\n\n /**\n * 给某个key值给予有效期\n *\n * @param key\n * @param second\n * @return\n */\n Long expire(String key, int second);\n\n\n /**\n * 从左边加入key队列\n *\n * @param key\n * @param value\n * @return\n */\n Long addList(String key, String... value);\n\n\n /**\n * 获取key队列中指定序列的值\n *\n * @param key\n * @param index\n * @return\n */\n String getListByIndex(String key, int index);\n\n\n /**\n * 删除list中的值\n *\n * @param key\n * @param count\n * @param value @return\n */\n Long remList(String key, long count, String value);\n\n\n /**\n * 设置list中的值\n *\n * @param key\n * @param count\n * @param value @return\n */\n String lSet(String key, long count, String value);\n\n /**\n * 获取队列列表\n *\n * @param key\n * @param length\n * @return\n */\n Collection<String> getList(String key, int length);\n\n\n /**\n * 增加一个元素在set队列里面\n *\n * @param key\n * @param value\n * @return\n */\n Long addWithSet(String key, String... value);\n\n\n /**\n * 将元素插入集合中\n *\n * @param key\n * @param value\n * @return\n */\n Long addSet(String key, String value);\n\n\n /**\n * 从集合中删除元素\n *\n * @param key\n * @param value\n * @return\n */\n Long delSetByValue(String key, String... value);\n\n\n /**\n * 从集合获取元素\n *\n * @param key\n * @return\n */\n Set<String> getSet(String key);\n\n /**\n * key对应的值自增1\n *\n * @param key\n * @return\n */\n Long incr(String key);\n\n /**\n * key 对应的值增1,带过期时间\n * @param key\n * @param expire\n * @return\n */\n Long incr(String key, int expire);\n\n /**\n * key获取有效时间\n *\n * @param key\n * @return\n */\n Long ttlKey(String key);\n\n /**\n * 检查是否在set集合里面\n *\n * @param key\n * @param value\n * @return\n */\n Boolean sismemberSet(String key, String value);\n\n /**\n * 检查是否在set集合里面\n *\n * @param key\n * @return\n */\n String rankSet(String key);\n\n /**\n * 存放map\n *\n * @param key\n * @param map\n * @return\n */\n String putHash(String key, Map<String, String> map);\n\n Long getIndexByMember(String key, String member);\n\n /**\n * setnx\n * @param key\n * @param value\n * @param expire 超时时间,秒。若不超时则设置0\n * @return\n */\n boolean setNX(String key, String value, int expire);\n\n /**\n * 通过前缀获取所有的keys\n * @param prefix\n * @return\n */\n Collection<String> getKeys(String prefix);\n\n /**\n * 不catch异常信息的方式获取缓存值\n * @param key\n * @return\n */\n String getStringValue(String key);\n}", "@Test(timeout = 4000)\n public void test65() throws Throwable {\n ConnectionFactories connectionFactories0 = new ConnectionFactories();\n connectionFactories0.getTopicConnectionFactory();\n XAConnectionFactory xAConnectionFactory0 = new XAConnectionFactory();\n boolean boolean0 = connectionFactories0.removeXAConnectionFactory(xAConnectionFactory0);\n assertFalse(boolean0);\n }", "@Ignore\n @Test\n @Override\n public void testBoolean(TestContext ctx) {\n super.testBoolean(ctx);\n }", "@Test\n public void testSameKeyAccessDiffCacheMulti()\n {\n doStressTest(\"IdxTestSKADCM\", getCacheName0(), getCacheName1(),\n IdentityExtractor.INSTANCE,\n new CompositeKeyCreator()\n {\n public CompositeKey getCompositeKey(Object oKeyNatural, NamedCache cache)\n {\n return new CompositeKey(oKeyNatural, oKeyNatural);\n }\n },\n /*nServers*/3, /*cRollingRestart*/0);\n }", "public RedisClient() {\n init();\n }", "private void ensureRedisClient() {\n if (_redisClient != null) {\n return;\n }\n\n synchronized (RedisConnector.class) {\n if (_redisClient != null) {\n return;\n }\n\n ContainerLogger.getInstance().info(\"Creating shared lettuce.io RedisClient\");\n _redisClient = RedisClient.create();\n }\n }", "@Test\n public void testKillClientBeforeServer()\n {\n int cServers = 3;\n Properties propsClient = new Properties();\n propsClient.put(\"coherence.distributed.localstorage\", \"false\");\n propsClient.put(\"coherence.cluster\", \"testKillClientBeforeServer\");\n Properties propsServer = new Properties();\n propsServer.put(\"coherence.cluster\", \"testKillClientBeforeServer\");\n CoherenceClusterMember[] servers = ClusteringTests.startServers(\"server-witness\", \"witness\", propsServer, cServers);\n CoherenceClusterMember client = startCacheServer(\"client-witness\", \"witness\", null, propsClient);\n\n Eventually.assertThat(invoking(servers[cServers-1]).getClusterSize(), is(4));\n\n UID uidClient = client.getLocalMemberUID();\n client.invoke(new ConnectionDestroyer(2));\n\n Eventually.assertThat(invoking(servers[cServers-1]).getClusterMemberUIDs().contains(uidClient), is(false));\n\n for (int i = 0; i < cServers; i++)\n {\n servers[i].close();\n }\n client.close();\n ClusteringTests.stopServers(\"server-witness\", cServers);\n AbstractFunctionalTest.stopCacheServer(\"client-witness\");\n Base.sleep(10000);\n }", "void failedToStop(RedisServer redisServer, Throwable cause) throws FailedToStopException;", "@Ignore\n @Test\n public void testGetConnection() {\n System.out.println(\"getConnection\");\n Util.commonServiceIPs = \"127.0.0.1\";\n PooledConnection expResult = null;\n try {\n long ret = JMSUtil.getQueuePendingMessageCount(\"127.0.0.1\",\"localhost\",CommonKeys.INDEX_REQUEST);\n fail(\"The test case is a prototype.\");\n }\n catch(Exception e)\n {\n \n } \n }", "@Test(timeout = 4000)\n public void test72() throws Throwable {\n ConnectionFactories connectionFactories0 = new ConnectionFactories();\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, true);\n QueueConnectionFactory queueConnectionFactory0 = new QueueConnectionFactory();\n connectionFactories0.addQueueConnectionFactory(queueConnectionFactory0);\n QueueConnectionFactory[] queueConnectionFactoryArray0 = connectionFactories0.getQueueConnectionFactory();\n assertEquals(1, queueConnectionFactoryArray0.length);\n }", "@Test\n public void testAdminTimeout() throws Exception {\n long lastLimit = HConstants.DEFAULT_HBASE_CLIENT_PREFETCH_LIMIT;\n HConnection lastConnection = null;\n boolean lastFailed = false;\n int initialInvocations = RandomTimeoutRpcEngine.getNumberOfInvocations();\n for (int i = 0; i < 5 || (lastFailed && i < 100); ++i) {\n lastFailed = false;\n // Ensure the HBaseAdmin uses a new connection by changing Configuration.\n Configuration conf = HBaseConfiguration.create(TEST_UTIL.getConfiguration());\n conf.setLong(HConstants.HBASE_CLIENT_PREFETCH_LIMIT, ++lastLimit);\n try {\n HBaseAdmin admin = new HBaseAdmin(conf);\n HConnection connection = admin.getConnection();\n assertFalse(connection == lastConnection);\n // run some admin commands\n HBaseAdmin.checkHBaseAvailable(conf);\n admin.setBalancerRunning(false, false);\n } catch (MasterNotRunningException ex) {\n // Since we are randomly throwing SocketTimeoutExceptions, it is possible to get\n // a MasterNotRunningException. It's a bug if we get other exceptions.\n lastFailed = true;\n }\n }\n // Ensure the RandomTimeoutRpcEngine is actually being used.\n assertFalse(lastFailed);\n assertTrue(RandomTimeoutRpcEngine.getNumberOfInvocations() > initialInvocations);\n }", "@Test\n public void testReplicatedClient()\n {\n generateEvents(\"repl-client-test\");\n checkEvents(true, false);\n }", "@Test\n public void testKillBadServer()\n throws Exception\n {\n int cServers = 3;\n Properties propsClient = new Properties();\n propsClient.put(\"coherence.distributed.localstorage\", \"false\");\n propsClient.put(\"coherence.cluster\", \"testKillBadServer\");\n Properties propsServer = new Properties();\n propsServer.put(\"coherence.cluster\", \"testKillBadServer\");\n CoherenceClusterMember[] servers = ClusteringTests.startServers(\"server-witness2\", \"witness2\", propsServer, cServers);\n Eventually.assertThat(invoking(servers[cServers-1]).getClusterSize(), is(3));\n\n CoherenceClusterMember badServer = startCacheServer(\"bad-server2\", \"witness2\", null, propsServer);\n Eventually.assertThat(invoking(badServer).getClusterSize(), is(4));\n\n CoherenceClusterMember client = startCacheServer(\"client-witness2\", \"witness2\", null, propsClient);\n Eventually.assertThat(invoking(client).getClusterSize(), is(5));\n\n UID uidServer = badServer.getLocalMemberUID();\n client.invoke(new ConnectionDestroyer(badServer.getLocalMemberId()));\n Thread.sleep(2000); // encourage either failure on this connection\n badServer.invoke(new ConnectionDestroyer(0)); // ensure witnesses will agree\n\n Eventually.assertThat(invoking(client).getClusterMemberUIDs().contains(uidServer), is(false));\n\n badServer.close();\n for (int i = 0; i < cServers; i++)\n {\n servers[i].close();\n }\n client.close();\n ClusteringTests.stopServers(\"server-witness2\", cServers);\n AbstractFunctionalTest.stopCacheServer(\"client-witness2\");\n }", "@Disabled\n void ignoredTestMethod() {\n }", "default boolean isHeartbeatSupported() {\n return false;\n }", "@Disabled\n @Test\n void processDepositValidatorPubkeysDoesNotContainPubkey() {\n }", "@Test(timeout = 4000)\n public void test29() throws Throwable {\n ConnectionFactories connectionFactories0 = new ConnectionFactories();\n ConnectionFactory connectionFactory0 = new ConnectionFactory();\n connectionFactories0.removeConnectionFactory(connectionFactory0);\n XAConnectionFactory[] xAConnectionFactoryArray0 = connectionFactories0.getXAConnectionFactory();\n connectionFactories0.getXAConnectionFactory();\n XAConnectionFactory[] xAConnectionFactoryArray1 = connectionFactories0.getXAConnectionFactory();\n assertNotSame(xAConnectionFactoryArray1, xAConnectionFactoryArray0);\n }", "public interface RedisService {\n\n boolean existsKey(String key);\n\n void removeKey(String key);\n\n void pushMsg(String key, String message);\n\n void setRedis(String key,String value,int second);\n\n String getRedisValue(String key);\n\n boolean acquireLock(String lockKey ,long expired);\n\n void releaseLock(String lockKey);\n}", "public interface RedisService {\n// void setKey(String key,String value);\n// void setKeyVsExpireTime(String key, String value, long time); //单位为妙\n// String getValue(String key);\n\n\n\n}", "protected void skipTestIfSigningAlgorithmNotSupported() {\n\t}", "public void testUnknownFailoverMethod() throws Exception\n {\n _url = \"amqp://user:pass@clientid/test?brokerlist='tcp://localhost:5672'&failover='unknown'\";\n _connectionUrl = new AMQConnectionURL(_url);\n _connection = createStubConnection();\n\n try\n {\n new FailoverPolicy(_connectionUrl, _connection);\n fail(\"Exception not thrown\");\n }\n catch(IllegalArgumentException iae)\n {\n // PASS\n }\n }", "@Test\n public void testSameKeyAccessDiffCache()\n {\n doStressTest(\"IdxTestSKADC\", getCacheName0(), getCacheName1(),\n IdentityExtractor.INSTANCE,\n new CompositeKeyCreator()\n {\n public CompositeKey getCompositeKey(Object oKeyNatural, NamedCache cache)\n {\n return new CompositeKey(oKeyNatural, oKeyNatural);\n }\n },\n /*nServers*/1, /*cRollingRestart*/0);\n }", "protected void initDefaultStrategies() {\n\t\tRedisSerializer<String> keySerializer = new StringRedisSerializer();\n\t\tRedisSerializer<Object> valueSerializer = new JacksonSerializer();\n\t\tsetSerializer(valueSerializer);\n\t\tsetStringSerializer(keySerializer);\n\t}", "@Test\n public void testSameKeyAccessDiffCacheMultiRollingRestart()\n {\n doStressTest(\"IdxTestSKADCMRR\", getCacheName0(), getCacheName1(),\n IdentityExtractor.INSTANCE,\n new CompositeKeyCreator()\n {\n public CompositeKey getCompositeKey(Object oKeyNatural, NamedCache cache)\n {\n return new CompositeKey(oKeyNatural, oKeyNatural);\n }\n },\n /*nServers*/3, /*cRollingRestart*/5);\n }", "@Test\n\t@Disabled\n\tpublic void test() {\n\t}", "@Test\n\tpublic void testGetDriverExcludeAllocations(){ \n\t\tassertNotNull(driverService.getDriverExcludeAllocations(239537L)); \n\t}", "@Test(timeout = 4000)\n public void test15() throws Throwable {\n ConnectionFactories connectionFactories0 = new ConnectionFactories();\n QueueConnectionFactory queueConnectionFactory0 = new QueueConnectionFactory();\n connectionFactories0.removeQueueConnectionFactory(queueConnectionFactory0);\n connectionFactories0.getXATopicConnectionFactory();\n XAConnectionFactory[] xAConnectionFactoryArray0 = connectionFactories0.getXAConnectionFactory();\n assertEquals(0, xAConnectionFactoryArray0.length);\n }", "public void testSoThatTestsDoNotFail() {\n\n }", "@Test(timeout = 30_000)\n public void setAndWait(TestContext should) {\n final int runs = 10;\n final Async test = should.async(runs);\n\n Redis.createClient(rule.vertx(), options).connect().onComplete(should.asyncAssertSuccess(cluster -> {\n for (int i = 0; i < runs; i++) {\n cluster.send(cmd(SET).arg(\"key\").arg(\"value\")).onComplete(should.asyncAssertSuccess(setResponse -> {\n should.assertEquals(\"OK\", setResponse.toString().toUpperCase());\n\n cluster.send(cmd(WAIT).arg(1).arg(2000)).onComplete(should.asyncAssertSuccess(waitResponse -> {\n should.assertEquals(1, waitResponse.toInteger());\n test.countDown();\n }));\n }));\n }\n }\n ));\n }", "@Test\n public void stoppedPrimarySenderShouldNotAddEventsToTmpDroppedEventsButStillDrainQueuesWhenStarted() {\n Integer lnPort = vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(2));\n Integer nyPort = vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(1, lnPort));\n\n createCacheInVMs(lnPort, vm2, vm4);\n createReceiverInVMs(vm2, vm4);\n createCacheInVMs(nyPort, vm3, vm5);\n createReceiverInVMs(vm3, vm5);\n\n vm2.invoke(() -> WANTestBase.createSender(\"ny\", 1, true, 100, 10, false, false, null, false));\n vm4.invoke(() -> WANTestBase.createSender(\"ny\", 1, true, 100, 10, false, false, null, false));\n\n vm3.invoke(() -> WANTestBase.createSender(\"ln\", 2, true, 100, 10, false, false, null, false));\n vm5.invoke(() -> WANTestBase.createSender(\"ln\", 2, true, 100, 10, false, false, null, false));\n\n vm2.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ny\", 1, 100,\n isOffHeap()));\n vm4.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ny\", 1, 100,\n isOffHeap()));\n\n vm3.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ln\", 1, 100,\n isOffHeap()));\n vm5.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ln\", 1, 100,\n isOffHeap()));\n\n stopSenderInVMsAsync(\"ny\", vm2);\n\n vm2.invoke(() -> WANTestBase.doPutsFrom(getTestMethodName() + \"_PR\", 0, 100));\n\n // verify tmpDroppedEvents is 0 at site-ny\n vm2.invoke(() -> WANTestBase.verifyTmpDroppedEventSize(\"ny\", 0));\n vm4.invoke(() -> WANTestBase.verifyTmpDroppedEventSize(\"ny\", 0));\n\n vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 100));\n vm4.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 100));\n\n vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 50));\n vm5.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 50));\n\n startSenderInVMsAsync(\"ny\", vm2);\n\n vm2.invoke(() -> WANTestBase.doPutsFrom(getTestMethodName() + \"_PR\", 100, 1000));\n\n vm2.invoke(() -> WANTestBase.verifyTmpDroppedEventSize(\"ny\", 0));\n vm4.invoke(() -> WANTestBase.verifyTmpDroppedEventSize(\"ny\", 0));\n\n vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 1000));\n vm4.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 1000));\n\n vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 950));\n vm5.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 950));\n\n // verify the secondary's queues are drained at site-ny\n vm2.invoke(() -> WANTestBase.validateParallelSenderQueueAllBucketsDrained(\"ny\"));\n vm4.invoke(() -> WANTestBase.validateParallelSenderQueueAllBucketsDrained(\"ny\"));\n }", "@Test\n public void testEnableReplicationWhenSlaveClusterDoesntHaveTable() throws Exception {\n createTableWithDefaultConf(tableName);\n Assert.assertFalse(TestAsyncReplicationAdminApiWithClusters.admin2.tableExists(tableName).get());\n admin.enableTableReplication(tableName).join();\n Assert.assertTrue(TestAsyncReplicationAdminApiWithClusters.admin2.tableExists(tableName).get());\n }", "@Test\n public void createUpdateTest() throws Exception {\n var createTemplate = getInitialTemplate();\n\n //add the entire template to redis\n CaaSTemplate template = redisClient.createTemplate(createTemplate);\n Assert.assertNotNull(redis.get(template.getSettingsId()));\n\n //Update the name of the template\n var newName = \"Updated Name\";\n redisClient.updateTemplateName(template.getSettingsId(), newName);\n Assert.assertEquals(newName, redis.get(template.getSettingsId(), String.class, new Path(\".templateName\")));\n\n //Update the template setting with key of 'setting1'\n var settingKey = \"setting1\";\n var newSettingValue = \"newValue\";\n redisClient.updateTemplateData(template.getSettingsId(), settingKey, newSettingValue);\n Assert.assertEquals(\n newSettingValue,\n redis.get(template.getSettingsId(), String.class, new Path(\".templateSettings.\" + settingKey))\n );\n\n var addSettingKey = \"addSetting\";\n var addSettingValue = \"addValue\";\n redisClient.addTemplateData(template.getSettingsId(), addSettingKey, addSettingValue);\n Assert.assertEquals(\n addSettingValue,\n redis.get(template.getSettingsId(), String.class, new Path(\".templateSettings.\" + addSettingKey))\n );\n\n //Delete the template setting with key 'setting1'\n redisClient.deleteTemplateData(template.getSettingsId(), settingKey);\n Assert.assertThrows(\n Exception.class,\n () -> {\n redis.get(template.getSettingsId(), String.class, new Path(\".templateSettings.\" + settingKey));\n }\n );\n\n //Get a CaasTemplate from redis with key 'auto-generated-test'\n var retrievedTemplate = redisClient.getTemplate(template.getSettingsId());\n var expectedTemplate = getInitialTemplate();\n expectedTemplate.setSettingsId(template.getSettingsId());\n expectedTemplate.setTemplateName(newName);\n expectedTemplate.setTemplateSettings(Map.of(\"setting2\", \"value2\", addSettingKey, addSettingValue));\n Assert.assertNotNull(retrievedTemplate); //the retrieved template isn't null\n Assert.assertEquals(retrievedTemplate, expectedTemplate); //the retrieved template is what was expected\n\n //Get the setting value for the setting with key 'setting2'\n Assert.assertEquals(\"value2\", redisClient.getTemplateSettings(template.getSettingsId(), \"setting2\"));\n\n //Set the entire template in Redis back to the original template\n redisClient.updateTemplate(template);\n Assert.assertEquals(template, redisClient.getTemplate(template.getSettingsId()));\n //no..... I'm not using redisClient to verify against itself...noooo. Move on.. nothing to see here\n\n //Delete the template\n redisClient.deleteTemplate(template.getSettingsId());\n Assert.assertThrows(\n Exception.class,\n () -> {\n redis.get(template.getSettingsId());\n }\n );\n }", "public interface IRedisService {\n\n /**\n * 写入缓存\n *\n * @param key\n * @param value\n * @return\n */\n boolean set(final String key, Object value);\n\n /**\n * 写入缓存\n *\n * @param key\n * @param value\n * @param expireTime(TimeUnit.SECONDS)\n * @return\n */\n boolean setnx(final String key, Object value, Long expireTime);\n\n /**\n * 写入缓存设置时效时间\n *\n * @param key\n * @param value\n * @return\n */\n boolean set(final String key, Object value, Long expireTime, TimeUnit timeUnit);\n\n /**\n * 批量删除对应的value\n *\n * @param keys\n */\n void remove(final String... keys);\n\n /**\n * 批量删除key\n *\n * @param pattern\n */\n void removePattern(final String pattern);\n\n /**\n * 删除对应的value\n *\n * @param key\n */\n void remove(final String key);\n\n /**\n * 判断缓存中是否有对应的value\n *\n * @param key\n * @return\n */\n boolean exists(final String key);\n\n /**\n * 判断缓存中是否有对应的value,如果存在则会删除并返回true\n *\n * @param key\n * @return\n */\n boolean existsRemove(final String key);\n\n\n /**\n * 查看key的过期时间\n */\n Long expire(String key);\n\n /**\n * 读取缓存\n *\n * @param key\n * @return\n */\n Object get(final String key);\n\n /**\n * 哈希 添加\n *\n * @param key\n * @param hashKey\n * @param value\n */\n void hmSet(String key, Object hashKey, Object value);\n\n /**\n * 哈希获取数据\n *\n * @param key\n * @param hashKey\n * @return\n */\n Object hmGet(String key, Object hashKey);\n\n /**\n * 哈希 添加\n *\n * @param key\n * @param hashKey\n * @param objClass\n */\n <T> T hmGet4Obj(String key, Object hashKey, Class<T> objClass);\n\n /**\n * 删除指定哈希数据\n *\n * @param key\n * @param hashKey\n * @return\n */\n void hmDel(String key, Object hashKey);\n\n /**\n * 列表添加\n *\n * @param k\n * @param v\n */\n void lPush(String k, Object v);\n\n /**\n * 列表获取\n *\n * @param k\n * @param l\n * @param l1\n * @return\n */\n List<Object> lRange(String k, long l, long l1);\n\n /**\n * 集合添加\n *\n * @param key\n * @param value\n */\n void add(String key, Object value);\n\n /**\n * 集合获取\n *\n * @param key\n * @return\n */\n Set<Object> members4Set(String key);\n\n /**\n * 有序集合添加\n *\n * @param key\n * @param value\n * @param scoure\n */\n void zAdd(String key, Object value, double scoure);\n\n /**\n * 有序集合获取\n *\n * @param key\n * @param scoure\n * @param scoure1\n * @return\n */\n Set<Object> rangeByScore(String key, double scoure, double scoure1);\n\n /**\n * 有序集合获取\n *\n * @param key\n * @param from\n * @param to\n * @return\n */\n Set<Object> rangeByIndex(String key, int from, int to);\n\n /**\n * 倒序获得有序集合获取\n *\n * @param key\n * @param from\n * @param to\n * @return\n */\n Set<Object> rangeByIndexReverse(String key, int from, int to);\n\n /**\n * 判断用户是否已登录\n *\n * @param request\n * @return\n */\n boolean isLogin(HttpServletRequest request);\n\n\n /**\n * 获得缓存的Map\n *\n * @param key\n * @return\n */\n Map<String, Object> getCacheIntegerMap(String key);\n\n /**\n * 发布消息\n */\n void sendMessage(String channel, Object message);\n\n\n\n Set<Object> keys(String key);\n\n void hmDelAll(String key, Set<String> hashKey);\n\n /**\n * redis incrId\n * @return\n */\n Long getIncrId();\n\n /**\n * 活动排行榜\n * @param customerId\n * @param customerId\n * @param activityScoure\n */\n void setActivityZadd(String activityCode,Integer customerId,int activityScoure);\n\n /**\n * 查询用户的活动排名\n * @param activityCode\n * @param customerId\n * @return\n */\n Long getActivityReverseRank(String activityCode,Integer customerId);\n\n /**\n * 获取用户的score\n * @param activityCode\n * @param customerId\n * @return\n */\n Double getActivityReverseScore(String activityCode,Integer customerId);\n\n /**\n * 获取活动 排名\n * @param activityCode\n * @param start\n * @param end\n * @return\n */\n public List<ImmutablePair<String, Double>> getActivityRevRangeWithScores(String activityCode, int start, int end);\n\n /**\n * 设置用户tonken\n * @param userId\n * @return\n */\n String doUserToken(Integer userId);\n\n /**\n * 设置用户tonken\n * @param userId\n * @param token\n * @return\n */\n boolean checkUserToken(Integer userId , String token);\n}", "@Test\n public void testCoh3710()\n {\n doExpiryOpTest(new Runnable()\n {\n public void run() { getNamedCache(getCacheName0()).clear(); }\n });\n }", "@Test(expected=IllegalStateException.class)\n public void ongoingConfiguration_withRequestsRecordingDisabled() {\n initJadler().withRequestsRecordingDisabled();\n \n try {\n verifyThatRequest();\n fail(\"request recording disabled, verification must fail\");\n }\n finally {\n closeJadler();\n }\n }", "@Test(timeout = 4000)\n public void test73() throws Throwable {\n FileSystemHandling.appendStringToFile((EvoSuiteFile) null, (String) null);\n ConnectionFactories connectionFactories0 = new ConnectionFactories();\n connectionFactories0.getXAConnectionFactory();\n connectionFactories0.getXAConnectionFactory();\n connectionFactories0.addConnectionFactory((ConnectionFactory) null);\n XATopicConnectionFactory[] xATopicConnectionFactoryArray0 = new XATopicConnectionFactory[0];\n connectionFactories0.setXATopicConnectionFactory(xATopicConnectionFactoryArray0);\n connectionFactories0.getConnectionFactory();\n connectionFactories0.getConnectionFactory();\n connectionFactories0.getConnectionFactory();\n connectionFactories0.getConnectionFactory();\n XAConnectionFactory[] xAConnectionFactoryArray0 = connectionFactories0.getXAConnectionFactory();\n XAConnectionFactory[] xAConnectionFactoryArray1 = connectionFactories0.getXAConnectionFactory();\n assertNotSame(xAConnectionFactoryArray1, xAConnectionFactoryArray0);\n }", "public void test_GetAllContestChannels_Failure2() throws Exception {\r\n try {\r\n initContext();\r\n\r\n entityManager.enablePersistenceException(true);\r\n\r\n beanUnderTest.getAllContestChannels();\r\n fail(\"ContestManagementException is expected.\");\r\n } catch (ContestManagementException e) {\r\n // success\r\n }\r\n }", "@Ignore //DKH\n @Test\n public void testMakePersistent() {\n }", "@Disabled\n @Test\n void processDepositValidatorPubkeysDoesNotContainPubkeyAndMinEmptyValidatorIndexIsNegative() {\n }", "@Test\n\tpublic void enableDisable() {\n\t\ttry {\n\t\t\t// mac.AcceptedBanknoteStorage.disable();\n\t\t\t// mac.AcceptedBanknoteStorage.enable();\n\t\t\tmac.checkoutStation.banknoteStorage.enable();\n\t\t\tmac.checkoutStation.banknoteStorage.disable();\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tfail(\"disabling and enabling throws an error\");\n\t\t}\n\t}", "@Test\n public void testGetReservedKeys() {\n assertEquals(\"Timestamp must match\",TIMESTAMP.toString(), ev.get(\"_timestamp\"));\n assertEquals(\"Sources must match\",source,ev.get(\"_source\"));\n }", "@Test\n @WithSystemProperty(key = IgniteSystemProperties.IGNITE_DUMP_THREADS_ON_FAILURE, value = \"false\")\n public void testConnectingNodesStopIfNoConnectedNodeIsPresented() throws Exception {\n /*\n Test reproduces the needed behavior (two nodes in CONNECTING state) doing the following:\n - it starts two regular nodes, node0 (coordinator) and node1 (just another server) with special\n discovery SPIs;\n - when node1 receives NodeAddFinished for subsequently started node2, it doesn't send it to the node\n but closes disco socket to node2 leaving it in CONNECTING state and generating NodeFailed for it.\n Also at this moment node3 is started;\n - when node0 receives this NodeFailed it fails (because special SPI throws an exception) and stops;\n - when node1 receives another join request from node2 or NodeAdded from node3 reaches it back,\n node1's special SPI also throws an exception so it goes down as well;\n - as a result, both node2 and node3 get stuck in CONNECTING state and as they use special IpFinders\n they see each other and are able to send join requests to each other back and forth.\n\n The whole purpose of the test is to verify that these two nodes won't stuck in CONNECTING state forever\n and will eventually stop.\n */\n\n usePortFromNodeName = true;\n\n final AtomicInteger joinReqsCntr = new AtomicInteger(0);\n\n final AtomicReference<IgniteInternalFuture> futureRef = new AtomicReference();\n\n final UUID node2Id = UUID.randomUUID();\n\n final TcpDiscoverySpi node0SpecialSpi = new TcpDiscoverySpi() {\n @Override protected void startMessageProcess(TcpDiscoveryAbstractMessage msg) {\n if (msg instanceof TcpDiscoveryNodeFailedMessage) {\n TcpDiscoveryNodeFailedMessage failedMsg = (TcpDiscoveryNodeFailedMessage)msg;\n\n UUID failedNodeId = failedMsg.failedNodeId();\n\n if (failedNodeId.equals(node2Id))\n throw new RuntimeException(\"Stop node0 exception\");\n }\n\n if (msg instanceof TcpDiscoveryJoinRequestMessage) {\n TcpDiscoveryJoinRequestMessage joinReq = (TcpDiscoveryJoinRequestMessage)msg;\n\n if (joinReq.node().id().equals(node2Id))\n joinReqsCntr.incrementAndGet();\n }\n }\n };\n\n final TcpDiscoverySpi node1SpecialSpi = new TcpDiscoverySpi() {\n @Override protected void startMessageProcess(TcpDiscoveryAbstractMessage msg) {\n if (msg instanceof TcpDiscoveryNodeAddFinishedMessage) {\n TcpDiscoveryNodeAddFinishedMessage finishedMsg = (TcpDiscoveryNodeAddFinishedMessage)msg;\n\n UUID nodeId = finishedMsg.nodeId();\n\n if (nodeId.equals(node2Id)) {\n Object workerObj = GridTestUtils.getFieldValue(impl, \"msgWorker\");\n\n OutputStream out = GridTestUtils.getFieldValue(workerObj, \"out\");\n\n try {\n out.close();\n\n log.warning(\"Out to 'sick' node closed\");\n }\n catch (Exception ignored) {\n // No-op.\n }\n\n futureRef.set(GridTestUtils.runAsync(() -> {\n try {\n startGrid(NODE_WITH_PORT_ID_3);\n }\n catch (Exception ignored) {\n //NO-op.\n }\n }));\n }\n }\n\n if (msg instanceof TcpDiscoveryJoinRequestMessage) {\n TcpDiscoveryJoinRequestMessage joinReq = (TcpDiscoveryJoinRequestMessage)msg;\n\n int joinReqsCount = joinReqsCntr.get();\n\n if (joinReq.node().id().equals(node2Id) && joinReqsCount == 1)\n throw new RuntimeException(\"Stop node1 exception by subsequent join req\");\n }\n\n if (msg instanceof TcpDiscoveryNodeAddedMessage) {\n TcpDiscoveryNodeAddedMessage addedMsg = (TcpDiscoveryNodeAddedMessage)msg;\n\n if (addedMsg.node().discoveryPort() == 47503)\n throw new RuntimeException(\"Stop node1 exception by new node added msg\");\n }\n }\n };\n\n specialSpi = node0SpecialSpi;\n\n startGrid(NODE_WITH_PORT_ID_0);\n\n specialSpi = node1SpecialSpi;\n\n startGrid(NODE_WITH_PORT_ID_1);\n\n specialIpFinder0 = new TcpDiscoveryVmIpFinder(false);\n\n ((TcpDiscoveryVmIpFinder)specialIpFinder0).setAddresses(Arrays.asList(\"127.0.0.1:47501\", \"127.0.0.1:47503\"));\n\n specialIpFinder1 = new TcpDiscoveryVmIpFinder(false);\n\n ((TcpDiscoveryVmIpFinder)specialIpFinder1).setAddresses(Arrays.asList(\"127.0.0.1:47502\"));\n\n specialSpi = null;\n\n nodeId = node2Id;\n\n boolean expectedExceptionThrown = false;\n\n try {\n startGrid(NODE_WITH_PORT_ID_2);\n }\n catch (Exception e) {\n Throwable cause0 = e.getCause();\n\n assertNotNull(cause0);\n\n Throwable cause1 = cause0.getCause();\n\n assertNotNull(cause1);\n\n String errorMsg = cause1.getMessage();\n\n assertTrue(\n \"Expected error message was not found: \" + errorMsg,\n errorMsg.contains(\"Failed to connect to any address from IP finder\")\n );\n\n expectedExceptionThrown = true;\n }\n\n assertTrue(\"Expected exception was not thrown.\", expectedExceptionThrown);\n\n IgniteInternalFuture startGridFut = futureRef.get();\n\n if (startGridFut != null)\n startGridFut.get();\n }", "@Test\n public void patchNoOp() throws Exception {\n\n }", "@Override\n protected String getRedisKey() {\n return REDIS_KEY;\n }", "@Test\r\n public void testApacheHttpClient4ExecutorAgain() throws Exception\r\n {\r\n doTestApacheHttpClient4Executor();\r\n }", "public void testExplictFailoverOptionNofailover() throws Exception\n {\n _url = \"amqp://user:pass@clientid/test?brokerlist='tcp://localhost:5672'&failover='nofailover'\";\n _connectionUrl = new AMQConnectionURL(_url);\n _connection = createStubConnection();\n\n _failoverPolicy = new FailoverPolicy(_connectionUrl, _connection);\n\n assertTrue(\"Unexpected failover method\", _failoverPolicy.getCurrentMethod() instanceof NoFailover);\n }", "@Test(timeout = 4000)\n public void test26() throws Throwable {\n ConnectionFactories connectionFactories0 = new ConnectionFactories();\n connectionFactories0.clearConnectionFactory();\n connectionFactories0.clearXATopicConnectionFactory();\n assertEquals(0, connectionFactories0.getConnectionFactoryCount());\n }", "@Test\n public void testLowVolumeDoesNotTripCircuit() {\n try {\n int sleepWindow = 200;\n int lowVolume = 5;\n\n HystrixCommandProperties.Setter properties = HystrixCommandPropertiesTest.getUnitTestPropertiesSetter().withCircuitBreakerSleepWindowInMilliseconds(sleepWindow).withCircuitBreakerRequestVolumeThreshold(lowVolume);\n HystrixCommandMetrics metrics = getMetrics(properties);\n HystrixCircuitBreaker cb = getCircuitBreaker(key, CommandOwnerForUnitTest.OWNER_TWO, metrics, properties);\n\n // fail\n metrics.markFailure(1000);\n metrics.markFailure(1000);\n metrics.markFailure(1000);\n metrics.markFailure(1000);\n\n // even though it has all failed we won't trip the circuit because the volume is low\n assertTrue(cb.allowRequest());\n assertFalse(cb.isOpen());\n\n } catch (Exception e) {\n e.printStackTrace();\n fail(\"Error occurred: \" + e.getMessage());\n }\n }", "@Test\n public void get() {\n Object str = redisUtil.get(\"key\");\n System.out.println(str);\n }", "@Test\n public void testHyperLogLog(){\n String redisKey= \"test:hll:01\";\n for (int i = 0; i <= 100000; i++) {\n redisTemplate.opsForHyperLogLog().add(redisKey,i);\n }\n\n for (int i = 0; i <= 100000; i++) {\n int r = (int) (Math.random() * 100000+1);\n redisTemplate.opsForHyperLogLog().add(redisKey,r);\n }\n\n Long size = redisTemplate.opsForHyperLogLog().size(redisKey);\n System.out.println(size);\n }", "@Test(timeout = 4000)\n public void test63() throws Throwable {\n ConnectionFactories connectionFactories0 = new ConnectionFactories();\n connectionFactories0.clearTopicConnectionFactory();\n XATopicConnectionFactory xATopicConnectionFactory0 = new XATopicConnectionFactory();\n connectionFactories0.addXATopicConnectionFactory(xATopicConnectionFactory0);\n XAQueueConnectionFactory[] xAQueueConnectionFactoryArray0 = connectionFactories0.getXAQueueConnectionFactory();\n assertEquals(0, xAQueueConnectionFactoryArray0.length);\n }", "@Test(timeout = 4000)\n public void test28() throws Throwable {\n ConnectionFactories connectionFactories0 = new ConnectionFactories();\n connectionFactories0.getXAQueueConnectionFactory();\n connectionFactories0.clearXAQueueConnectionFactory();\n ConnectionFactory connectionFactory0 = new ConnectionFactory();\n FileSystemHandling.shouldAllThrowIOExceptions();\n XAQueueConnectionFactory xAQueueConnectionFactory0 = new XAQueueConnectionFactory();\n connectionFactories0.addXAQueueConnectionFactory(xAQueueConnectionFactory0);\n assertNull(xAQueueConnectionFactory0.getName());\n }", "@Test\n\tpublic void testServerDisconnectedClientsDontGetWrite() throws Exception {\n\t\tKeyValueServer server = new KeyValueServer();\n\t\tArrayList<String> files = populateServer(server);\n\t\t//Set up fake clients\n\t\tKeyValueClient[] clients = new KeyValueClient[N_REPLICAS];\n\t\tString contentToWrite = \"testServerManyClientsRegisterAllGetInnerWrite.\" + System.currentTimeMillis() + \".\";\n\t\tfor (int i = 0; i < N_REPLICAS; i++) {\n\t\t\tclients[i] = mock(KeyValueClient.class);\n\n\t\t\tif (i % 2 == 0) {\n\t\t\t\t//Half of the clients will expect to get the write\n\t\t\t\tfor (String p : files)\n\t\t\t\t\texpect(clients[i].innerWriteKey(eq(p.toString()), eq(contentToWrite + p.toString()), anyLong())).andReturn(true);\n\t\t\t\tclients[i].commitTransaction(anyLong());\n\t\t\t\texpectLastCall().anyTimes();\n\t\t\t\tclients[i].abortTransaction(anyLong());\n\t\t\t\texpectLastCall().anyTimes();\n\t\t\t} else {\n\t\t\t\t//Other half of the clients will expect to get nothing!\n\t\t\t}\n\n\t\t\treplay(clients[i]);\n\t\t}\n\t\tfor (int i = 0; i < N_REPLICAS; i++) {\n\t\t\tserver.registerClient(\"fake hostname\", 9000 + i, clients[i]);\n\t\t}\n\t\tfor (int i = 0; i < N_REPLICAS; i++) {\n\t\t\tif (i % 2 != 0) {\n\t\t\t\tserver.cacheDisconnect(\"fake hostname\", 9000 + i);\n\t\t\t}\n\t\t}\n\t\tfor (String p : files)\n\t\t\tserver.set(p.toString(), contentToWrite + p.toString());\n\t\tfor (int i = 0; i < N_REPLICAS; i++) {\n\t\t\tif (i % 2 == 0)\n\t\t\t\tserver.cacheDisconnect(\"fake hostname\", 9000 + i);\n\t\t}\n\t\tfor (KeyValueClient client : clients)\n\t\t\tverify(client);\n\t}", "@Test\n public void testOldMemberCantJoinRolledLocators() {\n VM oldServer = Host.getHost(0).getVM(sourceConfiguration, 1);\n Properties props = getSystemProperties(); // uses the DUnit locator\n try {\n oldServer.invoke(invokeCreateCache(props));\n } catch (RMIException e) {\n Throwable cause = e.getCause();\n if ((cause instanceof AssertionError)) {\n cause = cause.getCause();\n if (cause != null && cause.getMessage() != null && !cause.getMessage().startsWith(\n \"Rejecting the attempt of a member using an older version of the product to join the distributed system\")) {\n throw e;\n }\n }\n }\n }", "@Override\n @Test(groups = {\"Resource access\"})\n public void testResource00() throws Exception {\n super.testResource00();\n }", "@Test\n public void consistencyCheckerDisabledTest() throws Exception {\n // 1. only one participant, consistency checker should be disabled\n AmbryServer server =\n new AmbryServer(new VerifiableProperties(props), clusterAgentsFactory, notificationSystem, time);\n server.startup();\n assertNull(\"The mismatch metric should not be created\", server.getServerMetrics().stoppedReplicasMismatchCount);\n server.shutdown();\n // 2. there are two participants but period of checker is zero, consistency checker should be disabled.\n props.setProperty(\"server.participants.consistency.checker.period.sec\", Long.toString(0L));\n List<ClusterParticipant> participants = new ArrayList<>();\n for (int i = 0; i < 2; ++i) {\n participants.add(\n new MockClusterParticipant(Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), null,\n null, null));\n }\n clusterAgentsFactory.setClusterParticipants(participants);\n server = new AmbryServer(new VerifiableProperties(props), clusterAgentsFactory, notificationSystem, time);\n server.startup();\n assertNull(\"The mismatch metric should not be created\", server.getServerMetrics().stoppedReplicasMismatchCount);\n server.shutdown();\n }", "@Disabled(\"Disabled test\")\n @Test\n void testDisable() {\n assertEquals(testing1, testing2);\n }", "@Test\n public void testClientMessageDecode() throws Exception {\n testNettyMessageClientDecoding(false, false, false);\n }", "@Override\n\tpublic boolean test() {\n\t\treturn false;\n\t}", "@Test\r\n @Ignore\r\n public void testHaveToQuit() {\r\n }", "public JMSBCXAjavaeeInOnlyTestService() {\n }", "@Test(timeout = 4000)\n public void test67() throws Throwable {\n ConnectionFactories connectionFactories0 = new ConnectionFactories();\n connectionFactories0.removeXAQueueConnectionFactory((XAQueueConnectionFactory) null);\n XAConnectionFactory[] xAConnectionFactoryArray0 = connectionFactories0.getXAConnectionFactory();\n assertEquals(0, xAConnectionFactoryArray0.length);\n }", "@Test\n public void lowHealthWarningTest() {\n }", "@Test\n public void testNoGuaranteeModeCannotReplayTuples() {\n KafkaSpoutConfig<String, String> spoutConfig = createKafkaSpoutConfigBuilder(mock(TopicFilter.class), mock(ManualPartitioner.class), -1)\n .setProcessingGuarantee(KafkaSpoutConfig.ProcessingGuarantee.NO_GUARANTEE)\n .setTupleTrackingEnforced(true)\n .build();\n doTestModeCannotReplayTuples(spoutConfig);\n }", "@Test\n\tpublic void testCachePushing()\n\t{\n\t messageCacheStorage.pushMessage(QUEUE_NAME, dummyMessage());\n Message message=messageCacheStorage.getMessage(\"testQueue\");\n Assert.assertTrue(\"TestMessage\".equals(message.getMessage()));\n messageCacheStorage.invalidate(QUEUE_NAME);\n message=messageCacheStorage.getMessage(QUEUE_NAME);\n Assert.assertNull(message); \n\t}", "@Test\n public void mustNotDisableMoreThanOnce() throws RemoteException {\n mHbmController.enable(mOnEnabled);\n\n // Should set the appropriate refresh rate for UDFPS and notify the caller.\n verify(mDisplayCallback).onHbmEnabled(eq(DISPLAY_ID));\n verify(mOnEnabled).run();\n\n // First request to disable the UDFPS mode.\n mHbmController.disable(mOnDisabled);\n\n // Should unset the refresh rate and notify the caller.\n verify(mOnDisabled).run();\n verify(mDisplayCallback).onHbmDisabled(eq(DISPLAY_ID));\n\n // Second request to disable the UDFPS mode, when it's already disabled.\n mHbmController.disable(mOnDisabled);\n\n // Should ignore the second request.\n verifyNoMoreInteractions(mOnDisabled);\n verifyNoMoreInteractions(mDisplayCallback);\n }" ]
[ "0.6645744", "0.6055408", "0.60156554", "0.5828165", "0.57768893", "0.5583059", "0.55813086", "0.5524731", "0.5492727", "0.54912764", "0.5486515", "0.54320985", "0.54061913", "0.5395535", "0.5380858", "0.53595185", "0.53595185", "0.5345423", "0.5330688", "0.5322148", "0.5305043", "0.5294088", "0.5289924", "0.5241942", "0.52396303", "0.52391726", "0.5219084", "0.5204387", "0.52009267", "0.51932704", "0.51737815", "0.5165955", "0.5158084", "0.51572293", "0.5156968", "0.51569295", "0.5149472", "0.5141596", "0.514123", "0.51403147", "0.51383287", "0.51323014", "0.51212883", "0.511431", "0.5091879", "0.50817966", "0.50798243", "0.50785077", "0.50763226", "0.50722736", "0.5066621", "0.5063022", "0.50566447", "0.50482404", "0.5032323", "0.5013937", "0.50136423", "0.50102973", "0.50056016", "0.50028324", "0.49994165", "0.49964395", "0.49923408", "0.49828723", "0.4982771", "0.49823895", "0.49807003", "0.49797645", "0.49792254", "0.4962376", "0.49591067", "0.4953564", "0.4946354", "0.49449146", "0.49444234", "0.49424246", "0.49381757", "0.49368003", "0.4926839", "0.49252433", "0.49231187", "0.492161", "0.49202132", "0.49186283", "0.4912511", "0.4908037", "0.4905432", "0.49034333", "0.49002904", "0.48994467", "0.4895678", "0.48906073", "0.48887083", "0.4888686", "0.4888421", "0.48877725", "0.48872873", "0.4886739", "0.48794886", "0.4878599", "0.48780793" ]
0.0
-1
Disable these tests for Redis 2 and below
@SuppressWarnings("unchecked") @Test public void variableResponseTypes() throws Exception { assumeThat(getEnv().serverVersion[0], is(greaterThanOrEqualTo(3))); assertThat(awaitIndefinitely(commandClient.zrem(key("Sicily"), asList(buf("Palermo"), buf("Catania")))), is(lessThanOrEqualTo(2L))); final Long geoaddLong = awaitIndefinitely(commandClient.geoadd(key("Sicily"), asList(new BufferLongitudeLatitudeMember(13.361389d, 38.115556d, buf("Palermo")), new BufferLongitudeLatitudeMember(15.087269d, 37.502669d, buf("Catania"))))); assertThat(geoaddLong, is(2L)); final List<Buffer> georadiusBuffers = awaitIndefinitely(commandClient.georadius(key("Sicily"), 15d, 37d, 200d, KM)); assertThat(georadiusBuffers, contains(buf("Palermo"), buf("Catania"))); final List<?> georadiusMixedList = awaitIndefinitely(commandClient.georadius(key("Sicily"), 15d, 37d, 200d, KM, WITHCOORD, WITHDIST, null, 5L, ASC, null, null)); final Matcher georadiusResponseMatcher = contains( contains(is(buf("Catania")), bufStartingWith(buf("56.")), contains(bufStartingWith(buf("15.")), bufStartingWith(buf("37.")))), contains(is(buf("Palermo")), bufStartingWith(buf("190.")), contains(bufStartingWith(buf("13.")), bufStartingWith(buf("38."))))); assertThat(georadiusMixedList, georadiusResponseMatcher); assertThat(awaitIndefinitely(commandClient.geodist(key("Sicily"), buf("Palermo"), buf("Catania"))), is(greaterThan(0d))); assertThat(awaitIndefinitely(commandClient.geodist(key("Sicily"), buf("foo"), buf("bar"))), is(nullValue())); assertThat(awaitIndefinitely(commandClient.geopos(key("Sicily"), buf("Palermo"), buf("NonExisting"), buf("Catania"))), contains( contains(bufStartingWith(buf("13.")), bufStartingWith(buf("38."))), is(nullValue()), contains(bufStartingWith(buf("15.")), bufStartingWith(buf("37."))))); final List<Buffer> evalBuffers = awaitIndefinitely(commandClient.evalList(buf("return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}"), 2L, asList(buf("key1"), buf("key2")), asList(buf("first"), buf("second")))); assertThat(evalBuffers, contains(buf("key1"), buf("key2"), buf("first"), buf("second"))); final Buffer evalBuf = awaitIndefinitely(commandClient.eval(buf("return redis.call('set','foo','bar')"), 0L, emptyList(), emptyList())); assertThat(evalBuf, is(buf("OK"))); final Long evalLong = awaitIndefinitely(commandClient.evalLong(buf("return 10"), 0L, emptyList(), emptyList())); assertThat(evalLong, is(10L)); final List<?> evalMixedList = awaitIndefinitely(commandClient.evalList(buf("return {1,2,{3,'four'}}"), 0L, emptyList(), emptyList())); assertThat(evalMixedList, contains(1L, 2L, asList(3L, buf("four")))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test(groups = { \"Integration\" })\n public void testNonStandardPort() throws Exception {\n redis = app.createAndManageChild(EntitySpec.create(RedisStore.class)\n .configure(RedisStore.REDIS_PORT, PortRanges.fromString(\"10000+\")));\n app.start(ImmutableList.of(loc));\n\n EntityAsserts.assertAttributeEqualsEventually(redis, Startable.SERVICE_UP, true);\n JedisSupport support = new JedisSupport(redis);\n support.redisTest();\n\n // Increase timeout because test was failing on jenkins sometimes. The log shows only one \n // call to `info server` (for obtaining uptime) which took 26 seconds; then 4 seconds later \n // this assert failed (with it checking every 500ms). The response did correctly contain\n // `uptime_in_seconds:27`.\n EntityAsserts.assertPredicateEventuallyTrue(ImmutableMap.of(\"timeout\", Duration.FIVE_MINUTES), redis, new Predicate<RedisStore>() {\n @Override public boolean apply(@Nullable RedisStore input) {\n return input != null &&\n input.getAttribute(RedisStore.UPTIME) > 0 &&\n input.getAttribute(RedisStore.TOTAL_COMMANDS_PROCESSED) >= 0 &&\n input.getAttribute(RedisStore.TOTAL_CONNECTIONS_RECEIVED) >= 0 &&\n input.getAttribute(RedisStore.EXPIRED_KEYS) >= 0 &&\n input.getAttribute(RedisStore.EVICTED_KEYS) >= 0 &&\n input.getAttribute(RedisStore.KEYSPACE_HITS) >= 0 &&\n input.getAttribute(RedisStore.KEYSPACE_MISSES) >= 0;\n }\n });\n }", "@Test\n public void test2() { User user = new User();\n// user.setId(\"asdasd\");\n// user.setUserType(1);\n// user.setUpdateDate(new Date());\n// redisHelper.set(\"testKey\",user);\n// System.out.println(redisHelper.get(\"testKey\", User.class));\n//\n redisHelper.del(\"testKey\");\n System.out.println(redisHelper.get(\"testKey\", User.class));\n\n }", "@Test(groups = { \"Integration\" })\n public void testRedisConnection() throws Exception {\n redis = app.createAndManageChild(EntitySpec.create(RedisStore.class));\n app.start(ImmutableList.of(loc));\n\n EntityAsserts.assertAttributeEqualsEventually(redis, Startable.SERVICE_UP, true);\n\n JedisSupport support = new JedisSupport(redis);\n support.redisTest();\n }", "@Test\n @FixFor(\"DBZ-4509\")\n public void testRedisConnectionRetry() throws Exception {\n Testing.Print.enable();\n\n Jedis jedis = new Jedis(HostAndPort.from(RedisTestResourceLifecycleManager.getRedisContainerAddress()));\n // wait until the offsets are written for the first time\n TestUtils.awaitHashSizeGte(jedis, OFFSETS_HASH_NAME, 1);\n\n // clear the offsets key\n jedis.del(OFFSETS_HASH_NAME);\n\n // pause container\n Testing.print(\"Pausing container\");\n RedisTestResourceLifecycleManager.pause();\n\n final PostgresConnection connection = TestUtils.getPostgresConnection();\n Testing.print(\"Creating new redis_test table and inserting 5 records to it\");\n connection.execute(\n \"CREATE TABLE inventory.redis_test (id INT PRIMARY KEY)\",\n \"INSERT INTO inventory.redis_test VALUES (1)\",\n \"INSERT INTO inventory.redis_test VALUES (2)\",\n \"INSERT INTO inventory.redis_test VALUES (3)\",\n \"INSERT INTO inventory.redis_test VALUES (4)\",\n \"INSERT INTO inventory.redis_test VALUES (5)\");\n connection.close();\n\n Testing.print(\"Sleeping for 2 seconds to flush records\");\n Thread.sleep(2000);\n Testing.print(\"Unpausing container\");\n\n RedisTestResourceLifecycleManager.unpause();\n Testing.print(\"Sleeping for 2 seconds to reconnect to redis and write offset\");\n\n // wait until the offsets are re-written\n TestUtils.awaitHashSizeGte(jedis, OFFSETS_HASH_NAME, 1);\n\n Map<String, String> redisOffsets = jedis.hgetAll(OFFSETS_HASH_NAME);\n jedis.close();\n assertThat(redisOffsets.size() > 0).isTrue();\n }", "private RedisClient() {\n\n }", "void failedToStart(RedisServer redisServer);", "private static void test(Jedis jedis) {\n\n JedisProxyCglib jp = new JedisProxyCglib();\n Jedis je = jp.getInstance(jedis);\n je.set(\"uuu11\", \"x\");\n je.set(\"uuu12\", \"x2\");\n je.set(\"uuu13\", \"x2\");\n }", "public void testCheckAndRestoreIfNeeded_failure()\n {\n // SETUP\n String host = \"localhost\";\n int port = 1234;\n String service = \"doesn'texist\";\n MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();\n\n RegistryKeepAliveRunner runner = new RegistryKeepAliveRunner( host, port, service );\n runner.setCacheEventLogger( cacheEventLogger );\n\n // DO WORK\n runner.checkAndRestoreIfNeeded();\n\n // VERIFY\n // 1 for the lookup, one for the rebind since the server isn't created yet\n assertEquals( \"error tally\", 2, cacheEventLogger.errorEventCalls );\n //System.out.println( cacheEventLogger.errorMessages );\n }", "@Test(groups = \"testAuth\", dependsOnGroups = \"authEnable\", priority = 1)\n public void testKVWithoutAuth() throws InterruptedException {\n assertThatThrownBy(() -> this.authDisabledKVClient.put(rootRoleKey, rootRoleValue).get())\n .hasMessageContaining(\"etcdserver: user name is empty\");\n assertThatThrownBy(() -> this.authDisabledKVClient.put(userRoleKey, rootRoleValue).get())\n .hasMessageContaining(\"etcdserver: user name is empty\");\n assertThatThrownBy(() -> this.authDisabledKVClient.get(rootRoleKey).get())\n .hasMessageContaining(\"etcdserver: user name is empty\");\n assertThatThrownBy(() -> this.authDisabledKVClient.get(userRoleKey).get())\n .hasMessageContaining(\"etcdserver: user name is empty\");\n }", "private static void clearRedis() {\n StringRedisTemplate redisTemplate = getRedisTemplate();\n Set<String> keys = redisTemplate.keys(\"*\");\n for (String key : keys) {\n redisTemplate.delete(key);\n Assert.assertFalse(redisTemplate.hasKey(key));\n }\n }", "@Test\n public void skipSslTest() {\n // TODO: test skipSsl\n }", "@Override\n @Before\n public void setUp() throws Exception {\n System.setProperty(\"org.apache.activemq.transport.AbstractInactivityMonitor.keepAliveTime\", \"2\");\n this.realStore = true;\n super.setUp();\n }", "@org.junit.Test\r\n public void test() {\n Jedis jedis = new Jedis(\"16.186.75.216\");\r\n System.out.println(\"connected successfully\");\r\n //set redis string value\r\n jedis.set(\"runoobkey\", \"www.runoob.com\");\r\n // get the stored value based on the key\r\n System.out.println(\"redis store strings: \"+ jedis.get(\"runoobkey\"));\r\n }", "@Test\n public void testNonTransactional() throws Throwable {\n List<MagicKey> keys = init();\n\n log.info(\"Invoking rehash event\");\n performRehashEvent(false);\n\n waitForRehashCompletion();\n log.info(\"Rehash complete\");\n\n for (MagicKey key : keys) assertOnAllCachesAndOwnership(key, \"v0\");\n }", "@Test\n public void orgApacheFelixEventadminIgnoreTimeoutTest() {\n // TODO: test orgApacheFelixEventadminIgnoreTimeout\n }", "public boolean isReliable() {\n return false;\n }", "public boolean isReliable() {\n return false;\n }", "@Test\n public void testSet() throws InterruptedException {\n\n final String k = \"mLock\";\n final String v = \"mValue\";\n\n// long l = 10;\n// Boolean isGetLock = redisTemplate.opsForValue().setIfAbsent(k, v, l, TimeUnit.SECONDS);\n// if (isGetLock) {\n// System.out.println(Thread.currentThread().getName() + \"获得锁成功\");\n// }\n\n\n// redisTemplate.opsForValue().set(\"k6\", \"v6\");\n// Duration duration = Duration.ofSeconds(10);\n// redisTemplate.expire(k, duration);\n// TimeUnit.SECONDS.sleep(10);\n// for (int i = 0; i < 100; i++) {\n// new Thread(() -> {\n// Boolean isGetLock = redisTemplate.opsForValue().setIfAbsent(k, v, 100, TimeUnit.SECONDS);\n//\n// if (isGetLock) {\n// System.out.println(Thread.currentThread().getName() + \"获得锁成功\");\n// } else {\n// System.out.println(Thread.currentThread().getName() + \"获得锁失败\");\n// }\n// }, \"thread-\" + i).start();\n// }\n\n for (int i = 0; i < 100; i++) {\n String key = \"kk\" +i;\n String value = \"vv\" + i;\n\n redisTemplate.opsForValue().set(key, value);\n// new Thread(new Task(key, value, redisTemplate)).start();\n// new Thread(() -> {\n// System.out.println(\"set \" + key + \":\" +value);\n// redisTemplate.opsForValue().set(key, value);\n//\n// if(key.equals(\"kk99\")) {\n// System.out.println(\"haha\");\n// }\n// }).start();\n }\n }", "@RepeatedTest(value = Integer.MAX_VALUE)\n @Disabled\n void test() {\n\n long start = System.currentTimeMillis();\n\n SimpleClientImpl client = new SimpleClientImpl(Config.HOST, Config.PORT);\n\n assertNotNull(client);\n\n logger.info(\"Request Success : \" + counter.incrementAndGet() + \" \"\n + (System.currentTimeMillis() - start));\n\n }", "@Test\n public void testRouterAllServersDown() throws Exception {\n defaultServer1.cancelRegistration();\n defaultServer2.cancelRegistration();\n\n testSyncServiceUnavailable();\n Assert.assertEquals(0, defaultServer1.getNumRequests());\n Assert.assertEquals(0, defaultServer2.getNumRequests());\n\n defaultServer1.registerServer();\n defaultServer2.registerServer();\n }", "public RedisConnector() {\n super();\n\n ensureRedisClient();\n }", "@Test(expected = DataRetrievalFailureException.class)\n public void testGet() {\n // given\n // No current value\n\n // when\n redisAtomicIntegerExampleBean.get();\n }", "@Override\n public void enableDisableDiscrete() {\n // empty bc mock\n }", "@Test\n\tpublic void testReadTicketFail() {\n\t}", "public interface MainTestConfig {\n /**\n * hostname for the RabbitMQ server\n * should not be the same machine as the tests runner\n * @return host or ip for the target host\n */\n public String rabbitHost();\n\n /**\n * TCP port for RabbitMQ\n * @return\n */\n public Integer rabbitPort();\n\n /**\n * Should the tests use long lived TCP connections or not\n * @return true or false\n */\n public Boolean tcpReuseConn();\n\n /**\n * Should the tests reuse channels\n * @return true orr false\n */\n public Boolean tcpReuseChannel();\n\n /**\n * specifies the size for the messages enqueued before starting tests\n * @return\n */\n public Integer maxMessages();\n\n /**\n * name of the queue hosting messages\n * @return\n */\n public String queueName();\n\n /**\n * name of the exchange used to publish messages\n * @return\n */\n public String exchangeName();\n\n /**\n * routing key used to deliver messages through the exchange\n * @return\n */\n public String routingKey();\n\n /**\n * should the queue be created as a lazy one?\n * @return\n */\n public Boolean lazyQueue();\n\n /**\n * prefetch size\n * @return\n */\n public Integer prefetch();\n\n /**\n * shoud messages be persisted\n * @return\n */\n public Boolean persistent();\n\n /**\n * is the queue exclusive? shoud le always false\n * @return\n */\n public Boolean exclusive();\n\n /**\n * is the queue flagged as autodelete ? should be false\n * @return\n */\n public Boolean autodelete();\n\n /**\n * delays to sleep while consuming messages\n * @return\n */\n public Integer threadDelay();\n}", "@Test\n public void testMigrate() {\n log.info(\"test migrate slot\");\n Set<HostAndPort> jedisClusterNode = new HashSet<HostAndPort>();\n jedisClusterNode.add(nodeInfo1);\n JedisCluster jc = new JedisCluster(jedisClusterNode, DEFAULT_TIMEOUT, DEFAULT_TIMEOUT, DEFAULT_REDIRECTIONS, \"cluster\", DEFAULT_CONFIG);\n String node3Id = JedisClusterTestUtil.getNodeId(node3.clusterNodes());\n String node2Id = JedisClusterTestUtil.getNodeId(node2.clusterNodes());\n node3.clusterSetSlotMigrating(15363, node2Id);\n node2.clusterSetSlotImporting(15363, node3Id);\n try {\n node2.set(\"e\", \"e\");\n } catch (JedisMovedDataException jme) {\n assertEquals(15363, jme.getSlot());\n assertEquals(new HostAndPort(localHost, nodeInfo3.getPort()), jme.getTargetNode());\n }\n\n try {\n node3.set(\"e\", \"e\");\n } catch (JedisAskDataException jae) {\n assertEquals(15363, jae.getSlot());\n assertEquals(new HostAndPort(localHost, nodeInfo2.getPort()), jae.getTargetNode());\n }\n\n jc.set(\"e\", \"e\");\n\n try {\n node2.get(\"e\");\n } catch (JedisMovedDataException jme) {\n assertEquals(15363, jme.getSlot());\n assertEquals(new HostAndPort(localHost, nodeInfo3.getPort()), jme.getTargetNode());\n }\n try {\n node3.get(\"e\");\n } catch (JedisAskDataException jae) {\n assertEquals(15363, jae.getSlot());\n assertEquals(new HostAndPort(localHost, nodeInfo2.getPort()), jae.getTargetNode());\n }\n\n assertEquals(\"e\", jc.get(\"e\"));\n\n node2.clusterSetSlotNode(15363, node2Id);\n node3.clusterSetSlotNode(15363, node2Id);\n // assertEquals(\"e\", jc.get(\"e\"));\n assertEquals(\"e\", node2.get(\"e\"));\n\n // assertEquals(\"e\", node3.get(\"e\"));\n\n }", "@Test\n\tpublic void testSetIgnoreFlush() {\n\t}", "private void limitedMemoryWithoutEviction() {\n Jedis jedis = this.connector.connection();\n System.out.println(\"Collect: \" + jedis.get(\"0\")); // Redis still services read operations.\n System.out.println(jedis.set(\"0\", \"0\")); // Write operations will be refused.\n }", "@Override\n\tpublic BaseResponse setRedisTest(String key, String value) {\n\t\tbaseRedisService.setString(key, value);\n\t\treturn setResultSuccess();\n\t}", "@Test\n public void testZookeeperCacheLoader() throws InterruptedException, KeeperException, Exception {\n\n DiscoveryZooKeeperClientFactoryImpl.zk = mockZookKeeper;\n\n @SuppressWarnings(\"resource\")\n ZookeeperCacheLoader zkLoader = new ZookeeperCacheLoader(new DiscoveryZooKeeperClientFactoryImpl(), \"\", 30_000);\n\n List<String> brokers = Lists.newArrayList(\"broker-1:15000\", \"broker-2:15000\", \"broker-3:15000\");\n for (int i = 0; i < brokers.size(); i++) {\n try {\n LoadManagerReport report = i % 2 == 0 ? getSimpleLoadManagerLoadReport(brokers.get(i))\n : getModularLoadManagerLoadReport(brokers.get(i));\n zkLoader.getLocalZkCache().getZooKeeper().create(LOADBALANCE_BROKERS_ROOT + \"/\" + brokers.get(i),\n ObjectMapperFactory.getThreadLocal().writeValueAsBytes(report), ZooDefs.Ids.OPEN_ACL_UNSAFE,\n CreateMode.PERSISTENT);\n } catch (Exception e) {\n fail(\"failed while creating broker znodes\");\n }\n }\n\n // strategically wait for cache to get sync\n for (int i = 0; i < 5; i++) {\n if (zkLoader.getAvailableBrokers().size() == 3 || i == 4) {\n break;\n }\n Thread.sleep(1000);\n }\n\n // 2. get available brokers from ZookeeperCacheLoader\n List<LoadManagerReport> list = zkLoader.getAvailableBrokers();\n\n // 3. verify retrieved broker list\n Set<String> cachedBrokers = list.stream().map(loadReport -> loadReport.getWebServiceUrl())\n .collect(Collectors.toSet());\n Assert.assertEquals(list.size(), brokers.size());\n Assert.assertTrue(brokers.containsAll(cachedBrokers));\n\n // 4.a add new broker\n final String newBroker = \"broker-4:15000\";\n LoadManagerReport report = getSimpleLoadManagerLoadReport(newBroker);\n zkLoader.getLocalZkCache().getZooKeeper().create(LOADBALANCE_BROKERS_ROOT + \"/\" + newBroker,\n ObjectMapperFactory.getThreadLocal().writeValueAsBytes(report), ZooDefs.Ids.OPEN_ACL_UNSAFE,\n CreateMode.PERSISTENT);\n brokers.add(newBroker);\n\n Thread.sleep(100); // wait for 100 msec: to get cache updated\n\n // 4.b. get available brokers from ZookeeperCacheLoader\n list = zkLoader.getAvailableBrokers();\n\n // 4.c. verify retrieved broker list\n cachedBrokers = list.stream().map(loadReport -> loadReport.getWebServiceUrl()).collect(Collectors.toSet());\n Assert.assertEquals(list.size(), brokers.size());\n Assert.assertTrue(brokers.containsAll(cachedBrokers));\n\n }", "@Override\n\tpublic BaseResponse getRedis(String key) {\n\t\treturn null;\n\t}", "protected boolean disableEnableSvcs() throws Throwable {\n int i = ((int)(Math.random() * nodes));\n portString = \"\" + (i + NODE_PORT_OFFSET);\n \n return (verifySvcs(\"online\") &&\n changeSvcs(\"disable\") &&\n verifySvcs(\"disabled\") &&\n changeSvcs(\"enable\") &&\n verifySvcs(\"online\"));\n }", "@Override\n protected String getSubsystem() {\n return \"com.poesys.db.memcached_test\";\n }", "@Test(timeout = 4000)\n public void test56() throws Throwable {\n ConnectionFactories connectionFactories0 = new ConnectionFactories();\n connectionFactories0.removeXATopicConnectionFactory((XATopicConnectionFactory) null);\n QueueConnectionFactory queueConnectionFactory0 = new QueueConnectionFactory();\n connectionFactories0.addQueueConnectionFactory(queueConnectionFactory0);\n assertEquals(0, connectionFactories0.getXATopicConnectionFactoryCount());\n }", "private void workaroundCLICheckedExceptions() throws\n cli.Infinispan.HotRod.Exceptions.HotRodClientException,\n cli.Infinispan.HotRod.Exceptions.RemoteCacheManagerNotStartedException {\n }", "public interface RedisManager {\n /**\n * 得到json实例通过key\n *\n * @param key\n * @return\n */\n String getString(String key);\n\n /**\n * 从redis中解析并返回对象,如果获取和解析过程中出现异常,直接抛出\n * add by houenxun 2015.07.17\n *\n * @param key\n * @param clazz\n * @param <T>\n * @return\n */\n <T> T getObject(String key, Class<T> clazz);\n\n /**\n * 从redis中解析并返回对象,如果获取和解析过程中出现异常,忽略并返回null\n * add by houenxun 2015.07.17\n *\n * @param key\n * @param clazz\n * @param <T>\n * @return\n */\n <T> T getObjectSilently(String key, Class<T> clazz);\n\n /**\n * 从redis中解析并返回对象列表,如果获取和解析过程中出现异常,忽略并返回null\n *\n * @param key\n * @param clazz\n * @param <T>\n * @return\n */\n <T> List<T> getObjectListSilently(String key, Class<T> clazz);\n\n\n /**\n * 得到json实例通过keys\n *\n * @param keys\n * @return\n */\n List<String> getStrings(List<String> keys);\n\n /**\n * 给某个key赋值 加给予有效期\n *\n * @param key\n * @param second\n * @return\n */\n String put(String key, String json, int second);\n\n /**\n * 存储json文本通过key\n *\n * @param key\n * @param json\n * @return\n */\n String putJson(String key, String json);\n\n\n /**\n * 批量删除实例keys\n *\n * @param key\n * @return\n */\n Long delete(String key);\n\n /**\n * 批量删除\n *\n * @param keys\n * @return\n */\n boolean delete(List<String> keys);\n\n /**\n * 验证是否存在\n *\n * @param key\n * @return\n */\n boolean exists(String key);\n\n /**\n * 移除一个分数从一个key中\n *\n * @param key\n * @param value\n */\n void removeWithScore(String key, String... value);\n\n /**\n * 统计set集合中元素根据索引 score从低到高\n *\n * @param key\n * @param startIndex\n * @param pageSize\n * @return\n */\n Collection<String> getZrangeByIndex(String key, int startIndex, int pageSize);\n\n /**\n * 统计set集合中元素根据score score从低到高\n *\n * @param key\n * @param min\n * @param max\n * @return\n */\n Collection<String> getZrangeByScore(String key, Double min, Double max);\n\n /**\n * 统计set集合中元素根据索引 score从高到低\n *\n * @param key\n * @param startIndex\n * @param pageSize\n * @return\n */\n Collection<String> getZrevrangeByIndex(String key, int startIndex, int pageSize);\n\n /**\n * 统计set集合全部元素 根据分数从低到高\n *\n * @param key\n * @return\n */\n Collection<String> getZRevrangeAll(String key);\n\n /**\n * 获取总数\n *\n * @param key\n * @return\n */\n Long getZcard(String key);\n\n /**\n * 增加Hash属性\n *\n * @param key\n * @param field\n * @param value\n * @return\n */\n Long hash(String key, String field, String value);\n\n /**\n * 获取key对应hash域的值\n *\n * @param key\n * @param field\n * @return\n */\n String getHash(String key, String field);\n\n /**\n * 是否存在域\n *\n * @param key\n * @param field\n * @return\n */\n Boolean hasHashByKey(String key, String field);\n\n\n /**\n * 删除key对应hash域的值\n *\n * @param key\n * @param field\n * @return\n */\n Long delHash(String key, String field);\n\n /**\n * 批量获取key对应hash域的值\n *\n * @param key\n * @param field\n * @return\n */\n List<String> getHash(String key, String... field);\n\n\n /**\n * 获取key中的所有的hash值的key\n *\n * @param key\n * @return\n */\n Set<String> getAllHashKey(String key);\n\n\n /**\n * 获取key中的所有的hash值\n *\n * @param key\n * @return\n */\n Map<String, String> getAllHash(String key);\n\n\n /**\n * 给某个key值给予有效期\n *\n * @param key\n * @param second\n * @return\n */\n Long expire(String key, int second);\n\n\n /**\n * 从左边加入key队列\n *\n * @param key\n * @param value\n * @return\n */\n Long addList(String key, String... value);\n\n\n /**\n * 获取key队列中指定序列的值\n *\n * @param key\n * @param index\n * @return\n */\n String getListByIndex(String key, int index);\n\n\n /**\n * 删除list中的值\n *\n * @param key\n * @param count\n * @param value @return\n */\n Long remList(String key, long count, String value);\n\n\n /**\n * 设置list中的值\n *\n * @param key\n * @param count\n * @param value @return\n */\n String lSet(String key, long count, String value);\n\n /**\n * 获取队列列表\n *\n * @param key\n * @param length\n * @return\n */\n Collection<String> getList(String key, int length);\n\n\n /**\n * 增加一个元素在set队列里面\n *\n * @param key\n * @param value\n * @return\n */\n Long addWithSet(String key, String... value);\n\n\n /**\n * 将元素插入集合中\n *\n * @param key\n * @param value\n * @return\n */\n Long addSet(String key, String value);\n\n\n /**\n * 从集合中删除元素\n *\n * @param key\n * @param value\n * @return\n */\n Long delSetByValue(String key, String... value);\n\n\n /**\n * 从集合获取元素\n *\n * @param key\n * @return\n */\n Set<String> getSet(String key);\n\n /**\n * key对应的值自增1\n *\n * @param key\n * @return\n */\n Long incr(String key);\n\n /**\n * key 对应的值增1,带过期时间\n * @param key\n * @param expire\n * @return\n */\n Long incr(String key, int expire);\n\n /**\n * key获取有效时间\n *\n * @param key\n * @return\n */\n Long ttlKey(String key);\n\n /**\n * 检查是否在set集合里面\n *\n * @param key\n * @param value\n * @return\n */\n Boolean sismemberSet(String key, String value);\n\n /**\n * 检查是否在set集合里面\n *\n * @param key\n * @return\n */\n String rankSet(String key);\n\n /**\n * 存放map\n *\n * @param key\n * @param map\n * @return\n */\n String putHash(String key, Map<String, String> map);\n\n Long getIndexByMember(String key, String member);\n\n /**\n * setnx\n * @param key\n * @param value\n * @param expire 超时时间,秒。若不超时则设置0\n * @return\n */\n boolean setNX(String key, String value, int expire);\n\n /**\n * 通过前缀获取所有的keys\n * @param prefix\n * @return\n */\n Collection<String> getKeys(String prefix);\n\n /**\n * 不catch异常信息的方式获取缓存值\n * @param key\n * @return\n */\n String getStringValue(String key);\n}", "@Test(timeout = 4000)\n public void test65() throws Throwable {\n ConnectionFactories connectionFactories0 = new ConnectionFactories();\n connectionFactories0.getTopicConnectionFactory();\n XAConnectionFactory xAConnectionFactory0 = new XAConnectionFactory();\n boolean boolean0 = connectionFactories0.removeXAConnectionFactory(xAConnectionFactory0);\n assertFalse(boolean0);\n }", "@Ignore\n @Test\n @Override\n public void testBoolean(TestContext ctx) {\n super.testBoolean(ctx);\n }", "@Test\n public void testSameKeyAccessDiffCacheMulti()\n {\n doStressTest(\"IdxTestSKADCM\", getCacheName0(), getCacheName1(),\n IdentityExtractor.INSTANCE,\n new CompositeKeyCreator()\n {\n public CompositeKey getCompositeKey(Object oKeyNatural, NamedCache cache)\n {\n return new CompositeKey(oKeyNatural, oKeyNatural);\n }\n },\n /*nServers*/3, /*cRollingRestart*/0);\n }", "public RedisClient() {\n init();\n }", "private void ensureRedisClient() {\n if (_redisClient != null) {\n return;\n }\n\n synchronized (RedisConnector.class) {\n if (_redisClient != null) {\n return;\n }\n\n ContainerLogger.getInstance().info(\"Creating shared lettuce.io RedisClient\");\n _redisClient = RedisClient.create();\n }\n }", "@Test\n public void testKillClientBeforeServer()\n {\n int cServers = 3;\n Properties propsClient = new Properties();\n propsClient.put(\"coherence.distributed.localstorage\", \"false\");\n propsClient.put(\"coherence.cluster\", \"testKillClientBeforeServer\");\n Properties propsServer = new Properties();\n propsServer.put(\"coherence.cluster\", \"testKillClientBeforeServer\");\n CoherenceClusterMember[] servers = ClusteringTests.startServers(\"server-witness\", \"witness\", propsServer, cServers);\n CoherenceClusterMember client = startCacheServer(\"client-witness\", \"witness\", null, propsClient);\n\n Eventually.assertThat(invoking(servers[cServers-1]).getClusterSize(), is(4));\n\n UID uidClient = client.getLocalMemberUID();\n client.invoke(new ConnectionDestroyer(2));\n\n Eventually.assertThat(invoking(servers[cServers-1]).getClusterMemberUIDs().contains(uidClient), is(false));\n\n for (int i = 0; i < cServers; i++)\n {\n servers[i].close();\n }\n client.close();\n ClusteringTests.stopServers(\"server-witness\", cServers);\n AbstractFunctionalTest.stopCacheServer(\"client-witness\");\n Base.sleep(10000);\n }", "void failedToStop(RedisServer redisServer, Throwable cause) throws FailedToStopException;", "@Ignore\n @Test\n public void testGetConnection() {\n System.out.println(\"getConnection\");\n Util.commonServiceIPs = \"127.0.0.1\";\n PooledConnection expResult = null;\n try {\n long ret = JMSUtil.getQueuePendingMessageCount(\"127.0.0.1\",\"localhost\",CommonKeys.INDEX_REQUEST);\n fail(\"The test case is a prototype.\");\n }\n catch(Exception e)\n {\n \n } \n }", "@Test(timeout = 4000)\n public void test72() throws Throwable {\n ConnectionFactories connectionFactories0 = new ConnectionFactories();\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, true);\n QueueConnectionFactory queueConnectionFactory0 = new QueueConnectionFactory();\n connectionFactories0.addQueueConnectionFactory(queueConnectionFactory0);\n QueueConnectionFactory[] queueConnectionFactoryArray0 = connectionFactories0.getQueueConnectionFactory();\n assertEquals(1, queueConnectionFactoryArray0.length);\n }", "@Test\n public void testAdminTimeout() throws Exception {\n long lastLimit = HConstants.DEFAULT_HBASE_CLIENT_PREFETCH_LIMIT;\n HConnection lastConnection = null;\n boolean lastFailed = false;\n int initialInvocations = RandomTimeoutRpcEngine.getNumberOfInvocations();\n for (int i = 0; i < 5 || (lastFailed && i < 100); ++i) {\n lastFailed = false;\n // Ensure the HBaseAdmin uses a new connection by changing Configuration.\n Configuration conf = HBaseConfiguration.create(TEST_UTIL.getConfiguration());\n conf.setLong(HConstants.HBASE_CLIENT_PREFETCH_LIMIT, ++lastLimit);\n try {\n HBaseAdmin admin = new HBaseAdmin(conf);\n HConnection connection = admin.getConnection();\n assertFalse(connection == lastConnection);\n // run some admin commands\n HBaseAdmin.checkHBaseAvailable(conf);\n admin.setBalancerRunning(false, false);\n } catch (MasterNotRunningException ex) {\n // Since we are randomly throwing SocketTimeoutExceptions, it is possible to get\n // a MasterNotRunningException. It's a bug if we get other exceptions.\n lastFailed = true;\n }\n }\n // Ensure the RandomTimeoutRpcEngine is actually being used.\n assertFalse(lastFailed);\n assertTrue(RandomTimeoutRpcEngine.getNumberOfInvocations() > initialInvocations);\n }", "@Test\n public void testReplicatedClient()\n {\n generateEvents(\"repl-client-test\");\n checkEvents(true, false);\n }", "@Disabled\n void ignoredTestMethod() {\n }", "@Test\n public void testKillBadServer()\n throws Exception\n {\n int cServers = 3;\n Properties propsClient = new Properties();\n propsClient.put(\"coherence.distributed.localstorage\", \"false\");\n propsClient.put(\"coherence.cluster\", \"testKillBadServer\");\n Properties propsServer = new Properties();\n propsServer.put(\"coherence.cluster\", \"testKillBadServer\");\n CoherenceClusterMember[] servers = ClusteringTests.startServers(\"server-witness2\", \"witness2\", propsServer, cServers);\n Eventually.assertThat(invoking(servers[cServers-1]).getClusterSize(), is(3));\n\n CoherenceClusterMember badServer = startCacheServer(\"bad-server2\", \"witness2\", null, propsServer);\n Eventually.assertThat(invoking(badServer).getClusterSize(), is(4));\n\n CoherenceClusterMember client = startCacheServer(\"client-witness2\", \"witness2\", null, propsClient);\n Eventually.assertThat(invoking(client).getClusterSize(), is(5));\n\n UID uidServer = badServer.getLocalMemberUID();\n client.invoke(new ConnectionDestroyer(badServer.getLocalMemberId()));\n Thread.sleep(2000); // encourage either failure on this connection\n badServer.invoke(new ConnectionDestroyer(0)); // ensure witnesses will agree\n\n Eventually.assertThat(invoking(client).getClusterMemberUIDs().contains(uidServer), is(false));\n\n badServer.close();\n for (int i = 0; i < cServers; i++)\n {\n servers[i].close();\n }\n client.close();\n ClusteringTests.stopServers(\"server-witness2\", cServers);\n AbstractFunctionalTest.stopCacheServer(\"client-witness2\");\n }", "default boolean isHeartbeatSupported() {\n return false;\n }", "@Disabled\n @Test\n void processDepositValidatorPubkeysDoesNotContainPubkey() {\n }", "@Test(timeout = 4000)\n public void test29() throws Throwable {\n ConnectionFactories connectionFactories0 = new ConnectionFactories();\n ConnectionFactory connectionFactory0 = new ConnectionFactory();\n connectionFactories0.removeConnectionFactory(connectionFactory0);\n XAConnectionFactory[] xAConnectionFactoryArray0 = connectionFactories0.getXAConnectionFactory();\n connectionFactories0.getXAConnectionFactory();\n XAConnectionFactory[] xAConnectionFactoryArray1 = connectionFactories0.getXAConnectionFactory();\n assertNotSame(xAConnectionFactoryArray1, xAConnectionFactoryArray0);\n }", "public interface RedisService {\n\n boolean existsKey(String key);\n\n void removeKey(String key);\n\n void pushMsg(String key, String message);\n\n void setRedis(String key,String value,int second);\n\n String getRedisValue(String key);\n\n boolean acquireLock(String lockKey ,long expired);\n\n void releaseLock(String lockKey);\n}", "public interface RedisService {\n// void setKey(String key,String value);\n// void setKeyVsExpireTime(String key, String value, long time); //单位为妙\n// String getValue(String key);\n\n\n\n}", "protected void skipTestIfSigningAlgorithmNotSupported() {\n\t}", "public void testUnknownFailoverMethod() throws Exception\n {\n _url = \"amqp://user:pass@clientid/test?brokerlist='tcp://localhost:5672'&failover='unknown'\";\n _connectionUrl = new AMQConnectionURL(_url);\n _connection = createStubConnection();\n\n try\n {\n new FailoverPolicy(_connectionUrl, _connection);\n fail(\"Exception not thrown\");\n }\n catch(IllegalArgumentException iae)\n {\n // PASS\n }\n }", "@Test\n public void testSameKeyAccessDiffCache()\n {\n doStressTest(\"IdxTestSKADC\", getCacheName0(), getCacheName1(),\n IdentityExtractor.INSTANCE,\n new CompositeKeyCreator()\n {\n public CompositeKey getCompositeKey(Object oKeyNatural, NamedCache cache)\n {\n return new CompositeKey(oKeyNatural, oKeyNatural);\n }\n },\n /*nServers*/1, /*cRollingRestart*/0);\n }", "protected void initDefaultStrategies() {\n\t\tRedisSerializer<String> keySerializer = new StringRedisSerializer();\n\t\tRedisSerializer<Object> valueSerializer = new JacksonSerializer();\n\t\tsetSerializer(valueSerializer);\n\t\tsetStringSerializer(keySerializer);\n\t}", "@Test\n public void testSameKeyAccessDiffCacheMultiRollingRestart()\n {\n doStressTest(\"IdxTestSKADCMRR\", getCacheName0(), getCacheName1(),\n IdentityExtractor.INSTANCE,\n new CompositeKeyCreator()\n {\n public CompositeKey getCompositeKey(Object oKeyNatural, NamedCache cache)\n {\n return new CompositeKey(oKeyNatural, oKeyNatural);\n }\n },\n /*nServers*/3, /*cRollingRestart*/5);\n }", "@Test\n\t@Disabled\n\tpublic void test() {\n\t}", "@Test\n\tpublic void testGetDriverExcludeAllocations(){ \n\t\tassertNotNull(driverService.getDriverExcludeAllocations(239537L)); \n\t}", "@Test(timeout = 4000)\n public void test15() throws Throwable {\n ConnectionFactories connectionFactories0 = new ConnectionFactories();\n QueueConnectionFactory queueConnectionFactory0 = new QueueConnectionFactory();\n connectionFactories0.removeQueueConnectionFactory(queueConnectionFactory0);\n connectionFactories0.getXATopicConnectionFactory();\n XAConnectionFactory[] xAConnectionFactoryArray0 = connectionFactories0.getXAConnectionFactory();\n assertEquals(0, xAConnectionFactoryArray0.length);\n }", "public void testSoThatTestsDoNotFail() {\n\n }", "@Test\n public void stoppedPrimarySenderShouldNotAddEventsToTmpDroppedEventsButStillDrainQueuesWhenStarted() {\n Integer lnPort = vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(2));\n Integer nyPort = vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(1, lnPort));\n\n createCacheInVMs(lnPort, vm2, vm4);\n createReceiverInVMs(vm2, vm4);\n createCacheInVMs(nyPort, vm3, vm5);\n createReceiverInVMs(vm3, vm5);\n\n vm2.invoke(() -> WANTestBase.createSender(\"ny\", 1, true, 100, 10, false, false, null, false));\n vm4.invoke(() -> WANTestBase.createSender(\"ny\", 1, true, 100, 10, false, false, null, false));\n\n vm3.invoke(() -> WANTestBase.createSender(\"ln\", 2, true, 100, 10, false, false, null, false));\n vm5.invoke(() -> WANTestBase.createSender(\"ln\", 2, true, 100, 10, false, false, null, false));\n\n vm2.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ny\", 1, 100,\n isOffHeap()));\n vm4.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ny\", 1, 100,\n isOffHeap()));\n\n vm3.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ln\", 1, 100,\n isOffHeap()));\n vm5.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ln\", 1, 100,\n isOffHeap()));\n\n stopSenderInVMsAsync(\"ny\", vm2);\n\n vm2.invoke(() -> WANTestBase.doPutsFrom(getTestMethodName() + \"_PR\", 0, 100));\n\n // verify tmpDroppedEvents is 0 at site-ny\n vm2.invoke(() -> WANTestBase.verifyTmpDroppedEventSize(\"ny\", 0));\n vm4.invoke(() -> WANTestBase.verifyTmpDroppedEventSize(\"ny\", 0));\n\n vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 100));\n vm4.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 100));\n\n vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 50));\n vm5.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 50));\n\n startSenderInVMsAsync(\"ny\", vm2);\n\n vm2.invoke(() -> WANTestBase.doPutsFrom(getTestMethodName() + \"_PR\", 100, 1000));\n\n vm2.invoke(() -> WANTestBase.verifyTmpDroppedEventSize(\"ny\", 0));\n vm4.invoke(() -> WANTestBase.verifyTmpDroppedEventSize(\"ny\", 0));\n\n vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 1000));\n vm4.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 1000));\n\n vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 950));\n vm5.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 950));\n\n // verify the secondary's queues are drained at site-ny\n vm2.invoke(() -> WANTestBase.validateParallelSenderQueueAllBucketsDrained(\"ny\"));\n vm4.invoke(() -> WANTestBase.validateParallelSenderQueueAllBucketsDrained(\"ny\"));\n }", "@Test\n public void testEnableReplicationWhenSlaveClusterDoesntHaveTable() throws Exception {\n createTableWithDefaultConf(tableName);\n Assert.assertFalse(TestAsyncReplicationAdminApiWithClusters.admin2.tableExists(tableName).get());\n admin.enableTableReplication(tableName).join();\n Assert.assertTrue(TestAsyncReplicationAdminApiWithClusters.admin2.tableExists(tableName).get());\n }", "@Test(timeout = 30_000)\n public void setAndWait(TestContext should) {\n final int runs = 10;\n final Async test = should.async(runs);\n\n Redis.createClient(rule.vertx(), options).connect().onComplete(should.asyncAssertSuccess(cluster -> {\n for (int i = 0; i < runs; i++) {\n cluster.send(cmd(SET).arg(\"key\").arg(\"value\")).onComplete(should.asyncAssertSuccess(setResponse -> {\n should.assertEquals(\"OK\", setResponse.toString().toUpperCase());\n\n cluster.send(cmd(WAIT).arg(1).arg(2000)).onComplete(should.asyncAssertSuccess(waitResponse -> {\n should.assertEquals(1, waitResponse.toInteger());\n test.countDown();\n }));\n }));\n }\n }\n ));\n }", "@Test\n public void createUpdateTest() throws Exception {\n var createTemplate = getInitialTemplate();\n\n //add the entire template to redis\n CaaSTemplate template = redisClient.createTemplate(createTemplate);\n Assert.assertNotNull(redis.get(template.getSettingsId()));\n\n //Update the name of the template\n var newName = \"Updated Name\";\n redisClient.updateTemplateName(template.getSettingsId(), newName);\n Assert.assertEquals(newName, redis.get(template.getSettingsId(), String.class, new Path(\".templateName\")));\n\n //Update the template setting with key of 'setting1'\n var settingKey = \"setting1\";\n var newSettingValue = \"newValue\";\n redisClient.updateTemplateData(template.getSettingsId(), settingKey, newSettingValue);\n Assert.assertEquals(\n newSettingValue,\n redis.get(template.getSettingsId(), String.class, new Path(\".templateSettings.\" + settingKey))\n );\n\n var addSettingKey = \"addSetting\";\n var addSettingValue = \"addValue\";\n redisClient.addTemplateData(template.getSettingsId(), addSettingKey, addSettingValue);\n Assert.assertEquals(\n addSettingValue,\n redis.get(template.getSettingsId(), String.class, new Path(\".templateSettings.\" + addSettingKey))\n );\n\n //Delete the template setting with key 'setting1'\n redisClient.deleteTemplateData(template.getSettingsId(), settingKey);\n Assert.assertThrows(\n Exception.class,\n () -> {\n redis.get(template.getSettingsId(), String.class, new Path(\".templateSettings.\" + settingKey));\n }\n );\n\n //Get a CaasTemplate from redis with key 'auto-generated-test'\n var retrievedTemplate = redisClient.getTemplate(template.getSettingsId());\n var expectedTemplate = getInitialTemplate();\n expectedTemplate.setSettingsId(template.getSettingsId());\n expectedTemplate.setTemplateName(newName);\n expectedTemplate.setTemplateSettings(Map.of(\"setting2\", \"value2\", addSettingKey, addSettingValue));\n Assert.assertNotNull(retrievedTemplate); //the retrieved template isn't null\n Assert.assertEquals(retrievedTemplate, expectedTemplate); //the retrieved template is what was expected\n\n //Get the setting value for the setting with key 'setting2'\n Assert.assertEquals(\"value2\", redisClient.getTemplateSettings(template.getSettingsId(), \"setting2\"));\n\n //Set the entire template in Redis back to the original template\n redisClient.updateTemplate(template);\n Assert.assertEquals(template, redisClient.getTemplate(template.getSettingsId()));\n //no..... I'm not using redisClient to verify against itself...noooo. Move on.. nothing to see here\n\n //Delete the template\n redisClient.deleteTemplate(template.getSettingsId());\n Assert.assertThrows(\n Exception.class,\n () -> {\n redis.get(template.getSettingsId());\n }\n );\n }", "@Test\n public void testCoh3710()\n {\n doExpiryOpTest(new Runnable()\n {\n public void run() { getNamedCache(getCacheName0()).clear(); }\n });\n }", "public interface IRedisService {\n\n /**\n * 写入缓存\n *\n * @param key\n * @param value\n * @return\n */\n boolean set(final String key, Object value);\n\n /**\n * 写入缓存\n *\n * @param key\n * @param value\n * @param expireTime(TimeUnit.SECONDS)\n * @return\n */\n boolean setnx(final String key, Object value, Long expireTime);\n\n /**\n * 写入缓存设置时效时间\n *\n * @param key\n * @param value\n * @return\n */\n boolean set(final String key, Object value, Long expireTime, TimeUnit timeUnit);\n\n /**\n * 批量删除对应的value\n *\n * @param keys\n */\n void remove(final String... keys);\n\n /**\n * 批量删除key\n *\n * @param pattern\n */\n void removePattern(final String pattern);\n\n /**\n * 删除对应的value\n *\n * @param key\n */\n void remove(final String key);\n\n /**\n * 判断缓存中是否有对应的value\n *\n * @param key\n * @return\n */\n boolean exists(final String key);\n\n /**\n * 判断缓存中是否有对应的value,如果存在则会删除并返回true\n *\n * @param key\n * @return\n */\n boolean existsRemove(final String key);\n\n\n /**\n * 查看key的过期时间\n */\n Long expire(String key);\n\n /**\n * 读取缓存\n *\n * @param key\n * @return\n */\n Object get(final String key);\n\n /**\n * 哈希 添加\n *\n * @param key\n * @param hashKey\n * @param value\n */\n void hmSet(String key, Object hashKey, Object value);\n\n /**\n * 哈希获取数据\n *\n * @param key\n * @param hashKey\n * @return\n */\n Object hmGet(String key, Object hashKey);\n\n /**\n * 哈希 添加\n *\n * @param key\n * @param hashKey\n * @param objClass\n */\n <T> T hmGet4Obj(String key, Object hashKey, Class<T> objClass);\n\n /**\n * 删除指定哈希数据\n *\n * @param key\n * @param hashKey\n * @return\n */\n void hmDel(String key, Object hashKey);\n\n /**\n * 列表添加\n *\n * @param k\n * @param v\n */\n void lPush(String k, Object v);\n\n /**\n * 列表获取\n *\n * @param k\n * @param l\n * @param l1\n * @return\n */\n List<Object> lRange(String k, long l, long l1);\n\n /**\n * 集合添加\n *\n * @param key\n * @param value\n */\n void add(String key, Object value);\n\n /**\n * 集合获取\n *\n * @param key\n * @return\n */\n Set<Object> members4Set(String key);\n\n /**\n * 有序集合添加\n *\n * @param key\n * @param value\n * @param scoure\n */\n void zAdd(String key, Object value, double scoure);\n\n /**\n * 有序集合获取\n *\n * @param key\n * @param scoure\n * @param scoure1\n * @return\n */\n Set<Object> rangeByScore(String key, double scoure, double scoure1);\n\n /**\n * 有序集合获取\n *\n * @param key\n * @param from\n * @param to\n * @return\n */\n Set<Object> rangeByIndex(String key, int from, int to);\n\n /**\n * 倒序获得有序集合获取\n *\n * @param key\n * @param from\n * @param to\n * @return\n */\n Set<Object> rangeByIndexReverse(String key, int from, int to);\n\n /**\n * 判断用户是否已登录\n *\n * @param request\n * @return\n */\n boolean isLogin(HttpServletRequest request);\n\n\n /**\n * 获得缓存的Map\n *\n * @param key\n * @return\n */\n Map<String, Object> getCacheIntegerMap(String key);\n\n /**\n * 发布消息\n */\n void sendMessage(String channel, Object message);\n\n\n\n Set<Object> keys(String key);\n\n void hmDelAll(String key, Set<String> hashKey);\n\n /**\n * redis incrId\n * @return\n */\n Long getIncrId();\n\n /**\n * 活动排行榜\n * @param customerId\n * @param customerId\n * @param activityScoure\n */\n void setActivityZadd(String activityCode,Integer customerId,int activityScoure);\n\n /**\n * 查询用户的活动排名\n * @param activityCode\n * @param customerId\n * @return\n */\n Long getActivityReverseRank(String activityCode,Integer customerId);\n\n /**\n * 获取用户的score\n * @param activityCode\n * @param customerId\n * @return\n */\n Double getActivityReverseScore(String activityCode,Integer customerId);\n\n /**\n * 获取活动 排名\n * @param activityCode\n * @param start\n * @param end\n * @return\n */\n public List<ImmutablePair<String, Double>> getActivityRevRangeWithScores(String activityCode, int start, int end);\n\n /**\n * 设置用户tonken\n * @param userId\n * @return\n */\n String doUserToken(Integer userId);\n\n /**\n * 设置用户tonken\n * @param userId\n * @param token\n * @return\n */\n boolean checkUserToken(Integer userId , String token);\n}", "@Test(expected=IllegalStateException.class)\n public void ongoingConfiguration_withRequestsRecordingDisabled() {\n initJadler().withRequestsRecordingDisabled();\n \n try {\n verifyThatRequest();\n fail(\"request recording disabled, verification must fail\");\n }\n finally {\n closeJadler();\n }\n }", "@Test(timeout = 4000)\n public void test73() throws Throwable {\n FileSystemHandling.appendStringToFile((EvoSuiteFile) null, (String) null);\n ConnectionFactories connectionFactories0 = new ConnectionFactories();\n connectionFactories0.getXAConnectionFactory();\n connectionFactories0.getXAConnectionFactory();\n connectionFactories0.addConnectionFactory((ConnectionFactory) null);\n XATopicConnectionFactory[] xATopicConnectionFactoryArray0 = new XATopicConnectionFactory[0];\n connectionFactories0.setXATopicConnectionFactory(xATopicConnectionFactoryArray0);\n connectionFactories0.getConnectionFactory();\n connectionFactories0.getConnectionFactory();\n connectionFactories0.getConnectionFactory();\n connectionFactories0.getConnectionFactory();\n XAConnectionFactory[] xAConnectionFactoryArray0 = connectionFactories0.getXAConnectionFactory();\n XAConnectionFactory[] xAConnectionFactoryArray1 = connectionFactories0.getXAConnectionFactory();\n assertNotSame(xAConnectionFactoryArray1, xAConnectionFactoryArray0);\n }", "public void test_GetAllContestChannels_Failure2() throws Exception {\r\n try {\r\n initContext();\r\n\r\n entityManager.enablePersistenceException(true);\r\n\r\n beanUnderTest.getAllContestChannels();\r\n fail(\"ContestManagementException is expected.\");\r\n } catch (ContestManagementException e) {\r\n // success\r\n }\r\n }", "@Ignore //DKH\n @Test\n public void testMakePersistent() {\n }", "@Disabled\n @Test\n void processDepositValidatorPubkeysDoesNotContainPubkeyAndMinEmptyValidatorIndexIsNegative() {\n }", "@Test\n\tpublic void enableDisable() {\n\t\ttry {\n\t\t\t// mac.AcceptedBanknoteStorage.disable();\n\t\t\t// mac.AcceptedBanknoteStorage.enable();\n\t\t\tmac.checkoutStation.banknoteStorage.enable();\n\t\t\tmac.checkoutStation.banknoteStorage.disable();\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tfail(\"disabling and enabling throws an error\");\n\t\t}\n\t}", "@Test\n public void testGetReservedKeys() {\n assertEquals(\"Timestamp must match\",TIMESTAMP.toString(), ev.get(\"_timestamp\"));\n assertEquals(\"Sources must match\",source,ev.get(\"_source\"));\n }", "@Test\n @WithSystemProperty(key = IgniteSystemProperties.IGNITE_DUMP_THREADS_ON_FAILURE, value = \"false\")\n public void testConnectingNodesStopIfNoConnectedNodeIsPresented() throws Exception {\n /*\n Test reproduces the needed behavior (two nodes in CONNECTING state) doing the following:\n - it starts two regular nodes, node0 (coordinator) and node1 (just another server) with special\n discovery SPIs;\n - when node1 receives NodeAddFinished for subsequently started node2, it doesn't send it to the node\n but closes disco socket to node2 leaving it in CONNECTING state and generating NodeFailed for it.\n Also at this moment node3 is started;\n - when node0 receives this NodeFailed it fails (because special SPI throws an exception) and stops;\n - when node1 receives another join request from node2 or NodeAdded from node3 reaches it back,\n node1's special SPI also throws an exception so it goes down as well;\n - as a result, both node2 and node3 get stuck in CONNECTING state and as they use special IpFinders\n they see each other and are able to send join requests to each other back and forth.\n\n The whole purpose of the test is to verify that these two nodes won't stuck in CONNECTING state forever\n and will eventually stop.\n */\n\n usePortFromNodeName = true;\n\n final AtomicInteger joinReqsCntr = new AtomicInteger(0);\n\n final AtomicReference<IgniteInternalFuture> futureRef = new AtomicReference();\n\n final UUID node2Id = UUID.randomUUID();\n\n final TcpDiscoverySpi node0SpecialSpi = new TcpDiscoverySpi() {\n @Override protected void startMessageProcess(TcpDiscoveryAbstractMessage msg) {\n if (msg instanceof TcpDiscoveryNodeFailedMessage) {\n TcpDiscoveryNodeFailedMessage failedMsg = (TcpDiscoveryNodeFailedMessage)msg;\n\n UUID failedNodeId = failedMsg.failedNodeId();\n\n if (failedNodeId.equals(node2Id))\n throw new RuntimeException(\"Stop node0 exception\");\n }\n\n if (msg instanceof TcpDiscoveryJoinRequestMessage) {\n TcpDiscoveryJoinRequestMessage joinReq = (TcpDiscoveryJoinRequestMessage)msg;\n\n if (joinReq.node().id().equals(node2Id))\n joinReqsCntr.incrementAndGet();\n }\n }\n };\n\n final TcpDiscoverySpi node1SpecialSpi = new TcpDiscoverySpi() {\n @Override protected void startMessageProcess(TcpDiscoveryAbstractMessage msg) {\n if (msg instanceof TcpDiscoveryNodeAddFinishedMessage) {\n TcpDiscoveryNodeAddFinishedMessage finishedMsg = (TcpDiscoveryNodeAddFinishedMessage)msg;\n\n UUID nodeId = finishedMsg.nodeId();\n\n if (nodeId.equals(node2Id)) {\n Object workerObj = GridTestUtils.getFieldValue(impl, \"msgWorker\");\n\n OutputStream out = GridTestUtils.getFieldValue(workerObj, \"out\");\n\n try {\n out.close();\n\n log.warning(\"Out to 'sick' node closed\");\n }\n catch (Exception ignored) {\n // No-op.\n }\n\n futureRef.set(GridTestUtils.runAsync(() -> {\n try {\n startGrid(NODE_WITH_PORT_ID_3);\n }\n catch (Exception ignored) {\n //NO-op.\n }\n }));\n }\n }\n\n if (msg instanceof TcpDiscoveryJoinRequestMessage) {\n TcpDiscoveryJoinRequestMessage joinReq = (TcpDiscoveryJoinRequestMessage)msg;\n\n int joinReqsCount = joinReqsCntr.get();\n\n if (joinReq.node().id().equals(node2Id) && joinReqsCount == 1)\n throw new RuntimeException(\"Stop node1 exception by subsequent join req\");\n }\n\n if (msg instanceof TcpDiscoveryNodeAddedMessage) {\n TcpDiscoveryNodeAddedMessage addedMsg = (TcpDiscoveryNodeAddedMessage)msg;\n\n if (addedMsg.node().discoveryPort() == 47503)\n throw new RuntimeException(\"Stop node1 exception by new node added msg\");\n }\n }\n };\n\n specialSpi = node0SpecialSpi;\n\n startGrid(NODE_WITH_PORT_ID_0);\n\n specialSpi = node1SpecialSpi;\n\n startGrid(NODE_WITH_PORT_ID_1);\n\n specialIpFinder0 = new TcpDiscoveryVmIpFinder(false);\n\n ((TcpDiscoveryVmIpFinder)specialIpFinder0).setAddresses(Arrays.asList(\"127.0.0.1:47501\", \"127.0.0.1:47503\"));\n\n specialIpFinder1 = new TcpDiscoveryVmIpFinder(false);\n\n ((TcpDiscoveryVmIpFinder)specialIpFinder1).setAddresses(Arrays.asList(\"127.0.0.1:47502\"));\n\n specialSpi = null;\n\n nodeId = node2Id;\n\n boolean expectedExceptionThrown = false;\n\n try {\n startGrid(NODE_WITH_PORT_ID_2);\n }\n catch (Exception e) {\n Throwable cause0 = e.getCause();\n\n assertNotNull(cause0);\n\n Throwable cause1 = cause0.getCause();\n\n assertNotNull(cause1);\n\n String errorMsg = cause1.getMessage();\n\n assertTrue(\n \"Expected error message was not found: \" + errorMsg,\n errorMsg.contains(\"Failed to connect to any address from IP finder\")\n );\n\n expectedExceptionThrown = true;\n }\n\n assertTrue(\"Expected exception was not thrown.\", expectedExceptionThrown);\n\n IgniteInternalFuture startGridFut = futureRef.get();\n\n if (startGridFut != null)\n startGridFut.get();\n }", "@Test\n public void patchNoOp() throws Exception {\n\n }", "@Override\n protected String getRedisKey() {\n return REDIS_KEY;\n }", "@Test\r\n public void testApacheHttpClient4ExecutorAgain() throws Exception\r\n {\r\n doTestApacheHttpClient4Executor();\r\n }", "public void testExplictFailoverOptionNofailover() throws Exception\n {\n _url = \"amqp://user:pass@clientid/test?brokerlist='tcp://localhost:5672'&failover='nofailover'\";\n _connectionUrl = new AMQConnectionURL(_url);\n _connection = createStubConnection();\n\n _failoverPolicy = new FailoverPolicy(_connectionUrl, _connection);\n\n assertTrue(\"Unexpected failover method\", _failoverPolicy.getCurrentMethod() instanceof NoFailover);\n }", "@Test(timeout = 4000)\n public void test26() throws Throwable {\n ConnectionFactories connectionFactories0 = new ConnectionFactories();\n connectionFactories0.clearConnectionFactory();\n connectionFactories0.clearXATopicConnectionFactory();\n assertEquals(0, connectionFactories0.getConnectionFactoryCount());\n }", "@Test\n public void testLowVolumeDoesNotTripCircuit() {\n try {\n int sleepWindow = 200;\n int lowVolume = 5;\n\n HystrixCommandProperties.Setter properties = HystrixCommandPropertiesTest.getUnitTestPropertiesSetter().withCircuitBreakerSleepWindowInMilliseconds(sleepWindow).withCircuitBreakerRequestVolumeThreshold(lowVolume);\n HystrixCommandMetrics metrics = getMetrics(properties);\n HystrixCircuitBreaker cb = getCircuitBreaker(key, CommandOwnerForUnitTest.OWNER_TWO, metrics, properties);\n\n // fail\n metrics.markFailure(1000);\n metrics.markFailure(1000);\n metrics.markFailure(1000);\n metrics.markFailure(1000);\n\n // even though it has all failed we won't trip the circuit because the volume is low\n assertTrue(cb.allowRequest());\n assertFalse(cb.isOpen());\n\n } catch (Exception e) {\n e.printStackTrace();\n fail(\"Error occurred: \" + e.getMessage());\n }\n }", "@Test\n public void get() {\n Object str = redisUtil.get(\"key\");\n System.out.println(str);\n }", "@Test\n public void testHyperLogLog(){\n String redisKey= \"test:hll:01\";\n for (int i = 0; i <= 100000; i++) {\n redisTemplate.opsForHyperLogLog().add(redisKey,i);\n }\n\n for (int i = 0; i <= 100000; i++) {\n int r = (int) (Math.random() * 100000+1);\n redisTemplate.opsForHyperLogLog().add(redisKey,r);\n }\n\n Long size = redisTemplate.opsForHyperLogLog().size(redisKey);\n System.out.println(size);\n }", "@Test(timeout = 4000)\n public void test63() throws Throwable {\n ConnectionFactories connectionFactories0 = new ConnectionFactories();\n connectionFactories0.clearTopicConnectionFactory();\n XATopicConnectionFactory xATopicConnectionFactory0 = new XATopicConnectionFactory();\n connectionFactories0.addXATopicConnectionFactory(xATopicConnectionFactory0);\n XAQueueConnectionFactory[] xAQueueConnectionFactoryArray0 = connectionFactories0.getXAQueueConnectionFactory();\n assertEquals(0, xAQueueConnectionFactoryArray0.length);\n }", "@Test(timeout = 4000)\n public void test28() throws Throwable {\n ConnectionFactories connectionFactories0 = new ConnectionFactories();\n connectionFactories0.getXAQueueConnectionFactory();\n connectionFactories0.clearXAQueueConnectionFactory();\n ConnectionFactory connectionFactory0 = new ConnectionFactory();\n FileSystemHandling.shouldAllThrowIOExceptions();\n XAQueueConnectionFactory xAQueueConnectionFactory0 = new XAQueueConnectionFactory();\n connectionFactories0.addXAQueueConnectionFactory(xAQueueConnectionFactory0);\n assertNull(xAQueueConnectionFactory0.getName());\n }", "@Test\n\tpublic void testServerDisconnectedClientsDontGetWrite() throws Exception {\n\t\tKeyValueServer server = new KeyValueServer();\n\t\tArrayList<String> files = populateServer(server);\n\t\t//Set up fake clients\n\t\tKeyValueClient[] clients = new KeyValueClient[N_REPLICAS];\n\t\tString contentToWrite = \"testServerManyClientsRegisterAllGetInnerWrite.\" + System.currentTimeMillis() + \".\";\n\t\tfor (int i = 0; i < N_REPLICAS; i++) {\n\t\t\tclients[i] = mock(KeyValueClient.class);\n\n\t\t\tif (i % 2 == 0) {\n\t\t\t\t//Half of the clients will expect to get the write\n\t\t\t\tfor (String p : files)\n\t\t\t\t\texpect(clients[i].innerWriteKey(eq(p.toString()), eq(contentToWrite + p.toString()), anyLong())).andReturn(true);\n\t\t\t\tclients[i].commitTransaction(anyLong());\n\t\t\t\texpectLastCall().anyTimes();\n\t\t\t\tclients[i].abortTransaction(anyLong());\n\t\t\t\texpectLastCall().anyTimes();\n\t\t\t} else {\n\t\t\t\t//Other half of the clients will expect to get nothing!\n\t\t\t}\n\n\t\t\treplay(clients[i]);\n\t\t}\n\t\tfor (int i = 0; i < N_REPLICAS; i++) {\n\t\t\tserver.registerClient(\"fake hostname\", 9000 + i, clients[i]);\n\t\t}\n\t\tfor (int i = 0; i < N_REPLICAS; i++) {\n\t\t\tif (i % 2 != 0) {\n\t\t\t\tserver.cacheDisconnect(\"fake hostname\", 9000 + i);\n\t\t\t}\n\t\t}\n\t\tfor (String p : files)\n\t\t\tserver.set(p.toString(), contentToWrite + p.toString());\n\t\tfor (int i = 0; i < N_REPLICAS; i++) {\n\t\t\tif (i % 2 == 0)\n\t\t\t\tserver.cacheDisconnect(\"fake hostname\", 9000 + i);\n\t\t}\n\t\tfor (KeyValueClient client : clients)\n\t\t\tverify(client);\n\t}", "@Override\n @Test(groups = {\"Resource access\"})\n public void testResource00() throws Exception {\n super.testResource00();\n }", "@Test\n public void testOldMemberCantJoinRolledLocators() {\n VM oldServer = Host.getHost(0).getVM(sourceConfiguration, 1);\n Properties props = getSystemProperties(); // uses the DUnit locator\n try {\n oldServer.invoke(invokeCreateCache(props));\n } catch (RMIException e) {\n Throwable cause = e.getCause();\n if ((cause instanceof AssertionError)) {\n cause = cause.getCause();\n if (cause != null && cause.getMessage() != null && !cause.getMessage().startsWith(\n \"Rejecting the attempt of a member using an older version of the product to join the distributed system\")) {\n throw e;\n }\n }\n }\n }", "@Test\n public void consistencyCheckerDisabledTest() throws Exception {\n // 1. only one participant, consistency checker should be disabled\n AmbryServer server =\n new AmbryServer(new VerifiableProperties(props), clusterAgentsFactory, notificationSystem, time);\n server.startup();\n assertNull(\"The mismatch metric should not be created\", server.getServerMetrics().stoppedReplicasMismatchCount);\n server.shutdown();\n // 2. there are two participants but period of checker is zero, consistency checker should be disabled.\n props.setProperty(\"server.participants.consistency.checker.period.sec\", Long.toString(0L));\n List<ClusterParticipant> participants = new ArrayList<>();\n for (int i = 0; i < 2; ++i) {\n participants.add(\n new MockClusterParticipant(Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), null,\n null, null));\n }\n clusterAgentsFactory.setClusterParticipants(participants);\n server = new AmbryServer(new VerifiableProperties(props), clusterAgentsFactory, notificationSystem, time);\n server.startup();\n assertNull(\"The mismatch metric should not be created\", server.getServerMetrics().stoppedReplicasMismatchCount);\n server.shutdown();\n }", "@Disabled(\"Disabled test\")\n @Test\n void testDisable() {\n assertEquals(testing1, testing2);\n }", "@Override\n\tpublic boolean test() {\n\t\treturn false;\n\t}", "@Test\r\n @Ignore\r\n public void testHaveToQuit() {\r\n }", "public JMSBCXAjavaeeInOnlyTestService() {\n }", "@Test\n public void lowHealthWarningTest() {\n }", "@Test\n public void testClientMessageDecode() throws Exception {\n testNettyMessageClientDecoding(false, false, false);\n }", "@Test(timeout = 4000)\n public void test67() throws Throwable {\n ConnectionFactories connectionFactories0 = new ConnectionFactories();\n connectionFactories0.removeXAQueueConnectionFactory((XAQueueConnectionFactory) null);\n XAConnectionFactory[] xAConnectionFactoryArray0 = connectionFactories0.getXAConnectionFactory();\n assertEquals(0, xAConnectionFactoryArray0.length);\n }", "@Test\n public void testNoGuaranteeModeCannotReplayTuples() {\n KafkaSpoutConfig<String, String> spoutConfig = createKafkaSpoutConfigBuilder(mock(TopicFilter.class), mock(ManualPartitioner.class), -1)\n .setProcessingGuarantee(KafkaSpoutConfig.ProcessingGuarantee.NO_GUARANTEE)\n .setTupleTrackingEnforced(true)\n .build();\n doTestModeCannotReplayTuples(spoutConfig);\n }", "@Test\n\tpublic void testCachePushing()\n\t{\n\t messageCacheStorage.pushMessage(QUEUE_NAME, dummyMessage());\n Message message=messageCacheStorage.getMessage(\"testQueue\");\n Assert.assertTrue(\"TestMessage\".equals(message.getMessage()));\n messageCacheStorage.invalidate(QUEUE_NAME);\n message=messageCacheStorage.getMessage(QUEUE_NAME);\n Assert.assertNull(message); \n\t}", "@Test\n public void mustNotDisableMoreThanOnce() throws RemoteException {\n mHbmController.enable(mOnEnabled);\n\n // Should set the appropriate refresh rate for UDFPS and notify the caller.\n verify(mDisplayCallback).onHbmEnabled(eq(DISPLAY_ID));\n verify(mOnEnabled).run();\n\n // First request to disable the UDFPS mode.\n mHbmController.disable(mOnDisabled);\n\n // Should unset the refresh rate and notify the caller.\n verify(mOnDisabled).run();\n verify(mDisplayCallback).onHbmDisabled(eq(DISPLAY_ID));\n\n // Second request to disable the UDFPS mode, when it's already disabled.\n mHbmController.disable(mOnDisabled);\n\n // Should ignore the second request.\n verifyNoMoreInteractions(mOnDisabled);\n verifyNoMoreInteractions(mDisplayCallback);\n }" ]
[ "0.66474336", "0.6055658", "0.60160905", "0.5827351", "0.5776508", "0.55831265", "0.5581282", "0.5526052", "0.5494488", "0.5489484", "0.5488585", "0.54325897", "0.5406967", "0.53954786", "0.5382056", "0.53599924", "0.53599924", "0.5344616", "0.53320414", "0.532225", "0.5303678", "0.52955765", "0.52904236", "0.524266", "0.52425665", "0.52424675", "0.52186555", "0.52027434", "0.5201173", "0.5193159", "0.51731807", "0.5167206", "0.5158837", "0.5158496", "0.5158432", "0.5154569", "0.51508266", "0.51435953", "0.51405215", "0.5139072", "0.5137143", "0.51322734", "0.5121692", "0.5115879", "0.5093974", "0.50820726", "0.508141", "0.50788504", "0.50787145", "0.5072711", "0.5068206", "0.5063926", "0.5055639", "0.50471246", "0.5034056", "0.50153357", "0.50134677", "0.5009134", "0.50051945", "0.50051063", "0.5001071", "0.49976522", "0.4994204", "0.49837002", "0.49832827", "0.49825934", "0.49811435", "0.49801826", "0.49780723", "0.49629292", "0.49615216", "0.49542466", "0.4947985", "0.494653", "0.49445215", "0.49441227", "0.49385932", "0.49378482", "0.49262092", "0.49251094", "0.49238384", "0.49221346", "0.49215826", "0.4919386", "0.49118173", "0.49091333", "0.49072644", "0.49024576", "0.49018845", "0.49011794", "0.4896945", "0.48921573", "0.48918527", "0.48909494", "0.48902526", "0.48900303", "0.48898223", "0.48885477", "0.4881121", "0.48798603", "0.48775876" ]
0.0
-1
Loads the full object representations of the child programs.
public void loadChildren(Map<String, Program> programs) { _children = new ArrayList<>(); for (String childName : getChildNames()) { getChildren().add(programs.get(childName)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void load() {\n\t}", "public static void load() {\n }", "public abstract void load();", "public void load() ;", "public void load();", "public void load();", "public void load() {\n }", "public void load() throws ClassNotFoundException, IOException;", "@Override\n public void load() throws IOException, ClassNotFoundException {\n \n }", "public static void load() {\n load(false);\n }", "public void loadDefault() {\n\t\tthis.loadJTree(\"{\\\"id\\\":\\\"1\\\", \\\"name\\\":\\\"Core\\\", \\\"children\\\":[\" +\r\n\t\t\t\t\"{\\\"id\\\":\\\"2\\\", \\\"name\\\":\\\"Leaf1\\\", \\\"data\\\":[], \\\"children\\\":[]}, \" +\r\n\t\t\t\t\"{\\\"id\\\":\\\"3\\\", \\\"name\\\":\\\"Leaf2\\\", \\\"data\\\":[], \\\"children\\\":[]}\" +\r\n\t \t\t\"], \\\"data\\\":[]}\");\r\n\t\tthis.resizeTree();\r\n\t\t\r\n }", "private static void load(){\n }", "public void loadObjData() {\n this.updateGeometryAndUVs(SquareCoords, UVCoords, DrawOrder);\n SquareCoords = new float[0];\n UVCoords = new float[0];\n DrawOrder = new int[0];\n }", "private void loadMemory() {\n try {\n File varTmpDir = new File(\"data/\" + brainLocation + \".ser\");\n if (varTmpDir.exists()) {\n FileInputStream fileIn = new FileInputStream(varTmpDir);\n ObjectInputStream in = new ObjectInputStream(fileIn);\n longTermMemory = (HashMap<String, BoardRecord>) in.readObject();\n in.close();\n fileIn.close();\n }\n } catch (IOException i) {\n i.printStackTrace();\n return;\n } catch (ClassNotFoundException c) {\n System.out.println(\"File not found\");\n c.printStackTrace();\n return;\n }\n\n System.out.println(\"RECALLED LONG TERM MEMORIES FROM \" + brainLocation + \": \" + longTermMemory.toString());\n }", "@Override\r\n\tpublic void load() {\n\t}", "void load();", "void load();", "public ProgramManager() {\n display = new DisplayManager();\n fileName = \"resources/aLargeFile\";\n try {\n fileReader = new BufferedReader(new FileReader(fileName));\n } catch (FileNotFoundException e) {\n logger.error(e.getMessage());\n }\n wordStorage = new WordStorage();\n }", "Object loadObject() throws Exception;", "@Override\n\tprotected void load() {\n\t\t\n\t}", "@Override\n\tprotected void load() {\n\t\t\n\t}", "@Override\n\tprotected void load() {\n\t\t\n\t}", "@Override\n public void load() {\n }", "@Override\r\n\tprotected void load() {\n\t\t\r\n\t}", "public void load() throws IOException, ClassNotFoundException {\n\t\ttry {\n\t\t\t// use buffering\n\t\t\tFile gamesInFile = new File(\"games.txt\");\n\t\t\tif (!gamesInFile.exists())\n\t\t\t\tSystem.out.println(\"First run\");\n\t\t\telse {\n\t\t\t\tInputStream file = new FileInputStream(gamesInFile);\n\t\t\t\tInputStream buffered = new BufferedInputStream(file);\n\t\t\t\tObjectInput input = new ObjectInputStream(buffered);\n\t\t\t\ttry {\n\t\t\t\t\t// deserialize the List\n\t\t\t\t\tArrayList<MancalaGame> gamesFromFile = (ArrayList<MancalaGame>) input.readObject();\n\t\t\t\t\tgames = gamesFromFile;\n\t\t\t\t} finally {\n\t\t\t\t\tinput.close();\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tSystem.out.println(\"Load successful\");\n\t\t}\n\t}", "public void loadState() throws IOException, ClassNotFoundException {\n\t\tFile f = new File(workingDirectory() + File.separator + id() + FILE_EXTENSION);\n\t\t\n\t\t// load client state from file\n\t\tObjectInputStream is = new ObjectInputStream(new FileInputStream(f));\n\t\tTrackerDaemon client = (TrackerDaemon) is.readObject();\n\t\tis.close();\n\t\t\n\t\t// copy attributes\n\t\tthis.peerRecord = client.peerRecord();\n\t\t\n\t}", "public void Load() {\n\t\tsceneLoaded = false;\n\n\t\tfor (int i = 0 ; i < gameObjects.size();i++) {\n\t\t\tGameObject gO = gameObjects.get(i);\n\t\t\tEngine.Instance.AddObject(gO);\n\n\t\t}\n\t\tEngine.Instance.currentScenes.add(this);\n\t\tsceneLoaded = true;\n\t}", "@Override\n\tprotected void load() {\n\n\t}", "@Override\n\tprotected void load() {\n\n\t}", "public static void load() throws IOException {\n ClassPath classPath = ClassPath.from(ClassLoader.getSystemClassLoader());\n //System.out.println(\"Length:\"+classPath.getTopLevelClasses(\"util\").size());\n for (ClassPath.ClassInfo classInfo : classPath.getTopLevelClasses(\"util\")) {\n Scene.v().addBasicClass(classInfo.getName(), SootClass.BODIES);\n sootClasses.add(classInfo.getName());\n }\n }", "@Override\r\n\tpublic void load() {\n\t\ts.load();\r\n\r\n\t}", "public void loadState(ObjectInput in) throws IOException {\n\t\t// loda deikto values\n\t\tdk.loadState(in);\n\t\t// load interpreter values\n\t\tinterpreter.globalActorBox=in.readFloat();\n\t\tinterpreter.globalPropBox=in.readFloat();\n\t\tinterpreter.globalStageBox=in.readFloat();\n\t\tinterpreter.globalEventBox=in.readFloat();\n\t\tinterpreter.globalVerbBox=in.readFloat();\n\t\tinterpreter.globalBNumberBox=in.readFloat();\n\n\t\t// load ticks\n\t\tcMoments = in.readInt();\n\t\t// load inactivity counter\n\t\tcInactivity = in.readInt();\n\t\t// load inactivity counter for the player\n\t\tplayerInactivity = in.readInt();\n\t\t// load storyIsOver\n\t\tstoryIsOver = in.readBoolean();\n\t\tisEpilogueNow = in.readBoolean();\n\t\tisHappilyDone = in.readBoolean();\n\t\tisPenultimateDone = in.readBoolean();\n\n\t\ttry {\n\t\t\t// load storybook\n\t\t\tint size = in.readInt();\n\t\t\tDeikto.checkByteArraySize(size*4);\n\t\t\thistoryBook.clear();\n\t\t\tfor(int i=0;i<size;i++)\n\t\t\t\thistoryBook.add((Sentence)in.readObject());\n\t\t\t//save random seeds\n\t\t\trandom = (Random)in.readObject();\n\t\t\tinterpreter.scriptRandom.setSeed(in.readLong());\n\t\t\t// load alarms\n\t\t\tsize = in.readInt();\n\t\t\tDeikto.checkByteArraySize(size*16);\n\t\t\talarms.clear();\n\t\t\tfor(int i=0;i<size;i++)\n\t\t\t\talarms.add((Alarm)in.readObject());\n\t\t\tsize = in.readInt();\n\t\t\tDeikto.checkByteArraySize(size*16);\n\t\t\tstorybookQueue.clear();\n\t\t\tstorybook.clear();\n\t\t\tfor(int i=0;i<size;i++)\n\t\t\t\tstorybook.add(in.readUTF());\n\t\t\tstorybookQueue.addAll(storybook);\n\t\t} catch(ClassNotFoundException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "public Object readObject() throws ClassNotFoundException, IOException;", "public static void load() {\n\n\t\ttry {\n\t\t\tnew Thread() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tObjectDef.loadConfig();\n\t\t\t\t\t\tObjectConstants.declare();\n\t\t\t\t\t\tMapLoading.load();\n\t\t\t\t\t\tRegion.sort();\n\t\t\t\t\t\tObjectManager.declare();\n\t\t\t\t\t\tGameDefinitionLoader.loadNpcSpawns();\n\t\t\t\t\t\tNpc.spawnBosses();\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\n\t\t\t}.start();\n\n\t\t\tGlobalItemHandler.spawn();\n\t\t\tTriviaBot.start();\n\t\t\tAchievements.declare();\n\n\t\t\tGameDefinitionLoader.loadItemValues();\n\t\t\tGameDefinitionLoader.loadNpcDefinitions();\n\t\t\tGameDefinitionLoader.loadItemDefinitions();\n\t\t\tGameDefinitionLoader.loadEquipmentDefinitions();\n\t\t\tGameDefinitionLoader.loadShopDefinitions();\n\t\t\tGameDefinitionLoader.setRequirements();\n\t\t\tGameDefinitionLoader.loadWeaponDefinitions();\n\t\t\tGameDefinitionLoader.loadSpecialAttackDefinitions();\n\t\t\tGameDefinitionLoader.loadRangedStrengthDefinitions();\n\t\t\tGameDefinitionLoader.loadSpecialAttackDefinitions();\n\t\t\tGameDefinitionLoader.loadCombatSpellDefinitions();\n\t\t\tGameDefinitionLoader.loadRangedWeaponDefinitions();\n\t\t\tGameDefinitionLoader.loadNpcCombatDefinitions();\n\t\t\tGameDefinitionLoader.loadItemBonusDefinitions();\n\n\t\t\tNPCDrops.parseDrops().load();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public abstract void loaded();", "@Override\r\n\tpublic void load() {\n\r\n\t}", "public abstract void load() throws IOException;", "public static void load() {\n\t\t// manager.load(camp_fire);\r\n\t\t// manager.load(camp_fire_burntout);\r\n\t\t//\r\n\t\t// manager.load(fire_stick);\r\n\t\t// manager.load(fire_stick_burntout);\r\n\t\t//\r\n\t\t// manager.load(stockpile);\r\n\t\t// manager.load(worker);\r\n\t\t//\r\n\t\t// manager.load(icon_wood);\r\n\t\t//\r\n\t\tmanager.load(worker_ant);\r\n\t\tmanager.setLoader(FreeTypeFontGenerator.class,\r\n\t\t\t\tnew FreeTypeFontGeneratorLoader(new InternalFileHandleResolver()));\r\n\t\tmanager.load(dialog);\r\n\t}", "public static void main(String[] args) throws IOException, ClassNotFoundException {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t\tSerializationExample1 obj1 = new SerializationExample1();\n\t\tSystem.out.println(\"Original Object i=\"+obj1.i+\" j=\"+obj1.j);\n\t\t\n\t\t\n\t\tFileOutputStream fos = new FileOutputStream(\"C:\\\\temp\\\\test\\\\Serealize.dmp\");\n\t\tObjectOutputStream oos = new ObjectOutputStream(fos);\n\t\toos.writeObject(obj1); //serialize object to file\n\t\t\n\t\t//now try to desirealize the same object back\n\t\tFileInputStream fis = new FileInputStream(\"C:\\\\temp\\\\test\\\\Serealize.dmp\");\n\t\tObjectInputStream ois = new ObjectInputStream(fis);\n\t\tSerializationExample1 obj2 = (SerializationExample1)ois.readObject();\n\t\t\n\t\tSystem.out.println(\"Object Read from file i=\"+obj2.i+\" j=\"+obj2.j);\n\t\t\n\t\toos.close();\n\t\tois.close();\n\t}", "public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException {\n MyClassLoader mcl = new MyClassLoader(\"myClassLoader1\");\n// // 根据全限定名加载,注意,这里调用loadClass方法\n// Class<?> clazz = mcl.loadClass(\"Student\");\n// Student student = (Student)clazz.newInstance();\n Object o = mcl.loadClass(\"Student\").newInstance();\n o.getClass().getMethod(\"shuchu\").invoke(o);\n// student.shuchu();\n// List<Integer> list = new ArrayList<>();\n// Object o = new Object();\n System.out.println(o.getClass().getClassLoader());\n// System.out.println(list.getClass().getClassLoader());\n// System.out.println(o.getClass().getClassLoader());\n byte[] allocation1, allocation2;\n allocation1 = new byte[30900 * 1024*2];\n allocation2 = new byte[900 * 1024*2];\n\n\n }", "public void loadData () {\n // create an ObjectInputStream for the file we created before\n ObjectInputStream ois;\n try {\n ois = new ObjectInputStream(new FileInputStream(\"DB/Guest.ser\"));\n\n int noOfOrdRecords = ois.readInt();\n Guest.setMaxID(ois.readInt());\n System.out.println(\"GuestController: \" + noOfOrdRecords + \" Entries Loaded\");\n for (int i = 0; i < noOfOrdRecords; i++) {\n guestList.add((Guest) ois.readObject());\n //orderList.get(i).getTable().setAvailable(false);\n }\n } catch (IOException | ClassNotFoundException e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n }\n }", "private void initializeModel() {\n\t\tmodel = new Model();\n\n\t\t// load up playersave\n\t\ttry {\n\t\t\tFileInputStream save = new FileInputStream(\"playersave.ser\");\n\t\t\tObjectInputStream in = new ObjectInputStream(save);\n\t\t\tmodel = ((Model) in.readObject());\n\t\t\tin.close();\n\t\t\tsave.close();\n\t\t\tSystem.out.println(\"playersave found. Loading file...\");\n\t\t}catch(IOException i) {\n\t\t\t//i.printStackTrace();\n\t\t\tSystem.out.println(\"playersave file not found, starting new game\");\n\t\t}catch(ClassNotFoundException c) {\n\t\t\tSystem.out.println(\"playersave not found\");\n\t\t\tc.printStackTrace();\n\t\t}\n\t\t\n\t\t// load up customlevels\n\t\ttry {\n\t\t\tFileInputStream fileIn = new FileInputStream(\"buildersave.ser\");\n\t\t\tObjectInputStream in = new ObjectInputStream(fileIn);\n\t\t\tmodel.importCustomLevels(((ArrayList<LevelModel>) in.readObject()));\n\t\t\tin.close();\n\t\t\tfileIn.close();\n\t\t\tSystem.out.println(\"Builder ArrayList<LevelModel> found. Loading file...\");\n\t\t}catch(IOException i) {\n\t\t\t//i.printStackTrace();\n\t\t\tSystem.out.println(\"Builder ArrayList<LevelModel> file not found, starting new game\");\n\t\t\treturn;\n\t\t}catch(ClassNotFoundException c) {\n\t\t\tSystem.out.println(\"Builder ArrayList<LevelModel> not found\");\n\t\t\tc.printStackTrace();\n\t\t\treturn;\n\t\t}\n\t}", "protected void ensureLoaded()\n {\n if (!m_fLoaded)\n {\n if (m_abClazz != null)\n {\n ByteArrayInputStream streamRaw = new ByteArrayInputStream(m_abClazz);\n DataInput stream = new DataInputStream(streamRaw);\n try\n {\n disassemble(stream, m_pool);\n }\n catch (IOException e)\n {\n throw ensureRuntimeException(e);\n }\n }\n\n m_fLoaded = true;\n }\n }", "@Override\n public void load() {\n }", "public void load (){\n load(MAX_PREZ);\n }", "public static Object objectLoader(String filename) throws IOException, ClassNotFoundException {\r\n\t\t// Creat file input stream\r\n\t\tFileInputStream fileInStr = new FileInputStream(filename);\r\n\t\t// Create object input steam\r\n\t\tObjectInputStream objInStr = new ObjectInputStream(fileInStr);\r\n\t\tObject obj = (Object) objInStr.readObject();\r\n\t\t// Closing all streams\r\n\t\tobjInStr.close();\r\n\t\tfileInStr.close();\r\n\t\tSystem.out.printf(\"Deserialized data - \" + filename); // Printing message plus file name that was saved\r\n\t\treturn obj;\r\n\t}", "private void load(Object o) {\n \n }", "public void load() {\n mapdb_ = DBMaker.newFileDB(new File(\"AllPoems.db\"))\n .closeOnJvmShutdown()\n .encryptionEnable(\"password\")\n .make();\n\n // open existing an collection (or create new)\n poemIndexToPoemMap_ = mapdb_.getTreeMap(\"Poems\");\n \n constructPoems();\n }", "@Override\r\n\tpublic void initialLoad() throws IOException {\n\t\t\r\n\t}", "private native static int load_object(String componentFileName);", "protected abstract void loadData();", "public void load() {\n handleLoad(false, false);\n }", "public Serializable readObject(){\n Serializable loadedObject = null;\n try {\n FileInputStream fileIn = new FileInputStream(name);\n ObjectInputStream in = new ObjectInputStream(fileIn);\n loadedObject = (Serializable) in.readObject();\n in.close();\n fileIn.close();\n System.out.println(\"Data loaded from: \"+ name);\n } \n catch (IOException i) {\n System.out.println(\"File not found.\");\n } \n catch (ClassNotFoundException c) {\n System.out.println(\"Class not found\");\n }\n return loadedObject;\n }", "public void initializePackageContents() {\n\t\tif (isInitialized) return;\n\t\tisInitialized = true;\n\n\t\t// Initialize package\n\t\tsetName(eNAME);\n\t\tsetNsPrefix(eNS_PREFIX);\n\t\tsetNsURI(eNS_URI);\n\n\t\t// Obtain other dependent packages\n\t\tCorePackage theCorePackage = (CorePackage)EPackage.Registry.INSTANCE.getEPackage(CorePackage.eNS_URI);\n\t\tEcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);\n\t\tObjectsPackage theObjectsPackage = (ObjectsPackage)EPackage.Registry.INSTANCE.getEPackage(ObjectsPackage.eNS_URI);\n\n\t\t// Create type parameters\n\n\t\t// Set bounds for type parameters\n\n\t\t// Add supertypes to classes\n\t\treadCsvFileEClass.getESuperTypes().add(theCorePackage.getCommand());\n\t\tprintEClass.getESuperTypes().add(theCorePackage.getCommand());\n\t\twriteCsvFileEClass.getESuperTypes().add(theCorePackage.getCommand());\n\t\texcludeColumnsEClass.getESuperTypes().add(theCorePackage.getCommand());\n\t\tselectColumnsEClass.getESuperTypes().add(theCorePackage.getCommand());\n\t\tassertTablesMatchEClass.getESuperTypes().add(theCorePackage.getCommand());\n\t\twriteLinesEClass.getESuperTypes().add(theCorePackage.getCommand());\n\t\treadLinesEClass.getESuperTypes().add(theCorePackage.getCommand());\n\t\tselectRowsEClass.getESuperTypes().add(theCorePackage.getCommand());\n\t\texcludeRowsEClass.getESuperTypes().add(theCorePackage.getCommand());\n\t\tasTableDataEClass.getESuperTypes().add(theCorePackage.getCommand());\n\t\treadPropertiesEClass.getESuperTypes().add(theCorePackage.getCommand());\n\n\t\t// Initialize classes and features; add operations and parameters\n\t\tinitEClass(readCsvFileEClass, ReadCsvFile.class, \"ReadCsvFile\", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);\n\t\tinitEAttribute(getReadCsvFile_Uri(), ecorePackage.getEString(), \"uri\", null, 0, 1, ReadCsvFile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\n\t\tinitEClass(printEClass, Print.class, \"Print\", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);\n\t\tinitEReference(getPrint_Input(), theEcorePackage.getEObject(), null, \"input\", null, 0, -1, Print.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\n\t\tinitEClass(writeCsvFileEClass, WriteCsvFile.class, \"WriteCsvFile\", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);\n\t\tinitEReference(getWriteCsvFile_Table(), theObjectsPackage.getTable(), null, \"table\", null, 0, 1, WriteCsvFile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\t\tinitEAttribute(getWriteCsvFile_Uri(), theEcorePackage.getEString(), \"uri\", null, 0, 1, WriteCsvFile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\n\t\tinitEClass(excludeColumnsEClass, ExcludeColumns.class, \"ExcludeColumns\", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);\n\t\tinitEReference(getExcludeColumns_Table(), theObjectsPackage.getTable(), null, \"table\", null, 0, 1, ExcludeColumns.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\t\tinitEAttribute(getExcludeColumns_Columns(), theEcorePackage.getEString(), \"columns\", null, 0, -1, ExcludeColumns.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\n\t\tinitEClass(selectColumnsEClass, SelectColumns.class, \"SelectColumns\", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);\n\t\tinitEReference(getSelectColumns_Table(), theObjectsPackage.getTable(), null, \"table\", null, 0, 1, SelectColumns.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\t\tinitEAttribute(getSelectColumns_Columns(), theEcorePackage.getEString(), \"columns\", null, 0, -1, SelectColumns.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\n\t\tinitEClass(assertTablesMatchEClass, AssertTablesMatch.class, \"AssertTablesMatch\", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);\n\t\tinitEReference(getAssertTablesMatch_Left(), theObjectsPackage.getTable(), null, \"left\", null, 0, 1, AssertTablesMatch.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\t\tinitEReference(getAssertTablesMatch_Right(), theObjectsPackage.getTable(), null, \"right\", null, 0, 1, AssertTablesMatch.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\t\tinitEAttribute(getAssertTablesMatch_IgnoreColumnOrder(), theEcorePackage.getEBoolean(), \"ignoreColumnOrder\", \"false\", 0, 1, AssertTablesMatch.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\t\tinitEAttribute(getAssertTablesMatch_IgnoreMissingColumns(), this.getIgnoreColumnsMode(), \"ignoreMissingColumns\", \"NONE\", 0, 1, AssertTablesMatch.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\n\t\tinitEClass(writeLinesEClass, WriteLines.class, \"WriteLines\", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);\n\t\tinitEAttribute(getWriteLines_Uri(), theEcorePackage.getEString(), \"uri\", null, 0, 1, WriteLines.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\t\tinitEAttribute(getWriteLines_Append(), theEcorePackage.getEBoolean(), \"append\", \"false\", 0, 1, WriteLines.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\n\t\tinitEClass(readLinesEClass, ReadLines.class, \"ReadLines\", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);\n\t\tinitEAttribute(getReadLines_Uri(), theEcorePackage.getEString(), \"uri\", null, 1, 1, ReadLines.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\n\t\tinitEClass(selectRowsEClass, SelectRows.class, \"SelectRows\", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);\n\t\tinitEReference(getSelectRows_Table(), theObjectsPackage.getTable(), null, \"table\", null, 0, 1, SelectRows.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\t\tinitEAttribute(getSelectRows_Column(), theEcorePackage.getEString(), \"column\", null, 0, 1, SelectRows.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\t\tinitEAttribute(getSelectRows_Value(), theEcorePackage.getEString(), \"value\", null, 0, 1, SelectRows.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\t\tinitEAttribute(getSelectRows_Match(), this.getRowMatchMode(), \"match\", null, 0, 1, SelectRows.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\n\t\tinitEClass(excludeRowsEClass, ExcludeRows.class, \"ExcludeRows\", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);\n\t\tinitEReference(getExcludeRows_Table(), theObjectsPackage.getTable(), null, \"table\", null, 0, 1, ExcludeRows.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\t\tinitEAttribute(getExcludeRows_Column(), theEcorePackage.getEString(), \"column\", null, 0, 1, ExcludeRows.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\t\tinitEAttribute(getExcludeRows_Value(), theEcorePackage.getEString(), \"value\", null, 0, 1, ExcludeRows.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\t\tinitEAttribute(getExcludeRows_Match(), this.getRowMatchMode(), \"match\", null, 0, 1, ExcludeRows.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\n\t\tinitEClass(asTableDataEClass, AsTableData.class, \"AsTableData\", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);\n\t\tinitEReference(getAsTableData_Input(), theEcorePackage.getEObject(), null, \"input\", null, 0, -1, AsTableData.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\n\t\tinitEClass(readPropertiesEClass, ReadProperties.class, \"ReadProperties\", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);\n\t\tinitEAttribute(getReadProperties_Uri(), ecorePackage.getEString(), \"uri\", null, 0, 1, ReadProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\n\n\t\t// Initialize enums and add enum literals\n\t\tinitEEnum(ignoreColumnsModeEEnum, IgnoreColumnsMode.class, \"IgnoreColumnsMode\");\n\t\taddEEnumLiteral(ignoreColumnsModeEEnum, IgnoreColumnsMode.NONE);\n\t\taddEEnumLiteral(ignoreColumnsModeEEnum, IgnoreColumnsMode.LEFT);\n\t\taddEEnumLiteral(ignoreColumnsModeEEnum, IgnoreColumnsMode.RIGHT);\n\t\taddEEnumLiteral(ignoreColumnsModeEEnum, IgnoreColumnsMode.BOTH);\n\n\t\tinitEEnum(rowMatchModeEEnum, RowMatchMode.class, \"RowMatchMode\");\n\t\taddEEnumLiteral(rowMatchModeEEnum, RowMatchMode.EXACT);\n\t\taddEEnumLiteral(rowMatchModeEEnum, RowMatchMode.GLOB);\n\t\taddEEnumLiteral(rowMatchModeEEnum, RowMatchMode.REGEXP);\n\n\t\t// Create resource\n\t\tcreateResource(eNS_URI);\n\n\t\t// Create annotations\n\t\t// http://www.eclipse.org/ecl/docs\n\t\tcreateDocsAnnotations();\n\t\t// http://www.eclipse.org/ecl/internal\n\t\tcreateInternalAnnotations();\n\t\t// http://www.eclipse.org/ecl/input\n\t\tcreateInputAnnotations();\n\t}", "private void load() {\r\n\t\tswitch (this.stepPanel.getStep()) {\r\n\t\tcase StepPanel.STEP_HOST_GRAPH:\r\n\t\t\tloadGraph(StepPanel.STEP_HOST_GRAPH);\r\n\t\t\tbreak;\r\n\t\tcase StepPanel.STEP_STOP_GRAPH:\r\n\t\t\tloadGraph(StepPanel.STEP_STOP_GRAPH);\r\n\t\t\tbreak;\r\n\t\tcase StepPanel.STEP_CRITICAL_PAIRS:\r\n\t\t\tloadPairs();\r\n\t\t\tbreak;\r\n\t\tcase StepPanel.STEP_FINISH:\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "public Main()\r\n\t{\r\n\t\tload=new Load();\r\n\t\tmyMap=new MyMap();\r\n\t\tload.myMap=myMap;\r\n\t}", "public abstract void loadData();", "public abstract void loadData();", "public void registerMetamodels(ResourceSet rs, IbexExecutable executable) throws IOException {\n\t\t\n\t\t// Set correct workspace root\n\t\tsetWorkspaceRootDirectory(rs);\n\t\t\n\t\t// Load and register source and target metamodels\n\t\tEPackage languagePack = null;\n\t\tEPackage henshinPack = null;\n\t\tEPackage ecorePack = null;\n\t\tEPackage emoflontohenshinPack = null;\n\t\t\n\t\tif(executable instanceof FWD_OPT) {\n\t\t\tResource res = executable.getResourceHandler().loadResource(\"platform:/resource/org.eclipse.emf.henshin.model/model/henshin.ecore\");\n\t\t\thenshinPack = (EPackage) res.getContents().get(0);\n\t\t\trs.getResources().remove(res);\n\t\t\t\n\t\t\tres = executable.getResourceHandler().loadResource(\"http://www.eclipse.org/emf/2002/Ecore\");\n\t\t\tecorePack = (EPackage) res.getContents().get(0);\n\t\t\trs.getResources().remove(res);\n\t\t\t\n\t\t\tres = executable.getResourceHandler().loadResource(\"platform:/resource/EMoflonToHenshin/model/EMoflonToHenshin.ecore\");\n\t\t\temoflontohenshinPack = (EPackage) res.getContents().get(0);\n\t\t\trs.getResources().remove(res);\n\t\t}\n\t\t\t\t\n\t\tif(executable instanceof BWD_OPT) {\n\t\t\tResource res = executable.getResourceHandler().loadResource(\"platform:/plugin/org.emoflon.ibex.tgg.language/model/Language.ecore\");\n\t\t\tlanguagePack = (EPackage) res.getContents().get(0);\n\t\t\trs.getResources().remove(res);\n\t\t\t\n\t\t\tres = executable.getResourceHandler().loadResource(\"http://www.eclipse.org/emf/2002/Ecore\");\n\t\t\tecorePack = (EPackage) res.getContents().get(0);\n\t\t\trs.getResources().remove(res);\n\t\t\t\n\t\t\tres = executable.getResourceHandler().loadResource(\"platform:/resource/EMoflonToHenshin/model/EMoflonToHenshin.ecore\");\n\t\t\temoflontohenshinPack = (EPackage) res.getContents().get(0);\n\t\t\trs.getResources().remove(res);\n\t\t}\n\n\t\tif(languagePack == null)\n\t\t\tlanguagePack = LanguagePackageImpl.init();\n\t\t\t\t\n\t\tif(henshinPack == null)\n\t\t\thenshinPack = HenshinPackageImpl.init();\n\t\t\n\t\tif(ecorePack == null)\n\t\t\tecorePack = EcorePackageImpl.init();\n\t\t\n\t\tif(emoflontohenshinPack == null) {\n\t\t\temoflontohenshinPack = EMoflonToHenshinPackageImpl.init();\n\t\t\trs.getPackageRegistry().put(\"platform:/resource/EMoflonToHenshin/model/EMoflonToHenshin.ecore\", EMoflonToHenshinPackage.eINSTANCE);\n\t\t\trs.getPackageRegistry().put(\"platform:/plugin/EMoflonToHenshin/model/EMoflonToHenshin.ecore\", EMoflonToHenshinPackage.eINSTANCE);\n\t\t}\n\t\t\t\n\t\trs.getPackageRegistry().put(\"platform:/resource/org.emoflon.ibex.tgg.language/model/Language.ecore\", languagePack);\n\t rs.getPackageRegistry().put(\"platform:/plugin/org.emoflon.ibex.tgg.language/model/Language.ecore\", languagePack);\t\n\t\t\t\n\t\trs.getPackageRegistry().put(\"platform:/resource/org.eclipse.emf.henshin.model/model/henshin.ecore\", henshinPack);\n\t\trs.getPackageRegistry().put(\"platform:/plugin/org.eclipse.emf.henshin.model/model/henshin.ecore\", henshinPack);\n\t\t\n\t\trs.getPackageRegistry().put(\"http://www.eclipse.org/emf/2002/Ecore\", henshinPack);\n\t}", "private void loadOutputModules() {\n\t\tthis.outputModules = new ModuleLoader<IOutput>(\"/Output_Modules\", IOutput.class).loadClasses();\n\t}", "public void registerMetamodels(ResourceSet rs, IbexExecutable executable) throws IOException {\r\n\t\t\r\n\t\t// Set correct workspace root\r\n\t\tsetWorkspaceRootDirectory(rs);\r\n\t\t\r\n\t\t// Load and register source and target metamodels\r\n\t\tEPackage familiesPack = null;\r\n\t\tEPackage personsPack = null;\r\n\t\tEPackage benchmarxfamiliestopersonsPack = null;\r\n\t\t\r\n\t\tif(executable instanceof FWD_OPT) {\r\n\t\t\tResource res = executable.getResourceHandler().loadResource(\"platform:/resource/Persons/model/Persons.ecore\");\r\n\t\t\tpersonsPack = (EPackage) res.getContents().get(0);\r\n\t\t\trs.getResources().remove(res);\r\n\t\t\t\r\n\t\t\tres = executable.getResourceHandler().loadResource(\"platform:/resource/BenchmarxFamiliesToPersons/model/BenchmarxFamiliesToPersons.ecore\");\r\n\t\t\tbenchmarxfamiliestopersonsPack = (EPackage) res.getContents().get(0);\r\n\t\t\trs.getResources().remove(res);\r\n\t\t}\r\n\t\t\t\t\r\n\t\tif(executable instanceof BWD_OPT) {\r\n\t\t\tResource res = executable.getResourceHandler().loadResource(\"platform:/resource/Families/model/Families.ecore\");\r\n\t\t\tfamiliesPack = (EPackage) res.getContents().get(0);\r\n\t\t\trs.getResources().remove(res);\r\n\t\t\t\r\n\t\t\tres = executable.getResourceHandler().loadResource(\"platform:/resource/BenchmarxFamiliesToPersons/model/BenchmarxFamiliesToPersons.ecore\");\r\n\t\t\tbenchmarxfamiliestopersonsPack = (EPackage) res.getContents().get(0);\r\n\t\t\trs.getResources().remove(res);\r\n\t\t}\r\n\r\n\t\tif(familiesPack == null)\r\n\t\t\tfamiliesPack = FamiliesPackageImpl.init();\r\n\t\t\t\t\r\n\t\tif(personsPack == null)\r\n\t\t\tpersonsPack = PersonsPackageImpl.init();\r\n\t\t\r\n\t\tif(benchmarxfamiliestopersonsPack == null) {\r\n\t\t\tbenchmarxfamiliestopersonsPack = BenchmarxFamiliesToPersonsPackageImpl.init();\r\n\t\t\trs.getPackageRegistry().put(\"platform:/resource/BenchmarxFamiliesToPersons/model/BenchmarxFamiliesToPersons.ecore\", BenchmarxFamiliesToPersonsPackage.eINSTANCE);\r\n\t\t\trs.getPackageRegistry().put(\"platform:/plugin/BenchmarxFamiliesToPersons/model/BenchmarxFamiliesToPersons.ecore\", BenchmarxFamiliesToPersonsPackage.eINSTANCE);\r\n\t\t}\r\n\t\t\t\r\n\t\trs.getPackageRegistry().put(\"platform:/resource/Families/model/Families.ecore\", familiesPack);\r\n\t rs.getPackageRegistry().put(\"platform:/plugin/Families/model/Families.ecore\", familiesPack);\t\r\n\t\t\t\r\n\t\trs.getPackageRegistry().put(\"platform:/resource/Persons/model/Persons.ecore\", personsPack);\r\n\t\trs.getPackageRegistry().put(\"platform:/plugin/Persons/model/Persons.ecore\", personsPack);\r\n\t}", "public Object load() {\n return null;\n }", "public static void main(String[] args) throws IOException, ClassNotFoundException {\n\t\ttry {\r\n//\t\t\t crea un fichero, salvo que exista y sea de solo lectura.\r\n\t\t\tFileOutputStream archivo = new FileOutputStream(\"fichero.dat\"); \r\n//\t\t\ttexto a escribir\r\n\t\t\tString texto = \"OLE OLE\";\r\n//\t\t\tguardamos el String el un array codigo\r\n\t\t\tbyte codigo[] = texto.getBytes();\r\n\t\t\tInteger.toBinaryString(codigo[0]);\r\n//\t\t\tse escribe lo guardado en el array\r\n\t\t\tarchivo.write(codigo);\r\n\t\t\tarchivo.close();\r\n\t\t\tFile fichero = new File(\"fichero.dat\");\r\n\t\t\tSystem.out.println(\"Nombre: \" + fichero.getName());\r\n\t\t\tSystem.out.println(\"Ruta absoluta: \" + fichero.getAbsolutePath());\r\n\t\t\tSystem.out.println(\"Ruta relativa: \" + fichero.getPath());\r\n\t\t\t\r\n\t\t} catch (IOException e ) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\tmetodoEscribirBinariosPrimitivos();\r\n\t\tmetodoLeerBinarioPrimitivos();\r\n\t\t\r\n//\t\tPasar de objeto a bytes\r\n\t\tPersona persona1 = new Persona(\"Pedro\", 11);\r\n\t\t\r\n\t\tFile fichero = new File(\"fichero.dat\");\r\n\t\tFileOutputStream fos = new FileOutputStream(fichero);\r\n\t\tObjectOutputStream os = new ObjectOutputStream (fos);\r\n\t\t\r\n\t\tos.writeObject(persona1); \r\n\t\tos.close();\r\n\t\t\r\n\t\tFileInputStream fis = new FileInputStream(fichero);\r\n\t\tObjectInputStream ois = new ObjectInputStream(fis);\r\n\t\t\r\n\t\tPersona objeto = (Persona) ois.readObject();\r\n\t\tSystem.out.println(objeto.getEdad());\r\n\t\tSystem.out.println(objeto.getNombre());\r\n\t\tois.close();\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\r\n\t}", "public static void main(String[] args) throws IOException {\n\t\tCorePackage.eINSTANCE.eClass();\n\t\tDOMPackage.eINSTANCE.eClass();\n\t\tPrimitiveTypesPackage.eINSTANCE.eClass();\n\t\t\n\t\tPersistenceBackendFactoryRegistry.register(BlueprintsURI.SCHEME, BlueprintsPersistenceBackendFactory.getInstance());\n\t\t\n\t\tResourceSet rSet = new ResourceSetImpl();\n\t\trSet.getResourceFactoryRegistry().getProtocolToFactoryMap().put(BlueprintsURI.SCHEME, PersistentResourceFactory.getInstance());\n\t\t\n\t\tResource graphResource = rSet.createResource(BlueprintsURI.createFileURI(new File(\"models/set1.graphdb\")));\n\t\tMap<String, Object> graphOptions = BlueprintsNeo4jOptionsBuilder.newBuilder().asMap();\n\t\tgraphResource.load(graphOptions);\n\t\t\n\t\tstartQuery();\n\t\t\n\t\ttry {\n\t\t\t/*\n\t\t\t * Create the OCL environment and load the query from an existing OCL file.\n\t\t\t * Note: Mogwa´ relies on the OCL Ecore metamodel. Moving to the Pivot metamodel is planned for the next release\n\t\t\t * and will provide support for computing queries over UML models.\n\t\t\t */\n\t\t\tOCL ocl = OCL.newInstance(EcoreEnvironmentFactory.INSTANCE);\n\t\t\tOCLInput oclInput = new OCLInput(new FileInputStream(new File(\"ocl/singletons.ocl\")));\n\t\t\tList<Constraint> constraints = ocl.parse(oclInput);\n\t\t\t\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tList<EObject> result = (List<EObject>)ocl.createQuery(constraints.get(0)).evaluate(graphResource.getContents().get(0));\n\t\t\tNeoLogger.info(\"Found {0} singletons\", result.size());\n\t\t\tendQuery();\n\t\t} catch(ParserException e) {\n\t\t\tSystem.out.println(\"Cannot parse the input OCL file\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t((PersistentResource)graphResource).close();\n\t}", "private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {\n\t\tname = in.readUTF();\n\t\tdesc = (String[]) in.readObject();\n\t\tmembers = (Members) in .readObject();\n\t\tbanlist = (List<UUID>) in .readObject();\n\t\tterritoryIds = (List<String>) in .readObject();\n\t\tinvite = in.readBoolean();\n\t}", "public void load() {\n structure = SpigotUtils.structBetweenTwoLocations(pos1, pos2, material);\n }", "public void loadQuickly(){\r\n System.out.println(\"I am going to try to load your games.\");\r\n String quickLoadPath = this.savePath + File.separator + \"QuickSave.ser\";\r\n this.load(quickLoadPath);\r\n }", "public void load(){\n Player temp;\n try{\n FileInputStream inputFile = new FileInputStream(\"./data.sec\");\n ObjectInputStream objectIn = new ObjectInputStream(inputFile);\n temp = (Player)objectIn.readObject();\n Arena.CUR_PLAYER = temp;\n objectIn.close();\n inputFile.close(); \n }\n catch(FileNotFoundException e ){\n System.err.print(\"data.sec not found\");\n }\n catch(IOException e){\n System.out.println(\"Error 201\");\n }\n catch(ClassNotFoundException e){\n System.out.println(\"Error 202\");\n }\n }", "private static Interaction loadInteraction() {\n File f = new File(\"./save_data\");\n if (f.exists()) {\n try {\n FileInputStream fs = new FileInputStream(f);\n ObjectInputStream os = new ObjectInputStream(fs);\n return (Interaction) os.readObject();\n } catch (FileNotFoundException e) {\n System.out.println(\"file not found\");\n System.exit(0);\n } catch (IOException e) {\n System.out.println(e);\n System.exit(0);\n } catch (ClassNotFoundException e) {\n System.out.println(\"class not found\");\n System.exit(0);\n }\n }\n /* In the case no Editor has been saved yet, we return a new one. */\n System.exit(0);\n return new Interaction();\n }", "public void load() {\n updater.load(-1); // -1 because Guest ID doesn't matter.\n }", "public Loader(){\n\t\tthis(PLANETS, NEIGHBOURS);\n\t}", "public void load() {\n ClassLoader loader;\n Class c;\n Mapper result;\n Method m;\n Object[] tables;\n\n if (isLoaded()) {\n return;\n }\n loader = Mapper.class.getClassLoader();\n try {\n c = loader.loadClass(name);\n } catch (ClassNotFoundException e) {\n throw new IllegalStateException(e.toString());\n }\n try {\n m = c.getMethod(\"load\", new Class[]{});\n } catch (NoSuchMethodException e) {\n throw new IllegalStateException(e.toString());\n }\n try {\n tables = (Object[]) m.invoke(null, new Object[] {});\n } catch (InvocationTargetException e) {\n throw new IllegalStateException(e.getTargetException().toString());\n } catch (IllegalAccessException e) {\n throw new IllegalStateException(e.toString());\n }\n parser = (Parser) tables[0];\n oag = (Oag) tables[1];\n }", "public void load() {\n World loadGame;\n final JFileChooser fileChooser =\n new JFileChooser(System.getProperty(\"user.dir\"));\n try {\n int fileOpened = fileChooser.showOpenDialog(GameFrame.this);\n\n if (fileOpened == JFileChooser.APPROVE_OPTION) {\n FileInputStream fileInput =\n new FileInputStream(fileChooser.getSelectedFile());\n ObjectInputStream objInput = new ObjectInputStream(fileInput);\n loadGame = (World) objInput.readObject();\n objInput.close();\n fileInput.close();\n } else {\n return;\n }\n } catch (IOException i) {\n i.printStackTrace();\n return;\n } catch (ClassNotFoundException x) {\n x.printStackTrace();\n return;\n }\n\n world = loadGame;\n gridPanel.removeAll();\n fillGamePanel();\n world.reinit();\n setWorld(world);\n GameFrame.this.repaint();\n System.out.println(\"Game loaded.\");\n }", "public static void main(String[] args) throws ClassNotFoundException, IOException {\n\t\tPersistProducts pp = new PersistProducts();\r\n\t\tpp.readData();\r\n\t}", "private void readObject (java.io.ObjectInputStream in) throws IOException {\n message(AX_PROGRESS,\"Deserialize activeX control\");\n try {\n in.defaultReadObject();\n long length = in.readLong();\n message(AX_PROGRESS, \"Read the size of COM storage: \" + length);\n String componentFileName = generateComponentFileName(\"x1p\");\n if (length > 0) {\n FileOutputStream fi = new FileOutputStream(componentFileName);\n byte[] buffer = new byte[1024];\n long sofar = 0;\n int num = -1;\n int bytesToRead = 0;\n\n /* The storage file could be many Megs so work in 1K chunks */\n while (sofar < length) {\n /* don't read more than we wrote */\n bytesToRead = (int)Math.min(1024, length - sofar);\n num = in.read(buffer, 0, bytesToRead);\n if (num < 0 ) {\n message(AX_ERROR,\n \"Unexpectedly encountered the end of the serialization stream\");\n break;\n }\n \n sofar += num;\n fi.write(buffer, 0, num);\n } \n\n fi.close();\n message(AX_PROGRESS, \"Created a \" + sofar + \" byte storage file.\");\n }\n boolean libraryIsLoaded = NativeMethodBroker.loadLibrary();\n if (!libraryIsLoaded) {\n throw new IOException(\"Could not locate JavaContainer dynamic library\");\n }\n \n messagesWaiting = new ThreadRequestQueue();\n if (length > 0) {\n loaded = true;\n fileLoadedFrom = componentFileName;\n }\n transientEventSets = new Hashtable();\n }\n catch (ClassNotFoundException e) {\n throw new IOException(e.toString());\n }\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Parent class object\");\n\t}", "protected abstract void loader() throws IOException;", "public static void load() throws ReflectiveOperationException {\n int minorVersion = BukkitReflection.getMinorVersion();\n Class<?> spawnEntityClass;\n Class<?> entityMetadataClass;\n Class<?> world;\n Class<?> entity;\n if (BukkitReflection.isMojangMapped()) {\n entity = Class.forName(\"net.minecraft.world.entity.Entity\");\n EntityTeleportClass = Class.forName(\"net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket\");\n EntityDestroyClass = Class.forName(\"net.minecraft.network.protocol.game.ClientboundRemoveEntitiesPacket\");\n entityMetadataClass = Class.forName(\"net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket\");\n Vec3D = Class.forName(\"net.minecraft.world.phys.Vec3\");\n EntityTypes = Class.forName(\"net.minecraft.world.entity.EntityType\");\n spawnEntityClass = Class.forName(\"net.minecraft.network.protocol.game.ClientboundAddEntityPacket\");\n PacketPlayOutEntity = Class.forName(\"net.minecraft.network.protocol.game.ClientboundMoveEntityPacket\");\n PacketPlayOutEntityLook = Class.forName(\"net.minecraft.network.protocol.game.ClientboundMoveEntityPacket$Rot\");\n PacketPlayOutNamedEntitySpawn = Class.forName(\"net.minecraft.network.protocol.game.ClientboundAddPlayerPacket\");\n world = Class.forName(\"net.minecraft.world.level.Level\");\n EntityArmorStand = Class.forName(\"net.minecraft.world.entity.decoration.ArmorStand\");\n } else if (minorVersion >= 17) {\n entity = Class.forName(\"net.minecraft.world.entity.Entity\");\n EntityTeleportClass = Class.forName(\"net.minecraft.network.protocol.game.PacketPlayOutEntityTeleport\");\n EntityDestroyClass = Class.forName(\"net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy\");\n entityMetadataClass = Class.forName(\"net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata\");\n Vec3D = Class.forName(\"net.minecraft.world.phys.Vec3D\");\n EntityTypes = Class.forName(\"net.minecraft.world.entity.EntityTypes\");\n spawnEntityClass = Class.forName(\"net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity\");\n PacketPlayOutEntity = Class.forName(\"net.minecraft.network.protocol.game.PacketPlayOutEntity\");\n PacketPlayOutEntityLook = Class.forName(\"net.minecraft.network.protocol.game.PacketPlayOutEntity$PacketPlayOutEntityLook\");\n PacketPlayOutNamedEntitySpawn = Class.forName(\"net.minecraft.network.protocol.game.PacketPlayOutNamedEntitySpawn\");\n world = Class.forName(\"net.minecraft.world.level.World\");\n EntityArmorStand = Class.forName(\"net.minecraft.world.entity.decoration.EntityArmorStand\");\n } else {\n entity = BukkitReflection.getLegacyClass(\"Entity\");\n spawnEntityClass = BukkitReflection.getLegacyClass(\"PacketPlayOutSpawnEntityLiving\", \"Packet24MobSpawn\");\n EntityTeleportClass = BukkitReflection.getLegacyClass(\"PacketPlayOutEntityTeleport\", \"Packet34EntityTeleport\");\n entityMetadataClass = BukkitReflection.getLegacyClass(\"PacketPlayOutEntityMetadata\", \"Packet40EntityMetadata\");\n EntityDestroyClass = BukkitReflection.getLegacyClass(\"PacketPlayOutEntityDestroy\", \"Packet29DestroyEntity\");\n PacketPlayOutEntity = BukkitReflection.getLegacyClass(\"PacketPlayOutEntity\", \"Packet30Entity\");\n PacketPlayOutEntityLook = BukkitReflection.getLegacyClass(\"PacketPlayOutEntity$PacketPlayOutEntityLook\", \"PacketPlayOutEntityLook\", \"Packet32EntityLook\");\n PacketPlayOutNamedEntitySpawn = BukkitReflection.getLegacyClass(\"PacketPlayOutNamedEntitySpawn\", \"Packet20NamedEntitySpawn\");\n world = BukkitReflection.getLegacyClass(\"World\");\n if (minorVersion >= 8) {\n EntityArmorStand = BukkitReflection.getLegacyClass(\"EntityArmorStand\");\n }\n }\n \n EntityDestroy_Entities = ReflectionUtils.getOnlyField(EntityDestroyClass);\n try {\n newEntityDestroy = EntityDestroyClass.getConstructor(int[].class);\n } catch (NoSuchMethodException e) {\n //1.17.0\n newEntityDestroy = EntityDestroyClass.getConstructor(int.class);\n }\n \n if (BukkitReflection.is1_19_3Plus()) {\n newEntityMetadata = entityMetadataClass.getConstructor(int.class, List.class);\n } else {\n newEntityMetadata = entityMetadataClass.getConstructor(int.class, DataWatcher.DataWatcher, boolean.class);\n }\n\n EntityTeleport_EntityId = ReflectionUtils.getFields(EntityTeleportClass, int.class).get(0);\n if (minorVersion >= 17) {\n Constructor<?> newEntityArmorStand = EntityArmorStand.getConstructor(world, double.class, double.class, double.class);\n Method World_getHandle = Class.forName(\"org.bukkit.craftbukkit.\" + BukkitReflection.getServerPackage() + \".CraftWorld\").getMethod(\"getHandle\");\n dummyEntity = newEntityArmorStand.newInstance(World_getHandle.invoke(Bukkit.getWorlds().get(0)), 0, 0, 0);\n newEntityTeleport = EntityTeleportClass.getConstructor(entity);\n } else {\n newEntityTeleport = EntityTeleportClass.getConstructor();\n }\n if (minorVersion >= 9) {\n EntityTeleport_X = ReflectionUtils.getFields(EntityTeleportClass, double.class).get(0);\n EntityTeleport_Y = ReflectionUtils.getFields(EntityTeleportClass, double.class).get(1);\n EntityTeleport_Z = ReflectionUtils.getFields(EntityTeleportClass, double.class).get(2);\n } else {\n EntityTeleport_X = ReflectionUtils.getFields(EntityTeleportClass, int.class).get(1);\n EntityTeleport_Y = ReflectionUtils.getFields(EntityTeleportClass, int.class).get(2);\n EntityTeleport_Z = ReflectionUtils.getFields(EntityTeleportClass, int.class).get(3);\n }\n\n if (minorVersion >= 13) {\n entityIds.put(EntityType.ARMOR_STAND, 1);\n } else {\n entityIds.put(EntityType.WITHER, 64);\n if (minorVersion >= 8) {\n entityIds.put(EntityType.ARMOR_STAND, 30);\n }\n }\n\n if (BukkitReflection.isMojangMapped()) {\n EntityTypes_ARMOR_STAND = EntityTypes.getDeclaredField(\"ARMOR_STAND\").get(null);\n } else if (minorVersion >= 19) {\n EntityTypes_ARMOR_STAND = EntityTypes.getDeclaredField(\"d\").get(null);\n } else if (minorVersion >= 17) {\n EntityTypes_ARMOR_STAND = ReflectionUtils.getField(EntityTypes, \"c\", \"f_20529_\").get(null); // Mohist 1.18.2\n }\n\n if (minorVersion >= 19) {\n newSpawnEntity = spawnEntityClass.getConstructor(int.class, UUID.class, double.class, double.class, double.class, float.class, float.class, EntityTypes, int.class, Vec3D, double.class);\n Vec3D_Empty = ReflectionUtils.getOnlyField(Vec3D, Vec3D).get(null);\n } else if (minorVersion >= 17) {\n newSpawnEntity = spawnEntityClass.getConstructor(int.class, UUID.class, double.class, double.class, double.class, float.class, float.class, EntityTypes, int.class, Vec3D);\n Vec3D_Empty = ReflectionUtils.getOnlyField(Vec3D, Vec3D).get(null);\n } else {\n newSpawnEntity = spawnEntityClass.getConstructor();\n SpawnEntity_EntityId = ReflectionUtils.getFields(spawnEntityClass, int.class).get(0);\n if (minorVersion >= 9) {\n SpawnEntity_UUID = ReflectionUtils.getOnlyField(spawnEntityClass, UUID.class);\n SpawnEntity_X = ReflectionUtils.getFields(spawnEntityClass, double.class).get(0);\n SpawnEntity_Y = ReflectionUtils.getFields(spawnEntityClass, double.class).get(1);\n SpawnEntity_Z = ReflectionUtils.getFields(spawnEntityClass, double.class).get(2);\n } else {\n SpawnEntity_X = ReflectionUtils.getFields(spawnEntityClass, int.class).get(2);\n SpawnEntity_Y = ReflectionUtils.getFields(spawnEntityClass, int.class).get(3);\n SpawnEntity_Z = ReflectionUtils.getFields(spawnEntityClass, int.class).get(4);\n }\n SpawnEntity_EntityType = ReflectionUtils.getFields(spawnEntityClass, int.class).get(1);\n if (minorVersion <= 14) {\n SpawnEntity_DataWatcher = ReflectionUtils.getOnlyField(spawnEntityClass, DataWatcher.DataWatcher);\n }\n }\n PacketPlayOutEntity_ENTITYID = ReflectionUtils.getFields(PacketPlayOutEntity, int.class).get(0);\n PacketPlayOutNamedEntitySpawn_ENTITYID = ReflectionUtils.getFields(PacketPlayOutNamedEntitySpawn, int.class).get(0);\n available = true;\n }", "protected void loadGUIs()\n {\n guiMap.put(\"game\", new GuiGame(this));\n }", "public \n PluginClassLoader\n (\n TreeMap<String,byte[]> contents, \n ClassLoader parentLoader\n ) \n {\n super(parentLoader == null ? getSystemClassLoader() : parentLoader);\n\n pContents = contents; \n pResources = new TreeMap<String,Long>();\n }", "public static void viewLoadLandRegistryFromBackUp() {\n\t\tArrayList<Property> prop_list = rc.loadFromFile(PROPERTIES_FILE);\r\n\t\tArrayList<Registrant> reg_list = rc.loadFromFile(REGISTRANTS_FILE);\r\n\t}", "abstract public Node load();", "@Override\n\t\tvoid loadData() throws IOException {\n\t\t\tsuper.loadData();\n\t\t}", "public void initializePackageContents() {\r\n\t\tif (isInitialized) return;\r\n\t\tisInitialized = true;\r\n\r\n\t\t// Initialize package\r\n\t\tsetName(eNAME);\r\n\t\tsetNsPrefix(eNS_PREFIX);\r\n\t\tsetNsURI(eNS_URI);\r\n\r\n\t\t// Obtain other dependent packages\r\n\t\tno.hal.pg.runtime.RuntimePackage theRuntimePackage_1 = (no.hal.pg.runtime.RuntimePackage)EPackage.Registry.INSTANCE.getEPackage(no.hal.pg.runtime.RuntimePackage.eNS_URI);\r\n\t\tOsmPackage theOsmPackage = (OsmPackage)EPackage.Registry.INSTANCE.getEPackage(OsmPackage.eNS_URI);\r\n\t\tEcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);\r\n\t\tAppPackage theAppPackage = (AppPackage)EPackage.Registry.INSTANCE.getEPackage(AppPackage.eNS_URI);\r\n\r\n\t\t// Create type parameters\r\n\r\n\t\t// Set bounds for type parameters\r\n\r\n\t\t// Add supertypes to classes\r\n\t\tEGenericType g1 = createEGenericType(theRuntimePackage_1.getTask());\r\n\t\tEGenericType g2 = createEGenericType(this.getPlayerTaskScores());\r\n\t\tg1.getETypeArguments().add(g2);\r\n\t\tpuzzleTaskEClass.getEGenericSuperTypes().add(g1);\r\n\t\tg1 = createEGenericType(theOsmPackage.getGeoLocation());\r\n\t\tpuzzleTaskEClass.getEGenericSuperTypes().add(g1);\r\n\t\tg1 = createEGenericType(theAppPackage.getTaskView());\r\n\t\tg2 = createEGenericType(this.getPuzzleTask());\r\n\t\tg1.getETypeArguments().add(g2);\r\n\t\tpuzzleTaskViewEClass.getEGenericSuperTypes().add(g1);\r\n\t\tsimplePuzzleEClass.getESuperTypes().add(this.getPuzzle());\r\n\r\n\t\t// Initialize classes, features, and operations; add parameters\r\n\t\tinitEClass(puzzleTaskEClass, PuzzleTask.class, \"PuzzleTask\", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);\r\n\t\tinitEReference(getPuzzleTask_Puzzles(), this.getPuzzle(), null, \"puzzles\", null, 0, -1, PuzzleTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\t\tinitEReference(getPuzzleTask_PlayerLevels(), this.getPlayerToInt(), null, \"playerLevels\", null, 0, -1, PuzzleTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\t\tinitEReference(getPuzzleTask_PlayerTaskScores(), this.getPlayerTaskScores(), null, \"playerTaskScores\", null, 0, 1, PuzzleTask.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\r\n\t\tEOperation op = initEOperation(getPuzzleTask__AcceptPuzzleProposal__String_Player(), theEcorePackage.getEBoolean(), \"acceptPuzzleProposal\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\t\taddEParameter(op, theEcorePackage.getEString(), \"proposal\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\t\taddEParameter(op, theRuntimePackage_1.getPlayer(), \"player\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\r\n\t\top = initEOperation(getPuzzleTask__CalculateScore__int_Player_boolean(), theEcorePackage.getEInt(), \"calculateScore\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\t\taddEParameter(op, theEcorePackage.getEInt(), \"puzzleLevel\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\t\taddEParameter(op, theRuntimePackage_1.getPlayer(), \"player\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\t\taddEParameter(op, theEcorePackage.getEBoolean(), \"isProposalCorrect\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\r\n\t\top = initEOperation(getPuzzleTask__AcceptPlayer__Player(), theEcorePackage.getEBoolean(), \"acceptPlayer\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\t\taddEParameter(op, theRuntimePackage_1.getPlayer(), \"player\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\r\n\t\tinitEClass(puzzlePieceEClass, PuzzlePiece.class, \"PuzzlePiece\", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);\r\n\t\tinitEAttribute(getPuzzlePiece_Image(), theEcorePackage.getEString(), \"image\", null, 0, 1, PuzzlePiece.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\t\tinitEAttribute(getPuzzlePiece_PlayerCount(), theEcorePackage.getEInt(), \"playerCount\", null, 0, 1, PuzzlePiece.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\r\n\t\tinitEClass(puzzleTaskViewEClass, PuzzleTaskView.class, \"PuzzleTaskView\", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);\r\n\t\tinitEAttribute(getPuzzleTaskView_Image(), theEcorePackage.getEString(), \"image\", null, 0, 1, PuzzleTaskView.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED);\r\n\t\tinitEAttribute(getPuzzleTaskView_Score(), theEcorePackage.getEInt(), \"score\", null, 0, 1, PuzzleTaskView.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED);\r\n\t\tinitEAttribute(getPuzzleTaskView_Level(), theEcorePackage.getEInt(), \"level\", null, 0, 1, PuzzleTaskView.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED);\r\n\r\n\t\top = initEOperation(getPuzzleTaskView__ProposeAnswer__String(), this.getPuzzleTaskView(), \"proposeAnswer\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\t\taddEParameter(op, theEcorePackage.getEString(), \"proposal\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\r\n\t\tinitEOperation(getPuzzleTaskView__Finish(), null, \"finish\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\r\n\t\tinitEOperation(getPuzzleTaskView__StartPuzzle(), null, \"startPuzzle\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\r\n\t\tinitEOperation(getPuzzleTaskView__AcceptPlayer(), theEcorePackage.getEBoolean(), \"acceptPlayer\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\r\n\t\tinitEClass(playerToIntEClass, Map.Entry.class, \"PlayerToInt\", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS);\r\n\t\tinitEReference(getPlayerToInt_Key(), theRuntimePackage_1.getPlayer(), null, \"key\", null, 0, 1, Map.Entry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\t\tinitEAttribute(getPlayerToInt_Value(), theEcorePackage.getEIntegerObject(), \"value\", null, 0, 1, Map.Entry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\r\n\t\tinitEClass(puzzleEClass, Puzzle.class, \"Puzzle\", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);\r\n\t\tinitEAttribute(getPuzzle_Level(), theEcorePackage.getEInt(), \"level\", null, 0, 1, Puzzle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\r\n\t\top = initEOperation(getPuzzle__AcceptProposal__String(), theEcorePackage.getEBoolean(), \"acceptProposal\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\t\taddEParameter(op, theEcorePackage.getEString(), \"proposal\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\r\n\t\top = initEOperation(getPuzzle__FinishPuzzle__Player(), theEcorePackage.getEBoolean(), \"finishPuzzle\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\t\taddEParameter(op, theRuntimePackage_1.getPlayer(), \"player\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\r\n\t\top = initEOperation(getPuzzle__StartPuzzle__Player(), theEcorePackage.getEBoolean(), \"startPuzzle\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\t\taddEParameter(op, theRuntimePackage_1.getPlayer(), \"player\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\r\n\t\top = initEOperation(getPuzzle__GetImage__Player(), theEcorePackage.getEString(), \"getImage\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\t\taddEParameter(op, theRuntimePackage_1.getPlayer(), \"player\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\r\n\t\tinitEClass(simplePuzzleEClass, SimplePuzzle.class, \"SimplePuzzle\", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);\r\n\t\tinitEReference(getSimplePuzzle_Instructions(), theRuntimePackage_1.getInfoItem(), null, \"instructions\", null, 0, 1, SimplePuzzle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\t\tinitEAttribute(getSimplePuzzle_Solution(), theEcorePackage.getEString(), \"solution\", null, 0, 1, SimplePuzzle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\t\tinitEReference(getSimplePuzzle_PuzzlePieces(), this.getPuzzlePiece(), null, \"puzzlePieces\", null, 0, -1, SimplePuzzle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\t\tinitEReference(getSimplePuzzle_PlayerPieces(), this.getPlayerToPuzzlePiece(), null, \"playerPieces\", null, 0, -1, SimplePuzzle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\r\n\t\top = initEOperation(getSimplePuzzle__AcceptProposal__String(), theEcorePackage.getEBoolean(), \"acceptProposal\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\t\taddEParameter(op, theEcorePackage.getEString(), \"proposal\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\r\n\t\top = initEOperation(getSimplePuzzle__FinishPuzzle__Player(), theEcorePackage.getEBoolean(), \"finishPuzzle\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\t\taddEParameter(op, theRuntimePackage_1.getPlayer(), \"player\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\r\n\t\top = initEOperation(getSimplePuzzle__StartPuzzle__Player(), theEcorePackage.getEBoolean(), \"startPuzzle\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\t\taddEParameter(op, theRuntimePackage_1.getPlayer(), \"player\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\r\n\t\top = initEOperation(getSimplePuzzle__GetImage__Player(), theEcorePackage.getEString(), \"getImage\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\t\taddEParameter(op, theRuntimePackage_1.getPlayer(), \"player\", 0, 1, IS_UNIQUE, IS_ORDERED);\r\n\r\n\t\tinitEClass(playerTaskScoreEClass, PlayerTaskScore.class, \"PlayerTaskScore\", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);\r\n\t\tinitEReference(getPlayerTaskScore_Player(), theRuntimePackage_1.getPlayer(), null, \"player\", null, 0, 1, PlayerTaskScore.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\t\tinitEAttribute(getPlayerTaskScore_Score(), theEcorePackage.getEInt(), \"score\", null, 0, 1, PlayerTaskScore.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\t\tinitEAttribute(getPlayerTaskScore_Level(), theEcorePackage.getEInt(), \"level\", null, 0, 1, PlayerTaskScore.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\r\n\t\tinitEClass(playerTaskScoresEClass, PlayerTaskScores.class, \"PlayerTaskScores\", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);\r\n\t\tinitEReference(getPlayerTaskScores_Scores(), this.getPlayerTaskScore(), null, \"scores\", null, 0, -1, PlayerTaskScores.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\r\n\t\tinitEClass(playerToPuzzlePieceEClass, Map.Entry.class, \"PlayerToPuzzlePiece\", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS);\r\n\t\tinitEReference(getPlayerToPuzzlePiece_Key(), theRuntimePackage_1.getPlayer(), null, \"key\", null, 0, 1, Map.Entry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\t\tinitEReference(getPlayerToPuzzlePiece_Value(), this.getPuzzlePiece(), null, \"value\", null, 0, 1, Map.Entry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\r\n\t\t// Create resource\r\n\t\tcreateResource(eNS_URI);\r\n\t}", "public void load() {\n loadDisabledWorlds();\n chunks.clear();\n for (World world : ObsidianDestroyer.getInstance().getServer().getWorlds()) {\n for (Chunk chunk : world.getLoadedChunks()) {\n loadChunk(chunk);\n }\n }\n }", "public Loader(String spaceObjects, String neighbours) {\n\t\tloadSpaceObjects(spaceObjects);\n\t\tloadNeighbours(neighbours);\n\t\tloadInformation();\n\t}", "public GameModel(){\n try {\n //System.out.println(\"Assuming dictionary file is with .jar or in bin/\");\n this.phraseBook = GameDictionaryReader.readDictionary(getRootDictionary());\n } catch (FileNotFoundException e){\n System.out.println(\"ERROR: Dictionary could not be found!\");\n System.exit(1);\n }\n }", "protected void loadAll() {\n\t\ttry {\n\t\t\tloadGroups(this.folder, this.cls, this.cachedOnes);\n\t\t\t/*\n\t\t\t * we have to initialize the components\n\t\t\t */\n\t\t\tfor (Object obj : this.cachedOnes.values()) {\n\t\t\t\t((Component) obj).getReady();\n\t\t\t}\n\t\t\tTracer.trace(this.cachedOnes.size() + \" \" + this + \" loaded.\");\n\t\t} catch (Exception e) {\n\t\t\tthis.cachedOnes.clear();\n\t\t\tTracer.trace(\n\t\t\t\t\te,\n\t\t\t\t\tthis\n\t\t\t\t\t\t\t+ \" pre-loading failed. No component of this type is available till we successfully pre-load them again.\");\n\t\t}\n\t}", "public static void main (String args[]) throws FileNotFoundException, \n\t\t\tIOException {\n\t\tPerson me = null;\n\n\t\tFileInputStream underlyingStream = new FileInputStream(\n\t\t\t\t\t\"./person.ser\"\n\t\t\t\t\t);\n\t\tObjectInputStream reader = new ObjectInputStream(underlyingStream);\n\t\t\n\t\t// read the person object in\n\t\ttry{\n\t\t\tme = (Person) reader.readObject();\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tSystem.out.println(me);\t\t\n\t}", "@Override\r\n\tprotected void initLoad() {\n\r\n\t}", "public static void load() {\r\n\t\tString mar = new String(readMAR().getStr());\r\n\t\tTraceINF.write(\"Read memory \"+mar);\r\n\t\tFormatstr content = new Formatstr();\r\n//\t\tSystem.out.println(\"index\"+Integer.parseInt(mar.substring(0, mar.length() - 2), 2));\r\n\t\tcontent.setStr(getBank(mar)[Integer.parseInt(mar.substring(0, mar.length() - 2), 2)]);\r\n\t\t\r\n\t\twriteMBR(content);\r\n\t\tTraceINF.write(\"Read finished.\");\r\n\t}", "private void readObject() {}", "private void readObject() {}", "private void readObject() {}", "public EmbeddedObjects() {\n super();\n this._embeddedObjectList = new java.util.Vector<de.lsem.simulation.transformation.anylogic.generator.persistant.EmbeddedObject>();\n }", "private void loadGameFiles(){\n\t}", "private void loadAssembly () {\r\n Factory assemblyFactory = new AssemblyFactory(mySimulation);\r\n int response = INPUT_CHOOSER.showDialog(null, \"Assembly file\");\r\n if (response == JFileChooser.APPROVE_OPTION) {\r\n assemblyFactory.loadFile(INPUT_CHOOSER.getSelectedFile());\r\n }\r\n }", "public void initializePackageContents() {\r\n\t\tif (isInitialized) return;\r\n\t\tisInitialized = true;\r\n\r\n\t\t// Initialize package\r\n\t\tsetName(eNAME);\r\n\t\tsetNsPrefix(eNS_PREFIX);\r\n\t\tsetNsURI(eNS_URI);\r\n\r\n\t\t// Obtain other dependent packages\r\n\t\tCorePackage theCorePackage = (CorePackage)EPackage.Registry.INSTANCE.getEPackage(CorePackage.eNS_URI);\r\n\t\tInstancePackage theInstancePackage = (InstancePackage)EPackage.Registry.INSTANCE.getEPackage(InstancePackage.eNS_URI);\r\n\t\tValuetypePackage theValuetypePackage = (ValuetypePackage)EPackage.Registry.INSTANCE.getEPackage(ValuetypePackage.eNS_URI);\r\n\t\tRealtimestatechartPackage theRealtimestatechartPackage = (RealtimestatechartPackage)EPackage.Registry.INSTANCE.getEPackage(RealtimestatechartPackage.eNS_URI);\r\n\r\n\t\t// Create type parameters\r\n\r\n\t\t// Set bounds for type parameters\r\n\r\n\t\t// Add supertypes to classes\r\n\t\trunnableEClass.getESuperTypes().add(theCorePackage.getNamedElement());\r\n\t\tlabelEClass.getESuperTypes().add(theCorePackage.getNamedElement());\r\n\t\tlabelAccessEClass.getESuperTypes().add(theCorePackage.getNamedElement());\r\n\r\n\t\t// Initialize classes, features, and operations; add parameters\r\n\t\tinitEClass(runnableEClass, org.muml.pim.runnable.Runnable.class, \"Runnable\", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);\r\n\t\tinitEReference(getRunnable_ComponentInstance(), theInstancePackage.getComponentInstance(), theInstancePackage.getComponentInstance_Runnables(), \"componentInstance\", null, 1, 1, org.muml.pim.runnable.Runnable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\t\tinitEReference(getRunnable_PortInstance(), theInstancePackage.getPortInstance(), theInstancePackage.getPortInstance_Runnable(), \"portInstance\", null, 0, -1, org.muml.pim.runnable.Runnable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\t\tinitEReference(getRunnable_Period(), theValuetypePackage.getTimeValue(), null, \"period\", null, 1, 1, org.muml.pim.runnable.Runnable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\t\tinitEReference(getRunnable_LabelAccesses(), this.getLabelAccess(), this.getLabelAccess_AccessingRunnable(), \"labelAccesses\", null, 0, -1, org.muml.pim.runnable.Runnable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\t\tinitEReference(getRunnable_Deadline(), theValuetypePackage.getTimeValue(), null, \"deadline\", null, 0, 1, org.muml.pim.runnable.Runnable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\r\n\t\tinitEClass(labelEClass, Label.class, \"Label\", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);\r\n\t\tinitEReference(getLabel_ComponentInstance(), theInstancePackage.getComponentInstance(), theInstancePackage.getComponentInstance_Labels(), \"componentInstance\", null, 1, 1, Label.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\t\tinitEReference(getLabel_ComponentStatechart(), theRealtimestatechartPackage.getRealtimeStatechart(), null, \"componentStatechart\", null, 0, 1, Label.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\t\tinitEAttribute(getLabel_IsConstant(), ecorePackage.getEBoolean(), \"isConstant\", \"false\", 1, 1, Label.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\r\n\t\tinitEClass(labelAccessEClass, LabelAccess.class, \"LabelAccess\", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);\r\n\t\tinitEAttribute(getLabelAccess_AccessKind(), this.getLabelAccessKind(), \"accessKind\", null, 1, 1, LabelAccess.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\t\tinitEReference(getLabelAccess_AccessLabel(), this.getLabel(), null, \"accessLabel\", null, 1, 1, LabelAccess.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\t\tinitEReference(getLabelAccess_AccessingRunnable(), this.getRunnable(), this.getRunnable_LabelAccesses(), \"accessingRunnable\", null, 1, 1, LabelAccess.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);\r\n\r\n\t\t// Initialize enums and add enum literals\r\n\t\tinitEEnum(labelAccessKindEEnum, LabelAccessKind.class, \"LabelAccessKind\");\r\n\t\taddEEnumLiteral(labelAccessKindEEnum, LabelAccessKind.READACCESS);\r\n\t\taddEEnumLiteral(labelAccessKindEEnum, LabelAccessKind.WRITEACCESS);\r\n\t}", "public static void main(String[] args) {\n\t\tProtecion ob1 = new Protecion();\n\t\tDerived ob2 = new Derived();\n\t\tSamePackage ob3 = new SamePackage();\n\t\tProtecion2 ob4 = new Protecion2();\n\t\tOtherPackage ob5 = new OtherPackage();\n\t\t\n\t\t\n\t\tob1.Protecion();\n\t\tob2.Deroved();\n\t\t\n\t}", "@Override\n public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {\n\n\n }" ]
[ "0.5719416", "0.5627503", "0.55981505", "0.5568266", "0.55657965", "0.55657965", "0.5529594", "0.5501362", "0.54701364", "0.541962", "0.5417842", "0.54075927", "0.54027027", "0.54010576", "0.5399618", "0.5367955", "0.5367955", "0.5356412", "0.5348403", "0.53370905", "0.53370905", "0.53370905", "0.5329864", "0.5301364", "0.52853894", "0.5280115", "0.52793705", "0.52759033", "0.52759033", "0.52667093", "0.5263147", "0.5257422", "0.5242354", "0.5222162", "0.5220262", "0.52160335", "0.5206556", "0.52021706", "0.5197184", "0.5185922", "0.51642877", "0.51555645", "0.5146775", "0.5146619", "0.5125777", "0.5122794", "0.51162404", "0.5108388", "0.5092085", "0.5075136", "0.50663126", "0.50595194", "0.5055687", "0.50482225", "0.5013502", "0.50107545", "0.4997065", "0.4997065", "0.49949595", "0.49939564", "0.49832928", "0.49754488", "0.49668568", "0.49653172", "0.49589863", "0.49491075", "0.49395138", "0.49372938", "0.49346942", "0.49247342", "0.49140784", "0.4895693", "0.48848337", "0.48773372", "0.48707107", "0.48638543", "0.48598874", "0.48573318", "0.48563242", "0.48556852", "0.48494443", "0.48478845", "0.48472193", "0.48468548", "0.48421124", "0.48404095", "0.48387766", "0.48357835", "0.48335242", "0.48012942", "0.47976717", "0.47932777", "0.47932777", "0.47932777", "0.47847408", "0.477491", "0.47690028", "0.4761291", "0.47538358", "0.47454515" ]
0.59322864
0
Recursively calculates the weight of this program and all children.
public int getTotalWeight() { if (_cachedTotalWeight == 0) { int totalWeight = getWeight(); for (Program child : getChildren()) { totalWeight += child.getTotalWeight(); } _cachedTotalWeight = totalWeight; } return (_cachedTotalWeight); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private double getChildrenTotalAlternativeWeight() {\n double totalWeight = 0.0;\n for (DependencyDescription child : this.getChildren()) {\n totalWeight += child.getAlternativeProbability();\n }\n return totalWeight;\n }", "public double computeScore(Params params) {\n score = localScore(params);\n if (children != null)\n for (Derivation child : children)\n score += child.computeScore(params);\n return score;\n }", "@Override\n protected SearchResponse compute() {\n if (this.searchRoot.children == null || this.searchRoot.children.isEmpty()) {\n return new SearchResponse(searchRoot.weight, null);\n }\n\n // Search child nodes recursively\n List<UnbalancedNodeSearcher> subtasks = new ArrayList<>(searchRoot.children.size());\n for (Node n : searchRoot.children) {\n UnbalancedNodeSearcher subtask = new UnbalancedNodeSearcher(n);\n subtasks.add(subtask);\n subtask.fork();\n }\n\n // Use a map to vote for the \"wrong\"(i.e. minority) disc weight\n Map<Long, AtomicLong> totalWeight = new HashMap<>();\n\n // To find out who reported the \"wrong\" weight\n Map<Long, Node> resultNodeMap = new HashMap<>();\n for (UnbalancedNodeSearcher searcher : subtasks) {\n SearchResponse response = searcher.join();\n\n // The search is over\n if (response.foundResult != null) {\n return response;\n }\n\n resultNodeMap.put(response.subSum, searcher.searchRoot);\n\n totalWeight.computeIfAbsent(response.subSum, (i) -> new AtomicLong(0L)).incrementAndGet();\n }\n\n if (totalWeight.size() == 1) {\n // Since there's only one\n long subtotal = totalWeight.keySet().iterator().next();\n long total = subtotal * subtasks.size() + searchRoot.weight;\n\n return new SearchResponse(total, null);\n } else if (totalWeight.size() == 2) {\n long correctWeight = -1;\n long wrongWeight = -1;\n for (Map.Entry<Long, AtomicLong> entry : totalWeight.entrySet()) {\n if (entry.getValue().get() != 1L) {\n correctWeight = entry.getKey();\n } else {\n wrongWeight = entry.getKey();\n }\n }\n\n return new SearchResponse(null, resultNodeMap.get(wrongWeight).weight - (wrongWeight - correctWeight));\n } else {\n throw new RuntimeException(\"More than one incorrect nodes\");\n }\n }", "public int weight ();", "public abstract double totalWeight();", "int Weight();", "public int weight() {\n if (this.weight == null) {\n return 0;\n } else {\n return this.weight;\n } // if/else\n }", "public double calculateValue() {\n if (!isLeaf && Double.isNaN(value)) {\n for (List<LatticeNode> list : children) {\n double tempVal = 0;\n for (LatticeNode node : list) {\n tempVal += ((CALatticeNode) node).calculateValue();\n }\n if (!list.isEmpty())\n value = tempVal;\n }\n }\n weight = Math.abs(value);\n return value;\n }", "public double computeScoreLocal(Params params) {\n score = localScore(params);\n if (children != null)\n for (Derivation child : children)\n score += child.score;\n return score;\n }", "public Double getBranchTotalWeight() {\n var totalWeight = 0D;\n if (parent != null) {\n totalWeight += parent.getBranchTotalWeight();\n }\n if (item != null) {\n totalWeight += item.getWeight();\n }\n\n return totalWeight;\n }", "public int weight(){\n\t\treturn this.weight;\n\t}", "public int weight() {\n \treturn weight;\n }", "public double findWeight(){\n int totalCoins = gold + silver + copper + electrum + platinum;\n if((totalCoins % 3) == 0){\n return totalCoins/3;\n }\n return totalCoins * weight;\n }", "abstract long calculateChildCount() throws TskCoreException;", "public double getWeight() {\n\t\tIterator<Ball> it = this.contents.iterator();\n\t\tdouble retVal = 0;\n\t\twhile (it.hasNext()) {\n\t\t\tretVal += it.next().getWeight();\n\t\t}\n\t\treturn retVal;\n\t}", "private double costOf(int w) {\n\t\treturn getVertex(w).getCost();\n\t}", "int getWeight();", "int getWeight();", "public int weight(Person person) {\n\t\tthis.weightMeasuredCount++; \n return person.getWeight(); \n }", "private void generateRecursive(ArrayList<double[]> weights,\n\t\t\tdouble[] weight, int numberOfObjectives, int left, int total, int index) {\n\t\tif (index == (numberOfObjectives - 1)) {\n\t\t\tweight[index] = (double)left/total;\n\t\t\tweights.add(weight.clone());\n\t\t} else {\n\t\t\tfor (int i = 0; i <= left; i += 1) {\n\t\t\t\tweight[index] = (double) i / total;\n\t\t\t\tgenerateRecursive(weights, weight, numberOfObjectives, left - i, total, index + 1);\n\t\t\t}\n\t\t}\n\t}", "@Override\n public double getWeight() {\n // For this example just assuming all cars weigh 500kg and people weigh 70kg\n return 500 + (70 * this.getNumPassengers());\n }", "private double weight(){\n return ((double) (m_PositiveCount + m_NegativeCount)) / ((double) m_PositiveCount);\n }", "@Override\r\n\tpublic double Weight() {\n\t\treturn Weight;\r\n\t}", "public abstract double getWeight ();", "public int getWeight();", "default double totalWeight() {\n return edges().stream().mapToDouble(E::weight).sum();\n }", "@Override\n\tpublic void additionalWeightWork() {\n\t\t\n\t}", "public double getWeight()\n\t{\n\t\t//metodo precisa retornar alguma coisa\n\t\treturn 0.0;\n\t}", "public static void main(String[] args) {\n BinaryTreeNode root=new BinaryTreeNode(20);\n root.left=new BinaryTreeNode(8);\n root.right=new BinaryTreeNode(12);\n root.right.left=new BinaryTreeNode(3);\n root.right.right=new BinaryTreeNode(9);\n System.out.println(ChildrenSumProperty.sol(root));\n }", "public void updateWeights() {\n\t\t\n\t}", "public static void main(String[] args) {\n TreeNode root = build(1, build(2, null, build(1)), build(3));\n System.out.println(new SumRootToLeaf().sum(root));\n }", "public void calculateEdgeWeights() {\n\n\t// Use a ListIterator so that we can modify the list\n\t// as we go\n\tListIterator<LayoutEdge>iter = edgeList.listIterator();\n\twhile (iter.hasNext()) {\n\t LayoutEdge edge = iter.next();\n\n\t // If we're only dealing with selected nodes, drop any edges\n\t // that don't have any selected nodes\n\t if (edge.getSource().isLocked() && edge.getTarget().isLocked()) {\n\t\titer.remove();\n\t } else if (edgeWeighter != null && edgeWeighter.normalizeWeight(edge) == false)\n\t\titer.remove();\n\n\t //logger.debug(\"Edge \"+edge.getEdge().getIdentifier()+\" now has weight \"+edge.getWeight());\n\t // logger.info( edge.toString() + \" now has weight \"+edge.getWeight());\n\t}\n }", "private void calculateWeight(Iterable<PageRankWritable> messages) {\r\n\t\tlong totalInCount = 0;\r\n\t\tlong totalOutCount = 0;\r\n\r\n\t\t// Because iterator can not go back to the first record,\r\n\t\t// so we need to new another Map to store the in/out edge counts.\r\n\t\tMap<Text, long[]> edgeCountMap = new HashMap<Text, long[]>();\r\n\t\tfor (PageRankWritable msg : messages) {\r\n\t\t\ttotalInCount += msg.getInEdgeCount().get();\r\n\t\t\ttotalOutCount += msg.getOutEdgeCount().get();\r\n\r\n\t\t\t// Store edge counts.\r\n\t\t\tlong[] edgeCounts = new long[2];\r\n\t\t\tedgeCounts[0] = msg.getInEdgeCount().get();\r\n\t\t\tedgeCounts[1] = msg.getOutEdgeCount().get();\r\n\t\t\tedgeCountMap.put(msg.getSenderId(), edgeCounts);\r\n\t\t}\r\n\r\n\t\t// Calculate weight for each destination vertex.\r\n\t\tMapWritable weightMap = new MapWritable();\r\n\t\tfor (Entry<Text, long[]> entry : edgeCountMap.entrySet()) {\r\n\t\t\tText key = entry.getKey();\r\n\t\t\tlong[] value = entry.getValue();\r\n\t\t\tdouble weight = (value[0] / (double) totalInCount)\r\n\t\t\t\t\t* (value[1] / (double) totalOutCount);\r\n\t\t\tweightMap.put(key, new DoubleWritable(weight));\r\n\t\t}\r\n\r\n\t\tgetValue().setWeightMap(weightMap);\r\n\t}", "public double getWeight() {\n\t\treturn weight; \n\t\t}", "public void updateBottomWeight(){\r\n\t \tif(this.bottomNode != null)\r\n\t \t{\r\n\t \t\tif( this.bottomNode.isNoGoZone() == true)\r\n\t \t{\r\n\t \t\t\t//set edge weight to 9999 if the next node is NO go zone or\r\n\t \t\t\t//boundary node\r\n\t \t\tthis.bottomWeight = weightOfNoGoZone;\r\n\t \t}\r\n\t \telse if(this.bottomNode.isRoad() == true && this.bottomNode.isNoGoZone() == false)\r\n\t \t{\r\n\t \t\t//set edge weight to 1 if the next node is a road node\r\n\t \t\tthis.bottomWeight = this.bottomNode.getOwnElevation();\r\n\t \t}\r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\t//set edge weight to INF if the next node is NULL\r\n\t \t\tthis.bottomWeight = weightOfMapEdge;\r\n\t \t}\r\n\t }", "protected int calculateWalk() {\n if (isPrimitive()) {\n double rating = getEngine().getRating();\n rating /= 1.2;\n if (rating % 5 != 0) {\n return (int) (rating - rating % 5 + 5) / (int) weight;\n }\n return (int) (rating / (int) weight);\n\n }\n return getEngine().getRating() / (int) weight;\n }", "public float getCost(int weight, int volume) {\r\n\t\t//System.out.println(\"getCost method in Journey called. should have been a delivery.\");\r\n\t\ttimesUsed++;\r\n\t\tfloat total = 0;\r\n\t\tfor(Path p: usedPaths){\r\n\t\t\t\ttry {\r\n\t\t\t\t\ttotal += p.calcCost(weight, volume);\r\n\t\t\t\t} catch (OverweightException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t} catch (ExceededVolumeException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t}\r\n\t\ttotalCost += total;\r\n\t\treturn total;\r\n\t}", "public float getWeight();", "public double getWeight(){\n\t\treturn this._weight;\n\t}", "public Program getImbalancedChild() {\n\t\tMap<Integer, List<Program>> weightsToChildren = new HashMap<>();\n\t\tfor (Program child : getChildren()) {\n\t\t\tweightsToChildren.computeIfAbsent(child.getTotalWeight(), k -> new ArrayList<>());\n\t\t\tweightsToChildren.get(child.getTotalWeight()).add(child);\n\t\t}\n\t\t// No children, or all children have the same total weight.\n\t\tif (getChildren().isEmpty() || weightsToChildren.size() == 1) {\n\t\t\treturn (null);\n\t\t}\n\t\t// Get the loner child. Assumption: The tree will have 3 or more children, so weight with only 1 child is the\n\t\t// imbalanced one.\n\t\tfor (List<Program> children : weightsToChildren.values()) {\n\t\t\tif (children.size() == 1) {\n\t\t\t\treturn (children.get(0));\n\t\t\t}\n\t\t}\n\t\tthrow new RuntimeException(\"Could not locate imbalanced child of program \" + getName());\n\t}", "@Override\n\t\tpublic int get_weights() {\n\t\t\treturn weight;\n\t\t}", "@Override\r\n\tpublic LinkedHashMap<IPSNode, Double> calculateEndNodeProbabilities() {\r\n\t\tfinal LinkedHashMap<IPSNode, Double> oResults = new LinkedHashMap<IPSNode, Double>();\r\n\r\n\t\t// loop through CPU nodes\r\n\t\tfor (final CPUNode cpuNode : getChildren()) {\r\n\t\t\t// get results for this CPU (unweighted at this point)\r\n\t\t\tfinal HashMap<IPSNode, Double> cpuProbabilityResults = cpuNode\r\n\t\t\t\t\t.calculateEndNodeProbabilities();\r\n\r\n\t\t\t// loop through unweighted CPU results, and add to output map with\r\n\t\t\t// the weighting applied\r\n\t\t\tfor (final Entry<IPSNode, Double> cpuProbabilityResult : cpuProbabilityResults\r\n\t\t\t\t\t.entrySet()) {\r\n\t\t\t\tfinal IPSNode ipsNodeForCPU = cpuProbabilityResult.getKey();\r\n\t\t\t\tfinal Double ipsNodeResultForCPU = cpuProbabilityResult\r\n\t\t\t\t\t\t.getValue();\r\n\r\n\t\t\t\t/**\r\n\t\t\t\t * add to results\r\n\t\t\t\t */\r\n\t\t\t\tDouble currentProbabilityForIPSNode = oResults\r\n\t\t\t\t\t\t.get(ipsNodeForCPU);\r\n\r\n\t\t\t\tif (currentProbabilityForIPSNode == null) {\r\n\t\t\t\t\t// we have not dealt with this node before\r\n\t\t\t\t\tcurrentProbabilityForIPSNode = Double.valueOf(0);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// add to results, applying weighting based on the CPU state\r\n\t\t\t\tcurrentProbabilityForIPSNode = Double\r\n\t\t\t\t\t\t.valueOf(currentProbabilityForIPSNode.doubleValue()\r\n\t\t\t\t\t\t\t\t+ (cpuNode.getProbability() * ipsNodeResultForCPU));\r\n\r\n\t\t\t\t// put new value to the result map\r\n\t\t\t\toResults.put(ipsNodeForCPU, currentProbabilityForIPSNode);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn oResults;\r\n\t}", "public int getWeight() {\n return weight;\n }", "private int optimize() {\n\t\t// items: Items sorted by value-to-weight ratio for linear relaxation\n\t\t// t: the decision vector being tested at each node\n\t\t// ws, vs, is, bs: stacks of weight, value, item id, whether bring item\n\t\t// p: stack pointer; i, b, weight, value: loop caches; best: max search\n\t\t// ss: stack size: Always <=2 children on stack for <=n-1 parents\n\t\tItem[] items = new Item[n];\n\t\tint ss = 2 * n;\n\t\tint[] itemsSorted = new int[n], t = new int[n], ws = new int[ss],\n\t\t\tvs = new int[ss], is = new int[ss], bs = new int[ss];\n\t\tint i, b, weight, value, best = 0, p = 0;\n\n\t\tfor (int j = 0; j < n; j++)\n\t\t\titems[j] = new Item(j);\n\t\tArrays.sort(items);\n\t\tfor (int j = 0; j < n; j++)\n\t\t\titemsSorted[j] = items[j].i();\n\t\titems = null; // For garbage collection.\n\n\t\t// Push item 0 onto the stack with and without bringing it.\n\t\tws[p] = 0; vs[p] = 0; is[p] = 0; bs[p] = 1; p++;\n\t\tws[p] = 0; vs[p] = 0; is[p] = 0; bs[p] = 0; p++;\n\n\t\twhile (p > 0) {\n\t\t\tp--; // Pop the latest item off the stack\n\t\t\ti = is[p]; b = bs[p];\n\t\t\tweight = ws[p] + w[i] * b;\n\t\t\tif (weight > k)\n\t\t\t\tcontinue;\n\t\t\tvalue = vs[p] + v[i] * b;\n\t\t\tif (bound(i, weight, value, itemsSorted) < best)\n\t\t\t\tcontinue;\n\t\t\tbest = Math.max(value, best);\n\t\t\tt[i] = b;\n\t\t\tif (i < n - 1) { // Push children onto stack w/ & w/o bringing item\n\t\t\t\tws[p] = weight; vs[p] = value; is[p] = i + 1; bs[p] = 1; p++;\n\t\t\t\tws[p] = weight; vs[p] = value; is[p] = i + 1; bs[p] = 0; p++;\n\t\t\t}\n\t\t\telse if (value >= best)\n\t\t\t\tSystem.arraycopy(t, 0, x, 0, n);\n\t\t}\n\t\treturn best;\n\t}", "public int getWeight() {\n\t\treturn weight;\n\t}", "public int getWeight() {\n\t\treturn weight;\n\t}", "@Override\n public double solutionWeight(){\n return solutionweight;\n }", "void calculating(int depth);", "public int getWeight(){\n\t\treturn weight;\n\t}", "public double getWeight(){\n\t\treturn weight;\n\t}", "public void addWeight(){\n\t\tweight++;\n\t}", "private HashMap<Integer, Double> recalculateWeight(HashMap<Integer, Double> boneIdWeightMap){\n\t\t\n\t\t//Without gaussian weights\n\t\t//boneIdWeightMap = preserveJustMax(boneIdWeightMap); //Just take max value\n\t\t\n\t\tDouble weightSum = 0.0;\n\t\t// Get the total Weight sum\n\t\tfor (Integer boneId : boneIdWeightMap.keySet()) {\n\t\t\tweightSum += boneIdWeightMap.get(boneId);\n\t\t}\n\t\t// Recalculate all weights to make them add up to 1.0;\n\t\tfor (Integer boneId : boneIdWeightMap.keySet()) {\n\t\t\tDouble weight = boneIdWeightMap.get(boneId);\n\t\t\tDouble newWeight = weight / weightSum * 1.0;\n\t\t\tboneIdWeightMap.put(boneId, newWeight);\n\t\t}\n\t\treturn boneIdWeightMap;\n\t}", "@Override\n\tpublic double weight() {\n\t\treturn 1.0;\n\t}", "public int getWeight() {\n return weight;\n }", "public int getWeight() {\n return weight;\n }", "public void calculateForces()\n {\n Stack<CelestialBody> stack = new Stack<>();\n stack = this.root.iterate(stack);\n\n OctreeIterator iterator = new OctreeIterator(stack);\n root.calculateForces(root, iterator);\n }", "public int getWeight() {\n\t\treturn _weight;\n\t}", "public double getWeight() {\n\t\treturn weight;\n\t}", "public int getCarriedWeight() {\n\t\tint weight = 0;\n\t\tfor (Item item : this) {\n\t\t\tweight += item.getWeight();\n\t\t}\n\n\t\treturn weight;\n\t}", "public static void main(String[] args) {\n Person brian = new Person(\"Brian\", 1, 110, 7);\n Reformatory helsinki = new Reformatory();\n \n System.out.println(helsinki.weight(brian));\n }", "public static void main(String[] args){ w = the total weight\n\t\t// i = item i\n\t\t// m[i, w] = maximum value attained with weight <= w using items up to i\n\t\t//\n\t\t// recurrence relation:\n\t\t// m[0, w] = 0, if there's zero items, the sum is zero\n\t\t// m[i, w] = m[i-1, w], if w(i) > w, the new item's weight > current weight limit\n\t\t// m[i, w] = max(m[i-1, w],\n\t\t// \t\t\t\t m[i-1, w-w(i)] + v(i), if w(i) <= w\n\t\t//\n\t\t//\n\t\tArrayList<Item> items = new ArrayList<Item>();\n\n\t\titems.add(new Item(10, 60));\n\t\titems.add(new Item(20, 100));\n\t\titems.add(new Item(30, 120));\n\n\t\tSystem.out.println(knapsack(items.size()-1, 50, items));\n\t}", "public int getWeight()\n {\n return weight;\n }", "public int getWeight() {\n return weight;\n }", "public void update_weight() {\n this.weights = this.updatedWeights;\n }", "public double getWeight() {\n\t\tif(weightConfiguration == null) {\n\t\t\treturn 1.0;\n\t\t}\n\t\treturn weightConfiguration.weightForIdentifier(this.getIdentifier());\n\t}", "public static void main(String[] args) {\n\t\tVertex v1, v2, v3, v4, v5, v6, v7;\n\t\tv1 = new Vertex(\"v1\");\n\t\tv2 = new Vertex(\"v2\");\n\t\tv3 = new Vertex(\"v3\");\n\t\tv4 = new Vertex(\"v4\");\n\t\tv5 = new Vertex(\"v5\");\n\t\tv6 = new Vertex(\"v6\");\n\t\tv7 = new Vertex(\"v7\");\n\n\t\tv1.addAdjacency(v2, 2);\n\t\tv1.addAdjacency(v3, 4);\n\t\tv1.addAdjacency(v4, 1);\n\n\t\tv2.addAdjacency(v1, 2);\n\t\tv2.addAdjacency(v4, 3);\n\t\tv2.addAdjacency(v5, 10);\n\n\t\tv3.addAdjacency(v1, 4);\n\t\tv3.addAdjacency(v4, 2);\n\t\tv3.addAdjacency(v6, 5);\n\n\t\tv4.addAdjacency(v1, 1);\n\t\tv4.addAdjacency(v2, 3);\n\t\tv4.addAdjacency(v3, 2);\n\t\tv4.addAdjacency(v5, 2);\n\t\tv4.addAdjacency(v6, 8);\n\t\tv4.addAdjacency(v7, 4);\n\n\t\tv5.addAdjacency(v2, 10);\n\t\tv5.addAdjacency(v4, 2);\n\t\tv5.addAdjacency(v7, 6);\n\n\t\tv6.addAdjacency(v3, 5);\n\t\tv6.addAdjacency(v4, 8);\n\t\tv6.addAdjacency(v7, 1);\n\n\t\tv7.addAdjacency(v4, 4);\n\t\tv7.addAdjacency(v5, 6);\n\t\tv7.addAdjacency(v6, 1);\n\n\t\tArrayList<Vertex> weightedGraph = new ArrayList<Vertex>();\n\t\tweightedGraph.add(v1);\n\t\tweightedGraph.add(v2);\n\t\tweightedGraph.add(v3);\n\t\tweightedGraph.add(v4);\n\t\tweightedGraph.add(v5);\n\t\tweightedGraph.add(v6);\n\t\tweightedGraph.add(v7);\n\t\t\n\t\tdijkstra( weightedGraph, v7 );\n\t\tprintPath( v1 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v2 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v3 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v4 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v5 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v6 );\n\t\tSystem.out.println(\"\");\n\t\tprintPath( v7 );\n\t\tSystem.out.println(\"\");\n\t}", "public double calcTotalOreWeight() \n {\n double fTotalOre;\n\n fTotalOre = 0.0;\n for (OrePile pile : m_orePileQueue) {\t// For this to work, Iterator must be implemented in DSAQueue\n fTotalOre += pile.getWeight();\n } \n\n return fTotalOre;\n }", "public int getWeight()\n\t{\n\t\treturn this.weight;\n\t}", "public double getWeight() {\n\t\n\t\treturn this.weight;\t \n\t}", "public double getWeight() {\r\n return weight;\r\n }", "public double getWeight() {\r\n return weight;\r\n }", "public double getWeight() {\n return weight;\n }", "public double getWeight() {\n return weight;\n }", "int getWeight() {\n return weight;\n }", "int getWeight() {\n return weight;\n }", "public double getWeight() {\n return 0;\n }", "private static double weightedNodeHeightHelper(PhyloTreeNode node) {\n if(node == null) {\n return 0;\n }\n else{\n return Math.max(node.getDistanceToChild() + weightedNodeHeightHelper(node.getLeftChild()),\n node.getDistanceToChild() + weightedNodeHeightHelper(node.getRightChild()));\n }\n }", "public int getRelativeWeight() {\n return relativeWeight;\n }", "public Weight getWeight();", "final protected double getWeight() {\n\t\treturn getWeight( _population );\n\t}", "public float getWeight() {\n\t\t\treturn weight;\n\t\t}", "public int getWeight() {\r\n\t\treturn this.weight;\r\n\t}", "int computeHeight() {\n Node<Integer>[] nodes = new Node[parent.length];\n for (int i = 0; i < parent.length; i++) {\n nodes[i] = new Node<Integer>();\n }\n int rootIndex = 0;\n for (int childIndex = 0; childIndex < parent.length; childIndex++) {\n if (parent[childIndex] == -1) {\n rootIndex = childIndex;\n } else {\n nodes[parent[childIndex]].addChild(nodes[childIndex]);\n }\n }\n return getDepth(nodes[rootIndex]);\n }", "public GiftCardProductQuery weight() {\n startField(\"weight\");\n\n return this;\n }", "@Override\n\tpublic String visitProgram(ProgramContext ctx) {\n\t\tfor(int i=0; i< ctx.getChildCount();i++)\n\t\t visit(ctx.getChild(i));\n\t\treturn sb.toString();\n\t}", "@Override\r\n public final int getWeight() {\r\n int i, c;\r\n Rule[] r;\r\n\r\n c = 0;\r\n r = this.m_rules;\r\n for (i = (r.length - 1); i >= 0; i--) {\r\n c += r[i].getWeight();\r\n }\r\n\r\n return c;\r\n }", "public int getWeight() {\n return this.weight;\n }", "public int getWeight()\n {\n return weightCarried;\n }", "@Override\n\tpublic double getWeight() {\n\t\treturn weight;\n\t}", "@Override\n\tpublic double getInternalWeight(int nodeIndex) {\n\t\treturn this.inWeights[nodeIndex];\n\t}", "public double getWeight() {\n return this.weight * 2.20462;\n }", "protected void mutateWeights() {\n\t\t// TODO: Change the way weight mutation works\n\t\tif (Braincraft.gatherStats) {\n\t\t\tArrayList<Integer> mutatedgenes = new ArrayList<Integer>();\n\t\t\tfor (Gene g : genes.values()) {\n\t\t\t\tif (Braincraft.randomChance(population.perWeightMutationRate)) {\n\t\t\t\t\tg.weight = Braincraft.randomWeight();\n\t\t\t\t\tmutatedgenes.add(g.innovation);\n\t\t\t\t}\n\t\t\t}\n\t\t\tString output = \"weight mutation \" + ID;\n\t\t\tfor (Integer i : mutatedgenes) {\n\t\t\t\toutput += \" \" + i;\n\t\t\t}\n\t\t\tBraincraft.genetics.add(output);\n\t\t} else {\n\t\t\tfor (Gene g : genes.values()) {\n\t\t\t\tif (Braincraft.randomChance(population.perWeightMutationRate))\n\t\t\t\t\tg.weight = Braincraft.randomWeight();\n\t\t\t}\n\t\t}\n\t\t// TODO: Report weight mutations to stats\n\t}", "public float getWeight() {\n return weight;\n }", "public void updateTopWeight(){\r\n\t \tif(this.topNode != null)\r\n\t \t{\r\n\t \t\tif(this.topNode.isNoGoZone() == true)\r\n\t \t{\r\n\t \t\t\t//set edge weight to 9999999 if the next node is NO go zone or\r\n\t \t\t\t//boundary node\r\n\t \t\tthis.topWeight = weightOfNoGoZone;\r\n\t \t}\r\n\t \telse if(this.topNode.road == true && this.topNode.isNoGoZone() == false)\r\n\t \t{\r\n\t \t\t//set edge weight to 1 if the next node is a road node\r\n\t \t\tthis.topWeight = this.topNode.getOwnElevation();\r\n\t \t}\r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\t//set edge weight to INF if the next node is NULL\r\n\t \t\tthis.topWeight = weightOfMapEdge;\r\n\t \t}\r\n\t }", "public double getWeightedHeight() {\n return weightedNodeHeight(overallRoot);\n }", "public int getWeight(){\n \treturn weight;\n }", "public float getWeight() {\n return weight;\n }", "public double womanWeight(double height) {\n return (height - 110) * 1.15;\n }", "private static void dfsBribe(int n, List<Integer>[] ch, long[] w) {\n if (ch[n].size() == 0){\n In[n] = w[n];\n OutD[n] = Long.MAX_VALUE;\n OutU[n] = 0;\n }\n //recurrance case: non.leaf, do dfs for all subordinates then calculate In, OutUp & OutDown.\n else{\n for (int c:ch[n])\n dfsBribe(c, ch, w); //running once for each child thereby O(N)\n In[n] = w[n];\n for (int c:ch[n]){ //O(N) running time\n In[n] += OutU[c];\n OutU[n] += Math.min(In[c], OutD[c]);\n OutD[n] += Math.min(In[c], OutD[c]);\n }\n OutD[n] += delta(n, ch); //add delta for no in Children\n }\n\n }", "public Integer getWeight() {\n return weight;\n }" ]
[ "0.62410337", "0.6037984", "0.5887768", "0.58677775", "0.5824807", "0.5751047", "0.57450753", "0.5690289", "0.5680299", "0.5669035", "0.5618554", "0.55972725", "0.5557797", "0.55353767", "0.55254686", "0.5504264", "0.5503389", "0.5503389", "0.5472274", "0.54603195", "0.54355055", "0.54318756", "0.5387055", "0.5329647", "0.5329288", "0.53278583", "0.5304348", "0.52957296", "0.5283093", "0.52798283", "0.526525", "0.5264848", "0.52579135", "0.5256667", "0.524998", "0.52479815", "0.5237405", "0.52289814", "0.5213303", "0.5203094", "0.5202988", "0.5201959", "0.51952386", "0.5192263", "0.51854616", "0.51854616", "0.51836586", "0.518206", "0.517824", "0.51750237", "0.51740956", "0.5172144", "0.5171418", "0.51672834", "0.51672834", "0.51668924", "0.5163482", "0.5163392", "0.5159056", "0.5146607", "0.5146055", "0.5138094", "0.5135952", "0.5130392", "0.51295084", "0.512469", "0.5122834", "0.5122808", "0.5119443", "0.5117788", "0.5117788", "0.5113894", "0.5113894", "0.51090485", "0.51090485", "0.5103757", "0.51032424", "0.5099457", "0.50934416", "0.5089079", "0.50785875", "0.50748605", "0.5074356", "0.5071092", "0.507074", "0.50559235", "0.50550467", "0.5054785", "0.50504214", "0.50405896", "0.5027822", "0.501577", "0.50156796", "0.5011008", "0.50108856", "0.5006916", "0.500286", "0.49934086", "0.49853772", "0.4978025" ]
0.69789845
0
Searches for the 1 child with the wrong weight.
public Program getImbalancedChild() { Map<Integer, List<Program>> weightsToChildren = new HashMap<>(); for (Program child : getChildren()) { weightsToChildren.computeIfAbsent(child.getTotalWeight(), k -> new ArrayList<>()); weightsToChildren.get(child.getTotalWeight()).add(child); } // No children, or all children have the same total weight. if (getChildren().isEmpty() || weightsToChildren.size() == 1) { return (null); } // Get the loner child. Assumption: The tree will have 3 or more children, so weight with only 1 child is the // imbalanced one. for (List<Program> children : weightsToChildren.values()) { if (children.size() == 1) { return (children.get(0)); } } throw new RuntimeException("Could not locate imbalanced child of program " + getName()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public AdapterNode child(int searchIndex) {\n org.w3c.dom.Node node = domNode.getChildNodes().item(searchIndex);\n\n if (FormEditor.compress) {\n TreeSet ChildSet = new TreeSet(new AdapterNodeComparator());\n org.w3c.dom.NodeList childNodes = domNode.getChildNodes();\n\n for (int i = 0; i < childNodes.getLength(); i++) {\n node = childNodes.item(i);\n\n if ((node.getNodeType() == GenerateListData.ELEMENT_TYPE) &&\n treeElement(node.getNodeName())) {\n ChildSet.add(new AdapterNode(node));\n }\n }\n\n Object obj = ChildSet.toArray()[searchIndex];\n\n return (AdapterNode) obj;\n\n // Return Nth displayable node\n\n /**\n * Old Code\n * int elementNodeIndex = 0;\n * for (int i=0; i<domNode.getChildNodes().getLength(); i++) {\n * node = (domNode.getChildNodes()).item(i);\n * if (node.getNodeType() == GenerateListData.ELEMENT_TYPE\n * && treeElement( node.getNodeName() )\n * && elementNodeIndex++ == searchIndex) {\n * break;\n * }\n *\n * }*/\n }\n\n return new AdapterNode(node);\n }", "private int WCIT(TFNode child) throws TFNodeException {\r\n if (child.getParent() == null) {\r\n throw new TFNodeException(\"Node has no parent\");\r\n }\r\n\r\n TFNode parent = child.getParent();\r\n for (int i = 0; i <= parent.getNumItems(); i++) {\r\n if (child == parent.getChild(i)) {\r\n return i;\r\n }\r\n }\r\n throw new TFNodeException(\"Node is not a child of it's parent\");\r\n }", "private int minChild(int ind)\n {\n int bestChild = kthChild(ind, 1);\n int k =2;\n int pos = kthChild(ind, k);\n while ((k <= d) && (pos < heapSize)){\n if(heap[pos] < heap[bestChild])\n {\n bestChild = pos;\n }\n else {\n pos = kthChild(ind, k++);\n }\n }\n return bestChild;\n\n }", "private int minChild(int ind) {\n int bestChild = kthChild(ind, 1);\n int k = 2;\n int pos = kthChild(ind, k);\n while ((k <= 2) && (pos < heapSize)) {\n if (heap[pos] < heap[bestChild])\n bestChild = pos;\n pos = kthChild(ind, k++);\n }\n return bestChild;\n }", "private int getIndexChild(BTreeNode<T> parent, BTreeNode<T> child) {\n for (int i = 0; i < 6; i++) {\n if (parent.getChild(i) == child) {\n return i;\n }\n }\n return -1;\n }", "@Override\n protected SearchResponse compute() {\n if (this.searchRoot.children == null || this.searchRoot.children.isEmpty()) {\n return new SearchResponse(searchRoot.weight, null);\n }\n\n // Search child nodes recursively\n List<UnbalancedNodeSearcher> subtasks = new ArrayList<>(searchRoot.children.size());\n for (Node n : searchRoot.children) {\n UnbalancedNodeSearcher subtask = new UnbalancedNodeSearcher(n);\n subtasks.add(subtask);\n subtask.fork();\n }\n\n // Use a map to vote for the \"wrong\"(i.e. minority) disc weight\n Map<Long, AtomicLong> totalWeight = new HashMap<>();\n\n // To find out who reported the \"wrong\" weight\n Map<Long, Node> resultNodeMap = new HashMap<>();\n for (UnbalancedNodeSearcher searcher : subtasks) {\n SearchResponse response = searcher.join();\n\n // The search is over\n if (response.foundResult != null) {\n return response;\n }\n\n resultNodeMap.put(response.subSum, searcher.searchRoot);\n\n totalWeight.computeIfAbsent(response.subSum, (i) -> new AtomicLong(0L)).incrementAndGet();\n }\n\n if (totalWeight.size() == 1) {\n // Since there's only one\n long subtotal = totalWeight.keySet().iterator().next();\n long total = subtotal * subtasks.size() + searchRoot.weight;\n\n return new SearchResponse(total, null);\n } else if (totalWeight.size() == 2) {\n long correctWeight = -1;\n long wrongWeight = -1;\n for (Map.Entry<Long, AtomicLong> entry : totalWeight.entrySet()) {\n if (entry.getValue().get() != 1L) {\n correctWeight = entry.getKey();\n } else {\n wrongWeight = entry.getKey();\n }\n }\n\n return new SearchResponse(null, resultNodeMap.get(wrongWeight).weight - (wrongWeight - correctWeight));\n } else {\n throw new RuntimeException(\"More than one incorrect nodes\");\n }\n }", "private Node find(Order ord){\n\t\tNode position=head;\n\t\tOrder ItemPosition;\n\t\twhile (position!=null){\n\t\t\tItemPosition = position.ord;\n\t\t\tif(ItemPosition.equals(ord)) {\n\t\t\t\tposition=bestBid;\n\t\t\t\treturn position;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private int findChildOrIndex(BTreeNode<T> currentNode, I id) {\n int indexChild = 0;\n while (currentNode.getKey(indexChild) != null && comparator.compare(currentNode.getKey(indexChild), id) < 0) {\n indexChild++;\n }\n\n return indexChild;\n }", "private SortableTreeNode findChild(DefaultMutableTreeNode parentNode, String childString) {\n Enumeration<SortableTreeNode> e = parentNode.children();\n while (e.hasMoreElements()) {\n SortableTreeNode node = e.nextElement();\n if (node.toString().equalsIgnoreCase(childString)) {\n return node;\n }\n }\n return null;\n }", "@Override\n\tpublic Node findChild(byte partialKey) {\n\t\tpartialKey = BinaryComparableUtils.unsigned(partialKey);\n\t\tfor(int i = 0; i < noOfChildren; i++){\n\t\t\tif(keys[i] == partialKey){\n\t\t\t\treturn children[i];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private static String findHighParent_B(BabelSynset bs) throws IOException {\n\t\tdouble weight = 0.0;\n\t\tString id = null;\n\t\tArrayList<String> B_parentsDouble = new ArrayList<String>();\n\t\tList<BabelSynsetIDRelation> edges = bs.getEdges(BabelPointer.ANY_HYPERNYM);\n\t\t\n\t\tfor(BabelSynsetIDRelation b : edges) {\n\t\t\tweight += b.getWeight();\n\t\t}\n\t\tif(weight == 0.0) return edges.get(0).getTarget();\n\t\t\n\t\tweight = 0.0;\n\t\tfor(BabelSynsetIDRelation b : edges) {\n\t\t\tString b_id = b.getTarget();\n\t\t\tif(!B_parentsDouble.contains(b_id) || (B_parentsDouble.contains(b_id) && b.getWeight() != 0.0)) {\n\t\t\t\tdouble temp_weight = b.getWeight();\n\t\t\t\tif(temp_weight > weight && !B_Ancestors.contains(b_id)) {\n\t\t\t\t\tweight = temp_weight;\n\t\t\t\t\tid = b_id;\n\t\t\t\t}\n\t\t\t\tB_parentsDouble.add(b_id);\n\t\t\t}\n\t\t}\n\t\tif(id == null) id = \"bn:00031027n\";\n\t\treturn id;\n\t}", "private Node getChild(K key) {\r\n\r\n // binarySearch for the correct index\r\n int correct_place = Collections.binarySearch(keys, key);\r\n int child_indexing;\r\n if (correct_place >= 0) {\r\n child_indexing = correct_place + 1;\r\n } else {\r\n child_indexing = -correct_place - 1;\r\n }\r\n\r\n return children.get(child_indexing);\r\n }", "int find(int child) {\n if (childToParentMap.get(child) == null) {\n return child;\n }\n\n // recursively do dfs upwards to find the topmost parent\n return find(childToParentMap.get(child));\n }", "private BTNode search(BTNode btNode, DataPair key) {\n int i =0;\n while (i < btNode.mCurrentKeyNum && key.compareTo(btNode.mKeys[i]) > 0)\n i++;\n\n if (i < btNode.mCurrentKeyNum && key.compareTo(btNode.mKeys[i])==0)\n return btNode;//btNode.mKeys[i];\n if (btNode.mIsLeaf)\n return null;\n return search(btNode.mChildren[i],key);\n }", "private KeyedItem findLeftMost(BinarySearchTree tree){\r\n\t\t\r\n\t\t//return the root when we find that we reached the leftmost child\r\n\t\tif(tree.getLeftChild() == null){\r\n\t\t\treturn tree.getRoot();\r\n\t\t}\r\n\t\telse{\r\n\t\t\t//keep going. has more left children\r\n\t\t\treturn findLeftMost(tree.getLeftChild());\r\n\t\t}\r\n\t}", "public NCRPNode select() {\n\t\t\t\n\t\t\t//dim number of children + 1 (unallocated mass) \n\t\t\tdouble[] weights = new double[children.size() + 1];\n\t \n\t\t\t//weight of unallocated probability mass\n\t\t\tweights[0] = gamma / (gamma + customers);\n\t\t\t\n\t\t\t//calc weight for each child based on the number of customers on them\n\t\t\tint i = 1;\n\t\t\tfor (NCRPNode child: children) {\n\t\t\t\tweights[i] = (double) child.customers / (gamma + customers);\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\t//sample a child with higher weight\n\t\t\tint choice = random.nextDiscrete(weights);\n\t\t\t//if unallocated mass is sampled, create a new child\n\t\t\tif (choice == 0) {\n\t\t\t\treturn(addChild());\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn children.get(choice - 1);\n\t\t\t}\n\t\t}", "@Override\n\t\tpublic void findChild(ITargetNode child, ITargetNode parent) {\n\n\t\t}", "private static Node auctionRound(Node bidder, Graph solution, Graph reference) {\n\t\tNode matchedNode = null;\n\t\tFloat bestValue = 0F;\n\n\t\tfor (Node seller : reference.getNodeListY()) {\n\t\t\tEdge edge = reference.getEdge(bidder.GetIndex(), seller.GetIndex()); // find edge\n\t\t\tFloat value = edge.GetWeight() - seller.getPrice();\n\n\t\t\tif (value > bestValue) {\n\t\t\t\tmatchedNode = seller;\n\t\t\t\tbestValue = value;\n\t\t\t}\n\t\t}\n\n\t\treturn matchedNode;\n\t}", "@Override\r\n\tpublic int getIndexOfChild(Object parent, Object child) {\r\n\t\t\r\n\t\treturn 0;\r\n\t}", "private int kthChild(int index, int k) {\n return 2 * index + k; // 2 = binary heap\n }", "private LexiNode search_specific_word(String word, int index){\n\t\tif(current_word != null && !current_word.isEmpty()){\n\t\tint local_index = index + 1;\n\t\t//if we found the word, we make the change\n\t\tif(current_word != null && \n\t\t !current_word.isEmpty() && \n\t\t\tword.toLowerCase().equals(current_word.toLowerCase()))\n\t\t\treturn this;\n\t\t//We try to find the word within our childs\n\t\tfor(LexiNode child: childs)\n\t\t\tif(word.toLowerCase().charAt(local_index) == Character.toLowerCase(child.getRepresentative_letter()))\n\t\t\t\treturn child.search_specific_word(word, local_index);\n\t\t}\n\t\treturn null;\n\t}", "private boolean FindNode(int num, TreeNodeWrapper parent, TreeNodeWrapper child) {\r\n\t\t//set parent node of TreeNodeWrapper as Root\r\n\t\tparent.Set(Root);\r\n\t\t//set child node as TreeNode Wrapper as Root\r\n\t\tchild.Set(Root);\r\n\t\t//if root is null, tree is empty\r\n\t\tif(Root == null) //tree is empty\r\n\t\t\treturn true;\r\n\t\t//while loop which searches tree until empty child node is found\r\n\t\twhile(child.Get() != null)\r\n\t\t{ if(child.Get().Data == num) // node found\r\n\t\t\treturn true;\r\n\t\t\t//if node not found use TreeNodeWrapper search remaining nodes\r\n\t\t else {\r\n\t\t\tparent.Set(child.Get());\r\n\t\t\tif(num < child.Get().Data)\r\n\t\t\t\tchild.Set(child.Get().Left);\r\n\t\t\telse\r\n\t\t\t\tchild.Set(child.Get().Right);\r\n\t\t }\t\r\n\t\t}\r\n\t\t//return false if node not found\r\n\t\treturn false;\r\n\t}", "@Override\n public Node getImmediateChild(ChildKey name) {\n if (name.isPriorityChildName() && !this.priority.isEmpty()) {\n return this.priority;\n } else if (children.containsKey(name)) {\n return children.get(name);\n } else {\n return EmptyNode.Empty();\n }\n }", "private int firstChild(int index) {\n // Formula to calculate the index of the first child of parent node\n return d * index + 1;\n }", "public int index(AdapterNode child) {\n int count = childCount();\n\n for (int i = 0; i < count; i++) {\n AdapterNode n = this.child(i);\n\n if (child == n) {\n return i;\n }\n }\n\n return -1; // Should never get here.\n }", "private int getNearestNode(LatLng vic) {\n\t\tint node = 0;\n\t\tfor(int j=0; j<nodeList.size()-1; j++){\n\t\t\tdouble dist1 = getWeight(vic, nodeList.get(node));\n\t\t\tdouble dist2 = getWeight(vic, nodeList.get(j));\n\t\t\tif(dist1 > dist2){\n\t\t\t\tnode = j;\n\t\t\t}\n\t\t}\n\t\treturn node;\n\t}", "Node getChild(K key) {\r\n\t\t\tint loc = Collections.binarySearch(keys, key);\r\n\t\t\tint childIndex = loc >= 0 ? loc + 1 : -loc - 1;\r\n\t\t\treturn children.get(childIndex);\r\n\t\t}", "private void trickleDown(int index) {\n Map.Entry<String, Double> smallest;\n Map.Entry<String, Double> top = this.get(index);\n int currentSize = this.size();\n\n while (index < currentSize / 2) { // while node has at leat one child\n Map.Entry<String, Double> left = LEFT(this.get(index));\n Map.Entry<String, Double> right = RIGHT(this.get(index));\n\n // find smaller child\n // if right child exists\n if (right != null && left.getValue().compareTo(right.getValue()) > 0) {\n smallest = right;\n } else {\n smallest = left;\n }\n\n // top <= smallest ?\n if (top.getValue().compareTo(smallest.getValue()) <= 0) {\n break;\n }\n\n // shift child up\n int smallestIndex = this.indexOf(smallest);\n Collections.swap(this, index, smallestIndex);\n index = smallestIndex;\n } // end while\n }", "int indexOfChild(TreeNodeValueModel<T> child);", "FPNode_Strings getChildWithID(String id) {\r\n\t\t// for each child node\r\n\t\tfor(FPNode_Strings child : childs){\r\n\t\t\t// if the id is the one that we are looking for\r\n\t\t\tif(child.itemID.equals(id)){\r\n\t\t\t\t// return that node\r\n\t\t\t\treturn child;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// if not found, return null\r\n\t\treturn null;\r\n\t}", "private int kthChild(int i, int k){\n return d * i + k;\n }", "public int getEmptyChild() {\r\n\t\t\tfor (int i = 0; i < children.size(); i++) {\r\n\t\t\t\t//System.out.println(\"Checking child #\" + i + \"\\t\\tChild: \" + getChild(i).debug());\r\n\t\t\t\tif (getChild(i).getData().size() == 0)\r\n\t\t\t\t\treturn i;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn -1;\r\n\t\t}", "private int kthChild(int i, int k)\n {\n return d*i + k;\n }", "@Test\n public void whenSearchTwoThenResultIndexOne() {\n tree.addChild(nodeOne, \"1\");\n nodeOne.addChild(nodeTwo, \"2\");\n nodeTwo.addChild(nodeThree, \"3\");\n assertThat(tree.searchByValue(\"4\"), is(\"Element not found\"));\n }", "private int getChildIndex(long descendent) {\n long destinationChild = ZQuad.getChildThatsAncestorOf(this.quad, descendent);\n // What is the descendancy of that child relative to this one?\n long descendancy = ZQuad.getDescendancy(destinationChild, 1);\n // The scalar component is what we're looking for.\n return (int) ZQuad.quadToScalar(descendancy, 1);\n }", "private TFNode search(TFNode node, Object key) throws TFNodeException {\r\n\r\n // Check for empty node\r\n if (node.getNumItems() == 0) {\r\n throw new TFNodeException(\"Search discovered an empty node\");\r\n }\r\n\r\n int index = FFGTE(node, key);\r\n TFNode child = node.getChild(index);\r\n\r\n // If the node contains they key, return node\r\n if (index < node.getNumItems()) {\r\n if(treeComp.isEqual(node.getItem(index).key(), key)){\r\n return node;\r\n }\r\n }\r\n \r\n // If the node is a leaf, return node\r\n if (child == null) {\r\n return node;\r\n // If neither of the above, keep searching\r\n } else {\r\n return search(child, key);\r\n }\r\n \r\n }", "private Node getChild(char key) {\n for (Node child : children) {\n if (child.getKey() == key) {\n return child;\n }\n }\n return null;\n }", "public native boolean searchAsChild() /*-{\n\t\tvar jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();\n\t\treturn jso.searchAsChild;\n }-*/;", "public int indexOf( ChildType child );", "static int nextChild(ReadOnlyList<INode> children, byte[] name) {\r\n if (name.length == 0) { // empty name\r\n return 0;\r\n }\r\n int nextPos = ReadOnlyList.Util.binarySearch(children, name) + 1;\r\n if (nextPos >= 0) {\r\n return nextPos;\r\n }\r\n return -nextPos;\r\n }", "public int find(int p) {\n\t\tvalidate(p);\n\t\twhile (p != parent[p])\n\t\t\tp = parent[p];\n\t return p;\n\t}", "private ProblemModel findCheapestNode(){\n\t\tProblemModel ret = unvisitedPM.peek();\n\t\t\n\t\tfor(ProblemModel p : unvisitedPM){ \n\t\t\t//f(s) = depth + cost to make this move\n\t\t\tif(p.getCost() + p.getDepth() <= ret.getCost() + ret.getDepth()) ret = p;\n\t\t}\n\t\tunvisitedPM.remove(ret);\n\t\treturn ret;\n\t}", "private int get_right_child(int index){\r\n return 2 * index + 2;\r\n }", "public Node find(int key) {\n Node current = root; // start at root\n while (current.iData != key) {\n // while no match\n if (key < current.iData)\n // go left\n current = current.leftChild;\n else\n current = current.rightChild;\n if (current == null) // if no child, didn't find it\n return null;\n }\n return current; // found it\n }", "private static BitVectorSolution chooseChild(\r\n\t\t\tBitVectorSolution parent1,\r\n\t\t\tBitVectorSolution parent2, \r\n\t\t\tBitVectorSolution child1,\r\n\t\t\tBitVectorSolution child2, \r\n\t\t\tdouble compFactor) {\r\n\t\t\r\n\t\tdouble fitnessTreshold = \r\n\t\t\t\tMath.min(parent1.fitness, parent2.fitness) + \r\n\t\t\t\tMath.abs(parent1.fitness - parent2.fitness) * compFactor;\r\n\t\t\r\n\t\tevaluateSingle(child2);\r\n\t\tevaluateSingle(child1);\r\n\t\t\r\n\t\tif (child1.fitness >= child2.fitness && child1.fitness > fitnessTreshold) {\r\n\t\t\treturn child1;\r\n\t\t\t\r\n\t\t} else if (child2.fitness > child1.fitness && child2.fitness > fitnessTreshold) {\r\n\t\t\treturn child2;\r\n\t\t\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t}", "private int get_left_child(int index){\r\n return 2 * index + 1;\r\n }", "@Override\n\tpublic void search() {\n\t\tpq = new IndexMinPQ<>(graph.getNumberOfStations());\n\t\tpq.insert(startIndex, distTo[startIndex]);\n\t\twhile (!pq.isEmpty()) {\n\t\t\tint v = pq.delMin();\n\t\t\tnodesVisited.add(graph.getStation(v));\n\t\t\tnodesVisitedAmount++;\n\t\t\tfor (Integer vertex : graph.getAdjacentVertices(v)) {\t\n\t\t\t\trelax(graph.getConnection(v, vertex));\n\t\t\t}\n\t\t}\n\t\tpathWeight = distTo[endIndex];\n\t\tpathTo(endIndex);\n\t}", "private int rightChildIdx(int idx) {\r\n // TODO\r\n return -1;\r\n }", "protected BSTNode getMinimumChild(BSTNode n) {\n\t\tassert (n != null);\n\n\t\twhile (hasLeftChild(n)) {\n\t\t\tn = n.left;\n\t\t\t_stats.incOtherTraversals();\n\t\t}\n\n\t\treturn n;\n\t}", "private static int rankParentIndex(int popAmount, int totalWeight) {\n // Randomly Generate the Weight\n double randomWeight = Math.random() * (totalWeight + 1);\n // Find out the Living Range\n for (int rankWeight = popAmount; rankWeight > 0; rankWeight--) {\n // Reduce the rankWeight\n randomWeight = randomWeight - rankWeight;\n // Meet the Rank\n if (randomWeight <= 0) {\n return popAmount - rankWeight;\n }\n }\n return popAmount - 1;\n }", "private RadixTree find(Signature key) {\n if (key.isEmpty()) {\n return this;\n } else {\n for (Signature label : children.keySet()) {\n if (label.equals(key)) {\n return children.get(label);\n } else if (label.isPrefix(key)) {\n RadixTree child = children.get(label);\n int len = label.size();\n return child.find(key.suffix(len));\n }\n }\n }\n\n return null;\n }", "private Node searchNode(int id) {\n\t\tNode node = searchRec(root,id);\n\t\treturn node;\n\t}", "public estNode getChildWithID(int id) {\r\n\t\tif (children == null)\r\n\t\t\treturn null;\r\n\t\tfor (estNode child : children) {\r\n\t\t\tif (child.itemID == id) {\r\n\t\t\t\treturn child;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "private Actor nearestThreat(float search_distance) {\n\t\t//ArrayList<Actor> threats = new ArrayList<Actor>();\n\t\tPriorityQueue<Actor> threats = new PriorityQueue<Actor>(10, new RiskAssessor());\n\n\t\tfor (Actor a: Actor.actors) {\n\t\t\t// Don't be scared of yourself\n\t\t\tif (a == this)\n\t\t\t\tcontinue;\n\n\t\t\t// do not consider these types threats\n\t\t\tif (a instanceof PowerUp)\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\t// Do not consider our own bullets threats\n\t\t\tif (a instanceof Bullet || a.parentId == id)\n\t\t\t\tcontinue;\n\n\t\t\tVector displacement = position.differenceOverEdge(a.position);\n\n\t\t\tif (displacement.magnitude2() > search_distance * search_distance)\n\t\t\t\tcontinue;\n\n\t\t\t// If the threat is a player we do not continue a threat until we are much closer\n\t\t\tif (a instanceof PlayerShip &&\n\t\t\t\t\tdisplacement.magnitude2() > MIN_PLAYER_SHIP_DISTANCE * MIN_PLAYER_SHIP_DISTANCE)\n\t\t\t\tcontinue;\n\n\t\t\tthreats.add(a);\n\t\t}\n\n\t\tswitch(threats.size()) {\n\t\tcase(0):\n\t\t\treturn null;\n\t\tdefault:\n\t\t\treturn threats.remove();\n\t\t}\n\t}", "default int childIndex() {\n // XXX this is expensive\n SemanticRegion<T> parent = parent();\n if (parent != null) {\n return parent.children().indexOf(this);\n }\n return -1;\n }", "private double getChildrenTotalAlternativeWeight() {\n double totalWeight = 0.0;\n for (DependencyDescription child : this.getChildren()) {\n totalWeight += child.getAlternativeProbability();\n }\n return totalWeight;\n }", "public int indexOf() { return _parent!=null? _parent.indexOfChild(this) : -1; }", "private Node search(String name)\r\n\t{\r\n\t\t// Check to see if the list is empty\r\n\t\tif(isEmpty())\r\n\t\t{\r\n\t\t\t// Return null which will be checked for by the method that called it\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t// Tree is not empty so use the recursive search method starting at the root reference \r\n\t\t// to find the correct Node containing the String name\r\n\t\treturn search(getRoot(), name);\r\n\t}", "public boolean searchNode(int value) \n { \n return searchNode(header.rightChild, value); \n }", "Node search(int reqNodeValue){\r\n\t\tNode reqNode = this.root ;\r\n\t\t \r\n\t\twhile(reqNode != null && reqNode.value != reqNodeValue) {\r\n\t\t\tif(reqNode.value < reqNodeValue) {\r\n\t\t\t\treqNode = reqNode.right ; \r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treqNode = reqNode.left ;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(reqNode == null) {\r\n\t\t\tSystem.out.println(\"No such node exists in the tree\");\r\n\t\t}\r\n\t\treturn reqNode;\r\n\t}", "private Node caseTwoChildren(Node deleteThis) {\r\n\r\n Node next = getMin(deleteThis.getRight()),\r\n child, parent;\r\n deleteThis.setKey(next.getKey());\r\n child = next.getRight();\r\n parent = next.getParent();\r\n if (parent.getLeft() == next) {\r\n parent.setLeft(child);\r\n } else {\r\n parent.setRight(child);\r\n }\r\n if (child != null) {\r\n child.setParent(parent);\r\n }\r\n return next;\r\n }", "public int getChildIndexWithID(int id) {\r\n\t\tif (children == null)\r\n\t\t\treturn -1;\r\n\t\tint i = 0;\r\n\t\tfor (estNode child : children) {\r\n\t\t\tif (child.itemID == id) {\r\n\t\t\t\treturn i;\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t\treturn -1;\r\n\t}", "public TreeNode find(TreeNode parent, String name){\r\n\t\tif(parent == null){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tTreeNode child;\r\n\t\tIterator<TreeNode> i = parent.children();\r\n\t\tint index = 0;\r\n\t\twhile(i.hasNext()){\r\n\t\t\t// Loop on children nodes\r\n\t\t\tchild = i.next();\r\n\t\t\tif(child.compare(name)){\r\n\t\t\t\t// If syscall name matches, return this child\r\n\t\t\t\tchild.setIndex(index);\r\n\t\t\t\treturn child;\r\n\t\t\t}\r\n\t\t\tindex++;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public Point2D nearest(Point2D p) {\n if (bst.isEmpty()) {\n return null;\n }\n\n Point2D nearest = null;\n double nearestDist = Double.POSITIVE_INFINITY;\n \n \n for (Point2D point: bst.keys()) {\n\n if (nearest == null \n || point != null \n && (nearestDist > point.distanceSquaredTo(p)\n && (!point.equals(p)))) {\n nearest = point;\n nearestDist = point.distanceSquaredTo(p);\n }\n \n }\n return nearest;\n }", "public BTreeNode search(long key) {\n\t\treturn searcher(root, key);\n\t}", "private int leftChild(int index){\n\t\treturn (2*index) +1;\n\t}", "@Override\r\n public Object findElement(Object key) {\r\n\r\n // Search for node possibly containing key\r\n TFNode node = search(root(), key);\r\n \r\n // Note the index of where the key should be\r\n int index = FFGTE(node, key);\r\n\r\n // If the index is greater than the number of items in the node, the key is not in the node\r\n if (index < node.getNumItems()) {\r\n // Look for key in node\r\n if (treeComp.isEqual(node.getItem(index).key(), key)) {\r\n return node.getItem(index);\r\n }\r\n }\r\n\r\n // The search hit a leaf without finding the key\r\n return null;\r\n }", "public int grandChildMin(int index, int index2)\n\t{\n\t\t\n\t\tif(index >= size)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\n\t\tif(index <size && index2 >= size)\n\t\t{\n\t\t\treturn index;\n\t\t}\n\n\t\tif(object.compare(array[index], array[index2]) <= 0)\n\t\t{\n\t\t\treturn index;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn index2;\n\t\t}\n\t}", "private int leftChild(int index) {\n return index * 2;\n }", "public void updateBottomWeight(){\r\n\t \tif(this.bottomNode != null)\r\n\t \t{\r\n\t \t\tif( this.bottomNode.isNoGoZone() == true)\r\n\t \t{\r\n\t \t\t\t//set edge weight to 9999 if the next node is NO go zone or\r\n\t \t\t\t//boundary node\r\n\t \t\tthis.bottomWeight = weightOfNoGoZone;\r\n\t \t}\r\n\t \telse if(this.bottomNode.isRoad() == true && this.bottomNode.isNoGoZone() == false)\r\n\t \t{\r\n\t \t\t//set edge weight to 1 if the next node is a road node\r\n\t \t\tthis.bottomWeight = this.bottomNode.getOwnElevation();\r\n\t \t}\r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\t//set edge weight to INF if the next node is NULL\r\n\t \t\tthis.bottomWeight = weightOfMapEdge;\r\n\t \t}\r\n\t }", "private int leftChildIdx(int idx) {\r\n // TODO\r\n return -1;\r\n }", "public BusinessObject findChildByName(String name) {\n\t\tif (children == null) return null;\n\t\tBusinessObject child = children.get(name.toLowerCase());\n\t\tif (child == null) return null;\n\t\treturn child.getReferencedObject();\n\t}", "private int rightChild(int index) {\n return index * 2 + 1;\n }", "public WSLNode getChild(int i) {return (WSLNode) children.elementAt(i);}", "public Node findClosest(int search_key){\n\n Node current, closest; //จำตำแหน่ง node ตอนนี้\n closest = current = root; // เก็บตำแหน่ง node ที่ใกล้ค่าที่หามากสุด\n int min_diff = Integer.MAX_VALUE; // ตัวเปรียบเทียบคสาต่าง\n while (current!= null){ // Use while loop to traverse from root to the closest leaf\n if (search_key == current.key){ //ถ้าเจอก็ return\n return current;\n }\n else{\n if(Math.abs(current.key - search_key) < min_diff){ //หาค่าความต่าง ถ้าอันใหม่ต่างน้อยกว่า แสดงว่าใกล้กว่า\n min_diff = Math.abs(current.key - search_key);\n closest = current;\n }\n\n }\n\n if(search_key < current.key) // กำหยดว่าจะลงไปในทิศทางไหนของ subtree\n {current = current.left;}\n else{current = current.right;}\n }\n\n\n\n return closest;\n }", "private Node search(Node traverse, String name)\r\n\t{\t\r\n\t\t// Haven't reached a dead-end yet\r\n\t\tif(traverse != null)\r\n\t\t{\r\n\t\t\t// Check to see if the current Node matches the String\r\n\t\t\tif(name.equalsIgnoreCase(traverse.getName()))\r\n\t\t\t{\r\n\t\t\t\t// return the location of the node\r\n\t\t\t\treturn traverse;\r\n\t\t\t}\r\n\t\t\t// The name is lexicographically less than the current Node's name\r\n\t\t\telse if(name.compareToIgnoreCase(traverse.getName()) < 0)\r\n\t\t\t{\r\n\t\t\t\t// Keep searching through the left subtree\r\n\t\t\t\treturn search(traverse.getLeftChild(), name); \r\n\t\t\t}\r\n\t\t\t// The name is lexicographically greater than the current Node's name\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Keep searching through the right subtree\r\n\t\t\t\treturn search(traverse.getRightChild(), name);\r\n\t\t\t}\r\n\t\t}\t\r\n\t\t// Node not found in the Binary Tree\r\n\t\treturn null;\r\n\t}", "private Node caseOneChild(Node deleteThis) {\r\n\r\n Node child, parent;\r\n if (deleteThis.getLeft() != null) {\r\n child = deleteThis.getLeft();\r\n } else {\r\n child = deleteThis.getRight();\r\n }\r\n parent = deleteThis.getParent();\r\n child.setParent(parent);\r\n\r\n\r\n if (parent == null) {\r\n this.root = child; // Poistettava on juuri\r\n return deleteThis;\r\n }\r\n if (deleteThis == parent.getLeft()) {\r\n parent.setLeft(child);\r\n } else {\r\n parent.setRight(child);\r\n }\r\n return deleteThis;\r\n }", "public btNode search(int m){ \r\n \r\n System .out.println(\"We are searching for \" + m);\r\n btNode current = root; \r\n while(current.getData() != m) \r\n {\r\n if(m < current.getData()) \r\n current = current.getLeft();\r\n else \r\n current = current.getRight();\r\n if(current == null) \r\n return null; \r\n }\r\n return current; \r\n }", "protected final int getChildIndexNoCheck(ViewLayoutState child) {\n return getChildren().getChildIndexNoCheck(child);\n }", "private UnconstrainedBidElement getClosest(double demandWatt) {\n UnconstrainedBidElement best = null;\n double bestDistance = Double.MAX_VALUE;\n for (UnconstrainedBidElement e : elements) {\n double distance = Math.abs(demandWatt - e.demandWatt);\n if (best == null || distance < bestDistance) {\n best = e;\n bestDistance = distance;\n }\n }\n return best;\n }", "private void GreedySearch(){\n\n Queue<Node> expanded = new LinkedList<>();\n ArrayList<Node> fringe = new ArrayList<>();\n ArrayList<Node> fringeTemp = new ArrayList<>();\n\n\n Node current = startNode;\n\n while(expanded.size() < 1000){\n\n if(current.getDigit().getDigitString().equals(goalNode.getDigit().getDigitString())){\n //goal is reached.\n solutionPath(current);\n expanded.add(current);\n printExpanded(expanded);\n System.exit(0);\n }\n\n\n boolean b = cycleCheck(current,expanded);\n\n if(!b) {\n expanded.add(current);\n }\n\n if(!b){\n\n if(current.getDigit().last_changed != 0){\n\n if ((Integer.parseInt(current.getDigit().getFirst_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseFirstDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(0);\n\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n\n //+1 child first digit\n if ((Integer.parseInt(current.getDigit().getFirst_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseFirstDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(0);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n\n }\n }\n\n if(current.getDigit().last_changed != 1){\n\n if ((Integer.parseInt(current.getDigit().getSecond_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseSecondDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(1);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n\n //+1 child\n if ((Integer.parseInt(current.getDigit().getSecond_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseSecondDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(1);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n }\n\n if(current.getDigit().last_changed != 2){\n if ((Integer.parseInt(current.getDigit().getThird_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseThirdDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(2);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n //+1 child\n if ((Integer.parseInt(current.getDigit().getThird_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseThirdDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(2);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n }\n\n }\n\n\n\n for(Node n : fringe){\n heuristicSetter(n);\n\n }\n\n fringeTemp.addAll(fringe);\n //now all the nodes in fringe have the heuristic value.\n //We can get the last added minm\n Node minm;\n if(fringeTemp.size() != 0){\n minm = fringeTemp.get(0);\n }else{\n break;\n }\n for(int i = 1; i<fringeTemp.size(); i++){\n if(fringeTemp.get(i).getHeuristic() <= minm.getHeuristic()){\n minm = fringeTemp.get(i);\n }\n }\n\n //now we have the minm for the next stage.\n current = minm;\n fringeTemp.remove(minm);\n fringe.clear();\n }\n\n //While loop ends\n System.out.println(\"No solution found.\");\n printExpanded(expanded);\n\n\n\n }", "public ConfigurationTreeNode findChild(String name) {\r\n\t\treturn children.get(name);\r\n\t}", "private void findNeighbour(int offset) {\n TreeNodeImpl node = (TreeNodeImpl) projectTree.getLastSelectedPathComponent();\n TreePath parentPath = projectTree.getSelectionPath().getParentPath();\n NodeList list = (NodeList) node.getParent().children();\n\n for (int i = 0; i < list.size(); ++i) {\n if (list.get(i).equals(node)) {\n if (offset > 0 && i < list.size() - offset) {\n projectTree.setSelectionPath(parentPath.pathByAddingChild(list.get(i + offset)));\n break;\n }\n if (offset < 0 && i >= offset) {\n projectTree.setSelectionPath(parentPath.pathByAddingChild(list.get(i + offset)));\n break;\n }\n }\n }\n }", "private double getClassWeight(Element e) {\n if (!classWeight) {\n return 0;\n }\n\n int weight = 0;\n\n /* Look for a special classname */\n String className = e.className();\n if (!\"\".equals(className)) {\n if (Patterns.exists(Patterns.NEGATIVE, className)) {\n weight -= 25;\n }\n if (Patterns.exists(Patterns.POSITIVE, className)) {\n weight += 25;\n }\n }\n\n /* Look for a special ID */\n String id = e.id();\n if (!\"\".equals(id)) {\n if (Patterns.exists(Patterns.NEGATIVE, id)) {\n weight -= 25;\n }\n if (Patterns.exists(Patterns.POSITIVE, id)) {\n weight += 25;\n }\n }\n return weight;\n }", "public Node nodeSearch(String s){\t \n\t int i=0;\n\t i++;\n\t if(this.children == null){\n\t\t//\t\tSystem.out.println(\"1\");\n\t\treturn null;\n\t }\n\t if(root.state.equals(s)){\n\t\t//System.out.println(\"2\");\n\t\treturn this;\n\t }\n\t Node v=null;\n\t for(String key:this.children.keySet()){\n\t\tNode nxt=this.children.get(key);\n\t\tif(key.equals(s)){\n\t\t // System.out.println(\"3\");\n\t\t return nxt;\n\t\t}\n\t\telse{\n\t\t v=nxt.nodeSearch(s);\n\t\t}\n\t }\n\n\t if(v!=null){\n\t\t//\t\tSystem.out.println(\"4\");\n\t\treturn v;\n\t }else{\n\t\t//System.out.println(\"5\");\t\t\n\t\treturn null;\n\t }\n\t}", "public int getChildNumber(Key key) {\r\n\t\t\tint ret = -1;\r\n\t\t\t\r\n\t\t\tchildren.reset();\r\n\t\t\t//find child position\r\n\t\t\tfor (int i = 0; i < children.size(); i++) {\r\n\t\t\t\tif (children.get().get(key) != null) {\r\n\t\t\t\t\tret = i;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tchildren.next();\r\n\t\t\t}\r\n\t\t\tchildren.reset();\r\n\t\t\t\r\n\t\t\treturn ret;\r\n\t\t}", "public TreeNode find(Integer searchKey) {\n\t\treturn root.find(searchKey);\n\t}", "@Override\n public int getMinChild() {\n if (isEmpty()) {\n throw new IllegalStateException(\"Heap is empty.\");\n }\n return heap[0];\n }", "public Node closestPrecedingNode(int id);", "public SaveGameNode getFirstChild(String name) {\r\n SaveGameNode node;\r\n node = this.children.stream().filter(child -> child.equals(name)).findFirst().get();\r\n return node;\r\n }", "private Node findChild(Node parent, Node lastChild, String elementName) {\n if (lastChild == null && parent != null) {\n lastChild = parent.getFirstChild();\n } else if (lastChild != null) {\n lastChild = lastChild.getNextSibling();\n }\n\n for ( ; lastChild != null ; lastChild = lastChild.getNextSibling()) {\n if (lastChild.getNodeType() == Node.ELEMENT_NODE &&\n lastChild.getNamespaceURI() == null && // resources don't have any NS URI\n elementName.equals(lastChild.getLocalName())) {\n return lastChild;\n }\n }\n\n return null;\n }", "private MyBinaryNode<K> searchRecursive(MyBinaryNode<K> current, K key) {\n\t\tif (current == null) \n\t\treturn null;\n\t\telse if(current.key.compareTo(key) == 0) \n\t\t\treturn current;\n\t\telse if(current.key.compareTo(key) < 0) \n\t\t\treturn searchRecursive(current.right, key);\n\t\telse\n\t\t\treturn searchRecursive(current.left, key); \n\t}", "public abstract Object findPropertyMatchedChild(Object obj, String property, String bench, boolean exactMatch)\n\t throws SAFSObjectNotFoundException;", "private static String findHighParent_A(BabelSynset bs) throws IOException {\n\t\tdouble weight = 0.0;\n\t\tString id = null;\n\t\tList<BabelSynsetIDRelation> edges = bs.getEdges(BabelPointer.ANY_HYPERNYM);\n\t\tfor(BabelSynsetIDRelation b : edges) {\n\t\t\tdouble temp_weight = b.getWeight();\n\t\t\tif(temp_weight > weight && !A_parentsHigh.contains(b.getTarget())) {\n\t\t\t\tweight = temp_weight;\n\t\t\t\tid = b.getTarget();\n\t\t\t\tA_parentsHigh.add(id);\n\t\t\t}\n\t\t}\n\t\tif(id == null) id = \"bn:00031027n\";\n\t\treturn id;\n\t}", "public void FindItem(View view) {\n String child = \"friendName\";\n String name = \"Peter Pan\";\n Query query = friendsDatabaseReference.orderByChild(child).equalTo(name);\n query.addChildEventListener(childEventListener);\n }", "private SiebelAsset findChildAsset(SiebelAsset _asset, String _id) {\n\t\tif (_asset != null && _asset.getChildAssets() != null\n\t\t\t\t&& _asset.getChildAssets().size() > 0) {\n\t\t\tIterator<SiebelAsset> childAssetItr = _asset.getChildAssets()\n\t\t\t\t\t.iterator();\n\n\t\t\twhile (childAssetItr.hasNext()) {\n\t\t\t\tSiebelAsset childAsset = childAssetItr.next();\n\n\t\t\t\tif (childAsset != null\n\t\t\t\t\t\t&& childAsset.getId().equalsIgnoreCase(_id)) {\n\t\t\t\t\treturn childAsset;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public RBNode search(RBNode x, int k){\r\n\t\twhile (x != nil && k != x.key){\r\n\t\t\tif (k < x.key)\r\n\t\t\t\tx = x.left;\r\n\t\t\telse x = x.right;\r\n\t\t}\r\n\t\treturn x;\r\n\t}", "@Test\n public void whenSearchTwoThenResultLevelTwo() {\n tree.addChild(nodeOne, \"1\");\n nodeOne.addChild(nodeTwo, \"2\");\n assertThat(tree.searchByValue(\"2\"), is(\"Element founded on level 2\"));\n }", "Node(int weight, Node leftChild, Node rightChild) {\n this.weight = weight;\n this.leftChild = leftChild;\n this.rightChild = rightChild;\n value = null;\n }", "public ChildType getChildAt( int index );" ]
[ "0.5850372", "0.58388215", "0.5838182", "0.5816095", "0.57206684", "0.5625884", "0.5553005", "0.5508925", "0.54901725", "0.5440739", "0.54253024", "0.5409784", "0.540961", "0.5385708", "0.5361069", "0.5320915", "0.52834445", "0.5266294", "0.52567375", "0.5254652", "0.52461356", "0.52205974", "0.5190102", "0.5165509", "0.51477927", "0.5139404", "0.51052463", "0.5092528", "0.508721", "0.508379", "0.50752246", "0.5061773", "0.50509286", "0.5042009", "0.5015114", "0.50062823", "0.49840698", "0.49718857", "0.4950663", "0.49478096", "0.49469322", "0.49430314", "0.49285135", "0.49235898", "0.49141562", "0.4892958", "0.48771217", "0.4873263", "0.48678568", "0.48616403", "0.48480597", "0.48422676", "0.48387423", "0.4837227", "0.4834994", "0.48347753", "0.48266146", "0.48234534", "0.4814816", "0.48092753", "0.48086414", "0.48076075", "0.4803022", "0.4802132", "0.479801", "0.47937414", "0.47910887", "0.47778463", "0.47753647", "0.47730905", "0.47700083", "0.4769171", "0.4757803", "0.47456253", "0.4745079", "0.4740737", "0.4736145", "0.47310653", "0.47248617", "0.47227514", "0.4718522", "0.47112602", "0.47111964", "0.47023126", "0.46926248", "0.46876085", "0.46869037", "0.4679838", "0.4675657", "0.467549", "0.4674686", "0.46715915", "0.46681473", "0.46647292", "0.4662269", "0.46520513", "0.46515977", "0.4650995", "0.46491367", "0.46470946" ]
0.6030364
0
Prints the program tower.
public String toString(int level) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < level; i++) { builder.append("\t"); } builder.append(getName()).append(" (").append(getWeight()).append(") (").append(getTotalWeight()).append(")\n"); for (Program child : getChildren()) { builder.append(child.toString(level + 1)); } return (builder.toString()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void p_show_info_program() {\n System.out.println(\"╔══════════════════════════════╗\");\n System.out.println(\"║ SoftCalculator V1.2 ║\");\n System.out.println(\"║ Oscar Javier Cardozo Diaz ║\");\n System.out.println(\"║ 16/04/2021 ║\");\n System.out.println(\"╚══════════════════════════════╝\");\n }", "@Override\r\n\tpublic void prettyPrintProgram(Robot robot, Writer writer)\r\n\t{\r\n\t\tif(robot.getProgram() == null)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"This robot does not yet contain a program in its memory.\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\twriter.append(robot.getProgram().toString());\r\n\t\t\t}\r\n\t\t\tcatch (IOException e)\r\n\t\t\t{\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private static void displayHelp(){\n System.out.println(\"1. (R)eport\");\n System.out.println(\"2. (M)inimum Spanning Tree\");\n System.out.println(\"3. (S)hortest Path from i j\");\n System.out.println(\"4. (D)own i j\");\n System.out.println(\"5. (U)p i j\");\n System.out.println(\"6. (C)hange Weight i j x\");\n System.out.println(\"7. (E)ulerian\");\n System.out.println(\"8. (Q)uit\");\n }", "private void printHelp() \n {\n System.out.println(\"You are lost. You are alone. You wander\");\n System.out.println(\"around at the university.\");\n System.out.println();\n System.out.println(\"Your command words are:\");\n parser.showCommands();\n }", "private void printHelp() \n {\n System.out.println(\"You are lost. You are alone. You wander\");\n System.out.println(\"around in a dense woods.\");\n System.out.println();\n System.out.println(\"Your command words are:\");\n parser.showCommands();\n }", "private void printHelp() \n {\n System.out.println(\"You are lost. You are alone. You wander\");\n System.out.println(\"around at the prision.\");\n System.out.println();\n System.out.println(\"Your command words are:\");\n System.out.println(parser.showCommands());\n }", "private void printMainMenu() {\n\t\tSystem.out.println(\"1. Go adventuring\");\n\t\tSystem.out.println(\"2. Enter tavern\");\n\t\tSystem.out.println(\"3. Show details about your character\");\n\t\tSystem.out.println(\"4. Exit game\");\n\t}", "public static void display() {\n\n\t\tSystem.out.println(\"************************************************************\");\n\t\tSystem.out.println(\"* Omar Oraby\t \t\t\t\t\t *\");\n\t\tSystem.out.println(\"* 900133379\t \t\t\t\t\t *\");\n\t\tSystem.out.println(\"* Salma Talaat *\");\n\t\tSystem.out.println(\"* 900161560\t \t\t\t\t\t *\");\n\t\tSystem.out.println(\"* Ahmed Elshafey *\");\n\t\tSystem.out.println(\"* 900131045 *\");\n\t\tSystem.out.println(\"* Programming in Java *\");\n\t\tSystem.out.println(\"* (2018 Fall) *\");\n\t\tSystem.out.println(\"************************************************************\");\n\t\tSystem.out.println();\n }", "private void help() {\n for (GameMainCommandType commandType : GameMainCommandType.values()) {\n System.out.printf(\"%-12s%s\\n\", commandType.getCommand(), commandType.getInfo());\n }\n System.out.println();\n }", "void printFleet(ConsolePrinter printer);", "public static void main(String[] args) {\n System.out.println (\"Once upon a time\");\n System.out.println (\"there was\");\n System.out.println (\"a program\");\n }", "private static void task43() {\n System.out.println(\"Twinkle, twinkle, little star,\");\n System.out.println(\"\\tHow I wonder what you are!\");\n System.out.println(\"\\t\\tUp above the world so high,\");\n System.out.println(\"\\t\\tLike a diamond in the sky!\");\n System.out.println(\"Twinkle, twinkle, little star,\");\n System.out.println(\"How I wonder what you are.\");\n }", "public void printUsage() {\n printUsage(System.out);\n }", "public static void showOptions() {\n System.out.println(new StringJoiner(\"\\n\")\n .add(\"*************************\")\n .add(\"1- The participants' directory.\")\n .add(\"2- The RDVs' agenda.\")\n .add(\"3- Quit the app.\")\n .add(\"*************************\")\n );\n }", "public static void main(String[] args){\n\n //Das System gibt FH Kufstein Tirol auf der Konsole aus.\n System.out.println(\"FH Kufstein Tirol\");\n }", "private void printMenu()\n {\n System.out.println(\"\");\n System.out.println(\"*** Salg ***\");\n System.out.println(\"(0) Tilbage\");\n System.out.println(\"(1) Opret\");\n System.out.println(\"(2) Find\");\n System.out.println(\"(3) Slet\");\n System.out.print(\"Valg: \");\n }", "private static void writeShortManual() {\n System.out.println(\"\\nPromethean CLI v1.0.0\");\n System.out.println(\"Commands:\");\n System.out.println(\"\\tplan - create (and optionally execute) a plan given input json\");\n System.out.println(\"\\ttestgen - generate a test input file given initial and goal states\");\n System.out.println(\"Run <command> --help to see all options\\n\");\n }", "private void showCommands() {\n System.out.println(\"\\n Commands:\");\n System.out.println(\"\\t lf: List reference frames\");\n System.out.println(\"\\t af: Add a reference frame\");\n System.out.println(\"\\t rf: Remove a reference frame\");\n System.out.println(\"\\t le: List events\");\n System.out.println(\"\\t ae: Add an event\");\n System.out.println(\"\\t re: Remove an event\");\n System.out.println(\"\\t ve: View all events from a certain frame\");\n System.out.println(\"\\t li: Calculate the Lorentz Invariant of two events\");\n System.out.println(\"\\t s: Save the world to file\");\n System.out.println(\"\\t l: Load the world from file\");\n System.out.println(\"\\t exit: Exit the program\");\n }", "public void print() {\n System.out.println(\"Command: \" + command);\n }", "public void printHelp() \n {\n System.out.println(\"You are lost. You are alone. You wander\");\n System.out.println(\"around at the university.\");\n System.out.println();\n System.out.println(\"Your command words are:\");\n System.out.println(\" go quit help\");\n }", "private void printHelp() \n {\n Logger.Log(\"You have somehow ended up in this strange, magical land. But really you just want to go home.\");\n Logger.Log(\"\");\n Logger.Log(\"Your command words are:\");\n parser.showCommands();\n Logger.Log(\"You may view your inventory or your companions\");\n }", "private void printHelp() \n {\n System.out.println(\"Your command words are:\");\n parser.showCommands();\n }", "void printUsage(){\n\t\tSystem.out.println(\"Usage: RefactorCalculator [prettyPrint.tsv] [tokenfile.ccfxprep] [cloneM.tsv] [lineM.tsv]\");\n\t\tSystem.out.println(\"Type -h for help.\");\n\t\tSystem.exit(1); //error\n\t}", "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}", "private void showHelp() {\n System.out.println(\"new: \");\n System.out.println(\"new chess and throw the chess bevor away\");\n System.out.println(\"move from to:\");\n System.out.println(\"take the pawn from position from to position to \");\n System.out.println(\"print:\");\n System.out.println(\"print the chess now \");\n System.out.println(\"help:\");\n System.out.println(\"show help\");\n System.out.println(\"quit:\");\n System.out.println(\"quit out\");\n }", "protected void help() {\n println(\"go - Begin execution at Start or resume execution from current pc location\");\n println(\"go <loc1> - Begin execution at <loc1>\");\n println(\"step - Execute next step\");\n println(\"dump <loc1> <loc2> - Dump memory locations from (including) <loc1> - <loc2>\");\n println(\"dumpr - Dump a table of registers\");\n println(\"exit - Exit debugger\");\n println(\"deas <loc1> <loc2> - Deassmble memory locations from (including) <loc1> - <loc2>\");\n println(\"brkt - List the current break point table\");\n println(\"sbrk <loc1> - Set break point at <loc1>\");\n println(\"cbrk <loc1> - Clear break point at <loc1>\");\n println(\"cbrkt - Clear breakpoint table\");\n println(\"help - Print a summary of debugger commands\");\n println(\"chngr <r#> <value> - Change the value of register <r#> to <value>\");\n println(\"chngm <loc1 <value> - Change the value of memory loaction <loc1> to <value>\");\n }", "public static void printGame(){\n System.out.println(\"Spielrunde \" + GameController.AKTUELLE_RUNDE);\n System.out.println(GameController.AKTUELLER_SPIELER +\" ist an der Reihe.\");\n System.out.println(\"Er attackiert \" +\n GameController.AKTUELLER_VERTEIDIGER + \" und verursacht \"\n + GameController.SCHADEN +\" Schaden. \");\n System.out.println();\n }", "@Override\n\tpublic void juxing() {\n\t\tSystem.out.println(\"***************\");\n\t\tSystem.out.println(\"***************\");\n\t\tSystem.out.println(\"***************\");\n\t\tSystem.out.println(\"***************\");\n\t\tSystem.out.println(\"***************\");\n\t}", "public static void printPrompt() {\n System.out.print(\" > \");\n }", "public static void mainText(){\n\t\tSystem.out.println(\"Enter: 1.'EXIT' 2.'STU' 3.'FAC' 4.SQL query 5.'MORE' -for more detail about options\");\n\t}", "public void print() {\n\t\tSystem.out.println(\"针式打印机打印了\");\n\t\t\n\t}", "public static void print() {\r\n System.out.println();\r\n }", "public void print() {\n\t\tSystem.out.println(toString());\n\t}", "public static void main (String [] args){\n\t\tdouble tuna; // we told have that we are going to work with a variable called tuna\n\t\ttuna = 5.28; //variable with value 5.28\n\t\t\n\t\tSystem.out.print(\"I want \"); // printing and staying on the same line\n\t\tSystem.out.print(tuna); //thats will print tuna value on the screen\n\t\tSystem.out.println (\" apple\"); // it moves cursor on a new line \n\t\tSystem.out.println (\" text is on the next line\"); // it moves on a new line \n\t}", "public void print() {\n System.out.println(\"I am \" + status() + (muted ? \" and told to shut up *sadface*\" : \"\") + \" (\" + toString() + \")\");\n }", "public void print() {\n System.out.println(toString());\n }", "final private static void usage_print () {\n\t\tSystem.out.println (NAME + ' ' + VERSION + ' ' + COPYRIGHT) ;\n\t\tSystem.out.println () ;\n\n\t\tSystem.out.println (\n\t\t \"Usage: java bcmixin.Main [<options>] <modelname> <equationname>\"\n\t\t) ;\n\n\t\tSystem.out.println () ;\n\t\tSystem.out.println (\"where [<options>] include any of the following:\") ;\n\t\tSystem.out.println () ;\n\t\tSystem.out.println (\" -help\") ;\n\t\tSystem.out.println (\" Prints this helpful message, then exits.\") ;\n\t\tSystem.out.println () ;\n\t\tSystem.out.println (\" where <modelname> means the model name that you want to work on.\") ;\n\t\tSystem.out.println () ;\n\t\tSystem.out.println (\"where <equationname> provides the equation name, which must end with .equation.\") ;\n\t\tSystem.out.println () ;\n }", "public void show() {\n System.out.println(\"I am the best\");\n }", "@Override\n protected void display() {\n System.out.println(\"Welcome to team builder tool!\");\n System.out.println(\"Current team: \" + team.getName());\n }", "public void print() {\n System.out.println(\"Nome: \" + nome);\n System.out.println(\"Telefone: \" + telefone);\n }", "private static void help() {\n\t\tSystem.out.println(\"\\n----------------------------------\");\n\t\tSystem.out.println(\"---Regatta Calculator Commands----\");\n\t\tSystem.out.println(\"----------------------------------\");\n\t\tSystem.out.println(\"addtype -- Adds a boat type and handicap to file. Format: name:lowHandicap:highHandicap\");\n\t\tSystem.out.println(\"format -- Provides a sample format for how input files should be arranged.\");\n\t\tSystem.out.println(\"help -- Lists every command that can be used to process regattas.\");\n\t\tSystem.out.println(\"podium -- Lists the results of the regatta, assuming one has been processed.\");\n\t\tSystem.out.println(\"regatta [inputfile] -- Accepts an input file as a parameter, this processes the regatta results outlined in the file.\");\n\t\tSystem.out.println(\"types -- lists every available boat type.\");\n\t\tSystem.out.println(\"write [outputfile] -- Takes the results of the regatta and writes them to the file passed as a parameter.\");\n\t\tSystem.out.println(\"----------------------------------\\n\");\n\t}", "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 }", "public void program5Pressed() {\n // display\n TextLCD.print(PROGRAM5);\n }", "public void runProgram() {\n\n\t\tSystem.out.println(\"\\n Time to start the machine... \\n\");\n\n\t\tpress.pressOlive(myOlives);\n\n\t\tSystem.out.println(\"Total amount of oil \" + press.getTotalOil());\n\t}", "public void print()\n {\n System.out.println();\n System.out.println(\"Ticket to \" + destination +\n \" Price : \" + price + \" pence \" + \n \" Issued \" + issueDateTime);\n System.out.println();\n }", "private void printHelp() {\n System.out.println(\"Your available command words are:\");\n parser.showCommands();\n }", "public static void f_menu(){\n System.out.println(\"------------------------------------------------\");\n System.out.println(\"------------------------------------------------\");\n System.out.println(\"-------------Soft_AVERAGE_HEIGHT-----------------\");\n System.out.println(\"-------------version 1.0 23-oct-2020------------\");\n System.out.println(\"-------------make by Esteban Gaona--------------\");\n System.out.println(\"-------------------------------------------------\");\n System.out.println(\"-------------------------------------------------\");\n}", "public void lookOut() //looking out the window\r\n\t{\r\n\tSystem.out.println(this.weather.description); //prints a description of the weather\r\n\t}", "public void printWelcome() {\n\t\tSystem.out.println(\"****************************************************\");\n\t\tSystem.out.println(\">> Welcome to TaskManager\");\n\t\tSystem.out.print(\">> You have \" + this.taskController.getUndoTaskNumber() + \" tasks to do\");\n\t\tSystem.out.println(\" and \" + this.taskController.getDoneTaskNumber() + \" tasks are done!\");\n\t\tSystem.out.println(\">> Pick an option:\");\n\t\tSystem.out.println(\">> (1) Show Task List by date\");\n\t\tSystem.out.println(\">> (2) Show Task List by project\");\n\t\tSystem.out.println(\">> (3) Add a New Task\");\n\t\tSystem.out.println(\">> (4) Edit a Task\");\n\t\tSystem.out.println(\">> (5) Remove a Task\");\n\t\tSystem.out.println(\">> (6) Save\");\n\t\tSystem.out.println(\">> (7) Exit\");\n\t\tSystem.out.println(\"****************************************************\\n\");\n\t}", "protected void printWelcome() {\n System.out.println(\"Slot machine game!\");\n System.out.println(\"- - - - - - - - - -\");\n }", "public static void main(String[] args) {\nprint();\n\t}", "private static void printMainMenu() {\n\t\tprintln(\"Main Menu:\");\n\t\tprintln(\"\\tI: Import Movie <Title>\");\n\t\tprintln(\"\\tD: Delete Movie <Title>\");\n\t\tprintln(\"\\tS: Sort Movies\");\n\t\tprintln(\"\\tA: Sort Actors\");\n\t\tprintln(\"\\tQ: Quit\");\n\t}", "private void printHelp() {\r\n\t\tSystem.out.println(\"Flag Param Details\");\r\n\t\tSystem.out.println(\" -f **x** Add a filter. 'x' is the board letter.\");\r\n\t\tSystem.out.println(\" Can have 0 or more stars before and after the board letter.\");\r\n\t\tSystem.out.println(\" -h Print this message.\");\r\n\t\tSystem.out.println(\" -q Quit interactive session.\");\r\n\t\tSystem.out.println(\" -n xx Display xx number of words.\");\r\n\t\tSystem.out.println(\" -n all Display all words.\");\r\n\t\tSystem.out.println(\" -r Repeat last search.\");\r\n\t\tSystem.out.println(\" -s len Words are sorted by length.\");\r\n\t\tSystem.out.println(\" -s alpha Words are sorted alphapetically.\");\r\n\t\t// System.out.println(\"\");\r\n\t}", "public void consoleBoardDisplay(){\n\t\tString cell[][] = ttt.getCells();\n\t\tSystem.out.println(\"\\n\" +\n\t\t\t\"R0: \" + cell[0][0] + '|' + cell[0][1] + '|' + cell[0][2] + \"\\n\" +\n\t\t\t\" \" + '-' + '+' + '-' + '+' + '-' + \"\\n\" +\n\t\t\t\"R1: \" + cell[1][0] + '|' + cell[1][1] + '|' + cell[1][2] + \"\\n\" +\n\t\t\t\" \" + '-' + '+' + '-' + '+' + '-' + \"\\n\" +\n\t\t\t\"R2: \" + cell[2][0] + '|' + cell[2][1] + '|' + cell[2][2] + \"\\n\"\n\t\t);\n\t}", "private static void printUsage()\n {\n HelpFormatter hf = new HelpFormatter();\n String header = String.format(\n \"%nAvailable commands: ring, cluster, info, cleanup, compact, cfstats, snapshot [name], clearsnapshot, bootstrap\");\n String usage = String.format(\"java %s -host <arg> <command>%n\", NodeProbe.class.getName());\n hf.printHelp(usage, \"\", options, header);\n }", "private static void printHelp(){\r\n System.out.println(\"\\n\\n\\t\\t\\t ----HELP---\\n\\n\" +\r\n \"\\nYou can set the length of password like this \\n\" +\r\n \"\\t java -jar nipunpassgen.jar -l (where l is length of password) \\n\\n\" +\r\n \"\\nYou can also specifiy the which type of word your want to use like this-->\\n\" +\r\n \"\\t Type java -jar nipunpassgen.jar -l -tttt \\n \" +\r\n \"Here 1st t will set uselowercase true \\t 2nd t set useUppercase true\\n\" +\r\n \"\\t 3rd t set useDigit True \\t and 4th t set useSpecial Char true\\n\" +\r\n \"You can use 't' or 'T' for setting the true and 'f' or 'F' for setting the false\\n\" +\r\n \"You can pass -c flag at the end of command for directly copy the password in your\\n\" +\r\n \"clipboard without showing in console like this \\t java -jar nipunpassgen.jar -c \\t this will copy a\\n\" +\r\n \"random 8 digit password in your clipboard .\");\r\n }", "static void print (){\n \t\tSystem.out.println();\r\n \t}", "private void displayLine()\n {\n System.out.println(\"#################################################\");\n }", "public static void print() {\r\n\t\tSystem.out.println(\"1: Push\");\r\n\t\tSystem.out.println(\"2: Pop\");\r\n\t\tSystem.out.println(\"3: Peek\");\r\n\t\tSystem.out.println(\"4: Get size\");\r\n\t\tSystem.out.println(\"5: Check if empty\");\r\n\t\tSystem.out.println(\"6: Exit\");\r\n\t\tSystem.out.println(\"====================================================================\");\r\n\t}", "void vorbereiten(){\n\t\tSystem.out.println(\"vorbereiten \");\n\t}", "private static void help(){\r\n System.out.println(\"\\n\\t Something Went Wrong\\nType\\t java -jar nipunpassgen.jar -h\\t for mor info\");\r\n System.exit(0);\r\n }", "public void printCarte() {\r\n\r\n\t\tSystem.out.println(\"Welcome to Yoyo-Restaurant <3\");\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"-<3----<3----<3----<3----<3----<3----<3----<3----<3----<3\");\r\n\t\tSystem.out.println(\"Our Menu \");\r\n\t\tfor (Menu menu : items) {\r\n\t\t\tmenu.print();\r\n\t\t}\r\n\r\n\t}", "public static void printProgram(ParseTree parseTree)\r\n {\r\n printProg(parseTree);\r\n }", "private void show() {\n System.out.println(team.toString());\n }", "public void printCommand() {\n System.out.println(\"Cette commande n'est pas supportee\");\n System.out.println(\"Quitter : \\\"quit\\\", Total: \\\"total\\\" , Liste: \\\"list\\\" ou Time: \\\"time\\\"\");\n System.out.println(\"--------\");\n }", "public static void main(String[] args){\n //how to print\n\n }", "public void print(){\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\" ~ THREE ROOM DUNGEON GAME ~ \");\n\t\tfor(int i = 0; i < this.area.length;i++){\n\t\t\tSystem.out.println(\" \");\n\t\t\tSystem.out.print(\" \");\n\t\t\tfor(int p = 0 ; p < this.area.length; p++){\n\t\t\t\tif(this.Garret[i][p] == 1){\n\t\t\t\t\tSystem.out.print(\":( \");\n\t\t\t\t}\n\t\t\t\telse if(this.Ari[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" ? \");\n\t\t\t\t}\n\t\t\t\telse if(this.position[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" + \");\n\t\t\t\t}\n\t\t\t\telse if(this.Items[i][p] != null){\n\t\t\t\t\tSystem.out.print(\"<$>\");\n\t\t\t\t}\n\t\t\t\telse if(this.Door[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" D \");\n\t\t\t\t}\n\t\t\t\telse if(this.Stairs[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" S \");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(this.area[i][p]);\n\t\t\t\t}\n\t\t\t}//end of inner for print\n\t\t}//end of outter for print\n\n\t}", "public void display() {\n System.out.println(toString());\n }", "public void printAll() {\n\t\tSystem.out.println(mainPot);\n\t\tcurrentPlayer.printHandAndPocket();\n\t\tcurrentPlayer.printCombos();\n\t\topponentPlayer.printCombos();\n\t\tSystem.out.println();\n\t}", "private void sysout() {\nSystem.out.println(\"pandiya\");\n}", "public void print() {\n\t\tSystem.out.println(\"ONOMA IDIOKTITH: \" + fname);\n\t\tSystem.out.println(\"EPWNYMO IDIOKTITH: \" + lname);\n\t\tSystem.out.println(\"DIEUTHINSH FARMAKEIOU: \" + address);\n\t\tSystem.out.println(\"THLEFWNO FARMAKEIOU: \" + telephone);\n\t\tSystem.out.println();\n\t}", "public static void main(String[] args) {\n System.out.println(\"Hi Everyone\");\n //it is needed to be able to work with the team remotely\n System.out.println(\"I am happy to learn something new\");\n //i need to focus on practicing\n }", "public static void main(String[] args){\n System.out.println(\" -----------\");\n System.out.println(\" | WELCOME |\");\n System.out.println(\" -----------\");\n System.out.println(\" ^ ^ ^ ^ ^ ^\");\n System.out.println(\" / \\\\/ \\\\/ \\\\/ \\\\/ \\\\/ \\\\\"); //Use double backslashes to only\n System.out.println(\"|-G--J--J--2--1--5-|\"); //print one of them.\n System.out.println(\" \\\\ /\\\\ /\\\\ /\\\\ /\\\\ /\\\\ /\");\n System.out.println(\" v v v v v v\");\n //Print out short autobioographic statement\n System.out.println(\"I've gone hiking in the Austrian Alps and I plan\");\n System.out.println(\"to go back to backpack Europe for a summer\");\n \n }", "public void help() {\n System.out.println(\"Type 'commands' to list all \" +\n \"available commands\");\n System.out.println(\"Type 'start' to play game\");\n System.out.println(\"Player to remove the last stone loses!\");\n System.out.println();\n }", "private void printWelcome()//Method was given\n {\n System.out.println();\n System.out.println(\"Welcome to Zork!\");\n System.out.println(\"This Zork is a new adventure game. Find your way through the building and get to the exit by solving riddles and escaping each room. Good luck!\");\n System.out.println(\"Type 'help' to see a list of command words that you can use to play the game.\");\n System.out.println();\n System.out.println(currentRoom.longDescription());\n }", "void dump() {\n\t\tSystem.out.print(\"I am: \" + (territoryID));\n\t\tSystem.out.print(\"\\tNeighbour of:\");\n\n\t}", "public static void main(String[] args) {\n System.out.print(\"-======================================================================-\");\n System.out.println(\" \");\n System.out.println(\" \");\n System.out.println(\" \");\n System.out.println(\" CAL'S DINER \");\n System.out.println(\" \");\n System.out.println(\" \");\n System.out.print(\"-======================================================================-\");\n \n \n //Display 3 special on menu\n System.out.println(\"\");\n System.out.println(\"\");\n System.out.println(\"\");\n System.out.println(\" Today's Special\");\n System.out.println(\" $26.00.......... 8oz Steak\");\n System.out.println(\" $16.00...........Spaghetti and Meatballs\");\n System.out.println(\" $17.00..........Homestyle Chicken Sandwich\");\n \n }", "public void printOut(){\n\t\tSystem.out.println(\"iD: \" + this.getiD());\n\t\tSystem.out.println(\"Titel: \" + this.getTitel());\n\t\tSystem.out.println(\"Produktionsland: \" + this.getProduktionsLand());\n\t\tSystem.out.println(\"Filmlaenge: \" + this.getFilmLaenge());\n\t\tSystem.out.println(\"Originalsprache: \" + this.getOriginalSprache());\n\t\tSystem.out.println(\"Erscheinungsjahr: \" + this.getErscheinungsJahr());\n\t\tSystem.out.println(\"Altersfreigabe: \" + this.getAltersFreigabe());\n\t\tif(this.kameraHauptperson != null) {\n\t\t\tSystem.out.println( \"Kameraperson: \" + this.getKameraHauptperson().toString() );\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println( \"Keine Kameraperson vorhanden \");\n\n\t\t}\n\t\tSystem.out.println(\"----------------------------\");\n\t\tif ( this.listFilmGenre != null) {\n\t\t\tfor( FilmGenre filmGenre: this.listFilmGenre ){\n\t\t\t\tSystem.out.println(\"Filmgenre: \" + filmGenre);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"----------------------------\");\n\t\tfor( Person darsteller: this.listDarsteller ){\n\t\t\tSystem.out.println(\"Darsteller: \" + darsteller);\n\t\t}\n\t\tSystem.out.println(\"----------------------------\");\n\t\tfor( Person synchronSpr: this.listSynchronsprecher ){\n\t\t\tSystem.out.println(\"synchro: \" + synchronSpr);\n\t\t}\n\t\tSystem.out.println(\"----------------------------\");\n\t\tfor( Person regi: this.listRegisseure ){\n\t\t\tSystem.out.println(\"regi: \" + regi);\n\t\t}\n\t\tSystem.out.println(\"----------------------------\");\n\t\tfor( Musikstueck mstk: this.listMusickstuecke ){\n\t\t\tSystem.out.println(\"Musikstueck: \" + mstk);\n\t\t}\n\t\tSystem.out.println(\"----------------------------\");\n\t\tSystem.out.println(\"Datentraeger: \" + this.getDatentraeger());\n\t\tSystem.out.println(\"----------------------------\");\n\t}", "private void printWelcome()\n {\n System.out.println();\n System.out.println(\"Welcome to the World of Zuul!\");\n System.out.println(\"You are invited to a reception at the Taylor’s mansion.\");\n System.out.println(\"However, during the evening the dead body of Mr Taylor is found in the poolroom.\");\n System.out.println(\"You have to solve this investigation.\");\n System.out.println(\"But be careful the case is not simple as it seems to be.\");\n System.out.println();\n System.out.println(\"You are currently in the \" + currentRoom.getDescription());\n System.out.print(\"Let's start your investigation !\");\n printExits();\n \n }", "private void printWelcome()\n {\n System.out.println();\n System.out.println(\"You are lost in the woods!\");\n System.out.println(\"The sun will go down soon and it is up to you to find your way out!\");\n System.out.println(\"Type '\" + CommandWord.HELP + \"' if you need help.\");\n System.out.println();\n System.out.println(currentRoom.getLongDescription());\n }", "public void program1Pressed() {\n // display\n TextLCD.print(PROGRAM1);\n }", "public static void printIndications() {\n\t\tSystem.out.println(\"\\n\" + \"Usage :\"\n\t\t\t\t+ \"\\n\\t\" + \"java -jar <jar-file> nodeScopeDirectoryPath windowSize\"\n\t\t\t\t+ \"\\n\\t\\t\" + \"nodeScopeDirectoryPath is the path of the directory where the tagged corpus is located\"\n\t\t\t\t+ \"\\n\\t\\t\" + \"windowSize is the size of the sliding window; it must be an integer (usually 2)\"\n\t\t\t\t+ \"\\n\\t\\t\" + \"Other input parameters\"\n\t\t\t\t+ \"\\n\\t\\t\" + \"the file containing the candidates terms must be located at src/main/resources/concepts/candidates.txt\"\n\t\t\t\t+ \"\\n\\t\\t\" + \"the file containing the reference terms must be located at src/main/resources/concepts/reference_samples.txt\"\n\t\t\t\t+ \"\\n\\t\\t\" + \"the file containing the stopwords must be located at src/main/resources/stopwords/stopwords_users.txt\"\n\t\t\t\t+ \"\\n\\t\\t\" + \"Output parameters\"\n\t\t\t\t+ \"\\n\\t\\t\" + \"nodeScopeDirectoryPath/output/pat_context.json\"\n\t\t\t\t+ \"\\n\\t\\t\" + \"nodeScopeDirectoryPath/output/med_context.json\"\n\t\t\t\t+ \"\\n\\t\\t\" + \"nodeScopeDirectoryPath/output/frequency.json\"\n\t\t\t\t+ \"\\n\"\n\t\t\t\t);\n\t}", "private void printEndingStory()\n {\n System.out.println();\n System.out.println(\"Princess Peach: Thanks, Mario. We'll be forever friends!\");\n System.out.println(\"Mario: Oh, no...\");\n System.out.println(\"Mario: Princess Peach you are more than a friend to me...\");\n System.out.println();\n }", "public void print() {\r\n\t\tSystem.out.print(getUID());\r\n\t\tSystem.out.print(getTITLE());\r\n\t\tSystem.out.print(getNOOFCOPIES());\r\n\t}", "private void help() {\n System.out.println(\"PLACE X,Y,F #Placing the robot in (X,Y) facing F. \\n\" +\n \"\\tX and Y are numbers between 0 AND 5, F is NORTH, EAST, WEST, SOUTH directions\\n\" +\n \"MOVE #Move one position towards the current direction\\n\" +\n \"LEFT #Turn left\\n\" +\n \"RIGHT #Turn right\\n\" +\n \"REPORT #Prints current position and the direction\\n\" +\n \"HELP #Help menu\");\n }", "public void writeln () {\n pw.println();\n }", "public void TarjanPrint() {\n long start = System.currentTimeMillis();\n io.println(\"The given statement is \");\n if (tarjan.checkSatisfiability()) {\n io.println(\"satisfiable.\");\n } else {\n io.println(\"not satisfiable.\");\n }\n io.println(\"The calculation took \" + (System.currentTimeMillis() - start) + \" milliseconds.\\n\");\n }", "public static void main(String args[]) {\n\t\tBoard initial = new Board(new int[][]{{5,8,7},{1,4,6},{3,0,2}});\r\n\t StdOut.printf(\"Dimension: %d\\n\", initial.dimension());\r\n\t StdOut.print(initial.toString());\r\n\t StdOut.printf(\"Hamming: %d\\n\", initial.hamming());\r\n\t StdOut.printf(\"Manhattan: %d\\n\", initial.manhattan());\r\n\t StdOut.printf(\"Twin:\\n%s\", initial.twin());\r\n\t StdOut.printf(\"\\nNeighbours:\\n\\n\");\r\n\t for (Board b : initial.neighbors()) {\r\n\t \tStdOut.println(b);\r\n\t \tStdOut.printf(\"Distance %d\\n\\n\", b.manhattan());\r\n\t }\r\n\t}", "public void print() {\r\n\t\t System.out.println(toString());\r\n\t }", "public void show() {\n\t\tSystem.out.println(\"show..\");\n\t}", "public static void help() {\n System.out.println(\"MENU : \");\n System.out.println(\"Step 1 to create a default character.\"); // create and display a character\n System.out.println(\"Step 2 to display characters.\");\n System.out.println(\"Step 3 to choice a character for list his details. \");\n System.out.println(\"Step 4 to start fight between 2 characters\");\n System.out.println(\"step 5 to remove a character.\");\n System.out.println(\"step 6 to create a Warrior.\");\n System.out.println(\"step 7 to create a Wizard.\");\n System.out.println(\"step 8 to create a Thief.\");\n System.out.println(\"Step 9 to exit the game. \");\n System.out.println(\"Step 0 for help ....\");\n\n }", "public static void status(){\n System.out.print(\"\\033[H\\033[2J\");//limpia pantalla\n System.out.flush();\n System.out.printf(\"\\nNOMBRE:\\t\\t\\t\"+nombrePersonaje);\n\tSystem.out.printf(\"\\nPuntos De Vida (HP):\\t\"+puntosDeVida);\n\tSystem.out.printf(\"\\nPuntos De mana (MP):\\t\"+puntosDeMana);\n System.out.printf(\"\\nNivel: \\t\\t\\t\"+nivel);\n\tSystem.out.printf(\"\\nExperiencia:\\t\\t\"+experiencia);\n\tSystem.out.printf(\"\\nOro: \\t\\t\"+oro);\n System.out.printf(\"\\nPotion:\\t\\t\\t\"+articulo1);\n System.out.printf(\"\\nHi-Potion:\\t\\t\"+articulo2);\n System.out.printf(\"\\nM-Potion:\\t\\t\"+articulo3);\n System.out.printf(\"\\n\\tEnemigos Vencidos:\\t\");\n\tSystem.out.printf(\"\\nNombre:\\t\\t\\tNo.Derrotas\");\n System.out.printf(\"\\nDark Wolf:\\t\\t\"+enemigoVencido1);\n\tSystem.out.printf(\"\\nDragon:\\t\\t\\t\"+enemigoVencido2);\n System.out.printf(\"\\nMighty Golem:\\t\\t\"+enemigoVencido3);\t\n }", "public void print ()\n\t{\n\t\tSystem.out.println(\"Polyhedron File Name: \" + FileName);\n\t\tSystem.out.println(\"Object active: \" + Boolean.toString(isActive()));\n\t\tprintCoordinates();\n\t}", "private static void displayHelp(){\n System.out.println(\"-host hostaddress: \\n\" +\n \" connect the host and run the game \\n\" +\n \"-help: \\n\" +\n \" display the help information \\n\" +\n \"-images: \\n\" +\n \" display the images directory \\n\" +\n \"-sound: \\n\" +\n \" display the sounds file directory \\n\"\n\n );\n }", "public static void main(String[] args) {\n\t\tSystem.out.print(\"Lets play \");\r\n\t\tSystem.out.print(\"sis\");\r\n\t}", "public void program4Pressed() {\n // display\n TextLCD.print(PROGRAM4);\n }", "@Override\r\n\tpublic void display() {\n\t\tSystem.out.println(\"RedHeadDuck\");\r\n\t}", "private static void printFirstOp(){\n\t\tSystem.out.println(\"Welcome to SimpleSocial!\\n\"\n\t\t\t\t+ \"Type:\\n\"\n\t\t\t\t+ \"- register\\n\"\n\t\t\t\t+ \"- login\\n\"\n\t\t\t\t+ \"- exit\");\n\t}", "private void printWelcome()\n {\n System.out.println();\n System.out.println(\"Welcome to the World of Zuul!\");\n System.out.println(\"World of Zuul is a new, incredibly boring adventure game.\");\n System.out.println(\"Type '\" + CommandWord.HELP + \"' if you need help.\");\n System.out.println();\n System.out.println(currentRoom.getLongDescription());\n }", "private void printUsage() {\n \n // new formatter\n HelpFormatter formatter = new HelpFormatter();\n \n // add the text and print\n formatter.printHelp(\"arara [file [--log] [--verbose] [--timeout N] [--language L] | --help | --version]\", commandLineOptions);\n }", "default void trip() {\n\t\tSystem.out.println(\"Oh no you fell! :(\");\n\t}" ]
[ "0.67012674", "0.66665286", "0.66095495", "0.65514374", "0.65395904", "0.6534808", "0.64735585", "0.6457291", "0.6439994", "0.6423201", "0.6398325", "0.6375908", "0.6355872", "0.6354643", "0.63455284", "0.63374704", "0.6331066", "0.63294965", "0.6319608", "0.6306107", "0.6296338", "0.6276114", "0.62696487", "0.6264861", "0.62639326", "0.62576395", "0.62468886", "0.6235897", "0.6234743", "0.62303114", "0.62233096", "0.62095094", "0.62091106", "0.6206801", "0.6205175", "0.6201077", "0.6196591", "0.61954045", "0.61940634", "0.6186296", "0.618612", "0.618307", "0.61790395", "0.61776036", "0.6176551", "0.61737126", "0.6167922", "0.6159717", "0.6159682", "0.6155873", "0.61540043", "0.61514425", "0.614748", "0.6137339", "0.61339325", "0.6133022", "0.6129731", "0.6123825", "0.61198986", "0.61176264", "0.61122656", "0.6111946", "0.61066383", "0.6103811", "0.6102732", "0.6102591", "0.61004514", "0.6099102", "0.6094564", "0.60894334", "0.6087215", "0.6086726", "0.6082165", "0.6079392", "0.60769546", "0.6073512", "0.607344", "0.60733134", "0.6071346", "0.6067062", "0.6059536", "0.60585374", "0.60495025", "0.6046177", "0.60460824", "0.6045186", "0.6038894", "0.60383785", "0.6037713", "0.6031597", "0.60253924", "0.6020105", "0.6013199", "0.6008605", "0.60062873", "0.6005919", "0.6004351", "0.6001377", "0.5999959", "0.5998141", "0.5991377" ]
0.0
-1
Accessor for the unique name
public String getName() { return _name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Nonnull\n String getUniqueName();", "@NotNull\n public String getName() {\n if (myName == null) {\n myName = myId;\n int index = myName.lastIndexOf('/');\n if (index != -1) {\n myName = myName.substring(index + 1);\n }\n }\n\n return myName;\n }", "public String getName() {\n\t\treturn ((name != null) && !name.isEmpty()) ? name\n\t\t\t\t: (\"[\" + Long.toString(dciId) + \"]\"); //$NON-NLS-1$ //$NON-NLS-2$\n\t}", "public java.lang.String getUniqueName()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(UNIQUENAME$10, 0);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target.getStringValue();\r\n }\r\n }", "public final String name ()\r\n {\r\n return _name;\r\n }", "protected final String name() {\n return name;\n }", "public String getName(){\n \treturn this.name().replace(\"_\", \" \");\n }", "public String getNameKey() {\n return getName();\n }", "public String getNameId() {\r\n\t\treturn nameId;\r\n\t}", "public String getUniqueID ( ) { return _uniqueID; }", "private String getUniqueNodeName() {\n return String.format(\"N%d\", uniqueNode++);\n }", "String getUniqueID();", "public String uniqueId() {\n return this.uniqueId;\n }", "public String getUniqueID() {\n return this.uniqueID;\n }", "private String getName() {\n\t\treturn name;\n\t}", "public String getName() { return name.get(); }", "final public Identifier getName ()\n {\n\treturn myName;\n }", "public String getUniqueID()\r\n {\r\n return (m_uniqueID);\r\n }", "String generateUniqueName();", "public String getUniqueID();", "@Basic @Immutable\n\tpublic String getName() {\n\t\treturn name;\n\t}", "public final String name() {\n return name;\n }", "public Identifier getName();", "public String getter() {\n\t\treturn name;\n\t}", "public String getUniqueIdValue() {\n return uniqueIdValue;\n }", "public java.lang.String getName();", "public String getName(){\n\n //returns the value of the name field\n return this.name;\n }", "String name() {\n return name;\n }", "public String name() {\n this.use();\n\n return name;\n }", "protected String getName() {\n\t\treturn name;\n\t}", "protected String getName() {\n\t\treturn name;\n\t}", "public String getUniqueField() {\n return uniqueField;\n }", "public synchronized Identifier getName() {\n if (name == null) {\n // lazy initialization !?\n name = Identifier.create(\"\"); // NOI18N\n }\n return name;\n }", "public String getIDName();", "public String getId() {\n String id = name.replaceAll(\" \", \"-\");\n id = id.replaceAll(\"_\", \"-\");\n return id.toLowerCase();\n }", "public final String name() {\n\t\treturn name;\n\t}", "protected String getName(){\r\n return this.name;\r\n }", "Object getName() {\n return name;\n }", "public String getName() {\r\n\t\treturn name.get();\r\n\t}", "public String getName() {\n return name.get();\n }", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "public String name() {\n return celestialName;\n }", "String getName() ;", "public final Identifier getName() {\n return getMemberImpl().getName();\n }", "public String getName()\r\n\t{\r\n\t\treturn name; // gives the value of the name to the caller\r\n\t}", "public int numericName()\n {\n return Factory.getID(this);\n }", "public final int getName() { return name; }", "public String getName() {\n return name + \"\";\n }", "private String name() {\r\n return cls.getSimpleName() + '.' + mth;\r\n }", "@Override\n public String name() {\n return this._name;\n }" ]
[ "0.76949054", "0.7350493", "0.71585184", "0.7124379", "0.71126306", "0.7091455", "0.7082302", "0.70709604", "0.70525414", "0.7018865", "0.7017653", "0.701177", "0.70029354", "0.6991076", "0.69750893", "0.6958763", "0.6957987", "0.69403815", "0.6934391", "0.6930874", "0.6917889", "0.6902037", "0.68969953", "0.68874854", "0.68770665", "0.68757963", "0.68695605", "0.68629056", "0.68512183", "0.68501633", "0.68501633", "0.6847651", "0.68455744", "0.68292797", "0.68208414", "0.682059", "0.68197495", "0.68159515", "0.68125135", "0.68069357", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.68050927", "0.6802917", "0.6795817", "0.67887175", "0.6777715", "0.67642635", "0.67603457", "0.6753725", "0.6748084", "0.6740118" ]
0.0
-1
Accessor for the weight
public int getWeight() { return _weight; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double getWeight() {\r\n return weight;\r\n }", "public double getWeight() {\r\n return weight;\r\n }", "public double getWeight() {\n return weight;\n }", "public double getWeight() {\n return weight;\n }", "public double getWeight(){\n return weight;\n }", "public double getWeight(){\n\t\treturn this._weight;\n\t}", "public double getWeight(){\n\t\treturn weight;\n\t}", "public float getWeight() {\n return weight;\n }", "public float getWeight() {\n return weight;\n }", "public double getWeight() {\n return this.weight * 2.20462;\n }", "public double getWeight() {\n\t\n\t\treturn this.weight;\t \n\t}", "@Override\n public double getWeight() {\n return this.weight;\n }", "public double getWeight() {\n\t\treturn weight; \n\t\t}", "public float getWeight() {\n return weight;\n }", "public float getWeight() {\n return weight;\n }", "public float getWeight();", "@Override\n\tpublic double getWeight() {\n\t\treturn weight;\n\t}", "public double getWeight() {\n\t\treturn weight;\n\t}", "public double getWeight()\r\n {\r\n return this.aWeight ;\r\n }", "public Weight getWeight();", "public int getWeight() {\n return weight;\n }", "public java.lang.Double getWeight () {\r\n\t\treturn weight;\r\n\t}", "public int getWeight() {\n return this.weight;\n }", "public int getWeight()\n {\n return weight;\n }", "public int getWeight() {\n return weight;\n }", "public int getWeight() {\n return weight;\n }", "public int getWeight();", "public Integer getWeight() {\n return weight;\n }", "public int getWeight() {\n return weight;\n }", "public int weight(){\n\t\treturn this.weight;\n\t}", "public float getWeight() {\n\t\t\treturn weight;\n\t\t}", "public int getWeight(){\n \treturn weight;\n }", "public int getWeight(){\n\t\treturn weight;\n\t}", "int getWeight() {\n return weight;\n }", "int getWeight() {\n return weight;\n }", "public int getWeight() {\r\n\t\treturn this.weight;\r\n\t}", "public double getWeight(){return this.aWeight;}", "public int getWeight()\n\t{\n\t\treturn this.weight;\n\t}", "public int weight() {\n \treturn weight;\n }", "public abstract double getWeight ();", "int getWeight();", "int getWeight();", "public int getWeight() {\n\t\treturn weight;\n\t}", "public int getWeight() {\n\t\treturn weight;\n\t}", "@Override\r\n\tpublic double Weight() {\n\t\treturn Weight;\r\n\t}", "public int weight() {\n if (this.weight == null) {\n return 0;\n } else {\n return this.weight;\n } // if/else\n }", "public int getWeight()\n {\n return this.aWeight;\n\n }", "public int getWeight() {\n return parameter.getWeight();\n }", "public String getWeight() {\n return weight;\n }", "public double getWeight()\n\t{\n\t\t//metodo precisa retornar alguma coisa\n\t\treturn 0.0;\n\t}", "@Basic\r\n\tpublic Weight getWeight(){\r\n\t\treturn weight;\r\n\t}", "public String getWeight()\r\n\t{\r\n\t\treturn weight;\r\n\t}", "public double getWeight() {\n \treturn this.trainWeight;\n }", "public double getWeight() {\n\t\tif(weightConfiguration == null) {\n\t\t\treturn 1.0;\n\t\t}\n\t\treturn weightConfiguration.weightForIdentifier(this.getIdentifier());\n\t}", "public Byte getWeight() {\n\t\treturn weight;\n\t}", "public int getWeight()\n {\n return weightCarried;\n }", "final protected double getWeight() {\n\t\treturn getWeight( _population );\n\t}", "public T3 getWeight() {\r\n\t\treturn weight;\r\n\t}", "public double getWeight() {\n return 0;\n }", "@Override\n\t\tpublic int get_weights() {\n\t\t\treturn weight;\n\t\t}", "public int getWeight() {\n\t\treturn quantity*weight; \n\t}", "public double getWeight()\r\n {\r\n return this.weightCapacity;\r\n }", "public double getActualWeight() {\n return actualWeight;\n }", "public int weight ();", "@JsonGetter(\"weight\")\n public int getWeight ( ) {\n return this.weight;\n }", "public float getWeightValue() {\r\n\t\treturn this.value;\r\n\t}", "public double getAtomicWeight() {\n }", "public Double getHeadWeight();", "public Matrix getWeight() {\n return weights;\n }", "public double getWeight() {\n\t\tIterator<Ball> it = this.contents.iterator();\n\t\tdouble retVal = 0;\n\t\twhile (it.hasNext()) {\n\t\t\tretVal += it.next().getWeight();\n\t\t}\n\t\treturn retVal;\n\t}", "public double getTotalWeight() {\n return this.totalWeight;\n }", "public int getpWeight() {\n return pWeight;\n }", "public int getWeight1() {\n return weight1;\n }", "public double getcurrentWeight() {\n\t return this.currentWeight;\n\t}", "public float getWeightUsed()\r\n {\r\n // implement our own magic formula here ...\r\n return 2.0f;\r\n }", "public Vec getRawWeight();", "private double weight(){\n return ((double) (m_PositiveCount + m_NegativeCount)) / ((double) m_PositiveCount);\n }", "public int getRelativeWeight() {\n return relativeWeight;\n }", "@Override\r\n\tpublic double getWeight() {\n\t\treturn 0;\r\n\t}", "public ButlerWeights getWeights() {\n\treturn currentWeights;\n }", "@Override\n\tpublic double getInternalWeight(int nodeIndex) {\n\t\treturn this.inWeights[nodeIndex];\n\t}", "public abstract double totalWeight();", "private double attrWeight (int index) {\n return m_MI[index];\n }", "public double getWeight(int paraIndex) {\n\t\treturn weights[paraIndex];\n\t}", "@Override\r\n public double getBaseWeight() { return type.getWeight(); }", "@Override\n public double getWeight() {\n // For this example just assuming all cars weigh 500kg and people weigh 70kg\n return 500 + (70 * this.getNumPassengers());\n }", "@Override\n\tpublic double weight() {\n\t\treturn 1.0;\n\t}", "public int getWeight(){\n\t\treturn this.edgeWeight;\n\t}", "public Weight[] getWeights() {\n return weights;\n }", "public int getWeight()\r\n\t{\r\n\t\treturn edgeWeight;\t\t\r\n\t}", "abstract Double getWeight(int i, int j);", "public String getWeightUnit() {\n return (String) get(\"weight_unit\");\n }", "public double getEquipmentWeight() {\r\n\t\tdouble ret = 0;\r\n\t\tPerson p = model.getData();\r\n\t\tif ( p!=null ) {\r\n\t\t\tret = p.getCarriedWeight();\r\n\t\t}\r\n\t\treturn ret;\r\n\t}", "HashMap<String, Double> getWeightMap() {\n\t\treturn weightMap;\n\t}", "public GiftCardProductQuery weight() {\n startField(\"weight\");\n\n return this;\n }", "double getWeight(V v, V w);", "int Weight();", "@Basic\n\tpublic Weight getCurrentWeight() {\n\t\treturn this.currentWeight;\n\t}", "public double getFodder() {\n return 0.025 * weight;\n }", "@Override\r\n public final int getWeight() {\r\n int i, c;\r\n Rule[] r;\r\n\r\n c = 0;\r\n r = this.m_rules;\r\n for (i = (r.length - 1); i >= 0; i--) {\r\n c += r[i].getWeight();\r\n }\r\n\r\n return c;\r\n }" ]
[ "0.8800734", "0.8800734", "0.87621886", "0.87621886", "0.8754785", "0.87313336", "0.87260234", "0.8704698", "0.8704698", "0.8689036", "0.8688297", "0.86876184", "0.868353", "0.86759055", "0.86705106", "0.86541873", "0.8639083", "0.86169964", "0.8611086", "0.8608543", "0.8543314", "0.8540919", "0.854042", "0.8524666", "0.851906", "0.851906", "0.8504008", "0.8488509", "0.8482227", "0.8455187", "0.84495974", "0.84463596", "0.8444937", "0.84279436", "0.84279436", "0.8393956", "0.83804333", "0.8357277", "0.8334824", "0.8314564", "0.8314359", "0.8314359", "0.8314208", "0.8314208", "0.8308108", "0.8300943", "0.8295424", "0.8294873", "0.8254495", "0.8244466", "0.82429236", "0.8231954", "0.8223735", "0.8162122", "0.8135319", "0.8128609", "0.8113678", "0.809225", "0.80899024", "0.80307794", "0.80296975", "0.7993433", "0.7948096", "0.7938222", "0.78784025", "0.785492", "0.7844194", "0.7826292", "0.7785711", "0.7745888", "0.77279425", "0.7692478", "0.76782125", "0.7657623", "0.7646087", "0.76139784", "0.760737", "0.7591673", "0.75850576", "0.75579953", "0.75522923", "0.75430065", "0.7541639", "0.74946845", "0.7441795", "0.742444", "0.7420824", "0.73950315", "0.7382122", "0.73622394", "0.73206717", "0.72933346", "0.7285856", "0.7276969", "0.72767466", "0.7247609", "0.72470105", "0.7235395", "0.72339314", "0.7174601" ]
0.8384145
36
Accessor for the child names
public List<String> getChildNames() { return _childNames; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getNameChildren(int childPosition)\n {\n ExpandableListItems_Child tempChild = children.get(childPosition);\n return(tempChild.getName());\n }", "public String getChildTagName() {\n return (String)attributes.get(\"childTagName\");\n }", "PropertyName getName();", "public String getName() { return name.get(); }", "public String getChild() {\n return child;\n }", "protected String getName(){\r\n return this.name;\r\n }", "public String[] listChildren()\n/* */ {\n/* 519 */ int childCount = getChildCount();\n/* 520 */ String[] outgoing = new String[childCount];\n/* 521 */ for (int i = 0; i < childCount; i++) {\n/* 522 */ outgoing[i] = getChild(i).getName();\n/* */ }\n/* 524 */ return outgoing;\n/* */ }", "public String [] getNames () { \n return this.listAttributes(); \n }", "@Override\n public ImmutableList<String> getNameParts() {\n return names.toImmutable();\n }", "public String getName() { return (String)get(\"Name\"); }", "public String getName(){return this.name;}", "public String getName(){\n\n //returns the value of the name field\n return this.name;\n }", "public abstract String getChildTitle();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "java.lang.String getName();", "@Override\n public java.lang.Object getNames() throws G2AccessException {\n java.lang.Object retnValue = getAttributeValue (SystemAttributeSymbols.NAMES_);\n return (java.lang.Object)retnValue;\n }", "public String getName(){\r\n return this.name;\r\n }", "public java.lang.String getName();", "public String getName ( ) {\n\t\treturn extract ( handle -> handle.getName ( ) );\n\t}", "public String getName () { return n.getName(); }", "String getNameElement();", "public String getName(){ return name; }", "private String[] getNameParts() {\n return field.getName().split(\"_\");\n }", "public String getName(){return this.aName;}", "String getName(){return this.name;}", "public String getName(){return name;}", "public String getName(){return name;}", "public String getName(){return name;}", "public String getName(){return name;}", "String getName() ;", "@Override\n public String getName() {\n return this.name();\n }", "public String getName() { return this.Name; }", "@Override\r\n String getName();", "public String getPropertyName();", "public String getName() { \n\t\treturn getNameElement().getValue();\n\t}", "public String getName() { \n\t\treturn getNameElement().getValue();\n\t}", "public String getName() { \n\t\treturn getNameElement().getValue();\n\t}", "@Override\n public String getName() {\n return this.name;\n }", "@Override\n String getName();", "@Override\n public String getName() {\n return name();\n }", "public String[] getTreeNames();", "public String getName() { return this.name; }", "public String getName() { return this.name; }", "public String getName() { return this.name; }", "public String getName(){\r\n return name;\r\n }", "public String getName(){\r\n return name;\r\n }", "public String getName(){\r\n return name;\r\n }", "public String getName(){\r\n return name;\r\n }", "public String getName(){\r\n return name;\r\n }", "public List<String> children() {\n return this.children;\n }" ]
[ "0.69056666", "0.65758747", "0.65588945", "0.64882565", "0.6483601", "0.6460986", "0.63707626", "0.63413084", "0.63053966", "0.6299754", "0.6291741", "0.62751055", "0.62710786", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62574714", "0.62532115", "0.6235985", "0.6229656", "0.62295955", "0.62271935", "0.6226316", "0.6200374", "0.6200102", "0.6199901", "0.6182851", "0.61810416", "0.61810416", "0.61810416", "0.61810416", "0.6178791", "0.6175643", "0.61754245", "0.616782", "0.6164754", "0.61646074", "0.61646074", "0.61646074", "0.6162993", "0.6157119", "0.61561567", "0.6154614", "0.6142025", "0.6142025", "0.6142025", "0.61413705", "0.61413705", "0.61413705", "0.61413705", "0.61413705", "0.6141346" ]
0.7714348
0
Accessor for the list of children. Must be initialized.
public List<Program> getChildren() { if (_children == null) { throw new IllegalArgumentException("Children must be initialized before calling."); } return _children; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<String> children() {\n return this.children;\n }", "public List<EntityHierarchyItem> children() {\n return this.innerProperties() == null ? null : this.innerProperties().children();\n }", "public ArrayList<Node> getChildren() { return this.children; }", "public ArrayList getChildren()\n {\n return children;\n }", "public ObjectList<DynamicModelPart> getChildren() {\n return this.children;\n }", "public List<PafDimMember> getChildren() {\r\n\t\t\r\n\t\tList<PafDimMember> childList = null;\r\n\t\t\r\n\t\t// If no children are found, return empty array list\r\n\t\tif (children == null) {\r\n\t\t\tchildList = new ArrayList<PafDimMember>();\r\n\t\t} else {\r\n\t\t\t// Else, return pointer to children\r\n\t\t\tchildList = children;\r\n\t\t}\r\n\t\treturn childList;\r\n\t}", "public String getChildren() {\n return children;\n }", "protected abstract List<T> getChildren();", "@Override\n public List<TreeNode<N>> children() {\n return Collections.unmodifiableList(children);\n }", "public JodeList children() {\n return new JodeList(node.getChildNodes());\n }", "public ArrayList<ExpandableListItems_Child> getChildren()\n {\n return children;\n }", "public List<String> getChildren() {\n\t\treturn null;\n\t}", "public Vector getChildren() {\n return this.children;\n }", "public String getChildren() {\n\t\treturn children;\n\t}", "public Human[] getChildren() {\n return children;\n }", "public @NonNull List<@NonNull Node<@Nullable T>> getChildren() {\n return Collections.unmodifiableList(this.children);\n }", "@Override\n\tpublic List<Node> chilren() {\n\t\treturn children;\n\t}", "public Vector getChildren()\r\n\t{\r\n\t\treturn m_children;\r\n\t}", "public List<GuiElementBase> getChildren()\n\t\t{ return Collections.unmodifiableList(children); }", "public Collection<ChildType> getChildren();", "public Node[] getChildren(){return children;}", "protected final synchronized Iterator<T> children() {\n if( children == null ) {\n children = Collections.emptyList();\n }\n \n return children.iterator();\n }", "public ArrayList<Node> getChildren() {\n return children;\n }", "public ArrayList<Node> getChildren(){\n return children;\n }", "public List<RealObject> getChildren();", "public ArrayList<LexiNode> getChilds(){\n\t\treturn childs;\n\t}", "public ParseTree[] getChildren() {\n\t\treturn children;\n\t}", "public java.util.List<BinomialTree<KEY, ITEM>> children()\n\t{\n\t\treturn _children;\n\t}", "public List<ChronologElement> getChildren() {\r\n return children;\r\n }", "protected String[] doListChildren()\n {\n return (String[])m_children.toArray( new String[ m_children.size() ] );\n }", "public int getChildCount() {return children.size();}", "@DISPID(4)\n\t// = 0x4. The runtime will prefer the VTID if present\n\t@VTID(10)\n\tcom.gc.IList children();", "public Item2Vector<Concept> getChildren() { return children; }", "public Collection<BaseGenerator> \n getChildren() \n {\n return Collections.unmodifiableCollection(pChildren.values());\n }", "@Override\n public LinkedList<ApfsElement> getChildren() {\n return this.children;\n }", "public List<XML2JSONObject> getChildren() {\r\n return _childs;\r\n }", "public List<TWidget> getChildren() {\n return children;\n }", "public String[] getChildList() {\n if (this.children == null) {\n return this.pointsByChild.keySet().toArray(new String[this.pointsByChild.size()]);\n } else {\n return this.children.clone();\n }\n }", "@Override\n\tpublic TreeNode[] getChildren() {\n\t\treturn this.children ;\n\t}", "@Nonnull\n Iterable<? extends T> getChildren();", "public ArrayList<PiptDataElement> getChildren()\n {\n\treturn children;\n }", "public List<Node> getChildren() {\r\n\t\t\tchildren.reset();\r\n\t\t\treturn children;\r\n\t\t}", "public List<TreeNode> getChildren ()\r\n {\r\n if (logger.isFineEnabled()) {\r\n logger.fine(\"getChildren of \" + this);\r\n }\r\n\r\n return children;\r\n }", "@NotNull\n @Override\n public TreeElement[] getChildren() {\n return callChildren(this, navigationItem);\n }", "public List<TreeNode> getChildren() {\n\t\treturn children;\n\t}", "ArrayList<Expression> getChildren();", "public List<HtmlMap<T>> getChildren()\n\t{\n\t\treturn m_children;\n\t}", "public String[] listChildren()\n/* */ {\n/* 519 */ int childCount = getChildCount();\n/* 520 */ String[] outgoing = new String[childCount];\n/* 521 */ for (int i = 0; i < childCount; i++) {\n/* 522 */ outgoing[i] = getChild(i).getName();\n/* */ }\n/* 524 */ return outgoing;\n/* */ }", "public ArrayList getChildren() {\n return m_values;\n }", "public SeleniumQueryObject children() {\n\t\treturn ChildrenFunction.children(this, elements);\n\t}", "public Node[] getChildren(){\n return children.values().toArray(new Node[0]);\n }", "@Override\r\n\tpublic List<TreeNode> getChildren() {\n\t\tif(this.children==null){\r\n\t\t\treturn new ArrayList<TreeNode>();\r\n\t\t}\r\n\t\treturn this.children;\r\n\t}", "List<Node<T>> children();", "public XMLElement[] getChildren()\n/* */ {\n/* 532 */ int childCount = getChildCount();\n/* 533 */ XMLElement[] kids = new XMLElement[childCount];\n/* 534 */ this.children.copyInto(kids);\n/* 535 */ return kids;\n/* */ }", "public List<FileNode> getChildren() {\r\n return this.children;\r\n }", "public HashMap<Integer, List<Integer>> getChildren() {\n\t\treturn children;\n\t}", "@Override\n\tpublic int getChildrenNum() {\n\t\treturn children.size();\n\t}", "public Enumeration enumerateChildren() {\n return this.children.elements();\n }", "@DISPID(-2147417075)\n @PropGet\n com4j.Com4jObject children();", "public LinkedList<Node> getChildren() { \r\n LinkedList<Node> nodes = new LinkedList<>();\r\n for(int i=0;i<=size;i++)\r\n nodes.add(children[i]);\r\n return nodes;\r\n }", "public Iterator<ParseTreeNode> children() {\r\n if ((_children == null) || (_children.size() == 0)) {\r\n return NULL_ITERATOR;\r\n }\r\n return _children.iterator();\r\n }", "public Vector<GraphicalLatticeElement> getChildren() {\n\t\tVector<GraphicalLatticeElement> children = new Vector<GraphicalLatticeElement>();\n\t\tif (childrenEdges != null)\n\t\t\tfor (int i = 0; i < childrenEdges.size(); i++) {\n\t\t\t\tEdge edge = childrenEdges.elementAt(i);\n\t\t\t\tchildren.add(edge);\n\t\t\t\tchildren.add(edge.getDestination());\n\t\t\t}\n\t\t\n\t\treturn children;\n\t}", "public ArrayList<CurrentMemo> getChild()\n\t\t{\n\t\t\treturn children;\n\t\t}", "public List<Ent> getChildList(){\n\t\tif(this.childList != null){\n\t\t\treturn Collections.unmodifiableList(this.childList);\n\t\t}else{\n\t\t\treturn new ArrayList<Ent>();\n\t\t}\n\t}", "public Enumeration children()\n {\n return new Enumeration(){\n int i = 0;\n public boolean hasMoreElements()\n {\n return i < mChildren.length;\n }\n\n public Object nextElement()\n {\n return mChildren[i++];\n }\n };\n }", "@Override\n public int getNumChildren() {\n\t return this._children.size();\n }", "public Node[] getChildren() {\n\t\treturn children.toArray(new Node[0]);\n\t}", "@Override\n public int getChildrenCount()\n {\n return children.getSubNodes().size();\n }", "public List<GameStateChild> getChildren() {\n return null;\n }", "public Collection<VisualLexiconNode> getChildren() {\n \t\treturn children;\n \t}", "public ArrayList<Node> getList(){\n \treturn this.children;\n }", "public ResultMap<BaseNode> listChildren();", "public List<String> getChildIds() {\n return childIds;\n }", "public List<MagicPattern> getChildren() {\n\t\treturn children;\n\t}", "public List<? extends Resource> getChildren() {\n\t\tLOGGER.debug(\"Get Children \");\n\t\tfinal Iterator<Content> children = content.listChildren().iterator();\n\t\treturn ImmutableList.copyOf(new PreemptiveIterator<SparseMiltonContentResource>() {\n\n\t\t\t\t\tprivate SparseMiltonContentResource resource;\n\n\t\t\t\t\t@Override\n\t\t\t\t\tprotected boolean internalHasNext() {\n\t\t\t\t\t\twhile (children.hasNext()) {\n\t\t\t\t\t\t\tContent n = children.next();\n\t\t\t\t\t\t\tif (n != null) {\n\t\t\t\t\t\t\t\tresource = new SparseMiltonContentResource(n\n\t\t\t\t\t\t\t\t\t\t.getPath(), session, n);\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresource = null;\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tprotected SparseMiltonContentResource internalNext() {\n\t\t\t\t\t\treturn resource;\n\t\t\t\t\t}\n\n\t\t\t\t});\n\t}", "@objid (\"808c084f-1dec-11e2-8cad-001ec947c8cc\")\n public final List<GmNodeModel> getChildren() {\n return new ArrayList<>(this.children);\n }", "public List<TreeNode> getNotes ()\r\n {\r\n return children;\r\n }", "@Override\n\tpublic List<Knoten> getChilds() {\n\t\treturn null;\n\t}", "Collection<DendrogramNode<T>> getChildren();", "public List<PlanNode> getChildren() {\n return childrenView;\n }", "int childCount(){\n return this.children.size();\n }", "public List<String> getChildNames() {\n\t\treturn _childNames;\n\t}", "public Enumeration<Node> children() { return null; }", "public IdList getChildIdList() {\n return _childIdList;\n }", "public LinkedList<ApfsElement> getChildren() {\n return this.ApfsChildren;\n }", "public ArrayList<BTreeNode<E>> getChildren() {\n\t\treturn children;\n\t}", "@Override\r\n\tpublic List<Node> getChildren() {\r\n\t\treturn null;\r\n\t}", "public abstract List<Node> getChildNodes();", "public IStatus[] getChildren() {\n\t\treturn adaptee.getChildren();\n\t}", "List<UIComponent> getChildren();", "public Vector getChildren() {\n return null;\n }", "public List<BudgetAccountTableRow> getChildren() {\n return this.children;\n }", "public Collection<ConfigurationTreeNode> getChildren() {\r\n\t\treturn children.values();\r\n\t}", "public void init$Children() {\n children = new ASTNode[2];\n setChild(new List(), 1);\n }", "public int getChildCount() {\r\n if (_children == null) {\r\n return 0;\r\n }\r\n return _children.size();\r\n }", "public void init$Children() {\n children = new ASTNode[3];\n setChild(new List(), 1);\n setChild(new List(), 2);\n }", "public List<String> childResources() {\n return this.childResources;\n }", "@Override\n public List<ConfigurationNode> getChildren()\n {\n return children.getSubNodes();\n }", "public int getChildCount() {\n return this.children.size();\n }", "public ArrayList<String> GetChild(){\n\t\treturn this.ChildSMILES;\n\t}", "public List<CourseComponent> getChildLeafs() {\n List<CourseComponent> childLeafs = new ArrayList<>();\n if (children != null) {\n for (CourseComponent c : children) {\n if (!c.isContainer())\n childLeafs.add(c);\n }\n }\n return childLeafs;\n }" ]
[ "0.79643387", "0.7625142", "0.7625103", "0.7595003", "0.75519216", "0.753348", "0.7527988", "0.75160885", "0.75145066", "0.7483659", "0.74819285", "0.74721086", "0.7471484", "0.7434044", "0.7414398", "0.74110335", "0.7405097", "0.73993415", "0.738633", "0.7384896", "0.7381029", "0.73766744", "0.73535174", "0.7353455", "0.7340125", "0.7323376", "0.73088175", "0.7287946", "0.7278557", "0.7275368", "0.72708654", "0.72473794", "0.7237017", "0.7214857", "0.7195869", "0.7185237", "0.7184709", "0.71819526", "0.7176221", "0.71657485", "0.71556807", "0.71526533", "0.71522486", "0.7129056", "0.7127189", "0.7107736", "0.7101913", "0.71004146", "0.7087739", "0.70776534", "0.70750535", "0.706155", "0.70573896", "0.7056637", "0.7041006", "0.70402145", "0.70325", "0.7030315", "0.7022604", "0.7013722", "0.698458", "0.6980482", "0.69729894", "0.6960258", "0.694855", "0.6941543", "0.6936359", "0.692895", "0.69093543", "0.6905675", "0.68999434", "0.6898288", "0.6896105", "0.68845993", "0.6884176", "0.68800956", "0.687291", "0.6869588", "0.68674934", "0.686545", "0.6863696", "0.6857559", "0.6853508", "0.6851674", "0.68424743", "0.68367887", "0.6826477", "0.68101364", "0.67751145", "0.6756196", "0.6752647", "0.67507344", "0.67302686", "0.67275023", "0.6727054", "0.6725874", "0.6725228", "0.67230976", "0.6714913", "0.6711607", "0.6705894" ]
0.0
-1
Setup Test animal and forest before each test.
@Before public final void setUp() { int numLegs = 4; animal = new Animal("Possum", "Mammal", "male", numLegs); testForest = new Forest("Hamner Forest Park", "Alpine Forest", "Warm, Mountain-like"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Before\n\tpublic void setup() {\n\t\t\n\t\t\n\t}", "@Before\r\n\tpublic void setup() {\r\n\t}", "@Before\n\tpublic void testEachSetup() {\n\t\ttestGrid = new Grid(50,50);\n\t\tundoRedo_TestStack = new UndoRedo();\n\t\tSystem.out.println(\"Setting up test...\");\n\t}", "@BeforeEach\n\tpublic void setup() {\n\t\t\n\t\trisorsa= new Film(1,1);\n\t\tuser=new Utente(\"nome\",\"cognome\",\"mail\",LocalDateTime.now(),\"cf\",\"user\",\"psw\");\n\t\tfruitore = new Fruitore(user);\n\t\t\n\t\trisorsa_diversa= new Film(2,1);\n\t\tuser_diverso=new Utente(\"nome\",\"cognome\",\"mail\",LocalDateTime.now(),\"cf\",\"user_diverso\",\"psw\");\n\t\tfruitore_diverso = new Fruitore(user_diverso);\n\t\t\n\t\tprestito= new Prestito(risorsa, fruitore);\n\t\tprestito_diverso= new Prestito(risorsa_diversa, fruitore_diverso);\n\t}", "@Before\n\tpublic void setup() \n\t{\n\t\tsuper.setup();\n\t\t\n }", "@Before\n public void setup() {\n }", "@Before\n public void setup() {\n }", "@Before\n public void setup() {\n }", "@Before\n public void setup() {\n }", "@Before\n public void postSetUpPerTest(){\n\n }", "@Before\n\tpublic void setup() {\n\t\tinit(rule.getProcessEngine());\n\t}", "@Before\n\tpublic void setup(){\n\t\tuuid = UUID.randomUUID();\n\t\ttitle = \"The Dark Knight\";\n\t\tdescription = \"Nanananana Batmaaaaan!\";\n\t\tstartDate = new Date(2008, 01, 01);\n\t\ttagLabel = \"Test-Tag\"; \n\t}", "@Before public void setUp() { }", "private void initSetUp()\n\t{\n\t\tthis.setActionName(NAME);\n\t\tthis.setDescription(DESCRIPTION);\n\t\tthis.setMagic(IS_MAGIC);\n\t\tthis.setAttack(IS_ATTACK);\n\t\tthis.setTargetSelf(IS_TARGET_SELF);\n\t\tthis.setInternalName(INTERNAL_NAME);\n\t}", "@BeforeEach\n public void setup() {\n }", "@BeforeClass\n\tpublic static void testSetup() {\n\t\t// do something before all tests\n\t}", "@Before\n\t public void setUp() {\n\t }", "@Before\n public void setupTests()\n {\n Service s1 = new Service();\n s1.setCategory(\"HAIR\");\n\n repository.save(s1);\n\n }", "@BeforeClass\n public static void beforeAll() {\n // The logger is shared by everything so this is the right place for it.\n TestSupportLogger.initLogger();\n\n /**\n * The context represents the application environment - should be fine to set up once here.\n * It includes creation and adding (as attributes) other one off objects such as:\n * - SessionFactory\n * - Configuration\n * - GalleryManager\n */\n context = new MockServletContext(TestSupportConstants.contextBaseDirPrefix + TestSupportConstants.contextBaseDir, null);\n String realPath = context.getRealPath(\"/\");\n assertEquals(TestSupportConstants.contextBaseDir, realPath);\n\n factory = TestSupportSessionFactory.getSessionFactory();\n\n context.setAttribute(\"sessionFactory\", factory);\n assertSame(factory, context.getAttribute(\"sessionFactory\"));\n\n configurationManager = new Configuration(factory);\n // Test one configuration value to check this has worked.\n assertTrue(((BlogEnabled) (configurationManager.getConfigurationItem(\"blogEnabled\"))).get());\n\n context.setAttribute(\"configuration\", configurationManager);\n assertSame(configurationManager, context.getAttribute(\"configuration\"));\n\n galleryManager = gallerySetup();\n context.setAttribute(\"Galleries\",galleryManager);\n assertSame(galleryManager, context.getAttribute(\"Galleries\"));\n }", "@BeforeClass\n\tpublic static void setup() {\n\n\t}", "@Before\r\n\t public void setUp(){\n\t }", "protected void runBeforeTest() {}", "@Before public void setUp() {\n }", "@Before public void setUp() {\n }", "@Before public void setUp() {\n }", "@Before public void setUp() {\n }", "@Before public void setUp() {\n }", "@BeforeEach\n\tpublic void setup() {\n\t\tuser= new Utente(\"Nome\",\n\t\t\t\t\"Cognome\",\n\t\t\t\t\"mail\",\n\t\t\t\tLocalDateTime.now(),\n\t\t\t\t\"CodiceFiscale\",\n\t\t\t\t\"Username\", \n\t\t\t\t\"password\");\n\t\tuser_diverso= new Utente(\"Nome\",\n\t\t\t\t\"Cognome\",\n\t\t\t\t\"mail\",\n\t\t\t\tLocalDateTime.now(),\n\t\t\t\t\"CodiceFiscale\",\n\t\t\t\t\"Username_diverso\", \n\t\t\t\t\"password\");\n\t\tuser_uguale= new Utente(\"Nome\",\n\t\t\t\t\"Cognome\",\n\t\t\t\t\"mail\",\n\t\t\t\tLocalDateTime.now(),\n\t\t\t\t\"CodiceFiscale\",\n\t\t\t\t\"Username\", \n\t\t\t\t\"password\");\n\t\t\n\t\tfruitore =new Fruitore(user);\n\t\tfruitore_uguale =new Fruitore(user_uguale);\n\t\tfruitore_diverso =new Fruitore(user_diverso);\n\t}", "@BeforeEach\n void setup() {\n String contentType = getContentType();\n preload(contentType, \"staff\", false);\n }", "@Before\n\tpublic void setUp() throws Exception {\n\t\truntimeConfig = ConfigLoader.load(\n\t\t\t\tnew File(resourcesDir,\n\t\t\t\t\t\t\"benchmark_config_with_ls_specific_settings.conf\").getAbsolutePath());\n\t\t\n\t\tscenario = new Scenario(\"animals\", \"mammal\");\n\t\t\n\t\ttmpDir = Files.createTempDir();\n\t\ttmpDir.mkdirs();\n\t\t\n\t\tfileFinder = new FileFinder(new File(\".\").getAbsolutePath(), scenario);\n\t\t// arbitrarily set to tmpDir\n\t\tfileFinder = fileFinder.updateWorkDir(tmpDir);\n\t\t\n\t\texamples = new PosNegExamples();\n\t\texamples.put(Constants.ExType.POS, Sets.newHashSet(\"one\", \"two\", \"three\"));\n\t\texamples.put(Constants.ExType.NEG, Sets.newHashSet(\"four\", \"five\", \"six\", \"seven\"));\n\t\tlog = new BenchmarkLog();\n\t}", "@BeforeAll\n static void setup() {\n log.info(\"@BeforeAll - executes once before all test methods in this class\");\n }", "@Before\n\tpublic void setup() {\n\t\tdatabase = new DatabaseLogic();\n\t}", "public void setUp() {\n\n\t}", "@BeforeAll\n public static void oneTimeSetUp() {\n numberOfTrees = 100;\n sampleSize = 256;\n dimensions = 3;\n randomSeed = 123;\n\n parallelExecutionForest = RandomCutForest.builder()\n .numberOfTrees(numberOfTrees)\n .sampleSize(sampleSize)\n .dimensions(dimensions)\n .randomSeed(randomSeed)\n .centerOfMassEnabled(true)\n .storeSequenceIndexesEnabled(true)\n .build();\n\n singleThreadedForest = RandomCutForest.builder()\n .numberOfTrees(numberOfTrees)\n .sampleSize(sampleSize)\n .dimensions(dimensions)\n .randomSeed(randomSeed)\n .centerOfMassEnabled(true)\n .storeSequenceIndexesEnabled(true)\n .parallelExecutionEnabled(false)\n .build();\n\n dataSize = 10_000;\n\n baseMu = 0.0;\n baseSigma = 1.0;\n anomalyMu = 5.0;\n anomalySigma = 1.5;\n transitionToAnomalyProbability = 0.01;\n transitionToBaseProbability = 0.4;\n\n NormalMixtureTestData generator = new NormalMixtureTestData(baseMu, baseSigma, anomalyMu, anomalySigma,\n transitionToAnomalyProbability, transitionToBaseProbability);\n double[][] data = generator.generateTestData(dataSize, dimensions);\n\n for (int i = 0; i < dataSize; i++) {\n parallelExecutionForest.update(data[i]);\n singleThreadedForest.update(data[i]);\n }\n }", "@Before\n\tpublic void setupTeste()\n\t{\n\t\tSystem.out.println(\"ESTOU FAZENDO O SETUP\");\n\t}", "protected void setUp() {\n\t}", "@Before\r\n\tpublic void set_up(){\n\t}", "@BeforeEach\n void setup() {\n String contentType = getContentType();\n preload(contentType, \"staff\", true);\n }", "@Before\r\n\tpublic void setUp() {\n\t}", "@Before\n public void setUp() throws Exception {\n coordinateArea Area1 = new coordinateArea(0,150,600,413);\n waterArea waterDeath = new waterArea(Area1);\n coordinateArea Border = new coordinateArea(0,100,600,734);\n animal = new Animal(\"file:src/p4_group_8_repo/Assets/froggerUp.png\",waterDeath,300,679.8,Border);\n }", "@BeforeClass public static void initialiseScenario(){\n SelectionScenario.initialiseScenario();\n }", "@Override\r\n protected void setUp()\r\n {\r\n island = new Island(5,5);\r\n position = new Position(island, 4,4);\r\n seed = new BirdFood(position, \"seed\", \"Crunchy Seeds\", 1.0, 2.0, 1.5);\r\n }", "@BeforeTest\r\n\tpublic void setupenvi() throws IOException {\r\n\t\tsetup();\r\n\t\tinit();\r\n\t}", "@Before\n\tpublic void setUp() {\n\t}", "@BeforeEach\n\tvoid setup(){\n\t}", "@BeforeClass\n public static void setup() {\n System.out.println(\"*** Before Class ***\");\n }", "@Before\n public void setUp() {\n System.out.println(\"\\n@Before - Setting Up Stuffs: Pass \"\n + ++setUpCount);\n // write setup code that must be executed before each test method run\n }", "@BeforeEach\n void setup() {\n String contentType = getContentType();\n preload(contentType, \"staffNS\", true);\n }", "@BeforeMethod\r\n\tpublic void beforeMethod() {\r\n\t\t//initializeTestBaseSetup();\r\n\t}", "@Before\n public void setUp() throws Exception {\n implType = FireHydrantsImplType.BASIC;\n fakeTicker = new FakeTicker();\n TesterPolicy policy = new TesterPolicy.Builder()\n .withNumTestsPerRollingPeriod(10)\n .withRollingPeriodInSecs(1 * 60 * 60)\n .withTimeToCompleteWorkInSecs(5 * 60)\n .withAvgNumOfTests(5)\n .withAvgTimePeriodInSecs(2 * 60 * 60)\n .withTicker(fakeTicker)\n .build();\n List<Tester> testers = new LinkedList<>();\n testers.add(TesterFactory.getTester(policy, implType));\n fireHydrants = FireHydrantsFactory.getFireHydrants(testers, implType);\n }", "@BeforeClass\n\tpublic void beforeTestClass() \n\t{\n\t\tfBase.driver = driver;\n\t\tfBase.testdataHashMap = testdataHashMap;\n\t\tfBase.eTest = eTest;\n\t}", "@BeforeTest\n\tpublic void setUp() {\n\t\tthis.lawn = new Lawn(4, 5);\n\t}", "@BeforeEach\n void setup() {\n String contentType = getContentType();\n preload(contentType, \"hc_staff\", false);\n }", "@BeforeClass\n\tpublic void beforeClass() {\n\t}", "@BeforeClass\n public void setup()\n throws Exception {\n startZk();\n startController();\n startBroker();\n startKafka();\n }", "@Before\n public void setup() {\n super.setup();\n fixture = Fixtures.newGivenWhenThenFixture(projectAggregate.class);\n\n fixture.registerAnnotatedCommandHandler(new projectCommandHandler(fixture.getEventBus(), fixture.getEventStore()));\n }", "@Before\n public void setupEnvironment() {\n TestEnvironment testEnvironment;\n switch (mode) {\n case CLUSTER:\n // This only works because of the quirks we built in the TestEnvironment.\n // We should refactor this in the future!!!\n testEnvironment = MINI_CLUSTER_RESOURCE.getTestEnvironment();\n testEnvironment.getConfig().disableObjectReuse();\n testEnvironment.setAsContext();\n break;\n case CLUSTER_OBJECT_REUSE:\n // This only works because of the quirks we built in the TestEnvironment.\n // We should refactor this in the future!!!\n testEnvironment = MINI_CLUSTER_RESOURCE.getTestEnvironment();\n testEnvironment.getConfig().enableObjectReuse();\n testEnvironment.setAsContext();\n break;\n case COLLECTION:\n new CollectionTestEnvironment().setAsContext();\n break;\n }\n }", "@Before\n\tpublic void setUp() throws Exception {\n\t\tscenario = getTac().useScenario(SimpleStoreScenario.class);\n\t\tcatalogPersister = getTac().getPersistersFactory().getCatalogTestPersister();\n\t\ttaxCode = getTac().getPersistersFactory().getTaxTestPersister().getTaxCode(TaxTestPersister.TAX_CODE_GOODS);\n\t}", "public void setUp() {\n entity = new Entity(BaseCareerSet.FIGHTER);\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n\tpublic void setUp() throws Exception {\n\t\tcatalogTestPersister = persisterFactory.getCatalogTestPersister();\n\t\tsettingsTestPersister = persisterFactory.getSettingsTestPersister();\n\t\ttaxCode = persisterFactory.getTaxTestPersister().getTaxCode(TaxTestPersister.TAX_CODE_GOODS);\n\t}", "@Before\n public void setup() {\n Helpers.fillData();\n }", "@BeforeClass\n\tpublic void setup() {\n\t\tSystem.out.println(\"Before Class Annotation\");\n\t}", "@Before\r\n\tpublic void setup()\r\n\t{\n\t\tgame = factory.makeHantoGame(HantoGameID.EPSILON_HANTO, BLUE);\r\n\t}", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\n public void setup() {\n Assert.assertNotNull(ministerRepository);\n Assert.assertNotNull(territoryRepository);\n }", "@Before\r\n\tpublic void setup() throws Exception {\n\t\tinitializeInMemoryDatabase();\r\n\r\n\t\t// Created from org.openmrs.test.CreateInitialDataSet\r\n\t\t// without line for \"concept_synonym\" table (not exist)\r\n\t\t// using 1.4.4-createdb-from-scratch-with-demo-data.sql\r\n\t\t// Removed all empty short_name=\"\" from concepts\r\n\t\t// Added missing description to relationship_type\r\n\t\t// Removed all patients and related patient/person info (id 2-500)\r\n\t\t// Removed all concepts except those in sqldiff\r\n\t\texecuteDataSet(\"initial-openmrs-dataset.xml\");\r\n\r\n\t\t// Includes Motech data added in sqldiff\r\n\t\texecuteDataSet(\"motech-dataset.xml\");\r\n\t\t\r\n\t\t// Add example Location, Facility and Community\r\n\t\texecuteDataSet(\"facility-community-dataset.xml\");\r\n\r\n\t\tauthenticate();\r\n\r\n\t\tactivator.startup();\r\n\t}", "@Before\n public void setUp() {\n \tserver = super.populateTest();\n }", "@BeforeClass\n public static void beforeClass() {\n }", "@BeforeClass\n\t public void setUp() {\n\t }", "@Override\r\n\tpublic void setUp() {\n\t\t\r\n\t}", "@Before\n public void setUp () {\n }", "@Before\n public void setUp() {\n }", "public void setUp()\r\n {\r\n //empty on purpose\r\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@BeforeClass\n\tpublic static void setup() {\n\t\tgetLogManager().init();\n\t}" ]
[ "0.7248763", "0.72430426", "0.7233797", "0.7204463", "0.7190108", "0.7150675", "0.7150675", "0.7150675", "0.70682645", "0.7028974", "0.69391036", "0.6938692", "0.69087875", "0.6884584", "0.6883129", "0.68758905", "0.6858967", "0.6851903", "0.6849583", "0.6846775", "0.68376064", "0.6808181", "0.6806987", "0.6806987", "0.6806987", "0.6806987", "0.6806987", "0.67879194", "0.676612", "0.6756426", "0.6752136", "0.6745611", "0.67399293", "0.6735976", "0.6723791", "0.6722218", "0.6719251", "0.6719198", "0.6711423", "0.6707971", "0.6701785", "0.66862965", "0.6684015", "0.6682339", "0.6675107", "0.66661024", "0.6665854", "0.6659926", "0.6636607", "0.6635089", "0.6630976", "0.662429", "0.66237044", "0.66227466", "0.6620876", "0.6615872", "0.6612114", "0.66040206", "0.6594185", "0.65837485", "0.65837485", "0.65837485", "0.65837485", "0.65837485", "0.6580772", "0.6580687", "0.65806365", "0.6572189", "0.65682423", "0.65682423", "0.65682423", "0.65682423", "0.65667176", "0.6558064", "0.65571195", "0.6548896", "0.6544492", "0.6540907", "0.65405357", "0.6536601", "0.65317535", "0.6530212", "0.6530212", "0.6530212", "0.6530212", "0.6530212", "0.6530212", "0.6530212", "0.6530212", "0.6530212", "0.6530212", "0.6530212", "0.6530212", "0.6530212", "0.6530212", "0.6530212", "0.6530212", "0.6530212", "0.6530212", "0.65176743" ]
0.77657276
0
Confirm that MoveTo for Animal only moves animals to Forests.
@Test public final void testMoveTo() { Room testRoom = new Room("247", 2, "Computer Lab"); animal.moveTo(testForest); assertEquals("Move To Forest", animal.location(), testForest); animal.moveTo(testRoom); assertEquals("Move To Room", animal.location(), testForest); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract boolean canMoveTo(Case Location);", "@Test\n public void isMoveActionLegalFor()\n {\n // Setup.\n final CheckersGameInjector injector = new CheckersGameInjector();\n final List<Agent> agents = createAgents(injector);\n final CheckersEnvironment environment = createEnvironment(injector, agents);\n final CheckersAdjudicator adjudicator = injector.injectAdjudicator();\n\n // Agent white can move his token to an adjacent empty space.\n assertTrue(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P09,\n CheckersPosition.P13));\n\n // Agent white cannot move backwards.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P09,\n CheckersPosition.P05));\n\n // Agent white cannot move to an occupied space.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P04,\n CheckersPosition.P08));\n\n // Agent white cannot move a red token.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P21,\n CheckersPosition.P17));\n\n // Agent white cannot move too far.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P09,\n CheckersPosition.P18));\n }", "public boolean canMove(Actor actor)\n\t {\n\t \t//PO: updated the methods after the move from the Bug Class to be called from\n\t \t//PO: the passed actor\n\t Grid<Actor> gr = actor.getGrid();\n\t if (gr == null)\n\t return false;\n\t Location loc = actor.getLocation();\n\t Location next = loc.getAdjacentLocation(actor.getDirection());\n\t if (!gr.isValid(next))\n\t return false;\n\t Actor neighbor = gr.get(next);\n\t return (neighbor == null) || (neighbor instanceof Flower);\n\t // ok to move into empty location or onto flower\n\t // not ok to move onto any other actor\n\t \n\t }", "public boolean canIMoveTo(Field moveTo)\n {\n if(!canIMoveBasic(whereAmI, moveTo))\n {\n return false;\n }\n Field.Direction direction = this.whereAmI.getDirection(moveTo);\n Field neighborInDirection = this.whereAmI.nextField(direction);\n while (neighborInDirection != moveTo)\n {\n if(!neighborInDirection.isEmpty())\n return false;\n neighborInDirection = neighborInDirection.nextField(direction);\n }\n return true;\n }", "public abstract boolean canMove(Board board, Spot from, Spot to);", "@Override\n\tpublic void moveForward() {\n\t\tSystem.out.println(\"Animal moved foreward\");\n\t}", "@Test\n public void testMove() {\n System.out.println(\"Animal.move\");\n animal1.move(101);\n animal2.move(202);\n assertEquals(101, animal1.getLocation());\n assertEquals(202, animal2.getLocation());\n }", "@Override\n\tpublic int moveAnimal() {\n\t\treturn 0;\n\t}", "public boolean moveTo(Object target);", "public boolean move(Pole fromPole, Pole toPole)\n\t{\n\t\t// Make sure the poles are valid\n\t\tif(fromPole == null || toPole == null)\n\t\t{\n\t\t\tprintIllegalMove(fromPole, toPole);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Get the disc to move\n\t\tDisc disc = fromPole.top();\n\n\t\t// If disc is null, then the pole was empty\n\t\tif(disc == null)\n\t\t{\n\t\t\tprintIllegalMove(fromPole, toPole);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Make sure the to pole has a disc that's larger than the disc to move\n\t\tDisc toDisc = toPole.top();\n\t\tif(toDisc != null && toDisc.getSize() < disc.getSize())\n\t\t{\n\t\t\tprintIllegalMove(fromPole, toPole);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Remove the disc from the from pole\n\t\tfromPole.pop();\n\n\t\t// Add the disc to the new pole\n\t\ttoPole.push(disc);\n\n\t\treturn true;\n\t}", "public abstract boolean changeMove();", "@Test\n public void moreThanOneCheckerOnToLocation() {\n\n assertTrue(game.move(Location.R1, Location.R2));\n assertTrue(game.move(Location.R1, Location.R3));\n game.nextTurn();\n // to der gerne skulle vaere lovlige og stemme med terningerne\n assertTrue(game.move(Location.R6, Location.R5));\n assertTrue(game.move(Location.R8, Location.R6));\n game.nextTurn();\n assertTrue(game.move(Location.R2, Location.R5));\n assertTrue(game.move(Location.R3, Location.R7));\n game.nextTurn();\n // der staar nu to sorte paa R4\n assertFalse(game.move(Location.R6, Location.R3));\n }", "public abstract boolean canMove();", "public void moveAnimal(AnimalSol animal, String from, String to) {\n removeAnimal(animal);\n placeAnimal(animal, to);\n }", "public void moveNoFormationTo(double xGoal, double yGoal, double angleGoal) {\n\n // Set the goals\n goalX = xGoal;\n goalY = yGoal;\n goalAngle = angleGoal;\n\n // Convert angle to unit vector\n double downUnitX = MathUtils.quickCos((float) (angleGoal + Math.PI));\n double downUnitY = MathUtils.quickSin((float) (angleGoal + Math.PI));\n double sideUnitX = MathUtils.quickCos((float) (angleGoal + Math.PI / 2));\n double sideUnitY = MathUtils.quickSin((float) (angleGoal + Math.PI / 2));\n\n // Sort distances of each soldier to the final point\n for (BaseSingle single : troops) {\n single.setTempSquaredDistanceFromGoal((single.getX() - xGoal) * (single.getX() - xGoal) +\n (single.getY() - yGoal) * (single.getY() - yGoal));\n }\n\n // Sort the troops by distance to the goal\n Collections.sort(troops, new Comparator<BaseSingle>() {\n @Override\n public int compare(BaseSingle o1, BaseSingle o2) {\n return Double.compare(o1.getTempSquaredDistanceFromGoal(), o2.getTempSquaredDistanceFromGoal());\n }\n });\n\n // Calculate final positions\n for (int i = 0; i < troops.size(); i++) {\n double xGoalSingle = goalX + (i % width) * unitStats.spacing * sideUnitX + (i / width) * unitStats.spacing * downUnitX;\n double yGoalSingle = goalY + (i % width) * unitStats.spacing * sideUnitY + (i / width) * unitStats.spacing * downUnitY;\n\n // Set the goal and change the state\n BaseSingle troop = troops.get(i);\n troop.setxGoal(xGoalSingle);\n troop.setyGoal(yGoalSingle);\n troop.switchState(SingleState.MOVING);\n troop.setSpeedGoal(troops.get(i).getSpeedStat());\n troop.setAngleGoal(angleGoal);\n troop.setDecisionDelay(MathUtils.randint(2, 20));\n }\n\n // Reset the flankers\n resetFlanker();\n }", "protected void move()\n {\n // Find a location to move to.\n Debug.print(\"Fish \" + toString() + \" attempting to move. \");\n Location nextLoc = nextLocation();\n\n // If the next location is different, move there.\n if ( ! nextLoc.equals(location()) )\n {\n // Move to new location.\n Location oldLoc = location();\n changeLocation(nextLoc);\n\n // Update direction in case fish had to turn to move.\n Direction newDir = environment().getDirection(oldLoc, nextLoc);\n changeDirection(newDir);\n Debug.println(\" Moves to \" + location() + direction());\n }\n else\n Debug.println(\" Does not move.\");\n }", "@Override\n public void action(){\n\n Position move=this.findWeed();\n if(move.getX()==0 && move.getY()==0){\n super.action();\n }\n else{\n System.out.println(this.getClass().getSimpleName());\n int actualX = this.position.getX();\n int actualY = this.position.getY();\n int xAction = actualX+move.getX();\n int yAction = actualY+move.getY();\n Organism tmpOrganism = this.WORLD.getOrganism(xAction, yAction);\n if(tmpOrganism==null){\n this.move(move.getX(), move.getY());\n this.WORLD.erasePosition(actualX,actualY);\n }\n else{\n tmpOrganism.collision(this, actualX, actualY, move);\n }\n }\n }", "@Test\n void checkDoMove() {\n abilities.doMove(turn, board.getCellFromCoords(1, 1));\n assertEquals(turn.getWorker().getCell(), board.getCellFromCoords(1, 1));\n Worker forcedWorker = turn.getWorker();\n for (Worker other : turn.getOtherWorkers()) {\n if (other.getCell() == board.getCellFromCoords(2, 2)) {\n forcedWorker = other;\n }\n }\n\n assertEquals(forcedWorker.getCell(), board.getCellFromCoords(2, 2));\n\n // Can't move anymore after having already moved\n assertFalse(abilities.checkCanMove(turn, board.getCellFromCoords(0, 0)));\n }", "public void move(){\n System.out.println(\"I can't move...\");\n }", "@Test\n public void canMoveTest() {\n assertTrue(cp1.canMove(5, 3));\n assertTrue(cp1.canMove(1, 5));\n assertTrue(cp2.canMove(4, 6));\n assertTrue(cp2.canMove(6, 5));\n\n assertFalse(cp1.canMove(0, 5));\n assertFalse(cp1.canMove(3, 4));\n assertFalse(cp2.canMove(2, 6));\n assertFalse(cp2.canMove(7, 4));\n }", "public abstract boolean attemptMove(Player currentPlayerObj, Coordinate move);", "public void toMoving() {\n notifyStartMoving(this.getCurrentTurn().getCurrentPlayer().getNickname());\n if (getCurrentTurn().getCurrentPlayer().isHasSpecialMove()) {\n notifyAskForEffect(currentTurn.getCurrentPlayer().getNickname());\n } else {\n notifyChooseWorker(this.getCurrentTurn().getCurrentPlayer().getNickname(), board);\n }\n }", "@Override\n\tpublic void move() {\n\t\tSystem.out.println(\"Can Move\");\n\t}", "boolean canMoveTo(Vector2d position);", "public boolean canMove ( Animal animal, int direction ) {\n\t\tint row = animal.getRow() + rowChange(direction);\n\t\tint col = animal.getColumn() + colChange(direction);\n\n\t\treturn (0 <= row && 0 <= col && row < numrows_ && col < numcols_ && field_[row][col] == null);\n\t}", "@Test(expected = IllegalArgumentException.class)\n public void testCantMoveSameShapeInOverlappingTime() {\n model1.addShape(Rectangle.createRectangle(\"R\", new Point.Double(500, 200),\n new Color(0, 0, 0), 0, 10, 10, 10));\n model1.addAction(new MoveAction(\"R\", 0, 100, new Point.Double(500, 200),\n new Point.Double(10, 10)));\n model1.addAction(new MoveAction(\"R\", 50, 150,\n new Point.Double(500, 200), new Point.Double(10, 10)));\n }", "public abstract boolean canMove(int originX, int originY, int destX, int destY);", "@Test\n\tpublic final void testEat() {\n\t\tFood testFood = new Food(\"White Bread\", \"Yeast Bread\", \n\t\t\t\t\"Pams Toast sliced\", false);\n\t\t\n\t\ttestForest.addThing(testFood);\n\t\tassertTrue(\"Food in Forest\", \n\t\t\t\ttestForest.contents().contains(testFood));\n\t\t\n\t\tanimal.moveTo(testForest);\n\t\t\n\t\tanimal.eat(testFood);\n\t\tassertFalse(\"Food consumed\", \n\t\t\t\ttestForest.contents().contains(testFood));\n\t}", "public boolean move();", "public void InvalidMove();", "public MoveResult canMovePiece(Alignment player, Coordinate from, Coordinate to);", "public void attemptMove(BoardPos to) {\n if (legalPos.contains(to)) {\n lastColor = !lastColor; // next turn\n // move striking piece to the end position\n board.set(to, board.get(legalPos.get(legalPos.indexOf(to)).getRouteLast()));\n // clear positions \"en route\" - pieces to strike and the initial position\n for (BoardPos step : legalPos.get(legalPos.indexOf(to)).getRoute())\n board.get(step).setEmpty();\n // promote qualifying pieces to crown\n findCrown();\n }\n\n legalPos.clear(); // next turn - no highlights\n }", "protected boolean shouldMoveTo(World worldIn, BlockPos pos) {\n Block block = worldIn.getBlockState(pos).getBlock();\n\n if (block == Blocks.FARMLAND) {\n pos = pos.up();\n IBlockState iblockstate = worldIn.getBlockState(pos);\n block = iblockstate.getBlock();\n\n if (block instanceof BlockCropPinto && ((BlockCropPinto) block).isMaxAge(iblockstate) && this.wantsToReapStuff && (this.currentTask == 0 || this.currentTask < 0)) {\n this.currentTask = 0;\n return true;\n }\n\n if (iblockstate.getMaterial() == Material.AIR && this.hasFarmItem && (this.currentTask == 1 || this.currentTask < 0)) {\n this.currentTask = 1;\n return true;\n }\n }\n return false;\n }", "public boolean allowMove(Point p, int pos);", "abstract void move();", "private void moveForwards() {\n\t\tposition = MoveAlgorithmExecutor.getAlgorithmFromCondition(orientation).execute(position);\n\t\t\n\t\t// Extracted the condition to check if tractor is in Ditch\n\t\tif(isTractorInDitch()){\n\t\t\tthrow new TractorInDitchException();\n\t\t}\n\t}", "@Override\r\n\tpublic boolean canMove() {\r\n\t\treturn false;\r\n\t}", "public abstract boolean validMove(ChessBoard board, Square from, Square to);", "public boolean moveCard(AbstractCard card, CardCollection moveLocation);", "public abstract void showBadMoveAlert(GameStateInterface state, Move mv);", "@Override\n\tpublic boolean moveTo() {\n\t\treturn true;\n\t}", "public abstract void Move();", "public void AIMakeMove() {\n\t\t\n\t\tRandom randomizer = new Random();\n\t\tint index = randomizer.nextInt(AIPossibleMoves.size());\n\t\tMove move = AIPossibleMoves.get(index);\n\t\tChecker checker = model.findChecker(move.getxOrigin(), move.getyOrigin());\n\t\tint xChange = (move.getxOrigin() - move.getxMove());\n\t\tint yChange = (move.getyOrigin() - move.getyMove());\n\t\t\n\t\tint xMoveNew = 0;\n\t\tint yMoveNew = 0;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tif(board.getBoard()[move.getyMove()][move.getxMove()] == 0) {\n\t\t\t//do nothing\n\t\t} else {\n\t\t\t//moving down\n\t\t\tif(yChange < 0) {\n\t\t\t\t//moving right\n\t\t\t\tif(xChange < 0) {\n\t\t\t\t\tremoveTakenPiece(move.getxMove(), move.getyMove());\n\t\t\t\t\txMoveNew = move.getxMove() + 1;\n\t\t\t\t\tyMoveNew = move.getyMove() + 1;\n\t\t\t\t\tmove.setxMove(xMoveNew);\n\t\t\t\t\tmove.setyMove(yMoveNew);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t//moving left\n\t\t\t\t\t\n\t\t\t\t\tremoveTakenPiece(move.getxMove(), move.getyMove());\n\t\t\t\t\txMoveNew = move.getxMove() - 1;\n\t\t\t\t\tyMoveNew = move.getyMove() + 1;\n\t\t\t\t\tmove.setxMove(xMoveNew);\n\t\t\t\t\tmove.setyMove(yMoveNew);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//moving up\n\t\t\t\tif(xChange < 0) {\n\t\t\t\t\t//moving right\n\t\t\t\t\tremoveTakenPiece(move.getxMove(), move.getyMove());\n\t\t\t\t\txMoveNew = move.getxMove() + 1;\n\t\t\t\t\tyMoveNew = move.getyMove() - 1;\n\t\t\t\t\tmove.setxMove(xMoveNew);\n\t\t\t\t\tmove.setyMove(yMoveNew);\n\t\t\t\t} else {\n\t\t\t\t\t//moving left \n\t\t\t\t\tremoveTakenPiece(move.getxMove(), move.getyMove());\n\t\t\t\t\txMoveNew = move.getxMove() - 1;\n\t\t\t\t\tyMoveNew = move.getyMove() - 1;\n\t\t\t\t\tmove.setxMove(xMoveNew);\n\t\t\t\t\tmove.setyMove(yMoveNew);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t//System.out.println(\"New Move is: \" + xMoveNew + \",\" + yMoveNew);\n\t\tif(canBeKing(checker, move)) {\n\t\t\tchecker = convertToKing(checker, move);\n\t\t\tmodel.updateChecker(move, checker, 2);\n\t\t\t\n\t\t\tprintBoard();\n\t\t\tmodel.moves.add(move);\n\t\t\treturn;\n\t\t}\n\t\tmodel.updateChecker(move, checker, 2);\n\t//\tSystem.out.println(\"AI - DEBUGGING\");\n\t//\tSystem.out.println(\"Origin Piece: \" + move.getxOrigin() + \",\" + move.getyOrigin());\n\t//\tSystem.out.println(\"Move Position: \" + move.getxMove() + \",\" + move.getyMove());\n\t\tupdateBoard(move);\n\t\tmodel.moves.add(move);\n\t\tprintBoard();\n\t\t\n\t}", "@Override\r\n public int move(Field f) throws CannotPerformAction {\r\n\r\n if(field.hasNeighbour(f)){\r\n this.replace(f);\r\n return 1;\r\n }\r\n\r\n if(this.field.hasStation() && f.hasStation()){\r\n this.replace(f);\r\n return 1;\r\n }\r\n\r\n if(field.hasStation()){\r\n if(hand.getCards().size() > 1) throw new AmbigousAction(\"Choose the card you'd like to discard\");\r\n hand.drop(hand.getCards().get(0));\r\n replace(f);\r\n return 1;\r\n }\r\n\r\n Card c1 = hand.hasCard(this.field);\r\n Card c2 = hand.hasCard(f);\r\n\r\n if(c1 != null && c2 != null) throw new AmbigousAction(\"You can take either private or public plane\");\r\n\r\n if(c1 != null) {\r\n replace(f);\r\n hand.drop(c1);\r\n return 1;\r\n }\r\n\r\n if(c2 != null){\r\n replace(f);\r\n hand.drop(c2);\r\n return 1;\r\n }\r\n throw new CannotPerformAction(\"You are not available to move to \" + f.getName());\r\n }", "@Test\n public void isJumpActionLegalFor()\n {\n // Setup.\n final CheckersGameInjector injector = new CheckersGameInjector();\n final List<Agent> agents = createAgents(injector);\n final Agent agentRed = agents.get(0);\n final Agent agentWhite = agents.get(1);\n final CheckersEnvironment environment = createEnvironment(injector, agents);\n {\n final CheckersMoveAction action = new CheckersMoveAction(environment, agentRed, CheckersPosition.P21,\n CheckersPosition.P17);\n action.doIt();\n }\n {\n final CheckersMoveAction action = new CheckersMoveAction(environment, agentWhite, CheckersPosition.P09,\n CheckersPosition.P14);\n action.doIt();\n }\n {\n final CheckersMoveAction action = new CheckersMoveAction(environment, agentRed, CheckersPosition.P22,\n CheckersPosition.P18);\n action.doIt();\n }\n final CheckersAdjudicator adjudicator = injector.injectAdjudicator();\n\n // Agent white can jump his token over a red token to an empty space.\n assertTrue(adjudicator.isJumpActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P14,\n CheckersPosition.P21));\n\n // Agent white cannot jump his token to an occupied space.\n assertFalse(adjudicator.isJumpActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P14,\n CheckersPosition.P23));\n\n // Agent white cannot jump his token to an adjacent empty space.\n assertFalse(adjudicator.isJumpActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P10,\n CheckersPosition.P15));\n\n // Agent white cannot jump his own token.\n assertFalse(adjudicator.isJumpActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P08,\n CheckersPosition.P15));\n }", "public boolean canMove2() {\n\t\tGrid<Actor> gr = getGrid(); \n\t\tif (gr == null) {\n\t\t\treturn false; \n\t\t}\n\t\t\n\t\tLocation loc = getLocation(); \n\t\tLocation next = loc.getAdjacentLocation(getDirection());\n\t\tLocation next2 = next.getAdjacentLocation(getDirection());\n\t\tif (!gr.isValid(next)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!gr.isValid(next2)) {\n\t\t\treturn false;\n\t\t}\n\t\tActor neighbor = gr.get(next2); \n\t\treturn (neighbor == null) || (neighbor instanceof Flower); \n\t}", "public static boolean move() {\n S.rc.setIndicatorString(2, \"move\");\n if (target == null) {\n System.err.println(\"ERROR: tried to move without target\");\n return false;\n }\n\n // Check if we are close enough.\n int distanceSqToTarget = S.rc.getLocation().distanceSquaredTo(target);\n if (distanceSqToTarget <= thresholdDistanceSq) {\n // Stop bugging.\n start = null;\n S.rc.setIndicatorString(2, \"close enough\");\n return moveCloserToTarget();\n }\n\n if (start == null) {\n // Not currently bugging.\n forward = S.rc.getLocation().directionTo(target);\n S.rc.setIndicatorString(2, \"not buggin\");\n if (moveForwardish()) return true;\n // Start bugging.\n start = S.rc.getLocation();\n forward = forward.rotateRight().rotateRight();\n return move();\n } else {\n // Already bugging.\n // Stop bugging if we got closer to the target than when we started bugging.\n if (distanceSqToTarget < start.distanceSquaredTo(target)) {\n start = null;\n return move();\n }\n\n // Stop bugging if back-left is clear.\n // This means that we must have bugged around something that has since moved.\n if (canMove(forward.rotateLeft().rotateLeft().rotateLeft())) {\n start = null;\n forward = S.rc.getLocation().directionTo(target);\n S.rc.setIndicatorString(2, \"back left clear, forward \" + forward);\n return moveForwardish();\n }\n\n S.rc.setIndicatorString(2, \"scan circle\");\n forward = forward.rotateLeft().rotateLeft();\n // Try moving left, and try every direction in a circle from there.\n for (int i = 0; i < 8; i++) {\n if (moveForwardStrict()) return true;\n forward = forward.rotateRight();\n }\n return false;\n }\n }", "public abstract void makeBestMove();", "private Direction moveToGoal() throws GameActionException {\n Direction toGoal = location.directionTo(goal);\n if (rc.canMove(toGoal)) {\n return toGoal;\n } else {\n return getHandOnWall();\n }\n }", "private boolean canDropOrganiserObject(IOrganiserObject object, TreeItem targetTreeItem) {\n if(targetTreeItem == null) { // Root tree\n return true;\n }\n \n if(object == targetTreeItem.getData()) { // Cannot drop onto itself\n return false;\n }\n \n // If moving a folder check that target folder is not a descendant of the source folder\n if(object instanceof IOrganiserFolder) {\n while((targetTreeItem = targetTreeItem.getParentItem()) != null) {\n if(targetTreeItem.getData() == object) {\n return false;\n }\n }\n }\n \n return true;\n }", "public boolean move(Case from, Case to)\n {\n if (to.getValue() == 0 && from.getValue() != 0)\n {\n to.setValue(to.getValue()+from.getValue());\n from.setValue(0);\n return true;\n }\n return false;\n }", "public abstract void move();", "public abstract void move();", "public abstract void move();", "public abstract void move();", "public abstract void move();", "public abstract void move();", "public abstract void move();", "boolean makeMove();", "private boolean checkMoveOthers(Pieces piece, Coordinates from, Coordinates to) {\n\t\t\t\t\n\t\t/* \n\t\t *il pedone: \n\t\t * -può andare dritto sse davanti a se non ha pedine\n\t\t * -può andare obliquo sse in quelle posizioni ha una pedina avversaria da mangiare\n\t\t * \n\t\t */\n\t\tif (piece instanceof Pawn) {\n\t\t\tif (from.getY() == to.getY()) {\n\t\t\t\tif(chessboard.at(to) == null)\n\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(chessboard.at(to) == null) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//il cavallo salta le pedine nel mezzo\n\t\tif (piece instanceof Knight)\n\t\t\treturn true;\n\t\t\n\t\t//Oltre non andranno il: cavallo, il re ed il pedone.\n\t\t/*\n\t\t *Calcolo le posizioni che intercorrono tra il from ed il to escluse \n\t\t *ed per ogni posizione verifico se è vuota\n\t\t *-se in almeno una posizione c'è una pedina(non importa il colore), la mossa non è valida\n\t\t *-altrimenti, la strada è spianata quindi posso effettuare lo spostamento \n\t\t */\n\t\tArrayList<Coordinates> path = piece.getPath(from, to);\n\t\tfor (Coordinates coordinate : path) {\n\t\t\tif ( chessboard.at(coordinate) != null ){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public void tryMove() {\n if(!currentPlayer.getHasPlayed()){\n if (!currentPlayer.isEmployed()) {\n String destStr = chooseNeighbor();\n\n currentPlayer.moveTo(destStr, getBoardSet(destStr));\n if(currentPlayer.getLocation().getFlipStage() == 0){\n currentPlayer.getLocation().flipSet();\n }\n refreshPlayerPanel();\n }\n else {\n view.showPopUp(currentPlayer.isComputer(), \"Since you are employed in a role, you cannot move but you can act or rehearse if you have not already\");\n }\n }\n else{ \n view.showPopUp(currentPlayer.isComputer(), \"You've already moved, rehearsed or acted this turn. Try a different command or click `end turn` to end turn your turn.\");\n }\n view.updateSidePanel(playerArray);\n }", "@Test\n\tvoid testRobotReturnToOrigin() {\n\t\t// Test for RobotReturnToOrigin\n\t\tassertTrue(new RobotReturnToOrigin().judgeCircle(\"UD\"));\n\t\tassertFalse(new RobotReturnToOrigin().judgeCircle(\"LL\"));\n\n\t\t// Test for RobotReturnToOrigin2\n\t\tassertTrue(new RobotReturnToOrigin2().judgeCircle(\"UD\"));\n\t\tassertFalse(new RobotReturnToOrigin2().judgeCircle(\"LL\"));\n\t}", "public boolean canMove() {\n\n\tArrayList<Location> moveLocs = getValid(getLocation());\n\n\tif (isEnd == true) {\n\t return false;\n\t} \n\tif (!moveLocs.isEmpty()) {\n\t \n\t randomSelect(moveLocs);\n\t // selectMoveLocation(moveLocs);\n\t return true;\n\n\t} else {\n\t return false;\n\t}\n }", "@SuppressWarnings(\"ConstantConditions\")\n private void moveToFoodSource() throws AntArtException {\n AntArea.Cell forward = getCellInDirection(directionVector);\n AntArea.Cell left = getCellInDirection(AntDirections.moveCounterClockwise(directionVector));\n AntArea.Cell right = getCellInDirection(AntDirections.moveClockWise(directionVector));\n\n //Try to move to a food cell.\n List<AntArea.Cell> cellList = Arrays.asList(forward, left, right);\n if (moveToFoodCell(cellList)) {\n return;\n }\n //Sort according to food pheromone levels\n cellList.sort((o1, o2) -> {\n float fp1 = o1.getFoodPheromone();\n float fp2 = o2.getFoodPheromone();\n if (fp1 == fp2) {\n return 0;\n }\n return fp1 > fp2 ? -1 : 1;\n });\n //Do a random action based on a probability\n if (random.nextInt(Configuration.ANT_SELECTION_SEED) == 0) {\n Collections.shuffle(cellList);\n }\n //Try to move to a cell\n for (AntArea.Cell cell : cellList) {\n if (moveTo(cell)) {\n break;\n }\n }\n }", "@Test\r\n public void should_not_be_allowed_to_move_in_wrong_direction() {\r\n game.nextTurn(); // will throw [1,2] and thus black starts\r\n assertFalse(game.move(Location.R12, Location.R10));\r\n }", "private boolean tryMove(Shape newPiece, int newX, int newY) {\n for (int i = 0; i < 4; ++i) {\n\n int x = newX + newPiece.x(i);\n int y = newY - newPiece.y(i);\n//if a piece reaches the edge it stops\n if (x < 0 || x >= BOARD_WIDTH || y < 0 || y >= BOARD_HEIGHT) {\n return false;\n }\n//if a piece is adjacent to any fallen tetris pieces it stops\n if (shapeAt(x, y) != Tetrominoe.NoShape) {\n return false;\n }\n }\n\n curPiece = newPiece;\n curX = newX;\n curY = newY;\n\n repaint();\n\n return true;\n }", "boolean doMove();", "private String easyMove() {\n int randomHole = evaluate();\n while (!isValidMove(randomHole)) {\n randomHole = evaluate();\n }\n\n return super.makeAMove(randomHole);\n }", "protected boolean shouldMoveTo(World worldIn, BlockPos pos)\n {\n Block block = worldIn.getBlockState(pos).getBlock();\n\n if (block == Blocks.FARMLAND)\n {\n pos = pos.up();\n IBlockState iblockstate = worldIn.getBlockState(pos);\n block = iblockstate.getBlock();\n\n if (block instanceof BlockCrops && this.wantsToReapStuff && (this.currentTask == 0 || this.currentTask < 0))\n {\n this.currentTask = 0;\n return true;\n }\n\n }\n\n return false;\n }", "@Test\n public void moveLocationTest()\n {\n boolean res1 = _city.moveLocation(1);\n boolean res2 = _city.moveLocation(3);\n assertTrue(res1);\n assertFalse(res2);\n }", "public boolean attemptMove(MapPanel caller) {\n\t\tGameState status = caller.getGameStatus();\n\t\tif(activePath == null || activePath.size() == 0) {\n\t\t\tlog.log(\"Move not attempted.\");\n\t\t\treturn false;\n\t\t}\n\t\telse if(status == GameState.PLAYER_CONFIRMING_ATTACK) {\n\t\t\treturn attemptAttack(caller, s.getSelected());\n\t\t}\n\t\telse if(status == GameState.PLAYER_CONFIRMING_MOVE) {\n\t\t\tmakeMove(caller);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean moveUnit(Position from, Position to);", "public boolean moveOn() {\n\t\t\n\t}", "private boolean checkTransitionToShooting() {\n if (mOperatorInterface.getShoot() /* && (!mStorage.isEmpty()) && result.HasResult*/) {\n mRobotLogger.log(\"Changing to shoot because our driver said so...\");\n switch (mState) {\n\n /** Disables intake if transitioning from intake */\n case INTAKE:\n mIntake.stop();\n mStorage.stop();\n mIntakeState = IntakeState.IDLE;\n break;\n default:\n break;\n }\n mState = State.SHOOTING;\n\n /** Sets the shooting state to preparing if it's not already */\n if (mShootingState == ShootingState.IDLE) {\n mShootingState = ShootingState.PREPARE_TO_SHOOT;\n }\n return true;\n } else {\n // mRobotLogger.info(\"Could not shoot because \" + (!mStorage.isEmpty()) + \" \" +\n // mOperatorInterface.getShoot());\n return false;\n }\n }", "public FarmerMover() {\n //super.addMove(goesAlone, s -> tryAlone(s));\n super.addMove(goesAlone, new UnaryOperator<State>() {\n @Override\n public State apply(State state) {\n return tryAlone(state);\n }\n });\n //super.addMove(takesWolf, s -> tryWolf(s));\n super.addMove(takesWolf, new UnaryOperator<State>() {\n @Override\n public State apply(State state) {\n return tryWolf(state);\n }\n });\n //super.addMove(takesGoat, s -> tryGoat(s));\n super.addMove(takesGoat, new UnaryOperator<State>() {\n @Override\n public State apply(State state) {\n return tryGoat(state);\n }\n });\n //super.addMove(takesCabbage, s -> tryCabbage(s));\n super.addMove(takesCabbage, new UnaryOperator<State>() {\n @Override\n public State apply(State state) {\n return tryCabbage(state);\n }\n });\n // super.addMove(takesGorilla, s-> takesGorilla(null));\n }", "private boolean moveEats(Point orig, Point dest){\r\n int mLength = Math.abs(orig.getSecond() - dest.getSecond());\r\n Point mid = getPieceToEat(orig,dest);\r\n return (mLength == 2) && ((isRed(orig) && isBlack(mid)) || \r\n (isBlack(orig) && isRed(mid))) && isEmpty(dest);\r\n }", "public boolean validMove(TileEnum from, TileEnum to) {\n if (!isMyTurn() || hasMoved()\n || (getMyPlayerNumber() == 1 && TileStateEnum.PLAYERONE != getTileState(from))\n || (getMyPlayerNumber() == 2 && TileStateEnum.PLAYERTWO != getTileState(from)))\n return false;\n\n List<TileEnum> fromNeighbors = getNeighborsOf(from);\n for (TileEnum otherTile : fromNeighbors) {\n if (to.equals(otherTile)) return TileStateEnum.FREE.equals(getTileState(otherTile));\n\n List<TileEnum> otherNeighbors = getNeighborsOf(otherTile);\n for (TileEnum anotherTile : otherNeighbors) {\n if (to.equals(anotherTile)) return TileStateEnum.FREE.equals(getTileState(anotherTile));\n }\n }\n return false;\n }", "boolean testMoveAllShips(Tester t) {\n return t.checkExpect(this.los3.moveAll(), new ConsLoGamePiece(\n new Ship(10, Color.CYAN, new MyPosn(51, 50), this.p6),\n new ConsLoGamePiece(new Ship(10, Color.CYAN, new MyPosn(51, 50), this.p6),\n new ConsLoGamePiece(new Ship(10, Color.CYAN, new MyPosn(50, 200), this.p3), this.mt))))\n && t.checkExpect(this.mt.moveAll(), this.mt);\n }", "public static void anyMoveTest() {\n\t\tOthelloBoard Board = new OthelloBoard(BOARD_SIZE,BOARD_SIZE);\n \tBoard.setBoard();\n\t\tBoard.decPieceCount();\n \tSystem.out.println(Board.getPieceCount());\t\n\t\tSystem.out.println(Board.move(\n\t\tTEST_MOVE_X1, TEST_MOVE_Y1, Board.WHITE_PIECE));\n\t\tBoard.m_Pieces[TEST_PIECE_X][TEST_PIECE_Y]=Board.WHITE_PIECE;\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.println(\"\");\n\t\tBoard.checkWin();\n\t\tSystem.out.println(\"Valid inputs\");\n\t\tSystem.out.println(\"OthelloBoard.anyMove() - Begin\");\n\t\tSystem.out.println(\"Expected output: false\");\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.println(\"Actual output: \" \n\t\t+ Board.anyMove(\n\t\t\t\tOUTPUT_ANYMOVE_TEST_X,OUTPUT_ANYMOVE_TEST_Y,Board.BLACK_PIECE));\n\t\tSystem.out.println(\"\");\n\t}", "public void action() throws Exception {\n // Cop move to another place\n move();\n\n // Search for agents nearby\n ArrayList<Position> occupiedNeighbor = this.getPosition().getOccupiedNeighborhood();\n ArrayList<Agent> arrestList = new ArrayList<>();\n for (Position neighbor : occupiedNeighbor) {\n Person person = neighbor.getOccupiedPerson();\n String className = person.getClass().getName();\n // if this is a agent and is active\n if (className.equals(Person.AGENT)) {\n if (((Agent) person).isActive()) {\n arrestList.add((Agent) person);\n }\n }\n }\n\n // If there at least one agent nearby\n if (0 != arrestList.size()) {\n // Randomly pick active agent to jail\n Random random = new Random();\n int maxIndex = arrestList.size();\n int randomIndex = random.nextInt(maxIndex);\n Agent arrestAgent = arrestList.get(randomIndex);\n int jailTerm = random.nextInt(getPersonEnvironment().getMaxJailTerm());\n arrestAgent.beArrested(jailTerm, this);\n }\n }", "public void moveFormationKeptTo(double xGoal, double yGoal, double angleGoal) {\n\n // Do not do anything if the intended goal bounding box overlaps with the current unit position. It does not\n // make sense.\n // TODO: Extremely ugly boundingBox code that currently only uses for drawing. This bounding box array should\n // currently is used for both drawing and collision checking. Separate these two bounding box for different\n // purpose.\n double[][] aliveBoundingBox = new double[][] {\n {boundingBox[0][0], boundingBox[0][1]},\n {boundingBox[1][0], boundingBox[1][1]},\n {boundingBox[2][0], boundingBox[2][1]},\n {boundingBox[3][0], boundingBox[3][1]},\n };\n if (PhysicUtils.checkPolygonPolygonCollision(aliveBoundingBox, getBoundingBoxAtPos(xGoal, yGoal, angleGoal))) return;\n\n // Set the shortest path\n Path shortestPath = env.getGraph().getShortestPath(\n anchorX, anchorY, xGoal, yGoal, env.getConstructs());\n path = shortestPath;\n path.getNodes().pollFirst();\n\n //TODO: fix the case when the path is empty\n if(path.getNodes().isEmpty()){\n return;\n }\n node = path.getNodes().get(0);\n\n // Set the goals\n goalX = node.getX();\n goalY = node.getY();\n goalAngle = angleGoal;\n\n // Find the furthest distance troops from the average position, according to angle goal\n ArrayList<BaseSingle> aliveArray = new ArrayList<>(aliveTroopsMap.keySet());\n double mostForwardDist = MathUtils.mostForwardDistance(aliveArray, -angleGoal);\n\n // Change unit state to moving, reset patience and ignore unit fought against\n state = UnitState.MOVING;\n currUnitPatience = unitStats.patience; // Reset patience.\n unitFoughtAgainst = null;\n\n // Reorder the troops if the turn is bigger than 90 degree\n // Essentially the last row of the block will become the new front row.\n double moveAngle = Math.atan2(goalY - anchorY, goalX - anchorX);\n if (Math.abs(MathUtils.signedAngleDifference(anchorAngle, moveAngle)) > UniversalConstants.NON_UTURN_ANGLE) {\n uTurnFormation();\n // Shift the anchorX,Y to the last row\n double downUnitX = MathUtils.quickCos((float) (anchorAngle + Math.PI));\n double downUnitY = MathUtils.quickSin((float) (anchorAngle + Math.PI));\n anchorX += depth * unitStats.spacing * downUnitX;\n anchorY += depth * unitStats.spacing * downUnitY;\n // Flip the angle\n anchorAngle += Math.PI;\n }\n\n // TODO: This is not well-designed code, since everytime we add a new unit with positional variation, we will\n // have to change this part of the code.\n if (this instanceof ArcherUnit) {\n ((ArcherUnit) this).generatePositionalVariation(troops.size());\n } else if (this instanceof SkirmisherUnit) {\n ((SkirmisherUnit) this).generatePositionalVariation(troops.size());\n }\n\n // Reset anchor angles\n if (Math.abs(MathUtils.signedAngleDifference(anchorAngle, moveAngle)) < UniversalConstants.NON_REGROUP_ANGLE) {\n double forwardedAnchorDist = (depth * unitStats.spacing / 2 + GameplayConstants.FORWARD_DISTANCE) *\n (1 - UniversalConstants.TENDENCY_TOWARD_FURTHEST_TROOP_DURING_REORDER) +\n mostForwardDist * UniversalConstants.TENDENCY_TOWARD_FURTHEST_TROOP_DURING_REORDER;\n // If the turn angle is not too sharp, we will not perform a reorder to keep the formation more consistent.\n // In this case, don't change the anchor angle and simply move the anchor position slightly forward.\n anchorX = averageX + MathUtils.quickCos((float) anchorAngle) * forwardedAnchorDist;\n anchorY = averageY + MathUtils.quickSin((float) anchorAngle) * forwardedAnchorDist;\n } else {\n double forwardedAnchorDist = (depth * unitStats.spacing / 2 + GameplayConstants.FORWARD_DISTANCE) *\n (1 - UniversalConstants.TENDENCY_TOWARD_FURTHEST_TROOP_DURING_REORDER) +\n mostForwardDist * UniversalConstants.TENDENCY_TOWARD_FURTHEST_TROOP_DURING_REORDER;\n anchorAngle = MathUtils.atan2(yGoal - averageY, xGoal - averageX);\n anchorX = averageX + MathUtils.quickCos((float) anchorAngle) * forwardedAnchorDist;\n anchorY = averageY + MathUtils.quickSin((float) anchorAngle) * forwardedAnchorDist;\n reorderTroops(anchorX, anchorY, anchorAngle);\n }\n\n // Decision has a random delay until it reaches the soldiers ear.\n for (int i = 0; i < troops.size(); i++) {\n // Set the goal and change the state\n BaseSingle troop = troops.get(i);\n troop.setDecisionDelay(MathUtils.randint(2, 20));\n }\n }", "public void move(Actor actor)\n\t\t {\n\t\t\t \t//PO: updated the methods after the move from the Bug Class to be called from\n\t\t \t//PO: the passed actor\n\t\t Grid<Actor> gr = actor.getGrid();\n\t\t if (gr == null)\n\t\t return;\n\t\t Location loc = actor.getLocation();\n\t\t Location next = loc.getAdjacentLocation(actor.getDirection());\n\t\t if (gr.isValid(next))\n\t\t \t//PO: alter the original code instead of calling the \n\t\t \t//PO: moveTo method in Actor call the method that is from this current behaviour\n\t\t this.moveTo(actor, next);\n\t\t else\n\t\t actor.removeSelfFromGrid();\n\t\t Flower flower = new Flower(actor.getColor());\n\t\t flower.putSelfInGrid(gr, loc);\n\t\t \n\t\t }", "@Override\r\n public boolean canMove() {\r\n Grid<Actor> gr = getGrid();\r\n int dirs[] = {\r\n Location.AHEAD, Location.HALF_CIRCLE, Location.LEFT,\r\n Location.RIGHT };\r\n // 当终点在周围时,不能移动且isEnd应当为true\r\n for (int i = 0; i < dirs.length; i++) {\r\n Location tarLoc = getLocation().getAdjacentLocation(dirs[i]);\r\n if (gr.isValid(tarLoc) && gr.get(tarLoc) != null) {\r\n // Color直接用==计算竟然不可行(真是哔了dog...\r\n if (gr.get(tarLoc) instanceof Rock\r\n && gr.get(tarLoc).getColor().equals(Color.RED)) {\r\n isEnd = true;\r\n return false;\r\n }\r\n }\r\n }\r\n ArrayList<Location> nextLocs = getValid(getLocation());\r\n // 当附近没有可以移动的位置时,不能移动\r\n if (nextLocs.size() == 0) {\r\n return false;\r\n }\r\n // 当可以移动的位置>1时,说明存在一个节点,这个节点应当被新建一个arraylist入栈\r\n if (nextLocs.size() > 1) {\r\n ArrayList<Location> newStackElem = new ArrayList<Location>();\r\n newStackElem.add(getLocation());\r\n crossLocation.push(newStackElem);\r\n }\r\n // 有可以移动的位置时,向概率最高的方向移动\r\n int maxProbLoc = 0;\r\n // 由于nextLocs不一定有4个location,所以只好循环判断取最大值\r\n for (int i = 0; i < nextLocs.size(); i++) {\r\n Location loc = nextLocs.get(i);\r\n int dirNum = getLocation().getDirectionToward(loc) / 90;\r\n if (probablyDir[dirNum] > probablyDir[maxProbLoc]) {\r\n maxProbLoc = i;\r\n }\r\n }\r\n next = nextLocs.get(maxProbLoc);\r\n return true;\r\n }", "@Override\n boolean canMove(Cell source, Cell destination) {\n return true;\n }", "public void AskForMove();", "public boolean move(int[][] foodPos){\n\tint[] target = findFood(foodPos);\n\tRandom choiceGen = new Random();\n\tif(target == null && trackTime != 0){\n\t moveAfter(previousTarget, choiceGen);\n\t trackTime--;\n\t return false;\n\t}\n\telse if(target != null){\n\t return moveAfter(target, choiceGen);\n\t}\n\trandomMove(choiceGen);\n\treturn false;\n }", "public boolean isValidMove(Point orig, Point dest){ \r\n Color playerColor = model.getCurrentPlayer().getColor();\r\n // Validate all point between board limits\r\n if(!isValidPosition(orig) || !isValidPosition(dest)) return false;\r\n // Check for continue move starting piece\r\n if(model.getCheckPiece() != null && !model.getCheckPiece().equals(orig)) return false;\r\n // Validate origin piece to player color\r\n if((isRed(playerColor) && !isRed(orig)) || (isBlack(playerColor) && !isBlack(orig))) return false;\r\n // Only can move to empty Black space\r\n if(!isEmpty(dest)) return false;\r\n // If current player have obligatory eats, then need to eat\r\n if(obligatoryEats(playerColor) && !moveEats(orig,dest)) return false;\r\n // Check move direction and length\r\n int moveDirection = orig.getFirst() - dest.getFirst(); // Direction in Rows\r\n int rLength = Math.abs(moveDirection); // Length in Rows\r\n int cLength = Math.abs(orig.getSecond() - dest.getSecond()); // Length in Columns\r\n int mLength;\r\n // Only acepts diagonal movements in 1 or 2 places (1 normal move, 2 eats move)\r\n if ((rLength == 1 && cLength == 1) || (rLength == 2 && cLength == 2)){\r\n mLength = rLength;\r\n } else {\r\n return false;\r\n }\r\n // 1 Place movement\r\n if (mLength == 1){ \r\n if (isRed(orig) && !isQueen(orig) && moveDirection > 0) return true;\r\n if (isBlack(orig) && !isQueen(orig) && moveDirection < 0) return true;\r\n if ((isRed(orig) && isQueen(orig)) || (isBlack(orig) && isQueen(orig))) return true;\r\n }\r\n // 2 Places movement need checks if eats rivals\r\n if (mLength == 2){\r\n // Compute mid point\r\n Point midPoint = getMidPoint(orig, dest);\r\n // Check move\r\n if ((isRed(orig) && isBlack(midPoint)) || (isBlack(orig) && isRed(midPoint))){\r\n if (isRed(orig) && !isQueen(orig) && moveDirection > 0) return true;\r\n if (isBlack(orig) && !isQueen(orig) && moveDirection < 0) return true;\r\n if ((isRed(orig) && isQueen(orig)) || (isBlack(orig) && isQueen(orig))) return true;\r\n }\r\n }\r\n return false;\r\n }", "@Override\r\n public void move() {\r\n Grid<Actor> gr = getGrid();\r\n if (gr == null) {\r\n return;\r\n }\r\n Location loc = getLocation();\r\n if (gr.isValid(next)) {\r\n setDirection(getLocation().getDirectionToward(next));\r\n moveTo(next);\r\n } else {\r\n removeSelfFromGrid();\r\n }\r\n Flower flower = new Flower(getColor());\r\n flower.putSelfInGrid(gr, loc);\r\n }", "@Override\n protected boolean makeMove(GameAction action) {\n // uses the actions to check instances of player actions\n //handles a move action by tapping on a square\n if(action instanceof StrategoMoveAction) {\n StrategoMoveAction sma = (StrategoMoveAction)action;\n state.tapOnSquare(sma.getRow(), sma.getCol());\n }\n //handles a forfeit action by telling the game state to end the game\n else if (action instanceof StrategoForfeitAction) {\n state.forfeitGame();\n }\n //handles a transition action by telling the game to transition phases\n else if (action instanceof StrategoTransitionAction) {\n state.transitionPhases();\n }\n //handles a button press by updating the proper game state variable\n else if (action instanceof StrategoButtonPieceAction) {\n StrategoButtonPieceAction bpa = (StrategoButtonPieceAction)action;\n state.setLastTappedPieceButton(bpa.getWhichButton());\n }\n else if (action instanceof StrategoMuteAction){\n StrategoMuteAction ma = (StrategoMuteAction)action;\n StrategoHumanPlayer sender = (StrategoHumanPlayer)ma.getPlayer();\n if(sender.getMediaPlayer().isPlaying()){\n sender.getMediaPlayer().pause();\n }\n else{\n sender.getMediaPlayer().start();\n }\n }\n //handles a computers setup action by setting up the board\n else if (action instanceof StrategoSmartComputerSetupAction) {\n StrategoSmartComputerSetupAction ssca = (StrategoSmartComputerSetupAction)action;\n this.letSmartComputerSetup();\n }\n //allows computers to make two dependant moves with one action\n else if (action instanceof StrategoComputerMoveAction) {\n StrategoComputerMoveAction scma = (StrategoComputerMoveAction) action;\n state.tapOnSquare(scma.getOldRow(), scma.getOldCol());\n state.tapOnSquare(scma.getFutureRow(), scma.getFutureCol());\n }\n //allows a player to pass if they cannot move\n else if (action instanceof StrategoPassAction) {\n StrategoPassAction spa = (StrategoPassAction)action;\n state.transitionTurns();\n }\n //allows the game to remove the visibility of a temporarily visible piece\n else if (action instanceof StrategoRemoveVisibilityAction) {\n StrategoRemoveVisibilityAction srva = (StrategoRemoveVisibilityAction) action;\n try{\n Thread.sleep(500);\n } catch(InterruptedException e) {\n\n }\n if(state.getVisiblePiece() != null) {\n state.removeTemporaryVisiblePiece();\n }\n }\n else if (action instanceof NoVendettaAction) {\n state.setLastKilledPiece(null);\n }\n return true;\n }", "@Override\n\tpublic boolean isLegalMove(Square newPosition) {\n\t\treturn false;\n\t}", "boolean testMoveAll(Tester t) {\n return t.checkExpect(this.lob3.moveAll(), new ConsLoGamePiece(\n new Bullet(2, Color.PINK, new MyPosn(51, 50), this.p6, 1),\n new ConsLoGamePiece(new Bullet(2, Color.PINK, new MyPosn(51, 50), this.p6, 1),\n new ConsLoGamePiece(\n new Bullet(2, Color.PINK, new MyPosn(250, 292), new MyPosn(0, -8), 1), this.mt))))\n && t.checkExpect(this.mt.moveAll(), this.mt);\n }", "public void move() {\n\t\tGrid<Actor> gr = getGrid();\n\t\tif (gr == null) {\n\t\t\treturn;\n\t\t}\n\t\tLocation loc = getLocation();\n\t\tLocation next = loc.getAdjacentLocation(getDirection());\n\t\t\n\t\tLocation next2 = next.getAdjacentLocation(getDirection());\n\t\tif (gr.isValid(next2)) {\n\t\t\tmoveTo(next2);\n\t\t} else {\n\t\t\tremoveSelfFromGrid();\n\t\t}\n\t}", "boolean canMove();", "@Override\n public void move(){\n if (flatbed.getCurrentAngle() == flatbed.getMinAngle()){\n super.move();\n }\n }", "@Override\n\tpublic boolean setUp(Action action) {\n\t\tif (action == null)\n\t\t\treturn false;\n\t\t\n\t\t// ACTIONS THAT LEAD TO THIS STATE\n\t\tif (action.ID == StateActionRegistry.A.GO)\n\t\t{\n\t\t\tGo g = (Go) action;\n\t\t\tif (g.owner == null || (g.loc == null && g.locationOf == null))\n\t\t\t\t\treturn false;\n\t\t\towner = g.owner;\n\t\t\tif (g.loc != null)\n\t\t\t{\n\t\t\t\tloc = g.loc;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlocationOf = g.locationOf;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t\n\t\t// ACTIONS WHOSE PRECOND INCLUDES THIS STATE\n\t\tif (action.ID == StateActionRegistry.A.TAKE)\n\t\t{\n\t\t\tTake t = (Take) action;\n\t\t\tif (t.owner == null || t.taken == null)\n\t\t\t\treturn false;\n\t\t\towner = t.owner;\n\t\t\tlocationOf = t.taken;\n\t\t\treturn true;\n\t\t} else if (action.ID == StateActionRegistry.A.STEAL)\n\t\t{\n\t\t\t\n\t\t\tSteal s = (Steal) action;\n\t\t\tif (s.owner == null || s.stolen == null)\n\t\t\t\treturn false;\n\t\t\towner = s.owner;\n\t\t\tlocationOf = s.stolen;\n\t\t\treturn true;\n\t\t} else if (action.ID == StateActionRegistry.A.ASKTO)\n\t\t{\n\t\t\tAskTo a = (AskTo) action;\n\t\t\tif (a.asker == null || a.askee == null)\n\t\t\t\treturn false;\n\t\t\towner = a.asker;\n\t\t\tlocationOf = a.askee;\n\t\t\treturn true;\n\t\t} else if (action.ID == StateActionRegistry.A.GIVE)\n\t\t{\n\t\t\tGive g = (Give) action;\n\t\t\tif (g.giver == null || g.givee == null || g.obj == null || g.obj.owner != g.giver)\n\t\t\t\treturn false;\n\t\t\towner = g.giver;\n\t\t\tlocationOf = g.givee;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t\n\t\treturn false;\n\t}", "@Override\n public boolean atDestination() {\n return myMovable.atDestination();\n }", "private boolean movePlayer(String placeToMoveTo) {\n if (placeToMoveTo.equalsIgnoreCase(\"go\") || placeToMoveTo.equals(\"\")) {\n System.out.println(\"Go where?\");\n return false;\n }\n\n // Check to see if the player is trying to move through a valid Exit\n if (currentRoom.getExit1() != null && placeToMoveTo.equalsIgnoreCase(currentRoom.getExit1().getName())) {\n if (this.checkExit(currentRoom.getExit1())) {\n // Move the player and set the current room to the room that they have moved to\n currentRoom = currentRoom.getExit1().getDestination();\n return true;\n }\n } else if (currentRoom.getExit2() != null && placeToMoveTo.equalsIgnoreCase(currentRoom.getExit2().getName())) {\n if (this.checkExit(currentRoom.getExit2())) {\n // Move the player and set the current room to the room that they have moved to\n currentRoom = currentRoom.getExit2().getDestination();\n return true;\n }\n } else if (currentRoom.getExit3() != null && placeToMoveTo.equalsIgnoreCase(currentRoom.getExit3().getName())) {\n if (this.checkExit(currentRoom.getExit3())) {\n // Move the player and set the current room to the room that they have moved to\n currentRoom = currentRoom.getExit3().getDestination();\n return true;\n }\n } else if (currentRoom.getExit4() != null && placeToMoveTo.equalsIgnoreCase(currentRoom.getExit4().getName())) {\n if (this.checkExit(currentRoom.getExit4())) {\n // Move the player and set the current room to the room that they have moved to\n currentRoom = currentRoom.getExit4().getDestination();\n return true;\n }\n } else if (currentRoom.getSecretExit() != null && placeToMoveTo.equalsIgnoreCase(currentRoom.getSecretExit().getName())) {\n if (this.checkExit(currentRoom.getSecretExit())) {\n // Move the player and set the current room to the room that they have moved to\n currentRoom = currentRoom.getSecretExit().getDestination();\n return true;\n }\n } // They have not specified a valid exit\n else {\n System.out.println(\"It doesn't appear as though I can go there.\");\n return false;\n }\n\n return false;\n }", "private void makeMove(){\r\n\t\tif(cornerColorIs(GREEN)){\r\n\t\t\tif(noBeepersPresent()){\r\n\t\t\t\tmove();\r\n\t\t\t\tpaintCorner(GREEN);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tif(noBeepersPresent()){\r\n\t\t\t\tmove();\r\n\t\t\t\tpaintCorner(RED);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n//\t\tif(()) {\r\n//\t\t if(cornerColorIs(GREEN)) {\r\n//\t\t move();\r\n//\t\t paintCorner(GREEN);\r\n//\t\t } else {\r\n//\t\t move();\r\n//\t\t paintCorner(RED);\r\n//\t\t }\r\n//\t\t}noBeepersPresent\r\n\t}", "@Override\n\tpublic boolean canMateWith(EntityAnimal mate) {\n\t\treturn getReproductionHelper().canMateWith(mate);\n\t}", "@Test(expected = IllegalArgumentException.class)\n public void moveException5() {\n MarbleSolitaireModel exampleBoard = new MarbleSolitaireModelImpl(2, 4);\n exampleBoard.move(4, 2, 2, 4);\n }" ]
[ "0.61176604", "0.5924558", "0.5794134", "0.57069814", "0.5667661", "0.565692", "0.5639185", "0.55877656", "0.55608", "0.54865855", "0.5484706", "0.54540455", "0.5433673", "0.54312027", "0.54175043", "0.53986293", "0.53612953", "0.53405344", "0.53346777", "0.531973", "0.53181833", "0.5260081", "0.5231344", "0.52237344", "0.5209274", "0.5190895", "0.51814795", "0.51775676", "0.51378286", "0.5132453", "0.5109064", "0.51074034", "0.5069517", "0.50674903", "0.50623393", "0.5062104", "0.505338", "0.50533503", "0.5052978", "0.50475574", "0.50427485", "0.5037542", "0.5037484", "0.5029601", "0.502663", "0.50261146", "0.50258416", "0.5018947", "0.50176084", "0.50173444", "0.50116724", "0.50103605", "0.50103605", "0.50103605", "0.50103605", "0.50103605", "0.50103605", "0.50103605", "0.50035536", "0.5003297", "0.5000767", "0.49990642", "0.499617", "0.49891046", "0.4986338", "0.49783427", "0.49719006", "0.49647656", "0.4962538", "0.49610636", "0.49526513", "0.49440107", "0.49363226", "0.4932029", "0.49311507", "0.49249765", "0.49212256", "0.49210888", "0.49144167", "0.49132913", "0.49084404", "0.4908228", "0.49080116", "0.49002948", "0.48959267", "0.4890521", "0.4889154", "0.48865306", "0.48864836", "0.48856503", "0.4879455", "0.4872329", "0.48715335", "0.48711854", "0.4847276", "0.484354", "0.48413587", "0.48355016", "0.48328376", "0.4832638" ]
0.6362375
0
Test that eat for animals in forests consumes the specified food item in the forest.
@Test public final void testEat() { Food testFood = new Food("White Bread", "Yeast Bread", "Pams Toast sliced", false); testForest.addThing(testFood); assertTrue("Food in Forest", testForest.contents().contains(testFood)); animal.moveTo(testForest); animal.eat(testFood); assertFalse("Food consumed", testForest.contents().contains(testFood)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void eatFruit(Fruit fruit) {\n raiseFoodLevel(30);\n }", "public boolean animalFood(Entity e, Material item){\r\n\t\t\r\n\t\tif(e instanceof Cow || e instanceof Horse || e instanceof Pig || e instanceof Sheep ){\r\n\t\t\tif(item == Material.HAY_BLOCK){\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\t\t}else if(e instanceof Chicken){\r\n\t\t\tif(item == Material.SEEDS){\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\t\t}else if( e instanceof Wolf){\r\n\t\t\tif(item == Material.ROTTEN_FLESH || item == Material.RAW_BEEF || item == Material.PORK){\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\t\t}else if(e instanceof Ocelot){\r\n\t\t\tif(item == Material.RAW_FISH){\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\t\t\t\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public boolean isAnimalFood(Material item){\r\n\t\tif(item == Material.HAY_BLOCK || item == Material.SEEDS || item == Material.ROTTEN_FLESH || item == Material.RAW_BEEF || item == Material.PORK\r\n\t\t\t\t|| item == Material.RAW_FISH){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "@Override\n\tpublic void eatFood(Food f) {\n\t\t\n\t}", "@Test\r\n\tpublic void TestgetAllFoodItem() {\n\t\tassertNotNull(\"Test if there is valid food list to get food item\", foodList);\r\n\r\n\t\t// the food list is not empty so can view food items.\r\n\t\tfoodList.add(f1);\r\n\t\tC206_CaseStudy.getAllFoodItem(foodList);\r\n\t\tassertFalse(\"Test that if the food list is not empty so can view food\", foodList.isEmpty());\r\n\r\n\t\t// Continue from step 2, test that the size of the food list is 1 and is not\r\n\t\t// empty.\r\n\t\tassertEquals(\"Test that food list size is 1\", 1, foodList.size());\r\n\t\tassertFalse(\"Test that the food list is not empty\", foodList.isEmpty());\r\n\t}", "public void eatEgg(Egg egg) {\n raiseFoodLevel(10);\n }", "public static void eatApple(int i) {\r\n\t\tstate = MOVE;\r\n\t\tscore++;\r\n\r\n\t\tsnake.addLast(lastTail);\r\n\r\n\t\tfood.remove(i);\r\n\t\twhile (true) {\r\n\t\t\tint x = r.nextInt(ROWS);\r\n\t\t\tint y = r.nextInt(COLUMNS);\r\n\r\n\t\t\tif (field[x][y] == EMPTY) {\r\n\t\t\t\tfood.add(new int[] { APPLE, x, y });\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void eat(Food food) {\n\r\n\t}", "@Test\n public void foodDeletedGoesAway() throws Exception {\n createFood();\n // locate the food item\n\n // delete the food item\n\n // check that food item no longer locatable\n\n }", "public void eatMealKit(MealKit mealkit) {\n raiseFoodLevel(100);\n }", "public void eatItem(Command command) {\n if (!command.hasSecondWord()) { // check if there's a second word\n System.out.println(\"Eat what?\");\n return;\n }\n String itemToBeEaten = command.getSecondWord();\n List<Item> playerInventory = player.getPlayerInventory(); // load the inventory of the player\n\n boolean somethingToUse = false;\n int notThisItem = 0;\n int loop;\n\n for (loop = 0; loop < playerInventory.size(); loop++) { // loop through the player inventory\n Item currentItem = playerInventory.get(loop); // set currentitem on the item that is currently in the loop\n if (itemToBeEaten.equals(currentItem.getItemName()) ){ // get the item name, then check if that matches the secondWord\n if (currentItem.getItemCategory().equals(\"food\")){ // check if the item used is an item in the \"food\" category\n if((player.getHealth())<(20)) { // check if the player's health is full\n player.addHealth(currentItem.getHealAmount()); // heal the player\n player.removeItemFromInventory(currentItem); // remove item from inventory\n System.out.println(\"You eat the \" + itemToBeEaten + \". It heals for \" + currentItem.getHealAmount()+\".\");\n } else { // the player's health is full\n System.out.println(\"Your are at full health!\");\n }\n } else { // item is not a food item\n System.out.println(\"You can't eat that item!\");\n }\n } else { // the item did not match the player provided name\n notThisItem++;\n }\n somethingToUse = true;\n }\n\n //errors afvangen\n if (!somethingToUse) { // the item is not found in the player inventory\n System.out.println(\"You can't eat that!\");\n }\n\n if (loop == notThisItem) { // the player has nothing to burn secondWord with\n //ThisItem is the same amount as loop. Then the player put something in that is not in the room\n System.out.println(\"You cannot eat \" + itemToBeEaten + \" because you don't have it in your inventory!\");\n }\n }", "public abstract void eat(String foodName);", "@Override\n\tpublic boolean eat(Item item,GameMap map) {\n\t\ttry {\n\t\t\tif (hitPoints<maxHitPoints){\n\t\t\t\theal(item.effect());\n\t\t\t\tmap.locationOf(this).removeItem(item);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} catch (NullPointerException nullPointer) {\n\t\t\tnullPointer.printStackTrace();\n\t\t}\n\t\treturn false;\n\t}", "public void eat(FoodList foods, AntList ants) {\n\t\tif (!dead){\n\t\tfor (int i = 0; i < foods.getQuantity(); i++) {\n\t\t\tif (Math.abs(foods.getFood(i).getX() - x) < 2\n\t\t\t\t\t&& Math.abs(foods.getFood(i).getY() - y) < 2\n\t\t\t\t\t&& !foods.getFood(i).isEaten()) {\n\t\t\t\tAntList.born(ants);\n\t\t\t\tfoods.getFood(i).eaten(foods);\n\t\t\t}\n\t\t}\n\t\t}\n\t}", "private void eatItem(String item)//Made by Lexi\n {\n itemFound = decodeItem(item);\n if (itemFound == null)\n {\n System.out.println(\"I don't know of any \" + item + \".\");\n }\n else\n {\n System.out.println(\"You gave in to the chocolate temptation and died from poison in the candy bar\");\n }\n }", "public boolean isSuitable(Food food) {\n return food.calculateFitness() < 100;\n }", "@Test\n\tpublic void testPurachase() {\n\t\tassertTrue(order.purachaseCheeseMeal().getMeal().get(0) instanceof CheeseSandwich);\n\t\tassertTrue(order.purachaseCheeseMeal().getMeal().get(1) instanceof OrangeJuice);\n\n\t\tassertTrue(order.purachaseTunaMeal().getMeal().get(0) instanceof TunaSandwich);\n\t\tassertTrue(order.purachaseTunaMeal().getMeal().get(1) instanceof OrangeJuice);\n\t}", "void cook(Food food) {\n //cook in pressure cooker\n }", "public void useItem(Item item) {\n\t\twillRun = pokemonRun();\n\t\t\n\t\tif (item.getClass() == items.SafariBall.class){\n\t\t\tcalcCatchProbability();\n\t\t\tisEating = false;\n\t\t\tisAngry = false;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (!isEating && !isAngry) {\n\t\t\tif (item.getClass() == items.Rock.class){\n\t\t\t\tisAngry = true;\n\t\t\t}\n\t\t\telse if (item.getClass() == items.Bait.class){\n\t\t\t\tisEating = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (isEating && !isAngry){\n\t\t\tif (item.getClass() == items.Rock.class){\n\t\t\t\tisEating = false;\n\t\t\t\tisAngry = true;\n\t\t\t}\n\t\t\telse if (item.getClass() == items.Bait.class){\n\t\t\t\tisEating = true;\n\t\t\t\tisAngry = false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tisEating = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!isEating && isAngry){\n\t\t\tif (item.getClass() == items.Bait.class){\n\t\t\t\tisEating = true;\n\t\t\t\tisAngry = false;\n\t\t\t}\n\t\t\telse if (item.getClass() == items.Rock.class){\n\t\t\t\tisEating = false;\n\t\t\t\tisAngry = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tisAngry = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tsetCatchRate(item.getCatchModifier());\n\t\tsetHP(item.hpModifier());\n\t\tcalcCatchProbability();\n\t}", "@Test\n void respectsStillSuitFamiliar() {\n setupFakeClient();\n var cleanups =\n new Cleanups(\n withFamiliar(FamiliarPool.GROUPIE),\n withEquipped(EquipmentManager.FAMILIAR, ItemPool.STILLSUIT),\n withFamiliarInTerrarium(FamiliarPool.BOWLET),\n withFamiliarInTerrarium(FamiliarPool.GREY_GOOSE),\n withProperty(\"stillsuitFamiliar\", \"Bowlet\"));\n\n try (cleanups) {\n var newFamiliar = FamiliarData.registerFamiliar(FamiliarPool.GREY_GOOSE, 0);\n var req = new FamiliarRequest(newFamiliar);\n req.responseText = \"You take\";\n req.processResults();\n var requests = getRequests();\n\n assertThat(requests, hasSize(2));\n assertPostRequest(\n requests.get(0),\n \"/familiar.php\",\n \"famid=\" + FamiliarPool.GROUPIE + \"&action=unequip&ajax=1\");\n assertPostRequest(\n requests.get(1),\n \"/familiar.php\",\n \"action=equip&whichfam=\" + FamiliarPool.BOWLET + \"&whichitem=10932&ajax=1\");\n }\n }", "public boolean feedPet(String food) {\r\n switch (food) {\r\n case (\"apple\"): {\r\n if ((this.player.getMoney() - apple.getCost()) >= 0) {\r\n player.feed(apple);\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n case (\"honey\"): {\r\n if ((this.player.getMoney() - honey.getCost()) >= 0) {\r\n player.feed(honey);\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n case (\"spinach\"): {\r\n if ((this.player.getMoney() - spinach.getCost()) >= 0) {\r\n player.feed(spinach);\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n case (\"steak\"): {\r\n if ((this.player.getMoney() - steak.getCost()) >= 0) {\r\n player.feed(steak);\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n }\r\n return false;\r\n }", "public boolean eatFood(Cat eatingCat) {\n if (eatingCat.getAppetite() > food) {\n System.out.printf(\"Cat \\u001B[31m%s\\u001B[0m can't eat - not enough food =(\\n\", eatingCat.getName());\n return false;\n }\n else {\n food -= eatingCat.getAppetite();\n System.out.printf(\"Cat \\u001B[32m%s\\u001B[0m have ate successful =)\\n\", eatingCat.getName());\n return true;\n }\n }", "@Test\r\n public void testPurchaseBeverage() {\r\n coffeeMaker.addRecipe(recipe1);\r\n assertEquals(25, coffeeMaker.makeCoffee(0, 75));\r\n assertEquals(0, coffeeMaker.makeCoffee(0, 50));\r\n }", "public void eatApple() {\n\t\teaten = peeled && !eaten ? true : false;\n\t}", "public void eatCorpse(Corpse corpse) {\n if (corpse.getSpecies().equals(\"Agilisaurus\")) {\n raiseFoodLevel(20);\n } else {\n raiseFoodLevel(50);\n }\n }", "@Test\r\n public void testPurChaseBeverageWithNotEnoughInventory() {\r\n coffeeMaker.addRecipe(recipe2); // add mocha which use 20 chocolate while we only have 15 chocolate\r\n assertEquals(75, coffeeMaker.makeCoffee(0, 75)); // not enough recipe\r\n }", "private void eatCookedMeal(double eatingTime) {\n\t\t// Obtain the dry mass of the dessert\n\t\tdouble dryMass = cookedMeal.getDryMass();\n\t\t// Proportion of meal being eaten over this time period.\n\t\tdouble proportion = person.getEatingSpeed() * eatingTime;\n\n\t\tif (cumulativeProportion > dryMass) {\n\t\t\tdouble excess = cumulativeProportion - dryMass;\n\t\t\tcumulativeProportion = cumulativeProportion - excess;\n\t\t\tproportion = proportion - excess;\n\t\t}\n\n\t\tif (proportion > MIN) {\n\t\t\t// Add to cumulativeProportion\n\t\t\tcumulativeProportion += proportion;\n\t\t\t// Food amount eaten over this period of time.\n\t\t\tdouble hungerRelieved = RATIO * proportion / dryMass;\n\t\t\t\t\t\n//\t\t\tlogger.info(person + \" ate '\" + cookedMeal.getName()\n//\t\t\t\t\t+ \" currentHunger \" + Math.round(currentHunger*100.0)/100.0\n//\t\t\t\t\t+ \" hungerRelieved \" + Math.round(hungerRelieved*100.0)/100.0\n//\t\t\t\t\t+ \" proportion \" + Math.round(proportion*1000.0)/1000.0\n//\t\t\t\t\t+ \" EatingSpeed \" + Math.round(person.getEatingSpeed()*1000.0)/1000.0\n//\t\t\t\t\t+ \" foodConsumptionRate \" + Math.round(foodConsumptionRate*1000.0)/1000.0);\n\t\t\t\n\t\t\t// Change the hunger level after eating\n\t\t\treduceHunger(hungerRelieved);\n\t\n\t\t\t// Reduce person's stress over time from eating a cooked meal.\n\t\t\t// This is in addition to normal stress reduction from eating task.\n\t\t\tdouble stressModifier = STRESS_MODIFIER * (cookedMeal.getQuality() + 1D);\n\t\t\tdouble newStress = condition.getStress() + (stressModifier * eatingTime);\n\t\t\tcondition.setStress(newStress);\n\t\n\t\t\t// Add caloric energy from meal.\n\t\t\tdouble caloricEnergyFoodAmount = proportion / dryMass * PhysicalCondition.FOOD_COMPOSITION_ENERGY_RATIO;\n\t\t\tcondition.addEnergy(caloricEnergyFoodAmount);\n\t\t}\n\t}", "private void harvest() {\n\t\t// if VERY far from flower, it must have died. start scouting\n\t\tif(grid.getDistance(grid.getLocation(targetFlower),grid.getLocation(this)) > 200) {\n\t\t\tstate = \"SCOUTING\";\n\t\t}\n\t\t// if crop storage is full, return to hive with information\n\t\telse if(food >= maxCrop) {\n\t\t\tif(targetFlower != null) {\n\t\t\t\tlastFlowerNectar = targetFlower.food;\n\t\t\t}\n\t\t\tstate = \"RETURNING\";\n\t\t}\n\t\t// if daylight is diminishing, return to hive\n\t\telse if(clock.time > (endForagingTime + 1.0)){\n\t\t\tlastFlowerNectar = 0;\n\t\t\tstate = \"RETURNING\";\n\t\t}\n\t\t// if flower loses all nectar, start scouting for new flower\n\t\telse if(targetFlower.food <= 0){\n\t\t\tstate = \"AIMLESSSCOUTING\";\n\t\t\ttempTime = clock.time;\n\t\t}\n\t\t// semi-random decision to scout for new flower if current flower has low food\n\t\telse if(RandomHelper.nextIntFromTo(0,(int)(maxFlowerNectar/4)) > targetFlower.food &&\n\t\t\t\tRandomHelper.nextDoubleFromTo(0,1) < forageNoise){\n\t\t\tstate = \"AIMLESSSCOUTING\";\n\t\t\ttempTime = clock.time;\n\t\t}\n\t\t// otherwise continue harvesting current flower\n\t\telse{\n\t\t\thover(grid.getLocation(targetFlower));\n\t\t\ttargetFlower.food -= foragingRate;\n\t\t\tfood += foragingRate;\n\t\t\tfood -= lowMetabolicRate;\n\t\t}\n\t}", "@Override\r\n\t\t \t public void eat(String item) {\n\t\t \t\t System.out.println(\"Penguin eats fish\");\r\n\t\t \t\t\r\n\t\t }", "@Test\r\n\tpublic void TestdeleteFood() {\n\t\tassertNotNull(\"Test if there is valid food list to delete food item\", foodList);\r\n\r\n\t\t// when given an empty food list, after adding two items, the size of the food\r\n\t\t// list is 2. After removing a food item, the size of the food list becomes 1.\r\n\t\tfoodList.add(f1);\r\n\t\tfoodList.add(f2);\r\n\t\tassertEquals(\"Test that food list size is 2\", 2, foodList.size());\r\n\t\tC206_CaseStudy.getAllFoodItem(foodList);\r\n\t\tfoodList.remove(0);\r\n\t\tassertEquals(\"Test that food list size is 1\", 1, foodList.size());\r\n\r\n\t\t// Continue from step 2, test that after removing a food item, the size of the\r\n\t\t// food list becomes empty.\r\n\t\tC206_CaseStudy.getAllFoodItem(foodList);\r\n\t\tfoodList.remove(0);\r\n\t\tassertTrue(\"Test that the food list is empty\", foodList.isEmpty());\r\n\t}", "@Override\n public String execute(Actor actor, GameMap map) {\n // Set the bound for use in generating a random integer within the range [0-bound)\n // There will be 5 possible integers\n int bound = 5;\n // Pick up fruit by chance\n // To yield 1 or 2 when there are 5 possible integers = 40% chance\n Random random = new Random();\n int number = random.nextInt(bound);\n if (number == 1 || number == 2) {\n String result = \"\\n- Your eco points increases from \" + ((Player) actor).getEcoPoints();\n // Increment eco points of Player\n ((Player) actor).setEcoPoints(((Player) actor).getEcoPoints() + 10);\n result += \" to \" + ((Player) actor).getEcoPoints();\n return super.execute(actor, map) + result;\n }\n return \"You search the tree or bush for fruit, but you can't find any ripe ones\";\n }", "private static void fish(ArrayList<Item> a, ItemManager im) {\n\t\t\n\t\tdouble ph = Math.random();\n\t\tSystem.out.println(\"you rolled a \" + ph);\n\t\tif( ph > 0.7) {\n\t\t\tprintItem(im,1);\n\t\t\ta.add(im.allItems[1]);\n\t\t} else if(ph > 0.03) {\n\t\t\tprintItem(im,2);\n\t\t\ta.add(im.allItems[2]);\n\t\t} else {\n\t\t\tSystem.out.println(\"Bummer! No luck!\");\n\t\t}\t\n\t}", "void cook(Food food) {\n }", "protected void pickupFood() {\r\n\t\tif(this.food > 0){\r\n\t\t\tthis.food--;\r\n\t\t}\r\n\t}", "@Test\n\tpublic void testEspresso() throws CoffeeException {\n\t\tMap<CoffeeSelection, CoffeeBean> beans = new HashMap<CoffeeSelection, CoffeeBean>();\n\t\tbeans.put(CoffeeSelection.ESPRESSO, new CoffeeBean(\"My favorite espresso bean\", 1000));\n\t\tbeans.put(CoffeeSelection.FILTER_COFFEE, new CoffeeBean(\"My favorite filter coffee bean\", 1000));\n\t\t\n\t\t// get a new CoffeeMachine object\n\t\tPremiumCoffeeMachine machine = new PremiumCoffeeMachine(beans);\n\t\t// brew a fresh coffee\n\t\tCoffee espresso = machine.brewCoffee(CoffeeSelection.ESPRESSO);\n\t\t\n\t\tAssert.assertEquals(CoffeeSelection.ESPRESSO, espresso.getSelection());\n\t\tAssert.assertEquals(28d, espresso.getQuantity(), 0.01);\n\t}", "public void eat(String foodName, int amount) {\n\t\tSystem.out.println(\"another eat method\");\n\n\t}", "@Test\n\tpublic void existingFlowerinArtificial() {\n\t\tboolean delete;\n\t\ttry {\n\t\t\tdelete = FlowerManager.deleteFlower(\"Artificial\", \"Full decoration package\");\n\t\t\tassertTrue(delete);\n\t\t} catch (ServiceException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Test\n void doEffectheatseeker() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"heatseeker\");\n Weapon w4 = new Weapon(\"heatseeker\", wf.getBooleans(), wf.getCosts(), wf.getRequestedNum(), wf.getApplier(), wf.getEffects(), wf.getDescriptions());\n WeaponDeck wd = new WeaponDeck();\n wd.addWeapon(w4);\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n wd.addWeapon(w4);\n p.setPlayerPosition(Board.getSquare(0));\n p.getPh().drawWeapon(wd, w4.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(10));\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n try{\n p.getPh().getWeaponDeck().getWeapon(w4.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 3);\n }", "@Test\n public void useEffect() {\n \t//should normally run useItem method, but for testing it is not needed here.\n \tHealthEffect bombEff = (HealthEffect) bomb.getEffect().get(0);\n \tbombEff.applyEffect(com);\n \tAssert.assertTrue(com.getHealth() == baseHP - 700);\n \tSpecial heal = new Special(SpecialType.HEALTHBLESS);\n \theal.getEffect().get(0).applyEffect(com);\n \tAssert.assertTrue(com.getHealth() == baseHP);\n }", "@Test\r\n public void testPurChaseBeverageWithNonValidRecipe() {\r\n coffeeMaker.addRecipe(recipe3); // add mocha which use 20 chocolate while we only have 15 chocolate\r\n assertEquals(75, coffeeMaker.makeCoffee(1, 75)); // non valid recipe\r\n }", "@Override\n public boolean test(Ingredient ingredient) {\n if (ingredient.getName().toUpperCase().contains(searchText.toUpperCase())){\n return true;\n } else {\n return false;\n }\n }", "@Override\n public boolean test(Ingredient ingredient) {\n if (ingredient.getName().toUpperCase().contains(searchText.toUpperCase())){\n return true;\n } else {\n return false;\n }\n }", "void placeFruit()\n\t{\n\t\t// .first is x-coordinate, it gets a number between 1 and 16\n\t\tfruit[0] = randomPoint();\n\t\t// .second is y-coordinate, it gets a number between 1 and 16\n\t\tfruit[1] = randomPoint();\n\t\tfruit[2] = randomPoint();\n\n\t\t// loops the snakes length\n\t\tfor (int i = 0; i < theSnake.getLength(); i++)\n\t\t{\n\t\t\t// checks for fruit being on/under snake\n\t\t\tif (theSnake.getXofPartI(i) == fruit[0] && theSnake.getYofPartI(i) == fruit[1] && theSnake.getZofPartI(i) == fruit[2])\n\t\t\t{\n\t\t\t\t// Picks new spot for fruit, because it was found on the snake\n\t\t\t\tfruit[0] = randomPoint();\n\t\t\t\tfruit[1] = randomPoint();\n\t\t\t\tfruit[2] = randomPoint();\n\t\t\t\t// just in case the fruit landed on the snake again\n\t\t\t\ti = 0;\n\t\t\t}\n\t\t}\n\t}", "public static void eat(int[] head) {\r\n\t\tint[] f;\r\n\t\tfor (int i = 0; i < food.size(); i++) {\r\n\t\t\tf = food.get(i);\r\n\t\t\tif (f[1] == head[0] && f[2] == head[1]) {\r\n\t\t\t\tif (f[0] == APPLE) {\r\n\t\t\t\t\teatApple(i);\r\n\t\t\t\t} else if (f[0] == MOUSE) {\r\n\t\t\t\t\teatMouse(i);\r\n\t\t\t\t} else if (f[0] == POISON) {\r\n\t\t\t\t\teatPoison(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "void eat(Edible anEdible, int amount);", "private boolean fruitChecker(String currentInput)\n\t{\n\t\tboolean hasFruit = false;\n\t\t// loop over all items in it, and look for a meme.\n\n\t\tfor (String currentPhrase : fruitList)\n\t\t{\n\t\t\tif (currentPhrase.equals(currentInput))\n\t\t\t{\n\t\t\t\thasFruit = true;\n\t\t\t}\n\t\t}\n\t\treturn hasFruit;\n\t}", "public void eat() {\n if (!isTired()) {\n hunger -= 3;\n fatigue += 2;\n\n if (!muted) {\n System.out.println(\"eat\\t\\t|\\tYummy this is tasty!\");\n }\n }\n }", "protected void dropFood() {\r\n\t\tthis.food++;\r\n\t}", "public void foodLocated() {\n ArrayList<Creature> creatures = world.getCreatureList();\n for (Creature c : creatures) {\n if (c.creatureLocation().equals(predatorLocation())) {\n //System.out.println(\"Eating Creature: \" + c.creatureLocation());\n c.removed();\n eaten++;\n }\n }\n for (int j = 0; j < world.getCreatureList().size(); j++) {\n if (!world.getCreatureList().get(j).isSpawned()) {\n world.despawnCreature(world.getCreatureList().get(j));\n }\n }\n }", "public static boolean flowerMenu(Lookup lookup) {\r\n\t\t\r\n\t\ttry {\r\n\t\t\tSystem.out.println(\r\n\t\t\t\t\t\"Do you want to purchase an item(Y,N)?\");\r\n\t\t\t\r\n\t\t\tString y_n = sc.next().toLowerCase();\r\n\r\n\t\t\tif (y_n.equals(\"y\")) {\r\n\r\n\t\t\t\tSystem.out.println(\"Enter flower id:\");\r\n\t\t\t\t\r\n\t\t\t\tString id_pre = sc.next();\r\n\t\t\t\tint id = convert(id_pre);\t\t\t\t\t\t\t\r\n\t\t\t\tif (lookup.isValidItem(id)) {\r\n\r\n\t\t\t\t\tSystem.out.println(\"Enter the quantity:\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tString quan_pre = sc.next();\r\n\t\t\t\t\tint quantity = convert(quan_pre);\r\n\r\n\t\t\t\t\tItem myItem = lookup.getItemById(id);\r\n\t\t\t\t\tsUser.addItemToTheLibrary(myItem, quantity);\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow new InvalidInputException(\r\n\t\t\t\t\t\t\t\"This flower's id is not existing!\\n\");\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\r\n\t\t\t}else if(y_n.equals(\"n\")){\r\n\t\t\t\treturn false;\r\n\t\t\t}else {\r\n\t\t\t\t// Doesn't return false, so keeps the loop going\r\n\t\t\t\tthrow new InvalidInputException(\"Invalid option\");\r\n\t\t\t}\r\n\r\n\t\t} catch (InvalidInputException e) {\r\n\t\t\tSystem.err.println(e.getMessage());\r\n\t\t\tSystem.err.flush();\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t\t\r\n\t}", "@Test\n\t public void test002() {\n\t\tFloor newFloor = new Floor(6);\n\t\tShelf newShelf = new Shelf(new Point(0, 5));\n \tRobot newRobot = new Robot(newFloor,newShelf,2,2,100);\n \tinventory newInventory = new inventory(newFloor, newRobot);\n\t\t \n\t\tShelf s = newInventory.finditem(\"pen\");\n\t\tassertTrue(s.Item.contains(\"pen\"));\n\t }", "protected boolean dangerAnimal(double margin) {\n if (!state.isHoldingItem() && !(state.isSearching() && state.getTimeToFinishSearching() > 1)) {\n return false;\n }\n FoodType type = state.isHoldingItem() ? state.getItemHeld() : state.getFoodSearched();\n int dangerGoose = 0;\n int dangerMonkey = 0;\n final Point location = state.getLocation();\n for (Animal animal : animals) {\n if (animal.isEating()) {\n continue;\n }\n if (animal.getType() == AnimalType.MONKEY) { //monkey\n if (//distance(animal.predictNextLocation(), location) <= 5.0 + 1e-7 && \n distance(animal.getLocation(), location) <= 5.0 + 1e-7 + margin) {\n dangerMonkey += 1;\n }\n } else if (type == FoodType.SANDWICH) { //goose\n if (//distance(animal.predictNextLocation(), location) <= 2.0 + 1e-7 &&\n distance(animal.getLocation(), location) <= 2.0 + 1e-7 + margin) {\n dangerGoose += 1;\n }\n }\n }\n return (dangerGoose >= 1 || dangerMonkey >= 3);\n }", "public static void main(String[] args) {\n String msg;\r\n Food[] picnicBasket = new Food[6];\r\n\r\n\r\n // Shows my name\r\n System.out.print(\"Exercise executed by Laercio da Silva\\n\");\r\n\r\n\r\n //Create some food objects\r\n Food snack1 = new Food(\"Banana\", \"Fruit\");\r\n Food snack2 = new Food(\"Yam\", \"Vegetable\");\r\n Food snack3 = new Food(\"Beef Jerky\", \"Meat\");\r\n Food snack4 = new Food(\"Yoghurt\", \"Dairy\");\r\n Food snack5 = new Food(\"Orange\", \"Fruit\");\r\n Food snack6 = new Food(\"Brussel Sprouts\", \"Vegetable\");\r\n\r\n //Add food objects to my array\r\n picnicBasket[0] = snack1;\r\n picnicBasket[1] = snack2;\r\n picnicBasket[2] = snack3;\r\n picnicBasket[3] = snack4;\r\n picnicBasket[4] = snack5;\r\n picnicBasket[5] = snack6;\r\n\r\n //Go through my picnic basket array\r\n for (int i = 0; i < picnicBasket.length; i++) {\r\n Food currentItem = picnicBasket[i];\r\n\r\n //Yuck, I hate veggies! I won't eat em!\r\n if (currentItem.foodType == \"Vegetable\") {\r\n msg = currentItem.denyIt();\r\n System.out.println(msg);\r\n } else {\r\n msg = currentItem.eatIt();\r\n System.out.println(msg);\r\n }\r\n }\r\n }", "@Test\n public void trueIsReturnedWhenRecipeIsFavoriteForCheckIfFavoriteMethod()\n throws Exception {\n Recipe testRecipe = new Recipe();\n testRecipe.setId(1L);\n\n // Given that recipeDao.findAllFavoriteRecipesForUser will\n // return List<Recipe> with one test recipe\n when(\n recipeDao.findAllFavoriteRecipesFor(any(User.class))\n ).thenReturn(Collections.singletonList(testRecipe));\n\n // When recipeService.checkIfRecipeIsFavorite is called\n // Then true should be returned\n assertTrue(\n recipeService.checkIfRecipeIsFavoriteForUser(\n testRecipe, any(User.class)\n )\n );\n\n // Verify mocks\n verify(recipeDao).findAllFavoriteRecipesFor(\n any(User.class)\n );\n }", "@Test\n\tvoid purchaseTest() {\n\t\ttestCrew.setMoney(10000);\n\t\tfor(MedicalItem item: itemList) {\n\t\t\tint currentMoney = testCrew.getMoney();\n\t\t\titem.purchase(testCrew);\n\t\t\tassertEquals(testCrew.getMoney(), currentMoney - item.getPrice());\n\t\t\tassertTrue(testCrew.getMedicalItems().get(0).getClass().isAssignableFrom(item.getClass()));\n\t\t\ttestCrew.removeFromMedicalItems(testCrew.getMedicalItems().get(0));\n\t\t}\n\t}", "public void eatHay(Hay hay) {\n raiseFoodLevel(20);\n }", "public static void main(String[] args) {\n\n\t Food animals[] = new Food [2];\n\t animals[0] = new Dog(\"Baron\");\n\t animals[1] = new Cat(\"Liza\");\n\t \n\t\t System.out.println(\"Trying to give 400gr. of Food for animals.\"); \n\t \n\t for (Food p: animals){\n\t p.giveFood(400);\n\t }\n\t}", "@Test\n void eatMeet() throws GameException {\n Game game=new Game();\n game.setFood(Constants.MAX_FOOD.getValue());\n Player player=new Player(\"test\");\n int index=1;\n Animal[] animals={new Animal(index++,player),new Animal(index++,player),new Animal(index++,player),new Animal(index++,player),new Animal(index++,player)};\n\n for (Animal an:animals\n ) {\n player.addAnimal(an);\n }\n player.connectAnimal(1,2,\"Cooperation\");\n player.connectAnimal(2,3,\"Cooperation\");\n player.connectAnimal(3,4, \"Communication\");\n player.connectAnimal(4,5,\"Communication\");\n\n //feed animals 1 first\n animals[0].eatMeet(player,game);\n assertThrows (GameException.class, ()->{animals[0].eatMeet(player,game);},\"This animal is fed!\");\n assertThrows (GameException.class, ()->{animals[1].eatMeet(player,game);},\"This animal is fed!\");\n assertThrows (GameException.class, ()->{animals[2].eatMeet(player,game);},\"This animal is fed!\");\n assert (animals[3].hungry ==1);\n assert (animals[4].hungry ==1);\n\n //feed animal 3 first\n player.resetFedFlag();\n player.resetFields();\n game.setFood(Constants.MAX_FOOD.getValue());\n animals[2].eatMeet(player,game);\n assertThrows (GameException.class, ()->{animals[0].eatMeet(player,game);},\"This animal is fed!\");\n assertThrows (GameException.class, ()->{animals[1].eatMeet(player,game);},\"This animal is fed!\");\n assertThrows (GameException.class, ()->{animals[2].eatMeet(player,game);},\"This animal is fed!\");\n assertThrows (GameException.class, ()->{animals[3].eatMeet(player,game);},\"This animal is fed!\");\n assertThrows (GameException.class, ()->{animals[4].eatMeet(player,game);},\"This animal is fed!\");\n assert (game.getFood()==5); //5= MAX.FOOD-3\n\n //feed animal 5 first\n player.resetFedFlag();\n player.resetFields();\n game.setFood(Constants.MAX_FOOD.getValue());\n animals[4].eatMeet(player,game);\n assertThrows (GameException.class, ()->{animals[0].eatMeet(player,game);},\"This animal is fed!\");\n assertThrows (GameException.class, ()->{animals[1].eatMeet(player,game);},\"This animal is fed!\");\n assertThrows (GameException.class, ()->{animals[2].eatMeet(player,game);},\"This animal is fed!\");\n assertThrows (GameException.class, ()->{animals[3].eatMeet(player,game);},\"This animal is fed!\");\n assertThrows (GameException.class, ()->{animals[4].eatMeet(player,game);},\"This animal is fed!\");\n assert (game.getFood()==5); //max 8-3\n\n //feed animal 5 first, game has less food\n player.resetFedFlag();\n player.resetFields();\n game.setFood(2);\n animals[4].eatMeet(player,game);\n assertThrows (GameException.class, ()->{animals[3].eatMeet(player,game);},\"This animal is fed!\");\n assertThrows (GameException.class, ()->{animals[4].eatMeet(player,game);},\"This animal is fed!\");\n assert (game.getFood()==0);\n assert (animals[0].hungry ==1);\n assert (animals[1].hungry ==1);\n assert (animals[2].hungry ==1);\n\n //feed animal 3 first, game has less food\n player.resetFedFlag();\n player.resetFields();\n game.setFood(2);\n animals[2].eatMeet(player,game);\n assertThrows (GameException.class, ()->{animals[0].eatMeet(player,game);},\"This animal is fed!\");\n assertThrows (GameException.class, ()->{animals[1].eatMeet(player,game);},\"This animal is fed!\");\n assertThrows (GameException.class, ()->{animals[2].eatMeet(player,game);},\"This animal is fed!\");\n assertThrows (GameException.class, ()->{animals[3].eatMeet(player,game);},\"This animal is fed!\");\n assert (animals[4].hungry ==1);\n assert (game.getFood()==0);\n\n //feed big animal\n player.resetFedFlag();\n player.resetFields();\n game.setFood(Constants.MAX_FOOD.getValue());\n animals[0].addProperty(\"Big\");\n animals[2].addProperty(\"Big\");\n player.resetFields();\n animals[0].eatMeet(player,game);\n assertThrows (GameException.class, ()->{animals[1].eatMeet(player,game);},\"This animal is fed!\");\n assert (animals[0].hungry ==1);\n assert (animals[1].hungry ==0);\n assert (animals[2].hungry ==1);\n\n //feed big animal again\n animals[0].eatMeet(player,game);\n assert (animals[0].hungry ==0);\n assert (animals[1].hungry ==0);\n assert (animals[2].hungry ==1);\n }", "@Override\n public void run() {\n int slotsUsed = 0;\n int potentialBananas = 0;\n RSItem[] items = Inventory.getAll();\n for (RSItem item : items) {\n // If this isn't a bone count it\n if (item.getID() < 6904 || item.getID() > 6907) {\n slotsUsed++;\n }\n else {\n // Item id bone amount\n // 6904 1\n // 6905 2\n // 6906 3\n // 6907 4\n potentialBananas += 1 + item.getID() - 6904;\n }\n }\n \n int slotsAvailable = 28 - slotsUsed;\n\n RSItem[] food = Inventory.find(1963);\n\n // If have bananas/peaches, deposit them, else collect bones\n if (food.length > 0) {\n // Heal and then deposit\n float eatHealth = m_settings.m_eatHealth * Skills.getActualLevel(SKILLS.HITPOINTS);\n float eatTo = m_settings.m_eatTo * Skills.getActualLevel(SKILLS.HITPOINTS);\n \n if (food.length > 0 && Skills.getCurrentLevel(SKILLS.HITPOINTS) < eatHealth) {\n // Eat\n while (food.length > 0 && Skills.getCurrentLevel(SKILLS.HITPOINTS) < eatTo) {\n food[0].click(\"Eat\");\n m_script.sleep(300, 600);\n food = Inventory.find(1963);\n }\n }\n else {\n // Deposit\n RSObject[] objs = Objects.findNearest(50, \"Food chute\");\n if (objs.length > 0) {\n while (!objs[0].isOnScreen()) {\n Walking.blindWalkTo(objs[0]);\n m_script.sleep(250);\n }\n objs[0].click(\"Deposit\");\n m_script.sleep(1200);\n }\n }\n }\n else {\n // If we have more than a full load of bananas worth of bones, cast bones to peaches\n if (potentialBananas >= slotsAvailable) {\n // Cast bones to peaches\n Magic.selectSpell(\"Bones to Bananas\");\n }\n else {\n // Collect bananas\n RSObject[] bonePiles = Objects.findNearest(10725, 10726, 10727, 10728);\n if (bonePiles.length > 0) {\n while (!bonePiles[0].isOnScreen()) {\n Walking.blindWalkTo(bonePiles[0]);\n m_script.sleep(250);\n }\n bonePiles[0].click(\"Grab\");\n m_script.sleep(150);\n }\n }\n }\n }", "public boolean isFood() {\n\t\treturn food > 0;\n\t}", "public boolean isFruit()\n\t{\n\t\treturn block == Block.FRUIT;\n\t}", "private boolean hasEatenApple() {\r\n return snake.getHead().equals(apple);\r\n }", "public void cook(Chef chef) {\n new Cooker(chef).cookIngredients(ingredients);\n }", "public String getHealthierFood(FoodItem item)\r\n\t{\r\n\t\tString result = \"\";\t\r\n\t\tif(item == null)\t\t\t\r\n\t\t\treturn result = \"No results for Image\";\r\n\t\tFoodSearch actualFood = searchFoodByActualName(item);\r\n\t\tFoodSearch otherSimilarFoods = searchFoodByGeneralName(item);\r\n\t\tNutrientSearch actualFoodsNutrients = null;\r\n\t\tNutrientSearch otherSimilarFoodsNutrients = null;\r\n\t\tOptional<Nutrient> actualFoodsSugar = null;\r\n\t\tOptional<Nutrient> otherSimilarFoodsSugar = null;\r\n\t\tif(actualFood == null)\r\n\t\t{\r\n\t\t\t//TODO: If searchFoodByActualName returns null, then search food by General name, and get first healthier option from there!\r\n\t\t\tresult = \"Food from image uploaded does not exist in database. Kindly try with another food item\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(actualFood == null || actualFood.getList() == null || actualFood.getList().getItem().size() == 0 || actualFood.getList().getItem().get(0) == null)\r\n\t\t\t{\r\n\t\t\t\tresult = \"Data 1 Not Properly Formed for Request. Please Try Again. If Error Persists, use another image\";\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t\tif(otherSimilarFoods == null || otherSimilarFoods.getList() == null || otherSimilarFoods.getList().getItem().size() == 0)\r\n\t\t\t{\r\n\t\t\t\tresult = \"Data 2 Not Properly Formed for Request. Please Try Again. If Error Persists, use another image\";\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t\tactualFoodsNutrients = searchNutrientByFoodNo(actualFood.getList().getItem().get(0).getNdbno());\r\n\t\t\t//Below line of code finds the first Nutrient object containing \"sugar\". Sugar is the parameter we use to determine healtier option\r\n\t\t\tactualFoodsSugar = actualFoodsNutrients.getReport().getFood().getNutrients().stream().filter(x -> x.getName().toUpperCase().contains(Constants.SUGAR)).findFirst();\r\n\t\t\tif(!actualFoodsSugar.isPresent())\r\n\t\t\t{\r\n\t\t\t\treturn result = \"No results for Image. Sugar content unavailable\";\r\n\t\t\t}\r\n\t\t\tdouble actualFoodSugarNum = Double.valueOf(actualFoodsSugar.get().getValue());\r\n\t\t\tif(actualFoodSugarNum <= 0)\r\n\t\t\t{\r\n\t\t\t\treturn result = \"The image you uploaded is the healthiest kind of \" + item.getGeneralFoodName() + \" there is!\" + \" It has zero sugars.\";\r\n\t\t\t}\r\n\t\t\tfor(Item element: otherSimilarFoods.getList().getItem())\r\n\t\t\t{\r\n\t\t\t\totherSimilarFoodsNutrients = searchNutrientByFoodNo(element.getNdbno());\r\n\t\t\t\totherSimilarFoodsSugar = otherSimilarFoodsNutrients.getReport().getFood().getNutrients().stream().filter(x -> x.getName().toUpperCase().contains(Constants.SUGAR)).findFirst();\r\n\t\t\t\tif(!otherSimilarFoodsSugar.isPresent())\r\n\t\t\t\t\tcontinue;\t\t\t\t\r\n\t\t\t\tdouble otherFoodsSugarNum = Double.valueOf(otherSimilarFoodsSugar.get().getValue());\r\n\t\t\t\tif(otherFoodsSugarNum < actualFoodSugarNum)\r\n\t\t\t\t{\r\n\t\t\t\t\tdouble scale = Math.pow(10, 2);\r\n\t\t\t\t\tdouble percentDiff = ((actualFoodSugarNum - otherFoodsSugarNum)/actualFoodSugarNum) * 100;\r\n\t\t\t\t\tpercentDiff = Math.round(percentDiff * scale) / scale;\r\n\t\t\t\t\tString manufacturer = (element.getManu().equals(\"none\")) ? \"N/A\" : element.getManu();\r\n\t\t\t\t\t//result = element.getName() + \" is a healther option.\" + \"\\n\" + \"Made by: \" + manufacturer + \"\\n\" + \"It has \" + percentDiff + \" percent less sugar\";\r\n\t\t\t\t\t//result = \"Healthier option found \";\r\n\t\t\t\t\tresult = \" A healthier option is: \" + element.getName() + \"\\n\" + \"Made by: \" + manufacturer + \"\\n\" + \"It has \" + percentDiff + \" percent less sugar\";\r\n\t\t\t\t\tresult = Utilities.encodeHtml(result);\r\n\t\t\t\t\tresult = Utilities.encodeJavaScript(result);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t\tif(result.isEmpty())\r\n\t\t\t\tresult = \"No healthier option found. Kindly go with the image uploaded\";\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "private void doItemVerification() {\n\t\tif (actor != null && !actor.attributes.getInventory().contains(Items.FISHING_ROD)) {\r\n\t\t\tactor.say(\"fishing.norod\", getAssigningPlayer());\r\n\t\t\treset();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tactor.setHeldItem(actor.attributes.getInventory()\r\n\t\t\t\t.getStackInSlot(actor.attributes.getInventory().getFirstSlotContainingItem(Items.FISHING_ROD))\r\n\t\t\t\t.getItem());\r\n\t}", "public void use(Consume item)\r\n {\r\n int gain = item.getRating();\r\n health += gain;\r\n \r\n if (health > maxHealth)\r\n health = maxHealth;\r\n \r\n say(\"I gained \" + gain + \" health by using \" + item.getName() + \" and now have \" + health + \"/\" + maxHealth);\r\n \r\n items.remove(item);\r\n }", "float shouldEatOffTheGround(IGeneticMob geneticMob, EntityItem itemEntity);", "public static boolean [] action (Species [][] map, int x, int y, int plantHealth) {\n \n // Actions: sheep eat = actionChoice[0], wolves eat = actionChoice[1], fight = actionChoice[2]\n boolean [] actionChoice = new boolean [] {false, false, false};\n \n // Find any animals and see if they have enough energy\n if ((map[y][x] != null) && (!(map[y][x] instanceof Plant)) && (((Animals)map[y][x]).getEnergy() > 0) ) {\n \n // Make sure in bounds\n if ((y > 0) && (y < map[0].length - 2) && (x > 0) && (x < map.length - 2)) {\n \n // Sheep decisions (sheep cannot decide whether or not to move away from wolves)\n if (map[y][x] instanceof Sheep) {\n \n // First choice is to eat\n if ((map[y-1][x] instanceof Plant) || (map[y+1][x] instanceof Plant) || (map[y][x-1] instanceof Plant) || (map[y][x+1] instanceof Plant)) {\n actionChoice[0] = true; \n }\n \n // Wolf decisions\n } else if (map[y][x] instanceof Wolf) {\n \n // First choice is to eat\n if ((map[y-1][x] instanceof Sheep) || (map[y+1][x] instanceof Sheep) || (map[y][x-1] instanceof Sheep) || (map[y][x+1] instanceof Sheep)) {\n actionChoice[1] = true;\n \n // Second choice is to fight a weaker wolf\n } else if ((map[y-1][x] instanceof Wolf) || (map[y+1][x] instanceof Wolf) || (map[y][x-1] instanceof Wolf) || (map[y][x+1] instanceof Wolf)) {\n actionChoice[2] = true;\n }\n \n }\n }\n \n }\n return actionChoice; // Returns what action the animal should do\n }", "@Test\n\tpublic void testInventoryNotEnoughChocolate() {\n\t\tcoffeeMaker.addRecipe(recipe5);\n\t\tassertEquals(1000, coffeeMaker.makeCoffee(0, 1000));\n\t}", "public static void main(String[] args) {\n\r\n Ingredient ingredient=new Ingredient();\r\n\r\n Food pasta=new Pasta();\r\n String pastaItems=ingredient.getPastaItems();\r\n pasta.prepareFood(pastaItems);\r\n System.out.println(pasta.deliverFood());\r\n\r\n\r\n System.out.println(\"------------FACADE---------------\");\r\n\r\n System.out.println(Waiter.deliveryFood(FoodType.PASTA));\r\n\r\n\r\n\r\n\r\n\r\n\r\n }", "@Test\n\tpublic void testPurchaseBeverageEnoughMoney() {\n\t\twhen(mockCoffeeMaker.getRecipes()).thenReturn(recipeList);\n\t\tassertEquals(100, mockCoffeeMaker.makeCoffee(0, 150));\n\t}", "@Test\r\n public void testAddRecipe() {\r\n assertTrue(coffeeMaker.addRecipe(recipe1));\r\n assertTrue(coffeeMaker.addRecipe(recipe2));\r\n assertTrue(coffeeMaker.addRecipe(recipe3));\r\n assertFalse(coffeeMaker.addRecipe(recipe4)); // this should pass, Only three recipes may be added to the CoffeeMaker.\r\n }", "private double lookingforFoodPhase(double time) {\n\n\t\t// Determine preferred kitchen to get meal.\n\t\tif (kitchen == null) {\n\t\t\tkitchen = getKitchenWithMeal(person);\n\n\t\t\tif (kitchen == null) {\n\t\t\t\t// If no kitchen found, look for preserved food.\n//\t\t\t\tlogger.info(person + \" couldn't find a kitchen with cooked meals and will look for preserved food.\");\n\t\t\t\tsetPhase(EAT_PRESERVED_FOOD);\n\t\t\t}\n\t\t}\n\t\n\t\tif (kitchen != null) {\n\t\t\t// Walk to kitchen.\n\t\t\twalkToActivitySpotInBuilding(kitchen.getBuilding(), FunctionType.DINING, true);\n\t\t\t\n\t\t\t// Pick up a meal at kitchen if one is available.\n\t\t\tcookedMeal = kitchen.chooseAMeal(person);\n\t\t\tif (cookedMeal != null) {\n\t\t\t\tsetDescription(Msg.getString(\"Task.description.eatDrink.cooked.pickingUp.detail\", cookedMeal.getName())); //$NON-NLS-1$\n\t\t\t\tLogConsolidated.log(Level.INFO, 0, sourceName,\n\t\t\t\t\t\t\"[\" + person.getLocationTag().getLocale() + \"] \" + person\n\t\t\t\t\t\t\t\t+ \" picked up a cooked meal '\" + cookedMeal.getName() \n\t\t\t\t\t\t\t\t+ \"' to eat in \" + person.getLocationTag().getImmediateLocation() + \".\");\n\t\t\t\tsetPhase(EAT_MEAL);\n\t\t\t}\n\t\t\telse {\n//\t\t\t\tlogger.info(person + \" couldn't find any cooked meals in this kitchen and will look for preserved food.\");\n\t\t\t\t// If no kitchen found, look for preserved food.\n\t\t\t\tsetPhase(EAT_PRESERVED_FOOD);\n\t\t\t}\n\t\t}\n\n\t\treturn time *.9;\n\t}", "public boolean hasFood() {\r\n\t\treturn this.food > 0;\r\n\t}", "public void addPatty() {\n\t\tMyStack newBurger = new MyStack();\n\t\tif (pattyCount < MAX_PATTY) {\n\t\t\twhile (myBurger.size() != 0) {\n\t\t\t\tString top = (String) myBurger.peek();\n\t\t\t\tif (pattyCount > 0) {\n\t\t\t\t\tif (top.equals(\"Cheddar\") || top.equals(\"Mozzarella\") || top.equals(\"Pepperjack\")\t\n\t\t\t\t\t\t\t|| top.equals(\"Beef\") || top.equals(\"Chicken\") || top.equals(\"Veggie\")) {\t\n\t\t\t\t\t\tnewBurger.push(\"Beef\");\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tString ingredient = (String) myBurger.pop();\t\t\t\t\t\n\t\t\t\t\t\tnewBurger.push(ingredient);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t} \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tString ingredient = (String) myBurger.pop();\t\t\t\t\t\t\n\t\t\t\t\tnewBurger.push(ingredient);\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t} else if (pattyCount == 0) {\n\t\t\t\t\tif (top.equals(\"Mushrooms\") || top.equals(\"Mustard\") || top.equals(\"Ketchup\")\n\t\t\t\t\t\t\t|| top.equals(\"Bottom Bun\")) {\n\t\t\t\t\t\tnewBurger.push(\"Beef\");\n\t\t\t\t\t\tString ingredient = (String) myBurger.pop();\n\t\t\t\t\t\tnewBurger.push(ingredient);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} \n\t\t\t\t\tString ingredient = (String) myBurger.pop();\n\t\t\t\t\tnewBurger.push(ingredient);\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (myBurger.size() != 0) {\n\t\t\t\tString ingredient = (String) myBurger.pop();\n\t\t\t\tnewBurger.push(ingredient);\n\t\t\t}\n\t\t\twhile (newBurger.size() != 0) {\n\t\t\t\tString ingredient = (String) newBurger.pop();\n\t\t\t\tmyBurger.push(ingredient);\n\t\t\t}\n\t\t\tpattyCount++;\n\t\t} else {\n\t\t\tSystem.out.println(\"cant add anymore patties\");\n\t\t}\n\t}", "public static boolean isValidFood(ItemStack itemStack) {\n\t\tItem item = itemStack.getItem();\n\n\t\t// Regular ItemFood\n\t\tif (item instanceof ItemFood)\n\t\t\treturn true;\n\n\t\t// Cake - Vanilla\n\t\tif (item instanceof ItemBlock && ((ItemBlock) item).getBlock() instanceof BlockCake)\n\t\t\treturn true;\n\n\t\t// Cake - Modded\n\t\tif (item instanceof ItemBlockSpecial && ((ItemBlockSpecial) item).getBlock() instanceof BlockCake)\n\t\t\treturn true;\n\n\t\t// Milk Bucket\n\t\tif (item instanceof ItemBucketMilk)\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "public boolean getFoodFromCooperation(Creature creature, Creature otherCreature){\n if(!creature.isSatisfied()){\n\n for(CreaturesPair creaturesPair : cooperationCreatures){\n if(!creaturesPair.card.isUsed() && creaturesPair.haveCreatures(creature, otherCreature)){\n creaturesPair.card.setUsed(true);\n creature.addFood();\n return true;\n }\n }\n\n }\n return false;\n }", "@Test\n public void test_4drink_fail_insufficient_ingredient() throws ExecutionException, InterruptedException {\n int countOutlets = 3;\n HashMap<String, Integer> ingredientsQuantity = new HashMap<>();\n ingredientsQuantity.put(HOT_WATER, 10);\n ingredientsQuantity.put(HOT_MILK, 10);\n ingredientsQuantity.put(GINGER_SYRUP, 10);\n ingredientsQuantity.put(SUGAR_SYRUP, 10);\n ingredientsQuantity.put(TEA_LEAVES_SYRUP, 10);\n\n HashMap<String, Map<String, Integer>> beverages = new HashMap<>();\n Map<String, Integer> hotTea = new HashMap<>();\n hotTea.put(HOT_WATER, 200);\n hotTea.put(GINGER_SYRUP, 10);\n hotTea.put(HOT_MILK, 200);\n hotTea.put(TEA_LEAVES_SYRUP, 30);\n\n String drink1 = \"hot_tea\";\n beverages.put(drink1, hotTea);\n\n Map<String, Integer> hotCoffee = new HashMap<>();\n hotCoffee.put(HOT_WATER, 100);\n hotCoffee.put(GINGER_SYRUP, 30);\n hotCoffee.put(HOT_MILK, 400);\n hotCoffee.put(TEA_LEAVES_SYRUP, 30);\n hotCoffee.put(SUGAR_SYRUP, 30);\n\n String drink2 = \"hot_coffee\";\n beverages.put(drink2, hotCoffee);\n\n Map<String, Integer> blackTea = new HashMap<>();\n blackTea.put(HOT_WATER, 300);\n blackTea.put(GINGER_SYRUP, 30);\n blackTea.put(TEA_LEAVES_SYRUP, 30);\n blackTea.put(SUGAR_SYRUP, 50);\n\n String drink3 = \"black_tea\";\n beverages.put(drink3, blackTea);\n\n Map<String, Integer> greenTea = new HashMap<>();\n greenTea.put(HOT_WATER, 500);\n greenTea.put(GINGER_SYRUP, 30);\n greenTea.put(TEA_LEAVES_SYRUP, 10);\n greenTea.put(SUGAR_SYRUP, 10);\n\n String drink4 = \"green_tea\";\n beverages.put(drink4, greenTea);\n\n\n RequestPayload requestPayload = new RequestPayload(countOutlets, ingredientsQuantity, beverages);\n CoffeeMachineService cms = new CoffeeMachineService(requestPayload);\n Map<String, ResponseTemplate> resp = cms.brewDrinks();\n int successCount = 0;\n for(Map.Entry<String, ResponseTemplate> entry: resp.entrySet()){\n if(entry.getValue().getStatus()) successCount++;\n }\n Assert.assertEquals(0, successCount);\n }", "abstract int food();", "private void eat(Person victim)\r\n { \r\n int defense = 0;\r\n if (victim.getEquip(Equip.ARMOR)!=null)\r\n defense = victim.getEquip(Equip.ARMOR).getRating();\r\n \r\n int hits = weapon.getRating() - defense;\r\n if (hits < 0)\r\n hits = 0;\r\n \r\n if (victim != this) //don't eat yourself\r\n {\r\n say(\"Grrr! I eat tasty \" + victim.getName() + \"!\");\r\n victim.suffer(hits);\r\n }\r\n }", "public void check() {\n Ellipse2D.Double head = snakeParts.get(0);\n Food food = gameGround.getFood();\n\n // Ate itself\n for (int i = 1; i < snakeParts.size(); i++) {\n if (head.getMinX() == snakeParts.get(i).getMinX() && head.getMinY() == snakeParts.get(i).getMinY()) {\n over = true;\n return;\n }\n }\n\n // Ate food\n if (head.getMinX() == food.getShape().getMinX() && head.getMinY() == food.getShape().getMinY()) {\n scoreBoard.addPoints(1);\n food.next(this);\n snakeParts.add(ass);\n }\n }", "private void useItem(String itemToUse) {\n if (itemToUse.equalsIgnoreCase(\"\") || itemToUse.equalsIgnoreCase(\"use\")) {\n System.out.println(\"Use what?\");\n return;\n }\n\n // Get a reference to the item\n Item item = player.getItemFromInventory(itemToUse);\n\n // If the reference is not null (i.e., the Item exists)\n if (item != null) {\n // Display a message\n System.out.println(\"You use the \" + item.getName());\n\n // Check if using the item will destroy a creature\n if (currentRoom.getCreature() != null && currentRoom.getCreature().getItemToDestroy() != null && currentRoom.getCreature().getItemToDestroy() == item) {\n // Display the text for defeating the creature. \n System.out.println(currentRoom.getCreature().getDefeatedText());\n currentRoom.setCreature(null);\n\n // Remove the item from the Player's inventory.\n player.removeItemFromInventory(item);\n }\n } // The player does not have the specified item\n else {\n System.out.println(\"There is no \" + itemToUse + \" in your inventory.\");\n }\n }", "public void setFoodHit(boolean b) {\n this.foodHit = b;\n }", "@Test\r\n\tpublic void MakeBeverageTest() throws InsuficientException, InterruptedException\r\n\t{\n\t\tmachine.MakeBeverage(\"Tea\", machine.GetOutlet(1));\r\n\t\tmachine.MakeBeverage(\"Tea\", machine.GetOutlet(0));\r\n\t\tSystem.out.println(\"Servered Successfully !!\");\r\n\t}", "public void createFood() {\n }", "public void eat() {\n int index;\n Cell selectedCell;\n if (getFoodArray() != null) {\n \n if (getFoodCount() > 0) {\n dayCountDown = getMaxHunger();\n index = RandomGenerator.nextNumber(getFoodCount());\n selectedCell = getFoodArray().get(index);\n \n if (getLocation().hasNotMove()) {\n new Holdable(getLocation()).init();\n this.setCell(selectedCell);\n \n getLocation().setMoved(false);\n }\n } else if (getLocation().getEmptyCount() != 0) {\n index = RandomGenerator.nextNumber(getLocation()\n .getEmptyCount());\n selectedCell = getLocation().getEmptyArray().get(index);\n \n if (getLocation().hasNotMove()) {\n dayCountDown--;\n new Holdable(getLocation()).init();\n this.setCell(selectedCell);\n \n \n getLocation().setMoved(false);\n }\n } else {\n dayCountDown--;\n getLocation().setMoved(false);\n }\n }\n \n }", "public void insertFoodItem(FoodItem f){\n int flag = 0;\n\t\tfor(int i=0; i<fooditem.length; i++){\n\n\t\t\tif (fooditem[i]!= null) {\n\t\t\t\tif (fooditem[i].getFid().equals(f.getFid())) {\n\t\t\t\t\tSystem.out.println(\"Opps! The Food ID already exists!\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(fooditem[i] == null){\n\t\t\t\tfooditem[i] = f;\n\t\t\t\tflag = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(flag == 1)\n\t\t{\n\t\t\tSystem.out.println(\"Food Dish Inserted\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"Can Not Insert\");\n\t\t}\n\n }", "@Test\r\n public void testPurChaseBeverageWithNotEnoughMoney() {\r\n coffeeMaker.addRecipe(recipe1); // cost 50\r\n assertEquals(25, coffeeMaker.makeCoffee(0, 25)); // not enough amount paid\r\n }", "@Test void addIngredientZero()\n {\n }", "public boolean isFood(){\n\t\treturn foodFlag;\n\t}", "public void addIngredient(String type) {\n\t\tBurger fullBurger1 = new Burger(true);\n\t\tBurger fullBurger2 = new Burger(true);\n\n\t\tfullBurger1.removeIngredient(\"Beef\");\n\t\tfullBurger2.removeIngredient(\"Beef\");\n\n\t\tint howManyBeef = this.howMany(\"Beef\");\n\t\tint howManyChicken = this.howMany(\"Chicken\");\n\t\tint howManyVeggie = this.howMany(\"Veggie\");\n\n\t\tif (this.has(\"Beef\")) {\n\t\t\tfor (int i = 0; i < howManyBeef; i++) {\n\t\t\t\tfullBurger1.addPatty();\n\t\t\t\tfullBurger2.addPatty();\n\t\t\t}\n\t\t}\n\t\tif (this.has(\"Chicken\")) {\n\t\t\tfor (int i = 0; i < howManyChicken; i++) {\n\t\t\t\tfullBurger1.addGeneralPatty(\"Chicken\");\n\t\t\t\tfullBurger2.addGeneralPatty(\"Chicken\");\n\t\t\t}\n\t\t}\n\t\tif (this.has(\"Veggie\")) {\n\t\t\tfor (int i = 0; i < howManyVeggie; i++) {\n\t\t\t\tfullBurger1.addGeneralPatty(\"Veggie\");\n\t\t\t\tfullBurger2.addGeneralPatty(\"Veggie\");\n\t\t\t}\n\t\t}\n\t\tmyBurger.push(type);\t\n\t\twhile (myBurger.size() != 0) {\n\t\t\tString top = (String) myBurger.peek();\n\t\t\tfullBurger1.removeIngredient(top);\n\t\t\tthis.removeIngredient(top);\n\t\t}\n\n\t\twhile (fullBurger1.myBurger.size() != 0) {\n\t\t\tString top = (String) fullBurger1.myBurger.peek();\n\t\t\tfullBurger2.removeIngredient(top);\n\t\t\tfullBurger1.removeIngredient(top);\n\t\t}\n\t\tint totalPatties = howManyBeef + howManyChicken + howManyVeggie;\n\t\tmyBurger = fullBurger2.myBurger;\n\t\tpattyCount = pattyCount + totalPatties;\n\t\tif (type.equals(\"Beef\") || type.equals(\"Chicken\") || type.equals(\"Veggie\")) {\n\t\t\tpattyCount++;\n\t\t}\n\t}", "@Test void addIngredientBoundary()\n {\n }", "public static int showFoods(String cuisin){\r\n int check=0;\r\n for(int i=0;i<foods.size();i++){\r\n if(foods.get(i).getCousin().toLowerCase().equals(cuisin.toLowerCase())){\r\n System.out.println(i+\".-\"+foods.get(i).getName()+\" --> \"+foods.get(i).getDescription()+\" --> \"+foods.get(i).getType()+\" --> \"+foods.get(i).getPrice());\r\n check=1;\r\n }\r\n }\r\n if(check==0)\r\n System.out.println(\"There are not food in this category\");\r\n return check;\r\n }", "public static int showFoods(String cuisin, String type){\r\n int check=0;\r\n for(int i=0;i<foods.size();i++){\r\n if(foods.get(i).getCousin().toLowerCase().equals(cuisin.toLowerCase())\r\n && foods.get(i).getType().toLowerCase().equals(type)){\r\n System.out.println(i+\".-\"+foods.get(i).getName()+\" --> \"+foods.get(i).getDescription()+\" --> \"+foods.get(i).getPrice());\r\n check=1;\r\n }\r\n }\r\n if(check==0)\r\n System.out.println(\"There are not food in this category\");\r\n return check;\r\n }", "private void findFood() {\n\t\tAgentSpace agentSpace = Blackboard.inst().getSpace(AgentSpace.class, _obj.getName());\n\t\tMap<String,FoodEntry> map = agentSpace.getScentMemories().getFirst();\n\t\tif (map == null || map.size() == 0) { \n\t\t\tlogger.error(\"Should not happen\");\n\t\t\treturn;\n\t\t}\n\n\t\t_food = null;\n\t\tfloat distance = 0;\n\t\t\n\t\tfor (FoodEntry entry : map.values()) { \n\t\t\tfloat d = _obj.getPPosition().sub(entry.obj.getPPosition()).length();\n\t\t\tif (_food == null || d < distance) { \n\t\t\t\t_food = entry.obj;\n\t\t\t\tdistance = d;\n\t\t\t}\n\t\t}\n\t}", "public void addFood(int quantity) {\n if (quantity > 0) {\n this.food += quantity;\n System.out.printf(\"\\u001B[34mINFO:\\u001B[0m %d of food added.\\n\", quantity);\n } else {\n System.out.println(\"\\u001B[34mINFO:\\u001B[0m There are no food to add.\");\n }\n }", "public void eatApple(){\n int rowsOld = snakePartList.get(SnakePartMaxID).getSnakePartRowsOld();\n int collsOld = snakePartList.get(SnakePartMaxID).getSnakePartCollsOld();\n\n snakePartList.add(new SnakePart(rowsOld, collsOld, SnakePartMaxID));\n board[rowsOld][collsOld] = 'S';\n SnakePartMaxID++;\n appleCount++;\n generateNewBoardAfterWin();\n spawnApples();\n }", "public void serveFood() {\r\n System.out.println(\"Serving food from \" + name + \" is a \" + type + \" restaurant\");\r\n }", "public boolean foodDetection() {\n ArrayList<Creature> creatures = world.getCreatureList();\n for (Creature c : creatures) {\n if (c.creatureLocation().equals((x + 1) + \",\" + y) || c.creatureLocation().equals((x - 1) + \",\" + y) ||\n c.creatureLocation().equals(x + \",\" + (y + 1)) || c.creatureLocation().equals(x + \",\" + (y - 1))) {\n //System.out.println(\"Creature Found: \" + c.creatureLocation());\n return true;\n }\n }\n return false;\n }", "private void addGeneralPatty(String s) {\n\t\tMyStack newBurger = new MyStack();\n\t\tif (pattyCount < MAX_PATTY) {\n\t\t\twhile (myBurger.size() != 0) {\n\t\t\t\tString top = (String) myBurger.peek();\n\t\t\t\tif (pattyCount > 0) {\n\t\t\t\t\tif (top.equals(\"Cheddar\") || top.equals(\"Mozzarella\") || top.equals(\"Pepperjack\")\t\n\t\t\t\t\t\t\t|| top.equals(\"Beef\") || top.equals(\"Chicken\") || top.equals(\"Veggie\")) {\t\n\t\t\t\t\t\tif (s.equals(\"Beef\")) {\n\t\t\t\t\t\t\tnewBurger.push(\"Beef\");\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString ingredient = (String) myBurger.pop();\t\t\t\t\t\n\t\t\t\t\t\t\tnewBurger.push(ingredient);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (s.equals(\"Chicken\")) {\n\t\t\t\t\t\t\tnewBurger.push(\"Chicken\");\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString ingredient = (String) myBurger.pop();\t\t\t\t\t\n\t\t\t\t\t\t\tnewBurger.push(ingredient);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (s.equals(\"Veggie\")) {\n\t\t\t\t\t\t\tnewBurger.push(\"Veggie\");\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString ingredient = (String) myBurger.pop();\t\t\t\t\t\n\t\t\t\t\t\t\tnewBurger.push(ingredient);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t} \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tString ingredient = (String) myBurger.pop();\t\t\t\t\t\t\n\t\t\t\t\tnewBurger.push(ingredient);\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t} else if (pattyCount == 0) {\n\t\t\t\t\tif (top.equals(\"Mushrooms\") || top.equals(\"Mustard\") || top.equals(\"Ketchup\")\n\t\t\t\t\t\t\t|| top.equals(\"Bottom Bun\")) {\n\t\t\t\t\t\tif (s.equals(\"Beef\")) {\n\t\t\t\t\t\t\tnewBurger.push(\"Beef\");\n\t\t\t\t\t\t\tString ingredient = (String) myBurger.pop();\n\t\t\t\t\t\t\tnewBurger.push(ingredient);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} if (s.equals(\"Chicken\")) {\n\t\t\t\t\t\t\tnewBurger.push(\"Chicken\");\n\t\t\t\t\t\t\tString ingredient = (String) myBurger.pop();\n\t\t\t\t\t\t\tnewBurger.push(ingredient);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} if (s.equals(\"Veggie\")) {\n\t\t\t\t\t\t\tnewBurger.push(\"Veggie\");\n\t\t\t\t\t\t\tString ingredient = (String) myBurger.pop();\n\t\t\t\t\t\t\tnewBurger.push(ingredient);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t\tString ingredient = (String) myBurger.pop();\n\t\t\t\t\tnewBurger.push(ingredient);\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (myBurger.size() != 0) {\n\t\t\t\tString ingredient = (String) myBurger.pop();\n\t\t\t\tnewBurger.push(ingredient);\n\t\t\t}\n\t\t\twhile (newBurger.size() != 0) {\n\t\t\t\tString ingredient = (String) newBurger.pop();\n\t\t\t\tmyBurger.push(ingredient);\n\t\t\t}\n\t\t\tpattyCount++;\n\t\t} else {\n\t\t\tSystem.out.println(\"cant add anymore patties\");\n\t\t}\n\t}" ]
[ "0.65657204", "0.65454125", "0.6319383", "0.6147356", "0.60614693", "0.6047957", "0.59388715", "0.59068394", "0.59014297", "0.58517694", "0.58496034", "0.5796155", "0.5760498", "0.57594585", "0.5753925", "0.57488686", "0.57158303", "0.5713619", "0.5708383", "0.56982744", "0.566726", "0.5665486", "0.5654932", "0.564177", "0.5630424", "0.56203604", "0.5584481", "0.55722344", "0.5568839", "0.5544757", "0.5528578", "0.55284745", "0.55169576", "0.551596", "0.5515018", "0.55148536", "0.548113", "0.54689914", "0.5468535", "0.5433856", "0.54234177", "0.54234177", "0.5414342", "0.54137075", "0.5411145", "0.54091096", "0.5407573", "0.54006565", "0.538566", "0.53507215", "0.5335669", "0.5317197", "0.5314732", "0.5300195", "0.5298068", "0.526833", "0.52564603", "0.5254823", "0.5250984", "0.52422714", "0.52289", "0.5215888", "0.5215381", "0.5212017", "0.5206216", "0.5195469", "0.51825625", "0.5176858", "0.5169853", "0.5162076", "0.51431304", "0.5142162", "0.51398873", "0.5139427", "0.51302373", "0.512213", "0.51217186", "0.5110575", "0.5104187", "0.50882304", "0.50731045", "0.5060811", "0.50573176", "0.50560755", "0.50494874", "0.50438774", "0.5043711", "0.503983", "0.5034837", "0.50322694", "0.5031647", "0.5026338", "0.5025968", "0.5024866", "0.50162137", "0.50151664", "0.5014961", "0.5010884", "0.50099456", "0.500677" ]
0.7230623
0
Confirm that toString produces the correct string details.
@Test public final void testToString() { animal.moveTo(testForest); assertEquals(animal.toString(), "[Animal: Possum, Type: Mammal, Gender: male, Legs: 4" + " is in " + testForest.toString() + "]"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void testToString_True() {\n\n\t\tString result = \"\";\n\t\tresult = \"\\n*************Title: \" + book1.getTitle();\n\t\tresult += \"\\n*************Author: \" + book1.getAuthor();\n\t\tresult += \"\\n*************Publication Year: \" + book1.getPublicationDate();\n\t\tresult += \"\\n*************ISBN: \" + book1.getIsbnNumber() + \"\\n \";\n\t\tassertEquals(result, book1.toString());\n\n\t}", "@Test\n\tpublic void testToString() {\n\t\tString result = email + \" \" + amount;\n\t\tassertEquals(\"Test : toString()\", bid.toString(), result);\n\t}", "@Test\n\tpublic void testToString() {\n\t\tassertEquals(\"Proper string format\", basic.toString(), \"5, 5\");\n\t}", "@Test\n public void toString_shouldReturnInCorrectFormat() {\n Task task = new Task(\"Test\");\n String expected = \"[N] Test\";\n Assertions.assertEquals(expected, task.toString());\n }", "@Test\r\n\tpublic void testToString() {\r\n\t\tPerson p1 = new Person(1, \"JavaLord\", \"hunter2\", \"The Lord of Java\");\r\n\t\tString s = p1.toString();\r\n\t\tassertTrue(s.equals(\"JavaLord:hunter2:The Lord of Java\"));\r\n\t}", "@Test\n public void toStringTest() {\n String expected = \"Pepper Potts has an hourly salary of 16.00 and has worked 152 this month\";\n\n assertEquals(\"The expected string output does not match the actual\",\n expected, e1.toString());\n\n }", "@Test\n\tpublic void testToString() {\n\t\tSystem.out.println(\"toString\");\n\t\tDeleteTask task = new DeleteTask(1);\n\t\tassertEquals(task.toString(), \"DeleteTask -- [filePath=1]\");\n\t}", "public void testToString()\n {\n // test making a few EthernetAddresss and check that the toString\n // gives back the same value in string form that was used to create it\n \n // test the null EthernetAddress\n EthernetAddress ethernet_address = new EthernetAddress(0L);\n assertEquals(\"null EthernetAddress string and toString did not match\",\n NULL_ETHERNET_ADDRESS_STRING.toLowerCase(),\n ethernet_address.toString().toLowerCase());\n \n // test a non-null EthernetAddress\n ethernet_address =\n new EthernetAddress(VALID_ETHERNET_ADDRESS_BYTE_ARRAY);\n assertEquals(\n \"EthernetAddress string and toString results did not match\",\n MIXED_CASE_VALID_ETHERNET_ADDRESS_STRING.toLowerCase(),\n ethernet_address.toString().toLowerCase());\n \n // EthernetAddress implementation returns strings all lowercase.\n // Although relying on this behavior in code is not recommended,\n // here is a unit test which will break if this assumption\n // becomes bad. This will act as an early warning to anyone\n // who relies on this particular behavior.\n ethernet_address =\n new EthernetAddress(VALID_ETHERNET_ADDRESS_BYTE_ARRAY);\n assertFalse(\"mixed case EthernetAddress string and toString \" +\n \"matched (expected toString to be all lower case)\",\n MIXED_CASE_VALID_ETHERNET_ADDRESS_STRING.equals(\n ethernet_address.toString()));\n assertEquals(\"mixed case string toLowerCase and \" +\n \"toString results did not match (expected toString to \" +\n \"be all lower case)\",\n MIXED_CASE_VALID_ETHERNET_ADDRESS_STRING.toLowerCase(),\n ethernet_address.toString());\n }", "@Test\n public void testToString() {\n assertEquals(jesseOberstein.toString(),\n \"joberste\" + \"\\n\" + \"Jesse\" + \"\\n\" + \"Oberstein\" + \"\\n\"\n + \"Mazor\" + \"\\n\" + \"2017\" + \"\\n\");\n assertFalse(nathanGoodman.toString().equals(\"Nathan Goodman\"));\n }", "@Test\n\tpublic void testToString_False() {\n\n\t\tString result = \"\";\n\t\tresult = \"\\n*************Title: \" + book1.getTitle();\n\t\tresult += \"\\n*************Author: \" + book1.getAuthor();\n\t\tresult += \"\\n*************Publication Year: \" + book1.getPublicationDate();\n\t\tresult += \"\\n*************ISBN: \" + book1.getIsbnNumber() + \"\\n \";\n\n\t\tassertNotEquals(result, book2.toString());\n\t}", "@Test\n public void testToString() {\n System.out.println(\"Animal.toString\");\n assertEquals(\"Abstract Axe (17 yo Aardvark) resides in cage #202\", animal1.toString());\n assertEquals(\"Brave Beard (3 yo Beaver) resides in cage #112\", animal2.toString());\n }", "@Test\n\tpublic void testaToString() {\n\t\tcontato = new Contato(\"Jardely\", \"Maris\", \"984653722\");\n\t\tassertEquals(contato.toString(), \"Jardely Maris - 984653722\");\n\t}", "@Test\r\n public void testToString() {\r\n System.out.println(\"*****************\");\r\n System.out.println(\"Test : toString\");\r\n Cours_Reservation instance = new Cours_Reservation();\r\n instance.setFormation(\"Miage\");\r\n instance.setModule(\"programmation\");\r\n String expResult = instance.getFormation() + \"\\n\" + instance.getModule() ;\r\n String result = instance.toString();\r\n assertEquals(expResult, result);\r\n }", "@Test\r\n public void testToString() {\r\n System.out.println(\"toString\");\r\n Simulacao instance = new Simulacao(TipoDPolarizacao.ABSORCAO);\r\n String expResult = \"Simulacao{\" + \"tipoDPolarizacao=\" + instance.getTipoDPolarizacao() + '}';\r\n String result = instance.toString();\r\n assertEquals(expResult, result);\r\n }", "@Test\n public void testToString() {\n System.out.println(\"toString\");\n String expResult = \"Name: Gates, Bill\" + \"\\n\"\n + \"Date of Birth: 09/05/1993\";\n String result = customer.toString();\n assertEquals(expResult, result);\n }", "@Test\r\n\tpublic void toStringValid() {\r\n\t\ttestObj.addNativeField(0);\r\n\t\ttestObj.addNativeField(1);\r\n\t\ttestObj.addRelatedTable(0);\r\n\t\ttestObj.addRelatedTable(1);\r\n\t\ttestObj.makeArrays();\r\n\t\ttestObj.toString();\r\n\t\tassertEquals(\"Output string should have valid data\", \"Table: 1\\r\\n{\\r\\nTableName: test\\r\\nNativeFields: 0|1\\r\\nRelatedTables: 0|1\\r\\nRelatedFields: 0|0\\r\\n}\\r\\n\", testObj.toString());\r\n\t}", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "@Test \n\tpublic void testToString() {\n\t\t\n\t\tString saida = \"decio neto - 56554522\";\n\t\tassertEquals(contato1.toString(), saida);\n\t}", "@Test\r\n public void testToString() {\r\n // TODO \r\n assertTrue(true); \r\n }", "@Test\n\tpublic void test_TCM__String_toString() {\n\t\t//expected value\n\t\tfinal Namespace ns = Namespace.getNamespace(\"prefx\", \"http://some.other.place\");\n\t\tfinal Attribute attr = new Attribute(\"test\", \"value\", ns);\n\t\tString str= attr.toString();\n\t\tassertTrue(\"incorrect toString form\", str.equals(\"[Attribute: prefx:test=\\\"value\\\"]\"));\n\n\t}", "@Test\n public void testToString() {\n System.out.println(\"toString\");\n Account instance = new Account(\"Piper\", 10.0);\n String expResult = \"Piper has a total of $10.0 in their account.\";\n String result = instance.toString();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n //fail(\"The test case is a prototype.\");\n }", "@Test\n public void testToString() {\n LOGGER.info(\"testToString\");\n final String actual = new AtomString(\"Hello\").toString();\n final String expected = \"Hello\";\n assertEquals(expected, actual);\n }", "public static void checkToString() {\r\n\t\tSystem.out.println(\"Beginning toString test (should be [-1, 2, 5, 17] and [3, 6, 8, 42])\");\r\n\t\tSortedIntList list = new SortedIntList(5);\r\n\t\tlist.add(5);\r\n\t\tlist.add(-1);\r\n\t\tlist.add(17);\r\n\t\tlist.add(2);\r\n\t\tSystem.out.println(\" \" + list.toString());\r\n\t\t\r\n\t\tSortedIntList list2 = new SortedIntList(true);\r\n\t\tlist2.add(6);\r\n\t\tlist2.add(3);\r\n\t\tlist2.add(6);\r\n\t\tlist2.add(42);\r\n\t\tlist2.add(8);\r\n\t\tSystem.out.println(\" \" + list2.toString());\r\n\t\tSystem.out.println();\r\n\t}", "@Test\r\n public void testToStringReturnString(){\r\n Assertions.assertEquals(patientResult.toString(), \"class PatientResult {\\n\" +\r\n \" patient: null\\n\" +\r\n \" patient: []\\n\" +\r\n \" child: []\\n\" +\r\n \" category: []\\n\" +\r\n \"}\");\r\n }", "@Test\r\n public void testToString() {\r\n String expected = \"3.0 + 4.0i\";\r\n Complex c = new Complex(3,4);\r\n String actual = c.toString();\r\n assertEquals(expected, actual);\r\n }", "@Test\n public void testToString() {\n System.out.println(\"toString\");\n Library instance = new Library();\n instance.setName(\"Test\");\n instance.setSize(5);\n String expResult = \"Library{\" + \"name=\" + instance.getName() + \", size=\" + instance.getSize() + \"}\";\n String result = instance.toString();\n assertEquals(expResult, result);\n \n }", "public void testToString()\n {\n // An empty board\n assertEquals(b1.toString(), \"EEEEEEEEE\");\n\n // A more complex case\n b1.fromString(\"RRRBEEBBE\");\n assertEquals(b1.toString(), \"RRRBEEBBE\");\n }", "@Test\n public void testToString() {\n Order order = new Order(\"Test\", LocalTime.NOON, GridCoordinate.ZERO);\n\n Assert.assertEquals(\"Compare toString.\",\n \"Order [orderId=Test, orderTime=12:00, customerLocation=GridCoordinate [x=0, y=0]]\",\n order.toString());\n }", "@Test\n public void testToString() {\n Pair instance = Pair.of(\"left\", \"right\");\n String result = instance.toString();\n assertTrue(result.contains(\"left\"));\n assertTrue(result.contains(\"right\"));\n assertTrue(result.contains(\"Pair\"));\n }", "protected String toString(Object expectedValue) {\n\t\treturn expectedValue == null ? \"\" : expectedValue.toString(); //$NON-NLS-1$\n\t}", "@Test\r\n public void testToString() {\r\n System.out.println(\"toString\");\r\n OpeningTicketPurpose instance = new OpeningTicketPurpose();\r\n String expResult = \"\";\r\n String result = instance.toString();\r\n assertEquals(expResult, result);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }", "@Test\n public void testToString_1()\n throws Exception {\n LogicStep fixture = new LogicStep();\n fixture.setScript(\"\");\n fixture.setName(\"\");\n fixture.setOnFail(\"\");\n fixture.setScriptGroupName(\"\");\n fixture.stepIndex = 1;\n\n String result = fixture.toString();\n\n assertEquals(\"LogicStep : \", result);\n }", "@Test\r\n public void testToString() {\r\n System.out.println(\"toString\");\r\n RevisorParentesis instance = null;\r\n String expResult = \"\";\r\n String result = instance.toString();\r\n assertEquals(expResult, result);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }", "@Test\n public void toStringTest() {\n prepareEntitiesForEqualityTest();\n\n assertEquals(entity0.toString(), entity1.toString());\n }", "public void testToString() {\n }", "@Test\r\n\tpublic void testToString() {\r\n\r\n\t\t// Create a new Notification and use accessors to set the note name\r\n\t\tINotification note = new Notification(\"TestNote\", \"1,3,5\", \"TestType\");\r\n\t\tString ts = \"Notification Name: TestNote Body:1,3,5 Type:TestType\";\r\n\r\n\t\t// test assertions\r\n\t\tAssert.assertEquals(\"Expecting note.testToString() == '\" + ts + \"'\", note.toString(), ts);\r\n\t}", "private void testToString() {\n init();\n assertTrue(\"l0.toString()\", l0.toString().equals(\"[]\"));\n assertTrue(\"l1.toString()\", l1.toString().equals(\"[5]\"));\n assertTrue(\"l2.toString()\", l2.toString().equals(\"[4, 5]\"));\n }", "@Test\n public void testToString() {\n System.out.println(\"toString\");\n Reserva instance = new Reserva();\n String expResult = \"\";\n String result = instance.toString();\n assertEquals(expResult, result);\n \n }", "public void test_toString() {\n String logMessage = instance.getLogMessage();\n\n assertEquals(\"'toString' should be correct.\", logMessage, instance.toString());\n }", "@Test\n public void testToString() {\n LevelReportDto body = new LevelReportDto(\"product-name\", \"key-obs\",\n ProductFamily.L0_REPORT);\n GenericMessageDto<LevelReportDto> dto =\n new GenericMessageDto<LevelReportDto>(123, \"input-key\", body);\n String str = dto.toString();\n assertTrue(\"toString should contain the identifier\",\n str.contains(\"id: 123\"));\n assertTrue(\"toString should contain the body\",\n str.contains(\"body: \" + body.toString()));\n assertTrue(\"toString should contain the input key\",\n str.contains(\"inputKey: input-key\"));\n }", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public abstract String toString();", "public void testToString() {\n assertEquals(this.empty.toString(), \"[]\");\n assertEquals(this.stack.toString(), \"[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]\");\n }", "@Test public void toStringTest() throws NegativeValueException {\n PetBunny pb1 = new PetBunny(\"Floppy\", \"Holland Lop\", 3.5);\n \n Assert.assertTrue(pb1.toString().contains(\"Estimated Monthly Cost: \"));\n }", "public java.lang.String toString () { throw new RuntimeException(); }", "@Test\n public void testToString() {\n System.out.println(\"toString\");\n Alumno instance = null;\n String expResult = \"\";\n String result = instance.toString();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public void testToString() {\n\t\tNumberConverter test = new NumberConverter(436);\n\t\tNumberConverter testH = new NumberConverter(95);\n\t\tNumberConverter testT = new NumberConverter(203);\n\t\tNumberConverter testO = new NumberConverter(870);\n\t\tNumberConverter testHT = new NumberConverter(2);\n\t\tNumberConverter testHO = new NumberConverter(40);\n\t\tNumberConverter testTO = new NumberConverter(900);\n\t\tNumberConverter testH2 = new NumberConverter(13);\n\t\tNumberConverter testHTO = new NumberConverter(0);\n\t\tassertEquals(\"Should have had stringed together correctly\",\n\t\t\t\ttest.toString(), \"four hundred and thirty six\");\n\t\tassertEquals(\"Should have had stringed together correctly\",\n\t\t\t\ttestH.toString(), \"ninety five\");\n\t\tassertEquals(\"Should have had stringed together correctly\",\n\t\t\t\ttestT.toString(), \"two hundred and three\");\n\t\tassertEquals(\"Should have had stringed together correctly\",\n\t\t\t\ttestO.toString(), \"eight hundred and seventy\");\n\t\tassertEquals(\"Should have had stringed together correctly\",\n\t\t\t\ttestHT.toString(), \"two\");\n\t\tassertEquals(\"Should have had stringed together correctly\",\n\t\t\t\ttestHO.toString(), \"forty\");\n\t\tassertEquals(\"Should have had stringed together correctly\",\n\t\t\t\ttestTO.toString(), \"nine hundred\");\n\t\tassertEquals(\"Should have had stringed together correctly\",\n\t\t\t\ttestH2.toString(), \"thirteen\");\n\t\tassertEquals(\"Should have had stringed together correctly\",\n\t\t\t\ttestHTO.toString(), \"\");\n\n\t}", "@Test\n public void testToString()\n {\n try\n {\n Square s1 = new Square();\n assertEquals(\"_\", s1.toString());\n\n s1.setType(Square.squareType.DB_LETTER);\n assertEquals(\"2L\", s1.toString());\n\n s1.setType(Square.squareType.STAR);\n assertEquals(\"S\", s1.toString());\n\n s1.setType(Square.squareType.DB_WORD);\n assertEquals(\"2W\", s1.toString());\n\n s1.setType(Square.squareType.TR_LETTER);\n assertEquals(\"3L\", s1.toString());\n\n s1.setType(Square.squareType.TR_WORD);\n assertEquals(\"3W\", s1.toString());\n\n s1.setTile(Tile.getInstance('A'));\n assertEquals(\"A\", s1.toString());\n }\n catch(Exception ex)\n {\n fail(\"No exception should be thrown when calling toString on Square.\");\n }\n }", "@Test\n\tpublic void testToString() {\n\t\tassertEquals(\"C Platinum 123ABC Kate\", c1.toString());\n\t\tassertEquals(\"C None 456DEF Bender\", c2.toString());\n\t}", "@Test\n\tpublic void testToString() {\n\t\tassertEquals(\n\t\t\t\t\"SHOW: Lana Del Rey planeta Terra, R$ 100.0, Nao emprestado, 120 min, LIVRE, Lana Del Rey, 10 faixas\",\n\t\t\t\tshow.toString());\n\t}", "@Test\n public void testToString() {\n String expected =\"Business: name='AMC Lowes', description='', price_range=2, stars=3.75}\";\n String actual = theater.toString();\n Assert.assertEquals(expected,actual);\n }", "@Test\n public void testToString() {\n System.out.println(\"toString\");\n String expResult = \"DetalleAhorro{codigo=1, fechaPago=Tue Jan 01 00:10:00 COT 2019, interes=0.07, saldo=600.0}\";\n String result = detalleAhorro.toString();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n // fail(\"The test case is a prototype.\");\n }", "abstract public String toString();", "@Test public void testToString() {\n final OctaveObject string = new OctaveString(\"tekst\");\n assertEquals(\"# name: ans\\n\" + \n\t\t \"# type: string\\n\" + \n\t\t \"# elements: 1\\n\" + \n\t\t \"# length: 5\\ntekst\\n\", \n\t\t OctaveIO.toText(string));\n }", "@Test\r\n\tvoid testToString() {\r\n\t\tSimpleList test = new SimpleList();\r\n\t\tString output = test.toString();\r\n\t\tassertEquals(\"\", output);\r\n\t}", "public String toString()\n/* 67: */ {\n/* 68:72 */ return this.mStringValue;\n/* 69: */ }", "public void test_toString() {\n // ## Arrange ##\n FromToOption option = createOption();\n option.compareAsDate();\n\n // ## Act ##\n String actual = option.toString();\n\n // ## Assert ##\n log(actual);\n assertTrue(actual.contains(\"lessThan=true\"));\n }", "public String toString() { return stringify(this, true); }", "@Test\n public void testToString() {\n System.out.println(\"toString\");\n List<Exposicao> listaExposicoes = new ArrayList<>();\n listaExposicoes.add(new Exposicao());\n RegistoExposicoes instance = new RegistoExposicoes(listaExposicoes);\n StringBuilder expResult = new StringBuilder();\n expResult.append(\"RegistoExposicoes{\");\n for (Exposicao exposicao : instance.getListaExposicoes()) {\n expResult.append(String.format(\"%s%n\", exposicao));\n }\n expResult.append(\"}\");\n String result = instance.toString();\n assertEquals(expResult.toString(), result);\n }" ]
[ "0.75851655", "0.74549174", "0.7437905", "0.74111605", "0.73614746", "0.73227704", "0.718329", "0.7170817", "0.7138549", "0.71106327", "0.7072562", "0.7055006", "0.70037603", "0.70006394", "0.6998778", "0.69774926", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69682235", "0.69666046", "0.69481456", "0.6942779", "0.6886011", "0.68811584", "0.68606377", "0.6857072", "0.6856401", "0.68543476", "0.6849885", "0.6831137", "0.68114716", "0.681049", "0.67943585", "0.67796254", "0.6775799", "0.6770251", "0.67684674", "0.6766864", "0.6763775", "0.6760497", "0.6744054", "0.67165095", "0.6704535", "0.6704535", "0.6704535", "0.6704535", "0.6704535", "0.6704535", "0.6704535", "0.6704535", "0.6704535", "0.6704535", "0.6704535", "0.6704535", "0.6704535", "0.6704535", "0.6704535", "0.6704535", "0.66986686", "0.6676562", "0.6675119", "0.6662788", "0.6659169", "0.6652527", "0.66126966", "0.66052425", "0.6604175", "0.6583983", "0.65784526", "0.65781087", "0.65747434", "0.6573056", "0.6568064", "0.655453", "0.6549677" ]
0.6941714
47
TODO Autogenerated method stub
@Override public void onException(Exception arg0) { }
{ "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 onDeletionNotice(StatusDeletionNotice arg0) { }
{ "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 onScrubGeo(long arg0, long arg1) { }
{ "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 onTrackLimitationNotice(int arg0) { }
{ "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}", "private stendhal() {\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "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\tprotected void initialize() {\n\n\t}", "@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}", "public void mo55254a() {\n }", "@Override\n\tprotected void initValue()\n\t{\n\n\t}" ]
[ "0.66730285", "0.65698135", "0.6524193", "0.64818907", "0.6477969", "0.6459897", "0.64150065", "0.6378023", "0.62785167", "0.6256323", "0.62391806", "0.6225302", "0.6203955", "0.6196986", "0.6196986", "0.6193411", "0.6188864", "0.6175446", "0.61352557", "0.6129083", "0.6081512", "0.6078478", "0.604346", "0.6027257", "0.6019896", "0.6001062", "0.5969694", "0.5969694", "0.59695363", "0.5950136", "0.5940857", "0.5923273", "0.59109026", "0.5904841", "0.58943695", "0.58871347", "0.5884626", "0.5871665", "0.5857174", "0.58529896", "0.58477926", "0.5827649", "0.58111745", "0.5810771", "0.58093345", "0.58093345", "0.58016413", "0.5792614", "0.57915145", "0.57915145", "0.57915145", "0.57915145", "0.57915145", "0.57915145", "0.579047", "0.5788485", "0.5783461", "0.5783461", "0.57756454", "0.57756454", "0.57756454", "0.57756454", "0.57756454", "0.5762863", "0.57603353", "0.57603353", "0.5751224", "0.5751224", "0.5751224", "0.5751004", "0.573491", "0.573491", "0.573491", "0.572175", "0.5717107", "0.5717079", "0.5717079", "0.5717079", "0.5717079", "0.5717079", "0.5717079", "0.5717079", "0.5716174", "0.5715048", "0.5704484", "0.5700041", "0.5699844", "0.56887585", "0.56792545", "0.5674781", "0.56728446", "0.56702185", "0.5662837", "0.5657697", "0.56568635", "0.56568635", "0.56568635", "0.5656818", "0.5655768", "0.56533396", "0.56532913" ]
0.0
-1
TODO Autogenerated method stub
@Override public void onStallWarning(StallWarning arg0) { }
{ "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