query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
The receiver to handle incoming messages
@Bean Receiver receiver() { return new Receiver(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onReceive(Object msg) throws Exception {\n }", "@Override\n public void onReceive(Object message) throws Exception {\n }", "@Override\r\n public void handleMessage(Message msg) {\n }", "@Override\r\n\tpublic void onReceive(Object arg0) throws Exception {\n\t\t\r\n\t}", "@Override\n\tpublic void onMessageRecieved(Message arg0) {\n\t\t\n\t}", "@Override\n public void handleMessage(Message message) {}", "void onMessageReceived(Message message);", "protected void handleMessage(Message msg) {}", "public void onReceive();", "@Override\r\n\tpublic void messageReceived(Object obj) {\n\t\t\r\n\t}", "@Override\n public void run() {\n Message message = mHandler.obtainMessage(1);\n mHandler.sendMessage(message);\n }", "public void OnMessageReceived(String msg);", "@Override\n public void onReceive(Context context, Intent intent) {\n String action = intent.getAction();\n switch (action) {\n case RoosterConnectionService.NEW_MESSAGE:\n// k = RoosterConnectionService.NEW_MESSAGE;\n String from = intent.getStringExtra(RoosterConnectionService.BUNDLE_FROM_JID);\n String body = intent.getStringExtra(RoosterConnectionService.BUNDLE_MESSAGE_BODY);\n// if(body.toUpperCase().contains(\"V\".toUpperCase()) ) {\n message(body);\n// }\n return;\n\n case RoosterConnectionService.UI_AUTHENTICATED:\n Toast.makeText(getApplicationContext(), \"authenticated\", Toast.LENGTH_SHORT).show();\n// Log.d(TAG,\"Got a broadcast to show the main app window\");\n //Show the main app window\n// showProgress(false);\n// Intent i2 = new Intent(mContext,ContactListActivity.class);\n// startActivity(i2);\n// finish();\n\n break;\n }\n\n\n }", "void onReceive(Message message) throws IOException {\n server.onReceive(message);\n }", "@Override\n\tpublic void msgReceived(Message msg) {\n\n\t}", "@Override\n public void run() {\n Message message = new Message();\n message.what=1;\n handler.sendMessage(message);\n }", "public abstract void messageReceived(String message);", "protected abstract void onReceiveMessage(Context context, Intent intent);", "@Override\n public void processMessage(int type, String receivedMsg) {\n }", "@Override\n public void onMessageReceived(RemoteMessage remoteMessage) {\n }", "@Override\n\tpublic void run() {\n\t\t\n\t\twhile(connected) {\n\t\t\tif(GameActivity.getInstance() == null)\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\ttry {\n\t\t\t\t// Read first 4 bytes (int, messageType) from stream\n\t\t\t\t//in.read(bytes, 0, 4);\n\t\t\t\tint messageType = in.readInt();\n\t\t\t\t//intByteBuffer.clear(); // Clear buffer so we can read from it again\n\t\t\t\t\n\t\t\t\t// Receive appropriate message based on received messageType\n\t\t\t if(messageType == Message.CHARACTERS.value()) {\n\t\t\t\t\treceiveCharacters();\n\t\t\t\t} else if(messageType == Message.ID.value()) {\n\t\t\t\t\treceiveId();\n\t\t\t\t} else {\n\t\t\t\t\tSystem.err.println(\"Received message with unknown id: \" + messageType);\n\t\t\t\t}\n\t\t\t \n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(\"Connection to server lost\");\n\t\t\t\te.printStackTrace();\n\t\t\t\tclose();\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "public void handleMessage(Message message);", "@Override\n public void receiveMessage(String message) {\n }", "void received() throws ImsException;", "public void handleMessage(Message msg) {\n switch (msg.what) {\n case handlerState:\n String readMessage = (String) msg.obj; // msg.arg1 = bytes from connect thread\n ReceivedData.setData(readMessage);\n break;\n\n case handlerState1:\n tempSound = Boolean.parseBoolean((String) msg.obj);\n ReceivedData.setSound(tempSound);\n break;\n\n case handlerState5:\n if(\"ACK\".equals ((String) msg.obj ))\n ReceivedData.clearPPGwaveBuffer();\n break;\n\n }\n ReceivedData.Process();\n }", "@Override\n public void run() {\n Message message = new Message();\n message.what = 4;\n handler.sendMessage(message);\n }", "public void run() {\n // Check if the specified connector is null\n //\n if(this.connector == null) {\n System.out.println(\"[ERROR] connector is null aborting\");\n return;\n }\n\n //\n // Keep reading messages\n //\n while (true) {\n AeMessage inMsg = connector.read();\n if(inMsg == null) {\n System.out.println(\"[ERROR] Received an invalid message\");\n connector.reconnect();\n try {\n Thread.sleep(10000);\n }\n catch(Exception e) {\n }\n }\n else {\n //\n // Reject messages over two minutes old\n //\n if(inMsg.checkMessageOlderThan(120) == 1) {\n System.out.println(\"[INFO] Message has expired: \" + inMsg.toString());\n }\n else if(inMsg.getMessageType().equals(\"22\")) {\n System.out.println(\"[INFO] Received message:\" + inMsg.toString());\n if(messageStore.reportMessage(inMsg)) {\n System.out.println(\"[INFO] Successfully added message to the store\");\n }\n else {\n System.out.println(\"[ERROR] Failed to add message to the store\");\n }\n }\n }\n }\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n String message = intent.getStringExtra(\"message\");\n Log.d(\"receiver\", \"Got message: \" + message);\n filterDayWise();\n }", "@Override\n\tpublic void receive() {\n\t}", "public void messageReceived(Message m) {\n\t\t\r\n\t}", "@Override\n\tpublic void receive(String msg) {\n\t\t\n\t}", "@Override\n public void handleMessage(Message msg) {\n System.out.println(\"recibe mensajes ...\");\n System.out.println(msg.obj);\n }", "@Override\n\tpublic void receive_message(Message m) {\n\t\t\n\t}", "public void onRecieve(RoundTimeMessage message) {\n\n\n }", "@Override\n\t\tpublic void handleMessage(Message msg) {\n\t\t\tsuper.handleMessage(msg);\n\t\t\tswitch (msg.what) {\n\t\t\tcase 0:\n\t\t\t\ttv_read.setText(msg.obj.toString());\n\t\t\t\tToast.makeText(N20PINPadControllerActivity.this, \"recv\",\n\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "public void run() \n { \n String message; // String for incoming messages\n \n // listen for messages until stopped\n while ( keepListening ) \n { \n try \n { \n message = input.readLine(); // read message from client\n } // end try\n catch ( SocketTimeoutException socketTimeoutException ) \n {\n continue; // continue to next iteration to keep listening\n } // end catch\n catch ( IOException ioException ) \n {\n ioException.printStackTrace(); \n break;\n } // end catch\n\n // ensure non-null message\n if ( message != null ) \n {\n // tokenize message to retrieve user name and message body\n StringTokenizer tokenizer = new StringTokenizer( \n message, MESSAGE_SEPARATOR );\n\n // ignore messages that do not contain a user\n // name and message body\n if ( tokenizer.countTokens() == 2 ) \n {\n // send message to MessageListener\n messageListener.messageReceived( \n tokenizer.nextToken(), // user name\n tokenizer.nextToken() ); // message body\n } // end if\n else\n {\n // if disconnect message received, stop listening\n if ( message.equalsIgnoreCase(\n MESSAGE_SEPARATOR + DISCONNECT_STRING ) ) \n stopListening();\n } // end else\n } // end if\n } // end while \n \n try\n { \n input.close(); // close BufferedReader (also closes Socket)\n } // end try\n catch ( IOException ioException ) \n {\n ioException.printStackTrace(); \n } // end catch \n }", "private void incomingBT_handle()\n {\n if(BT_Message_Handle_Func != null)\n BT_Message_Handle_Func.run();\n\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n Bundle bundle = RemoteInput.getResultsFromIntent(intent);\n if (bundle != null) {\n //Should actually use extractMessagingStyleFromNotification() or use database..\n CharSequence replyText = bundle.getCharSequence(KEY_REMOTE_INPUT);\n Message reply = new Message(replyText, USER_NAME);\n MainActivity.MESSAGES.add(reply);\n\n MainActivity.sendMessageChannel(context);\n }\n }", "public void messageReceived() {\n\tTrackedMessage.accumulateMap(TrackedMessage.unmapType(\n\t\tTrackedMessage.messagesRecieved, this.getClass()), this\n\t\t.getMessageType(), 1);\n\tTrackedMessage.accumulateMap(TrackedMessage.unmapType(\n\t\tTrackedMessage.bytesRecieved, this.getClass()), this\n\t\t.getMessageType(), TrackedMessage.objectSize(this));\n }", "@Override\n\tprotected void processConnection() {\n\t\t\n\t\twhile(true) {\n\t\t\t\n\t\t\ttry {\n\t\t\t\tint receiverID = (Integer) input.readObject();\n\t\t\t\tString message = (String) input.readObject();\n\t\t\t\t\n\t\t\t\tClientHandler recieverHandler = Server.clientConnections.get(receiverID);\n\t\t\t\tif(recieverHandler == null) {\n\t\t\t\t\tsendData(ERROR_CODE);\n\t\t\t\t\tsendData(\"Not available\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\trecieverHandler.sendData(clientID);\n\t\t\t\t\trecieverHandler.sendData(message);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(ClassNotFoundException classNotFoundException) {\n\t\t\t\tserver.serverGUI.showMessage(\"Unknown object type recieved.\");\n\t\t\t}\n\t\t\tcatch(IOException ioException) {\n\t\t\t\tserver.serverGUI.showMessage(\"Client terminated connection.\\n\");\n\t\t\t\tcloseConnection();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void onReceive(Context context, Intent intent) {\n String message = intent.getStringExtra(\"message\");\n Log.d(\"receiver\", \"Got message: \" + message);\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n String message = intent.getStringExtra(\"message\");\n Log.d(\"receiver\", \"Got message: \" + message);\n }", "@Override\n\tprotected void doReceiveMessage(Message msg) {\n\t\tdeliverMessage(msg);\n\t}", "private void receiveAndDispatchMessage() {\n String response = null;\n try {\n while((response = bufferedReader.readLine()) != null) {\n System.out.println(\"received message from server: \" + response);\n String messageKind = \"\";\n if(response.contains(\":\")) {\n messageKind = response.substring(0, response.indexOf(\":\"));\n } else {\n messageKind = response;\n }\n Bundle bundle = new Bundle();\n bundle.putString(\"response\", response);\n switch (messageKind) {\n case ClientMessageKind.SIGNUPDENIED:\n case ClientMessageKind.SIGNUPOK:\n if(resultReceiverMap.keySet().contains(ActivityNames.COMMONSIGNUPACTIVITY)) {\n resultReceiverMap.get(ActivityNames.COMMONSIGNUPACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.SIGNINDENIED:\n case ClientMessageKind.SIGNINOK:\n if(resultReceiverMap.keySet().contains(ActivityNames.COMMONSIGNINACTIVITY)) {\n resultReceiverMap.get(ActivityNames.COMMONSIGNINACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.DRIVERLOC:\n if(resultReceiverMap.keySet().contains(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.PASSENGERLOC:\n if(resultReceiverMap.keySet().contains(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.CHATFROMDRIVER:\n if(resultReceiverMap.keySet().contains(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.CHATFROMPASSENGER:\n if(resultReceiverMap.keySet().contains(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.PASSENGERDEST:\n if(resultReceiverMap.containsKey(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.STARTRIDE:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n } else if(resultReceiverMap.containsKey(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.ENDRIDE:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERENDSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERENDSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.DRIVERCANCEL:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.PASSENGERCANCEL:\n if(resultReceiverMap.containsKey(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.UPDATEPASSENGERPROFILEDENIED:\n case ClientMessageKind.UPDATEPASSENGERPROFILEOKAY:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERUPDATEPROFILEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERUPDATEPROFILEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.UPDATEDRIVERPROFILEDENIED:\n case ClientMessageKind.UPDATEDRIVERPROFILEOKAY:\n if(resultReceiverMap.containsKey(ActivityNames.DRIVERUPDATEPROFILEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERUPDATEPROFILEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.DRIVERREQUESTLOC:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.PASSENGERREQUESTLOC:\n if(resultReceiverMap.containsKey(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n default:\n break;\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public abstract void msgHandler(Message msg);", "@Override\n\t\t\tpublic void handleMessage(Message msg) {\n\t\t\t\tswitch (msg.what) {\n\t\t\t\tcase UDPHelper.HANDLER_MESSAGE_BIND_ERROR:\n\t\t\t\t\tLog.e(\"my\", \"HANDLER_MESSAGE_BIND_ERROR\");\n\t\t\t\t\tT.showShort(mContext, R.string.port_is_occupied);\n\t\t\t\t\tbreak;\n\t\t\t\tcase UDPHelper.HANDLER_MESSAGE_RECEIVE_MSG:\n\t\t\t\t\tisReceive = true;\n\t\t\t\t\tLog.e(\"my\", \"HANDLER_MESSAGE_RECEIVE_MSG\");\n\t\t\t\t\t// NormalDialog successdialog=new NormalDialog(mContext);\n\t\t\t\t\t// successdialog.successDialog();\n\t\t\t\t\tT.showShort(mContext, R.string.set_wifi_success);\n\t\t\t\t\tmHelper.StopListen();\n\t\t\t\t\tBundle bundle = msg.getData();\n\t\t\t\t\t\n\t\t\t\t\tIntent it = new Intent();\n\t\t\t\t\tit.setAction(Constants.Action.RADAR_SET_WIFI_SUCCESS);\n\t\t\t\t\tsendBroadcast(it);\n\t\t\t\t\tFList flist = FList.getInstance();\n\t\t\t\t\tflist.updateOnlineState();\n\t\t\t\t\tflist.searchLocalDevice();\n\n\t\t\t\t\tString contactId = bundle.getString(\"contactId\");\n\t\t\t\t\tString frag = bundle.getString(\"frag\");\n\t\t\t\t\tString ipFlag = bundle.getString(\"ipFlag\");\n\t\t\t\t\tContact saveContact = new Contact();\n\t\t\t\t\tsaveContact.contactId = contactId;\n\t\t\t\t\tsaveContact.activeUser = NpcCommon.mThreeNum;\n\t\t\t\t\tIntent add_device = new Intent(mContext,\n\t\t\t\t\t\t\tAddContactNextActivity.class);\n\t\t\t\t\tadd_device.putExtra(\"contact\", saveContact);\n\t\t\t\t\tif (Integer.parseInt(frag) == Constants.DeviceFlag.UNSET_PASSWORD) {\n\t\t\t\t\t\tadd_device.putExtra(\"isCreatePassword\", true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tadd_device.putExtra(\"isCreatePassword\", false);\n\t\t\t\t\t}\n\t\t\t\t\tadd_device.putExtra(\"isfactory\", true);\n\t\t\t\t\tadd_device.putExtra(\"ipFlag\", ipFlag);\n\t\t\t\t\tstartActivity(add_device);\n\t\t\t\t\t// Intent modify = new Intent();\n\t\t\t\t\t// modify.setClass(mContext, LocalDeviceListActivity.class);\n\t\t\t\t\t// mContext.startActivity(modify);\n\t\t\t\t\tfinish();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcancleTimer();\n\t\t\t}", "public synchronized void handleMessage(String message) {\n Log.d(TAG, \"incoming message:\" + message);\n OnMessageReceivedListener listener = listenerReference.get();\n if(listener != null) {\n Log.d(TAG, \"listener not null. Handling message..\");\n listener.handleMessage(message);\n }\n else {\n Log.d(TAG, \"listener null!!\");\n }\n }", "@Override\n public void run() {\n Message message;\n while(true){\n logger.debug(\"SMS Reader Thread is waiting for incoming messages\");\n message = messageQueue.getInputSMS().poll() ;\n logger.debug(\"SMS message has been received from \"+ message.getFromWhom());\n view.receivedMessages.append(message.getFromWhom().toString() +\" :\");\n view.receivedMessages.append(message.getData() + \"\\n\");\n view.setPreferredSize(new Dimension(view.getSize().height+10, view.getSize().width));\n view.jScrollPaneReceivedMessages.getVerticalScrollBar().setValue(view.jScrollPaneReceivedMessages.getVerticalScrollBar().getMaximum());\n view.revalidate();\n }\n }", "public void run() {\n byte[] buffer = new byte[256];\n int bytes;\n\n // Keep looping to listen for received messages\n while (true) {\n try {\n bytes = mmInStream.read(buffer); //read bytes from input buffer\n String readMessage = new String(buffer, 0, bytes);\n // Send the obtained bytes to the UI Activity via handler\n bluetoothIn.obtainMessage(handlerState, bytes, -1, readMessage).sendToTarget();\n } catch (IOException e) {\n break;\n }\n }\n }", "@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }", "@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }", "@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }", "@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }", "public void handleMessageEvent(StunMessageEvent e) {\n delegate.processRequest(e);\n }", "@Override\n public void handleMessage(Message msg) {\n Log.d(\"LOG19\", \"handleMessage\");\n broadcastDiscoveryResponse((String)msg.obj);\n // Stop the service using the startId, so that we don't stop\n // the service in the middle of handling another job\n// stopSelf(msg.arg1);\n }", "public void run() {\n\n\t\tinitListen(new OnReceivedListener() {\n\t\t\t@Override\n\t\t\tpublic void onReceived() throws Exception {\n\n\t\t\t\tmSocket.receive(new DatagramPacket(mQuickBuffer, mQuickBuffer.length));\n\t\t\t\tPacket packet = (Packet) deserialization(mQuickBuffer);\n\t\t\t\tif (packet.isAck()) {\n\t\t\t\t\tSR.updateBufferSlotTimerSender(packet.getSeq(), BufferSlotTimer.ACKED);\n\t\t\t\t\tSR.output.append(\"(S) - Acknowledgment for Packet \" + packet.getSeq() + \" has been Received \\n\");\n\t\t\t\t\tSR.updateBaseSnd();\n\t\t\t\t\tSR.getBufferSlotTimerSender(packet.getSeq()).stopTimerTimeout();\n\t\t\t\t\tSR.output.append(\"(S) - Timer for Packet \" + packet.getSeq() + \" has been stopped \\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "@Override\n public void handleMessage(Message msg){\n BTRobotRemoteActivity activity = outer.get();\n\n //can't access main UI activity\n if(activity == null){return;}\n\n //find out what message was sent\n switch(msg.what){\n //bluetooth\n case BluetoothClientService.MESSAGE_STATE_CHANGE:{\n //update bluetooth connection status\n activity.setStatus(msg.arg1);\n break;\n }\n //service wrote data \n case BluetoothClientService.MESSAGE_WRITE:{\n //store data as a string\n String writeMessage = new String((byte[]) msg.obj);\n break;\n }\n //service read data\n case BluetoothClientService.MESSAGE_READ:{\n String readMessage = new String((byte[])msg.obj, 0, msg.arg1);\n break;\n }\n //service retreived device's name\n case BluetoothClientService.MESSAGE_DEVICE_NAME:{\n // save the connected device's name\n activity.setDeviceName(msg.getData().getString(DEVICE_NAME));\n Toast.makeText(activity.getApplicationContext(), \"Connected to \"\n + activity.getDeviceName(), Toast.LENGTH_SHORT).show();\n break;\n }\n //motion sensor\n case MotionMonitor.MESSAGE_MOTION:{\n if(msg.arg1 == MotionMonitor.ARG_ACCEL){\n Bundle b = (Bundle) msg.obj;\n if(b == null){Log.e(TAG, \"Failed to convert message object to bundle\");}\n float [] data = b.getFloatArray(MotionMonitor.KEY_ACCEL);\n activity.updateOrientation(data);\n }\n else if(msg.arg1 == MotionMonitor.ARG_GYRO){\n Bundle b = (Bundle) msg.obj;\n if(b == null){Log.e(TAG, \"Failed type message data to float []\");}\n //set data in gyrostats view \n float [] data = b.getFloatArray(MotionMonitor.KEY_ROTATE);\n TextView stats = (TextView) activity.findViewById(R.id.gyro_stats);\n stats.setText(String.format(\"%4f, %4f, %4f\", data[0], data[1], data[2]));\n }\n else{Log.e(TAG, \"Unsupported argument for MESSAGE_MOTION in handleMessage()\");}\n }\n //ignore other types\n default:{\n }}\n }", "public void handleMessage(Message msg) {\n int nRequestType = msg.what;\n switch(nRequestType)\n {\n case WIPER_START_PERIODIC_HI_FREQ_FIXES:\n lPeriod = lHighFreqPeriodMs; // hardcoded to 3.5 sec for now\n if(bIsWifiScanStopped == true){\n registerReceiver(mReceiver, mScanResultIntentFilter);\n bIsWifiScanStopped = false;\n }\n if(bIsNetworkSessionStopped == true){\n locationManager.requestLocationUpdates(locationProvider.getName(),lPeriod, (float)0, locationListener);\n bIsNetworkSessionStopped = false;\n }\n break;\n\n case WIPER_START_PERIODIC_KEEP_WARM:\n lPeriod = lLowFreqPeriodMs;// hardcoded to 5 sec for now\n //Start the Wifi scanner\n if(bIsWifiScanStopped == true){\n registerReceiver(mReceiver, mScanResultIntentFilter);\n bIsWifiScanStopped = false;\n }\n if(bIsNetworkSessionStopped == true){\n locationManager.requestLocationUpdates(locationProvider.getName(),lPeriod, (float)0, locationListener);\n bIsNetworkSessionStopped = false;\n }\n break;\n\n\n case WIPER_STOP_PERIODIC_FIXES:\n case WIPER_SUSPEND:\n if(bIsNetworkSessionStopped == false){\n locationManager.removeUpdates(locationListener);\n bIsNetworkSessionStopped = true;\n }\n if(bIsWifiScanStopped == false){\n unregisterReceiver(mReceiver);\n bIsWifiScanStopped = true;\n }\n break;\n\n case STOP_WIPER_SERVICE:\n if (Config.LOGD)\n {\n Log.d(TAG,\"Ending Wiper Service \");\n }\n stopSelf ();\n break;\n\n default:\n super.handleMessage(msg);\n }\n }", "@Override\r\n\tpublic void onReceive(Context arg0, Intent arg1) {\n\t\t\r\n\t}", "public abstract void onTextReceived(String message);", "@Override\r\n\tpublic void onReceive(Context context, Intent intent) {\r\n\t}", "public void onReceive(Object message) {\r\n if (message instanceof End) {\r\n End end = (End) message;\r\n \r\n log.debug(\"Message End of file for : \"+end.getFilePath().toString()+\" received!\");\r\n \r\n count++;\r\n \r\n String path = end.getFilePath().toString();\r\n \r\n System.out.println(\"Words count of file : \" + path + \" is \" + wordCount.get(path) + \" words\");\r\n \r\n if (count >= numberOfFiles) {\r\n getContext().system().terminate();\r\n }\r\n } else if (message instanceof Line) {\r\n \t\r\n Line line = (Line) message;\r\n \r\n log.debug(\"Message Line of file for : \"+line.getFilePath().toString()+\" received!\");\r\n\r\n int lineWordsCounts = line.read.split(\" \").length;\r\n \r\n String path = line.getFilePath();\r\n \r\n if (wordCount.containsKey(path)) {\r\n \twordCount.put(path, wordCount.get(path) + lineWordsCounts);\r\n } else {\r\n \twordCount.put(path, lineWordsCounts);\r\n }\r\n \r\n } else if (message instanceof Start) {\r\n Start start = (Start) message;\r\n \r\n log.debug(\"Message Start of file for : \"+start.getFilePath().toString()+\" received!\");\r\n\r\n } else {\r\n\t\t\tlog.error(\"Unexpected object message received: \"+message);\r\n unhandled(message);\r\n }\r\n }", "@Override\n public void handleMessage(Message msg) {\n super.handleMessage(msg);\n Log.d(TAG,\"In Handler, Msg = \"+msg.arg1);\n }", "@Override\n\tpublic void onMessage(Object arg0) {\n\t\t\n\t}", "@Override\n public void onReceive(Context context, Intent intent) {\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n }", "public void sendToManager(){\n String receiveMessage;\n while((receiveMessage=receiveFrom(messageReader)) != null){\n manager.manage(receiveMessage);\n }\n }", "@Override\n\tpublic void onMessageReceived(Message m) {\n\t\thandle.addMessage(m);\n\t\trefreshMessages();\n\t}", "public void handleMessageFromClient(Object msg) {\n\n }", "@Override\n\tpublic void run() {\n\t\n\t\tboolean finMsg = false;\n\n \n \n\t\ttry {\n\t\t\t\n\t\t DataInputStream is = new DataInputStream(socket.getInputStream());\n DataOutputStream os = new DataOutputStream(socket.getOutputStream()); \n\t\t\t\n\t\t\twhile (!finMsg) {\n\t\t\t\t\n\t\t\tString[] client_Msg = is.readUTF().split(\" \");\n\t\t\t\t\n\t\t\tswitch (client_Msg[1]) {\n\t\t\t\n\t\t\t\tcase \"REG\":\n\t\t\t\t\thandleRegister(client_Msg, os);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"RDY\":\n\t\t\t\t\thandleReady(client_Msg, os);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"MOV\":\n\t\t\t\t\thandleMove(client_Msg, os);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\tcase \"FIN\":\n\t\t\t\t\tsocket.close();\n\t\t\t\t\tfinMsg=true;\n\t\t\t\t\tbreak;\n\t\t\t \n\t\t\t\n\t\t\t\t}\n\t\t\n\t\t \n\t\t\t}\n\t\t\t\t\n\t\t}catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "@Override\n public void handleMessage(Message msg) {\n AsyncResult ar;\n\n switch (msg.what) {\n case EVENT_NEW_SMS:\n // A new SMS has been received by the device\n if (Config.LOGD) {\n Log.d(TAG, \"New SMS Message Received\");\n }\n\n SmsMessage sms;\n\n ar = (AsyncResult) msg.obj;\n\n // FIXME unit test leaves cm == null. this should change\n if (mCm != null) {\n // FIXME only acknowledge on store\n mCm.acknowledgeLastIncomingSMS(true, null);\n }\n\n if (ar.exception != null) {\n Log.e(TAG, \"Exception processing incoming SMS. Exception:\" + ar.exception);\n return;\n }\n\n sms = (SmsMessage) ar.result;\n dispatchMessage(sms);\n\n break;\n\n case EVENT_SEND_SMS_COMPLETE:\n // An outbound SMS has been sucessfully transferred, or failed.\n handleSendComplete((AsyncResult) msg.obj);\n break;\n\n case EVENT_SEND_RETRY:\n sendSms((SmsTracker) msg.obj);\n break;\n\n case EVENT_NEW_SMS_STATUS_REPORT:\n handleStatusReport((AsyncResult)msg.obj);\n break;\n\n case EVENT_SIM_FULL:\n handleSimFull();\n break;\n\n case EVENT_POST_ALERT:\n handleReachSentLimit((SmsTracker)(msg.obj));\n break;\n\n case EVENT_ALERT_TIMEOUT:\n ((AlertDialog)(msg.obj)).dismiss();\n msg.obj = null;\n mSTracker = null;\n break;\n\n case EVENT_SEND_CONFIRMED_SMS:\n if (mSTracker!=null) {\n Log.d(TAG, \"Ready to send SMS again.\");\n sendSms(mSTracker);\n mSTracker = null;\n }\n break;\n }\n }", "@Override public void handleMessage(Message msg) {\n super.handleMessage(msg);\n byte[] byteArray = (byte[]) msg.obj;\n int length = msg.arg1;\n byte[] resultArray = length == -1 ? byteArray : new byte[length];\n for (int i = 0; i < byteArray.length && i < length; ++i) {\n resultArray[i] = byteArray[i];\n }\n String text = new String(resultArray, StandardCharsets.UTF_8);\n if (msg.what == BluetoothTalker.MessageConstants.MESSAGE_WRITE) {\n Log.i(TAG, \"we just wrote... [\" + length + \"] '\" + text + \"'\");\n// mIncomingMsgs.onNext(text);\n } else if (msg.what == BluetoothTalker.MessageConstants.MESSAGE_READ) {\n Log.i(TAG, \"we just read... [\" + length + \"] '\" + text + \"'\");\n Log.i(TAG, \" >>r \" + Arrays.toString((byte[]) msg.obj));\n mIncomingMsgs.onNext(text);\n sendMsg(\"I heard you : \" + Math.random() + \"!\");\n// mReadTxt.setText(++ri + \"] \" + text);\n// if (mServerBound && mServerService.isConnected()) {\n// mServerService.sendMsg(\"I heard you : \" + Math.random() + \"!\");\n// } else if (mClientBound && mClientService.isConnected()) {\n// mClientService.sendMsg(\"I heard you : \" + Math.random() + \"!\");\n// }\n// mBluetoothStuff.mTalker.write();\n }\n }", "@Override\n\tpublic void handleMsg(String in) {\n\n\t}", "@Override\n\tpublic void onReceive(Context arg0, Intent arg1) {\n\n\t}", "@Override\n public void onReceive(Context context, Intent intent) {\n String message = intent.getStringExtra(\"message\");\n Log.d(\"receiver\", \"Got message: \" + message);\n\n textView.setText(message);\n }", "@Override\n\tpublic void run() {\n\t\tsuper.run();\n\t\twhile (keepListening) {\n\t\t\tbyte[] buffer = new byte[SocketMessengerConstants.MESSAGE_SIZE];\n\t\t\tDatagramPacket packet = new DatagramPacket(buffer, SocketMessengerConstants.MESSAGE_SIZE);\n\t\t\ttry {\n\t\t\t\tmulticastSocket.receive(packet);\n\t\t\t} catch (InterruptedIOException e) {\n\t\t\t\tcontinue;\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO: handle exception\n\t\t\t\te.printStackTrace();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tString message = new String(packet.getData());\n\t\t\tSystem.out.println(\"Receiving a message: \" + message);\n\t\t\tmessage = message.trim();\n\t\t\tStringTokenizer tokenizer = new StringTokenizer(message, SocketMessengerConstants.MESSAGE_SEPARATOR);\n\t\t\tif (tokenizer.countTokens() == 2)\n\t\t\t\tmessageListener.messageReceived(tokenizer.nextToken(), tokenizer.nextToken());\n\t\t}\n\t\ttry {\n\t\t\tmulticastSocket.leaveGroup(multicastGroup);\n\t\t\tmulticastSocket.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n public void onReceive(Context context, Intent intent) {\n // TODO Auto-generated method stub\n Log.d(TAG, \"got it\");\n }", "public void process(PlainMessage msg) throws IOException {\n relay(msg);\n }", "@Override public void run() {\n boolean looperIsNotPreparedInCurrentThread = Looper.myLooper() == null;\n\n if (looperIsNotPreparedInCurrentThread) {\n Looper.prepare();\n }\n\n handler = new Handler(new Handler.Callback() {\n @Override public boolean handleMessage(Message message) {\n Log.d(getClass().getSimpleName(), message.getData().toString());\n\n if (handlerCallback != null) {\n // note: we can avoid this callback by using event bus depending on concrete use case\n handlerCallback.handleMessage(message.getData());\n }\n return true;\n }\n });\n\n if (looperIsNotPreparedInCurrentThread) {\n Looper.loop();\n }\n }", "public void run(){\n\t\t\tObjectReader readerClient = new ObjectReader(in, clientInetAddress);\r\n\t\t\treaderClient.start();\r\n\t\t\t\r\n\t\t\t// Constantly checks msgToSend for messages and sends them\r\n\t\t\twhile(true){\r\n\t\t\t\ttry{\r\n\t\t\t\t\t// Send message\r\n\t\t\t\t\tif(msgToSend.length() != 0){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tout.writeObject(new DataObject(DataObject.STRING, msgToSend.toString()));\r\n\t\t\t\t\t\tout.flush();\r\n\t\t\t\t\t\tmsgToSend.setLength(0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tcatch(IOException ioe){\r\n\t\t\t\t\tioe.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "@Override\n public void channelRead(ChannelHandlerContext ctx, Object msg) {\n try {\n // The incoming message should have been transformed to a CorfuMsg earlier in the pipeline.\n CorfuMsg m = ((CorfuMsg) msg);\n // We get the handler for this message from the map\n AbstractServer handler = handlerMap.get(m.getMsgType());\n if (handler == null) {\n // The message was unregistered, we are dropping it.\n log.warn(\"Received unregistered message {}, dropping\", m);\n } else {\n if (validateEpoch(m, ctx)) {\n // Route the message to the handler.\n log.trace(\"Message routed to {}: {}\", handler.getClass().getSimpleName(), msg);\n handlerWorkers.submit(() -> handler.handleMessage(m, ctx, this));\n }\n }\n } catch (Exception e) {\n log.error(\"Exception during read!\", e);\n }\n }", "@Override\n\t\tpublic void run()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\twhile (keepListening)\n\t\t\t\t{\n\t\t\t\t\tString rcvStr = is.readLine();\n\t\t\t\t\t\n\t\t\t\t\t//We must make sure that this packet has been sent here correctly.\n\t\t\t\t\tif (rcvStr != null)\n\t\t\t\t\t{\n\t\t\t\t\t\t//TO-DO parse message here and notify controller\n\t\t\t\t\t\t//just transmit it to controller.\n\t\t\t\t\t\tSystem.out.println(\"receive reply : \" + rcvStr);\n\t\t\t\t\t\tmyController.parseResponse(rcvStr);\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t//The receive String is null means that this connection is broken.\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"at ControlChannel listenRunnable : receive null response\");\n\t\t\t\t\t\tkeepListening = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "abstract protected void receiveMessage(Message m);", "@Override\n\tpublic void onMessage( String message ) {\n\t\tlog.info(\"received: \" + message);\n\t}", "@Override\n public void handleMessage(Message msg) {\n Bundle data = msg.getData();\n if (data.containsKey(\"command\")) {\n if (data.getString(\"command\").equalsIgnoreCase(\"get_data\")) {\n mGetDataMessenger = msg.replyTo;\n getData();\n }\n }\n }", "private void messageHandler(String read){\n\n try {\n buffer.append(read);\n }catch (MalformedMessageException e){\n System.out.println(\"[CLIENT] The message received is not in XML format.\");\n }\n\n while(!buffer.isEmpty()) {\n if (buffer.getPong()) pong = true;\n else if (buffer.getPing()) send(\"<pong/>\");\n else {\n try {\n clientController.onReceivedMessage(buffer.get());\n } catch (EmptyBufferException e) {\n System.out.println(\"[CLIENT] The buffer is empty!\");\n }\n }\n }\n\n }", "public void afterReceive() {\n\t}", "@Override\n public void onMessageReceived(RemoteMessage remoteMessage) {\n Log.i(TAG, \"From: \" + remoteMessage.getFrom());\n sendOnChannel1();\n sendOnChannel2();\n if (remoteMessage == null)\n return;\n\n // Check if message contains a notification payload.\n if (remoteMessage.getNotification() != null) {\n Log.e(TAG, \"Notification Body: \" + remoteMessage.getNotification().getBody());\n // handleNotification(remoteMessage.getNotification().getBody());\n // sendMyBroadCast(remoteMessage.getNotification().getBody());\n }\n\n // Check if message contains a data payload.\n if (remoteMessage.getData().size() > 0) {\n Log.e(TAG, \"Data Payload: \" + remoteMessage.getData().toString());\n\n try {\n JSONObject json = new JSONObject(remoteMessage.getData().toString());\n // handleDataMessage(json);\n // sendMyBroadCast(remoteMessage.getData().toString());\n } catch (Exception e) {\n Log.e(TAG, \"Exception: \" + e.getMessage());\n }\n }\n }", "@Override\n\t\tpublic void handleMessage(Message msg) {\n\t\t\tsuper.handleMessage(msg);\n\t\t\tswitch (msg.what) {\n\t\t\tcase 911:\n\t\t\t\tqueryMsg();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}", "private void onReceiveChatMessages() {\n\n//\t\tL.debug(\"onReceiveChatMessages\");\n//\n//\t\t// called from NetworkChangeReceiver whenever the user is logged in\n//\t\t// will always be called whenever there is a change in network state,\n//\t\t// will always check if the app is connected to server,\n//\t\tXMPPConnection connection = XMPPLogic.getInstance().getConnection();\n//\n//\t\tif (connection == null || !connection.isConnected()) {\n//\t\t\tSQLiteHandler db = new SQLiteHandler(getApplicationContext());\n//\t\t\tdb.openToWrite();\n//\n//\t\t\t// db.updateBroadcasting(0);\n//\t\t\t// db.updateBroadcastTicker(0);\n//\n//\t\t\tAccount ac = new Account();\n//\t\t\tac.LogInChatAccount(db.getUsername(), db.getEncryptedPassword(), db.getEmail(), new OnXMPPConnectedListener() {\n//\n//\t\t\t\t@Override\n//\t\t\t\tpublic void onXMPPConnected(XMPPConnection con) {\n//\t\t\t\t\t\n//\t\t\t\t\t//addPacketListener(con);\n//\t\t\t\t}\n//\n//\t\t\t});\n//\n//\t\t\tdb.close();\n//\t\t} else {\n//\n//\t\t\t//addPacketListener(connection);\n//\n//\t\t}\n\t}", "@Override\n public void handleMessage(Message message) {\n // ...\n // When needed, stop the service with\n // stopSelf();\n }", "public void initReceiver() {\n }", "@Override\n protected void channelRead0(ChannelHandlerContext ctx, Message msg)\n {\n mDispatcher.dispatch(mPeer, msg);\n }", "protected void processMessagesOnConnection() {\n try {\n logger.info(\"Connected to \" + getConnectionName());\n state.set(StreamState.CONNECTED);\n notifyConnection();\n inputBuffer.flip();\n\n while (!Thread.currentThread().isInterrupted() && isConnected()) {\n try {\n // Find the start of message\n byte byStart = 0;\n while(byStart != START_OF_MSG && !Thread.currentThread().isInterrupted() && isConnected()) {\n byStart = nextByte(inputBuffer);\n }\n\n // and then make sure there are enough bytes and read the protocol\n readCompleteMessage(inputBuffer);\n if(inputBuffer.get() != protocol.getKeyIdentifier()) throw new TcProtocolException(\"Bad protocol\");\n\n logByteBuffer(\"Line read from stream\", inputBuffer);\n\n // now we take a shallow buffer copy and process the message\n MenuCommand mc = protocol.fromChannel(inputBuffer);\n logger.info(\"Command received: \" + mc);\n notifyListeners(mc);\n }\n catch(TcProtocolException ex) {\n // a protocol problem shouldn't drop the connection\n logger.warn(\"Probable Bad message reason='{}' Remote={} \", ex.getMessage(), getConnectionName());\n }\n }\n logger.info(\"Disconnected from \" + getConnectionName());\n } catch (Exception e) {\n logger.error(\"Problem with connectivity on \" + getConnectionName(), e);\n }\n finally {\n close();\n }\n }", "@Override\n\tpublic void onReceive(final Context context, Intent intent) {\n\t\tLog.i(\"msg\", \"new message\");\n\t\tif (Constants.MoShi==3) {\n\t\t\tnew Thread(){\n\t\t\t\tpublic void run() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsleep(3000);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\tSmsDao smsdao = new SmsDao(context);\n\t\t\t\t\tMap<String, String> data = smsdao.getSmsData();\n\t\t\t\t\t\n\t\t\t\t\tIntent itent = new Intent(Constants.ACTION_RING);\n\t\t\t\t\tif (data != null) {\n\t\t\t\t\t\titent.putExtra(\"data\", Constants.SMSINFO);\n\t\t\t\t\t\titent.putExtra(\"person\", data.get(\"person\"));\n\t\t\t\t\t\titent.putExtra(\"body\", data.get(\"body\"));\n\t\t\t\t\t}\n\n\t\t\t\t\tcontext.sendBroadcast(itent);\n\t\t\t\t};\n\t\t\t\t\n\t\t\t}.start();\n\t\t}\n\t\t\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\twhile (true) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\treMsg = withClient.getInputStream();\r\n\t\t\t\t\t\tbyte[] reBuffer = new byte[500];\r\n\t\t\t\t\t\treMsg.read(reBuffer);\r\n\t\t\t\t\t\tString msg = new String(reBuffer);\r\n\t\t\t\t\t\tmsg = msg.trim();\r\n\t\t\t\t\t\tif (msg.indexOf(\"/bye\") == 0) {\r\n\t\t\t\t\t\t\tendCat();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tAnalysis.ckMsg(mySin, msg);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\tendCat();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}", "@Override\r\n\tpublic void run() {\r\n\t\twhile (closer) {\r\n\t\t\ttry {\r\n\t\t\t\tObjectInputStream ois = new ObjectInputStream(client.getInputStream());\r\n\t\t\t\tObject object = ois.readObject();\r\n\t\t\t\tArrayList<String> input = (ArrayList<String>) object;\r\n\t\t\t\tInteger election = inputTransformer(input);\r\n\t\t\t\tif (election == 1) {\r\n\t\t\t\t\tsl.getLogger().info(\"IncomingMessage on Client Type 1 - For Chat\");\r\n\t\t\t\t}\r\n\t\t\t\tif (election == 2) {\r\n\t\t\t\t\tsl.getLogger().info(\"IncomingMessage on Client Type 2 - For Points\");\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n public void receiveMessage(Message m) {\n commReceiver.receiveMessage(m);\n }" ]
[ "0.7461032", "0.7365458", "0.71273595", "0.71249115", "0.71081525", "0.7099159", "0.7063077", "0.7052697", "0.702009", "0.7017723", "0.7004586", "0.69606346", "0.6923113", "0.6920978", "0.69082713", "0.68994695", "0.6898329", "0.68806285", "0.6880467", "0.6842299", "0.6799586", "0.67925763", "0.6761072", "0.6757679", "0.67449903", "0.67389286", "0.6731347", "0.6730956", "0.6730195", "0.67023456", "0.67006207", "0.6685995", "0.6678492", "0.6674495", "0.6660731", "0.6657632", "0.66439134", "0.66341984", "0.6632303", "0.66316444", "0.6630125", "0.6630125", "0.6591822", "0.65833354", "0.65799075", "0.6560008", "0.6546025", "0.6544611", "0.65445274", "0.654004", "0.654004", "0.654004", "0.654004", "0.6538563", "0.65295225", "0.65293723", "0.6528731", "0.652717", "0.6522116", "0.6514498", "0.6514025", "0.65076524", "0.6507498", "0.65060216", "0.6502644", "0.6502644", "0.65002924", "0.65002924", "0.65002924", "0.6495853", "0.649182", "0.6488135", "0.648588", "0.64780504", "0.6476448", "0.6470554", "0.6464651", "0.6460365", "0.6451693", "0.6450614", "0.6439875", "0.643899", "0.6435748", "0.6434602", "0.6431697", "0.64243925", "0.6424129", "0.6422618", "0.6422447", "0.64190876", "0.64169145", "0.6414308", "0.64079654", "0.6404913", "0.63974106", "0.63948476", "0.6394674", "0.6389487", "0.6372428", "0.63662183", "0.63647664" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) throws InterruptedException { System.setProperty("webdriver.chrome.driver", "chromedriver.exe"); WebDriver driver = new ChromeDriver(); // driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS); WebDriverWait w = new WebDriverWait(driver, 5); driver.manage().window().maximize(); String[] items = { "Brocolli", "Cucumber", "Tomato", "Onion" }; driver.get("https://rahulshettyacademy.com/seleniumPractise/"); // Thread.sleep(5000); addItems(driver, items); driver.findElement(By.cssSelector("img[alt='Cart']")).click(); driver.findElement(By.xpath("//button[contains(text(),'PROCEED TO CHECKOUT')]")).click(); w.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("input.promoCode"))); driver.findElement(By.cssSelector("input.promoCode")).sendKeys("rahulshettyacademy"); driver.findElement(By.cssSelector("button.promoBtn")).click(); w.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("span.promoInfo"))); System.out.println(driver.findElement(By.cssSelector("span.promoInfo")).getText()); }
{ "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
public Book[] getBooksByName(String bkName) throws SQLException { ArrayList<Book> books = new ArrayList<Book>(); String sql = "select * from TB_Book where bkName like ?"; Object[] params = new Object[]{bkName}; ResultSet rs = SQLHelper.getResultSet(sql,params); if(rs != null){ while(rs.next()){ Book book = initBook(rs); books.add(book); } rs.close(); } if(books.size()>0){ Book[] array = new Book[books.size()]; books.toArray(array); return array; } return null; }
{ "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.66713095", "0.6567948", "0.652319", "0.648097", "0.64770466", "0.64586824", "0.64132667", "0.6376419", "0.62759", "0.62545097", "0.62371093", "0.62237984", "0.6201738", "0.619477", "0.619477", "0.61924416", "0.61872935", "0.6173417", "0.613289", "0.6127952", "0.6080854", "0.6076905", "0.6041205", "0.6024897", "0.60200036", "0.59985113", "0.5967729", "0.5967729", "0.5965808", "0.5949083", "0.5941002", "0.59236866", "0.5909713", "0.59030116", "0.589475", "0.58857024", "0.58837134", "0.586915", "0.58575684", "0.5850424", "0.5847001", "0.5824116", "0.5810248", "0.5809659", "0.58069366", "0.58069366", "0.5800507", "0.5792168", "0.5792168", "0.5792168", "0.5792168", "0.5792168", "0.5792168", "0.57900196", "0.5790005", "0.578691", "0.578416", "0.578416", "0.5774115", "0.5774115", "0.5774115", "0.5774115", "0.5774115", "0.5761079", "0.57592577", "0.57592577", "0.5749888", "0.5749888", "0.5749888", "0.5748457", "0.5733414", "0.5733414", "0.5733414", "0.57209575", "0.57154554", "0.57149583", "0.57140404", "0.57140404", "0.57140404", "0.57140404", "0.57140404", "0.57140404", "0.57140404", "0.571194", "0.57043016", "0.56993437", "0.5696782", "0.5687825", "0.5677794", "0.5673577", "0.5672046", "0.5669512", "0.5661156", "0.56579345", "0.5655569", "0.5655569", "0.5655569", "0.56546396", "0.56543446", "0.5653163", "0.56502634" ]
0.0
-1
TODO Autogenerated method stub
@Override public String[] getPrettyColumnNames() { return this.dispColNames; //未实现 }
{ "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 String[] getMethodNames() { return this.methodNames; //未实现 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.66708666", "0.65675074", "0.65229905", "0.6481001", "0.64770633", "0.64584893", "0.6413091", "0.63764185", "0.6275735", "0.62541914", "0.6236919", "0.6223816", "0.62017626", "0.61944294", "0.61944294", "0.61920846", "0.61867654", "0.6173323", "0.61328775", "0.61276996", "0.6080555", "0.6076938", "0.6041293", "0.6024541", "0.6019185", "0.5998426", "0.5967487", "0.5967487", "0.5964935", "0.59489644", "0.59404725", "0.5922823", "0.5908894", "0.5903041", "0.5893847", "0.5885641", "0.5883141", "0.586924", "0.5856793", "0.58503157", "0.58464456", "0.5823378", "0.5809384", "0.58089525", "0.58065355", "0.58065355", "0.5800514", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57896614", "0.5789486", "0.5786597", "0.5783299", "0.5783299", "0.5773351", "0.5773351", "0.5773351", "0.5773351", "0.5773351", "0.5760369", "0.5758614", "0.5758614", "0.574912", "0.574912", "0.574912", "0.57482654", "0.5732775", "0.5732775", "0.5732775", "0.57207066", "0.57149917", "0.5714821", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57115865", "0.57045746", "0.5699", "0.5696016", "0.5687285", "0.5677473", "0.5673346", "0.56716853", "0.56688815", "0.5661065", "0.5657898", "0.5654782", "0.5654782", "0.5654782", "0.5654563", "0.56536144", "0.5652585", "0.5649566" ]
0.0
-1
TODO Autogenerated method stub
@Override public String[] getAllObjectsName() throws Exception { return null; //未实现 }
{ "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
read the file correctMe.txt and copy it in an ArrayList
public static void loadFile(String inputFile, ArrayList<String> array) { String line = ""; String[] words; try { BufferedReader reader = new BufferedReader(new FileReader(inputFile)); System.out.println("\nFile found"); System.out.println("Loading file... \"CorrectMe\""); while ((line = reader.readLine()) != null) { line = line.replaceAll("[^a-zA-Z ]", "").toLowerCase(); words = line.split(" "); for (int i = 0; i < words.length; i++) array.add(words[i]); } reader.close(); } catch (IOException ex) { System.out.println("File not found"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void takeInFile() {\n System.out.println(\"Taking in file...\");\n //Reads the file\n String fileName = \"messages.txt\";\n String line = null;\n try {\n FileReader fileReader = new FileReader(fileName);\n \n BufferedReader bufferedReader = new BufferedReader(fileReader);\n\n //Adds each line to the ArrayList\n int i = 0;\n while ((line = bufferedReader.readLine()) != null) {\n lines.add(line);\n //System.out.println(line);\n i++;\n }\n \n bufferedReader.close();\n } catch (FileNotFoundException ex) {\n System.out.println(\"Unable to open file '\" + fileName + \"'\");\n } catch (IOException ex) {\n System.out.println(\"Error reading file '\" + fileName + \"'\");\n }\n System.out.println(\"Done taking in file...\");\n }", "private static ArrayList<String> readFile() throws ApplicationException {\r\n\r\n ArrayList<String> bookList = new ArrayList<>();\r\n\r\n File sourceFile = new File(FILE_TO_READ);\r\n try (BufferedReader input = new BufferedReader(new FileReader(sourceFile))) {\r\n\r\n if (sourceFile.exists()) {\r\n LOG.debug(\"Reading book data\");\r\n String oneLine = input.readLine();\r\n\r\n while ((oneLine = input.readLine()) != null) {\r\n\r\n bookList.add(oneLine);\r\n\r\n }\r\n input.close();\r\n } else {\r\n throw new ApplicationException(\"File \" + FILE_TO_READ + \" does not exsit\");\r\n }\r\n } catch (IOException e) {\r\n LOG.error(e.getStackTrace());\r\n }\r\n\r\n return bookList;\r\n\r\n }", "public List<String> loadCorrectAnswers() {\r\n\t\tScanner scanner = null;\r\n\t\ttry {\r\n\t\t\t// Creating scanner that reads the questions.txt file.\r\n\t\t\tscanner = new Scanner(new File(\"javaCorrectAnswers.txt\"));\r\n\t\t\t// Loop that goes over the file and adding each line as a string element to the\r\n\t\t\t// list. The result is full list with the questions.\r\n\t\t\twhile (scanner.hasNextLine()) {\r\n\r\n\t\t\t\tcorrectAnswers.add(scanner.nextLine());\r\n\t\t\t}\r\n\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// Closing the scanner.\r\n\t\tfinally {\r\n\t\t\tscanner.close();\r\n\t\t}\r\n\t\treturn correctAnswers;\r\n\t}", "public void populateListFromFile() \n\t{\n\t\tBufferedReader bufferedReader = null;\n\t\tallQuestions = new ArrayList<ArrayList<String>>();\n\t\tquestionAndAnswers = new ArrayList<String>();\n\n\t\ttry {\n\t\t bufferedReader = new BufferedReader(new FileReader(\"questions.txt\"));\n\t\t String line = \"\";\n\t\t \n\t\t while ((line = bufferedReader.readLine()) != null) \n\t\t {\t\t\t \t\n\t\t \tif(line.length() > 0)\n\t\t \t\tquestionAndAnswers.add(line);\n\t\t \telse if (line.length() == 0)\n\t\t \t{\n\t\t \t\tallQuestions.add(questionAndAnswers);\n\t\t \t\tquestionAndAnswers = new ArrayList<String>();\n\t\t \t}\n\t\t } \n\t\t} catch (IOException e) {\n\t\t e.printStackTrace();\n\t\t}\n\t}", "static List<String> fileToList(){\n List<String> contacts = null;\n try {\n Path contactsListPath = Paths.get(\"contacts\",\"contacts.txt\");\n contacts = Files.readAllLines(contactsListPath);\n } catch (IOException ioe){\n ioe.printStackTrace();\n }\n return contacts;\n }", "static void read()\n\t\t{\n\n\n\t\t\tString content=new String();\n\t\t\ttry {\n\t\t\t\tFile file=new File(\"Dic.txt\");\n\t\t\t\tScanner scan=new Scanner(file);\n\t\t\t\twhile(scan.hasNextLine()) {\n\t\t\t\t\tcontent=scan.nextLine();\n\t\t\t\t//\tSystem.out.println(content);\n\n\t\t\t\t//\tString [] array=content.split(\" \");\n\t\t\t\t\tlist.add(content.trim());\n\n\t\t\t\t}\n\t\t\t\tscan.close(); \n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tSystem.out.println(e);\n\t\t\t}\n\n\n\t\t}", "private void readItems() {\n // open file\n File file = getFilesDir();\n File todoFile = new File(file, \"scores.txt\");\n // try to find items to add\n try {\n items = new ArrayList<>(FileUtils.readLines(todoFile));\n } catch (IOException e) {\n items = new ArrayList<>();\n }\n }", "private void readListFromFile() {\n // clear existing list\n if (listArr == null || listArr.size() > 0) {\n listArr = new ArrayList<>();\n }\n\n try {\n Scanner scan = new Scanner(openFileInput(LIST_FILENAME));\n\n while (scan.hasNextLine()) {\n String line = scan.nextLine();\n listArr.add(line);\n }\n\n if (listAdapter != null) {\n listAdapter.notifyDataSetChanged();\n }\n\n } catch (IOException ioe) {\n Log.e(\"ReadListFromFile\", ioe.toString());\n }\n\n }", "private void readFile() {\r\n\t\tScanner sc = null; \r\n\t\ttry {\r\n\t\t\tsc = new Scanner(inputFile);\t\r\n\t\t\twhile(sc.hasNextLine()){\r\n\t\t\t\tgrade.add(sc.nextLine());\r\n\t } \r\n\t\t}\r\n\t\tcatch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tsc.close();\r\n\t\t}\t\t\r\n\t}", "ArrayList<WordListItem> addDataFromFile(){\n BufferedReader br;\n InputStream inputStream = context.getResources().openRawResource(R.raw.animal_list);\n br = new BufferedReader(\n new InputStreamReader(inputStream, Charset.forName(\"UTF-8\"))\n );\n String currentLine;\n ArrayList<WordListItem> wordListItems = new ArrayList<WordListItem>();\n try {\n while ((currentLine = br.readLine()) != null) {\n String[] tokens = currentLine.split(\";\");\n\n String word = tokens[0];\n String pronunciation = tokens[1];\n String description = tokens[2];\n\n WordListItem wordItem = new WordListItem(word, pronunciation, description);\n wordItem.setImgResNbr(setImgResFromWord(wordItem.getWord().toLowerCase()));\n wordListItems.add(wordItem);\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n if (br != null) br.close();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }\n\n return wordListItems;\n }", "public ArrayList<String> readFromFile(){\n ArrayList<String> results = new ArrayList<>();\n //Wrap code in a try/ catch to help with exception handling.\n try{\n //Create a object of Scanner class\n Scanner s = new Scanner(new FileReader(path));\n //While loop for iterating thru the file.\n // Reads the data and adds it to the ArrayList.\n while(s.hasNext()) {\n String c1 = s.next();\n String c2 = s.next();\n String w = s.next();\n results.add(c1);\n results.add(c2);\n results.add(w);\n }return results;\n\n }//File not found exception block.\n catch(FileNotFoundException e){\n System.out.println(e);\n }\n return results;//default return.\n }", "private void readFile() {\n try (BufferedReader br = new BufferedReader(new FileReader(\"../CS2820/src/production/StartingInventory.txt\"))) {\n String line = br.readLine();\n while (line != null) {\n line = br.readLine();\n this.items.add(line);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private ArrayList<String> parseFile(String file_name){ // extract each line from file AS string (stopList)\r\n ArrayList<String> list = new ArrayList<>();\r\n Scanner scanner = null;\r\n try{\r\n scanner = new Scanner(new BufferedReader(new FileReader(file_name)));\r\n while (scanner.hasNextLine())\r\n {\r\n list.add(scanner.nextLine());\r\n }\r\n }\r\n catch (Exception e ){ System.out.println(\"Error reading file -> \"+e.getMessage()); }\r\n finally {\r\n if(scanner != null ){scanner.close();} // close the file\r\n }\r\n return list;\r\n }", "public List<Answer> loadAnswers() {\r\n\t\tScanner scanner = null;\r\n\t\ttry {\r\n\t\t\t// Creating scanner that reads the questions.txt file.\r\n\t\t\tscanner = new Scanner(new File(\"javaAnswers.txt\"));\r\n\t\t\t// Loop that goes over the file and adding each line as a string element to the\r\n\t\t\t// list. The result is full list with the questions.\r\n\t\t\twhile (scanner.hasNextLine()) {\r\n\t\t\t\tAnswer a = new Answer();\r\n\t\t\t\ta.setPossibleAnswer(scanner.nextLine());\r\n\t\t\t\tpossibleAnswers.add(a);\r\n\t\t\t}\r\n\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// Closing the scanner.\r\n\t\tfinally {\r\n\t\t\tscanner.close();\r\n\t\t}\r\n\t\treturn possibleAnswers;\r\n\t}", "private ArrayList<String> saveText(){\n FileReader loadDetails = null;\n String record;\n record = null;\n\n //Create an ArrayList to store the lines from text file\n ArrayList<String> lineKeeper = new ArrayList<String>();\n\n try{\n loadDetails=new FileReader(\"employees.txt\");\n BufferedReader bin=new BufferedReader (loadDetails);\n record=new String();\n while (((record=bin.readLine()) != null)){//Read the file and store it into the ArrayList line by line*\n lineKeeper.add(record);\n }//end while\n bin.close();\n bin=null;\n }//end try\n catch (IOException ioe) {}//end catc\n\n return lineKeeper;\n\n }", "void readFile()\n {\n Scanner sc2 = new Scanner(System.in);\n try {\n sc2 = new Scanner(new File(\"src/main/java/ex45/exercise45_input.txt\"));\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n while (sc2.hasNextLine()) {\n Scanner s2 = new Scanner(sc2.nextLine());\n while (s2.hasNext()) {\n //s is the next word\n String s = s2.next();\n this.readFile.add(s);\n }\n }\n }", "public ArrayList<String> readFile() {\n data = new ArrayList<>();\n String line = \"\";\n boolean EOF = false;\n\n try {\n do {\n line = input.readLine();\n if(line == null) {\n EOF = true;\n } else {\n data.add(line);\n }\n } while(!EOF);\n } catch(IOException io) {\n System.out.println(\"Error encountered.\");\n }\n return data;\n }", "public ArrayList<String> readFile(File file) {\n\t\tArrayList<String> al = new ArrayList<String>();\n\t\ttry {\n\t\t\tif (file.exists()) {\n\t\t\t\tFileReader fr = new FileReader(file);\n\t\t\t\tBufferedReader br = new BufferedReader(fr);\n\t\t\t\tString line;\n\t\t\t\tbr.readLine();\n\t\t\t\twhile((line = br.readLine()) != null) {\n\t\t\t\t\tal.add(line);\n\t\t\t\t\tSystem.out.println(line);\n\t\t\t\t}\n\t\t\t\tbr.close();\n\t\t\t}\n\t\t} catch (IOException e) {\t\n\t\t\t}\n\t\treturn al;\n\t\t}", "public List<String> readFile(File inputFile) {\n\n List<String> AL = new ArrayList<>();\n List<String> retAL;\n wordReplace wr = new wordReplace();\n String text;\n try{\n Scanner file_scan = new Scanner(inputFile);\n while(file_scan.hasNextLine()){\n text= file_scan.nextLine();\n AL.add(text);\n }\n file_scan.close();\n }\n catch(IOException e){\n System.out.println(\"File Not Found for some reason.\");\n }\n retAL = wr.replaceWord((ArrayList<String>) AL);\n return retAL;\n }", "public static void read8() {\n List<String> list = new ArrayList<>();\n\n try (Stream<String> stream = Files.lines(Paths.get(filePath))) {\n\n //1. filter line 3\n //2. convert all content to upper case\n //3. convert it into a List\n list = stream\n .filter(line -> !line.startsWith(\"line3\"))\n .map(String::toUpperCase)\n .collect(Collectors.toList());\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n list.forEach(System.out::println);\n }", "public List<String> readFile() {\n \n try {\n ensureFileExists();\n return Files.readAllLines(filePath);\n } catch (FileNotFoundException ex) {\n return new ArrayList<>();\n } catch (IOException ex) {\n ex.printStackTrace();\n return new ArrayList<>();\n }\n }", "public static ArrayList<Item> readFromFile() {\n\t\t\n\t\tPath writeFile = Paths.get(\"list.txt\");\n\t\tFile file = writeFile.toFile();\n\t\tArrayList<Item> itemList = new ArrayList<Item>();\n\n\t\ttry {\n\t\t\tFileReader fr = new FileReader(file);\n\t\t\t// this is a buffer and the benefit of using this is to is to store a block of\n\t\t\t// memory that\n\t\t\t// we can read data from later -- more efficient than Scanner\n\n\t\t\tBufferedReader reader = new BufferedReader(fr);\n\t\t\t// this is attempting to read the first line from the text document\n\t\t\tString line = \"\";\n\t\t\twhile ((line = reader.readLine()) != null) {\n\n\t\t\t\tString[] stringArray= line.split(\",\");\n\t\t\t\tItem item = new Item(Integer.parseInt(stringArray[0]), stringArray[1], stringArray[2],stringArray[3],Integer.parseInt(stringArray[4]),Double.parseDouble(stringArray[5]) );\n\t\t\t\titemList.add(item);\n\t\t\t}\n\t\t\treader.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"There were no items!\");\n\t\t}\n\t\treturn itemList;\n\t}", "public static List read(String fileName) throws IOException {\n\tList data = new ArrayList() ;\n Scanner scanner = new Scanner(new FileInputStream(fileName));\n try {\n while (scanner.hasNextLine()){\n data.add(scanner.nextLine());\n }\n }\n finally{\n scanner.close();\n }\n return data;\n }", "private List<String> readFile() throws FileNotFoundException {\t\n\t\tList<String> itemsLines = new ArrayList<>();\n\t\tFile inputFile = new File(filePath);\t\n\t\ttry (Scanner newScanner = new Scanner(inputFile)) {\n\t\t\twhile(newScanner.hasNextLine()) {\n\t\t\t\titemsLines.add(newScanner.nextLine());\n\t\t\t}\t\n\t\t}\n\t\treturn itemsLines;\n\t}", "private ArrayList<String> readEntriesFromFile(String nameOfFile){\n\t\tArrayList<String> foundEntries = new ArrayList<String>();\n\t\t\n\t\ttry{\n\t\t\tFile file = new File(nameOfFile); \n\t\t\tScanner fileIn = new Scanner(file);\n\t\t\twhile (fileIn.hasNext()){\n\t\t\t\tString currentLine = fileIn.nextLine();\n\t\t\t\tfoundEntries.add(currentLine);\n\t\t\t} \n\t\t\tfileIn.close();\n\t\t}catch (IOException e){\n\t\t}\n\t\t\n\t\tif(foundEntries.size()==0){\n\t\t return null;\n\t\t}else{\n\t\t\treturn foundEntries;\n\t\t}\n\t}", "public ArrayList<String> read_file() {\n prog = new ArrayList<>();\n //Read file\n try {\n\n File myObj = new File(\"in3.txt\");\n Scanner myReader = new Scanner(myObj);\n while (myReader.hasNextLine()) {\n String data = myReader.nextLine();\n if (data.charAt(0) != '.') {\n// System.out.println(data);\n prog.add(data);\n } else {\n continue;\n// data = data.substring(1);\n// System.out.println(\"{{ \" + data + \" }}\");\n }\n\n }\n myReader.close();\n\n } catch (FileNotFoundException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n\n return prog;\n }", "public List<String> spellCheck(String fileName) {\r\n List<String> list = new LinkedList<String>();\r\n\r\n Scanner fileScanner;\r\n\r\n try {\r\n // use a FileInputStream to ensure correct reading end-of-file\r\n fileScanner = new Scanner(new FileInputStream(\"data\" + File.separator +fileName));\r\n\r\n while (fileScanner.hasNextLine()) {\r\n String nextLine = fileScanner.nextLine();\r\n // System.out.println(\"nextLine: \" + nextLine); uncomment if you want to see what is read in\r\n String [] words = nextLine.split(\" \");\r\n\r\n for(int i = 0; i < words.length; i++)\r\n {\r\n if(words[i].length() > 0 && !contains(words[i]))\r\n {\r\n list.add(words[i]);\r\n }\r\n }\r\n }\r\n\r\n } catch (FileNotFoundException ex) {\r\n System.out.println(\"could not find the file \" +fileName+ \"in the data directory!\");\r\n return null;\r\n }\r\n\r\n return list;\r\n }", "public static ArrayList<Player> readPlayersFromFile() \r\n {\r\n //Inisialize Arraylist \r\n ArrayList<Player> players = new ArrayList<Player>();\r\n //Inisialize FileInputStream\r\n FileInputStream fileIn = null;\r\n\r\n try \r\n {\r\n //Establish connection to file \r\n fileIn = new FileInputStream(\"players.txt\");\r\n while (true) \r\n {\r\n //Create an ObjectOutputStream \r\n ObjectInputStream objectIn = new ObjectInputStream(fileIn);\r\n //Read a Player object from the file and add it to the ArrayList\r\n players.add((Player)objectIn.readObject());\r\n }//end while\r\n\r\n }\r\n catch (Exception e)\r\n {\r\n //System.out.println(e);\r\n }\r\n finally \r\n {\r\n usernamesTaken.clear();\r\n\r\n for(int i = 0; i < players.size(); i++)\r\n {\r\n usernamesTaken.add(players.get(i).getUsername());\r\n }//end for\r\n\r\n //Try to close the file and return the ArrayList\r\n try\r\n {\r\n //Check if the end of the file is reached\r\n if (fileIn != null)\r\n { \r\n //Close the file \r\n fileIn.close();\r\n //Return the ArrayList of players\r\n return players;\r\n }\r\n }\r\n catch (Exception e)\r\n {\r\n //System.out.println(e)\r\n }//end try \r\n\r\n //Return null if there is an excetion \r\n return null;\r\n }//end try \r\n }", "public ArrayList<Task> readFile() throws DukeException, IOException {\n\n TaskList taskList = new TaskList();\n\n if(Files.exists(Path.of(PATH_DIRECTORY))) {\n File f = new File (PATH_DIRECTORY + \"/tasks.txt\");\n Scanner sc = new Scanner(f);\n\n while(sc.hasNext()) {\n String partialString = sc.nextLine();\n String[] data = partialString.trim().split(\"\\\\|\", 3);\n taskAssigner(data, taskList);\n }\n } else {\n File f = new File (PATH_DIRECTORY);\n boolean dirExists = f.mkdir();\n if (dirExists) {\n f = new File (PATH_DIRECTORY + \"/tasks.txt\");\n f.createNewFile();\n } else {\n throw new DukeException();\n }\n }\n\n return taskList.getTaskArrayList();\n }", "public ArrayList<String> fileRead(String fileName) {\n String line = null;\n ArrayList<String> list = new ArrayList<>();\n try {\n // FileReader reads text files in the default encoding.\n FileReader fileReader = new FileReader(fileName);\n\n // Always wrap FileReader in BufferedReader.\n BufferedReader bufferedReader = new BufferedReader(fileReader);\n\n while ((line = bufferedReader.readLine()) != null) {\n list.add(line);\n }\n\n // Always close files.\n bufferedReader.close();\n } catch (FileNotFoundException ex) {\n System.out.println(\"Unable to open file '\" + fileName + \"'\");\n\n } catch (IOException ex) {\n System.out.println(\"Error reading file '\" + fileName + \"'\");\n }\n return list;\n }", "public ArrayList<SoundInfo> readFile(String textFilePath) {\n\t\t\n\t\topenNewProject();\n\t\tprojectFileIO = new XMLReaderWriter(textFilePath);\n\t\t\n\t\t// Read the project file and save its contents to memory\n\t\tArrayList<SoundInfo> readSounds = projectFileIO.readFile();\n\t\tArrayList<Integer> removeSounds = new ArrayList<Integer>();\n\t\tfor (int s=0; s < readSounds.size(); s++) {\n\t\t\tSoundInfo currSound = readSounds.get(s);\n\t\t\tint keyCode = currSound.getKeyCode();\n\t\t\t\n\t\t\tif (!soundList.containsKey(keyCode)) {\n\t\t\t\tsoundList.put(keyCode, currSound);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Two sounds with the same key code were found in the file\n\t\t\t\t// Report this as a read error\n\t\t\t\tremoveSounds.add(s);\n\t\t\t\tcurrSound.close();\n\t\t\t\tprojectModified = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Remove sounds with duplicate key codes from the list\n\t\tfor (int i=0; i < removeSounds.size(); i++) {\n\t\t\tint index = removeSounds.get(i);\n\t\t\treadSounds.remove(index);\n\t\t}\n\t\t\n\t\t// The contents of the project file may have been modified in memory to make the values valid\n\t\tif (projectFileIO.getReadError()) {\n\t\t\tprojectModified = true;\n\t\t}\n\t\t\n return readSounds;\n\t}", "public ArrayList<String> verPuntajes(){\r\n\t\tFile archivo = new File(\"archivos/puntajes.txt\");\r\n\t\tArrayList<String> datos = new ArrayList<String>();\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tFileReader fr = new FileReader(archivo);\r\n\t\t\tBufferedReader br = new BufferedReader(fr);\r\n\t\t\tString linea = \"\";\r\n\t\t\twhile ((linea = br.readLine()) != null) {\r\n\t\t\t\tdatos.add(linea);\t\t\t\t\r\n\t\t\t}\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn datos;\r\n\t}", "public List<String> readFileIntoList(String filepath) throws IOException;", "private void loadQuestions() throws IOException, FileNotFoundException {\n \t\tquestions = new ArrayList<>();\n \n \t\tBufferedReader br = new BufferedReader(new FileReader(\"QuestionBank.txt\"));\n \n \t\tString question;\n \t\tString[] choices = new String[4];\n \t\tint correctIndex = 0;\n \n \t\tquestion = br.readLine();\n \t\twhile (question != null) {\n \t\t\tfor (byte i = 0; i < 4; ++i) {\n \t\t\t\tchoices[i] = br.readLine();\n \t\t\t\t// -- marks the right answer\n \t\t\t\tif (choices[i].indexOf(\"--\") != -1) {\n \t\t\t\t\tcorrectIndex = i;\n \t\t\t\t}\n \t\t\t}\n \n \t\t\tquestions.add(new Question(question, choices, correctIndex));\n \t\t\tquestion = br.readLine();\n \t\t}\n \t\tbr.close();\n \t}", "private ArrayList<Book> readBookCollection() {\n File file = new File(\"books.txt\");\n ArrayList<Book> collection = new ArrayList<Book>();\n try {\n FileReader fileReader = new FileReader(file);\n BufferedReader reader = new BufferedReader(fileReader);\n while (true) {\n String line = reader.readLine();\n if (line == null) break;\n line = line.trim();\n if (line.equals(\"\")) continue; // ignore possible blank lines\n String[] bookInfo = line.split(\" :: \");\n collection.add(new Book(bookInfo[0], bookInfo[1]));\n }\n }\n catch (IOException e) {\n System.out.println(e.getMessage());\n }\n return collection;\n }", "public static ArrayList<String> getRenglones(FileReader file) throws IOException {\n ArrayList<String> producciones = new ArrayList<>();\n BufferedReader b = new BufferedReader(file);\n\n String readedString;\n while ((readedString = b.readLine()) != null) { //cuando b.readLine() == null significa que se ha encontrado un salto de linea (retorno de carro —\\n—)\n producciones.add(readedString);\n }\n return producciones;\n }", "private static List<String> readFile(File file) throws IOException {\n return Files.readAllLines(file.toPath());\n }", "private static List<String> readFile(File file) throws IOException {\n return Files.readAllLines(file.toPath());\n }", "public static List<String> getPalindromes(File f) throws IOException\n {\n //FileReader constructor throws FileNotFoundException (IOException)\n BufferedReader br = new BufferedReader(new FileReader(f));\n List<String> strings = new ArrayList<String>();\n String s;\n while ((s=br.readLine())!=null)\n {\n strings.add(s.toLowerCase());\n }\n\n br.close();\n return getPalindromes(strings);\n }", "private static void list() throws FileNotFoundException {\n ArrayList<String> words = new ArrayList<>();\n Scanner input = new Scanner(new File(fileLocation));\n while (input.hasNext()) {\n String word = input.next();\n if (!words.contains(word)) {\n words.add(word);\n }\n }\n }", "private List<String> readFile(String fileName)\n {\n try\n {\n String file = new String(Files.readAllBytes(Paths.get(fileName)), Charset.forName(\"ISO-8859-1\"));\n file = file\n .toLowerCase()\n .replaceAll(\"[^\\\\w]+\", \" \")\n .replaceAll(\"[0-9]\", \"\");\n Tokenizer tokenizer = SimpleTokenizer.INSTANCE;\n String[] tokens = tokenizer.tokenize(file);\n return Arrays.asList(tokens);\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n return new ArrayList<>();\n }", "public static ArrayList<String> readToString(String filePath) {\n\t\tFile file = new File(filePath);\n\t\tArrayList<String> res = new ArrayList<String>();\n\t\tif (!file.exists()) {\n\t\t\treturn res;\n\t\t}\n\t\ttry {\n\t\t\tFileReader fr = new FileReader(file);\n\t\t\tBufferedReader br = new BufferedReader(fr);\n\t\t\tString str = null;\n\t\t\twhile ((str = br.readLine()) != null) {\n\t\t\t\tres.add(str);\n\t\t\t}\n\t\t\tfr.close();\n\t\t\tbr.close();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\treturn res;\n\t}", "public ArrayList<String> readFromFile(String fileName) throws IOException {\n\t\tBufferedReader reader = new BufferedReader(new FileReader(fileName));\n\t ArrayList<String> retour = new ArrayList<String>();\n\t String line = null;\n\t while((line = reader.readLine()) != null) \n\t \tretour.add(line);\n\t \n\t reader.close();\n\t return retour; \n\t}", "public ArrayList<Task> copyFileContents() throws IOException {\n assert filePath != null;\n File f = new File(this.filePath); // create a File for the given file path\n Scanner s = new Scanner(f); // create a Scanner using the File as the source\n StringBuilder targetBuilder = new StringBuilder();\n while (s.hasNext()) {\n targetBuilder.append(s.nextLine()).append(\"\\n\");\n }\n\n return parse(targetBuilder.toString());\n }", "public static void readFromFile(ArrayList<String> sArrayList, Context context){\n\n int i=0;\n try{\n InputStream inputStream = context.openFileInput(TxtName);\n\n if(inputStream!=null) {\n InputStreamReader inputStreamReader = new InputStreamReader(inputStream);\n BufferedReader bufferedReader = new BufferedReader(inputStreamReader);\n String receivedString = \"\";\n\n while((receivedString = bufferedReader.readLine())!=null){\n sArrayList.set(i,receivedString);\n Log.d(\"fileContent\", \"readFromFile: \"+sArrayList.get(i)+\"\\n\");\n i++;\n }\n inputStream.close();\n }\n\n } catch (FileNotFoundException e) {\n Log.e(\"login activity\", \"File not found: \" + e.toString());\n } catch (IOException e) {\n Log.e(\"login activity\", \"Can not read file: \" + e.toString());\n }\n\n }", "public void readPoemFiles(){\n try (Scanner fileScan = new Scanner(new File(\"poems.txt\"))) {\n //Poems.txt consist of a header (poet and theme) plus verse lines.\n //First loop reads the header and creates object 'PoetAndTheme'.\n while (fileScan.hasNextLine()){\n String themeAndPoet = fileScan.nextLine();\n PoetAndTheme addToList = new PoetAndTheme(themeAndPoet);\n //Second loop reads verse lines and adds them to object 'PoetAndTheme'.\n while(fileScan.hasNextLine()){\n String verseLine = fileScan.nextLine();\n if (verseLine.isEmpty()){\n break;\n }\n addToList.addVerseLine(verseLine);\n }\n poetsAndThemesList.add(addToList);\n }\n \n } catch (Exception e) {\n System.out.println(\"Error: \" + e.getMessage());\n }\n }", "protected List<List<String>> readFile() throws FileNotFoundException {\n\n List<List<String>> list = new ArrayList<>();\n\n File dire = new File(dir);\n File file = new File(dire, filename);\n\n try (Scanner in = new Scanner(file)) {\n\n while (in.hasNextLine()) {\n \n String line = in.nextLine();\n \n String temp[] = line.split(delimiter);\n \n list.add(Arrays.asList(temp));\n }\n in.close();\n } catch (IOException e) {\n System.out.println(\"Error reading file!\");\n }\n return list;\n }", "public static List<Server> readFile() {\n String fileName = \"servers.txt\";\n\n List<Server> result = new LinkedList<>();\n try (Scanner sc = new Scanner(createFile(fileName))) {\n\n while (sc.hasNextLine()) {\n String line = sc.nextLine();\n result.add(lineProcessing(line));\n\n }\n\n } catch (FileNotFoundException e) {\n System.out.println(\"File is not found\");\n } catch (MyException e) {\n System.out.println(\"File is corrupted\");\n }\n return result;\n }", "List readFile(String pathToFile);", "public void readUserFile (){\n try {\n FileReader reader = new FileReader(fileName);\n BufferedReader bufferedReader = new BufferedReader(reader);\n String line;\n while ((line = bufferedReader.readLine()) != null) {\n Scanner s = new Scanner(line); //use of a scanner to parse the line and assign its tokens to different variables\n//each line corresponds to the values of a User object\n while(s.hasNext()){\n String usrname = s.next();\n String pass = s.next();\n User u = new User(usrname,pass);\n userlist.add(u);//added to the list\n }\n \n }\n reader.close();\n \n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private ArrayList<String> readTestCasesFromFile(File f)\r\n\t\t\tthrows EasyCorrectionException {\r\n\t\treturn readStringsFromFile(f, Constants.TEST_CASE_SEPARATOR);\r\n\t}", "public void readFile() {\r\n\t\tBufferedReader br = null;\r\n\r\n\t\ttry {\r\n\r\n\t\t\tString currentLine;\r\n\r\n\t\t\tbr = new BufferedReader(new FileReader(fileName));\r\n\r\n\t\t\twhile ((currentLine = br.readLine()) != null) {\r\n\r\n\t\t\t\tif (!currentLine.equals(\"\")) {\r\n\t\t\t\t\tString[] paragraphs = currentLine.split(\"\\\\n\\\\n\");\r\n\r\n\t\t\t\t\tfor (String paragraphEntry : paragraphs) {\r\n\t\t\t\t\t\t//process(paragraphEntry);\r\n\t\t\t\t\t\t//System.out.println(\"Para:\"+paragraphEntry);\r\n\t\t\t\t\t\tParagraph paragraph = new Paragraph();\r\n\t\t\t\t\t\tparagraph.process(paragraphEntry);\r\n\t\t\t\t\t\tthis.paragraphs.add(paragraph);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tif (br != null)br.close();\r\n\t\t\t} catch (IOException ex) {\r\n\t\t\t\tex.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public void readFile()\n {\n try {\n fileName = JOptionPane.showInputDialog(null,\n \"Please enter the file you'd like to access.\"\n + \"\\nHint: You want to access 'catalog.txt'!\");\n \n File aFile = new File(fileName);\n Scanner myFile = new Scanner(aFile);\n \n String artist, albumName; \n while(myFile.hasNext())\n { //first we scan the document\n String line = myFile.nextLine(); //for the next line. then we\n Scanner myLine = new Scanner(line); //scan that line for our info.\n \n artist = myLine.next();\n albumName = myLine.next();\n ArrayList<Track> tracks = new ArrayList<>();\n \n while(myLine.hasNext()) //to make sure we get all the tracks\n { //that are on the line.\n Track song = new Track(myLine.next());\n tracks.add(song);\n }\n myLine.close();\n Collections.sort(tracks); //sort the list of tracks as soon as we\n //get all of them included in the album.\n Album anAlbum = new Album(artist, albumName, tracks);\n catalog.add(anAlbum);\n }\n myFile.close();\n }\n catch (NullPointerException e) {\n System.err.println(\"You failed to enter a file name!\");\n System.exit(1);\n }\n catch (FileNotFoundException e) {\n System.err.println(\"Sorry, no file under the name '\" + fileName + \"' exists!\");\n System.exit(2);\n }\n }", "public static ArrayList<String> readFile(String fileName) {\n\t\tArrayList<String> al = new ArrayList<String>();\n\t\ttry {\n\t\t\tFile myObj = new File(fileName);\n\t\t\tScanner myReader = new Scanner(myObj);\n\t\t\twhile (myReader.hasNextLine()) {\n\t\t\t\tString data = myReader.nextLine();\n\t\t\t\tal.add(data);\n\t\t\t}\n\t\t\tmyReader.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\tif (e.toString().contains(\"No such file or directory\")) {\n\t\t\t\tal.add(\"no file found\");\n\t\t\t\treturn al;\n\t\t\t}\n\t\t}\n\t\treturn al;\n\t}", "private static ArrayList<String> read(String fileName, boolean next) {\n\t\t\n\n\t\tFile input = new File(fileName);\n\t\tArrayList<String> information = new ArrayList<String>();\n\t\t\n\t\t\n\t\t//uses a simple try catch to read the file\n\t\ttry {\n\t\t\t\n\t\t\tScanner fileReader = new Scanner(input);\n\t\t\t\n\t\t\tif(next) //if reading by word, the ArrayList will contain info by word\n\t\t\t\twhile(fileReader.hasNext()) \n\t\t\t\t\tinformation.add(fileReader.next());\n\t\t\t\t\n\t\t\telse //otherwise the ArrayList will contain info by lines\n\t\t\t\twhile(fileReader.hasNextLine())\n\t\t\t\t\tinformation.add(fileReader.nextLine());\n\t\t\t\n\t\t\tfileReader.close();\n\t\t} catch(FileNotFoundException e) {\n\t\t\t\n\t\t\te.printStackTrace();\n\t\t\t\n\t\t}\n\t\t\n\t\treturn information;\n\t}", "public String[] read()\n {\n ArrayList<String> input = new ArrayList<String>();\n try\n {\n dir = new File(contextRef.getFilesDir(), filename);\n if (dir.exists())\n {\n Scanner contacts = new Scanner(dir);\n while (contacts.hasNextLine())\n {\n input.add(contacts.nextLine());\n }\n contacts.close();\n }\n }catch (Exception ex)\n {\n //debug(\"read file contents failure\");\n debug = \"test read failure\";\n }\n return input.toArray(new String[1]);\n }", "public static String[] readFile() throws FileNotFoundException {\r\n\t\tScanner scan = new Scanner(new File(\"H:/My Documents/Eclipse/wordlist.txt\"));\r\n\t\tArrayList<String> a = new ArrayList<String>();\r\n\t\twhile (scan.hasNextLine()) {\r\n\t\t\ta.add(scan.nextLine());\r\n\t\t}\r\n\t\tString[] w = new String[a.size()];\r\n\t\tfor (int i = 0; i < a.size(); i++) {\r\n\t\t\tw[i] = a.get(i);\r\n\t\t}\r\n\t\tscan.close();\r\n\t\treturn w;\r\n\t}", "public static List<String> readFileAsList(String filePath) {\n\n\t\tBufferedReader readFile = null;\n\t\tString line = null;\n\t\tList<String> fileContents = new ArrayList<String>();\n\t\ttry {\n\t\t\treadFile = new BufferedReader((new FileReader(filePath)));\n\t\t\twhile ((line = readFile.readLine()) != null)\n\t\t\t\tfileContents.add(line);\n\t\t\treadFile.close();\n\t\t\treturn fileContents;\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"Unable to find file: \" + filePath);\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Unable to read file: \" + filePath);\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn fileContents;\n\t}", "public static ArrayList<String> textToStr(String path) throws IOException {\n ArrayList<String> lines = new ArrayList<>();\n try{\n File file = new File(path);\n FileReader fr = new FileReader(file);\n BufferedReader bufr = new BufferedReader(fr);\n String line = \"\";\n while((line = bufr.readLine()) != null){\n if(line.trim() != null && line.trim().length() > 0){\n lines.add(line.trim());\n }\n }\n return lines;\n }\n catch (Exception e){\n System.out.println(\"The path is wrong or the input file does not exist. Try again.\\n\");\n return null;\n }\n }", "public List<Question> loadQuestions() {\r\n\t\tScanner scanner = null;\r\n\t\ttry {\r\n\t\t\t// Creating scanner that reads the questions.txt file.\r\n\t\t\tscanner = new Scanner(new File(\"javaQuestions.txt\"));\r\n\t\t\t// Loop that goes over the file and adding each line as a string element to the\r\n\t\t\t// list. The result is full list with the questions.\r\n\t\t\twhile (scanner.hasNextLine()) {\r\n\t\t\t\tQuestion q = new Question();\r\n\t\t\t\tq.setQuestion(scanner.nextLine());\r\n\t\t\t\tquestions.add(q);\r\n\t\t\t}\r\n\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// Closing the scanner.\r\n\t\tfinally {\r\n\t\t\tscanner.close();\r\n\t\t}\r\n\t\treturn questions;\r\n\t}", "public static ArrayList<Student> read(String filename){\n\t\t\n\t\tArrayList<Student> students = new ArrayList<>();\n\n\t\tBufferedReader br;\n\t\ttry {\n\t\t\tbr = new BufferedReader(new FileReader(filename));\n\t\t\tString line;\n\t\t\twhile ((line = br.readLine()) != null) {\n\t\t\t\tif (line.contains(\" \")){\n\t\t\t\t\tstudents.add(new Student(getGpaFromLine(line), getSatFromLine(line)));\n\t\t\t\t}\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e){\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn students;\n\t}", "private void setWords() {\r\n words = new ArrayList<>();\r\n\r\n String line = null;\r\n try {\r\n // FileReader reads text files in the default encoding.\r\n FileReader fileReader = new FileReader(\"words.txt\");\r\n\r\n // Always wrap FileReader in BufferedReader.\r\n BufferedReader bufferedReader = new BufferedReader(fileReader);\r\n\r\n while((line = bufferedReader.readLine()) != null)\r\n words.add(line);\r\n\r\n // Always close files.\r\n bufferedReader.close();\r\n }\r\n catch(Exception ex) {\r\n ex.printStackTrace();\r\n System.out.println(\"Unable to open file '\");\r\n }\r\n }", "List<String> fileToListOfWords(File f) throws FileNotFoundException {\n\n\t\tScanner sc = new Scanner(f, \"UTF-8\");\n\n\t\tString txt = sc.useDelimiter(\"\\\\A\").next().toLowerCase();\n\t\tString[] s = txt.replaceAll(\"^[.,\\\\s]+\", \"\").split(\"[.,\\\\s]+\");\n\t\tsc.close(); // ovo je dobro\n\t\tList<String> list = Arrays.asList(s);\n\t\t\n\t\treturn list;\n\t}", "private ArrayList<String> load(String fileName, String initialWord)\n\t{\n\t\tArrayList<String> words = new ArrayList<String>();\n\t\ttry{\n\t\t\tBufferedReader reader = new BufferedReader(new FileReader(fileName));\n\t\t\tString word = reader.readLine();\n\t\t\twhile(word != null){\n\t\t\tif(word.length()==initialWord.length())\n\t\t\t\twords.add(word);\n\t\t\tword = reader.readLine();\n\t\t\t}\n\t\t\treader.close();\n\t\t}catch(IOException e){\n\t\t\tSystem.err.println(\"Can't find a file '\"+fileName+\"'!\");\n\t\t\tJOptionPane.showMessageDialog(null,\"Can't find a file '\"+fileName+\"'!\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t}\n\t\treturn words;\n\t}", "public static List<List<String>> readFile() {\r\n List<List<String>> out = new ArrayList<>();\r\n File dir = new File(\"./tmp/data\");\r\n dir.mkdirs();\r\n File f = new File(dir, \"storage.txt\");\r\n try {\r\n f.createNewFile();\r\n Scanner s = new Scanner(f);\r\n while (s.hasNext()) {\r\n String[] tokens = s.nextLine().split(\"%%%\");\r\n List<String> tokenss = new ArrayList<>(Arrays.asList(tokens));\r\n out.add(tokenss);\r\n }\r\n return out;\r\n } catch (IOException e) {\r\n throw new Error(\"Something went wrong: \" + e.getMessage());\r\n }\r\n }", "public static void readFile(String myFile, List <Integer> myList) throws FileNotFoundException{\n \t \n Scanner fileScanner = new Scanner(new File(myFile)); // Reads in from filePath.\n \n while (fileScanner.hasNextInt()){ // Loops while there is still a next integer in the list.\n \t myList.add(fileScanner.nextInt()); // Adds all integers to RandomIntegers arraylist.\n }\n \n System.out.println(\"\\nFile read in successfully.\"); \n }", "public ArrayList <String> loadWordList () {\n ArrayList <String> words = new ArrayList <String> ();\n File file;\n if (chooser.showOpenDialog (null) == JFileChooser.APPROVE_OPTION) {\n file = chooser.getSelectedFile ();\n } else {\n return words;\n }\n if (file != null) {\n try {\n FileReader fileReader = new FileReader (file);\n BufferedReader buffer = new BufferedReader (fileReader);\n String temp;\n while ((temp = buffer.readLine ()) != null)\n words.add (temp);\n buffer.close ();\n return words;\n } catch (IOException e) {\n JOptionPane.showMessageDialog (null, \"File IO Exception\\n\" + e.getLocalizedMessage (), \"Error!\", JOptionPane.ERROR_MESSAGE);\n }\n }\n return words;\n }", "public static ArrayList<String> lerArquivo(String nomeArquivo) {\n\t\tString payLoad = \"\";\n\t\tArrayList<String> lista = new ArrayList<String>();\n\t\t\n\t\t\ttry{\n\t\t\t\tFileReader fr = new FileReader(nomeArquivo);\n\t\t\t\tBufferedReader br = new BufferedReader(fr);\n\t\t\t\t\n\t\t\t\twhile(true){\n\t\t\t\t\tpayLoad = br.readLine();\n\t\t\t\t\t\n\t\t\t\t\tif (payLoad == null){\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tlista.add(payLoad); //Adiciona no mapa.\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//System.out.println(s);\n\t\t\t\tbr.close();\n\t\t\t}\n\t\t\tcatch (IOException e){\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.out.println(\"Impossivel ler no arquivo\");\n\t\t\t}\n\t\t\t\n\t\t\treturn lista;\n\t}", "public static List<String> readIn(String filename) throws Exception {\r\n Path filePath = new File(filename).toPath();\r\n Charset charset = Charset.defaultCharset(); \r\n List<String> stringList = Files.readAllLines(filePath, charset);\r\n\r\n return stringList;\r\n }", "public static ArrayList<String> convert2listWithoutDuplicate(String filename) \n\t\t\tthrows FileNotFoundException{\n\t\t\n\t\tInputStream oeuvre = new FileInputStream(filename);\n\t\tScanner scanner = new Scanner(oeuvre).useDelimiter(\"\\n\");\n\t\t\n\t\tArrayList<String> words = new ArrayList<String>();\n\t\tString word = null;\n\t\twhile(scanner.hasNext()){\n\t\t\tword = scanner.next();\n\t\t\tif (!(words.contains(word))){\n\t\t\t\twords.add(word);\n\t\t\t}\n\t\t\n\t\t}\n\t\treturn words;\n\t}", "public void readFile()\r\n\t{\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tx = new Scanner(new File(\"clean vipr measles results.txt\"));\r\n\t\t\t\r\n\t\t\twhile (x.hasNext())\r\n\t\t\t{\r\n\t\t\t\tString a = x.next();\r\n\t\t\t\tString b = x.next();\r\n\t\t\t\tString c = x.next();\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.printf(\"%s %s %s \\n\\n\", a,b,c);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tx.close();\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"file not found\");\r\n\t\t}\r\n\t\r\n\t}", "private List<String> readFile(String path) throws IOException {\n return Files.readAllLines (Paths.get (path), StandardCharsets.UTF_8);\n }", "public static ArrayList<String> Readfile(String fileName) {\n\t\t\t\t\t// This will reference one line at a time\n\t\t\t\t\tArrayList<String> doc = new ArrayList<String>();\n\t\t\t\t\tString line = null;\n\t\t\t\t\tString fileNamehere = fileName;\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// FileReader reads text files in the default encoding.\n\t\t\t\t\t\tFileReader fileReader = new FileReader(fileName);\n\n\t\t\t\t\t\t// Always wrap FileReader in BufferedReader.\n\t\t\t\t\t\tBufferedReader bufferedReader = new BufferedReader(fileReader);\n\n\t\t\t\t\t\twhile ((line = bufferedReader.readLine()) != null) {\n\t\t\t\t\t\t\tdoc.add(line);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Always close files.\n\t\t\t\t\t\tbufferedReader.close();\n\t\t\t\t\t} catch (FileNotFoundException ex) {\n\t\t\t\t\t\tSystem.out.println(\"file not found '\" + fileName + \"'\");\n\t\t\t\t\t} catch (IOException ex) {\n\t\t\t\t\t\tex.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\treturn doc;\n\t}", "public void readFromFile(){\n\t\ttry {\r\n\t\t\tFile f = new File(\"E:\\\\Study\\\\Course\\\\CSE215L\\\\Project\\\\src\\\\Railway.txt\");\r\n\t\t\tScanner s = new Scanner(f);\r\n\t\t\tpersons = new Person2 [50]; \r\n\t\t\tint i = 0;\r\n\t\t\t\r\n\t\t\twhile(s.hasNextLine()){\r\n\t\t\t\tString a = s.nextLine();\r\n\t\t\t\tString b = s.nextLine();\r\n\t\t\t\tString c = s.nextLine();\r\n\t\t\t\tString d = s.nextLine();\r\n\t\t\t\tString e = s.nextLine();\r\n\t\t\t\tString g = s.nextLine();\r\n\t\t\t\tString h = s.nextLine();\r\n\t\t\t\tString j = s.nextLine();\r\n\t\t\t\tPerson2 temp = new Person2 (a,b,c,d,e,g,h,j);\r\n\t\t\t\tpersons[i] = temp;\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}", "public static List<String> makeListFromFile(String filename) {\n\t\tList<String> names = new ArrayList<>();\n\t\ttry {\n\t\t\tFile file = new File(\"/Users/adhiman/Downloads/\" + filename);\n\t\t\tScanner input = new Scanner(file);\n\t\t\t\n\t\t\twhile (input.hasNextLine()) {\n\t\t\t\tString line = input.nextLine();\n\t\t\t\tnames.add(line);\n\t\t\t}\n\t\t\tinput.close();\n\t\t\t\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\treturn names;\n\t}", "private ArrayList<String> readReturnFileContents(String fileName){\n String startingDir = System.getProperty(\"user.dir\");\n BufferedReader reader = null;\n String line = \"\";\n ArrayList<String> wholeFile = new ArrayList<String>();\n try {\n reader = new BufferedReader(new FileReader(startingDir + \"/\" + fileName));\n while ((line = reader.readLine()) != null) {\n wholeFile.add(line);\n }\n } catch (FileNotFoundException fnfe) {\n System.out.println(fnfe.getMessage());\n System.exit(1);\n } catch (NullPointerException npe) {\n System.out.println(npe.getMessage());\n System.exit(1);\n } catch (Exception ex) {\n System.out.println(ex.getMessage());\n System.exit(1);\n }\n return wholeFile;\n }", "@Override\n public ArrayList parseFile(String pathToFile) {\n\n Scanner scanner = null;\n try {\n scanner = new Scanner(new File(pathToFile));\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n ArrayList<String> data = new ArrayList<>();\n while (scanner.hasNext()) {\n data.add(scanner.next());\n }\n scanner.close();\n\n return data;\n }", "public static ArrayList<String> searchResultTxtFile(String syllable, ArrayList<String> syllableList,\n\t\t\tFilePath pathStr) throws IOException {\n\t\tsyllableList = new ArrayList<String>();\n\t\tFile file = new File(pathStr.getPathStr() + \"result.txt\");\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file), \"euc-kr\"));\n\t\tString resultStr = null;\n\t\tboolean isSyllable = false;\n\t\twhile ((resultStr = br.readLine()) != null) {\n\t\t\tif (resultStr.equals(syllable)) {\n\t\t\t\tisSyllable = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!resultStr.equals(\"\") && isSyllable == true) {\n\n\t\t\t\tif (isNumeric(resultStr)) {\n\t\t\t\t\tsyllableList.add(resultStr);\n\t\t\t\t} else {\n\t\t\t\t\tisSyllable = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn syllableList;\n\n\t}", "private ArrayList<String> getPackagesFromFile() {\n\t\tArrayList<String> temp = new ArrayList<String>();\r\n\t\ttry {\r\n\t\t\tString path = Environment.getExternalStorageDirectory().getCanonicalPath() + \"/data/levelup/\";\r\n\r\n\r\n\t\t\t//view2_.setText(\"\");\r\n\t\t\tFile root = new File(path);\r\n\r\n\r\n\t\t\troot.mkdirs();\r\n\r\n\r\n\t\t\tFile f = new File(root, \"custom.txt\");\r\n\t\t\tif(!f.exists())\r\n\t\t\t{\r\n\t\t\t\t//view2_.setText(\"now I am here\");\r\n\t\t\t\tFileOutputStream fos = new FileOutputStream(f);\r\n\t\t\t\tfos.close();\r\n\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tFileReader r = new FileReader(f);\r\n\t\t\tBufferedReader br = new BufferedReader(r);\r\n\r\n\r\n\r\n\t\t\t// Open the file that is the first\r\n\t\t\t// command line parameter\r\n\r\n\r\n\t\t\tString strLine;\r\n\t\t\t// Read File Line By Line\r\n\r\n\r\n\r\n\t\t\twhile ((strLine = br.readLine()) != null) {\r\n\t\t\t\t// Print the content on the console\r\n\t\t\t\t//String[] allWords;\r\n\t\t\t\tif(!strLine.equals(null)) temp.add(strLine);\r\n\t\t\t\tLog.i(\"packages from file\", strLine);\r\n\t\t\t}\r\n\r\n\t\t\tr.close();\r\n\r\n\r\n\t\t} catch (Exception e) {// Catch exception if any\r\n\t\t\t//System.err.println(\"Error: \" + e.getMessage());\r\n\t\t}\r\n\t\treturn temp;\r\n\t}", "public static ArrayList<String> readLines(String fileName){\n\t\treturn read(fileName, false);\n\t}", "public static ArrayList<String> inquiries() {\n ArrayList<String> temp = new ArrayList<String>();\n Scanner inquirer;\n try {\n inquirer = new Scanner(new File(\"Inquiries.txt\"));\n inquirer.useDelimiter(\", *\");\n while (inquirer.hasNext()){\n temp.add(\" \"+inquirer.next()+\" \");\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n return temp;\n }", "public ArrayList<quizImpl> readFile() {\n\n // The name of the file to open.\n String fileName = \"Quizzes.txt\";\n\n // This will reference one line at a time\n String line;\n\n try {\n //reads file twice the first time adding contacts the second adding meetings\n // FileReader reads text files in the default encoding.\n FileReader fileReader = new FileReader(fileName);\n\n // Wrap FileReader in BufferedReader.\n BufferedReader bufferedReader = new BufferedReader(fileReader);\n\n while ((line = bufferedReader.readLine()) != null) {\n quizzes.add(line);\n }\n bufferedReader.close();\n for (String s : quizzes) {\n if (s.startsWith(\"quizName\")) {\n //splits the line into an array of strings\n String[] stringArray = s.split(\",\");\n //If game already has a highScore\n if (stringArray.length > 3) {\n if (stringArray[stringArray.length - 3].equals(\"highScore\")) {\n quizImpl q = new quizImpl(stringArray[1], stringArray[stringArray.length - 2], Integer.parseInt(stringArray[stringArray.length - 1]));\n for (int i = 2; i < stringArray.length - 3; i = i + 6) {\n q.addQuestion(stringArray[i], stringArray[i + 1], stringArray[i + 2], stringArray[i + 3], stringArray[i + 4], Integer.parseInt(stringArray[i + 5]));\n }\n quizArray.add(q);\n } else {\n quizImpl q = new quizImpl(stringArray[1]);\n for (int i = 2; i < stringArray.length; i = i + 6) {\n q.addQuestion(stringArray[i], stringArray[i + 1], stringArray[i + 2], stringArray[i + 3], stringArray[i + 4], Integer.parseInt(stringArray[i + 5]));\n }\n quizArray.add(q);\n }\n } else {\n quizImpl q = new quizImpl(stringArray[1]);\n for (int i = 2; i < stringArray.length; i = i + 6) {\n q.addQuestion(stringArray[i], stringArray[i + 1], stringArray[i + 2], stringArray[i + 3], stringArray[i + 4], Integer.parseInt(stringArray[i + 5]));\n }\n quizArray.add(q);\n }\n }\n }\n } catch (FileNotFoundException ex) {\n System.out.println(\"Unable to open file '\" + fileName + \"'\");\n } catch (IOException ex) {\n System.out.println(\"Error reading file '\" + fileName + \"'\");\n }\n return quizArray;\n }", "public static void main(String[] args) {\n\r\n\t\tArrayList<CorreoElectronico> correo = new ArrayList<>();\r\n\r\nPath path = Paths.get(\"src/main/resources/emails.txt\");\r\n\r\n try(BufferedReader reader = Files.newBufferedReader(path, Charset.forName(\"UTF-8\"))){ \r\n\r\n String currentLine = null;\r\n\r\n while((currentLine = reader.readLine()) != null){//while there is content on the current line\r\n\r\n \t CorreoElectronico correos = new CorreoElectronico();\r\n \t String[] linea = currentLine.split(\" , \");\r\n \t correos.setDireccion(linea[0]);\r\n \t correos.setAsunto(linea[1]);\r\n \t correo.add(correos);\r\n System.out.println(currentLine); // print the current line\r\n\r\n }\r\n\r\n }catch(IOException ex){\r\n\r\n ex.printStackTrace(); //handle an exception here\r\n\r\n }\r\nEnviadorCorreo enviador = new EnviadorCorreo();\r\nfor (CorreoElectronico coreos: correo) {\r\n\tenviador.enviarCorreo(coreos);\r\n}\r\n\r\n\t}", "List<String> shouldReadFile(BufferedReader file) throws IOException {\n List<String> payments = new ArrayList<>();\n while (true){\n String paymentLine = file.readLine();\n if(paymentLine == null){\n break;\n }\n payments.add(paymentLine);\n }\n file.close();\n return payments;\n }", "public List<String> readFile(File spamFile) throws FileNotFoundException {\n\n Scanner scanner = new Scanner(spamFile);\n List<String> words;\n words = new ArrayList<>();\n List<String> temp;\n List<String> tempStr;\n while (scanner.hasNextLine()) \n {\n temp = Arrays.asList(scanner.nextLine().split(\"[ :@,.-]\"));\n for (String t : temp) \n {\n t = t.toLowerCase();\n if (!t.matches(\"[a-z']+\") || (stopListEnable && stopWords.contains(t))) \n {\n continue;\n } \n else \n {\n words.add(t);\n }\n }\n }\n\n return words;\n }", "public static List<Contract> readFromFile(String filename) {\n List<Contract> contracts = new ArrayList<>();\n\n InputStreamReader inputStreamReader = null;\n try {\n inputStreamReader = new InputStreamReader(new FileInputStream(new File(filename)),\"cp1251\");\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n BufferedReader bufferedReader = new BufferedReader(inputStreamReader);\n String [] lines = null;\n String line = null;\n try{\n while ((line = bufferedReader.readLine()) != null) {\n\n lines= line.split(\",\");\n\n\n LocalDate conc = LocalDate.parse(lines[1], DateTimeFormatter.ofPattern(\"dd.MM.yyyy\"));\n LocalDate start = LocalDate.parse(lines[2], DateTimeFormatter.ofPattern(\"dd.MM.yyyy\"));\n LocalDate end = LocalDate.parse(lines[3], DateTimeFormatter.ofPattern(\"dd.MM.yyyy\"));\n\n Client client=new Client(ClientType.valueOf(lines[4]),lines[5],lines[6]);\n\n ArrayList<InsuredPerson>insuredPeople=new ArrayList<>();\n for(int i=7; i<lines.length; i+=4 ){\n LocalDate d=LocalDate.parse(lines[i+2],DateTimeFormatter.ofPattern(\"dd.MM.yyyy\"));\n InsuredPerson person = new InsuredPerson(Integer.valueOf(lines[i]),lines[i+1],d,Double.valueOf(lines[i+3]));\n insuredPeople.add(person);\n\n\n }\n Contract contract=new Contract(Integer.valueOf(lines[0]),conc,start,end,client,insuredPeople);\n contracts.add(contract);\n }\n bufferedReader.close();}\n catch (IOException e){\n System.out.println(e.getMessage());\n e.printStackTrace();\n }\n return contracts;\n\n }", "private void readFile() {\r\n\t\tcsvEntrys = new ArrayList<>();\r\n\t\tString line = \"\";\r\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(new File(filepath)))) {\r\n\t\t\twhile ((line = br.readLine()) != null) {\r\n\t\t\t\tif (!line.contains(\"id\")) {\r\n\t\t\t\t\tcsvEntrys.add(line);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void readfiles1(String file_name){\n \n\n try{\n File fname1 = new File(file_name);\n Scanner sc = new Scanner(fname1);\n \n while (sc.hasNext()){\n String temp = sc.nextLine();\n String[] sts = temp.split(\" \");\n outs.addAll(Arrays.asList(sts));\n\n }\n\n // for (int i = 0;i<outs.size();i++){\n // System.out.println(outs.get(i));\n //}\n\n }catch(Exception ex){\n System.out.println(ex.getMessage());\n }\n }", "private static List<Question> loadQuestions(String filePath) {\n List<Question> questions = new ArrayList<Question>();\n FileReader in;\n try {\n in = new FileReader(new File(filePath));\n BufferedReader bufferIn = new BufferedReader(in);\n\n String quizQuestion;\n while ((quizQuestion = bufferIn.readLine()) != null) {\n Question q = new Question();\n q.setQuestion(quizQuestion);\n questions.add(q);\n }\n bufferIn.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return questions;\n }", "static void readRecipes() {\n\t\tBufferedReader br = null;\n\t\tString line = \"\";\n\t\tString cvsSplitBy = \",\";\n\t\ttry {\n\n\t\t\tbr = new BufferedReader(new FileReader(inputFileLocation));\n\t\t\twhile ((line = br.readLine()) != null) {\n\n\t\t\t\tString[] currentLine = line.split(cvsSplitBy);\n\t\t\t\tRecipe currentRecipe = new Recipe(currentLine[0]);\n\t\t\t\t/*\n\t\t\t\t * String[] recipe=new String[currentLine.length-1];\n\t\t\t\t * System.arraycopy(currentLine,1,recipe,0,recipe.length-2);\n\t\t\t\t */\n\t\t\t\tString[] recipe = java.util.Arrays.copyOfRange(currentLine, 1,\n\t\t\t\t\t\tcurrentLine.length);\n\t\t\t\tArrayList<String> ingredients = new ArrayList<String>();\n\t\t\t\tfor (String a : recipe) {\n\t\t\t\t\tingredients.add(a);\n\t\t\t\t}\n\t\t\t\tcurrentRecipe.setIngredients(ingredients);\n\t\t\t\tRecipes.add(currentRecipe);\n\t\t\t}\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tif (br != null) {\n\t\t\t\ttry {\n\t\t\t\t\tbr.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "public static void Reader(String document, ArrayList<String> listSymptoms) throws IOException {\n\t\t\t\tif (document != null) {\n\t\t\t\tBufferedReader br = new BufferedReader(new FileReader(document));\n\t\t\t\tString line = br.readLine();\n\t\t\t\twhile ((line = br.readLine()) != null){\n\t\t\t\t\t\n\t\t\t\t\t//see the content of the files in the console \n\t\t\t\t\tSystem.out.println(line);\n\t\t\t\t\t\n\t\t\t\t\t// add the symptoms in the list\n\t\t\t\t\tlistSymptoms.add(line);\n\t\t\t }\n\t\t\t\t\t// see the list in the console\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(listSymptoms);\n\t\t\t\t\t\n\t\t\t br.close();\n\t\t\t \n\t\t\t \n\t\t\t\t}\n\t}", "public static ArrayList<String> convert2list(String filename) \n\t\t\tthrows FileNotFoundException{\n\t\tInputStream oeuvre = new FileInputStream(filename);\n\t\tScanner scanner = new Scanner(oeuvre).useDelimiter(\"\\n\");\n\t\t\n\t\tArrayList<String> words = new ArrayList<String>();\n\t\twhile(scanner.hasNext()){\n\t\t\twords.add(scanner.next());\n\t\t}\n\t\treturn words;\n\t}", "public List<String> readFileContents(String filePath) throws APIException;", "public static List<String> readFile(String fileName){\r\n \r\n List<String> lines = Collections.emptyList();\r\n\r\n try{\r\n lines = Files.readAllLines(Paths.get(fileName));\r\n }\r\n\r\n catch(IOException err){\r\n err.printStackTrace();\r\n }\r\n\r\n return lines;\r\n }", "public static ArrayList<Student> loadListOfStudents(String fileName) {\n ArrayList<Student> students = new ArrayList<>();\r\n String str = TextReader.StringFromFile(fileName);//Uses the method that returns a complete string with newlines for each studentline.\r\n if (validateInput(str)) {//Uses the validation method to check that the input is valid.\r\n String[] lines = str.split(\"\\n\");\r\n String[] lineParameters;\r\n int countFor = 0;\r\n for (String line : lines) {\r\n if(countFor > 1){\r\n lineParameters = line.split(\",\");\r\n Vote vote = new Vote(new Subject(lineParameters[1]), new Subject(lineParameters[2]), new Subject(lineParameters[3]), new Subject(lineParameters[4]));\r\n Student newStudent = new Student(lineParameters[0], vote);\r\n students.add(newStudent);\r\n }\r\n countFor++;\r\n }\r\n }\r\n\r\n return students;\r\n }", "String[] readFile(File file) {\n ArrayList<String> list = new ArrayList<>();\n String[] output = null;\n Scanner reader = null;\n try {\n if (file.isFile()) {\n reader = new Scanner(file);\n while (reader.hasNextLine()) {\n list.add(reader.nextLine());\n }\n }\n } catch (FileNotFoundException e) {\n System.out.println(\"File not found exception\");\n }\n output = new String[list.size()];\n for (int i = 0; i < list.size(); i++) output[i] = list.get(i);\n reader.close();\n return output;\n }", "private static ArrayList<Capital> getCapitalsFromFile() {\n\n String txtFile = \"countries_and_capitals.txt\";\n BufferedReader br = null;\n String line = \"\";\n int COUNTRY_COL = 0;\n int CAPITAL_COL = 1;\n ArrayList<Capital> capitals = new ArrayList<Capital>();\n\n try {\n\n br = new BufferedReader(new FileReader(txtFile));\n\n while ((line = br.readLine()) != null) {\n String[] capital = line.split(\" \\\\| \");\n capitals.add(new Capital(capital[CAPITAL_COL], capital[COUNTRY_COL]));\n }\n\n } catch (FileNotFoundException e) {\n System.out.println(\"File not found\");\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (br != null) {\n try {\n br.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n return capitals;\n }", "public static void read6() {\n List<String> list = new ArrayList<>();\n\n try (BufferedReader br = Files.newBufferedReader(Paths.get(filePath))) {\n\n //br returns as stream and convert it into a List\n list = br.lines().collect(Collectors.toList());\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n list.forEach(System.out::println);\n }", "public static List<String> loadListFromFile(File file) throws InstantiationException, IllegalAccessException {\n\t\n\tList<String> list = new ArrayList<String>();\n\t\n\tif (file.exists()) {\n\t try {\n\t\tScanner s = new Scanner(file);\n\t\twhile (s.hasNext())\n\t\t list.add(s.next());\n\t } catch (FileNotFoundException ex) {\n\t\t// This should never be thrown because we have an if to check it...\n\t }\n\t \n\t}\n\t\n\treturn list;\n\t\n }", "public void readFromFile() {\n //reading text from file\n\n try {\n Scanner scanner = new Scanner(openFileInput(\"myTextFile.txt\"));\n\n while(scanner.hasNextLine()){\n\n String line = scanner.nextLine();\n\n String[] lines = line.split(\"\\t\");\n\n System.out.println(lines[0] + \" \" + lines[1]);\n\n toDoBean newTask = new toDoBean(lines[0], lines[1], 0);\n // System.out.println(line);\n sendList.add(newTask);\n\n }\n\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public static void loadArrayList() throws IOException\n\t{\n\t\tString usersXPFile = \"UsersXP.txt\";\n\t\t\n\t\tFile file = new File(usersXPFile);\n\t\t\n\t\tScanner fileReader;\n\t\t\n\t\tif(file.exists())\n\t\t{\n\t\t\tfileReader = new Scanner(file);\n\t\t\twhile(fileReader.hasNext())\n\t\t\t\tuserDetail1.add(userData.addNewuser(fileReader.nextLine().trim()));\n\t\t\tfileReader.close();\n\t\t}\n\t\telse overwriteFile(usersXPFile, \"\");\n\t\t\n\t\t\n\t}" ]
[ "0.70437926", "0.7013258", "0.6939507", "0.66710645", "0.6660377", "0.66316134", "0.6623537", "0.6605618", "0.6601082", "0.64871144", "0.6439022", "0.64322287", "0.64138615", "0.63989687", "0.6379588", "0.6355628", "0.63110524", "0.6303731", "0.6295785", "0.62865263", "0.62625", "0.62582475", "0.62176293", "0.6211966", "0.61879534", "0.6183055", "0.61764395", "0.6174873", "0.61706275", "0.6161156", "0.615941", "0.6157149", "0.61373806", "0.6134804", "0.61195105", "0.61063564", "0.6084382", "0.6084382", "0.60817873", "0.60727435", "0.6071861", "0.6064194", "0.60526305", "0.60416186", "0.6040404", "0.60403913", "0.60308653", "0.60283965", "0.60227096", "0.60190916", "0.6016764", "0.6012896", "0.6004421", "0.5987266", "0.59849113", "0.59835243", "0.59781075", "0.5974337", "0.5973934", "0.5970775", "0.5970442", "0.5968765", "0.5965909", "0.5957768", "0.59494054", "0.5940419", "0.59289765", "0.59279925", "0.5926993", "0.5925374", "0.59207565", "0.591986", "0.5917274", "0.59167844", "0.5914044", "0.5907534", "0.59058166", "0.58993256", "0.58957535", "0.58873075", "0.5883861", "0.5883421", "0.5877581", "0.5866716", "0.5865083", "0.58642197", "0.5856243", "0.5848762", "0.5847045", "0.58467287", "0.58434933", "0.5842055", "0.58403957", "0.5839121", "0.58368134", "0.583377", "0.58319867", "0.5831872", "0.583087", "0.58288276", "0.5828205" ]
0.0
-1
Read the file dictionary.txt and copy it in an ArrayList
public static void loadFile(ArrayList<String> array, String inputFile) { String line = ""; String[] words; try { BufferedReader reader = new BufferedReader(new FileReader(inputFile)); System.out.println("Loading file... \"Dictionary\""); while ((line = reader.readLine()) != null) { words = line.split("\n"); for (int i = 0; i < words.length; i++) array.add(words[i]); } reader.close(); } catch (Exception ex) { System.out.println("File not found"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void populateDictionary() throws IOException {\n\t\tScanner scan = new Scanner(new File(\"dictionary.txt\"));\n\t\twhile(scan.hasNextLine()) {\n\t\t\tString curr = scan.nextLine().toLowerCase();\n\t\t\tthis.dictionary.add(curr);\n\t\t}\n\t}", "public static void readDictionary()\r\n\t{\r\n\t\t//It trys to read over the file using try-catch in case of an Exception\r\n\t\ttry {\r\n\t\t\tFile file = new File(\"english.0\");\r\n\t\t\tScanner scan = new Scanner(file);\r\n\t\t\t//It reads over the file as long as there are words to read and we insert them into the given storage\r\n\t\t\twhile(scan.hasNext()) {\r\n\t\t\t\tdata.insert(scan.next());\r\n\t\t\t}\r\n\t\t\tscan.close(); \r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tSystem.out.println(\"File not found\");\r\n\t\t}\r\n\t}", "public final void loadDict() {\r\n try {\r\n FileInputStream inf = new FileInputStream(dictionary);\r\n char let;\r\n String str = \"\";\r\n int n = 0;\r\n while ((n = inf.read()) != -1) {\r\n let = (char) n;\r\n if (Character.isLetter(let)) {\r\n str += Character.toLowerCase(let);\r\n }\r\n if ((Character.isWhitespace(let) || let == '-') && !str.isEmpty()) { \r\n dictList[str.charAt(0) - 97].add(str);\r\n str = \"\";\r\n\r\n }\r\n\r\n }\r\n inf.close();\r\n\r\n } catch (IOException e) {\r\n\r\n e.printStackTrace();\r\n\r\n }\r\n }", "public void loadDictionary() {\r\n\t\r\n\t\t\r\n\t\ttry {\r\n\t\t\r\n\t\t\tFileReader fr = new FileReader( \"rsc/English.txt\" );\r\n\t\t BufferedReader br = new BufferedReader(fr);\r\n\t \tString word ;\r\n\t \twhile (( word = br .readLine()) != null ) {\r\n\t\t// Aggiungere parola alla struttura dati\r\n\t \t\t\r\n\t \t\tthis.dictionary.add(word);\r\n\t \t\t\r\n\t\t}\r\n\t\tbr .close();\r\n\t\t} catch (IOException e ){\r\n\t\tSystem. out .println( \"Errore nella lettura del file\" );\r\n\t\t}\r\n\t\t\t\t\r\n\t\t\t\r\n\t try {\r\n\t\t\t\r\n\t\t\tFileReader fr = new FileReader( \"rsc/Italian.txt\" );\r\n\t\t BufferedReader br = new BufferedReader(fr);\r\n\t \tString word ;\r\n\t \twhile (( word = br .readLine()) != null ) {\r\n\t\t\t// Aggiungere parola alla struttura dati\r\n\t\t \t\t\r\n\t\t \t\tthis.dizionario.add(word);\r\n\t\t \t\t\r\n\t\t\t}\r\n\t\t\tbr .close();\r\n\t\t\t} catch (IOException e ){\r\n\t\t\tSystem. out .println( \"Errore nella lettura del file\" );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "private void populateDictionary() {\n Scanner scanner = null;\n try {\n scanner = new Scanner(new FileInputStream(filePath));\n while(scanner.hasNextLine()) {\n String word = scanner.nextLine();\n rwDictionary.put(reducedWord(word), word);\n lcDictionary.put(word.toLowerCase(), word);\n }\n } catch(IOException e) {\n System.err.println(e.toString());\n e.printStackTrace();\n } finally {\n if(scanner != null) {\n scanner.close();\n }\n }\n }", "private void loadDictWords(String dictFile) {\n try {\n BufferedReader reader = new BufferedReader(new FileReader(dictFile));\n\n String word = reader.readLine();\n while (word != null) {\n word = word.trim().toLowerCase();\n wordsList.add(word);\n\n word = reader.readLine();\n }\n reader.close();\n } catch (FileNotFoundException e) {\n System.out.println(\"Error: Cannot find dictionary file at location: \" + dictFile);\n } catch (IOException e) {\n System.out.println(\"Error: Failed to open and read dictionary file at location: \" + dictFile);\n }\n }", "public ArrayList<String> createWordBank() {\r\n ArrayList<String> wordBank = new ArrayList<String>();\r\n AssetManager assetM = getActivity().getAssets(); // get asset manager to access dictionary file\r\n try {\r\n InputStream is = assetM.open(\"dictionary\"); // open input stream to read dictionary\r\n BufferedReader r = new BufferedReader(new InputStreamReader(is)); // read from input stream\r\n String line;\r\n while ((line = r.readLine()) != null) { // while line is not null\r\n if (line.length() == 9) wordBank.add(line); // take only the 9 letter words\r\n }\r\n } catch (IOException e) {\r\n }\r\n return wordBank;\r\n }", "MainDictionary ( String pathToFile ) {\n WordListReader reader = new WordListReader( pathToFile );\n List<String> wordList = reader.asLowerCaseList();\n \n this.dictionary = new HashSet<>( wordList );\n \n if ( this.dictionary.isEmpty() ) {\n LOGGER.warn( \"Main dictionary is empty\" );\n }\n }", "private void getDictionary(){\r\n // TODO: read Dictionary\r\n try{\r\n lstDictionary.clear();\r\n for(int i = 0; i < IConfig.LABEL_COUNT; i++){\r\n lstDictionary.add(new HashMap<>());\r\n DictionaryReader dictionaryReader = new DictionaryReader(lstDictionary.get(i), IConfig.DICTIONARY_URL[i]);\r\n dictionaryReader.read();\r\n }\r\n }catch (Exception e){\r\n e.printStackTrace();\r\n }\r\n }", "ArrayList<WordListItem> addDataFromFile(){\n BufferedReader br;\n InputStream inputStream = context.getResources().openRawResource(R.raw.animal_list);\n br = new BufferedReader(\n new InputStreamReader(inputStream, Charset.forName(\"UTF-8\"))\n );\n String currentLine;\n ArrayList<WordListItem> wordListItems = new ArrayList<WordListItem>();\n try {\n while ((currentLine = br.readLine()) != null) {\n String[] tokens = currentLine.split(\";\");\n\n String word = tokens[0];\n String pronunciation = tokens[1];\n String description = tokens[2];\n\n WordListItem wordItem = new WordListItem(word, pronunciation, description);\n wordItem.setImgResNbr(setImgResFromWord(wordItem.getWord().toLowerCase()));\n wordListItems.add(wordItem);\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n if (br != null) br.close();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }\n\n return wordListItems;\n }", "public Dictionary(String filename)\n\t\tthrows FileNotFoundException, IOException\n\t{\n\t\tmyFilename = filename;\n\t\t\n\t\tchar myCharacter = 'a';\n\t\tString myWord = new String(\"\");\n\t\tBufferedReader myReader = new BufferedReader(new FileReader(myFilename));\n\t\t\n\t\tmyWord = myReader.readLine();\n\t\t\n\t\t//creates each WordList for the words in the given text file\n\t\tfor(int counter = 0; counter < 26; ++counter)\n\t\t{\nSystem.out.print((char)(counter + (int)'a'));\n\t\t\tint position = 0;\n\t\t\tString[] tempArray = new String[100];\n\t\t\t\n\t\t\tmyCharacter = (char)myWord.charAt(0);\n\t\t\ttempArray[position] = myWord;\n\t\t\t\n\t\t\tmyWord = myReader.readLine();\n\t\t\t\n\t\t\twhile(myWord != null && myWord.charAt(0) == myCharacter)\n\t\t\t{\n\t\t\t\t++position;\n\t\t\t\t\n\t\t\t\tif(tempArray.length >= position)\n\t\t\t\t{\n\t\t\t\t\ttempArray = enlargeArray(tempArray);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttempArray[position] = myWord;\n\t\t\t\t\n\t\t\t\tmyWord = myReader.readLine();\n\t\t\t}\n\t\t\t\n\t\t\tmyDictionaryArray[counter] = new WordList(shrinkArray(tempArray));\n\t\t}\n\t\t\n\t\tmyReader.close();\n\t}", "public HashSet<String> createDictionary() {\r\n HashSet<String> dictionary = new HashSet<String>();\r\n AssetManager assetM = getActivity().getAssets(); // get asset manager to access dictionary file\r\n try {\r\n InputStream is = assetM.open(\"dictionary\");\r\n BufferedReader r = new BufferedReader(new InputStreamReader(is)); // read from input stream\r\n String line;\r\n while ((line = r.readLine()) != null) { // while line is not null\r\n if (line.length() >= 3) dictionary.add(line); // take only the 3 letter word\r\n }\r\n } catch (IOException e) {\r\n }\r\n return dictionary;\r\n }", "private void readDictionaryFile(InputStream dictionary, CharsetDecoder decoder) throws IOException {\n BufferedReader reader = new BufferedReader(new InputStreamReader(dictionary, decoder));\n // TODO: don't create millions of strings.\n String line = reader.readLine(); // first line is number of entries\n int numEntries = Integer.parseInt(line);\n \n // TODO: the flags themselves can be double-chars (long) or also numeric\n // either way the trick is to encode them as char... but they must be parsed differently\n while ((line = reader.readLine()) != null) {\n String entry;\n HunspellWord wordForm;\n \n int flagSep = line.lastIndexOf('/');\n if (flagSep == -1) {\n wordForm = NOFLAGS;\n entry = line;\n } else {\n // note, there can be comments (morph description) after a flag.\n // we should really look for any whitespace\n int end = line.indexOf('\\t', flagSep);\n if (end == -1)\n end = line.length();\n \n String flagPart = line.substring(flagSep + 1, end);\n if (aliasCount > 0) {\n flagPart = getAliasValue(Integer.parseInt(flagPart));\n } \n \n wordForm = new HunspellWord(flagParsingStrategy.parseFlags(flagPart));\n Arrays.sort(wordForm.getFlags());\n entry = line.substring(0, flagSep);\n if(ignoreCase) {\n entry = entry.toLowerCase(Locale.ENGLISH);\n }\n }\n \n List<HunspellWord> entries = words.get(entry);\n if (entries == null) {\n entries = new ArrayList<HunspellWord>();\n words.put(entry, entries);\n }\n entries.add(wordForm);\n }\n }", "public Dictionary(String filename) throws IOException {\r\n\t\tFile dFile = new File(filename);\r\n\t\tFileReader fr = new FileReader(dFile);\r\n\t\tnew BufferedReader(fr).lines().forEach(e -> dict.add(e));\r\n\t\tfr.close();\r\n\t}", "public static void main(String[] args) throws FileNotFoundException {\n File f = new File(\"dict2.txt\");\n Scanner readFile = new Scanner(f);\n ArrayList<String> dictionary = new ArrayList<String>();\n \n while (readFile.hasNext()) {\n dictionary.add(readFile.next());\n }\n \n HangmanLogic logic = new HangmanLogic(dictionary);\n HangmanUserInterface game = new HangmanUserInterface(logic);\n game.start();\n }", "private void load(File dictionary) throws IOException {\n // open the file\n BufferedReader in = new BufferedReader(new FileReader(dictionary));\n \n // while file is readable\n while (in.ready()) {\n // get the next word in the file\n String s = in.readLine();\n // as long as the word is not just a new line character\n if (!s.equals(\"\\n\")) {\n // insert the word\n boolean noError = this.insert(s);\n // if there was an error in inserting the word\n if (!noError) {\n // print out the word\n System.out.println(s);\n // increment the number of errors found during load\n errors++;\n }\n // increment the size of the dictionary\n size++;\n }\n }\n \n // close the file\n in.close();\n }", "public MapDictionary(String filename) {\n\t\ttry {\n\t\t\tScanner scan = new Scanner(new File(filename));\n\t\t\t\n\t\t\t\twhile(scan.hasNextLine()) {\n\t\t\t\t\tString word = scan.nextLine().toLowerCase();\n\t\t\t\t\tString signature = PredictivePrototype.wordToSignature(word);\n\t\t\t\t\tSet <String> wordsSet = new HashSet<String>();\n\t\t\t\t\tif(PredictivePrototype.isValid(signature)==true && word.length() == signature.length()) {\n\t\t\t\t\t\twordsSet.add(word);\n\t\t\t\t\t\tif(dictionary.containsKey(signature)) {\n\t\t\t\t\t\t\tdictionary.get(signature).add(word);\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\tdictionary.put(signature, wordsSet);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tscan.close();\n\t\t\t\t\n\t\t} catch(IOException e){\n\t\t\tSystem.out.println(\"File not found\");\n\t\t}\n\t}", "public Dictionary(String filename) throws FileNotFoundException, IOException {\n wordlist = loadWordList(filename);\n }", "private void setWords() {\r\n words = new ArrayList<>();\r\n\r\n String line = null;\r\n try {\r\n // FileReader reads text files in the default encoding.\r\n FileReader fileReader = new FileReader(\"words.txt\");\r\n\r\n // Always wrap FileReader in BufferedReader.\r\n BufferedReader bufferedReader = new BufferedReader(fileReader);\r\n\r\n while((line = bufferedReader.readLine()) != null)\r\n words.add(line);\r\n\r\n // Always close files.\r\n bufferedReader.close();\r\n }\r\n catch(Exception ex) {\r\n ex.printStackTrace();\r\n System.out.println(\"Unable to open file '\");\r\n }\r\n }", "public static void getNounList()throws Exception{\r\n\t\tSystem.out.println(\"Start loading noun dictionary into memory...\");\r\n\t\tBufferedReader nounReader = new BufferedReader(new FileReader(NOUN_DICT));\r\n\t\tString line = null;\r\n\t\twhile((line = nounReader.readLine())!=null){\r\n\t\t\tline = line.toLowerCase();\r\n\t\t\tnounList.add(line);\r\n\t\t\tnounSet.add(line);\r\n\t\t}\r\n\t\tnounReader.close();\r\n\t\tSystem.out.println(\"Noun dictionary loaded.\");\r\n\t}", "private void addWordsFromFile(File file){\n \n FileResource fr = new FileResource(file);\n String fileName = file.getName();\n for (String word : fr.words()) {\n if (!hashWords.containsKey(word)) {// if hash map doesnt contain the key word\n ArrayList<String> newList = new ArrayList<String>();//create a new Arraylist\n newList.add(fileName);//add the file name to it \n hashWords.put(word, newList);// map the word to the new list\n } else if (hashWords.containsKey(word)\n && !hashWords.get(word).contains(fileName)) {\n //the hash map contains the keyword but not the filename\n // it gets stored as a new value in the\n //arraylist of the hashmap:\n \n ArrayList<String> currentList = hashWords.get(word);//currentList is the existing array list of files\n //for the given word\n currentList.add(fileName);//Add new file name to existing list\n hashWords.put(word, currentList);//map the 'word' to the updated arraylist\n }\n }\n }", "private void loadDictionary(String pathDictionary) throws IOException {\n File fileAnnotation = new File(pathDictionary);\n if (!fileAnnotation.exists()) {\n fileAnnotation.createNewFile();\n }\n FileReader fr;\n fr = new FileReader(fileAnnotation);\n BufferedReader br = new BufferedReader(fr);\n String line;\n while ((line = br.readLine()) != null) {\n String[] dic = line.split(\"[ \\t]\");\n String word = line.substring(line.indexOf(\" \") + 1);\n dictionaryTerms.put(word.toLowerCase(), dic[0]);\n System.out.println(\"Loading Dictionary Terms: Word: \" + word + \"\\tTag: \" + dic[0]);\n }\n br.close();\n fr.close();\n System.out.println(\"Dictionary Terms Loaded\");\n }", "public HashMap readFile(String filePath, HashMap source){\n\t\tArrayList<String> temp1 = new ArrayList<String>();\n\t\tArrayList<String> temp2 = new ArrayList<String>();\n\t\tBufferedReader br = null;\n\t\t\n\t\ttry {\n\t\t\tString sCurrentLine;\n\t\t\t\n\t\t\t// \"Users/Jasmine/Documents/Eclipse/CacheDictionary/src/english.txt\"\n\t\t\tbr = new BufferedReader(new FileReader(filePath)); \n\t\t\t\n\t\t\t//str.matches(\".*\\\\d+.*\"); ==> string that contains numbers\n\t\t\t//.matches(\"[a-zA-Z]+\"); ==> string that only contains letter\n\t\t\twhile ((sCurrentLine = br.readLine()) != null) {\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t * if the source file itself is not one word per line, we need to split the string\n\t\t\t\t * only letter(not single) will be stored in the array\n\t\t\t\t */\n\t\t\t\t//\n\t\t\t\tif(sCurrentLine.matches(\".*([ \\t]).*\")){ //check if the current line is a single word or not\n\t\t\t\t\ttemp1.add(sCurrentLine);\n\t\t\t\t}\n\t\t\t\telse if(sCurrentLine.matches(\"[a-zA-Z]+\") && sCurrentLine.length()>1){\n\t\t\t\t\ttemp2.add(sCurrentLine);\n\t\t\t\t}\n\t\t\t}// end of while loop\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (br != null)br.close();\n\t\t\t} catch (IOException ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\tif(!temp1.isEmpty()){\n\t\t\tfor(int i = 0; i< temp1.size(); i++){\n\t\t\t\tString thisLine[] = temp1.get(i).split(\" \");\n\t\t\t\t//for each word in this line\n\t\t\t\tfor(int j = 0; j < thisLine.length; j++){\n\t\t\t\t\t//if it is a valid word\n\t\t\t\t\tif(thisLine[j].matches(\"[a-zA-Z]+\") && thisLine[j].length()>1 ){\n\t\t\t\t\t\tif( source.get(thisLine[j]) == null){\n\t\t\t\t\t\t\tsource.put(thisLine[j].toLowerCase(),thisLine[j].toLowerCase());\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t} // end of if current word i valid\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t} // end of temp1\n\t\t\n\t\tif(!temp2.isEmpty()){\n\t\t\tfor(int i = 0; i< temp2.size(); i++){\n\t\t\t\tif(temp2.get(i).matches(\"[a-zA-Z]+\") && temp2.get(i).length()>1){\n\t\t\t\t\tif(source.get(temp2.get(i)) == null){\n\t\t\t\t\t\tsource.put(temp2.get(i).toLowerCase(),temp2.get(i).toLowerCase());\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t} \n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn source;\n\t}", "public static Dictionary readInDictionary(String fileName) {\r\n Dictionary d = new Dictionary();\r\n Scanner fileScanner;\r\n\r\n try {\r\n // use a FileInputStream to ensure correct reading end-of-file\r\n fileScanner = new Scanner(new FileInputStream(\"data\" + File.separator +fileName));\r\n\r\n while (fileScanner.hasNextLine()) {\r\n String nextLine = fileScanner.nextLine();\r\n // System.out.println(\"nextLine: \" + nextLine); uncomment if you want to see what is read in\r\n DictionaryData data = new DictionaryData(nextLine);\r\n\r\n // TODO: call insert() here to insert the data object into the dictionary!\r\n d.insert(data.word.toUpperCase(),data);\r\n }\r\n\r\n } catch (FileNotFoundException ex) {\r\n System.out.println(\"could not find the file \" +fileName+ \"in the data directory!\");\r\n return null;\r\n }\r\n\r\n return d;\r\n }", "public void initDict(String filename, int max_length) {\n\t\tsetDictionary(new ArrayList<String>());\n\t\tFile f = new File(\"src/\" + filename);\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(f))) {\n\t\t\tString line;\n\t\t\twhile ((line = br.readLine()) != null) {\n\t\t\t\tif (line.length() < max_length) {\n\t\t\t\t\tgetDictionary().add(line.toLowerCase());\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"Poop\");\n\t\t}\n\n\t\tfor (String word : getDictionary()) {\n\t\t\taddWord(word);\n\t\t}\n\t}", "public static ArrayList<String> readWords(String fileName){\n\t\treturn read(fileName, true);\n\t}", "public void addToDictionary(InputStream f)\r\n throws IOException, FileNotFoundException {\r\n long t = System.currentTimeMillis();\r\n final int bufSize = 1000;\r\n int read;\r\n int numWords = 0;\r\n InputStreamReader fr = null;\r\n try {\r\n fr = new InputStreamReader(f);\r\n char[] buf = new char[bufSize];\r\n while ((read = fr.read(buf)) != -1) {\r\n // TODO modify this split regex to actually be useful\r\n String[] words = new String(buf, 0, read).split(\"\\\\W\");\r\n for (String s : words) {\r\n trie.insert(s);\r\n numWords++;\r\n }\r\n }\r\n } finally {\r\n if (fr != null) {\r\n try {\r\n fr.close();\r\n } catch (IOException e) {\r\n }\r\n }\r\n }\r\n System.out.println(\"Read from file and inserted \" + numWords + \" words into trie in \" +\r\n (System.currentTimeMillis() - t) / 1000.0 + \" seconds.\");\r\n }", "private ArrayList<String> load(String fileName, String initialWord)\n\t{\n\t\tArrayList<String> words = new ArrayList<String>();\n\t\ttry{\n\t\t\tBufferedReader reader = new BufferedReader(new FileReader(fileName));\n\t\t\tString word = reader.readLine();\n\t\t\twhile(word != null){\n\t\t\tif(word.length()==initialWord.length())\n\t\t\t\twords.add(word);\n\t\t\tword = reader.readLine();\n\t\t\t}\n\t\t\treader.close();\n\t\t}catch(IOException e){\n\t\t\tSystem.err.println(\"Can't find a file '\"+fileName+\"'!\");\n\t\t\tJOptionPane.showMessageDialog(null,\"Can't find a file '\"+fileName+\"'!\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t}\n\t\treturn words;\n\t}", "public ArrayList <String> loadWordList () {\n ArrayList <String> words = new ArrayList <String> ();\n File file;\n if (chooser.showOpenDialog (null) == JFileChooser.APPROVE_OPTION) {\n file = chooser.getSelectedFile ();\n } else {\n return words;\n }\n if (file != null) {\n try {\n FileReader fileReader = new FileReader (file);\n BufferedReader buffer = new BufferedReader (fileReader);\n String temp;\n while ((temp = buffer.readLine ()) != null)\n words.add (temp);\n buffer.close ();\n return words;\n } catch (IOException e) {\n JOptionPane.showMessageDialog (null, \"File IO Exception\\n\" + e.getLocalizedMessage (), \"Error!\", JOptionPane.ERROR_MESSAGE);\n }\n }\n return words;\n }", "public void loadList () {\r\n ArrayList<String> list = fileManager.loadWordList();\r\n if (list != null) {\r\n for (String s : list) {\r\n addWord(s);\r\n }\r\n }\r\n }", "public Map<String, Set<String>> loadDictionary(File dictionaryFile) throws IOException {\n // iterate through the input file lines\n try (Stream<String> lines = Files.lines(dictionaryFile.toPath())) {\n // create resulting map as per javadoc\n Map<String, Set<String>> result = new HashMap<>();\n // for each line in the input file\n lines.forEach(line -> {\n // convert to lower case and remove all non-mappable characters\n String filtered = filter(line);\n // get number that is result of decoding of the word in current line\n String decodedNumber = decode(filtered);\n // create empty set if there are no entries for the current decoded number\n if (!result.containsKey(decodedNumber)) {\n result.put(decodedNumber, new HashSet<>());\n }\n // put original word mapped to the decoded number\n result.get(decodedNumber).add(line);\n });\n return result;\n }\n }", "static void loadDictionary() throws IOException {\r\n URL oracle = new URL(urlEndPoint);\r\n BufferedReader br = new BufferedReader(new InputStreamReader(oracle.openStream()));\r\n\r\n String st;\r\n while ((st = br.readLine()) != null) {\r\n localDictionary.add(st);\r\n }\r\n }", "public boolean loadDictionary(String fileName) throws IOException;", "public void loadDictionary(String language) {\r\n\t\tif(this.language.equals(language) && dizionario != null ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tdizionario = new ArrayList<String>();\r\n\t\tthis.language = language; //Impostiamo la lingua uguale a quella passata da parametro\r\n\t\t\r\n\t\ttry {\r\n\t\t\tFileReader fr = new FileReader(\"English.txt\");\r\n\t\t\tBufferedReader br = new BufferedReader(fr);\r\n\t\t\tString word;\r\n\t\t\twhile ((word = br.readLine()) != null) {\r\n\t\t\t// Aggiungere parola alla struttura dati\r\n\t\t\t\tdizionario.add(word.toLowerCase());\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tCollections.sort(dizionario);\r\n\t\t\tbr.close();\r\n\t\t\t} catch (IOException e){\r\n\t\t\tSystem.out.println(\"Errore nella lettura del file\");\r\n\t\t\t}\r\n\t}", "public void readFile() throws IOException {\n String line;\n while ((line = fileReader.readLine()) != null) {\n wordStorage.addWords(line);\n }\n }", "private ArrayList<Book> readBookCollection() {\n File file = new File(\"books.txt\");\n ArrayList<Book> collection = new ArrayList<Book>();\n try {\n FileReader fileReader = new FileReader(file);\n BufferedReader reader = new BufferedReader(fileReader);\n while (true) {\n String line = reader.readLine();\n if (line == null) break;\n line = line.trim();\n if (line.equals(\"\")) continue; // ignore possible blank lines\n String[] bookInfo = line.split(\" :: \");\n collection.add(new Book(bookInfo[0], bookInfo[1]));\n }\n }\n catch (IOException e) {\n System.out.println(e.getMessage());\n }\n return collection;\n }", "public SpellChecker() throws FileNotFoundException {\r\n\t\t// Initialize empty dictionary collection.\r\n\t\tdictionary = new LinkedSet<String>();\r\n\t\t\r\n\t\t// Add contents of provided \"dictionary.txt\" file to dictionary.\r\n\t\ttry {\r\n\t\t\tFile file = new File(\"dictionary.txt\");\r\n\t\t\tSystem.out.println(\"Initializing program dicitonary...\");\r\n\t\t\tScanner scanner = new Scanner(file);\r\n\t\t\twhile (scanner.hasNextLine()) {\r\n\t\t\t\tString line = scanner.nextLine();\r\n\t\t\t\tdictionary.add(line);\r\n\t\t\t}\r\n\t\t\tscanner.close();\r\n\t\t\tSystem.out.println(\"dictionary initialized\");\r\n\t\t}\r\n\t\tcatch (FileNotFoundException e) {\r\n\t\t\tSystem.out.println(\"An error occurred while initializing program dicitonary. File not found.\");\r\n\t\t}\r\n\t}", "public static void loadPracticeListFromFile() {\n JSONParser jsonParser = new JSONParser();\n\n try (FileReader reader = new FileReader(\"src/practiceList.json\")) {\n // Read JSON file\n Object object = jsonParser.parse(reader);\n\n //Iterate over word list array\n JSONArray wordList = (JSONArray) object;\n for (Object o : wordList) {\n\n JSONObject next = (JSONObject) o;\n String extra = \"\";\n\n if (((String) next.get(\"wordType\")).equalsIgnoreCase(\"verb\")) {\n extra = \"to \";\n }\n\n Word loadedWord = new Word(extra + next.get(\"english\"), (String) next.get(\"welsh\"), (String) next.get(\"wordType\"));\n\n addIntoPracticedWords(loadedWord);\n }\n\n } catch (ParseException | IOException e) {\n System.out.println(\"PracticeList file not found, will be created on exit.\");\n }\n }", "static void read()\n\t\t{\n\n\n\t\t\tString content=new String();\n\t\t\ttry {\n\t\t\t\tFile file=new File(\"Dic.txt\");\n\t\t\t\tScanner scan=new Scanner(file);\n\t\t\t\twhile(scan.hasNextLine()) {\n\t\t\t\t\tcontent=scan.nextLine();\n\t\t\t\t//\tSystem.out.println(content);\n\n\t\t\t\t//\tString [] array=content.split(\" \");\n\t\t\t\t\tlist.add(content.trim());\n\n\t\t\t\t}\n\t\t\t\tscan.close(); \n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tSystem.out.println(e);\n\t\t\t}\n\n\n\t\t}", "public void readWordList() {\n try {\n wordList = XmlStringArrayParser.parse(getAssets().open(Constant.WORDLISTFILE),\n settings.getInt(\"wordMaxLength\", 7));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static ArrayList readBiblioscapeTagFile(String filename) {\n ArrayList bibitems = new ArrayList();\n File f = new File(filename);\n if (!f.exists() || !f.canRead() || !f.isFile()) {\n System.err.println(\"Error: \" + filename + \" is not a valid file and|or is not readable.\");\n return null;\n }\n \n try {\n BufferedReader in = new BufferedReader(new FileReader(filename));\n String line;\n HashMap hm = new HashMap();\n HashMap lines = new HashMap();\n StringBuffer previousLine = null;\n while ((line = in.readLine()) != null) {\n // entry delimiter -> item complete\n if (line.equals(\"------\")) {\n String[] type = new String[2];\n String[] pages = new String[2];\n String country = null;\n String address = null;\n Vector comments = new Vector();\n // add item\n Object[] l = lines.entrySet().toArray();\n for (int i = 0; i < l.length; ++i) {\n Map.Entry entry = (Map.Entry)l[i];\n if (entry.getKey().equals(\"AU\")) hm.put(\"author\",entry.getValue().toString());\n else if (entry.getKey().equals(\"TI\")) hm.put(\"title\",entry.getValue().toString());\n else if (entry.getKey().equals(\"ST\")) hm.put(\"booktitle\",entry.getValue().toString());\n else if (entry.getKey().equals(\"YP\")) hm.put(\"year\",entry.getValue().toString());\n else if (entry.getKey().equals(\"VL\")) hm.put(\"volume\",entry.getValue().toString());\n else if (entry.getKey().equals(\"NB\")) hm.put(\"number\",entry.getValue().toString());\n else if (entry.getKey().equals(\"PS\")) pages[0] = entry.getValue().toString();\n else if (entry.getKey().equals(\"PE\")) pages[1] = entry.getValue().toString();\n else if (entry.getKey().equals(\"KW\")) hm.put(\"keywords\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"RM\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"RU\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"RT\")) type[0] = entry.getValue().toString();\n else if (entry.getKey().equals(\"SB\")) comments.add(\"Subject: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"SA\")) comments.add(\"Secondary Authors: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"NT\")) hm.put(\"note\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"PP\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"PB\")) hm.put(\"publisher\",entry.getValue().toString());\n else if (entry.getKey().equals(\"TA\")) comments.add(\"Tertiary Authors: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"TT\")) comments.add(\"Tertiary Title: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"ED\")) hm.put(\"edition\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"DP\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"TW\")) type[1] = entry.getValue().toString();\n else if (entry.getKey().equals(\"QA\")) comments.add(\"Quaternary Authors: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"QT\")) comments.add(\"Quaternary Title: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"IS\")) hm.put(\"isbn\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"LA\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"AB\")) hm.put(\"abstract\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"DI\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"DM\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"AV\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"PR\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"LO\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"AD\")) address = entry.getValue().toString();\n else if (entry.getKey().equals(\"LG\")) hm.put(\"language\",entry.getValue().toString());\n else if (entry.getKey().equals(\"CO\")) country = entry.getValue().toString();\n else if (entry.getKey().equals(\"UR\") || entry.getKey().equals(\"AT\")) {\n String s = entry.getValue().toString().trim();\n hm.put(s.startsWith(\"http://\") || s.startsWith(\"ftp://\") ? \"url\" : \"pdf\",\n entry.getValue().toString());\n }\n else if (entry.getKey().equals(\"C1\")) comments.add(\"Custom1: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"C2\")) comments.add(\"Custom2: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"C3\")) comments.add(\"Custom3: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"C4\")) comments.add(\"Custom4: \" + entry.getValue().toString());\n //else if (entry.getKey().equals(\"RD\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"MB\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"C5\")) comments.add(\"Custom5: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"C6\")) comments.add(\"Custom6: \" + entry.getValue().toString());\n //else if (entry.getKey().equals(\"FA\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"CN\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"DE\")) hm.put(\"annote\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"RP\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"DF\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"RS\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"CA\")) comments.add(\"Categories: \" + entry.getValue().toString());\n //else if (entry.getKey().equals(\"WP\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"TH\")) comments.add(\"Short Title: \" + entry.getValue().toString());\n //else if (entry.getKey().equals(\"WR\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"EW\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"SE\")) hm.put(\"chapter\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"AC\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"LP\")) hm.put(\"\",entry.getValue().toString());\n }\n \n String bibtexType = \"misc\";\n if (type[1] != null) { // first check TW\n type[1] = type[1].toLowerCase();\n if (type[1].indexOf(\"article\") >= 0) bibtexType = \"article\";\n else if (type[1].indexOf(\"book\") >= 0) bibtexType = \"book\";\n else if (type[1].indexOf(\"conference\") >= 0) bibtexType = \"inproceedings\";\n else if (type[1].indexOf(\"proceedings\") >= 0) bibtexType = \"inproceedings\";\n else if (type[1].indexOf(\"report\") >= 0) bibtexType = \"techreport\";\n else if (type[1].indexOf(\"thesis\") >= 0\n && type[1].indexOf(\"master\") >= 0) bibtexType = \"mastersthesis\";\n else if (type[1].indexOf(\"thesis\") >= 0) bibtexType = \"phdthesis\";\n } else if (type[0] != null) { // check RT\n type[0] = type[0].toLowerCase();\n if (type[0].indexOf(\"article\") >= 0) bibtexType = \"article\";\n else if (type[0].indexOf(\"book\") >= 0) bibtexType = \"book\";\n else if (type[0].indexOf(\"conference\") >= 0) bibtexType = \"inproceedings\";\n else if (type[0].indexOf(\"proceedings\") >= 0) bibtexType = \"inproceedings\";\n else if (type[0].indexOf(\"report\") >= 0) bibtexType = \"techreport\";\n else if (type[0].indexOf(\"thesis\") >= 0\n && type[0].indexOf(\"master\") >= 0) bibtexType = \"mastersthesis\";\n else if (type[0].indexOf(\"thesis\") >= 0) bibtexType = \"phdthesis\";\n }\n \n // concatenate pages\n if (pages[0] != null || pages[1] != null)\n hm.put(\"pages\",(pages[0] != null ? pages[0] : \"\")\n + (pages[1] != null ? \"--\" + pages[1] : \"\"));\n \n // concatenate address and country\n if (address != null)\n hm.put(\"address\",address + (country != null ? \", \" + country : \"\"));\n \n if (comments.size() > 0) { // set comment if present\n StringBuffer s = new StringBuffer();\n for (int i = 0; i < comments.size(); ++i)\n s.append((i > 0 ? \"; \" : \"\")+ comments.elementAt(i).toString());\n hm.put(\"comment\",s.toString());\n }\n BibtexEntry b = new BibtexEntry(\n Globals.DEFAULT_BIBTEXENTRY_ID,\n Globals.getEntryType(bibtexType));\n b.setField(hm);\n bibitems.add(b);\n \n hm.clear();\n lines.clear();\n previousLine = null;\n \n continue;\n }\n // new key\n if (line.startsWith(\"--\") && line.length() >= 7 && line.substring(4,7).equals(\"-- \")) {\n lines.put(line.substring(2,4),previousLine = new StringBuffer(line.substring(7)));\n continue;\n }\n // continuation (folding) of previous line\n if (previousLine == null) // sanity check; should never happen\n return null;\n previousLine.append(line.trim());\n }\n } catch (IOException e) {\n return null;\n }\n \n return bibitems;\n }", "public Dictionary() {\n\t\tthis.dictionary = new HashSet<String>();\n\t\ttry {\n\t\t\tthis.populateDictionary();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error: File not found, please try again with a valid filename.\");\n\t\t}\n\t}", "public TreeDictionary(String filename) {\n\t\tString entry;\n\t\ttry {\n\t\t\tBufferedReader in = new BufferedReader(new FileReader(filename));\n\t\t\twhile((entry=in.readLine())!=null){\n\t\t\t\tif(MapDictionary.isValidWord(entry)){\n\t\t\t\t\tString signature = wordToSignature(entry.toLowerCase());\n\t\t\t\t\tinsert(entry, signature);\n\t\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t\tin.close();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tSystem.out.println(\"File not found\");\n\t\t}\n\t}", "private static void list() throws FileNotFoundException {\n ArrayList<String> words = new ArrayList<>();\n Scanner input = new Scanner(new File(fileLocation));\n while (input.hasNext()) {\n String word = input.next();\n if (!words.contains(word)) {\n words.add(word);\n }\n }\n }", "private void loadFromFile() {\n try {\n FileInputStream fis = openFileInput(FILENAME);\n InputStreamReader isr = new InputStreamReader(fis);\n BufferedReader reader = new BufferedReader(isr);\n Gson gson = new Gson();\n Type listFeelingType = new TypeToken<ArrayList<Feeling>>(){}.getType();\n recordedFeelings.clear();\n ArrayList<Feeling> tmp = gson.fromJson(reader, listFeelingType);\n recordedFeelings.addAll(tmp);\n fis.close();\n\n } catch (FileNotFoundException e) {\n // TODO Auto-generated catch block\n recordedFeelings = new ArrayList<Feeling>();\n e.printStackTrace();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "public ArrayList<Item> loadItems(String filename) {\n ArrayList<Item> itemsList = new ArrayList<>();\n try {\n File file = new File(filename);\n BufferedReader reader= new BufferedReader(new InputStreamReader(new FileInputStream(file), \"UTF-8\"));\n String line= reader.readLine();\n while (line != null){\n String[] splitedLine = line.split(\"=\");\n String name = splitedLine[0];\n int weight = Integer.parseInt(splitedLine[1]) / 1000; // on convertit en tonnes\n itemsList.add(new Item(name,weight));\n line = reader.readLine();\n }\n reader.close(); //pour arreter la memoire tampon\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n\n return itemsList;\n }", "public ArrayList<String> getTerms () throws FileNotFoundException {\n String inputFile = getInputFile();\r\n Scanner scanner = new Scanner (new File (inputFile));\r\n ArrayList<String> terms = new ArrayList<String>();\r\n ArrayList<String> definitions = new ArrayList<String>();\r\n while (scanner.hasNextLine()) {\r\n terms.add(scanner.nextLine()); //took out .toLowerCase() part so it prints correctly \r\n definitions.add(scanner.nextLine());\r\n }\r\n return terms;\r\n }", "public static ArrayList<String> readBook(String filename)\n throws FileNotFoundException {\n ArrayList<String> words = new ArrayList<>();\n Scanner in = new Scanner(new File(filename));\n while (in.hasNext()) {\n words.add(in.next());\n }\n return words;\n }", "void readFile()\n {\n Scanner sc2 = new Scanner(System.in);\n try {\n sc2 = new Scanner(new File(\"src/main/java/ex45/exercise45_input.txt\"));\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n while (sc2.hasNextLine()) {\n Scanner s2 = new Scanner(sc2.nextLine());\n while (s2.hasNext()) {\n //s is the next word\n String s = s2.next();\n this.readFile.add(s);\n }\n }\n }", "public void init( String dictionaryFilePath) throws IOException {\n if(dictionaryFilePath == null || dictionaryFilePath.isEmpty()) {\n dictionaryFilePath = DEFAULT_DICTIONARY;\n log.warn(\"Using Default Dictionary\");\n }\n\n DICTIONARY = Files.readAllLines(Paths.get(dictionaryFilePath))\n .parallelStream()\n .map(line -> line.replaceAll(\"[^a-zA-Z ]\", \"\"))\n .map(Word::new)\n .collect(Collectors.toCollection(ConcurrentLinkedQueue::new));\n }", "public ArrayList<String> readWords(String fileName) {\n BufferedReader r = null;\n\n try {\n r = new BufferedReader(new InputStreamReader(new FileInputStream(fileName)));\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n\n words = new ArrayList<String>();\n\n while (true) {\n String word = null;\n try {\n word = r.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (word == null) {\n break;\n }\n assert word.length() == 5;\n words.add(word);\n }\n\n return words;\n }", "private static ArrayList<String> readFile() throws ApplicationException {\r\n\r\n ArrayList<String> bookList = new ArrayList<>();\r\n\r\n File sourceFile = new File(FILE_TO_READ);\r\n try (BufferedReader input = new BufferedReader(new FileReader(sourceFile))) {\r\n\r\n if (sourceFile.exists()) {\r\n LOG.debug(\"Reading book data\");\r\n String oneLine = input.readLine();\r\n\r\n while ((oneLine = input.readLine()) != null) {\r\n\r\n bookList.add(oneLine);\r\n\r\n }\r\n input.close();\r\n } else {\r\n throw new ApplicationException(\"File \" + FILE_TO_READ + \" does not exsit\");\r\n }\r\n } catch (IOException e) {\r\n LOG.error(e.getStackTrace());\r\n }\r\n\r\n return bookList;\r\n\r\n }", "public void insertFromFile() throws IOException {\n File file = new File(Main.DATA_FILE_PATH);\n Scanner sc = new Scanner(file);\n\n dictionary = new Dictionary();\n TreeMap<String, ArrayList<String>> wordList = new TreeMap<>();\n String target = sc.nextLine().substring(1).trim();\n ArrayList<String> explain = new ArrayList<>();\n while (sc.hasNextLine()) {\n String str = sc.nextLine();\n if (str.indexOf(\"@\") == 0) {\n wordList.put(target, explain);\n target = str.substring(1).trim();\n explain = new ArrayList<>();\n } else if (str.indexOf(\"=\") == 0) {\n str = str.replace(\"+\", \" : \");\n String word = \" = \" + str.substring(1);\n explain.add(word);\n } else if (str.indexOf(\"#\") == 0 || str.indexOf(\"*\") == 0) {\n explain.add(str);\n } else {\n explain.add(\" \" + str);\n }\n }\n dictionary.setWordList(wordList);\n sc.close();\n }", "private static void populateWordList(Scanner dictScan) {\n\t\tfor(int i=2; i<wordList.length; i++) {\n\t\t\tif(dictScan.hasNext()) {\n\t\t\t\twordList[i] = dictScan.nextLine();\n\t\t\t}\n\t\t}\n\t}", "public void constructDictionaries(String corpusFilePath) throws Exception {\n\n System.out.println(\"Constructing dictionaries...\");\n File dir = new File(corpusFilePath);\n for (File file : dir.listFiles()) {\n if (\".\".equals(file.getName()) || \"..\".equals(file.getName())) {\n continue; // Ignore the self and parent aliases.\n }\n System.out.printf(\"Reading data file %s ...\\n\", file.getName());\n BufferedReader input = new BufferedReader(new FileReader(file));\n String line = null;\n\n System.out.println(file.getName() + \"----------------------------------- \");\n while ((line = input.readLine()) != null) {\n\n if (line.isEmpty()) {\n continue;\n }\n\n /*\n * Remember: each line is a document (refer to PA2 handout)\n * TODO: Your code here\n */\n\n String[] words = line.trim().split(\"\\\\s+\");\n String previousWord = words[0];\n unigrams.add(previousWord);\n\n for (int i=1; i<words.length; ++i) {\n String w = words[i];\n unigrams.add(w);\n\n String bigram = previousWord + \" \" + w ;\n\n bigrams.add(bigram);\n\n previousWord = w;\n }\n\n }\n input.close();\n }\n\n computeUnigramProbabilities();\n computeBigramProbabilities();\n\n System.out.println(\"Done.\");\n }", "private void readItems() {\n // open file\n File file = getFilesDir();\n File todoFile = new File(file, \"scores.txt\");\n // try to find items to add\n try {\n items = new ArrayList<>(FileUtils.readLines(todoFile));\n } catch (IOException e) {\n items = new ArrayList<>();\n }\n }", "private static ArrayList<Capital> getCapitalsFromFile() {\n\n String txtFile = \"countries_and_capitals.txt\";\n BufferedReader br = null;\n String line = \"\";\n int COUNTRY_COL = 0;\n int CAPITAL_COL = 1;\n ArrayList<Capital> capitals = new ArrayList<Capital>();\n\n try {\n\n br = new BufferedReader(new FileReader(txtFile));\n\n while ((line = br.readLine()) != null) {\n String[] capital = line.split(\" \\\\| \");\n capitals.add(new Capital(capital[CAPITAL_COL], capital[COUNTRY_COL]));\n }\n\n } catch (FileNotFoundException e) {\n System.out.println(\"File not found\");\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (br != null) {\n try {\n br.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n return capitals;\n }", "public Dictionary()\n\t\tthrows FileNotFoundException, IOException\n\t{\n\t\tthis(\"dictionary.txt\");\n\t}", "private void takeInFile() {\n System.out.println(\"Taking in file...\");\n //Reads the file\n String fileName = \"messages.txt\";\n String line = null;\n try {\n FileReader fileReader = new FileReader(fileName);\n \n BufferedReader bufferedReader = new BufferedReader(fileReader);\n\n //Adds each line to the ArrayList\n int i = 0;\n while ((line = bufferedReader.readLine()) != null) {\n lines.add(line);\n //System.out.println(line);\n i++;\n }\n \n bufferedReader.close();\n } catch (FileNotFoundException ex) {\n System.out.println(\"Unable to open file '\" + fileName + \"'\");\n } catch (IOException ex) {\n System.out.println(\"Error reading file '\" + fileName + \"'\");\n }\n System.out.println(\"Done taking in file...\");\n }", "private static ArrayList<String> read(String fileName, boolean next) {\n\t\t\n\n\t\tFile input = new File(fileName);\n\t\tArrayList<String> information = new ArrayList<String>();\n\t\t\n\t\t\n\t\t//uses a simple try catch to read the file\n\t\ttry {\n\t\t\t\n\t\t\tScanner fileReader = new Scanner(input);\n\t\t\t\n\t\t\tif(next) //if reading by word, the ArrayList will contain info by word\n\t\t\t\twhile(fileReader.hasNext()) \n\t\t\t\t\tinformation.add(fileReader.next());\n\t\t\t\t\n\t\t\telse //otherwise the ArrayList will contain info by lines\n\t\t\t\twhile(fileReader.hasNextLine())\n\t\t\t\t\tinformation.add(fileReader.nextLine());\n\t\t\t\n\t\t\tfileReader.close();\n\t\t} catch(FileNotFoundException e) {\n\t\t\t\n\t\t\te.printStackTrace();\n\t\t\t\n\t\t}\n\t\t\n\t\treturn information;\n\t}", "private ArrayList<String> readEntriesFromFile(String nameOfFile){\n\t\tArrayList<String> foundEntries = new ArrayList<String>();\n\t\t\n\t\ttry{\n\t\t\tFile file = new File(nameOfFile); \n\t\t\tScanner fileIn = new Scanner(file);\n\t\t\twhile (fileIn.hasNext()){\n\t\t\t\tString currentLine = fileIn.nextLine();\n\t\t\t\tfoundEntries.add(currentLine);\n\t\t\t} \n\t\t\tfileIn.close();\n\t\t}catch (IOException e){\n\t\t}\n\t\t\n\t\tif(foundEntries.size()==0){\n\t\t return null;\n\t\t}else{\n\t\t\treturn foundEntries;\n\t\t}\n\t}", "public HunspellDictionary(InputStream affix, List<InputStream> dictionaries, Version version, boolean ignoreCase) throws IOException, ParseException {\n this.version = version;\n this.ignoreCase = ignoreCase;\n String encoding = getDictionaryEncoding(affix);\n CharsetDecoder decoder = getJavaEncoding(encoding);\n readAffixFile(affix, decoder);\n words = new CharArrayMap<List<HunspellWord>>(version, 65535 /* guess */, this.ignoreCase);\n for (InputStream dictionary : dictionaries) {\n readDictionaryFile(dictionary, decoder);\n }\n }", "public void llenDic(){\r\n ArrayList<String> wor= new ArrayList<String>();\r\n ArrayList<Association<String,String> >asociaciones= new ArrayList<Association<String,String>>();\r\n \r\n try {\r\n \r\n arch = new File (\"diccionario.txt\");\r\n fr = new FileReader (arch);\r\n br = new BufferedReader(fr);\r\n\r\n \r\n String lin;\r\n \r\n while((lin=br.readLine())!=null){\r\n wor.add(lin);\r\n }\r\n }\r\n catch(Exception e){\r\n e.printStackTrace();\r\n }finally{\r\n \r\n try{ \r\n if( null != fr ){ \r\n fr.close(); \r\n } \r\n }catch (Exception e2){ \r\n e2.printStackTrace();\r\n }\r\n }\r\n \r\n //Ciclo para separar y obtener la palabra en ingles y español\r\n for(int i=0; i<wor.size()-1;i++){\r\n int lugar=wor.get(i).indexOf(',');\r\n String ing=wor.get(i).substring(0,lugar);\r\n String esp=wor.get(i).substring(lugar+1,wor.get(i).length());\r\n asociaciones.add(new Association(ing, esp));\r\n }\r\n \r\n rz.setValue(asociaciones.get(0));\r\n for (int i=1; i<asociaciones.size(); i++){\r\n insertarNodo(rz, asociaciones.get(i));\r\n }\r\n }", "public void populateListFromFile() \n\t{\n\t\tBufferedReader bufferedReader = null;\n\t\tallQuestions = new ArrayList<ArrayList<String>>();\n\t\tquestionAndAnswers = new ArrayList<String>();\n\n\t\ttry {\n\t\t bufferedReader = new BufferedReader(new FileReader(\"questions.txt\"));\n\t\t String line = \"\";\n\t\t \n\t\t while ((line = bufferedReader.readLine()) != null) \n\t\t {\t\t\t \t\n\t\t \tif(line.length() > 0)\n\t\t \t\tquestionAndAnswers.add(line);\n\t\t \telse if (line.length() == 0)\n\t\t \t{\n\t\t \t\tallQuestions.add(questionAndAnswers);\n\t\t \t\tquestionAndAnswers = new ArrayList<String>();\n\t\t \t}\n\t\t } \n\t\t} catch (IOException e) {\n\t\t e.printStackTrace();\n\t\t}\n\t}", "WordLadderSolver(String dictionaryFile) {\n \tdictionary = new Dictionary(dictionaryFile); //Set up the words from the file\n }", "public InMemoryDictionary(File dictFile) {\n\t\t// TODO: Implement constructor\n\t}", "private void loadData () {\n try {\n File f = new File(\"arpabet.txt\");\n BufferedReader br = new BufferedReader(new FileReader(f));\n vowels = new HashMap<String, String>();\n consonants = new HashMap<String, String>();\n phonemes = new ArrayList<String>();\n String[] data = new String[3];\n for (String line; (line = br.readLine()) != null; ) {\n if (line.startsWith(\";\")) {\n continue;\n }\n data = line.split(\",\");\n phonemes.add(data[0]);\n if (data[1].compareTo(\"v\") == 0) {\n vowels.put(data[0], data[2]);\n } else {\n consonants.put(data[0], data[2]);\n }\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public HashMap<String, String[]> convertToArray() throws IOException\n\t{\n\t HashMap<String, String[]> map = new HashMap<String, String[]>();\n\t String[] list;\n\t \n\t String line;\n\t BufferedReader reader;\n\t\t\n\t try {\n\t\t\treader = new BufferedReader(new FileReader(filePath));\n\t\t\t\n\t\t\twhile ((line = reader.readLine()) != null)\n\t\t {\n\t\t\t\tString key = line;\n\t\t\t\tString value = \"\";\n\t\t\t\tString tmp;\n\t\t\t\t\n\t\t\t\twhile(!(tmp=reader.readLine()).equals(\"$\"))\n\t\t\t\t{\t\n\t\t\t\t\tvalue = value+tmp; \n\t\t\t\t}\n\t\t\t\tString values = value.replaceAll(\"\\\"\", \"\");\n\t\t\t\t\n\t\t\t\tString[] parts = values.split(\",\");\n\t\t map.put(key, parts);\n\t\t }\n\t\t\t\n\t\t\t/*for (String key : map.keySet())\n\t\t {\n\t\t System.out.println(key);\n\t\t for(int i=0; i < map.get(key).length; i++)\n\t\t {\n\t\t \tSystem.out.println(map.get(key)[i]);\n\t\t }\n\t\t }*/\n\t\t\t\n\t\t reader.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t \n\t \n\t return map;\n\t}", "public static void buildDictionary() throws IOException {\n\t\t\n \tSystem.out.println(\"Loading dictionary...\");\n \t\n \tBufferedReader input = new BufferedReader( new FileReader(entities) );\n \tMapDictionary<String> dictionary = new MapDictionary<String>();\t\n \tString aux = null;\n \t\n\t\twhile ((aux=input.readLine())!=null) {\t\t\t\n\t\t\tif (aux.length()==0)\n\t\t\t\tcontinue;\n\n\t\t\taux.replaceAll(\"([A-Z])\",\" $1\").trim();\t\t\t\n\t\t\tdictionary.addEntry(new DictionaryEntry<String>(aux,aux,CHUNK_SCORE));\n\t \n\t\t}\n\t\t\n chunker = new ExactDictionaryChunker(dictionary,IndoEuropeanTokenizerFactory.INSTANCE,true,true);\n System.out.println(\"Dictionary contains \" + dictionary.size() + \" entries.\");\n }", "public List<String> readFile(File inputFile) {\n\n List<String> AL = new ArrayList<>();\n List<String> retAL;\n wordReplace wr = new wordReplace();\n String text;\n try{\n Scanner file_scan = new Scanner(inputFile);\n while(file_scan.hasNextLine()){\n text= file_scan.nextLine();\n AL.add(text);\n }\n file_scan.close();\n }\n catch(IOException e){\n System.out.println(\"File Not Found for some reason.\");\n }\n retAL = wr.replaceWord((ArrayList<String>) AL);\n return retAL;\n }", "public WordDictionary() {\n\t\tthis.checker = new SpellChecker();\n\n\t\t\ttry {\n\t\t\t\tReader reader = new InputStreamReader(WordDictionary.class.getResourceAsStream(\"/english.txt\"));\n\t\t\t\tthis.checker.initialize(reader);\n\t\t\t} catch (Exception exception) {\n\t\t\t\tSystem.err.println(\"Wrong path to dictionary file\");\n\t\t\t\texception.printStackTrace();\n\t\t\t}\n\t}", "public static void loadFile(String inputFile, ArrayList<String> array) {\n String line = \"\";\n String[] words;\n try {\n BufferedReader reader = new BufferedReader(new FileReader(inputFile));\n System.out.println(\"\\nFile found\");\n System.out.println(\"Loading file... \\\"CorrectMe\\\"\");\n while ((line = reader.readLine()) != null) {\n line = line.replaceAll(\"[^a-zA-Z ]\", \"\").toLowerCase();\n words = line.split(\" \");\n for (int i = 0; i < words.length; i++)\n array.add(words[i]);\n }\n reader.close();\n } catch (IOException ex) {\n System.out.println(\"File not found\");\n }\n }", "public static ArrayList<String> convert2list(String filename) \n\t\t\tthrows FileNotFoundException{\n\t\tInputStream oeuvre = new FileInputStream(filename);\n\t\tScanner scanner = new Scanner(oeuvre).useDelimiter(\"\\n\");\n\t\t\n\t\tArrayList<String> words = new ArrayList<String>();\n\t\twhile(scanner.hasNext()){\n\t\t\twords.add(scanner.next());\n\t\t}\n\t\treturn words;\n\t}", "public static ArrayList readScifinder( String filename)\n {\n \t\tArrayList bibitems=new ArrayList();\n \t\tFile f = new File(filename);\n \n \t\tif(!f.exists() && !f.canRead() && !f.isFile()){\n \t\t\tSystem.err.println(\"Error \" + filename + \" is not a valid file and|or is not readable.\");\n \t\t\treturn null;\n \t\t}\n \t\tStringBuffer sb=new StringBuffer();\n \t\ttry{\n \t\t\tBufferedReader in = new BufferedReader(new FileReader( filename));\n \n \t\t\tString str;\n \t\t\twhile ((str = in.readLine()) != null) {\n \t\t\t\tsb.append(str);\n \t\t\t}\n \t\t\tin.close();\n \n \t\t}\n \t\tcatch(IOException e){return null;}\n \t\tString [] entries=sb.toString().split(\"START_RECORD\");\n \t\tHashMap hm=new HashMap();\n \t\tfor(int i=1; i<entries.length; i++){\n \t\t\tString[] fields = entries[i].split(\"FIELD \");\n \t\t\tString Type=\"\";\n \t\t\thm.clear(); // reset\n \t\t\tfor(int j=0; j<fields.length; j++) if (fields[j].indexOf(\":\") >= 0) {\n \t\t\t\tString tmp[]= new String[2];\n tmp[0] = fields[j].substring(0, fields[j].indexOf(\":\"));\n tmp[1] = fields[j].substring(fields[j].indexOf(\":\")+1);\n \t\t\t\tif(tmp.length > 1){//==2\n \t\t\t\t\tif(tmp[0].equals(\"Author\"))\n \t\t\t\t\t\thm.put( \"author\", tmp[1].replaceAll(\";\",\" and \") );\n \t\t\t\t\telse if(tmp[0].equals(\"Title\"))\n \t\t\t\t\t\thm.put(\"title\",tmp[1]);\n \n \t\t\t\t\telse if(tmp[0].equals(\"Journal Title\"))\n \t\t\t\t\t\thm.put(\"journal\",tmp[1]);\n \n \t\t\t\t\telse if(tmp[0].equals(\"Volume\"))\n \t\t\t\t\thm.put(\"volume\",tmp[1]);\n \t\t\t\telse if(tmp[0].equals(\"Page\"))\n \t\t\t\t\thm.put(\"pages\",tmp[1]);\n \t\t\t\telse if(tmp[0].equals(\"Publication Year\"))\n \t\t\t\t\thm.put(\"year\",tmp[1]);\n \t\t\t\telse if(tmp[0].equals(\"Abstract\"))\n \t\t\t\t\thm.put(\"abstract\",tmp[1]);\n \t\t\t\telse if(tmp[0].equals(\"Supplementary Terms\"))\n \t\t\t\t\thm.put(\"keywords\",tmp[1]);\n \t\t\t\telse if(tmp[0].equals(\"Document Type\"))\n \t\t\t\t\tType=tmp[1].replaceAll(\"Journal\",\"article\");\n \t\t\t}\n \t }\n \n \t BibtexEntry b=new BibtexEntry(Globals.DEFAULT_BIBTEXENTRY_ID,\n \t\t\t\t\t\t\t\t\t Globals.getEntryType(Type)); // id assumes an existing database so don't create one here\n \t b.setField( hm);\n \t bibitems.add( b );\n \n \t}\n \treturn bibitems;\n }", "private void readFile() {\r\n\t\tScanner sc = null; \r\n\t\ttry {\r\n\t\t\tsc = new Scanner(inputFile);\t\r\n\t\t\twhile(sc.hasNextLine()){\r\n\t\t\t\tgrade.add(sc.nextLine());\r\n\t } \r\n\t\t}\r\n\t\tcatch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tsc.close();\r\n\t\t}\t\t\r\n\t}", "private void createDictionary() throws IOException {\r\n long start = System.currentTimeMillis();\r\n\r\n dict = new PrefixTree(); //new prefix\r\n BufferedReader reader = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(\"/dictionary.csv\"))); //read the file\r\n\r\n String line;\r\n while ((line = reader.readLine()) != null) {\r\n //System.out.println(line);\r\n addToRoot(line); //for each line add it in dictionary\r\n }\r\n\r\n System.out.println(\"Time took for making Dictionary : \" + (System.currentTimeMillis() - start) + \" ms\");\r\n }", "public MapDictionary(String dictionaryLocation) {\n\t\ttry {\n\t\t\tScanner dictionary = new Scanner(new FileReader(dictionaryLocation));\n\t\t\twhile(dictionary.hasNextLine()) {\n\t\t\t\tString word = dictionary.nextLine().toLowerCase();\n\t\t\t\tif(PredictivePrototype.isValidWord(word))\n\t\t\t\t\taddElement(word, PredictivePrototype.wordToSignature(word));\n\t\t\t}\n\t\t\tdictionary.close();\n\t\t}\n\t\tcatch (FileNotFoundException e) {\n\t\t\tSystem.out.print(\"Dictionary not found.\");\n\t\t}\n\t}", "public static ArrayList load(String filePath) throws IOException\n\t{\n\t\tString line;\n\t\tArrayList gameConfigs = new ArrayList();\n\t\tBufferedReader textReader = new BufferedReader(new FileReader(filePath));\n\t\t\n\t\twhile((line = textReader.readLine()) != null)\n\t\t{\n\t\t\tgameConfigs.add(line);\n\t\t}\n\t\t\n\t\ttextReader.close();\n\t\treturn gameConfigs;\n\t}", "public List<DictionaryData> alphabeticalList() {\r\n //System.out.println(\"Checkpoint 5: alphabeticalList() not implemented yet\");\r\n //using the java collection set\r\n //wordlist here is the collection containing elements to be added to this set values\r\n Collection<DictionaryData> wordlist = dictionaryMap.values();\r\n //return list of words as an arrarylist using the same format as above\r\n return new ArrayList<DictionaryData>(wordlist);\r\n\r\n //return null;\r\n }", "public void readFile()\n {\n try {\n fileName = JOptionPane.showInputDialog(null,\n \"Please enter the file you'd like to access.\"\n + \"\\nHint: You want to access 'catalog.txt'!\");\n \n File aFile = new File(fileName);\n Scanner myFile = new Scanner(aFile);\n \n String artist, albumName; \n while(myFile.hasNext())\n { //first we scan the document\n String line = myFile.nextLine(); //for the next line. then we\n Scanner myLine = new Scanner(line); //scan that line for our info.\n \n artist = myLine.next();\n albumName = myLine.next();\n ArrayList<Track> tracks = new ArrayList<>();\n \n while(myLine.hasNext()) //to make sure we get all the tracks\n { //that are on the line.\n Track song = new Track(myLine.next());\n tracks.add(song);\n }\n myLine.close();\n Collections.sort(tracks); //sort the list of tracks as soon as we\n //get all of them included in the album.\n Album anAlbum = new Album(artist, albumName, tracks);\n catalog.add(anAlbum);\n }\n myFile.close();\n }\n catch (NullPointerException e) {\n System.err.println(\"You failed to enter a file name!\");\n System.exit(1);\n }\n catch (FileNotFoundException e) {\n System.err.println(\"Sorry, no file under the name '\" + fileName + \"' exists!\");\n System.exit(2);\n }\n }", "private void loadStopWords() throws FileNotFoundException, IOException{\n\n BufferedReader reader = new BufferedReader(new FileReader(\"src/stopwords/English.txt\"));\n String sWord;\n while ((sWord = reader.readLine()) != null) \n {\n stopWordList.add(sWord);\n }\n reader.close();\n }", "public static void main(String[] args) throws FileNotFoundException{\n Scanner scnr = new Scanner(new File(\"words.txt\"));\r\n //Declare the ArrayList to store words\r\n ArrayList<String> words = new ArrayList<String>();\r\n \r\n //Read from file and store elements in the ArrayList\r\n //while(scnr.hasNext()) File is too large and will take time\r\n for(int i = 0; i < 2000; i++){\r\n words.add(scnr.next());\r\n }\r\n // Task1: Display the ArrayList\r\n System.out.println(words); //toString() of the ArrayList\r\n \r\n // Task 2: Display words in reverse order\r\n displayReverse(words);\r\n \r\n // Task 3: Display words ending with \"s\" capitalized\r\n displayPlurals(words);\r\n \r\n // Task 4: Remove words ending with \"s\"\r\n removePlurals(words);\r\n System.out.println(words);\r\n \r\n }", "private void readPhrases() {\n\t\tphrases = new HashMap<String, String>();\n\t\tcounter = new HashMap<String, Integer>();\n\n\t\tBufferedReader br = null;\n\n\t\ttry {\n\t\t\tbr = new BufferedReader(new FileReader(input));\n\t\t\tfor (String line; (line = br.readLine()) != null;) {\n\t\t\t\tStringTokenizer tokenizer = new StringTokenizer(line, \"|\");\n\n\t\t\t\twhile (tokenizer.hasMoreTokens()) {\n\t\t\t\t\tString phrase = tokenizer.nextToken();\n\t\t\t\t\tString key = StringUtils.getMd5Hash(phrase);\n\n\t\t\t\t\tif (phrases.containsKey(key)) {\n\t\t\t\t\t\tint count = counter.get(key);\n\t\t\t\t\t\tcounter.put(key, ++count);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tphrases.put(key, phrase);\n\t\t\t\t\t\tcounter.put(key, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tthrow new IllegalAccessError(\"Error reading input [\"\n\t\t\t\t\t+ input.getName() + \"]\");\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tbr.close();\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.err.println(e.getMessage());\n\t\t\t}\n\t\t}\n\n\t}", "private ArrayList<String> saveText(){\n FileReader loadDetails = null;\n String record;\n record = null;\n\n //Create an ArrayList to store the lines from text file\n ArrayList<String> lineKeeper = new ArrayList<String>();\n\n try{\n loadDetails=new FileReader(\"employees.txt\");\n BufferedReader bin=new BufferedReader (loadDetails);\n record=new String();\n while (((record=bin.readLine()) != null)){//Read the file and store it into the ArrayList line by line*\n lineKeeper.add(record);\n }//end while\n bin.close();\n bin=null;\n }//end try\n catch (IOException ioe) {}//end catc\n\n return lineKeeper;\n\n }", "private void upgradeDictionary() throws IOException {\n File fileAnnotation = new File(filePathAnnSource);\n FileReader fr = new FileReader(fileAnnotation);\n BufferedReader br = new BufferedReader(fr);\n String line;\n\n if (fileAnnotation.exists()) {\n while ((line = br.readLine()) != null) {\n String[] annotations = line.split(\"[ \\t]\");\n String word = line.substring(line.lastIndexOf(\"\\t\") + 1);\n\n if (!nonDictionaryTerms.contains(word.toLowerCase())) {\n if (dictionaryTerms.containsKey(word.toLowerCase())) {\n if (!dictionaryTerms.get(word.toLowerCase()).equalsIgnoreCase(annotations[1])) {\n System.out.println(\"Conflict: word:: \" + word + \" Dictionary Tag: \" + dictionaryTerms.get(word.toLowerCase()) + \" New Tag: \" + annotations[1]);\n nonDictionaryTerms.add(word.toLowerCase());\n// removeLineFile(dictionaryTerms.get(word.toLowerCase())+\" \"+word.toLowerCase(),filePathDictionaryAuto);\n dictionaryTerms.remove(word.toLowerCase());\n writePrintStream(word, filePathNonDictionaryAuto);\n }\n } else {\n System.out.println(\"Updating Dictionary:: Word: \" + word + \"\\tTag: \" + annotations[1]);\n dictionaryTerms.put(word.toLowerCase(), annotations[1]);\n writePrintStream(annotations[1] + \" \" + word.toLowerCase(), filePathDictionaryAuto);\n }\n }\n\n// if (dictionaryTerms.containsKey(word.toLowerCase())) {\n// if (!dictionaryTerms.get(word.toLowerCase()).equalsIgnoreCase(annotations[1])) {\n// System.out.println(\"Conflict: word: \" + word + \" Dictionary Tag: \" + dictionaryTerms.get(word.toLowerCase()) + \" New Tag: \" + annotations[1]);\n// nonDictionaryTerms.add(word.toLowerCase());\n//\n// }\n// } else {\n// dictionary.add(word.toLowerCase());\n// dictionaryTerms.put(word.toLowerCase(), annotations[1]);\n// System.out.println(\"Updating Dictionary: Word: \" + word + \"\\tTag: \" + annotations[1]);\n// }\n }\n }\n\n\n br.close();\n fr.close();\n }", "public ArrayList<String> getDefinitions () throws FileNotFoundException {\n String inputFile = getInputFile();\r\n Scanner scanner = new Scanner (new File (inputFile));\r\n ArrayList<String> terms = new ArrayList<String>();\r\n ArrayList<String> definitions = new ArrayList<String>();\r\n while (scanner.hasNextLine()) {\r\n terms.add(scanner.nextLine()); //took out .toLowerCase()\r\n definitions.add(scanner.nextLine());\r\n }\r\n return definitions;\r\n }", "public static void testDictionary() throws IOException {\n String wnhome=\"c:\\\\Users\\\\Katherine\\\\Documents\\\\2nd sem\\\\IR\\\\project\\\\WordNet_3.1\";\n String path = wnhome + File.separator + \"dict\";\n\n\n URL url = new URL(\"file\", null, path);\n\n IDictionary dictionary = new Dictionary(url);\n dictionary.open();\n // /Users/Ward/Downloads\n IIndexWord indexWord = dictionary.getIndexWord(\"use\", POS.VERB);\n\n for (IWordID wordID : indexWord.getWordIDs()) {\n\n IWord word = dictionary.getWord(wordID);\n for (IWord word1 : word.getSynset().getWords()) {\n System.out.println(word1.getLemma());\n }\n// System.out.println(\"Id = \" + wordID);\n// System.out.println(\" Lemma = \" + word.getLemma());\n// System.out.println(\" Gloss = \" + word.getSynset().getGloss());\n\n List<ISynsetID> hypernyms =\n word.getSynset().getRelatedSynsets(Pointer.HYPERNYM);\n // print out each h y p e r n y m s id and synonyms\n List<IWord> words;\n for (ISynsetID sid : hypernyms) {\n words = dictionary.getSynset(sid).getWords();\n System.out.print(sid + \" {\");\n for (Iterator<IWord> i = words.iterator(); i.hasNext(); ) {\n System.out.print(i.next().getLemma());\n if (i.hasNext())\n System.out.print(\", \");\n }\n System.out.println(\"}\");\n }\n }\n }", "public List<Answer> loadAnswers() {\r\n\t\tScanner scanner = null;\r\n\t\ttry {\r\n\t\t\t// Creating scanner that reads the questions.txt file.\r\n\t\t\tscanner = new Scanner(new File(\"javaAnswers.txt\"));\r\n\t\t\t// Loop that goes over the file and adding each line as a string element to the\r\n\t\t\t// list. The result is full list with the questions.\r\n\t\t\twhile (scanner.hasNextLine()) {\r\n\t\t\t\tAnswer a = new Answer();\r\n\t\t\t\ta.setPossibleAnswer(scanner.nextLine());\r\n\t\t\t\tpossibleAnswers.add(a);\r\n\t\t\t}\r\n\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// Closing the scanner.\r\n\t\tfinally {\r\n\t\t\tscanner.close();\r\n\t\t}\r\n\t\treturn possibleAnswers;\r\n\t}", "@PostConstruct\n private List<String> loadFortunesFile() {\n System.out.println(\">> FileFortuneService: inside method 'loadFortunesFile'.\");\n\n try {\n String fileName = \"src/com/luv2code/springdemo/fortune_data.txt\";\n BufferedReader reader = new BufferedReader(new FileReader(fileName));\n String line = null;\n while ( (line = reader.readLine()) != null) {\n fortunes.add(line);\n }\n } catch (IOException e) {\n System.out.println(\"An error occurred during file-stream: \");\n e.printStackTrace();\n }\n return fortunes;\n\n }", "public ArrayList<String> readFile() {\n data = new ArrayList<>();\n String line = \"\";\n boolean EOF = false;\n\n try {\n do {\n line = input.readLine();\n if(line == null) {\n EOF = true;\n } else {\n data.add(line);\n }\n } while(!EOF);\n } catch(IOException io) {\n System.out.println(\"Error encountered.\");\n }\n return data;\n }", "private void readListFromFile() {\n // clear existing list\n if (listArr == null || listArr.size() > 0) {\n listArr = new ArrayList<>();\n }\n\n try {\n Scanner scan = new Scanner(openFileInput(LIST_FILENAME));\n\n while (scan.hasNextLine()) {\n String line = scan.nextLine();\n listArr.add(line);\n }\n\n if (listAdapter != null) {\n listAdapter.notifyDataSetChanged();\n }\n\n } catch (IOException ioe) {\n Log.e(\"ReadListFromFile\", ioe.toString());\n }\n\n }", "private void populateDictionary() throws IOException {\n populateDictionaryByLemmatizer();\n// populateDictionaryBySynonyms();\n }", "private void loadFromFile(){\n try {\n FileInputStream fis = openFileInput(FILENAME);\n BufferedReader in = new BufferedReader(new InputStreamReader(fis));\n Gson gson = new Gson();\n Type listType = new TypeToken<ArrayList<Countbook>>() {}.getType();\n countbookList = gson.fromJson(in, listType);\n } catch (FileNotFoundException e) {\n countbookList = new ArrayList<Countbook>();\n }\n }", "public static List read(String fileName) throws IOException {\n\tList data = new ArrayList() ;\n Scanner scanner = new Scanner(new FileInputStream(fileName));\n try {\n while (scanner.hasNextLine()){\n data.add(scanner.nextLine());\n }\n }\n finally{\n scanner.close();\n }\n return data;\n }", "@Override\r\n public Map getData(String fileName) {\r\n Map<String, Integer> map = new HashMap<>();\r\n \r\n File file = new File(fileName);\r\n \r\n try (BufferedReader bufferedReader =\r\n new BufferedReader(new FileReader(file))) {\r\n \r\n String line;\r\n while ((line = bufferedReader.readLine()) != null) {\r\n \r\n //if the word have already been in the map,\r\n //increases the number of occurances,\r\n //otherwise sets this number to 1\r\n //and puts a new value to the map\r\n String[] words = line.split(\" \");\r\n for (String word : words) {\r\n Integer value = map.get(word);\r\n if (value == null) {\r\n value = 1;\r\n } else {\r\n value++;\r\n }\r\n map.put(word, value);\r\n }\r\n }\r\n } catch(IOException e) {\r\n System.out.println(e.getMessage());\r\n return null;\r\n }\r\n \r\n return map;\r\n }", "private void readFile() {\n try (BufferedReader br = new BufferedReader(new FileReader(\"../CS2820/src/production/StartingInventory.txt\"))) {\n String line = br.readLine();\n while (line != null) {\n line = br.readLine();\n this.items.add(line);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public Dictionary ( ArrayList < String > listOfWords ) {\n\t\tsuper(listOfWords.get((listOfWords.size()-1)/2));\n\t\t\n\t\t//store words list as binary tree\n\t\t//starts with left side then with right\n\t\tint start = 0;\n\t\tint end = listOfWords.size()-1;\n\t\tint mid = (start+end)/2;\n\t\tmakeTree(listOfWords, start, mid-1);\n\t\tmakeTree(listOfWords, mid+1, end);\n\t\t\n\t\t\n\t\t/**old code written by Professor below\n\t\t * \n\t\t */\n\t\t//words = listOfWords;\n\t\t//if (null == words) {\n\t\t//\twords = new ArrayList <String> ();\n\t\t//}\n\t\t\n\n\t\t\n\t}", "List<String> fileToListOfWords(File f) throws FileNotFoundException {\n\n\t\tScanner sc = new Scanner(f, \"UTF-8\");\n\n\t\tString txt = sc.useDelimiter(\"\\\\A\").next().toLowerCase();\n\t\tString[] s = txt.replaceAll(\"^[.,\\\\s]+\", \"\").split(\"[.,\\\\s]+\");\n\t\tsc.close(); // ovo je dobro\n\t\tList<String> list = Arrays.asList(s);\n\t\t\n\t\treturn list;\n\t}", "public ArrayList<SoundInfo> readFile(String textFilePath) {\n\t\t\n\t\topenNewProject();\n\t\tprojectFileIO = new XMLReaderWriter(textFilePath);\n\t\t\n\t\t// Read the project file and save its contents to memory\n\t\tArrayList<SoundInfo> readSounds = projectFileIO.readFile();\n\t\tArrayList<Integer> removeSounds = new ArrayList<Integer>();\n\t\tfor (int s=0; s < readSounds.size(); s++) {\n\t\t\tSoundInfo currSound = readSounds.get(s);\n\t\t\tint keyCode = currSound.getKeyCode();\n\t\t\t\n\t\t\tif (!soundList.containsKey(keyCode)) {\n\t\t\t\tsoundList.put(keyCode, currSound);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Two sounds with the same key code were found in the file\n\t\t\t\t// Report this as a read error\n\t\t\t\tremoveSounds.add(s);\n\t\t\t\tcurrSound.close();\n\t\t\t\tprojectModified = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Remove sounds with duplicate key codes from the list\n\t\tfor (int i=0; i < removeSounds.size(); i++) {\n\t\t\tint index = removeSounds.get(i);\n\t\t\treadSounds.remove(index);\n\t\t}\n\t\t\n\t\t// The contents of the project file may have been modified in memory to make the values valid\n\t\tif (projectFileIO.getReadError()) {\n\t\t\tprojectModified = true;\n\t\t}\n\t\t\n return readSounds;\n\t}", "private List<KeyFileEntry> convertLinesIntoInMemoryObjectList(List<String> lines) {\n List<KeyFileEntry> retList = new ArrayList<>(1250);\n\n int i = 0;\n\n // Ignore the header lines and information\n for (; i < lines.size(); i++) {\n String lineIgnore = lines.get(i);\n if (lineIgnore.startsWith(\"______\")) {\n break;\n }\n }\n\n // Ignore underscore ___ line\n i++;\n\n // reached entries lines\n KeyFileEntry entry = new KeyFileEntry();\n\n // create in memory list of objects\n while (i < lines.size()) {\n String line = lines.get(i);\n\n // For terminating line no need to complete loop\n if (line.equals(\"//\")) {\n retList.add(entry);\n entry = new KeyFileEntry();\n i++;\n continue;\n }\n\n String[] tokens = line.split(SPLIT_SPACES);\n switch (tokens[0]) {\n case \"ID\":\n entry.id = tokens[1];\n break;\n case \"IC\":\n entry.ic = tokens[1];\n break;\n case \"AC\":\n entry.ac = tokens[1];\n break;\n case \"DE\":\n entry.de.add(tokens[1]);\n break;\n case \"SY\":\n entry.sy.add(tokens[1]);\n break;\n case \"HI\":\n entry.hi.add(tokens[1]);\n break;\n case \"GO\":\n entry.go.add(tokens[1]);\n break;\n case \"CA\":\n entry.ca = tokens[1];\n break;\n case \"WW\":\n entry.ww.add(tokens[1]);\n break;\n default:\n LOG.info(\"Unhandle line found while parsing file: {}\", line);\n\n }\n\n // read and save next line\n i++;\n }\n return retList;\n }" ]
[ "0.7310868", "0.71755815", "0.71333665", "0.7102177", "0.696881", "0.685843", "0.6781969", "0.6778036", "0.67718124", "0.6699699", "0.66815114", "0.6652267", "0.6643592", "0.6607187", "0.656068", "0.6523619", "0.64643675", "0.64343214", "0.6418905", "0.63800657", "0.6347947", "0.6335205", "0.6331966", "0.6266722", "0.6266209", "0.62507206", "0.62266874", "0.6209611", "0.61924726", "0.6171366", "0.616129", "0.61339885", "0.6128187", "0.6119374", "0.60638726", "0.6061753", "0.60556537", "0.6051588", "0.6048059", "0.6033354", "0.6031952", "0.6028926", "0.60043097", "0.59890866", "0.59791607", "0.5978926", "0.5966756", "0.59638995", "0.59453356", "0.5938071", "0.59326005", "0.59102154", "0.5898538", "0.5891044", "0.5885283", "0.5884739", "0.58828455", "0.5860823", "0.5857727", "0.58507854", "0.5833972", "0.5821635", "0.579884", "0.57959485", "0.57840055", "0.57819337", "0.5780257", "0.57780266", "0.5761812", "0.57615477", "0.57560223", "0.5751512", "0.57449764", "0.57286227", "0.5715626", "0.57019705", "0.5699384", "0.5692472", "0.56889915", "0.5685129", "0.5682039", "0.5680204", "0.5670614", "0.56595814", "0.56581306", "0.56550276", "0.5653365", "0.56507164", "0.5649183", "0.5648784", "0.5633462", "0.5627824", "0.56248796", "0.5622698", "0.56205267", "0.56134653", "0.56047297", "0.56031984", "0.56023407", "0.5597943" ]
0.67091376
9
There are two arrayLists, one that contains the dictionary and the other one contains the words that must be corrected. For every word of the string arrayCorrectMe i find the minimum distance with all the words of the arrayDictionary, using the EditDistanceDyn class
public static void editDistanceApplication(ArrayList<String> arrayCorrectMe, ArrayList<String> arrayDictionary) { long startTime = System.nanoTime(); EditDistanceDyn e; // EditDistance e2; int result = 0, min = Integer.MAX_VALUE; ArrayList<String> aux = new ArrayList<String>(); for (int j = 0; j < arrayCorrectMe.size(); j++) { for (int i = 0; i < arrayDictionary.size(); i++) { e = new EditDistanceDyn(); result = e.min_distance_dyn(arrayCorrectMe.get(j), arrayDictionary.get(i)); // e2 = new EditDistance(); // result = e2.edit_distance(arrayCorrectMe.get(j), arrayDictionary.get(i), // arrayCorrectMe.get(j).length(), arrayDictionary.get(i).length()); if (result < min) { min = result; aux.clear(); aux.add(arrayDictionary.get(i)); } else if (result == min) aux.add(arrayDictionary.get(i)); } System.out.println("\nThe word is : " + arrayCorrectMe.get(j) + " \nMinimum distance : " + min); printArray(aux); aux.clear(); min = Integer.MAX_VALUE; } long endTime = System.nanoTime(); long totalTime = endTime - startTime; System.out.println("\nTotal time is:" + totalTime / 1000000000 + " seconds"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void findTheShortestDistance(String[]\tarrayOfWords, String word1, String word2) {\n\t\tHashMap<String, ArrayList<Integer>> wordMap = new HashMap<String, ArrayList<Integer>>();\n\t\t\n\t\t// Add each word to the map\n\t\tfor(int i = 0; i < arrayOfWords.length; ++i) {\n\t\t\t\n\t\t\t// Does this word exist in the map?\n\t\t\tif(wordMap.containsKey(arrayOfWords[i])) {\n\t\t\t\t\n\t\t\t\t// It does, get the value and add to it\n\t\t\t\twordMap.get(arrayOfWords[i]).add(i);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// It does not, create the first record\n\t\t\t\tArrayList<Integer> firstRecord = new ArrayList<Integer>();\n\t\t\t\tfirstRecord.add(i);\n\t\t\t\twordMap.put(arrayOfWords[i].toLowerCase(), firstRecord);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t// Ensure that there is a record for word1 and word2?\n\t\tif(!wordMap.containsKey(word1.toLowerCase()) || !wordMap.containsKey(word2.toLowerCase())) {\n\t\t\t\n\t\t\tSystem.out.println(\"Specified words don't appear in the provided document.\");\n\t\t\treturn;\n\t\t\t\n\t\t}\n\t\t\n\t\t// Now let's find the closest instance of word2 to word1\n\t\t\n\t\t// Get the locations of word1\n\t\tArrayList<Integer> locationsOfWord1 = wordMap.get(word1.toLowerCase());\n\t\t\n\t\t// Get the locations of word2\n\t\tArrayList<Integer> locationsOfWord2 = wordMap.get(word2.toLowerCase());\n\t\t\n\t\t// Initialize minDistance, cannot be longer than the length of our document\n\t\tint minDistance = arrayOfWords.length;\n\t\tint word1Position = 0, word2Position = 0;\n\t\t\n\t\t// Compare each instance of word1\n\t\tfor(int i : locationsOfWord1) {\n\t\t\t\n\t\t\t// To each instance of word2\n\t\t\tfor(int j : locationsOfWord2) {\n\t\t\t\t\n\t\t\t\t// Get the distance between these two occurrences\n\t\t\t\tint distance = Math.abs(i - j);\n\t\t\t\t\n\t\t\t\t// If our distance is less than minDistance, update minDistance\n\t\t\t\tif(distance < minDistance) {\n\t\t\t\t\t\n\t\t\t\t\t// Set the new distance\n\t\t\t\t\tminDistance = distance;\n\t\t\t\t\tword1Position = i;\n\t\t\t\t\tword2Position = j;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\t\n\t\t// We're done, print out the result\n\t\tSystem.out.println(\"\\r\\nThe distance is:\\r\\n\" + minDistance + \" [\" + word1 + \" @ \" + (word1Position + 1) + \"], [\" + word2 + \" @ \" + (word2Position + 1) + \"]\");\n\t\t\n\t}", "private Map<String, Integer> editDistance(String s, DictionaryModel dictionary, int numberOfAllowedChanges, Set <String> alreadyPresentWords ) {\n\n Map<String, Integer> res = new HashMap<>();\n ArrayList <String> editions = editDistance(s, dictionary);\n ArrayList <String> newWords = new ArrayList<>();\n\n for( String word : editions ) {\n if( !alreadyPresentWords.contains(word) ) {\n res.put(word, numberOfAllowedChanges);\n newWords.add( word );\n }\n }\n alreadyPresentWords.addAll( newWords );\n Timber.d(\"There are %d new words(%d)\", newWords.size() , numberOfAllowedChanges);\n\n for( String word : newWords ) {\n if( numberOfAllowedChanges > 1 )\n res.putAll( editDistance( word, dictionary, numberOfAllowedChanges - 1, alreadyPresentWords ) );\n }\n\n return res;\n }", "private static ArrayList<Result> distanceMatching(Query query, DataManager myVocab) {\n\t\tString queryterm = query.getQuery();\n\t\tint maxScore;\n\t\tif (queryterm.length()<9)\n\t\t\tmaxScore= queryterm.length()-THRESHOLD_LEV;\n\t\telse\n\t\t\tmaxScore = queryterm.length()-(queryterm.length()/THRESHOLD_LEV);\n\t\tArrayList<Result> fuzzyResults = new ArrayList<Result>();\n\t\tfor (int i = 0; i < myVocab.vocab.size(); i++){\n\t\t\tString vocabterm = myVocab.vocab.get(i).trim();\n\t\t\tint distance = levenshteinDistance(vocabterm, queryterm);\n\t\t\t// subtract the distance that's just the length difference\n\t\t\t// to only take into account the character substitution\n\t\t\tdistance = distance - (Math.abs(vocabterm.length() - queryterm.length()));\n\t\t\tif (distance < maxScore){\n\t\t\t\tdouble score;\n\t\t\t\tif (vocabterm.length() < queryterm.length())\n\t\t\t\t\tscore = ((double)(vocabterm.length())/(double)(queryterm.length()+distance))*99;\n\t\t\t\telse\n\t\t\t\t\tscore = (((double)queryterm.length()/(double)(vocabterm.length()+distance)))*99;\n\t\t\t\tfuzzyResults.add(new Result(query.getType()+\"/\"+myVocab.vocab.get(i), myVocab.vocab.get(i), query.getType(),score, false));\n\t\t\t}\n\t\t}\n\t\treturn fuzzyResults;\n\t}", "public String[][] findSuggestions(String w) {\n ArrayList<String> suggestions = new ArrayList<>();\n String word = w.toLowerCase();\n // parse through the word - changing one letter in the word\n for (int i = 0; i < word.length(); i++) {\n // go through each possible character difference\n for (int j = 0; j < Node.NUM_VALID_CHARS; j++) {\n // get the character that will change in the word\n Character c = (char) ((j < 26) ? j + 'a' : '\\'');\n \n // if the selected character is not the same as the character to change - avoids getting the same word as a suggestion\n if (c != word.charAt(i)) {\n // change the character in the word\n String check = word.substring(0, i) + c.toString() + ((i + 1 < word.length()) ? word.substring(i + 1, word.length()) : \"\");\n\n // if the chenged word is in the dictionary, add it to the list of suggestions\n if (this.checkDictionary(check)) {\n suggestions.add(check);\n }\n }\n }\n }\n \n // parse through the word - adding one letter to the word\n for (int i = 0; i < word.length(); i++) {\n // if the loop is not on the last charcater\n if (i < word.length() - 1) {\n // check words with one character added between current element and next element\n for (int j = 0; j < Node.NUM_VALID_CHARS; j++) {\n Character c = (char) ((j < 26) ? j + 'a' : '\\'');\n\n // add the character to the word\n String check = word.substring(0, i) + c.toString() + ((i < word.length()) ? word.substring(i, word.length()) : \"\");\n\n // if the new word is in the dictionary, add it to the list of suggestions\n if (this.checkDictionary(check)) {\n suggestions.add(check);\n }\n }\n }\n // if the loop is on the last character\n else {\n // check the words with one character added to the end of the word\n for (int j = 0; j < Node.NUM_VALID_CHARS; j++) {\n Character c = (char) ((j < 26) ? j + 'a' : '\\'');\n\n // add the character to the word\n String check = word + c;\n\n // if the new word is in the dictionary, add it to the list of suggestions\n if (this.checkDictionary(check)) {\n suggestions.add(check);\n }\n }\n }\n }\n \n // parse through the word - removing one letter from the word\n for (int i = 0; i < word.length(); i++) {\n // remove the chracter at the selected index from the word\n String check = word.substring(0, i) + ((i + 1 < word.length()) ? word.substring(i + 1, word.length()) : \"\");\n\n // if the chenged word is in the dictionary, add it to the list of suggestions\n if (this.checkDictionary(check)) {\n suggestions.add(check);\n }\n }\n \n String[][] rtn = new String[suggestions.size()][1];\n for (int i = 0, n = suggestions.size(); i < n; i++) {\n rtn[i][0] = suggestions.get(i);\n }\n \n return rtn;\n }", "void calculateDistance()\t{\n\t\t\t\t\t\t\t\t\t\n\t\tfor (String substringOne : setOne)\t{\n\t\t\t\tif (setTwo.contains(substringOne))\n\t\t\t\t\toverlapSubstringCount++;\n\t\t}\t\t\t\t\t\t\t\n\n\t\tsubstringCount = (length1 - q) + (length2 - q) + 2 - overlapSubstringCount; \n\t\tdistance = (double)overlapSubstringCount/(substringCount - overlapSubstringCount);\t\n\t}", "public int minDistance(String word1, String word2) {\n int m=word1.length();\n int n=word2.length();\n \n int dp[][]=new int[m+1][n+1];\n \n for(int i=0;i<m+1;i++){\n for(int j=0;j<n+1;j++){\n //if first string is empty then only option is add all chars from second\n if(i==0)\n dp[i][j]=j;\n \n //if second string is empty then only option is remove all chars from 1st\n else if(j==0)\n dp[i][j]=i;\n //do nothing and copy from diagonal ie. ignore \n else if(word1.charAt(i-1)==word2.charAt(j-1))\n dp[i][j]=dp[i-1][j-1];\n else\n {\n //insert , //remove // replace\n dp[i][j]=1+Math.min(dp[i][j-1], Math.min(dp[i-1][j], dp[i-1][j-1]));\n }\n }\n }\n return dp[m][n];\n }", "public Set<String> calculateDistance() throws IOException {\n booleanSearch();\n\n Set<String> words = invertedIndexForQuerryWords.keySet();\n Map<String, Double> tfidfQuerry = new TreeMap<>();\n\n //load idf\n char c='a';\n char prC = 'v';\n for (String word : words){\n c = word.charAt(0);\n if(c != prC) {\n String path = Constants.PATH_TO_IDF + c + \"IDF.idf\";\n prC = c;\n idfMap.putAll(objectMapper.readValue(new File(path), new TypeReference<TreeMap<String, Double>>(){}));\n }\n }\n\n Map<String, Double> distanceMap = new HashMap<>();\n double sum = 0.0;\n //calculez norma interogarii\n for(String word:words){\n double idf, tf;\n if(idfMap.containsKey(word)) {\n idf = idfMap.get(word);\n tf = 1.0 / words.size();\n tfidfQuerry.put(word, tf * idf);\n\n sum += (tf * idf) * (tf * idf);\n } else {\n sum += 0.0;\n }\n }\n\n double normQuerry = Math.sqrt(sum);\n\n //iau toate documentele rezultate din boolean search\n Set<String> docs = new TreeSet<>();\n for(List<MyPair> list : invertedIndexForQuerryWords.values()) {\n if (list != null) {\n docs.addAll(list.stream().map(p -> p.getKey()).collect(Collectors.toSet()));\n }\n }\n\n List<File> documents = FileLoader.getFilesForInternalPath(\"Norms\", \".norm\");\n\n Map<String, Double> norms = new HashMap<>();\n for(File file : documents) {\n norms.putAll(objectMapper.readValue(file, new TypeReference<TreeMap<String, Double>>(){}));\n }\n\n //pentru fiecare document din boolean search calculez distanta cosinus\n for(String doc : docs) {\n\n String fileName = Paths.get(doc).getFileName().toString();\n\n String filePath = Constants.PATH_TO_TF + fileName.replaceFirst(\"[.][^.]+$\", \".tf\");\n\n Map<String, Double> tf = objectMapper.readValue(new File(filePath), new TypeReference<TreeMap<String, Double>>(){});\n double wordTF, wordIDF;\n double vectorialProduct = 0.0;\n double tfidfForQueryWord;\n\n for(String word : words) {\n if (tf.containsKey(word)) {\n wordTF = tf.get(word);\n wordIDF = idfMap.get(word);\n tfidfForQueryWord = tfidfQuerry.get(word);\n\n vectorialProduct += tfidfForQueryWord * wordIDF * wordTF;\n }\n }\n\n double normProduct = normQuerry * norms.get(Paths.get(doc).getFileName().toString());\n\n distanceMap.put(doc, vectorialProduct / normProduct);\n }\n\n //sortare distance map\n distanceMap = distanceMap.entrySet().stream()\n .sorted(Map.Entry.comparingByValue(Collections.reverseOrder()))\n .collect(Collectors.toMap(\n Map.Entry::getKey,\n Map.Entry::getValue,\n (e1, e2) -> e1,\n LinkedHashMap::new));\n\n// System.out.println(\"Cos distance:\");\n// for(Map.Entry entry : distanceMap.entrySet()){\n// System.out.println(entry);\n// }\n\n return distanceMap.keySet();\n }", "public String[] spellchecker(String[] wordlist, String[] queries) {\n String[] wlc = new String[wordlist.length];\n String[] qc = new String[queries.length];\n String[] answer = new String[queries.length];\n int[] priority = new int[answer.length];\n String vowels = \"aeiou\";\n for (int i = 0; i < answer.length; i++) {\n if (qc[i] == null) {\n qc[i] = queries[i].toLowerCase();\n }\n for (int j = 0; j < wlc.length; j++) {\n if (wlc[j] == null) {\n wlc[j] = wordlist[j].toLowerCase();\n }\n if (queries[i].equals(wordlist[j])) {\n //if theyre same word\n answer[i] = wordlist[j];\n priority[i] = 3;\n break;\n } else if (priority[i] < 2 && qc[i].equals(wlc[j])) {\n //if theyre same word, regardless of case use proper word fully\n answer[i] = wordlist[j];\n priority[i] = 2;\n } else if (priority[i] < 1 && qc[i].length() == wlc[j].length()) {\n //if same length, check vowels\n boolean same = true;\n for (int k = 0; k < qc[i].length(); k++) {\n if (vowels.indexOf(qc[i].charAt(k)) == -1) {\n \t// isnt vowel\n if (qc[i].charAt(k) != wlc[j].charAt(k)) {\n same = false;\n break;\n }\n } else {\n \t// is vowel\n if (vowels.indexOf(wlc[j].charAt(k)) == -1) {\n same = false;\n break;\n }\n }\n }\n if (same) {\n answer[i] = wordlist[j];\n priority[i] = 1;\n }\n }\n }\n if (answer[i] == null) {\n answer[i] = \"\";\n }\n }\n return answer;\n }", "public int minDistance(String word1, String word2) {\n if(word1==null||word1.length()==0){\n return word2==null?0:word2.length();\n }else if(word2==null||word2.length()==0){\n return word1.length();\n }else if(word1.equals(word2)){\n return 0;\n }\n char[] str1 = word1.toCharArray();\n char[] str2 = word2.toCharArray();\n int[] oldl = new int[str2.length+1];\n int[] newl = new int[str2.length+1];\n for(int i=0;i<=str2.length;i++){\n oldl[i]=i;\n }\n for(int i=1;i<=str1.length;i++){\n newl[0]=i;\n for(int j=1;j<=str2.length;j++){\n newl[j]=Math.min(oldl[j]+1,newl[j-1]+1);\n if(str1[i-1]!=str2[j-1]){\n newl[j]=Math.min(oldl[j-1]+1,newl[j]);\n }else{\n newl[j]=Math.min(oldl[j-1],newl[j]);\n }\n }\n for(int k=0;k<=str2.length;k++){\n oldl[k]=newl[k];\n }\n }\n return newl[str2.length];\n }", "public int minDistance(String word1, String word2) {\n char[] cs1 = word1.toCharArray();\n char[] cs2 = word2.toCharArray();\n int len1 = cs1.length;\n int len2 = cs2.length;\n // if (len1 * len2 == 0) {\n // return Math.max(len1, len2);\n // }\n int[][] min = new int[len1][len2];\n int m = Integer.MAX_VALUE;\n for (int i = 0; i < len1; i++) {\n for (int j = 0; j < len2; j++) {\n m = Integer.MAX_VALUE;\n m = Math.min(getMinDis(min, i, j - 1) + 1, m);\n m = Math.min(getMinDis(min, i - 1, j) + 1, m);\n m = Math.min(getMinDis(min, i - 1, j - 1)\n + (cs1[i] == cs2[j] ? 0 : 1), m);\n min[i][j] = m;\n }\n }\n return getMinDis(min, len1 - 1, len2 - 1);\n }", "public static int minDistance(String word1, String word2){\n int m = word1.length(), n = word2.length();\n int[][] dp = new int[m+1][n+1];\n\n for (int i = 0; i <= m; i++){\n dp[i][0] = i;\n }\n for (int i = 0; i <= n; i++){\n dp[0][i] = i;\n }\n\n for (int i = 1; i <= m; i++){\n for (int j = 1; j <= n; j++){\n if (word1.charAt(i-1) == word2.charAt(j-1)){\n dp[i][j] = dp[i-1][j-1];\n }else{\n dp[i][j] = Math.min(dp[i-1][j-1], Math.min(dp[i][j-1], dp[i-1][j])) + 1;\n }\n }\n }\n\n return dp[m][n];\n }", "public int shortestWordDistance(String[] words, String word1, String word2) {\n int indexWord1 = -1;\n int indexWord2 = -1;\n boolean flag = word1.equals(word2);\n \n int distance = Integer.MAX_VALUE;\n for (int i = 0; i < words.length; i++) {\n if (words[i].equals(word1)) {\n if(flag){ // 如果两个词相同 则只更新一个index 因为index2之后还会更新一次 相当于排除了之后那个word2的判断\n indexWord1 = indexWord2;\n indexWord2 = i;\n } else {\n indexWord1 = i;\n }\n }\n \n if (words[i].equals(word2)) {\n indexWord2 = i;\n }\n if (indexWord1 >= 0 && indexWord2 >= 0) {\n distance = Math.min(distance, Math.abs(indexWord2 - indexWord1));\n }\n }\n return distance;\n }", "public static int minDistanceIteration(String word1, String word2) {\n\n int m = word1.length();\n int n = word2.length();\n\n //op[i][j] 代表word1[0...i-1]与word2[0...j-1]的编辑距离\n int[][] op = new int[m + 1][n + 1];\n\n for (int i = 0; i <= m; i++) {\n op[i][0] = i;\n }\n\n for (int i = 0; i <=n; i++) {\n op[0][i] = i;\n }\n\n for (int i = 1; i <=m; i++) {\n for (int j = 1; j <=n; j++) {\n if (word1.charAt(i-1) == word2.charAt(j-1)) {\n op[i][j] = op[i-1][j-1];\n } else {\n op[i][j] = Math.min(Math.min(op[i-1][j-1], op[i-1][j]), op[i][j-1]) + 1;\n }\n }\n }\n\n return op[m][n];\n }", "public int minDistance(String word1, String word2) {\n if (word1==null && word2==null)\n return 0;\n if (word1==null)\n return word2.length();\n if (word2==null)\n return word1.length();\n\n int len1 = word1.length()+1;\n int len2 = word2.length()+1;\n int[][] dp = new int[len1][len2];\n for (int i=0; i<len1; i++) {\n dp[i][0] = i;\n }\n for (int j=1; j<len2; j++) {\n dp[0][j] = j;\n }\n for (int i=1; i<len1; i++) {\n char ch1 = word1.charAt(i-1);\n for (int j=1; j<len2; j++) {\n char ch2 = word2.charAt(j-1);\n if (ch1 == ch2) {\n dp[i][j] = dp[i-1][j-1];\n } else {\n int change = dp[i-1][j-1]+1;\n int delete = dp[i-1][j]+1;\n int add = dp[i][j-1]+1;\n int best = change > delete ? delete : change;\n best = best > add ? add : best;\n dp[i][j] = best;\n }\n }\n }\n return dp[len1-1][len2-1];\n }", "public int minDistance(String word1, String word2) {\n\n rows = word1.length() + 1;\n cols = word2.length() + 1;\n dp = new int[rows][cols];\n for (int i = 0; i < rows; i++) {\n dp[i][0] = i;\n }\n for (int i = 0; i < cols; i++) {\n dp[0][i] = i;\n }\n\n for (int i = 1; i < rows; i++) {\n for (int j = 1; j < cols; j++) {\n if (word1.charAt(i - 1) == word2.charAt(j - 1)) {\n dp[i][j] = dp[i - 1][j - 1];\n } else {\n dp[i][j] = 1 + Math.min(dp[i - 1][j - 1], Math.min(dp[i][j - 1], dp[i - 1][j]));\n }\n }\n }\n findPath(dp);\n printPath(dp);\n return dp[rows - 1][cols - 1];\n }", "public BoggleSolver(String[] dictionary) {\n wordsSoFar = new ArrayList<String>();\n // 1. build the trie tree of the dictionary\n dict = new NewTrieSet();\n for (String s : dictionary) {\n if (s.length() >= MIN_WORD_LENGTH)\n dict.add(s);\n }\n }", "public void alignment() {\n\t\toptArray = new int[lenA+1][lenB+1];\n\n\t\t//Initializing the array:\n\t\toptArray[0][0] = 0;\n\t\tfor(int i=1;i<=lenA;i++) {\n\t\t\toptArray[i][0] = i*g;\n\t\t}\n\t\tfor(int j=1;j<=lenB;j++) {\n\t\t\toptArray[0][j] = j*g;\n\t\t}\n\n\t\t//Starting the 'recurrsion':\n\t\tint p;\n\t\tString pair;\n\t\tfor(int i=1;i<=lenA;i++) {\n\t\t\tfor(int j=1;j<=lenB;j++) {\n\t\t\t\tpair = wordA.charAt(i-1) + \" \" + wordB.charAt(j-1);\n\t\t\t\tp = penaltyMap.get(pair);\n\t\t\t\toptArray[i][j] = min(p+optArray[i-1][j-1], g+optArray[i-1][j], g+optArray[i][j-1]);\n\t\t\t}\n\t\t}\n\t}", "public static int shortestWordDistanceIII(String[] words, String word1, String word2) {\n\t\tint dist = Integer.MAX_VALUE;//words.length;\n\t\tint i1 = -dist; //i1 记录当前最近的word1的位置\n\t\tint i2 = dist;//i2 记录当前最近的word2的位置\n//\t\tint i1 = -1; //i1 记录当前最近的word1的位置\n//\t\tint i2 = -1;//i2 记录当前最近的word2的位置\n\n\t\tfor (int i = 0; i < words.length; i++) {\n\t\t\tif (words[i].equals(word1)) {\n\t\t\t\ti1 = i; //i1 记录当前最近的word1\n\t\t\t}\n\t\t\tif (words[i].equals(word2)) {\n\t\t\t\tif (word1.equals(word2)) {\n\t\t\t\t\ti1 = i2;\n\t\t\t\t}\n\t\t\t\ti2 = i;\n\t\t\t}\n\t\t\tdist = Math.min(dist, Math.abs(i1 - i2));\n\t\t\tprint(\"i1:i2:dist\", i1, i2, dist);\n\t\t}\n\t\treturn (int) dist;\n\t}", "private static int editDistance(String str1, String str2)\n {\n // if either of the strings is null, distance cannot be computed\n if (str1 == null || str2 == null)\n {\n return -1; // indicates error input\n }\n \n // all values are by default initialized to 0 by JVM\n int[][] distanceTable = new int[str1.length()+1][str2.length()+1];\n \n int numRows = str1.length() + 1;\n int numCols = str2.length() + 1;\n \n for (int m = 0; m < numRows; m++)\n {\n for (int n = 0; n < numCols; n++)\n {\n // if length of str1 is 0, we have no option but to insert all of str2 \n if (m == 0)\n {\n distanceTable[m][n] = n;\n }\n \n // if length of str2 is 0, delete all of str1 of make it match with str2\n else if (n == 0)\n {\n distanceTable[m][n] = m;\n }\n \n /*\n * if last characters of str1 and str2 are equal, compute distance ending at\n * second last characters for both str1 and str2 \n */\n else if (str1.charAt(m-1) == str2.charAt(n-1))\n {\n distanceTable[m][n] = distanceTable[m-1][n-1]; \n }\n \n /*\n * else use minimum of following three cases:\n * delete last character of str1 and check distance: distance(str1, str2, m-1, n)\n * insert last character of str2 into str1 and check distance: distance(str1, str2, m, n-1)\n * replace last char of str1 with last char of str2 and check distance: distance(str1, str2, m-1, n-1) \n */\n else\n {\n distanceTable[m][n] = min (\n 1 + distanceTable[m-1][n],\n 1 + distanceTable[m][n-1],\n 1 + distanceTable[m-1][n-1]\n );\n }\n }\n }\n \n return distanceTable[numRows-1][numCols-1];\n }", "public void ComputeSimilarity() {\n\t\t\n\t\t//first construct the vector space representations for these five reviews\n\t\t// the our smaples vector, finally get the similarity metric \n\t\tanalyzequery(LoadJson(\"./data/samples/query.json\"));\n\t\n\t\t\n\t\tHashMap<String, Double> Similarity = new HashMap<String, Double>();\n\n\t\tfor (int i = 0; i < m_reviews.size(); i++) {\n\t\t\tString content = m_reviews.get(i).getContent();\n\n\t\t\tHashMap<String, Integer> conunttf = new HashMap<String, Integer>();\n\n\t\t\tHashSet<String> biminiset = new HashSet<String>();\n \n\t\t\t//danci means word unit: one or two words\n\t\t\tArrayList danci = new ArrayList();\n\n\t\t\tfor (String token : tokenizer.tokenize(content)) {\n\t\t\t\tif (m_stopwords.contains(token))\n\t\t\t\t\tcontinue;\n\t\t\t\tif (token.isEmpty())\n\t\t\t\t\tcontinue;\n\n\t\t\t\tdanci.add(PorterStemmingDemo(SnowballStemmingDemo(NormalizationDemo(token))));\n\n\t\t\t}\n \n\t\t\t//get word count in a document\n\t\t\tfor (int k = 0; k < danci.size(); k++) {\n\n\t\t\t\tif (conunttf.containsKey(danci.get(k).toString())) {\n\t\t\t\t\tconunttf.put(danci.get(k).toString(),\n\t\t\t\t\t\t\tconunttf.get(danci.get(k).toString()) + 1);\n\t\t\t\t} else {\n\t\t\t\t\tconunttf.put(danci.get(k).toString(), 1);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tArrayList<String> N_gram = new ArrayList<String>();\n\n\t\t\tfor (String token : tokenizer.tokenize(content)) {\n\n\t\t\t\ttoken = PorterStemmingDemo(SnowballStemmingDemo(NormalizationDemo(token)));\n\t\t\t\tif (token.isEmpty()) {\n\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\n\t\t\t\t\tN_gram.add(token);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tString[] fine = new String[N_gram.size()];\n \n\t\t\t//get rid of stopwords\n\t\t\tfor (int p = 0; p < N_gram.size() - 1; p++) {\n\t\t\t\tif (m_stopwords.contains(N_gram.get(p)))\n\t\t\t\t\tcontinue;\n\t\t\t\tif (m_stopwords.contains(N_gram.get(p + 1)))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tfine[p] = N_gram.get(p) + \"-\" + N_gram.get(p + 1);\n\n\t\t\t}\n\n\t\t\t\n\t\t\tfor (String str2 : fine) {\n\n\t\t\t\tif (conunttf.containsKey(str2)) {\n\t\t\t\t\tconunttf.put(str2, conunttf.get(str2) + 1);\n\t\t\t\t} else {\n\t\t\t\t\tconunttf.put(str2, 1);\n\t\t\t\t}\n\t\t\t}\n \n\t\t\t//compute tf * idf for each document\n\t\t\tfor (String key : conunttf.keySet()) {\n\t\t\t\tif (m_stats.containsKey(key)) {\n\t\t\t\t\tdouble df = (double) m_stats.get(key);\n\n\t\t\t\t\tdouble idf = (1 + Math.log(102201 / df));\n\n\t\t\t\t\tdouble tf = conunttf.get(key);\n\n\t\t\t\t\tdouble result = tf * idf;\n\n\t\t\t\t\tm_idf.put(key, result);\n\t\t\t\t} else {\n\t\t\t\t\tm_idf.put(key, 0.0);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t\n\n\t\t\tHashMap<String, Double> query = new HashMap<String, Double>();\n\t\t\tHashMap<String, Double> test = new HashMap<String, Double>();\n \n\t\t\t//If query contains this word, store it for future computation \n\t\t\tfor (Map.Entry<String, Double> entry : m_idf.entrySet()) {\n\t\t\t\tString key = entry.getKey();\n\t\t\t\tif (query_idf.containsKey(key)) {\n\t\t\t\t\tquery.put(key, query_idf.get(key));\n\t\t\t\t\ttest.put(key, m_idf.get(key));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdouble dotProduct = 0.00;\n\t\t\tdouble magnitude1 = 0.0;\n\t\t\tdouble magnitude2 = 0.0;\n\t\t\tdouble magnitude3 = 0.0;\n\t\t\tdouble magnitude4 = 0.0;\n\t\t\tdouble cosineSimilarity = 0;\n \n\t\t\t\n\t\t\t//compute Compute similarity between query document and each document in file\n\t\t\tfor (String cal : test.keySet()) {\n\t\t\t\tdotProduct += query.get(cal) * test.get(cal); // a.b\n\t\t\t\tmagnitude1 += Math.pow(query.get(cal), 2); // (a^2)\n\t\t\t\tmagnitude2 += Math.pow(test.get(cal), 2); // (b^2)\n\n\t\t\t\tmagnitude3 = Math.sqrt(magnitude1);// sqrt(a^2)\n\t\t\t\tmagnitude4 = Math.sqrt(magnitude2);// sqrt(b^2)\n\t\t\t}\n\n\t\t\tif (magnitude3 != 0.0 | magnitude4 != 0.0)\n\t\t\t\tcosineSimilarity = dotProduct / (magnitude3 * magnitude4);\n\n\t\t\telse\n\t\t\t\tcosineSimilarity = 0;\n\n\t\t\tSimilarity.put(content, cosineSimilarity);\n\n\t\t\t\t\t\n\n\t\t}\n\n\t\t// sort output to get 3 reviews with the highest similarity with query review\n\t\tList<Map.Entry<String, Double>> infoIds = new ArrayList<Map.Entry<String, Double>>(\n\t\t\t\tSimilarity.entrySet());\n\n\t\tCollections.sort(infoIds, new Comparator<Map.Entry<String, Double>>() {\n\t\t\tpublic int compare(Map.Entry<String, Double> o1,\n\t\t\t\t\tMap.Entry<String, Double> o2) {\n\t\t\t\treturn (int) (o1.getValue() - o2.getValue());\n\t\t\t}\n\t\t});\n\n\t\tfor (int i = infoIds.size() - 1; i > infoIds.size() - 4; i--) {\n\t\t\tEntry<String, Double> ent = infoIds.get(i);\n\t\t\tSystem.out.println(ent.getValue()+\"++\"+ent.getKey()+\"\\n\");\n\n\t\t}\n\n\t}", "public int minDistance(String word1, String word2) {\n int N=word1.length(), M=word2.length();\n int[][] dp = new int[N+1][M+1];\n for (int i=0; i<=N; i++) dp[i][0]=i;\n for (int j=0; j<=M; j++) dp[0][j]=j;\n for (int i=1; i<=N; i++) {\n for (int j=1; j<=M; j++) {\n if (word1.charAt(i-1)==word2.charAt(j-1)) {\n dp[i][j]=dp[i-1][j-1];\n } else {\n dp[i][j]=Math.min(dp[i-1][j], dp[i][j-1]) + 1;\n }\n }\n }\n return dp[N][M];\n }", "private Map<String, Double> distance1Generation(String word) {\n if (word == null || word.length() < 1) throw new RuntimeException(\"Input words Error: \" + word);\n\n Map<String, Double> result = new HashMap<String, Double>();\n\n String prev;\n String last;\n\n for (int i = 0; i < word.length(); i++) {\n // Deletion\n prev = word.substring(0, i);\n last = word.substring(i + 1, word.length());\n result.put(prev + last, 1.0);\n\n // transposition\n if ((i + 1) < word.length()) {\n prev = word.substring(0, i);\n last = word.substring(i + 2, word.length());\n String trans = prev + word.charAt(i + 1) + word.charAt(i) + last;\n result.put(trans, 1.0);\n }\n\n // alter\n prev = word.substring(0, i);\n last = word.substring(i + 1, word.length());\n for (int j = 0; j < 26; j++) {\n result.put(prev + (char) (j + 97) + last, 1.0);\n }\n\n // insertion\n prev = word.substring(0, i);\n last = word.substring(i + 1, word.length());\n for (int j = 0; j < 26; j++) {\n result.put(prev + (char) (j + 97) + word.charAt(i) + last, 1.0);\n result.put(prev + word.charAt(i) + (char) (j + 97) + last, 1.0);\n }\n\n }\n\n result.remove(word);\n return result;\n }", "private int calculateLevenshtein(String lhs, String rhs) {\n\t\tint len0 = lhs.length() + 1; \n\t int len1 = rhs.length() + 1; \n\t \n\t // the array of distances \n\t int[] cost = new int[len0]; \n\t int[] newcost = new int[len0]; \n\t \n\t // initial cost of skipping prefix in String s0 \n\t for (int i = 0; i < len0; i++) cost[i] = i; \n\t \n\t // dynamically computing the array of distances \n\t \n\t // transformation cost for each letter in s1 \n\t for (int j = 1; j < len1; j++) { \n\t // initial cost of skipping prefix in String s1 \n\t newcost[0] = j; \n\t \n\t // transformation cost for each letter in s0 \n\t for(int i = 1; i < len0; i++) { \n\t // matching current letters in both strings \n\t int match = (lhs.charAt(i - 1) == rhs.charAt(j - 1)) ? 0 : 1; \n\t \n\t // computing cost for each transformation \n\t int cost_replace = cost[i - 1] + match; \n\t int cost_insert = cost[i] + 1; \n\t int cost_delete = newcost[i - 1] + 1; \n\t \n\t // keep minimum cost \n\t newcost[i] = Math.min(Math.min(cost_insert, cost_delete), cost_replace);\n\t } \n\t \n\t // swap cost/newcost arrays \n\t int[] swap = cost; cost = newcost; newcost = swap; \n\t } \n\t \n\t // the distance is the cost for transforming all letters in both strings \n\t return cost[len0 - 1]; \n }", "private static final int weightedLevenshteinDistance(String str1,\n \t\t\tString str2) {\n \t\tint[][] distances = new int[str1.length() + 1][str2.length() + 1];\n \n \t\tfor (int i = 0; i < str1.length() + 1; i++) {\n \t\t\tdistances[i][0] = i;\n \t\t}\n \n \t\tfor (int j = 1; j < str2.length() + 1; j++) {\n \t\t\tdistances[0][j] = j;\n \t\t}\n \n \t\tfor (int i = 1; i < str1.length() + 1; i++) {\n \t\t\tfor (int j = 1; j < str2.length() + 1; j++) {\n \t\t\t\tdistances[i][j] = getKeyDistance(str1.charAt(0), str2.charAt(0))\n \t\t\t\t\t\t+ Math.min(\n \t\t\t\t\t\t\t\tdistances[i - 1][j - 1]\n \t\t\t\t\t\t\t\t\t\t+ (str1.charAt(i - 1) == str2\n \t\t\t\t\t\t\t\t\t\t\t\t.charAt(j - 1) ? 0 : 1), Math\n \t\t\t\t\t\t\t\t\t\t.min(distances[i - 1][j] + 1,\n \t\t\t\t\t\t\t\t\t\t\t\tdistances[i][j - 1] + 1));\n \t\t\t}\n \t\t}\n \n \t\treturn distances[str1.length()][str2.length()];\n \t}", "public int shortest(String word1, String word2) {\n List<Integer> first = map.get(word1);\n List<Integer> second = map.get(word2);\n int result = Integer.MAX_VALUE ;\n for(int i = 0, j = 0 ; i < first.size() && j < second.size();)\n result = first.get(i) < second.get(j) ? Math.min(result,second.get(j) - first.get(i++)) : Math.min(result,first.get(i) - second.get(j++)) ;\n return result;\n }", "private static int levenshteinDistance(String vocabTerm, String queryTerm){\n\t\tint dMatrix[][]= new int[vocabTerm.length()+1][queryTerm.length()+1];\n\t\t\n\t\tfor (int i = 0; i<vocabTerm.length()+1; i++){\n\t\t\tdMatrix[i][0]=i;\n\t\t}\n\t\tfor (int i = 0; i<queryTerm.length()+1; i++){\n\t\t\tdMatrix[0][i]=i;\n\t\t}\n\t\tfor (int i = 1; i < queryTerm.length()+1; i++){\n\t\t\tfor (int j= 1; j < vocabTerm.length()+1; j++){\n\t\t\t\tif (vocabTerm.charAt(j-1)==queryTerm.charAt(i-1)){\n\t\t\t\t\tdMatrix[j][i]=dMatrix[j-1][i-1];\n\t\t\t\t}else{\n\t\t\t\t\tdMatrix[j][i]=min(dMatrix[j-1][i-1], dMatrix[j][i-1], dMatrix[j-1][i]) +1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn dMatrix[vocabTerm.length()][queryTerm.length()];\n\t}", "private static Word getShortestTransformation(String startWord, String endWord, Set<String> dictionary) {\n\n if (dictionary.contains(startWord) && dictionary.contains(endWord)) {\n\n List<String> shortestPath = new LinkedList<String>();\n shortestPath.add(startWord);\n\n Queue<Word> queue = new LinkedList<Word>();\n\n // adding start wor d to queue\n queue.add(new Word(shortestPath, 0, startWord));\n\n // begin with start word and remove from dictionary to avoid visiting again the same word\n dictionary.remove(startWord);\n\n // queue iteration until queue is empty or found end word.\n while (!queue.isEmpty() && !queue.peek().equals(endWord)) {\n Word ladder = queue.remove();\n\n if (endWord.equals(ladder.setStartWord())) {\n return ladder;\n }\n\n Iterator<String> i = dictionary.iterator();\n while (i.hasNext()) {\n String string = i.next();\n\n if (letterDifferByOne(string, ladder.setStartWord())) {\n\n List<String> list = new LinkedList<String>(ladder.getTransformationPath());\n list.add(string);\n\n // letter difference between the two words is 1, add that to queue for iteration\n queue.add(new Word(list, ladder.getPathLength() + 1, string));\n System.out.print(\"values in queue\" + queue.element().toString());\n\n\n i.remove();\n }\n }\n }\n\n // returns the head of the node but do not remove from the queue\n if (!queue.isEmpty()) {\n return queue.peek();\n\n }\n }\n\n return null;\n }", "public int minDistance_LCS(String word1, String word2) {\n int N=word1.length(), M=word2.length();\n int[][] dp = new int[N+1][M+1];\n for (int i=1; i<=N; i++) {\n for (int j=1; j<=M; j++) {\n if (word1.charAt(i-1)==word2.charAt(j-1)) {\n dp[i][j]=dp[i-1][j-1]+1;\n } else {\n dp[i][j]=Math.max(dp[i-1][j], dp[i][j-1]);\n }\n }\n }\n return N+M-2*dp[N][M];\n }", "int partDist(String w1, String w2, int w1len, int w2len) {\n // To remember previous state\n int [][] matrix = new int [w1len + 1][w2len +1];\n for(int i = 0; i <= w1len; i++){\n for(int j = 0; j <= w2len; j++){\n // If word 1 is empty\n if(i == 0)\n matrix[i][j] = j;\n // If word 2 is empty\n else if(j == 0)\n matrix[i][j] = i;\n\n // if the previous letter are the same\n else if(w1.charAt(i-1) == w2.charAt(j-1))\n matrix[i][j] = matrix[i-1][j-1];\n /*\n remove one letter matrix[i][j-1]\n add one letter matrix[i-1][j]\n change letter matrix[i-1][j-1]\n */\n else\n matrix[i][j] = 1 + min(matrix[i][j-1], matrix[i-1][j], matrix[i-1][j-1]);\n }\n }\n\n return matrix[w1len][w2len];\n }", "public BoggleSolver(final String[] dictionary) {\n inputdict = new TrieST();\n for (int i = 0; i < dictionary.length; i++) {\n inputdict.add(dictionary[i]);\n }\n // validwords = new HashSet<>();\n }", "public static void docWtgArray() {\n int docCount = 0;\n\n while(docCount<totaldocument) {\n List<Double> pass = new ArrayList();\n for(Entry<String,List<Double>> entry : wtgMap.entrySet()) {\n List<Double> docList = new ArrayList();\n docList = entry.getValue();\n double temp = docList.get(docCount);\n pass.add(temp);\n }\n\n double answer = CosineSimilarity(pass,query);\n if(answer >= alpha) {\n DocID.put(docCount,answer);\n }\n docCount++;\n }\n }", "public Map<String, WordImageRelevaces> calculateImageWordRelevanceCompact(\r\n\t\t\tMap<String, WordImage> wordImageRel) {\r\n\r\n\t\tMap<String, WordImageRelevaces> wordImgRelevance = new HashMap<String, WordImageRelevaces>();\r\n\r\n\t\tdouble IuWTotal1 = 0; // The normalization factor\r\n\t\tdouble IuWTotal2 = 0; // The normalization factor\r\n\t\tdouble IuWTotal3 = 0; // The normalization factor\r\n\t\tdouble IuWTotal4 = 0; // The normalization factor\r\n\t\tdouble IuWTotal5 = 0; // The normalization factor\r\n\t\tdouble IuWTotal6 = 0; // The normalization factor\r\n\r\n\t\tint index = 0;\r\n\r\n\t\tdouble IuWSingle1[] = new double[wordImageRel.size()];\r\n\t\tdouble IuWSingle2[] = new double[wordImageRel.size()];\r\n\t\tdouble IuWSingle3[] = new double[wordImageRel.size()];\r\n\t\tdouble IuWSingle4[] = new double[wordImageRel.size()];\r\n\t\tdouble IuWSingle5[] = new double[wordImageRel.size()];\r\n\t\tdouble IuWSingle6[] = new double[wordImageRel.size()];\r\n\r\n\t\tfor (String word : wordImageRel.keySet()) { // For each word\r\n\r\n\t\t\tWordImage wordImage = wordImageRel.get(word);\r\n\t\t\tdouble PcjW = wordImage.getImageProbability();\r\n\r\n\t\t\tdouble Pw1 = wordImage.getPwOnlyWords();\r\n\t\t\tdouble Pw2 = wordImage.getPwAllUsers();\r\n\t\t\tdouble Pw3 = wordImage.getPwOnlyUniqueUsers();\r\n\t\t\tdouble Pw4 = wordImage.getPwTFIDFlOnlyWords();\r\n\t\t\tdouble Pw5 = wordImage.getPwTFIDFlAllUsers();\r\n\t\t\tdouble Pw6 = wordImage.getPwTFIDFOnlyUniqueUsers();\r\n\r\n\t\t\tint C = totalNumberOfImages;\r\n\t\t\tint R = totalNumberOfSimilarImages;\r\n\t\t\tint Rw = wordImageRel.get(word).getSimlarImages().size();\r\n\t\t\tint Lw = wordImageRel.get(word).getOcurrances();\r\n\r\n\t\t\tSet<String> imgIDs = wordImage.getSimilarImageIDs(); // Get images\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// related\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// to that\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// word\r\n\r\n\t\t\tfor (String imgID : imgIDs) {\r\n\r\n\t\t\t\tdouble PIc = wordImage.getSimilarImage(imgID)\r\n\t\t\t\t\t\t.getPointSimilarity();\r\n\r\n\t\t\t\tIuWSingle1[index] += Pw1 * PcjW * PIc;\r\n\t\t\t\tIuWSingle2[index] += Pw2 * PcjW * PIc;\r\n\t\t\t\tIuWSingle3[index] += Pw3 * PcjW * PIc;\r\n\t\t\t\tIuWSingle4[index] += Pw4 * PcjW * PIc;\r\n\t\t\t\tIuWSingle5[index] += Pw5 * PcjW * PIc;\r\n\t\t\t\tIuWSingle6[index] += Pw6 * PcjW * PIc;\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// Normalise\r\n\t\t\tWordImageRelevaces wImgRels = new WordImageRelevaces();\r\n\t\t\twImgRels.setFreqRelOnlyWords(IuWSingle1[index]);\r\n\t\t\twImgRels.setFreqRelWordsAndAllUsers(IuWSingle2[index]);\r\n\t\t\twImgRels.setFreqRelWordAndOnlyUniqueUsers(IuWSingle3[index]);\r\n\t\t\twImgRels.setTfIdfRelOnlyWords(IuWSingle4[index]);\r\n\t\t\twImgRels.setTfIdfRelWordsAndAllUsers(IuWSingle5[index]);\r\n\t\t\twImgRels.setTfIdfRelWordAndOnlyUniqueUsers(IuWSingle6[index]);\r\n\r\n\t\t\twordImgRelevance.put(word, wImgRels); // unnormalized value\r\n\r\n\t\t\tIuWTotal1 += IuWSingle1[index];\r\n\t\t\tIuWTotal2 += IuWSingle2[index];\r\n\t\t\tIuWTotal3 += IuWSingle3[index];\r\n\t\t\tIuWTotal4 += IuWSingle4[index];\r\n\t\t\tIuWTotal5 += IuWSingle5[index];\r\n\t\t\tIuWTotal6 += IuWSingle6[index];\r\n\r\n\t\t\tindex++;\r\n\t\t}\r\n\r\n\t\tfor (String word : wordImgRelevance.keySet()) {\r\n\r\n\t\t\tdouble notNormalizedValue1 = wordImgRelevance.get(word)\r\n\t\t\t\t\t.getFreqRelOnlyWords();\r\n\t\t\twordImgRelevance.get(word).setFreqRelOnlyWords(\r\n\t\t\t\t\tnotNormalizedValue1 / IuWTotal1);\r\n\r\n\t\t\tdouble notNormalizedValue2 = wordImgRelevance.get(word)\r\n\t\t\t\t\t.getFreqRelWordsAndAllUsers();\r\n\t\t\twordImgRelevance.get(word).setFreqRelWordsAndAllUsers(\r\n\t\t\t\t\tnotNormalizedValue2 / IuWTotal2);\r\n\r\n\t\t\tdouble notNormalizedValue3 = wordImgRelevance.get(word)\r\n\t\t\t\t\t.getFreqRelWordAndOnlyUniqueUsers();\r\n\t\t\twordImgRelevance.get(word).setFreqRelWordAndOnlyUniqueUsers(\r\n\t\t\t\t\tnotNormalizedValue3 / IuWTotal3);\r\n\r\n\t\t\tdouble notNormalizedValue4 = wordImgRelevance.get(word)\r\n\t\t\t\t\t.getTfIdfRelOnlyWords();\r\n\t\t\twordImgRelevance.get(word).setTfIdfRelOnlyWords(\r\n\t\t\t\t\tnotNormalizedValue4 / IuWTotal4);\r\n\r\n\t\t\tdouble notNormalizedValue5 = wordImgRelevance.get(word)\r\n\t\t\t\t\t.getTfIdfRelWordsAndAllUsers();\r\n\t\t\twordImgRelevance.get(word).setTfIdfRelWordsAndAllUsers(\r\n\t\t\t\t\tnotNormalizedValue5 / IuWTotal5);\r\n\r\n\t\t\tdouble notNormalizedValue6 = wordImgRelevance.get(word)\r\n\t\t\t\t\t.getTfIdfRelWordAndOnlyUniqueUsers();\r\n\t\t\twordImgRelevance.get(word).setTfIdfRelWordAndOnlyUniqueUsers(\r\n\t\t\t\t\tnotNormalizedValue6 / IuWTotal6);\r\n\r\n\t\t}\r\n\t\treturn wordImgRelevance;\r\n\r\n\t}", "public static int editDistance4(String s1, String s2) {\r\n\t\tint m = s1.length();\r\n\t\tint n = s2.length();\r\n\t\tint[][] mem = new int[m + 1][n + 1];\r\n\t\tfor (int j = 0; j <= n; ++j) \r\n\t\t\tmem[m][j] = n-j;\r\n\t\tfor (int i = 0; i <= m; ++i) \r\n\t\t\tmem[i][n] = m-i;\r\n\r\n\t\tfor (int i = m - 1; i >= 0; --i) {\r\n\t\t\tfor (int j = n - 1; j >= 0; --j) {\r\n\t\t\t\tif (s1.charAt(i) != s2.charAt(j)) {\r\n\t\t\t\t\tint rcost = mem[i + 1][j + 1];\r\n\t\t\t\t\tint icost = mem[i][j + 1];\r\n\t\t\t\t\tint dcost = mem[i + 1][j];\r\n\t\t\t\t\tmem[i][j] = Math.min(dcost, Math.min(rcost, icost)) + 1;\r\n\t\t\t\t} else \r\n\t\t\t\t\tmem[i][j] = mem[i + 1][j + 1];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn mem[0][0];\r\n\t}", "public int minDistance(String word1, String word2) {\n int[][] mem = new int[word1.length() + 1][word2.length() + 1];\n for (int[] row : mem) Arrays.fill(row, -1);\n mem[word1.length()][word2.length()] = 0;\n return minDist(word1, 0, word2, 0, mem);\n }", "public static int editDistance(String s1, String s2){\n int m=s1.length();\n int n=s2.length();\n int[][] dp=new int[m+1][n+1];\n for(int i=0;i<=m;i++){\n dp[i][0]=i;\n }\n for(int j=0;j<=n;j++){\n dp[0][j]=j;\n }\n for(int i=1;i<=m;i++){\n for(int j=1;j<=n;j++){\n if(s1.charAt(m-i)==s2.charAt(n-j)){\n dp[i][j]=dp[i-1][j-1];\n }\n else{\n dp[i][j]=1+Math.min(dp[i-1][j-1],Math.min(dp[i][j-1],dp[i-1][j]));\n }\n }\n \n }\n int res=dp[m][n];\n return res;\n\n\t}", "public interface DictionaryCorrectior {\n\n\t/**\n\t * get correction word that have the most possibility from the misspelled text\n\t * @author liyuan\n\t * \n\t */\n\tpublic String getCorrectionWord(String misspell);\n\t\n\t\n\t\n\t/**\n\t * get a list of correction words from the misspelled text\n\t * @author liyuan\n\t * \n\t */\n\tpublic String[] getCorrectionList(String misspell);\n}", "public void computeWords(){\n\n loadDictionary();\n\n CharacterGrid characterGrid = readCharacterGrid();\n\n Set<String> wordSet = characterGrid.findWordMatchingDictionary(dictionary);\n\n System.out.println(wordSet.size());\n for (String word : wordSet) {\n\t System.out.println(word);\n }\n\n // System.out.println(\"Finish scanning character grid in \" + (System.currentTimeMillis() - startTime) + \" ms\");\n }", "public void updateWordPoints() {\n for (String word: myList.keySet()) {\n int wordValue = 0;\n for (int i = 0; i < word.length(); i++) {\n // gets individual characters from word and\n // from that individual character get the value from scrabble list\n int charValue = scrabbleList.get(word.toUpperCase().charAt(i));\n // add character value gotten from character key from scrabble map to word value\n wordValue = wordValue + charValue;\n }\n\n // update the value of the word in myList map\n myList.put(word, wordValue);\n }\n }", "private static int editDistance(String a, String b) {\n int m = a.length() + 1, n = b.length() + 1;\n int[] dists = new int[m], newDists = new int[m];\n for (int i = 0; i < m; i++) dists[i] = i;\n for (int j = 1; j < n; j++) {\n newDists[0] = j;\n for (int i = 1; i < m; i++) {\n newDists[i] = Math.min(Math.min(\n dists[i] + 1, // Insert\n newDists[i-1] + 1), // Delete\n dists[i-1] + (a.charAt(i-1) == b.charAt(j-1) ? 0 : 1)); // Replace\n }\n int[] swap = dists; dists = newDists; newDists = swap;\n }\n return dists[m-1];\n }", "private void normalizeDictionary() {\n\t\t\n\t\tCollections.sort(idfValues, Collections.reverseOrder());\n\t\tCollections.sort(idf2Values, Collections.reverseOrder());\n\t\tDouble maxIDF=idfValues.get(0)==0.0?1.0:idfValues.get(0);\n\t\tDouble maxIDF2=idf2Values.get(0)==0.0?1.0:idf2Values.get(0);\t\n\t\tfor (int i = 0; i < getTfMapArrayIDF().size(); i++) {\n\t\t\tList<Map<String,List<Double>>> gestureDocument = getTfMapArrayIDF().get(i);\n\t\t\tfor (int j = 0; j < gestureDocument.size(); j++) {\n\t\t\t\tMap<String,List<Double>> tempMap = gestureDocument.get(j);\n\t\t\t\tIterator<Entry<String, List<Double>>> it = tempMap.entrySet().iterator();\n\t\t\t\t while (it.hasNext()) {\n\t\t\t\t Map.Entry<String,List<Double>> pairs = (Map.Entry)it.next();\n\t\t\t\t \t//normalize tf-idf\n\t\t\t\t \tpairs.getValue().set(3, pairs.getValue().get(3)/maxIDF);\n\t\t\t\t \t//normalize tf-idf2\n\t\t\t\t \tpairs.getValue().set(4, pairs.getValue().get(4)/maxIDF2);\n\t\t\t\t }\n\t\t\t}\n\t\t}\n\t}", "private static void buildTrainingSet(ArrayList<ArrayList<String>> posTrainSet, HashMap<String, Integer> hashMap1,\r\n\t\t\tHashMap<String, Integer> hashMap2)\r\n\t{\n\tfor (ArrayList<String> currentReview : posTrainSet) \r\n\t{ \t\r\n\t \t\r\n \tint negation = 0;\r\n \t\r\n \tfor(String word : currentReview)\r\n {\r\n \t\t//ADD OTHER NEGATIVE WORDS.ALSO CONSIDER NOT ONLY AND NEITHER NOR\r\n \tif(word.equals(\"not\") || word.equals(\"but\") || word.equals(\"no\") || word.equals(\"never\"))\r\n \t{\r\n \t\tnegation = 1- negation;\r\n \t}\r\n \telse if(word.equals(\".\"))\r\n \t{\r\n \t\tnegation =0;\r\n \t}\r\n \telse if(negation == 0)\r\n \t{\r\n \t\tInteger count = hashMap1.get(word);\r\n \t\t if (count == null) {\r\n \t\t count = 0;\r\n \t\t }\r\n \t\t hashMap1.put(word, count + 1);\r\n \t\t \r\n \t\t //ADD TO NEGATIVE NOT_WORD\r\n \t\t String negForm = \"NOT_\"+ word;\r\n \t\t count = hashMap2.get(negForm);\r\n \t\t if (count == null) {\r\n \t\t count = 0;\r\n \t\t }\r\n \t\t hashMap2.put(negForm, count + 1);\r\n \t\t \r\n \t}\r\n \telse\r\n \t{\r\n \t\tString negForm = \"NOT_\"+ word;\r\n \t\tInteger count = hashMap1.get(negForm);\r\n \t\t if (count == null) {\r\n \t\t count = 0;\r\n \t\t }\r\n \t\t hashMap1.put(negForm, count + 1);\r\n \t}\r\n \t\r\n }\r\n\t\r\n }\r\n\t}", "private void computeDistances() {\n for (int i = 0; i < groundTruthInstant.size(); ++i)\n for (int j = 0; j < estimatedInstant.size(); ++j) {\n float currentDist = groundTruthInstant.get(i).getDistanceTo(estimatedInstant.get(j).getPos());\n if (currentDist < distToClosestEstimate[i][0]) {\n distToClosestEstimate[i][0] = currentDist;\n distToClosestEstimate[i][1] = j;\n }\n }\n }", "public static int minLength(String[] words) {\n ArrayList<String> minimized = new ArrayList<>();\n int len = words[0].length() + 1;\n minimized.add(words[0]);\n\n for (int i = 1; i < words.length; i++) {\n for (int j = 0; j < minimized.size(); j++) {\n if (encoded(minimized.get(j), words[i])) {\n break;\n }\n if (encoded(words[i], minimized.get(j))) {\n len -= minimized.get(j).length();\n minimized.remove(j);\n\n len += words[i].length();\n minimized.add(words[i]);\n break;\n }\n\n if (j == minimized.size() - 1) {\n minimized.add(words[i]);\n len += (words[i].length() + 1);\n break;\n }\n }\n }\n\n return len;\n }", "public int calcDistance(String wordOne, String wordTwo) {\n int [][]table = new int[wordOne.length()][wordTwo.length()];\n for (int i = 0; i < wordOne.length(); ++i) {\n for (int j = 0; j < wordTwo.length(); ++j) {\n table[i][j] = -1;\n }\n }\n\n return calcDistanceRecursive(wordOne.length()-1, wordTwo.length()-1, wordOne.toCharArray(), wordTwo.toCharArray(), table);\n }", "public static void main(String[] args) throws NoSimilarWordFoundException, IOException {\n\t\t\n\t\tString dictionaryFileName = args[0];\n\t\tString inputWord = args[1];\n\t\t\n\t\t/**\n\t\t * Create an instance of your corrector here\n\t\t */\n\t\tSpellCorrector corrector = new SpellingCorrector();\n Trie trie1 = new Words();\n\n trie1.add(\"bob\");\n trie1.add(\"karen\");\n trie1.add(\"smith\");\n trie1.add(\"smal\");\n\n Trie trie2 = new Words();\n\n trie2.add(\"bob\");\n trie2.add(\"karen\");\n trie2.add(\"smith\");\n trie2.add(\"smab\");\n\n boolean test = trie1.equals(trie2);\n\n System.out.println(test);\n\n\t\tcorrector.useDictionary(dictionaryFileName);\n\n\t\tString suggestion = corrector.suggestSimilarWord(inputWord);\n\t\t\n\t\tSystem.out.println(\"Suggestion is: \" + suggestion);\n\t}", "public int calWord() {\n for(int i = 0; i < newWord.length(); i++) {\n for (String c : keySetPoint) {\n if(String.valueOf(newWord.charAt(i)).equals(c)) {\n point += mapPoint.get(c);\n }\n }\n }\n\n return point;\n }", "public static int editDistance(String s1, String s2) {\n int[] costs = new int[s2.length() + 1];\n for (int i = 0; i <= s1.length(); i++) {\n int lastValue = i;\n for (int j = 0; j <= s2.length(); j++) {\n if (i == 0)\n costs[j] = j;\n else {\n if (j > 0) {\n int newValue = costs[j - 1];\n if (s1.charAt(i - 1) != s2.charAt(j - 1))\n newValue = Math.min(Math.min(newValue, lastValue),\n costs[j]) + 1;\n costs[j - 1] = lastValue;\n lastValue = newValue;\n }\n }\n }\n if (i > 0)\n costs[s2.length()] = lastValue;\n }\n return costs[s2.length()];\n }", "private Suggestion getBestLinearization(List<String> linearizations,\n Interpretation interpretation,\n Map<String, WordType> originalWords, boolean matchAllWords) {\n\n Suggestion best = null;\n\n for (String current : linearizations) {\n Suggestion suggestion = buildSuggestion(\n current, interpretation,\n originalWords, matchAllWords);\n\n if (suggestion != null) {\n if (best == null) {\n best = suggestion;\n }\n else {\n if (suggestionComparator.compare(best, suggestion) > 0) {\n best = suggestion;\n }\n }\n }\n }\n\n return best;\n }", "static int levenshteinDistance(String x, String y) {\r\n\t\tint[][] dp = new int[x.length() + 1][y.length() + 1];\r\n\r\n\t\tfor (int i = 0; i <= x.length(); i++) {\r\n\t\t\tfor (int j = 0; j <= y.length(); j++) {\r\n\t\t\t\tif (i == 0) {\r\n\t\t\t\t\tdp[i][j] = j;\r\n\t\t\t\t}\r\n\t\t\t\telse if (j == 0) {\r\n\t\t\t\t\tdp[i][j] = i;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tdp[i][j] = min(dp[i - 1][j - 1] \r\n\t\t\t\t\t\t\t+ costOfSubstitution(x.charAt(i - 1), y.charAt(j - 1)), \r\n\t\t\t\t\t\t\tdp[i - 1][j] + 1, \r\n\t\t\t\t\t\t\tdp[i][j - 1] + 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn dp[x.length()][y.length()];\r\n\t}", "static int editDistDP(String str1, String str2, int m, int n) \n {\n int dp[][] = new int[m + 1][n + 1]; \n \n // Fill d[][] in bottom up manner \n for (int i = 0; i <= m; i++) { \n for (int j = 0; j <= n; j++) { \n // If first string is empty, only option is to \n // insert all characters of second string \n if (i == 0) \n dp[i][j] = j; // Min. operations = j \n \n // If second string is empty, only option is to \n // remove all characters of second string \n else if (j == 0) \n dp[i][j] = i; // Min. operations = i \n \n // If last characters are same, ignore last char \n // and recur for remaining string \n else if (str1.charAt(i - 1) == str2.charAt(j - 1)) \n dp[i][j] = dp[i - 1][j - 1]; \n \n // If the last character is different, consider all \n // possibilities and find the minimum \n else\n dp[i][j] = 1 + min(dp[i][j - 1], // Insert \n dp[i - 1][j], // Remove \n dp[i - 1][j - 1]); // Replace \n } \n }\n\t\tprint2DArray(dp);\n \n return dp[m][n]; \n }", "public static void main(String[] args) {\n\t\t\n\t\tString word1 = \"hit\";\n\t\tString word2 = \"lot\";\n\t\tString[] dictionary = { \"dog\", \"dot\", \"bag\", \"hot\", \"lot\", \"log\", \"cog\" };\n\t\tQueue queue = new Queue();\n\t\tArrayList<String> visited = new ArrayList<String>();\n\t\tWordLadder wl = new WordLadder(word1, 1);\n\t\t\n\t\t/*wl.setWord(word1);\n\t\twl.setLevel(1);*/\n\t\tqueue.enqueue(wl);\n\t\twhile (!queue.isEmpty()) {\n\t\t\tWordLadder wl2 = null;\n\t\t\ttry {\n\t\t\t\t \n\t\t\t\twl2 = (WordLadder) queue.dequeue();\n\t\t\t\tSystem.out.println(wl2.getWord());\n\t\t\t\tif(wl2.getWord().equals(word2))\t{\n\t\t\t\t\t\tSystem.out.println(wl2.getLevel());\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tfor (String s : dictionary) {\n\t\t\t\t\tif (editDistance(wl2.getWord(), s) == 1 && !(visited.contains(s))) {\n\t\t\t\t\t\twl = new WordLadder(s, wl2.getLevel()+1);\n\t\t\t\t\t\t/*wl.setWord(s);\n\t\t\t\t\t\twl.setLevel(wl2.getLevel()+1);*/\n\t\t\t\t\t\tqueue.enqueue(wl);\n\t\t\t\t\t\tvisited.add(wl2.getWord());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t//int distance = editDistance(word1, word2);\n\t\t//System.out.println(distance);\n\t}", "private static int LevenshteinDistance(String src, String dest){\n int[][] d = new int[src.length() + 1][dest.length() + 1];\n int i, j, cost;\n char[] str1 = src.toCharArray();\n char[] str2 = dest.toCharArray();\n \n for (i = 0; i <= str1.length; i++){d[i][0] = i;}\n for (j = 0; j <= str2.length; j++){d[0][j] = j;}\n for (i = 1; i <= str1.length; i++){\n for (j = 1; j <= str2.length; j++){\n if (str1[i - 1] == str2[j - 1])\n cost = 0;\n else\n cost = 1;\n d[i][j] =\n Math.min(\n d[i - 1][j] + 1, // Deletion\n Math.min(\n d[i][j - 1] + 1, // Insertion\n d[i - 1][j - 1] + cost)); // Substitution\n\n if ((i > 1) && (j > 1) && (str1[i - 1] == str2[j - 2]) && (str1[i - 2] == str2[j - 1]))\n {\n d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + cost);\n } \n }\n }\n return d[str1.length][str2.length];\n }", "public void translate() {\n\t\tif(!init)\r\n\t\t\treturn; \r\n\t\ttermPhraseTranslation.clear();\r\n\t\t// document threshold: number of terms / / 8\r\n//\t\tdocThreshold = (int) (wordKeyList.size() / computeAvgTermNum(documentTermRelation) / 8.0);\r\n\t\t//\t\tuseDocFrequency = true;\r\n\t\tint minFrequency=1;\r\n\t\temBkgCoefficient=0.5;\r\n\t\tprobThreshold=0.001;//\r\n\t\titerationNum = 20;\r\n\t\tArrayList<Token> tokenList;\r\n\t\tToken curToken;\r\n\t\tint j,k;\r\n\t\t//p(w|C)\r\n\r\n\t\tint[] termValues = termIndexList.values;\r\n\t\tboolean[] termActive = termIndexList.allocated;\r\n\t\ttotalCollectionCount = 0;\r\n\t\tfor(k=0;k<termActive.length;k++){\r\n\t\t\tif(!termActive[k])\r\n\t\t\t\tcontinue;\r\n\t\t\ttotalCollectionCount +=termValues[k];\r\n\t\t}\r\n\t\t\r\n\t\t// for each phrase\r\n\t\tint[] phraseFreqKeys = phraseFrequencyIndex.keys;\r\n\t\tint[] phraseFreqValues = phraseFrequencyIndex.values;\r\n\t\tboolean[] states = phraseFrequencyIndex.allocated;\r\n\t\tfor (int phraseEntry = 0;phraseEntry<states.length;phraseEntry++){\r\n\t\t\tif(!states[phraseEntry]){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (phraseFreqValues[phraseEntry] < minFrequency)\r\n\t\t\t\tcontinue;\r\n\t\t\ttokenList=genSignatureTranslation(phraseFreqKeys[phraseEntry]); // i is phrase number\r\n\t\t\tfor (j = 0; j <tokenList.size(); j++) {\r\n\t\t\t\tcurToken=(Token)tokenList.get(j);\r\n\t\t\t\tif(termPhraseTranslation.containsKey(curToken.getIndex())){\r\n\t\t\t\t\tIntFloatOpenHashMap old = termPhraseTranslation.get(curToken.getIndex());\r\n\t\t\t\t\tif(old.containsKey(phraseFreqKeys[phraseEntry])){\r\n\t\t\t\t\t\tSystem.out.println(\"aha need correction\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\told.put(phraseFreqKeys[phraseEntry], (float) curToken.getWeight()); //phrase, weight\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tIntFloatOpenHashMap newPhrase = new IntFloatOpenHashMap();\r\n\t\t\t\t\tnewPhrase.put(phraseFreqKeys[phraseEntry], (float) curToken.getWeight());\r\n\t\t\t\t\ttermPhraseTranslation.put(curToken.getIndex(), newPhrase);\r\n\t\t\t\t}\r\n\t\t\t\t//\t\t\t\toutputTransMatrix.add(i,curToken.getIndex(),curToken.getWeight());\r\n\t\t\t\t//\t\t\t\toutputTransTMatrix.add(curToken.getIndex(), i, curToken.getWeight());\r\n\t\t\t\t//TODO termPhrase exists, create PhraseTerm\r\n\t\t\t}\r\n\t\t\ttokenList.clear();\r\n\t\t}\r\n\r\n\t}", "public Map<String, float[]> getClosestEntry(float[] inpvec){\n\t Map<String, float[]> resMap = new HashMap<>();\n\t double minDist = -2;\n\t String minWord = null;\n\t float[] minVec = null;\n\t double tempDist;\n\t for(Entry<String, float[]> wordEntry : word2vec.entrySet()) {\n\t\t String word = wordEntry.getKey();\n\t\t float[] wordvec = wordEntry.getValue();\n\t\t tempDist = getSqEucDist(inpvec, wordvec, minDist);\n\t\t if(tempDist != -1) {\n\t\t\t minWord = word;\n\t\t\t minVec = wordvec;\n\t\t\t minDist = tempDist;\n\t\t }\n\t }\n\t resMap.put(minWord, minVec);\n\t return resMap;\n }", "@Test\n public void testEditDistEqualStrings() throws Exception{\n assertEquals(0,Esercizio2.edit_distance_dyn(s1,s4));\n }", "public static void main(String[] args) {\n int validPhrases = 0;\n\n // get filepath for the puzzle input\n System.out.print(\"Please provide the filepath of the text document containing the puzzle input: \");\n String filePath = new Scanner(System.in).nextLine();\n\n try {\n // attempt to read each line in the file into a list\n List<String> lines = Files.readAllLines(Paths.get(filePath));\n\n /// PART 1\n for (String line : lines) {\n List<String> usedWords = new ArrayList<>();\n boolean validPassphrase = true;\n\n for (String word : line.split(\" \")) {\n if (usedWords.contains(word)) {\n validPassphrase = false;\n break;\n } else {\n usedWords.add(word);\n }\n }\n\n if (validPassphrase) {\n validPhrases++;\n }\n }\n\n System.out.println(\"The solution to part 1 is: \" + validPhrases);\n validPhrases = 0;\n\n /// PART 2\n for (String line : lines) {\n // this time around each word will be a dictionary mapping every character in the word, to how many\n // times that character is used in the word\n List<Map<Character, Integer>> usedWords = new ArrayList<>();\n boolean validPassphrase = true;\n\n for (String word : line.split(\" \")) {\n Map<Character, Integer> charMap = new HashMap<>();\n for (char c : word.toCharArray()) {\n // if the character has already been used, increment it's value, otherwise add it to the dict\n if (charMap.containsKey(c)) {\n charMap.put(c, charMap.get(c) + 1);\n } else {\n charMap.put(c, 1);\n }\n }\n\n // now we check if the word we're looking at is an anagram of any we've seen before on this line\n for (Map<Character, Integer> usedWord : usedWords) {\n // no need to check characters if the char maps are a different size\n if (usedWord.keySet().size() == charMap.keySet().size()) {\n boolean hasDifferingValues = false;\n for (char c : charMap.keySet()) {\n // we can short circuit checking every single character by breaking as soon as we see\n // any difference between the two words\n if (!usedWord.containsKey(c) || usedWord.get(c) != charMap.get(c)) {\n hasDifferingValues = true;\n break;\n }\n }\n\n if (!hasDifferingValues) {\n validPassphrase = false;\n break;\n }\n }\n }\n\n // we don't need to check the rest of the words if we already know the line is invalid\n if (!validPassphrase)\n break;\n usedWords.add(charMap);\n }\n\n if (validPassphrase) {\n validPhrases++;\n }\n }\n\n System.out.println(\"The solution to part 2 is: \" + validPhrases);\n } catch (Exception ex) {\n System.out.println(\"An error occurred attempting to read your input file.\");\n }\n }", "@Override\n public int compare(Suggestion sugg1, Suggestion sugg2) {\n int alteredGrammarWordsDifference = sugg1.getAlteredGrammarWordsCount()\n - sugg2.getAlteredGrammarWordsCount();\n\n if (alteredGrammarWordsDifference != 0) {\n return alteredGrammarWordsDifference;\n }\n\n //if tied: less added info first\n int additionalNamesDifference = sugg1.getAdditionalNamesCount() + sugg1.getAdditionalGrammarWords()\n - (sugg2.getAdditionalNamesCount() + sugg2.getAdditionalGrammarWords());\n\n if (additionalNamesDifference != 0) {\n return additionalNamesDifference;\n }\n\n //if tied: less words first\n int wordCountDifference = sugg1.getWordsCount() - sugg2.getWordsCount();\n\n if (wordCountDifference == 0) {\n return wordCountDifference;\n }\n\n //if tied: shortest text first\n return sugg1.getText().length() - sugg2.getText().length();\n }", "public void strComp() {\n\t\tSystem.out.printf(\"total word: %d\", userstring.size());\n\t\tint i = 0, j = 0, k = 0;\n\t\twhile (i < userstring.size() ) {\n\t\t\tif (userstring.get(i++).equalsIgnoreCase(masterString.get(j++))) {\n\t\t\t\t// user said correct word. update the array and total number of\n\t\t\t\t// matches\n\t\t\t\tmatchValues[k] = true;\n\t\t\t\ttotalCorrectMatches++;\n\t\t\t} \n\t\t\tk++;\n\t\t}\n\n\t}", "@Test\r\n public void shouldFindTheLongestWordInDictionary2() {\r\n\r\n String inputWord = \"abppplee\";\r\n String[] dictionary =\r\n new String[] {\"able\", \"ale\", \"apple\", \"bale\", \"kangaroo\", \r\n \"axxxxxxxxxxxxxx\", \"bddddddddddddddd\", \"cccccccccccccccccc\", \r\n \"hxxxxxxxxxxxxxx\", \"gbddddddddddddddd\", \"xccccccccccccccccc\"};\r\n\r\n assertEquals(\"apple\", wordSeeker2.lookFor(inputWord, dictionary));\r\n }", "@Override\r\n\tpublic void shorter() {\n\t\tsuper.shorter();\r\n\t\twordSize = (int) Math.max((Math.abs(x2 - x1) + Math.abs(y2 - y1)) / 3, 2);\r\n\t}", "@Test\r\n public void test5() {\r\n String[] words = new String[] {\r\n \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"F\", \"B\", \"H\", \"I\", \"J\", \"K\"\r\n };\r\n \r\n Assert.assertEquals(shortestDistanceBetween(words, \"B\", \"F\"), 1);\r\n Assert.assertEquals(shortestDistanceBetween(words, \"A\", \"E\"), 4);\r\n Assert.assertEquals(shortestDistanceBetween(words, \"I\", \"A\"), 9);\r\n }", "@Test\n \tpublic void testSimpleAlignments()\n \t{\n \t\tSystem.out.format(\"\\n\\n-------testSimpleAlignments() ------------------------\\n\");\n \t\tPseudoDamerauLevenshtein DL = new PseudoDamerauLevenshtein();\n \t\t//DL.init(\"AB\", \"CD\", false, true);\n \t\t//DL.init(\"ACD\", \"ADE\", false, true);\n \t\t//DL.init(\"AB\", \"XAB\", false, true);\n \t\t//DL.init(\"AB\", \"XAB\", true, true);\n \t\t//DL.init(\"fit\", \"xfity\", true, true);\n \t\t//DL.init(\"fit\", \"xxfityyy\", true, true);\n \t\t//DL.init(\"ABCD\", \"BACD\", false, true);\n \t\t//DL.init(\"fit\", \"xfityfitz\", true, true);\n \t\t//DL.init(\"fit\", \"xfitfitz\", true, true);\n \t\t//DL.init(\"fit\", \"xfitfitfitfitz\", true, true);\n \t\t//DL.init(\"setup\", \"set up\", true, true);\n \t\t//DL.init(\"set up\", \"setup\", true, true);\n \t\t//DL.init(\"hobbies\", \"hobbys\", true, true);\n \t\t//DL.init(\"hobbys\", \"hobbies\", true, true);\n \t\t//DL.init(\"thee\", \"The x y the jdlsjds salds\", true, false);\n \t\tDL.init(\"Bismark\", \"... Bismarck lived...Bismarck reigned...\", true, true);\n \t\t//DL.init(\"refugee\", \"refuge x y\", true, true);\n \t\t//StringMatchingStrategy.APPROXIMATE_MATCHING_MINPROB\n \t\tList<PseudoDamerauLevenshtein.Alignment> alis = DL.computeAlignments(0.65);\n \t\tSystem.out.format(\"----------result of testSimpleAlignments() ---------------------\\n\\n\");\n \t\tfor (Alignment ali: alis)\n \t\t{\n \t\t\tali.print();\n \t\t}\n \t}", "private int calcDistance()\n\t{\n\t\tint distance = 0;\n\n\t\t// Generate a sum of all of the difference in locations of each list element\n\t\tfor(int i = 0; i < listSize; i++) \n\t\t{\n\t\t\tdistance += Math.abs(indexOf(unsortedList, sortedList[i]) - i);\n\t\t}\n\n\t\treturn distance;\n\t}", "private HashMap<String,HashMap<String,Integer>> computeTFForQueryWords(ArrayList<String> queryPostingLines) {\n HashMap<String,HashMap<String,Integer>> queryWordsTF = new HashMap<>();\n HashMap<String,HashMap<String,Integer>> queryWordsTFPerDoc = new HashMap<>();\n String docID,term;\n Integer tf;\n HashSet<String> docIDs = new HashSet<>();\n for(String postingLine : queryPostingLines){\n HashMap<String,Integer> frequenciesInDocuments = new HashMap<>();\n term = postingLine.substring(0,postingLine.indexOf(\"|\"));\n postingLine = postingLine.substring(postingLine.indexOf(\"|\")+1);\n while(!postingLine.equals(\"\")) {\n docID = postingLine.substring(0, postingLine.indexOf(\":\"));\n docIDs.add(docID);\n postingLine = postingLine.substring(postingLine.indexOf(\"_\") + 1);\n tf = Integer.valueOf(postingLine.substring(0, postingLine.indexOf(\"_\")));\n postingLine = postingLine.substring(postingLine.indexOf(\"_\") + 1);\n frequenciesInDocuments.put(docID,tf);\n }\n queryWordsTF.put(term,frequenciesInDocuments);\n }\n\n ArrayList<String> allTermsInQuery = new ArrayList<>(queryWordsTF.keySet());\n for(String doc : docIDs){\n HashMap<String,Integer> tfsInDoc = new HashMap<>();\n for(String termInQuery : allTermsInQuery){\n HashMap<String,Integer> termsTFInDoc = queryWordsTF.get(termInQuery);\n if(termsTFInDoc.containsKey(doc)){\n tfsInDoc.put(termInQuery,termsTFInDoc.get(doc));\n }\n }\n queryWordsTFPerDoc.put(doc,tfsInDoc);\n }\n return queryWordsTFPerDoc;\n }", "public Collection<String> wordsNearest(String word,int n) {\n INDArray vec = Transforms.unitVec(this.getWordVectorMatrix(word));\n\n\n if(cache instanceof InMemoryLookupCache) {\n InMemoryLookupCache l = (InMemoryLookupCache) cache;\n INDArray syn0 = l.getSyn0();\n INDArray weights = syn0.norm2(0).rdivi(1).muli(vec);\n INDArray distances = syn0.mulRowVector(weights).sum(1);\n INDArray[] sorted = Nd4j.sortWithIndices(distances,0,false);\n INDArray sort = sorted[0];\n List<String> ret = new ArrayList<>();\n VocabWord word2 = cache.wordFor(word);\n if(n > sort.length())\n n = sort.length();\n //there will be a redundant word\n for(int i = 0; i < n + 1; i++) {\n if(sort.getInt(i) == word2.getIndex())\n continue;\n ret.add(cache.wordAtIndex(sort.getInt(i)));\n }\n\n\n return ret;\n }\n\n if(vec == null)\n return new ArrayList<>();\n Counter<String> distances = new Counter<>();\n\n for(String s : cache.words()) {\n if(s.equals(word))\n continue;\n INDArray otherVec = getWordVectorMatrix(s);\n double sim = Transforms.cosineSim(vec,otherVec);\n distances.incrementCount(s, sim);\n }\n\n\n distances.keepTopNKeys(n);\n return distances.keySet();\n\n }", "WordLadderSolver(String dictionaryFile) {\n \tdictionary = new Dictionary(dictionaryFile); //Set up the words from the file\n }", "public static int editDistance(String str1, String str2)\r\n\t{\r\n\t\tint length1 = str1.length();\r\n\t\tint length2 = str2.length();\r\n\r\n\t\tint[][] arr = new int[length1 + 1][length2 + 1];\r\n\r\n\t\tfor (int i = 0; i <= length1; i++)\r\n\t\t{\r\n\t\t\tarr[i][0] = i;\r\n\t\t}\r\n\t\tfor (int j = 0; j <= length2; j++)\r\n\t\t{\r\n\t\t\tarr[0][j] = j;\r\n\t\t}\r\n\r\n\t\t// iterate though, and check last char\r\n\t\tfor (int i = 0; i < length1; i++)\r\n\t\t{\r\n\t\t\tchar c1 = str1.charAt(i);\r\n\t\t\tfor (int j = 0; j < length2; j++)\r\n\t\t\t{\r\n\t\t\t\tchar c2 = str2.charAt(j);\r\n\r\n\t\t\t\tif (c1 == c2)\r\n\t\t\t\t{\r\n\t\t\t\t\tarr[i + 1][j + 1] = arr[i][j];\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tint replace = arr[i][j] + 1;\r\n\t\t\t\t\tint insert = arr[i][j + 1] + 1;\r\n\t\t\t\t\tint delete = arr[i + 1][j] + 1;\r\n\r\n\t\t\t\t\tint min = replace > insert ? insert : replace;\r\n\t\t\t\t\tmin = delete > min ? min : delete;\r\n\t\t\t\t\tarr[i + 1][j + 1] = min;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn arr[length1][length2];\r\n\t}", "public int minEditDistance(String str1,String str2){\n\n\t \t return minEditDistanceHelper(str1,str1.length(),str2,str2.length());\n\t }", "public static void checkMagazine(String[] magazine, String[] ransom) {\n HashMap<String, Integer> usableWords = makeMap(magazine);\n for (int i = 0; i < ransom.length; i++) {\n if (usableWords.containsKey(ransom[i]) && usableWords.get(ransom[i]) > 0) {\n usableWords.merge(ransom[i], -1, Integer::sum); // uses the word\n } else {\n System.out.println(\"No\");\n return;\n }\n }\n System.out.println(\"Yes\");\n}", "static int editDistDP(String str1, String str2, int m, int n) \n {\n int dp[][] = new int[m+1][n+1]; \n \n // Fill d[][] in bottom up manner \n for (int i=0; i<=m; i++) \n { \n for (int j=0; j<=n; j++) \n { \n // If first string is empty, only option is to \n // insert all characters of second string \n if (i==0) \n dp[i][j] = j; // Min. operations = j \n \n // If second string is empty, only option is to \n // remove all characters of second string \n else if (j==0) \n dp[i][j] = i; // Min. operations = i \n \n // If last characters are same, ignore last char \n // and recur for remaining string \n else if (str1.charAt(i-1) == str2.charAt(j-1)) \n dp[i][j] = dp[i-1][j-1]; \n \n // If the last character is different, consider all \n // possibilities and find the minimum \n else\n dp[i][j] = 1 + min(dp[i][j-1], // Insert \n dp[i-1][j], // Remove \n dp[i-1][j-1]); // Replace \n } \n } \n \n return dp[m][n]; \n }", "private void correctSpelling() {\n\t\tparent_frame.getFestival().speak(\"Correct\", false);\n\n\t\t//adds to respective arraylist based on which attempt they get it right\n\t\tif (current_attempt_number==1){\n\t\t\twords_mastered.add(words_to_spell.get(current_word_number));\n\t\t} else {//words is faulted\n\t\t\twords_faulted.add(words_to_spell.get(current_word_number));\n\t\t}\n\n\t\tcurrent_word_number+=1;\n\t\tcurrent_attempt_number=1;\n\t\tprogress_bar.setForeground(Color.GREEN);\n\t\tprogress_bar.setString(\"word \"+current_word_number +\" was CORRECT\");\n\t\tfeedback_display.setText(\"\");//clear display\n\t}", "public Map<String, WordImageRelevaces> calculateImageWordRelevance(\r\n\t\t\tMap<String, WordImage> wordImageRel) {\r\n\r\n\t\tPrintWriter tempOut;\r\n\t\tMap<String, WordImageRelevaces> wordImgRelevance = new HashMap<String, WordImageRelevaces>();\r\n\t\ttry {\r\n\r\n\t\t\ttempOut = new PrintWriter(word_prop_output);\r\n\r\n\t\t\tdouble IuWTotal1 = 0; // The normalization factor\r\n\t\t\tdouble IuWTotal2 = 0; // The normalization factor\r\n\t\t\tdouble IuWTotal3 = 0; // The normalization factor\r\n\t\t\tdouble IuWTotal4 = 0; // The normalization factor\r\n\t\t\tdouble IuWTotal5 = 0; // The normalization factor\r\n\t\t\tdouble IuWTotal6 = 0; // The normalization factor\r\n\r\n\t\t\tint index = 0;\r\n\r\n\t\t\tdouble IuWSingle1[] = new double[wordImageRel.size()];\r\n\t\t\tdouble IuWSingle2[] = new double[wordImageRel.size()];\r\n\t\t\tdouble IuWSingle3[] = new double[wordImageRel.size()];\r\n\t\t\tdouble IuWSingle4[] = new double[wordImageRel.size()];\r\n\t\t\tdouble IuWSingle5[] = new double[wordImageRel.size()];\r\n\t\t\tdouble IuWSingle6[] = new double[wordImageRel.size()];\r\n\r\n\t\t\ttempOut.println(\"Word , total Occur , #NotSimImgs, #SimImgs , WordOccur , #Unique Users \"\r\n\t\t\t\t\t+ \", Pw1, Pw2,Pw3 , Pw4 , Pw5,Pw6 , C, R, Rw, Lw\");\r\n\r\n\t\t\tfor (String word : wordImageRel.keySet()) { // For each word\r\n\r\n\t\t\t\tWordImage wordImage = wordImageRel.get(word);\r\n\t\t\t\tdouble PcjW = wordImage.getImageProbability();\r\n\r\n\t\t\t\tdouble Pw1 = wordImage.getPwOnlyWords();\r\n\t\t\t\tdouble Pw2 = wordImage.getPwAllUsers();\r\n\t\t\t\tdouble Pw3 = wordImage.getPwOnlyUniqueUsers();\r\n\t\t\t\tdouble Pw4 = wordImage.getPwTFIDFlOnlyWords();\r\n\t\t\t\tdouble Pw5 = wordImage.getPwTFIDFlAllUsers();\r\n\t\t\t\tdouble Pw6 = wordImage.getPwTFIDFOnlyUniqueUsers();\r\n\r\n\t\t\t\tint C = totalNumberOfImages;\r\n\t\t\t\tint R = totalNumberOfSimilarImages;\r\n\t\t\t\tint Rw = wordImageRel.get(word).getSimlarImages().size();\r\n\t\t\t\tint Lw = wordImageRel.get(word).getOcurrances();\r\n\r\n\t\t\t\ttempOut.println(word\r\n\t\t\t\t\t\t+ \",\"\r\n\t\t\t\t\t\t+ wordImageRel.get(word).getTotalOcurences()\r\n\t\t\t\t\t\t+ \",\"\r\n\t\t\t\t\t\t+ wordNotSimilarImages.get(word)\r\n\t\t\t\t\t\t+ \",\"\r\n\t\t\t\t\t\t+ wordImageRel.get(word).getSimilarImageIDs().size()\r\n\t\t\t\t\t\t+ \",\"\r\n\t\t\t\t\t\t+ wordImageRel.get(word).getOcurrances()\r\n\t\t\t\t\t\t+ \",\"\r\n\t\t\t\t\t\t+ wordImageRel.get(word)\r\n\t\t\t\t\t\t\t\t.getWordUniqueUsers(this.photoList).size()\r\n\t\t\t\t\t\t+ \",\" + +Pw1 + \",\" + Pw2 + \",\" + Pw3 + \",\" + Pw4 + \",\"\r\n\t\t\t\t\t\t+ Pw5 + \",\" + Pw6 + \",\" + C + \",\" + R + \",\" + Rw + \",\"\r\n\t\t\t\t\t\t+ Lw);\r\n\r\n\t\t\t\tSet<String> imgIDs = wordImage.getSimilarImageIDs(); // Get\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// images\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// related\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// to\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// that\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// word\r\n\r\n\t\t\t\tfor (String imgID : imgIDs) {\r\n\r\n\t\t\t\t\tdouble PIc = wordImage.getSimilarImage(imgID)\r\n\t\t\t\t\t\t\t.getPointSimilarity();\r\n\r\n\t\t\t\t\tIuWSingle1[index] += Pw1 * PcjW * PIc;\r\n\t\t\t\t\tIuWSingle2[index] += Pw2 * PcjW * PIc;\r\n\t\t\t\t\tIuWSingle3[index] += Pw3 * PcjW * PIc;\r\n\t\t\t\t\tIuWSingle4[index] += Pw4 * PcjW * PIc;\r\n\t\t\t\t\tIuWSingle5[index] += Pw5 * PcjW * PIc;\r\n\t\t\t\t\tIuWSingle6[index] += Pw6 * PcjW * PIc;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Normalise\r\n\t\t\t\tWordImageRelevaces wImgRels = new WordImageRelevaces();\r\n\t\t\t\twImgRels.setFreqRelOnlyWords(IuWSingle1[index]);\r\n\t\t\t\twImgRels.setFreqRelWordsAndAllUsers(IuWSingle2[index]);\r\n\t\t\t\twImgRels.setFreqRelWordAndOnlyUniqueUsers(IuWSingle3[index]);\r\n\t\t\t\twImgRels.setTfIdfRelOnlyWords(IuWSingle4[index]);\r\n\t\t\t\twImgRels.setTfIdfRelWordsAndAllUsers(IuWSingle5[index]);\r\n\t\t\t\twImgRels.setTfIdfRelWordAndOnlyUniqueUsers(IuWSingle6[index]);\r\n\r\n\t\t\t\twordImgRelevance.put(word, wImgRels); // unnormalized value\r\n\r\n\t\t\t\tIuWTotal1 += IuWSingle1[index];\r\n\t\t\t\tIuWTotal2 += IuWSingle2[index];\r\n\t\t\t\tIuWTotal3 += IuWSingle3[index];\r\n\t\t\t\tIuWTotal4 += IuWSingle4[index];\r\n\t\t\t\tIuWTotal5 += IuWSingle5[index];\r\n\t\t\t\tIuWTotal6 += IuWSingle6[index];\r\n\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\r\n\t\t\tfor (String word : wordImgRelevance.keySet()) {\r\n\r\n\t\t\t\tdouble notNormalizedValue1 = wordImgRelevance.get(word)\r\n\t\t\t\t\t\t.getFreqRelOnlyWords();\r\n\t\t\t\twordImgRelevance.get(word).setFreqRelOnlyWords(\r\n\t\t\t\t\t\tnotNormalizedValue1 / IuWTotal1);\r\n\r\n\t\t\t\tdouble notNormalizedValue2 = wordImgRelevance.get(word)\r\n\t\t\t\t\t\t.getFreqRelWordsAndAllUsers();\r\n\t\t\t\twordImgRelevance.get(word).setFreqRelWordsAndAllUsers(\r\n\t\t\t\t\t\tnotNormalizedValue2 / IuWTotal2);\r\n\r\n\t\t\t\tdouble notNormalizedValue3 = wordImgRelevance.get(word)\r\n\t\t\t\t\t\t.getFreqRelWordAndOnlyUniqueUsers();\r\n\t\t\t\twordImgRelevance.get(word).setFreqRelWordAndOnlyUniqueUsers(\r\n\t\t\t\t\t\tnotNormalizedValue3 / IuWTotal3);\r\n\r\n\t\t\t\tdouble notNormalizedValue4 = wordImgRelevance.get(word)\r\n\t\t\t\t\t\t.getTfIdfRelOnlyWords();\r\n\t\t\t\twordImgRelevance.get(word).setTfIdfRelOnlyWords(\r\n\t\t\t\t\t\tnotNormalizedValue4 / IuWTotal4);\r\n\r\n\t\t\t\tdouble notNormalizedValue5 = wordImgRelevance.get(word)\r\n\t\t\t\t\t\t.getTfIdfRelWordsAndAllUsers();\r\n\t\t\t\twordImgRelevance.get(word).setTfIdfRelWordsAndAllUsers(\r\n\t\t\t\t\t\tnotNormalizedValue5 / IuWTotal5);\r\n\r\n\t\t\t\tdouble notNormalizedValue6 = wordImgRelevance.get(word)\r\n\t\t\t\t\t\t.getTfIdfRelWordAndOnlyUniqueUsers();\r\n\t\t\t\twordImgRelevance.get(word).setTfIdfRelWordAndOnlyUniqueUsers(\r\n\t\t\t\t\t\tnotNormalizedValue6 / IuWTotal6);\r\n\r\n\t\t\t\ttempOut.close();\r\n\t\t\t}\r\n\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\treturn wordImgRelevance;\r\n\r\n\t}", "public static List<List<String>> breakIntoWords(String longWord, Collection<String> dict) {\n List<List<String>>[] words = new ArrayList[longWord.length() + 1];\n // words[i] = list of matching words at longWord length i\n // words[longWord.length()] is answer\n Arrays.stream(words).forEach((wl) -> wl = null);\n // contains empty list of lists\n // the first element contains an emtpty list of strings\n words[0] = new ArrayList<List<String>>();\n\n int beginIndx = -1;\n while (beginIndx < longWord.length()) {\n // beginIndx starts from 0 and goes up to length of the word -1\n // start with -1 and first index where the words[beginIndx] != null is 0\n // last value for beingIndx is wordlength -1\n while ((words[++beginIndx] == null) && (beginIndx < longWord.length())) ;\n // non null List of Lists of String\n // for index 0 it will be empty. For subsequent indices it may be non empty\n List<List<String>> beginIndxLists = words[beginIndx];\n // if beginIndx has not reached the end of the word\n // last value of beingIndx is longWord.length-1\n // need to compare the last character for which substring(wordlength-1, wordlength)\n if (beginIndx < longWord.length()) {\n // beginIdx is the start of the word, end Indx is end\n // last value for endIndx is longWord.length\n for (int endIndx = beginIndx + 1; endIndx <= longWord.length(); endIndx++) {\n String matchW = longWord.substring(beginIndx, endIndx);\n if ((matchW != null) && (!matchW.isEmpty())) {\n if (dict.contains(matchW)) {\n // list of list of Strings for getting to the endIndx\n List<List<String>> mwordsList = words[endIndx];\n if (mwordsList == null) {\n mwordsList = new ArrayList<List<String>>();\n }\n if((beginIndxLists==null)||(beginIndxLists.isEmpty())) {\n mwordsList.add(new ArrayList(Arrays.asList(matchW)));\n }\n // words[endIndx] has list of list initialized\n // there is a list at beginIndx\n // get the list of words at begingIndx. It contains at least one empty list\n else {\n for (List<String> beginList : beginIndxLists) {\n // at the matched word in the list at beginIndx and then copy it to mwordsList at endIndx\n beginList.add(matchW);\n mwordsList.add(beginList);\n }\n }\n words[endIndx] = mwordsList;\n }\n }\n }\n\n }\n\n }\n return words[longWord.length()];\n }", "private static int levenshteinDistance(String word, int wordLen, String other, int otherLen) {\n if (wordLen == 0 || otherLen == 0) {\n return Math.max(wordLen, otherLen);\n }\n\n int cost = word.charAt(wordLen - 1) == other.charAt(otherLen - 1) ? 0 : 1;\n\n int deleteFromWord = levenshteinDistance(word, wordLen - 1, other, otherLen) + 1;\n int deleteFromOther = levenshteinDistance(word, wordLen, other, otherLen - 1) + 1;\n int deleteFromBoth = levenshteinDistance(word, wordLen - 1, other, otherLen - 1) + cost;\n\n return Math.min(deleteFromWord, Math.min(deleteFromOther, deleteFromBoth));\n }", "public static int computeLevenshteinDistance(CharSequence str1, CharSequence str2) {\n int[][] distance = new int[str1.length() + 1][str2.length() + 1];\n\n for (int i = 0; i <= str1.length(); i++)\n distance[i][0] = i;\n for (int j = 0; j <= str2.length(); j++)\n distance[0][j] = j;\n\n for (int i = 1; i <= str1.length(); i++)\n for (int j = 1; j <= str2.length(); j++)\n distance[i][j] = minimum(\n distance[i - 1][j] + 1,\n distance[i][j - 1] + 1,\n distance[i - 1][j - 1]\n + ((str1.charAt(i - 1) == str2.charAt(j - 1)) ? 0\n : 1));\n\n return distance[str1.length()][str2.length()];\n }", "private void findHighestScoringWord(ArrayList<Tile> inputTiles, ArrayList<Tile> tilesToBeUsed, String currentWord, int score, Anchor anchor){\n for (int tileNo = 0 ; tileNo < inputTiles.size() ; tileNo++){\n Tile currentTile = inputTiles.get(tileNo);\n if (currentTile == null) break;\n if (isValidPrefix(currentWord + currentTile.letter)\t){\n ArrayList<Tile> remainingTiles = new ArrayList<Tile>( inputTiles);\n ArrayList<Tile> tilesInWord = new ArrayList<Tile>(tilesToBeUsed);\n remainingTiles.remove(tileNo);\n tilesInWord.add(currentTile);\n //score check here when we know it's valid?\n findHighestScoringWord(remainingTiles, tilesInWord ,currentWord + currentTile.letter, score + currentTile.pointValue , anchor);\n\n //need to check if anchor is in the word before we propose it as an answer\n if (tilesToBeUsed.contains(anchor.anchorTile) || currentTile.equals(anchor.anchorTile)){\n if (isValidWord(currentWord + currentTile.letter)){\n if (fitsOnBoard(anchor, tilesInWord)){\n Move move = null; //let's make our move to score\n if(anchor.isAcross()){ //make a move to check score bases on anchor being across type\n move = new Move(tilesInWord, anchor.row , (anchor.col - getAnchorPosition(anchor, tilesInWord)), true, bot );\n } else if(!anchor.isAcross()){ // make a move to check score on anchor being vert type\n move = new Move(tilesInWord, (anchor.row - getAnchorPosition(anchor,tilesInWord)), anchor.col,false, bot );\n }\n int currentWordScore = Scorer.score(move , boardSpaces);\n if (currentWord.length() > 6){\n currentWordScore += 50;\n }\n\n if (maxScore < currentWordScore && moveIsValid(move) ){\n maxScore = currentWordScore;\n bestWord = tilesInWord;\n currentAnchor = anchor;\n }\n }\n }\n }\n }\n }\n }", "public void normalize() {\n // YOUR CODE HERE\n String w1, w2;\n for (int i = 0; i < row; i++) {\n w1 = NDTokens.get(i);\n for (int j = 0; j < column; j++) {\n w2 = NDTokens.get(j);\n if(smooth) {\n bi_grams_normalized[NDTokens.indexOf(w1)][NDTokens.indexOf(w2)] = (getCount(w1, w2))/(uni_grams[NDTokens.indexOf(w1)] + NDTokens_size);\n }else {\n bi_grams_normalized[NDTokens.indexOf(w1)][NDTokens.indexOf(w2)] = getCount(w1, w2)/(uni_grams[NDTokens.indexOf(w1)]);\n }\n }\n }\n }", "private Suggestion buildSuggestion(String linearization,\n Interpretation interpretation,\n Map<String, WordType> originalWords, boolean matchAllWords) {\n String[] words = linearization.split(\"\\\\s+\");\n\n Map<String, Integer> namesMissing = new HashMap(\n interpretation.getNameTypeCounts().counts);\n\n int additionalNamesCount = 0;\n\n Set<String> wordsNotMatched = new HashSet<>(originalWords.keySet());\n for (Entry<String, WordType> entry : originalWords.entrySet()) {\n if (entry.getValue() == WordType.Name) {\n wordsNotMatched.remove(entry.getKey());\n }\n }\n int additionalGrammarWordsCount = 0;\n\n\n for (String word : words) {\n\n //name word\n if (defTempl.isVariable(word)) {\n String nameType = word.substring(2, word.length() - 2);\n if (namesMissing.containsKey(nameType)) {\n Integer missingCount = namesMissing.get(nameType);\n if (missingCount > 1) {\n namesMissing.put(nameType, missingCount - 1);\n }\n else {\n namesMissing.remove(nameType);\n }\n }\n else {\n additionalNamesCount++;\n }\n }\n //grammar word\n else {\n String lowerCaseWord = word.toLowerCase();\n\n if (wordsNotMatched.contains(lowerCaseWord)) {\n wordsNotMatched.remove(lowerCaseWord);\n }\n else {\n additionalGrammarWordsCount++;\n }\n }\n }\n\n //if removing words from query is not allowed\n if (matchAllWords && !wordsNotMatched.isEmpty()) {\n return null;\n }\n\n int grammarWordsAltered = wordsNotMatched.size();\n int grammarWordsAdded = additionalGrammarWordsCount - grammarWordsAltered;\n\n return new Suggestion(linearization, false,\n additionalNamesCount, grammarWordsAdded, grammarWordsAltered);\n }", "public static String findReplacements(TreeSet<String> dictionary, \n\t\t\t\t\t String word)\n\t{\n\t String replacements = \"\";\n\t String leftHalf, rightHalf, newWord;\n\t int deleteAtThisIndex, insertBeforeThisIndex;\n\t char index;\n\t TreeSet<String> alreadyDoneNewWords = new TreeSet<String>();\n\t /* The above TreeSet<String> will hold words that the spell checker\n\t suggests as replacements. By keeping track of what has already\n\t been suggested, the method can make sure not to output the\n\t same recommended word twice. For instance, the word \n\t \"mispelled\" would ordinarily result in two of the same suggested\n\t replacements: \"misspelled\" (where the additional \"s\" is added to \n\t different locations.) */\n\t \n\t // First, we'll look for words to make by subtracting one letter\n\t // from the misspelled word.\n\t for(deleteAtThisIndex = 0; deleteAtThisIndex < word.length();\n\t\tdeleteAtThisIndex ++)\n\t\t{\n\t\t if(deleteAtThisIndex == 0)\n\t\t\t{\n\t\t\t leftHalf = \"\";\n\t\t\t rightHalf = word;\n\t\t\t}\n\t\t else\n\t\t\t{\n\t\t\t leftHalf = word.substring(0, deleteAtThisIndex);\n\t\t\t rightHalf = word.substring(deleteAtThisIndex+1,\n\t\t\t\t\t\t word.length());\n\t\t\t}\n\n\t\t newWord = \"\";\n\t\t newWord = newWord.concat(leftHalf);\n\t\t newWord = newWord.concat(rightHalf);\n\t\t if(dictionary.contains(newWord) &&\n\t\t !alreadyDoneNewWords.contains(newWord))\n\t\t\t{\n\t\t\t replacements = replacements.concat(newWord + \"\\n\");\n\t\t\t alreadyDoneNewWords.add(newWord);\n\t\t\t}\n\t\t}\n\n\t // The rest of this method looks for words to make by adding a \n\t // new letter to the misspelled word.\n\t for(insertBeforeThisIndex = 0; \n\t\tinsertBeforeThisIndex <= word.length();\n\t\tinsertBeforeThisIndex ++)\n\t\t{\n\t\t if(insertBeforeThisIndex == word.length())\n\t\t\t{\n\t\t\t leftHalf = word;\n\t\t\t rightHalf = \"\";\n\t\t\t}\n\t\t else\n\t\t\t{\n\t\t\t leftHalf = word.substring(0,insertBeforeThisIndex);\n\t\t\t rightHalf = word.substring(insertBeforeThisIndex,\n\t\t\t\t\t\t word.length());\n\t\t\t}\n\t\t \n\t\t for(index = 'a'; index <= 'z'; index ++)\n\t\t\t{\n\t\t\t newWord = \"\";\n\t\t\t newWord = newWord.concat(leftHalf);\n\t\t\t newWord = newWord.concat(\"\" + index + \"\");\n\t\t\t newWord = newWord.concat(rightHalf);\n\t\t\t \n\t\t\t if(dictionary.contains(newWord) &&\n\t\t\t !alreadyDoneNewWords.contains(newWord))\n\t\t\t\t{\n\t\t\t\t replacements \n\t\t\t\t\t= replacements.concat(newWord + \"\\n\");\n\t\t\t\t alreadyDoneNewWords.add(newWord);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t return replacements;\n\t}", "public void checkDictionary (String[] target) {\n try {\n File f = new File(\"cmudict.0.7a\");\n BufferedReader br = new BufferedReader(new FileReader(f));\n String[][] data;\n Double result;\n for (String line; (line = br.readLine()) != null; ) {\n if (!line.matches(\"^[A-Za-z].*\")) {\n continue;\n }\n data = readDictionary(line);\n result = compareWords(target, data[1]);\n try {\n PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(\"results.txt\", true)));\n out.print(result);\n out.println(\" \" + data[0][0]); // prints the word\n out.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static void main(String[] args) throws Exception \n\t{\n\t\tList<String> stopWords = new ArrayList<String>();\n\t\tstopWords = stopWordsCreation();\n\n\n\t\t\n\t\tHashMap<Integer, String> hmap = new HashMap<Integer, String>();\t//Used in tittle, all terms are unique, and any dups become \" \"\n\t\n\t\t\n\t\tList<String> uniqueTerms = new ArrayList<String>();\n\t\tList<String> allTerms = new ArrayList<String>();\n\t\t\t\t\n\t\t\n\t\tHashMap<Integer, String> hmap2 = new HashMap<Integer, String>();\n\t\tHashMap<Integer, String> allValues = new HashMap<Integer, String>();\n\t\tHashMap<Integer, Double> docNorms = new HashMap<Integer, Double>();\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tMap<Integer, List<String>> postingsFileListAllWords = new HashMap<>();\t\t\n\t\tMap<Integer, List<String>> postingsFileList = new HashMap<>();\n\t\t\n\t\tMap<Integer, List<StringBuilder>> docAndTitles = new HashMap<>();\n\t\tMap<Integer, List<StringBuilder>> docAndAbstract = new HashMap<>();\n\t\tMap<Integer, List<StringBuilder>> docAndAuthors = new HashMap<>();\n\t\t\n\t\t\n\t\tMap<Integer, List<Double>> termWeights = new HashMap<>();\n\t\t\n\t\tList<Integer> docTermCountList = new ArrayList<Integer>();\n\t\t\n\t\tBufferedReader br = null;\n\t\tFileReader fr = null;\n\t\tString sCurrentLine;\n\n\t\tint documentCount = 0;\n\t\tint documentFound = 0;\n\t\tint articleNew = 0;\n\t\tint docTermCount = 0;\n\t\t\n\t\t\n\t\tboolean abstractReached = false;\n\n\t\ttry {\n\t\t\tfr = new FileReader(FILENAME);\n\t\t\tbr = new BufferedReader(fr);\n\n\t\t\t// Continues to get 1 line from document until it reaches the end of EVERY doc\n\t\t\twhile ((sCurrentLine = br.readLine()) != null) \n\t\t\t{\n\t\t\t\t// sCurrentLine now contains the 1 line from the document\n\n\t\t\t\t// Take line and split each word and place them into array\n\t\t\t\tString[] arr = sCurrentLine.split(\" \");\n\n\n\t\t\t\t//Go through the entire array\n\t\t\t\tfor (String ss : arr) \n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t/*\n\t\t\t\t\t * This section takes the array and checks to see if it has reached a new\n\t\t\t\t\t * document or not. If the current line begins with an .I, then it knows that a\n\t\t\t\t\t * document has just started. If it incounters another .I, then it knows that a\n\t\t\t\t\t * new document has started.\n\t\t\t\t\t */\n\t\t\t\t\t//System.out.println(\"Before anything: \"+sCurrentLine);\n\t\t\t\t\tif (arr[0].equals(\".I\")) \n\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\tif (articleNew == 0) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tarticleNew = 1;\n\t\t\t\t\t\t\tdocumentFound = Integer.parseInt(arr[1]);\n\t\t\t\t\t\t} \n\t\t\t\t\t\telse if (articleNew == 1) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tarticleNew = 0;\n\t\t\t\t\t\t\tdocumentFound = Integer.parseInt(arr[1]);\n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t//System.out.println(documentFound);\n\t\t\t\t\t\t//count++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/* This section detects that after a document has entered,\n\t\t\t\t\t * it has to gather all the words contained in the title \n\t\t\t\t\t * section.\n\t\t\t\t\t */\n\t\t\t\t\tif (arr[0].equals(\".T\") ) \n\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// Go to line UNDER .T since that is where tittle is located\n\t\t\t\t\t\t//sCurrentLine = br.readLine();\n\t\t\t\t\t\tdocAndTitles.put(documentFound, new ArrayList<StringBuilder>());\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\t//System.out.println(\"Docs and titles: \"+docAndTitles);\n\t\t\t\t\t\tStringBuilder title = new StringBuilder();\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile ( !(sCurrentLine = br.readLine()).matches(\".B|.A|.N|.X|.K|.C\") )\n\t\t\t\t\t\t{\t\t\t\t\n\t\t\t\t\t\t\t/* In this section, there are 2 lists being made. One list\n\t\t\t\t\t\t\t * is for all the unique words in every title in the document (hmap).\n\t\t\t\t\t\t\t * Hmap contains all unique words, and anytime a duplicate word is \n\t\t\t\t\t\t\t * found, it is replaced with an empty space in the map.\n\t\t\t\t\t\t\t * All Values \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//postingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\t\t\t//postingsFileList.get(documentFound - 1).add(term2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"current line: \"+sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString[] tittle = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tif (tittle[0].equals(\".W\") )\n\t\t\t\t\t\t\t{\t\t\n\t\t\t\t\t\t\t\tabstractReached = true;\n\t\t\t\t\t\t\t\tbreak;\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\ttitle.append(sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (String tittleWords : tittle)\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\ttittleWords = tittleWords.toLowerCase();\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.replaceAll(\"[-&^%'{}*|$+\\\\/\\\\?!<>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.replaceAll(\"[-&^%'*{}|$+\\\\/\\\\?!<>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.replaceAll(\"[-&^%'{}*|$+\\\\/\\\\?!<>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\t//System.out.println(tittleWords);\n\t\t\t\t\t\t\t\tif (hmap.containsValue(tittleWords)) \n\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, \" \");\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, tittleWords);\n\t\t\t\t\t\t\t\t\tallTerms.add(tittleWords);\n\t\t\t\t\t\t\t\t\tdocumentCount++;\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\tallTerms.add(tittleWords);\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, tittleWords);\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, tittleWords);\n\t\t\t\t\t\t\t\t\tif (!(uniqueTerms.contains(tittleWords)))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ((stopWordsSetting && !(stopWords.contains(tittleWords))))\n\t\t\t\t\t\t\t\t\t\t\tuniqueTerms.add(tittleWords);\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\tdocumentCount++;\n\t\t\t\t\t\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//docAndTitles.get(documentCount).add(\" \");\n\t\t\t\t\t\t\ttitle.append(\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//System.out.println(\"Title: \"+title);\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\tdocAndTitles.get(documentFound).add(title);\n\t\t\t\t\t\t//System.out.println(\"Done!: \"+ docAndTitles);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif (arr[0].equals(\".A\") ) \n\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// Go to line UNDER .T since that is where tittle is located\n\t\t\t\t\t\t//sCurrentLine = br.readLine();\n\t\t\t\t\t\tdocAndAuthors.put(documentFound, new ArrayList<StringBuilder>());\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\t//System.out.println(\"Docs and titles: \"+docAndTitles);\n\t\t\t\t\t\tStringBuilder author = new StringBuilder();\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\twhile ( !(sCurrentLine = br.readLine()).matches(\".N|.X|.K|.C\") )\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* In this section, there are 2 lists being made. One list\n\t\t\t\t\t\t\t * is for all the unique words in every title in the document (hmap).\n\t\t\t\t\t\t\t * Hmap contains all unique words, and anytime a duplicate word is \n\t\t\t\t\t\t\t * found, it is replaced with an empty space in the map.\n\t\t\t\t\t\t\t * All Values \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//postingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\t\t\t//postingsFileList.get(documentFound - 1).add(term2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"current line: \"+sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString[] tittle = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tif (tittle[0].equals(\".W\") )\n\t\t\t\t\t\t\t{\t\t\n\t\t\t\t\t\t\t\tabstractReached = true;\n\t\t\t\t\t\t\t\tbreak;\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\tauthor.append(sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//docAndTitles.get(documentCount).add(\" \");\n\t\t\t\t\t\t\tauthor.append(\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//System.out.println(\"Title: \"+title);\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\tdocAndAuthors.get(documentFound).add(author);\n\t\t\t\t\t\t//System.out.println(\"Done!: \"+ docAndTitles);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/* Since there may or may not be an asbtract after\n\t\t\t\t\t * the title, we need to check what the next section\n\t\t\t\t\t * is. We know that every doc has a publication date,\n\t\t\t\t\t * so it can end there, but if there is no abstract,\n\t\t\t\t\t * then it will keep scanning until it reaches the publication\n\t\t\t\t\t * date. If abstract is empty (in tests), it will also finish instantly\n\t\t\t\t\t * since it's blank and goes straight to .B (the publishing date).\n\t\t\t\t\t * Works EXACTLY like Title \t\t \n\t\t\t\t\t */\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif (abstractReached) \n\t\t\t\t\t{\t\n\t\t\t\t\t\t//System.out.println(\"\\n\");\n\t\t\t\t\t\t//System.out.println(\"REACHED ABSTRACT and current line is: \" +sCurrentLine);\n\t\t\t\t\t\tdocAndAbstract.put(documentFound, new ArrayList<StringBuilder>());\n\t\t\t\t\t\tStringBuilder totalAbstract = new StringBuilder();\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile ( !(sCurrentLine = br.readLine()).matches(\".T|.I|.A|.N|.X|.K|.C\") )\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\tString[] abstaract = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tif (abstaract[0].equals(\".B\") )\n\t\t\t\t\t\t\t{\t\t\t\n\t\t\t\t\t\t\t\tabstractReached = false;\n\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttotalAbstract.append(sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString[] misc = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tfor (String miscWords : misc) \n\t\t\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\tmiscWords = miscWords.toLowerCase(); \n\t\t\t\t\t\t\t\tmiscWords = miscWords.replaceAll(\"[-&^%'*$+|{}?!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\tmiscWords = miscWords.replaceAll(\"[-&^%'*$+|?{}!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\t\t\n\t\t\t\t\t\t\t\tmiscWords = miscWords.replaceAll(\"[-&^%'*$+|{}?!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\t\t\n\t\t\t\t\t\t\t\t//System.out.println(miscWords);\n\t\t\t\t\t\t\t\tif (hmap.containsValue(miscWords)) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, \" \");\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, miscWords);\n\t\t\t\t\t\t\t\t\tallTerms.add(miscWords);\n\t\t\t\t\t\t\t\t\tdocumentCount++;\n\t\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\tallTerms.add(miscWords);\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, miscWords);\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, miscWords);\n\t\t\t\t\t\t\t\t\tif (!(uniqueTerms.contains(miscWords)))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ((stopWordsSetting && !(stopWords.contains(miscWords))))\n\t\t\t\t\t\t\t\t\t\t\tuniqueTerms.add(miscWords);\n\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\n\t\t\t\t\t\t\t\t\tdocumentCount++;\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\ttotalAbstract.append(\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdocAndAbstract.get(documentFound).add(totalAbstract);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t//Once article is found, we enter all of of it's title and abstract terms \n\t\t\t\tif (articleNew == 0) \n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tdocumentFound = documentFound - 1;\n\t\t\t\t\t//System.out.println(\"Words found in Doc: \" + documentFound);\n\t\t\t\t\t//System.out.println(\"Map is\" +allValues);\n\t\t\t\t\tSet set = hmap.entrySet();\n\t\t\t\t\tIterator iterator = set.iterator();\n\n\t\t\t\t\tSet set2 = allValues.entrySet();\n\t\t\t\t\tIterator iterator2 = set2.iterator();\n\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tpostingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\tpostingsFileListAllWords.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\twhile (iterator.hasNext()) {\n\t\t\t\t\t\tMap.Entry mentry = (Map.Entry) iterator.next();\n\t\t\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t\t\t// (\"Value is: \" + mentry.getValue());\n\t\t\t\t\t\t// );\n\t\t\t\t\t\tString term = mentry.getValue().toString();\n\t\t\t\t\t\t// //\"This is going to be put in doc3: \"+ (documentFound-1));\n\t\t\t\t\t\tpostingsFileList.get(documentFound - 1).add(term);\n\t\t\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\t\t\tdocTermCount++;\n\t\t\t\t\t}\n\t\t\t\t\t// \"BEFORE its put in, this is what it looks like\" + hmap);\n\t\t\t\t\thmap2.putAll(hmap);\n\t\t\t\t\thmap.clear();\n\t\t\t\t\tarticleNew = 1;\n\n\t\t\t\t\tdocTermCountList.add(docTermCount);\n\t\t\t\t\tdocTermCount = 0;\n\n\t\t\t\t\twhile (iterator2.hasNext()) {\n\t\t\t\t\t\tMap.Entry mentry2 = (Map.Entry) iterator2.next();\n\t\t\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t\t\t// (\"Value2 is: \" + mentry2.getValue());\n\t\t\t\t\t\t// );\n\t\t\t\t\t\tString term = mentry2.getValue().toString();\n\t\t\t\t\t\t// //\"This is going to be put in doc3: \"+ (documentFound-1));\n\t\t\t\t\t\tpostingsFileListAllWords.get(documentFound - 1).add(term);\n\t\t\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\t\t\t// docTermCount++;\n\t\t\t\t\t}\n\n\t\t\t\t\tallValues.clear();\t\t\t\t\t\n\t\t\t\t\tdocumentFound = Integer.parseInt(arr[1]);\n\n\t\t\t\t\t// \"MEANWHILE THESE ARE ALL VALUES\" + postingsFileListAllWords);\n\n\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Looking at final doc!\");\n\t\t\t//Final loop for last sets\n\t\t\tSet set = hmap.entrySet();\n\t\t\tIterator iterator = set.iterator();\n\n\t\t\tSet setA = allValues.entrySet();\n\t\t\tIterator iteratorA = setA.iterator();\n\t\t\tpostingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\tpostingsFileListAllWords.put(documentFound - 1, new ArrayList<String>());\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\tMap.Entry mentry = (Map.Entry) iterator.next();\n\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t// (\"Value is: \" + mentry.getValue());\n\t\t\t\t// //);\n\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\tString term2 = mentry.getValue().toString();\n\t\t\t\tpostingsFileList.get(documentFound - 1).add(term2);\n\n\t\t\t\tdocTermCount++;\n\t\t\t}\n\t\t\t//System.out.println(\"Done looking at final doc!\");\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Sorting time!\");\n\t\t\twhile (iteratorA.hasNext()) {\n\t\t\t\tMap.Entry mentry2 = (Map.Entry) iteratorA.next();\n\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t// (\"Value2 is: \" + mentry2.getValue());\n\t\t\t\t// //);\n\t\t\t\tString term = mentry2.getValue().toString();\n\t\t\t\t// //\"This is going to be put in doc3: \"+ (documentFound-1));\n\t\t\t\tpostingsFileListAllWords.get(documentFound - 1).add(term);\n\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\t// docTermCount++;\n\t\t\t}\n\n\t\t\thmap2.putAll(hmap);\n\t\t\thmap.clear();\n\t\t\tdocTermCountList.add(docTermCount);\n\t\t\tdocTermCount = 0;\n\n\n\t\t\t\n\t\t\n\t\t\t// END OF LOOKING AT ALL DOCS\n\t\t\t\n\t\t\t//System.out.println(\"Docs and titles: \"+docAndTitles);\n\t\t\t\n\t\t\t//System.out.println(\"All terms\" +allTerms);\n\t\t\tString[] sortedArray = allTerms.toArray(new String[0]);\n\t\t\tString[] sortedArrayUnique = uniqueTerms.toArray(new String[0]);\n\t\t\t//System.out.println(Arrays.toString(sortedArray));\n\t\t\t\n\t\t\tArrays.sort(sortedArray);\n\t\t\tArrays.sort(sortedArrayUnique);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//Sortings \n\t\t\tSet set3 = hmap2.entrySet();\n\t\t\tIterator iterator3 = set3.iterator();\n\n\t\t\t// Sorting the map\n\t\t\t//System.out.println(\"Before sorting \" +hmap2);\t\t\t\n\t\t\tMap<Integer, String> map = sortByValues(hmap2);\n\t\t\t//System.out.println(\"after sorting \" +map);\n\t\t\t// //\"After Sorting:\");\n\t\t\tSet set2 = map.entrySet();\n\t\t\tIterator iterator2 = set2.iterator();\n\t\t\tint docCount = 1;\n\t\t\twhile (iterator2.hasNext()) {\n\t\t\t\tMap.Entry me2 = (Map.Entry) iterator2.next();\n\t\t\t\t// (me2.getKey() + \": \");\n\t\t\t\t// //me2.getValue());\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(\"Done sorting!\");\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Posting starts \");\n\t\t\t//\"THIS IS START OF DICTIONARTY\" \n\t\t\tBufferedWriter bw = null;\n\t\t\tFileWriter fw = null;\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Start making an array thats big as every doc total \");\n\t\t\tfor (int z = 1; z < documentFound+1; z++)\n\t\t\t{\n\t\t\t\ttermWeights.put(z, new ArrayList<Double>());\n\t\t\t}\n\t\t\t//System.out.println(\"Done making that large array Doc \");\n\t\t\t\n\t\t\t//System.out.println(\"Current Weights: \"+termWeights);\n\t\t\t\n\t\t\t//System.out.println(\"All terms\" +allTerms)\n\t\t\t//System.out.println(Arrays.toString(sortedArray));\n\t\t\t//System.out.println(Arrays.toString(sortedArrayUnique));\n\t\t\t//System.out.println(uniqueTerms);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//\tSystem.out.println(\"Posting starts \");\n\t\t\t// \tPOSTING FILE STARTS \n\t\t\ttry {\n\t\t\t\t// Posting File\n\t\t\t\t//System.out.println(\"postingsFileListAllWords: \"+postingsFileListAllWords); //Contains every word including Dups, seperated per doc\n\t\t\t\t//System.out.println(\"postingsFileList: \"+postingsFileList); \t\t //Contains unique words, dups are \" \", seperated per doc\n\t\t\t\t//System.out.println(\"postingsFileListAllWords.size(): \" +postingsFileListAllWords.size()); //Total # of docs \n\t\t\t\t//System.out.println(\"Array size: \"+sortedArrayUnique.length);\n\n\t\t\t\tfw = new FileWriter(POSTING);\n\t\t\t\tbw = new BufferedWriter(fw);\n\t\t\t\tString temp = \" \";\n\t\t\t\tDouble termFreq = 0.0;\n\t\t\t\t// //postingsFileListAllWords);\n\t\t\t\tList<String> finalTermList = new ArrayList<String>();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\t// //postingsFileList.get(i).size());\n\t\t\t\t\tfor (int j = 0; j < sortedArrayUnique.length; ++j)\t\t\t\t\t // go thru each word, CURRENT TERM\n\t\t\t\t\t{\n\t\t\t\t\t\t//System.out.println(\"Term is: \" + sortedArrayUnique[j]);\n\t\t\t\t\t\ttemp = sortedArrayUnique[j];\t\t\t\t\t\n\t\t\t\t\t\tif ((stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!(finalTermList.contains(temp))) \n\t\t\t\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\t//PART TO FIND DOCUMENT FREQ\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tint docCountIDF = 0;\n\t\t\t\t\t\t\t//Start here for dictionary \n\t\t\t\t\t\t\tfor (int totalWords = 0; totalWords < sortedArray.length; totalWords++) \t\t\n\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (temp.compareTo(\" \") == 0 || (stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//EITHER BLANK OR STOPWORD \n\t\t\t\t\t\t\t\t\t//System.out.println(\"fOUND STOP WORD\");\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tString temp2 = sortedArray[totalWords];\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Compare: \"+temp+ \" with \" +temp2);\n\t\t\t\t\t\t\t\t\tif (temp.compareTo(temp2) == 0) {\n\t\t\t\t\t\t\t\t\t\t// (temp2+\" \");\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tdocCountIDF++;\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//System.out.println(\"Total Number: \" +docCountIDF);\n\t\t\t\t\t\t\t//System.out.println(\"documentFound: \" +documentFound);\n\t\t\t\t\t\t\t//System.out.println(\"So its \" + documentFound + \" dividied by \" +docCountIDF);\n\t\t\t\t\t\t\t//docCountIDF = 1;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdouble idf = (Math.log10(((double)documentFound/(double)docCountIDF)));\n\t\t\t\t\t\t\t//System.out.println(\"Calculated IDF: \"+idf);\n\t\t\t\t\t\t\tif (idf < 0.0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tidf = 0.0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//System.out.println(\"IDF is: \" +idf);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"Size of doc words: \" + postingsFileListAllWords.size());\n\t\t\t\t\t\t\tfor (int k = 0; k < postingsFileListAllWords.size(); k++) \t\t//Go thru each doc. Since only looking at 1 term, it does it once per doc\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//System.out.println(\"Current Doc: \" +(k+1));\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\t\t\t\t\ttermFreq = 1 + (Math.log10(Collections.frequency(postingsFileListAllWords.get(k), temp)));\t\t\t\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Freq is: \" +Collections.frequency(postingsFileListAllWords.get(k), temp));\n\t\t\t\t\t\t\t\t\t//System.out.println(termFreq + \": \" + termFreq.isInfinite());\n\t\t\t\t\t\t\t\t\tif (termFreq.isInfinite() || termFreq <= 0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttermFreq = 0.0;\n\t\t\t\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\t\t\t\t//System.out.println(\"termFreq :\" +termFreq); \n\t\t\t\t\t\t\t\t\t//System.out.println(\"idf: \" +idf);\n\t\t\t\t\t\t\t\t\ttermWeights.get(k+1).add( (idf*termFreq) );\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"\");\n\t\t\t\t\t\t\tfinalTermList.add(temp);\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t//System.out.println(\"Current Weights: \"+termWeights);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//FINALCOUNTER\n\t\t\t\t\t\t//System.out.println(\"Done looking at word: \" +j);\n\t\t\t\t\t\t//System.out.println(\"\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Current Weights: \"+termWeights);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\twhile (true)\n\t\t\t\t {\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"Enter a query: \");\n\t\t\t\t\t\n\t \tScanner scanner = new Scanner(System.in);\n\t \tString enterQuery = scanner.nextLine();\n\t \t\n\t \t\n\t\t\t\t\tList<Double> queryWeights = new ArrayList<Double>();\n\t\t\t\t\t\n\t\t\t\t\t// Query turn\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tenterQuery = enterQuery.toLowerCase();\t\t\n\t\t\t\t\tenterQuery = enterQuery.replaceAll(\"[-&^%'*$+|{}?!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"]\", \"\");\n\t\t\t\t\t//System.out.println(\"Query is: \" + enterQuery);\n\t\t\t\t\t\n\t\t\t\t\tif (enterQuery.equals(\"exit\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tString[] queryArray = enterQuery.split(\" \");\n\t\t\t\t\tArrays.sort(queryArray);\n\t\t\t\t\t\n\t\t\t\t\t//Find the query weights for each term in vocab\n\t\t\t\t\tfor (int j = 0; j < sortedArrayUnique.length; ++j)\t\t\t\t\t // go thru each word, CURRENT TERM\n\t\t\t\t\t{\n\t\t\t\t\t\t//System.out.println(\"Term is: \" + sortedArrayUnique[j]);\n\t\t\t\t\t\ttemp = sortedArrayUnique[j];\t\t\t\t\t\n\t\t\t\t\t\tif ((stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\tint docCountDF = 0;\n\t\t\t\t\t\t//Start here for dictionary \n\t\t\t\t\t\tfor (int totalWords = 0; totalWords < queryArray.length; totalWords++) \t\t\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (temp.compareTo(\" \") == 0 || (stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//EITHER BLANK OR STOPWORD\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tString temp2 = queryArray[totalWords];\n\t\t\t\t\t\t\t\t//System.out.println(\"Compare: \"+temp+ \" with \" +temp2);\n\t\t\t\t\t\t\t\tif (temp.compareTo(temp2) == 0) {\n\t\t\t\t\t\t\t\t\t// (temp2+\" \");\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tdocCountDF++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tDouble queryWeight = 1 + (Math.log10(docCountDF));\n\t\t\t\t\t\tif (queryWeight.isInfinite())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tqueryWeight = 0.0;\n\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tqueryWeights.add(queryWeight);\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Query WEights is: \"+queryWeights);\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// Finding the norms for DOCS\t\t\t\t\t\n\t\t\t\t\tfor (int norms = 1; norms < documentFound+1; norms++)\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble currentTotal = 0.0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (int weightsPerDoc = 0; weightsPerDoc < termWeights.get(norms).size(); weightsPerDoc++)\n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tdouble square = Math.pow(termWeights.get(norms).get(weightsPerDoc), 2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"Current square: \" + termWeights.get(norms).get(weightsPerDoc));\n\t\t\t\t\t\t\tcurrentTotal = currentTotal + square;\n\t\t\t\t\t\t\t//System.out.println(\"Current total: \" + currentTotal);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//System.out.println(\"About to square root this: \" +currentTotal);\n\t\t\t\t\t\tdouble root = Math.sqrt(currentTotal);\n\t\t\t\t\t\tdocNorms.put(norms, root);\n\t\t\t\t\t}\n\t\t\t\t\t//System.out.println(\"All of the docs norms: \"+docNorms);\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Finding the norm for the query\n\t\t\t\t\tdouble currentTotal = 0.0;\t\t\t\t\t\n\t\t\t\t\tfor (int weightsPerDoc = 0; weightsPerDoc < queryWeights.size(); weightsPerDoc++)\n\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tdouble square = Math.pow(queryWeights.get(weightsPerDoc), 2);\n\t\t\t\t\t\tcurrentTotal = currentTotal + square;\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tdouble root = Math.sqrt(currentTotal);\n\t\t\t\t\tdouble queryNorm = root; \t\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Query norm \" + queryNorm);\n\t\t\t\t\t\n\t\t\t\t\t//Finding the cosine sim\n\t\t\t\t\t//System.out.println(\"Term Weights \" + termWeights);\n\t\t\t\t\tHashMap<Integer, Double> cosineScore = new HashMap<Integer, Double>();\n\t\t\t\t\tfor (int cosineSim = 1; cosineSim < documentFound+1; cosineSim++)\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble total = 0.0;\n\t\t\t\t\t\tfor (int docTerms = 0; docTerms < termWeights.get(cosineSim).size(); docTerms++)\n\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\tdouble docTermWeight = termWeights.get(cosineSim).get(docTerms);\n\t\t\t\t\t\t\tdouble queryTermWeight = queryWeights.get(docTerms);\n\t\t\t\t\t\t\t//System.out.println(\"queryTermWeight \" + queryTermWeight);\n\t\t\t\t\t\t\t//System.out.println(\"docTermWeight \" + docTermWeight);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttotal = total + (docTermWeight*queryTermWeight);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdouble cosineSimScore = 0.0;\n\t\t\t\t\t\tif (!(total == 0.0 || (docNorms.get(cosineSim) * queryNorm) == 0))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcosineSimScore = total / (docNorms.get(cosineSim) * queryNorm);\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\tcosineSimScore = 0.0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tcosineScore.put(cosineSim, cosineSimScore);\n\t\t\t\t\t}\n\t\t\t\t\tcosineScore = sortByValues2(cosineScore);\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"This is the cosineScores: \" +cosineScore);\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"docAndTitles: \"+ docAndTitles);\n\t\t\t\t\tint topK = 0;\n\t\t\t\t\tint noValue = 0;\n\t\t\t\t\tfor (Integer name: cosineScore.keySet())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (topK < 50)\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\n\t\t\t\t String key =name.toString();\n\t\t\t\t //String value = cosineScore.get(name).toString(); \n\t\t\t\t if (!(cosineScore.get(name) <= 0))\n\t\t\t\t {\n\t\t\t\t \tSystem.out.println(\"Doc: \"+key);\t\t\t\t \t\t\t\t\t \t\t\t\t\t \t\n\t\t\t\t \t\n\t\t\t\t \tStringBuilder builder = new StringBuilder();\n\t\t\t\t \tfor (StringBuilder value : docAndTitles.get(name)) {\n\t\t\t\t \t builder.append(value);\n\t\t\t\t \t}\n\t\t\t\t \tString text = builder.toString();\t\t\t\t \t\n\t\t\t\t \t//System.out.println(\"Title:\\n\" +docAndTitles.get(name));\n\t\t\t\t \tSystem.out.println(\"Title: \" +text);\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//System.out.println(\"Authors:\\n\" +docAndAuthors.get(name));\n\t\t\t\t \t\n\t\t\t\t \tif (docAndAuthors.get(name) == null || docAndAuthors.get(name).toString().equals(\"\"))\n\t\t\t\t \t{\n\t\t\t\t \t\tSystem.out.println(\"Authors: N\\\\A\\n\");\n\t\t\t\t \t}\n\t\t\t\t \telse \n\t\t\t\t \t{\t\t\t\t \t\t\t\t\t\t \t\n\t\t\t\t\t \tStringBuilder builder2 = new StringBuilder();\n\t\t\t\t\t \tfor (StringBuilder value : docAndAuthors.get(name)) {\n\t\t\t\t\t \t builder2.append(value);\n\t\t\t\t\t \t}\n\t\t\t\t\t \tString text2 = builder2.toString();\t\t\t\t \t\n\t\t\t\t\t \t\n\t\t\t\t\t \tSystem.out.println(\"Authors found: \" +text2);\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/* ABSTRACT \n\t\t\t\t \tif (docAndAbstract.get(name) == null)\n\t\t\t\t \t{\n\t\t\t\t \t\tSystem.out.println(\"Abstract: N\\\\A\\n\");\n\t\t\t\t \t}\n\t\t\t\t \telse \n\t\t\t\t \t{\t\t\t\t \t\t\t\t\t\t \t\n\t\t\t\t\t \tStringBuilder builder2 = new StringBuilder();\n\t\t\t\t\t \tfor (StringBuilder value : docAndAbstract.get(name)) {\n\t\t\t\t\t \t builder2.append(value);\n\t\t\t\t\t \t}\n\t\t\t\t\t \tString text2 = builder2.toString();\t\t\t\t \t\n\t\t\t\t\t \t\n\t\t\t\t\t \tSystem.out.println(\"Abstract: \" +text2);\n\t\t\t\t \t}\t\n\t\t\t\t \t*/\n\t\t\t\t \t\n\t\t\t\t \tSystem.out.println(\"\");\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t \tnoValue++;\n\t\t\t\t }\n\t\t\t\t topK++;\n\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\n\t\t\t\t\t\tif (noValue == documentFound)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(\"No documents contain query!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t\ttopK=0;\n\t\t\t\t\tnoValue = 0;\n\t\t\t\t }\n\t\t\t\t\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (bw != null)\n\t\t\t\t\t\tbw.close();\n\n\t\t\t\t\tif (fw != null)\n\t\t\t\t\t\tfw.close();\n\n\t\t\t\t} catch (IOException ex) {\n\n\t\t\t\t\tex.printStackTrace();\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (br != null)\n\t\t\t\t\tbr.close();\n\n\t\t\t\tif (fr != null)\n\t\t\t\t\tfr.close();\n\n\t\t\t} catch (IOException ex) {\n\n\t\t\t\tex.printStackTrace();\n\n\t\t\t}\n\n\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\tint itemCount = uniqueTerms.size();\n\t\t\t//System.out.println(allValues);\n\t\t\tSystem.out.println(\"Total Terms BEFORE STEMING: \" +itemCount);\n\t\t\tSystem.out.println(\"Total Documents \" + documentFound);\n\t\t\t\t\t\t\n\t\t \n\t\t\t \n\t\t\t \n\t\t\t//END OF MAIN\n\t\t}", "static void getMinScoreWordIndex(String[] words, int minScore){\n int currentMinScore = minScore;\n\n for(int i=0; i < words.length; i++){\n if (!tracker.contains(i)) {\n String word = words[i];\n int score = minScore(word);\n\n if(currentMinScore == -1){\n currentMinScore=score+1;\n tracker.add(i);\n }\n if(score < currentMinScore){\n currentMinScore = score;\n tracker.add(i);\n\n// minIndex = i;\n }\n\n\n }\n\n\n\n// if(i == words.length-1) return currentIndex ;\n\n\n }\n// return minIndex;\n }", "public float minDistancePair(int doc) throws IOException {\n float distance = 0f;\n final SortedSet<Integer> pos = new TreeSet<Integer>();\n final LeafReader reader = this.context.reader();\n if (reader != null && this.terms.size() > 1) {\n // get a sorted list of positions\n for (final TermCountPair term : this.terms) {\n final PostingsEnum posting =\n reader.postings(new Term(this.privateField, term.getTerm()), PostingsEnum.POSITIONS);\n if (posting != null) {\n // move to the document currently looking at\n posting.advance(doc);\n int count = 0;\n final int freq = posting.freq();\n // make sure to add them all\n while (count < freq) {\n pos.add(new Integer(posting.nextPosition()));\n count += 1;\n }\n }\n }\n // now find the closest pairs\n Integer dist = Math.abs(pos.first() - pos.last());\n final Iterator<Integer> it = pos.iterator();\n Integer prev = pos.last();\n Integer current;\n while (it.hasNext()) {\n current = it.next();\n if (Math.abs(current - prev) < dist) {\n dist = Math.abs(current - prev);\n }\n prev = current;\n }\n distance = dist.intValue();\n } else if (this.terms.size() > 1) {\n distance = this.getDocLength(doc);\n }\n return distance;\n }", "public static int EditDistance(String s, String t) {\n int len1=s.length();\n int len2=t.length();\n \n int matrix[][] =new int[len1+1][len2+1]; \n \n for(int i=0;i<=len1;i++){\n matrix[i][0]=i;\n }\n for(int i=0;i<=len2;i++){\n matrix[0][i]=i;\n } \n\n \n \n for(int i =1; i<=len1;i++){\n for(int j =1;j<=len2;j++){\n if(s.charAt(i-1)==t.charAt(j-1))\n {\n matrix[i][j]=matrix[i-1][j-1];\n }else{\n matrix[i][j]=min(matrix[i-1][j-1], matrix[i][j-1], matrix[i-1][j])+1;\n }\n }\n } \n \n \n \n \n \n /*\n for(int i =0; i<=len1;i++){\n for(int j =0;j<=len2;j++){\n System.out.print(\" \"+matrix[i][j]);\n }System.out.println(\"\");\n } */\n \n \n \n return matrix[len1][len2];\n }", "public int allWordsHorizontal(Board board, Dictionary dictionary, Scrabble game, int moves){\n // Initializes variables\n testBoard = board;\n String topHWord = \"\";\n int topHScore = 0;\n int topHRow=0;\n int topHCol=0;\n boolean theWay = true;\n boolean found = false;\n ArrayList<Piece> piecesOfTopWord = new ArrayList<Piece>();\n\n // Goes through ever point on the board\n for (int row = 0; row < 15; row++){\n for (int col = 0; col < 15; col++) {\n if (game.numOfMoves()==0){\n row = 7;\n col = 7;\n }\n \n // The word to make at that point\n mustUse=new ArrayList<Character>();\n mustUseVert=new ArrayList<Character>(); \n int retHorz = anagramAtSquare(row,col,col,0,false, moves);\n int retVert = anagramAtSquareVert(row,col,row,0,false, moves);\n \n // Puts the word on the board and checks to make sure valid word, and if it is top word it stores information about the word for horizontal words\n ArrayList<String> allAnagrams = null;\n if (retHorz!=-1){\n allAnagrams = allWords(retHorz, mustUse);\n for (int inde = 0; inde < allAnagrams.size(); inde++){\n ArrayList<String> test = dictionary.anagram(allAnagrams.get(inde).toLowerCase());\n if(test != null){\n for (int all = 0; all < test.size(); all++) {\n if (addToBoardHor(col, row, all, test, board)) {\n if (game.isValidMove()||moves==0) {\n ArrayList<ArrayList<Piece>> words = new ArrayList<ArrayList<Piece>>();\n words.addAll(board.words());\n if (game.isValidWord(words)){\n int trackScore=0;\n trackScore=board.scoreAI(words);\n if (board.numNonPinned() == 7)\n trackScore+=50;\n if (trackScore>topHScore && game.getStrength()){\n wordsToDisplay = new ArrayList<String>();\n for (int index = 0; index < words.size(); index++)\n {\n ArrayList<Piece> word = new ArrayList<Piece>();\n word = words.get(index);\n String wordToCheck = \"\";\n for (int indexInner = 0; indexInner < word.size(); indexInner++)\n wordToCheck += word.get(indexInner).theLetter();\n\n if (wordToCheck.length() > 1)\n wordsToDisplay.add(wordToCheck);\n }\n\n topHWord = test.get(all);\n topHScore = trackScore;\n topHRow=row;\n topHCol=col;\n theWay= true;\n found = true;\n piecesOfTopWord = words.get(0);\n } else if (trackScore>topHScore && trackScore<15){\n wordsToDisplay = new ArrayList<String>();\n for (int index = 0; index < words.size(); index++)\n {\n ArrayList<Piece> word = new ArrayList<Piece>();\n word = words.get(index);\n String wordToCheck = \"\";\n for (int indexInner = 0; indexInner < word.size(); indexInner++)\n wordToCheck += word.get(indexInner).theLetter();\n\n if (wordToCheck.length() > 1)\n wordsToDisplay.add(wordToCheck);\n }\n\n topHWord = test.get(all);\n topHScore = trackScore;\n topHRow=row;\n topHCol=col;\n theWay= true;\n found = true;\n piecesOfTopWord = words.get(0);\n }\n }\n \n board.clearNonPinned();\n } else {\n board.clearNonPinned();\n }\n }\n }\n }\n }\n }\n \n // Puts the word on the board and checks to make sure valid word, and if it is top word it stores information about the word for Vertical words\n allAnagrams = null;\n if (retVert!=-1){\n allAnagrams = allWords(retVert, mustUse);\n for (int inde = 0; inde < allAnagrams.size(); inde++){\n ArrayList<String> test = dictionary.anagram(allAnagrams.get(inde).toLowerCase());\n if(test != null){\n for (int all = 0; all < test.size(); all++) {\n if (addToBoardVer(col, row, all, test, board)) {\n if (game.isValidMove()||moves==0) {\n ArrayList<ArrayList<Piece>> words = new ArrayList<ArrayList<Piece>>();\n words.addAll(board.words());\n if (game.isValidWord(words)){\n int trackScore=0;\n trackScore=board.scoreAI(words);\n if (board.numNonPinned() == 7)\n trackScore+=50;\n if (trackScore>topHScore && game.getStrength()){\n wordsToDisplay = new ArrayList<String>();\n for (int index = 0; index < words.size(); index++)\n {\n ArrayList<Piece> word = new ArrayList<Piece>();\n word = words.get(index);\n String wordToCheck = \"\";\n for (int indexInner = 0; indexInner < word.size(); indexInner++)\n wordToCheck += word.get(indexInner).theLetter();\n\n if (wordToCheck.length() > 1)\n wordsToDisplay.add(wordToCheck);\n }\n \n topHWord = test.get(all);\n topHScore = trackScore;\n topHRow=row;\n topHCol=col;\n theWay=false;\n found = true;\n piecesOfTopWord = words.get(0);\n } else if (trackScore>topHScore && trackScore<15){\n wordsToDisplay = new ArrayList<String>();\n for (int index = 0; index < words.size(); index++)\n {\n ArrayList<Piece> word = new ArrayList<Piece>();\n word = words.get(index);\n String wordToCheck = \"\";\n for (int indexInner = 0; indexInner < word.size(); indexInner++)\n wordToCheck += word.get(indexInner).theLetter();\n\n if (wordToCheck.length() > 1)\n wordsToDisplay.add(wordToCheck);\n }\n \n topHWord = test.get(all);\n topHScore = trackScore;\n topHRow=row;\n topHCol=col;\n theWay=false;\n found = true;\n piecesOfTopWord = words.get(0);\n }\n }\n \n board.clearNonPinned();\n } else {\n board.clearNonPinned();\n }\n }\n }\n }\n }\n }\n \n if (game.numOfMoves()==0){\n row = 15;\n col = 15;\n }\n \n }\n }\n \n System.out.println(\"Top Word: \" + topHWord + \" Score: \" + topHScore + \" Row: \" + topHRow + \" Col: \" + topHCol+ \" HorOrVert: \" + theWay);\n for (int i = 0; i < piecesOfTopWord.size(); i++) {\n System.out.print(piecesOfTopWord.get(i).theLetter());\n }\n System.out.println();\n \n for (int i = 0; i < playersPieces.size(); i++) {\n System.out.print(playersPieces.get(i).theLetter());\n }\n System.out.println();\n \n // Returns what move to make\n if (found){\n putOnBoard(topHRow, topHCol, theWay,topHWord, piecesOfTopWord, board);\n return 1;\n }\n else if (!game.isBagEmpty()){\n return 2;\n }else\n return 3;\n }", "private static String test(double[][] test_data) {\n\n\t\t// Holds score for each word\n\t\tHashMap<Integer, Integer> scores = new HashMap<Integer, Integer>();\n\n\t\t// Euclidean distances hashamp for <Word, Distances> for each row\n\t\t// HashMap<String, double[]> distances = new HashMap<String,\n\t\t// double[]>();\n\t\tdouble[][] distances = new double[training_data.size()][test_data[0].length];\n\n\t\t// Just class names\n\t\tString[] classnames = training_data.keySet().toArray(new String[1]);\n\t\t// names = classnames;\n\t\t// System.out.println(Arrays.toString(classnames));\n\n\t\t// Initialize scores for each word to be 0\n\t\tfor (int i = 0; i < classnames.length; i++) {\n\t\t\tscores.put(i, 0);\n\t\t}\n\n\t\t// Convert MxN test data matrix to NxM for ease of use\n\t\ttest_data = Data.rotate(test_data);\n\n\t\t// Calculate scores for each row and populate the distances matrix\n\t\tfor (int i = 0; i < test_data.length; i++) {\n\t\t\tdouble min = Double.MAX_VALUE;\n\t\t\tint min_index = 0;\n\t\t\tint c = 0;\n\t\t\tfor (String name : training_data.keySet()) {\n\t\t\t\tdouble[][] train = training_data.get(name);\n\t\t\t\ttrain = Data.rotate(train);\n\t\t\t\t// System.out.println(\"Testing \" + name);\n\t\t\t\t// System.out.println(\"Calculating euc distance between: \" +\n\t\t\t\t// Arrays.toString(test_data[i]));\n\t\t\t\t// System.out.println(\" and: \" +\n\t\t\t\t// Arrays.toString(train[i]));\n\t\t\t\tdistances[c][i] = Data.calcEuclideanDistance(test_data[i],\n\t\t\t\t\t\ttrain[i]);\n\t\t\t\t// System.out.println(\"Distance: \" + distances[c][i]);\n\t\t\t\t// new Scanner(System.in).nextLine();\n\t\t\t\tif (min > distances[c][i]) {\n\t\t\t\t\tmin = distances[c][i];\n\t\t\t\t\tmin_index = c;\n\t\t\t\t}\n\t\t\t\tc++;\n\t\t\t}\n\t\t\t// System.out.print(\"\\n\"+classnames[min_index] + \" won with \" +\n\t\t\t// min);\n\t\t\tscores.put(min_index, scores.get(min_index) + 1);\n\t\t}\n\n\t\t// for (int i =0; i < distances.length; i++) {\n\t\t// for (int j = 0; j < distances[0].length; j++) {\n\t\t// System.out.print(distances[i][j] + \" \");\n\t\t// }\n\t\t// System.out.print(\"\\n\");\n\t\t// }\n\n\t\t// Word with the highest score wins\n\t\tdouble max = Double.MIN_VALUE;\n\t\tint index = 0;\n\t\tfor (Integer i : scores.keySet()) {\n\t\t\t// System.out.print(scores.get(i) + \",\");\n\t\t\tif (max < scores.get(i)) {\n\t\t\t\tmax = scores.get(i);\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\n\t\tconfusion_matrix.add(scores);\n\t\treturn classnames[index];\n\t}", "private String getWordStatsFromList(List<String> wordList) {\n\t\tif (wordList != null && !wordList.isEmpty()) {\n\t\t\tList<String> wordsUsedCaps = new ArrayList<>(); \n\t\t\tList<String> wordsExcludedCaps = new ArrayList<>(); \n\t\t\tListIterator<String> iterator = wordList.listIterator();\n\t\t\tMap<String, Integer> wordToFreqMap = new HashMap<>();\n\t\t\t// iterate on word List using listIterator to enable edits and removals\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\tString origWord = iterator.next();\n\t\t\t\t// remove quotes from word e.g. change parents' to parents; \n\t\t\t\t// change children's to children; change mark'd to mark\n\t\t\t\tString curWord = stripQuotes(origWord);\n\t\t\t\tif (!curWord.equals(origWord)) {\n\t\t\t\t\titerator.set(curWord);\n\t\t\t\t}\n\t\t\t\tString curWordCaps = curWord.toUpperCase();\n\t\t\t\t// remove words previously used (to prevent duplicates) or previously\n\t\t\t\t// excluded (compare capitalized version)\n\t\t\t\tif (wordsExcludedCaps.contains(curWordCaps)) {\n\t\t\t\t\titerator.remove();\n\t\t\t\t}\n\t\t\t\telse if (wordsUsedCaps.contains(curWordCaps)) {\n\t\t\t\t\t// if word was previously used then update wordToFreqMap to increment\n\t\t\t\t\t// its usage frequency\n\t\t\t\t\tSet<String> wordKeys = wordToFreqMap.keySet();\n\t\t\t\t\tfor (String word : wordKeys) {\n\t\t\t\t\t\tif (curWord.equalsIgnoreCase(word)) {\n\t\t\t\t\t\t\twordToFreqMap.put(word, wordToFreqMap.get(word).intValue() + 1);\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\titerator.remove();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// invoke checkIfEligible() with algorithm described in Challenge 2 to see if word not\n\t\t\t\t\t// previously used/excluded should be kept. If kept in list \n\t\t\t\t\t// then add to wordsUsedCaps list; if not qualified then add to\n\t\t\t\t\t// wordsExcludedCaps list to prevent checkIfEligible() having to be \n\t\t\t\t\t// called again\n\t\t\t\t\tif (checkIfEligible(curWordCaps)) {\n\t\t\t\t\t\twordsUsedCaps.add(curWordCaps);\n\t\t\t\t\t\twordToFreqMap.put(curWord, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\twordsExcludedCaps.add(curWordCaps);\n\t\t\t\t\t\titerator.remove();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// sort words in list in order of length\n\t\t\twordList.sort(Comparator.comparingInt(String::length));\n\t\t\t// sort wordToFreqMap by value (frequency) and choose the last sorted map element\n\t\t\t// to get most frequently used word\n\t\t\tList<Map.Entry<String, Integer>> mapEntryWtfList = new ArrayList<>(wordToFreqMap.entrySet());\n\t\t\tmapEntryWtfList.sort(Map.Entry.comparingByValue());\n\t\t\tMap<String, Integer> sortedWordToFreqMap = new LinkedHashMap<>();\n\t\t\tsortedWordToFreqMap.put(mapEntryWtfList.get(mapEntryWtfList.size()-1).getKey(), mapEntryWtfList.get(mapEntryWtfList.size()-1).getValue());\t\n\t\t\t// set up Json object to be returned as string\n\t\t\t// the code below is self-explaining\n\t\t\tJSONObject json = new JSONObject();\n\t\t\ttry {\n\t\t\t\tjson.put(\"remaining words ordered by length\", wordList);\n\t\t\t\tjson.put(\"most used word\", mapEntryWtfList.get(mapEntryWtfList.size()-1).getKey());\n\t\t\t\tjson.put(\"number of uses\", mapEntryWtfList.get(mapEntryWtfList.size()-1).getValue());\n\t\t\t} catch(JSONException je) {\n\t\t\t\tje.printStackTrace();\n\t\t\t}\n\t\t\treturn json.toString();\n\t\t\t\n\t\t}\n\t\treturn \"\";\n\t}", "public static void main(String[] args) {\n String[] words = {\"practice\", \"makes\", \"perfect\", \"coding\", \"makes\"};\n ShortestWordDistIII245 sw = new ShortestWordDistIII245();\n System.out.println(sw.shortestWordDistance(words, \"makes\", \"makes\"));\n }", "public List<RichWord> spellCheckText(List<String> inputTextList){\r\n\t\t\r\n\t\tList<RichWord> listaParole = new ArrayList<RichWord>();\r\n\t\t\r\n\t\t/*for(String input : inputTextList) {\r\n\t\t\tif(dizionario.contains(input.toLowerCase()))\r\n\t\t\t\tlistaParole.add(new RichWord(input, true));\r\n\t\t\telse\r\n\t\t\t\tlistaParole.add(new RichWord(input, false));\r\n\t\t}\r\n\t\t*/\r\n\t\t\r\n\t\tfor(String input : inputTextList) {\r\n\t\t\tRichWord rw = new RichWord(input);\r\n\t\t\t\r\n\t\t\t//Se il dizionario contiene la parola passata in input \r\n\t\t\t//setto la rich word come corretta\r\n\t\t\tif(dizionario.contains(input.toLowerCase()))\r\n\t\t\t\trw.setCorrect(true);\r\n\t\t\telse\r\n\t\t\t\trw.setCorrect(false);\r\n\t\t\t\r\n\t\t\tlistaParole.add(rw);\r\n\t\t}\r\n\t\t\r\n\t\treturn listaParole;\r\n\t}", "public static void main(String[] args) throws Exception {\n java.io.File threeLetterFile = new java.io.File(\"three-letter-words.txt\");\n \n //create custom SearchArray object with my search Methods\n threeletterwords.SearchArray search = new SearchArray();\n \n //create Scanner objects\n Scanner loadList = new Scanner(threeLetterFile);\n Scanner input = new Scanner(System.in);\n \n //declare arrays\n String[] threeLetterList = new String[1012];\n char[] startWordArray = new char[3];\n char[] finalWordArray = new char[3];\n char[] wordHolderArray = new char[3];\n char[] partialMatchArray = new char[3];\n char[] firstTwoArray = new char[2];\n char[] lastTwoArray = new char[2];\n \n //declare String Variables\n String startWord;\n String finalWord;\n String wordHolder;\n String partialMatch;\n String firstTwoHolder;\n String lastTwoHolder;\n \n //initialize boolean variables\n boolean wordCheck = true;\n boolean partialCheck = false;\n boolean firstTwoCheck = true;\n \n //initialize integer variables\n \n int moves = 0;\n int index = 0;\n \n /*This while loop will transfer the three letter words to the array\n * threeLetterList\n */\n \n while(loadList.hasNextLine()){\n threeLetterList[index] = loadList.nextLine();\n threeLetterList[index] = threeLetterList[index].toLowerCase();\n index++;\n }\n loadList.close();\n \n \n \n /* These do ... while loops make sure user only inputs a valid 3 letter \n * word from the list. Will loop until user gets it right.\n */\n \n do{\n System.out.println(\"Type in a Three Letter word from the list\");\n startWord = input.next();\n if (startWord.length() != 3){\n System.out.println(\"Word must be three Letters!\");\n }\n if (search.searchList(threeLetterList, startWord) == false){\n System.out.println(\"Word must be in list!\");\n }\n }while(startWord.length() != 3 || search.searchList(threeLetterList, startWord) == false);\n \n do{\n System.out.println(\"Type in a Second Three Letter word from the list\");\n finalWord = input.next();\n if (finalWord.length() != 3){\n System.out.println(\"Word must be three Letters!\");\n }\n if (search.searchList(threeLetterList, finalWord) == false){\n System.out.println(\"Word must be in list!\");\n }\n }while(finalWord.length() != 3 || search.searchList(threeLetterList, finalWord) == false);\n \n //initialize strings and arrays\n System.arraycopy(startWord.toCharArray(), 0, startWordArray, 0, 3);\n System.arraycopy(startWord.toCharArray(), 0, wordHolderArray, 0, 3);\n System.arraycopy(finalWord.toCharArray(), 0, finalWordArray, 0, 3);\n System.arraycopy(startWord.toCharArray(), 0, firstTwoArray, 0, 2);\n System.arraycopy(startWord.toCharArray(), 1, lastTwoArray, 0, 2);\n wordHolder = String.copyValueOf(wordHolderArray);\n firstTwoHolder = String.copyValueOf(firstTwoArray);\n lastTwoHolder = String.copyValueOf(lastTwoArray);\n \n /*the following section of code is what makes the \"moves\"\n * \n */\n while(wordHolder.toLowerCase().contentEquals(finalWord.toLowerCase()) == false){ \n for(int k = 0; k < finalWordArray.length; k++){\n if(wordHolderArray[k] != finalWordArray[k]){\n wordHolderArray[k] = finalWordArray[k];\n wordHolder = String.copyValueOf(wordHolderArray);\n if (search.searchList(threeLetterList, wordHolder) == true){\n moves++;\n System.out.println(\"Move \" + moves + \":\\t\" + wordHolder);\n }\n else{\n wordHolderArray[k] = startWordArray[k];\n wordHolder = String.copyValueOf(wordHolderArray);\n }\n }\n }\n if(wordHolder.toLowerCase().contentEquals(startWord.toLowerCase())){\n \n }\n } \n }", "@Test\n public void testEditDistDifferentStrings() throws Exception{\n assertEquals(1,Esercizio2.edit_distance_dyn(s1, s2));\n }", "public ArrayList<String> sortArrayByStringMinDistance(String qtxt,\n\t\t\tArrayList<String> inArr) {\n\t\tArrayList<StringObj> stringObjs = new ArrayList<StringObj>();\n\t\tArrayList<String> retArr = new ArrayList<String>();\n\n\t\tfor (String str : inArr) {\n\t\t\tstringObjs.add(new StringObj(getLevenshteinDistance(qtxt, str), str));\n\t\t}\n\n\t\tCollections.sort(stringObjs);\n\n\t\tfor (StringObj stringObj : stringObjs) {\n\t\t\tretArr.add(stringObj.str);\n\t\t}\n\n\t\treturn retArr;\n\t}", "public static <T extends Object> void applySubstitutionToWeights(Map<String, HashMap<T, Double>> weightMap, PatriciaTrie<HashMap<String, Double>> substitutionMap) {\n\t\tHashMap<String, HashMap<T, Double>> mapChanges = new HashMap<>();\r\n\t\t\r\n\t\tfor(Entry<String, HashMap<T, Double>> entry : weightMap.entrySet()) {\r\n\t\t\tString word = entry.getKey();\r\n\t\t\tfor(int i = 0; i < word.length(); i++) {\r\n\t\t\t\t// Search for entries that apply to this sentence (use first letter in prefix map to speed up the search)\r\n\t\t\t\tMap<String, HashMap<String, Double>> potentialSubstitutionMap = substitutionMap.prefixMap(word.substring(i, i+1));\r\n\t\t\t\tfor(Entry<String, HashMap<String, Double>> subEntry : potentialSubstitutionMap.entrySet() ) {\r\n\t\t\t\t\tString from = subEntry.getKey();\r\n\t\t\t\t\tif(word.length() - i >= from.length()) {\r\n\t\t\t\t\t\tif(word.substring(i, i+from.length()).equals(from)) {\r\n\t\t\t\t\t\t\t// We have a confirmed substitution\r\n\t\t\t\t\t\t\tfor(Entry<String, Double> substitution : subEntry.getValue().entrySet()) {\r\n\t\t\t\t\t\t\t\tString newWord = word.substring(0, i) + substitution.getKey() + word.substring(i+from.length());\r\n\t\t\t\t\t\t\t\tmapChanges.put(newWord, returnScaledMap(weightMap.get(word), substitution.getValue()));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Merge substitutions\r\n\t\tfor(Entry<String, HashMap<T, Double>> entry : mapChanges.entrySet()) {\r\n\t\t\tString word = entry.getKey();\r\n\t\t\tHashMap<T, Double> map = entry.getValue();\r\n\t\t\t// If the weight map didn't already contain the modified word, add the word to it\r\n\t\t\tif(!weightMap.containsKey(word)) {\r\n\t\t\t\tweightMap.put(word, map);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tHashMap<T, Double> currentMap = weightMap.get(word);\r\n\t\t\t\tfor(Entry<T, Double> weightEntry : map.entrySet()) {\r\n\t\t\t\t\tT key = weightEntry.getKey();\r\n\t\t\t\t\tif(currentMap.containsKey(key)) {\r\n\t\t\t\t\t\t// Add the old weight and new weight together if already exists\r\n\t\t\t\t\t\tcurrentMap.put(key, currentMap.get(key) + weightEntry.getValue());\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tcurrentMap.put(key, weightEntry.getValue());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private static void tooNearComp(int[][] mainArray, String tooNearStringPair, ArrayList<String> tooNearArray, int[] forcedList) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tString tooNearString = tooNearStringPair;\r\n\t\t\r\n\t\tswitch(tooNearString.charAt(0)) {\r\n\t\tcase 'A':\r\n\t\t\ttooNearComp2(mainArray, 0, tooNearString.charAt(1), tooNearArray, forcedList);\r\n\t\t\tbreak;\r\n\t\tcase 'B':\r\n\t\t\ttooNearComp2(mainArray, 1, tooNearString.charAt(1), tooNearArray, forcedList);\r\n\t\t\tbreak;\r\n\t\tcase 'C':\r\n\t\t\ttooNearComp2(mainArray, 2, tooNearString.charAt(1), tooNearArray, forcedList);\r\n\t\t\tbreak;\r\n\t\tcase 'D':\r\n\t\t\ttooNearComp2(mainArray, 3, tooNearString.charAt(1), tooNearArray, forcedList);\r\n\t\t\tbreak;\r\n\t\tcase 'E':\r\n\t\t\ttooNearComp2(mainArray, 4, tooNearString.charAt(1), tooNearArray, forcedList);\r\n\t\t\tbreak;\r\n\t\tcase 'F':\r\n\t\t\ttooNearComp2(mainArray, 5, tooNearString.charAt(1), tooNearArray, forcedList);\r\n\t\t\tbreak;\r\n\t\tcase 'G':\r\n\t\t\ttooNearComp2(mainArray, 6, tooNearString.charAt(1), tooNearArray, forcedList);\r\n\t\t\tbreak;\r\n\t\tcase 'H':\r\n\t\t\ttooNearComp2(mainArray, 7, tooNearString.charAt(1), tooNearArray, forcedList);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tOutputWriter.writeFile(forcedList, 0, \"No valid solution possible!\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n tfYourText = new javax.swing.JTextField();\n jScrollPane2 = new javax.swing.JScrollPane();\n tfWrongWords = new javax.swing.JTextField();\n jScrollPane3 = new javax.swing.JScrollPane();\n tfSuggestions1 = new javax.swing.JTextField();\n tfNumberMistakes = new javax.swing.JTextField();\n tfWrongWord1 = new javax.swing.JTextField();\n pbProgress = new javax.swing.JProgressBar();\n btCheck = new javax.swing.JButton();\n btNextWrongWord = new javax.swing.JButton();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jScrollPane1.setViewportView(tfYourText);\n\n tfWrongWords.setEditable(false);\n jScrollPane2.setViewportView(tfWrongWords);\n\n tfSuggestions1.setEditable(false);\n jScrollPane3.setViewportView(tfSuggestions1);\n\n tfNumberMistakes.setEditable(false);\n\n tfWrongWord1.setEditable(false);\n\n btCheck.setText(\"Check Spelling\");\n btCheck.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btCheckActionPerformed(evt);\n }\n });\n\n btNextWrongWord.setText(\"Next Wrong Word\");\n btNextWrongWord.setEnabled(false);\n\n jLabel1.setFont(new java.awt.Font(\"SansSerif\", 1, 24)); // NOI18N\n jLabel1.setText(\"Spell Checker\");\n\n jLabel2.setFont(new java.awt.Font(\"Serif\", 1, 15)); // NOI18N\n jLabel2.setText(\"Your Text:\");\n\n jLabel3.setFont(new java.awt.Font(\"SansSerif\", 1, 15)); // NOI18N\n jLabel3.setText(\"Wrong word:\");\n\n jLabel4.setFont(new java.awt.Font(\"SansSerif\", 1, 15)); // NOI18N\n jLabel4.setText(\"Number of mistakes: \");\n\n jLabel5.setFont(new java.awt.Font(\"SansSerif\", 1, 15)); // NOI18N\n jLabel5.setText(\"Suggestions:\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1)\n .addComponent(jScrollPane2)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel4)\n .addGap(18, 18, 18)\n .addComponent(tfNumberMistakes, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(jLabel5))\n .addGap(41, 41, 41)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 420, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(tfWrongWord1, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGap(0, 91, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(btCheck)\n .addGap(18, 18, 18)\n .addComponent(pbProgress, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(btNextWrongWord)\n .addComponent(jLabel1)\n .addComponent(jLabel2))\n .addGap(0, 0, Short.MAX_VALUE)))\n .addContainerGap())))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(btCheck)\n .addComponent(pbProgress, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel4)\n .addComponent(tfNumberMistakes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(tfWrongWord1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel3))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(jLabel5)\n .addGap(47, 47, 47)))\n .addComponent(btNextWrongWord))\n );\n\n pack();\n }", "private boolean checkDict(String word, String[] dict){\n int a = 0;\n int b = dict.length-1;\n while (a<=b) {\n int m = (a+b)/2;\n if (word.compareTo(dict[m]) == 0) return true;\n else if (word.compareTo(dict[m])>0) a = m+1;\n else b = m-1;\n }\n return false;\n }", "public void BruteForceSimilarity(String s1, String s2, int sLength) {\n\n s1_Array = splitStringIntoArray(s1, sLength);\n s2_Array = splitStringIntoArray(s2, sLength);\n\n// for (int i = 0; i < s1_Array.size(); i++) {\n//// System.out.println(s1_Array.get(i));\n// }\n// System.out.println(\"**************************\");\n//\n// for (int i = 0; i < s2_Array.size(); i++) {\n// System.out.println(s2_Array.get(i));\n// }\n\n }", "public List<String> match(List<String> someList)\n {\n char[] objectWord = this.aWord.toCharArray();\n Arrays.sort(objectWord);\n\n List<String> answer = new ArrayList<>();\n HashMap<String, Integer> mapForEachWord = new HashMap<>();\n\n for (int i = 0; i < someList.size(); i++)\n {\n String wordFromList = someList.get(i).toLowerCase();\n //mapForEachWord = processWord(wordFromList);\n\n char[] listWordArray = wordFromList.toCharArray();\n Arrays.sort(listWordArray);\n\n if (Arrays.equals(listWordArray, objectWord) && !this.aWord.equals(wordFromList))\n {\n answer.add(someList.get(i));\n }\n\n }\n\n return answer;\n }", "public void theDude() {\n\t\ttotal_targets = 0;\n\t\ttotal = 0;\n\t\tint target_count = 0;\n\t\tresult.clear();\n\t\t\n\t\tfor(int k=0; k<input.getWords().size();k++) {\n\t\t\tWord currentWordStat = input.getWordStatistics().get(k);\n\t\t\ttarget_count = 0;\n\t\t\t\n\t\t\tfor(int i=0;i<input.getWords().get(k).length();i++) {\n\t\t\t\tif(target.contains(input.getWords().get(k).charAt(i))) {\n\t\t\t\t\ttarget_count++;\n\t\t\t\t\ttotal_targets++;\n\t\t\t\t}\n\t\t\t\ttotal++;\n\t\t\t}\n\t\t\t\n\t\t\tif(result.containsKey(currentWordStat)) {\n\t\t\t\tresult.put(currentWordStat, result.get(currentWordStat)+target_count);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tresult.put(currentWordStat, target_count);\n\t\t\t}\n\t\t}\t\n\t}", "public double matchData() {\n\t\tArrayList<OWLDataProperty> labels1 = getDataProperties(ontology1);\n\t\tArrayList<OWLDataProperty> labels2 = getDataProperties(ontology2);\n\t\tfor (OWLDataProperty lit1 : labels1) {\n\t\t\tfor (OWLDataProperty lit2 : labels2) {\n\t\t\t\tif (LevenshteinDistance.computeLevenshteinDistance(TestAlign.mofidyURI(lit1.toString())\n\t\t\t\t\t\t, TestAlign.mofidyURI(lit2.toString()))>0.8){\n\t\t\t\t\treturn 1.0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0.;\n\n\n\t}" ]
[ "0.7459864", "0.62383074", "0.6099479", "0.6071125", "0.60492885", "0.6049104", "0.604283", "0.60357016", "0.6017925", "0.6006053", "0.5982794", "0.59486127", "0.59484744", "0.5923156", "0.58971477", "0.5860274", "0.5860137", "0.585713", "0.58212197", "0.57855254", "0.5780048", "0.57601815", "0.5726999", "0.5712638", "0.57056767", "0.5689049", "0.56849504", "0.5668863", "0.56650496", "0.56612545", "0.5633919", "0.5622443", "0.56202406", "0.5596675", "0.55841076", "0.55806804", "0.55794287", "0.55713606", "0.55668724", "0.5546442", "0.5542356", "0.55168104", "0.5503565", "0.5488511", "0.5468439", "0.5453536", "0.5452665", "0.5448368", "0.54378694", "0.5436431", "0.5426275", "0.5395271", "0.53925204", "0.5386335", "0.5381139", "0.5380936", "0.53502685", "0.5341727", "0.5341321", "0.5338224", "0.53350013", "0.53347474", "0.532148", "0.53107864", "0.5295652", "0.5287654", "0.52838045", "0.5281942", "0.52677345", "0.52666706", "0.52659464", "0.52621675", "0.52445835", "0.5242937", "0.5234029", "0.5223103", "0.5208195", "0.52081704", "0.52072144", "0.5203239", "0.5195515", "0.5187818", "0.5187357", "0.5181249", "0.51800054", "0.5179628", "0.5174551", "0.5167346", "0.5163039", "0.51553553", "0.5152864", "0.5151549", "0.5140827", "0.51400423", "0.5136057", "0.5134601", "0.5126752", "0.51171076", "0.51150674", "0.5115059" ]
0.8626115
0
Imports Common interface for the definition of a security context with a String will suffice.
public interface ISecurityContext { /** * Retrieves the Context String * @return String */ public String getContextString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface SecurityContext {\n\n}", "public abstract I_Authenticate getSecurityCtx();", "public interface SecurityService\r\n{\r\n\t/**\r\n\t * This method return true if the given 'securityToken' is a valid token for the given security service. The security service can be any service\r\n\t * such as OAuth, LDAP, ActiveDirectory, OpenID etc. It is up to the implementor of this interface to interact with the appropriate security\r\n\t * service to determine if the given securityToken is valid. Reasons for a token to not be valid include but are not limited to, expired tokens, \r\n\t * incorrect tokens, not authenticated tokens etc.<br/>\r\n\t * This method will be used by the provider in a DIRECT environment to authenticate/validate a consumer.\r\n\t * \r\n\t * @param securityToken The token that shall be validated against a given security service such as LDAP, OAuth, Active Directory, etc.\r\n\t * @param requestMetadata Metadata that has been sourced from a request. The environmentID property is always null because the token is\r\n * not yet authenticated and therefore the environment is not yet determined. \r\n\t * \r\n\t * @return TRUE if the token is known and valid to the security server and not expired. If a token is expired then FALSE should be returned.\r\n\t */\r\n\tpublic boolean validate(String securityToken, RequestMetadata requestMetadata);\r\n\r\n\t/**\r\n\t * This method may contact the security server which can be an OAuth server, and LDAP server a Active Directory etc. In return it will provide \r\n\t * information that relate to the securityToken such as: <br/>\r\n\t * a) Information about the application and/or user of that securityToken (appUserInfo property populated in the TokenInfo) or<br/>\r\n\t * b) Information about the SIF environment or SIF session the securityToken relates to. This would be the case for already existing SIF\r\n\t * Environments.<br/>\r\n\t * Further an expire date might be set for the securityToken if the token has expired. If the securityToken does not expire then the \r\n\t * expire date is null in the returned TokenInfo object.<br/>\r\n * This method will be used by the provider in a DIRECT environment to get information about a consumer's security token.\r\n\t * \r\n\t * @param securityToken The security token for which the TokenInfo shall be returned.\r\n\t * @param requestMetadata Metadata that has been sourced from a request. The environmentID property is always null because the token is\r\n * not yet authenticated and therefore the environment is not yet determined. \r\n\t * \r\n\t * @return See Desc. It is expected that this method only returns either the environmentKey or the SIF environment ID or the SIF session token but\r\n\t * not all of these at the same time.\r\n\t */\r\n\tpublic TokenInfo getInfo(String securityToken, RequestMetadata requestMetadata);\r\n\t\r\n\t/**\r\n\t * This method may contact the security server which can be an OAuth server, and LDAP server a Active Directory etc. to generate a \r\n\t * security token based on the given 'coreInfo'. It is expected that any consumer or a provider in a BROKERED environment calls this \r\n\t * method to retrieve a security token which it will use as the authorisation token in all SIF requests to a provider or broker.\r\n\t * \r\n\t * @param coreInfo Information about the consumer/provider that might be used to generate a security token by the external security service.\r\n\t * In most cases it would at least need the application key.\r\n\t * @param password It is very likely that some sort of password will be required to generate a security token.\r\n\t * \r\n\t * @return A TokenInfo object which will have the 'token' property set (the security token). Optional the 'tokenExpiryDate' may be set\r\n\t * if the token has an expire date. If the 'tokenExpiryDate' is null it is assumed that the returned security token won't expire.\r\n\t * The returned token should only be a token without any authentication method as a prefix. For example the token may be\r\n\t * \"ZjI2NThiNTktNDM1Yi00YThkLTlmNzYtYzI0MDBiNjY1NWMxOlBhc3N3b3JkMQ\". It should not hold the authentication method such as 'Bearer'\r\n\t * (i.e. not look like this: \"Bearer ZjI2NThiNTktNDM1Yi00YThkLTlmNzYtYzI0MDBiNjY1NWMxOlBhc3N3b3JkMQ\"). The SIF3 Framework will\r\n\t * manage the authentication method.\r\n\t */\r\n\tpublic TokenInfo createToken(TokenCoreInfo coreInfo, String password);\r\n}", "public SecurityContext getSecurityContext();", "public interface SecurityService {\n\n /**\n * Try to authenticate an user\n *\n * @param credentials to authenticate.\n * @return LoggedUser instance associated with credentials\n * @throws IOException if error generating token\n */\n LoggedUser authenticate(@Valid AccountCredentials credentials) throws IOException;\n\n /**\n * Creates a new LoggedUser instance with the requested role\n *\n * @param roleId requested role id.\n * @return new LoggedUser instance\n * @throws IOException if error generating token\n */\n LoggedUser changeRole(String roleId) throws IOException;\n\n /**\n * Gets info from logged user (LoggedUser instance)\n *\n * @return LoggedUser instance\n */\n LoggedUser getLoggedUser();\n\n /**\n * Hashes a value\n *\n * @param value value to be hashed.\n * @return hashed value\n */\n String hashValue(String value);\n}", "public interface SecurityConfiguration {\n\t\n\t/**\n\t * Gets the executor.\n\t *\n\t * @return the executor\n\t */\n\tExecutor getExecutor();\t\n\t\n\t/**\n\t * User preemptive auth.\n\t *\n\t * @return true, if successful\n\t */\n\tboolean userPreemptiveAuth();\n}", "private Security() { }", "public interface Insecure {\n}", "void enableSecurity();", "public interface SecurityMechanism extends EObject {\r\n}", "public interface ISecurityVerifier {\n public static final String COMPONENT_NAME = \"ISecurityVerifier\";\n\n Access getAllPossibleAccess(SecurityAccessor accessor, String resourceEntity, Access mask);\n\n boolean canAccess(SecurityAccessor accessor, String resourceEntity, Access access);\n\n boolean canAccess(SecurityAccessor accessor, String resourceEntity, Access access, Object... instances);\n\n void checkAccess(SecurityAccessor accessor, String resourceEntity, Access access) throws NoPermissionException;\n\n void checkAccess(SecurityAccessor accessor, String resourceEntity, Access access, Object... instances) throws NoPermissionException;\n\n boolean canAccessMappedResource(SecurityAccessor accessor, String mappedResource, Access access);\n\n void setAuthorityProvider(IAuthorityProvider provider);\n}", "public static synchronized void configureSecurity()\n {\n // import Component.Application.Console.Coherence;\n // import Component.Net.Security.Standard;\n // import com.tangosol.internal.net.security.DefaultStandardDependencies;\n // import com.tangosol.internal.net.security.LegacyXmlStandardHelper;\n // import com.tangosol.run.xml.XmlElement;\n \n if (isConfigured())\n {\n return;\n }\n \n DefaultStandardDependencies deps = null;\n Security security = null;\n \n try\n {\n // create security dependencies including default values\n deps = new DefaultStandardDependencies();\n \n // internal call equivalent to \"CacheFactory.getSecurityConfig();\"\n XmlElement xmlConfig = Coherence.getServiceConfig(\"$Security\");\n if (xmlConfig != null)\n {\n // load the security dependencies given the xml config \n deps = LegacyXmlStandardHelper.fromXml(xmlConfig, deps);\n \n if (deps.isEnabled())\n {\n // \"model\" element is not documented for now\n security = (Standard) _newInstance(\"Component.Net.Security.\" + deps.getModel()); \n }\n }\n }\n finally\n {\n // if Security is not instantiated, we still neeed to process\n // the dependencies to pickup the IdentityAsserter and IdentityTransformer\n // objects for the Security component (see onDeps()).\n if (security == null)\n {\n processDependencies(deps.validate());\n }\n else\n {\n // load the standard dependencies (currently only support Standard)\n if (deps.getModel().equals(\"Standard\"))\n {\n ((Standard) security).setDependencies(deps);\n }\n setInstance(security);\n }\n \n setConfigured(true);\n }\n }", "SecurityScope createSecurityScope();", "private SecurityConsts()\r\n\t{\r\n\r\n\t}", "public interface SecurityOptionIFace\n{\n /**\n * @return a unique name (without a security prefix) used by the security system, \n * doesn't need to be localized and is not intended to be human readable.\n */\n public abstract String getPermissionName();\n \n /**\n * @return the localized human readable title of the permission.\n */\n public abstract String getPermissionTitle();\n \n /**\n * @return a short localized description of the security option to help explain what it is.\n */\n public abstract String getShortDesc();\n \n /**\n * Return the icon that represents the task.\n * @param size use standard size (i.e. 32, 24, 20, 26)\n * @return the icon that represents the task\n */\n public abstract ImageIcon getIcon(int size);\n \n /**\n * @return a PermissionEditorIFace object that is used to set the permissions for the\n * the task.\n */\n public abstract PermissionEditorIFace getPermEditorPanel();\n \n /**\n * @return returns a permissions object\n */\n public abstract PermissionIFace getPermissions();\n \n /**\n * Sets a permission object.\n * @param permissions the object\n */\n public abstract void setPermissions(PermissionIFace permissions);\n \n /**\n * @return a list of addition Security options. These can be thought as 'sub-options'.\n */\n public abstract List<SecurityOptionIFace> getAdditionalSecurityOptions(); \n \n /**\n * @param userType the type of use, this value is implementation dependent, it can be null\n * @return the default permissions for a user type\n */\n public abstract PermissionIFace getDefaultPermissions(String userType);\n \n}", "public static Security_I create()\r\n\t\t{\r\n\t\treturn new Security();\r\n\t\t}", "private static Context createContext(final Context context)\r\n throws EscidocException, InternalClientException, TransportException, MalformedURLException {\r\n \t\r\n \t// prepare client object\r\n \tAuthentication auth = new Authentication(new URL(Constants.DEFAULT_SERVICE_URL), Constants.USER_NAME_SYSADMIN, Constants.USER_PASSWORD_SYSADMIN);\r\n \tContextHandlerClient chc = new ContextHandlerClient(auth.getServiceAddress());\r\n \tchc.setHandle(auth.getHandle());\r\n\r\n Context createdContext = chc.create(context);\r\n\r\n return createdContext;\r\n }", "public WebloungeWebConsoleSecurityProvider(SecurityService securityService) {\n this.securityService = securityService;\n }", "public interface SecurityService {\n\n PasswordEncoder getPasswordEncoder();\n\n void createAdminUser(NewUser newUser);\n\n org.springframework.security.core.userdetails.User getCurrentUserFromCtx();\n\n User getCurrentUser();\n\n void createOfficeUser(NewOfficeUser newOfficeUser);\n\n void lockUser(User user);\n\n void unLockUser(User user);\n\n void changePassword(ChangePassword changePassword);\n\n boolean resetPassword(User user);\n\n boolean isLogged();\n\n\n}", "protected EscidocAuthenticationProvider() {\r\n }", "public interface SecurityConstants {\n\n /**\n * 默认的处理验证码的url前缀\n */\n String DEFAULT_VALIDATE_CODE_URL_PREFIX = \"/code\";\n\n /**\n * 当请求需要身份认证时,默认跳转的url\n */\n String DEFAULT_UNAUTHENTICATION_URL = \"/authentication/require\";\n\n /**\n * 默认的用户名密码登录请求处理url\n */\n String DEFAULT_SIGN_IN_PROCESSING_URL_FORM = \"/oauth/login\";\n\n /**\n * 默认的手机验证码登录请求处理url\n */\n String DEFAULT_SIGN_IN_PROCESSING_URL_MOBILE = \"/oauth/mobile\";\n\n /**\n * 默认获取token的url\n */\n String DEFAULT_GET_TOKEN_URL = \"/oauth/token\";\n\n /**\n * 验证短信验证码时,http请求中默认的携带短信验证码信息的参数的名称\n */\n String DEFAULT_PARAMETER_NAME_CODE_SMS = \"smsCode\";\n /**\n * 发送短信验证码 或 验证短信验证码时,传递手机号的参数的名称\n */\n String DEFAULT_PARAMETER_NAME_MOBILE = \"mobile\";\n /**\n * 验证图片验证码时,http请求中默认的携带图片验证码信息的参数的名称\n */\n String DEFAULT_PARAMETER_NAME_CODE_IMAGE = \"imageCode\";\n}", "public interface ICredentials extends RequestPolicyFactory {\n\n}", "public interface IJ2EESecurity {\r\n /**\r\n * Change the users password in the J2EE Security Realm\r\n * @param request\r\n * @param response\r\n * @return\r\n */\r\n public boolean changePassword(HttpServletRequest request, HttpServletResponse response);\r\n\r\n /**\r\n * Reset a user's password in the J2EE Security Realm\r\n * @param request\r\n * @param userId userid\r\n * @param password new password\r\n */\r\n void resetPassword(HttpServletRequest request, String userId, String password) ;\r\n\r\n /**\r\n * Log a user out, invalidating all sessions and J2EE Security data\r\n * @param request\r\n */\r\n void logout(HttpServletRequest request);\r\n\r\n /**\r\n * Determines if a user already exists in the J2EE Security Realm\r\n * @param request\r\n * @param userId userid\r\n * @return true/false\r\n */\r\n boolean userExists(HttpServletRequest request, String userId);\r\n\r\n}", "Context createContext();", "Context createContext();", "@DOMSupport(DomLevel.ONE)\r\n @Property String getSecurity();", "public interface InstanceSecurable extends Securable\n{\n\t/**\n\t * Return an identifying string. This string is used to determine\n\t * which instance of the Securable class we're dealing with when\n\t * looking up authorizations.\n\t */\n\tpublic String getInstanceIdentifier();\n}", "public interface StandardContext extends Context\n{\n public static final String NAME_KEY = \"urn:avalon:name\";\n public static final String PARTITION_KEY = \"urn:avalon:partition\";\n public static final String WORKING_KEY = \"urn:avalon:temp\";\n public static final String HOME_KEY = \"urn:avalon:home\";\n\n /**\n * Return the name assigned to the component\n * @return the name\n */\n String getName();\n\n /**\n * Return the partition name assigned to the component\n * @return the partition name\n */\n String getPartitionName();\n\n /**\n * @return a file representing the home directory\n */\n File getHomeDirectory();\n\n /**\n * @return a file representing the temporary working directory\n */\n File getWorkingDirectory();\n\n}", "public interface SysPermissionService {\n}", "SecurityScheme createSecurityScheme();", "public interface ISecurityMonitorService {\n\n\n}", "public interface AutenticacionIBS extends AuthenticationProvider {\r\n\r\n}", "public interface SecurityService extends UserDetailsService {\n\n @Override\n public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException;\n}", "public interface AgroalSecurityProvider {\n\n /**\n * Converts a custom principal / credential objects to properties to be passed to the JDBC driver.\n * @return null if not capable of handle the security object, otherwise return a {@link Properties} object even if empty.\n */\n Properties getSecurityProperties(Object securityObject);\n}", "SecuritySchemeLibrary createSecuritySchemeLibrary();", "public abstract boolean authenticate(ServiceSecurity serviceSecurity, SecurityContext securityContext);", "static SecurityContext getSecurityContext() {\n if (System.getSecurityManager() != null) {\n return AccessController.doPrivileged(new PrivilegedAction<SecurityContext>() {\n public SecurityContext run() {\n return SecurityContextAssociation.getSecurityContext();\n }\n });\n } else {\n return SecurityContextAssociation.getSecurityContext();\n }\n }", "SecuritySchemeParameter createSecuritySchemeParameter();", "TrustedIdProvider create(Context context);", "SecurityProfile securityProfile();", "public static interface Credentials extends Serializable {\n\t\tpublic String getUserName();\n\t\t/**\n\t\t* The password is encrypted.\n\t\t*/\n\t\tpublic String getPassword();\n\t}", "@Role\npublic interface WebContext\n{\n Tenant getTenant();\n\n User getUser();\n\n void setUser(User user);\n\n void setTenant(Tenant tenant);\n\n Theme getTheme();\n\n void setTheme(Theme theme);\n\n void setSettings(Map<Class, Object> settings);\n\n <T extends ExposedSettings> T getSettings(Class<T> c);\n\n Locale getLocale();\n\n void setLocale(Locale locale);\n\n boolean isAlternativeLocale();\n\n void setAlternativeLocale(boolean alternativeLocale);\n\n Session getSession();\n\n void setSession(Session session);\n\n void setFlash(Flash flash);\n\n Flash getFlash();\n\n void flash(String name, Serializable value);\n\n void session(String name, Serializable value);\n\n WebRequest getRequest();\n\n void setRequest(WebRequest request);\n}", "public interface IAuthService {\n AuthInfo getAuthentication(String username, String password);\n}", "interface WithSecurityToken {\n /**\n * Specifies the securityToken property: The authorization token for the repo of the source control..\n *\n * @param securityToken The authorization token for the repo of the source control.\n * @return the next definition stage.\n */\n WithCreate withSecurityToken(SourceControlSecurityTokenProperties securityToken);\n }", "ExpressionTree createSecurityFeatureInitializer( WorkingCopy workingCopy,\n TreeMaker make, String id);", "public abstract String getSecret();", "public abstract boolean addRunAs(ServiceSecurity serviceSecurity, SecurityContext securityContext);", "public interface SipContext extends Context {\n\n\tpublic static final String APPLICATION_SIP_XML = \"WEB-INF/sip.xml\";\n\t\n\tpublic static final String LOAD_BALANCER = \"org.mobicents.servlet.sip.LoadBalancer\";\t\n\t\n\tString getApplicationName();\n\tString getApplicationNameHashed();\n\n\tboolean hasDistributableManager();\n\t\n\tvoid setApplicationName(String applicationName);\n\n\tString getDescription();\n\t\n\tvoid setDescription(String description);\n\t\n\tString getLargeIcon();\n\n\tvoid setLargeIcon(String largeIcon);\n\n\tSipListenersHolder getListeners();\n\n\tvoid setListeners(SipListenersHolder listeners);\n\n\tboolean isMainServlet();\n\t\n\tString getMainServlet();\n\n\tvoid setMainServlet(String mainServlet);\n\t\n\tvoid setServletHandler(String servletHandler);\n\tString getServletHandler();\n\n\tint getProxyTimeout();\n\t\n\tvoid setProxyTimeout(int proxyTimeout);\n\t\n\tint getSipApplicationSessionTimeout();\n\t\n\tvoid setSipApplicationSessionTimeout(int proxyTimeout);\n\n\tvoid addConstraint(org.apache.catalina.deploy.SecurityConstraint securityConstraint);\n\t\n\tvoid removeConstraint(org.apache.catalina.deploy.SecurityConstraint securityConstraint);\n\t\n\tString getSmallIcon();\n\n\tvoid setSmallIcon(String smallIcon);\n\n\tvoid addSipApplicationListener(String listener);\n\t\n\tvoid removeSipApplicationListener(String listener);\n\t\n\tString[] findSipApplicationListeners();\n\t\n\tMethod getSipApplicationKeyMethod();\n\t\n\tvoid setSipApplicationKeyMethod(Method sipApplicationKeyMethod);\n\t\n\tvoid setSipLoginConfig(SipLoginConfig config);\n\t\n\tSipLoginConfig getSipLoginConfig();\n\t\n\tvoid addSipServletMapping(SipServletMapping sipServletMapping);\n\t\n\tvoid removeSipServletMapping(SipServletMapping sipServletMapping);\n\t\n\tList<SipServletMapping> findSipServletMappings();\n\t\n\tSipServletMapping findSipServletMappings(SipServletRequest sipServletRequest);\n\t\n\tMap<String, Container> getChildrenMap();\n\tpublic Container findChildrenByName(String name);\t\n\tContainer findChildrenByClassName(String className);\n\t\n\tvoid addChild(SipServletImpl child);\n\t\n\tvoid removeChild(SipServletImpl child);\n\t\n\tSipManager getSipManager();\n\t\n\tSipApplicationDispatcher getSipApplicationDispatcher();\n\n//\tAnnotationProcessor getAnnotationProcessor();\n\t\n//\tInstanceManager getInstanceManager();\n\n\tSipInstanceManager getSipInstanceManager();\n\t\n\tString getEngineName();\n\n\tString getBasePath();\n\t\n\tboolean notifySipContextListeners(SipContextEvent event);\n\t\n//\tvoid enterSipApp(SipServletRequestImpl request, SipServletResponseImpl response);\n//\tvoid exitSipApp(SipServletRequestImpl request, SipServletResponseImpl response);\n\t\n\tvoid enterSipApp(MobicentsSipApplicationSession sipApplicationSession, MobicentsSipSession sipSession);\n\tvoid exitSipApp(MobicentsSipApplicationSession sipApplicationSession, MobicentsSipSession sipSession);\n\t\n//\tvoid enterSipAppHa(MobicentsSipApplicationSession sipApplicationSession, boolean startCacheActivity, boolean bindSessions);\n\tvoid enterSipAppHa(boolean startCacheActivity);\n//\tvoid enterSipAppHa(SipServletRequestImpl request, SipServletResponseImpl response, boolean startCacheActivity, boolean bindSessions);\n\tvoid exitSipAppHa(SipServletRequestImpl request, SipServletResponseImpl response);\n\t\n\tSipFactoryFacade getSipFactoryFacade();\n\t\n\tSipSessionsUtilImpl getSipSessionsUtil();\n\t\n\tTimerService getTimerService();\t\n\tProxyTimerService getProxyTimerService();\n\tSipApplicationSessionTimerService getSipApplicationSessionTimerService();\n\n\tvoid setConcurrencyControlMode(ConcurrencyControlMode mode);\n\tConcurrencyControlMode getConcurrencyControlMode();\n\n\tvoid setSipRubyController(SipRubyController rubyController);\n\tSipRubyController getSipRubyController();\n}", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public CryptoProvider() {\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\n \"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "public interface Securable\r\n{\r\n\t// public SecurityCheck addSecurityCheck( String checkType, String checkName\r\n\t// );\r\n\t//\r\n\t// public void addSecurityChecksListener( SecurityTestListener listener );\r\n\t//\r\n\t// public int getSecurityCheckCount();\r\n\t//\r\n\t// public SecurityCheck getSecurityCheckAt( int c );\r\n\t//\r\n\t// public void removeSecurityChecksListener( SecurityTestListener listener );\r\n\t//\r\n\t// public void removeSecurityCheck( SecurityCheck securityCheck );\r\n\t//\r\n\t// // public AssertionStatus getAssertionStatus();\r\n\t// //\r\n\t// // public enum AssertionStatus\r\n\t// // {\r\n\t// // UNKNOWN, VALID, FAILED\r\n\t// // }\r\n\t//\r\n\t// // public String getAssertableContent();\r\n\t//\r\n\t// // public String getDefaultAssertableContent();\r\n\t//\r\n\t// // public AssertableType getAssertableType();\r\n\t//\r\n\t// public List<SecurityCheck> getSecurityCheckList();\r\n\t//\r\n\t// public SecurityCheck getSecurityCheckByName( String name );\r\n\t//\r\n\t// public ModelItem getModelItem();\r\n\t//\r\n\t// public Interface getInterface();\r\n\t//\r\n\t// public SecurityCheck cloneSecurityCheck( SecurityCheck source, String name\r\n\t// );\r\n\t//\r\n\t// public Map<String, SecurityCheck> getSecurityChecks();\r\n\t//\r\n\t// public SecurityCheck moveSecurityCheck( int ix, int offset );\r\n}", "@Local\npublic interface IDistributedServiceAuthenticationService {\n boolean isValidToken(String token);\n public String getToken(Long userId) throws InternalServerErrorException, UnauthorizedException;\n UserDTO login(String username, String password) throws InternalServerErrorException, UnauthorizedException;\n UserDTO loginByToken(String token) throws UnauthorizedException, InternalServerErrorException;\n}", "protected CryptoProvider() {\n\n super(\"Crypto\", 1.0, \"HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)\");\n put(\"SecureRandom.SHA1PRNG\",\"org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl\");\n put(\"SecureRandom.SHA1PRNG ImplementedIn\", \"Software\");\n }", "void applySecurityRequirements(ReaderContext context, Operation operation, Method method);", "public SecurityContext(World world) {\n\t\tsuper();\n\t\tthis.whitelist = world.getWhitelist();\n\t\tthis.securityLevel = SecurityLevel.AUTHOR;\n\t\tthis.world = world;\n\t\tthis.entity = null;\n\t\tthis.team = TeamFlavor.AUTHOR;\n\t}", "public GluewineSecuredStaticHandler(String context, UseridPasswordAuthentication authenticator)\n {\n super(context);\n this.authenticator = authenticator;\n }", "public Secure() {\n\t\tsuper();\n\t}", "public abstract void makeContext();", "TrustedIdProvider apply(Context context);", "Context context();", "Context context();", "protected abstract String getAuthorization();", "public abstract T useTransportSecurity(File certChain, File privateKey);", "public interface Authentication extends Component {\n /**\n * Given an incoming HTTP request, determine who the user is and create a UserPermissions object with that\n * information. If the user cannot be identified and/or authenticated, don't set those attributes and throw an\n * exception. Otherwise return a UserPermissions object.\n */\n UserPermissions authenticate (Request request);\n}", "public interface Config {\n String SUCCESS = \"success\";\n String SUCCESS_CODE = \"10000\";\n String ERROR = \"error\";\n String ERROR_CODE = \"20000\";\n\n String ROLE_ADMIN = \"SYS_ADMIN\";\n String ROLE_GUEST = \"SYS_GUEST\";\n String IMG_FILE_PATH = \"upload/image\";\n String IMG_BANNER_TYPE = \"BANNER\";\n String IMG_ALBUM_TYPE = \"ALBUM\";\n String IMG_GLOBAL_TYPE = \"GLOBAL\";\n String GLOBAL_ABOUT_CODE=\"ABOUT\";\n String GLOBAL_REASON_CODE=\"REASON\";\n String AES_KEY = \"harlanking021109\";\n String HMAC_KEY = \"harlanking021109\";\n\n String CURRENT_USER_KEY = \"user\";\n}", "public abstract Context context();", "@Path(\"app\")\n @GET\n @View(\"hello.jsp\")\n public void sayHello(@Context SecurityContext securityContext) {\n\n logger.info(\"AdminRole :: \" + securityContext.isUserInRole(\"AdminRole\"));\n logger.info(\"admin :: \" + securityContext.isUserInRole(\"admin\"));\n logger.info(\"INFO :: \" + securityContext.isSecure());\n\n }", "SimpleContextVariable createSimpleContextVariable();", "public SecurityUser() {\n\t\tsuper();\n\t}", "public abstract boolean propagate(ServiceSecurity serviceSecurity, SecurityContext securityContext);", "public void setSecurityContext() {\n ctx = SecurityContextHolder.getContext();\n SecurityContextHolder.getContext();\n final Authentication authentication = ctx.getAuthentication();\n setName(authentication.getName()); //NOPMD\n }", "public UserContext getUserContext();", "@Test\n public void testGetSecurityContext() {\n System.out.println(\"getSecurityContext\");\n SpineSecurityContext result = instance.getSecurityContext();\n assertNotNull(result);\n }", "interface WithSecurityToken {\n /**\n * Specifies the securityToken property: The authorization token for the repo of the source control..\n *\n * @param securityToken The authorization token for the repo of the source control.\n * @return the next definition stage.\n */\n Update withSecurityToken(SourceControlSecurityTokenProperties securityToken);\n }", "@ThreadSafe\npublic interface AuthorizationProvider {\n\n public static String SENTRY_PROVIDER = \"sentry.provider\";\n\n /***\n * Returns validate subject privileges on given Authorizable object\n *\n * @param subject: UserID to validate privileges\n * @param authorizableHierarchy : List of object according to namespace hierarchy.\n * eg. Server->Db->Table or Server->Function\n * The privileges will be validated from the higher to lower scope\n * @param actions : Privileges to validate\n * @param roleSet : Roles which should be used when obtaining privileges\n * @return\n * True if the subject is authorized to perform requested action on the given object\n */\n public boolean hasAccess(Subject subject, List<? extends Authorizable> authorizableHierarchy,\n Set<? extends Action> actions, ActiveRoleSet roleSet);\n\n /***\n * Get the GroupMappingService used by the AuthorizationProvider\n *\n * @return GroupMappingService used by the AuthorizationProvider\n */\n public GroupMappingService getGroupMapping();\n\n /***\n * Validate the policy file format for syntax and semantic errors\n * @param strictValidation\n * @throws SentryConfigurationException\n */\n public void validateResource(boolean strictValidation) throws SentryConfigurationException;\n\n /***\n * Returns the list privileges for the given subject\n * @param subject\n * @return\n * @throws SentryConfigurationException\n */\n public Set<String> listPrivilegesForSubject(Subject subject) throws SentryConfigurationException;\n\n /**\n * Returns the list privileges for the given group\n * @param groupName\n * @return\n * @throws SentryConfigurationException\n */\n public Set<String> listPrivilegesForGroup(String groupName) throws SentryConfigurationException;\n\n /***\n * Returns the list of missing privileges of the last access request\n * @return\n */\n public List<String> getLastFailedPrivileges();\n\n /**\n * Frees any resources held by the the provider\n */\n public void close();\n}", "public SecurityContext(Entity entity) {\n\t\tsuper();\n\t\tthis.world = entity.getWorld();\n\t\tthis.whitelist = world.getWhitelist();\n\t\tswitch(entity.getTeam()) {\n\t\tcase AUTHOR:\n\t\t\tthis.securityLevel = SecurityLevel.AUTHOR;\n\t\t\tbreak;\n\t\tcase PLAYER:\n\t\t\tthis.securityLevel = SecurityLevel.TEAM;\n\t\t\tbreak;\n\t\tcase NONE:\n\t\tdefault:\n\t\t\tthis.securityLevel = SecurityLevel.NONE;\n\t\t\tbreak;\n\t\t\n\t\t}\n\t\tthis.entity = entity;\n\t\tthis.team = entity.getTeam();\n\t}", "@Override\n public void filter(ContainerRequestContext requestContext) throws IOException {\n String authorizationHeader =\n requestContext.getHeaderString(HttpHeaders.AUTHORIZATION);\n\n // Validate the Authorization header\n if (!isTokenBasedAuthentication(authorizationHeader)) {\n abortWithUnauthorized(requestContext);\n return;\n }\n\n // Extract the token from the Authorization header\n String token = authorizationHeader\n .substring(AUTHENTICATION_SCHEME.length()).trim();\n\n try {\n // Check if the token is valid\n validateToken(token);\n\n //extract the data you need\n String username = Jwts.parser().setSigningKey(keyGenerator.getKey()).parseClaimsJws(token).getBody().getIssuer();\n if (username!=null) {\n final SecurityContext securityContext = requestContext.getSecurityContext();\n requestContext.setSecurityContext(new SecurityContext() {\n @Override\n public Principal getUserPrincipal() {\n return new Principal() {\n @Override\n public String getName() {\n return username;\n }\n };\n }\n @Override\n public boolean isUserInRole(String permission) {\n\n List<RoleEntity> roleEntities = userDao.getUserByUsername(username).getRoleEntityList();\n List<PermissionEntity> permissionEntities = new ArrayList<>();\n\n //creating the list containg all the permissionsAllowed\n for (RoleEntity r : roleEntities) {\n for (PermissionEntity p : r.getPermissionEntityList()) {\n if (!permissionEntities.contains(p)) {\n permissionEntities.add(p);\n }\n }\n\n }\n\n List<String> permissionStrings = new ArrayList<>();\n\n //getting all the types (description and id are not important)\n for (PermissionEntity p : permissionEntities) {\n permissionStrings.add(p.getType());\n }\n\n //returns true if the list contains the permission given as parameter\n for (String p : permissionStrings) {\n if (p.equals(permission)) {\n return true;\n }\n }\n return false;\n }\n @Override\n public boolean isSecure() {\n return true;\n }\n @Override\n public String getAuthenticationScheme() {\n return AUTHENTICATION_SCHEME;\n }\n });\n }\n //getting value from annotation\n Method resourceMethod = resourceInfo.getResourceMethod();\n Secured secured = resourceMethod.getAnnotation(Secured.class);\n if (secured != null){\n List<String> permissionStrings = new ArrayList<>();\n for (SecurityPermission s : secured.permissionsAllowed()) {\n permissionStrings.add(s.getText());\n }\n\n //performing authorization\n if (permissionStrings.size() > 0 && !isAuthenticated(requestContext)) {\n refuseRequest();\n }\n\n for (String role : permissionStrings) {\n if (requestContext.getSecurityContext().isUserInRole(role)) {\n return;\n }\n else {\n throw new AuthentificationException(ExceptionMessageCatalog.NOT_ALLOWED);\n }\n }\n\n refuseRequest();\n }\n } catch (AuthentificationException e) {\n abortWithUnauthorized(requestContext);\n }\n }", "public interface WebConstants {\n String SESSION_USER = \"user\";\n}", "public interface SysUserService {\n List<String> getAllUrl();\n\n /**\n * 获取角色名称\n *\n * @param url\n * @return\n */\n List<String> getRoleNameByUrl(String url);\n\n /**\n * 根据loginName获取用户角色\n *\n * @param loginName\n * @return\n */\n List<SysUserRole> getRoleByLoginName(String loginName);\n\n /**\n * 根据Id获取SysUser\n *\n * @param userId\n * @return\n */\n SysUser getSysUserById(Integer userId);\n\n /**\n * 根据role_id获取roleName\n *\n * @param roleId\n * @return\n */\n String getRoleNameById(Integer roleId);\n\n /**\n * 根据登录信息获取用户\n *\n * @param loginName\n * @param userPassword\n * @return\n */\n SysUser getSysUser(String loginName, String userPassword);\n\n String queryRole();\n}", "public interface EcAuthService {\n\n /**\n * 接口信息鉴权\n * @param appKey appKey\n * @param appSecrect appSecrect\n * @param url 路径\n * @return 鉴权类信息\n */\n AuthResp auth(String appKey, String appSecrect, String url);\n}", "public interface SystemContext {\n\n public Bukkit getBukkit();\n\n public DatabaseManager getDatabaseManager();\n}", "protected SSLContext() {}", "public interface CredentialConnector {\n\n /**\n * Check whether the credential (e.g public key) associated with a stack (cluster) has present on Cloud provider.\n *\n * @param authenticatedContext the authenticated context which holds the client object\n * @return the status respone of method call\n */\n CloudCredentialStatus verify(@Nonnull AuthenticatedContext authenticatedContext);\n\n\n /**\n * Create the credential (e.g public key) associated with a stack (cluster) on Cloud provider.\n *\n * @param authenticatedContext the authenticated context which holds the client object\n * @return the status respone of method call\n */\n CloudCredentialStatus create(@Nonnull AuthenticatedContext authenticatedContext);\n\n\n /**\n * Interactive login for credential creation.\n *\n * @return parameters for interactive login\n */\n Map<String, String> interactiveLogin(CloudContext cloudContext, ExtendedCloudCredential extendedCloudCredential,\n CredentialNotifier credentialNotifier);\n\n /**\n * Delete the credential (e.g public key) associated with a stack (cluster) from Cloud provider.\n *\n * @param authenticatedContext the authenticated context which holds the client object\n * @return the status respone of method call\n */\n CloudCredentialStatus delete(@Nonnull AuthenticatedContext authenticatedContext);\n\n}", "public interface ScopeKeys {\n\n String SESSION_USER = \"user\";\n}", "public interface IUserInfoScm {\n\n}", "WithCreate withSecurityToken(SourceControlSecurityTokenProperties securityToken);", "public interface SysUserService {\n String getHelloWords();\n\n void addSysUser(SysUser user);\n\n SysUser getUserById(String id);\n\n SysUser getUserByLoginName(String sysUserLoginName);\n}", "public interface CryptoService {\n /**\n * Read encrypted password file.\n *\n * @param file Encrypted file instance.\n * @param password Password to decrypt file.\n *\n * @return file content.\n *\n * */\n String readFile(File file, String password);\n\n /**\n * Write and encrypt content to file.\n *\n * @param file encrypted file location.\n * @param password password which will be used to encrypt file.\n * @param cnt file content.\n * */\n void writeFile(File file, String password, String cnt);\n\n /**\n * Encrypt content\n *\n * @param password password which will be used to encrypt file.\n * @param textToEncrypt text which will be encrypted\n * @return encrypted content\n * */\n String encrypt(String password, String textToEncrypt);\n\n /**\n * Decrypt content\n *\n * @param password password which will be used to encrypt file.\n * @param textToDecrypt text which will be decrypted\n * @return decrypted content\n * */\n String decrypt(String password, String textToDecrypt);\n\n /**\n * Write and encrypt the password database.\n *\n * @param passwordDatabase passwords database which will be saved to encrypted file.\n * */\n void writeFile(PasswordDatabase passwordDatabase) throws JsonConversionException;\n}", "String getSecret();", "public Security getSecurity()\n {\n return __m_Security;\n }", "private void processSecurity(SecurityContext securityContext, ServerRequest req, ServerResponse res) {\n SecurityTracing tracing = SecurityTracing.get();\n tracing.securityContext(securityContext);\n\n // extract headers\n extractQueryParams(securityContext, req);\n\n securityContext.endpointConfig(securityContext.endpointConfig()\n .derive()\n .configMap(configMap)\n .customObjects(customObjects.orElse(new ClassToInstanceStore<>()))\n .build());\n\n try {\n AtxResult atnResult = processAuthentication(res, securityContext, tracing.atnTracing());\n\n AtxResult atzResult;\n if (atnResult.proceed) {\n atzResult = processAuthorization(req, res, securityContext, tracing.atzTracing());\n } else {\n atzResult = AtxResult.STOP;\n }\n\n if (atzResult.proceed) {\n // authorization was OK, we can continue processing\n tracing.logProceed();\n tracing.finish();\n\n // propagate context information in call to next\n res.next();\n } else {\n tracing.logDeny();\n tracing.finish();\n }\n } catch (Exception e) {\n tracing.error(e);\n LOGGER.log(Level.SEVERE, \"Unexpected exception during security processing\", e);\n abortRequest(res, null, Http.Status.INTERNAL_SERVER_ERROR_500.code(), Map.of());\n }\n\n // auditing\n res.whenSent(() -> processAudit(req, res, securityContext));\n }", "java.lang.String getSecret();", "interface ServiceProvisionContext extends Context<BaseExtension> {\n Optional<BindingTarget> target();\n Key<?> key();\n}", "public interface SAML2MessageReceiver {\n Credentials receiveMessage(SAML2MessageContext context);\n}", "public interface Parameters {\n\t\n\t// HTTP request parameters\n\tfinal static String OPENID_REMEMBERME = \"rememberOpenid\";\n\tfinal static String OPENID_IDENTIFIER = \"openid_identifier\";\n\tfinal static String OPENID_IDENTITY_COOKIE = \"esg.openid.identity.cookie\";\n\tfinal static int OPENID_IDENTITY_COOKIE_LIFETIME = 86400*365*10; // ten years\n\t\n\t// OpenID RP target URL\n\tfinal static String OPENID_URL = \"/j_spring_openid_security_check.htm\";\n\t\n\t// OpenID RP login URL\n\tfinal static String LOGIN_URL = \"/home.htm\";\n\t\n\t// OpenID Relying Party parameters\n\tfinal static String KEYSTORE_PATH = \"kestorePath\";\n\tfinal static String KEYSTORE_PASSWORD = \"kestorePassword\";\n\tfinal static String KEYSTORE_ALIAS = \"kestoreAlias\";\n\t\n\t// Secured application parameters\n\tfinal static String POLICY_SERVICE = \"policyServiceClass\";\n\tfinal static String POLICY_SERVICES = \"policyServiceClasses\";\n\tfinal static String POLICY_FILES = \"policyFiles\";\n\tfinal static String AUTHORIZATION_SERVICE = \"authorizationServiceClass\";\n\tfinal static String TRUSTORE_FILE = \"trustoreFile\";\n\tfinal static String TRUSTORE_PASSWORD = \"trustorePassword\";\n\tfinal static String OPENID_RP_URL = \"openidRelyingPartyUrl\";\n\tfinal static String REGISTRATION_RELAY_URL = \"registrationRelayUrl\";\n\tfinal static String AUTHORIZATION_SERVICE_URL = \"authorizationServiceUrl\";\n\tfinal static String AUTHORIZATION_URL_TRANSFORMER = \"urlTransformer\";\n\tfinal static String AUTHORIZATION_URL_TRANSFORMER_REPLACEMENTS = \"urlTransformerReplacements\";\n final static String AUTHORIZATION_REQUEST_ATTRIBUTE = \"eske.model.security.AuthorizationToken\"; // legacy value compatible with old TDS filter\n final static String AUTHENTICATION_REQUEST_ATTRIBUTE = \"esg.openid\";\n final static String AUTHENTICATION_ONLY_FLAG = \"authenticationOnlyFlag\";\n final static String AUTHENTICATION_REQUIRED_PATTERNS = \"authenticationRequiredPatterns\";\n final static String AUTHENTICATION_NOT_REQUIRED_PATTERNS = \"authenticationNotRequiredPatterns\";\n final static String AUTHORIZED_IP = \"authorizedIp\";\n final static String IP_WHITELIST = \"ip_whitelist\";\n\t\n\t// shared parameters\n\tfinal static String OPENID_REDIRECT = \"redirect\";\n\tfinal static String OPENID_IDENTITY = \"openid\";\n\tfinal static String OPENID_SAML_COOKIE = \"esg.openid.saml.cookie\";\n\tfinal static String SESSION_AUTH = \"authentication\";\n\t\n\t// new cookies\n\tfinal static String ORP_SESSION_ID_COOKIE = \"esg.session.cookie\";\n\t\n\t// HTTP request parameters\n public final static String HTTP_PARAMETER_XML = \"xml\";\n public final static String HTTP_PARAMETER_GROUP = \"group\";\n public final static String HTTP_PARAMETER_ROLE = \"role\";\n public final static String HTTP_PARAMETER_USER = \"user\";\n public final static String HTTP_PARAMETER_URL = \"url\";\n public final static String HTTP_PARAMETER_RESOURCE = \"resource\";\n public final static String HTTP_PARAMETER_RESULT = \"result\";\n\t\n\t// test file\n\tfinal static String TEST_FILE = \"esg-saml-test-file.xml\";\n\tfinal static String TEST_OPENID = \"http://JoeTester.myopenid.com/\";\n\n}", "public interface UserAuthorityService extends AbstractService<UserAuthority, Long> {\n\n void grantNormalAuth(Long userId);\n}", "protected SecurityObject() {\n\t\t// Used by JPA provider.\n\n\t\tLOGGER.debug(\"SecurityObject#co\");\n\t}", "TrustedIdProvider create();", "public interface LoginProvider {\n\n /**\n * Log in the user given the username and password, and returns a login context.\n *\n * @param username the username\n * @param password the password\n * @return the login context\n * @throws LoginException if the user cannot be logged in\n */\n LoginContext login(String username, String password) throws LoginException;\n\n}" ]
[ "0.75953585", "0.6758983", "0.6236305", "0.61458987", "0.6061218", "0.605522", "0.603687", "0.5956646", "0.59368336", "0.5891935", "0.5885328", "0.5861795", "0.5858316", "0.5839816", "0.58270335", "0.5817745", "0.5780139", "0.57528603", "0.57259", "0.5672337", "0.56580055", "0.56238925", "0.55980015", "0.5591803", "0.5591803", "0.5590769", "0.5534316", "0.5533417", "0.5507379", "0.5505614", "0.55013794", "0.5496697", "0.54925376", "0.54822564", "0.5481306", "0.5466762", "0.54475784", "0.542187", "0.5410029", "0.54014415", "0.5397762", "0.53516144", "0.53373826", "0.53363496", "0.5332842", "0.5311619", "0.53103113", "0.5309555", "0.53059095", "0.53059095", "0.53059095", "0.5305009", "0.5284172", "0.5281234", "0.5266388", "0.52607346", "0.52527857", "0.5234551", "0.52199244", "0.52191883", "0.5211944", "0.5211944", "0.52091557", "0.5205649", "0.5202366", "0.5186375", "0.5186213", "0.51838636", "0.517431", "0.5174139", "0.51578027", "0.5152142", "0.51496935", "0.5148506", "0.51231134", "0.51185656", "0.5109621", "0.5105182", "0.510469", "0.5096663", "0.5092394", "0.5083853", "0.5082868", "0.5070515", "0.50646114", "0.50466436", "0.5039945", "0.5025693", "0.50255144", "0.5022124", "0.5021773", "0.50181776", "0.5013477", "0.5012611", "0.5012306", "0.5007192", "0.4997925", "0.49970755", "0.49945205", "0.49884427" ]
0.7403555
1
Retrieves the Context String
public String getContextString();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getContext();", "public java.lang.String getContext() {\n java.lang.Object ref = context_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n context_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getContext() {\n java.lang.Object ref = context_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n context_ = s;\n return s;\n }\n }", "public String getContext() { return context; }", "public String getContext() {\r\n\t\treturn context;\r\n\t}", "public String getContext() {\n\t\treturn context;\n\t}", "public String getContext() {\n return context;\n }", "public String getContext() {\n return context;\n }", "public String getContext() {\n return context;\n }", "public String getTraceContextString() {\n Map<String, String> traceInfo = getTraceContext();\n if (traceInfo == null) {\n DDLogger.getLoggerImpl().debug(\"No Trace/Log correlation IDs returned\");\n return \"\";\n }\n\n String traceID = traceInfo.get(this.tracing.TRACE_ID_KEY);\n String spanID = traceInfo.get(this.tracing.SPAN_ID_KEY);\n return formatTraceContext(this.tracing.TRACE_ID_KEY, traceID, this.tracing.SPAN_ID_KEY, spanID);\n }", "default String getContext() {\n return getContextOpt().orElseThrow(IllegalStateException::new);\n }", "@Nullable\n default String getContext() {\n String contextName =\n String.valueOf(execute(DriverCommand.GET_CURRENT_CONTEXT_HANDLE).getValue());\n return \"null\".equalsIgnoreCase(contextName) ? null : contextName;\n }", "public com.google.protobuf.ByteString\n getContextBytes() {\n java.lang.Object ref = context_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n context_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getContextBytes() {\n java.lang.Object ref = context_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n context_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public String getContext() {\n int l=code.getCurLine();\n String s=\"\\t\\t at line:\" + l + \" \";\n if (l>-1) {\n s+=\"\\n\\t\\t\\t \"+code.getLineAsString(l-2);\n s+=\"\\n\\t\\t\\t \"+code.getLineAsString(l-1);\n s+=\"\\n\\t\\t\\t> \"+code.getLineAsString(l)+\" <\";\n s+=\"\\n\\t\\t\\t \"+code.getLineAsString(l+1);\n s+=\"\\n\\t\\t\\t \"+code.getLineAsString(l+2);\n s=s+ \"\\n\\t\\t current token:\" + tok.toString();;\n s=s+ \"\\n\\t\\t Variable dump:\" + vars;\n if (gVars!=null) {\n s=s+ \"\\n\\t\\t Globals:\" + gVars;\n }\n } else s+=\"\\n\\t\\t\\t> \"+tok.getLine()+\" <\";\n\n return s;\n }", "public com.google.protobuf.ByteString getContext() {\n return context_;\n }", "public com.google.protobuf.ByteString getContext() {\n return context_;\n }", "public java.lang.String getSourceContext() {\n java.lang.Object ref = sourceContext_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n sourceContext_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "private String context(){\r\n \r\n assert iMessage!=null;\r\n assert iIndex>=0;\r\n assert iIndex<=iMessage.length();\r\n\r\n return iMessage.substring(0, iIndex)+\" ^ \"+iMessage.substring(iIndex);//return parse context\r\n \r\n }", "public java.lang.String getSourceContext() {\n java.lang.Object ref = sourceContext_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n sourceContext_ = s;\n return s;\n }\n }", "public static String getContext(String key){\r\n return String.valueOf(scenarioContext.get(key));\r\n }", "public String getContext() {\n\t\treturn this.getClass().getSimpleName();\n\t}", "com.google.protobuf.ByteString getContext();", "String getContextId();", "public java.lang.CharSequence getContextId() {\n return contextId;\n }", "com.google.protobuf.ByteString\n getContextBytes();", "java.lang.String getSourceContext();", "String getContextPath();", "String getContextPath();", "String getContextPath();", "public java.lang.CharSequence getContextId() {\n return contextId;\n }", "public java.lang.String getLinkedContext() {\n java.lang.Object ref = linkedContext_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n linkedContext_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String getAgentContext() {\n return (String)getAttributeInternal(AGENTCONTEXT);\n }", "Context getContext();", "Map<String, Object> getContext();", "public java.lang.String getLinkedContext() {\n java.lang.Object ref = linkedContext_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n linkedContext_ = s;\n return s;\n }\n }", "String getContextPath() {\n return contextPath;\n }", "public static String getSrwContext() {\r\n if (srwContext == null) {\r\n srwContext = PropertiesProvider.getInstance().getProperty(\"srw.context\", \"/srw\");\r\n }\r\n return srwContext;\r\n }", "java.lang.String getLinkedContext();", "public abstract String toString(String context);", "public String getContextId() {\n return contextId;\n }", "public String getContextCharacters() {\r\n return this.text.toString();\r\n }", "public String tooltip()\n\t{\n\t if (contextURI==null)\n\t return \"(no context specified)\";\n\t \n\t if (contextURI.equals(Vocabulary.SYSTEM_CONTEXT.METACONTEXT))\n\t return \"MetaContext (stores data about contexts)\";\n\t \n\t if(contextURI.equals(Vocabulary.SYSTEM_CONTEXT.VOIDCONTEXT))\n\t \treturn \"VoID Context (stores statistics about contexts)\";\n\t \n\t if (type!=null && timestamp!=null)\n\t {\n\t GregorianCalendar c = new GregorianCalendar();\n\t c.setTimeInMillis(timestamp);\n\t \n\t String date = ReadWriteDataManagerImpl.dateToISOliteral(c.getTime()); \n\t \n\t if (!StringUtil.isNullOrEmpty(date))\n\t date = ValueResolver.resolveSysDate(date);\n\t \n\t String ret = \"Created by \" + type;\n\t if (type.equals(ContextType.USER))\n\t ret += \" '\"\n\t + source.getLocalName()\n\t + \"'\";\n\t else\n\t {\n\t String displaySource = null;\n\t if(source!=null)\n\t {\n\t displaySource = EndpointImpl.api().getNamespaceService().getAbbreviatedURI(source);\n\t if (StringUtil.isNullOrEmpty(displaySource))\n\t displaySource = source.stringValue(); // fallback solution: full URI\n\t }\n\t String displayGroup = null;\n\t if (group!=null)\n\t {\n\t displayGroup = EndpointImpl.api().getNamespaceService().getAbbreviatedURI(group);\n\t if (StringUtil.isNullOrEmpty(displayGroup))\n\t displayGroup = group.stringValue(); // fallback solution: full URI\n\t }\n\t \n\t ret += \" (\";\n\t ret += source==null ? \"\" : \"source='\" + displaySource + \"'\";\n\t ret += source!=null && group!=null ? \"/\" : \"\";\n\t ret += group==null ? \"\" : \"group='\" + displayGroup + \"'\";\n\t ret += \")\";\n\t }\n\t ret += \" on \" + date;\n\t if (label!=null)\n\t ret += \" (\" + label.toString() + \")\";\n\t if (state!=null && !state.equals(ContextState.PUBLISHED))\n\t ret += \" (\" + state + \")\"; \n\t return ret;\n\t }\n\t else\n\t return contextURI.stringValue();\n\t}", "public com.google.protobuf.ByteString\n getSourceContextBytes() {\n java.lang.Object ref = sourceContext_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n sourceContext_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getSourceContextBytes() {\n java.lang.Object ref = sourceContext_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n sourceContext_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public URI getCurrentContext();", "RenderingContext getContext();", "public static String getTestdataContext() {\r\n if (testdataContext == null) {\r\n testdataContext = PropertiesProvider.getInstance().getProperty(\"testdata.context\", \"/testdata\");\r\n }\r\n return testdataContext;\r\n }", "public static Context getContext() {\n\t\treturn context;\n\t}", "public static Context getContext() {\n\t\treturn context;\n\t}", "Context context();", "Context context();", "public String getOperationContext() {\n return this.operationContext;\n }", "public String getOperationContext() {\n return this.operationContext;\n }", "public String getContextProperty() {\n return _contextProperty;\n }", "CTX_Context getContext();", "@java.lang.Override\n public POGOProtos.Rpc.QuestProto.Context getContext() {\n @SuppressWarnings(\"deprecation\")\n POGOProtos.Rpc.QuestProto.Context result = POGOProtos.Rpc.QuestProto.Context.valueOf(context_);\n return result == null ? POGOProtos.Rpc.QuestProto.Context.UNRECOGNIZED : result;\n }", "@java.lang.Override public POGOProtos.Rpc.QuestProto.Context getContext() {\n @SuppressWarnings(\"deprecation\")\n POGOProtos.Rpc.QuestProto.Context result = POGOProtos.Rpc.QuestProto.Context.valueOf(context_);\n return result == null ? POGOProtos.Rpc.QuestProto.Context.UNRECOGNIZED : result;\n }", "@Override public String toString() {\n return \"\" + \"Context=\" + \"[LLVMContext]\" // NOI18N\n + \", GlobalList=\" + NativeTrace.getIdentityStr(GlobalList) // NOI18N\n + \", FunctionList=\" + NativeTrace.getIdentityStr(FunctionList) // NOI18N\n + \", AliasList=\" + NativeTrace.getIdentityStr(AliasList) // NOI18N\n + \", IFuncList=\" + NativeTrace.getIdentityStr(IFuncList) // NOI18N\n + \", NamedMDList=\" + NativeTrace.getIdentityStr(NamedMDList) // NOI18N\n + \", GlobalScopeAsm=\" + GlobalScopeAsm // NOI18N\n + \", ValSymTab=\" + NativeTrace.getIdentityStr(ValSymTab) // NOI18N\n + \", ComdatSymTab=\" + NativeTrace.getIdentityStr(ComdatSymTab) // NOI18N\n + \", Materializer=\" + Materializer // NOI18N\n + \", ModuleID=\" + ModuleID // NOI18N\n + \", SourceFileName=\" + SourceFileName // NOI18N\n + \", TargetTriple=\" + TargetTriple // NOI18N\n + \", NamedMDSymTab=\" + NativeTrace.getIdentityStr(NamedMDSymTab) // NOI18N\n + \", DL=\" + DL; // NOI18N\n }", "public Context getContext() {\n\t\treturn context;\n\t}", "public static String getContext(HttpServletRequest request) {\n\t\tString context = request.getParameter(CONTEXT_KEY);\n\t\tif (context == null && Server.getInstance().getAllKnownInternalContexts().size() == 1) {\n\t\t\tcontext = (String) Server.getInstance().getAllKnownInternalContexts().toArray()[0];//req.getContextPath();\n\t\t}\n\t\t// If no or invalid context, display a list of available WebApps\n\t\tif (context == null || Server.getInstance().getApplication(context) == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn context;\n\t\t}\n\t}", "public Context getContext() {\r\n\t\treturn context;\r\n\t}", "public String toString()\n {\n return Native.getNumeralString(getContext().nCtx(), getNativeObject());\n }", "public static String getExtraString(Activity context, String key) {\n \tString param = \"\";\n \tBundle bundle = context.getIntent().getExtras();\n \tif(bundle!=null){\n \t\tparam = bundle.getString(key);\n \t}\n \treturn param;\n\t}", "public cl_context getContext() {\r\n return context;\r\n }", "protected final TranslationContext context() {\n\t\treturn context;\n\t}", "public static String getFrameworkContext() {\r\n if (frameworkContext == null) {\r\n frameworkContext = PropertiesProvider.getInstance().getProperty(\"server.context\", \"/escidoc\");\r\n if (!frameworkContext.startsWith(\"/\")) {\r\n frameworkContext = \"/\" + frameworkContext;\r\n }\r\n }\r\n return frameworkContext;\r\n }", "public String getSessionContext() {\n return this.SessionContext;\n }", "public String toString() {\n\treturn state.toString() + \" \" + context.toString();\n }", "long getCurrentContext();", "@Override\n\tpublic String getContextPath() {\n\t\treturn contextPath;\n\t}", "public Context getContext() {\n return context;\n }", "public String getContextAssertion() {\n return this.contextAssertion;\n }", "public String getContextID() throws PolicyContextException {\n\tcheckSetPolicyPermission();\n\treturn this.CONTEXT_ID;\n }", "public java.lang.String getOuterContextId() {\n java.lang.Object ref = outerContextId_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n outerContextId_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "protected String toString(DID context) {\n\t\tStringBuilder builder = new StringBuilder(512);\n\t\tif (did != null && (context == null || !did.equals(context)))\n\t\t\tbuilder.append(did);\n\n\t\tif (path != null && !path.isEmpty())\n\t\t\tbuilder.append(path);\n\n\t\tif (query != null && !query.isEmpty())\n\t\t\tbuilder.append(\"?\").append(getQueryString());\n\n\t\tif (fragment != null && !fragment.isEmpty())\n\t\t\tbuilder.append(\"#\").append(getFragment());\n\n\t\treturn builder.toString();\n\t}", "public String showContextChosen() {\n String s = \"\";\n\n for (Context c : surveyContext.values()) {\n s = s.concat(c.getContextName() + \":\\n\" +\n c.showActivitiesChosen() +\n \"\\n\\n\");\n }\n return s;\n }", "public String getContext(String namespace, String key) {\n String value = null;\n Map<String, String> namespaceMap = context.get(namespace);\n if (namespaceMap != null) {\n value = namespaceMap.get(key);\n }\n return value;\n }", "com.google.protobuf.ByteString\n getSourceContextBytes();", "public Context getContext() {\n return contextMain;\n }", "public String getCurrent() {\n\t\t\tString result=\"\";\n\t\t\treturn result ;\n\t\t}", "@Override\r\n\tpublic Context getContext() {\r\n\t\treturn this.context;\r\n\t}", "public java.lang.String getOuterContextId() {\n java.lang.Object ref = outerContextId_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n outerContextId_ = s;\n return s;\n }\n }", "void getContext() {\n playerName = getIntent().getExtras().getString(\"player_name\");\n Log.i(\"DiplomaActivity\", \"getContext - Player name: \" + playerName);\n }", "public final Object getContextInfo() {\n return this.info;\n }", "public static String getTempRequest() {\n\t\treturn MDC.get(ApplicationConstants.TEMP_REQUEST);\n\t}", "public static Context getContext(){\n return appContext;\n }", "private String appendContextMessage(String msg) {\n\t\treturn msg;\r\n\t}", "@java.lang.Override public int getContextValue() {\n return context_;\n }", "public Context getContext() {\n\t\treturn ctx;\n\t}", "Context getContext() {\n Context context = mContextRef.get();\n return context != null ? context : AppUtil.getAppContext();\n }", "String getProviderString();", "public static String getOaiproviderContext() {\r\n if (oaiproviderContext == null) {\r\n oaiproviderContext =\r\n PropertiesProvider.getInstance().getProperty(\"oaiprovider.context\", \"/escidoc-oaiprovider/\");\r\n }\r\n return oaiproviderContext;\r\n }", "private static String m19532b(Context context) {\n String str = null;\n try {\n ApplicationInfo applicationInfo = context.getApplicationInfo();\n if (applicationInfo == null) {\n return null;\n }\n str = applicationInfo.sourceDir;\n return str;\n } catch (Throwable unused) {\n }\n }", "public abstract Context context();", "@java.lang.Override public int getContextValue() {\n return context_;\n }", "public Context getContext() {\n\t\treturn null;\n\t}", "public String getContextUrl() {\n String currentURL = driver.getCurrentUrl();\n return currentURL.substring(0, currentURL.lastIndexOf(\"/login\"));\n }", "static synchronized Context getContext() {\n checkState();\n return sInstance.mContext;\n }", "public int getContextId() {\n return contextId;\n }" ]
[ "0.8250086", "0.82296646", "0.8082728", "0.78362983", "0.7810732", "0.77995056", "0.7734992", "0.7734992", "0.7734992", "0.75126386", "0.7331645", "0.7293789", "0.72775227", "0.7108147", "0.70953315", "0.7063765", "0.7042531", "0.7036486", "0.6997672", "0.692424", "0.68912673", "0.684861", "0.6834105", "0.6698647", "0.668221", "0.6675028", "0.66553336", "0.6654199", "0.6654199", "0.6654199", "0.6647789", "0.65832573", "0.6582887", "0.65822995", "0.6501209", "0.64995086", "0.6469331", "0.63570917", "0.6354273", "0.6349894", "0.6294497", "0.6272888", "0.62586266", "0.6245369", "0.62222886", "0.6206272", "0.6197795", "0.6185645", "0.6176803", "0.6176803", "0.61496687", "0.61496687", "0.60549164", "0.60549164", "0.6052842", "0.60500526", "0.60430616", "0.60427797", "0.60339123", "0.6024656", "0.6016509", "0.60119295", "0.6009415", "0.6006092", "0.59965074", "0.5989723", "0.59392196", "0.59237444", "0.59204096", "0.590041", "0.58801454", "0.58763665", "0.5873087", "0.5868519", "0.5857159", "0.5852377", "0.5817458", "0.5816556", "0.5800275", "0.5796249", "0.5783382", "0.5776176", "0.5769594", "0.57630134", "0.5761824", "0.57613593", "0.5757488", "0.5750573", "0.5747464", "0.57370824", "0.57150674", "0.5708182", "0.5700807", "0.5698857", "0.5688615", "0.5683658", "0.5677595", "0.5670123", "0.56683344", "0.5654773" ]
0.8664641
0
Create an entity for this test. This is a static method, as tests for other entities might also need it, if they test an entity which requires the current entity.
public static Profile createEntity(EntityManager em) { Profile profile = new Profile() .height(DEFAULT_HEIGHT) .weight(DEFAULT_WEIGHT) .location(DEFAULT_LOCATION) .dob(DEFAULT_DOB); return profile; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Entity createEntity();", "T createEntity();", "protected abstract ENTITY createEntity();", "void create(E entity);", "void create(T entity);", "E create(E entity);", "E create(E entity);", "TestEntity buildEntity () {\n TestEntity testEntity = new TestEntity();\n testEntity.setName(\"Test name\");\n testEntity.setCheck(true);\n testEntity.setDateCreated(new Date(System.currentTimeMillis()));\n testEntity.setDescription(\"description\");\n\n Specialization specialization = new Specialization();\n specialization.setName(\"Frontend\");\n specialization.setLevel(\"Senior\");\n specialization.setYears(10);\n\n testEntity.setSpecialization(specialization);\n\n return testEntity;\n }", "protected abstract EntityBase createEntity() throws Exception;", "public static TestEntity createEntity(EntityManager em) {\n TestEntity testEntity = new TestEntity();\n // Add required entity\n User user = UserResourceIntTest.createEntity(em);\n em.persist(user);\n em.flush();\n testEntity.setUserOneToMany(user);\n return testEntity;\n }", "void create(T entity) throws Exception;", "@Override\n protected void createEntity() {\n ProjectStatus status = createProjectStatus(5);\n setEntity(status);\n }", "protected T createSimulatedExistingEntity() {\n final T entity = createNewEntity();\n entity.setId(IDUtil.randomPositiveLong());\n\n when(getDAO().findOne(entity.getId())).thenReturn(entity);\n return entity;\n }", "public Entity newEntity() { return newMyEntity(); }", "public Entity newEntity() { return newMyEntity(); }", "public static TranshipTube createEntity(EntityManager em) {\n TranshipTube transhipTube = new TranshipTube()\n .status(DEFAULT_STATUS)\n .memo(DEFAULT_MEMO)\n .columnsInTube(DEFAULT_COLUMNS_IN_TUBE)\n .rowsInTube(DEFAULT_ROWS_IN_TUBE);\n // Add required entity\n TranshipBox transhipBox = TranshipBoxResourceIntTest.createEntity(em);\n em.persist(transhipBox);\n em.flush();\n transhipTube.setTranshipBox(transhipBox);\n // Add required entity\n FrozenTube frozenTube = FrozenTubeResourceIntTest.createEntity(em);\n em.persist(frozenTube);\n em.flush();\n transhipTube.setFrozenTube(frozenTube);\n return transhipTube;\n }", "public static Student createEntity(EntityManager em) {\n Student student = new Student()\n .firstName(DEFAULT_FIRST_NAME)\n .middleName(DEFAULT_MIDDLE_NAME)\n .lastName(DEFAULT_LAST_NAME)\n .studentRegNumber(DEFAULT_STUDENT_REG_NUMBER)\n .dateOfBirth(DEFAULT_DATE_OF_BIRTH)\n .regDocType(DEFAULT_REG_DOC_TYPE)\n .registrationDocumentNumber(DEFAULT_REGISTRATION_DOCUMENT_NUMBER)\n .gender(DEFAULT_GENDER)\n .nationality(DEFAULT_NATIONALITY)\n .dateJoined(DEFAULT_DATE_JOINED)\n .deleted(DEFAULT_DELETED)\n .wxtJwtPq55wd(DEFAULT_WXT_JWT_PQ_55_WD);\n // Add required entity\n NextOfKin nextOfKin;\n if (TestUtil.findAll(em, NextOfKin.class).isEmpty()) {\n nextOfKin = NextOfKinResourceIT.createEntity(em);\n em.persist(nextOfKin);\n em.flush();\n } else {\n nextOfKin = TestUtil.findAll(em, NextOfKin.class).get(0);\n }\n student.getRelatives().add(nextOfKin);\n return student;\n }", "@PostConstruct\n protected void initNewEntity() {\n setNewEntity(getService().create());\n }", "public static Emprunt createEntity(EntityManager em) {\n Emprunt emprunt = new Emprunt()\n .dateEmprunt(DEFAULT_DATE_EMPRUNT)\n .dateRetour(DEFAULT_DATE_RETOUR);\n // Add required entity\n Usager usager = UsagerResourceIntTest.createEntity(em);\n em.persist(usager);\n em.flush();\n emprunt.setUsager(usager);\n // Add required entity\n Exemplaire exemplaire = ExemplaireResourceIntTest.createEntity(em);\n em.persist(exemplaire);\n em.flush();\n emprunt.setExemplaire(exemplaire);\n return emprunt;\n }", "public ClientEntity newEntity() {\r\n if (entityType == null) {\r\n entityType = getEntityType(entitySet);\r\n }\r\n return odataClient.getObjectFactory().newEntity(new FullQualifiedName(NAMESPAVE, entityType));\r\n }", "@Override\n public EntityResponse createEntity(String entitySetName, OEntity entity) {\n return super.createEntity(entitySetName, entity);\n }", "ID create(T entity);", "public static MotherBed createEntity(EntityManager em) {\n MotherBed motherBed = new MotherBed()\n .value(DEFAULT_VALUE)\n .status(DEFAULT_STATUS);\n // Add required entity\n Nursery nursery = NurseryResourceIntTest.createEntity(em);\n em.persist(nursery);\n em.flush();\n motherBed.setNursery(nursery);\n return motherBed;\n }", "private FailingEntity createFailingEntity() {\n FailingEntity entity = app.createAndManageChild(EntitySpec.create(FailingEntity.class)\n .configure(FailingEntity.FAIL_ON_START, true));\n return entity;\n }", "@Override\n public EntityResponse createEntity(String entitySetName, OEntityKey entityKey, String navProp, OEntity entity) {\n return super.createEntity(entitySetName, entityKey, navProp, entity);\n }", "public <T extends Entity> T createEntity(EntitySpec<T> spec) {\n Map<String,Entity> entitiesByEntityId = MutableMap.of();\n Map<String,EntitySpec<?>> specsByEntityId = MutableMap.of();\n \n T entity = createEntityAndDescendantsUninitialized(spec, entitiesByEntityId, specsByEntityId);\n initEntityAndDescendants(entity.getId(), entitiesByEntityId, specsByEntityId);\n return entity;\n }", "public static Prestamo createEntity(EntityManager em) {\n Prestamo prestamo = new Prestamo().observaciones(DEFAULT_OBSERVACIONES).fechaFin(DEFAULT_FECHA_FIN);\n // Add required entity\n Libro libro;\n if (TestUtil.findAll(em, Libro.class).isEmpty()) {\n libro = LibroResourceIT.createEntity(em);\n em.persist(libro);\n em.flush();\n } else {\n libro = TestUtil.findAll(em, Libro.class).get(0);\n }\n prestamo.setLibro(libro);\n // Add required entity\n Persona persona;\n if (TestUtil.findAll(em, Persona.class).isEmpty()) {\n persona = PersonaResourceIT.createEntity(em);\n em.persist(persona);\n em.flush();\n } else {\n persona = TestUtil.findAll(em, Persona.class).get(0);\n }\n prestamo.setPersona(persona);\n // Add required entity\n User user = UserResourceIT.createEntity(em);\n em.persist(user);\n em.flush();\n prestamo.setUser(user);\n return prestamo;\n }", "default E create(E entity)\n throws TechnicalException, ConflictException {\n return create(entity, null);\n }", "public static Rentee createEntity(EntityManager em) {\n Rentee rentee = new Rentee();\n rentee = new Rentee()\n .firstName(DEFAULT_FIRST_NAME)\n .lastName(DEFAULT_LAST_NAME)\n .email(DEFAULT_EMAIL)\n .phoneNumber(DEFAULT_PHONE_NUMBER)\n .password(DEFAULT_PASSWORD);\n return rentee;\n }", "public static Pocket createEntity(EntityManager em) {\n Pocket pocket = new Pocket()\n .key(DEFAULT_KEY)\n .label(DEFAULT_LABEL)\n .startDateTime(DEFAULT_START_DATE_TIME)\n .endDateTime(DEFAULT_END_DATE_TIME)\n .amount(DEFAULT_AMOUNT)\n .reserved(DEFAULT_RESERVED);\n // Add required entity\n Balance balance = BalanceResourceIntTest.createEntity(em);\n em.persist(balance);\n em.flush();\n pocket.setBalance(balance);\n return pocket;\n }", "public static ItemSubstitution createEntity(EntityManager em) {\n ItemSubstitution itemSubstitution = new ItemSubstitution()\n .timestamp(DEFAULT_TIMESTAMP)\n .type(DEFAULT_TYPE)\n .substituteType(DEFAULT_SUBSTITUTE_TYPE)\n .substituteNo(DEFAULT_SUBSTITUTE_NO)\n .description(DEFAULT_DESCRIPTION)\n .isInterchangeable(DEFAULT_IS_INTERCHANGEABLE)\n .relationsLevel(DEFAULT_RELATIONS_LEVEL)\n .isCheckedToOriginal(DEFAULT_IS_CHECKED_TO_ORIGINAL)\n .origCheckDate(DEFAULT_ORIG_CHECK_DATE);\n // Add required entity\n Item item;\n if (TestUtil.findAll(em, Item.class).isEmpty()) {\n item = ItemResourceIT.createEntity(em);\n em.persist(item);\n em.flush();\n } else {\n item = TestUtil.findAll(em, Item.class).get(0);\n }\n itemSubstitution.getItems().add(item);\n return itemSubstitution;\n }", "E create(E entity, RequestContext context)\n throws TechnicalException, ConflictException;", "public static A createEntity(EntityManager em) {\n A a = new A();\n return a;\n }", "public static Edge createEntity(EntityManager em) {\n Edge edge = new Edge()\n .description(DEFAULT_DESCRIPTION);\n // Add required entity\n Stone from = StoneResourceIntTest.createEntity(em);\n em.persist(from);\n em.flush();\n edge.setFrom(from);\n // Add required entity\n Stone to = StoneResourceIntTest.createEntity(em);\n em.persist(to);\n em.flush();\n edge.setTo(to);\n return edge;\n }", "public static QuizQuestion createEntity(EntityManager em) {\n QuizQuestion quizQuestion = new QuizQuestion()\n .text(DEFAULT_TEXT)\n .description(DEFAULT_DESCRIPTION);\n // Add required entity\n Quiz quiz;\n if (TestUtil.findAll(em, Quiz.class).isEmpty()) {\n quiz = QuizResourceIT.createEntity(em);\n em.persist(quiz);\n em.flush();\n } else {\n quiz = TestUtil.findAll(em, Quiz.class).get(0);\n }\n quizQuestion.setQuiz(quiz);\n return quizQuestion;\n }", "public static Partida createEntity(EntityManager em) {\n Partida partida = new Partida()\n .dataPartida(DEFAULT_DATA_PARTIDA);\n return partida;\n }", "public T create(T entity) {\n\t \tgetEntityManager().getTransaction().begin();\n\t getEntityManager().persist(entity);\n\t getEntityManager().getTransaction().commit();\n\t getEntityManager().close();\n\t return entity;\n\t }", "public static Emprunt createEntity(EntityManager em) {\n Emprunt emprunt = new Emprunt()\n .dateEmprunt(DEFAULT_DATE_EMPRUNT);\n return emprunt;\n }", "public static SitAndGo createEntity(EntityManager em) {\n SitAndGo sitAndGo = new SitAndGo()\n .format(DEFAULT_FORMAT)\n .buyIn(DEFAULT_BUY_IN)\n .ranking(DEFAULT_RANKING)\n .profit(DEFAULT_PROFIT)\n .bounty(DEFAULT_BOUNTY);\n return sitAndGo;\n }", "public static Exercise createEntity(EntityManager em) {\n Exercise exercise = new Exercise()\n .minutes(DEFAULT_MINUTES);\n return exercise;\n }", "@Override\n\tpublic Entity createEntity() {\n\t\tEntity entity = new Entity(LINKS_ENTITY_KIND);\n\t\tentity.setProperty(id_property, ID);\n\t\tentity.setProperty(url_property, url);\n\t\tentity.setProperty(CategoryID_property, CategoryID);\n\t\tentity.setProperty(note_property, note);\n\t\tentity.setProperty(createdOn_property, createdOn);\n\t\tentity.setProperty(updatedOn_property, updatedOn);\t\t\t\n\t\treturn entity;\n\t}", "public static House createEntity(EntityManager em) {\n House house = new House()\n .houseName(DEFAULT_HOUSE_NAME)\n .houseNo(DEFAULT_HOUSE_NO)\n .address(DEFAULT_ADDRESS)\n .houseToFloorNo(DEFAULT_HOUSE_TO_FLOOR_NO)\n .ownToFloorNo(DEFAULT_OWN_TO_FLOOR_NO)\n .lat(DEFAULT_LAT)\n .lon(DEFAULT_LON)\n .createdate(DEFAULT_CREATEDATE)\n .createBy(DEFAULT_CREATE_BY)\n .updateDate(DEFAULT_UPDATE_DATE)\n .updateBy(DEFAULT_UPDATE_BY)\n .image(DEFAULT_IMAGE)\n .imageContentType(DEFAULT_IMAGE_CONTENT_TYPE);\n // Add required entity\n Country country = CountryResourceIntTest.createEntity(em);\n em.persist(country);\n em.flush();\n house.setCountry(country);\n // Add required entity\n State state = StateResourceIntTest.createEntity(em);\n em.persist(state);\n em.flush();\n house.setState(state);\n // Add required entity\n City city = CityResourceIntTest.createEntity(em);\n em.persist(city);\n em.flush();\n house.setCity(city);\n // Add required entity\n Profile profile = ProfileResourceIntTest.createEntity(em);\n em.persist(profile);\n em.flush();\n house.setProfile(profile);\n // Add required entity\n User user = UserResourceIntTest.createEntity(em);\n em.persist(user);\n em.flush();\n house.setUser(user);\n return house;\n }", "public static CourtType createEntity(EntityManager em) {\n CourtType courtType = new CourtType()\n .type(DEFAULT_TYPE);\n return courtType;\n }", "public static Ailment createEntity(EntityManager em) {\n Ailment ailment = new Ailment()\n .name(DEFAULT_NAME)\n .symptoms(DEFAULT_SYMPTOMS)\n .treatments(DEFAULT_TREATMENTS);\n return ailment;\n }", "@Override\r\n public void createNewEntity(String entityName) {\n\r\n }", "public static Articulo createEntity(EntityManager em) {\n Articulo articulo = new Articulo()\n .titulo(DEFAULT_TITULO)\n .contenido(DEFAULT_CONTENIDO)\n .fechaCreacion(DEFAULT_FECHA_CREACION);\n return articulo;\n }", "void create(Student entity);", "public static TipoLocal createEntity(EntityManager em) {\n TipoLocal tipoLocal = new TipoLocal()\n .tipo(DEFAULT_TIPO);\n return tipoLocal;\n }", "public static Testtable2 createEntity(EntityManager em) {\n Testtable2 testtable2 = new Testtable2();\n testtable2.setColumn2(DEFAULT_COLUMN_2);\n return testtable2;\n }", "@Override\n\tprotected CoreEntity createNewEntity() {\n\t\treturn null;\n\t}", "public static OrderItem createEntity(EntityManager em) {\n OrderItem orderItem = new OrderItem().quantity(DEFAULT_QUANTITY).totalPrice(DEFAULT_TOTAL_PRICE).status(DEFAULT_STATUS);\n return orderItem;\n }", "public static Arrete createEntity(EntityManager em) {\n Arrete arrete = new Arrete()\n .intituleArrete(DEFAULT_INTITULE_ARRETE)\n .numeroArrete(DEFAULT_NUMERO_ARRETE)\n .dateSignature(DEFAULT_DATE_SIGNATURE)\n .nombreAgrement(DEFAULT_NOMBRE_AGREMENT);\n return arrete;\n }", "public static Tenant createEntity() {\n return new Tenant();\n }", "public static MyOrders createEntity(EntityManager em) {\n MyOrders myOrders = new MyOrders();\n return myOrders;\n }", "public static Enseigner createEntity(EntityManager em) {\n Enseigner enseigner = new Enseigner().dateDebut(DEFAULT_DATE_DEBUT).dateFin(DEFAULT_DATE_FIN);\n return enseigner;\n }", "@Test\n public void eventEntityConstructionTest() {\n\n Event event = new EventEntity();\n\n assertThat(event).isNotNull();\n\n }", "public static EnteteVente createEntity(EntityManager em) {\n EnteteVente enteteVente = new EnteteVente()\n .enteteVenteType(DEFAULT_ENTETE_VENTE_TYPE)\n .enteteVenteTotalHT(DEFAULT_ENTETE_VENTE_TOTAL_HT)\n .enteteVenteTotalTTC(DEFAULT_ENTETE_VENTE_TOTAL_TTC)\n .enteteVenteDateCreation(DEFAULT_ENTETE_VENTE_DATE_CREATION);\n return enteteVente;\n }", "public void createNewObject(Representation entity) throws ResourceException {\r\n\t\tT entry = createObjectFromHeaders(null, entity);\r\n\t\texecuteUpdate(entity, entry, createUpdateObject(entry));\r\n\r\n\t}", "public static Organizer createEntity(EntityManager em) {\n Organizer organizer = new Organizer()\n .name(DEFAULT_NAME)\n .description(DEFAULT_DESCRIPTION)\n .facebook(DEFAULT_FACEBOOK)\n .twitter(DEFAULT_TWITTER);\n // Add required entity\n User user = UserResourceIntTest.createEntity(em);\n em.persist(user);\n em.flush();\n organizer.setUser(user);\n return organizer;\n }", "public static Note createEntity(EntityManager em) {\n Note note = new Note().content(DEFAULT_CONTENT).title(DEFAULT_TITLE).xpos(DEFAULT_XPOS).ypos(DEFAULT_YPOS);\n return note;\n }", "public static FillingGapsTestItem createEntity(EntityManager em) {\n FillingGapsTestItem fillingGapsTestItem = new FillingGapsTestItem()\n .question(DEFAULT_QUESTION);\n return fillingGapsTestItem;\n }", "public Entity build();", "@Test\n public void createQuejaEntityTest() {\n PodamFactory factory = new PodamFactoryImpl();\n QuejaEntity newEntity = factory.manufacturePojo(QuejaEntity.class);\n QuejaEntity result = quejaPersistence.create(newEntity);\n\n Assert.assertNotNull(result);\n QuejaEntity entity = em.find(QuejaEntity.class, result.getId());\n Assert.assertNotNull(entity);\n Assert.assertEquals(newEntity.getName(), entity.getName());\n}", "public abstract boolean create(T entity) throws ServiceException;", "public static Acheteur createEntity(EntityManager em) {\n Acheteur acheteur = new Acheteur()\n .typeClient(DEFAULT_TYPE_CLIENT)\n .nom(DEFAULT_NOM)\n .prenom(DEFAULT_PRENOM)\n .tel(DEFAULT_TEL)\n .cnib(DEFAULT_CNIB)\n .email(DEFAULT_EMAIL)\n .adresse(DEFAULT_ADRESSE)\n .numroBanquaire(DEFAULT_NUMRO_BANQUAIRE)\n .deleted(DEFAULT_DELETED);\n return acheteur;\n }", "public static RoomGenericProduct createEntity(EntityManager em) {\n RoomGenericProduct roomGenericProduct = new RoomGenericProduct()\n .quantity(DEFAULT_QUANTITY)\n .quantityUnit(DEFAULT_QUANTITY_UNIT);\n return roomGenericProduct;\n }", "public static TypeOeuvre createEntity(EntityManager em) {\n TypeOeuvre typeOeuvre = new TypeOeuvre()\n .intitule(DEFAULT_INTITULE);\n return typeOeuvre;\n }", "public static Reservation createEntity(EntityManager em) {\n Reservation reservation = ReservationTest.buildReservationTest(1L);\n //reservation.setUser(User.builder().email(\"adfad\").name(\"\").build());\n return reservation;\n }", "@Test\n public void testNewEntity() throws Exception {\n\n }", "public static Model createEntity(EntityManager em) {\n\t\tModel model = new Model().name(DEFAULT_NAME).type(DEFAULT_TYPE).algorithm(DEFAULT_ALGORITHM)\n\t\t\t\t.status(DEFAULT_STATUS).owner(DEFAULT_OWNER).performanceMetrics(DEFAULT_PERFORMANCE_METRICS)\n\t\t\t\t.modelLocation(DEFAULT_MODEL_LOCATION).featureSignificance(DEFAULT_FEATURE_SIGNIFICANCE)\n\t\t\t\t.builderConfig(DEFAULT_BUILDER_CONFIG).createdDate(DEFAULT_CREATED_DATE)\n\t\t\t\t.deployedDate(DEFAULT_DEPLOYED_DATE).trainingDataset(DEFAULT_TRAINING_DATASET)\n .library(DEFAULT_LIBRARY).project(DEFAULT_PROJECT).version(DEFAULT_VERSION);\n\t\treturn model;\n\t}", "public static ProcessExecution createEntity(EntityManager em) {\n ProcessExecution processExecution = new ProcessExecution()\n .execution(DEFAULT_EXECUTION);\n return processExecution;\n }", "public static Paiement createEntity(EntityManager em) {\n Paiement paiement = new Paiement()\n .dateTransation(DEFAULT_DATE_TRANSATION)\n .montantTTC(DEFAULT_MONTANT_TTC);\n return paiement;\n }", "public static Article createEntity(EntityManager em) {\n Article article = new Article()\n .name(DEFAULT_NAME)\n .content(DEFAULT_CONTENT)\n .creationDate(DEFAULT_CREATION_DATE)\n .modificationDate(DEFAULT_MODIFICATION_DATE);\n return article;\n }", "T makePersistent(T entity);", "void buildFromEntity(E entity);", "public static XepLoai createEntity(EntityManager em) {\n XepLoai xepLoai = new XepLoai()\n .tenXepLoai(DEFAULT_TEN_XEP_LOAI);\n return xepLoai;\n }", "public static Lot createEntity(EntityManager em) {\n Lot lot = new Lot()\n .createdAt(DEFAULT_CREATED_AT)\n .updatedAt(DEFAULT_UPDATED_AT)\n .qte(DEFAULT_QTE)\n .qtUg(DEFAULT_QT_UG)\n .num(DEFAULT_NUM)\n .dateFabrication(DEFAULT_DATE_FABRICATION)\n .peremption(DEFAULT_PEREMPTION)\n .peremptionstatus(DEFAULT_PEREMPTIONSTATUS);\n return lot;\n }", "private MetaEntityImpl createMetaEntity(Class<?> entityType) {\n String className = entityType.getSimpleName();\n MetaEntityImpl managedEntity = new MetaEntityImpl();\n managedEntity.setEntityType(entityType);\n managedEntity.setName(className);\n ((MetaTableImpl) managedEntity.getTable()).setName(className);\n ((MetaTableImpl) managedEntity.getTable()).setKeySpace(environment.getConfiguration().getKeySpace());\n return managedEntity;\n }", "public TransporteTerrestreEntity createTransporte(TransporteTerrestreEntity transporteEntity) throws BusinessLogicException {\n LOGGER.log(Level.INFO, \"Inicia proceso de creación del transporte\");\n super.createTransporte(transporteEntity);\n\n \n persistence.create(transporteEntity);\n LOGGER.log(Level.INFO, \"Termina proceso de creación del transporte\");\n return transporteEntity;\n }", "public static EmployeeCars createEntity(EntityManager em) {\n EmployeeCars employeeCars = new EmployeeCars()\n .previousReading(DEFAULT_PREVIOUS_READING)\n .currentReading(DEFAULT_CURRENT_READING)\n .workingDays(DEFAULT_WORKING_DAYS)\n .updateDate(DEFAULT_UPDATE_DATE);\n // Add required entity\n Employee employee = EmployeeResourceIT.createEntity(em);\n em.persist(employee);\n em.flush();\n employeeCars.setEmployee(employee);\n // Add required entity\n Car car = CarResourceIT.createEntity(em);\n em.persist(car);\n em.flush();\n employeeCars.setCar(car);\n return employeeCars;\n }", "public static TaskComment createEntity(EntityManager em) {\n TaskComment taskComment = new TaskComment()\n .value(DEFAULT_VALUE);\n // Add required entity\n Task newTask = TaskResourceIT.createEntity(em);\n Task task = TestUtil.findAll(em, Task.class).stream()\n .filter(x -> x.getId().equals(newTask.getId()))\n .findAny().orElse(null);\n if (task == null) {\n task = newTask;\n em.persist(task);\n em.flush();\n }\n taskComment.setTask(task);\n return taskComment;\n }", "public static Personel createEntity(EntityManager em) {\n Personel personel = new Personel()\n .fistname(DEFAULT_FISTNAME)\n .lastname(DEFAULT_LASTNAME)\n .sexe(DEFAULT_SEXE);\n return personel;\n }", "public static Territorio createEntity(EntityManager em) {\n Territorio territorio = new Territorio().nome(DEFAULT_NOME);\n return territorio;\n }", "public static Ordre createEntity(EntityManager em) {\n Ordre ordre = new Ordre()\n .name(DEFAULT_NAME)\n .status(DEFAULT_STATUS)\n .price(DEFAULT_PRICE)\n .creationDate(DEFAULT_CREATION_DATE);\n return ordre;\n }", "@Override\n @LogMethod\n public T create(T entity) throws InventoryException {\n \tInventoryHelper.checkNull(entity, \"entity\");\n repository.persist(entity);\n return repository.getByKey(entity.getId());\n }", "public static Poen createEntity(EntityManager em) {\n Poen poen = new Poen()\n .tip(DEFAULT_TIP);\n return poen;\n }", "public static Expediente createEntity(EntityManager em) {\n Expediente expediente = new Expediente()\n .horarioEntrada(DEFAULT_HORARIO_ENTRADA)\n .horarioSaida(DEFAULT_HORARIO_SAIDA)\n .diaSemana(DEFAULT_DIA_SEMANA);\n return expediente;\n }", "public static Unidade createEntity(EntityManager em) {\n Unidade unidade = new Unidade()\n .descricao(DEFAULT_DESCRICAO)\n .sigla(DEFAULT_SIGLA)\n .situacao(DEFAULT_SITUACAO)\n .controleDeEstoque(DEFAULT_CONTROLE_DE_ESTOQUE)\n .idAlmoxarifado(DEFAULT_ID_ALMOXARIFADO)\n .andar(DEFAULT_ANDAR)\n .capacidade(DEFAULT_CAPACIDADE)\n .horarioInicio(DEFAULT_HORARIO_INICIO)\n .horarioFim(DEFAULT_HORARIO_FIM)\n .localExame(DEFAULT_LOCAL_EXAME)\n .rotinaDeFuncionamento(DEFAULT_ROTINA_DE_FUNCIONAMENTO)\n .anexoDocumento(DEFAULT_ANEXO_DOCUMENTO)\n .setor(DEFAULT_SETOR)\n .idCentroDeAtividade(DEFAULT_ID_CENTRO_DE_ATIVIDADE)\n .idChefia(DEFAULT_ID_CHEFIA);\n // Add required entity\n TipoUnidade tipoUnidade;\n if (TestUtil.findAll(em, TipoUnidade.class).isEmpty()) {\n tipoUnidade = TipoUnidadeResourceIT.createEntity(em);\n em.persist(tipoUnidade);\n em.flush();\n } else {\n tipoUnidade = TestUtil.findAll(em, TipoUnidade.class).get(0);\n }\n unidade.setTipoUnidade(tipoUnidade);\n return unidade;\n }", "public void spawnEntity(AEntityB_Existing entity){\r\n\t\tBuilderEntityExisting builder = new BuilderEntityExisting(entity.world.world);\r\n\t\tbuilder.loadedFromSavedNBT = true;\r\n\t\tbuilder.setPositionAndRotation(entity.position.x, entity.position.y, entity.position.z, (float) -entity.angles.y, (float) entity.angles.x);\r\n\t\tbuilder.entity = entity;\r\n\t\tworld.spawnEntity(builder);\r\n }", "public static Book createEntity() {\n Book book = new Book()\n .idBook(DEFAULT_ID_BOOK)\n .isbn(DEFAULT_ISBN)\n .title(DEFAULT_TITLE)\n .author(DEFAULT_AUTHOR)\n .year(DEFAULT_YEAR)\n .publisher(DEFAULT_PUBLISHER)\n .url_s(DEFAULT_URL_S)\n .url_m(DEFAULT_URL_M)\n .url_l(DEFAULT_URL_L);\n return book;\n }", "private void createTestData() {\n StoreEntity store = new StoreEntity();\n store.setStoreName(DEFAULT_STORE_NAME);\n store.setPecEmail(DEFAULT_PEC);\n store.setPhone(DEFAULT_PHONE);\n store.setImagePath(DEFAULT_IMAGE_PATH);\n store.setDefaultPassCode(STORE_DEFAULT_PASS_CODE);\n store.setStoreCap(DEFAULT_STORE_CAP);\n store.setCustomersInside(DEFAULT_CUSTOMERS_INSIDE);\n store.setAddress(new AddressEntity());\n\n // Create users for store.\n UserEntity manager = new UserEntity();\n manager.setUsercode(USER_CODE_MANAGER);\n manager.setRole(UserRole.MANAGER);\n\n UserEntity employee = new UserEntity();\n employee.setUsercode(USER_CODE_EMPLOYEE);\n employee.setRole(UserRole.EMPLOYEE);\n\n store.addUser(manager);\n store.addUser(employee);\n\n // Create a new ticket.\n TicketEntity ticket = new TicketEntity();\n ticket.setPassCode(INIT_PASS_CODE);\n ticket.setCustomerId(INIT_CUSTOMER_ID);\n ticket.setDate(new Date(new java.util.Date().getTime()));\n\n ticket.setArrivalTime(new Time(new java.util.Date().getTime()));\n ticket.setPassStatus(PassStatus.VALID);\n ticket.setQueueNumber(INIT_TICKET_QUEUE_NUMBER);\n store.addTicket(ticket);\n\n // Persist data.\n em.getTransaction().begin();\n\n em.persist(store);\n em.flush();\n\n // Saving ID generated from SQL after the persist.\n LAST_TICKET_ID = ticket.getTicketId();\n LAST_STORE_ID = store.getStoreId();\n LAST_MANAGER_ID = manager.getUserId();\n LAST_EMPLOYEE_ID = employee.getUserId();\n\n em.getTransaction().commit();\n }", "@Test\n public void testNewEntity_0args() {\n // newEntity() is not implemented!\n }", "public static NoteMaster createEntity(EntityManager em) {\n NoteMaster noteMaster = new NoteMaster()\n .semestre(DEFAULT_SEMESTRE)\n .noteCC1(DEFAULT_NOTE_CC_1)\n .noteCC2(DEFAULT_NOTE_CC_2)\n .noteFinal(DEFAULT_NOTE_FINAL)\n .date(DEFAULT_DATE);\n return noteMaster;\n }", "public Camp newEntity() { return new Camp(); }", "T create() throws PersistException;", "private EntityDef createEntityDef(Class<?> entityClass)\n {\n\t\tif (entityClass.isAnnotationPresent(InheritanceSingleTable.class)) {\n return new SingleTableSubclass.SingleTableSuperclass(entityClass);\n } else if (entityClass.getSuperclass().isAnnotationPresent(InheritanceSingleTable.class)) {\n return new SingleTableSubclass(entityClass);\n } else {\n return new EntityDef(entityClass);\n }\n\t}", "public static Restaurant createEntity(EntityManager em) {\n Restaurant restaurant = new Restaurant()\n .restaurantName(DEFAULT_RESTAURANT_NAME)\n .deliveryPrice(DEFAULT_DELIVERY_PRICE)\n .restaurantAddress(DEFAULT_RESTAURANT_ADDRESS)\n .restaurantCity(DEFAULT_RESTAURANT_CITY);\n return restaurant;\n }", "@Override\n\tpublic EmploieType creer(EmploieType entity) throws InvalideTogetException {\n\t\treturn emploieTypeRepository.save(entity);\n\t}", "public static Team createEntity(EntityManager em) {\n Team team = new Team().name(DEFAULT_NAME).description(DEFAULT_DESCRIPTION)\n .level(DEFAULT_LEVEL).totalMember(DEFAULT_TOTAL_MEMBER)\n .extraGroupName(DEFAULT_EXTRA_GROUP_NAME)\n .extraGroupDescription(DEFAULT_EXTRA_GROUP_DESCRIPTION)\n .extraGroupTotalMember(DEFAULT_EXTRA_GROUP_TOTAL_MEMBER);\n return team;\n }", "public static Produit createEntity(EntityManager em) {\n Produit produit = new Produit()\n .designation(DEFAULT_DESIGNATION)\n .soldeInit(DEFAULT_SOLDE_INIT)\n .prixAchat(DEFAULT_PRIX_ACHAT)\n .prixVente(DEFAULT_PRIX_VENTE)\n .quantiteDispo(DEFAULT_QUANTITE_DISPO)\n .quantiteInit(DEFAULT_QUANTITE_INIT)\n .seuilReaprov(DEFAULT_SEUIL_REAPROV)\n .reference(DEFAULT_REFERENCE);\n return produit;\n }", "public void constructEntity (EntityBuilder entityBuilder, Position position){\n entityBuilder.createEntity();\n entityBuilder.buildPosition(position);\n entityBuilder.buildName();\n entityBuilder.buildPosition();\n entityBuilder.buildContComp();\n entityBuilder.buildPhysComp(length, width);\n entityBuilder.buildGraphComp(length, width);\n }" ]
[ "0.7723305", "0.7505274", "0.7488161", "0.7361733", "0.7314842", "0.7155991", "0.7155991", "0.71510035", "0.71503216", "0.70774376", "0.7016772", "0.6803864", "0.6751574", "0.674037", "0.674037", "0.6711867", "0.6681123", "0.66649336", "0.6640917", "0.66236806", "0.6623581", "0.6607203", "0.65886664", "0.6574219", "0.65733147", "0.65651935", "0.6551965", "0.6530816", "0.6530493", "0.64816064", "0.6420097", "0.63867855", "0.6376756", "0.63683766", "0.631363", "0.62982166", "0.62934905", "0.6259659", "0.6246786", "0.6243627", "0.6240041", "0.62185824", "0.62089497", "0.61828023", "0.61810684", "0.6176266", "0.61701936", "0.6164241", "0.6161646", "0.61572057", "0.61560243", "0.6151938", "0.614384", "0.61375284", "0.61358017", "0.6128972", "0.6125033", "0.6120872", "0.6107493", "0.61068636", "0.61040056", "0.60931665", "0.6091511", "0.6080635", "0.6074821", "0.606992", "0.6068297", "0.6067405", "0.606327", "0.6058971", "0.6052093", "0.60421026", "0.6038577", "0.6031825", "0.6027355", "0.60237074", "0.602222", "0.60201675", "0.6014506", "0.6014125", "0.601345", "0.6003593", "0.60032177", "0.6003115", "0.5999931", "0.5996455", "0.5995158", "0.5982424", "0.5977344", "0.5974824", "0.59728104", "0.59668046", "0.5963527", "0.59633553", "0.59537613", "0.5945382", "0.59448254", "0.5941257", "0.5939186", "0.59312433", "0.59300697" ]
0.0
-1
test find account by id
public void testFindAccountById(){ int id = 10 ; Account acc = this.bean.findAccountById(id ) ; Assert.assertEquals(id, acc.getId()) ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Account getAccount(int id);", "@Test\n\tpublic void test_Fetch_All_Account_By_Id() throws DatabaseException, BadParameterException, NotFoundException {\n\t\ttry (MockedStatic<ConnectionUtil> mockedConnectionUtil = mockStatic(ConnectionUtil.class)) {\n\t\t\tmockedConnectionUtil.when(ConnectionUtil::connectToDB).thenReturn(mockConn);\n\t\t\t\n\t\t\tAccount actual = accountService.getAccountById(\"1\", \"1\");\n\t\t\t\n\t\t\tAccount expected = new Account(\"Savings\", 10101010, 100.50);\n\t\t\t\n\t\t\tassertEquals(expected, actual);\n\t\t}\n\t}", "Account findById(int id);", "public MnoAccount getAccountById(String id);", "UserAccount getUserAccountById(long id);", "@Override\npublic Account findById(int accountid) {\n\treturn accountdao.findById(accountid);\n}", "@Override\r\n\tpublic Account findById(int id) {\n\t\treturn daoref.findById(id);\r\n\t}", "@Override\r\n\tpublic Account findById(int id) {\n\t\tAccount account=accountMapper.findById(id);\t\r\n\t\t\r\n\t\treturn account;\r\n\t\r\n\t}", "@RequestMapping(value = \"/accounts/{id}\", method = RequestMethod.GET)\n\tpublic ResponseEntity<Account> find(@PathVariable(\"id\") final Integer id) {\n\n\t\tlogger.info(\"AccountController.find: id=\" + id);\n\n\t\tAccount accountResponse = this.service.findAccount(id);\n\t\treturn new ResponseEntity<Account>(accountResponse,\n\t\t\t\tgetNoCacheHeaders(), HttpStatus.OK);\n\n\t}", "@GetMapping(\"/accounts/{id}\")\n\tpublic ResponseEntity<Account> findById(@PathVariable(\"id\") int id){\n\t\tAccount body = this.accService.findById(id);\n\t\tResponseEntity<Account> response = new ResponseEntity<Account>(body, HttpStatus.OK);\n\t\treturn response;\n\t}", "@Test\n public void getAccountByIdTest() throws ApiException {\n ApiResponse<AccountResponse> mockResponse = new ApiResponse<AccountResponse>(200, null, accountResponse);\n doReturn(mockResponse).when(mockApiClient).execute(any(Call.class), Matchers.<Class<AccountResponse>>any());\n AccountResponse response = accountsApi.getAccountById(budgetId, accountId);\n assertEquals(response.getData().getAccount().getId(), \"someId\");\n assertEquals(response.getData().getAccount().getName(), \"someName\");\n }", "@Override\n\tpublic Account getAccountById(int id) {\n\t\treturn (Account) jdbcTemplate.queryForObject(\"select * from account where id=? limit 0 , 1\", new Object[]{id}, new BeanPropertyRowMapper(Account.class));\n\t}", "Account selectByPrimaryKey(String id);", "public Account getAccountByID(int id)//This function is for getting account for transfering amount\r\n {\r\n return this.ac.stream().filter(ac1 -> ac1.getAccId()==id).findFirst().orElse(null);\r\n }", "@GetMapping(\"/{id}\")\n public Account account(@PathVariable(\"id\") Long id){\n return accountRepository.findOne(id);\n }", "@Override\n\tpublic Optional<Account> findAccountById(Long id) {\n\t\treturn accountRepository.findById(id);\n\t}", "@GetMapping(\"/account/{id}\")\n @PreAuthorize(\"hasRole('ADMIN')\")\n public ResponseEntity getAccount(\n @PathVariable String id\n ){\n Optional<Account> account = accountRepository.findById(id);\n // check if the account exists\n if(!account.isPresent()){\n return ResponseEntity\n .badRequest()\n .body(\n new ErrorResponse(\n 404,\n \"account/not-found\",\n \"account not found\"\n )\n );\n }\n \n return ResponseEntity.ok(accountService.getRequestResponse(id));\n }", "@Test\n @Order(10)\n void get_account_3() {\n client2 = service.createClient(new Client(\"Test 2\"));\n int sumOfIds = 0;\n HashSet<Client> allClients = service.getAllClients();\n for(Client c : allClients) {\n sumOfIds += c.getId();\n }\n // want to give a valid account\n Account needle = client.getAccounts().iterator().next();\n\n Account check = service.getAccount(sumOfIds, needle.getId());\n Assertions.assertNull(check);\n\n // also want to return null in the event both are valid but there is a mismatch\n // client2 is a valid user and needle is a valid account but client2 doesn't own\n // needle, so should return null\n check = service.getAccount(client2.getId(), needle.getId());\n Assertions.assertNull(check);\n }", "@Test\n public void testFindUserById() {\n System.out.println(\"findUserById\");\n long userId = testUsers.get(0).getId();\n UserServiceImpl instance = new UserServiceImpl(passwordService);\n User expResult = testUsers.get(0);\n User result = instance.findUserById(userId);\n assertEquals(expResult.getEmail(), result.getEmail());\n }", "public Optional<CheckingAcc> find(Long id){\n if (checkingAccRepository.findById(id).isPresent()){\n return checkingAccRepository.findById(id);\n } else {\n throw new ResponseStatusException(HttpStatus.NOT_FOUND, \"There is no account with the provided id\");\n }\n }", "AccountModel findById(String accountNumber) throws AccountException;", "Optional<Account> findById(Long id);", "@Test\n\tpublic void getAccountTestSuccess() {\n\n\t\tString accountNumber = createAccount(\"viaks\",1000);\n\t\tMap<String, String> parametersMap = new HashMap<>();\n\t\tparametersMap.put(\"accountNumber\", accountNumber);\n\n\t\tRestAssured.given().when().parameters(parametersMap).get(\"/account\").then().assertThat().statusCode(200);\n\t}", "@Override\n\tpublic Account findAccountByAccountId(int accountId) throws SQLException {\n\t\tConnection connect = db.getConnection();\n\t\tString selectQuery = \"select * from accounts where id=?\";\n\t\tPreparedStatement prepStmt = connect.prepareStatement(selectQuery);\n\t\tprepStmt.setInt(1, accountId);\n\t\tResultSet rs = prepStmt.executeQuery();\n\t\tAccount a = null;\n\t\twhile (rs.next()) {\n\t\t\ta = new Account(rs.getInt(1), rs.getString(2), rs.getDouble(3));\n\t\t}\n\t\treturn a;\n\n\t}", "public Account queryById(Integer id) {\n\t\treturn accountDao.queryById(id);\n\t}", "@Test\n public void getAccountsTest() throws ApiException {\n ApiResponse<AccountsResponse> mockResponse = new ApiResponse<AccountsResponse>(200, null, accountsResponse);\n doReturn(mockResponse).when(mockApiClient).execute(any(Call.class), Matchers.<Class<AccountsResponse>>any());\n AccountsResponse response = accountsApi.getAccounts(budgetId);\n assertEquals(response.getData().getAccounts().get(0).getId(), \"someId\");\n }", "@Test\n public void testGetAccountByName() {\n\tassertEquals(1, 1);\n }", "@Test\n public void testFindUsuario_Integer() {\n System.out.println(\"findUsuario\");\n Integer id = 1;\n String user = \"[email protected]\";\n UsuarioJpaController instance = new UsuarioJpaController(emf);\n Usuario expResult = instance.findUsuario(user);\n Usuario result = instance.findUsuario(id);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n if (!result.equals(expResult)) {\n fail(\"El test de busqueda por usuario ha fallado\");\n }\n }", "FinanceAccount selectByPrimaryKey(Integer id);", "@Test\n public void testFindBySsoId() {\n LOGGER.info(\"findBySsoId\");\n String ssoId = \"sam\";\n AppUser result = userRepo.findBySsoId(ssoId);\n assertNotNull(result);\n }", "public static Account getAccountById(int id) throws SQLException\n {\n PreparedStatement ps = ConnectionManager\n .getConnection()\n .prepareStatement(\n \"SELECT accountId, name, address, manager FROM Account WHERE accountId = ?\");\n ps.setInt(1, id);\n\n ResultSet rs = ps.executeQuery();\n try\n {\n if (rs.next())\n return new Account(rs.getInt(1), rs.getString(2),\n rs.getString(3), rs.getBoolean(4));\n else\n throw new SQLException(\"No matching account.\");\n }\n finally\n {\n rs.close();\n ps.close();\n }\n }", "@Override\n\tpublic Account findOneById(long id) {\n\t\treturn null;\n\t}", "AccountDetail getAccount(String number) throws Exception;", "@Test\n\tpublic void testFindUserById() throws Exception {\n\t\tSqlSession sqlSession = factory.openSession();\n\t\tUser user = sqlSession.selectOne(\"com.wistron.meal.user.findUserById\",3);\n\t\tSystem.out.println(user);\n\t\tsqlSession.close();\n\t\t\n\t}", "@Test\n\t public void testRetrieveById(){\n\t\t try{\n\t\t\t Users user = BaseData.getUsers();\n\t\t\t\twhen(entityManager.find(Users.class,\"a1234567\")).thenReturn(user);\n\t\t\t\tUsers savedUser = userDao.retrieveById(\"a1234567\");\n\t\t\t\tassertNotNull(savedUser);\n\t\t\t\tassertTrue(savedUser.getFirstName().equals(\"MerchandisingUI\"));\n\t\t }catch(DataAcessException se){\n\t\t\t logger.error(\"error at service layer while testing retrieveById:.\",se);\n\t\t }\n\t }", "@Test\n void testGetByIdUser() {\n User getUser = (User) userData.crud.getById(1);\n assertEquals(\"Kevin\", getUser.getFirstName());\n logger.info(\"Got user information for ID: \" + getUser.getId());\n }", "@Test\n\tvoid shouldFindUserWithCorrectId() throws Exception {\n\t\tUser user = this.userService.findUser(\"antonio98\").orElse(null);\n\t\tAssertions.assertThat(user.getUsername()).isEqualTo(\"antonio98\");\n\t}", "@Test\n\tpublic void test_get_by_id_success(){\n\t\tResponseEntity<User> response = template.getForEntity(\n\t\t\t\tREST_SERVICE_URI + \"/20\" + ACCESS_TOKEN + token, User.class);\n\t\tUser user = response.getBody();\n\t\tassertThat(user.getEmail(), is(\"[email protected]\"));\n\t\tassertThat(response.getStatusCode(), is(HttpStatus.OK));\n\t\tvalidateCORSHttpHeaders(response.getHeaders());\n\t}", "@GetMapping(\"/{id}\")\r\n\tpublic ResponseEntity<?> getAccountById(@PathVariable(\"id\") String accID) throws AccountNotFoundException {\r\n\r\n\t\tOptional<Account> acc = accountService.getAccountById(accID);\r\n\r\n\t\tif(acc.isPresent()) {\r\n\t\t\treturn ResponseEntity.ok(acc.get());\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"Hello from account\");\r\n\t\t\tthrow new AccountNotFoundException(\"Account Not Found\");\t\r\n\t\t}\r\n\t}", "@Override\n\tpublic List<Account> findAccountByIdUser(int id) {\n\t\treturn null;\n\t}", "@Query(value = \"from BankAccount where dtype = 'BankAccount' and user_id = :id\")\n Optional<BankAccount> findBankAccountByUserAndType(Long id);", "@Test\n public void Athlete_Test_findUser()throws Exception {\n Athlete athlete2= new Athlete();\n Athlete athlete1= new Athlete();\n athlete1.name=\"emma\";\n athlete2.name=\"jose\";\n athlete1.save();\n athlete2.save();\n String id_athlete= athlete2.findUser(\"jose\").id;\n String id_athlete2 = athlete2.id;\n assertEquals(id_athlete, id_athlete2);\n }", "@Test\n void getByIdSuccess() {\n logger.info(\"running getByID test\");\n User retrievedUser = (User)genericDao.getById(2);\n\n assertEquals(\"BigAl\", retrievedUser.getUserName());\n assertEquals(\"Albert\", retrievedUser.getFirstName());\n assertEquals(2, retrievedUser.getId());\n assertEquals(\"Einstein\", retrievedUser.getLastName());\n assertEquals(\"11223\", retrievedUser.getZipCode());\n assertEquals(LocalDate.of(1879,3,14), retrievedUser.getBirthDate());\n\n }", "@Test\n public void testFindById() {\n System.out.println(\"findById\");\n Integer id = 1;\n PrioridadRest instance = mokPrioridadRest;\n Prioridad expResult = new Prioridad(1);\n Prioridad result = instance.findById(id);\n assertEquals(expResult, result);\n \n }", "@When(\"a user retrieves the user by id (\\\\d+)\")\n public void a_user_retrieves_the_user_by_id(Integer id) throws Exception {\n Client client = ClientBuilder.newClient();\n testedResponse = client.target(\"http://localhost:1080\").path(\"/rest/api/customer/\" + id).request().get();\n if (testedResponse.hasEntity()) {\n String o = testedResponse.readEntity(String.class);\n customerReponse = mapper.readValue(o, Customer.class);\n }\n\n }", "@Test\n public void findByIdTest() {\n Long id = 1L;\n reservation1.setId(id);\n Mockito.when(reservationDao.findById(id)).thenReturn(reservation1);\n Reservation result = reservationService.findById(id);\n Assert.assertEquals(reservation1, result);\n Assert.assertEquals(id, reservation1.getId());\n }", "Accounts getAccount(int id) {\n SQLiteDatabase db = this.getReadableDatabase();\n\n Cursor cursor = db.query(TABLE_ACCOUNTS, new String[]{KEY_ID,\n KEY_NAME, KEY_PASSWORD, KEY_PH_NO, KEY_EMAIL}, KEY_ID + \"=?\",\n new String[]{String.valueOf(id)}, null, null, null, null);\n if (cursor != null)\n cursor.moveToFirst();\n\n Accounts account = new Accounts(Integer.parseInt(cursor.getString(0)),\n cursor.getString(1), cursor.getString(2), cursor.getString(3), cursor.getString(4));\n\n return account;\n }", "public UserAccount getUserAccountByLoginId(String loginId);", "List<BookAccount> findAllForAccount(long idAccount);", "Account selectByPrimaryKey(Long accountid);", "@Override\n\tpublic Account getAccount(Integer id) {\n\t\tfor(Account account:accountList) {\n\t\t\tif(id.compareTo(account.returnAccountNumber()) == 0 ) {\n\t\t\t\treturn account;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "@Test\r\n public void testSelectById() {\r\n System.out.println(\"selectById\");\r\n int id = 1;\r\n AbonentDAL instance = new AbonentDAL();\r\n Abonent result = instance.selectById(id);\r\n assertTrue(result!=null && result.getId()==id);\r\n }", "Account getAccount();", "public BankAccount findAccountById(int currentBankID) throws SQLException;", "@Test\n public void testSelectByAccount() throws Exception {\n }", "@Test\n public void getUserByIdCatch() {\n userDAO.createUser(new User(\"dummy\", \"dummy\", 1));\n\n //test fetching of data\n assertNull(userResource.getUser(\"notdummy\"));\n\n //clean up\n userDAO.removeUser(\"dummy\");\n }", "boolean hasAccountId();", "boolean hasAccountId();", "boolean hasAccountId();", "boolean hasAccountId();", "boolean hasAccountId();", "boolean hasAccountId();", "boolean hasAccountId();", "@Test\n public void findByIdTest() {\n }", "@Test\n public void findByIdTest() {\n }", "boolean existsById(String accountNumber) throws AccountException;", "@GET\n @Path(\"/{accountID}\")\n @Produces(MediaType.APPLICATION_JSON)\n public Account getAccount(@PathParam(\"accountID\") int a_id ) {\n \tSystem.out.println(\"get Account by ID: \"+a_id );\n\treturn AccountService.getAccount(a_id);\n }", "@Test\n void getByIdSuccess() {\n UserRoles retrievedUserRole = (UserRoles) genericDao.getById(2);\n assertEquals(\"all\", retrievedUserRole.getRoleName());\n assertEquals(\"fhensen\", retrievedUserRole.getUserName());\n\n assertNotNull(retrievedUserRole);\n }", "CusBankAccount selectByPrimaryKey(Integer id);", "public CarerAccount getAccountWithID(int search){\n\t\tCarerAccount item = null;\n\n\t\tint count = 0;\n for (int i = 0; i < CarerAccounts.size(); ++i) {\n if (CarerAccounts.get(i).getID() == search){\n\t\t\t\tcount++;\n item = CarerAccounts.get(i);\n\t\t\t}\n\t\t}\n\t\treturn item;\n\t}", "@Test\npublic void testOpenAccount(){\n String pin = \"1234\";\n AppUser user = new AppUser();\n double amount = 100;\n Account expectedAccount = new Account(amount,-1,pin);\n\n Account actualAccount = null;\n when(mockAccountDAO.accountExists(anyInt())).thenReturn(true);\n when(mockAccountDAO.accountOpen(anyInt())).thenReturn(true);\n\n actualAccount = sut.openAccount(user,pin,amount);\n\n assertEquals(expectedAccount.getAccountId(),actualAccount.getAccountId());\n\n\n}", "public void testGetAccount_fixture22_1()\n\t\tthrows Exception {\n\t\tFolder fixture = getFixture22();\n\n\t\tAccount result = fixture.getAccount();\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(null, result.getPerson());\n\t}", "String getAccountID();", "String getAccountID();", "public Integer ejbFindByPrimaryKey(final Integer id)\n throws FinderException\n {\n PreparedStatement ps = null;\n try \n {\n ps = getConnection().prepareStatement(\"SELECT ID FROM CCBMPACCOUNT WHERE ID = ?\");\n ps.setInt(1, id.intValue());\n ResultSet rs = ps.executeQuery();\n if (!rs.next()) \n {\n throw new ObjectNotFoundException(\"No such account: \" + id);\n } // end of if ()\n rs.close();\n\n }\n catch (Exception e)\n {\n Category.getInstance(getClass().getName()).info(\"Exception in findByPK\", e);\n throw new EJBException(\"Problem in findByPrimaryKey: \" + e);\n } // end of try-catch\n finally\n {\n try \n {\n if (ps != null) {ps.close();}\n }\n catch (Exception e)\n {\n Category.getInstance(getClass().getName()).info(\"Exception closing ps: \" + e);\n } // end of try-catch\n } // end of finally\n return id;\n }", "public Account findById(String num) {\n\t\treturn null;\n\t}", "public void testGetAccount_fixture24_1()\n\t\tthrows Exception {\n\t\tFolder fixture = getFixture24();\n\n\t\tAccount result = fixture.getAccount();\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(null, result.getPerson());\n\t}", "Account getAccount(Integer accountNumber);", "@Test\n public void testGiveAccount() {\n System.out.println(\"giveAccount\");\n String name = \"Gert Hansen\";\n String address = \"Grønnegade 12\";\n String phone = \"98352010\";\n CustomerCtr instance = new CustomerCtr();\n int customerID = instance.createCustomer(name, address, phone);\n String type = \"Visa\";\n int regNo = 39292492;\n int cardNo = 457153253;\n instance.giveAccount(customerID, type, regNo, cardNo);\n Account result = instance.getCustomer(customerID).getAccount();\n assertNotNull(result);\n assertEquals(\"Visa\", result.getType());\n assertEquals(39292492, result.getRegNr());\n assertEquals(457153253, result.getCardNr());\n // TODO review the generated test code and remove the default call to fail.\n// fail(\"The test case is a prototype.\");\n }", "public Account getUserAllInfo(int id) {\n\t\treturn accRepo.findById(id).orElse(null);\n\t}", "@Test\n void getByIdSuccess() {\n UserRoles retrievedRole = (UserRoles)genericDAO.getByID(1);\n assertEquals(\"administrator\", retrievedRole.getRoleName());\n assertEquals(1, retrievedRole.getUserRoleId());\n assertEquals(\"admin\", retrievedRole.getUserName());\n }", "@Test\n void findById() {\n when(ownerRepository.findById(anyLong())).thenReturn(Optional.of(returnOwner));\n\n Owner owner = service.findById(1L);\n\n assertNotNull(owner);\n }", "AuditoriaUsuario find(Object id);", "@Test\n\tpublic void shouldFindUserWithGivenId() throws UserNotFoundException\n\t{\n\t\tUserProfile user = new UserProfile();\n\t\tuser.setId(1);\n\t\t\n\t\twhen(userDao.findUserById(user.getId())).thenReturn(user);\n\t\t\n\t\tassertEquals(user, userService.findUserById(user.getId()));\n\t}", "@Test\n public void sTest(){\n List<Account> accounts = as.findAllAccount ();\n for (Account account : accounts) {\n System.out.println (account);\n }\n }", "@Test\r\n public void testEGet_int() {\r\n System.out.println(\"get\");\r\n \r\n \r\n UsuarioDao instance = new UsuarioDao();\r\n Usuario obj = instance.getByUserName(\"admin\");\r\n \r\n int usuarioId = obj.getId();\r\n \r\n Usuario result = instance.get(usuarioId);\r\n \r\n assertEquals(usuarioId, result.getId());\r\n }", "public void testGetAccount_fixture16_1()\n\t\tthrows Exception {\n\t\tFolder fixture = getFixture16();\n\n\t\tAccount result = fixture.getAccount();\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(null, result.getPerson());\n\t}", "@Test\r\n public void testFindById() throws Exception {\r\n }", "@Test\n void getByIdSuccess() {\n User retrievedUser = (User) dao.getById(1);\n //User retrievedUser = dao.getById(1);\n assertEquals(\"Dave\", retrievedUser.getFirstName());\n assertEquals(\"Queiser\", retrievedUser.getLastName());\n }", "@Test\n public void testFindUsuario_String() {\n System.out.println(\"findUsuario\");\n Integer user = 1;\n Usuario usuario = new Usuario(1, \"[email protected]\", \"12345\", new Date(), true);\n UsuarioJpaController instance = new UsuarioJpaController(emf);\n Usuario expResult = instance.findUsuario(usuario.getIdUsuario());\n Usuario result = instance.findUsuario(user);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n if (!result.equals(expResult)) {\n fail(\"El test de busqueda por id ha fallado\");\n }\n }", "public Account getAccount(Integer id) {\n if (!accounts.containsKey(id)) {\n throw new NotFoundException(\"Not found\");\n }\n\n AccountEntry entry = accounts.get(id);\n if (entry == null) {\n throw new NotFoundException(\"Not found\");\n }\n\n // concurrency: optimistic, entry may already be excluded from accounts\n Lock itemLock = entry.lock.readLock();\n try {\n itemLock.lock();\n return entry.data;\n } finally {\n itemLock.unlock();\n }\n }", "@Test\n public void getUserById() {\n userDAO.createUser(new User(\"dummy\", \"dummy\", 1));\n\n //test fetching of data\n assertNotNull(userResource.getUser(\"dummy\"));\n\n //clean up\n userDAO.removeUser(\"dummy\");\n }", "@Test\n public void testGetUserAccounts() {\n Bank bank = new Bank();\n User user = new User(\"Petr\", \"0000 000000\");\n AccountOfUser acc = new AccountOfUser(0, \"0000 0000 0000 0000\");\n AccountOfUser acc2 = new AccountOfUser(0, \"0000 0000 0000 0001\");\n List<AccountOfUser> accs = new ArrayList<>();\n accs.add(acc);\n accs.add(acc2);\n bank.addUser(user);\n bank.addAccountToUser(user.getPassport(), acc);\n bank.addAccountToUser(user.getPassport(), acc2);\n assertThat(bank.getUserAccounts(user.getPassport()), is(accs));\n }", "public void testGetAccount_fixture10_1()\n\t\tthrows Exception {\n\t\tFolder fixture = getFixture10();\n\n\t\tAccount result = fixture.getAccount();\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(null, result.getPerson());\n\t}", "public void test_getId() {\n assertEquals(\"'id' value should be properly retrieved.\", id, instance.getId());\n }", "@Test\n\tpublic void get_usersByIdtest(){\n\t\t\n\t}", "@Test\n public void findOne(){\n ApplicationContext ac = new AnnotationConfigApplicationContext(SpringConfiguration.class);\n\n AccountService as = ac.getBean(\"accountService\", AccountService.class);\n Account account = as.findAccountById(1);\n System.out.println(account);\n }", "Long getAccountId();", "public void testGetAccount_fixture23_1()\n\t\tthrows Exception {\n\t\tFolder fixture = getFixture23();\n\n\t\tAccount result = fixture.getAccount();\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(null, result.getPerson());\n\t}", "public void testGetAccount_fixture11_1()\n\t\tthrows Exception {\n\t\tFolder fixture = getFixture11();\n\n\t\tAccount result = fixture.getAccount();\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(null, result.getPerson());\n\t}" ]
[ "0.7641576", "0.7430484", "0.73682934", "0.7316182", "0.7269857", "0.71494913", "0.7112942", "0.7027347", "0.6975473", "0.69545484", "0.6932888", "0.6814039", "0.67827564", "0.67551947", "0.67140955", "0.6709104", "0.6696827", "0.6686027", "0.6672067", "0.6665774", "0.6599152", "0.6596467", "0.6582487", "0.65639955", "0.65620506", "0.653639", "0.6519613", "0.65128106", "0.6505536", "0.64880085", "0.64877397", "0.64665246", "0.64624774", "0.6448825", "0.644608", "0.64440876", "0.64172494", "0.64099103", "0.6393579", "0.63922995", "0.6379163", "0.6373348", "0.63675743", "0.6345694", "0.63259923", "0.6288349", "0.62817824", "0.6281131", "0.6277349", "0.6268027", "0.62625915", "0.62492603", "0.6239048", "0.62383306", "0.6235287", "0.6231521", "0.62252194", "0.62252194", "0.62252194", "0.62252194", "0.62252194", "0.62252194", "0.62252194", "0.6218602", "0.6218602", "0.6218073", "0.621082", "0.6210581", "0.6186997", "0.61797535", "0.61726385", "0.61700183", "0.6168739", "0.6168739", "0.6168103", "0.61561805", "0.6150826", "0.6150755", "0.61422724", "0.61366016", "0.61285937", "0.6127107", "0.612349", "0.6123117", "0.6116405", "0.61084497", "0.6107324", "0.61029154", "0.6097757", "0.60793173", "0.6074812", "0.6071851", "0.6069034", "0.6064276", "0.6035036", "0.6032382", "0.6017972", "0.60076874", "0.60050744", "0.5993068" ]
0.87204355
0
test update account by id
public void testUpdateAccount(){ int id = 10 ; Account acc = this.bean.findAccountById(id ) ; acc.setDatetime(CommUtil.getNowDate()) ; int r = this.bean.updateAccount(acc) ; Assert.assertEquals(r, 1) ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic boolean update(int id, Account account) {\n\t\treturn daoref.update(id, account);\r\n\t}", "@Test\n public void updateById() {\n User user = new User();\n user.setId(1259474874313797634L);\n user.setAge(30);\n boolean ifUpdate = user.updateById();\n System.out.println(ifUpdate);\n }", "@Test\n void testUpdateUser() {\n String password = \"testPassword\";\n User updateUser = (User) userData.crud.getById(1);\n updateUser.setPassword(password);\n userData.crud.updateRecords(updateUser);\n User getUser = (User) userData.crud.getById(1);\n assertEquals(getUser, updateUser);\n logger.info(\"Updated the password for ID: \" + updateUser.getId());\n }", "void updateAccount();", "@Test\n @Order(14)\n void update_account_2() {\n Account first = client.getAccounts().iterator().next();\n\n // mismatch is a copy, but with different client Id\n // we use client2 because it's valid in the database\n Account mismatch = new Account(first.getId(), first.getAmount()+200, client2.getId());\n Account nullCheck = service.updateAccount(mismatch);\n Assertions.assertNull(nullCheck);\n\n // get the account with the id we used to check, should not have changed\n Account check = service.getAccount(client.getId(), mismatch.getId());\n Assertions.assertEquals(first.getAmount(), check.getAmount(), 0.1);\n }", "void updateAccount(Account account);", "public Account update(Account user);", "int updateByPrimaryKey(Account record);", "int updateByPrimaryKey(Account record);", "@Test\n public void updateAccount(){\n ApplicationContext ac = new AnnotationConfigApplicationContext(SpringConfiguration.class);\n\n AccountService as = ac.getBean(\"accountService\", AccountService.class);\n Account account = as.findAccountById(2);\n account.setMoney(123456f);\n as.updateAccount(account);\n\n }", "@Test\n\tpublic void testUpdateAdminAccountSuccessfully() {\n\t\tassertEquals(2, adminAccountService.getAllAdminAccounts().size());\n\n\t\tString newName = \"New Name\";\n\t\tString newPassword = \"newPassword\";\n\n\t\tAdminAccount user = null; \n\t\ttry {\n\t\t\tuser = adminAccountService.updateAdminAccount(USERNAME1, newPassword, newName);\n\t\t} catch (InvalidInputException e) {\n\t\t\t// Check that no error occurred\n\t\t\tfail();\n\t\t}\n\t\tassertNotNull(user);\n\t\tassertEquals(USERNAME1, user.getUsername());\n\t\tassertEquals(newPassword, user.getPassword());\n\t\tassertEquals(newName, user.getName());\n\t}", "void updateAccount(int id, double accountBalance, String account) {\n // Update only the required keys\n sql = \"UPDATE CashiiDB2 \" + \"SET \" + account + \" ='\" + accountBalance + \"' WHERE AccountNum in ('\" + id + \"')\";\n try {\n st.executeUpdate(sql);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public void testFindAccountById(){\n\t\tint id = 10 ;\n\t\tAccount acc = this.bean.findAccountById(id ) ;\n\t\tAssert.assertEquals(id, acc.getId()) ;\n\t}", "@Test\n\tpublic void test_Update_Account() throws DatabaseException, BadParameterException, NotFoundException, CreationException {\n\t\ttry (MockedStatic<ConnectionUtil> mockedConnectionUtil = mockStatic(ConnectionUtil.class)) {\n\t\t\tmockedConnectionUtil.when(ConnectionUtil::connectToDB).thenReturn(mockConn);\n\t\t\t\n\t\t\tAccount actual = accountService.updateAccount(\"1\", \"1\", new AccountDTO(10101010, 100.50, \"Savings\"));\n\t\t\t\n\t\t\tAccount expected = new Account(\"Savings\", 10101010, 100.50);\n\t\t\t\n\t\t\tassertEquals(expected, actual);\n\t\t}\n\t}", "int updateAccountInfo(Account account);", "@Test\r\n public void testBUpdate() throws Exception {\r\n System.out.println(\"update\");\r\n \r\n UsuarioDao instance = new UsuarioDao();\r\n \r\n Usuario obj = instance.login(\"admin\", \"admin\");\r\n obj.setFullName(\"Kevin Duran\");\r\n \r\n int expResult = 1;\r\n int result = instance.update(obj);\r\n assertEquals(expResult, result);\r\n }", "public int updateAccount(Accounts account) {\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(KEY_NAME, account.getName());\n values.put(KEY_PASSWORD, account.getPassword());\n values.put(KEY_PH_NO, account.getPhoneNumber());\n values.put(KEY_EMAIL, account.getEmail());\n\n // updating row\n return db.update(TABLE_ACCOUNTS, values, KEY_ID + \" = ?\",\n new String[]{String.valueOf(account.getID())});\n }", "@PutMapping(\"/account/{id}\")\n\tpublic Account update(@Valid @RequestBody Account newAccount, @PathVariable int id) {\n\t\treturn accountRepository.findById(id).map(account -> {\n\t\t\t// skip id, createdTime and isDeleted\n\t\t\taccount.setPassword(bcryptEncoder.encode(newAccount.getPassword()));\n\t\t\taccount.setEmail(newAccount.getEmail());\n\t\t\treturn accountRepository.save(account);\n\t\t}).orElseThrow(() -> new AccountNotFoundException(id));\n\t}", "@Test\n public void test() throws Exception{\n update(\"update user set username=? where id=?\",\"wangjian\",\"4\");\n }", "int updateByPrimaryKey(ShopAccount record);", "Account.Update update();", "int updateByPrimaryKey(FinanceAccount record);", "@Test\n\tpublic void updateAccount() throws Exception {\n\n\t\tFacebookAdaccountBuilder fbAccount = SocialEntity\n\t\t\t\t.facebookAccount(accessToken);\n\t\tfbAccount.addAccount(\"New Test AdAccount\", \"USD\", 1);\n\t\t// fbAccount.create();\n\n\t\tfbAccount.updateAccountName(\"275668082617836\",\n\t\t\t\t\"Update Test New AdAccount\");\n\t\tfbAccount.updateAccountName(\"1419302888335966\",\n\t\t\t\t\"Batch AdAccount Name Update\");\n\t\tSystem.out.println(fbAccount.update());\n\t}", "public abstract void updateAccount(JSONObject account);", "@Test\n public void testModifyUser() throws Exception {\n\n User user = userDao.retrieveById(\"uuid123123123\");\n user.setUsername(\"newbody4\");\n\n Boolean result = userDao.update(user);\n Assert.assertTrue(result);\n }", "int updateByPrimaryKey(CusBankAccount record);", "String updateClientAccount(ClientAccount account) throws ServiceException;", "@Override\n\tpublic int accountUpdate(String id, String balance) {\n\t\tSession session=sessionFactory.openSession();\n\t\tTransaction tr = session.beginTransaction();\n\t\tint executeUpdate = 0;\n\t\tString sqlString=\"update user set balance = '\"+balance+\"' where id ='\"+id+\"'\";\n\t\ttry {\n\t\t\tQuery query=session.createSQLQuery(sqlString);\n\t\t\texecuteUpdate = query.executeUpdate();\n\t\t\tSystem.out.println(\"executeUpdate:\"+executeUpdate);\n\t\t} catch (HibernateException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\ttr.commit();\n\t\t session.close();\n\t\t}\n\t\treturn executeUpdate;\t\n\t}", "@Override\n\tpublic void updateAccount(String pwd, String field, String company) {\n\t}", "@Test\n public void testAccountSetPassword() {\n try {\n Account newAcc = new Account(1, \"holder\", \"holder\", Credential.ADMIN);\n newAcc.setPassword(\"newPasswordForHolder\");\n Assert.assertEquals(\"Incorrect updated password for account after changing\",\n \"newPasswordForHolder\", newAcc.getPassword());\n } catch (Exception e) {\n Assert.fail(\"Set account password should not have failed here\");\n e.printStackTrace();\n }\n }", "@Test\n\tpublic void test_update_user_success(){\n\t\tUser user = new User(null, \"fengt\", \"[email protected]\", \"12345678\");\n\t\ttemplate.put(REST_SERVICE_URI + \"/20\" + ACCESS_TOKEN + token, user);\n\t}", "@Test\n public void whenUpdatingCustomerItShouldUseTheGivenID() {\n given(repository.getOne(CUSTOMER1_ID)).willReturn(CUSTOMER1);\n // Given that a CUSTOMER1 with CUSTOMER1_ID is updated\n controller.updateCustomer(CUSTOMER1, CUSTOMER1_ID);\n // Verify that when the customer is saved\n verify(repository).saveAndFlush(anyCustomer.capture());\n // It should have the given CUSTOMER1\n assertThat(anyCustomer.getValue().getId()).isEqualTo(CUSTOMER1_ID);\n }", "@Override\r\n\tpublic void update(Account account) throws ServiceException {\n\r\n\t}", "@Test\n public void putId() throws Exception {\n Role role = create(new Role(\"roleName\"));\n\n //Change a field of the object that has to be updated\n role.setName(\"roleNameChanged\");\n RESTRole restRole = new RESTRole(role);\n\n //Perform the put request to update the object and check the fields of the returned object\n try {\n mvc.perform(MockMvcRequestBuilders.put(\"/auth/roles/{id}\", UUIDUtil.UUIDToNumberString(role.getUuid()))\n .header(\"Content-Type\", \"application/json\")\n .header(\"Authorization\", authPair[0])\n .header(\"Function\", authPair[1])\n .content(TestUtil.convertObjectToJsonBytes(restRole))\n )\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$.name\", equalTo(restRole.getName())));\n } catch (AssertionError e) {\n remove(role.getUuid());\n throw e;\n }\n\n //Test if changes actually went in effect in the database\n try {\n role = get(role.getUuid());\n try {\n assertEquals(\"name field not updated correctly\", \"roleNameChanged\", role.getName());\n } finally {\n //Clean up database for other tests\n remove(role.getUuid());\n }\n } catch (ObjectNotFoundException e) {\n fail(\"Could not retrieve the put object from the actual database\");\n }\n }", "@Override\npublic void update(Account account) {\n\taccountdao.update(account);\n}", "@Test\n public void updateTest() throws SQLException, IDAO.DALException {\n userDAO.create(user);\n user.setNavn(\"SørenBob\");\n user.setCpr(\"071199-4397\");\n user.setAktiv(false);\n user.setIni(\"SBO\");\n // Opdatere objektet i databasen, og sammenligner.\n userDAO.update(user);\n recivedUser = userDAO.get(-1);\n\n assertEquals(recivedUser.getId(), user.getId());\n assertEquals(recivedUser.getNavn(), user.getNavn());\n assertEquals(recivedUser.getIni(), user.getIni());\n assertEquals(recivedUser.getCpr(), user.getCpr());\n assertEquals(recivedUser.isAktiv(),user.isAktiv());\n }", "private static void testupdate() {\n\t\ttry {\n\t\t\tRoleModel model = new RoleModel();\n\t\t\tRoleBean bean = new RoleBean();\n\t\t\tbean = model.findByPK(7L);\n\t\t\tbean.setName(\"Finance\");\n\t\t\tbean.setDescription(\"Finance Dept\");\n\t\t\tbean.setCreatedBy(\"CCD MYSORE\");\n\t\t\tbean.setModifiedBy(\"CCD MYSORE\");\n\t\t\tbean.setCreatedDatetime(new Timestamp(new Date().getTime()));\n\t\t\tbean.setModifiedDatetime(new Timestamp(new Date().getTime()));\n\t\t\tmodel.update(bean);\n\t\t\tRoleBean updateBean = model.findByPK(1);\n\t\t\tif (\"12\".equals(updateBean.getName())) {\n\t\t\t\tSystem.out.println(\"UPDATE RECORD FAILED\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"RECORD UPDATED SUCCESSFULLY\");\n\t\t\t}\n\t\t} catch (ApplicationException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (DuplicateRecordException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void UserServiceTest_Edit()\r\n {\r\n User user = new User();\r\n user.setId(\"1234\");\r\n user.setName(\"ABCEdited\");\r\n user.setPassword(\"123edited\");\r\n ArrayList<Role> roles = new ArrayList<>();\r\n roles.add(new Role(\"statio manager\"));\r\n user.setRoles(roles);\r\n \r\n UserService service = new UserService(); \r\n try {\r\n service.updateUser(user);\r\n } catch (SQLException e) {\r\n fail();\r\n System.out.println(e);\r\n }catch (NotFoundException e) {\r\n fail();\r\n System.out.println(e);\r\n }\r\n }", "@Test\n public void testUpdateUser_ResetPassword() throws Exception {\n User user = new User();\n user.setUserUID(123);\n user.setUsername(\"resetme\");\n user.setPasswordTemporary(false);\n\n when(userService.getUserByUID(123)).thenReturn(user);\n\n mockMvc.perform(put(\"/api/users/123?action=resetpwd\").contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk());\n\n verify(userService, times(1)).getUserByUID(anyLong());\n }", "int updateByExample(CusBankAccount record, CusBankAccountExample example);", "@Override\r\n\tpublic boolean updateUser(AccountDTO account) {\n\t\taccountDao.update(account);\r\n\t\treturn true;\r\n\t}", "int updateByPrimaryKey(SsSocialSecurityAccount record);", "public void update(Account account) {\n\t\t\n\t}", "void updateUser(int id, UpdateUserDto updateUserDto);", "@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 }", "@Test\n public void testUpdateAccount() {\n for (int i = 0; i < 10; i++) {\n presenter.onUpdateAccount();\n }\n Assert.assertEquals(10, view.getManageUpdateAccountClicks());\n }", "@BodyParser.Of(BodyParser.Json.class)\n @Transactional\n public static Result update(Integer id, String accessToken) {\n AccessToken access = AccessTokens.access(accessToken);\n Result error = Access.checkAuthentication(access, Access.AuthenticationType.CONNECTED_USER);\n if (error != null) {\n \treturn error;\n }\n \n JsonNode root = request().body().asJson();\n if (root == null) {\n \treturn new errors.Error(errors.Error.Type.JSON_REQUIRED).toResponse();\n }\n \n errors.Error parametersErrors = new errors.Error(Type.PARAMETERS_ERROR);\n String email = root.path(\"email\").textValue();\n String password = root.path(\"password\").textValue();\n String oldPassword = root.path(\"old_password\").textValue();\n String firstname = root.path(\"first_name\").textValue();\n String lastname = root.path(\"last_name\").textValue();\n checkParams(false, email, password, firstname, lastname, parametersErrors);\n \n if (parametersErrors.isParameterError())\n \treturn parametersErrors.toResponse();\n \n User user = User.find.byId(id);\n if (user == null) {\n \treturn new errors.Error(errors.Error.Type.USER_NOT_FOUND).toResponse();\n }\n\n error = Access.hasPermissionOnUser(access, user, Access.UserAccessType.WRITE);\n if (error != null) {\n \treturn error;\n }\n\n if (password != null) {\n \tif (oldPassword == null) {\n \t\treturn new errors.Error(Type.PARAMETERS_ERROR).addParameter(\"old_password\", ParameterType.REQUIRED).toResponse();\n \t} else if (!user.password.equals(Utils.Hasher.hash(oldPassword))) {\n \t\treturn new errors.Error(errors.Error.Type.WRONG_PASSWORD).toResponse();\n \t}\n }\n\n updateOneUser(user, root);\n user.save();\n\n return ok(getUserObjectNode(user));\n }", "@Test\n public void test_update() throws Exception {\n User user1 = createUser(1, false);\n\n user1.setUsername(\"new\");\n\n entityManager.getTransaction().begin();\n instance.update(user1);\n entityManager.getTransaction().commit();\n entityManager.clear();\n\n User retrievedUser = instance.get(user1.getId());\n\n assertEquals(\"'update' should be correct.\", user1.getUsername(), retrievedUser.getUsername());\n }", "int updateByPrimaryKey(AccountPaymentMethodEntity record);", "int updateByPrimaryKeySelective(FinanceAccount record);", "@PreAuthorize(\"hasRole('ROLE_USER')\")\r\n\tpublic void updateUserAccount(UserAccount account);", "int updateByPrimaryKey(BankUserInfo record);", "int updateByPrimaryKey(BankUserInfo record);", "@SmallTest\n public void testUpdate() {\n int result = -1;\n if (this.entity != null) {\n Settings settings = SettingsUtils.generateRandom(this.ctx);\n settings.setId(this.entity.getId());\n\n result = (int) this.adapter.update(settings);\n\n Assert.assertTrue(result >= 0);\n }\n }", "public boolean saveAccount(Account account)\n {\n PreparedStatement preparedStatement = null;\n try\n {\n preparedStatement = connection.prepareStatement(\n String.format(\"UPDATE %s.accounts SET balance=? WHERE id = ?;\",\n simpleEconomy.getConfig().getString(\"db.database\")));\n preparedStatement.setDouble(1, account.getBalance());\n preparedStatement.setInt(2, account.getId());\n preparedStatement.execute();\n return true;\n }\n catch (SQLException e)\n {\n e.printStackTrace();\n }\n return false;\n }", "@Test\n public void testUpdatePerson() {\n final AuthenticationToken myToken = login(\"[email protected]\", \"finland\");\n final Group memberGroup = findMemberGroup(myToken);\n final FetchGroupRequest groupRequest = new FetchGroupRequest(memberGroup.getGroupId());\n groupRequest.setUsersToFetch(FetchGroupRequest.UserFetchType.ACTIVE);\n final FetchGroupResponse groupResponse1 = administration.fetchGroup(myToken, groupRequest);\n assertThat(groupResponse1.isOk(), is(true));\n assertThat(groupResponse1.getMembers().size(), is(1));\n\n // Now, let's update the Object, and send it into the IWS\n final User myself = groupResponse1.getMembers().get(0).getUser();\n final Person person = myself.getPerson();\n final Address address = new Address();\n address.setStreet1(\"Mainstreet 1\");\n address.setPostalCode(\"12345\");\n address.setCity(\"Cooltown\");\n address.setState(\"Coolstate\");\n person.setAddress(address);\n person.setFax(\"My fax\");\n person.setBirthday(new Date(\"01-JAN-1980\"));\n person.setMobile(\"+1 1234567890\");\n person.setGender(Gender.UNKNOWN);\n person.setPhone(\"+1 0987654321\");\n person.setUnderstoodPrivacySettings(true);\n person.setAcceptNewsletters(false);\n myself.setPerson(person);\n final UserRequest updateRequest = new UserRequest();\n updateRequest.setUser(myself);\n final Response updateResult = administration.controlUserAccount(myToken, updateRequest);\n assertThat(updateResult.isOk(), is(true));\n\n // Let's find the account again, and verify that the updates were applied\n final FetchUserRequest userRequest = new FetchUserRequest();\n userRequest.setUserId(myself.getUserId());\n final FetchUserResponse userResponse = administration.fetchUser(myToken, userRequest);\n assertThat(userResponse.isOk(), is(true));\n final User myUpdate = userResponse.getUser();\n final Person updatedPerson = myUpdate.getPerson();\n assertThat(updatedPerson.getAlternateEmail(), is(person.getAlternateEmail()));\n assertThat(updatedPerson.getBirthday(), is(person.getBirthday()));\n assertThat(updatedPerson.getFax(), is(person.getFax()));\n assertThat(updatedPerson.getGender(), is(person.getGender()));\n assertThat(updatedPerson.getMobile(), is(person.getMobile()));\n assertThat(updatedPerson.getPhone(), is(person.getPhone()));\n assertThat(updatedPerson.getUnderstoodPrivacySettings(), is(person.getUnderstoodPrivacySettings()));\n assertThat(updatedPerson.getAcceptNewsletters(), is(person.getAcceptNewsletters()));\n\n final Address updatedAddress = updatedPerson.getAddress();\n assertThat(updatedAddress.getStreet1(), is(address.getStreet1()));\n assertThat(updatedAddress.getStreet2(), is(address.getStreet2()));\n assertThat(updatedAddress.getPostalCode(), is(address.getPostalCode()));\n assertThat(updatedAddress.getCity(), is(address.getCity()));\n assertThat(updatedAddress.getState(), is(address.getState()));\n\n // Wrapup... logout\n logout(myToken);\n }", "int updateUserById( User user);", "@Test\r\n public void testUpdateUsuario() throws Exception \r\n {\r\n UsuarioEntity entity = dataUs.get(0);\r\n UsuarioEntity nuevo = factory.manufacturePojo(UsuarioEntity.class);\r\n nuevo.setId(entity.getId());\r\n \r\n usuarioLogic.updateUsuario(nuevo);\r\n \r\n UsuarioEntity buscado = em.find(UsuarioEntity.class, entity.getId());\r\n \r\n Assert.assertEquals(nuevo.getId(), buscado.getId());\r\n }", "@Test\n public void updateTest() {\n reservation3.setId(13L);\n reservation3.setReserveDate(LocalDate.now().plusDays(2));\n reservationService.update(reservation3);\n Mockito.verify(reservationDao, Mockito.times(1)).update(reservation3);\n }", "public boolean updateAcct(String id, Account updAcc){\n if(id.startsWith(\"9\")){\n proList.put(id, (AccntPro) updAcc);\n System.out.println(\"#\"+id+\" a été mis à jour dans la liste des professionnels.\");\n\n } else {\n memberList.put(id, (AccntMember) updAcc);\n System.out.println(\"#\"+id+\" a été mis à jour dans la liste des membres.\");\n }\n return true;\n }", "public void UpdateAccount(int ID) throws InterruptedException, HeadlessException, AWTException, IOException\n {\n\n // Populating the data from Excel\n \t ExcelDataConfig excel=new ExcelDataConfig(ConfigReader.getExcelPath());\n \t try {\n \t\t //Check whether navigated to update account page\n \t\t Thread.sleep(1000);\n Assert.assertTrue(BrowserFactory.driver.findElement(By.linkText(\"Update Account\")).isDisplayed());\n BaseClass.testLog.log(Status.PASS, \"Navigated to update account page\");\n \t }\n \t catch(Exception e) \n \t {\n \t\t//Capture screenshot of the fail page\n\t\t ScreenShot.captureScreenshot(BrowserFactory.driver, \"Navigate to update account page unsuccessfull\");\n\n BaseClass.testLog.log(Status.PASS, \"Navigate to update account page unsuccessfull\");\n \t }\n\n //Click on change name link\n Thread.sleep(1000);\n ChangeName.click();\n\n //Enter first name\n FirstName.clear();\n FirstName.sendKeys(excel.getData(\"Account\",ID, 1));\n\n //Enter last name\n LastName.clear();\n LastName.sendKeys(excel.getData(\"Account\",ID, 2));\n\n //Click on submit button\n SubmitName.click();\n BaseClass.testLog.log(Status.PASS, \"Update Name Successfull\");\n\n //Click on change password\n //ChangePassword.click();\n //Enter current password\n //CurrentPassword.sendKeys(excel.getData(\"Account\",ID, 3));\n //Enter new password\n // NewPassword.sendKeys(excel.getData(\"Account\",ID, 4));\n //Enter confirm password\n //ConfirmPassword.sendKeys(excel.getData(\"Account\",ID, 5));\n //Click on submit button\n //SubmitPassword.click();\n BaseClass.testLog.log(Status.PASS, \"Update password Successfull\");\n\n\n //Click on change email\n ChangeEmail.click();\n //Enter Email address\n Email.clear();\n Email.sendKeys(excel.getData(\"Account\",ID, 6));\n //Click submit button\n SubmitEmail.click();\n BaseClass.testLog.log(Status.PASS, \"Update email Successfull\");\n\n\n //Update cerdit card details\n ChangeCard.click();\n //Click forget button to remove the credit card\n ForgetButton.click();\n BaseClass.testLog.log(Status.PASS,\"Remove credit card details Successfull\");\n\n\n //Click on change region link\n ChangeRegion.click();\n //Select a region fro dropdown list\n Region.click();\n Thread.sleep(1000);\n Actions action = new Actions(BrowserFactory.driver);\n action.sendKeys(Region, Keys.ARROW_DOWN).perform();\n action.sendKeys(Region, Keys.RETURN).click();\n //Click on submit button\n SubmitRegion.click();\n try\n {\n Thread.sleep(1000);\n Assert.assertTrue(BrowserFactory.driver.findElement(By.linkText(\"Your region has been updated\")).isDisplayed());\n BaseClass.testLog.log(Status.PASS, \"Updated region successfully\");\n }\n catch (Exception e)\n {\n \t//Capture screenshot of the fail page\t\n \t ScreenShot.captureScreenshot(BrowserFactory.driver, \"Update region unsuccessfull\");\n \t BaseClass.testLog.log(Status.FAIL,\"Update region unsuccessfull\");\n }\n\n //Click on Change address\n Thread.sleep(1000);\n ChangeAddress.click();\n //Click on Add new address button\n Thread.sleep(1000);\n AddNewAddress.click();\n String Expected = \"Add Address\";\n String Actual = BrowserFactory.driver.findElement(By.xpath(\"//*[@id='content']/div[2]/div[2]/div/h1\")).getText();\n if (Expected == Actual)\n {\n \t BaseClass.testLog.log(Status.PASS, \"Navigated to Add Address page\");\n }\n else\n { \n \t //Capture screenshot of the fail page\t\n \t ScreenShot.captureScreenshot(BrowserFactory.driver, \"Failed to navigate to Address page\");\n \t BaseClass.testLog.log(Status.FAIL, \"Navigate to Add Address page unsuccessfull\");\n }\n //Enter the details in address page\n Thread.sleep(1000);\n Label.sendKeys(excel.getData(\"Account\",ID, 8));\n Thread.sleep(1000);\n Name.clear();\n Name.sendKeys(excel.getData(\"Account\",ID, 9));\n Thread.sleep(1000);\n Address.sendKeys(excel.getData(\"Account\",ID, 10));\n Thread.sleep(1000);\n Suburb.sendKeys(excel.getData(\"Account\",ID, 11));\n Thread.sleep(1000);\n City.sendKeys(excel.getData(\"Account\",ID, 12));\n Thread.sleep(1000);\n PostCode.sendKeys(excel.getData(\"Account\",ID, 13));\n Thread.sleep(1000);\n ContactPhone.sendKeys(excel.getData(\"Account\",ID, 14));\n Thread.sleep(1000);\n AddAddress.click();\n Thread.sleep(1000);\n try\n {\n //string ExpectedMessage = \"Your address has been saved as work\";\n //String ActualMessage = Driver.driver.FindElement(By.PartialLinkText(ExpectedMessage)).Text;\n Thread.sleep(1000);\n Assert.assertTrue(BrowserFactory.driver.findElement(By.linkText(\"Update Account\")).isDisplayed());\n \n BaseClass.testLog.log(Status.PASS,\"Updated address successfully\");\n }\n catch (Exception e)\n {\n \t//Capture screenshot of the fail page\n\t\t ScreenShot.captureScreenshot(BrowserFactory.driver, \"Update address unsuccessfull\");\n \t BaseClass.testLog.log(Status.FAIL,\"Update address unsuccessfull\");\n }\n BaseClass.testLog.log(Status.PASS, \"Update useraccount successfull\");\n \t\n }", "@Test\n\tpublic void testUpdateTicketOk() {\n\t}", "int updateByPrimaryKeySelective(Account record);", "@Test\n\tpublic void testUpdateAdminAccountWithInvalidToken() {\n\t\tassertEquals(2, adminAccountService.getAllAdminAccounts().size());\n\n\t\tString error = null;\n\t\tAdminAccount user = null; \n\t\ttry {\n\t\t\tuser = adminAccountService.updateAdminAccount(USERNAME2, PASSWORD1, NAME1);\n\t\t} catch (InvalidInputException e) {\n\t\t\terror = e.getMessage();\n\t\t}\n\n\t\tassertNull(user);\n\t\t// check error\n\t\tassertEquals(\"You do not have permission to modify this account.\", error);\n\t}", "@Test\n public void testUpdateOwnPassword() throws Exception\n {\n authenticate(\"user1\");\n\n // As user1, change his own password.\n actorService.updateOwnPassword(\"user1\", \"user1newpassword\");\n\n flushTransaction();\n\n // Test that user1's password was changed.\n userAccountService.passwordMatchesAccount(getPrincipal().getUserAccount(), \"user1newpassword\");\n\n authenticate(\"admin\");\n\n // As admin, change his own password.\n actorService.updateOwnPassword(\"admin\", \"adminnewpassword\");\n\n flushTransaction();\n\n // Test that admin's password was changed.\n userAccountService.passwordMatchesAccount(getPrincipal().getUserAccount(), \"adminnewpassword\");\n }", "int updateByPrimaryKey(ResPartnerBankEntity record);", "int updateByPrimaryKey(SessionAccountConnectAttrs record);", "@Test\n\tpublic void testUpdateUserWithoutUserid() {\n\t\tUser testUser = new User();\n\t\ttestUser.setUserEmail(TEST_EMAIL);\n\t\ttestUser.setUserPassword(TEST_PASSWORD);\n\t\t\n\t\tgiven().body(testUser).contentType(ContentType.JSON).when()\n\t\t\t\t.put(getBaseTestURI()).then()\n\t\t\t\t.statusCode(HttpServletResponse.SC_BAD_REQUEST);\n\t}", "@Test\n void updateTest() {\n admin.setSurname(\"Rossini\");\n Admin modifyied = adminJpa.update(admin);\n assertEquals(\"Rossini\", modifyied.getSurname());\n }", "@Test\n\tpublic void testUpdateAdminAccountWithEmptyPassword() {\n\n\t\tString newPassword = \"\";\n\n\t\tString error = null;\n\t\tAdminAccount user = null; \n\t\ttry {\n\t\t\tuser = adminAccountService.updateAdminAccount(USERNAME1, newPassword, NAME1);\n\t\t} catch (InvalidInputException e) {\n\t\t\terror = e.getMessage();\n\t\t}\n\n\t\tassertNull(user);\n\t\t// check error\n\t\tassertEquals(\"Password cannot be empty.\", error);\n\t}", "@Test\n\t public void testUpdate(){\n\t\t try{\n\t\t\t Users user = BaseData.getUsers();\n\t\t\t\twhen(entityManager.merge(user)).thenReturn(BaseData.getDBUsers());\n\t\t\t\tUsers savedUser = userDao.update(user);\n\t\t\t\tassertNotNull(savedUser);\n\t\t\t\tassertTrue(savedUser.getFirstName().equals(\"MerchandisingUI\"));\n\t\t }catch(DataAcessException se){\n\t\t\t logger.error(\"error at service layer while testing update:.\",se);\n\t\t }\n\t }", "@Test\n\t// @Disabled\n\tvoid testUpdateCustomer() {\n\t\tCustomer customer1 = new Customer(1, \"tommy\", \"cruise\", \"951771122\", \"[email protected]\");\n\t\tMockito.when(custRep.findById(1)).thenReturn(Optional.of(customer1));\n\t\tMockito.when(custRep.save(customer1)).thenReturn(customer1);\n\t\tCustomer persistedCust = custService.updateCustomer(1, customer1);\n\t\tassertEquals(1, persistedCust.getCustomerId());\n\t}", "@Test\n public void updateUser() {\n userDAO.createUser(new User(\"dummy\", \"dummy\", 1));\n\n assertTrue(userResource.updateUser(new User(\"dummy\", \"dummyUPDATED\", 2)));\n\n //clean up\n userDAO.removeUser(\"dummy\");\n }", "@Test\n void updateSuccess() {\n String newFirstName = \"Artemis\";\n User userToUpdate = (User) dao.getById(1);\n userToUpdate.setFirstName(newFirstName);\n dao.saveOrUpdate(userToUpdate);\n User userAfterUpdate = (User) dao.getById(1);\n assertEquals(newFirstName, userAfterUpdate.getFirstName());\n }", "int updateByPrimaryKeySelective(ShopAccount record);", "int updateByPrimaryKey(PasswdDo record);", "int updateByPrimaryKey(TestEntity record);", "public abstract void updateAccount(final GDataAccount account)\n throws ServiceException;", "@Test\n\tvoid update() {\n\t\tfinal UserOrgEditionVo userEdit = new UserOrgEditionVo();\n\t\tuserEdit.setId(\"flast1\");\n\t\tuserEdit.setFirstName(\"FirstA\");\n\t\tuserEdit.setLastName(\"LastA\");\n\t\tuserEdit.setCompany(\"ing\");\n\t\tuserEdit.setMail(\"[email protected]\");\n\t\tfinal List<String> groups = new ArrayList<>();\n\t\tgroups.add(\"dig rha\");\n\t\tuserEdit.setGroups(groups);\n\t\tinitSpringSecurityContext(\"fdaugan\");\n\t\tresource.update(userEdit);\n\t\tfinal TableItem<UserOrgVo> tableItem = resource.findAll(null, null, \"flast1\", newUriInfoAsc(\"id\"));\n\t\tAssertions.assertEquals(1, tableItem.getRecordsTotal());\n\t\tAssertions.assertEquals(1, tableItem.getRecordsFiltered());\n\t\tAssertions.assertEquals(1, tableItem.getData().size());\n\n\t\tfinal UserOrgVo user = tableItem.getData().get(0);\n\t\tAssertions.assertEquals(\"flast1\", user.getId());\n\t\tAssertions.assertEquals(\"Firsta\", user.getFirstName());\n\t\tAssertions.assertEquals(\"Lasta\", user.getLastName());\n\t\tAssertions.assertEquals(\"ing\", user.getCompany());\n\t\tAssertions.assertEquals(\"[email protected]\", user.getMails().get(0));\n\t\tAssertions.assertEquals(1, user.getGroups().size());\n\t\tAssertions.assertEquals(\"DIG RHA\", user.getGroups().get(0).getName());\n\n\t\t// Rollback attributes\n\t\tuserEdit.setId(\"flast1\");\n\t\tuserEdit.setFirstName(\"First1\");\n\t\tuserEdit.setLastName(\"Last1\");\n\t\tuserEdit.setCompany(\"ing\");\n\t\tuserEdit.setMail(\"[email protected]\");\n\t\tuserEdit.setGroups(null);\n\t\tresource.update(userEdit);\n\t}", "int updateByPrimaryKeySelective(CusBankAccount record);", "int updateByPrimaryKey(DepAcctDO record);", "@Test\n public void test_update_user_success() throws Exception {\n UserDto user = new UserDto(1L, \"Arya\", \"Stark\", \"[email protected]\");\n\n when(userService.updateUser(user.getUserId(), user)).thenReturn(user);\n\n mockMvc.perform(put(\"/users/{id}\", user.getUserId()).contentType(MediaType.APPLICATION_JSON)\n .content(asJsonString(user))).andExpect(status().isOk());\n\n verify(userService, times(1)).updateUser(user.getUserId(), user);\n verifyNoMoreInteractions(userService);\n }", "public void updateUser(int uid, String name, String phone, String email, String password, int money, int credit);", "@Test\n public void testUpdate() {\n System.out.println(\"update\");\n Address obj = null;\n AddressDAO instance = null;\n boolean expResult = false;\n boolean result = instance.update(obj);\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 }", "@Override\n\tpublic Account updateAccount(Integer id, String type) {\n\t\tfor(Account account:accountList) {\n\t\t\tif(id.compareTo(account.returnAccountNumber()) == 0 ) {\n\t\t\t\taccount.updateAccountType(type);\n\t\t\t\treturn account;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "int updateByPrimaryKey(PasswordCard record);", "@Test\n public void updateContact() {\n }", "@Test\n public void testUpdateUser_InvalidUser() throws Exception {\n when(userService.getUserByUID(anyLong())).thenThrow(IncorrectResultSizeDataAccessException.class);\n\n mockMvc.perform(put(\"/api/users/321?action=unlock\")).andExpect(status().isNotFound());\n\n verify(userService, times(1)).getUserByUID(anyLong());\n }", "@Override\n\tpublic void updateAccount(int idUsuario, int idCarteira) {\n\t}", "int updateByPrimaryKey(AccountAccountTemplateEntity record);", "@org.junit.Test\r\n public void testUpdateReview2() throws Exception {\r\n System.out.println(\"updateReview2\");\r\n Long id = null;\r\n Review review = new Review(new Long(0), \"Max\", 9, \"It's excellent\");\r\n service.insertReview(review);\r\n Review review2 = new Review(new Long(0), \"Jack\", 2, \"Disappointing\");\r\n try{\r\n Review result = service.updateReview(review2, id);\r\n }catch(BusinessException ex){\r\n return;\r\n }\r\n fail(\"Accepted null id\");\r\n }", "@Test\n\tpublic void testUpdateUser() {\n\t\tLogin login = new Login(\"unique_username_4324321\", \"password\");\n\t\t//login is encrypted in createUser method\n\t\tResponse response = createUser(login);\n\t\t//printResponse(response);\n\t\tassertEquals(Status.OK.getStatusCode(), response.getStatus());\n\t\t\n\t\t//update the user\n\t\tLogin update = new Login(\"unique_username_53428971\", \"a_different_password\");\n\t\tupdate.encryptPassword(passwordEncryptionKey);\n\t\tString resource = \"update_user\";\n\t\tString requestType = \"POST\";\n\t\tList<Login> updateLogins = Arrays.asList(login, update);\n\t\t\n\t\tresponse = sendRequest(resource, requestType, Entity.entity(updateLogins, MediaType.APPLICATION_JSON));\n\t\t//printResponse(response);\n\t\tassertEquals(Status.OK.getStatusCode(), response.getStatus());\n\t}", "@Test\n\tpublic void testUpdateAdminAccountWithEmptyName() {\n\t\tassertEquals(2, adminAccountService.getAllAdminAccounts().size());\n\n\t\tString newName = \"\";\n\n\t\tString error = null;\n\t\tAdminAccount user = null; \n\t\ttry {\n\t\t\tuser = adminAccountService.updateAdminAccount(USERNAME1, PASSWORD1, newName);\n\t\t} catch (InvalidInputException e) {\n\t\t\terror = e.getMessage();\n\t\t}\n\n\t\tassertNull(user);\n\t\t// check error\n\t\tassertEquals(\"Name cannot be empty.\", error);\n\t}", "@Test\n public void updateUserCatch() {\n userDAO.createUser(new User(\"dummy\", \"dummy\", 1));\n\n assertFalse(userDAO.updateUser(new User(\"notdummy\", \"dummyUPDATED\", 2)));\n\n //clean up\n userDAO.removeUser(\"dummy\");\n }", "@Test\n\t@Override\n\tpublic void testUpdateObjectWrongIdJson() throws Exception {\n\t}", "int updateByPrimaryKey(SysAuthentication record);", "@Test\r\n\tpublic void test_updateEmployeeDetail() {\r\n\t\tgiven()\r\n\t\t\t\t.contentType(ContentType.JSON)//\r\n\t\t\t\t.queryParam(\"id\", \"2\")//\r\n\t\t\t\t.body(new EmployeeDto(2L, \"sunil\", \"changed\", \"[email protected]\"))//\r\n\t\t\t\t.when()//\r\n\t\t\t\t.put(\"/api/v1/employee\")//\r\n\t\t\t\t.then()//\r\n\t\t\t\t.log()//\r\n\t\t\t\t.body()//\r\n\t\t\t\t.statusCode(200)//\r\n\t\t\t\t.body(\"id\", equalTo(2))//\r\n\t\t\t\t.body(\"firstName\", equalTo(\"sunil\"))//\r\n\t\t\t\t.body(\"lastName\", equalTo(\"changed\"))//\r\n\t\t\t\t.body(\"emailId\", equalTo(\"[email protected]\"));\r\n\r\n\t}", "Accessprofile update(Integer id, Accessprofile accessprofile);", "@Test\r\n public void testupdateCustomer() throws Exception {\r\n System.out.println(\"updateCustomer\");\r\n List<Server.Customer> lesClients = DAOCustomer.loadCustomer(Con());\r\n Server.Customer m = lesClients.get(2);\r\n DAOCustomer.updateCustomer(Con(),1, \"Costa\", \"Rui\",\"15 rue Paul\",\"77290\",\"Paris\",\"[email protected]\",\"M\");\r\n List<Server.Customer> results = DAOCustomer.loadCustomer(Con());\r\n Server.Customer r = results.get(2);\r\n assertFalse(m.getPrenom() == r.getPrenom());\r\n \r\n }", "@Test\n void saveOrUpdateSuccess() {\n String newRoleName = \"readOnly\";\n UserRoles toUpdate = (UserRoles) genericDao.getById(3);\n toUpdate.setRoleName(newRoleName);\n genericDao.saveOrUpdate(toUpdate);\n UserRoles retrievedRole = (UserRoles) genericDao.getById(3);\n assertEquals(newRoleName, retrievedRole.getRoleName());\n log.info(\"update role success test\");\n\n }" ]
[ "0.729067", "0.7267875", "0.71791494", "0.71152", "0.7114287", "0.7111761", "0.70036924", "0.6955015", "0.6955015", "0.692031", "0.6903706", "0.6869812", "0.68528414", "0.6842599", "0.6837474", "0.6812", "0.6771184", "0.67588186", "0.6757361", "0.67451435", "0.67365533", "0.6725754", "0.6633753", "0.6632716", "0.6605833", "0.6568602", "0.6562136", "0.65225446", "0.650105", "0.6492232", "0.64909905", "0.6476862", "0.64510787", "0.64305866", "0.6427425", "0.6414161", "0.640664", "0.64009196", "0.63975245", "0.6386683", "0.63862264", "0.6385632", "0.6384508", "0.63791597", "0.6377348", "0.6374952", "0.63727355", "0.6314884", "0.63101715", "0.63089716", "0.6305965", "0.63029474", "0.63029474", "0.6298428", "0.62873065", "0.62856174", "0.6280604", "0.6280312", "0.62694794", "0.62562245", "0.6253078", "0.6244987", "0.62377113", "0.6228409", "0.62212986", "0.6220946", "0.621879", "0.62162894", "0.6214332", "0.6213163", "0.6210811", "0.62096554", "0.6204183", "0.62033325", "0.620106", "0.61953837", "0.61923105", "0.61769617", "0.61743194", "0.6166574", "0.6162498", "0.6161267", "0.6161061", "0.6159994", "0.6145228", "0.6143484", "0.6131379", "0.6129039", "0.61241895", "0.61168057", "0.6115814", "0.6106581", "0.6099715", "0.6086756", "0.6085616", "0.6079874", "0.6079284", "0.607527", "0.6073437", "0.6072385" ]
0.82513714
0
test find account list by parames
public void testFindAccountList(){ String begin = "2013-01-01" ; String end = "2014-01-01" ; Account account = new Account() ; List<Account> list = this.bean.findAccountList(begin, end, account) ; Assert.assertTrue(list.size()>2) ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<Account> getAccounts(String login);", "@Test\n public void sTest(){\n List<Account> accounts = as.findAllAccount ();\n for (Account account : accounts) {\n System.out.println (account);\n }\n }", "String getAccountList(int accountId);", "@Test\n public void testGetUserAccounts() {\n Bank bank = new Bank();\n User user = new User(\"Petr\", \"0000 000000\");\n AccountOfUser acc = new AccountOfUser(0, \"0000 0000 0000 0000\");\n AccountOfUser acc2 = new AccountOfUser(0, \"0000 0000 0000 0001\");\n List<AccountOfUser> accs = new ArrayList<>();\n accs.add(acc);\n accs.add(acc2);\n bank.addUser(user);\n bank.addAccountToUser(user.getPassport(), acc);\n bank.addAccountToUser(user.getPassport(), acc2);\n assertThat(bank.getUserAccounts(user.getPassport()), is(accs));\n }", "@Override\n\tpublic List<Account> getAccountsByName(String name) {\n\t\treturn jdbcTemplate.query(\"select * from account where locate(?, name)>0 \", new Object[]{name}, new BeanPropertyRowMapper(Account.class));\n\t}", "@Test\n\tpublic void testGetAdminAccountsByName() {\n\n\t\tList<AdminAccount> users = adminAccountService.getAdminAccountsByName(NAME1);\n\t\tassertNotNull(users);\n\t\tassertEquals(users.get(0).getUsername(), USERNAME1);\n\t}", "List<Account> findAccountByAddressStartingWith(String pattern);", "List<Project> findProjectsOfAccount(String username);", "List<UserRepresentation> searchUserAccount(final String username);", "@Test\n public void testMultiSearch_withParens() {\n List<String> fields = new ArrayList<>();\n fields.add(\"sn\");\n fields.add(\"mail\");\n \n BridgeRequest request = new BridgeRequest();\n request.setStructure(\"user\");\n request.setFields(fields);\n request.setQuery(\"(samaccountname=*)\");\n \n RecordList list = null;\n BridgeError unexpectedError = null;\n try {\n list = getAdapter().search(request);\n } catch (BridgeError e) {\n unexpectedError = e;\n }\n \n assertNull(unexpectedError);\n assertTrue(list.getRecords().size() > 0);\n }", "private void ViewAccounts() {\n for (int k = 0; k < accountList.size(); k++) {\n\n System.out.print(k + \": \" + accountList.get(k) + \" || \");\n\n }\n }", "private void loadAccounts() {\n JsonReader jsonReader = null;\n try {\n jsonReader = new JsonReader(parkinglots, \"account\");\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n try {\n accounts = jsonReader.findall();\n } catch (IOException | ParseException e) {\n e.printStackTrace();\n }\n }", "private static Account[] findAccbySmth(RemoteBank bankService) throws Exception {\n\t\tAccount[] accounts = new Account[0];\n\t\tSystem.out.println(\"I want find Accounts by\\n\");\n\t\tSystem.out.println(\"1 - account name\\n\");\n\t\tSystem.out.println(\"2 - balance\\n\");\n\t\tint c = -1;\n\t\ttry {\n\t\t\tc = scanner.nextInt();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Incorrect data type\");\n\t\t\tthrow e;\n\t\t}\n\t\tswitch (c) {\n\t\t\tcase 1:\n\t\t\t\tSystem.out.println(\"Please enter account name at one line\\n\");\n\t\t\t\tscanner.nextLine();\n\t\t\t\tString accountName = scanner.nextLine();\n\t\t\t\taccounts = bankService.searchByAccountName(accountName);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tSystem.out.println(\"Please enter account balance at one line\\n\");\n\t\t\t\tdouble balance = 0;\n\t\t\t\ttry {\n\t\t\t\t\tbalance = scanner.nextDouble();\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tSystem.out.println(\"Incorrect data type\");\n\t\t\t\t}\n\t\t\t\taccounts = bankService.searchByBalance(balance);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Incorrect choice\");\n\t\t\t\tbreak;\n\t\t}\n\t\treturn accounts;\n\t}", "@RequestLine(\"GET /accounts\")\n AccountList getAccountsListOfUser();", "public List<Account> getAccounts(String customerName){\n List<Account> accounts = new ArrayList<>();\n try {\n accounts = getAccountsFromFile();\n } catch (Exception e) {\n System.out.println(messageService.unexpectedError(e));\n }\n System.out.println(accounts.stream().filter(a -> a.getCustomerName().equals(customerName))\n .collect(Collectors.toList()));\n return accounts.stream().filter(a -> a.getCustomerName().equals(customerName))\n .collect(Collectors.toList());\n }", "@Test\r\n public void testAddAcc3() {\r\n assertEquals(bank.searchAccountOwner(a3), p2.getFullName());\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 }", "ArrayList<Bet> selectAllBetsOfAccount(String login) throws DAOException;", "public List <Account> getAllAccountsByRIB(String RIB);", "public List<EOSUser> findUsers(List<String> logins);", "@Test\n @Order(10)\n void get_account_3() {\n client2 = service.createClient(new Client(\"Test 2\"));\n int sumOfIds = 0;\n HashSet<Client> allClients = service.getAllClients();\n for(Client c : allClients) {\n sumOfIds += c.getId();\n }\n // want to give a valid account\n Account needle = client.getAccounts().iterator().next();\n\n Account check = service.getAccount(sumOfIds, needle.getId());\n Assertions.assertNull(check);\n\n // also want to return null in the event both are valid but there is a mismatch\n // client2 is a valid user and needle is a valid account but client2 doesn't own\n // needle, so should return null\n check = service.getAccount(client2.getId(), needle.getId());\n Assertions.assertNull(check);\n }", "List<Authority> findByNameIn(List<AuthorityName> names);", "List<Member> findByName(String name);", "public Account searchAccounts(Account account) {\n\t\treturn null;\r\n\t}", "@Test\r\n public void testAddAcc1() {\r\n assertEquals(bank.searchAccountOwner(a1), p1.getFullName());\r\n }", "private boolean checkUserNameExists(ArrayList<Member> members) throws Exception {\nfor(Member member:members) {\nif(this.userName.equals(member.userName)){\nreturn true;\n}\n}\nreturn false;\n}", "public void searchByAccount() {\n\t\t\n\t\tlog.log(Level.INFO, \"Please Enter the account number you want to search: \");\n\t\tint searchAccountNumber = scan.nextInt();\n\t\tbankop.search(searchAccountNumber);\n\n\t}", "@Test\n void getUserRolesByNameLikeSuccess() {\n List<UserRoles> userRoles = genericDao.getEntityByName(\"roleName\", \"all\");\n assertEquals(2, userRoles.size());\n List<UserRoles> users2 = genericDao.getEntityByName(\"roleName\", \"user\");\n assertEquals(2, users2.size());\n }", "@Test\n public void getListTest() throws SQLException, IDAO.DALException {\n User[] userList = userDAO.getList();\n assertEquals(\"Simon\", userList[0].getNavn());\n assertEquals(\"Silas\", userList[1].getNavn());\n assertEquals(\"Peter\", userList[2].getNavn());\n }", "List<Account> findAll();", "List<Account> findAll();", "@Test\n\tpublic void test_Fetch_All_Accounts() throws DatabaseException, BadParameterException, NotFoundException {\n\t\ttry (MockedStatic<ConnectionUtil> mockedConnectionUtil = mockStatic(ConnectionUtil.class)) {\n\t\t\tmockedConnectionUtil.when(ConnectionUtil::connectToDB).thenReturn(mockConn);\n\t\t\t\n\t\t\tArrayList<Account> actual = accountService.getAllAccounts(\"1\", new AccQueryDTO());\n\t\t\t\n\t\t\tArrayList<Account> expected = new ArrayList<Account>();\n\t\t\texpected.add(new Account(\"Savings\", 10101010, 100.50));\n\t\t\texpected.add(new Account(\"Checking\", 10101011, 1.99));\n\t\t\t\n\t\t\tassertEquals(expected, actual);\n\t\t}\n\t}", "List<UserAccount> getUserAccountListByCompany(Serializable companyId,\r\n Serializable creatorId, Serializable subsystemId);", "@Test\n public void testGetAccountByName() {\n\tassertEquals(1, 1);\n }", "Customer search(String login);", "@Test\n public void testAddAccountToUser() {\n Bank bank = new Bank();\n User user = new User(\"Petr\", \"0000 000000\");\n AccountOfUser acc = new AccountOfUser(0, \"0000 0000 0000 0000\");\n List<AccountOfUser> accs = new ArrayList<>();\n accs.add(acc);\n bank.addUser(user);\n bank.addAccountToUser(user.getPassport(), acc);\n assertThat(bank.getUserAccounts(user.getPassport()), is(accs));\n }", "List<Account> findByUsername(String username);", "@Test\n\tpublic void testGetAllAdminAccountsWithBusinessInformation() {\n\t\tBusinessInformation businessInformation = new BusinessInformation();\n\t\tbusinessInformation.setName(INFO_NAME);\n\t\tList<AdminAccount> users = adminAccountService.getAllAdminAccountsWithBusinessInformation(INFO_NAME);\n\t\tassertNotNull(users);\n\t\tassertEquals(users.get(0).getUsername(), USERNAME1);\n\t\tassertEquals(users.get(1).getUsername(), USERNAME2);\n\t}", "List<User> getMembers(String companyId, String name);", "List<AccountTypeDTO> lookupAccountTypes();", "public ArrayList getAccountList() throws RemoteException, SQLException, Exception;", "List<Account> findAccountByRole(UserRole role);", "@Test\n public void testSearch() {\n List<String> fields = new ArrayList<>();\n fields.add(\"memberOf\");\n fields.add(\"cn\");\n \n BridgeRequest request = new BridgeRequest();\n request.setStructure(\"User\");\n request.setFields(fields);\n request.setQuery(\"(sAMAccountName=mary.olowu)\");\n \n RecordList list = null;\n BridgeError unexpectedError = null;\n try {\n list = getAdapter().search(request);\n } catch (BridgeError e) {\n unexpectedError = e;\n }\n\n Object str = JSONValue.parse((String)list.getRecords().get(0).getValue(\"memberOf\"));\n\n assertTrue(str instanceof JSONArray);\n assertNull(unexpectedError);\n assertTrue(list.getRecords().size() > 0);\n }", "List<Account> getAccountsForCustomerId(int customerId);", "public Account getAccountByOwnerAndName(String user,String accountName);", "@Test\r\n public void testAddAcc2() {\r\n assertEquals(bank.searchAccountOwner(a2), p2.getFullName());\r\n }", "@Test\n void getByPropertyLikeSuccess() {\n List<UserRoles> roles = genericDAO.getByPropertyLike(\"userName\", \"a\");\n for(UserRoles role : roles) {\n log.info(role.getUserName());\n }\n assertEquals(2, roles.size());\n }", "private static void lookupAccount(String email) {\n\t\t\n\t}", "ArrayList<Bet> selectPlayingBetsOfAccount(Account account) throws DAOException;", "public List<Account> queryByParam(Account entity) {\n\t\treturn null;\n\t}", "@Override\n\tpublic List<Account> searchAccountById(String key) {\n\t\treturn m_managementDao.findByAccountIdContaining(key);\n\t}", "ArrayList<Bet> selectWonBetsOfAccount(Account account) throws DAOException;", "ArrayList<String> getAccounts(Klant klant) throws SessionExpiredException, IllegalArgumentException, RemoteException;", "List<AssociatedDevicesInfo> selectDeviceListByTransactionAccountName(@Param(value = \"group_id\") int group_id, @Param(value = \"account_names\") List<String> account_names);", "@Test\n\tvoid findAllMyCompany() {\n\t\tinitSpringSecurityContext(\"mmartin\");\n\n\t\tfinal TableItem<UserOrgVo> tableItem = resource.findAll(\"ligoj\", null, null, newUriInfoAsc(\"id\"));\n\n\t\t// 7 users from company 'ligoj', 0 from delegate\n\t\tAssertions.assertEquals(7, tableItem.getRecordsTotal());\n\t\tAssertions.assertEquals(7, tableItem.getRecordsFiltered());\n\n\t\t// Check the users\n\t\tAssertions.assertEquals(\"alongchu\", tableItem.getData().get(0).getId());\n\t}", "@Test\r\n public void testGetUsuarios() throws Exception \r\n {\r\n List<UsuarioEntity> list;\r\n list = usuarioLogic.getUsuarios();\r\n Assert.assertEquals(dataUs.size(), list.size()); \r\n for(UsuarioEntity entity : list)\r\n {\r\n boolean found = false;\r\n for(UsuarioEntity storedEntity : dataUs)\r\n {\r\n if(entity.getId().equals(storedEntity.getId()))\r\n {\r\n found=true;\r\n }\r\n }\r\n Assert.assertTrue(found);\r\n }\r\n }", "@Test\n public void testGetUsersList() {\n System.out.println(\"getUsersList\");\n\n Set<User> expResult = new HashSet<>();\n expResult.add(new User(\"nick0\", \"[email protected]\"));\n expResult.add(new User(\"nick1\", \"[email protected]\"));\n expResult.add(new User(\"nick2\", \"[email protected]\"));\n expResult.add(new User(\"nick3\", \"[email protected]\"));\n expResult.add(new User(\"nick4\", \"[email protected]\"));\n expResult.add(new User(\"nick5\", \"[email protected]\"));\n expResult.add(new User(\"nick6\", \"[email protected]\"));\n expResult.add(new User(\"nick7\", \"[email protected]\"));\n expResult.add(new User(\"nick8\", \"[email protected]\"));\n expResult.add(new User(\"nick9\", \"[email protected]\"));\n\n Set<User> result = sn10.getUsersList();\n assertEquals(expResult, result);\n }", "public List<Account> findByUserDetails(UserDetails userDetails);", "@Override\r\n\tpublic ArrayList<BankAccountPO> findBankAccountPOList() {\n\t\tArrayList<BankAccountPO> BankAccountList = new ArrayList<>();\r\n\t\tBankAccountList.add(new BankAccountPO(\"SS141250110\",200000));\r\n\t\treturn BankAccountList;\r\n\t}", "@Test\n\tvoid findAllForMyCompany() {\n\t\tinitSpringSecurityContext(\"assist\");\n\t\tfinal TableItem<UserOrgVo> tableItem = resource.findAll(null, null, null, newUriInfoAsc(\"id\"));\n\t\tAssertions.assertEquals(9, tableItem.getRecordsTotal());\n\t\tAssertions.assertEquals(9, tableItem.getRecordsFiltered());\n\t\tAssertions.assertEquals(9, tableItem.getData().size());\n\n\t\t// Check the users\n\t\tAssertions.assertEquals(\"fdoe2\", tableItem.getData().get(0).getId());\n\t\tAssertions.assertTrue(tableItem.getData().get(0).isCanWrite());\n\n\t\t// Check the groups\n\t\tAssertions.assertEquals(0, tableItem.getData().get(0).getGroups().size());\n\t}", "List<Account> findAccountByAgeBetween(int age1, int age2);", "@Test\n public void testSelectByAccount() throws Exception {\n }", "List selectByExample(CusBankAccountExample example);", "List<TransactionRec> loadRecordsByAccount(BankAccount account);", "public CarerAccount getAccountWithUsername(String search){\n\t\tCarerAccount item = null;\n\n\t\tint count = 0;\n for (int i = 0; i < CarerAccounts.size(); ++i) {\n if (CarerAccounts.get(i).getUsername().equals(search)){\n\t\t\t\tcount++;\n item = CarerAccounts.get(i);\n\t\t\t}\n\t\t}\n\t\treturn item;\n\t}", "List<ShopAccount> selectByExample(ShopAccountExample example);", "@Test\n void getUserBy() {\n List<Role> users = (List<Role>) roleDAO.getEntityBy(\"roleName\", \"o\");\n assertEquals(1, users.size());\n }", "@Test\n public void testSearchFilter() {\n List<String> fields = new ArrayList<>();\n fields.add(\"name\");\n \n BridgeRequest request = new BridgeRequest();\n request.setStructure(\"user\");\n request.setFields(fields);\n request.setQuery(\"(samaccountname=*)\");\n \n RecordList list = null;\n BridgeError unexpectedError = null;\n try {\n list = getAdapter().search(request);\n } catch (BridgeError e) {\n unexpectedError = e;\n }\n \n assertNull(unexpectedError);\n assertTrue(list.getRecords().size() > 0);\n }", "List<AccountClasificationDTO> lookupAccountClasifications();", "@Test\n\tpublic void requestAccountsForCustomer12212_checkListOfAccountsIDs_expectContains12345() {\n\n\t\tgiven().\n\t\t\tspec(requestSpec).\n\t\twhen().\n\t\tthen();\n\t}", "List<Account> selectAll();", "List<User> getUserByName(String name);", "public static void UserAccounts() throws FileNotFoundException{\n\t\tScanner input = new Scanner(new File(AccountFile));\t\t\t\t//Creats objects and adds to array list.\r\n\t\t\r\n\t\twhile (input.hasNextLine()) {\t\t\t\t\t\t\t\t\t//Loops as long as there is another line\r\n\t\t\t\r\n\t\t\tString line = input.nextLine();\r\n\t\t\tif(line.equals(\"ADMIN\")) {\t\t\t\t\t\t\t\t\t//Checks if the data is for Admin, creats admin object\r\n\t\t\t\tString AdminUsername = input.nextLine();\r\n\t\t\t\tString AdminPassword = input.nextLine();\r\n\t\t\t\t\r\n\t\t\t\tAdmin admin = new Admin(AdminUsername, AdminPassword);\r\n\t\t\t\taccounts.add(admin);\r\n\t\t\t\t\r\n\t\t\t} if(line.equals(\"COORDINATOR\")){\r\n\t\t\t\tString coordinatorUsername = input.nextLine();\r\n\t\t\t\tString coordinatorPassword = input.nextLine();\r\n\t\t\t\t\r\n\t\t\t\tCoordinator coordinator = new Coordinator(coordinatorUsername, coordinatorPassword);\r\n\t\t\t\taccounts.add(coordinator);\r\n\r\n\t\t\t} if(line.equals(\"APPROVER\")){\r\n\t\t\t\tString approverUsername = input.nextLine();\r\n\t\t\t\tString approverPassword = input.nextLine();\r\n\t\t\t\t\r\n\t\t\t\tApprover approver = new Approver(approverUsername, approverPassword);\r\n\t\t\t\taccounts.add(approver);\r\n\r\n\t\t\t} if(line.equals(\"CASUAL\")){\r\n\t\t\t\tString casualUsername = input.nextLine();\r\n\t\t\t\tString casualPassword = input.nextLine();\r\n\t\t\t\t\r\n\t\t\t\tCasualStaff casual = new CasualStaff(casualUsername, casualPassword);\r\n\t\t\t\taccounts.add(casual);\r\n\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} loginSystem();\r\n\t}", "public void test_selectList_prefixSearch_Tx() throws Exception {\n // ## Arrange ##\n final String prefix = \"S\";\n\n // ## Act ##\n final List<Member> memberList = jdbcManager.from(Member.class).where(\"memberName like ?\", prefix + \"%\")\n .orderBy(\"birthdate desc, memberId asc\").getResultList();\n\n // Assert ##\n assertNotNull(memberList);\n assertNotSame(0, memberList.size());\n for (Member member : memberList) {\n log(member.toString());\n assertTrue(member.memberName.startsWith(prefix));\n }\n }", "private void ReadInAccounts() {\n\t\tLog.d(\"SelectAccountActivity.ReadInAccounts\", \"checking for file\" + AccountMan.CheckForFile());\n\t\taccounts = AccountMan.GetAccounts();\n\t\t//Comment out this line and uncomment the line above after purging the excess accounts\n\t\t//accounts = AccountMan.PurgeDuplicateAccounts(AccountMan.GetAccounts());\n\t\tLog.d(\"SelectAccountActivity.ReadInAccounts\", String.valueOf(accounts.size()));\n\t}", "@Test\n public void testMultiSearch_withoutParens() {\n List<String> fields = new ArrayList<>();\n fields.add(\"sn\");\n fields.add(\"mail\");\n\n BridgeRequest request = new BridgeRequest();\n request.setStructure(\"user\");\n request.setFields(fields);\n request.setQuery(\"memberOf=cn=VPN Users,cn=Users,dc=kineticdata,dc=com\");\n\n BridgeError expectedError = null;\n try {\n getAdapter().search(request);\n } catch (BridgeError e) {\n expectedError = e;\n }\n\n assertNotNull(expectedError);\n }", "@Override\n public Optional<Utilizador> search(String username, List<Utilizador> list) {\n for (Utilizador u : list) {\n if (u.getUsername().equals(username)) {\n return Optional.of(u);\n }\n }\n return Optional.empty();\n }", "List<Agent> listPOSAgentsHaveCredential();", "@Test\n public void testGetMembers()\n {\n System.out.println(\"getMembers\");\n Party instance = null;\n ArrayList<Account> expResult = null;\n ArrayList<Account> result = instance.getMembers();\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 testRetrieveUsersByNames() throws RetrievalException {\r\n System.out.println(\"Demo 3: Retrieves the users by names.\");\r\n\r\n // Should retrieve all users whose first name starts with 'First' and last name starts with 'Last'.\r\n ExternalUser[] users = defaultDBUserRetrieval.retrieveUsersByName(\"First A\", \"Last A\");\r\n // There should be 1 user got.\r\n System.out.println(users.length);\r\n\r\n ExternalUser user = users[0];\r\n // There is only one alternative email.\r\n System.out.println(user.getAlternativeEmails().length);\r\n // The email address should be the same to [email protected].\r\n System.out.println(user.getAlternativeEmails()[0]);\r\n // The design number ratings should be the same as 10.\r\n System.out.println(user.getDesignNumRatings());\r\n // The design rating should be the same as 1563.\r\n System.out.println(user.getDesignRating());\r\n // The design reliability should be the same 1.00 %.\r\n System.out.println(user.getDesignReliability());\r\n // The design volatility should be the same as 431.\r\n System.out.println(user.getDesignVolatility());\r\n // There is no dev rating of the user.\r\n System.out.println(user.getDevNumRatings());\r\n // There is no dev rating of the user.\r\n System.out.println(user.getDevRating());\r\n // There is no dev rating of the user.\r\n System.out.println(user.getDevReliability());\r\n // There is no dev rating of the user.\r\n System.out.println(user.getDevVolatility());\r\n // The email address should be the same as [email protected].\r\n System.out.println(user.getEmail());\r\n // The first name should be the same as First A.\r\n System.out.println(user.getFirstName());\r\n // The last name should be the same as Last A.\r\n System.out.println(user.getLastName());\r\n // The handle should be the same as Handle A.\r\n System.out.println(user.getHandle());\r\n // The user id should be the same as 1001.\r\n System.out.println(user.getId());\r\n\r\n // Should retrieve all users whose last name starts with Last (ignores first name)\r\n ExternalUser[] tcsUsers = defaultDBUserRetrieval.retrieveUsersByName(\" \", \"Last\");\r\n // There should be 3 users got.\r\n System.out.println(tcsUsers.length);\r\n\r\n // must have at least first or last name be not empty.\r\n try {\r\n defaultDBUserRetrieval.retrieveUsersByName(\"\", \"\");\r\n } catch (IllegalArgumentException e) {\r\n // Ignore.\r\n }\r\n\r\n System.out.println();\r\n }", "@Test\n public void testSearch() throws Exception\n {\n // This use case has no authentication requirements.\n unauthenticate();\n\n List<Actor> actors = actorService.search(\"user1\");\n Assert.isTrue(actors.size() == 1);\n Assert.isTrue(actors.get(0).getUserAccount().getUsername().equals(\"user1\"));\n\n authenticate(\"user1\");\n\n actors = actorService.search(\"user2\");\n Assert.isTrue(actors.size() == 1);\n Assert.isTrue(actors.get(0).getUserAccount().getUsername().equals(\"user2\"));\n\n authenticate(\"user2\");\n\n actors = actorService.search(\"Administrator\");\n Assert.isTrue(actors.size() == 1);\n Assert.isTrue(actors.get(0).getUserAccount().getUsername().equals(\"admin\"));\n\n authenticate(\"admin\");\n\n actors = actorService.search(\"user3\");\n Assert.isTrue(actors.size() == 1);\n Assert.isTrue(actors.get(0).getUserAccount().getUsername().equals(\"user3\"));\n }", "public void printAccounts() { \r\n\t\tif ( size == 0 ) {\r\n\t\t\tSystem.out.println(\"Accounts is empty\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"--Listing accounts in the database--\");\r\n\t\tfor(int i = 0; i < accounts.length; i++) {\r\n\t\t\tif ( accounts[i] != null ) {\r\n\t\t\t\tSystem.out.println(accounts[i].toString());\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"--end of listing--\");\r\n\t\tSystem.out.println();\r\n\t\treturn;\r\n\t}", "@Test\n @IfProfileValue(name=\"dept-test-group\", values={\"all\",\"role\"})\n public void _4_2_6_findMultiRolesByNameRecusiveExist() throws Exception {\n this.mockMvc.perform(get(\"/api/v1.0/companies/\"+\n c_1.getId()+\"/departments/\"+\n d_1.getId()+\n \"/roles?name=VP\")\n .header(AUTHORIZATION, ACCESS_TOKEN))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$._embedded.roles\",hasSize(1)))\n .andExpect(jsonPath(\"$._embedded.roles[0].id\",is(r_1.getId().toString())));\n }", "@Test\n public void shouldListExpectedUsers() {\n OrgMembersListPage theMembersPage = open(OrgMembersListPage.class, organization.getName());\n theMembersPage.entriesContainer().shouldHave(text(\"Admin User (admin)\"));\n }", "List<Account> coverListEmpDTOToListAccount(List<AccountDTO> accountDTOList);", "private Account findAccount(String name, String email) throws AccountNotFoundException {\n for (Account current: accounts) {\n if (name.equals(current.getName()) && email.equals(current.getEmail())) {\n return current;\n }\n }\n throw new AccountNotFoundException();\n }", "public static ArrayList<Member> findByName(String usr){\n setConnection();\n \n ArrayList<Member> members = new ArrayList<>();\n \n try{\n Statement statement = con.createStatement();\n \n //Query statement\n String query = \"SELECT * FROM member WHERE name LIKE ?\";\n\n //Create mysql prepared statement\n PreparedStatement preparedStatement = con.prepareStatement(query);\n preparedStatement.setString(1, \"%\"+usr+\"%\");\n \n //Execute the prepared statement\n ResultSet result = preparedStatement.executeQuery();\n \n while(result.next()){\n int memberId = result.getInt(1);\n String name = result.getString(2);\n String email = result.getString(3);\n String phone = result.getString(4);\n String address = result.getString(5);\n String dob = result.getString(6);\n \n members.add(new Member(memberId, name, email, phone, address, dob));\n }\n\n con.close();\n } catch (SQLException e){\n System.out.println(e.getMessage());\n }\n \n return members;\n }", "@Test\n\tvoid findAllForMyCompanyFilter() {\n\t\tinitSpringSecurityContext(\"assist\");\n\n\t\tfinal TableItem<UserOrgVo> tableItem = resource.findAll(\"ing\", null, null, newUriInfoAsc(\"id\"));\n\t\tAssertions.assertEquals(8, tableItem.getRecordsTotal());\n\t\tAssertions.assertEquals(8, tableItem.getRecordsFiltered());\n\t\tAssertions.assertEquals(8, tableItem.getData().size());\n\n\t\t// Check the users\n\t\tAssertions.assertEquals(\"fdoe2\", tableItem.getData().get(0).getId());\n\t\tAssertions.assertTrue(tableItem.getData().get(0).isCanWrite());\n\n\t\t// Check the groups\n\t\tAssertions.assertEquals(0, tableItem.getData().get(0).getGroups().size());\n\t}", "@Test\n public void userExist() {\n String username = argument.substring(0, 15);\n boolean found = false;\n\n for(int i = 0; i<users.size(); i++){\n if(users.get(i).substring(0, 15).trim().toLowerCase().contains(username.trim().toLowerCase())){\n found = true;\n }\n }\n assertTrue(\"User Not Found\", found);\n }", "public void setAccountList(List<Account> accountList) {\r\n this.accountList = accountList;\r\n }", "@Test\n void retrieveAllTest() {\n boolean check1 = false;\n boolean check2 = false;\n List<Admin> adminList = adminJpa.retrieveAll();\n for (Admin anAdmin : adminList) {\n String email = anAdmin.getEmail();\n if (email.equals(\"[email protected]\"))\n check1 = true;\n if (email.equals(\"[email protected]\"))\n check2 = true;\n }\n assertTrue(check1);\n assertTrue(check2);\n }", "@Override\n\tpublic List<Map<String, Object>> getAccountsMapByName(String name) {\n\t\treturn jdbcTemplate.queryForList(\"select * from account where locate(?, name)>0 \", new Object[]{name});\n\t}", "public static String accountValid(String account){\n return \"select u_accountnum from users having u_accountnum = '\" + account + \"'\";\n }", "public List<BarrioCovid> readAll(String email);", "public List<User> listSearch(String search);", "List<ClientResponse> findUsersClient(User user) throws BaseException;", "public Account findAccount(String login) {\r\n\t\tfor (Account account : listOfAccounts)\r\n\t\t\tif (account.getLogin().equals(login)) return account;\r\n\t\treturn null;\r\n\t}", "@Test\n\tpublic void getAccountTestSuccess() {\n\n\t\tString accountNumber = createAccount(\"viaks\",1000);\n\t\tMap<String, String> parametersMap = new HashMap<>();\n\t\tparametersMap.put(\"accountNumber\", accountNumber);\n\n\t\tRestAssured.given().when().parameters(parametersMap).get(\"/account\").then().assertThat().statusCode(200);\n\t}", "public void getUserAccounts(){\n UserAccountDAO userAccountsManager = DAOFactory.getUserAccountDAO();\n //populate with values from the database\n if(!userAccountsManager.readUsersHavingResults(userAccounts)){\n //close the window due to read failure\n JOptionPane.showMessageDialog(rootPanel, \"Failed to read user accounts from database. Please check your internet connection and try again.\");\n System.exit(-4);\n }\n }", "public List<User> findEmployees(String companyShortName, int start, int rows, String sortBy, String sortHow);" ]
[ "0.7156621", "0.67698455", "0.66892624", "0.665632", "0.63419324", "0.6233896", "0.61991704", "0.6141652", "0.60504645", "0.59887385", "0.5986315", "0.5973507", "0.5969425", "0.5949987", "0.59388506", "0.5929813", "0.5903028", "0.59000003", "0.5890329", "0.58677214", "0.5867335", "0.583103", "0.5802886", "0.57881576", "0.578452", "0.5778216", "0.576919", "0.57680327", "0.5762618", "0.5756303", "0.5756303", "0.5750328", "0.57499427", "0.57413495", "0.5734019", "0.5725745", "0.57248646", "0.5711601", "0.56949306", "0.5679263", "0.56761515", "0.56707877", "0.5669972", "0.56639785", "0.5662322", "0.5656615", "0.56529915", "0.5642127", "0.5623376", "0.56163174", "0.56160206", "0.5615829", "0.5615218", "0.5610541", "0.56040484", "0.5597205", "0.55964184", "0.5587608", "0.5571021", "0.5565698", "0.55613524", "0.55612373", "0.55588585", "0.555865", "0.55543464", "0.55508566", "0.5538535", "0.5536881", "0.5525432", "0.55179983", "0.5516808", "0.5514557", "0.55128485", "0.55068594", "0.5505729", "0.54878235", "0.54796314", "0.54774773", "0.5473423", "0.54675096", "0.5462313", "0.54590005", "0.54529965", "0.545226", "0.54494274", "0.5443019", "0.54386604", "0.5435529", "0.5431369", "0.5430292", "0.54214954", "0.54167306", "0.54009384", "0.54003894", "0.5399705", "0.53925884", "0.53886604", "0.53849775", "0.5376618", "0.53732944" ]
0.72411126
0
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); jComboBox1 = new javax.swing.JComboBox(); jButton1 = new javax.swing.JButton(); jPanel1 = new javax.swing.JPanel(); setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(FluidBasicView.class, "FluidBasicView.border.title"))); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(FluidBasicView.class, "FluidBasicView.jLabel1.text")); // NOI18N jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); jComboBox1.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jComboBox1ItemStateChanged(evt); } }); jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Views/OpenFullView.png"))); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(jButton1, org.openide.util.NbBundle.getMessage(FluidBasicView.class, "FluidBasicView.jButton1.text")); // NOI18N jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 0, Short.MAX_VALUE) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 133, Short.MAX_VALUE) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 147, Short.MAX_VALUE) .addComponent(jButton1))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n initComponents();\n }", "public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }", "public FormListRemarking() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n \n }", "public FormPemilihan() {\n initComponents();\n }", "public GUIForm() { \n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "public TorneoForm() {\n initComponents();\n }", "public FormCompra() {\n initComponents();\n }", "public muveletek() {\n initComponents();\n }", "public Interfax_D() {\n initComponents();\n }", "public quanlixe_form() {\n initComponents();\n }", "public SettingsForm() {\n initComponents();\n }", "public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public Soru1() {\n initComponents();\n }", "public FMainForm() {\n initComponents();\n this.setResizable(false);\n setLocationRelativeTo(null);\n }", "public soal2GUI() {\n initComponents();\n }", "public EindopdrachtGUI() {\n initComponents();\n }", "public MechanicForm() {\n initComponents();\n }", "public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }", "public quotaGUI() {\n initComponents();\n }", "public BloodDonationGUI() {\n initComponents();\n }", "public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }", "public PatientUI() {\n initComponents();\n }", "public Oddeven() {\n initComponents();\n }", "public myForm() {\n\t\t\tinitComponents();\n\t\t}", "public intrebarea() {\n initComponents();\n }", "public Magasin() {\n initComponents();\n }", "public RadioUI()\n {\n initComponents();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public ZobrazUdalost() {\n initComponents();\n }", "public FormUtama() {\n initComponents();\n }", "public p0() {\n initComponents();\n }", "public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }", "public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }", "public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }", "public form2() {\n initComponents();\n }", "public MainForm() {\n\t\tsuper(\"Hospital\", List.IMPLICIT);\n\n\t\tstartComponents();\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }", "public kunde() {\n initComponents();\n }", "public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public MusteriEkle() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public DESHBORDPANAL() {\n initComponents();\n }", "public frmVenda() {\n initComponents();\n }", "public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }", "public Botonera() {\n initComponents();\n }", "public FrmMenu() {\n initComponents();\n }", "public OffertoryGUI() {\n initComponents();\n setTypes();\n }", "public JFFornecedores() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "public vpemesanan1() {\n initComponents();\n }", "public FormHorarioSSE() {\n initComponents();\n }", "public Kost() {\n initComponents();\n }", "public frmacceso() {\n initComponents();\n }", "public UploadForm() {\n initComponents();\n }", "public HW3() {\n initComponents();\n }", "public Managing_Staff_Main_Form() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "public sinavlar2() {\n initComponents();\n }", "public P0405() {\n initComponents();\n }", "public MiFrame2() {\n initComponents();\n }", "public IssueBookForm() {\n initComponents();\n }", "public Choose1() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n\n String oldAuthor = prefs.get(\"AUTHOR\", \"\");\n if(oldAuthor != null) {\n this.authorTextField.setText(oldAuthor);\n }\n String oldBook = prefs.get(\"BOOK\", \"\");\n if(oldBook != null) {\n this.bookTextField.setText(oldBook);\n }\n String oldDisc = prefs.get(\"DISC\", \"\");\n if(oldDisc != null) {\n try {\n int oldDiscNum = Integer.parseInt(oldDisc);\n oldDiscNum++;\n this.discNumberTextField.setText(Integer.toString(oldDiscNum));\n } catch (Exception ex) {\n this.discNumberTextField.setText(oldDisc);\n }\n this.bookTextField.setText(oldBook);\n }\n\n\n }", "public GUI_StudentInfo() {\n initComponents();\n }", "public Lihat_Dokter_Keseluruhan() {\n initComponents();\n }", "public JFrmPrincipal() {\n initComponents();\n }", "public bt526() {\n initComponents();\n }", "public Pemilihan_Dokter() {\n initComponents();\n }", "public Ablak() {\n initComponents();\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\" desc=\"Generated\n\t// Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tlabel1 = new java.awt.Label();\n\t\tlabel2 = new java.awt.Label();\n\t\tlabel3 = new java.awt.Label();\n\t\tlabel4 = new java.awt.Label();\n\t\tlabel5 = new java.awt.Label();\n\t\tlabel6 = new java.awt.Label();\n\t\tlabel7 = new java.awt.Label();\n\t\tlabel8 = new java.awt.Label();\n\t\tlabel9 = new java.awt.Label();\n\t\tlabel10 = new java.awt.Label();\n\t\ttextField1 = new java.awt.TextField();\n\t\ttextField2 = new java.awt.TextField();\n\t\tlabel14 = new java.awt.Label();\n\t\tlabel15 = new java.awt.Label();\n\t\tlabel16 = new java.awt.Label();\n\t\ttextField3 = new java.awt.TextField();\n\t\ttextField4 = new java.awt.TextField();\n\t\ttextField5 = new java.awt.TextField();\n\t\tlabel17 = new java.awt.Label();\n\t\tlabel18 = new java.awt.Label();\n\t\tlabel19 = new java.awt.Label();\n\t\tlabel20 = new java.awt.Label();\n\t\tlabel21 = new java.awt.Label();\n\t\tlabel22 = new java.awt.Label();\n\t\ttextField6 = new java.awt.TextField();\n\t\ttextField7 = new java.awt.TextField();\n\t\ttextField8 = new java.awt.TextField();\n\t\tlabel23 = new java.awt.Label();\n\t\ttextField9 = new java.awt.TextField();\n\t\ttextField10 = new java.awt.TextField();\n\t\ttextField11 = new java.awt.TextField();\n\t\ttextField12 = new java.awt.TextField();\n\t\tlabel24 = new java.awt.Label();\n\t\tlabel25 = new java.awt.Label();\n\t\tlabel26 = new java.awt.Label();\n\t\tlabel27 = new java.awt.Label();\n\t\tlabel28 = new java.awt.Label();\n\t\tlabel30 = new java.awt.Label();\n\t\tlabel31 = new java.awt.Label();\n\t\tlabel32 = new java.awt.Label();\n\t\tjButton1 = new javax.swing.JButton();\n\n\t\tlabel1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel1.setText(\"It seems that some of the buttons on the ATM machine are not working!\");\n\n\t\tlabel2.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel2.setText(\"Unfortunately these numbers are exactly what Professor has to use to type in his password.\");\n\n\t\tlabel3.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel3.setText(\n\t\t\t\t\"If you want to eat tonight, you have to help him out and construct the numbers of the password with the working buttons and math operators.\");\n\n\t\tlabel4.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tlabel4.setText(\"Denver's Password: 2792\");\n\n\t\tlabel5.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel5.setText(\"import java.util.Scanner;\\n\");\n\n\t\tlabel6.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel6.setText(\"public class ATM{\");\n\n\t\tlabel7.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel7.setText(\"public static void main(String[] args){\");\n\n\t\tlabel8.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel8.setText(\"System.out.print(\");\n\n\t\tlabel9.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel9.setText(\" -\");\n\n\t\tlabel10.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel10.setText(\");\");\n\n\t\ttextField1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttextField1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tlabel14.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel14.setText(\"System.out.print( (\");\n\n\t\tlabel15.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel15.setText(\"System.out.print(\");\n\n\t\tlabel16.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel16.setText(\"System.out.print( ( (\");\n\n\t\tlabel17.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel17.setText(\")\");\n\n\t\tlabel18.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel18.setText(\" +\");\n\n\t\tlabel19.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel19.setText(\");\");\n\n\t\tlabel20.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel20.setText(\" /\");\n\n\t\tlabel21.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel21.setText(\" %\");\n\n\t\tlabel22.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel22.setText(\" +\");\n\n\t\tlabel23.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel23.setText(\");\");\n\n\t\tlabel24.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel24.setText(\" +\");\n\n\t\tlabel25.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel25.setText(\" /\");\n\n\t\tlabel26.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel26.setText(\" *\");\n\n\t\tlabel27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tlabel27.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel27.setText(\")\");\n\n\t\tlabel28.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel28.setText(\")\");\n\n\t\tlabel30.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel30.setText(\"}\");\n\n\t\tlabel31.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel31.setText(\"}\");\n\n\t\tlabel32.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel32.setText(\");\");\n\n\t\tjButton1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tjButton1.setText(\"Check\");\n\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tjButton1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(28).addGroup(layout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING).addComponent(getDoneButton()).addComponent(jButton1)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, 774, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addGap(92).addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15, GroupLayout.PREFERRED_SIZE, 145,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(37))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(174)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(7)))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label23, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20).addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(23).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16, GroupLayout.PREFERRED_SIZE, 177,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup().addGroup(layout.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(19)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(78)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(76)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(75)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(27))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel23,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(29)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))))\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGap(30)\n\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(25)\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(26).addComponent(jButton1).addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(getDoneButton()).addContainerGap(23, Short.MAX_VALUE)));\n\t\tthis.setLayout(layout);\n\n\t\tlabel16.getAccessibleContext().setAccessibleName(\"System.out.print( ( (\");\n\t\tlabel17.getAccessibleContext().setAccessibleName(\"\");\n\t\tlabel18.getAccessibleContext().setAccessibleName(\" +\");\n\t}", "public Pregunta23() {\n initComponents();\n }", "public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }", "public AvtekOkno() {\n initComponents();\n }", "public busdet() {\n initComponents();\n }", "public Ventaform() {\n initComponents();\n }", "public ViewPrescriptionForm() {\n initComponents();\n }", "public Kuis2() {\n initComponents();\n }", "public CreateAccount_GUI() {\n initComponents();\n }", "public Carrera() {\n initComponents();\n }", "public POS1() {\n initComponents();\n }", "public EqGUI() {\n initComponents();\n }", "public JFriau() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setTitle(\"BuNus - Budaya Nusantara\");\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setBackground(new java.awt.Color(204, 204, 204));\n setMinimumSize(new java.awt.Dimension(1, 1));\n setPreferredSize(new java.awt.Dimension(760, 402));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 750, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n }", "public nokno() {\n initComponents();\n }", "public dokter() {\n initComponents();\n }", "public ConverterGUI() {\n initComponents();\n }", "public hitungan() {\n initComponents();\n }", "public Modify() {\n initComponents();\n }", "public frmAddIncidencias() {\n initComponents();\n }", "public FP_Calculator_GUI() {\n initComponents();\n \n setVisible(true);\n }" ]
[ "0.7318655", "0.7289971", "0.7289971", "0.7289971", "0.72860885", "0.7247684", "0.7213551", "0.72080934", "0.7195069", "0.7189731", "0.7183451", "0.71579945", "0.7147311", "0.7092687", "0.70798934", "0.7055229", "0.69868284", "0.6976656", "0.6954658", "0.6952896", "0.69449455", "0.6941766", "0.6935132", "0.6930653", "0.6926533", "0.6924141", "0.6924061", "0.691111", "0.69099087", "0.6892076", "0.68916506", "0.68900466", "0.6889725", "0.68877757", "0.68822116", "0.6881593", "0.688101", "0.68768275", "0.687494", "0.68733007", "0.6870892", "0.6859287", "0.6855569", "0.68548936", "0.6854684", "0.6854257", "0.68525183", "0.6851817", "0.6851817", "0.6842853", "0.68366945", "0.68358713", "0.68282205", "0.6827655", "0.68258286", "0.68239987", "0.68230146", "0.6816489", "0.68163615", "0.68090576", "0.6808936", "0.68077636", "0.6806842", "0.6806332", "0.68016505", "0.67948395", "0.67940617", "0.67914915", "0.6789197", "0.6788211", "0.6787595", "0.67870516", "0.678107", "0.6765869", "0.67651415", "0.6764227", "0.675663", "0.67545617", "0.67512757", "0.6750906", "0.6742937", "0.6738739", "0.67365867", "0.67357975", "0.673252", "0.6726489", "0.67264307", "0.67190623", "0.6715255", "0.6713752", "0.67136234", "0.6707712", "0.67064816", "0.6703903", "0.6700871", "0.6698895", "0.6698197", "0.66973954", "0.66938066", "0.66912496", "0.66892624" ]
0.0
-1
End of variables declaration//GENEND:variables
private void initMyComponents() { this.jPanel1.setLayout(new BoxLayout(this.jPanel1, BoxLayout.Y_AXIS)); this.jPanel1.add(controller.getPressureController().getEMeasureBasicView()); this.jPanel1.add(controller.getTemperatureController().getEMeasureBasicView()); this.controller.getPressureController().getListeners().add(this); this.controller.getTemperatureController().getListeners().add(this); this.jComboBox1.setModel(new DefaultComboBoxModel(FluidKind.values())); this.changeResponce(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void lavar() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "public void mo38117a() {\n }", "@Override\r\n\tpublic void initVariables() {\n\t\t\r\n\t}", "private void assignment() {\n\n\t\t\t}", "private void kk12() {\n\n\t}", "public void gored() {\n\t\t\n\t}", "public void mo21779D() {\n }", "@Override\n public void func_104112_b() {\n \n }", "public final void mo51373a() {\n }", "protected boolean func_70041_e_() { return false; }", "public void mo4359a() {\n }", "public void mo21782G() {\n }", "private void m50366E() {\n }", "public void mo12930a() {\n }", "public void mo115190b() {\n }", "public void method_4270() {}", "public void mo1403c() {\n }", "public void mo3376r() {\n }", "public void mo3749d() {\n }", "public void mo21793R() {\n }", "protected boolean func_70814_o() { return true; }", "public void mo21787L() {\n }", "public void mo21780E() {\n }", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo21792Q() {\n }", "public void mo21791P() {\n }", "public void mo12628c() {\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "public void mo97908d() {\n }", "public void mo21878t() {\n }", "public void mo9848a() {\n }", "public void mo21825b() {\n }", "public void mo23813b() {\n }", "public void mo3370l() {\n }", "public void mo21879u() {\n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "public void mo21785J() {\n }", "public void mo21795T() {\n }", "public void m23075a() {\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 }", "public void mo21789N() {\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "public void mo21794S() {\n }", "public final void mo12688e_() {\n }", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "private Rekenhulp()\n\t{\n\t}", "public void mo6944a() {\n }", "public static void listing5_14() {\n }", "public void mo1405e() {\n }", "public final void mo91715d() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "public void mo9137b() {\n }", "public void func_70295_k_() {}", "void mo57277b();", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "public void mo21877s() {\n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "public void Tyre() {\n\t\t\r\n\t}", "void berechneFlaeche() {\n\t}", "public void mo115188a() {\n }", "public void mo21880v() {\n }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "public void mo21784I() {\n }", "private stendhal() {\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "public void mo56167c() {\n }", "@Override\n\tpublic void nefesAl() {\n\n\t}", "public void mo44053a() {\n }", "public void mo21781F() {\n }", "public void mo2740a() {\n }", "public void mo21783H() {\n }", "public void mo1531a() {\n }", "double defendre();", "private zzfl$zzg$zzc() {\n void var3_1;\n void var2_-1;\n void var1_-1;\n this.value = var3_1;\n }", "public void stg() {\n\n\t}", "void m1864a() {\r\n }", "private void poetries() {\n\n\t}", "public void skystonePos4() {\n }", "public void mo2471e() {\n }", "private void yy() {\n\n\t}", "@AnyLogicInternalCodegenAPI\n private void setupPlainVariables_Main_xjal() {\n }", "@Override\n\tprotected void getExras() {\n\n\t}", "static void feladat4() {\n\t}", "@Override\n\tpublic void verkaufen() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "public void init() { \r\n\t\t// TODO Auto-generated method\r\n\t }", "public void furyo ()\t{\n }", "public void verliesLeven() {\r\n\t\t\r\n\t}", "protected void initVars() {}", "protected void mo6255a() {\n }" ]
[ "0.63617", "0.6280625", "0.61909467", "0.6095729", "0.6092663", "0.607037", "0.60523474", "0.605212", "0.6002499", "0.59878224", "0.5970378", "0.59679425", "0.5967425", "0.5965642", "0.596177", "0.5942055", "0.5908757", "0.589693", "0.589137", "0.5882839", "0.58795726", "0.58542675", "0.5850878", "0.58504444", "0.5841756", "0.5839311", "0.5834832", "0.5821372", "0.580889", "0.5802595", "0.5793358", "0.5786154", "0.5784295", "0.5784031", "0.57823145", "0.5774607", "0.5760889", "0.57576865", "0.574549", "0.5742612", "0.573284", "0.57327205", "0.57327205", "0.57327205", "0.57327205", "0.57327205", "0.57327205", "0.57327205", "0.5729986", "0.57238674", "0.5722988", "0.5718144", "0.5704055", "0.56985307", "0.56980056", "0.56893533", "0.5688039", "0.5687071", "0.56737286", "0.5659433", "0.56510425", "0.5645038", "0.564365", "0.5642898", "0.5641512", "0.56405234", "0.562868", "0.56283444", "0.56271064", "0.5621948", "0.5618186", "0.56120354", "0.5611326", "0.5610841", "0.5604668", "0.5602491", "0.56024784", "0.5600282", "0.559161", "0.55856514", "0.55762357", "0.5570551", "0.5569697", "0.55596817", "0.5552693", "0.55520314", "0.55489874", "0.55482525", "0.554708", "0.55467427", "0.55457246", "0.5544302", "0.5542325", "0.55405486", "0.5538116", "0.5535594", "0.55260235", "0.5523616", "0.5516166", "0.550274", "0.5501853" ]
0.0
-1
Default ctor with defaul BookService used.
public BookResource() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Book() {\n\t\t// Default constructor\n\t}", "public BookingBean() {\n }", "public BookManager()\n { }", "public BookService(BookRepository repo) {\n\t\tthis.bRepo = repo;\n\t}", "public Book() {}", "public Book() {\n }", "private BookContract() {}", "private BookService getBookService() {\n return bookService;\n }", "private BookContract() {\n }", "private BookContract() {\n }", "@SuppressWarnings(\"unused\")\n private Booking() {\n }", "private BookReader() {\n\t}", "private BookReader() {\r\n }", "public BookConverter() {\r\n }", "protected Book() {\n this.title = \"Init\";\n this.author = \"Init\";\n this.bookCategories = new HashSet<>(10);\n }", "@Autowired\n public AvailabilityServiceImpl(final BookingService bookingService) {\n this.bookingService = bookingService;\n }", "public BookList(){\n\n }", "public BookSearchResource() {\n }", "public Book() {\n this.bookName = \"Five Point Someone\";\n this.bookAuthorName = \"Chetan Bhagat\";\n this.bookIsbnNumber = \"9788129104595\";\n\n }", "private BookMasterContract() {\n }", "public AlbumService() {\n super();\n }", "public BookingInfo() {\n }", "public Library() {\n books = new Book[0];\n numBooks = 0;\n }", "public Service(){\n\t\t\n\t}", "public Library()\r\n\t{\r\n\t\titems = new ArrayList<Book>();\r\n\t}", "public BookResponse() {\n }", "private Service() {}", "public BookInfoDO() {\n super();\n }", "private BookFilters()\n {\n }", "public ServiceClient() {\n\t\tsuper();\n\t}", "public BookManagerImpl() {\n this.attachInterface(this, DESCRIPTOR);\n }", "private FournisseurArboTraficService() {\r\n\t\tsuper();\r\n\t}", "public interface BookService {\n List<Book> selectAll();\n EBook search(String content);\n void insert(String isbn,Long userId) throws Exception;\n List<RequestBookDtoV2> requestSearch(String content, Long userId);\n DetailBookInfo detailBook(String bookId);\n String request(String isbn, Long userId);\n}", "public AutowireService() {\n\t\tSystem.out.println(\"Default constructor used\");\n\t}", "public BookInfoExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public BookAuthor(){}", "public Book() {\n\t\ttitle = null;\n\t\tauthor = null;\n\t}", "public RestService() {\r\n }", "@Override\n public void init() throws ServletException {\n super.init();\n try {\n var bookDAO = getDaoImpl(BookImplDB.class);\n bookService = new BookService(bookDAO);\n } catch (IllegalArgumentException ex) {\n throw new ServletException(ex);\n }\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic InventoryServiceBean() {\n }", "private AnagramService() {\n\t}", "public Book () {\n\t\tsuper ();\n\t\t_title = \"\";\n\t\t_text = \"\";\n\t\t_publisher = null;\n\t\t_oid = 0;\n\t\t_author = null;\n\t\t_Isbn = \"\";\n\t}", "private ServiceGen() {\n }", "private GeneralServicesImpl() {\r\n\t}", "protected AbstractService() {\n this(false);\n }", "public BookRecord() {\n super(Book.BOOK);\n }", "private ServiceListingList() {\n //This Exists to defeat instantiation\n super();\n }", "Book(int id, String judul, int tahun) {\n // nah disini mirip kayak override/overload, cuman pake nya keyword this\n // this ini merujuk ke variabel yang diatas(property) sedang yang nggak merujuk\n // ke parameter\n this.id = id;\n this.judul = judul;\n this.tahun = tahun;\n }", "@Autowired\n public BookService(BookRepository bookRepository) {\n\n this.bookRepository = bookRepository;\n }", "public static Books setUpClient() {\n return new Books.Builder(AndroidHttp.newCompatibleTransport()\n , jsonFactory, null)\n .setApplicationName(APPLICATION_NAME)\n .setGoogleClientRequestInitializer(new BooksRequestInitializer(APIKEY))\n .build();\n }", "public Library() {\n this.okToPrint = true;\n this.libraryBooks = this.readBookCollection();\n this.patron = new HashMap<String, Patron>();\n this.calendar = new Calendar();\n this.openOrNot = false;\n this.numberedListOfServing = new HashMap<Integer, Book>();\n this.searchBooks = new ArrayList<Book>();\n this.numberedListOfSearch = new HashMap<Integer, Book>();\n this.serveOrNot = false;\n this.searchOrNot = false;\n this.servingPatron = new Patron(null,null);\n }", "public interface BookService {\n\tpublic List<BookJoin> join();\n\tpublic Book insert(Book student);\n\tpublic Book update(Book student);\n\tpublic boolean delete(Book student);\n\tpublic Iterable<Book> findAll(String libid);\n\tpublic void deleteAll();\n}", "public ClienteServicio() {\n }", "public RecordService() {\n super(\"RecordService\");\n }", "@Override\r\n\tpublic void init(ServletConfig config) throws ServletException {\n\t\tbookService = new BookService();\r\n\t}", "public RestService() {\r\n \r\n }", "private ServiceLocator(){}", "Library(List<Book> books) {\n\n // Referring to same book as\n // this keyword refers to same instance itself\n this.books = books;\n }", "private ReportService() { }", "public ReservationApi()\r\n {\r\n }", "@Bean\r\n\t@Lazy(value=true)\r\n\tpublic Book book() {\n\t\treturn new Book(109, \"Spring in Action\", defaultAuthor);\r\n\t\t//return new Book(109, \"Spring in Action\", config.author());\r\n\t}", "public ProductosBean() {\r\n }", "public SearchBooksBean() {\r\n \t\tclearFilter();\r\n \t}", "public interface BookService {\n\n /**\n * 根据主键删除图书\n * @param id\n * @return\n */\n int deleteByPrimaryKey(String id);\n\n /**\n * 插入新的图书\n * @param record\n * @return\n */\n int insert(Book record);\n\n /**\n * 有条件的插入图书信息\n * @param record\n * @return\n */\n int insertSelective(Book record);\n\n /**\n * 根据主键查询图书信息\n * @param id\n * @return\n */\n Book selectByPrimaryKey(String id);\n\n /**\n * 分页查询\n * @param bookName\n * @param pageNum\n * @param pageSize\n * @return\n */\n Pagination<BookVo> selectPageQuery (String bookName, int pageNum , int pageSize);\n\n /**\n * 有条件的更新图书信息\n * @param record\n * @return\n */\n int updateByPrimaryKeySelective(Book record);\n\n /**\n * 更新图书信息\n * @param record\n * @return\n */\n int updateByPrimaryKey(Book record);\n\n /**\n * 查询所有信息\n */\n List<Book> selectAll();\n\n\n /**\n * @param authorId\n * @return java.util.List<cn.edu.hfut.xc.bookauthordemo.common.model.Book>\n * @description 根据作者id来获取该作者所写的图书信息\n * @method selectBooksByAuthorId\n */\n List<Book> selectBooksByAuthorId(@Param(\"authorId\") String authorId);\n\n //根据图书馆id查询图书信息\n List<Book> selectBooksByLibraryId(@Param(\"libraryId\") String libraryId);\n\n //根据商店id查询商店售卖的图书信息\n List<Book> selectBooksByShopId(@Param(\"shopId\") String shopId);\n\n //根据商店id查询商店售卖的图书信息\n List<Book> selectBooksByNationalityId(@Param(\"nationalityId\") String nationalityId);\n\n /**\n * @param id\n * @return cn.edu.hfut.xc.bookauthordemo.common.model.Book\n * @description 根据主键查询图书信息\n * @method selectBookAuthorByPrimaryKey\n */\n Book selectBookAuthorByPrimaryKey(String id);\n\n /*\n * @param\n * @return java.util.List<cn.edu.hfut.xc.bookauthordemo.common.model.Book>\n * @description 查询所有图书信息\n * @method selectBookWithAuthor\n */\n List<Book> selectBookWithAuthor();\n\n /**\n * @param id\n * @return cn.edu.hfut.xc.bookauthordemo.common.model.Book\n * @description 根据主键查询图书信息包括该书所在的图书馆信息\n * @method selectBookLibraryByPrimaryKey\n */\n Book selectBookLibraryByPrimaryKey(String id);\n\n /**\n * @param\n * @return java.util.List<cn.edu.hfut.xc.bookauthordemo.common.model.Book>\n * @description 查询所有图书信息和该图书所在的图书馆信息\n * @method selectBookWithLibrary\n */\n List<Book> selectBookWithLibrary();\n\n// PageList<Book> pageSelect(String bookName, int pageNum , int pageSize );\n}", "public Book(Integer id) {\n\t\tthis.id = id;\n\t}", "private ServiceGenerator() {\n }", "private ServiceGenerator() {\n }", "public OfferBean() {\n\n }", "private ServiceFactory() {}", "private ServiceGenerator() {\n }", "public ContactsService() {\r\n }", "public BudgetAccountServiceImpl() {\r\n\t}", "private ServiceLocator() {\r\n\t\t\r\n\t}", "public interface BookService {\n List<Book> getAllAvailable();\n List<Book> getAllUnavailable();\n Book getByID(long id);\n Book save(Book book);\n void delete(long id);\n String healthcheck();\n}", "public BookAdapter(Context context, List<Book> books) {\n super(context, 0, books);\n }", "public VBookDao() {\n\t\tsuper(org.jooq.test.h2.generatedclasses.tables.VBook.V_BOOK, org.jooq.test.h2.generatedclasses.tables.pojos.VBook.class);\n\t}", "public CarAccessBean () {\n super();\n }", "public OfficerWS() {\n officerDao = new OfficerDaoBd();\n }", "public addressBean() {\n }", "public ServiceFactoryImpl() {\n\t\tsuper();\n\t}", "public AutoSenderService() {\r\n\t\tsuper();\r\n\t}", "private APIClient() {\n }", "private AddressBook() {\n addressList = new ArrayList<>();\n }", "public interface IBookService {\n\n /**\n * 通过公司id查询公司的书库信息\n * @param companyId\n * @return\n */\n public List<Book> getLibraryByUsr(long companyId);\n\n /**\n * 通过isbn号查询书籍详情\n * @param isbn\n * @return\n */\n public Book getBookInfoByIsbn(String isbn);\n\n /**\n * 通过isbn号借阅书籍\n * @param\n * @return\n */\n public Response borrowBookByIsb(BookBorrow bookBorrow)throws Exception;\n\n /**\n * 通过企业ID查询企业借阅信息\n * @param page\n * @return\n */\n public List<BookBorrow> queryBorrowInfoByCompanyId(PageQuery page);\n\n /**\n * 通过用户id查询用户借阅信息\n * @param page\n * @return\n */\n public List<BookBorrow> queryBorrowInfoByUsrId(PageQuery page);\n\n /**\n * 还书\n * @return\n */\n public Response backBook(BookBorrow bookBorrow) throws Exception;\n\n /**\n * 书籍入库\n * @param isbn\n * @param usrId\n * @return\n */\n public Response addBookToLibrary(String isbn,long usrId) throws Exception;\n\n /**\n *\n * @param isbn\n * @param usrId\n * @return\n * @throws Exception\n */\n public Response addBookToLibraryReq(String isbn, long usrId) throws Exception;\n\n /**\n * 管理员查询所有入库申请\n * @param usrId\n * @return\n * @throws Exception\n */\n public Response getAllBookInLibReq(long usrId)throws Exception;\n\n /**\n * 审批入库申请\n * @param isbn\n * @return\n * @throws Exception\n */\n public Response approveBookInlib(long usrId,String isbn)throws Exception;\n}", "public DebtorsAgingBean() {\n }", "private SiteEditService() {\r\n \r\n }", "public ControladorCatalogoServicios() {\r\n }", "public EmailService() {\n }", "public PersonBean() {\n\t}", "public TestService() {}", "public Bean_article() {\n }", "public DigestListService() {\r\n parserRssService = new ParserRss();\r\n generalDao = new GeneralDao();\r\n }", "public VehmonService() {\n }", "@Autowired\n\tpublic BookingService(Mapper mapper, PatientRepository patientRepository,\n\t\t\tReservationRepository reservationRepository, SessionRepository sessionRepository,\n\t\t\tMailSendingRepository mailSendingRepository, MailTemplateRepository mailTemplateRepository,\n\t\t\tDepartmentRepository departmentRepository, UserChildRepository userChildRepository,\n\t\t\tUserRepository userRepository, HospitalRepository hospitalRepository, DoctorRepository doctorRepository) {\n\t\tthis.mapper = mapper;\n\t\tthis.patientRepository = patientRepository;\n\t\tthis.reservationRepository = reservationRepository;\n\t\tthis.sessionRepository = sessionRepository;\n\t\tthis.mailSendingRepository = mailSendingRepository;\n\t\tthis.mailTemplateRepository = mailTemplateRepository;\n\t\tthis.departmentRepository = departmentRepository;\n\t\tthis.userChildRepository = userChildRepository;\n\t\tthis.userRepository = userRepository;\n\t\tthis.hospitalRepository = hospitalRepository;\n\t\tthis.doctorRepository = doctorRepository;\n\t}", "public BookcaseTest () {\n }", "private BookmarkStore() {\n }", "public BookingSystemTest()\n {\n }", "public ServiceCompte() {\n\t\tsuper();\n\t}", "public Book()\n {\n title = null;\n author = null;\n }", "Service(){\r\n\t\tserviceName =\"x\";\r\n\t\tserviceID = 0;\r\n\t\tserviceFee = 0.0;\r\n\t\tserviceDescrp = \"zztop\";\r\n\t}" ]
[ "0.7586205", "0.7300427", "0.7165619", "0.7148921", "0.71281314", "0.71108645", "0.70973593", "0.7080727", "0.6969158", "0.6969158", "0.6927313", "0.69136286", "0.69061244", "0.6891125", "0.68646085", "0.68605167", "0.68520325", "0.6745712", "0.67413145", "0.67123884", "0.6711188", "0.6698846", "0.66484123", "0.66423553", "0.6600355", "0.65786314", "0.65477556", "0.65113693", "0.6491705", "0.647504", "0.6416921", "0.6393887", "0.6381793", "0.6376429", "0.6372669", "0.63721496", "0.6355196", "0.63147795", "0.6307852", "0.6294436", "0.6289928", "0.6286989", "0.6284228", "0.6256455", "0.6226956", "0.6226752", "0.62191594", "0.6208873", "0.62063783", "0.6197008", "0.61937815", "0.6176197", "0.61653167", "0.6155371", "0.6149737", "0.61458945", "0.6133854", "0.61184025", "0.6104946", "0.6103593", "0.6101848", "0.6101819", "0.6100418", "0.60998297", "0.6093716", "0.6088311", "0.6088311", "0.6087824", "0.6086337", "0.6081249", "0.60728365", "0.60568756", "0.60548776", "0.6038512", "0.60292524", "0.6019298", "0.60146195", "0.60137045", "0.6008946", "0.6003684", "0.5983962", "0.5982448", "0.59747463", "0.5971837", "0.59711635", "0.596861", "0.59568477", "0.5956101", "0.59560895", "0.59503084", "0.59494084", "0.5947986", "0.5947692", "0.59451866", "0.59422725", "0.59377444", "0.59356344", "0.5929138", "0.5924903", "0.59198195" ]
0.6895655
13
Returns currently used bookService.
private BookService getBookService() { return bookService; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public java.lang.String getServiceBook () {\r\n\t\treturn serviceBook;\r\n\t}", "public Object getService() {\n return service;\n }", "public String getService() {\n\t\treturn service.get();\n\t}", "public BluetoothService getService() {\n return _service;\n }", "@Override\n\tpublic ArrayList<com.easybooking.model.BookedServices> getBookedServices() {\n\t\treturn null;\n\t}", "public Service getService() {\n\t\treturn _service;\n\t}", "public EPPService getService() {\n\t\treturn service;\n\t}", "private Service getService() {\n return service;\n }", "public Service getService() {\n return serviceInstance;\n }", "public String getService() {\n return service;\n }", "public String getService() {\n return service;\n }", "public String getService() {\n return service;\n }", "public String getService() {\n return this.service;\n }", "public String getService() {\n return this.service;\n }", "public String getService() {\n return this.service;\n }", "public Service getService()\n {\n return (Service) getSource();\n }", "public static Booking getBooking() {\n return sBooking;\n }", "public Service getService() {\n\t\treturn this;\n\t}", "public com.sohlman.liferay.foobar.service.BarService getBarService() {\n return barService;\n }", "public BarService getBarService() {\n\t\treturn barService;\n\t}", "public java.lang.CharSequence getService() {\n return service;\n }", "public java.lang.CharSequence getService() {\n return service;\n }", "public synchronized BluetoothService getBluetoothService(){\n\t\treturn bluetoothService;\n\t}", "public String getService(){\n\t\t return service;\n\t}", "public AbstractService getService() {\n return service;\n }", "BLEService getService() {\n return BLEService.this;\n }", "public OrdersBusinessInterface getService() {\r\n\t\treturn service;\r\n\t}", "public Bookstore getBookstore() throws NumberFormatException, RemoteException, NotBoundException {\r\n\t\tif (System.getSecurityManager() == null) {\r\n\t\t\tSystem.setSecurityManager(new SecurityManager());\r\n\t\t}\r\n\t\tRegistry registry;\r\n\t\tBookstore bookstore;\r\n\t\t\r\n\t\tregistry = LocateRegistry.getRegistry(adressTextField.getText(), Integer.parseInt(portTextField.getText()));\r\n\t\tbookstore = (Bookstore) registry.lookup(\"Bookstore\");\r\n\t\treturn bookstore;\r\n\t}", "public ServiceInfo getSelectedService() {\n return includedService;\n }", "public Text getService() {\n return service;\n }", "public java.lang.String getService() {\n java.lang.Object ref = service_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n service_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getService() {\n java.lang.Object ref = service_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n service_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getService() {\n java.lang.Object ref = service_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n service_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public Book getBook() {\r\n\t\treturn b;\r\n\t}", "public java.lang.String getService() {\n java.lang.Object ref = service_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n service_ = s;\n return s;\n }\n }", "public java.lang.String getService() {\n java.lang.Object ref = service_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n service_ = s;\n return s;\n }\n }", "public java.lang.String getService() {\n java.lang.Object ref = service_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n service_ = s;\n return s;\n }\n }", "public boolean getUseGlobalService();", "public DownloadService getService() {\n return DownloadService.this;\n }", "public String getBalService() {\r\n\t\treturn balService;\r\n\t}", "public ViewObjectImpl getBooksVOInstance() {\n return (ViewObjectImpl)findViewObject(\"BooksVOInstance\");\n }", "public TTSService getService() {\n return TTSService.this;\n }", "public BindingService getService() {\n return BindingService.this;\n }", "public interface BookService {\n List<Book> getAllAvailable();\n List<Book> getAllUnavailable();\n Book getByID(long id);\n Book save(Book book);\n void delete(long id);\n String healthcheck();\n}", "PubService getService() {\n return PubService.this;\n }", "public static BookFactory getInstance()\r\n {\r\n \r\n if(bookFactoryInstance == null)\r\n {\r\n bookFactoryInstance = new BookFactory();\r\n }\r\n \r\n return bookFactoryInstance;\r\n }", "@Override\n\tpublic BaseServic<Banco> getService() {\n\t\treturn service;\n\t}", "public Book getBook() {\n return book;\n }", "public LocationService getService()\n {\n return LocationService.this;\n }", "public void setServiceBook (java.lang.String serviceBook) {\r\n\t\tthis.serviceBook = serviceBook;\r\n\t}", "public PlaylistBusinessInterface getService() {\n\t\treturn service;\n\t}", "@NotNull\n public static UsageTracker getInstance() {\n return ServiceManager.getService(UsageTracker.class);\n }", "@Override\r\n\tpublic Book getBook(long bookId) {\n\t\treturn bd.getOne(bookId);\r\n\t}", "public IVirtualBookRef currentVirtualBook() {\n\t\tif (currentElement >= 0 && currentElement < size()) {\n\t\t\treturn get(currentElement);\n\t\t}\n\t\treturn null;\n\t}", "public StatusService getStatusService() {\r\n return this.statusService;\r\n }", "public Book getBook() {\n\t\treturn book; //changed BoOk to book\r\n\t}", "private IPersonServiceLocal getPersonService() {\n\t\treturn _businessServicesLocator.getPersonServiceLocal();\n\t}", "public ReferenceService getReferenceService(){\n\t\treturn this.referenceService;\n\t}", "public ViewObjectImpl getBooksReservedVOInstance() {\n return (ViewObjectImpl)findViewObject(\"BooksReservedVOInstance\");\n }", "public int getServiceID() {\n return serviceID;\n }", "public String getBook() {\n\t\treturn book;\r\n\t}", "public Object getPersonService() {\n\t\treturn null;\n\t}", "public ServiceID getServiceID() {\n return null;\n }", "public com.sohlman.liferay.foobar.service.FooService getFooService() {\n return fooService;\n }", "public java.lang.Long getServiceId() {\n return serviceId;\n }", "protected StatusService getStatusService() {\n return getLockssDaemon().getStatusService();\n }", "public go.micro.runtime.RuntimeOuterClass.Service getService() {\n return service_ == null ? go.micro.runtime.RuntimeOuterClass.Service.getDefaultInstance() : service_;\n }", "public go.micro.runtime.RuntimeOuterClass.Service getService() {\n return service_ == null ? go.micro.runtime.RuntimeOuterClass.Service.getDefaultInstance() : service_;\n }", "public go.micro.runtime.RuntimeOuterClass.Service getService() {\n return service_ == null ? go.micro.runtime.RuntimeOuterClass.Service.getDefaultInstance() : service_;\n }", "public go.micro.runtime.RuntimeOuterClass.Service getService() {\n if (serviceBuilder_ == null) {\n return service_ == null ? go.micro.runtime.RuntimeOuterClass.Service.getDefaultInstance() : service_;\n } else {\n return serviceBuilder_.getMessage();\n }\n }", "public go.micro.runtime.RuntimeOuterClass.Service getService() {\n if (serviceBuilder_ == null) {\n return service_ == null ? go.micro.runtime.RuntimeOuterClass.Service.getDefaultInstance() : service_;\n } else {\n return serviceBuilder_.getMessage();\n }\n }", "public go.micro.runtime.RuntimeOuterClass.Service getService() {\n if (serviceBuilder_ == null) {\n return service_ == null ? go.micro.runtime.RuntimeOuterClass.Service.getDefaultInstance() : service_;\n } else {\n return serviceBuilder_.getMessage();\n }\n }", "public ID getServiceID() {\n\treturn serviceID;\n }", "public PreferenceService getPreferenceService() {\n return preferenceService;\n }", "WorkoutService getService() {\n return WorkoutService.this;\n }", "public java.lang.Long getServiceId() {\n return serviceId;\n }", "public AppService appService() {\n\t\treturn appService;\n\t}", "public Class getServiceClass() { return serviceClass; }", "MainService getService() {\n return MainService.this;\n }", "public ServiceCombo getServices()\n {\n return services;\n }", "public ID getMainService() { \r\n\t\tID retVal = this.getTypedField(46, 0);\r\n\t\treturn retVal;\r\n }", "UpdateService getService() {\n\t\t\treturn UpdateService.this;\r\n\t\t}", "public static IPayService getInstance(ApplicationContext context) {\r\n return (IPayService) context.getBean(SERVICE_BEAN_ID);\r\n }", "public interface BookService {\n\tpublic List<BookJoin> join();\n\tpublic Book insert(Book student);\n\tpublic Book update(Book student);\n\tpublic boolean delete(Book student);\n\tpublic Iterable<Book> findAll(String libid);\n\tpublic void deleteAll();\n}", "public ServiceID getServiceID() {\n\t\treturn null;\n\t}", "public RentService getRentService() {\n\t\treturn this.rentService;\n\t}", "public com.google.protobuf.ByteString\n getServiceBytes() {\n java.lang.Object ref = service_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n service_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getServiceBytes() {\n java.lang.Object ref = service_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n service_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getServiceBytes() {\n java.lang.Object ref = service_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n service_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public void returnBook()\n\t{\n\t\tavailableBooks++;\n\t}", "ClassOfService getClassOfService();", "String getServiceRef();", "protected AbstractApplicationContext getServicesContext() {\r\n\t\treturn this.servicesContext;\r\n\t}", "private PackageService getPackageService() {\n\t\treturn packageService;\n\t}", "public GeoService getService() {\n return GeoService.this;\n }", "public org.apache.xmlbeans.XmlString xgetServiceID()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(SERVICEID$6, 0);\n return target;\n }\n }", "public Book getBook() \t\t{ return this.myBook; }", "Book getLatestBook();", "public DeveloperService getDeveloperService() {\n return developerService;\n }", "public static ProductsService getInstance() {\n\t\treturn productsService;\n\t}" ]
[ "0.733516", "0.6209562", "0.61604327", "0.6144707", "0.6109761", "0.61023074", "0.6091382", "0.60766095", "0.6060945", "0.59764177", "0.59764177", "0.59764177", "0.5970774", "0.5970774", "0.5970774", "0.59557766", "0.5915895", "0.5902728", "0.58994126", "0.58790874", "0.58740485", "0.58671784", "0.58628845", "0.5805254", "0.57867956", "0.577576", "0.5766232", "0.57416266", "0.5714139", "0.57078195", "0.5636915", "0.5636915", "0.5636915", "0.561811", "0.5614192", "0.5614192", "0.5614192", "0.5545033", "0.55358785", "0.55349976", "0.5527024", "0.55064106", "0.5505533", "0.54974896", "0.5481143", "0.5465786", "0.5463721", "0.54461944", "0.54393417", "0.5432017", "0.54263735", "0.54246914", "0.5421081", "0.5411468", "0.5408918", "0.54071146", "0.536674", "0.53557056", "0.53488404", "0.5345573", "0.53408265", "0.5327523", "0.5322493", "0.53150177", "0.531204", "0.53064805", "0.5294432", "0.5294432", "0.5294432", "0.52942866", "0.52942866", "0.52942866", "0.5293964", "0.52892697", "0.52849585", "0.5284273", "0.5281667", "0.527135", "0.5268954", "0.5264873", "0.52636814", "0.52626324", "0.52598137", "0.52594733", "0.525852", "0.52527684", "0.5249562", "0.5249562", "0.5249562", "0.5248725", "0.52472746", "0.5246335", "0.5236884", "0.5235916", "0.522911", "0.52274865", "0.5225379", "0.52249646", "0.5220207", "0.5211552" ]
0.7357729
0
Rest request creating a new Book on the service data.
@POST @Consumes(MediaType.APPLICATION_JSON) public Response createBook(Book book) { final BookServiceResult result = bookService.addBook(book); return Response .status(result.getStatus()) .entity(getJsonFromServiceResult(result)) .build(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@PostMapping(\"/books\")\n\tpublic Book createBook(@RequestBody Book book)\n\t{\n\t\treturn bookRepository.save(book);\n\t}", "public com.huqiwen.demo.book.model.Books create(long bookId);", "@PostMapping\n\tpublic ResponseEntity<?> createBook(@Valid @RequestBody Book book, UriComponentsBuilder ucBuilder) {\n\t\tif (bookRepository.findByIsbn(book.getIsbn()).isPresent()) {\n\t\t\tthrow new BookIsbnAlreadyExistException(book.getIsbn()); \n\t\t}\n\t\tLOGGER.info(\"saving book\");\n\t\tbookRepository.save(book);\n\n\t\tHttpHeaders headers = new HttpHeaders();\n\t\t// uri templates & UCB to specify resource location\n\t\t/**\n\t\t * 2. We need to send where the new book resource can be located, so the client is\n\t\t * able to parse the header response and make a new request to retrieve the book's data.\n\t\t */\n\t\theaders.setLocation(ucBuilder.path(\"/api/books/{isbn}\").buildAndExpand(book.getIsbn()).toUri());\n\t\theaders.setContentType(MediaType.APPLICATION_JSON);\n\n\t\tLOGGER.info(\"setting headers and sending response\");\n\n\t\treturn new ResponseEntity<>(headers, HttpStatus.CREATED);\n\t}", "@RequestMapping(value=\"/createBook\",method=RequestMethod.POST,consumes=\"application/json\")\n\tpublic ResponseEntity<Void> createBook (@RequestBody Book bookMap,UriComponentsBuilder uri) throws JsonMappingException, JsonParseException, IOException{\n\t\tbookRepository.save(bookMap);\n\t\tHttpHeaders header = new HttpHeaders();\n\t\treturn new ResponseEntity<Void>(header,HttpStatus.CREATED);\n\t}", "public static Response createBook(String title, double price){\n Book b = new Book();\n b.setTitle(title);\n b.setPrice(price);\n EntityTransaction t = em.getTransaction();\n t.begin();\n em.persist(b);\n t.commit();\n return Response.ok().build();\n }", "@PostMapping(\"api/book\")\n public ResponseEntity<Book> addBook(@RequestBody Book book) {\n Result<Book> result = bookService.save(book);\n if (result.isSuccess()) {\n return ResponseEntity.ok(book);\n } else {\n return ResponseEntity.noContent().build();\n }\n }", "@PostMapping(\"/bookings\")\n @ResponseStatus(HttpStatus.CREATED)\n public Booking addBooking(@RequestBody Booking booking){\n bookingClient.addBooking(booking);\n return booking;\n }", "@RequestMapping(value=\"/book\",method=RequestMethod.POST)\n\tpublic @ResponseBody ResponseEntity<Books> createBooks(@RequestBody Books bookDetails) throws Exception{\n\t\tBooks book=null;\n\t\t\n\t\t//for checking duplicate entry of books\n\t\tbook=booksDAO.findOne(bookDetails.getIsbn());\n\t\tif(book==null){\n\t\t\t//create a new book entry \n\t\t\ttry{\n\t\t\t\tbook=new Books(bookDetails.getBookName(),bookDetails.getBookDescription(),bookDetails.getPrice(),bookDetails.getIsActive(),new Date(),new Date());\n\t\t\t\tbooksDAO.save(book);\n\t\t\t\t}catch(Exception e){\n\t\t\t\t\tthrow new Exception(\"Exception in saving book details...\",e);\n\t\t\t\t}\n\t\t}else{\n\t\t\t bookDetails.setCreationTime(book.getCreationTime());\n\t\t\t bookDetails.setLastModifiedTime(new Date());\n\t\t\t booksDAO.save(bookDetails);\n\t\t}\n\t\t\treturn new ResponseEntity<Books>(book, HttpStatus.OK);\n\t}", "@PostMapping(\"/{username}/books\")\n public Book addBookToLibrary(@PathVariable String username,\n @RequestBody Book book) {\n\n if(book.getBookId() == null) {\n logger.error(\"bookId is null\");\n throw new IllegalArgumentException(\"Invalid bookId\");\n }\n return userBookToBook.apply(userService.addBook(username, book.getBookId()));\n }", "void create(Book book);", "public void create(String title, String numPages, String quantity, String category, String price, String publicationYear, String[] authorsId, String publisherId) {\n System.out.println(\"creating book \" + title + \" by \"+ authorsId[0] + \" published by \" + publisherId);\n dbmanager.open();\n \n JSONObject item = new JSONObject();\n item.put(\"idBOOK\", dbmanager.getNextId());\n item.put(\"title\", title);\n item.put(\"numPages\", numPages);\n item.put(\"quantity\", quantity);\n item.put(\"category\", category);\n item.put(\"price\", price);\n item.put(\"publicationYear\", publicationYear);\n item.put(\"authors\", authorsId); \n item.put(\"publisher\", publisherId);\n\n dbmanager.createCommit(getNextBookId(),item);\n \n dbmanager.close();\n }", "Book createBook();", "Booking createBooking(Booking newBooking) throws Exception;", "@RequestMapping(\"/create\")\n\tpublic Booking create(Booking booking) {\n\t\tbooking.setTravelDate(new Date());\n\t\tbooking = bookingRepository.save(booking);\n\t return booking;\n\t}", "@PostMapping(value=\"/booking\" , consumes = MediaType.APPLICATION_JSON_VALUE ,\n produces = MediaType.APPLICATION_JSON_VALUE)\n public ResponseEntity createBooking(@RequestBody BookingDTO bookingDTO){\n BookingInfoEntity booking = POJOConvertor.covertBookingDTOToEntity(bookingDTO);\n\n BookingInfoEntity savedBooking = bookingService.createBooking(booking);\n\n BookingDTO savedBookingDTO = POJOConvertor.covertBookingEntityToDTO(booking);\n\n return new ResponseEntity(savedBookingDTO , HttpStatus.CREATED);\n }", "E create(Resource data);", "@PostMapping(\"/book\")\n public ResponseEntity<?> addBook(@RequestBody Book book) {\n if(bookService.findBook(book.getBarcode()).isPresent()){\n return ResponseEntity.badRequest().body(\"Book with this barcode already exists.\");\n } else {\n bookService.addBook(book);\n return ResponseEntity.status(HttpStatus.OK).body(\"Book was added.\");\n }\n\n }", "@RequestMapping(path = \"/create\", method = RequestMethod.POST)\n\tpublic ResponseEntity<RestResponse<CompanyDTO>> create(@RequestBody CompanyDTO request) {\n\n\t\tCompanyDTO result = companyService.create(request);\n\t\t\n\t\tRestResponse<CompanyDTO> restResponse = \n\t\t\t\tnew RestResponse<CompanyDTO>(RestResponseCodes.OK.getCode(), RestResponseCodes.OK.getDescription(), result);\n\t\t\n\t\treturn new ResponseEntity<RestResponse<CompanyDTO>>(restResponse, HttpStatus.OK);\n\t\t\t\n\t}", "public static void addBook(final @Valid Book book) {\n\t\tif (book.serie.id == null) {\r\n\t\t\tValidation.required(\"book.serie.name\", book.serie.name);\r\n\r\n\t\t\tif (book.serie.name != null) {\r\n\t\t\t\tSerie serie = Serie.find(\"byName\", book.serie.name).first();\r\n\t\t\t\tif (serie != null) {\r\n\t\t\t\t\tValidation.addError(\"book.serie.name\",\r\n\t\t\t\t\t\t\t\"La série existe déjà\",\r\n\t\t\t\t\t\t\tArrayUtils.EMPTY_STRING_ARRAY);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Validation errror treatment\r\n\t\tif (Validation.hasErrors()) {\r\n\r\n\t\t\tif (Logger.isDebugEnabled()) {\r\n\t\t\t\tfor (play.data.validation.Error error : Validation.errors()) {\r\n\t\t\t\t\tLogger.debug(error.message() + \" \" + error.getKey());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Specific treatment for isbn, just to provide example\r\n\t\t\tif (!Validation.errors(\"book.isbn\").isEmpty()) {\r\n\t\t\t\tflash.put(\"error_isbn\", Messages.get(\"error.book.isbn.msg\"));\r\n\t\t\t}\r\n\r\n\t\t\tparams.flash(); // add http parameters to the flash scope\r\n\t\t\tValidation.keep(); // keep the errors for the next request\r\n\t\t} else {\r\n\r\n\t\t\t// Create serie is needed\r\n\t\t\tif (book.serie.id == null) {\r\n\t\t\t\tbook.serie.create();\r\n\t\t\t}\r\n\r\n\t\t\tbook.create();\r\n\r\n\t\t\t// Send WebSocket message\r\n\t\t\tWebSocket.liveStream.publish(MessageFormat.format(\r\n\t\t\t\t\t\"La BD ''{0}'' a été ajoutée dans la série ''{1}''\",\r\n\t\t\t\t\tbook.title, book.serie.name));\r\n\r\n\t\t\tflash.put(\"message\",\r\n\t\t\t\t\t\"La BD a été ajoutée, vous pouvez créer à nouveau.\");\r\n\t\t}\r\n\r\n\t\tBookCtrl.prepareAdd(); // Redirection toward input form\r\n\t}", "@Override\n\tpublic void add() {\n\t\tHashMap<String, String> data = new HashMap<>();\n\t\tdata.put(\"title\", title);\n\t\tdata.put(\"author\", author);\n\t\tdata.put(\"publisher\", publisher);\n\t\tdata.put(\"isbn\", isbn);\n\t\tdata.put(\"bookID\", bookID);\n\t\tHashMap<String, Object> result = null;\n\t\tString endpoint = \"bookinfo/post.php\";\n\t\ttry {\n\t\t\tresult = APIClient.post(BookInfo.host + endpoint, data);\n\t\t\tvalid = result.get(\"status_code\").equals(\"Success\");\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n\tpublic Book createBook(Book book) throws SQLException {\n\t\ttry {\n\t\t\treturn dao.insertBook(book);\n\t\t} catch (ClassNotFoundException | SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}return book;\n\t}", "public void create(Book book) {\n\t\tentityManager.persist(book);\n\t\tSystem.out.println(\"BookDao.create()\" +book.getId());\n\t\t\n\t}", "public Book createBook(Book newBook) {\n\t\treturn this.sRepo.save(newBook);\n\t}", "@POST\n Call<Post> createPost(@Body Post post);", "public BookResource() {\n }", "public String actionCreateNew() {\r\n \t\tsetBook(new Book());\r\n \t\treturn \"new\";\r\n \t}", "public com.Hotel.model.Hotel create(long hotelId);", "@GET\n @Path(\"/id/{id}\")\n public Book findById(@PathParam(\"id\") long id) {\n return new Book();\n }", "public com.squareup.okhttp.Call addressBookGetForInsertCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {\n Object localVarPostBody = null;\n\n // create path and map variables\n String localVarPath = \"/api/AddressBook/newinstance\";\n\n List<Pair> localVarQueryParams = new ArrayList<Pair>();\n List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();\n\n Map<String, String> localVarHeaderParams = new HashMap<String, String>();\n\n Map<String, Object> localVarFormParams = new HashMap<String, Object>();\n\n final String[] localVarAccepts = {\n \"application/json\", \"text/json\", \"application/xml\", \"text/xml\"\n };\n final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);\n if (localVarAccept != null) localVarHeaderParams.put(\"Accept\", localVarAccept);\n\n final String[] localVarContentTypes = {\n \n };\n final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);\n localVarHeaderParams.put(\"Content-Type\", localVarContentType);\n\n if(progressListener != null) {\n apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {\n @Override\n public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {\n com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());\n return originalResponse.newBuilder()\n .body(new ProgressResponseBody(originalResponse.body(), progressListener))\n .build();\n }\n });\n }\n\n String[] localVarAuthNames = new String[] { \"Authorization\" };\n return apiClient.buildCall(localVarPath, \"GET\", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);\n }", "@POST(\"posts\")\n Call<Post> createPost(@Body Post post);", "@Operation(\n summary = \"Save a new reservation\"\n )\n @ApiResponses(\n @ApiResponse(\n responseCode = \"200\",\n description = \"Successful Response\",\n content = @Content(schema = @Schema(implementation = Reservation.class))\n )\n )\n @PostMapping(\n path = \"/new-reservation\",\n consumes = APPLICATION_JSON_VALUE\n )\n public ResponseEntity<String> newReservation(\n @RequestBody Reservation reservation) {\n reservationsRepository.save(reservation);\n return new ResponseEntity<>(\"Info saved correctly\", HttpStatus.OK);\n }", "@RequestMapping(value=\"/add\", method = RequestMethod.POST)\r\n public void addAction(@RequestBody Reservation reservation){\n reservationService.create(reservation);\r\n }", "private void insertBook() {\n /// Create a ContentValues object with the dummy data\n ContentValues values = new ContentValues();\n values.put(BookEntry.COLUMN_BOOK_NAME, \"Harry Potter and the goblet of fire\");\n values.put(BookEntry.COLUMN_BOOK_PRICE, 100);\n values.put(BookEntry.COLUMN_BOOK_QUANTITY, 2);\n values.put(BookEntry.COLUMN_BOOK_SUPPLIER_NAME, \"Supplier 1\");\n values.put(BookEntry.COLUMN_BOOK_SUPPLIER_PHONE, \"972-3-1234567\");\n\n // Insert the dummy data to the database\n Uri uri = getContentResolver().insert(BookEntry.CONTENT_URI, values);\n // Show a toast message\n String message;\n if (uri == null) {\n message = getResources().getString(R.string.error_adding_book_toast).toString();\n } else {\n message = getResources().getString(R.string.book_added_toast).toString();\n }\n Toast.makeText(this, message, Toast.LENGTH_LONG).show();\n }", "private void createProduct(String pid, String name, String price, String description) {\n\n mApiService = ApiClient.getCurdClient().create(ApiInterface.class);\n\n ProductModel productModel = new ProductModel(pid, name, price, description, \"\", \"\");\n\n Call<ResponseModel> call = mApiService.createProduct(productModel);\n\n\n call.enqueue(new Callback<ResponseModel>() {\n @Override\n public void onResponse(Call<ResponseModel> call, Response<ResponseModel> response) {\n int statusCode = response.code();\n ResponseModel responseModel = response.body();\n\n Toast.makeText(SampleRetrofit.this, \" CreateProduct \" + responseModel.getMessage(), Toast.LENGTH_SHORT).show();\n\n }\n\n @Override\n public void onFailure(Call<ResponseModel> call, Throwable t) {\n // Log error here since request failed\n Log.e(\"\", t.toString());\n }\n\n });\n }", "public BookResponse() {\n }", "@GetMapping(\"/addBook\")\n public String addNewBook(Model model) {\n Book newBook = new Book();\n List<Author> authors = authorService.getAllAuthor();\n List<Category> categories = categoryService.getAllCategory();\n model.addAttribute(\"authorAddBook\", authors);\n model.addAttribute(\"newBook\", newBook);\n model.addAttribute(\"categoryAddBook\", categories);\n return \"add-new-book\";\n }", "@POST(\"lugares/\")\n Call<Lugar> create(@Body Lugar lugar);", "public Event createBooking(RequestContext context) {\n\tHotel hotel = (Hotel) context.getFlowScope().get(\"hotel\");\n\tUser user = (User) context.getConversationScope().get(\"user\");\n\tBooking booking = new Booking(hotel, user);\n\tEntityManager em = (EntityManager) context.getFlowScope().get(\"entityManager\");\n\tem.persist(booking);\n\tcontext.getFlowScope().put(\"booking\", booking);\n\treturn success();\n }", "@Secured(value=\"CRIAR_LIVRO\")\n\t@Override\n\tpublic IEbook createEbook(IEbook object) {\n\t\t\n\t\tsecurityFacade.saveUserTransaction(\"CRIAR_LIVRO\", object, object.getCollection());\n\t\treturn (IEbook) ebookDataprovider.saveOrUpdate(object);\n\t}", "@POST\n\t@Consumes(\"text/plain\")\n\t@Produces(\"application/json\")\n\t@Path(\"/insert/query\")\n\tpublic Response bookTicket(@QueryParam(\"ticketNo\") String ticketNo,\n\t\t\t@QueryParam(\"theater\") String theater,\n\t\t\t@QueryParam(\"showTime\") String showTime,\n\t\t\t@QueryParam(\"date\") String date, @QueryParam(\"seats\") String seats,\n\t\t\t@QueryParam(\"foodItems\") String foodItems,\n\t\t\t@QueryParam(\"totalPrice\") String totalPrice) {\n\t\tticketNo = ticketNo.trim();\n\t\tif (!bookedTickets.containsKey(ticketNo)) {\n\t\t\tMap<String, String> ticketInfo = new HashMap<>();\n\t\t\tticketInfo.put(\"theater\", theater);\n\t\t\tticketInfo.put(\"showTime\", showTime);\n\t\t\tticketInfo.put(\"date\", date);\n\t\t\tticketInfo.put(\"seats\", seats);\n\t\t\tticketInfo.put(\"foodItems\", foodItems);\n\t\t\tticketInfo.put(\"totalPrice\", totalPrice);\n\n\t\t\tbookedTickets.put(ticketNo, ticketInfo);\n\n\t\t\tMessage msg = new Message();\n\t\t\tmsg.setMessage(\"Success\");\n\t\t\treturn Response.ok(msg).build();\n\t\t}\n\t\tMessage msg = new Message();\n\t\tmsg.setMessage(\"Fail\");\n\t\treturn Response.ok(msg).build();\n\n\t}", "@Test\n public void shouldNotCreateANullBook() throws JAXBException {\n Response response = target(\"/books\").request().post(Entity.entity(null, MediaType.APPLICATION_XML));\n assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatusInfo().getStatusCode());\n }", "@FormUrlEncoded\n @POST(\"/v2/cards/create.json\")\n void create(@Field(\"card_data\") CardData data, Callback<CardCreate> cb);", "@POST( CONTROLLER )\n VersionedObjectKey createObject( @Body CreateObjectRequest request );", "@PostMapping(value=\"/insert/hotel\", consumes=MediaType.APPLICATION_JSON_VALUE)\r\n\tpublic ResponseClient insertNewRoom(@RequestBody Hotel hotel){\r\n\t\thotelSer.save(hotel);\r\n\t\tResponseClient res = new ResponseClient();\r\n\t\tres.setResponse(\"successfull hotel_id: \");\r\n\t\treturn res;\r\n\t}", "@Override\r\n\tpublic boolean addBook(BookDto book) {\n\t\tsqlSession.insert(ns + \"addBook\", book);\t\t\r\n\t\treturn true;\r\n\t}", "public Book create(String title,double price, Author author)\r\n {\r\n return new Book(title,price,author);\r\n }", "public static Book createEntity() {\n Book book = new Book()\n .idBook(DEFAULT_ID_BOOK)\n .isbn(DEFAULT_ISBN)\n .title(DEFAULT_TITLE)\n .author(DEFAULT_AUTHOR)\n .year(DEFAULT_YEAR)\n .publisher(DEFAULT_PUBLISHER)\n .url_s(DEFAULT_URL_S)\n .url_m(DEFAULT_URL_M)\n .url_l(DEFAULT_URL_L);\n return book;\n }", "@POST\n @Path(\"/new\")\n @Consumes(MediaType.APPLICATION_JSON)\n @Produces(MediaType.APPLICATION_JSON)\n public Response createNewBlah(\n BlahPayload entity,\n @Context UriInfo uri,\n @Context HttpServletRequest request) {\n try {\n final long start = System.currentTimeMillis();\n final String authorId = BlahguaSession.ensureAuthenticated(request, true);\n if (!BlahguaSession.isAuthenticatedClient(request))\n throw new InvalidAuthorizedStateException();\n entity = getBlahManager().createBlah(LocaleId.en_us, authorId, entity);\n final Response response = RestUtilities.make201CreatedResourceResponse(entity, new URI(uri.getAbsolutePath() + entity.getId()));\n getSystemManager().setResponseTime(CREATE_BLAH_OPERATION, (System.currentTimeMillis() - start));\n return response;\n } catch (InvalidRequestException e) {\n return RestUtilities.make400InvalidRequestResponse(request, e);\n } catch (ResourceNotFoundException e) {\n return RestUtilities.make404ResourceNotFoundResponse(request, e);\n } catch (StateConflictException e) {\n return RestUtilities.make409StateConflictResponse(request, e);\n } catch (InvalidAuthorizedStateException e) {\n return RestUtilities.make401UnauthorizedRequestResponse(request, e);\n } catch (SystemErrorException e) {\n return RestUtilities.make500AndLogSystemErrorResponse(request, e);\n } catch (Exception e) {\n return RestUtilities.make500AndLogSystemErrorResponse(request, e);\n }\n }", "public Book() {}", "CreateResponse create(@NonNull CreateRequest request);", "@PostMapping(\"/cargos\")\n @Timed\n public ResponseEntity<Cargo> createCargo(@RequestBody Cargo cargo) throws URISyntaxException {\n log.debug(\"REST request to save Cargo : {}\", cargo);\n if (cargo.getId() != null) {\n throw new BadRequestAlertException(\"A new cargo cannot already have an ID\", ENTITY_NAME, \"idexists\");\n }\n Cargo result = cargoRepository.save(cargo);\n return ResponseEntity.created(new URI(\"/api/cargos/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))\n .body(result);\n }", "com.soa.SolicitarServicioDocument.SolicitarServicio addNewSolicitarServicio();", "public Book() {\n }", "@RequestMapping(method = RequestMethod.POST)\n public Bin create() {\n throw new NotImplementedException(\"To be implemented\");\n }", "@POST\r\n public Response createResearchObject()\r\n throws BadRequestException, IllegalArgumentException, UriBuilderException, ConflictException,\r\n DigitalLibraryException, NotFoundException {\r\n LOGGER.debug(String.format(\"%s\\t\\tInit create RO\", new DateTime().toString()));\r\n String researchObjectId = request.getHeader(Constants.SLUG_HEADER);\r\n if (researchObjectId == null || researchObjectId.isEmpty()) {\r\n throw new BadRequestException(\"Research object ID is null or empty\");\r\n }\r\n URI uri = uriInfo.getAbsolutePathBuilder().path(researchObjectId).path(\"/\").build();\r\n ResearchObject researchObject = ResearchObject.findByUri(uri);\r\n if (researchObject != null) {\r\n throw new ConflictException(\"RO already exists\");\r\n }\r\n researchObject = new ResearchObject(uri);\r\n URI researchObjectURI = ROSRService.createResearchObject(researchObject);\r\n LOGGER.debug(String.format(\"%s\\t\\tRO created\", new DateTime().toString()));\r\n \r\n RDFFormat format = RDFFormat.forMIMEType(request.getHeader(Constants.ACCEPT_HEADER), RDFFormat.RDFXML);\r\n InputStream manifest = ROSRService.SMS.get().getNamedGraph(researchObject.getManifestUri(), format);\r\n ContentDisposition cd = ContentDisposition.type(format.getDefaultMIMEType())\r\n .fileName(ResearchObject.MANIFEST_PATH).build();\r\n \r\n LOGGER.debug(String.format(\"%s\\t\\tReturning\", new DateTime().toString()));\r\n return Response.created(researchObjectURI).entity(manifest).header(\"Content-disposition\", cd).build();\r\n }", "public com.squareup.okhttp.Call addressBookGetForInsert_0Call(Integer addressbookCategoryId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {\n Object localVarPostBody = null;\n\n // create path and map variables\n String localVarPath = \"/api/AddressBook/newinstance/{addressbookCategoryId}\"\n .replaceAll(\"\\\\{\" + \"addressbookCategoryId\" + \"\\\\}\", apiClient.escapeString(addressbookCategoryId.toString()));\n\n List<Pair> localVarQueryParams = new ArrayList<Pair>();\n List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();\n\n Map<String, String> localVarHeaderParams = new HashMap<String, String>();\n\n Map<String, Object> localVarFormParams = new HashMap<String, Object>();\n\n final String[] localVarAccepts = {\n \"application/json\", \"text/json\", \"application/xml\", \"text/xml\"\n };\n final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);\n if (localVarAccept != null) localVarHeaderParams.put(\"Accept\", localVarAccept);\n\n final String[] localVarContentTypes = {\n \n };\n final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);\n localVarHeaderParams.put(\"Content-Type\", localVarContentType);\n\n if(progressListener != null) {\n apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {\n @Override\n public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {\n com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());\n return originalResponse.newBuilder()\n .body(new ProgressResponseBody(originalResponse.body(), progressListener))\n .build();\n }\n });\n }\n\n String[] localVarAuthNames = new String[] { \"Authorization\" };\n return apiClient.buildCall(localVarPath, \"GET\", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);\n }", "@POST\n @Consumes(APPLICATION_JSON)\n @Produces(APPLICATION_JSON)\n @ApiOperation(value = \"Create a publisher\", response = PublisherDTO.class)\n @ApiResponses(value = {\n @ApiResponse(code = 201, message = \"The publisher is created\"),\n @ApiResponse(code = 400, message = \"Invalid input\"),\n @ApiResponse(code = 415, message = \"Format is not JSon\")\n })\n public Response createPublisher(@ApiParam(value = \"Publisher to be created\", required = true) @Valid PublisherDTO publisherDTO, @Context UriInfo uriInfo) throws URISyntaxException {\n log.debug(\"REST request to save Publisher : {}\", publisherDTO);\n if (publisherDTO.getId() != null) {\n throw new BadRequestAlertException(\"A new publisher cannot already have an ID\", ENTITY_NAME, \"idexists\");\n }\n PublisherDTO result = publisherService.save(publisherDTO);\n URI createdURI = uriInfo.getBaseUriBuilder().path(String.valueOf(result.getId())).build();\n return Response.created(createdURI).entity(result).build();\n }", "public void doCreateItem() {\r\n\t\tlogger.info(\"Se procede a crear el book \" + newItem.getDescription());\r\n\t\tBook entity = newItem.getEntity();\r\n\t\tentity.setUser(Global.activeUser());\r\n\t\tentity.setBookBalance(BigDecimal.ZERO);\r\n\t\tentity.setTotalBudget(BigDecimal.ZERO);\r\n\t\tentity.setTotalIncome(BigDecimal.ZERO);\r\n\t\tentity.setTotalExpenses(BigDecimal.ZERO);\r\n\t\tentity = bookService.create(entity);\r\n\r\n\t\t// Actualizar el mapa de books\r\n\t\tGlobalBook.instance().put(new BookData(entity));\r\n\r\n\t\tlogger.info(\"Se ha creado el book \" + newItem.getDescription());\r\n\t\tnewItem = new BookData(new Book());\r\n\t\tFacesContext.getCurrentInstance().addMessage(null,\r\n\t\t\t\tnew FacesMessage(FacesMessage.SEVERITY_INFO, \"Libro creado\", \"Libro creado correctamente\"));\r\n\t}", "private Book createBook() {\n Book book = null;\n\n try {\n\n //determine if fiction or non-fiction\n if (radFiction.isSelected()) {\n //fiction book\n book = new Fiction(Integer.parseInt(tfBookID.getText()));\n\n } else if (radNonFiction.isSelected()) {\n //non-fiction book\n book = new NonFiction(Integer.parseInt(tfBookID.getText()));\n\n } else {\n driver.errorMessageNormal(\"Please selecte fiction or non-fiction.\");\n }\n } catch (NumberFormatException nfe) {\n driver.errorMessageNormal(\"Please enter numbers only the Borrower ID and Book ID fields.\");\n }\n return book;\n }", "@BodyParser.Of(play.mvc.BodyParser.Json.class)\n public static Result create() throws JsonParseException, JsonMappingException, IOException {\n JsonNode json = request().body().asJson();\n Thing thing = mapper.treeToValue(json, Thing.class);\n thing.save();\n return ok(mapper.valueToTree(thing));\n }", "@PostMapping(\"/add\")\r\n\tResponseEntity<BookingDetails> bookingprocess(@RequestBody CreateBookingRequest bookingDto){\r\n\t\tList<Seat> seats = choosenSeats(bookingDto.getChoosenSeats());\r\n\t\tdouble cost = getCost(seats);\r\n\t\t\r\n\t\tBooking booking=convertBookingDto(bookingDto,cost);\r\n\t\tbooking = bookingService.createBooking(booking,bookingDto.getPaymentMethod(),bookingDto.getScreenName());\r\n\t\t\r\n\t\tBookingDetails bookingDetails = convertBooking(booking);\r\n\t\tResponseEntity<BookingDetails> response = new ResponseEntity<BookingDetails>(bookingDetails,HttpStatus.OK);\r\n\t\treturn response;\r\n\t}", "private void save(HttpServletRequest request, HttpServletResponse response) throws IOException {\n\t\tBook book = new Book();\r\n\t\tbook.setId(bookService.list().size()+1);\r\n\t\tbook.setBookname(request.getParameter(\"bookname\"));\r\n\t\tbook.setAuthor(request.getParameter(\"author\"));\r\n\t\tbook.setPrice(Float.parseFloat(request.getParameter(\"price\")));\r\n\t\tbookService.save(book);\r\n\t\t//out.println(\"<script>window.location.href='index.html'</script>\");\r\n\t\tresponse.sendRedirect(\"index.html\");\r\n\t}", "public BookSearchResource() {\n }", "@PostMapping(value = \"/create\",consumes = MediaType.APPLICATION_JSON_VALUE)\n public InternationalTournaments create(@RequestBody InternationalTournaments create){\n return service.create(create);\n }", "@RequestMapping(value = \"/{branch}/stackRoom/{book}\", method = RequestMethod.POST)\n public String addBookToStack(@PathVariable String branch, @PathVariable String book,\n @RequestBody(required = false) BookDTO bookDTO) {\n if (bookDTO != null) {\n branchBookService.addBook(branch, book, bookDTO.getAuthor());\n } else {\n branchBookService.addBook(branch, book);\n }\n\n return \"Success\";\n }", "@POST(\"orders/new_order/\")\n Call<ApiStatus> createNewOrderByUser(@Body Order myOrder);", "public Book() {\n\t\t// Default constructor\n\t}", "@Test\n public void createHouseholdUsingPostTest() throws ApiException {\n Household household = null;\n Household response = api.createHouseholdUsingPost(household);\n\n // TODO: test validations\n }", "public AssertableResponse createBooking(BookingDataPayload bookingDataPayload) {\n JsonObject bookingData = new JsonObject();\n JsonObject requestObject = new JsonObject();\n\n bookingData.put(bookingDataPayload.bookingDatePayload.CHECK_IN, bookingDataPayload.bookingDatePayload.chekIn);\n bookingData.put(bookingDataPayload.bookingDatePayload.CHECK_OUT, bookingDataPayload.bookingDatePayload.chekOut);\n\n requestObject.put(bookingDataPayload.FIRST_NAME, bookingDataPayload.firstname);\n requestObject.put(bookingDataPayload.LAST_NAME, bookingDataPayload.lastname);\n requestObject.put(bookingDataPayload.TOTAL_PRICE, bookingDataPayload.totalPrice);\n requestObject.put(bookingDataPayload.DEPOSIT_PAID, bookingDataPayload.depositPaid);\n requestObject.put(bookingDataPayload.ADDITIONAL_NEEDS, bookingDataPayload.additionalNeeds);\n requestObject.put(bookingDataPayload.BOOKING_DATES, bookingData);\n\n return new AssertableResponse( setUp()\n .log().all()\n .request()\n .header(\"Content-Type\", \"application/json\")\n .body(requestObject.toJson())\n .when()\n .post(System.getProperty(\"baseApiUri\") + BOOKING)\n .then().log().all().extract().response());\n }", "@Override\n\tpublic Long addBook(BookRequestVO request) {\n\t\tLong savedBookId = bookStorePersistDao.addBook(request);\n\t\treturn savedBookId;\n\t}", "@BearerAuth\n @HttpRequestHandler(paths = \"/api/v2/service/create\", methods = \"POST\")\n private void handleCreateRequest(@NonNull HttpContext context, @NonNull @RequestBody Document body) {\n var configuration = body.readObject(\"serviceConfiguration\", ServiceConfiguration.class);\n if (configuration == null) {\n // check for a provided service task\n var serviceTask = body.readObject(\"task\", ServiceTask.class);\n if (serviceTask != null) {\n configuration = ServiceConfiguration.builder(serviceTask).build();\n } else {\n // fallback to a service task name which has to exist\n var serviceTaskName = body.getString(\"serviceTaskName\");\n if (serviceTaskName != null) {\n var task = this.serviceTaskProvider.serviceTask(serviceTaskName);\n if (task != null) {\n configuration = ServiceConfiguration.builder(task).build();\n } else {\n // we got a task but it does not exist\n this.badRequest(context)\n .body(this.failure().append(\"reason\", \"Provided task is unknown\").toString())\n .context()\n .closeAfter(true)\n .cancelNext(true);\n return;\n }\n } else {\n this.sendInvalidServiceConfigurationResponse(context);\n return;\n }\n }\n }\n\n var createResult = this.serviceFactory.createCloudService(configuration);\n var start = body.getBoolean(\"start\", false);\n if (start && createResult.state() == ServiceCreateResult.State.CREATED) {\n createResult.serviceInfo().provider().start();\n }\n\n this.ok(context)\n .body(this.success().append(\"result\", createResult).toString())\n .context()\n .closeAfter(true)\n .cancelNext(true);\n }", "@Path(\"/create/{vmname}/{vmdescription}\")\n@POST\npublic String createVM(@PathParam(\"vmname\") String vmname,@PathParam(\"vmdescription\") String vmdescription){\n\tSystem.out.println(\" name of vm is \"+vmname+\" and description is \"+vmdescription);\n\t\n\n\treturn computefacade.createVM(vmname, vmdescription);\n\t\n\n}", "public void insertBook(){\n\n // Create a new map of values, where column names are the keys\n ContentValues values = new ContentValues();\n values.put(BookContract.BookEntry.COLUMN_PRODUCT_NAME, \"You Do You\");\n values.put(BookContract.BookEntry.COLUMN_PRICE, 10);\n values.put(BookContract.BookEntry.COLUMN_QUANTITY, 20);\n values.put(BookContract.BookEntry.COLUMN_SUPPLIER_NAME, \"Kedros\");\n values.put(BookContract.BookEntry.COLUMN_SUPPLIER_PHONE_NUMBER, \"210 27 10 48\");\n\n Uri newUri = getContentResolver().insert(BookContract.BookEntry.CONTENT_URI, values);\n }", "@RequestMapping(\"/book/new\")\n public String newBook(Model model){\n model.addAttribute(\"book\", new Book ());\n return \"bookform\";\n }", "@POST\n @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})\n @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})\n public Response createEducation( Education education,\n @BeanParam GenericBeanParam params ) throws ForbiddenException, UnprocessableEntityException, InternalServerErrorException {\n\n RESTToolkit.authorizeAccessToWebService(params);\n logger.log(Level.INFO, \"creating new Education by executing EducationResource.createEducation(education) method of REST API\");\n\n Education createdEducation = null;\n URI locationURI = null;\n\n try {\n // persist new resource in database\n createdEducation = educationFacade.create(education);\n\n // populate created resource with hypermedia links\n EducationResource.populateWithHATEOASLinks(createdEducation, params.getUriInfo());\n\n // construct link to newly created resource to return in HTTP Header\n String createdEducationId = String.valueOf(createdEducation.getEducationId());\n locationURI = params.getUriInfo().getBaseUriBuilder().path(EducationResource.class).path(createdEducationId).build();\n\n } catch (EJBTransactionRolledbackException ex) {\n ExceptionHandler.handleEJBTransactionRolledbackException(ex);\n } catch (EJBException ex) {\n ExceptionHandler.handleEJBException(ex);\n } catch (Exception ex) {\n throw new InternalServerErrorException(ExceptionHandler.ENTITY_CREATION_ERROR_MESSAGE);\n }\n\n return Response.created(locationURI).entity(createdEducation).build();\n }", "@PostMapping\n public ResponseEntity<HotelResource> saveHotel(@RequestBody Hotel hotel){\n return new ResponseEntity<>(\n hotelService.saveHotel(hotel), HttpStatus.CREATED\n );\n }", "public void createBooking(Booking book) {\n\tStudentDAO studentDAO=new StudentDAO();\n\tstudentDAO.createBooking(book);\n}", "@Test\r\n\tpublic void createProductDetails() {\r\n\t\tRestAssured.baseURI = \"http://localhost:9000/products\";\r\n\t\tRequestSpecification request = RestAssured.given();\r\n\t\tJSONObject requestParams = new JSONObject();\r\n\t\trequestParams.put(\"id\", \"7\"); // Cast\r\n\t\trequestParams.put(\"name\", \"Mangao\");\r\n\t\trequest.header(\"Content-Type\", \"application/json\");\r\n\t\trequest.body(requestParams.toString());\r\n\t\tResponse response = request.post(\"\");\r\n\t\tSystem.out.println(\"POST Responce Body ----->\" + response.asString());\r\n\t\tint statusCode = response.getStatusCode();\r\n\t\tAssert.assertEquals(statusCode, 201);\r\n\r\n\t}", "@Override\n\t@RestResource(exported = false)\n\tpublic <S extends Book> S save(S entity);", "public Booking saveBooking(Booking booking);", "@POST\n Response createCalendar(Calendar calendar);", "@Override\r\n\tpublic Book addBook(Book book) {\n\t\treturn bd.save(book);\r\n\t}", "@Test\n public void whenCreateValidStudent_thenReceiveOKResponse() throws IOException {\n final HttpPost httpPost = new HttpPost(BASE_URL + \"2/students\");\n final InputStream resourceStream = this.getClass().getClassLoader()\n .getResourceAsStream(\"created_student.xml\");\n httpPost.setEntity(new InputStreamEntity(resourceStream));\n httpPost.setHeader(\"Content-Type\", \"text/xml\");\n \n //In this case the Student object does not exist in the Course \n //istance and should be succefully created\n final HttpResponse response = client.execute(httpPost);\n assertEquals(200, response.getStatusLine().getStatusCode());\n \n //We may confirm the new states of the web service resource\n final Student student = getStudent(2, 3);\n assertEquals(3, student.getId());\n assertEquals(\"Student C\", student.getName());\n }", "@PostMapping(\"/new\")\n public ResponseEntity create(@RequestBody CityInfo cityInfo){\n service.create(cityInfo);\n return new ResponseEntity(HttpStatus.CREATED);\n }", "@RequestMapping(value = \"/card/\", method = RequestMethod.POST)\n public ResponseEntity<Void> createCard(@RequestBody Card card, UriComponentsBuilder ucBuilder) {\n \tcard.setNbDispo(card.getNbItem());\n card.setDate(new Date(System.currentTimeMillis()));\n if (cardService.isCardExist(card)) {\n \tlogger.warn( \"A Card with name \" + card.getNameFr() + \" already exist\" );\n return new ResponseEntity<Void>(HttpStatus.CONFLICT);\n }\n cardService.saveCard(card);\n HttpHeaders headers = new HttpHeaders();\n headers.setLocation(ucBuilder.path(\"/card/{id}\").buildAndExpand(card.getId()).toUri());\n return new ResponseEntity<Void>(headers, HttpStatus.CREATED);\n }", "public com.ms3.training.services.model.Course create(java.lang.String title);", "@RequestMapping(value=\"/getbook\", method=RequestMethod.GET, produces = \"application/json\")\n\tpublic Book getBook() {\n\t\treturn new Book(\"1\", \"Marvel Comics\", \"Stanlee\", 200D, \"Awesome book\");\n\t}", "public com.squareup.okhttp.Call addressBookInsertAddressBook_0Call(List<AddressBookDTO> addressBookDtos, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {\n Object localVarPostBody = addressBookDtos;\n\n // create path and map variables\n String localVarPath = \"/api/AddressBook/addressbooks\";\n\n List<Pair> localVarQueryParams = new ArrayList<Pair>();\n List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();\n\n Map<String, String> localVarHeaderParams = new HashMap<String, String>();\n\n Map<String, Object> localVarFormParams = new HashMap<String, Object>();\n\n final String[] localVarAccepts = {\n \"application/json\", \"text/json\", \"application/xml\", \"text/xml\"\n };\n final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);\n if (localVarAccept != null) localVarHeaderParams.put(\"Accept\", localVarAccept);\n\n final String[] localVarContentTypes = {\n \"application/json\", \"text/json\", \"application/xml\", \"text/xml\", \"application/x-www-form-urlencoded\"\n };\n final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);\n localVarHeaderParams.put(\"Content-Type\", localVarContentType);\n\n if(progressListener != null) {\n apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {\n @Override\n public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {\n com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());\n return originalResponse.newBuilder()\n .body(new ProgressResponseBody(originalResponse.body(), progressListener))\n .build();\n }\n });\n }\n\n String[] localVarAuthNames = new String[] { \"Authorization\" };\n return apiClient.buildCall(localVarPath, \"POST\", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);\n }", "public static AddressBook create(String bookName) {\n return new AddressBook(bookName);\n }", "@Test\n public void validAdd() throws Exception {\n Logger.getGlobal().info(\"Start validAdd test\");\n RestaurantVO restaurant = new RestaurantVO();\n restaurant.setId(\"999\");\n restaurant.setName(\"Test Restaurant\");\n\n ResponseEntity<Restaurant> restaurants = restaurantController.add(restaurant);\n Assert.assertEquals(HttpStatus.CREATED, restaurants.getStatusCode());\n Logger.getGlobal().info(\"End validAdd test\");\n }", "private void insertDummyBook() {\n ContentValues values = new ContentValues();\n values.put(BookEntry.COLUMN_NAME, getString(R.string.dummy_book_name));\n values.put(BookEntry.COLUMN_GENRE, BookEntry.GENRE_SELF_HELP);\n values.put(BookEntry.COLUMN_PRICE, getResources().getInteger(R.integer.dummy_book_price));\n values.put(BookEntry.COLUMN_QUANTITY, getResources().getInteger(R.integer.dummy_book_quantity));\n values.put(BookEntry.COLUMN_SUPPLIER, getString(R.string.dummy_book_supplier));\n values.put(DatabaseContract.BookEntry.COLUMN_SUPPLIER_PHONE, getString(R.string.dummy_supplier_phone_number));\n values.put(DatabaseContract.BookEntry.COLUMN_SUPPLIER_EMAIL, getString(R.string.dummy_book_supplier_email));\n getContentResolver().insert(BookEntry.CONTENT_URI, values);\n }", "void create(int id, int authorId, String title);", "public Result save() {\n try {\n Form<Book> bookForm = formFactory.form(Book.class).bindFromRequest();\n Book book = bookForm.get();\n libraryManager.addLibraryItem(book);\n return redirect(routes.MainController.index());\n } catch (IsbnAlreadyInUseException e) {\n return notAcceptable(e.getMessage());\n }\n }", "@Override\n\tpublic String insertBook(Book book) {\n\t\treturn \"Book successfully inserted\";\n\t}", "public com.alain.puntocoma.model.Catalogo create(long catalogoId);", "@PostMapping\n\t@ApiOperation(value = \"Create reservation\", notes = \"Service to create a new reservation\")\n\t@ApiResponses(value = {\n\t\t\t@ApiResponse(code = 201, message = \"Reservation created\"),\n\t\t\t@ApiResponse(code = 400, message = \"Bad request\")\n\t})\n\tpublic ResponseEntity<?> create(@RequestBody ReservationVO reservationVO){\n\t\tReservation reservation = new Reservation(reservationVO);\n\t\treservation = reservationService.create(reservation);\n\t\tReservationDTO reservationDTO = new ReservationDTO(reservation);\n\t\treturn new ResponseEntity<>(reservationDTO,HttpStatus.CREATED);\n\t}", "@Override\n\tpublic void addBook() {\n\t\t\n\t}", "@POST\n @Consumes(\"application/json\")\n public Response createPO(PurchaseOrderEJBDTO po) {\n int pono = pfb.addPO(po);\n URI uri = context.getAbsolutePath();\n return Response.created(uri).entity(pono).build();\n }", "public RentalResponse createReservation(Reservation argRequest) {\r\n\t\t\r\n\t\tRentalResponse response = service.processRequest(argRequest);\r\n\t\t\r\n\t\treturn response;\r\n\t\t\r\n\t}", "CreateCategoryResponse createCategory(CreateCategoryRequest request);" ]
[ "0.7267275", "0.7244061", "0.69509166", "0.694357", "0.6772077", "0.6684743", "0.6625989", "0.65122765", "0.64426327", "0.63884884", "0.63784313", "0.62515974", "0.61637515", "0.6163674", "0.6138262", "0.60124886", "0.59749997", "0.5969275", "0.5931774", "0.59197927", "0.5902432", "0.5887316", "0.5881098", "0.58760655", "0.583318", "0.5818904", "0.57912135", "0.5789249", "0.5752134", "0.5714998", "0.5701714", "0.56969374", "0.5661381", "0.5653928", "0.5651534", "0.5645376", "0.5645255", "0.5618309", "0.5581971", "0.5547001", "0.552517", "0.5521166", "0.55170876", "0.550978", "0.55055296", "0.55055016", "0.55023605", "0.54904115", "0.5452593", "0.5446312", "0.5435042", "0.54336435", "0.5428285", "0.5423137", "0.5422771", "0.5422418", "0.5421469", "0.5413286", "0.54111874", "0.5408785", "0.54051256", "0.5395162", "0.53700495", "0.536957", "0.5369049", "0.53605455", "0.53600866", "0.53599954", "0.53505546", "0.53466177", "0.534171", "0.5340604", "0.5333172", "0.5322656", "0.53025883", "0.52773994", "0.5272128", "0.52574104", "0.52519184", "0.5248183", "0.5231064", "0.5216806", "0.5214604", "0.5210039", "0.5207473", "0.52044415", "0.5191267", "0.51836383", "0.51830506", "0.51795894", "0.5172619", "0.5171334", "0.5170467", "0.5169098", "0.5168658", "0.5168208", "0.5162855", "0.5159744", "0.5151422", "0.5151259" ]
0.77890515
0
Rest request to update a existing book.
@PUT @Path("{isbn}") @Consumes(MediaType.APPLICATION_JSON) public Response updateBook(@PathParam("isbn") String isbn, Book book) { //isbn in uri differs from isbn in book object. I do that because updateBook only gets a book object, //there's no possibility to check in service for the local var isbn because the json defined isbn is given to //the service if (!book.getIsbn().equals("") && !isbn.equals(book.getIsbn())) { return Response.status(Response.Status.BAD_REQUEST) .entity(new JSONObject().put("Message", "Isbn differs from isbn specified in payload.").toString()) .build(); } //no isbn in request json body else if (book.getIsbn().equals("")) { book = new Book(book.getTitle(), book.getAuthor(), isbn); } //find and replace book object final BookServiceResult result = bookService.updateBook(book); return Response.status(result.getStatus().getStatusCode()) .entity(getJsonFromServiceResult(result)) .build(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@PutMapping(\"/book\")\n public ResponseEntity<?> update(@RequestBody Book book) {\n bookService.update(book);\n\n return ResponseEntity.ok().body(\"Book has been updated successfully.\");\n }", "@PutMapping(\"/update/{id}\")\n public ResponseEntity<Void> updateBook(@RequestBody Book book,\n @PathVariable(\"id\") Long id) throws BookNotFoundException {\n bookService.updateBook(book, id);\n\n return ResponseEntity.status(HttpStatus.OK).build();\n }", "@PutMapping(\"/books/{id}\")\n\tpublic ResponseEntity<Book> updateBook(@PathVariable Long id,@RequestBody Book bookDetails)\n\t{\n\t\tBook book = bookRepository.findById(id)\n\t\t\t\t.orElseThrow(() -> new ResourceNotFoundException(\"Book Not found with id\" + id));\n\t\tbook.setTitle(bookDetails.getTitle());\n\t\tbook.setAuthors(bookDetails.getAuthors());\n\t\tbook.setYear(bookDetails.getYear());\n\t\tbook.setPrice(bookDetails.getPrice());\n\t\t\n\t\tBook updatedBook = bookRepository.save(book);\n\t\treturn ResponseEntity.ok(updatedBook);\n\t}", "@RequestMapping(value=\"/api/books/{id}\", method=RequestMethod.PUT)\n\t public Book update(@ModelAttribute(\"Book\") Book books, @PathVariable(\"id\") Long id, @RequestParam(value=\"title\") String title, @RequestParam(value=\"description\") String desc, @RequestParam(value=\"language\") String lang, @RequestParam(value=\"pages\") Integer numberOfPages) {\n\t Book book = bookService.findBook(id);\n\t book.setTitle(title);\n\t book.setDescription(desc);\n\t book.setNumberOfPages(numberOfPages);\n\t return book;\n\t }", "@Override\r\n\tpublic void updatebook(BookDto book) {\n\t\tsqlSession.update(ns + \"updatebook\", book);\r\n\t}", "@Override\r\n\tpublic Book updateBook(Book book) {\n\t\treturn bd.save(book);\r\n\t}", "@GetMapping(\"/update\")\n\tpublic String updateBook(Map<String, Object> map, @ModelAttribute(\"bookCmd\") Book book, HttpServletRequest req) {\n\n\t\tList<BookModel> listmodel = null;\n\t\tBookModel model = null;\n\n\t\t// create model class object\n\t\tmodel = new BookModel();\n\t\t// use service\n\t\tmodel = service.findById(Integer.parseInt(req.getParameter(\"bookid\")));\n\n\t\t// copy model class to command class\n\t\tBeanUtils.copyProperties(model, book);\n\n\t\t// use service\n\t\tlistmodel = service.findAllBookDetails();\n\t\t\n\t\t//map \n\t\tmap.put(\"listmodel\", listmodel);\n\t\tmap.put(\"book\", book);\n\t\tSystem.out.println(book);\n\t\treturn \"register\";\n\n\t}", "public Book updateBook(Long id, Book book) {\n return this.sRepo.save(book);\n\n\t}", "@PatchMapping(\"recipes/{id}\")\n public RecipeDto updateBook(@PathVariable(\"id\") Long id, @RequestBody RecipeDto toUpdate) {\n logger.info(\"updating book with id: [{}] with new attributes: [{}]\", id, toUpdate);\n return recipeService.updateRecipeWithAttributes(id, toUpdate);\n }", "@PutMapping(\"/{username}/books/{bookId}\")\n public Book markBookInLibrary(@PathVariable String username,\n @PathVariable Long bookId,\n @RequestBody Book book) {\n\n UserBookStatus userBookStatus = UserBookStatus.valueOf(book.getStatus().toUpperCase());\n UserBook userBook = userService.markBook(username, bookId, userBookStatus);\n return userBookToBook.apply(userBook);\n }", "void update(Book book);", "@PUT\n\t@Consumes({\"text/turtle\",\"application/rdf+xml\"})\n\tResponse updateResource(String body, @HeaderParam(\"Accept\") String format);", "public void update(int bookId, int quantity){ \n JSONObject jbook = dbmanager.getBmanager().readJSON(bookId);\n dbmanager.getBmanager().delete(bookId);\n jbook.remove(\"quantity\");\n jbook.put(\"quantity\", Integer.toString(quantity));\n dbmanager.open();\n dbmanager.createCommit(getNextBookId(),jbook);\n dbmanager.close();\n \n }", "@Override\r\n\tpublic int updateBookInfo(Book book, int book_id) {\n\t\treturn 0;\r\n\t}", "@PUT\n @Path(\"/update\")\n public void put() {\n System.out.println(\"PUT invoked\");\n }", "public book edit(book editedbook) {\n\t\t\n\t\treturn repository.save(editedbook);\n\t}", "@Override\r\n\tpublic Book update(Book book) {\r\n\t\treturn null;\r\n\t}", "int updateByPrimaryKey(Book record);", "int updateByPrimaryKey(Book record);", "public boolean updateBook(Books books){\n String sql=\"update Book set book_name=?,book_publish_date=?,book_author=?,book_price=?,scraption=? where id=?\";\n boolean flag=dao.exeucteUpdate(sql,new Object[]{books.getBook_name(),books.getBook_publish_date(),\n books.getBook_author_name(),books.getBook_price(),books.getScraption(),books.getId()});\n return flag;\n }", "@RequestMapping(\"/update\")\n\tpublic Booking update(@RequestParam Long bookingId, @RequestParam String psngrName) {\n\t\tBooking booking = bookingRepository.findOne(bookingId);\n\t\tbooking.setPsngrName(psngrName);\n\t\tbooking = bookingRepository.save(booking);\n\t return booking;\n\t}", "@PutMapping(\"/{id}/shoppingcart\")\n public ShoppingCart addBookToShoppingCart(@PathVariable long id, @RequestBody Book book){\n Customer b = customerRepository.findById(id);\n ShoppingCart sc = b.getShoppingCart();\n sc.addBook(book);\n book.addShoppingCart(sc);\n customerRepository.save(b);\n return sc;\n }", "@PutMapping(\"/boards\")\n public ResponseEntity<Board> updateBook(@RequestBody Board board) throws URISyntaxException {\n if(board.getId() == null){\n throw new BadRequestAlertException(\"Invalid id\", ENTITY_NAME, \"idnull\");\n }\n Board result = boardRepository.save(board);\n return ResponseEntity.ok()\n .headers(HeaderUtil.createEntityUpdateAlert(applicationName, false, ENTITY_NAME, board.getId().toString()))\n .body(result);\n }", "public book update(long id) {\n\t\treturn repository.findById(id).orElse(new book());\n\t\t\n\t}", "@Override\n\tpublic BookModel update(BookModel updateBook) {\n\t\tCategoryModel category = categoryDao.findByCode(updateBook.getCategoryCode());\n\t\tupdateBook.setCategoryId(category.getId());\n\t\tbookDao.update(updateBook);\n\t\treturn bookDao.findOne(updateBook.getId());\n\t}", "@GetMapping(\"/editBook\")\n public String editBook(Model model, @RequestParam(\"id\") int id) {\n Book book = bookService.getBookById(id);\n modelAndList(model, book);\n return \"editBook\";\n }", "@Override\n\tpublic Book update(Book dto) {\n\t\treturn null;\n\t}", "@RequestMapping(method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE)\n //Request Body is requesting the student parameter\n public void updateStudent(@RequestBody Student student){\n studentService.updateStudent(student);\n }", "@ResponseStatus(code=HttpStatus.OK)\r\n\t@RequestMapping(value=\"/update\", method=RequestMethod.GET)\r\n\tpublic void update() {\r\n\t\tSystem.out.println(\"StudentRestController.Update()_________\");\r\n\t}", "int updateByPrimaryKey(BookInfo record);", "@RestAPI\n \t@PreAuthorize(\"hasAnyRole('A')\")\n \t@RequestMapping(value = \"/api/{id}\", params = \"action=update\", method = RequestMethod.PUT)\n \tpublic HttpEntity<String> update(@PathVariable(\"id\") Long id) {\n \t\tagentManagerService.update(id);\n \t\treturn successJsonHttpEntity();\n \t}", "@Override\n public Optional<BookDto> updateBook(Integer bookId, BookDto bookDto) {\n try {\n Optional<BookEntity> bookEntity = bookRepository.findByBookId(bookId);\n if (bookEntity.isPresent()) {\n BookEntity updatedBookEntity = bookRepository.save(new BookEntity(bookId,\n bookDto.getBookName(), bookDto.getBookAuthor()));\n LogUtils.getInfoLogger().info(\"Book Updated: {}\", updatedBookEntity.toString());\n return Optional.of(bookDtoBookEntityMapper.bookEntityToBookDto(updatedBookEntity));\n } else {\n LogUtils.getInfoLogger().info(\"Book Not updated\");\n return Optional.empty();\n }\n }catch (Exception exception){\n throw new BookException(exception.getMessage());\n }\n }", "int updateByPrimaryKey(CmsRoomBook record);", "public static void updateBook(Book book) throws HibernateException{\r\n session=sessionFactory.openSession();\r\n session.beginTransaction();\r\n \r\n //Update detail of the book to the database\r\n session.update(book);\r\n \r\n session.getTransaction().commit();\r\n session.close();\r\n \r\n }", "@PutMapping(\"/update\")\n @ResponseStatus(HttpStatus.CREATED)//status 201\n public AsociadosProyecto update(@RequestBody AsociadosProyecto asociadosProyecto){\n return asociadosProyectoService.update(asociadosProyecto);\n }", "@RequestMapping(value = \"/libros\", method = RequestMethod.PUT)\n\tpublic ResponseEntity<Libro> updateLibro(@RequestBody Libro libro) {\n\t\t\t\n\t\tlibro = repository.findById(libro.getId()).get().setLibro(libro);\n\t\trepository.save(libro);\n\t\t\n\t return new ResponseEntity<Libro>(libro, HttpStatus.OK);\n\t}", "@PostMapping(\"/{username}/books\")\n public Book addBookToLibrary(@PathVariable String username,\n @RequestBody Book book) {\n\n if(book.getBookId() == null) {\n logger.error(\"bookId is null\");\n throw new IllegalArgumentException(\"Invalid bookId\");\n }\n return userBookToBook.apply(userService.addBook(username, book.getBookId()));\n }", "@PUT\n\t@Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})\n\t@Consumes({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})\n\t@Path(\"/contact/{name}\")\n\tpublic Response update(@PathParam(\"name\") String name,Contact contact){\n\t\tcontact.setName(name);\n\t\tAddressBookResponse addressBookResponse = new AddressBookResponse();\n\t\tif(processor.update(contact)){\n\t\t\taddressBookResponse.setCode(Status.OK);\n\t\t\taddressBookResponse.setMessage(\"Success\");\n\t\t\taddressBookResponse.setMessage(\"Entery got successfully created\");\n\t\t}else{\n\t\t\taddressBookResponse.setCode(Status.NOT_FOUND);\n\t\t\taddressBookResponse.setMessage(\"contact for \" + contact.getName() \n\t\t\t\t\t+ \" \"+ contact.getlName() + \" does not exist\");\n\t\t}\n\t\t\n\t\treturn Response.ok().entity(addressBookResponse).build();\n\t\t\n\t}", "public com.squareup.okhttp.Call addressBookUpdateAddressBookCall(Integer addressbookId, AddressBookDTO addressBookDto, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {\n Object localVarPostBody = addressBookDto;\n\n // create path and map variables\n String localVarPath = \"/api/AddressBook/addressbook/{addressbookId}\"\n .replaceAll(\"\\\\{\" + \"addressbookId\" + \"\\\\}\", apiClient.escapeString(addressbookId.toString()));\n\n List<Pair> localVarQueryParams = new ArrayList<Pair>();\n List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();\n\n Map<String, String> localVarHeaderParams = new HashMap<String, String>();\n\n Map<String, Object> localVarFormParams = new HashMap<String, Object>();\n\n final String[] localVarAccepts = {\n \"application/json\", \"text/json\", \"application/xml\", \"text/xml\"\n };\n final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);\n if (localVarAccept != null) localVarHeaderParams.put(\"Accept\", localVarAccept);\n\n final String[] localVarContentTypes = {\n \"application/json\", \"text/json\", \"application/xml\", \"text/xml\", \"application/x-www-form-urlencoded\"\n };\n final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);\n localVarHeaderParams.put(\"Content-Type\", localVarContentType);\n\n if(progressListener != null) {\n apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {\n @Override\n public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {\n com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());\n return originalResponse.newBuilder()\n .body(new ProgressResponseBody(originalResponse.body(), progressListener))\n .build();\n }\n });\n }\n\n String[] localVarAuthNames = new String[] { \"Authorization\" };\n return apiClient.buildCall(localVarPath, \"PUT\", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);\n }", "@PUT\n @Path(\"/{id}\")\n @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})\n public Response addStudentGrade(Grade grade, @PathParam(\"id\") int id) {\n // getting student by it's index\n if(grade.getCourse() == null)\n return Response.status(Response.Status.NOT_FOUND).entity(\"Grade's course not existing\").build();\n StudentService studentService = new StudentService();\n Student searchedStudent = studentService.getStudent(index);\n System.out.println(\"PUT\");\n System.out.println(searchedStudent);\n\n // getting student's grade by it's id\n Grade searchedGrade = searchedStudent.getGradeById(id);\n System.out.println(searchedGrade);\n\n // checking if grade's course exists\n CourseService courseService = new CourseService();\n System.out.println(grade.getCourse());\n Course searchedCourse = courseService.getCourseById(grade.getCourse().getId());\n System.out.println(\"Course : \" + searchedCourse);\n if (searchedCourse == null)\n return Response.status(Response.Status.NOT_FOUND).entity(\"Grade's course not found\").build();\n\n searchedCourse.setId(grade.getCourse().getId());\n grade.setId(id);\n grade.setStudentIndex(searchedStudent.getIndex());\n System.out.println(grade.get_id());\n grade.set_id(searchedGrade.get_id());\n System.out.println(grade.get_id());\n searchedStudent.updateStudentGrade(grade);\n System.out.println(searchedStudent);\n studentService.updateStudent(searchedStudent);\n String result = \"Student grade \" + grade + \" updated!\";\n System.out.println(searchedGrade);\n // creating response\n return Response.status(Response.Status.CREATED).entity(result).build();\n }", "int updateByPrimaryKey(BookDO record);", "@RequestMapping(\"/book/edit/{id}\")\n public String edit(@PathVariable Long id, Model model){\n model.addAttribute(\"book\", bookService.getBookById(id));\n return \"bookform\";\n }", "@PostMapping(\"api/book\")\n public ResponseEntity<Book> addBook(@RequestBody Book book) {\n Result<Book> result = bookService.save(book);\n if (result.isSuccess()) {\n return ResponseEntity.ok(book);\n } else {\n return ResponseEntity.noContent().build();\n }\n }", "int updateByPrimaryKey(IntegralBook record);", "RocketDTO updateRocket(UpdateRocketDTO rocket);", "@PatchMapping(\"/{hotelId}\")\n public ResponseEntity<HotelResource> updateHotel(@PathVariable Long hotelId, @RequestBody Hotel hotel){\n return new ResponseEntity<>(\n hotelService.updateHotel(hotelId, hotel), HttpStatus.OK\n );\n }", "int updateByExample(@Param(\"record\") Book record,\n @Param(\"example\") BookExample example);", "public ResponseTranslator put() {\n setMethod(\"PUT\");\n return doRequest();\n }", "@RequestMapping(value = \"/enquirys\",\n method = RequestMethod.PUT,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public ResponseEntity<Void> update(@Valid @RequestBody Enquiry enquiry) throws URISyntaxException {\n log.debug(\"REST request to update Enquiry : {}\", enquiry);\n if (enquiry.getId() == null) {\n return create(enquiry);\n }\n enquiryRepository.save(enquiry);\n return ResponseEntity.ok().build();\n }", "public void updateBook(View view){\n update();\n }", "public void update(Book entity)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tbookdao.openCurrentSessionwithTransation();\r\n\t\t\tbookdao.update(entity);\r\n\t\t\tbookdao.closeSessionwithTransaction();\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}", "@RequestMapping(value = \"garage/{id}\", method = RequestMethod.PUT)\n\tpublic Garage update(@PathVariable int id, \n\t\t\t@RequestBody String jsonGarage, HttpServletResponse res) {\n\n\t\tSystem.out.println(\"in update ************************\" + id);\n\t\tres.setStatus(202);\n\t\tSystem.out.println(jsonGarage);\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\ttry {\n\t\t\tGarage mappedAddress = mapper.readValue(jsonGarage, Garage.class);\n\t\t\treturn garagedao.update(id, mappedAddress);\n\t\t} catch (JsonParseException e) {\n\n\t\t\te.printStackTrace();\n\t\t} catch (JsonMappingException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "@RequestMapping(value = \"/shopressource\", method = RequestMethod.PUT)\n ShopRessource updateShopRessource(@RequestBody ShopRessource shopRessource);", "@PUT\n @Path(\"/{educationId : \\\\d+}\") // catch only numeric identifiers\n @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})\n @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})\n public Response updateEducation( @PathParam(\"educationId\") Long educationId,\n Education education,\n @BeanParam GenericBeanParam params ) throws ForbiddenException, UnprocessableEntityException, InternalServerErrorException {\n\n RESTToolkit.authorizeAccessToWebService(params);\n logger.log(Level.INFO, \"updating existing Education by executing EducationResource.updateEducation(educationId, education) method of REST API\");\n\n // set resource ID passed in path param on updated resource object\n education.setEducationId(educationId);\n\n Education updatedEducation = null;\n try {\n // reflect updated resource object in database\n updatedEducation = educationFacade.update(education, true);\n // populate created resource with hypermedia links\n EducationResource.populateWithHATEOASLinks(updatedEducation, params.getUriInfo());\n\n } catch (EJBTransactionRolledbackException ex) {\n ExceptionHandler.handleEJBTransactionRolledbackException(ex);\n } catch (EJBException ex) {\n ExceptionHandler.handleEJBException(ex);\n } catch (Exception ex) {\n throw new InternalServerErrorException(ExceptionHandler.ENTITY_UPDATE_ERROR_MESSAGE);\n }\n\n return Response.status(Status.OK).entity(updatedEducation).build();\n }", "public Result save() {\n try {\n Form<Book> bookForm = formFactory.form(Book.class).bindFromRequest();\n Book book = bookForm.get();\n libraryManager.addLibraryItem(book);\n return redirect(routes.MainController.index());\n } catch (IsbnAlreadyInUseException e) {\n return notAcceptable(e.getMessage());\n }\n }", "@Override\r\n\tpublic boolean updateByBookId(Book book) {\n\t\tboolean flag=false;\r\n\t\tString sql=\"update books set title=?,author=?,publisherId=?,publishDate=?,isbn=?,wordsCount=?,unitPrice=?,contentDescription=?,aurhorDescription=?,editorComment=?,TOC=?,categoryId=?,booksImages=?,quantity=?,address=?,baoyou=? \"\r\n\t\t\t\t+ \"where id=?\";\r\n\t\tList<Object> list=new ArrayList<Object>();\r\n\t\tif(book!=null){\r\n\t\t\tlist.add(book.getTitle());\r\n\t\t\tlist.add(book.getAuthor());\r\n\t\t\tlist.add(book.getPublisherId());\r\n\t\t\tlist.add(book.getPublishDate());\r\n\t\t\tlist.add(book.getIsbn());\r\n\t\t\tlist.add(book.getWordsCount());\r\n\t\t\tlist.add(book.getUnitPrice());\r\n\t\t\tlist.add(book.getContentDescription());\r\n\t\t\tlist.add(book.getAurhorDescription());\r\n\t\t\tlist.add(book.getEditorComment());\r\n\t\t\tlist.add(book.getTOC());\r\n\t\t\tlist.add(book.getCategoryId());\r\n\t\t\t\r\n\t\t\tlist.add(book.getBooksImages());\r\n\t\t\tlist.add(book.getQuantity());\r\n\t\t\t\r\n\t\t\tlist.add(book.getAddress());\r\n\t\t\tif(book.getBaoyou()==\"0\"){\r\n\t\t\t\tbook.setBaoyou(\"不包邮\");\r\n\t\t\t}else{\r\n\t\t\t\tbook.setBaoyou(\"包邮\");\r\n\t\t\t}\r\n\t\t\tlist.add(book.getBaoyou());\r\n\t\t\tlist.add(book.getId());\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\ttry {\r\n\t\t\tint update = runner.update(sql, list.toArray());\r\n\t\t\tif(update>0){\r\n\t\t\t\tflag=true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn flag;\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn flag;\r\n\t}", "@PostMapping(\"/books\")\n\tpublic Book createBook(@RequestBody Book book)\n\t{\n\t\treturn bookRepository.save(book);\n\t}", "public @ResponseBody Contract updateContract(@RequestBody Contract Contract);", "@POST\n @Consumes(MediaType.APPLICATION_JSON)\n public Response createBook(Book book) {\n final BookServiceResult result = bookService.addBook(book);\n return Response\n .status(result.getStatus())\n .entity(getJsonFromServiceResult(result))\n .build();\n }", "@Override\n\tpublic int editBook(bookInfo bookinfo) {\n\t\treturn 0;\n\t}", "private void update() {\n ambianceModel.ambiance.uniq_id = ambianceModel._id.$oid;\n\n RestAdapter restAdapter = new RestAdapter.Builder().setLogLevel(RestAdapter.LogLevel.FULL).setEndpoint(getResources().getString(R.string.api)).build();\n final GsonBuilder builder = new GsonBuilder();\n builder.excludeFieldsWithoutExposeAnnotation();\n builder.disableHtmlEscaping();\n final Gson gson = builder.create();\n Request r = new Request(Singleton.token, ambianceModel._id.$oid, ambianceModel);\n String json = gson.toJson(r);\n Log.v(\"Ambiance activity\", json);\n\n final Lumhueapi lumhueapi = restAdapter.create(Lumhueapi.class);\n lumhueapi.updateAmbiance(r, new Callback<AmbianceApplyResponse>() {\n @Override\n public void success(AmbianceApplyResponse ambianceApplyResponse, Response response) {\n Log.v(\"Ambiance activity\", \"It worked\");\n }\n\n @Override\n public void failure(RetrofitError error) {\n String tv = error.getMessage();\n Log.v(\"Ambiance activity\", tv + \"\");\n }\n });\n }", "@Test\r\n\tpublic void updateProductDetails() {\r\n\r\n\t\tRestAssured.baseURI = \"http://localhost:9000/products\";\r\n\t\tRequestSpecification request = RestAssured.given();\r\n\t\tJSONObject requestParams = new JSONObject();\r\n\t\trequestParams.put(\"name\", \"Banana\");\r\n\t\trequest.header(\"Content-Type\", \"application/json\");\r\n\t\trequest.body(requestParams.toString());\r\n\t\tResponse response = request.put(\"/5\");\r\n\t\tSystem.out.println(\"Update Responce Body ----->\" + response.asString());\r\n\t\tint statusCode = response.getStatusCode();\r\n\t\tAssert.assertEquals(statusCode, 200);\r\n\r\n\t}", "@PreAuthorize(\"hasAuthority('SECRETARY')\")\n @PostMapping(\"/document/edit\")\n public ResponseEntity<Response> editSecretaryDocument(@RequestParam(value = \"id\") String id,\n @RequestParam(value = \"name\") String name,\n @RequestParam(value = \"description\") String description,\n @RequestParam(value = \"endDateOfUpload\") String endDateOfUpload) {\n return ResponseEntity.ok(secretaryService.editSecretaryDocument(SecretaryDocumentModel.builder()\n .id(Long.valueOf(id))\n .endDateOfUpload(LocalDateTime.parse(endDateOfUpload, DateTimeFormatter.ISO_DATE_TIME))\n .name(name)\n .description(description)\n .build()));\n }", "int updateByPrimaryKeySelective(Book record);", "int updateByPrimaryKeySelective(Book record);", "@GET\n @Path(\"/id/{id}\")\n public Book findById(@PathParam(\"id\") long id) {\n return new Book();\n }", "@RequestMapping(value = \"/book/{id}\", method = RequestMethod.GET)\r\n public ResponseEntity<Book> get(@PathVariable(\"id\") long id) throws Exception{\r\n Book book = bookService.getBookById(id);\r\n return ResponseEntity.ok().body(book);\r\n }", "void update(Seller obj);", "void update(Seller obj);", "@Override\n\tpublic void updateBookData() {\n\t\tList<Book> bookList = dao.findByHql(\"from Book where bookId > 1717\",null);\n\t\tString bookSnNumber = \"\";\n\t\tfor(Book book:bookList){\n\t\t\tfor (int i = 1; i <= book.getLeftAmount(); i++) {\n\t\t\t\t// 添加图书成功后,根据ISBN和图书数量自动生成每本图书SN号\n\t\t\t\tBookSn bookSn = new BookSn();\n\t\t\t\t// 每本书的bookSn号根据书的ISBN号和数量自动生成,\n\t\t\t\t// 如书的ISBN是123,数量是3,则每本书的bookSn分别是:123-1,123-2,123-3\n\t\t\t\tbookSnNumber = \"-\" + i;//book.getIsbn() + \"-\" + i;\n\t\t\t\tbookSn.setBookId(book.getBookId());\n\t\t\t\tbookSn.setBookSN(bookSnNumber);\n\t\t\t\t// 默认书的状态是0表示未借出\n\t\t\t\tbookSn.setStatus(new Short((short) 0));\n\t\t\t\t// 添加bookSn信息\n\t\t\t\tbookSnDao.save(bookSn);\n\t\t\t}\n\t\t}\n\t}", "@Override\n\t@RestResource(exported = false)\n\tpublic <S extends Book> S save(S entity);", "public static void update( EntityManager em, UserTransaction ut, String isbn,\n String title, int year) throws Exception {\n ut.begin();\n Book book = em.find( Book.class, isbn);\n if ( title != null && !title.equals( book.title)) {\n book.setTitle( title);\n }\n if ( year != book.year) {\n book.setYear( year);\n }\n ut.commit();\n System.out.println( \"Book.update: the book \" + book + \" was updated.\");\n }", "int updateByPrimaryKeySelective(CmsRoomBook record);", "public abstract Response update(Request request, Response response);", "private void updateBook(){\n String dateStarted = ((EditText)dialogView.findViewById(R.id.input_date_started_reading))\n .getText().toString();\n book.setDateStarted(dateStarted);\n\n String dateCompleted = ((EditText)dialogView.findViewById(R.id.input_date_completed))\n .getText().toString();\n book.setDateCompleted(dateCompleted);\n\n //update the book\n DatabaseReference mDatabase = FirebaseDatabase.getInstance().getReference();\n mDatabase.child(\"books\").child(book.getId()).setValue(book);\n\n //hide dialog\n dismiss();\n }", "HttpPut putRequest(HttpServletRequest request, String address) throws IOException;", "public abstract void update(@Nonnull Response response);", "@PUT\n @Produces({ \"application/json\" })\n @Path(\"{id}\")\n @CommitAfter\n public abstract Response update(Person person);", "private void save(HttpServletRequest request, HttpServletResponse response) throws IOException {\n\t\tBook book = new Book();\r\n\t\tbook.setId(bookService.list().size()+1);\r\n\t\tbook.setBookname(request.getParameter(\"bookname\"));\r\n\t\tbook.setAuthor(request.getParameter(\"author\"));\r\n\t\tbook.setPrice(Float.parseFloat(request.getParameter(\"price\")));\r\n\t\tbookService.save(book);\r\n\t\t//out.println(\"<script>window.location.href='index.html'</script>\");\r\n\t\tresponse.sendRedirect(\"index.html\");\r\n\t}", "@Path(\"/{ID}\")\n @PUT\n @Consumes(MediaType.APPLICATION_JSON)\n @Produces(MediaType.APPLICATION_JSON)\n public Response update(@PathParam(\"ID\") String ID, Person person) \n throws NotFoundException, MissingInformationException {\n if(person == null) \n throw new MissingInformationException(\"No Person were found\");\n \n Document found = fetchByObjectId(ID);\n \n UpdateResult result = getCollection().updateOne(found, \n new Document(\"$set\", toDocument(person)));\n if(result.getModifiedCount() == 0)\n return Response.status(Response.Status.GONE).build();\n \n // Indicates nothing was modified at all\n return Response.status(Response.Status.ACCEPTED).build();\n }", "@PUT\n @Path(\"/{register_id}\")\n @Consumes(MediaType.APPLICATION_JSON)\n Response update(@Valid @NotNull RegisterDTO registerDto, @PathParam(\"store_id\") Long storeId, @PathParam(\"register_id\") Long registerId);", "@RequestMapping(\"/edit\")\n\tpublic ModelAndView editBooking(@RequestParam(\"id\") Integer id, ModelMap model,\n\t\t\t@RequestParam(name = \"roomId\", defaultValue = \"-1\") Integer roomId,\n\t\t\t@RequestParam(name = \"computerId\", defaultValue = \"-1\") Integer computerId,\n\t\t\t@RequestParam(\"start\") @DateTimeFormat(pattern = \"yyyy-MM-dd HH:mm\") Date start,\n\t\t\t@RequestParam(\"end\") @DateTimeFormat(pattern = \"yyyy-MM-dd HH:mm\") Date end,\n\t\t\t@RequestParam(name = \"userId\", defaultValue = \"-1\") Integer userId,\n\t\t\tRedirectAttributes redirectAttr) throws Exception {\n\t\tif (id == null || roomId == null || computerId == null || start == null || end == null) {\n\t\t\treturn new ModelAndView(\"redirect:/bookings\");\n\t\t}\n\t\t// Get Room, Computer, Booking by Id\n\t\tRoom room = roomService.findById(roomId);\n\t\tComputer computer = computerService.findById(computerId);\n\t\tBooking booking = bookingService.findById(id);\n\t\t// Set new title with room name and computer brand / model\n\t\tString title = \"\";\n\t\tif (room != null) {\n\t\t\ttitle += room.getName();\n\t\t}\n\t\tif (computer != null) {\n\t\t\ttitle += \" - \" + computer.getBrand() + \" \" + computer.getModel();\n\t\t}\n\t\t// Set all new properties to booking\n\t\tbooking.setComputer(computer);\n\t\tbooking.setRoom(room);\n\t\tbooking.setEnd(end);\n\t\tbooking.setStart(start);\n\t\tbooking.setTitle(title);\n\t\ttry {\n\t\t\t// Save booking\n\t\t\tbooking = bookingService.addOrUpdate(booking, userId);\n\t\t\tredirectAttr.addFlashAttribute(\"success\", \"La réservation à bien été modifiée.\");\n\t\t} catch (Exception e) {\n\t\t\tif (e.getMessage().equals(\"room_computer_null\")) {\n\t\t\t\tredirectAttr.addFlashAttribute(\"error\", \"Vous devez sélectionnez un ordinateur et/ou une salle.\");\n\t\t\t} else {\n\t\t\t\tredirectAttr.addFlashAttribute(\"error\", \"Vérifier que la salle et/ou l'ordinateur sont bien disponibles.\");\n\t\t\t}\n\t\t\treturn new ModelAndView(\"redirect:/bookings/bookingById?id=\" + id, model);\n\t\t}\n\t\tredirectAttr.addFlashAttribute(\"booking\", booking);\n\t\tmodel.addAttribute(\"id\", id);\n\t\treturn new ModelAndView(\"redirect:/bookings/bookingById\", model);\n\t}", "@Override\n @PUT\n @Path(\"/update/{id}\")\n public void update(@PathParam(\"id\") int id, Author author) {\n EntityManager em = PersistenceUtil.getEntityManagerFactory().createEntityManager();\n AuthorDao authorDao = new AuthorDao(em);\n authorDao.update(id,author);\n }", "int updateByPrimaryKeySelective(BookInfo record);", "@RequestMapping(path = \"/update\", method = RequestMethod.POST)\n\tpublic ResponseEntity<RestResponse<CompanyDTO>> update(@RequestBody CompanyDTO request) {\n\n\t\tCompanyDTO result = companyService.update(request);\n\t\t\n\t\tRestResponse<CompanyDTO> restResponse = \n\t\t\t\tnew RestResponse<CompanyDTO>(RestResponseCodes.OK.getCode(), RestResponseCodes.OK.getDescription(), result);\n\t\t\n\t\treturn new ResponseEntity<RestResponse<CompanyDTO>>(restResponse, HttpStatus.OK);\n\t\t\t\n\t}", "public interface BookService {\n\n Book createBook(Book book);\n\n List<Book> getBookByUserId(String userId);\n\n Book updateBook(String id, Book book);\n\n void deleteBook(String id);\n}", "@PutMapping(value=\"/ticket/{ticketId}\")\n\tpublic Ticket updateTicket(@RequestBody Ticket ticket,@PathVariable(\"ticketId\") Integer ticketId){\n return ticketBookingService.updateTicket(ticket,ticketId);\t\t\n\t}", "@Override\n public void update(BookUpdateViewModel viewModel) {\n Book bookDb = repository.findById(viewModel.getId())\n .orElseThrow(RecordNotFoundException::new);\n\n\n // check the validity of the fields\n if (viewModel.getTitle().strip().length() < 5) {\n throw new DomainValidationException();\n }\n\n // apply the update\n BeanUtils.copyProperties(viewModel, bookDb);\n\n // save and flush\n repository.saveAndFlush(bookDb);\n }", "@PutMapping(\"/update/{id}\")\n public String upadtegetRestaurant(@RequestBody Restaurant restaurant, @PathVariable String id) throws RestaurantAlreadyException, RestaurantNotFound {\n restaurant.setRestaurantId(id);\n restaurantServiceImpl.updataData(restaurant);\n return \"Updated successfully\";\n\n }", "@PUT\n\t@Path(\"/\")\n\t@Nonnull\n\t@Consumes(MediaType.APPLICATION_JSON)\n\t@Produces(MediaType.APPLICATION_JSON)\n\tExercise update(@Nonnull Exercise exercise);", "@PutMapping(\"/items/{item_id}\")\n\tpublic ResponseEntity<Item> updateItem(@PathVariable(value=\"item_id\") Long item_id, @Valid @RequestBody Item itemDetails){ \n\t\tItem item = itemDAO.findOne(item_id);\n\t\tif(item == null) {\n\t\t\treturn ResponseEntity.notFound().build();\n\t\t}\n\t\titem.setItem_id(itemDetails.getItem_id());\n\t\titem.setItem_name(itemDetails.getItem_name());\n\t\titem.setItem_discription(itemDetails.getItem_discription());\n\t\titem.setCategory(itemDetails.getCategory());\n\t\titem.setPrice(itemDetails.getPrice());\n\t\t\n\t\tItem upItem = itemDAO.save(item);\n\t\t\n\t\treturn ResponseEntity.ok().body(upItem);\n\t\t\n\t}", "public void updateProductByRest(long id, HttpServletRequest request) {\n // set URL\n String url = String.format(\"%s://%s:%d/products/\" + id, request.getScheme(), request.getServerName(), request.getServerPort());\n // execute rest api update product request using RestTemplate.put method\n HttpEntity<Product> entity = getHttpEntity(request);\n RestTemplate restTemplate = new RestTemplate();\n restTemplate.put(url, entity, id);\n }", "@Headers({\n \"Content-Type:application/json\"\n })\n @PUT(\"users/{id}\")\n Call<Void> updateUser(\n @retrofit2.http.Path(\"id\") String id, @retrofit2.http.Body UserResource userResource\n );", "@Test\n public void updateHouseholdUsingPutTest() throws ApiException {\n Object household = null;\n UUID householdId = null;\n Household response = api.updateHouseholdUsingPut(household, householdId);\n\n // TODO: test validations\n }", "public Book save(Book book) {\n return bookRepository.save(book);\n }", "public interface UpdateQuestionService {\n public static final String BASE_URL= \"https://private-anon-74261c4c7e-blissrecruitmentapi.apiary-mock.com/\";\n @PUT(\"questions/{id}\")\n Call<Question> updateQuestion(@Path(\"id\") int bookId, @Body Question question);\n\n}", "public static int doPut(String name, String id) {\n int status = 0;\n try {\n URL url = new URL(\"https://intense-lake-93564.herokuapp.com/menusection/\");\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n conn.setRequestMethod(\"PUT\");\n conn.setDoOutput(true);\n // make the request info as an json message\n JSONObject objJson = new JSONObject();\n JSONObject objJsonSend = new JSONObject();\n try {\n objJson.put(\"id\", id);\n objJson.put(\"name\", name);\n objJsonSend.put(\"name\", name);\n } catch (JSONException ex) {\n Logger.getLogger(RestaurantApiClient.class.getName()).log(Level.SEVERE, null, ex);\n }\n String ans = objJson.toString();\n System.out.println(\"Request Body:\");\n System.out.println(objJsonSend.toString());\n OutputStreamWriter out = new OutputStreamWriter(conn.getOutputStream());\n out.write(ans);\n out.close();\n // wait for response\n status = conn.getResponseCode();\n conn.disconnect(); \n }\n catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return status;\n }", "@PutMapping(\"/{id}\")\t\n\t@ApiOperation(value = \"Update reservation\", notes = \"Service to update a reservation\")\n\t@ApiResponses(value = {\n\t\t\t@ApiResponse(code = 201, message = \"Reservation updated\"),\n\t\t\t@ApiResponse(code = 404, message = \"Reservation not found\"),\n\t\t\t@ApiResponse(code = 400, message = \"Bad request\")\n\t})\n\tpublic ResponseEntity<?> update(@PathVariable(\"id\") int id, @RequestBody ReservationVO reservationVO){\n\t\tResponseEntity<?> response;\n\t\tReservation reservation = reservationService.get(id);\n\t\tif(reservation==null) {\n\t\t\tMap<String,String> errors = new HashMap<>();\n\t\t\terrors.put(\"Errors\", \"The reservation does not exist\");\n\t\t\tresponse = new ResponseEntity<>(errors,HttpStatus.NOT_FOUND);\n\t\t}else {\n\t\t\treservation.setReservation(reservationVO);\n\t\t\treservation = reservationService.update(reservation);\n\t\t\tReservationDTO reservationDTO = new ReservationDTO(reservation);\n\t\t\tresponse = new ResponseEntity<>(reservationDTO,HttpStatus.CREATED);\n\t\t}\n\t\treturn response;\n\t}", "@RequestMapping(method = RequestMethod.PUT, value = \"/courses/{code}\")\n\tpublic ResponseEntity<Course> updateCoursebyId(@RequestBody Course course, @PathVariable String code) throws SNotFoundException {\n\t\treturn courseService.updateCoursebyId(code, course);\n\t}", "@PostMapping\n\tpublic ResponseEntity<?> createBook(@Valid @RequestBody Book book, UriComponentsBuilder ucBuilder) {\n\t\tif (bookRepository.findByIsbn(book.getIsbn()).isPresent()) {\n\t\t\tthrow new BookIsbnAlreadyExistException(book.getIsbn()); \n\t\t}\n\t\tLOGGER.info(\"saving book\");\n\t\tbookRepository.save(book);\n\n\t\tHttpHeaders headers = new HttpHeaders();\n\t\t// uri templates & UCB to specify resource location\n\t\t/**\n\t\t * 2. We need to send where the new book resource can be located, so the client is\n\t\t * able to parse the header response and make a new request to retrieve the book's data.\n\t\t */\n\t\theaders.setLocation(ucBuilder.path(\"/api/books/{isbn}\").buildAndExpand(book.getIsbn()).toUri());\n\t\theaders.setContentType(MediaType.APPLICATION_JSON);\n\n\t\tLOGGER.info(\"setting headers and sending response\");\n\n\t\treturn new ResponseEntity<>(headers, HttpStatus.CREATED);\n\t}" ]
[ "0.76921725", "0.7468999", "0.72239935", "0.6882416", "0.6852522", "0.6528355", "0.641519", "0.6308572", "0.6287282", "0.62535423", "0.62022185", "0.61581105", "0.61060303", "0.608522", "0.6055129", "0.5879162", "0.5854981", "0.5825846", "0.5825846", "0.5781368", "0.57633686", "0.5762642", "0.5760985", "0.5757169", "0.5745149", "0.57383955", "0.5736131", "0.57326365", "0.57317007", "0.57197934", "0.57191986", "0.5717006", "0.5690574", "0.56628764", "0.5615366", "0.561176", "0.5584785", "0.55721134", "0.55560625", "0.55306834", "0.5529377", "0.5524725", "0.5522795", "0.54459727", "0.5439265", "0.5428074", "0.5409784", "0.5409521", "0.5397529", "0.53735644", "0.5363832", "0.5352438", "0.5340664", "0.53385466", "0.5336926", "0.5335842", "0.5334295", "0.5323438", "0.53136593", "0.5300929", "0.5290042", "0.52648306", "0.5263398", "0.52587533", "0.52587533", "0.525605", "0.52390057", "0.5236659", "0.5236659", "0.5234623", "0.5221953", "0.52214223", "0.52065194", "0.52054983", "0.52047765", "0.519755", "0.517556", "0.5168923", "0.51594114", "0.5158095", "0.5154414", "0.5152237", "0.5150732", "0.51461935", "0.5129488", "0.51280236", "0.5110647", "0.5109152", "0.5103317", "0.5099426", "0.50960463", "0.50943536", "0.50942343", "0.5093974", "0.5091229", "0.50911295", "0.5086403", "0.508528", "0.5084979", "0.50844514" ]
0.7391581
2
Rest request to get all the books in an array.
@GET @Produces(MediaType.APPLICATION_JSON) public Response getBooks() { return Response .status(Response.Status.OK) .entity(getBookService().getBooks()) .build(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@GetMapping(\"api/books\")\n public List<Book> getallBooks() {\n return bookService.all().getPayload();\n }", "List<Book> getAllBooks();", "@RequestMapping(value=\"/getbooks\", method=RequestMethod.GET, produces = \"application/json\")\n\tpublic List<Book> getAll() {\n\t\tList<Book> books = new ArrayList<>();\n\t\tbooks = bookDao.getAllFromDB();\n\t\t\n\t\treturn books;\n\t}", "Collection<Book> getAll();", "@RequestMapping(value=\"/book/all\",method=RequestMethod.GET)\n\t\t public @ResponseBody ResponseEntity<List<Books>> getAllBooks(){\n\t\t\t List<Books> books=(List<Books>) booksDAO.findAll();\n\t\t\t return new ResponseEntity<List<Books>>(books,HttpStatus.OK);\n\t\t }", "public List<Book> getAllBooks(){\n\t\treturn this.bRepo.findAll();\n\t}", "private void getBooks(){\n final ProgressDialog loading = ProgressDialog.show(this,\"Fetching Data\",\"Please wait...\",false,false);\n\n //Creating a rest adapter\n RestAdapter adapter = new RestAdapter.Builder()\n .setEndpoint(ROOT_URL)\n .build();\n\n //Creating an object of our api interface\n BooksAPI api = adapter.create(BooksAPI.class);\n\n //Defining the method\n api.getBooks(new Callback<List<Book>>() {\n @Override\n public void success(List<Book> list, Response response) {\n //Dismissing the loading progressbar\n loading.dismiss();\n Log.e(\"response\", response.getReason());\n //Storing the data in our list\n books = (ArrayList<Book>) list;\n lv.setAdapter(listAdapter);\n //Calling a method to show the list\n //showList();\n }\n\n @Override\n public void failure(RetrofitError error) {\n //you can handle the errors here\n Log.e(\"error\",error.getResponse().getReason());\n }\n });\n }", "public List<Book> getAll() {\n return bookFacade.findAll(); \n }", "public List<Book> allBooks() {\n return bookRepository.findAll();\n }", "public List<Book> getAllBooks() {\n return entityManager.createQuery(\"select b from Book b\", Book.class).getResultList();\n }", "@GetMapping\n\tpublic ResponseEntity<BookList> getBooks() throws Exception {\n\t\tBookList books = crawlerService.getBooksFromUrl();\t\t\n\t\treturn new ResponseEntity<BookList>(books, HttpStatus.OK);\n\t}", "@Override\r\n\tpublic List<Book> getBooks() {\n\t\treturn bd.findAll();\r\n\t}", "List<Book> findAll();", "@RequestMapping(value=\"/list\",method=RequestMethod.GET)\n\tpublic @ResponseBody\n\tList<Book> getBookList(){\n\t\tList<Book> bookList = null;\n\t\ttry{\n\t\t\tbookList = bookService.getBookList();\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println(\"bookList returned\");\n\t\tSystem.out.println(bookList);\n\t\treturn bookList;\n\t}", "@Override\n\tpublic List<Book> getAllBooks() {\n\t\treturn bookList;\n\t}", "public void getAllBook(){\n Call<Book> call = api.testBooks();\n call.enqueue(\n new Callback<Book>() {\n @Override\n public void onResponse(Call<Book> call, Response<Book> response) {\n Log.e(\"Test API\", \"on Response \"+response.body());\n Book book = response.body();\n Log.e(\"Test API\", \"on Response \"+book.getAuthor());\n Log.e(\"Test API\", \"on Response \"+book.getTitle());\n Log.e(\"Test API\", \"on Response \"+book.getLanguage());\n Log.e(\"Test API\", \"on Response \"+book.getDescription());\n view.onGetSuccess(book);\n }\n\n @Override\n public void onFailure(Call<Book> call, Throwable t) {\n Log.i(\"Test API\", \"on Failure \"+t.getLocalizedMessage());\n }\n }\n );\n }", "public void listBooks() {\n for (int g = 0; g < books.length; g++) {\n books[g].toString();\n }\n// List all books in Bookstore\n }", "Collection<Book> readAll();", "public java.util.List<com.huqiwen.demo.book.model.Books> findAll()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "public List<Book> findAll() {\n return bookRepository.findAll();\n }", "public Books getBooks(String title,String authors,String isbn,String publisher);", "@Override\n public List<BookDto> getAllBooks() {\n try {\n List<BookEntity> bookEntityArrayList = bookRepository.findAll();\n if (bookEntityArrayList.isEmpty()) {\n LogUtils.getInfoLogger().info(\"No Books found\");\n return null;\n } else {\n List<BookDto> bookDtoArrayList = bookEntityArrayList.stream()\n .map(bookEntity ->\n bookDtoBookEntityMapper.bookEntityToBookDto(bookEntity))\n .collect(Collectors.toList());\n LogUtils.getInfoLogger().info(\"Books Found: {}\", bookDtoArrayList.toString());\n return bookDtoArrayList;\n }\n }catch (Exception exception){\n throw new BookException(exception.getMessage());\n }\n }", "public List<Books> showAllBooks(){\n String sql=\"select * from Book\";\n BaseDao baseDao=dao.executeQuery(sql,new Object[]{});\n List<Books> list=new ArrayList<>();\n list=resultSetToBook(baseDao);\n return list;\n }", "public Books[] getBooks() {\n return books;\n }", "List<Book> getBooksByAuthorId(Integer authorId);", "@SuppressWarnings(\"unchecked\")\n\tpublic List<Book> getAllBook() {\n\t\treturn entityManager.createQuery(\"from Book\").getResultList();\n\t}", "@GetMapping(\"/bookworm/showAllAuthors\")\n public ResponseEntity<List> showAllAuthors() {\n\n log.debug(\"Showing all the Authors whose books are present in library\");\n return ResponseEntity.ok(authorService.getAuthor());\n }", "public Book[] getRecommendBook(){\n\t\n\t String stmnt = String.format(\n \"SELECT * FROM book \" );\n ResultSet rs = executeQuery(stmnt);\n ArrayList<Book> arr = resultSetPacker(rs, Book.class);\n\n return arr.toArray(new Book[arr.size()]);\n}", "public ArrayList<Book> getListBook();", "@Override\n public List<Book> result(List<Book> books) {\n return search.result(books);\n }", "public List<Book> getBooks() {\n return books;\n }", "public List<Book> findAll() {\n\t\treturn bookDao.findAll();\r\n\t}", "@GET(Url.END_POINT)\n Call<ArrayList<Recipe>> getRecipes();", "public List<Book> fetchAllBooks() {\n\t\treturn null;\n\t}", "public interface BookService {\n\n @GET(\"books.json\")\n Call<List<Book>> getBooks();\n\n}", "@Override\n\tpublic List<Book> findAll() {\n\t\treturn dao.findAll();\n\t}", "public List<Book> listBooks() {\n\t\tArrayList<Book> books = new ArrayList<>();\n\t\ttry (Connection con = LibraryConnection.getConnection()) {\n\t\t\tPreparedStatement stmt = con.prepareStatement(\"SELECT * FROM book\");\n\n\t\t\tResultSet rs = stmt.executeQuery();\n\t\t\twhile (rs.next()) {\n\t\t\t\tbooks.add(new Book(rs.getString(\"isbn\"), rs.getString(\"title\")));\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn books;\n\t}", "public Book[] getRecommendBooks()\n {\n String stmnt = String.format(\n \"SELECT * FROM book LIMIT %d \",\n PAGE_LIMIT);\n ResultSet rs = executeQuery(stmnt);\n ArrayList<Book> arr = resultSetPacker(rs, Book.class);\n\n return arr.toArray(new Book[arr.size()]);\n\n }", "@Override\n\tpublic List<BookVO> etcListCall() {\n\t\tList<BookVO> bookList =bookDAO.etcListCall();\n\t\t\n\t\treturn bookList;\n\t}", "@GetMapping\n public List<Author> getAllAuthors(){\n return authorService.getAllAuthors();\n }", "public void searchForBooks(String query) {\n\n\n BooksAPI booksAPI = ServiceGenerator.getBooksAPI();\n Call<GBookList> call = booksAPI.getBook(query);\n call.enqueue(new Callback<GBookList>() {\n @EverythingIsNonNull\n @Override\n public void onResponse(Call<GBookList> call, Response<GBookList> response) {\n if (response.isSuccessful()) {\n //response.body() returns GBookList\n //from json format to object\n searchedBooks.setValue(response.body());\n\n }\n }\n @EverythingIsNonNull\n @Override\n public void onFailure(Call<GBookList> call, Throwable t) {\n Log.i(\"Retrofit \", \"Retrieving from google.books.com failed\");\n }\n });\n }", "List<Book> findBooksByName(String name);", "@GetMapping(\"/books\")\n public String list(Model model){\n model.addAttribute(\"book\", bookService.findAllBooks());\n return \"books\";\n }", "@Override\n\tpublic List<BookRequestVO> bookList(String bookName) {\n\t\treturn bookStorePersistDao.bookList(bookName);\n\t}", "private void getBooks(){\n String ROOT_URL =\"http://projects.yogeemedia.com/preview/embassy\";\n\n //Creating a rest adapter\n RestAdapter adapter = new RestAdapter.Builder()\n .setEndpoint(ROOT_URL)\n .build();\n\n //Creating an object of our api interface\n Interface api = adapter.create(Interface.class);\n\n //Defining the method\n api.getBooks( new Callback<Response>() {\n @Override\n public void success(Response detailsResponse, Response response2) {\n\n String detailsString = getStringFromRetrofitResponse(detailsResponse);\n\n try {\n JSONObject object = new JSONObject(detailsString);\n\n Log.e(\"List\", String.valueOf(object.getJSONArray(\"contacts\")));\n\n writeToFile(object);\n\n //In here you can check if the \"details\" key returns a JSONArray or a String\n\n } catch (JSONException e) {\n\n }\n\n }\n\n @Override\n public void failure(RetrofitError error) {\n Log.e(\"List\",error.toString());\n\n }});}", "@GET\n public List<TrayectoDetail> darTrayectos() {\n \n List<TrayectoDetail> listaTrayecto = listEntity2DetailDTO(trayectoLogic.getTrayectos());\n LOGGER.log(Level.INFO, \"BookResource getBooks: output: {0}\", listaTrayecto);\n return listaTrayecto;\n }", "@Override\n\tpublic List<ShoppingCart> getAllBook() {\n\t\treturn dao.findAll();\n\t}", "public List<Book> getAllBooks()\n {\n List<Book> books = new LinkedList<Book>();\n\n //1. Query para la consulta\n String query = \"Select * FROM \"+ BookReaderContract.FeedBook.TABLE_NAME;\n\n //2. Obtener la referencia a la DB\n SQLiteDatabase db = this.getWritableDatabase();\n Cursor cursor = db.rawQuery(query, null);\n\n //3. Recorrer el resultado y crear un objeto Book\n Book book = null;\n if(cursor.moveToFirst()){\n do{\n book = new Book();\n book.setId(Integer.parseInt(cursor.getString(0)));\n book.setTitle(cursor.getString(1));\n book.setAuthor(cursor.getString(2));\n books.add(book);\n }while(cursor.moveToNext());\n }\n Log.d(\"getAllBooks\",books.toString());\n return books;\n }", "public Ebook[] getAll() {\n return ebooks;\n }", "public List<Book> findAll()\r\n\t{\r\n\t\tList<Book> booklist= null;\r\n\t\ttry\r\n\t\t{\r\n\t\t\tbookdao.openCurrentSession();\r\n\t\t booklist=bookdao.findAll();\r\n\t\t\tbookdao.closeCurrentSession();\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 booklist;\r\n\t}", "public static Collection<BookReview> getALL() {\n }", "public Collection<Book> getBooks() {\n return books;\n }", "public Addressbook[] getAddressbooks() throws RemoteException;", "public LiveData<List<BookModel>> getAllFavoriteBooksFromAPI(List<BookTable> bookIds) {\n List<BookModel> finalFavoriteBooksList = new ArrayList<>();\n\n for (BookTable favBook : bookIds) {\n Call<BookModel> call = booksApi.getBookByID(\"v1/volumes/\" + favBook.getBookID());\n\n call.enqueue(new Callback<BookModel>() {\n @Override\n public void onResponse(Call<BookModel> call, Response<BookModel> response) {\n if (!response.isSuccessful()) {\n return;\n }\n finalFavoriteBooksList.add(new BookModel(response.body().getId(),\n response.body().getBookInfo(),\n response.body().getBookSaleInfo()));\n\n favoriteBooks.postValue(finalFavoriteBooksList);\n }\n\n @Override\n public void onFailure(Call<BookModel> call, Throwable t) {\n }\n });\n\n }\n\n return favoriteBooks;\n }", "@Override\r\n\tpublic List<BookDto> getBookList(String storename) {\n\t\tList<BookDto> blist = sqlSession.selectList(ns + \"getBookList\", storename);\t\t\r\n\t\treturn blist;\r\n\t}", "@GetMapping(value = \"/{username}/books\")\n public Iterable<Book> listBooksInLibrary(@PathVariable String username,\n @RequestParam(required = false) String author,\n @RequestParam(required = false) String status) {\n\n UserBookStatus userBookStatus = StringUtils.isEmpty(status) ? null : UserBookStatus.valueOf(status.toUpperCase());\n List<UserBook> userBooks = userService.listBooks(username, author, userBookStatus);\n\n return userBooks.stream().map(userBookToBook).collect(Collectors.toList());\n }", "public List<Book> getBooks() {\r\n\t\treturn books;\r\n\t}", "@GET\n\t@Path(\"listado/{codigo}\") //ruta -> metodo que al que llama\n\t@Produces(\"application/json\") \n\tpublic String buscar(@PathParam(\"codigo\") String isbn) {\n\t\tLibro libro = negocio.consultarISBN(isbn);\n\t\tJSONObject json = new JSONObject(libro);\n\t\treturn json.toString();\n\t}", "public List<Book> getByAuthor(String name );", "@GET\r\n @Produces({MediaType.APPLICATION_XML})\r\n public Set<Document> findAll() throws InternalServerErrorException{\r\n LOGGER.info(\"Peticion de todos los documentos\");\r\n Set<Document> collection = null;\r\n try {\r\n collection = ejb.getDocumentList();\r\n } catch (GetCollectionException ex) {\r\n LOGGER.warning(\"ERROR en la obtencion de la lista de documentos\");\r\n throw new InternalServerErrorException();\r\n }\r\n LOGGER.info(\"Respuesta de obtencion de lista de documentos\");\r\n return collection;\r\n }", "public List<PrintableBook> PerformSearch_google(String[] kw, int N){\n\t\t// build the JAX-RS client object \n\t\tClient client = ClientBuilder.newClient();\n\t\tint res_cont = 0;\t// initialize number of already processed results\n\t\tint tot_res = 1;\t// initialize total number of results so that it is greater than the number of already processed results\n\t\t// build the web target\n\t\tWebTarget target = client.target(getBaseURI_google()).path(\"volumes\");\n\t\t// create empty list of PrintableBook\n\t\tList<PrintableBook> pbooks = new ArrayList<PrintableBook>();\n\t\t// prepare query string\n\t\tStringBuffer queryString = new StringBuffer(kw[0]);\n\t\tfor (int i=1; i<kw.length; i++) {\n\t\t\tqueryString.append(' ');\n\t\t\tqueryString.append(kw[i]);\n\t\t}\n\t\tint offset;\t\t// declare variable used to store offset\n\t\t// main loop on pages\n\t\tfor(int page=0; pbooks.size()<N && res_cont<tot_res; page++){\n\t\t\toffset = page*20;\n\t\t\tSystem.out.println(\"Searching \"+queryString+\" on Google books with offset \"+offset);\n\t\t\ttry {\n\t\t\t\t// perform a get request using mediaType=APPLICATION_JSON\n\t\t\t\t// and convert the response into a SearchResult object\n\t\t\t\tit.polito.dp2.rest.gbooks.client.jaxb.SearchResult result = target\n\t\t\t\t\t\t\t\t\t .queryParam(\"q\", queryString)\t\n\t\t\t\t\t\t\t\t\t .queryParam(\"printType\", \"books\")\n\t\t\t\t\t\t\t\t\t .queryParam(\"maxResults\", 20)\n\t\t\t\t\t\t\t\t\t .queryParam(\"startIndex\", offset)\n\t\t\t\t\t\t\t\t\t .request()\n\t\t\t\t\t\t\t\t\t .accept(MediaType.APPLICATION_JSON)\n\t\t\t\t\t\t\t\t\t .get(it.polito.dp2.rest.gbooks.client.jaxb.SearchResult.class);\n\t\t\t\ttot_res = result.getTotalItems().intValue();\n\t\t\t\tSystem.out.println(\"OK Response received. Total number of Items:\"+tot_res);\n\t\t\t\tSystem.out.println(\"Validating items and converting validated items to xml.\");\n\t\t\t\tfor (it.polito.dp2.rest.gbooks.client.jaxb.Items item:result.getItems()) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// validate item\n\t\t\t\t \tJAXBSource source = new JAXBSource(jc_gbooks, item);\n\t\t\t\t \tSystem.out.println(\"Validating \"+item.getSelfLink());\n\t\t\t\t \tvalidator_gbooks.validate(source);\n\t\t\t\t \tSystem.out.println(\"Validation OK\");\n\t\t\t\t \t// add item to list\n\t\t\t\t\t\tSystem.out.println(\"Adding item to list\");\n\t\t\t\t\t\tPrintableItem pi = Factory.createPrintableItem(BigInteger.valueOf(idCounter.getNextId()),item.getVolumeInfo());\t\t\t\t\n\t\t\t\t\t\tif(pi instanceof PrintableBook){\n\t\t\t\t\t\t\tpbooks.add((PrintableBook)pi);\n\t\t\t\t\t\t\tif(pbooks.size()==N) break;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (org.xml.sax.SAXException se) {\n\t\t\t\t\t System.out.println(\"Validation Failed\");\n\t\t\t\t\t // print error messages\n\t\t\t\t\t Throwable t = se;\n\t\t\t\t\t while (t!=null) {\n\t\t\t\t\t\t String message = t.getMessage();\n\t\t\t\t\t\t if (message!= null)\n\t\t\t\t\t\t \t System.out.println(message);\n\t\t\t\t\t\t t = t.getCause();\n\t\t\t\t\t }\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tSystem.out.println(\"Unexpected I/O Exception\");\n\t\t\t\t\t} catch (JAXBException e) {\n\t\t\t\t\t\tSystem.out.println(\"Unexpected JAXB Exception\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tres_cont = res_cont + 20;\n\t\t\t} catch(WebApplicationException e) {\n\t\t\t\tSystem.err.println(\"Error in remote operation: \"+e.getMessage());\n\t\t\t\treturn null;\t\n\t\t\t}\n\t\t}\n\t System.out.println(\"Number of validated Bibliography books from gbooks: \"+pbooks.size());\n\t return pbooks;\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic Collection<Book> findAll() {\n\t\treturn entityManager.createQuery(\"SELECT b FROM Book b\").getResultList();\n\t}", "@Override\n\tpublic QueryResult<BookType> list(String start, String limit, String[] ands) {\n\t\treturn list(start, limit, ands, null, null);\n\t}", "public Medium[] getBooks() {\n Session session = getSessionFactory().openSession();\n session.beginTransaction();\n List<Book> bookList = session.createQuery(\"from Book\", Book.class).list();\n session.getTransaction().commit();\n session.close();\n return bookList.toArray(new Medium[bookList.size()]);\n }", "public ArrayList<Book> getBooks()\n {\n ArrayList<Book> books = new ArrayList<>();\n String sql = \"SELECT [book_id]\\n\" +\n \" ,[book_title]\\n \" +\n \" ,[book_author]\\n\" +\n \" ,[book_publish_year]\\n\" +\n \" ,[book_category]\\n\" +\n \" ,[book_keyword]\\n\" +\n \" ,[book_status]\\n \" +\n \" FROM [lib_book_master]\";\n try {\n PreparedStatement statement = connection.prepareStatement(sql);\n ResultSet rs = statement.executeQuery();\n //cursor\n while(rs.next()) \n { \n int book_id = rs.getInt(\"book_id\");\n String book_title = rs.getString(\"book_title\");\n String book_author = rs.getString(\"book_author\");\n String book_publish_year = rs.getString(\"book_publish_year\");\n String book_category = rs.getString(\"book_category\");\n String book_keyword = rs.getString(\"book_keyword\");\n String book_status = rs.getString(\"book_status\");\n \n Book s = new Book(book_id,book_title, book_author, book_publish_year,book_category,book_keyword,book_status);\n books.add(s);\n }\n \n } catch (SQLException ex) {\n Logger.getLogger(DBContext.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n return books;\n }", "@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)\n public ResponseEntity<List<BirdIdProjection>> getAllBirds(){\n logger.trace(\"Find all Birds invoked.\");\n List<BirdIdProjection> birds = birdService.fetchAllVisibleBirds();\n logger.trace(\"find all birds completed succesfully\");\n return ResponseEntity.status(HttpStatus.OK).body(birds);\n }", "public List<Books> findBooksByTitle(String title) {\r\n return bookController.findBooksByTitle(title);\r\n }", "public @ResponseBody List<Contract> getAllContract();", "@RequestMapping(value = \"/list\", method= RequestMethod.GET) \n public String getAllBuku(Model model){\n model.addAttribute(\"books\", this.bukuService.getAll());\n return \"buku\"; \n }", "@GET\n @Produces(APPLICATION_JSON)\n @ApiOperation(value = \"Find all authors\", response = CategoryDTO.class, responseContainer = \"List\")\n @ApiResponses(value = {\n @ApiResponse(code = 200, message = \"All categories found\"),\n @ApiResponse(code = 404, message = \"Categories not found\")}\n )\n public Response getAllCategories() {\n log.debug(\"REST request to get all Categories\");\n List<CategoryDTO> result = categoryService.findAll();\n return ok(result).build();\n }", "public Iterator getBooks() {\r\n return books.iterator();\r\n }", "@GET\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response list() {\n\t\t//System.out.println(\"================================= public Response list()\");\n\t\tIterable<Student> students = this.studentService.findAll();\n\t\tif (students != null) {\n\t\t\tList<StudentModelBasic> sbmList = new ArrayList<>();\n\t\t\tfor (Student s : students) {\n\t\t\t\tsbmList.add(this.studentService.convertToModelBasic(s));\n\t\t\t}\n\t\t\t//System.out.println(students.toString());\n\t\t\treturn Response.ok(sbmList).build();\n\t\t} else {\n\t\t\treturn Response.status(Status.NOT_FOUND).build();\n\t\t}\n\t}", "public interface BookService {\n\n List<Book> getAll();\n\n}", "public List<Cosa> findAllBooks() {\r\n\t\tList<Cosa> cosas = (List<Cosa>) jdbcTemplate.query(\r\n\t\t\t\t\"select * from persone\", new CosaRowMapper());\r\n\t\treturn cosas;\r\n\t}", "public List<BookData> getAllBooks() throws Exception{\n\t\tList<BookData> list = new ArrayList<>();\n\t\tStatement myStmt = null;\n\t\tResultSet myRs = null;\n\t\t\n\t\ttry {\n\t\t\tmyStmt = myConn.createStatement();\n\t\t\tmyRs = myStmt.executeQuery(\"select title, author_name, publisher_name, book_id from books natural join book_authors\");\n\t\t\t\n\t\t\twhile (myRs.next()) {\n\t\t\t\tBookData tempbook = convertRowToBook(myRs);\n\t\t\t\tlist.add(tempbook);\n\t\t\t}\n\t\t\t\n\t\t\treturn list;\n\t\t}\n\t\tfinally {\n\t\t\tmyRs.close();\n\t\t\tmyStmt.close();\n\t\t\t\n\t\t}\n\t\t\n\t}", "@Override\n\tpublic List<BookInfoVO> findAll() {\n\t\treturn bookInfoDao.findAll();\n\t}", "@GetMapping(\"/api/obd\")\n public List<Obd> readAll() {\n return obdRepository.findAll();\n }", "public ArrayList<Book> getAllBooksArray(){\n ArrayList<Book> booksArray = new ArrayList<>();\n\n Connection con = null;\n Statement stmt = null;\n ResultSet rs = null;\n\n try{\n Class.forName(\"org.sqlite.JDBC\");\n con = DriverManager.getConnection(\"jdbc:sqlite:Library.db\");\n stmt = con.createStatement();\n String sql = \"SELECT * FROM BOOKS\";\n rs = stmt.executeQuery(sql);\n while(rs.next()){\n Book book = new Book(rs.getString(\"TITLE\"), rs.getString(\"AUTHOR\"), rs.getString(\"ILLUSTRATOR\"), rs.getString(\"ISBN\"), rs.getString(\"DECIMAL\"),\n rs.getString(\"DESCRIPTION\"), rs.getString(\"GENRE\"), rs.getBoolean(\"NON_FICTION\"));\n String tags = rs.getString(\"TAGS\");\n book.setID(rs.getInt(\"ID\"));\n book.deserializeTags(tags);\n booksArray.add(book);\n }\n rs.close();\n stmt.close();\n con.close();\n }catch(SQLException | ClassNotFoundException e){\n e.printStackTrace();\n }\n return booksArray;\n }", "@GET(\"list_movies.json\")\n Call<MoviesResponse> getMoviesList(\n @Query(\"genre\") String genre,\n @Query(\"sort_by\") String sortBy,\n @Query(\"page\") int page);", "public ArrayList<Book> getBooks() {\n return bookList;\n }", "@GET\n @Produces(APPLICATION_JSON)\n @ApiOperation(value = \"Find all authors\", response = PublisherDTO.class, responseContainer = \"List\")\n @ApiResponses(value = {\n @ApiResponse(code = 200, message = \"All publishers found\"),\n @ApiResponse(code = 404, message = \"Publishers not found\")}\n )\n public Response getAllPublishers() {\n log.debug(\"REST request to get all Publishers\");\n List<PublisherDTO> result = publisherService.findAll();\n return ok(result).build();\n }", "public List<ReadBookVO> getReadBookList() {\n\t\t\n\t\tList<ReadBookVO> readBookList = readBookDao.selectAll();\n\t\t\n\t\t\n\t\treturn readBookList;\n\t}", "public void getAllBibles(VolleyCallback callback){\n String url = url_base + \"/v1/bibles\";\n getResponse(url, callback);\n }", "@GET\r\n\t@Path(\"/all\")\r\n\t@Produces(\"application/json\")\r\n\tpublic JsonArray getAllItems(){\r\n\t\t \tConnection database = DBConnecter.getConnection();\r\n\t\t Statement stat = null;\r\n\t\t ResultSet rs = null;\r\n\t\t\ttry {\r\n\t\t\t\tstat = database.createStatement();\r\n\t\t\t\tString sqlQueryString = \"select * from item;\";\r\n\t\t\t\trs = stat.executeQuery(sqlQueryString);\r\n\t\t\t\tstat.executeQuery(sqlQueryString);\r\n\t\t\t\twhile(rs.next()){\r\n\t\t\t\t\tItem itemNew = new Item(\r\n\t\t \t\trs.getInt(idTagString),\r\n\t\t \t\trs.getInt(binNumString),\r\n\t\t \t\trs.getString(departmentString),\r\n\t\t \t\trs.getString(descriptionString),\r\n\t\t \t\trs.getFloat(replacementCostString),\r\n\t\t \t\trs.getFloat(priceString),\r\n\t\t \t\trs.getString(dimensionsString),\r\n\t\t \t\trs.getInt(lengthString),\r\n\t\t \t\trs.getFloat(weightString),\r\n\t\t \t\trs.getString(modelNumberString),\r\n\t\t \t\trs.getInt(purchaseDateString),\r\n\t\t \t\trs.getInt(warrantyEndDateString),\r\n\t\t \t\trs.getString(categoryString)\r\n\t\t \t\t);\r\n\t\t items.add(itemNew);\r\n\t\t\t\t}\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}finally{\r\n\t\t\t\ttry {\r\n\t\t\t\t\trs.close();\r\n\t\t\t\t\tstat.close();\r\n\t\t\t\t\tdatabase.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t \r\n\t\t\t}\r\n\t\t\treturn getListAsJson(items);\r\n\t}", "@GetMapping(\"/listAll\")\n\tpublic ResponseEntity<?> findAll(){\n\t\treturn new ResponseEntity<>(catService.listAll(),HttpStatus.OK);\n\t}", "public static List<Book> retrieveAll( EntityManager em) {\n TypedQuery<Book> query = em.createQuery( \"SELECT b FROM Book b\", Book.class);\n List<Book> books = query.getResultList();\n System.out.println( \"Book.retrieveAll: \" + books.size()\n + \" books were loaded from DB.\");\n return books;\n }", "public List<Book> getBooks() {\r\n \t\t// switch dates\r\n \t\tif (filter_dateFrom.compareTo(filter_dateTo) > 0) {\r\n \t\t\tCalendar tmp = filter_dateFrom;\r\n \t\t\tfilter_dateFrom = filter_dateTo;\r\n \t\t\tfilter_dateTo = tmp;\r\n \t\t}\r\n \r\n \t\tDate yearFrom = filter_dateFrom.getTime();\r\n \t\tDate yearTo = filter_dateTo.getTime();\r\n \r\n \t\t// genre\r\n \t\tGenre genre = null;\r\n \t\tif (!filter_genre.isEmpty() && !filter_genre.equalsIgnoreCase(\"all\")) {\r\n \t\t\tgenre = genreMgr.findByName(filter_genre);\r\n \t\t\tif (genre == null) {\r\n \t\t\t\tSystem.err.println(\"Badly working database encoding!\");\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\treturn bookMgr.find(filter_name, filter_author, yearFrom, yearTo, genre, filter_isbn_issn);\r\n \t}", "@RequestLine(\"GET /show\")\n List<Bucket> getAllEmployeesList();", "@GetMapping(\"/book/{id}\")\n public ResponseEntity<Book> get(@PathVariable(\"id\") String id) {\n Book result = bookService.get(id);\n return ResponseEntity.ok().body(result);\n }", "@RequestMapping(value=\"/books/isActive/{isActive}\",method=RequestMethod.GET)\n\t\t\tpublic @ResponseBody ResponseEntity<List<Books>> getAllIsActiveBooks(@PathVariable boolean isActive)throws Exception{\n\t\t\t\tList<Books> book=null;\n\t\t\t\tbook=booksDAO.findByIsActive(isActive);\t\t\t\t\n\t\t\t\t\treturn new ResponseEntity<List<Books>>(book,HttpStatus.OK);\n\t\t\t}", "public interface Api {\n @GET(\"v2/book/search\")\n Observable<BaseApi<List<Book>>> searchBook(@Query(\"q\") String bookName);\n}", "@GET\n @Path(\"{isbn}\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response getBook(@PathParam(\"isbn\") String isbn) {\n final Book book = getBookService().getBook(isbn);\n return Response\n .status(book == null ? Response.Status.BAD_REQUEST : Response.Status.OK)\n .entity(book == null ? new JSONObject()\n .put(\"Status\", Response.Status.BAD_REQUEST.getStatusCode())\n .put(\"Message\", \"No book with given isbn found.\").toString()\n : book\n ).build();\n }", "@Override\n public List<Book> findBooks(SelectRequest selectRequest)\n throws DaoException {\n List<Book> foundBooks = new ArrayList<>();\n DataBaseHelper helper = new DataBaseHelper();\n try (Connection connection = SqlConnector.connect();\n PreparedStatement statement = helper\n .prepareStatementFind(connection, selectRequest);\n ResultSet resultSet = statement.executeQuery()) {\n while (resultSet.next()) {\n BookCreator bookCreator = new BookCreator();\n Book book = bookCreator.create(resultSet);\n foundBooks.add(book);\n }\n } catch (SQLException e) {\n throw new DaoException(\"Error while reading database!\", e);\n }\n return foundBooks;\n }", "@RequestMapping(value=\"/api/books/{id}\", method=RequestMethod.GET)\n public Book get(@PathVariable(\"id\") Long id) {\n return this.bookService.findBook(id);\n }", "@RequestMapping(value=\"/purchase/all\",method=RequestMethod.GET)\n\t\t public @ResponseBody ResponseEntity<List<Purchases>> getAllPurchases(){\n\t\t\t List<Purchases> purchase=(List<Purchases>) purchaseDAO.findAll();\n\t\t\t Books books=null;\n\t\t\t User user=null;\n\t\t\t for(Purchases purch : purchase) {\n\t\t\t\t books=booksDAO.findOne(purch.getIsbn());\n\t\t\t\t purch.setBook(books);\n\t\t\t\t user=userDAO.findOne(purch.getUserId());\n\t\t\t\t purch.setUser(user);\n\t\t\t }\n\t\t\t return new ResponseEntity<List<Purchases>>(purchase, HttpStatus.OK);\n\t\t }", "public static Result readAll() {\n List<Thing> things = Thing.find.all();\n JsonNode json = mapper.valueToTree(things);\n return ok(json);\n }", "@GetMapping(\"/all\")\n List<Seller> findAllSeller(){\n return sellerService.findAllSeller();\n }", "public List<Book> getBooksToReturn() {\n\t\treturn booksToReturn;\n\t}", "@Test\n public void testFindAll() {\n final WebTarget target = target().\n path(\"category\");\n\n Response response = target.request(MediaType.APPLICATION_JSON_TYPE).get();\n\n assertEquals(200, response.getStatus());\n List<Category> categories = response.readEntity(new GenericType<List<Category>>() {});\n assertTrue(categories.size() > 0);\n \n response = target.request(MediaType.APPLICATION_XML_TYPE).get();\n assertEquals(200, response.getStatus());\n }", "@RequestMapping(value = \"/liburall\",method = RequestMethod.GET)\n\t public List<Libur> liburList(){\n\t return liburService.getAllLibur();\n\t }" ]
[ "0.78511685", "0.7491718", "0.7338897", "0.72515464", "0.7024936", "0.6802204", "0.6758367", "0.67450833", "0.6701458", "0.6675645", "0.66674817", "0.66519284", "0.6604192", "0.6585337", "0.6545055", "0.654194", "0.650756", "0.6476744", "0.6445163", "0.643056", "0.6423219", "0.63790625", "0.63309276", "0.6274974", "0.6261993", "0.62534994", "0.61993074", "0.61965394", "0.6180582", "0.61302185", "0.6101619", "0.60922486", "0.60710216", "0.60627896", "0.6027383", "0.60235614", "0.60218894", "0.6021138", "0.59996724", "0.59900177", "0.59897435", "0.59872836", "0.5953416", "0.59180176", "0.5913177", "0.5905947", "0.5897842", "0.5892546", "0.58793575", "0.5878029", "0.587739", "0.58762693", "0.58652353", "0.58558375", "0.5848107", "0.5844494", "0.57811826", "0.57695556", "0.57651156", "0.57646817", "0.5760346", "0.57341516", "0.57254857", "0.57066983", "0.56963915", "0.5690992", "0.5683364", "0.56716126", "0.5660963", "0.56604606", "0.5645349", "0.56362575", "0.56306523", "0.56259686", "0.56112325", "0.56112254", "0.55908585", "0.558293", "0.55816525", "0.5575696", "0.5569717", "0.5558533", "0.5557722", "0.5555777", "0.55369896", "0.55279267", "0.5521223", "0.55108696", "0.5488708", "0.5487226", "0.54829246", "0.5478995", "0.54744256", "0.54579955", "0.5454493", "0.54508555", "0.5442306", "0.5440763", "0.5438856", "0.54332066" ]
0.7121085
4
Rest request to get a book by its isbn.
@GET @Path("{isbn}") @Produces(MediaType.APPLICATION_JSON) public Response getBook(@PathParam("isbn") String isbn) { final Book book = getBookService().getBook(isbn); return Response .status(book == null ? Response.Status.BAD_REQUEST : Response.Status.OK) .entity(book == null ? new JSONObject() .put("Status", Response.Status.BAD_REQUEST.getStatusCode()) .put("Message", "No book with given isbn found.").toString() : book ).build(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@RequestMapping(value=\"/book/{isbn}\",method=RequestMethod.GET)\n\tpublic @ResponseBody ResponseEntity<Books> getOneBookDetails(@PathVariable Long isbn)throws Exception{\n\t\tBooks book=null;\n\t\t\n\t\t\tbook=booksDAO.findOne(isbn);\n\t\t\tif(book!=null)\n\t\t\t\treturn new ResponseEntity<Books>(book, HttpStatus.OK);\n\t\t\telse {\n\t\t\t\treturn new ResponseEntity<Books>(HttpStatus.NOT_FOUND);\n\t\t\t}\n\t}", "@GET\n\t@Path(\"listado/{codigo}\") //ruta -> metodo que al que llama\n\t@Produces(\"application/json\") \n\tpublic String buscar(@PathParam(\"codigo\") String isbn) {\n\t\tLibro libro = negocio.consultarISBN(isbn);\n\t\tJSONObject json = new JSONObject(libro);\n\t\treturn json.toString();\n\t}", "public String isbnRequest(final String query) {\n try {\n String url = getApiUrl(\"isbn:\");\n return url + URLEncoder.encode(query, \"utf-8\") + \"&Key=\" + ACCESS_KEY;\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n return null;\n }\n }", "public Books getBooks(String title,String authors,String isbn,String publisher);", "public void findByIsbn(String isbn) {\n\t\tResultSet rs;\n\t\ttry (PreparedStatement stmt = LibraryConnection.getConnection()\n\t\t\t\t.prepareStatement(\"SELECT * FROM book WHERE isbn=?\")) {\n\t\t\tstmt.setString(1, isbn);\n\t\t\trs = stmt.executeQuery();\n\t\t\tif (rs.next()) {\n\t\t\t\t//\n\t\t\t}\n\t\t\t// TODO Auto-generated catch block\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@RequestMapping(value=\"/api/books/{id}\", method=RequestMethod.GET)\n public Book get(@PathVariable(\"id\") Long id) {\n return this.bookService.findBook(id);\n }", "public Book fetchBookByISBN(String isbn) {\n\t\treturn null;\n\t}", "@GET\n @Path(\"/id/{id}\")\n public Book findById(@PathParam(\"id\") long id) {\n return new Book();\n }", "@GetMapping(\"/book/{id}\")\n public ResponseEntity<Book> get(@PathVariable(\"id\") String id) {\n Book result = bookService.get(id);\n return ResponseEntity.ok().body(result);\n }", "@PUT\n @Path(\"{isbn}\")\n @Consumes(MediaType.APPLICATION_JSON)\n public Response updateBook(@PathParam(\"isbn\") String isbn, Book book) {\n //isbn in uri differs from isbn in book object. I do that because updateBook only gets a book object,\n //there's no possibility to check in service for the local var isbn because the json defined isbn is given to\n //the service\n if (!book.getIsbn().equals(\"\") && !isbn.equals(book.getIsbn())) {\n return Response.status(Response.Status.BAD_REQUEST)\n .entity(new JSONObject().put(\"Message\", \"Isbn differs from isbn specified in payload.\").toString())\n .build();\n }\n //no isbn in request json body\n else if (book.getIsbn().equals(\"\")) {\n book = new Book(book.getTitle(), book.getAuthor(), isbn);\n }\n\n //find and replace book object\n final BookServiceResult result = bookService.updateBook(book);\n return Response.status(result.getStatus().getStatusCode())\n .entity(getJsonFromServiceResult(result))\n .build();\n }", "@GetMapping(\"/getById/{id}\")\n public Book getBookById(@PathVariable(\"id\") Long id) throws BookNotFoundException {\n return bookService.getBookById(id);\n }", "@GetMapping(\"/books/{id}\")\n public ResponseEntity<book> getBook(@PathVariable(\"id\") int id){\n book b = bs.getBookById(id);\n if(b == null){\n return ResponseEntity.status(HttpStatus.NOT_FOUND).build();\n }\n return ResponseEntity.of(Optional.of(b));\n }", "public static Book retrieve( EntityManager em, String isbn) {\n Book book = em.find( Book.class, isbn);\n if ( book != null) {\n System.out.println( \"Book.retrieve: loaded book \" + book);\n }\n return book;\n }", "public JSONObject getBookJSONObject(String bookTitle) throws BadRequestException {\n\n String apiUrlString = \"https://www.googleapis.com/books/v1/volumes?q=intitle:\" + bookTitle + \"&filter:free-ebooks&printType:books\";\n try{\n HttpURLConnection connection = null;\n // Build Connection.\n try{\n URL url = new URL(apiUrlString);\n connection = (HttpURLConnection) url.openConnection();\n connection.setRequestMethod(\"GET\");\n connection.setReadTimeout(5000); // 5 seconds\n connection.setConnectTimeout(5000); // 5 seconds\n } catch (MalformedURLException e) {\n // Impossible: The only two URLs used in the app are taken from string resources.\n e.printStackTrace();\n } catch (ProtocolException e) {\n // Impossible: \"GET\" is a perfectly valid request method.\n e.printStackTrace();\n }\n int responseCode = connection.getResponseCode();\n if(responseCode != 200){\n connection.disconnect();\n throw new BadRequestException(\"GoogleBooksAPI request failed. Response Code: \" + responseCode);\n\n }\n\n // Read data from response.\n StringBuilder builder = new StringBuilder();\n BufferedReader responseReader = new BufferedReader(new InputStreamReader(connection.getInputStream()));\n String line = responseReader.readLine();\n while (line != null){\n builder.append(line);\n line = responseReader.readLine();\n System.out.println(line);\n }\n String responseString = builder.toString();\n JSONObject responseJson = new JSONObject(responseString);\n // Close connection and return response code.\n connection.disconnect();\n return responseJson;\n } catch (SocketTimeoutException e) {\n return null;\n } catch(IOException e){\n e.printStackTrace();\n return null;\n } catch (JSONException e) {\n e.printStackTrace();\n return null;\n }\n }", "Book getBookById(Integer id);", "public Listing getListingByIsbn(int id) throws SQLException;", "@RequestMapping(value = \"/book/{id}\", method = RequestMethod.GET)\r\n public ResponseEntity<Book> get(@PathVariable(\"id\") long id) throws Exception{\r\n Book book = bookService.getBookById(id);\r\n return ResponseEntity.ok().body(book);\r\n }", "public static Book getBook(int id) {\n ClientResponse clientResponse = HttpRequest.get(\"/book\" + id);\n Book book = null;\n\n if (clientResponse == null) {\n System.out.println(\"No sdk\");\n } else {\n String encryptedJson = clientResponse.getEntity(String.class);\n if (clientResponse.getStatus() == 200) {\n String decryptedJson = Cryptor.encryptDecryptXOR(encryptedJson);\n book = new Gson().fromJson(decryptedJson, Book.class);\n } else {\n System.out.println(\"Error\");\n }\n }\n clientResponse.close();\n return book;\n }", "List<Book> getBooksByAuthorId(Integer authorId);", "public Medium getBook(String isbn) {\n\n Session session = getSessionFactory().openSession();\n session.beginTransaction();\n Book book = null;\n try {\n book = session.createQuery(\"from Book where isbn = :isbn\", Book.class).setParameter(\"isbn\", isbn).getSingleResult();\n } catch (NoResultException nre) {\n // book is already null. so nothing to do\n }\n session.getTransaction().commit();\n session.close();\n\n return book;\n //return bookList.stream().filter(i -> ((Book) i).getIsbn().equals(isbn)).findFirst().orElse(null);\n }", "@GET(\"/books/{isbn}/commercialOffers\")\n Call<Offers> getBestOffers(@Path(\"isbn\") String param);", "Book getBookByTitle(String title);", "public String getBookIsbn() {\n return bookIsbn;\n }", "public interface ApiInterface {\n @GET(\"books/v1/volumes\")\n Call<JsonResponse> getBook(@Query(\"q\") String isbn, @Query(\"key\") String key );\n}", "@RequestMapping(value=\"/{bookId}\",method = RequestMethod.GET)\n\tpublic @ResponseBody\n\tBook getBook(@PathVariable(\"bookId\")Integer bookId){\n\t\tBook book = null;\n\t\ttry{\n\t\t\tSystem.out.println(\"entering into try\");\n\t\t\tbook = bookService.getBookById(bookId);\n\t\t\tSystem.out.println(\"got book by id\");\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println(\"book returned\");\n\t\tSystem.out.println(book.getBookName());\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tStringWriter sw= new StringWriter();\n\t\ttry {\n\t\t\tSystem.out.println(\"1\");\n\t\t\tmapper.writeValue(sw, book);\n\t\t\tSystem.out.println(\"1.5\" + sw.toString());\n\t\t\tSystem.out.println(\"2\");\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn book;\n\t}", "BookDO selectByPrimaryKey(String bookIsbn);", "public String getIsbn() { return isbn; }", "public void listBooksByISBN(int ISBN) {\n String sql = \"SELECT ISBN, BookName, AuthorName, Price \" +\n \"FROM books \" +\n \"WHERE ISBN = ?\";\n\n try (Connection conn = this.connect();\n PreparedStatement pstmt = conn.prepareStatement(sql)) {\n\n // Set values\n pstmt.setInt(1, ISBN);\n\n ResultSet rs = pstmt.executeQuery();\n\n // Print results\n while(rs.next()) {\n System.out.println(rs.getInt(\"ISBN\") + \"\\t\" +\n rs.getString(\"BookName\") + \"\\t\" +\n rs.getString(\"AuthorName\") + \"\\t\" +\n rs.getInt(\"Price\"));\n }\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "@Override\r\n\tpublic Book getBook(long bookId) {\n\t\treturn bd.getOne(bookId);\r\n\t}", "@RequestMapping(value=\"/book/{isbn}\",method=RequestMethod.DELETE)\n\t\t\tpublic @ResponseBody ResponseEntity<Books> deleteBookDetails(@PathVariable Long isbn)throws Exception{\n\t\t\t\tBooks book=null;\n\t\t\t\tbook=booksDAO.findOne(isbn);\n\t\t\t\tif(book!=null)\n\t\t\t\t{\ttry{\t\n\t\t\t\t\t\t\tbook.setLastModifiedTime(new Date());\n\t\t\t\t\t\t\tif(book.getIsActive())\n\t\t\t\t\t\t\t\tbook.setIsActive(false);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tbook.setIsActive(true);\n\t\t\t\t\t\t\tbooksDAO.save(book);\n\t\t\t\t\t\t\treturn new ResponseEntity<Books>(book, HttpStatus.OK);\n\t\t\t\t\t\t}catch(Exception e){\n\t\t\t\t\t\t\tthrow new Exception(\"Could not change the status of book. \",e);\n\t\t\t\t\t\t}\n\t\t\t\t}else\n\t\t\t\t\treturn new ResponseEntity<Books>(HttpStatus.NOT_FOUND); \n\t\t\t}", "@Validate\n @Override\n public void getRmbtestsBooks(String author, BigDecimal publicationYear, BigDecimal rating,\n String isbn, List<String> facets, Map<String, String> okapiHeaders,\n Handler<AsyncResult<Response>> asyncResultHandler, Context vertxContext) throws Exception {\n\n asyncResultHandler.handle(io.vertx.core.Future.succeededFuture(GetRmbtestsBooksResponse.withJsonOK(new Book())));\n\n }", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response getBooks() {\n return Response\n .status(Response.Status.OK)\n .entity(getBookService().getBooks())\n .build();\n }", "@Test\n public void testAuthorsGetIDBook() {\n int bookID = 2;\n Response response =\n given().\n pathParam(\"IDBook\", bookID).\n when().\n get(\"/authors/books/{IDBook}\").\n then().\n contentType(ContentType.JSON).\n extract().response();\n // Put all bookIDs into a list\n List<Integer> bookIDs = response.path(\"IDBook\");\n\n // Check that each Author's IDBook for the response is equal to the expected\n for (int ID : bookIDs) {\n assertThat(ID, equalTo(bookID));\n }\n }", "List<Book> getAllBooks();", "public void searchForBooks(String query) {\n\n\n BooksAPI booksAPI = ServiceGenerator.getBooksAPI();\n Call<GBookList> call = booksAPI.getBook(query);\n call.enqueue(new Callback<GBookList>() {\n @EverythingIsNonNull\n @Override\n public void onResponse(Call<GBookList> call, Response<GBookList> response) {\n if (response.isSuccessful()) {\n //response.body() returns GBookList\n //from json format to object\n searchedBooks.setValue(response.body());\n\n }\n }\n @EverythingIsNonNull\n @Override\n public void onFailure(Call<GBookList> call, Throwable t) {\n Log.i(\"Retrofit \", \"Retrieving from google.books.com failed\");\n }\n });\n }", "public BookBean retrieveBook(String bid) throws SQLException {\r\n\t\tString query = \"select * from BOOK where bid='\" + bid + \"'\";\t\t\r\n\t\tBookBean book = null;\r\n\t\tPreparedStatement p = con.prepareStatement(query);\t\t\r\n\t\tResultSet r = p.executeQuery();\r\n\t\t\r\n\t\twhile(r.next()){\r\n\t\t\tString bookID = r.getString(\"BID\");\r\n\t\t\tString title = r.getString(\"TITLE\");\r\n\t\t\tint price = r.getInt(\"PRICE\");\r\n\t\t\tString bookCategory = r.getString(\"CATEGORY\");\t\t\t\r\n\t\t\tbook = new BookBean(bookID, title, price,bookCategory);\r\n\t\t}\r\n\t\tr.close();\r\n\t\tp.close();\r\n\t\treturn book;\r\n\t}", "@DeleteMapping(\"/{isbn}\")\n\tpublic ResponseEntity<?> deleteBook(@PathVariable(name = \"isbn\") String isbn){\n\t\treturn bookRepository.findByIsbn(isbn).\n\t\t\tmap(bookDelete -> {\n\t\t\t\tbookRepository.delete(bookDelete);\n\t\t\t\treturn new ResponseEntity<>(HttpStatus.NO_CONTENT);\n\t\t\t})\n\t\t\t.orElseThrow(() -> new BookNotFoundException(\"Wrong isbn\"));\n\t}", "@Basic( optional = true )\n\t@Column( length = 2147483647 )\n\tpublic String getIsbn() {\n\t\treturn this.isbn;\n\t\t\n\t}", "public String getIsbn() {\n return isbn;\n }", "public String getIsbn() {\n return isbn;\n }", "@RequestMapping(value=\"/getbook\", method=RequestMethod.GET, produces = \"application/json\")\n\tpublic Book getBook() {\n\t\treturn new Book(\"1\", \"Marvel Comics\", \"Stanlee\", 200D, \"Awesome book\");\n\t}", "@Override\n\tpublic Book findBook(Book book) throws RemoteException {\n\t\tPredicate<Book> predicate = x-> x.getIsbn().equals(book.getIsbn());\n\t\treturn bookList.stream().filter(predicate).findFirst().get();\n\t\t\n\t}", "public BookSearchResponse requestTitle(String title, String author, int page) throws JSONException, IOException{\n\t\tTreeMap<String, String> params = new TreeMap<String, String>();\n\t\tparams.put(PARAM_APP_ID, APP_ID);\n\t\tparams.put(PARAM_TITLE, title);\n\t\tparams.put(PARAM_AUTHOR, author);\n\t\tparams.put(PARAM_PAGE, Integer.toString(page) );\n\t\tparams.put(PARAM_OUT_OF_STOCK, VALUE_SHOW_OUT_OF_STOCK);\n\t\tparams.put(PARAM_SORT, VALUE_SORT_RELEASEDATE_ASC);\n\t\t//params.put(PARAM_SIZE, VALUE_SIZE_COMIC);//only comic\n\n\t\treturn rawRequest(SERVICE_URL, params, BookSearchResponse.class);\n\t}", "public String getIsbn() {\n\treturn isbn;\n}", "@GetMapping(\"api/books\")\n public List<Book> getallBooks() {\n return bookService.all().getPayload();\n }", "@GetMapping(\"/books/{id}\")\n public ResponseEntity<Book> getBookById(@PathVariable(value = \"id\") long bookId ) throws ResourceNotFoundException{\n Book book = bookRepository.findById(bookId)\n .orElseThrow(() -> new ResourceNotFoundException(\"Book not found :: \" + bookId));\n return ResponseEntity.ok().body(book);\n }", "@Override\n\tpublic void getByID(String ID) {\n\t\tString endpoint = \"bookinfo/get.php\";\n\t\tHashMap<String, String> dict = new HashMap<>();\n\t\tdict.put(\"bookID\", ID);\n\t\ttry {\n\t\t\tHashMap<String, Object> result = APIClient.get(BookInfo.host + endpoint, dict);\n\t\t\tif ( result.get(\"status_code\").equals(\"Success\") ) {\n\t\t\t\tJSONObject o = (JSONObject) result.get(\"result\");\n\t\t\t\tthis.title = o.getString(\"title\");\n\t\t\t\tthis.author = o.getString(\"author\");\n\t\t\t\tthis.publisher = o.getString(\"publisher\");\n\t\t\t\tthis.isbn = o.getString(\"isbn\");\n\t\t\t\tthis.bookID = o.getString(\"bookID\");\n\t\t\t\tthis.valid = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.valid = false;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n public Libro getLibro(long isbn) throws PortalException, SystemException {\n return libroPersistence.findByPrimaryKey(isbn);\n }", "@GetMapping\n\tpublic ResponseEntity<BookList> getBooks() throws Exception {\n\t\tBookList books = crawlerService.getBooksFromUrl();\t\t\n\t\treturn new ResponseEntity<BookList>(books, HttpStatus.OK);\n\t}", "String getIsbn();", "public Book read(int bookId){\n System.out.println(\"looking for Book with id \" + bookId);\n Book b = new Book();\n \n try (DBIterator keyIterator = dbmanager.getDB().iterator()) {\n keyIterator.seekToFirst();\n\n while (keyIterator.hasNext()) {\n String key = asString(keyIterator.peekNext().getKey());\n String[] splittedString = key.split(\"-\");\n\n if(!\"book\".equals(splittedString[0])){\n keyIterator.next();\n continue;\n }\n\n String resultAttribute = asString(dbmanager.getDB().get(bytes(key)));\n JSONObject jbook = new JSONObject(resultAttribute);\n\n if(jbook.getInt(\"idBOOK\") == bookId){\n b = new Book(jbook);\n break;\n }\n keyIterator.next(); \n }\n }\n catch(Exception ex){\n ex.printStackTrace();\n } \n return b;\n }", "@Override\n public Optional<BookDto> getBook(Integer bookId) {\n try {\n Optional<BookEntity> bookEntity = bookRepository.findByBookId(bookId);\n if (bookEntity.isPresent()) {\n LogUtils.getInfoLogger().info(\"Found the book: {}\", bookEntity.get());\n return Optional.of(bookDtoBookEntityMapper.bookEntityToBookDto(bookEntity.get()));\n } else {\n LogUtils.getInfoLogger().info(\"Book not found\");\n return Optional.empty();\n }\n }catch (Exception exception){\n throw new BookException(exception.getMessage());\n }\n }", "public List<Book> getByAuthor(String name );", "public List searchBookItemsWithISBN(Class<BookSellingInfo> classType, double isbn, HttpServletRequest request) throws Exception {\n\t\tSession session = null;\n\t\tTransaction tx = null;\n\t\ttry{\n\t\t\tsession = getSessionFactory().openSession();\n\t\t\tif(session != null) {\n\t\t\t\ttx = session.beginTransaction();\n\t\t\t\tQuery query = session.createQuery(\"from BookSellingInfo b where b.isbn = :isbn and b.user =:user\");\n\t\t\t\tquery.setParameter(\"isbn\", isbn);\n\t\t\t\tquery.setEntity(\"user\", S2SBooksTools.getCurrentUser(request));\n\t\t\t\treturn (List) query.list();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t} catch (Throwable e) {\n\t\t\tthrow new Exception(e);\n\t\t} finally{\n\t\t\tif(tx != null){\n\t\t\t\ttx.commit();\n\t\t\t}\n\t\t\tif(session != null) {\n\t\t\t\tsession.close();\n\t\t\t}\n\t\t}\n\t}", "public void getAllBook(){\n Call<Book> call = api.testBooks();\n call.enqueue(\n new Callback<Book>() {\n @Override\n public void onResponse(Call<Book> call, Response<Book> response) {\n Log.e(\"Test API\", \"on Response \"+response.body());\n Book book = response.body();\n Log.e(\"Test API\", \"on Response \"+book.getAuthor());\n Log.e(\"Test API\", \"on Response \"+book.getTitle());\n Log.e(\"Test API\", \"on Response \"+book.getLanguage());\n Log.e(\"Test API\", \"on Response \"+book.getDescription());\n view.onGetSuccess(book);\n }\n\n @Override\n public void onFailure(Call<Book> call, Throwable t) {\n Log.i(\"Test API\", \"on Failure \"+t.getLocalizedMessage());\n }\n }\n );\n }", "public Book load(String bid) {\n\t\treturn bookDao.load(bid);\r\n\t}", "public SBook getBookById(int id) throws RuntimeException {\n\t\treturn bookMapper.findBookById(id);\r\n\t}", "@Override\n\tpublic Book getBook() {\n\t\t\n\t\tint isbn;\n\t\tString name;\n\t\tString publication;\n\t\tdouble price;\n\t\t\n\t\tScanner s1= new Scanner(System.in);\n\t\tSystem.out.println(\"enter ISBN: \");\n\t\tisbn=s1.nextInt();\n\t\tSystem.out.println(\"enter Name of the book: \");\n\t\tname=s1.next();\n\t\tSystem.out.println(\"enter Publication \");\n\t\tpublication=s1.next();\n\t\tSystem.out.println(\"enter price: \");\n\t\tprice=s1.nextDouble();\n\t\t\n\t\tBook b1=new Book(isbn, name, publication, price);\n\t\treturn b1;\n\t}", "public String getIsbn() {\n\t\treturn isbn;\n\t}", "public interface GoogleBooksService {\n @GET(\"/books/v1/volumes\")\n void search(@Query(\"q\") String query, Callback<SearchResult> callback);\n}", "public interface IteBooksApi {\n\n @GET(\"search/{query}\")\n Observable<SearchBookResult> getBooksByCategory(@Path(\"query\") String query);\n\n @GET(\"search/{query}/page/{number}\")\n Observable<SearchBookResult> getBooksByPage(@Path(\"query\") String query, @Path(\"number\") String number);\n\n @GET(\"book/{id}\")\n Observable<BookDetailResult> getBookDetail(@Path(\"id\") String id);\n}", "@RequestMapping(value=\"/list\",method=RequestMethod.GET)\n\tpublic @ResponseBody\n\tList<Book> getBookList(){\n\t\tList<Book> bookList = null;\n\t\ttry{\n\t\t\tbookList = bookService.getBookList();\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println(\"bookList returned\");\n\t\tSystem.out.println(bookList);\n\t\treturn bookList;\n\t}", "private void getBooks(){\n final ProgressDialog loading = ProgressDialog.show(this,\"Fetching Data\",\"Please wait...\",false,false);\n\n //Creating a rest adapter\n RestAdapter adapter = new RestAdapter.Builder()\n .setEndpoint(ROOT_URL)\n .build();\n\n //Creating an object of our api interface\n BooksAPI api = adapter.create(BooksAPI.class);\n\n //Defining the method\n api.getBooks(new Callback<List<Book>>() {\n @Override\n public void success(List<Book> list, Response response) {\n //Dismissing the loading progressbar\n loading.dismiss();\n Log.e(\"response\", response.getReason());\n //Storing the data in our list\n books = (ArrayList<Book>) list;\n lv.setAdapter(listAdapter);\n //Calling a method to show the list\n //showList();\n }\n\n @Override\n public void failure(RetrofitError error) {\n //you can handle the errors here\n Log.e(\"error\",error.getResponse().getReason());\n }\n });\n }", "public com.huqiwen.demo.book.model.Books fetchByPrimaryKey(long bookId)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "@Override\n\tpublic Optional<ShoppingCart> getBookById(int bookid) {\n\t\treturn dao.findById(bookid);\n\t}", "public JSONObject book_details(int book_id) throws JSONException {\n startSession();\n\n Query query = session.createQuery(\"from Book where id = :i\");\n query.setParameter(\"i\", book_id);\n\n Book book = (Book) query.uniqueResult();\n User owner = (User) book.getOwner();\n JSONObject book_info = new JSONObject(book.getBook_info());\n JSONObject response = new JSONObject();\n\n response.put(\"success\",\"true\");\n response.put(\"book\", book.getName());\n response.put(\"author\", book.getAuthor());\n response.put(\"rent\", book.getRent());\n response.put(\"deposit\", book.getDeposit());\n response.put(\"genre\", book.getGenre());\n response.put(\"times_rented\", book.getTimes_rented());\n response.put(\"available\",book.isAvailable());\n\n response.put(\"print\", book_info.getString(\"print\"));\n response.put(\"condition\", book_info.getString(\"condition\"));\n response.put(\"year_bought\", book_info.getString(\"year_bought\"));\n response.put(\"review\", book_info.getString(\"review\"));\n\n response.put(\"owner_id\", owner.getId());\n response.put(\"owner_name\", owner.getFull_name());\n response.put(\"owner_location\", owner.getLocation());\n response.put(\"owner_contact\", owner.getContact_no());\n\n endSession();\n return response;\n }", "@RequestMapping(value=\"/getbooks\", method=RequestMethod.GET, produces = \"application/json\")\n\tpublic List<Book> getAll() {\n\t\tList<Book> books = new ArrayList<>();\n\t\tbooks = bookDao.getAllFromDB();\n\t\t\n\t\treturn books;\n\t}", "public List<PrintableBook> PerformSearch_google(String[] kw, int N){\n\t\t// build the JAX-RS client object \n\t\tClient client = ClientBuilder.newClient();\n\t\tint res_cont = 0;\t// initialize number of already processed results\n\t\tint tot_res = 1;\t// initialize total number of results so that it is greater than the number of already processed results\n\t\t// build the web target\n\t\tWebTarget target = client.target(getBaseURI_google()).path(\"volumes\");\n\t\t// create empty list of PrintableBook\n\t\tList<PrintableBook> pbooks = new ArrayList<PrintableBook>();\n\t\t// prepare query string\n\t\tStringBuffer queryString = new StringBuffer(kw[0]);\n\t\tfor (int i=1; i<kw.length; i++) {\n\t\t\tqueryString.append(' ');\n\t\t\tqueryString.append(kw[i]);\n\t\t}\n\t\tint offset;\t\t// declare variable used to store offset\n\t\t// main loop on pages\n\t\tfor(int page=0; pbooks.size()<N && res_cont<tot_res; page++){\n\t\t\toffset = page*20;\n\t\t\tSystem.out.println(\"Searching \"+queryString+\" on Google books with offset \"+offset);\n\t\t\ttry {\n\t\t\t\t// perform a get request using mediaType=APPLICATION_JSON\n\t\t\t\t// and convert the response into a SearchResult object\n\t\t\t\tit.polito.dp2.rest.gbooks.client.jaxb.SearchResult result = target\n\t\t\t\t\t\t\t\t\t .queryParam(\"q\", queryString)\t\n\t\t\t\t\t\t\t\t\t .queryParam(\"printType\", \"books\")\n\t\t\t\t\t\t\t\t\t .queryParam(\"maxResults\", 20)\n\t\t\t\t\t\t\t\t\t .queryParam(\"startIndex\", offset)\n\t\t\t\t\t\t\t\t\t .request()\n\t\t\t\t\t\t\t\t\t .accept(MediaType.APPLICATION_JSON)\n\t\t\t\t\t\t\t\t\t .get(it.polito.dp2.rest.gbooks.client.jaxb.SearchResult.class);\n\t\t\t\ttot_res = result.getTotalItems().intValue();\n\t\t\t\tSystem.out.println(\"OK Response received. Total number of Items:\"+tot_res);\n\t\t\t\tSystem.out.println(\"Validating items and converting validated items to xml.\");\n\t\t\t\tfor (it.polito.dp2.rest.gbooks.client.jaxb.Items item:result.getItems()) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// validate item\n\t\t\t\t \tJAXBSource source = new JAXBSource(jc_gbooks, item);\n\t\t\t\t \tSystem.out.println(\"Validating \"+item.getSelfLink());\n\t\t\t\t \tvalidator_gbooks.validate(source);\n\t\t\t\t \tSystem.out.println(\"Validation OK\");\n\t\t\t\t \t// add item to list\n\t\t\t\t\t\tSystem.out.println(\"Adding item to list\");\n\t\t\t\t\t\tPrintableItem pi = Factory.createPrintableItem(BigInteger.valueOf(idCounter.getNextId()),item.getVolumeInfo());\t\t\t\t\n\t\t\t\t\t\tif(pi instanceof PrintableBook){\n\t\t\t\t\t\t\tpbooks.add((PrintableBook)pi);\n\t\t\t\t\t\t\tif(pbooks.size()==N) break;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (org.xml.sax.SAXException se) {\n\t\t\t\t\t System.out.println(\"Validation Failed\");\n\t\t\t\t\t // print error messages\n\t\t\t\t\t Throwable t = se;\n\t\t\t\t\t while (t!=null) {\n\t\t\t\t\t\t String message = t.getMessage();\n\t\t\t\t\t\t if (message!= null)\n\t\t\t\t\t\t \t System.out.println(message);\n\t\t\t\t\t\t t = t.getCause();\n\t\t\t\t\t }\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tSystem.out.println(\"Unexpected I/O Exception\");\n\t\t\t\t\t} catch (JAXBException e) {\n\t\t\t\t\t\tSystem.out.println(\"Unexpected JAXB Exception\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tres_cont = res_cont + 20;\n\t\t\t} catch(WebApplicationException e) {\n\t\t\t\tSystem.err.println(\"Error in remote operation: \"+e.getMessage());\n\t\t\t\treturn null;\t\n\t\t\t}\n\t\t}\n\t System.out.println(\"Number of validated Bibliography books from gbooks: \"+pbooks.size());\n\t return pbooks;\n\t}", "public interface BookService {\n List<Book> selectAll();\n EBook search(String content);\n void insert(String isbn,Long userId) throws Exception;\n List<RequestBookDtoV2> requestSearch(String content, Long userId);\n DetailBookInfo detailBook(String bookId);\n String request(String isbn, Long userId);\n}", "public Book getBook(int bookID) throws SQLException {\n if (books.getBook(bookID)!=null){\n return books.getBook(bookID);}\n else\n return null;\n }", "Book selectByPrimaryKey(String bid);", "public void getBookByTitle(String base64){\n Call<Book> call = api.postBook(base64);\n call.enqueue(\n new Callback<Book>() {\n @Override\n public void onResponse(Call<Book> call, Response<Book> response) {\n Log.e(\"Test API\", \"on Response \"+response.body());\n Book book = response.body();\n Log.e(\"Test API\", \"on Response \"+book.getAuthor());\n Log.e(\"Test API\", \"on Response \"+book.getTitle());\n Log.e(\"Test API\", \"on Response \"+book.getLanguage());\n Log.e(\"Test API\", \"on Response \"+book.getDescription());\n view.onGetSuccess(book);\n }\n\n @Override\n public void onFailure(Call<Book> call, Throwable t) {\n Log.i(\"Test API\", \"on Failure \"+t.getLocalizedMessage());\n }\n }\n );\n }", "@Then(\"book information must match the api for {}\")\n public void book_information_must_match_the_api_for_The_kite_runner(String book) {\n String query = \"SELECT id FROM books WHERE name = '\" + book + \"'\";\n String id = DBUtils.getCellValue(query).toString();\n // get the token\n AuthenticationUtility authenticationUtility = new LibrarianAuthenticationUtility();\n String token = authenticationUtility.getToken();\n // use the id to make the call to api\n Response response = given().\n log().all().\n header(\"x-library-token\", token).\n pathParam(\"id\", id).\n when().\n get(Endpoints.GET_BOOK_BY_ID).\n prettyPeek();\n // verify response vs ui\n response.then().statusCode(200).contentType(ContentType.JSON);\n Book bookPojo = response.as(Book.class);\n\n assertThat(bookPojo.getName(), is(booksPage.bookName.getAttribute(\"value\")));\n assertThat(bookPojo.getAuthor(), is(booksPage.author.getAttribute(\"value\")));\n assertThat(bookPojo.getIsbn(), is(booksPage.isbn.getAttribute(\"value\")));\n assertThat(bookPojo.getDescription(), is(booksPage.description.getAttribute(\"value\")));\n\n }", "public Long getIsbn() {\n return isbn;\n }", "public interface Api {\n @GET(\"v2/book/search\")\n Observable<BaseApi<List<Book>>> searchBook(@Query(\"q\") String bookName);\n}", "@RequestMapping(\"/read\")\n\tpublic Booking read(@RequestParam Long bookingId) {\n\t\tBooking booking = bookingRepository.findOne(bookingId);\n\t return booking;\n\t}", "public List<Books> findBooksByFormat(String format) {\r\n return bookController.findBooksByFormat(format);\r\n }", "public List<Books> searchBook(int book_id){\n String sql=\"select * from Book where id=?\";\n BaseDao baseDao =dao.executeQuery(sql,new Object[]{book_id});\n return resultSetToBook(baseDao);\n }", "@GetMapping(\"/getByStatus/{status}\")\n public List<Book> getBooksByStatus(@PathVariable(\"status\") String status) {\n return bookService.getBooksByStatus(status);\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tresp.setCharacterEncoding(\"gbk\");\n\t\tresp.setContentType(\"text/html;charset=gbk\");\n\t\tPrintWriter out=resp.getWriter();\n\t\tCollection<Book> books=BookDB.getAll();\n\t\tout.write(\"本站提供的图书有:<br/>\");\n\t\tfor(Book book :books) {\n\t\t\tString url =\"/chapter05/PurchaseServlet?id=\"+book.getId();\n\t\t \n\t\t\tout.write(book.getName()+\"<a href='\"+url\n\t\t\t\t\t+\"'>点击购买</a><br/>\");\n\t\t}\n\t}", "public Book getBook(int index)\r\n\t{\r\n\t\tBook book = null;\r\n\t\ttry {\r\n\t\t\tbook = items.get(index);\r\n\t\t} catch(IndexOutOfBoundsException e) {\r\n\t\t}\r\n\t\treturn book;\r\n\t}", "public Book getBookById(final long id) {\n return entityManager.find(Book.class, id);\n }", "public interface IBooksRestModel {\n\n @GET(\"volumes\")\n public Call<Volumes> searchBook(@Query(\"q\") String query);\n\n}", "Book getLatestBook();", "public void retrieveDetailedBookInfo(){\n //Check for internet connection\n if(!NetworkJSONUtils.checkInternetConnection(this)) {\n ErrorUtils.errorDialog(BookDetailsActivity.this, \"Network Error\", \"It seems you don't have any network connection. Reset your connection and try again.\");\n return;\n }\n\n //Build Uri that fetches book data\n Uri.Builder builder = new Uri.Builder();\n builder.scheme(SCHEME)\n .authority(BASE_URL)\n .appendPath(PATH0)\n .appendPath(PATH1)\n .appendPath(PATH2)\n .appendQueryParameter(PARAM_ACTION, VALUE_ACTION_RETRIEVE_DETAILED_DATA)\n .appendQueryParameter(PARAM_GID, VALUE_GID)\n .build();\n String urlString = builder.toString();\n\n //Download and parse JSON\n downloadJSON(urlString);\n }", "@GetMapping(value = \"/community/{bid}\")\n JsonResp<CommunityVO> getCommunity(@PathVariable int bid);", "Collection<Book> getAll();", "@GetMapping(value = \"/{username}/books\")\n public Iterable<Book> listBooksInLibrary(@PathVariable String username,\n @RequestParam(required = false) String author,\n @RequestParam(required = false) String status) {\n\n UserBookStatus userBookStatus = StringUtils.isEmpty(status) ? null : UserBookStatus.valueOf(status.toUpperCase());\n List<UserBook> userBooks = userService.listBooks(username, author, userBookStatus);\n\n return userBooks.stream().map(userBookToBook).collect(Collectors.toList());\n }", "public Book getById(Long bookId) {\n\t\treturn (Book) entityManager.createQuery(\"from Book where id= :bookId\").setParameter(\"bookId\", bookId)\n\t\t\t\t.getSingleResult();\n\t}", "public String getBookId() {\r\n return bookId;\r\n }", "@Query(\n nativeQuery = true,\n value = \"select * from book where isbn = ?1\"\n )\n Book findByQueryNativeIsbn(String isbn);", "public void setIsbn(String isbn) {\n\tthis.isbn = isbn;\n}", "public String getBookId() {\n return bookId;\n }", "public String getBookId() {\n return bookId;\n }", "List<Info> getBookInfoById(Long infoId) throws Exception;", "@GET\n\t@Path(\"/{id:[a-f0-9\\\\-]+}\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic String getAsJSON(@PathParam(\"id\") final String dbBookId) {\n\t\treturn getDetail(dbBookId);\n\t}", "public List<BookReviewBean> getBookReviewsById(String bid) throws Exception {\n List<BookReviewBean> reviews = new ArrayList<BookReviewBean>();\n String query = \"SELECT poi.rating, poi.review FROM POItem poi INNER JOIN PO p ON poi.id=p.id AND p.status='ORDERED' INNER JOIN book b ON poi.bid=b.bid WHERE poi.bid=? AND poi.rating>0 ORDER BY poi.id DESC\";\n try (Connection con = this.ds.getConnection();\n PreparedStatement p = con.prepareStatement(query)) {\n p.setString(1, bid);\n ResultSet r = p.executeQuery();\n while (r.next()) {\n BookReviewBean review = new BookReviewBean(r.getInt(\"rating\"), r.getString(\"review\"));\n reviews.add(review);\n }\n return reviews;\n }\n }", "public String getIsbn() {\n return (String)getAttributeInternal(ISBN);\n }", "@Override\r\n\tpublic Book searchBook(long ISBN) {\n\t\t transactionTemplate.setReadOnly(true);\r\n\t\treturn transactionTemplate.execute(new TransactionCallback<Book>() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic Book doInTransaction(TransactionStatus status) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n//\t\t\t\tBook book = bookDAO.serachBook(ISBN);\r\n\t\t\t\tBook book=new Book();\r\n\t\t\t\tbook.setISBN(ISBN);\r\n\t\t\t\tbookDAO.addBook(book);\r\n\t\t\t\treturn book;\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t}", "@Nullable\n public static BookData getBook(ResourceLocation id) {\n return books.getOrDefault(id, null);\n }" ]
[ "0.7426404", "0.7015551", "0.692721", "0.6824965", "0.6666958", "0.6485304", "0.64638096", "0.6438463", "0.63374704", "0.63336486", "0.6332343", "0.63304704", "0.63054925", "0.6160252", "0.6128883", "0.6003881", "0.600304", "0.59823334", "0.59559566", "0.5950672", "0.59176797", "0.5845095", "0.5813087", "0.58038265", "0.57808477", "0.5767259", "0.5764484", "0.5762687", "0.57434726", "0.570097", "0.5654058", "0.5638904", "0.5625813", "0.5623723", "0.5546286", "0.553712", "0.54876643", "0.54664606", "0.5457735", "0.5457735", "0.54569", "0.54511356", "0.5446352", "0.5397095", "0.53940994", "0.5383184", "0.5381761", "0.53801066", "0.5373639", "0.5366776", "0.5347777", "0.5345839", "0.5339966", "0.53252125", "0.53172046", "0.5293606", "0.5280264", "0.524943", "0.5234043", "0.52338046", "0.52301586", "0.5226865", "0.52021873", "0.5189078", "0.518533", "0.5181742", "0.5179665", "0.51771843", "0.51737434", "0.5171633", "0.5159705", "0.5158841", "0.51548284", "0.51457375", "0.5138551", "0.51367235", "0.5134971", "0.5127072", "0.51228327", "0.5106554", "0.51049596", "0.50970227", "0.5095864", "0.5094836", "0.5087871", "0.50806355", "0.5077188", "0.50757366", "0.5064171", "0.5045863", "0.5042169", "0.5040114", "0.5033075", "0.5033075", "0.50262403", "0.50259066", "0.5025583", "0.5024105", "0.5020782", "0.5018268" ]
0.83810997
0
Transforms bookServiceResult to JsonObject
private String getJsonFromServiceResult(BookServiceResult bookServiceResult) { final JSONObject returnJsonObject = new JSONObject(); returnJsonObject.put("Status", bookServiceResult.getStatus().getStatusCode()); returnJsonObject.put("Message", bookServiceResult.getMessage()); return returnJsonObject.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public JSONObject getBookJSONObject(String bookTitle) throws BadRequestException {\n\n String apiUrlString = \"https://www.googleapis.com/books/v1/volumes?q=intitle:\" + bookTitle + \"&filter:free-ebooks&printType:books\";\n try{\n HttpURLConnection connection = null;\n // Build Connection.\n try{\n URL url = new URL(apiUrlString);\n connection = (HttpURLConnection) url.openConnection();\n connection.setRequestMethod(\"GET\");\n connection.setReadTimeout(5000); // 5 seconds\n connection.setConnectTimeout(5000); // 5 seconds\n } catch (MalformedURLException e) {\n // Impossible: The only two URLs used in the app are taken from string resources.\n e.printStackTrace();\n } catch (ProtocolException e) {\n // Impossible: \"GET\" is a perfectly valid request method.\n e.printStackTrace();\n }\n int responseCode = connection.getResponseCode();\n if(responseCode != 200){\n connection.disconnect();\n throw new BadRequestException(\"GoogleBooksAPI request failed. Response Code: \" + responseCode);\n\n }\n\n // Read data from response.\n StringBuilder builder = new StringBuilder();\n BufferedReader responseReader = new BufferedReader(new InputStreamReader(connection.getInputStream()));\n String line = responseReader.readLine();\n while (line != null){\n builder.append(line);\n line = responseReader.readLine();\n System.out.println(line);\n }\n String responseString = builder.toString();\n JSONObject responseJson = new JSONObject(responseString);\n // Close connection and return response code.\n connection.disconnect();\n return responseJson;\n } catch (SocketTimeoutException e) {\n return null;\n } catch(IOException e){\n e.printStackTrace();\n return null;\n } catch (JSONException e) {\n e.printStackTrace();\n return null;\n }\n }", "@Override\n\t\t\t\t\tpublic void handleResponse(String jsonResult, EHttpError error) {\n\t\t\t\t\t\tif(jsonResult!=null&&error == EHttpError.KErrorNone){\n\t\t\t\t\t\t\tGson gson = new Gson();\n\t\t\t\t\t\t\tType type = new TypeToken<Map<String, Object>>() {\n\t\t\t\t\t\t\t}.getType();\n\t\t\t\t\t\t\tbooks = gson.fromJson(jsonResult, type);\n\t\t\t\t\t\t\tList<Map<String, Object>>list = (List<Map<String, Object>>) books.get(\"books\");\n saveCache(context, jsonResult);\n\t\t\t\t\t\t\tSystem.out.println(\"旧书\"+list);\n\t\t\t\t\t\t\tthis.completeListener.onQueryComplete(GETBOOKBYTAPE, books, error);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthis.completeListener.onQueryComplete(GETBOOKBYTAPE, null, error);\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "@Override\n\t\t\t\t\tpublic void handleResponse(String jsonResult, EHttpError error) {\n\t\t\t\t\t\tif(jsonResult!=null&&error == EHttpError.KErrorNone){\n\t\t\t\t\t\t\tGson gson = new Gson();\n\t\t\t\t\t\t\tType type = new TypeToken<Map<String, Object>>() {\n\t\t\t\t\t\t\t}.getType();\n\t\t\t\t\t\t\tbooks = gson.fromJson(jsonResult, type);\n\t\t\t\t\t\t\tList<Map<String, Object>>list = (List<Map<String, Object>>) books.get(\"books\");\n\t\t\t\t\t\t\tSystem.out.println(\"书籍详情\"+list);\n\t\t\t\t\t\t\tthis.completeListener.onQueryComplete(GETBOOKBYNAME, list, error);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthis.completeListener.onQueryComplete(GETBOOKBYNAME, null, error);\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "public JSONObject book_details(int book_id) throws JSONException {\n startSession();\n\n Query query = session.createQuery(\"from Book where id = :i\");\n query.setParameter(\"i\", book_id);\n\n Book book = (Book) query.uniqueResult();\n User owner = (User) book.getOwner();\n JSONObject book_info = new JSONObject(book.getBook_info());\n JSONObject response = new JSONObject();\n\n response.put(\"success\",\"true\");\n response.put(\"book\", book.getName());\n response.put(\"author\", book.getAuthor());\n response.put(\"rent\", book.getRent());\n response.put(\"deposit\", book.getDeposit());\n response.put(\"genre\", book.getGenre());\n response.put(\"times_rented\", book.getTimes_rented());\n response.put(\"available\",book.isAvailable());\n\n response.put(\"print\", book_info.getString(\"print\"));\n response.put(\"condition\", book_info.getString(\"condition\"));\n response.put(\"year_bought\", book_info.getString(\"year_bought\"));\n response.put(\"review\", book_info.getString(\"review\"));\n\n response.put(\"owner_id\", owner.getId());\n response.put(\"owner_name\", owner.getFull_name());\n response.put(\"owner_location\", owner.getLocation());\n response.put(\"owner_contact\", owner.getContact_no());\n\n endSession();\n return response;\n }", "private static JSONObject addObject(JSONArray bookList,Book book){\r\n bookList.add(book.toJson()); \r\n JSONObject bookObject = new JSONObject();\r\n bookObject.put(\"books\", bookList);\r\n return bookObject;\r\n }", "@Override\n\t\t\t\t\tpublic void handleResponse(String jsonResult, EHttpError error) {\n\t\t\t\t\t\tMap<String, Object>books;\n\t\t\t\t\t\tif(jsonResult!=null&&error == EHttpError.KErrorNone){\n\t\t\t\t\t\t\tGson gson = new Gson();\n\t\t\t\t\t\t\tType type = new TypeToken<Map<String, Object>>() {\n\t\t\t\t\t\t\t}.getType();\n\t\t\t\t\t\t\tbooks = gson.fromJson(jsonResult, type);\n\t\t\t\t\t\t\tList<String>list = (List<String>) books.get(\"booknames\");\n\t\t\t\t\t\t\tSystem.out.println(\"搜索到的书\"+list);\n\t\t\t\t\t\t\tthis.completeListener.onQueryComplete(AUTOCOMPLETE, list, error);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthis.completeListener.onQueryComplete(AUTOCOMPLETE, null, error);\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "@Override\n\t\t\t\t\tpublic void handleResponse(String jsonResult, EHttpError error) {\n\t\t\t\t\t\tif(jsonResult!=null&&error == EHttpError.KErrorNone){\n\t\t\t\t\t\t\tGson gson = new Gson();\n\t\t\t\t\t\t\tType type = new TypeToken<Map<String, Object>>() {\n\t\t\t\t\t\t\t}.getType();\n\t\t\t\t\t\t\tbooks = gson.fromJson(jsonResult, type);\n\t\t\t\t\t\t\tList<Map<String, Object>>list = (List<Map<String, Object>>) books.get(\"books\");\n\t\t\t\t\t\t\tSystem.out.println(\"搜索到的书\"+list);\n\t\t\t\t\t\t\tthis.completeListener.onQueryComplete(new QueryId(), list, error);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthis.completeListener.onQueryComplete(new QueryId(), null, error);\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "protected abstract Object buildJsonObject(R response);", "private static void parseBookObject(JSONObject book){\r\n BookManager.books.add(new Book(Integer.parseInt((String) book.get(\"id\")),(String) book.get(\"name\"),(String) book.get(\"author\")));\r\n }", "protected void onPostExecute(String result) {\n Gson gson = new Gson();\n Book book = gson.fromJson(result, Book.class);\n\n onDownloadAsyncTask.onComplete(book);\n }", "public JSONObject readJSON(int bookId){\n System.out.println(\"looking for Book JSON with id \" + bookId);\n dbmanager.open();\n JSONObject jbook = new JSONObject();\n try (DBIterator keyIterator = dbmanager.getDB().iterator()) {\n keyIterator.seekToFirst();\n\n while (keyIterator.hasNext()) {\n String key = asString(keyIterator.peekNext().getKey());\n String[] splittedString = key.split(\"-\");\n\n if(!\"book\".equals(splittedString[0])){\n keyIterator.next();\n continue;\n }\n\n String resultAttribute = asString(dbmanager.getDB().get(bytes(key)));\n jbook = new JSONObject(resultAttribute);\n\n if(jbook.getInt(\"idBOOK\") == bookId){ \n break;\n }\n keyIterator.next(); \n }\n }\n catch(Exception ex){\n ex.printStackTrace();\n } \n dbmanager.close();\n return jbook;\n }", "public java.lang.String getResultJson() {\n return result_json;\n }", "public JsonObject toJson();", "private BookDetailResponse convertBookDetail(Book book) {\n BookDetailResponse response = new BookDetailResponse();\n BeanUtils.copyProperties(book, response);\n BookCategory thirdCategory = book.getCategory();\n if (thirdCategory != null) {\n response.setThirdCategoryId(thirdCategory.getId());\n BookCategory secondCategory = thirdCategory.getParent();\n if (secondCategory != null) {\n response.setSecondCategoryId(secondCategory.getId());\n BookCategory firstCategory = secondCategory.getParent();\n if (firstCategory != null) {\n response.setFirstCategoryId(firstCategory.getId());\n }\n }\n }\n if (StringUtils.isBlank(book.getFileName()) && book.getSource() != null) {\n response.setFileName(FilenameUtils.getName(book.getSource()));\n }\n return response;\n }", "public java.lang.String getResultJson() {\n return result_json;\n }", "public static Book GetBookFromJSONObject(JSONObject item) throws JSONException {\n String bookId = item.getString(\"id\");\n JSONObject vol_info = item.getJSONObject(\"volumeInfo\");\n String bookTitle = vol_info.getString(\"title\");\n String bookAuthors = \"\";\n JSONArray auth = vol_info.getJSONArray(\"authors\");\n\n for (int i = 0; i < auth.length(); i++) {\n bookAuthors += auth.get(i) + (i < auth.length() - 1 ? \", \" : \"\");\n }\n\n String bookPhotoUri = \"\";\n try {\n JSONObject imagesLinks = vol_info.getJSONObject(\"imageLinks\");\n bookPhotoUri = imagesLinks.getString(\"thumbnail\");\n }\n catch (Exception er){\n\n }\n\n String bookIsbn = \"\";\n if(vol_info.has(\"industryIdentifiers\")) {\n JSONArray industryIdentifiers = vol_info.getJSONArray(\"industryIdentifiers\");\n JSONObject ISBN_Object = industryIdentifiers.getJSONObject(0);\n bookIsbn = ISBN_Object.getString(\"identifier\");\n }\n\n return new Book(bookTitle, bookAuthors, bookPhotoUri, bookIsbn, null);\n }", "public JSONObject getResponseAsObject(String query) throws RmesException {\n\t\treturn repositoryUtils.getResponseAsObject(query, repositoryUtils.initRepository(config.getRdfServerPublication(), config.getRepositoryIdPublication()));\n\t}", "@Override\n\tprotected void handleResult(JSONObject obj) {\n\t\t\n\t}", "private void writeHttpServiceResponse(String contentType, HttpServletResponse response, Object result) throws\r\n IOException {\r\n if (contentType.indexOf(CONTENT_TYPE_BSF) > -1) {\r\n OutputStream outputStream = response.getOutputStream();\r\n ObjectOutputStream oos = new ObjectOutputStream(outputStream);\r\n oos.writeObject(new ServiceResponse(result));\r\n oos.close();\r\n } else {\r\n //JSONObject jsonResult = new JSONObject();\r\n \tJsonObject jsonResult = new JsonObject();\r\n if (result instanceof Throwable) {\r\n Throwable ex = (Throwable) result;\r\n jsonResult.addProperty(ERROR, ex.getMessage());\r\n StringWriter sw = new StringWriter();\r\n ex.printStackTrace(new PrintWriter(sw));\r\n jsonResult.addProperty(STACK_TRACE, sw.toString());\r\n } /*else if (result != null && ObjectUtil.isCollection(result)) {\r\n jsonResult.put(VALUE, JSONArray.fromObject(result));\r\n } else if (result instanceof String && JSONUtils.mayBeJSON((String) result)) {\r\n jsonResult.put(VALUE, JSONObject.fromObject((String) result));\r\n } else if (JSONUtils.isNumber(result) || JSONUtils.isBoolean(result) || JSONUtils.isString(result)) {\r\n jsonResult.put(VALUE, result);\r\n }*/ \r\n else {\r\n System.out.println(\">>>result class: \" + result.getClass());\r\n jsonResult.add(VALUE, JSONConverter.toJsonTree(result));\r\n }\r\n response.setCharacterEncoding(RESP_ENCODING);\r\n response.getWriter().write(JSONConverter.gson().toJson(jsonResult));\r\n }\r\n }", "protected abstract String getJSON(B bean);", "private JsonValidate convertFromJson(String result) {\n JsonValidate jv = null;\n if (result != null && result.length() > 0) {\n try {\n Gson gson = new Gson();\n jv = gson.fromJson(result, JsonValidate.class);\n } catch (Exception ex) {\n Log.v(Constants.LOG_TAG, \"Error: \" + ex.getMessage());\n }\n }\n return jv;\n }", "private static JSONArray objectToArray(JSONObject obj){\r\n return (JSONArray) obj.get(\"books\");\r\n }", "public JsonObject covertToJson() {\n JsonObject transObj = new JsonObject(); //kasutaja portf. positsiooni tehing\n transObj.addProperty(\"symbol\", symbol);\n transObj.addProperty(\"type\", type);\n transObj.addProperty(\"price\", price);\n transObj.addProperty(\"volume\", volume);\n transObj.addProperty(\"date\", date);\n transObj.addProperty(\"time\", time);\n transObj.addProperty(\"profitFromSell\", profitFromSell);\n transObj.addProperty(\"averagePurchasePrice\", averagePurchasePrice);\n return transObj;\n }", "private static JSONObject removeObject(JSONArray bookList,Book book){\r\n bookList.remove(book.toJson()); \r\n JSONObject bookObject = new JSONObject();\r\n bookObject.put(\"books\", bookList);\r\n return bookObject;\r\n }", "static WritableMap authenticationResultToJSON(AuthenticationResult authenticationResult) {\n WritableMap authResult = Arguments.createMap();\n\n authResult.putString(\"accessToken\", authenticationResult.getAccessToken());\n authResult.putString(\"accessTokenType\", authenticationResult.getAccessTokenType());\n authResult.putString(\"expiresOn\", String.valueOf(authenticationResult.getExpiresOn()));\n authResult.putString(\"idToken\", authenticationResult.getIdToken());\n authResult.putBoolean(\"isMultipleResourceRefreshToken\", authenticationResult.getIsMultiResourceRefreshToken());\n authResult.putString(\"statusCode\", String.valueOf(authenticationResult.getStatus()));\n authResult.putString(\"tenantId\", authenticationResult.getTenantId());\n\n WritableMap userInfo = null;\n userInfo = userInfoToJSON(authenticationResult.getUserInfo());\n\n authResult.putMap(\"userInfo\", userInfo);\n\n return authResult;\n }", "ArrayList<Map<String,Object>> parseQueryResult(Object result) { return null;}", "JsonObject raw();", "private <T> T convert(String json, Type resultObject) {\n\t\tGson gson = new GsonBuilder().create();\n\t\treturn gson.fromJson(json, resultObject);\n\t}", "public String getJsonFromRequest(HttpResponse httpResult)\n throws ParseException, IOException {\n String stringResult = null;\n stringResult = EntityUtils.toString(httpResult.getEntity(), \"UTF-8\");\n return stringResult;\n }", "@POST\n @Consumes(MediaType.APPLICATION_JSON)\n public Response createBook(Book book) {\n final BookServiceResult result = bookService.addBook(book);\n return Response\n .status(result.getStatus())\n .entity(getJsonFromServiceResult(result))\n .build();\n }", "private void getBooks(){\n String ROOT_URL =\"http://projects.yogeemedia.com/preview/embassy\";\n\n //Creating a rest adapter\n RestAdapter adapter = new RestAdapter.Builder()\n .setEndpoint(ROOT_URL)\n .build();\n\n //Creating an object of our api interface\n Interface api = adapter.create(Interface.class);\n\n //Defining the method\n api.getBooks( new Callback<Response>() {\n @Override\n public void success(Response detailsResponse, Response response2) {\n\n String detailsString = getStringFromRetrofitResponse(detailsResponse);\n\n try {\n JSONObject object = new JSONObject(detailsString);\n\n Log.e(\"List\", String.valueOf(object.getJSONArray(\"contacts\")));\n\n writeToFile(object);\n\n //In here you can check if the \"details\" key returns a JSONArray or a String\n\n } catch (JSONException e) {\n\n }\n\n }\n\n @Override\n public void failure(RetrofitError error) {\n Log.e(\"List\",error.toString());\n\n }});}", "public String toJSONResult() {\n StringBuilder pageJSON = new StringBuilder();\n pageJSON.append(\"{\\\"id\\\": \");\n pageJSON.append(\"\\\"\");\n pageJSON.append(getID());\n pageJSON.append(\"\\\"\");\n pageJSON.append(\", \\\"title\\\": \");\n try {\n pageJSON.append(\"\\\"\").append(URLEncoder.encode(getTitle(), \"UTF-8\")).append(\"\\\"\");\n } catch (UnsupportedEncodingException e) {\n pageJSON.append(\"null\");\n }\n pageJSON.append(\", \\\"url\\\": \\\"\").append(getUrl())\n .append(\"\\\", \\\"preview\\\": \");\n try {\n pageJSON.append(\"\\\"\").append(URLEncoder.encode(getPreview(), \"UTF-8\"))\n .append(\"\\\"\");\n } catch (UnsupportedEncodingException e) {\n pageJSON.append(\"null\");\n }\n pageJSON.append(\"}\");\n\n return pageJSON.toString();\n }", "public void searchForBooks(String query) {\n\n\n BooksAPI booksAPI = ServiceGenerator.getBooksAPI();\n Call<GBookList> call = booksAPI.getBook(query);\n call.enqueue(new Callback<GBookList>() {\n @EverythingIsNonNull\n @Override\n public void onResponse(Call<GBookList> call, Response<GBookList> response) {\n if (response.isSuccessful()) {\n //response.body() returns GBookList\n //from json format to object\n searchedBooks.setValue(response.body());\n\n }\n }\n @EverythingIsNonNull\n @Override\n public void onFailure(Call<GBookList> call, Throwable t) {\n Log.i(\"Retrofit \", \"Retrieving from google.books.com failed\");\n }\n });\n }", "public void parseJSON(JSONObject json){\n try {\n\n int success = json.getInt(KEY_SUCCESS);\n if(success == 0){\n //An error occurred - Server will handle message\n String message = json.getString(KEY_MESSAGE);\n Toast.makeText(this, message, Toast.LENGTH_LONG).show();\n }else if(success == 1){\n //Book Info successfully retrieved\n //Get detailed book info\n JSONObject jsonResponse = json.getJSONObject(KEY_JSON);\n String title = jsonResponse.getString(KEY_TITLE);\n String subTitle = jsonResponse.getString(KEY_SUB_TITLE);\n String subject = jsonResponse.getString(KEY_SUBJECT);\n String description = jsonResponse.getString(KEY_DESCRIPTION);\n String authors = jsonResponse.getString(KEY_AUTHORS);\n //String bookDetails = jsonResponse.getString(KEY_BOOK_DETAILS);\n String thumbnail = jsonResponse.getString(KEY_THUMBNAIL);\n int copies = jsonResponse.getInt(KEY_COPIES);\n String ISBN10 = jsonResponse.getString(KEY_ISBN10);\n String ISBN13 = jsonResponse.getString(KEY_ISBN13);\n int numberRatings = jsonResponse.getInt(KEY_NUMBER_RATINGS);\n String averageRating = jsonResponse.getString(KEY_AVG_RATING);\n int availableCopies = jsonResponse.getInt(KEY_AVAILABLE_COPIES);\n JSONArray copyDetails = jsonResponse.getJSONArray(KEY_COPY_DETAILS);\n JSONArray reviews = jsonResponse.getJSONArray(KEY_REVIEWS);\n\n //Create book object\n currentBook = new Book(Float.valueOf(averageRating), numberRatings, copies, availableCopies, VALUE_GID, title, subTitle, null, subject, description, authors, thumbnail, null, ISBN10, ISBN13);\n\n //Get UID to check if there are comments by current user. Also assume that there are no reviews initially\n SharedPreferences sharedPref = getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVATE);\n VALUE_UID = sharedPref.getInt(\"UID\", -2);\n\n //Loop through copy details\n for(int i = 0; i < copyDetails.length(); i++){\n JSONObject currentCopy = (JSONObject)copyDetails.get(i);\n\n int BID = currentCopy.getInt(KEY_BID);\n String checkoutTime = currentCopy.getString(KEY_CHECKOUT_TIME);\n String returnTime = currentCopy.getString(KEY_RETURN_TIME);\n int waitingListSize = currentCopy.getInt(KEY_WAITLIST_SIZE);\n int UID = currentCopy.getInt(KEY_UID);\n\n Copy curCopy = new Copy(BID, waitingListSize, checkoutTime, returnTime);\n currentBook.copies.add(curCopy);\n if (VALUE_UID == UID) {\n mCheckout.setText(\"Return\");\n checkedOut = true;\n mCopy = curCopy;\n break;\n }else{\n checkedOut = false;\n mCheckout.setText(getResources().getString(R.string.checkout));\n }\n\n\n\n }\n\n //Loop through Reviews\n for(int i = 0; i < reviews.length(); i++){\n JSONObject currentReview = (JSONObject)reviews.get(i);\n int CID = currentReview.getInt(KEY_CID);\n int rating = currentReview.getInt(KEY_RATING);\n String timestamp = currentReview.getString(KEY_COMMENT_TIME);\n String commentTitle = currentReview.getString(KEY_COMMENT_TITLE);\n String comment = currentReview.getString(KEY_COMMENT);\n String name = currentReview.getString(KEY_NAME);\n int UID = currentReview.getInt(KEY_UID);\n\n Review curReview = new Review(CID, UID, rating, comment, commentTitle, timestamp, name);\n\n //If the current user already added a review, display it at the top.\n if(UID == VALUE_UID) {\n currentBook.reviews.add(0, curReview);\n }else {\n currentBook.reviews.add(curReview);\n }\n }\n retrieveDetailedImage();\n displayBookInfo();\n }else if(success == 11){\n //Comment successfully added\n boolean authSuccess = json.getBoolean(KEY_AUTH_SUCCESS);\n Log.i(\"LoginActivity\", \"AUTH SUCCESS: \" + authSuccess);\n if(authSuccess){\n String message = json.getString(KEY_MESSAGE);\n Toast.makeText(this, message, Toast.LENGTH_SHORT).show();\n //Updates new info\n Log.i(\"LoginActivity\", \"UPDATE INITIATED\");\n retrieveDetailedBookInfo();\n }else{\n ErrorUtils.errorDialog(this, \"Authentication Error\", \"The user's credentials could not be authenticated, so the review was not uploaded. Please try logging out and baack in.\");\n }\n }else if(success == 14){\n //Book successfully checked out\n int BID = json.getInt(KEY_BID);\n SharedPreferences.Editor prefEditor = getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVATE).edit();\n prefEditor.putInt(\"BOOK\" + BID, BID);\n prefEditor.commit();\n\n String message = json.getString(KEY_MESSAGE);\n Toast.makeText(this, message, Toast.LENGTH_LONG).show();\n\n checkedOut = true;\n mCheckout.setText(\"Return\");\n\n configureReturnAlarm(BID);\n\n if(restartOnFinished){\n restartOnFinished = false;\n refreshScreen();\n }\n\n }else if(success == 15){\n //Successfully added to wait list\n int BID = json.getInt(KEY_BID);\n SharedPreferences.Editor prefEditor = getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVATE).edit();\n prefEditor.putInt(\"WAITLIST\" + BID, BID);\n prefEditor.commit();\n\n String message = json.getString(KEY_MESSAGE);\n Toast.makeText(this, message, Toast.LENGTH_LONG).show();\n\n if(restartOnFinished) {\n restartOnFinished = false;\n refreshScreen();\n }\n\n }else if(success == 16){\n //Successfully returned\n int BID = json.getInt(KEY_BID);\n SharedPreferences pref = getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVATE);\n SharedPreferences.Editor prefEditor = pref.edit();\n prefEditor.remove(\"BOOK\" + BID);\n prefEditor.commit();\n\n String message = json.getString(KEY_MESSAGE);\n Toast.makeText(this, message, Toast.LENGTH_LONG).show();\n checkedOut = false;\n mCheckout.setText(\"Checkout\");\n\n if(restartOnFinished) {\n restartOnFinished = false;\n refreshScreen();\n }\n\n Log.i(\"LoginActivity\", \"SUCCESS RETURNED\");\n }\n }catch(JSONException JSONE){\n JSONE.printStackTrace();\n ErrorUtils.errorDialog(this, \"Malformed JSON Error\", \"A malformed response was recieved from the server. Please try again later.\");\n }\n }", "public abstract Object toJson();", "public void jsonPresentation () {\n System.out.println ( \"****** Json Data Module ******\" );\n ArrayList<Book> bookArrayList = new ArrayList<Book>();\n String jsonData = \"\";\n ObjectMapper mapper = new ObjectMapper();\n bookArrayList = new Request().postRequestBook();\n try {\n jsonData = mapper.writeValueAsString(bookArrayList);\n } catch (JsonProcessingException e) {\n System.out.println(\"Error: \"+ e);\n }\n System.out.println(jsonData);\n ClientEntry.showMenu ( );\n }", "public void getAllBook(){\n Call<Book> call = api.testBooks();\n call.enqueue(\n new Callback<Book>() {\n @Override\n public void onResponse(Call<Book> call, Response<Book> response) {\n Log.e(\"Test API\", \"on Response \"+response.body());\n Book book = response.body();\n Log.e(\"Test API\", \"on Response \"+book.getAuthor());\n Log.e(\"Test API\", \"on Response \"+book.getTitle());\n Log.e(\"Test API\", \"on Response \"+book.getLanguage());\n Log.e(\"Test API\", \"on Response \"+book.getDescription());\n view.onGetSuccess(book);\n }\n\n @Override\n public void onFailure(Call<Book> call, Throwable t) {\n Log.i(\"Test API\", \"on Failure \"+t.getLocalizedMessage());\n }\n }\n );\n }", "private void fetchBooks(String barcode_number) {\n Log.d(\"fetchBooks\", \"Books being fetched...\");\n client = new BookClient();\n final String error = \"{\\\"start\\\":0,\\\"num_found\\\":0,\\\"numFound\\\":0,\\\"docs\\\":[]}\";\n\n client.getBooks(barcode_number, new JsonHttpResponseHandler() {\n @Override\n public void onSuccess(int statusCode, Header[] headers, JSONObject response) {\n try {\n JSONArray docs = null;\n if(response != null) {\n if (response.toString().equals(error)) {\n // Deal with invalid barcode\n Log.d(\"ReceievedError\", \"received error\");\n errorText.setText(\"Error: Could not find book \" + barcodeID);\n } else {\n Log.d(\"debug\", \"response = \" + response);\n // Get the docs json array\n docs = response.getJSONArray(\"docs\");\n // Parse json array into array of model objects\n final ArrayList<Book> books = Book.fromJson(docs);\n // retrieve first book out of array\n Book myBook = books.get(0);\n String title = \"Title:\";\n String author = \"Author\";\n String barcode = \"Barcode ID:\";\n\n titleText.setText(myBook.getTitle());\n authorText.setText(myBook.getAuthor());\n preTitleText.setText(title);\n preAuthorText.setText(author);\n preBarcodeText.setText(barcode);\n\n Log.d(\"Picasso\", \"getContext() = \" + getContext());\n\n Picasso.with(getContext()).load(Uri.parse(myBook.getLargeCoverUrl())).error(R.drawable.ic_nocover).into(coverImage);\n }\n }\n } catch (JSONException e) {\n // Invalid JSON format\n Log.d(\"ReceievedError\", \"received error\");\n errorText.setText(\"Error: Received invalid JSON format\");\n }\n }\n });\n }", "JSONObject toJson();", "JSONObject toJson();", "public interface BookInfoService {\n\n ResultInfo queryBook(String jsonStr);\n\n ResultInfo queryBookNumByType(String jsonStr);\n\n ResultInfo insertBook(String jsonStr);\n\n ResultInfo deleteBook(String jsonStr);\n\n}", "public abstract String toJson();", "private Page<BookListResponse> convertBookPage(Page<Book> bookPage) {\n List<BookListResponse> content = Lists.newArrayList();\n bookPage.forEach(book -> {\n BookListResponse response = new BookListResponse();\n BeanUtils.copyProperties(book, response);\n content.add(response);\n });\n return new PageImpl<>(content, bookPage.getPageable(), bookPage.getTotalElements());\n }", "public static void convertBookToBookVO() {\n\t\t// TODDO\n\t}", "@Override\n public void onSuccess(int statusCode, Header[] headers, JSONObject response)\n {\n super.onSuccess(statusCode, headers, response);\n LogUtil.i(TAG, \"getservBookResource\", response.toString());\n if (response.opt(\"code\").equals(\"00000\"))\n {\n JSONObject dataJsonObject = response.optJSONObject(\"data\");\n JSONArray trafficJSONList = dataJsonObject.optJSONArray(\"traffic\");\n if (trafficJSONList != null && trafficJSONList.length() > 0)\n {\n for (int j = 0; j < trafficJSONList.length(); j++)\n {\n JSONObject serviceJSON = trafficJSONList.optJSONObject(j);\n ServResrouce service = new ServResrouce();\n service.setServId(serviceJSON.optString(\"servId\"));\n service.setServName(serviceJSON.optString(\"servName\"));\n service.setServAlias(serviceJSON.optString(\"servAlias\"));\n service.setServType(serviceJSON.optString(\"servType\"));\n service.setRank(serviceJSON.optString(\"rank\"));\n service.setTitleImage(serviceJSON.optString(\"titleImg\"));\n service.setServDesc(serviceJSON.optString(\"servDesc\"));\n if (service.getServType().equals(\"airplane\") || service.getServType().equals(\"Iairplane\"))\n {\n airPlaneList.add(service);\n }\n else\n {\n carOrBoaticList.add(service);\n }\n }\n }\n JSONArray stayJSONList = dataJsonObject.optJSONArray(\"stay\");\n if (stayJSONList != null && stayJSONList.length() > 0)\n {\n for (int j = 0; j < stayJSONList.length(); j++)\n {\n JSONObject serviceJSON = stayJSONList.optJSONObject(j);\n ServResrouce service = new ServResrouce();\n service.setServId(serviceJSON.optString(\"servId\"));\n service.setServName(serviceJSON.optString(\"servName\"));\n service.setServAlias(serviceJSON.optString(\"servAlias\"));\n service.setServType(serviceJSON.optString(\"servType\"));\n service.setRank(serviceJSON.optString(\"rank\"));\n service.setTitleImage(serviceJSON.optString(\"titleImg\"));\n service.setServDesc(serviceJSON.optString(\"servDesc\"));\n stayList.add(service);\n }\n }\n mAirListViewAdapter.notifyDataSetChanged();\n mNoAirAdapter.notifyDataSetChanged();\n mHotelAdapter.notifyDataSetChanged();\n }\n }", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response getBooks() {\n return Response\n .status(Response.Status.OK)\n .entity(getBookService().getBooks())\n .build();\n }", "public static String getResultFromMap(Map<String, Object> result) {\n\t\tString userJsonStr=\"\";\n\t\ttry {\n\t\t\tuserJsonStr = JSON.toJSONString(result);\n\t\t\treturn userJsonStr;\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}", "@Override\n public void onSuccess(int statusCode, Header[] headers, byte[] response) {\n\n String res = new String(response);\n try {\n JSONObject object = new JSONObject(res);\n String objStr = object.get(\"vote_result\") + \"\";\n\n\n } catch (JSONException e) {\n e.printStackTrace();\n Log.d(\"SUN\", \"e : \" + e.toString());\n }\n\n }", "@Override\n protected void onPostExecute(Object o) {\n super.onPostExecute(o);\n\n Toast.makeText(JSONParserActivity.this,\"Response: \"+response.toString(),Toast.LENGTH_LONG).show();\n\n // Parse JSON Data as Java Objects\n\n /*try {\n\n JSONObject jsonObject = new JSONObject(response.toString());\n JSONArray jsonArray = jsonObject.getJSONArray(\"bookstore\");\n\n for(int i=0;i<jsonArray.length();i++){\n JSONObject jObj = jsonArray.getJSONObject(i);\n\n Book book = new Book();\n book.price = jObj.getString(\"price\");\n book.name = jObj.getString(\"name\");\n book.author = jObj.getString(\"author\");\n\n bookList.add(book);\n }\n\n\n // Code here to add data in adapter\n for(Book book : bookList){\n Log.i(\"BOOK\",book.toString());\n adapter.add(book.toString());\n }\n\n\n\n\n listView.setAdapter(adapter);\n\n\n\n\n progressDialog.dismiss();\n\n }catch (Exception e){\n e.printStackTrace();\n }*/\n\n parseNewsApiResponse();\n\n\n }", "protected JSONObject createAllOkKSON() {\r\n\t\tJSONObject jo = new JSONObject();\r\n\t\tjo.put(OnlineKeys.RESULT, \"OK\");\r\n\t\treturn jo;\r\n\t}", "public BookResponse() {\n }", "public JSONObject toJsonObject()\n\t{\n\t\tJSONObject jsonObject = new JSONObject();\n\t\ttry {\n\t\t\tjsonObject.put(\"status\", status);\n\t\t\tif(catrgories != null && catrgories.length > 0){\n\t\t\t\tJSONArray catrgoriesJsonArray = new JSONArray();\n\t\t\t\tfor(ModelCatrgory catrgoriesElement : catrgories){\n\t\t\t\t\tcatrgoriesJsonArray.put(catrgoriesElement.toJsonObject());\n\t\t\t\t}\n\t\t\t\tjsonObject.put(\"catrgories\", catrgoriesJsonArray);\n\t\t\t}\n\t\t\t\n\t\t} catch (JSONException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn jsonObject;\n\t}", "public void parseJson() {\n\n try {\n JSONParser parser = new JSONParser();\n jsonReader = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(\"/resources/bangor-library.json\")));\n JSONObject jsonObj = (JSONObject) parser.parse(jsonReader);\n \n String name = (String) jsonObj.get(\"name\");\n libraryName = name;\n JSONArray extractedBooks = (JSONArray) jsonObj.get(\"books\");\n\n Iterator i = extractedBooks.iterator();\n while (i.hasNext()) {\n rec = new LibraryRecord();\n rec.setLib_name(libraryName);\n JSONObject innerObj = (JSONObject) i.next();\n rec.setBook_name(innerObj.get(\"name\").toString());\n rec.setAuth_name(innerObj.get(\"author\").toString());\n rec.setCat_name(innerObj.get(\"category\").toString());\n\n if (!LibraryAccess.bookShelves.isEmpty()) {\n for (LibraryRecord bookSaved : LibraryAccess.bookShelves) {\n if (this.rec.getHashOfContent() == bookSaved.getHashOfContent()) {\n duplicate = true;\n rec = null;\n }\n }\n if (!duplicate) {\n LibraryAccess.addRecord(rec);\n }\n duplicate = false;\n\n } else {\n System.out.println(\"Library empty : Adding records...\");\n LibraryAccess.addRecord(this.rec);\n }\n }\n\n } catch (FileNotFoundException ex) {\n Logger.getLogger(JsnParser.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IOException ex) {\n Logger.getLogger(JsnParser.class.getName()).log(Level.SEVERE, null, ex);\n } catch (ParseException ex) {\n Logger.getLogger(JsnParser.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public JSONObject getResult()\n {\n return result;\n }", "public void setResultJson(java.lang.String value) {\n this.result_json = value;\n }", "@Override\n\tpublic ZsPkgSearchReply respFormat(String result) throws Exception {\n\t\tZsPkgSearchReply resp = null;\n\t\ttry {\n\t\t\tif (StringUtils.isNotEmpty(result)) {\n\t\t\t\tresult=\"{\"+\"\\\"\"+\"list\"+\"\\\"\"+\":\"+result+\"}\";\n\t\t\t\tresp = JsonUtils.toBean(result, ZsPkgSearchReply.class);\n\t\t\t}\n\t\t} catch (Throwable e) {\n\t\t\tLOGGER.error(\"{} {} parse response data error(Exception),msg:{}\",\n\t\t\t\t\tthis.getClass().getName(), this.getHashCode(),\n\t\t\t\t\te.getMessage(), e);\n\t\t} finally {\n\t\t\tthis.setResponse(resp);\n\t\t}\n\t\treturn this.getResponse();\n\t}", "public abstract String toJsonString();", "public String extractingmessagegetbookings()\r\n\t{\r\n\t\tString localresponseJSONString = responseJSONString;\r\n\t\tJSONObject jsonResult = new JSONObject(localresponseJSONString);\r\n\t\tString getbookingsstring;\r\n\t\tgetbookingsstring = jsonResult.getJSONObject(\"hotelogix\").getJSONObject(\"response\").getJSONObject(\"status\").getString(\"message\");\r\n\t\tSystem.out.println(\"at last getbookings success:\"+getbookingsstring);\r\n\t\treturn getbookingsstring;\r\n\t}", "public Book(JSONObject bookJson){\n // Parse book json\n try{\n this.selfLink = bookJson.getString(\"selfLink\"); // selflink is not inside volumeinfo\n }catch (JSONException e){\n e.printStackTrace();\n }\n JSONObject volumeInfo = null;\n try{\n volumeInfo = bookJson.getJSONObject(\"volumeInfo\");\n }catch (JSONException e){\n e.printStackTrace();\n }\n try{\n this.title = volumeInfo.getString(\"title\");//title is inside volumeinfo\n }catch (JSONException e){\n this.title = \"N/A\";\n e.printStackTrace();\n }\n try{\n this.publisher = volumeInfo.getString(\"publisher\");\n }catch (JSONException e){\n this.publisher = \"N/A\";\n e.printStackTrace();\n }\n try{\n this.year = volumeInfo.getString(\"publishedDate\");\n }catch (JSONException e){\n this.year = \"N/A\";\n e.printStackTrace();\n }\n try{\n this.description = volumeInfo.getString(\"description\");\n }catch (JSONException e){\n this.description = \"N/A\";\n e.printStackTrace();\n }\n\n\n // get the image\n\n JSONObject imageLinks = null;\n try{\n imageLinks = volumeInfo.getJSONObject(\"imageLinks\");\n }catch (JSONException e){\n e.printStackTrace();\n }\n try{\n if(imageLinks!=null){\n this.imageLink = imageLinks.getString(\"thumbnail\");\n }else{\n this.imageLink = \"N/A\";\n }\n\n }catch (JSONException e){\n this.imageLink = \"N/A\";\n e.printStackTrace();\n }\n\n // ISBN is inside industryidentifiers\n JSONArray industryIdentifiers = null;\n try{\n industryIdentifiers = volumeInfo.getJSONArray(\"industryIdentifiers\"); //its an array\n }catch (JSONException e){\n e.printStackTrace();\n }\n try{\n\n this.isbn = industryIdentifiers.getJSONObject(0).getString(\"identifier\");\n }catch (JSONException e){\n e.printStackTrace();\n }\n\n\n // fields with default values\n this.review = \"\";\n this.read = false;\n\n }", "public static OpenLibraryBook parse(JSONObject jsonObject) throws JSONException {\n OpenLibraryBook book = null;\n\n JSONArray names = jsonObject.names();\n if (names != null && names.length() > 0) {\n jsonObject = jsonObject.getJSONObject(names.getString(0));\n book = new OpenLibraryBook();\n if (jsonObject.has(TITLE)) {\n book.title = jsonObject.getString(TITLE);\n }\n if (jsonObject.has(SUBTITLE)) {\n book.subtitle = jsonObject.getString(SUBTITLE);\n }\n if (jsonObject.has(PUBLISHERS)) {\n JSONArray publishers = jsonObject.getJSONArray(PUBLISHERS);\n\n for (int i = 0; i < publishers.length(); i++) {\n JSONObject publisher = publishers.getJSONObject(i);\n if (publisher.has(PUBLISHER_NAME)) {\n book.publishers.add(publisher.getString(PUBLISHER_NAME));\n }\n }\n }\n if (jsonObject.has(IDENTIFIERS)) {\n JSONObject identifiers = jsonObject.getJSONObject(IDENTIFIERS);\n if (identifiers.has(ISBN_10)) {\n JSONArray isbn10 = identifiers.getJSONArray(ISBN_10);\n if (isbn10.length() > 0) {\n book.isbn10 = isbn10.getString(0);\n }\n }\n if (identifiers.has(ISBN_13)) {\n JSONArray isbn13 = identifiers.getJSONArray(ISBN_13);\n if (isbn13.length() > 0) {\n book.isbn13 = isbn13.getString(0);\n }\n }\n }\n if (jsonObject.has(NUMBER_OF_PAGES)) {\n book.numberOfPages = jsonObject.getLong(NUMBER_OF_PAGES);\n }\n if (jsonObject.has(COVER)) {\n JSONObject cover = jsonObject.getJSONObject(COVER);\n if (cover.has(COVER_SMALL)) {\n book.coverLinkSmall = cover.getString(COVER_SMALL);\n }\n if (cover.has(COVER_MEDIUM)) {\n book.coverLinkMedium = cover.getString(COVER_MEDIUM);\n }\n if (cover.has(COVER_LARGE)) {\n book.coverLinkLarge = cover.getString(COVER_LARGE);\n }\n }\n if (jsonObject.has(SUBJECTS)) {\n JSONArray subjects = jsonObject.getJSONArray(SUBJECTS);\n for (int i = 0; i < subjects.length(); i++) {\n JSONObject subject = subjects.getJSONObject(i);\n if (subject.has(SUBJECT_NAME)) {\n book.subjects.add(subject.getString(SUBJECT_NAME));\n }\n }\n }\n if (jsonObject.has(PUBLISH_DATE)) {\n book.publishDate = jsonObject.getString(PUBLISH_DATE);\n }\n if (jsonObject.has(AUTHORS)) {\n JSONArray authors = jsonObject.getJSONArray(AUTHORS);\n for (int i = 0; i < authors.length(); i++) {\n JSONObject author = authors.getJSONObject(i);\n if (author.has(AUTHOR_NAME)) {\n book.authors.add(author.getString(AUTHOR_NAME));\n }\n }\n }\n }\n return book;\n }", "@Override\n public String encode() {\n JsonObject tmp = new JsonObject();\n addIfSet(tmp, \"id\", id);\n addIfSet(tmp, \"courseId\", courseId);\n addIfSet(tmp, \"sheetId\", sheetId);\n addIfSet(tmp, \"maxPoints\", maxPoints);\n addIfSet(tmp, \"type\", type);\n addIfSet(tmp, \"link\", link);\n addIfSet(tmp, \"bonus\", bonus);\n addIfSet(tmp, \"linkName\", linkName);\n addIfSet(tmp, \"submittable\", submittable);\n addIfSet(tmp, \"resultVisibility\", resultVisibility);\n tmp = super.encodeToObject(tmp);\n return tmp.toString();\n }", "@Override\n\tprotected List<?> processResult(ResultSet rs) throws SQLException {\n\t\tList<Book> aList=new ArrayList<Book>();\n\t\t\n\t\twhile(rs.next()){\n\t\t\tBook a=new Book ();\n\t\t\ta.setBookId(rs.getInt(\"bookId\"));\n\t\t\ta.setTitle(rs.getString(\"title\"));\n\t\t\t\n\t\t\taList.add(a);\n\t\t\t\n\t\t}\n\t\treturn aList;\n\t}", "public JsonObject toJson() {\n\t\tJsonObject json = new JsonObject();\n\t\t\n\t\tif (id != null) {\n\t\t\tjson.addProperty( \"id\", id );\n\t\t}\n\t\tif (name != null) {\n\t\t\tjson.addProperty( \"name\", name );\n\t\t}\n\t\tif (version != null) {\n\t\t\tjson.addProperty( \"version\", version );\n\t\t}\n\t\tif (context != null) {\n\t\t\tjson.addProperty( \"context\", context );\n\t\t}\n\t\tif (provider != null) {\n\t\t\tjson.addProperty( \"provider\", provider );\n\t\t}\n\t\tif (description != null) {\n\t\t\tjson.addProperty( \"description\", description );\n\t\t}\n\t\tif (status != null) {\n\t\t\tjson.addProperty( \"status\", status );\n\t\t}\n\t\treturn json;\n\t}", "private int returnParsedJsonObject(String result){\n\n JSONObject resultObject = null;\n int returnedResult = 0;\n try {\n resultObject = new JSONObject(result);\n returnedResult = resultObject.getInt(\"success\");\n } catch (JSONException e) {\n e.printStackTrace();\n }\n Log.d(\"PRUEBA\",\"se obtubo en el JSON: \"+returnedResult);\n return returnedResult;\n }", "public static void convertBookVOToBook() {\n\n\t}", "private BookData convertRowToBook(ResultSet myRs) throws SQLException {\n\t\t\n\t\tString title = myRs.getString(\"title\");\n\t\t\n\t\tString author = myRs.getString(\"author_name\");\n\t\tString publisher = myRs.getString(\"publisher_name\");\n\t\tint id=myRs.getInt(\"book_id\");\n\t\t\n\t\t\n\t\t\n\t\tBookData tempbook = new BookData(title, author, publisher, id);\n\t\treturn tempbook;\n\n\t}", "@Override\n\t\t\t\t\tpublic void handleResponse(String jsonResult, EHttpError error) {\n\t\t\t\t\t\tif(jsonResult!=null&&error == EHttpError.KErrorNone){\n\t\t\t\t\t\t\tSystem.out.println(\"发布书单\"+jsonResult);\n\t\t\t\t\t\t\tthis.completeListener.onQueryComplete(new QueryId(), jsonResult, error);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthis.completeListener.onQueryComplete(new QueryId(), null, error);\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "public JSONObject toJson() {\n }", "public void setResultObject(Map<String, Object> resultObject) {\n this.resultObject = resultObject;\n }", "@RequestMapping(value=\"/{bookId}\",method = RequestMethod.GET)\n\tpublic @ResponseBody\n\tBook getBook(@PathVariable(\"bookId\")Integer bookId){\n\t\tBook book = null;\n\t\ttry{\n\t\t\tSystem.out.println(\"entering into try\");\n\t\t\tbook = bookService.getBookById(bookId);\n\t\t\tSystem.out.println(\"got book by id\");\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println(\"book returned\");\n\t\tSystem.out.println(book.getBookName());\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tStringWriter sw= new StringWriter();\n\t\ttry {\n\t\t\tSystem.out.println(\"1\");\n\t\t\tmapper.writeValue(sw, book);\n\t\t\tSystem.out.println(\"1.5\" + sw.toString());\n\t\t\tSystem.out.println(\"2\");\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn book;\n\t}", "String toJSON();", "public JsonObject toJson(){\n JsonObject json = new JsonObject();\n if(username != null){\n json.addProperty(\"username\" , username);\n }\n json.addProperty(\"title\", title);\n json.addProperty(\"description\", description);\n json.addProperty(\"date\", date);\n json.addProperty(\"alarm\", alarm);\n json.addProperty(\"alert_before\", alert_before);\n json.addProperty(\"location\", location);\n\n return json;\n }", "private static List<Book> parseServerResponse(String serverResponse) {\n if (TextUtils.isEmpty(serverResponse)) {\n Log.e(LOG_TAG, \"Provided server response is empty, exiting method early\");\n return null;\n }\n\n ArrayList<Book> foundBooks = new ArrayList<>();\n JSONObject response = null;\n try {\n response = new JSONObject(serverResponse);\n JSONArray items = response.getJSONArray(\"items\");\n\n for (int i = 0; i < items.length();\n i++) {\n\n JSONObject currentItem = items.getJSONObject(i);\n JSONObject volumeInfo = currentItem.getJSONObject(\"volumeInfo\");\n\n String infoLink = getInfoLink(volumeInfo);\n Bitmap image = getImage(volumeInfo);\n String title = getFullTitle(volumeInfo);\n String authors = getAuthors(volumeInfo);\n String categories = getCategories(volumeInfo);\n\n foundBooks.add(new Book(infoLink, image, title, authors, categories));\n }\n } catch (JSONException e) {\n Log.e(LOG_TAG, \"Problem occured while parsing server response\");\n e.printStackTrace();\n }\n return foundBooks;\n }", "@Override\n\tpublic Object onSuccess(String str) {\n\t\treturn new Gson().fromJson(str, Result.class);\n\t}", "@Override\n public JSONObject toJson() {\n JSONObject json = new JSONObject();\n json.put(\"frontInfo\", frontInfo);\n json.put(\"backInfo\", backInfo);\n\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n String formattedDate = dateFormat.format(startTime);\n\n json.put(\"startTime\", formattedDate);\n json.put(\"cardID\", cardID);\n return json;\n }", "private static JsonProfessor toBasicJson(Professor professor) {\r\n\t\tJsonProfessor jsonProfessor = new JsonProfessor();\r\n\t\tapplyBasicJsonValues(jsonProfessor, professor);\r\n\t\treturn jsonProfessor;\r\n\t}", "private void parse(){\n\t\tfor (Object res : book_results){\n\t\t\tString author = JsonPath.read(res,\"$.name\").toString();\n\t\t\tRole role = new Role(author, \"Author\");\n\t\t\tList<String> books = JsonPath.read(res,\"$./book/author/works_written[*].a:name\");\n\t\t\tmql_map.put(role, books);\n\t\t}\n\t\t\n\t\tfor (Object res : organization_results){\n\t\t\tString businessperson = JsonPath.read(res,\"$.name\").toString();\n\t\t\tRole role = new Role(businessperson, \"Businessperson\");\n\t\t\tList<String> organizations = JsonPath.read(res,\"$./organization/organization_founder/organizations_founded[*].a:name\");\n\t\t\tmql_map.put(role, organizations);\n\t\t}\n\t}", "public static JSONObject getProductPrices(String item) {\n JSONObject returnJson = new JSONObject();\n\n String productDetailsUrl = \"https://api.zinc.io/v1/products/\" + item + \"/offers?retailer=amazon\";\n String clientToken = Constants.zincClientToken + \":\";\n\n URL url = null;\n HttpURLConnection conn = null;\n\n try {\n url = new URL(productDetailsUrl);\n conn = (HttpURLConnection) url.openConnection();\n conn.setRequestMethod(\"GET\");\n conn.setRequestProperty(\"Accept\", \"application/json\"); // maybe i don't need this?\n\n String encoded = new String(new Base64().encode(clientToken.getBytes()));\n conn.setRequestProperty(\"Authorization\", \"Basic \" + encoded);\n\n if (conn.getResponseCode() != 200) {\n System.out.println(\"Failed : HTTP error code : \" + conn.getResponseCode());\n }\n\n InputStreamReader reader = new InputStreamReader((conn.getInputStream()));\n BufferedReader br = new BufferedReader(reader);\n\n String output = \"\";\n String jsonText = \"\";\n// System.out.println(\"Output from Server .... \\n\");\n while ((output = br.readLine()) != null) {\n jsonText += output;\n }\n// System.out.println(jsonText);\n\n returnJson = new JSONObject(jsonText);\n\n } catch (MalformedURLException ex) {\n ex.printStackTrace();\n } catch (IOException ex) {\n ex.printStackTrace();\n } catch (JSONException ex) {\n Logger.getLogger(ZincUtils.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n return returnJson;\n }", "@SuppressWarnings(\"unchecked\")\n\t@POST\n\t@Path(\"result\")\n @Consumes(MediaType.APPLICATION_JSON)\n @Produces(MediaType.APPLICATION_JSON)\n public Response result(String req) throws Exception{\n \t\n \tObjectMapper mapper = new ObjectMapper();\n \tLinkedHashMap res = mapper.readValue(req , LinkedHashMap.class);\n \t\n \tint jobID = (int) ((LinkedHashMap) res.get(\"job\")).get(\"id\");\n \tint saID = JobDAO.sa(jobID);\n \tString xml = (String) res.get(\"result\");\n \t\n \tSystem.out.println(\"Got Results for Job : \"+jobID);\n \t\n \tString status;\n \tif(ResultDAO.insert(new Result(jobID , saID , xml))){\n \t\tstatus = \"ok\";\n \t}else{\n \t\tstatus = \"fail\";\n \t}\n \t\n \tJSONObject response = new JSONObject();\n \tresponse.put(\"status\",status);\n \t\n\t\treturn Response.status(200).entity(response.toJSONString()).build();\n }", "@Override\n\tpublic JSONObject toJson() throws JSONException {\n\t\tJSONObject result = super.toJson();\n\t\treturn result;\n\t}", "void showBookResult(Book book);", "@Override\r\n\t\t\t\t\t\tpublic void result(ResposneBundle b) {\n\t\t\t\t\t\t\tLog.e(\"result\", b.getContent());\r\n\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tJSONObject job = new JSONObject(b.getContent());\r\n\t\t\t\t\t\t\t\tif (job.getInt(\"code\") == -1) {\r\n\t\t\t\t\t\t\t\t\tact.showToast(job.getString(\"msg\"));\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tf.refreshFriendList();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} catch (JSONException 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}", "@Get(\"json\")\n public Representation toJSON() {\n \tString status = getRequestFlag(\"status\", \"valid\");\n \tString access = getRequestFlag(\"location\", \"all\");\n\n \tList<Map<String, String>> metadata = null;\n\n \tString msg = \"no metadata matching query found\";\n\n \ttry {\n \t\tmetadata = getMetadata(status, access,\n \t\t\t\tgetRequestQueryValues());\n \t} catch(ResourceException r){\n \t\tmetadata = new ArrayList<Map<String, String>>();\n \tif(r.getCause() != null){\n \t\tmsg = \"ERROR: \" + r.getCause().getMessage();\n \t}\n \t}\n\n\t\tString iTotalDisplayRecords = \"0\";\n\t\tString iTotalRecords = \"0\";\n\t\tif (metadata.size() > 0) {\n\t\t\tMap<String, String> recordCounts = (Map<String, String>) metadata\n\t\t\t\t\t.remove(0);\n\t\t\tiTotalDisplayRecords = recordCounts.get(\"iTotalDisplayRecords\");\n\t\t\tiTotalRecords = recordCounts.get(\"iTotalRecords\");\n\t\t}\n\n\t\tMap<String, Object> json = buildJsonHeader(iTotalRecords,\n\t\t\t\tiTotalDisplayRecords, msg);\n\t\tList<ArrayList<String>> jsonResults = buildJsonResults(metadata);\n\n\t\tjson.put(\"aaData\", jsonResults);\n\n\t\t// Returns the XML representation of this document.\n\t\treturn new StringRepresentation(JSONValue.toJSONString(json),\n\t\t\t\tMediaType.APPLICATION_JSON);\n }", "@Override\n\t\t\t\t\t\t\tpublic void handleResponse(String jsonResult,\n\t\t\t\t\t\t\t\t\tEHttpError error) {\n\t\t\t\t\t\t\t\tMap<String, Object> map;\n\t\t\t\t\t\t\t\tif (jsonResult != null\n\t\t\t\t\t\t\t\t\t\t&& error == EHttpError.KErrorNone) {\n\t\t\t\t\t\t\t\t\tGson gson = new Gson();\n\t\t\t\t\t\t\t\t\tType type = new TypeToken<Map<String, Object>>() {\n\t\t\t\t\t\t\t\t\t}.getType();\n\t\t\t\t\t\t\t\t\tmap = gson.fromJson(jsonResult, type);\n\t\t\t\t\t\t\t\t\tthis.completeListener.onQueryComplete(\n\t\t\t\t\t\t\t\t\t\t\tGetWishDetail, map, error);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}", "public String toJson() throws Exception {\r\n\t\treturn SimpleJson.HashMapToText(getJsonToken());\r\n\t}", "public String getJson();", "private JSONObject changeAdsJsonObject(){\n JSONObject jsonObject=new JSONObject();\n JSONArray jsonArray=new JSONArray();\n\n try {\n for (int i = 0; i < adsInfoList.size(); i++) {\n AdsClickBean adsClickBean=adsInfoList.get(i);\n JSONObject object=new JSONObject();\n object.put(\"adNum\",adsClickBean.getAdNum());\n object.put(\"clickCount\",adsClickBean.getClickCount());\n object.put(\"shareCount\",0);\n object.put(\"shareAppNum\",0);\n object.put(\"shareClickNum\",0);\n object.put(\"incomeDay\",0);\n object.put(\"times\",adsClickBean.getTimes());\n jsonArray.put(object);\n }\n jsonObject.put(\"list\",jsonArray);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n return jsonObject;\n }", "public JsonObject toJson() {\n JsonObject json = new JsonObject();\n putIfNotNull(json, \"bounceAddress\", bounceAddress);\n putIfNotNull(json, \"from\", from);\n putIfNotNull(json, \"to\", to);\n putIfNotNull(json, \"cc\", cc);\n putIfNotNull(json, \"bcc\", bcc);\n putIfNotNull(json, \"subject\", subject);\n putIfNotNull(json, \"text\", text);\n putIfNotNull(json, \"html\", html);\n if (attachment != null) {\n JsonArray array = new JsonArray();\n for (MailAttachment a : attachment) {\n array.add(a.toJson());\n }\n json.put(\"attachment\", array);\n }\n if (headers != null) {\n json.put(\"headers\", multiMapJson(headers));\n }\n if (fixedHeaders) {\n json.put(\"fixedheaders\", true);\n }\n return json;\n }", "@RequestMapping(value=\"/getbook\", method=RequestMethod.GET, produces = \"application/json\")\n\tpublic Book getBook() {\n\t\treturn new Book(\"1\", \"Marvel Comics\", \"Stanlee\", 200D, \"Awesome book\");\n\t}", "private static JsonBairro toBasicJson(Bairro bairro) {\r\n\t\tJsonBairro jsonBairro = new JsonBairro();\r\n\t\tapplyBasicJsonValues(jsonBairro, bairro);\r\n\t\treturn jsonBairro;\r\n\t}", "public interface BookService {\n NoteResult<List<Book>> loadUserBooks(String userId);\n NoteResult<Map> addBook(String userId, String bookName);\n}", "public String toString() {\n\t String resultJson=\"\";\t \n\t ObjectToJson jsonObj = new ObjectToJson(this.paperAuthorsList);\n\t try {\n\t\t resultJson = jsonObj.convertToJson(); \n\t }\n\t catch(Exception ex) {\n\t\t System.out.println(\"problem in conversion \"+ex.getMessage());\t\t \n\t }\n\t return resultJson;\n }", "@Override\n public void onSuccessResponse(String result) {\n LatestDetailBean detailBean = JSON.parseObject(result, LatestDetailBean.class);\n Log.e(\"TAG\", \"detailBean \" + detailBean.toString());\n initUI(detailBean);\n }", "@Override\n\tpublic void update(HashMap result) {\n\t\t// TODO Auto-generated method stub\n\t\tgetListJson(result);\n\t}", "private static JsonObject getJsonObject(String request_url) {\n JsonObject jsonResponse = new JsonParser().parse(NetworkUtils.getResponseBody(request_url)).getAsJsonObject();\n return jsonResponse;\n }", "public String toJsonObject() {\n if (this.isEmpty()) return \"\";\n StringBuilder sb = new StringBuilder(this.filterExpression.length() + 30);\n sb.append(\"\\\"keyFilter\\\" : \\\"\");\n sb.append(this.filterExpression);\n sb.append(\"\\\"\");\n return sb.toString();\n }", "public JSONObject constructValidHotelJson(String hotelId){\n\t\t\n\t\tHotel hotel = hotelMap.get(hotelId);\n\t\tMap<String, Object> obj = new LinkedHashMap<>();\n\t\t\n\t\tobj.put(\"success\",true);\n\t\tobj.put(\"hotelId\",hotelId);\n\t\tobj.put(\"name\", hotel.getHotelName());\n\t\tobj.put(\"addr\", hotel.getAddress().getStreetAddr());\n\t\tobj.put(\"city\", hotel.getAddress().getCity());\n\t\tobj.put(\"state\", hotel.getAddress().getState());\n\t\tobj.put(\"country\", hotel.getCountry());\n\t\tJSONObject jsonResponse = new JSONObject(obj);\n\t\treturn jsonResponse;\n\t\t\n\t}", "public JSONObject returnAsJSONObject() throws JSONException {\n\t\tJSONObject data = new JSONObject();\n\n\t\tdata.put(\"client_database_id\", this.id);\n\t\tdata.put(\"access_token\", this.access_token);\n\t\tdata.put(\"service\", this.service);\n\t\tdata.put(\"action\", this.action);\n\t\tdata.put(\"objects\", this.objects);\n\t\tdata.put(\"create_date\", this.create_date);\n\n\t\treturn data;\n\t}", "public Map<String, Object> getResultObject() {\n return resultObject;\n }", "public void cacheResult(com.huqiwen.demo.book.model.Books books);" ]
[ "0.6187844", "0.6154019", "0.61165893", "0.5988071", "0.59732914", "0.59643555", "0.58669156", "0.5762749", "0.57010674", "0.56145954", "0.5507815", "0.53338504", "0.5317048", "0.5295569", "0.52847576", "0.527879", "0.5277752", "0.5274796", "0.52630144", "0.5261465", "0.52458483", "0.5244155", "0.5240599", "0.52145195", "0.52056646", "0.5179141", "0.5109208", "0.5109166", "0.5099702", "0.5083737", "0.5081401", "0.5076915", "0.5067871", "0.5028373", "0.5024503", "0.5018942", "0.50068605", "0.50013924", "0.5000513", "0.5000513", "0.49973598", "0.4987447", "0.49677497", "0.49623355", "0.49486706", "0.49475655", "0.48893434", "0.4882861", "0.48810768", "0.48649836", "0.4852665", "0.48365223", "0.4831775", "0.48176163", "0.48137867", "0.48118892", "0.48082817", "0.4806678", "0.47904888", "0.47886652", "0.47858244", "0.47815984", "0.4779999", "0.47792223", "0.47467235", "0.47389433", "0.47306377", "0.47264314", "0.47135302", "0.47066668", "0.46866232", "0.46816796", "0.46769488", "0.4674754", "0.4672497", "0.46705052", "0.46667", "0.4648536", "0.464396", "0.46419322", "0.46408978", "0.46367753", "0.46345696", "0.4631838", "0.4627529", "0.46228185", "0.46176982", "0.46102092", "0.46071732", "0.46026286", "0.4599088", "0.4597556", "0.45952973", "0.45909536", "0.4589667", "0.45814556", "0.45810038", "0.45775923", "0.4569918", "0.45678627" ]
0.80668736
0
Actually write the operation to the database
public void buttonClick(ClickEvent event) { if (!isProcessing) { isProcessing = saveOperacion(oItem, operacionConfirmForm); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void writeDatabase();", "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 }", "public void commit();", "void commit();", "void commit();", "public abstract void commit();", "@Override\r\n\tpublic void save(TQssql sql) {\n\r\n\t}", "public void commit() {\n doCommit();\n }", "public void commit() {\n }", "void commit( boolean onSave );", "public static void ExecuteWriteQuery(String query) {\n\t\ttry {\n\t\t\tStatement st = conn.createStatement();\n\t\t\tst.executeUpdate(query);\n\t\t} catch(SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void commit(){\n \n }", "void commit() {\n }", "@Override\r\n\t\tpublic void commit() throws SQLException {\n\t\t\t\r\n\t\t}", "@Override\n public void commit() {\n }", "@Override\n\tpublic int commit() {\n\t\treturn 0;\n\t}", "void flushDB();", "public void operationSave() {\n\r\n\t\tstatusFeldSave();\r\n\t}", "public void store(DBConnection db) throws IOException;", "@Override\n\tpublic void commit() {\n\n\t}", "@Override\r\n\tpublic void save() {\n\r\n\t\ts.save();\r\n\r\n\t}", "public void commit() {\n\t\tcommitted = true;\n\t}", "private void actuallyWriteData() {\r\n\t\t// Get rid of old data. Getting rid of trips, trip patterns, and blocks\r\n\t\t// is a bit complicated. Need to delete them in proper order because\r\n\t\t// of the foreign keys. Because appear to need to use plain SQL\r\n\t\t// to do so successfully (without reading in objects and then\r\n\t\t// deleting them, which takes too much time and memory). Therefore\r\n\t\t// deleting of this data is done here before writing the data.\r\n\t\tlogger.info(\"Deleting old blocks and associated trips from database...\");\r\n\t\tBlock.deleteFromSandboxRev(session);\r\n\r\n\t\tlogger.info(\"Deleting old trips from database...\");\r\n\t\tTrip.deleteFromSandboxRev(session);\r\n\r\n\t\tlogger.info(\"Deleting old trip patterns from database...\");\r\n\t\tTripPattern.deleteFromSandboxRev(session);\r\n\t\t\r\n\t\t// Now write the data to the database.\r\n\t\t// First write the Blocks. This will also write the Trips, TripPatterns,\r\n\t\t// Paths, and TravelTimes since those all have been configured to be\r\n\t\t// cascade=CascadeType.ALL .\r\n\t\tlogger.info(\"Saving {} blocks (plus associated trips) to database...\", \r\n\t\t\t\tgtfsData.getBlocks().size());\r\n\t\tint c = 0;\r\n\t\tfor (Block block : gtfsData.getBlocks()) {\r\n\t\t\tlogger.debug(\"Saving block #{} with blockId={} serviceId={} blockId={}\",\r\n\t\t\t\t\t++c, block.getId(), block.getServiceId(), block.getId());\r\n\t\t\twriteObject(block);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving routes to database...\");\r\n\t\tRoute.deleteFromSandboxRev(session);\r\n\t\tfor (Route route : gtfsData.getRoutes()) {\r\n\t\t\twriteObject(route);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving stops to database...\");\r\n\t\tStop.deleteFromSandboxRev(session);\r\n\t\tfor (Stop stop : gtfsData.getStops()) {\r\n\t\t\twriteObject(stop);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving agencies to database...\");\r\n\t\tAgency.deleteFromSandboxRev(session);\r\n\t\tfor (Agency agency : gtfsData.getAgencies()) {\r\n\t\t\twriteObject(agency);\r\n\t\t}\r\n\r\n\t\tlogger.info(\"Saving calendars to database...\");\r\n\t\tCalendar.deleteFromSandboxRev(session);\r\n\t\tfor (Calendar calendar : gtfsData.getCalendars()) {\r\n\t\t\twriteObject(calendar);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving calendar dates to database...\");\r\n\t\tCalendarDate.deleteFromSandboxRev(session);\r\n\t\tfor (CalendarDate calendarDate : gtfsData.getCalendarDates()) {\r\n\t\t\twriteObject(calendarDate);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving fare rules to database...\");\r\n\t\tFareRule.deleteFromSandboxRev(session);\r\n\t\tfor (FareRule fareRule : gtfsData.getFareRules()) {\r\n\t\t\twriteObject(fareRule);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving fare attributes to database...\");\r\n\t\tFareAttribute.deleteFromSandboxRev(session);\r\n\t\tfor (FareAttribute fareAttribute : gtfsData.getFareAttributes()) {\r\n\t\t\twriteObject(fareAttribute);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving frequencies to database...\");\r\n\t\tFrequency.deleteFromSandboxRev(session);\r\n\t\tfor (Frequency frequency : gtfsData.getFrequencies()) {\r\n\t\t\twriteObject(frequency);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving transfers to database...\");\r\n\t\tTransfer.deleteFromSandboxRev(session);\r\n\t\tfor (Transfer transfer : gtfsData.getTransfers()) {\r\n\t\t\twriteObject(transfer);\r\n\t\t}\r\n\t}", "public void commit() {\n tryCommit(true);\n }", "@Override\n public void executeQuery() {\n try {\n Put put = new Put(this.userId.getBytes());\n put.add(\"cf\".getBytes(), Bytes.toBytes(this.poi.getTimestamp()), this.poi.getBytes());\n this.table.put(put);\n \n } catch (IOException ex) {\n Logger.getLogger(InsertPOIVisitClient.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void save() {\n DataBuffer.saveDataLocally();\n\n //TODO save to db must be done properly\n DataBuffer.save(session);\n\n //TODO recording saved confirmation\n }", "@Override\n public void writeToDb(List<String> data) {\n\n try {\n openConnection();\n if (validateData((ArrayList<String>) data)) {\n for (String datum : data) {\n bufferedWriter.write(getDate() + \" - \" + datum);\n bufferedWriter.newLine();\n }\n bufferedWriter.write(\"==================\\n\");\n System.out.println(\"All data is written to MS SQL DB\");\n closeConnection();\n }\n } catch (IOException e) {\n System.err.println(\"ERROR!!!\");\n e.printStackTrace();\n }\n\n }", "public void commitChanges() {\n try {\n connection.commit();\n } catch (SQLException sqle) {\n LOGGER.log(Level.SEVERE, \"Unable to commit changes to the DB due to error {0}\", sqle.getMessage());\n }\n }", "protected abstract void doSave();", "private void updateDB() {\n }", "@Override\r\n\tpublic void save(Connection connection, Salary salary) throws SQLException {\n\r\n\t}", "public void commitChanges()\n {\n }", "public void saveData ( ) {\n\t\tinvokeSafe ( \"saveData\" );\n\t}", "public void finalizarInsercion(PreparedStatement stm){\n try {\n stm.executeUpdate();\n }\n catch (Exception ex){\n ex.printStackTrace();\n }\n }", "public void save() {\t\n\t\n\t\n\t}", "public void save();", "public void save();", "public void save();", "public void save();", "public void commitWriter () {\n try {\n writer.commit();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "protected void commit()\n\t{\n\t\t_Status = DBRowStatus.Unchanged;\n\t}", "@Override\n\tpublic void save() {\n\t\tSystem.out.println(\"save method\");\n\t}", "public void save() {\n //write lift information to datastore\n LiftDataAccess lda = new LiftDataAccess();\n ArrayList<Long>newKeys = new ArrayList<Long>();\n for (Lift l : lift) {\n newKeys.add(lda.insert(l));\n }\n\n //write resort information to datastore\n liftKeys = newKeys;\n dao.update(this);\n }", "public void 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 public void commit() throws SQLException {\n if (isTransActionAlive() && !getTransaction().getStatus().isOneOf(TransactionStatus.MARKED_ROLLBACK,\n TransactionStatus.ROLLING_BACK)) {\n // Flush synchronizes the database with in-memory objects in Session (and frees up that memory)\n getSession().flush();\n // Commit those results to the database & ends the Transaction\n getTransaction().commit();\n }\n }", "private void writeObject(Object object) {\r\n\t\tsession.saveOrUpdate(object);\r\n\r\n\t\t// Since can writing large amount of data should use Hibernate \r\n\t\t// batching to make sure don't run out memory.\r\n\t\tcounter++;\r\n\t\tif (counter % HibernateUtils.BATCH_SIZE == 0) {\r\n\t\t\tsession.flush();\r\n\t\t\tsession.clear();\r\n\t\t}\r\n\t}", "public void save() {\n\t\tSystem.out.println(\"-----------from PersonDao.save()\");\n\t}", "private void save(MyContext myContext) {\n if (isMember.unknown || group.actorId == 0 || memberId == 0 || myContext == null ||\n myContext.getDatabase() == null) return;\n\n for (int pass=0; pass<5; pass++) {\n try {\n tryToUpdate(myContext, isMember.toBoolean(false));\n break;\n } catch (SQLiteDatabaseLockedException e) {\n MyLog.i(this, \"update, Database is locked, pass=\" + pass, e);\n if (DbUtils.waitBetweenRetries(\"update\")) {\n break;\n }\n }\n }\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 }", "public void commit() {\n\t\ttry {\n\t\t\tconn.commit();\n\t\t\tSystem.out.println(\"完了したコミット/Commit Done\");\n\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"接続エラーが発生しました/Connection Commit Error Occured\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void saveData() {\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 }", "public static int write(final ILogger aLogger, final PreparedStatement aStm) {\r\n String method= \"write\";\r\n try {\r\n return aStm.executeUpdate();\r\n } catch (Exception e) {\r\n error(aLogger, method, e.toString(), e);\r\n return -1;\r\n }\r\n }", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public void save() {\n }", "@Override\r\n\tpublic boolean commit() {\n\t\ttry {\r\n\t\t\tconn = DriverManager.getConnection(URL, USER, PASS);\r\n\t\t\tString sql = \"commit\";\r\n\t\t\tps = conn.prepareStatement(sql);\r\n\t\t\tps.executeUpdate();\r\n\t\t\trs.close();\r\n\t\t\tps.close();\r\n\t\t\treturn true;\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public <E extends Writeable> void write(String sql);", "public void commit() throws SQLException {\n\t\tconnection.commit();\n\t}", "void commit() throws CommitException;", "@Override\n public void beginDatabaseBatchWrite() throws BlockStoreException {\n if (!autoCommit) {\n return;\n }\n if (instrument)\n beginMethod(\"beginDatabaseBatchWrite\");\n\n batch = db.createWriteBatch();\n uncommited = new HashMap<ByteBuffer, byte[]>();\n uncommitedDeletes = new HashSet<ByteBuffer>();\n utxoUncommittedCache = new HashMap<ByteBuffer, UTXO>();\n utxoUncommittedDeletedCache = new HashSet<ByteBuffer>();\n autoCommit = false;\n if (instrument)\n endMethod(\"beginDatabaseBatchWrite\");\n }", "public void saveOrUpdate(Transaction transaction) throws Exception;", "public void storeValues() throws SQLException { //store values into the database\n \tstoreValuesDump();\n \tstoreValuesMatl();\n }", "@PostPersist\n\t@PostUpdate\n\tprivate void storeChangesToDw() {\n\t}", "public final void commit() throws com.mendix.core.CoreException\n\t{\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\n\t}", "public final void commit() throws com.mendix.core.CoreException\n\t{\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\n\t}", "public final void commit() throws com.mendix.core.CoreException\n\t{\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\n\t}", "public final void commit() throws com.mendix.core.CoreException\n\t{\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\n\t}", "private boolean saveData()\r\n {\n if (tableDataValid())\r\n {\r\n // get the modified rows\r\n Vector vecModifiedRows = getModifiedRows() ;\r\n if (vecModifiedRows != null)\r\n {\r\n System.out.println(\"obtd modified rows successfuly\") ;\r\n }\r\n\r\n HashMap hashStoredProcedure = (HashMap)tableStructureBeanPCDR.getHashStoredProceduresForThisTable();\r\n if(hashStoredProcedure == null)\r\n System.out.println(\"hashStoredProcedure == null\");\r\n //Get the update stored procedure associated witht this table.\r\n StoredProcedureBean updateStoredProcedure =\r\n (StoredProcedureBean)hashStoredProcedure.get(new Integer(1));\r\n\r\n RequestTxnBean requestTxnBean = new RequestTxnBean();\r\n requestTxnBean.setAction(\"MODIFY_DATA\");\r\n requestTxnBean.setStoredProcedureBean(updateStoredProcedure);\r\n requestTxnBean.setRowsToModify(vecModifiedRows) ;\r\n\r\n // the servlet will return if the saving process was successful or not\r\n Boolean success = (Boolean)getDataFromServlet(requestTxnBean) ;\r\n if (success == null) // Error while saving data\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"saveFail_exceptionCode.1102\");\r\n\r\n CoeusOptionPane.showInfoDialog(msg);\r\n return false;\r\n }\r\n else\r\n {//Data Saved Successfully\r\n saveRequired = false;\r\n return true;\r\n }\r\n\r\n }// end if data validation\r\n else\r\n {\r\n return false;\r\n }\r\n }", "protected abstract boolean pvSaveBalance(OperationDataClass pOperationData, Boolean pInsert) throws DBSIOException;", "@Override\r\n\tpublic int save() throws NotesApiException {\n\t\treturn 0;\r\n\t}", "void commit(Session session);", "@Override\n public void commitTx() {\n \n }", "@Override\n\tpublic void save() {\n\t\t\n\t}", "@Override\n\tpublic void save() {\n\t\t\n\t}", "public void startDBWrite() {\r\n this.setStatus(false);\r\n this.isDBOutStarted = true;\r\n if (!this.is_alg_started || (this.is_alg_started && ((this.is_already_read_from_DB && this.UseFile.isSelected())\r\n || (!this.is_already_read_from_DB && this.UseDB.isSelected())))) {\r\n this.startALG(true);\r\n } else {\r\n // setStatus(true);\r\n\r\n Thread t = new Thread(new Runnable() {\r\n @Override\r\n public void run() {\r\n Controller.this.isDBWriteInUse = true;\r\n Controller.this.writeIntoDBProgress.setVisible(true);\r\n Controller.this.cw.setWritesOnlyFiles(true);\r\n Controller.this.cw.writeFile(false, false, false);\r\n String pw = \"\";\r\n for (int i = 0; i < Controller.this.rpasswdfield.getPassword().length; i++)\r\n pw += Controller.this.rpasswdfield.getPassword()[i];\r\n\r\n Controller.this.dbc_in = new DBConnect(Controller.this.rhostfield.getText(),\r\n Controller.this.rdatabasefield.getText(), Controller.this.ruserfield.getText(), pw,\r\n Integer.parseInt(Controller.this.rportfield.getText()),\r\n Controller.this.otablenamefield.getText(), COLUMN_NAMES_FOR_DB_OUT);\r\n\r\n // File: Controller.CLASSES_TMP_FILENAME\r\n // Columns: Controller.COLUMN_NAMES_FOR_DB_OUT\r\n try {\r\n Controller.this.dbc_in.stillWorks = true;\r\n Controller.this.dbc_in.maxProgerss = Controller.this.cw.countNodesWithClasses;\r\n Controller.this.dbc_in.writeFromFileIntoDB();\r\n } catch (IOWrapperException iow_e) {\r\n System.err.println(\"Error while writing into DB!\\nConnection failed!\");\r\n JOptionPane.showMessageDialog(null, \"Error while writing into DB!\\nConnection failed!\", \"Error\",\r\n JOptionPane.ERROR_MESSAGE);\r\n Controller.this.dBInError = true;\r\n Controller.this.dbc_in.stillWorks = false;\r\n return;\r\n } catch (IOIteratorException ioi_e) {\r\n System.err.println(\"Error while writing into DB!\\nCould not iterate over results!\");\r\n JOptionPane.showMessageDialog(null,\r\n \"Error while writing into DB!\\nCould not iterate over results!\", \"Error\",\r\n JOptionPane.ERROR_MESSAGE);\r\n Controller.this.dBInError = true;\r\n Controller.this.dbc_in.stillWorks = false;\r\n return;\r\n }\r\n }// run()\r\n });// Thread\r\n\r\n t.start();\r\n Timer timer = new Timer();\r\n timer.schedule(new ObserveProgress(timer, t), 200, 2000);\r\n this.isDBOutStarted = false;\r\n }\r\n }", "public void saveData(){\r\n file.executeAction(modelStore);\r\n }", "void sendTransactionToServer()\n \t{\n \t\t//json + sql magic\n \t}", "protected void doDML(int operation, TransactionEvent e) {\n super.doDML(operation, e);\n }", "protected void doDML(int operation, TransactionEvent e) {\n super.doDML(operation, e);\n }", "protected void doDML(int operation, TransactionEvent e) {\n super.doDML(operation, e);\n }", "protected void doDML(int operation, TransactionEvent e) {\n super.doDML(operation, e);\n }", "public void writeSQL(SQLOutput stream) throws SQLException{\r\n}", "private void saveData(){\n\t\tdataBase=mHelper.getWritableDatabase();\n\t\tContentValues values=new ContentValues();\n\t\t\n\t\tvalues.put(DbHelper.KEY_NNAME,nname);\n\t\t//values.put(DbHelper.KEY_LNAME,lname );\n\t\t\n\t\tSystem.out.println(\"\");\n\t\tif(isUpdate)\n\t\t{ \n\t\t\t//update database with new data \n\t\t\tdataBase.update(DbHelper.TABLE_NOTE, values, DbHelper.KEY_ID+\"=\"+id, null);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//insert data into database\n\t\t\tdataBase.insert(DbHelper.TABLE_NOTE, null, values);\n\t\t}\n\t\t//close database\n\t\tdataBase.close();\n\t\tfinish();\n\t\t\n\t\t\n\t}", "void execute(final ReadWriteTransaction readWriteTransaction);", "public boolean save();", "@Override\n\tpublic void commit(boolean onSave) {\n\t\tsuper.commit(onSave);\n\t}", "private boolean write(String sql) {\n if (!checkConnected()) {\n return false;\n }\n\n PreparedStatement statement = null;\n try {\n statement = connection.prepareStatement(sql);\n statement.executeUpdate();\n return true;\n }\n catch (SQLException ex) {\n if (!sql.equalsIgnoreCase(\"ALTER TABLE `\" + tablePrefix + \"users` DROP COLUMN `party` ;\")) {\n printErrors(ex);\n }\n return false;\n }\n finally {\n if (statement != null) {\n try {\n statement.close();\n }\n catch (SQLException e) {\n // Ignore\n }\n }\n }\n }", "private DatabaseWriteResult(UploadStrategy strategy) {\n savedEntries = new ArrayList<>(1000);\n databaseSize = -1L;\n error = null;\n uploadStrategy = strategy;\n }", "@Override\n\tprotected String sql() throws OperationException {\n\t\treturn sql.insert(tbObj, fieldValue);\n\t}", "public void doSave(T objectToSave) throws SQLException;", "@Override\n public void doSave(FasciaOrariaBean bean) throws SQLException {\n Connection con = null;\n PreparedStatement statement = null;\n String sql = \"INSERT INTO fasciaoraria VALUES (?,?)\";\n try {\n con = DriverManagerConnectionPool.getConnection();\n statement = con.prepareStatement(sql);\n statement.setInt(1, bean.getId());\n statement.setString(2, bean.getFascia());\n System.out.println(\"doSave=\" + 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 }", "private void updateDatabase() {\n\t\tAbstractSerializer serializer = new CineplexSerializer();\n\t\tArrayList<String> updatedRecords = serializer.serialize(records);\n\t\tDatabaseHandler.writeToDatabase(DATABASE_NAME, updatedRecords);\n\t}", "public void saveOperate(OperateBO operateBo) throws RollbackableException {\n }", "public void insert() throws SQLException;", "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}", "public void pass(String order) throws SQLException\n\t{\n\t\tStatement stmt = con.createStatement();\n\t\ttry\n\t\t{\n\t\t\tstmt.executeUpdate(order);\n\t\t} finally\n\t\t{\n\t\t\tif (stmt != null)\n\t\t\t{\n\t\t\t\tstmt.close(); // aint giving the solution but good practice\n\t\t\t}\n\t\t}\n\t}", "public String execute() throws SQLException\n {\n setDestPath(\"/home/hadoop/NetBeansProjects/RestfulAPI/document/\");\n\n try{\n System.out.println(\"name: \" + getName());\n\n System.out.println(\"Src File name: \" + getMyFile());\n System.out.println(\"Dst File name: \" + getMyFileFileName());\n\n File destFile = new File(getDestPath(), getMyFileFileName());\n FileUtils.copyFile(getMyFile(), destFile);\n System.out.println(\"Berhasil\");\n \n DBConnector connector = new DBConnector();\n Connection conn = connector.getConn();\n String sql = \"insert into book (name,sinopsis,author) values (?,?,?)\";\n PreparedStatement stmt = null;\n stmt = conn.prepareStatement(sql);\n stmt.setString(1, name);\n stmt.setString(2, sinopsis);\n stmt.setString(3, author);\n stmt.executeUpdate();\n// PreparedStatement ps = conn.prepareStatement(sql);\n// ResultSet rs0 = ps.executeQuery();\n \n// se.writeFakta(conn, namaperiod, list,Integer.parseInt(periodselect),Integer.parseInt(modelfakta));\n \n }catch(IOException e){\n e.printStackTrace();\n return ERROR;\n }\n\n return SUCCESS;\n }" ]
[ "0.727645", "0.69853014", "0.682288", "0.68119687", "0.68119687", "0.6651227", "0.6626136", "0.66161436", "0.6606788", "0.6594516", "0.6529939", "0.6527128", "0.64654034", "0.6457262", "0.6450723", "0.6391775", "0.63769174", "0.63738495", "0.63286525", "0.63003904", "0.62845635", "0.62734425", "0.62536144", "0.6228254", "0.62104607", "0.6202514", "0.6185201", "0.61693954", "0.61506826", "0.61445117", "0.6123411", "0.6118895", "0.6117153", "0.6081382", "0.6080336", "0.60758424", "0.60758424", "0.60758424", "0.60758424", "0.60287976", "0.6028395", "0.6015113", "0.6004041", "0.5991843", "0.59899205", "0.59864855", "0.5986208", "0.59825283", "0.5978577", "0.59741944", "0.59622437", "0.59571064", "0.59491706", "0.59440917", "0.59440917", "0.59440917", "0.59440917", "0.59440917", "0.59405965", "0.59167844", "0.5916621", "0.5915051", "0.59141666", "0.5907693", "0.5899373", "0.58953017", "0.5874837", "0.5867997", "0.5867997", "0.5867997", "0.5867997", "0.5862934", "0.58593684", "0.5857569", "0.5850289", "0.58368707", "0.58366", "0.58366", "0.5834526", "0.58342725", "0.58321434", "0.5830574", "0.5830574", "0.5830574", "0.5830574", "0.58266765", "0.5826478", "0.58079195", "0.5805897", "0.5805407", "0.5798736", "0.57953763", "0.5794672", "0.57897955", "0.57833403", "0.57820904", "0.57807773", "0.5776545", "0.5773253", "0.57731104", "0.57730246" ]
0.0
-1
Actually write the operation to the database
private boolean saveOperacion(BeanItem<Operacion> oItem, Form operacionConfirmForm) { boolean isMulti = (cuentasSet!=null); EntityTransaction trans = null; EntityManager em = null; try { em = ConfigurationUtil.getNewEntityManager(); MutableLocalEntityProvider<Operacion> operacionEP = new BatchableLocalEntityProvider<Operacion>( Operacion.class, em); operacionEP.setTransactionsHandledByProvider(false); MutableLocalEntityProvider<Cuenta> cuentaEP = new BatchableLocalEntityProvider<Cuenta>( Cuenta.class, em); MutableLocalEntityProvider<Usuario> usuarioEP = new BatchableLocalEntityProvider<Usuario>( Usuario.class, em); cuentaEP.setTransactionsHandledByProvider(false); MutableLocalEntityProvider<Saldo> saldoEP = new BatchableLocalEntityProvider<Saldo>( Saldo.class, em); saldoEP.setTransactionsHandledByProvider(false); String logCaja = null; trans = em.getTransaction(); trans.begin(); if (!isMulti) { cuentasSet = new HashSet<Cuenta>(); cuentasSet.add(cuenta); } Operacion oper = null; for (Cuenta cn : cuentasSet) { oper = (isMulti ? ((Operacion)oItem.getBean()).clone() : (Operacion)oItem.getBean()); oper.setUsuario(em.find(Usuario.class, (SessionHandler.get().getId()))); if (oper.getFechaDeCobro()==null && (!oper.getTipo().equals(Tipo.CHEQUE.toString()))) oper.setFechaDeCobro(oper.getFecha()); cn = cuentaEP.getEntityManager().find(Cuenta.class, cn.getId(), LockModeType.PESSIMISTIC_WRITE); assert cn!=null; if (oper.getIsCargo()) { oper.setPen(oper.getPen().multiply(new BigDecimal(-1)).setScale(2)); oper.setUsd(oper.getUsd().multiply(new BigDecimal(-1)).setScale(2)); } Boolean isEfectivo = oper.getTipo().equals(Tipo.EFECTIVO.toString()); //logger.info("Got operacion to save: " + oper); oper.setIsPen((oper.getPen().compareTo(new BigDecimal(0)) > 0 || oper.getPen().compareTo(new BigDecimal(0))< 0) ? true : false); Boolean isCorEfectivo = oper.getIsCorrection() ? oper.getOperacionCorrected().getTipo().equals(Tipo.EFECTIVO.toString()) : isEfectivo; // In case of correction and same type (EFECTIVO/BANCO) or is of type Caja/Banco // Only add the difference if (oper.getIsCorrection() && (isEfectivo.equals(isCorEfectivo) || cn.getIsCaja())) { Operacion oldOperacion = oper.getOperacionCorrected(); BigDecimal diffPen = oper.getPen().subtract( oldOperacion.getPen()); oper.setPen(diffPen); BigDecimal diffUsd = oper.getUsd().subtract( oldOperacion.getUsd()); oper.setUsd(diffUsd); } else if (oper.getIsCorrection() && (!cn.getIsCaja()) && ((!isEfectivo.equals(isCorEfectivo)) || ((!isEfectivo) && (!isCorEfectivo) && (!oper.getBanco().equals(oper.getOperacionCorrected().getBanco()))))) { // If isCorrection and there are differences of types we have to move between Efectivo and Bancario // make a reverse operation Operacion op = oper.getOperacionCorrected().clone(); op.setIsCorrection(true); op.setDescripcion(oper.getDescripcion()); op.setOperacionCorrected(oper.getOperacionCorrected()); op.setBeneficiario(oper.getBeneficiario()); op.setCentroCosto(oper.getCentroCosto()); op.setCuentaContable(oper.getCuentaContable()); op.setRubroInstitucional(oper.getRubroInstitucional()); op.setRubroProyecto(oper.getRubroProyecto()); op.setLugarGasto(oper.getLugarGasto()); op.setBanco(oper.getBanco()); op.setChequeNumero(oper.getChequeNumero()); op.setDocNumero(oper.getDocNumero()); op.setDni(oper.getDni()); op.setTipoDocumento(oper.getTipoDocumento()); if (ConfigurationUtil.getUltimoMesCerrado().before(oper.getOperacionCorrected().getFecha())) op.setFecha(ConfigurationUtil.dateAddSeconds(oper.getOperacionCorrected().getFecha(), 1)); else op.setFecha(ConfigurationUtil.dateAddSeconds(ConfigurationUtil.getUltimoMesCerrado(), 1)); op.setPen(oper.getOperacionCorrected().getPen().multiply(new BigDecimal(-1))); op.setUsd(oper.getOperacionCorrected().getUsd().multiply(new BigDecimal(-1))); cn.setPen(cn.getPen().add(op.getPen())); cn.setUsd(cn.getUsd().add(op.getUsd())); cn = cuentaEP.updateEntity(cn); op.setSaldoPen(cn.getPen()); op.setSaldoUsd(cn.getUsd()); Object operAdded = operacionEP.addEntity(op); Object newOperacionId = ((Operacion)operAdded).getId(); op.setId((Long)newOperacionId); // NEW CODE REVERSE the Caja/Banco // NEW CODE - added operacion to caja Cuenta logger.info(processCajaBancoOperacion(cn, (Operacion)operAdded, em, cuentaEP, operacionEP)); if (newOperacionId!=null) recalculateSaldos((Operacion)operAdded, em); } String logCuenta = "Cuenta numero: " + cn.getNumero() + " , antes PEN: " + cn.getPen() + ", USD: " + cn.getUsd(); // Set the BancoCuenta beacause otherwise it gets lost if (oper.getBanco()!=null) { Cuenta bancoCuenta = em.find(Cuenta.class, oper.getBanco().getBancoCuenta().getId()); Banco banco = em.find(Banco.class, oper.getBanco().getId()); banco.setBancoCuenta(bancoCuenta); oper.setBanco(banco); } Object operAdded = operacionEP.addEntity(oper); Object newOperacionId = ((Operacion)operAdded).getId(); cn = recalculateSaldos((Operacion)operAdded, em); logger.info("new oper id: " + newOperacionId); oper.setId((Long) newOperacionId); if (operAdded!=null) logger.info("Added new operacion: " + operAdded.toString()); logger.info("Updated cn: " + cn.toString()); // PROCESS CAJA/BANCO if (!cn.getIsCaja()) { logger.info("OPERACION en CAJA/BANCO processing normally for non Caja"); logger.info(processCajaBancoOperacion(cn, (Operacion)operAdded, em, cuentaEP, operacionEP)); } logger.info("Nueva operacion " + (oper.getIsCorrection() ? " CORRECCION" : "") + ": " + oper); logCuenta += ", ahora PEN: " + cn.getPen() + ", USD: " + cn.getUsd(); logger.info(logCuenta); cuenta = cn; } if (trans!=null && trans.isActive()) { logger.info("trans active commiting..."); trans.commit(); logger.info("commit done"); em.close(); } logger.info("Cuenta for redrawing: " + cuenta); removeComponent(operacionConfirmForm); if (operacionTable instanceof AccountantCajaTable) ((AccountantCajaTable)operacionTable).redraw(cuenta, oper.getIsPen(), true, false); else if (operacionTable!=null) operacionTable.drawCuentaForm(cuenta, true); if (cuentaTable!=null) cuentaTable.redraw(); Window par = getWindow().getParent(); par.removeWindow(getWindow()); if (!isMulti && ConfigurationUtil.is("REPORTS_COMPROBANTE_OPEN")) ReportHelper.generateComprobante(oper, par); if (!isMulti && ConfigurationUtil.is("REPORTS_COMPROBANTE_PRINT")&&(!SessionHandler.isAdmin())&&(!SessionHandler.isContador())) { JasperPrint jrPrint = ReportHelper.printComprobante(oper, par); boolean isPrinted = false; if (((VasjaApp)par.getApplication()).getPrintHelper()!=null) isPrinted = ((VasjaApp)par.getApplication()).getPrintHelper().print(jrPrint, true); if (!isPrinted) throw new Exception("No se podia imprimir comprobante"); } } catch (Exception e) { if ((trans!=null) && (trans.isActive())) { logger.info("Trans is active rolling back..."); trans.rollback(); logger.info("Rolled back"); em.close(); } e.printStackTrace(); getWindow().showNotification("Problema con la operacion ", e.getMessage(), Notification.TYPE_ERROR_MESSAGE); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void writeDatabase();", "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 }", "public void commit();", "void commit();", "void commit();", "public abstract void commit();", "@Override\r\n\tpublic void save(TQssql sql) {\n\r\n\t}", "public void commit() {\n doCommit();\n }", "public void commit() {\n }", "void commit( boolean onSave );", "public static void ExecuteWriteQuery(String query) {\n\t\ttry {\n\t\t\tStatement st = conn.createStatement();\n\t\t\tst.executeUpdate(query);\n\t\t} catch(SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void commit(){\n \n }", "void commit() {\n }", "@Override\r\n\t\tpublic void commit() throws SQLException {\n\t\t\t\r\n\t\t}", "@Override\n public void commit() {\n }", "@Override\n\tpublic int commit() {\n\t\treturn 0;\n\t}", "void flushDB();", "public void operationSave() {\n\r\n\t\tstatusFeldSave();\r\n\t}", "public void store(DBConnection db) throws IOException;", "@Override\n\tpublic void commit() {\n\n\t}", "@Override\r\n\tpublic void save() {\n\r\n\t\ts.save();\r\n\r\n\t}", "public void commit() {\n\t\tcommitted = true;\n\t}", "private void actuallyWriteData() {\r\n\t\t// Get rid of old data. Getting rid of trips, trip patterns, and blocks\r\n\t\t// is a bit complicated. Need to delete them in proper order because\r\n\t\t// of the foreign keys. Because appear to need to use plain SQL\r\n\t\t// to do so successfully (without reading in objects and then\r\n\t\t// deleting them, which takes too much time and memory). Therefore\r\n\t\t// deleting of this data is done here before writing the data.\r\n\t\tlogger.info(\"Deleting old blocks and associated trips from database...\");\r\n\t\tBlock.deleteFromSandboxRev(session);\r\n\r\n\t\tlogger.info(\"Deleting old trips from database...\");\r\n\t\tTrip.deleteFromSandboxRev(session);\r\n\r\n\t\tlogger.info(\"Deleting old trip patterns from database...\");\r\n\t\tTripPattern.deleteFromSandboxRev(session);\r\n\t\t\r\n\t\t// Now write the data to the database.\r\n\t\t// First write the Blocks. This will also write the Trips, TripPatterns,\r\n\t\t// Paths, and TravelTimes since those all have been configured to be\r\n\t\t// cascade=CascadeType.ALL .\r\n\t\tlogger.info(\"Saving {} blocks (plus associated trips) to database...\", \r\n\t\t\t\tgtfsData.getBlocks().size());\r\n\t\tint c = 0;\r\n\t\tfor (Block block : gtfsData.getBlocks()) {\r\n\t\t\tlogger.debug(\"Saving block #{} with blockId={} serviceId={} blockId={}\",\r\n\t\t\t\t\t++c, block.getId(), block.getServiceId(), block.getId());\r\n\t\t\twriteObject(block);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving routes to database...\");\r\n\t\tRoute.deleteFromSandboxRev(session);\r\n\t\tfor (Route route : gtfsData.getRoutes()) {\r\n\t\t\twriteObject(route);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving stops to database...\");\r\n\t\tStop.deleteFromSandboxRev(session);\r\n\t\tfor (Stop stop : gtfsData.getStops()) {\r\n\t\t\twriteObject(stop);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving agencies to database...\");\r\n\t\tAgency.deleteFromSandboxRev(session);\r\n\t\tfor (Agency agency : gtfsData.getAgencies()) {\r\n\t\t\twriteObject(agency);\r\n\t\t}\r\n\r\n\t\tlogger.info(\"Saving calendars to database...\");\r\n\t\tCalendar.deleteFromSandboxRev(session);\r\n\t\tfor (Calendar calendar : gtfsData.getCalendars()) {\r\n\t\t\twriteObject(calendar);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving calendar dates to database...\");\r\n\t\tCalendarDate.deleteFromSandboxRev(session);\r\n\t\tfor (CalendarDate calendarDate : gtfsData.getCalendarDates()) {\r\n\t\t\twriteObject(calendarDate);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving fare rules to database...\");\r\n\t\tFareRule.deleteFromSandboxRev(session);\r\n\t\tfor (FareRule fareRule : gtfsData.getFareRules()) {\r\n\t\t\twriteObject(fareRule);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving fare attributes to database...\");\r\n\t\tFareAttribute.deleteFromSandboxRev(session);\r\n\t\tfor (FareAttribute fareAttribute : gtfsData.getFareAttributes()) {\r\n\t\t\twriteObject(fareAttribute);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving frequencies to database...\");\r\n\t\tFrequency.deleteFromSandboxRev(session);\r\n\t\tfor (Frequency frequency : gtfsData.getFrequencies()) {\r\n\t\t\twriteObject(frequency);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving transfers to database...\");\r\n\t\tTransfer.deleteFromSandboxRev(session);\r\n\t\tfor (Transfer transfer : gtfsData.getTransfers()) {\r\n\t\t\twriteObject(transfer);\r\n\t\t}\r\n\t}", "public void commit() {\n tryCommit(true);\n }", "@Override\n public void executeQuery() {\n try {\n Put put = new Put(this.userId.getBytes());\n put.add(\"cf\".getBytes(), Bytes.toBytes(this.poi.getTimestamp()), this.poi.getBytes());\n this.table.put(put);\n \n } catch (IOException ex) {\n Logger.getLogger(InsertPOIVisitClient.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void save() {\n DataBuffer.saveDataLocally();\n\n //TODO save to db must be done properly\n DataBuffer.save(session);\n\n //TODO recording saved confirmation\n }", "@Override\n public void writeToDb(List<String> data) {\n\n try {\n openConnection();\n if (validateData((ArrayList<String>) data)) {\n for (String datum : data) {\n bufferedWriter.write(getDate() + \" - \" + datum);\n bufferedWriter.newLine();\n }\n bufferedWriter.write(\"==================\\n\");\n System.out.println(\"All data is written to MS SQL DB\");\n closeConnection();\n }\n } catch (IOException e) {\n System.err.println(\"ERROR!!!\");\n e.printStackTrace();\n }\n\n }", "public void commitChanges() {\n try {\n connection.commit();\n } catch (SQLException sqle) {\n LOGGER.log(Level.SEVERE, \"Unable to commit changes to the DB due to error {0}\", sqle.getMessage());\n }\n }", "protected abstract void doSave();", "private void updateDB() {\n }", "@Override\r\n\tpublic void save(Connection connection, Salary salary) throws SQLException {\n\r\n\t}", "public void commitChanges()\n {\n }", "public void saveData ( ) {\n\t\tinvokeSafe ( \"saveData\" );\n\t}", "public void finalizarInsercion(PreparedStatement stm){\n try {\n stm.executeUpdate();\n }\n catch (Exception ex){\n ex.printStackTrace();\n }\n }", "public void save() {\t\n\t\n\t\n\t}", "public void save();", "public void save();", "public void save();", "public void save();", "protected void commit()\n\t{\n\t\t_Status = DBRowStatus.Unchanged;\n\t}", "public void commitWriter () {\n try {\n writer.commit();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void save() {\n\t\tSystem.out.println(\"save method\");\n\t}", "public void save() {\n //write lift information to datastore\n LiftDataAccess lda = new LiftDataAccess();\n ArrayList<Long>newKeys = new ArrayList<Long>();\n for (Lift l : lift) {\n newKeys.add(lda.insert(l));\n }\n\n //write resort information to datastore\n liftKeys = newKeys;\n dao.update(this);\n }", "public void 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 public void commit() throws SQLException {\n if (isTransActionAlive() && !getTransaction().getStatus().isOneOf(TransactionStatus.MARKED_ROLLBACK,\n TransactionStatus.ROLLING_BACK)) {\n // Flush synchronizes the database with in-memory objects in Session (and frees up that memory)\n getSession().flush();\n // Commit those results to the database & ends the Transaction\n getTransaction().commit();\n }\n }", "private void writeObject(Object object) {\r\n\t\tsession.saveOrUpdate(object);\r\n\r\n\t\t// Since can writing large amount of data should use Hibernate \r\n\t\t// batching to make sure don't run out memory.\r\n\t\tcounter++;\r\n\t\tif (counter % HibernateUtils.BATCH_SIZE == 0) {\r\n\t\t\tsession.flush();\r\n\t\t\tsession.clear();\r\n\t\t}\r\n\t}", "public void save() {\n\t\tSystem.out.println(\"-----------from PersonDao.save()\");\n\t}", "private void save(MyContext myContext) {\n if (isMember.unknown || group.actorId == 0 || memberId == 0 || myContext == null ||\n myContext.getDatabase() == null) return;\n\n for (int pass=0; pass<5; pass++) {\n try {\n tryToUpdate(myContext, isMember.toBoolean(false));\n break;\n } catch (SQLiteDatabaseLockedException e) {\n MyLog.i(this, \"update, Database is locked, pass=\" + pass, e);\n if (DbUtils.waitBetweenRetries(\"update\")) {\n break;\n }\n }\n }\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 }", "public void commit() {\n\t\ttry {\n\t\t\tconn.commit();\n\t\t\tSystem.out.println(\"完了したコミット/Commit Done\");\n\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"接続エラーが発生しました/Connection Commit Error Occured\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void saveData() {\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 }", "public static int write(final ILogger aLogger, final PreparedStatement aStm) {\r\n String method= \"write\";\r\n try {\r\n return aStm.executeUpdate();\r\n } catch (Exception e) {\r\n error(aLogger, method, e.toString(), e);\r\n return -1;\r\n }\r\n }", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public void save() {\n }", "@Override\r\n\tpublic boolean commit() {\n\t\ttry {\r\n\t\t\tconn = DriverManager.getConnection(URL, USER, PASS);\r\n\t\t\tString sql = \"commit\";\r\n\t\t\tps = conn.prepareStatement(sql);\r\n\t\t\tps.executeUpdate();\r\n\t\t\trs.close();\r\n\t\t\tps.close();\r\n\t\t\treturn true;\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public <E extends Writeable> void write(String sql);", "public void commit() throws SQLException {\n\t\tconnection.commit();\n\t}", "void commit() throws CommitException;", "@Override\n public void beginDatabaseBatchWrite() throws BlockStoreException {\n if (!autoCommit) {\n return;\n }\n if (instrument)\n beginMethod(\"beginDatabaseBatchWrite\");\n\n batch = db.createWriteBatch();\n uncommited = new HashMap<ByteBuffer, byte[]>();\n uncommitedDeletes = new HashSet<ByteBuffer>();\n utxoUncommittedCache = new HashMap<ByteBuffer, UTXO>();\n utxoUncommittedDeletedCache = new HashSet<ByteBuffer>();\n autoCommit = false;\n if (instrument)\n endMethod(\"beginDatabaseBatchWrite\");\n }", "public void saveOrUpdate(Transaction transaction) throws Exception;", "public void storeValues() throws SQLException { //store values into the database\n \tstoreValuesDump();\n \tstoreValuesMatl();\n }", "@PostPersist\n\t@PostUpdate\n\tprivate void storeChangesToDw() {\n\t}", "public final void commit() throws com.mendix.core.CoreException\n\t{\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\n\t}", "public final void commit() throws com.mendix.core.CoreException\n\t{\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\n\t}", "public final void commit() throws com.mendix.core.CoreException\n\t{\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\n\t}", "public final void commit() throws com.mendix.core.CoreException\n\t{\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\n\t}", "private boolean saveData()\r\n {\n if (tableDataValid())\r\n {\r\n // get the modified rows\r\n Vector vecModifiedRows = getModifiedRows() ;\r\n if (vecModifiedRows != null)\r\n {\r\n System.out.println(\"obtd modified rows successfuly\") ;\r\n }\r\n\r\n HashMap hashStoredProcedure = (HashMap)tableStructureBeanPCDR.getHashStoredProceduresForThisTable();\r\n if(hashStoredProcedure == null)\r\n System.out.println(\"hashStoredProcedure == null\");\r\n //Get the update stored procedure associated witht this table.\r\n StoredProcedureBean updateStoredProcedure =\r\n (StoredProcedureBean)hashStoredProcedure.get(new Integer(1));\r\n\r\n RequestTxnBean requestTxnBean = new RequestTxnBean();\r\n requestTxnBean.setAction(\"MODIFY_DATA\");\r\n requestTxnBean.setStoredProcedureBean(updateStoredProcedure);\r\n requestTxnBean.setRowsToModify(vecModifiedRows) ;\r\n\r\n // the servlet will return if the saving process was successful or not\r\n Boolean success = (Boolean)getDataFromServlet(requestTxnBean) ;\r\n if (success == null) // Error while saving data\r\n {\r\n String msg = coeusMessageResources.parseMessageKey(\r\n \"saveFail_exceptionCode.1102\");\r\n\r\n CoeusOptionPane.showInfoDialog(msg);\r\n return false;\r\n }\r\n else\r\n {//Data Saved Successfully\r\n saveRequired = false;\r\n return true;\r\n }\r\n\r\n }// end if data validation\r\n else\r\n {\r\n return false;\r\n }\r\n }", "protected abstract boolean pvSaveBalance(OperationDataClass pOperationData, Boolean pInsert) throws DBSIOException;", "@Override\r\n\tpublic int save() throws NotesApiException {\n\t\treturn 0;\r\n\t}", "void commit(Session session);", "@Override\n public void commitTx() {\n \n }", "@Override\n\tpublic void save() {\n\t\t\n\t}", "@Override\n\tpublic void save() {\n\t\t\n\t}", "public void startDBWrite() {\r\n this.setStatus(false);\r\n this.isDBOutStarted = true;\r\n if (!this.is_alg_started || (this.is_alg_started && ((this.is_already_read_from_DB && this.UseFile.isSelected())\r\n || (!this.is_already_read_from_DB && this.UseDB.isSelected())))) {\r\n this.startALG(true);\r\n } else {\r\n // setStatus(true);\r\n\r\n Thread t = new Thread(new Runnable() {\r\n @Override\r\n public void run() {\r\n Controller.this.isDBWriteInUse = true;\r\n Controller.this.writeIntoDBProgress.setVisible(true);\r\n Controller.this.cw.setWritesOnlyFiles(true);\r\n Controller.this.cw.writeFile(false, false, false);\r\n String pw = \"\";\r\n for (int i = 0; i < Controller.this.rpasswdfield.getPassword().length; i++)\r\n pw += Controller.this.rpasswdfield.getPassword()[i];\r\n\r\n Controller.this.dbc_in = new DBConnect(Controller.this.rhostfield.getText(),\r\n Controller.this.rdatabasefield.getText(), Controller.this.ruserfield.getText(), pw,\r\n Integer.parseInt(Controller.this.rportfield.getText()),\r\n Controller.this.otablenamefield.getText(), COLUMN_NAMES_FOR_DB_OUT);\r\n\r\n // File: Controller.CLASSES_TMP_FILENAME\r\n // Columns: Controller.COLUMN_NAMES_FOR_DB_OUT\r\n try {\r\n Controller.this.dbc_in.stillWorks = true;\r\n Controller.this.dbc_in.maxProgerss = Controller.this.cw.countNodesWithClasses;\r\n Controller.this.dbc_in.writeFromFileIntoDB();\r\n } catch (IOWrapperException iow_e) {\r\n System.err.println(\"Error while writing into DB!\\nConnection failed!\");\r\n JOptionPane.showMessageDialog(null, \"Error while writing into DB!\\nConnection failed!\", \"Error\",\r\n JOptionPane.ERROR_MESSAGE);\r\n Controller.this.dBInError = true;\r\n Controller.this.dbc_in.stillWorks = false;\r\n return;\r\n } catch (IOIteratorException ioi_e) {\r\n System.err.println(\"Error while writing into DB!\\nCould not iterate over results!\");\r\n JOptionPane.showMessageDialog(null,\r\n \"Error while writing into DB!\\nCould not iterate over results!\", \"Error\",\r\n JOptionPane.ERROR_MESSAGE);\r\n Controller.this.dBInError = true;\r\n Controller.this.dbc_in.stillWorks = false;\r\n return;\r\n }\r\n }// run()\r\n });// Thread\r\n\r\n t.start();\r\n Timer timer = new Timer();\r\n timer.schedule(new ObserveProgress(timer, t), 200, 2000);\r\n this.isDBOutStarted = false;\r\n }\r\n }", "public void saveData(){\r\n file.executeAction(modelStore);\r\n }", "protected void doDML(int operation, TransactionEvent e) {\n super.doDML(operation, e);\n }", "protected void doDML(int operation, TransactionEvent e) {\n super.doDML(operation, e);\n }", "protected void doDML(int operation, TransactionEvent e) {\n super.doDML(operation, e);\n }", "protected void doDML(int operation, TransactionEvent e) {\n super.doDML(operation, e);\n }", "void sendTransactionToServer()\n \t{\n \t\t//json + sql magic\n \t}", "public void writeSQL(SQLOutput stream) throws SQLException{\r\n}", "private void saveData(){\n\t\tdataBase=mHelper.getWritableDatabase();\n\t\tContentValues values=new ContentValues();\n\t\t\n\t\tvalues.put(DbHelper.KEY_NNAME,nname);\n\t\t//values.put(DbHelper.KEY_LNAME,lname );\n\t\t\n\t\tSystem.out.println(\"\");\n\t\tif(isUpdate)\n\t\t{ \n\t\t\t//update database with new data \n\t\t\tdataBase.update(DbHelper.TABLE_NOTE, values, DbHelper.KEY_ID+\"=\"+id, null);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//insert data into database\n\t\t\tdataBase.insert(DbHelper.TABLE_NOTE, null, values);\n\t\t}\n\t\t//close database\n\t\tdataBase.close();\n\t\tfinish();\n\t\t\n\t\t\n\t}", "void execute(final ReadWriteTransaction readWriteTransaction);", "public boolean save();", "@Override\n\tpublic void commit(boolean onSave) {\n\t\tsuper.commit(onSave);\n\t}", "private boolean write(String sql) {\n if (!checkConnected()) {\n return false;\n }\n\n PreparedStatement statement = null;\n try {\n statement = connection.prepareStatement(sql);\n statement.executeUpdate();\n return true;\n }\n catch (SQLException ex) {\n if (!sql.equalsIgnoreCase(\"ALTER TABLE `\" + tablePrefix + \"users` DROP COLUMN `party` ;\")) {\n printErrors(ex);\n }\n return false;\n }\n finally {\n if (statement != null) {\n try {\n statement.close();\n }\n catch (SQLException e) {\n // Ignore\n }\n }\n }\n }", "private DatabaseWriteResult(UploadStrategy strategy) {\n savedEntries = new ArrayList<>(1000);\n databaseSize = -1L;\n error = null;\n uploadStrategy = strategy;\n }", "@Override\n\tprotected String sql() throws OperationException {\n\t\treturn sql.insert(tbObj, fieldValue);\n\t}", "public void doSave(T objectToSave) throws SQLException;", "@Override\n public void doSave(FasciaOrariaBean bean) throws SQLException {\n Connection con = null;\n PreparedStatement statement = null;\n String sql = \"INSERT INTO fasciaoraria VALUES (?,?)\";\n try {\n con = DriverManagerConnectionPool.getConnection();\n statement = con.prepareStatement(sql);\n statement.setInt(1, bean.getId());\n statement.setString(2, bean.getFascia());\n System.out.println(\"doSave=\" + 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 }", "private void updateDatabase() {\n\t\tAbstractSerializer serializer = new CineplexSerializer();\n\t\tArrayList<String> updatedRecords = serializer.serialize(records);\n\t\tDatabaseHandler.writeToDatabase(DATABASE_NAME, updatedRecords);\n\t}", "public void saveOperate(OperateBO operateBo) throws RollbackableException {\n }", "public void insert() throws SQLException;", "public String execute() throws SQLException\n {\n setDestPath(\"/home/hadoop/NetBeansProjects/RestfulAPI/document/\");\n\n try{\n System.out.println(\"name: \" + getName());\n\n System.out.println(\"Src File name: \" + getMyFile());\n System.out.println(\"Dst File name: \" + getMyFileFileName());\n\n File destFile = new File(getDestPath(), getMyFileFileName());\n FileUtils.copyFile(getMyFile(), destFile);\n System.out.println(\"Berhasil\");\n \n DBConnector connector = new DBConnector();\n Connection conn = connector.getConn();\n String sql = \"insert into book (name,sinopsis,author) values (?,?,?)\";\n PreparedStatement stmt = null;\n stmt = conn.prepareStatement(sql);\n stmt.setString(1, name);\n stmt.setString(2, sinopsis);\n stmt.setString(3, author);\n stmt.executeUpdate();\n// PreparedStatement ps = conn.prepareStatement(sql);\n// ResultSet rs0 = ps.executeQuery();\n \n// se.writeFakta(conn, namaperiod, list,Integer.parseInt(periodselect),Integer.parseInt(modelfakta));\n \n }catch(IOException e){\n e.printStackTrace();\n return ERROR;\n }\n\n return SUCCESS;\n }", "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}", "public void pass(String order) throws SQLException\n\t{\n\t\tStatement stmt = con.createStatement();\n\t\ttry\n\t\t{\n\t\t\tstmt.executeUpdate(order);\n\t\t} finally\n\t\t{\n\t\t\tif (stmt != null)\n\t\t\t{\n\t\t\t\tstmt.close(); // aint giving the solution but good practice\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.7275091", "0.6983871", "0.6822504", "0.68116444", "0.68116444", "0.6650768", "0.6624443", "0.6615913", "0.6606671", "0.65936923", "0.65294397", "0.6526621", "0.6465526", "0.6456538", "0.6450489", "0.6391971", "0.6376474", "0.6374464", "0.6326863", "0.63002753", "0.62827885", "0.627356", "0.6252788", "0.6228065", "0.6210277", "0.6200746", "0.6184797", "0.61691785", "0.6149439", "0.6144347", "0.6120779", "0.61193705", "0.6116025", "0.60812086", "0.60788125", "0.607457", "0.607457", "0.607457", "0.607457", "0.6029338", "0.6028882", "0.6013616", "0.60028774", "0.5989615", "0.5989185", "0.59853154", "0.5984557", "0.5980792", "0.5976678", "0.5973375", "0.5961441", "0.59556663", "0.59483075", "0.59437364", "0.59437364", "0.59437364", "0.59437364", "0.59437364", "0.5939191", "0.5916291", "0.59153336", "0.59143835", "0.59142184", "0.5907085", "0.5898132", "0.5894132", "0.587325", "0.58676714", "0.58676714", "0.58676714", "0.58676714", "0.58625925", "0.5858484", "0.58566856", "0.5849017", "0.58358395", "0.5835119", "0.5835119", "0.58343905", "0.58342147", "0.58323723", "0.58323723", "0.58323723", "0.58323723", "0.58309543", "0.5826316", "0.5825124", "0.58079964", "0.58048964", "0.5804696", "0.57981825", "0.579576", "0.57953376", "0.5788363", "0.5781855", "0.57815695", "0.5780547", "0.57754797", "0.57740307", "0.57720083", "0.57720023" ]
0.0
-1
logger.info("OPERACION en CAJA/BANCO processing normally for non Caja");
public static String processCajaBancoOperacion(Cuenta cn, Operacion oper, EntityManager em, MutableLocalEntityProvider<Cuenta> cuentaEP, MutableLocalEntityProvider<Operacion> operacionEP) throws Exception { String logCaja = ""; Boolean isEfectivo = oper.getTipo().toString().equals(Tipo.EFECTIVO.toString()); Cuenta cajaCuenta; if (isEfectivo) { if (cn.getCategoriaCuenta().getCajaCuenta()==null) throw new Exception("La categoria de esta Cuenta no tiene una cuenta de CAJA!!!"); cajaCuenta = cuentaEP.getEntityManager().find(Cuenta.class, cn.getCategoriaCuenta().getCajaCuenta().getId(), LockModeType.PESSIMISTIC_WRITE); } else { if (oper.getBanco().getBancoCuenta()==null) throw new Exception("El banco seleccionado no tiene una cuenta!!!\nBanco seleccionado: " + oper.getBanco()); cajaCuenta = cuentaEP.getEntityManager().find(Cuenta.class, oper.getBanco().getBancoCuenta().getId(), LockModeType.PESSIMISTIC_WRITE); } logCaja = " Caja antes, PEN: " + cajaCuenta.getPen() + " USD: " + cajaCuenta.getUsd(); cajaCuenta.setPen(cajaCuenta.getPen().add(oper.getPen())); cajaCuenta.setUsd(cajaCuenta.getUsd().add(oper.getUsd())); cajaCuenta = cuentaEP.updateEntity(cajaCuenta); logCaja += ", CAJA ahora PEN: " + cajaCuenta.getPen() + ", USD: " + cajaCuenta.getUsd(); // NEW CODE - added operacion to caja Cuenta Operacion cajaOperacion = oper.giveCajaOperacion(cajaCuenta); Object cajaOperacionAdded = operacionEP.addEntity(cajaOperacion); Object newCajaOperacionId = ((Operacion)cajaOperacionAdded).getId(); recalculateSaldos((Operacion)cajaOperacionAdded, em); logCaja += "new caja oper id: " + newCajaOperacionId; logger.info(logCaja); return logCaja; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void logika_rozpocznij(){\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tlogger.trace(\"Mensaje de tipo TRACE\");\n\t\tlogger.debug(\"Mensaje de tipo DEBUG\");\n\t\tlogger.info(\"Mensaje de tipo INFO\");\n\t\tlogger.warn(\"Mensaje de tipo WARN\");\n\t\tlogger.error(\"Mensaje de tipo ERROR\");\n\t\tlogger.fatal(\"Mensaje de tipo FATAL\");\n\n\t\ttry {\n\t\t\tint resultado = 100/0;\n\t\t} catch(Exception e) {\n\t\t\t//e.printStackTrace();\n\t\t\tlogger.error(\"Logueamos una excepcion\", e);\n\t\t}\n\t\t\n\t}", "String getLogHandled();", "void log();", "private static void cajas() {\n\t\t\n\t}", "private static void _logInfo ()\n {\n System.err.println (\"Logging is enabled using \" + log.getClass ().getName ());\n }", "public void bienvenida(){\n System.out.println(\"Bienvenid@ a nuestro programa de administracion de parqueos\");\n }", "private void doIt() {\n\t\tlogger.debug(\"hellow this is the first time I use Logback\");\n\t\t\n\t}", "public static void saludo(){\n System.out.println(\"Bienvenido al Sistema\");\n }", "@Override\r\n\tpublic void hacerSonido() {\n\t\tSystem.out.print(\"miau,miau -- o depende\");\r\n\t\t\r\n\t}", "public void imprimir(String log){\n System.out.println(log);\n\n }", "@Override\n public void comunicar() {\n System.out.println(\"miauuuu\");\n\n }", "public void executarLogica() {\n\t\tchecarTarefaValida();\n\t\texecutar();\n\t\texecutandoTarefa();\n\t\tfinalizarTarefa();\n\t}", "public static void main(String []args) {\n\t\tlog.trace(\"111---\");\n\t\tlog.debug(\"2222\");\n\t\tlog.info(\"333\");\n\t\tlog.warn(\"444\");\n\t\tlog.error(\"555\");\n\t}", "String getLogContinued();", "void log() {\n\t\tm_drivetrain.log();\n\t\tm_forklift.log();\n\t}", "public void logData(){\n }", "void InitCombustibile(){\r\n\tdouble logQ=Math.log10(Q);\r\n log(String.format(\"Input %d\",combustibile));\r\n\r\n\tswitch(combustibile){\r\n\t\tcase Comb_1.COKE:\r\n\t\tcase Comb_1.ANTRACITE:\r\n\t\tcase Comb_1.LIGNITE:\r\n log(\"coke antracite lignite\");\r\n\t\t\t\tif(Q<= 100.0){\r\n\t\t\t\t\tPw=15*logQ; // Tiraggio minimo\r\n\t\t\t\t}else if(Q <= 1000){\r\n\t\t\t\t\tPw= -70+50*logQ; // Tiraggio minimo\r\n\t\t\t\t}else{\r\n\t\t\t\t\tPw=80;\t\t\t// Tiraggio minimo\r\n\t\t\t\t}\r\n\r\n\t\t\trend=68.65+4.35*logQ; //Rendimento valido per potenze fino a 2000 kW\r\n\t\t\tif(Q<100){\r\n\t\t\t\tco2=9.5; //CO2\r\n\t\t\t}else{\r\n\t\t\t\tco2=4.1+2.7*logQ; //CO2\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase Comb_1.LEGNO_23:\r\n\t\tcase Comb_1.LEGNO_33:\r\n\t\tcase Comb_1.PALLET :\r\nlog(\"legno pallet\");\r\n\t\t\tif(Q<= 50.0){\r\n\t\t\t\t\tPw=15*logQ; // Tiraggio minimo\r\n\t\t\t\t}else{\r\n\t\t\t\t\tPw=27+13*logQ; // Tiraggio minimo Valido fino a 350 kW\r\n\t\t\t\t}\r\n\r\n\t\t\trend=51.6+8.4*logQ; // Rendimento valido per potenze fino a 1000 kW\r\n\t\t\tif(Q<10){\r\n\t\t\t\tco2=8.0; //CO2\r\n\t\t\t}else{\r\n\t\t\t\tco2=6.0+2.0*logQ; // valido per potenze fino a 1000 kW\r\n\t\t\t}\r\n\r\n\t\t\tbreak;\r\n\t\tdefault : // Combustibili Liquidi e gassosi\r\n log(\"Defaul gas e liquidi:\");\r\n\t\t\tif(Q<= 100.0){\r\n\t\t\t\t\tPw=15*logQ; \t\t// Tiraggio minimo\r\n\t\t\t\t}else{\r\n\t\t\t\t\tPw= -47+38.5*logQ; // Tiraggio minimo\r\n\t\t\t\t}\r\n\t\t\tif(Q<= 1000.0){\r\n\t\t\t\t\trend= 85+logQ;\t\t// Rendimento\r\n\t\t\t\t}else{\r\n\t\t\t\t\trend=88.0; \t\t\t\t// Rendimento\r\n\t\t\t\t}\r\n\t\t\t\t// CO2 per combustibili liquidi utilizzo dati prospetto B.3\r\n\t\t\t\tdouble fx1,fx2,fx3;\t\t\t// DATI PROSPETTO B3\r\n fx1=11.2;\r\n fx2=0.076;\r\n fx3=13.2;\r\n\r\n\t\t\t\tif(aria_soffiata){\r\n\t\t\t\t\tif(combustibile==Comb_1.GAS_NAT_H || combustibile==Comb_1.GAS_NAT_L){\r\n\t\t\t\t\t\tfx1=8.6;\r\n\t\t\t\t\t\tfx2=0.078;\r\n\t\t\t\t\t\tfx3=10.2;\r\n log(String.format(\"Aria soffiata- GAS; fx1=%5.3f \\t fx2=%5.3f\\tfx3=%5.3f \",fx1,fx2,fx3));\r\n\t\t\t\t\t}else if(combustibile == Comb_1.GAS_LIQUIDO){\r\n\t\t\t\t\t\tfx1=10.0;\r\n\t\t\t\t\t\tfx2=0.080;\r\n\t\t\t\t\t\tfx3=11.9;\r\n log(String.format(\"Aria soffiata - GAS LIQUIDO; fx1=%5.3f \\t fx2=%5.3f\\tfx3=%5.3f \",fx1,fx2,fx3));\r\n\t\t\t\t\t}else{ // LIQUIDO\r\n\t\t\t\t\t\tfx1=11.2;\r\n\t\t\t\t\t\tfx2=0.076;\r\n\t\t\t\t\t\tfx3=13.2;\r\n log(String.format(\"Aria soffiata -COMB LIQUIDO; fx1=%5.3f \\t fx2=%5.3f\\tfx3=%5.3f \",fx1,fx2,fx3));\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{ // ARIA NATURALE : SOLO gas; NON VIENE FATTO TEST SE LIQUIDO....\r\n\t\t\t\t\tif(combustibile==Comb_1.GAS_NAT_H || combustibile==Comb_1.GAS_NAT_L){\r\n\t\t\t\t\t\tfx1=5.1;\r\n\t\t\t\t\t\tfx2=0.075;\r\n\t\t\t\t\t\tfx3=6.0;\r\n log(String.format(\"Aria naturale - GAS NATURALE; fx1=%5.3f \\t fx2=%5.3f\\tfx3=%5.3f \",fx1,fx2,fx3));\r\n\t\t\t\t\t}else if(combustibile == Comb_1.GAS_LIQUIDO){\r\n\t\t\t\t\t\tfx1=5.9;\r\n\t\t\t\t\t\tfx2=0.079;\r\n\t\t\t\t\t\tfx3=7.0;\r\n log(String.format(\"Aria naturale - GAS LIQUIDO; fx1=%5.3f \\t fx2=%5.3f\\tfx3=%5.3f \",fx1,fx2,fx3));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(Q<= 100.0){\r\n\t\t\t\t\tco2=fx1/(1-fx2*logQ);\t\t\t\t\t\t// sigma(CO2)\r\n\t\t\t\t}else{\r\n\t\t\t\t\tco2=fx3; \t\t\t\t\t\t// sigma(CO2)\r\n\t\t\t\t}\r\n\r\n\t\t\tbreak;\r\n\t}\r\n\r\n}", "public boolean reducir_log(){\n\t\t//se carga la consulta a una varible tipo string\n\t\tString query = \"exec sp_reducir_log_de_transacciones\";\n\t\t//variable distancia a la clase connection\n\t\tConnection con = new Connexion().conexion();\n //se declara la variable que prepara el query primero nula\n\t\tPreparedStatement pstmt = null;\n\t //intenta o carga el error \t\n\t\t\n\t\t\n\t\t\t\n\t\ttry {\n\t \t//se inicializa ala transaccion en falto hasta el commit\n\t\t\tcon.setAutoCommit(false);\n\t\t\t//prepara la coneccion con el query\n\t\t\tpstmt = con.prepareStatement(query);\n\t\t\t//ejecuta el query \n\t\t\tpstmt.execute();\n //si se ejecuta la transaccion la marcara como verdadero \t\t\n \t\t\tcon.commit();\n\t\t\t//cacha el error\n \t\t\t\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"SQLException: \" + e.getMessage());\n\t\t\tif (con != null){\n\t\t\t\ttry {\n\t\t\t\t\tSystem.out.println(\"La transacción ha sido abortada\");\n\t\t\t\t\tcon.rollback();\n\t\t\t\t} catch(SQLException ex) {\n\t\t\t\t\tSystem.out.println(ex.getMessage());\n\t\t\t\t}\n\t\t\t} \n\t\t\treturn false;\n\t\t\t\n\t\t}finally{\n\t\t\ttry {\n\t\t\t\tpstmt.close();\n\t\t\t\tcon.close();\n\t\t\t} catch(SQLException e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\t\t\n\t\treturn true;\n\t}", "public void testLogAccuracy() {\r\n // log the message\r\n Exception cause = new Exception(\"some error\");\r\n String message = \"some message\";\r\n log.log(Level.ALL, cause, message);\r\n\r\n // check the result\r\n String result = AccuracyTestsHelper.getFileContent(FILE);\r\n assertTrue(result.indexOf(\"some message\") >= 0);\r\n assertTrue(result.indexOf(\"some error\") >= 0);\r\n }", "@Override\n public void logs() {\n \n }", "@Test\r\n\tpublic void logTest() {\r\n\t\tlogger.info(\"Testando info\");\r\n\t\tlogger.debug(\"nao sera logado\" + \"Nice\");\r\n\t\tlogger.error(\"This is Error message\", new Exception(\"Testing\"));\r\n\t}", "public static void main(String[] args) {\n // logger.info(\"Message\");\n // System.out.println(\"cdkdk\");\n\n }", "public String apavada_vriddhi(String X_anta, String X_adi)\n {\n\n Log.info(\"*******ENTERED AAPAVADA NIYAMA UNO**********\");\n Log.info(\"X_adi == \" + X_adi);\n String anta = EncodingUtil.convertSLPToUniformItrans(X_anta);\n // x.transform(X_anta); // anta is ITRANS equivalent\n String adi = EncodingUtil.convertSLPToUniformItrans(X_adi);\n // x.transform(X_adi); // adi is ITRANS equivalent\n\n Log.info(\"adi == \" + adi);\n\n String return_me = \"UNAPPLICABLE\";\n\n boolean bool1 = VowelUtil.isAkaranta(X_anta) && (adi.equals(\"eti\") || adi.equals(\"edhati\"));\n boolean bool2 = VowelUtil.isAkaranta(X_anta) && adi.equals(\"UTh\");\n\n // 203\n // **********IF****************//\n if (X_anta.endsWith(\"f\") && X_adi.startsWith(\"f\")) // watch out!!! must\n // be SLP not ITRANS\n {// checked:29-6\n String strip1 = VarnaUtil.stripAntyaVarna(X_anta);\n String strip2 = VarnaUtil.stripAdiVarna(X_adi);\n\n return_me = utsarga_sandhi(X_anta, X_adi) + \", \" + strip1 + \"f\" + strip2;\n\n comments.start_adding_notes();\n comments.setSutraNum(\"\");\n comments.setVartikaPath(\"RRiti RRi vA vacanam\");\n comments.setSutraProc(\"hrasva RRikara ekadesh\");\n comments.setSource(Comments.vartika);\n String cond1 = \"small RRi followed by small RRi merge to become small RRi.\\n\" + \"RRi + RRi = RRi\";\n comments.setConditions(cond1);\n\n } // end of main if\n // **********END OF IF****************//\n\n // 204\n // **********IF****************//\n else if (X_anta.endsWith(\"f\") && X_adi.startsWith(\"x\")) // watch out!!!\n // must be SLP\n // not ITRANS\n { // checked:29-6 // SLP x = ITRANS LLi\n String strip1 = VarnaUtil.stripAntyaVarna(X_anta);\n String strip2 = VarnaUtil.stripAdiVarna(X_adi);\n\n return_me = utsarga_sandhi(X_anta, X_adi) + \", \" + strip1 + \"x\" + strip2; // SLP\n // x =\n // ITRANS\n // LLi\n\n comments.start_adding_notes();\n comments.setSutraNum(\"\");\n comments.setVartikaPath(\"LLiti LLi vA vacanam\");\n comments.setSutraProc(\"hrasva LLikara ekadesh\");\n comments.setSource(Comments.vartika);\n String cond1 = \" RRi/RRI followed by small LLi merge to become small LLi.\\n RRi/RRI + LLi = LLi\";\n comments.setConditions(cond1);\n\n } // end of main if\n // **********END OF IF****************//\n\n // 207a-b\n // **********ELSE IF****************//\n else if (bool1 || bool2)\n {\n // checked:29-6\n return_me = vriddhi_sandhi(X_anta, X_adi);\n\n // We have to remove vriddhi_sandhi default notes\n // this is done by\n comments.decrementPointer();\n comments.start_adding_notes();\n comments.setSutraNum(\"6.1.86\");\n comments.setSutraPath(\"eti-edhati-UThsu\");\n comments.setSutraProc(\"vRRiddhi-ekadesh\");\n comments.setSource(Comments.sutra);\n\n String cond1 = \"akaara followed by declensions of 'iN', 'edha' and 'UTh\" + \"<eti/edhati/UTh> are replaced by their vRRiddhi counterpart.\\n\" + \"a/A/a3 + eti/edhati/UTha = VRRiddhi Counterpart.\\n\" + \"Pls. Note.My Program cannot handle all the declensions of given roots.\" + \"Hence will only work for one instance of Third Person Singular Form\";\n comments.setConditions(cond1);\n\n String cond2 = \"Blocks para-rupa Sandhi given by 'e~ni pararUpam' which had blocked Normal Vriddhi Sandhi\";\n\n if (bool1)\n comments.append_condition(cond2);\n else if (bool2) comments.append_condition(\"Blocks 'Ad guNaH'\");\n\n }\n\n // **********END OF ELSE IF****************//\n\n // 208\n // **********ELSE IF****************//\n else if (anta.equals(\"akSa\") && adi.equals(\"UhinI\"))\n {// checked:29-6\n return_me = \"akzOhiRI\"; // u to have give in SLP..had\n // ITRANS....fixed\n // not sending to vrridhit_sandhi becose of Na-inclusion\n // vriddhi_sandhi(X_anta,X_adi);\n // We have to remove vriddhi_sandhi default notes\n // this is done by\n // ***/vowel_notes.decrement_pointer();/***/\n\n comments.start_adding_notes();\n comments.setSutraNum(\"\");\n comments.setVartikaPath(\"akSAdUhinyAm\");\n comments.setSutraProc(\"vRRiddhi-ekadesh\");\n comments.setSource(Comments.vartika);\n String cond1 = \"akSa + UhinI = akshauhiNI.Vartika blocks guna-sandhi ato allow vRRiddhi-ekadesh\";\n comments.setConditions(cond1);\n\n }\n // **********END OF ELSE IF****************//\n\n // 209\n // **********ELSE IF****************//\n else if (anta.equals(\"pra\") && (adi.equals(\"Uha\") || adi.equals(\"UDha\") || adi.equals(\"UDhi\") || adi.equals(\"eSa\") || adi.equals(\"eSya\")))\n // checked:29-6\n {\n return_me = vriddhi_sandhi(X_anta, X_adi);\n\n // We have to remove vriddhi_sandhi default notes\n // this is done by\n /***/\n comments.decrementPointer();\n /***/\n\n comments.start_adding_notes();\n comments.setSutraNum(\"\");\n comments.setVartikaPath(\"prAd-Uha-UDha-UDhi-eSa-eSyeSu\");\n comments.setSutraProc(\"vRRiddhi-ekadesh\");\n comments.setSource(Comments.vartika);\n String cond1 = \"upasarga 'pra' + <prAd/Uha/UDha/UDhi/eSa/eSya> = vRRiddhi-ekadesha.\" + \"\\nVartika blocks para-rupa Sandhi and/or guna Sandhi to allow vRRidhi-ekadesh.\";\n\n comments.setConditions(cond1);\n\n }\n\n // **********END OF ELSE IF****************//\n\n // 210\n // **********ELSE IF****************//\n else if (anta.equals(\"sva\") && (adi.equals(\"ira\") || adi.equals(\"irin\")))\n {\n // checked:29-6\n return_me = vriddhi_sandhi(X_anta, X_adi);\n // We have to remove vriddhi_sandhi default notes\n // this is done by\n /***/\n comments.decrementPointer();\n /***/\n\n comments.start_adding_notes();\n comments.setSutraNum(\"\");\n comments.setVartikaPath(\"svaadireriNoH\");\n comments.setSutraProc(\"vRRiddhi-ekadesh\");\n comments.setSource(Comments.vartika);\n String cond1 = \"sva + <ira/irin> = vRRIddhi.\\n Blocks Guna Sandhi.\" + \"\\nPls. note. My program does not cover sandhi with declensions.\";\n comments.setConditions(cond1);\n }\n\n // **********END OF ELSE IF****************//\n\n // 211 Vik. Semantic Dependency\n // **********ELSE IF****************//\n else if (VowelUtil.isAkaranta(X_anta) && X_adi.equals(\"fta\"))// adi.equals(\"RRita\"))\n {\n // checked:29-6\n // not working for 'a' but working for 'A'. Find out why...fixed\n\n return_me = utsarga_prakruti_bhava(X_anta, X_adi) + \", \" + vriddhi_sandhi(X_anta, X_adi) + \"**\";\n\n // We have to remove vriddhi_sandhi default notes\n // this is done by\n /***/\n comments.decrementPointer();\n /***/\n\n comments.start_adding_notes();\n comments.setSutraNum(\"\");\n comments.setVartikaPath(\"RRite ca tRRitIyAsamAse\");\n comments.setSutraProc(\"Vriddhi-ekadesh\");\n comments.setSource(Comments.vartika);\n String cond1 = \"If an akaranta ('a/aa/a3'-terminating phoneme) is going to form a Tritiya Samas compound with a RRi-initial word\" + \" vRRiddhi-ekadesha takes place blocking other rules.\\n\" + \"a/A/a3 + RRi -> Tritiya Samaasa Compound -> vRRiddhi-ekadesh\" + depend;\n comments.setConditions(cond1);\n }\n // **********END OF ELSE IF****************//\n\n // 212-213\n // **********ELSE IF****************//\n else if ((anta.equals(\"pra\") || anta.equals(\"vatsatara\") || anta.equals(\"kambala\") || anta.equals(\"vasana\") || anta.equals(\"RRiNa\") || anta.equals(\"dasha\")) && adi.equals(\"RRiNa\"))\n\n // checked:29-6\n { // pra condition not working...fixed now . 5 MAR 05\n // return_me = guna_sandhi(X_anta,X_adi) + \", \" +\n // prakruti_bhava(X_anta,X_adi)\n\n return_me = vriddhi_sandhi(X_anta, X_adi);\n // We have to remove vriddhi_sandhi default notes\n // this is done by\n /***/\n comments.decrementPointer();\n /***/\n\n comments.start_adding_notes();\n // vowel_notes.set_sutra_num(\"\") ;\n comments.setVartikaPath(\"pra-vatsatara-kambala-vasanArNa dashaanAm RRiNe\");\n comments.setSutraProc(\"Vriddhi-ekadesh\");\n comments.setSource(Comments.vartika);\n String cond1 = \"If 'pra' etc are followed by the word 'RRiNa',\" + \" vRRiddhi-ekadesh takes place blocking Guna and Prakruti Bhava Sandhis.\" + \"\\n<pra/vatsatara/kambala/vasana/RRiNa/dash> + RRiNa = vRRiddhi\";\n comments.setConditions(cond1);\n }\n // ???? also implement prakruti bhava\n\n /**\n * **YEs ACCORDING TO SWAMI DS but not according to Bhaimi Bhashya else\n * if ( adi.equals(\"RRiNa\") && (anta.equals(\"RRiNa\") ||\n * anta.equals(\"dasha\")) ) { return_me = vriddhi_sandhi(X_anta,X_adi);\n * //*sandhi_notes = VE + apavada + vartika + \"'RRiNa dashAbhyAm ca'.\" +\n * \"\\nBlocks Guna and Prakruti Bhava Sandhi\";\n * \n * vowel_notes.start_adding_notes(); vowel_notes.set_sutra_num(\"\") ;\n * vowel_notes.set_vartika_path(\"RRiNa dashAbhyAm ca\") ;\n * vowel_notes.set_sutra_proc(\"Vriddhi-ekadesh\");\n * vowel_notes.set_source(tippani.vartika) ; String cond1 =depend +\n * \"Blocks Guna and Prakruti Bhava Sandhi\";\n * vowel_notes.set_conditions(cond1);\n * /* return_me = utsarga_prakruti_bhava(X_anta,X_adi) + \", \" +\n * vriddhi_sandhi(X_anta,X_adi) + \"**\"; sandhi_notes = usg1 +\n * sandhi_notes; sandhi_notes+= \"\\n\" + usg2 + VE +apavada + vartika +\n * \"'RRiNa dashAbhyAm ca'.\" + depend; // .... this was when I assumed\n * this niyama is optional with other // ???? also implement prakruti\n * bhava }\n */\n // **********END OF ELSE IF****************//\n // 214 Vik. Semantic Dependency\n // **********ELSE IF****************//\n else if (anta.equals(\"A\") && VowelUtil.isAjadi(X_adi))\n {\n // checked:29-6\n // rules is A + Vowel = VRddhi\n\n return_me = utsarga_sandhi(X_anta, X_adi) + \", \" + vriddhi_sandhi(X_anta, X_adi) + \"**\";\n /*******************************************************************\n * sandhi_notes = usg1 + sandhi_notes + \"\\n\" + usg2 ; // We have to\n * remove vriddhi_sandhi default notes // this is done by /\n ******************************************************************/\n comments.decrementPointer();\n /***/\n\n comments.start_adding_notes();\n comments.setSutraNum(\"6.1.87\");\n comments.setSutraPath(\"ATashca\");\n comments.setSutraProc(\"Vriddhi-ekadesh\");\n comments.setSource(Comments.vartika);\n String cond1 = depend + \"if String 1 equals 'aa' and implies 'AT'-Agama and \" + \"String 2 is a verbal form. E.g. A + IkSata = aikSata not ekSata.\\n\" + \" 'aa' + Verbal Form = vRRiddhi-ekadesh\";\n comments.setConditions(cond1);\n }\n // **********END OF ELSE IF****************//\n\n // **********ELSE IF****************//\n // akaranta uparga mein error....fixed 4 MAR\n // 215 Vik Semantic Dependency\n else if (is_akaranta_upsarga(X_anta) && X_adi.startsWith(\"f\")) // RRi\n // ==\n // SLP\n // 'f'USing\n // X_adi,\n // switched\n // to\n // Sharfe\n // Encoding\n { // according to Vedanga Prakash Sandhi Vishaya RRIkara is being\n // translated\n // but checked with SC Basu Trans. it is RRIta not RRikara\n // checked:29-6\n\n Log.info(\" Rules 215 applies\");\n return_me = utsarga_sandhi(X_anta, X_adi) + \", \" + vriddhi_sandhi(X_anta, X_adi) + \"**\";\n // We have to remove vriddhi_sandhi default notes\n // this is done by\n // vowel_notes.decrement_pointer();\n\n // July 14 2005.. I have removed the above line\n // vowel_notes.decrement_pointer();\n\n comments.start_adding_notes();\n comments.setSutraNum(\"6.1.88\");\n comments.setSutraPath(\"upasargAdRRiti dhAtau\");\n comments.setSutraProc(\"Vriddhi-ekadesh\");\n comments.setSource(Comments.vartika);\n String cond1 = depend + \"akaranta upsarga(preverb) followed by verbal form begining with short RRi.\\n \" + \"preverb ending in <a> + verbal form begining with RRi = vRRiddhi-ekadesha\\n\";\n\n /*\n * \"By 6.1.88 it should block all \" + \"optional forms but by 'vA\n * supyApishaleH' (6.1.89) subantas are \" + \"permitted the Guna\n * option.\";\n */\n comments.setConditions(cond1);\n }\n // **********END OF ELSE IF****************//\n\n Log.info(\"return_me == \" + return_me);\n Log.info(\"*******EXITED AAPAVADA NIYAMA UNO**********\");\n\n if (return_me.equals(\"UNAPPLICABLE\"))\n {\n return_me = apavada_para_rupa(X_anta, X_adi); // search for more\n // apavada rules\n }\n return return_me; // apavada rules formulated by Panini apply\n }", "public abstract void logKenaiUsage(Object... parameters);", "private void logToFile() {\n }", "public void writeLog() {\n\n\t}", "public void writeLog() {\n\n\t}", "public void writeLog() {\n\n\t}", "public void estiloError() {\r\n /**Bea y Jose**/\r\n\t}", "public void belajar(){\n\t\tSystem.out.println(\"Belajar java di \"+tempat+\" selama \"+jamBelajar+\" jam\");\n\t}", "private void logIt(String msg) {\n\tSystem.out.println(\"PLATINUM-SYNC-LOG: \" + msg);\n}", "@Override\n\tpublic void maasHesapla() {\n\t\tSystem.out.println(\"isciler icin maas 5000 tl \");\n \t\t\n\t}", "private void log() {\n\t\t\n//\t\tif (trx_loggin_on){\n\t\t\n\t\tif ( transLogModelThreadLocal.get().isTransLoggingOn() ) {\n\t\t\t\n\t\t\tTransLogModel translog = transLogModelThreadLocal.get();\n\t\t\tfor (Entry<Attr, String> entry : translog.getAttributesConText().entrySet()) {\n\t\t\t\tMDC.put(entry.getKey().toString(), ((entry.getValue() == null)? \"\":entry.getValue()));\n\t\t\t}\n\t\t\tfor (Entry<Attr, String> entry : translog.getAttributesOnce().entrySet()) {\n\t\t\t\tMDC.put(entry.getKey().toString(), ((entry.getValue() == null)? \"\":entry.getValue()));\n\t\t\t}\n\t\t\ttransactionLogger.info(\"\"); // don't really need a msg here\n\t\t\t\n\t\t\t// TODO MDC maybe conflic with existing MDC using in the project\n\t\t\tfor (Entry<Attr, String> entry : translog.getAttributesConText().entrySet()) {\n\t\t\t\tMDC.remove(entry.getKey().toString());\n\t\t\t}\n\t\t\tfor (Entry<Attr, String> entry : translog.getAttributesOnce().entrySet()) {\n\t\t\t\tMDC.remove(entry.getKey().toString());\n\t\t\t}\n\t\t\t\n\t\t\ttranslog.getAttributesOnce().clear();\n\t\t}\n\t\t\n\t}", "public void guardaDjAlcabala(RaDjalcabala raDjalcabala) throws Exception;", "private static void saluti() {\n\t\tUtilityIO.header(MSG_CHIUSURA, SIMBOLO_MESSAGGIO_BENV_USCITA);\n\t\tSystem.out.println();\n\t}", "@Override\r\n\tpublic void exibir() {\n\t\t\r\n\t\tSystem.out.println(\"Condicoes atuais: \" + temp + \"°C e \" + umid + \"% de umidade \" \r\n\t\t\t\t+ pressao + \" pressao\");\r\n\t\t\r\n\t}", "abstract protected void _log(TrackingActivity activity) throws Exception;", "private void btnExecutarLabirinto(){\n log.setText(\"Log de erros\");\n botao[2].setEnabled(false);\n try{\n lab.encontrarAdj();\n lab.andadinha();\n info.setText(\" \");\n visor.setText(lab.toString());\n\n Pilha<Coordenada> caminho = lab.getCaminho();\n Pilha<Coordenada> inverso = new Pilha<Coordenada>();\n while(!caminho.isVazia())\n {\n inverso.guardeUmItem(caminho.recupereUmItem());\n caminho.removaUmItem();\n }\n\n log.setText(\"Caminho percorrido: \");\n while(!inverso.isVazia())\n {\n log.setText(log.getText() + inverso.recupereUmItem().toString() + \" \");\n inverso.removaUmItem();\n }\n }\n catch(Exception erro1){\n log.setText(erro1.getMessage());\n }\n\t\t}", "@Override\n public void log()\n {\n }", "abstract void initiateLog();", "private void registraLog(int aTipo, String aMensagem)\n\t{\n\t\tArquivoConfiguracaoGPP arqConf = ArquivoConfiguracaoGPP.getInstance();\n\t\tif (aTipo == Definicoes.FATAL)\n\t\t\tlogger.fatal(aMensagem);\n\t\telse if (aTipo == Definicoes.ERRO)\n\t\t\t\tlogger.error(aMensagem);\n\t\telse if (aTipo == Definicoes.WARN)\n\t\t\t\tlogger.warn(aMensagem);\n\t\telse if (aTipo == Definicoes.INFO)\n\t\t\t\tlogger.info(aMensagem);\n\t\telse if (aTipo == Definicoes.DEBUG)\n\t\t{\n\t\t\t\tif (arqConf.getSaidaDebug())\n\t\t\t\t\tlogger.debug(aMensagem);\n\t\t}\n\t\telse logger.warn(\"SEVERIDADE NAO DEFINIDA - \" + aMensagem);\n\t}", "public static void main(String[] args) {\n\t\tLog.debug(\"Im Debugging\");\n\t\tLog.info(\"info\");\n\t\tLog.error(\"this is an error\");\n\t\tLog.fatal(\"this is fatal\");\n\t\tLog.trace(\"this is trace\");\n\t\t/////////////////////\n\t\tLog.error(\"this is an error\");\n\t\tLog.fatal(\"this is fatal\");\n\t\tLog.trace(\"this is trace\");\n\t\tgaurav\n\t}", "@Override\n\tpublic void preparar() {\n\t\tSystem.out.println(\"massa, presunto, queijo, calabreza e cebola\");\n\t\t\n\t}", "public void carroNoAgregado(){\n System.out.println(\"No hay un parqueo para su automovil\");\n }", "public void zalogujSkonci() {\n PrintWriter pw;\n try {\n pw = new PrintWriter(new BufferedWriter(new FileWriter(new File(\"logClient.txt\"), true)));\n pw.println(\"Odeslano bytu: \" + main.odeslanoZprav);\n pw.println(\"Prijato bytu: \" + main.prijatoBytu);\n pw.println(\"Odeslano zprav: \" + main.odeslanoZprav);\n pw.println(\"Prijato zprav: \" + main.prijatoZprav);\n pw.println(\"Odehrano her: \" + main.odehranoHer);\n pw.println(\"Doba behu: \" + (System.currentTimeMillis() - main.start) / 1000 + \" sekund.\");\n pw.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n System.exit(0);\n }", "@Pointcut(\"execution(* genarateClientResponse(..))\")\n private void AccessLogingpc() {\n }", "void aprovarAnalise();", "@Then(\"My logi success\")\r\n\tpublic void my_logi_success() {\n\t\tSystem.out.println(\"code for sucess\");\r\n\t}", "private void registraLog(int aTipo, String aMensagem)\n\t{\n\t\tif (aTipo == Definicoes.FATAL)\n\t\t\tlogger.fatal(aMensagem);\n\t\telse if (aTipo == Definicoes.ERRO)\n\t\t\t\tlogger.error(aMensagem);\n\t\telse if (aTipo == Definicoes.WARN)\n\t\t\t\tlogger.warn(aMensagem);\n\t\telse if (aTipo == Definicoes.INFO)\n\t\t\t\tlogger.info(aMensagem);\n\t\telse if (aTipo == Definicoes.DEBUG)\n\t\t{\n\t\t\t\tif (arqConfig.getSaidaDebug())\n\t\t\t\t\tlogger.debug(aMensagem);\n\t\t}\n\t\telse logger.warn(\"SEVERIDADE NAO DEFINIDA - \" + aMensagem);\n\t}", "@Override\n\tvoid work() {\n\t\tSystem.out.println(\"승용차가 사람을 태우고 있습니다.\");\n\t}", "public LogScrap() {\n\t\tconsumer = bin->Conveyor.LOG.debug(\"{}\",bin);\n\t}", "public void estiloAcierto() {\r\n\t\t /**Bea y Jose**/\t\t\r\n \r\n\t}", "void comer() {\n\t\tSystem.out.println(\"comiendo\");\n\t}", "public void log(long idProcesso, int aTipo, String aClasse, String aMetodo, String aMensagem)\n\t{\n\t\tString mensagemFinal = \"<Servidor> \" + this.hostName; \n\t\tmensagemFinal = mensagemFinal + \" <ID> \" + idProcesso;\n\t\tmensagemFinal = mensagemFinal + \" <CL> \" + aClasse;\n\t\tmensagemFinal = mensagemFinal + \" <ME> \" + aMetodo;\n\t\tmensagemFinal = mensagemFinal + \" <Mensagem> \" + aMensagem;\n\t\t\n\t\tregistraLog(aTipo,mensagemFinal);\n\t}", "private void logUser() {\n }", "void log(Log log);", "private static final void log(org.jetbrains.anko.AnkoLogger r2, java.lang.Object r3, java.lang.Throwable r4, int r5, kotlin.jvm.functions.Function2<? super java.lang.String, ? super java.lang.String, kotlin.Unit> r6, kotlin.jvm.functions.Function3<? super java.lang.String, ? super java.lang.String, ? super java.lang.Throwable, kotlin.Unit> r7) {\n /*\n r0 = r2.getLoggerTag();\n r1 = android.util.Log.isLoggable(r0, r5);\n if (r1 == 0) goto L_0x0017;\n L_0x000a:\n if (r4 == 0) goto L_0x001c;\n L_0x000c:\n if (r3 == 0) goto L_0x0018;\n L_0x000e:\n r1 = r3.toString();\n if (r1 == 0) goto L_0x0018;\n L_0x0014:\n r7.invoke(r0, r1, r4);\n L_0x0017:\n return;\n L_0x0018:\n r1 = \"null\";\n goto L_0x0014;\n L_0x001c:\n if (r3 == 0) goto L_0x0028;\n L_0x001e:\n r1 = r3.toString();\n if (r1 == 0) goto L_0x0028;\n L_0x0024:\n r6.invoke(r0, r1);\n goto L_0x0017;\n L_0x0028:\n r1 = \"null\";\n goto L_0x0024;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: org.jetbrains.anko.Logging.log(org.jetbrains.anko.AnkoLogger, java.lang.Object, java.lang.Throwable, int, kotlin.jvm.functions.Function2, kotlin.jvm.functions.Function3):void\");\n }", "private void divertLog() {\n wr = new StringWriter(1000);\n LogTarget[] lt = { new WriterTarget(wr, fmt) };\n SampleResult.log.setLogTargets(lt);\n }", "void kiemTraThangHopLi() {\n }", "@Override\n\tpublic void hacerDevolucion() {\n\t\tSystem.out.println(\"Hacer Devolucion pantalon\");\n\t}", "@Override\r\n\tpublic String log(String info) {\n\t\tlong id=Thread.currentThread().getId();\r\n\t\tCalcThread b=ProCalcManage.getInstance().threadIDMap.get(id);\r\n\t\tsynchronized (b.proinfo.info.log) {\r\n\t\t\tb.proinfo.info.log.add(new LogInfo(new Date(), info));\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn info;\r\n\t}", "private static void benvenuto() {\n\t\tUtilityIO.header(MSG_BENVENUTO, SIMBOLO_MESSAGGIO_BENV_USCITA);\n\t\tSystem.out.println();\n\t\t\n\t}", "public void doLog() {\n SelfInvokeTestService self = (SelfInvokeTestService)context.getBean(\"selfInvokeTestService\");\n self.selfLog();\n //selfLog();\n }", "public void transAccElec(){\n System.out.println(\"Elija la cuenta a la que desea efectuar la transferencia\");\n System.out.println(\"\");\n}", "private Log() {\r\n\t}", "public void log(long idProcesso, int aTipo, String aClasse, String aMetodo, String aMensagem)\n\t{\n\t\tStringBuffer mensagemFinal = new StringBuffer(\"<Servidor> \").append(getHostName()); \n\t\tmensagemFinal.append(\" <ID> \").append(idProcesso);\n\t\tmensagemFinal.append(\" <Metodo> \").append(aMetodo);\n\t\tmensagemFinal.append(\" <Mensagem> \").append(aMensagem);\n\t\t\n\t\tregistraLog(aTipo,mensagemFinal.toString());\n\t\tmensagemFinal = null;\n\t}", "public static void main(String[] args)throws IOException ,SQLException {\nlog.debug(\"Hello this is a debug message\");\r\nlog.info(\"Hello this is a info message\");\r\nlog.warn(\"Sample warn message \");\r\nlog.error(\"Sample error message \");\r\nlog.fatal(\"Sample fatal message \");\r\n\r\n}", "@Override\r\n\tpublic void realizarTransacción() {\n\t\tSystem.out.println(\"Transaccion en progreso\");\r\n\t}", "@Override\n protected void onTick() {\n leerFromMatlab();\n if ((voltajeMR > 120 * 1.1 && voltajeMR < 120 * 0.9) || (frecuenciaMR > 60 * 1.1 && frecuenciaMR < 60 * 0.9)) {\n alarmaMR = true;\n System.out.println(\"Alarma de condiciones no deseadas de microred encendida\");\n } else {\n alarmaMR = false;\n }\n\n if ((voltajeRE > 120 * 1.1 && voltajeRE < 120 * 0.9) || (frecuenciaRE > 60 * 1.1 && frecuenciaRE < 60 * 0.9)) {\n alarmaRE = true;\n System.out.println(\"Alarma de condiciones no deseadas de red externa encendida\");\n } else {\n alarmaRE = false;\n }\n\n try {\n ACLMessage mensaje = new ACLMessage();\n AID r1 = new AID();\n r1.setLocalName(\"EnergyMarketAgent\");\n AID r2 = new AID();\n r2.setLocalName(\"InterfaceAgent\");\n mensaje.setSender(getAID());\n //mensaje.addReceiver(r);\n mensaje.addReceiver(r1);\n mensaje.addReceiver(r2);\n //mensaje.addReceiver(getDefaultDF());\n mensaje.setLanguage(codec.getName());\n mensaje.setOntology(ontologia.getName());\n mensaje.setPerformative(ACLMessage.INFORM);\n Operacion operacion = new Operacion();\n operacion.setEstadoFallaMicroRed(alarmaMR);\n operacion.setEstadoFallaRedExterna(alarmaRE);\n operacion.setPotenciaAlmacenada((float) potenciaAlmacenada);\n operacion.setPotenciaGenerada((float) potenciaGenerada);\n operacion.setPotenciaDemanda((float) demandaPotencia);\n operacion.setModoOperacionApagado(modoOperacionApagado);\n operacion.setModoOperacionInterno(modoOperacionInterno);\n operacion.setModoOperacionExterno(modoOperacionExterno);\n operacion.setModoOperacionParcial(modoOperacionParcial);\n operacion.setModoOperacionVenta(modoOperacionVenta);\n operacion.setModoOperacionAlmacenamiento(modoOperacionAlmacenamiento);\n\n EnviarInfoOperacion enviarModoOperacion = new EnviarInfoOperacion();\n enviarModoOperacion.setParametros(operacion);\n //mensaje.setContentObject(enviarModoOperacion);\n getContentManager().fillContent(mensaje, (ContentElement) enviarModoOperacion);\n \n\n send(mensaje);\n } catch (Codec.CodecException ex) {\n Logger.getLogger(AgenteMicroRed.class.getName()).log(Level.SEVERE, null, ex);\n } catch (OntologyException ex) {\n Logger.getLogger(AgenteMicroRed.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n }", "public void testCombinedCmsConcurrentApplicationConcurrentTimeLogging() {\n // TODO: Create File in platform independent way.\n File testFile = new File(\"src/test/data/dataset19.txt\");\n GcManager gcManager = new GcManager();\n File preprocessedFile = gcManager.preprocess(testFile, null);\n gcManager.store(preprocessedFile, false);\n JvmRun jvmRun = gcManager.getJvmRun(new Jvm(null, null), Constants.DEFAULT_BOTTLENECK_THROUGHPUT_THRESHOLD);\n Assert.assertEquals(\"Event type count not correct.\", 2, jvmRun.getEventTypes().size());\n Assert.assertTrue(\"Log line not recognized as \" + JdkUtil.LogEventType.CMS_CONCURRENT.toString() + \".\",\n jvmRun.getEventTypes().contains(JdkUtil.LogEventType.CMS_CONCURRENT));\n }", "private void report() {\n\t\t\n\t}", "static void mostrarInstrucciones(){\r\n\t\tSystem.out.println(\"Introduzca la base y el exponente para calcular el resultado.\");\r\n\t}", "public void KosarajuPrint() {\n long start = System.currentTimeMillis();\n io.println(\"The given statement is \");\n if (kosaraju.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 }", "@Test\r\n public void test_logEntrance2_NoLogging() throws Exception {\r\n log = null;\r\n LoggingWrapperUtility.logEntrance(log, signature, paramNames, paramValues, true, Level.INFO);\r\n\r\n assertEquals(\"'logEntrance' should be correct.\", 0, TestsHelper.readFile(TestsHelper.LOG_FILE).length());\r\n }", "public void ciudad(){\n System.out.println(\"ciudad londres\");\n }", "public int processLokaal(Lokalen lokaal);", "private void inizia() throws Exception {\n this.setMessaggio(\"Addebiti in corso\");\n this.setBreakAbilitato(true);\n }", "@Override\r\n\t\t\tpublic void reporte() {\n\r\n\t\t\t}", "public void orina() {\n System.out.println(\"Que bien me quedé! Deposito vaciado.\");\n }", "private static void log(String aMsg){\n\t System.out.println(aMsg);\n\t }", "public void SayHello() {\n try {\n log.info(\"处理任务开始>........\");\n // 业务逻辑代码调用\n System.out.println(\"时间[\" + new java.util.Date().toLocaleString() + \"]----->大家好啊!\");\n log.info(\"处理任务结束!\");\n } catch (Exception e) {\n log.info(\"处理任务出现异常\", e);\n }\n }", "public String get_log(){\n }", "private static void writeLog(String log) {\n\t\twriteLog(log, true);\n\t}", "public static void main(String[] args){\n try {\r\n // m.nada(0);\r\n } catch (Exception ex) {\r\n System.out.println(\"No hay error\");\r\n }\r\n }", "public static void mensajeInicioPrueba(String nombre_clase){\n \n System.out.println(\" --- INICIANDO PRUEBAS DE \"+nombre_clase+\".JAVA --- \");\n }", "public void notificate() {\nSystem.out.println(\"Comman for all\");\r\n\t}", "void crier() {\n System.out.println(\"Je Feule pour impressionner !!\");\n }", "public static void main(String[] args) {\n\t\tLogger spacedLogger = new SpacedLogger();\n\t\tLogger asteriskLogger = new AsteriskLogger();\n\t\t\n// Part 11 this will Test both methods on both instances, passing in Strings \n\t\tasteriskLogger.Error(\"This is a Fatal Error you Must look at everything Again!!! \");\n\t\tasteriskLogger.Log(\"There is an Error!! You must fix this!!!\");\n\t\t\t\t\n\t\t\n\t\tSystem.out.println();\n\t\tspacedLogger.Error(\"This is a Huge ERROR!!! Must fix it ASAP!!!!\");\n\t\tspacedLogger.Log(\"This is more readable!! With More Spaces!!!\");\n\t\t\n\t}", "public void log(String txt);", "private void logToFile(ByteArrayOutputStream logbaos) {\n String filename = \"/tmp/QlikLoad.dat\"; // + totalOps;\n try(OutputStream outputStream = new FileOutputStream(filename, true)) {\n System.out.println(\"logging BAOS content to file: \" + filename);\n logbaos.writeTo(outputStream);\n } catch (FileNotFoundException e) {\n LOG.error(\"error writing buffer to file\", e);\n } catch (IOException e) {\n LOG.error(\"IOException when writing buffer to file\", e);\n }\n }", "private void logPrimaryImplicants(Set<Mask> primary) {\n\t\tLOG.log(Level.FINE, () -> \"\");\n\t\tLOG.log(Level.FINE, () -> \"Svi primarni implikanti:\");\n\t\tfor (Mask mask : primary) {\n\t\t\tLOG.log(Level.FINE, mask::toString);\n\t\t}\n\t}", "@Test\r\n public void test_logEntrance1_NoLogging() throws Exception {\r\n log = null;\r\n LoggingWrapperUtility.logEntrance(log, signature, paramNames, paramValues);\r\n\r\n assertEquals(\"'logEntrance' should be correct.\", 0, TestsHelper.readFile(TestsHelper.LOG_FILE).length());\r\n }", "public static void main(String[] args) {\n\t\ttry {\n\t\t\talgoritmoConPosibilidadDeExcepcion();\n\t\t\tSystem.out.println(\"Estoy dentro del bloque que da error, justo despues de dar error\");\n\t\t} catch (ParseException | UnsupportedOperationException e) {\n\t\t\t// Proporciona el feedback al usuario de la aplicacion\n\t\t\tSystem.out.println(\"Ha ocurrido un error\");\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t}", "public void enableLogging();", "public void comer(){\r\n\t\tSystem.out.println(\"He comido\");\r\n\t}", "public static void main(String[] args) {\n\r\n\t\tSystem.out.println(\"\\n....Hello World....\\n\");\r\n\t\tlogger.trace(\"this is trace message\");\r\n\t\tlogger.info(\"this is info message\");\r\n\t\tlogger.error(\"this is error message\");\r\n\t\tlogger.fatal(\"this is info message\");\r\n\t\tlogger.warn(\"this is error message\");\r\n\t\t\r\n\t\tSystem.out.println(\"\\n....completed....\\n\");\r\n\t}", "public String apavada_prakruti_bhava(String X_anta, String X_adi)\n {\n\n Log.info(\"*******ENTERED AAPAVADA NIYAMA 3**********\");\n String anta = EncodingUtil.convertSLPToUniformItrans(X_anta); // anta\n // is\n // ITRANS\n // equivalent\n String adi = EncodingUtil.convertSLPToUniformItrans(X_adi); // adi is\n // ITRANS\n // equivalent\n\n String return_me = \"UNAPPLICABLE\";\n // 249\n if (VowelUtil.isPlutanta(X_anta) && X_adi.equals(\"iti\"))\n {// checked:29-6\n\n return_me = prakruti_bhava(X_anta, X_adi) + \", \" + utsarga_sandhi(X_anta, X_adi) + \"**\";\n ;\n /*\n * sandhi_notes = usg1 + sandhi_notes + \"\\nRegular Sandhis which\n * were being blocked by \" + \"pluta-pragRRihyA-aci-nityam(6.1.121)\n * are allowed by \" + \" 'apluta-vadupasthite' (6.2.125)\" + \"\\n\" +\n * usg2 ;\n * \n * sandhi_notes+= Prkr + apavada + depend + sutra +\n * \"pluta-pragRRihyA aci nityam' (6.1.121)\" + \"\\nCondition: Only if\n * String 1 is a Vedic Usage(Arsha-prayoga)\";\n * \n * //This note below goes after the Notes returned fropm\n * utsarga_sandhi above String cond1 = \"\\nRegular Sandhis which were\n * being blocked by \" + \"'pluta-pragRRihyA-aci-nityam'(6.1.121) are\n * allowed by \" + \" 'apluta-vadupasthite' (6.2.125)\";\n * vowel_notes.append_condition(cond1); ;\n */\n // We have to remove vriddhi_sandhi default notes\n // this is done by\n comments.decrementPointer();\n\n comments.start_adding_notes();\n comments.setSutraNum(\"6.1.121\");\n comments.setSutraPath(\"pluta-pragRRihyA aci nityam\");\n comments.setSutraProc(\"Prakruti Bhava\");\n comments.setSource(Comments.sutra);\n String cond1 = \"pluta-ending word or a pragRRihya followed by any Vowel result in Prakruti bhava sandhi.\\n\" + \"<pluta-ending> || pragRRihya + vowel = prakruti bhava.\";\n comments.setConditions(cond1);\n\n comments.start_adding_notes();\n comments.setSutraNum(\"6.2.125\");\n comments.setSutraPath(\"apluta-vadupasthite\");\n comments.setSutraProc(\"utsargic Sandhis Unblocked\");\n comments.setSource(Comments.sutra);\n String cond2 = depend + \"According to 6.1.121 plutantas followed by Vowels result in prakruti-bhaava\\n\" + \"However if the word 'iti' used is non-Vedic, then regular sandhis block 6.1.121.\";\n\n comments.setConditions(cond2);\n\n }\n\n // 250\n else if ((X_anta.endsWith(\"I3\") || X_anta.endsWith(\"i3\")) && VowelUtil.isAjadi(X_adi))\n // was making mistake of using vowel.is_Vowel(X_adi) */ )\n {// checked:29-6\n Log.info(\"came in 250\");\n return_me = utsarga_sandhi(X_anta, X_adi); // fixed error above:\n // was sending ITRANS\n // values rather than\n // SLP\n /*\n * sandhi_notes += apavada + sutra + \"'I3 cAkravarmaNasya'\n * (6.1.126)\" + \"Blocks 'pluta-pragRRihyA aci nityam' (6.1.121)\";\n */\n // vowel_notes.start_adding_notes();\n // vowel_notes.set_sutra_num(\"6.1.126\") ;\n // vowel_notes.setSutraPath(\"I3 cAkravarmaNasya\") ;\n // vowel_notes.set_sutra_proc(\"para-rupa ekadesh\");\n // vowel_notes.set_source(tippani.sutra) ;\n String cond1 = \"According to chaakravarman pluta 'i' should be trated as non-plutanta.\\n\" + \"Given in Panini Sutra 'I3 cAkravarmaNasya' (6.1.126). This sutra allows General Sandhis to operate by blocking\" + \"'pluta-pragRRihyA aci nityam' (6.1.121)\";\n comments.append_condition(cond1);\n\n }\n // prakrutibhava starts\n // 233-239 Vedic Usages\n // 243 : error (now fixed) shivA# isAgacha printing as sh-kaar ha-kaar\n // ikaar etc should be shakaar ikaar\n // **********ELSE IF****************//\n else if ((VowelUtil.isPlutanta(X_anta) || this.pragrhya == true) && VowelUtil.isAjadi(X_adi))\n // was making mistake of using Vowel.is_Vowel(X_adi) */ )\n {// checked:29-6\n Log.info(\"came in 243\");\n return_me = prakruti_bhava(X_anta, X_adi); // fixed error above:\n // was sending ITRANS\n // values rather than\n // SLP\n // sandhi_notes = Prkr + sutra + \"pluta-pragRRihyA aci nityam'\n // (6.1.121)\";\n comments.start_adding_notes();\n comments.setSutraNum(\"6.1.121\");\n comments.setSutraPath(\"pluta-pragRRihyA aci nityam\");\n comments.setSutraProc(\"prakruti bhava\");\n comments.setSource(Comments.sutra);\n String cond1 = \"pragRRihyas or plutantas followed by any vowel result in NO SANDHI which is prakruti bhava\"; // Fill\n // Later\n comments.setConditions(cond1);\n\n }\n // **********END OF ELSE IF****************//\n\n // **********ELSE IF****************//\n else if (anta.equals(\"go\") && adi.equals(\"indra\")) // Avan~Na Adesh\n {// checked:29-6\n String avang_adesh = EncodingUtil.convertSLPToUniformItrans(\"gava\"); // transform\n // ITRANS\n // gava\n // to\n // SLP\n return_me = guna_sandhi(avang_adesh, X_adi);\n // We have to remove guna_sandhi default notes\n // this is done by\n comments.decrementPointer();\n\n comments.start_adding_notes();\n comments.setSutraNum(\"6.1.120\");\n comments.setSutraPath(\"indre ca\");\n comments.setSutraProc(\"ava~nga Adesha followed by Guna Sandhi\");\n comments.setSource(Comments.sutra);\n String cond1 = \"Blocks Prakruti Bhava, and Ayadi Sandhi.\\n go + indra = go + ava~N + indra = gava + indra = gavendra.\"; // Fill\n // Later\n comments.setConditions(cond1);\n }\n // **********END OF ELSE IF****************//\n\n // 241 242 Vik.\n // **********ELSE IF****************//\n else if (anta.equals(\"go\") && VowelUtil.isAjadi(X_adi))\n {// checked:29-6\n\n return_me = utsarga_sandhi(X_anta, X_adi); //\n String avang_adesh = EncodingUtil.convertSLPToUniformItrans(\"gava\"); // transform\n // ITRANS\n // gava\n // to\n // SLP\n return_me += \", \" + utsarga_sandhi(avang_adesh, X_adi);\n\n // We have to remove utsarga_sandhi default notes\n // this is done by\n comments.decrementPointer();\n\n comments.start_adding_notes();\n comments.setSutraNum(\"6.1.119\");\n comments.setSutraPath(\"ava~N sphoTayanasya\");\n comments.setSutraProc(\"ava~nga Adesha followed by Regular Vowel Sandhis\");\n comments.setSource(Comments.sutra);\n String cond1 = padanta + \"View Only Supported by Sphotaayana Acharya.\\n\" + \"padanta 'go' + Vowel gets an avana~N-adesh resulting in gava + Vowel.\"; // Fill\n // Later...filled\n comments.setConditions(cond1);\n\n if (X_adi.startsWith(\"a\"))\n {\n return_me += \", \" + prakruti_bhava(X_anta, X_adi);\n\n comments.start_adding_notes();\n comments.setSutraNum(\"6.1.118\");\n comments.setSutraPath(\"sarvatra vibhaaSaa goH\");\n comments.setSutraProc(\"Optional Prakruti Bhava for 'go'(cow)implying words ending in 'e' or 'o'.\");\n comments.setSource(Comments.sutra);\n String cond2 = \"Padanta Dependency. Prakruti bhava if 'go' is followed by any other Phoneme.\"; // Fill\n // Later\n comments.setConditions(cond2);\n\n return_me += \", \" + purva_rupa(X_anta, X_adi);\n\n comments.start_adding_notes();\n comments.setSutraNum(\"6.1.105\");\n comments.setSutraPath(\"e~NaH padAntAdati\");\n comments.setSutraProc(\"purva-rupa ekadesh\");\n comments.setSource(Comments.sutra);\n String cond3 = padanta + \"If a padanta word ending in either 'e' or 'o' is followed by an 'a' purva-rupa ekadesh takes place\" + \"\\npadanta <e~N> 'e/o' + 'a' = purva-rupa ekadesha. Blocks Ayadi Sandhi\";\n comments.setConditions(cond3);\n\n }\n }\n // **********END OF ELSE IF****************//\n\n // 243\n\n // 244\n\n // 246 -250 , 253-260\n\n Log.info(\"return_me == \" + return_me);\n Log.info(\"*******EXITED AAPAVADA NIYAMA3s**********\");\n\n return return_me; // apavada rules formulated by Panini\n }", "public void logThis(String log, Theory theory)\n {\n }", "public static void test(String[] args) throws Exception {\n\t\tAbstractPILPDelegate.setDebugMode(null);\r\n\t\t\r\n\t\tComputeCostBasedOnFreq ins = new ComputeCostBasedOnFreq();\r\n\t\tins.initPreMapping(\"D:/data4code/replay/pre.csv\");\r\n\t\tins.getEventSeqForEachPatient(\"D:/data4code/cluster/LogBasedOnKmeansPlusPlus-14.csv\");\r\n\t\tins.removeOneLoop();\r\n\r\n\t\tPetrinetGraph net = null;\r\n\t\tMarking initialMarking = null;\r\n\t\tMarking[] finalMarkings = null; // only one marking is used so far\r\n\t\tXLog log = null;\r\n\t\tMap<Transition, Integer> costMOS = null; // movements on system\r\n\t\tMap<XEventClass, Integer> costMOT = null; // movements on trace\r\n\t\tTransEvClassMapping mapping = null;\r\n\r\n\t\tnet = constructNet(\"D:/data4code/mm.pnml\");\r\n\t\tinitialMarking = getInitialMarking(net);\r\n\t\tfinalMarkings = getFinalMarkings(net);\r\n\t\tXParserRegistry temp=XParserRegistry.instance();\r\n\t\ttemp.setCurrentDefault(new XesXmlParser());\r\n\t\tlog = temp.currentDefault().parse(new File(\"D:/data4code/mm.xes\")).get(0);\r\n//\t\tlog = XParserRegistry.instance().currentDefault().parse(new File(\"d:/temp/BPI2013all90.xes.gz\")).get(0);\r\n\t\t//\t\t\tlog = XParserRegistry.instance().currentDefault().parse(new File(\"d:/temp/BPI 730858110.xes.gz\")).get(0);\r\n\t\t//\t\t\tlog = XFactoryRegistry.instance().currentDefault().openLog();\r\n\t\tcostMOS = constructMOSCostFunction(net);\r\n\t\tXEventClass dummyEvClass = new XEventClass(\"DUMMY\", 99999);\r\n\t\tXEventClassifier eventClassifier = XLogInfoImpl.STANDARD_CLASSIFIER;\r\n\t\tcostMOT = constructMOTCostFunction(net, log, eventClassifier, dummyEvClass);\r\n\t\tmapping = constructMapping(net, log, dummyEvClass, eventClassifier);\r\n\r\n\t\tint cost1 = AlignmentTest.computeCost(costMOS, costMOT, initialMarking, finalMarkings, null, net, log,\r\n\t\t\t\tmapping, false);\r\n\t\tSystem.out.println(cost1);\r\n\t\t\r\n//\t\tint iteration = 0;\r\n//\t\twhile (true) {\r\n//\t\t\tSystem.out.println(\"start: \" + iteration);\r\n//\t\t\tlong start = System.currentTimeMillis();\r\n//\t\t\tint cost1 = AlignmentTest.computeCost(costMOS, costMOT, initialMarking, finalMarkings, null, net, log,\r\n//\t\t\t\t\tmapping, false);\r\n//\t\t\tlong mid = System.currentTimeMillis();\r\n//\t\t\tSystem.out.println(\" With ILP cost: \" + cost1 + \" t: \" + (mid - start));\r\n//\r\n//\t\t\tlong mid2 = System.currentTimeMillis();\r\n//\t\t\tint cost2 = AlignmentTest.computeCost(costMOS, costMOT, initialMarking, finalMarkings, null, net, log,\r\n//\t\t\t\t\tmapping, false);\r\n//\t\t\tlong end = System.currentTimeMillis();\r\n//\r\n//\t\t\tSystem.out.println(\" No ILP cost: \" + cost2 + \" t: \" + (end - mid2));\r\n//\t\t\tif (cost1 != cost2) {\r\n//\t\t\t\tSystem.err.println(\"ERROR\");\r\n//\t\t\t}\r\n//\t\t\t//System.gc();\r\n//\t\t\tSystem.out.flush();\r\n//\t\t\titeration++;\r\n//\t\t}\r\n\r\n\t}" ]
[ "0.6972952", "0.6015153", "0.59764385", "0.5973333", "0.58960956", "0.588816", "0.5868158", "0.5846135", "0.58236635", "0.5784596", "0.57443744", "0.56913257", "0.56423604", "0.5641666", "0.563092", "0.56274796", "0.5607455", "0.560446", "0.5597177", "0.558469", "0.55700153", "0.5555748", "0.5544792", "0.55311394", "0.5505189", "0.550406", "0.5497659", "0.5497659", "0.5497659", "0.5474642", "0.5452025", "0.5434392", "0.54250944", "0.5411048", "0.5398859", "0.5394405", "0.5379753", "0.5373949", "0.5370501", "0.53661144", "0.53547406", "0.53469557", "0.53363454", "0.5332351", "0.5327833", "0.5314385", "0.5310102", "0.5297534", "0.52960545", "0.5295589", "0.52944076", "0.5292022", "0.528724", "0.5281014", "0.52730095", "0.5270027", "0.5251526", "0.5247839", "0.5241565", "0.5239406", "0.5239325", "0.52379125", "0.52343845", "0.5234339", "0.52292424", "0.5228296", "0.5223437", "0.52135915", "0.5210934", "0.5210495", "0.5199843", "0.5199426", "0.519592", "0.51905406", "0.5185208", "0.5182573", "0.51764816", "0.5175541", "0.5165568", "0.5162608", "0.5161445", "0.5161051", "0.51593906", "0.5157288", "0.51548594", "0.514826", "0.51476604", "0.5144965", "0.51440364", "0.51424795", "0.5137396", "0.5137263", "0.5132822", "0.5130079", "0.5108986", "0.5100086", "0.5091768", "0.50837433", "0.5082367", "0.5081249" ]
0.5503477
26
filter averaging out pixel values
public static Integer[][] averager(Integer[][] matrixIn) { Integer[][] extendedMatrixInteger = expandMatrix(matrixIn); Integer[][] resultIntegers = new Integer[matrixIn.length][matrixIn[0].length]; for (int i = 0; i < resultIntegers.length; i++) { for (int j = 0; j < resultIntegers[0].length; j++) { resultIntegers[i][j] = pointAverage(i + 1, j + 1, extendedMatrixInteger); } } return resultIntegers; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static BufferedImage average(BufferedImage image, int value) {\n //3-position array where we store R,G,B values of every pixel\n int[] colors;\n //3-position array where we will store the mean value of every pixel of every channel\n int[] meanColor = new int[3];\n //mean values for every channel\n double meanRed, meanGreen, meanBlue;\n //Create a tessela form the original image so we can modify its pixels\n WritableRaster bitmap = (WritableRaster) image.getData();\n WritableRaster tesela = bitmap.createWritableChild(image.getMinX(), image.getMinY(), image.getWidth(), image.getHeight(), 0,0, null);\n //Image iteration\n for (int x = 0; x < image.getWidth()-1; x++){\n for (int y = 0; y < image.getHeight()-1; y++) {\n int red = 0, green=0, blue = 0;\n //Window iteration\n for (int f =-value; f <= value; f++) {\n for (int k = -value; k <= value; k++) {\n //Get every window coordinate, but first check if they actually exist (not out of bounds)\n if (y+(f)>=0 && x+(k)>=0 && y+(f) < image.getHeight() && x+(k)<image.getWidth()) {\n //Temporal store of the value of every channel so then we can compute the mean\n colors = getPixelColor(image,x+k,y+f);\n red += colors[0];\n green += colors[1];\n blue += colors[2];\n }\n }\n }\n //To compute the mean of every color we have to compute the 'distance'+1\n int distance = (value - (-value)+1)*(value - (-value)+1);\n //For every channel, compute the new pixel value\n meanRed = red / distance;\n meanColor[0] = (int) meanRed; \n meanGreen = green / distance;\n meanColor[1] = (int) meanGreen;\n meanBlue = blue / distance;\n meanColor[2] = (int) meanBlue;\n bitmap.setPixel(x,y,meanColor);\n }\n }\n //Create the averaged image and return it\n BufferedImage subImage = new BufferedImage(image.getColorModel(),tesela,image.isAlphaPremultiplied(),null);\n return subImage;\n }", "public static int[][] average(int[][] pixels){\r\n\t\t\t\r\n\t\t\tint height = pixels.length;\r\n\t\t\tint width = pixels[0].length;\r\n\t\t\t\r\n\t\t\t//Apply Average Filter\r\n\t for (int v = 1; v < height; v++) {\r\n\t for (int u = 1; u < width; u++) {\r\n\t \r\n\t int sum = 0;\r\n\t for (int j = -1; j <=1; j++) {\r\n\t for (int i = -1; i <= 1; i++) {\r\n\t if((u + (j) >= 0 && v + (i) >= 0 && u+(j) < width && v + (i) < height)){\r\n\t \tint p = pixels[v+(i)][u+(j)];\r\n\t \tsum = sum + p;\r\n\t }\r\n\t }\r\n\t }\r\n\r\n\t int q = (int) (sum /9);\r\n\t aResult[v][u] = q;\r\n\t }\r\n\t }\r\n\t return aResult;\r\n\t\t}", "public int[] mean_thresh(int[] src, int width, int height, int size,\n int con) {\n\n i_w = width;\n i_h = height;\n src_1d = new int[i_w * i_h];\n dest_1d = new int[i_w * i_h];\n int mean = 0;\n int count = 0;\n src_1d = src;\n int[][] tmp_2d = new int[i_w][i_h];\n\n //First convert input array from 1_d to 2_d for ease of processing\n for (int i = 0; i < i_w; i++) {\n for (int j = 0; j < i_h; j++) {\n tmp_2d[i][j] = src_1d[i + (j * i_w)] & 0x000000ff;\n }\n }\n\n final int HALF_SIZE = size / 2;\n //Now find the sum of values in the size X size neigbourhood\n for (int j = 0; j < i_h; j++) {\n for (int i = 0; i < i_w; i++) {\n mean = 0;\n count = 0;\n //Check the local neighbourhood\n for (int k = 0; k < size; k++) {\n for (int l = 0; l < size; l++) {\n\n int x = i - HALF_SIZE + k;\n int y = j - HALF_SIZE + l;\n //If out of bounds then ignore pixel\n if (x >= 0 && x < i_w && y >= 0 && y < i_h) {\n mean = mean + tmp_2d[x][y];\n count++;\n }\n }\n }\n //Find the mean value\n mean = (mean / count) - con;\n\n //Threshold below the mean\n if (tmp_2d[i][j] > mean) {\n dest_1d[i + (j * i_w)] = 0xffffffff;\n } else {\n dest_1d[i + (j * i_w)] = 0xff000000;\n }\n }\n }\n return dest_1d;\n }", "public void filterImage()\r\n {\r\n\t if (!isInverted && !isBlured )\r\n {\r\n cropedEdited = cropedPart;\r\n }\r\n\t float[] elements = {0.0f, 1.0f, 0.0f, -1.0f,brightnessLevel,1.0f,0.0f,0.0f,0.0f}; \r\n\t Kernel kernel = new Kernel(3, 3, elements); \r\n\t BufferedImageOp change = new ConvolveOp(kernel); \r\n\t cropedEdited = change.filter(cropedEdited, null);\r\n repaint();\r\n }", "public int[] meanMaxMin_thresh(int[] src, int width, int height, int size,\n int con) {\n\n i_w = width;\n i_h = height;\n src_1d = new int[i_w * i_h];\n dest_1d = new int[i_w * i_h];\n int mean = 0;\n int max, min;\n int[] values = new int[size * size];\n src_1d = src;\n int[][] tmp_2d = new int[i_w][i_h];\n\n //First convert input array from 1_d to 2_d for ease of processing\n for (int i = 0; i < i_w; i++) {\n for (int j = 0; j < i_h; j++) {\n tmp_2d[i][j] = src_1d[i + (j * i_w)] & 0x000000ff;\n }\n }\n\n int tmp;\n\n //Now find the max and min of values in the size X size neigbourhood\n for (int j = 0; j < i_h; j++) {\n for (int i = 0; i < i_w; i++) {\n mean = 0;\n max = tmp_2d[i][j];\n min = tmp_2d[i][j];\n //Check the local neighbourhood\n for (int k = 0; k < size; k++) {\n for (int l = 0; l < size; l++) {\n try {\n tmp = tmp_2d[(i - ((int) (size / 2)) + k)]\n [(j - ((int) (size / 2)) + l)];\n if (tmp > max) {\n max = tmp;\n }\n if (tmp < min) {\n min = tmp;\n }\n }\n //If out of bounds then ignore pixel\n catch (ArrayIndexOutOfBoundsException e) {\n // TODO: eliminate this\n }\n }\n }\n //Find the mean value\n\n tmp = max + min;\n tmp = tmp / 2;\n mean = tmp - con;\n\n //Threshold below the mean\n if (tmp_2d[i][j] >= mean) {\n dest_1d[i + (j * i_w)] = 0xffffffff;\n } else {\n dest_1d[i + (j * i_w)] = 0xff000000;\n }\n }\n }\n return dest_1d;\n }", "private void overexposure(Bitmap bmp) {\n int w = bmp.getWidth();\n int h = bmp.getHeight();\n int[] pixels = new int[w*h];\n bmp.getPixels(pixels, 0, w, 0, 0, w, h);\n for (int i = 0; i < w*h; i++) {\n float[] hsv = new float[3];\n Color.RGBToHSV(Color.red(pixels[i]), Color.green(pixels[i]), Color.blue(pixels[i]), hsv);\n hsv[2] *= 1.5;\n pixels[i] = Color.HSVToColor(hsv);\n }\n bmp.setPixels(pixels, 0, w, 0, 0, w, h);\n }", "private static void filterNoise(BufferedImage image) {\n\t\tfor (int x=0; x<image.getWidth(); x++) {\r\n\t\t\tfor (int y=0; y<image.getHeight(); y++) {\r\n\t\t\t\t\r\n\t\t\t\tint pixelVal = image.getRGB(x, y);\r\n\r\n\t\t\t\t// check how many pixels in a 2 x 2 rectangle with this point \r\n\t\t\t\t// in the center have the same color as this point; if not \r\n\t\t\t\t// many, flip this pixel's color\r\n\t\t\t\tint startX = Math.max(x-2, 0);\r\n\t\t\t\tint startY = Math.max(y-2, 0);\r\n\t\t\t\tint endX = Math.min(x+2, image.getWidth()-1);\r\n\t\t\t\tint endY = Math.min(y+2, image.getHeight()-1);\r\n\r\n\t\t\t\tint matchCount = 0;\r\n\t\t\t\tint totalCount = 0;\r\n\t\t\t\tfor (int i=startX; i<=endX; i++) {\r\n\t\t\t\t\tfor (int j=startY; j<=endY; j++) {\r\n\t\t\t\t\t\tif (image.getRGB(i,j) == pixelVal) {\r\n\t\t\t\t\t\t\tmatchCount++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ttotalCount++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ((matchCount / (double) totalCount) < .2) {\r\n\t\t\t\t\tif (pixelVal == Color.YELLOW.getRGB()) {\r\n\t\t\t\t\t\timage.setRGB(x, y, Color.BLACK.getRGB());\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\timage.setRGB(x, y, Color.YELLOW.getRGB());\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\tif (debug) {\r\n\t\t\ttry {\r\n\t\t\t\tImageIO.write(image, \"gif\", new File(\"noiseFiltered.gif\"));\r\n\t\t\t} catch (Exception e) {e.printStackTrace();}\r\n\t\t}\r\n\t}", "List<List<Pixel>> filter(Image img, int multiplier, String operation);", "public void pixave(int x1, int y1, int x2, int y2) {\n float sumr,sumg,sumb;\n int pix;\n int r,g,b;\n int n;\n\n if(x1<0) x1=0;\n if(x2>=kWidth) x2=kWidth-1;\n if(y1<0) y1=0;\n if(y2>=kHeight) y2=kHeight-1;\n\n sumr=sumg=sumb=0.0f;\n for(int y=y1; y<=y2; y++) {\n for(int i=kWidth*y+x1; i<=kWidth*y+x2; i++) {\n pix= kinecter.depthImg.pixels[i];\n b=pix & 0xFF; // blue\n pix = pix >> 8;\n g=pix & 0xFF; // green\n pix = pix >> 8;\n r=pix & 0xFF; // red\n //if( random(0, 150000) > 149000 && r > 0) println(\"r \" + r + \" b \" + b + \" g \" + g);\n // averaging the values\n sumr += b;//r;//g;//r;\n sumg += b;//r;//g;\n sumb += b;//r;//g;//b;\n }\n }\n n = (x2-x1+1)*(y2-y1+1); // number of pixels\n // the results are stored in static variables\n ar = sumr/n; \n ag=sumg/n; \n ab=sumb/n;\n }", "private void filter(BufferedImageOp op)\n { \n if (image == null) return;\n BufferedImage filteredImage \n = new BufferedImage(image.getWidth(), image.getHeight(), image.getType());\n op.filter(image, filteredImage);\n image = filteredImage;\n repaint();\n }", "@Test void compareToNaive() {\n\t\tfor (var type : new ImageType[]{ImageType.SB_U8, ImageType.SB_U16, ImageType.SB_F32, ImageType.SB_F64}) {\n\t\t\tvar src = (ImageGray)type.createImage(width, height);\n\t\t\tvar dst = (ImageGray)type.createImage(1, 1);\n\n\t\t\tGImageMiscOps.fillUniform(src, rand, 0, 100);\n\n\t\t\tdouble mean = GImageStatistics.mean(src);\n\t\t\tGeometricMeanFilter.filter(src, radiusX, radiusY, mean, dst);\n\n\t\t\tassertEquals(width, dst.width);\n\t\t\tassertEquals(height, dst.height);\n\n\t\t\tfor (int y = 0; y < dst.height; y++) {\n\t\t\t\tfor (int x = 0; x < dst.width; x++) {\n\t\t\t\t\tdouble found = GeneralizedImageOps.get(dst, x, y);\n\t\t\t\t\tassertEquals(naiveMean(src, x, y, radiusX, radiusY), found, 1.0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public List<Peak> filterNoise(List<Peak> peaks, double threshold, double experimentalPrecursorMzRatio);", "public void filterImage() {\n\n if (opIndex == lastOp) {\n return;\n }\n\n lastOp = opIndex;\n switch (opIndex) {\n case 0:\n biFiltered = bi; /* original */\n return;\n case 1:\n biFiltered = ImageNegative(bi); /* Image Negative */\n return;\n\n case 2:\n biFiltered = RescaleImage(bi);\n return;\n\n case 3:\n biFiltered = ShiftImage(bi);\n return;\n\n case 4:\n biFiltered = RescaleShiftImage(bi);\n return;\n\n case 5:\n biFiltered = Add(bi, bi1);\n return;\n\n case 6:\n biFiltered = Subtract(bi, bi1);\n return;\n\n case 7:\n biFiltered = Multiply(bi, bi1);\n return;\n\n case 8:\n biFiltered = Divide(bi, bi1);\n return;\n\n case 9:\n biFiltered = NOT(bi);\n return;\n\n case 10:\n biFiltered = AND(bi, bi1);\n return;\n\n case 11:\n biFiltered = OR(bi, bi1);\n return;\n\n case 12:\n biFiltered = XOR(bi, bi1);\n return;\n\n case 13:\n biFiltered = ROI(bi);\n return;\n\n case 14:\n biFiltered = Negative_Linear(bi);\n return;\n\n case 15:\n biFiltered= Logarithmic_function(bi);\n return;\n\n case 16:\n biFiltered = Power_Law(bi);\n return;\n\n case 17:\n biFiltered = LUT(bi);\n return;\n\n case 18:\n biFiltered = Bit_planeSlicing(bi);\n return;\n\n case 19:\n biFiltered = Histogram(bi1,bi2);\n return;\n\n case 20:\n biFiltered = HistogramEqualisation(bi,bi3);\n return;\n\n case 21:\n biFiltered = Averaging(bi1);\n return;\n\n case 22:\n biFiltered = WeightedAveraging(bi1);\n return;\n\n case 23:\n biFiltered = fourNeighbourLaplacian(bi1);\n return;\n\n case 24:\n biFiltered= eightNeighbourLaplacian(bi1);\n return;\n\n case 25:\n biFiltered = fourNeighbourLaplacianEnhancement(bi1);\n return;\n\n case 26:\n biFiltered = eightNeighbourLaplacianEnhancement(bi1);\n return;\n\n case 27:\n biFiltered = Roberts(bi1);\n return;\n\n case 28:\n biFiltered = SobelX(bi1);\n return;\n\n case 29:\n biFiltered = SobelY(bi1);\n return;\n\n case 30:\n biFiltered = Gaussian(bi1);\n return;\n\n case 31:\n biFiltered = LoG (bi1);\n return;\n\n case 32:\n biFiltered = saltnpepper(bi4);\n return;\n\n case 33:\n biFiltered = minFiltering(bi4);\n return;\n\n case 34:\n biFiltered = maxFiltering(bi4);\n return;\n\n case 35:\n biFiltered = maidpointFiltering(bi4);\n return;\n\n case 36:\n biFiltered = medianFiltering(bi4);\n return;\n\n case 37:\n biFiltered = simpleThresholding(bi5);\n return;\n\n case 38:\n biFiltered = automatedThresholding(bi6);\n return;\n\n case 39:\n biFiltered = adaptiveThresholding(bi7);\n return;\n }\n }", "private int[] getAveragedVals(int x, int y, int n, int m) {\n\t\tint[] rtn = new int[NUM_TRIANGLE_SIDES];\n\t\tint avgRed = 0;\n\t\tint avgGreen = 0;\n\t\tint avgBlue = 0;\n\t\tint totalPixels = 0;\n\n\t\tfor (int i = x; i < (x+n); i++) {\n\t\t\tfor (int j = y; j < (y+m); j++) {\n\t\t\t\tif (j < this.getPictureHeight() && i < this.getPictureWidth()) {\n\t\t\t\t\tavgRed += this.image.getPixelRed(i,j);\n\t\t\t\t\tavgGreen += this.image.getPixelGreen(i,j);\n\t\t\t\t\tavgBlue += this.image.getPixelBlue(i,j);\n\t\t\t\t\ttotalPixels++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (totalPixels == 0) {\n\t\t\trtn[0] = 255;\t\t\n\t\t\trtn[1] = 255;\n\t\t\trtn[2] = 255;\n\t\t\treturn rtn;\n\t\t}\n\n\t\trtn[0] = avgRed / totalPixels;\t\t\n\t\trtn[1] = avgGreen / totalPixels;\n\t\trtn[2] = avgBlue / totalPixels;\n\t\treturn rtn;\n\t}", "public static int run(Bitmap temp) {\n Mat src = new Mat();\n Bitmap bmp32 = temp.copy(Bitmap.Config.ARGB_8888, true);\n Utils.bitmapToMat(bmp32, src);\n\n List<Mat> bgrPlanes = new ArrayList<>();\n Core.split(src, bgrPlanes);\n\n int histSize = 256;\n\n float[] range = {0, 256}; //the upper boundary is exclusive\n MatOfFloat histRange = new MatOfFloat(range);\n\n boolean accumulate = false;\n\n Mat bHist = new Mat(), gHist = new Mat(), rHist = new Mat();\n Imgproc.calcHist(bgrPlanes, new MatOfInt(0), new Mat(), bHist, new MatOfInt(histSize), histRange, accumulate);\n Imgproc.calcHist(bgrPlanes, new MatOfInt(1), new Mat(), gHist, new MatOfInt(histSize), histRange, accumulate);\n Imgproc.calcHist(bgrPlanes, new MatOfInt(2), new Mat(), rHist, new MatOfInt(histSize), histRange, accumulate);\n\n float[] bHistData = new float[(int) (bHist.total() * bHist.channels())];\n bHist.get(0, 0, bHistData);\n float[] gHistData = new float[(int) (gHist.total() * gHist.channels())];\n gHist.get(0, 0, gHistData);\n float[] rHistData = new float[(int) (rHist.total() * rHist.channels())];\n rHist.get(0, 0, rHistData);\n\n // Get num vals at each intensity and sum total vals\n float totalVals = 0;\n float[] histData = new float[256];\n for(int i = 0; i < histSize; i++) {\n histData[i] = bHistData[i] + gHistData[i] + rHistData[i];\n totalVals = totalVals + histData[i];\n }\n\n // Get sum of all values * intensities\n float sum = 0;\n for(int i = 0; i < histSize; i++) {\n sum = sum + (histData[i] * i);\n }\n\n // Divide by total value to find average intensity\n float avg = sum / totalVals;\n\n // Check what range avg is in\n if(avg < 51) {\n return 1;\n } else if (avg < 102) {\n return 3;\n } else if (avg < 153) {\n return 5;\n } else if (avg < 205) {\n return 4;\n } else if (avg < 256) {\n return 2;\n } else {\n return 0;\n }\n }", "public native MagickImage averageImages() throws MagickException;", "private void doBlur(int times){\n \n int pixel, x,y;\n long s,r,g,b;\n //times the image will be blurred with the kernel\n for (int t = 0; t < times; t++) {\n //march pixels\n for (int i = 0; i < size; i++) {\n for (int j = 0; j < size; j++) {\n //reset colors\n r = g = b = s = 0;\n //march pixels inside kernel\n for (int k = 0; k < kernelSize; k++) {\n for (int l = 0; l < kernelSize; l++) {\n //get rgb color from pixel\n x = j + l - kernelCenter; \n y = i + k - kernelCenter;\n try{\n if( x>=0 && x<512 && y>=0 && y<512 ){\n pixel = imageKerneled.getRGB(x,y);\n //multiply the rgb by the number in kernel\n r += ((pixel >> 16) & 0xff) * kernel[k][l];\n g += ((pixel >> 8) & 0xff) * kernel[k][l];\n b += ((pixel) & 0xff) * kernel[k][l];\n s += kernel[k][l];\n }\n }catch(ArrayIndexOutOfBoundsException e){\n System.out.println(\"Error en \"+x+\",\"+y);\n }\n }\n }\n //averages\n r = Math.round(r/s);\n if(r>255) {System.out.println(r+\" entro r > 255 en \"+j+\",\"+i); r=255; }\n else if(r<0) {System.out.println(r+\" entro r < 255 en \"+j+\",\"+i); r=0; }\n g = Math.round(g/s);\n if(g>255) {System.out.println(g+\" entro g > 255 en \"+j+\",\"+i); g=255; }\n else if(g<0) {System.out.println(g+\" entro g < 255 en \"+j+\",\"+i); g=0; }\n b = Math.round(b/s);\n if(b>255) {System.out.println(b+\" entro b > 255 en \"+j+\",\"+i); b=255; }\n else if(b<0) {System.out.println(b+\" entro b < 255 en \"+j+\",\"+i); b=0; }\n //set the new rgb\n imageKerneled2.setRGB(j,i,new Color((int)r,(int)g,(int)b).getRGB());\n }\n }\n copyKerneled2ToKerneled();\n System.out.println(\"Finished blur: \"+(t+1));\n }\n }", "public double getMeanValuePixels() {\n\t\tdouble avg = 0;\n\n\t\tfor (int i = 0; i < width; i++) {\n\t\t\tfor (int j = 0; j < height; j++) {\n\t\t\t\tavg += this.image[i][j];\n\t\t\t}\n\t\t}\n\t\tavg /= this.getQtyPixels();\n\n\t\treturn avg;\n\t}", "public void useFilter() {\r\n\t\t\tif(src.channels() > 1) {\r\n\t\t\t\tImgproc.cvtColor(src, bwsrc, Imgproc.COLOR_BGR2GRAY);\r\n\t\t\t\tdst = new Mat(bwsrc.size(),CvType.CV_8U);\r\n\t\t\t\tfor(int i = 0; i<bwsrc.rows();i++) {\r\n\t\t\t\t\tfor(int j = 0; j <bwsrc.cols();j++) {\r\n\t\t\t\t\t\tif(bwsrc.get(i,j)[0]>=t) {\r\n\t\t\t\t\t\t\tdst.put(i, j, 255);\r\n\t\t\t\t\t\t}else dst.put(i, j, 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else {\r\n\t\t\t\tdst = new Mat(src.size(),CvType.CV_8U);\r\n\t\t\t\tfor(int i = 0; i<src.rows();i++) {\r\n\t\t\t\t\tfor(int j = 0; j <src.cols();j++) {\r\n\t\t\t\t\t\tif(src.get(i,j)[0]>=t) {\r\n\t\t\t\t\t\t\tdst.put(i, j, 255);\r\n\t\t\t\t\t\t}else dst.put(i, j, 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "public static ImagePlus[] normalizeBeforeComputation(ImagePlus []imgsEchoes,ImagePlus imgMask) {\n\t\tImagePlus []tabRet=VitimageUtils.imageTabCopy(imgsEchoes);\n\t\tImagePlus imgSum=VitimageUtils.sumOfImages(imgsEchoes);\n\t\timgSum=VitimageUtils.makeOperationBetweenTwoImages(imgSum, imgMask, 2, true);\n\t\tint Z=imgSum.getNSlices();\n\t\tint X=VitimageUtils.getDimensions(imgSum)[0];\n\t\tint Y=VitimageUtils.getDimensions(imgSum)[1];\n\t\tint[][]coords=new int[Z][3];\n\t\tdouble[]meanOverAll=new double[Z];\n\t\tdouble[]meanOverCap=new double[Z];\n\t\tdouble[]meanOverRest=new double[Z];\n\t\tdouble globalMeanOverCap;\n\t\tdouble globalMeanOverRest;\n\t\tint radiusAroundCapillary=(int)Math.round(VitimageUtils.bionanoCapillaryRadius*1.5/VitimageUtils.getVoxelSizes(imgSum)[0]);\n\t\t//Pour chaque Z\n\t\tfor(int z=0;z<Z;z++) {\n\t\t\tImagePlus sliceTemp=new Duplicator().run(imgSum,1,1,z+1,z+1,1,1);\n\t\t\t//Pour cette image, localiser le capillaire, sur chaque Z\n\t\t\tcoords[z]=VitimageUtils.findCapillaryCenterInSlice(sliceTemp, VitimageUtils.bionanoCapillaryRadius);\n\t\t\tif(coords[z][0]<radiusAroundCapillary+5 || coords[z][1]<radiusAroundCapillary+5 || coords[z][0]>(X-radiusAroundCapillary-5) || coords[z][0]>(Y-radiusAroundCapillary-5) ) {\n\t\t\t\tIJ.showMessage(\"Warning in normalizeBeforeComputation : unsteady mean computation at z=\"+z+\" because capillary is detected near the border, at coordinates \"+coords[z][0]+\" , \"+coords[z][1]+\" with an indicated security radius of \"+radiusAroundCapillary);\n\t\t\t}\n\t\t\t\n\t\t\t//Mesurer la moyenne autour du capillaire\n\t\t\tmeanOverCap[z]=VitimageUtils.meanValueofImageAround(sliceTemp, coords[z][0], coords[z][1], 0,radiusAroundCapillary);\n\t\t\t\n\t\t\t\n\t\t\t//Mesurer la moyenne de l'image\n\t\t\tint radiusImg=Math.min(X/2,Y/2)-2;\n\t\t\tmeanOverAll[z]=VitimageUtils.meanValueofImageAround(sliceTemp, X/2, Y/2, 0,radiusImg);\n\t\t\t\n\t\t\t//Oter l'un à l'autre\n\t\t\tmeanOverRest[z]=meanOverAll[z]*(2*radiusImg+1)*(2*radiusImg+1) - meanOverCap[z]*(2*radiusAroundCapillary+1)*(2*radiusAroundCapillary+1);\n\t\t\tmeanOverRest[z]=meanOverRest[z]/( (2*radiusImg+1)*(2*radiusImg+1) - (2*radiusAroundCapillary+1)*(2*radiusAroundCapillary+1) );\n\n\t\t}\n\t\t//Faire la moyenne des valeurs mesurées along Z\n\t\tglobalMeanOverRest=VitimageUtils.statistics1D(meanOverRest)[0];\n\t\tglobalMeanOverCap=VitimageUtils.statistics1D(meanOverCap)[0];\n\n\t\tint radiusSq=radiusAroundCapillary*radiusAroundCapillary;\n\t\tdouble distSq;\n\t\t//Pour chaque Z\n\t\tfor(int im=0;im<tabRet.length;im++) {\n\t\t\tIJ.run(tabRet[im],\"32-bit\",\"\");\n\t\t\tfor(int z=0;z<Z;z++) {\n\t\t\t\tfloat[]tabData=(float[])tabRet[im].getStack().getProcessor(z+1).getPixels();\n\t\t\t\tdouble factorMultCap=globalMeanOverCap/meanOverCap[z];\n\t\t\t\tdouble factorMultRest=globalMeanOverRest/meanOverRest[z];\n\t\t\t\tfor(int x=0;x<X;x++) {\n\t\t\t\t\tfor(int y=0;y<Y;y++) {\n\t\t\t\t\t\tdistSq=(coords[z][0]-x)*(coords[z][0]-x) + (coords[z][1]-y)*(coords[z][1]-y);\n\t\t\t\t\t\t//Multiplier par moy / facteur 1(Z) sauf dans cap ou on multiplie par moy / facteur 2(Z) \n\t\t\t\t\t\tif(distSq<radiusSq)tabData[X*y+x]*=(factorMultCap);\n\t\t\t\t\t\telse tabData[X*y+x]*=(factorMultRest);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\t\t\t\n\t\treturn tabRet;\n\t}", "void removeNearbyPixels(Stroke theStroke){\n\t\tint index;\n\t\tint CurvIndex;\n\t\tint SpeedIndex;\n\t\tVector ptList = theStroke.getM_ptList();\n\t\tfor(index=0; index < CommonSegmentPts.size(); index++){\n\t\t\tPoint CommonPt = (PixelInfo)ptList.get((Integer)CommonSegmentPts.get(index));\n\t\t\tfor(CurvIndex = 0; CurvIndex < CurvVector.size(); CurvIndex++){\n\t\t\t\tPoint CurvPt = (PixelInfo)ptList.get((Integer)CurvVector.get(CurvIndex));\n\t\t\t\tif(CommonPt.distance(CurvPt) <= TolerantDistance){\n\t\t\t\t\tCurvVector.remove(CurvIndex--);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(SpeedIndex = 0; SpeedIndex < SpeedVector.size(); SpeedIndex++){\n\t\t\t\tPoint SpeedPt = (PixelInfo)ptList.get((Integer)SpeedVector.get(SpeedIndex));\n\t\t\t\tif(CommonPt.distance(SpeedPt) <= TolerantDistance){\n\t\t\t\t\tSpeedVector.remove(SpeedIndex--);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private Color computeAverageColor(AbstractCollection<Pixel> pixels)\n {\n int r=0, g=0, b=0;\n for(Pixel p : pixels)\n {\n Color c = new Color(image.getRGB(p.p, p.q));\n r+=c.getRed();\n g+=c.getGreen();\n b+=c.getBlue();\n }\n return new Color(r/pixels.size(),g/pixels.size(),b/pixels.size());\n }", "public native int getFilter() throws MagickException;", "public void filter(PixelImage pi) {\n\t\tPixel[][] data = pi.getData();\r\n\r\n\t\t\r\n\t\t// use loop to edit every pixel\r\n\t\tfor (int rowTemp = 1; rowTemp < data.length-1; rowTemp+=1) {\r\n\t\t\tfor (int colTemp = 1; colTemp < data[0].length-1; colTemp+=1) {\r\n\t\t\t\t\r\n\t\t\t\t// get every pixel in 3x3\r\n\t\t\t\tPixel tempMid =data[rowTemp][colTemp];\t\t\t\t\r\n\t\t\t\tPixel temp2 = data[rowTemp-1][colTemp];\r\n\t\t\t\tPixel temp1 = data[rowTemp-1][colTemp-1];\r\n\t\t\t\tPixel temp3 = data[rowTemp-1][colTemp+1];\r\n\t\t\t\tPixel temp4 = data[rowTemp][colTemp-1];\r\n\t\t\t\tPixel temp6 = data[rowTemp][colTemp+1];\r\n\t\t\t\tPixel temp7 = data[rowTemp+1][colTemp-1];\r\n\t\t\t\tPixel temp8 = data[rowTemp+1][colTemp];\r\n\t\t\t\tPixel temp9 = data[rowTemp+1][colTemp+1];\r\n\t\t\r\n\t\t\t\t// put red color in redList\r\n\t\t\t\tint[] redList = {temp1.red,temp2.red,temp3.red,\r\n\t\t\t\t\t\ttemp4.red,temp7.red,temp6.red,temp8.red,temp9.red,tempMid.red};\r\n\t\t\t\t\r\n\t\t\t\t// arrange list in the order that int is from small to big\r\n\t\t\t\tArrays.sort(redList);\r\n\t\t\t\t\r\n\t\t\t\t// take the middle int\t\t\t\r\n\t\t\t\ttempMid.red= redList[4];\r\n\t\t\t\t\r\n\t\t\t\t// put blue color in redList\t\t\r\n\t\t\t\tint[] blueList = {temp1.blue,temp2.blue,temp3.blue,\r\n\t\t\t\t\t\ttemp4.blue,\ttemp7.blue,temp6.blue,temp8.blue,temp9.blue,tempMid.blue};\r\n\t\t\t\tArrays.sort(blueList);\r\n\t\t\t\t// get the middle int\r\n\t\t\t\ttempMid.blue= blueList[4];\r\n\t\t\t\r\n\t\t\t\t// put green color in redList\r\n\t\t\t\tint[] greenList = {temp1.green,temp2.green,temp3.green\r\n\t\t\t\t\t\t,temp4.green,temp7.green,temp6.green,temp8.green,temp9.green,tempMid.green};\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\tArrays.sort(greenList);\r\n\t\t\t\t\r\n\t\t\t\ttempMid.green= greenList[4];\r\n\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\tdata[rowTemp][colTemp]=tempMid;\r\n\r\n\t\t\t}\t\t\r\n\t\t}\r\n\t\r\n\r\n\t\tpi.setData(data);\r\n\t}", "public static Image filtroGris(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double red, green, blue;\n red = color.getRed();\n green = color.getGreen();\n blue = color.getBlue();\n red *= 255;\n green *= 255;\n blue *= 255;\n double gris = (red + green + blue)/3;\n pixelw.setColor(j, i, Color.rgb((int)gris, (int)gris, (int)gris));\n }\n }\n \n return resultImg;\n }", "public static Image filtroGrisVerde(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double green;\n green = color.getGreen();\n green *= 255;\n pixelw.setColor(j, i, Color.rgb((int)green, (int)green, (int)green));\n }\n }\n \n return resultImg;\n }", "public void applyFilterAtPoint(int x, int y, BufferedImage imgIn, BufferedImage imgOut) {\r\n\t double dltX = 0; double dltY = 0;\r\n\r\n\t for(int i_x = -getMargin(); i_x <= getMargin(); i_x++) {\r\n\t for(int i_y = -getMargin(); i_y <= getMargin(); i_y++) {\r\n\t int rgb = imgIn.getRGB(x + i_x, y + i_y);\r\n\t int blue = (rgb) & 0x000000FF;\r\n\t double V_ = blue * Math.exp(-0.25 * (Math.pow(i_x, 2) + Math.pow(i_y, 2)));\r\n\t dltX += Integer.signum(i_x) * V_;\r\n\t dltY += Integer.signum(i_y) * V_;\r\n\t }\r\n\t }\r\n\r\n\t double N_ = Math.sqrt(Math.pow(dltX, 2) + Math.pow(dltY, 2));\r\n\t double V_ = 255.0 - 0.5 * N_;\r\n\t int V_grey = (int) Math.round(Math.max(0.0d, V_));\r\n\t imgOut.setRGB(x - this.getMargin() , y - this.getMargin(), new Color(V_grey, V_grey, V_grey).getRGB());\r\n\t }", "public static int[] LoGFilter(int[] data, int w, int h) {\n int[] newData = new int[w * h];\n\n // apply filter\n int kernel_size = 3; // kernel size\n double s = 1.1; // sigma value\n double i2ss = 0.5 / s / s, issss = 1d / s / s / s / s;\n\n double[][] kernel = new double[kernel_size * 2 + 1][kernel_size * 2 + 1];\n for (int i = -kernel_size; i <= kernel_size; i++) {\n for (int j = -kernel_size; j <= kernel_size; j++) {\n double ss = (i * i + j * j) * i2ss;\n kernel[i + kernel_size][j + kernel_size] = (ss - 1d) * Math.exp(-ss) * issss / Math.PI;\n }\n }\n\n for (int x = 0; x < w; x++) {\n for (int y = 0; y < h; y++) {\n double sum = 0d;\n for (int i = -kernel_size; i <= kernel_size; i++) {\n for (int j = -kernel_size; j <= kernel_size; j++) {\n int xx = x + i, yy = y + j;\n if (xx >= 0 && xx < w && yy >= 0 && yy < h) {\n sum += kernel[i + kernel_size][j + kernel_size] * RGB.luminance(data[yy * w + xx]);\n }\n }\n }\n\n newData[y * w + x] = (int) sum;\n }\n }\n\n return newData;\n }", "public boolean test(MyList<Point> pixels, Image img)\r\n/* 19: */ {\r\n/* 20:33 */ int volume = 0;\r\n/* 21:35 */ for (MyListNode<Point> n = pixels.getHead(); n != null; n = n.getNext())\r\n/* 22: */ {\r\n/* 23:36 */ Point p = (Point)n.getDatum();\r\n/* 24: */ \r\n/* 25:38 */ int[] val = img.getVXYByte(p.x, p.y);\r\n/* 26:40 */ for (int c = 0; c < val.length; c++) {\r\n/* 27:41 */ volume += img.getXYCByte(p.x, p.y, c);\r\n/* 28: */ }\r\n/* 29: */ }\r\n/* 30:44 */ if (volume < this.threshold) {\r\n/* 31:44 */ return false;\r\n/* 32: */ }\r\n/* 33:45 */ return true;\r\n/* 34: */ }", "BufferedImage filterH(BufferedImage img, int order);", "protected void reduceBitmapMode(BufferedImage img, int xoffs, int yoffs) {\n \t\t@SuppressWarnings(\"unchecked\")\n \t\tMap<Integer, Integer>[] histograms = new Map[(img.getWidth() + 7) / 8];\n \t\t@SuppressWarnings(\"unchecked\")\n \t\tMap<Integer, Integer>[] histogramSides = new Map[(img.getWidth() + 7) / 8];\n \t\t\n \t\t// be sure we select the 8 pixel groups sensibly\n \t\tif ((xoffs & 7) > 3)\n \t\t\txoffs = (xoffs + 7) & ~7;\n \t\telse\n \t\t\txoffs = xoffs & ~7;\n \t\t\n \t\tint width = img.getWidth();\n \t\tfor (int y = 0; y < img.getHeight(); y++) {\n \t\t\t// first scan: get histogram for each range\n \t\t\t\n \t\t\tfor (int x = 0; x < width; x += 8) {\n \t\t\t\tMap<Integer, Integer> histogram = new HashMap<Integer, Integer>();\n \t\t\t\tMap<Integer, Integer> histogramSide = new HashMap<Integer, Integer>();\n \t\t\t\t\n \t\t\t\thistograms[x / 8] = histogram;\n \t\t\t\thistogramSides[x / 8] = histogramSide;\n \t\t\t\t\n \t\t\t\tint maxx = x + 8 < width ? x + 8 : width;\n \t\t\t\t\n \t\t\t\tint scmx;\n \t\t\t\tint scmn;\n \t\t\t\t\n \t\t\t\t// scan outside the 8 pixels to get a broader\n \t\t\t\t// idea of what colors are important\n \t\t\t\tscmn = Math.max(0, x - 4);\n \t\t\t\tscmx = Math.min(width, maxx + 4);\n \t\t\t\t\n \t\t\t\tint pixel = 0;\n \t\t\t\tfor (int xd = scmn; xd < scmx; xd++) {\n \t\t\t\t\tif (xd < width)\n \t\t\t\t\t\tpixel = img.getRGB(xd, y);\n \t\t\t\t\t\n \t\t\t\t\tMap<Integer, Integer> hist = (xd >= x && xd < maxx) ? histogram : histogramSide;\n \t\t\t\t\t\n \t\t\t\t\tInteger cnt = hist.get(pixel);\n \t\t\t\t\tif (cnt == null)\n \t\t\t\t\t\tcnt = 1;\n \t\t\t\t\telse\n \t\t\t\t\t\tcnt++;\n \t\t\t\t\t\n \t\t\t\t\thist.put(pixel, cnt);\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\n \t\t\tfor (int x = 0; x < width; x += 8) {\n \t\t\t\tMap<Integer, Integer> histogram = histograms[x / 8];\n \t\t\t\tMap<Integer, Integer> histogramSide = histogramSides[x / 8];\n \t\t\t\t\n \t\t\t\tint maxx = x + 8 < width ? x + 8 : width;\n \t\t\t\t\n \t\t\t\t// get prominent colors, weighing colors that also\n \t\t\t\t// appear in surrounding pixels higher \n \t\t\t\tList<Pair<Integer, Integer>> sorted = new ArrayList<Pair<Integer,Integer>>();\n \t\t\t\tfor (Map.Entry<Integer, Integer> entry : histogram.entrySet()) {\n \t\t\t\t\tInteger c = entry.getKey();\n \t\t\t\t\tint cnt = entry.getValue() * 2;\n \t\t\t\t\tInteger scnt = histogramSide.get(c);\n \t\t\t\t\tif (scnt != null)\n \t\t\t\t\t\tcnt += scnt;\n \t\t\t\t\tsorted.add(new Pair<Integer, Integer>(c, cnt));\n \t\t\t\t}\n \t\t\t\tCollections.sort(sorted, new Comparator<Pair<Integer, Integer>>() {\n \t\n \t\t\t\t\t@Override\n \t\t\t\t\tpublic int compare(Pair<Integer, Integer> o1,\n \t\t\t\t\t\t\tPair<Integer, Integer> o2) {\n \t\t\t\t\t\treturn o2.second - o1.second;\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t});\n \t\n \t\t\t\tint fpixel, bpixel;\n \t\t\t\tif (sorted.size() >= 2) {\n \t\t\t\t\tfpixel = sorted.get(0).first;\n \t\t\t\t\tbpixel = sorted.get(1).first;\n \t\t\t\t} else {\n \t\t\t\t\tfpixel = bpixel = sorted.get(0).first;\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tint newPixel = 0;\n \t\t\t\tfor (int xd = x; xd < maxx; xd++) {\n \t\t\t\t\tif (xd < width)\n \t\t\t\t\t\tnewPixel = img.getRGB(xd, y);\n \t\t\t\t\t\n \t\t\t\t\tif (newPixel != fpixel && newPixel != bpixel) {\n \t\t\t\t\t\tif (fpixel < bpixel) {\n \t\t\t\t\t\t\tnewPixel = newPixel <= fpixel ? fpixel : bpixel;\n \t\t\t\t\t\t} else {\n \t\t\t\t\t\t\tnewPixel = newPixel < bpixel ? fpixel : bpixel;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\timageData.setPixel(xd + xoffs, y + yoffs, newPixel);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}", "public int[] median_thresh(int[] src, int width, int height, int size,\n int con) {\n\n i_w = width;\n i_h = height;\n src_1d = new int[i_w * i_h];\n dest_1d = new int[i_w * i_h];\n int median = 0;\n int[] values = new int[size * size];\n int count = 0;\n src_1d = src;\n int[][] tmp_2d = new int[i_w][i_h];\n\n //First convert input array from 1_d to 2_d for ease of processing\n for (int i = 0; i < i_w; i++) {\n for (int j = 0; j < i_h; j++) {\n tmp_2d[i][j] = src_1d[i + (j * i_w)] & 0x000000ff;\n }\n }\n\n //Now find the values in the size X size neigbourhood\n for (int j = 0; j < i_h; j++) {\n for (int i = 0; i < i_w; i++) {\n median = 0;\n count = 0;\n values = new int[size * size];\n //Check the local neighbourhood\n for (int k = 0; k < size; k++) {\n for (int l = 0; l < size; l++) {\n try {\n values[count] = tmp_2d[(i - ((int) (size / 2)) + k)]\n [(j - ((int) (size / 2)) + l)];\n count++;\n }\n //If out of bounds then ignore pixel\n catch (ArrayIndexOutOfBoundsException e) {\n // TODO: eliminate this\n }\n }\n }\n //Find the median value\n\n //First Sort the array\n Arrays.sort(values);\n\n //Then select the median\n count = count / 2;\n median = values[count] - con;\n\n //Threshold below the median\n if (tmp_2d[i][j] >= median) {\n dest_1d[i + (j * i_w)] = 0xffffffff;\n } else {\n dest_1d[i + (j * i_w)] = 0xff000000;\n }\n }\n }\n return dest_1d;\n }", "public static double[]getBackgroundStatsFromProcessor(ImageProcessor imgP) {\n\t\tint dimX=imgP.getWidth();\n\t\tint dimY=imgP.getHeight();\n\t\tint samplSize=Math.min(10+20,dimX/10);\n\t\tif(dimX<100)samplSize=12;\n\t\tif(dimX>500)samplSize=40;\n\n\t\tint x0=(3*samplSize)/2;\n\t\tint y0=(3*samplSize)/2;\n\t\tint x1=dimX/2;\n\t\tint y1=dimY/2;\n\t\tint x2=dimX-(3*samplSize)/2;\n\t\tint y2=dimY-(3*samplSize)/2;\n\t\tdouble[][] vals=new double[8][];\n\t\tvals[0]=VitimageUtils.valuesOfImageProcessor(imgP,x0,y0,samplSize/2);\n\t\tvals[1]=VitimageUtils.valuesOfImageProcessor(imgP,x0,y2,samplSize/2);\n\t\tvals[2]=VitimageUtils.valuesOfImageProcessor(imgP,x2,y0,samplSize/2);\n\t\tvals[3]=VitimageUtils.valuesOfImageProcessor(imgP,x2,y2,samplSize/2);\t\t\n\t\tvals[4]=VitimageUtils.valuesOfImageProcessor(imgP,x0,y1,samplSize/4);\n\t\tvals[5]=VitimageUtils.valuesOfImageProcessor(imgP,x1,y0,samplSize/4);\n\t\tvals[6]=VitimageUtils.valuesOfImageProcessor(imgP,x2,y1,samplSize/4);\n\t\tvals[7]=VitimageUtils.valuesOfImageProcessor(imgP,x2,y2,samplSize/4);\n\n\t\t//Compute the global mean over all these squares\n\t\tdouble[]tempStatsMeanVar=null;\n\t\tdouble[]tempStats=new double[vals.length];\n\t\t\n\t\t//Measure local stats, and guess that three of them can host the object\n\t\tfor(int i=0;i<vals.length;i++) {\n\t\t\ttempStatsMeanVar=VitimageUtils.statistics1D(vals[i]);\n\t\t\ttempStats[i]=tempStatsMeanVar[0];\n\t\t}\n\n\t\tdouble[]tempStatsCorrected=null;\n\t\tint incr=0;\n\t\tdouble[][]valsBis=null;\n\t\ttempStatsCorrected=new double[5];//Suppress the 3 maximum, that should be the border or corner where the object lies\n\n\t\tdouble[]tempStats2=doubleArraySort(tempStats);\n\t\tfor(int i=0;i<5;i++)tempStatsCorrected[i]=tempStats2[i];\n\t\tvalsBis=new double[5][];\t\t\t\n\t\tfor(int i=0;i<8 && incr<5;i++) {if(tempStats[i]<=tempStatsCorrected[4]) {valsBis[incr++]=vals[i];}}\n\t\t\t\n\t\tdouble []valsRetBis=VitimageUtils.statistics2D(valsBis);\t\t\n\t\treturn valsRetBis;\n\t}", "private void rgbThreshold(Mat input, double[] red, double[] green, double[] blue, Mat out) {\n Imgproc.cvtColor(input, out, Imgproc.COLOR_BGR2RGB);\n Core.inRange(out, new Scalar(red[0], green[0], blue[0]), new Scalar(red[1], green[1], blue[1]), out);\n }", "private static void normalizeColor(BufferedImage image) {\n\t\tHashMap<Integer, Integer> counts = colorHistogram(image);\r\n\t\tInteger[] a=sortmap(counts); // sorting the map\r\n\t\tInteger minFreq = 1000;\r\n\t\tfor (Integer i: counts.keySet()) {\r\n\t\t\tif (counts.get(i) < minFreq) {\r\n\t\t\t\tminFreq = counts.get(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\t/*\r\n\t\t*\r\n\t\t*Main logic to normalise the code\r\n\t\t* Assumption: all the colors which start from edges are the noise to the captcha or background.\r\n\t\t*/\r\n\t\tArrayList<Integer> topValues = new ArrayList<>();\r\n\t\tfor (Integer i: counts.keySet()) {\r\n\t\t\ttopValues.add(i); // adding all the colors into the the array list topValues without any condition\r\n\t\t}\r\n\t\tInteger[] out=findEdgecolors(image); // findEdgecolors function returns the array of RGB values of colors which are at the edges of the picture\r\n\t\tfor(int i=0;i<out.length;i++)\r\n\t\t{\r\n\t\t\tif(out[i]!=null)\r\n\t\t\t\ttopValues.remove(out[i]); // remove the colours from topValues list if the color exist in the array returned by the findEdgecolors funciton (removing the colors which start from edges)\r\n\t\t}\r\n\t\t/*\r\n\t\t*Now topvalues consists of colors which are not in the edges of the clipped image\r\n\t\t*/\r\n\t\tint white_rgb = Color.YELLOW.getRGB();\r\n\t\tint black_rgb = Color.BLACK.getRGB();\r\n\r\n\t\tfor (int x=0; x<image.getWidth(); x++) {\r\n\t\t\tfor (int y=0; y<image.getHeight(); y++) {\r\n\t\t\t\tint pixelVal = image.getRGB(x, y);\r\n\r\n\t\t\t\tif (!topValues.contains(pixelVal)) {\r\n\t\t\t\t\timage.setRGB(x, y, white_rgb); //replacing the colors in topvalue with black\r\n\t\t\t\t} else {\r\n\t\t\t\t\timage.setRGB(x, y, black_rgb); // rest is colored with yellow (background)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (debug) {\r\n\t\t\ttry {\r\n\t\t\t\tImageIO.write(image, \"gif\", new File(\"colorNormalized.gif\"));\r\n\t\t\t} catch (Exception e) {e.printStackTrace();}\r\n\t\t}\r\n\t}", "@Override\npublic Image operate (Image source)\n{\n final Image thresholdImage = NIVision\n .imaqCreateImage(ImageType.IMAGE_U8, 0);\n\n // @TODO: Store NIVision.Range instead of integers so we don't make a\n // new one every time.\n NIVision.imaqColorThreshold(thresholdImage, source, 255,\n NIVision.ColorMode.HSL, this.hueRange, this.satRange,\n this.lumRange);\n source.free();\n return thresholdImage;\n}", "@Override\n public BufferedImage filter(BufferedImage image) {\n int width = image.getWidth();\n int height = image.getHeight();\n int imageType = image.getType();\n BufferedImage newImage = new BufferedImage(width, height, imageType);\n \n // Process each pixel in column-major order\n for (int column = 0; column < newImage.getWidth(); column++) {\n for (int row = 0; row < newImage.getHeight(); row++) {\n \n try {\n // Compare the pixel at (column, row) in this image to the pixel\n // at (column, row) in the other image, and visualize the results\n // accordingly.\n int thisRGB = image.getRGB(column, row);\n int otherRGB = this.other.getRGB(column, row);\n int difference = otherRGB - thisRGB;\n if (difference == 0) {\n newImage.setRGB(column, row, MATCH_COLOR);\n } else {\n newImage.setRGB(column, row, NO_MATCH_COLOR);\n }\n } \n \n // If the other image is narrower or shorter than this one, and this \n // pixel lies out of the range of the smaller image, then visualize\n // this pixel as \"out of bounds\"\n catch (IndexOutOfBoundsException e) {\n newImage.setRGB(column, row, OUT_OF_BOUNDS_COLOR);\n } \n }\n }\n \n return newImage;\n }", "public void histNormalize() {\n\n double max = max();\n double min = min();\n max = max - min;\n for (int i = 0; i < pixelData.length; i++) {\n double value = pixelData[i] & 0xff;\n pixelData[i] = (byte) Math.floor((value - min) * 255 / max);\n }\n }", "private static native void amFilter_0(long joint_nativeObj, long src_nativeObj, long dst_nativeObj, double sigma_s, double sigma_r, boolean adjust_outliers);", "@Override\r\n\tpublic void extractFeature() {\n\t\tint numOfBins = 64;\r\n\r\n\t\t// Quantise the image into the specified amount of bins\r\n\t\tint[][] quantizedImage = new int[imageRaster.getWidth()][imageRaster\r\n\t\t\t\t.getHeight()];\r\n\t\tint[] pixel = new int[3];\r\n\t\tfor (int i = 0; i != imageRaster.getWidth(); i++) {\r\n\t\t\tfor (int j = 0; j != imageRaster.getHeight(); j++) {\r\n\t\t\t\tpixel = imageRaster.getPixel(i, j, pixel);\r\n\t\t\t\tquantizedImage[i][j] = getPixelBin(pixel);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Builds a histogram based on the 64 quantised values which is used for\r\n\t\t// normalisation\r\n\t\tint[] histogram = new int[numOfBins];\r\n\t\tfor (int x = 0; x < imageRaster.getWidth(); x++)\r\n\t\t\tfor (int y = 0; y < imageRaster.getHeight(); y++) {\r\n\t\t\t\thistogram[quantizedImage[x][y]]++;\r\n\t\t\t}\r\n\r\n\t\tautoCorrelogram = new double[numOfBins][distanceSet.length];\r\n\r\n\t\tint imageWidth = imageRaster.getWidth();\r\n\t\tint imageHeight = imageRaster.getHeight();\r\n\r\n\t\t// Chebyshev distance\r\n\t\tfor (int x = 0; x != imageWidth; x++) {\r\n\t\t\tfor (int y = 0; y != imageHeight; y++) {\r\n\t\t\t\tint pColour = quantizedImage[x][y];\r\n\t\t\t\tfor (int distIndex = 0; distIndex != distanceSet.length; distIndex++) {\r\n\t\t\t\t\tint dist = distanceSet[distIndex];\r\n\r\n\t\t\t\t\t// move horizontally across pixel grid on top and bottom\r\n\t\t\t\t\tfor (int localX = -dist; localX <= dist; localX++) {\r\n\t\t\t\t\t\t// Top\r\n\t\t\t\t\t\tint globalX = x + localX;\r\n\t\t\t\t\t\tint globalY = y - dist;\r\n\t\t\t\t\t\t// Bounds checking\r\n\t\t\t\t\t\tif (globalX >= 0 && globalX < imageWidth\r\n\t\t\t\t\t\t\t\t&& globalY >= 0 && globalY < imageHeight) {\r\n\t\t\t\t\t\t\t// If the colours are the same, update the\r\n\t\t\t\t\t\t\t// autocorrelogram\r\n\t\t\t\t\t\t\tif (quantizedImage[globalX][globalY] == pColour) {\r\n\t\t\t\t\t\t\t\tautoCorrelogram[pColour][distIndex]++;\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\t// Bottom\r\n\t\t\t\t\t\t\tglobalY = y + dist;\r\n\t\t\t\t\t\t\t// Bounds checking\r\n\t\t\t\t\t\t\tif (globalX >= 0 && globalX < imageWidth\r\n\t\t\t\t\t\t\t\t\t&& globalY >= 0 && globalY < imageHeight) {\r\n\t\t\t\t\t\t\t\t// If the colours are the same, update the\r\n\t\t\t\t\t\t\t\t// autocorrelogram\r\n\t\t\t\t\t\t\t\tif (quantizedImage[globalX][globalY] == pColour) {\r\n\t\t\t\t\t\t\t\t\tautoCorrelogram[pColour][distIndex]++;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// move vertically through pixel grid on left and right\r\n\t\t\t\t\tfor (int localY = -dist + 1; localY <= dist - 1; localY++) {\r\n\t\t\t\t\t\t// Left\r\n\t\t\t\t\t\tint globalX = x - dist;\r\n\t\t\t\t\t\tint globalY = y + localY;\r\n\t\t\t\t\t\t// Bounds checking\r\n\t\t\t\t\t\tif (globalX >= 0 && globalX < imageWidth\r\n\t\t\t\t\t\t\t\t&& globalY >= 0 && globalY < imageHeight) {\r\n\t\t\t\t\t\t\t// If the colours are the same, update the\r\n\t\t\t\t\t\t\t// autocorrelogram\r\n\t\t\t\t\t\t\tif (quantizedImage[globalX][globalY] == pColour) {\r\n\t\t\t\t\t\t\t\tautoCorrelogram[pColour][distIndex]++;\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// Right\r\n\t\t\t\t\t\tglobalX = x + dist;\r\n\t\t\t\t\t\t// Bounds checking\r\n\t\t\t\t\t\tif (globalX >= 0 && globalX < imageWidth\r\n\t\t\t\t\t\t\t\t&& globalY >= 0 && globalY < imageHeight) {\r\n\t\t\t\t\t\t\t// If the colours are the same, update the\r\n\t\t\t\t\t\t\t// autocorrelogram\r\n\t\t\t\t\t\t\tif (quantizedImage[globalX][globalY] == pColour) {\r\n\t\t\t\t\t\t\t\tautoCorrelogram[pColour][distIndex]++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// normalize the feature vector\r\n\t\tfor (int c = 0; c != numOfBins; c++) {\r\n\t\t\tfor (int d = 0; d != distanceSet.length; d++)\r\n\t\t\t\tif (histogram[c] > 0)\r\n\t\t\t\t\tautoCorrelogram[c][d] = (float) Math\r\n\t\t\t\t\t\t\t.floor(16d * (autoCorrelogram[c][d] / (((float) histogram[c]) * 8.0f * distanceSet[d])));\r\n\t\t}\r\n\t}", "public Bitmap rgbAverageContrastAugmentation(Bitmap bmp) {\n\n\n int width, height, r, g, b;\n long acc = 0;\n width = bmp.getWidth();\n height = bmp.getHeight();\n //Alocate memory\n int[] hist = new int[256];\n int[] LUT = new int[256];\n int[] pixels = new int[height * width];\n bmp.getPixels(pixels, 0, width, 0, 0, width, height);\n for (int index = 0; index < width * height; ++index) {\n //Do general Histogram\n r = (pixels[index] >> 16) & 0xff;\n g = (pixels[index] >> 8) & 0xff;\n b = (pixels[index]) & 0xff;\n hist[r]++;\n hist[g]++;\n hist[b]++;\n }\n for (int ng = 0; ng < 256; ng++) {\n hist[ng] /= 3; //Getting average of three RGB channels\n acc += hist[ng]; //Cumulative function\n LUT[ng] = (int) ((acc * 255) / ((width * height))); //Histogram Equalization formula\n }\n //Setting new pixels to image.\n for (int index = 0; index < width * height; index++) {\n r = LUT[(pixels[index] >> 16) & 0xff];\n g = LUT[(pixels[index] >> 8) & 0xff];\n b = LUT[(pixels[index]) & 0xff];\n pixels[index] = ((0xff) << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff);\n }\n bmp.setPixels(pixels, 0, width, 0, 0, width, height);\n\n\n\n\n return bmp;\n }", "private Color getMedianPixel(BufferedImage image){\n Color[] pixels = imageToArray(image);\n return orderStat.findColor(pixels, pixels.length/2);\n }", "public Average getAverageWinTurn(Predicate<GameResult> filter) {\n long sum = results.stream()\n .filter(filter)\n .mapToLong(result -> result.getEndTurn() * result.getCount())\n .sum();\n long count = count(filter);\n double avg = (double) sum / (double) count;\n\n double distanceSum = results.stream()\n .filter(filter)\n .mapToDouble(result -> Math.abs(avg - result.getEndTurn()) * result.getCount())\n .sum();\n double mad = distanceSum / (double) count;\n\n// double distanceSqSum = results.stream()\n// .filter(filter)\n// .mapToDouble(result -> ((double) result.getEndTurn() - avg) * ((double) result.getEndTurn() - avg) * result.getCount())\n// .sum();\n// double standardDeviation = Math.sqrt(distanceSum / (double) count);\n\n return new Average(avg, mad);\n }", "private void gaussianBlur() {\n targetImage = new Mat();\n Utils.bitmapToMat(lena, targetImage);\n Imgproc.cvtColor(targetImage, targetImage, Imgproc.COLOR_BGR2RGB);\n\n gaussianBlur(targetImage.getNativeObjAddr());\n\n // create a bitMap\n Bitmap bitMap = Bitmap.createBitmap(targetImage.cols(),\n targetImage.rows(), Bitmap.Config.RGB_565);\n // convert Mat to Android's bitmap:\n Imgproc.cvtColor(targetImage, targetImage, Imgproc.COLOR_RGB2BGR);\n Utils.matToBitmap(targetImage, bitMap);\n\n\n ImageView iv = (ImageView) findViewById(R.id.imageView);\n iv.setImageBitmap(bitMap);\n }", "public void pixaveGreyscale(int x1, int y1, int x2, int y2) {\n //float sumr,sumg,sumb;\n float sumg;\n int pix;\n //int r,g,b;\n float g;\n int n;\n\n if(x1<0) x1=0;\n if(x2>=kWidth) x2=kWidth-1;\n if(y1<0) y1=0;\n if(y2>=kHeight) y2=kHeight-1;\n\n //sumr=sumg=sumb=0.0;\n sumg = 0.0f;\n for(int y=y1; y<=y2; y++) {\n for(int i=kWidth*y+x1; i<=kWidth*y+x2; i++) {\n \n // old method use depth image\n //pix= kinecter.depthImg.pixels[i];\n //g = pix & 0xFF; // grey\n //sumg += g;\n \n //b=pix & 0xFF; // blue\n // pix = pix >> 8;\n //g=pix & 0xFF; // green\n //pix = pix >> 8;\n //r=pix & 0xFF; // red\n //if( random(0, 150000) > 149000 && r > 0) println(\"r \" + r + \" b \" + b + \" g \" + g);\n // averaging the values\n //sumr += b;//r;//g;//r;\n //sumg += b;//r;//g;\n //sumb += b;//r;//g;//b;\n \n // WORK WITH RAW DEPTH INSTEAD\n sumg += kinecter.rawDepth[i];\n\n \n }\n }\n n = (x2-x1+1)*(y2-y1+1); // number of pixels\n // the results are stored in static variables\n //ar = sumr/n; \n //ag = sumg/n; \n //ab = sumb/n;\n\n ar = sumg/n; \n ag = ar; \n ab = ar;\n }", "private Color averageAround(RenderedImage i, double px, double py) {\n\t\t// Get an iterator for the image.\n\t\tRandomIter iterator = RandomIterFactory.create(i, null);\n\t\t// Get memory for a pixel and for the accumulator.\n\t\tdouble[] pixel = new double[3];\n\t\tdouble[] accum = new double[3];\n\t\t// The size of the sampling area.\n\t\tint sampleSize = 10;\n\t\tint numPixels = 0;\n\t\t// Sample the pixels.\n\t\tfor (double x = px * baseSize - sampleSize; x < px * baseSize\n\t\t\t\t+ sampleSize; x++) {\n\t\t\tfor (double y = py * baseSize - sampleSize; y < py * baseSize\n\t\t\t\t\t+ sampleSize; y++) {\n\t\t\t\titerator.getPixel((int) x, (int) y, pixel);\n\t\t\t\taccum[0] += pixel[0];\n\t\t\t\taccum[1] += pixel[1];\n\t\t\t\taccum[2] += pixel[2];\n\t\t\t\tnumPixels++;\n\t\t\t}\n\t\t}\n\t\t// Average the accumulated values.\n\t\taccum[0] /= numPixels;\n\t\taccum[1] /= numPixels;\n\t\taccum[2] /= numPixels;\n\t\treturn new Color((int) accum[0], (int) accum[1], (int) accum[2]);\n\t}", "@Override\n public Bitmap filterImage(Bitmap inputImage){\n Mat cvMat = new Mat(inputImage.getWidth(), inputImage.getHeight(), CvType.CV_8UC4);\n Utils.bitmapToMat(inputImage, cvMat);\n // Convert Image to grayscale\n Mat cvMatGray = new Mat(inputImage.getWidth(), inputImage.getHeight(), CvType.CV_8UC1);\n Imgproc.cvtColor(cvMat, cvMatGray, Imgproc.COLOR_BGRA2GRAY);\n cvMatGray.convertTo(cvMatGray, CvType.CV_64FC1);\n Mat cvMatGrayInvert = cvMatGray.clone();\n // Then apply a gaussian blur\n Mat cvMatGrayBlurred = new Mat(inputImage.getWidth(),\n inputImage.getHeight(),\n CvType.CV_64FC1);\n Size kernelSize = new Size(25, 25);\n Imgproc.GaussianBlur(\n cvMatGrayInvert,\n cvMatGrayBlurred,\n kernelSize,\n 0,\n 0,\n Core.BORDER_CONSTANT\n );\n // Finally Blend the grayscale image with the blurred negative\n Mat cvMatGrayBlend = cvMatGray.clone();\n Core.divide(cvMatGrayBlend, cvMatGrayBlurred, cvMatGrayBlend, 256);\n cvMatGrayBlend.convertTo(cvMatGrayBlend, CvType.CV_8UC3);\n Bitmap filteredImage = Bitmap.createBitmap(\n cvMat.cols(),\n cvMat.rows(),\n Bitmap.Config.ARGB_8888\n );\n Utils.matToBitmap(cvMatGrayBlend, filteredImage);\n return filteredImage;\n }", "public void k() {\n float f2 = BitmapDescriptorFactory.HUE_RED;\n for (float f3 : this.i) {\n if (f3 > BitmapDescriptorFactory.HUE_RED) {\n f2 += f3;\n }\n }\n if (f2 != BitmapDescriptorFactory.HUE_RED) {\n int length = this.i.length;\n for (int i2 = 0; i2 < length; i2++) {\n float[] fArr = this.i;\n if (fArr[i2] > BitmapDescriptorFactory.HUE_RED) {\n fArr[i2] = fArr[i2] / f2;\n }\n }\n }\n }", "public BufferedImage getThresh(BufferedImage img, int left, int right, int top, int bottom) { // Method to get thresholded image \n\t\t//Vision.logger.debug(\"Starting thresholding\");\n\n\t\t//stops it fucking up the locations before we've given it the thresholds\n\t\tif (worldState.isClickingDone()){\n\n\t\t\tnewBluePixels = new ArrayList<Point>();\n\t\t\tnewYellowPixels = new ArrayList<Point>();\n\t\t\tArrayList<Point> bluePixels = new ArrayList<Point>();\n\t\t\tArrayList<Point> yellowPixels = new ArrayList<Point>();\n\t\t\t/*pitch = worldState.getRoom();\n\t\t\twidth = right-left;\n\t\t\theight = top-bottom;*/\n\n\t\t\t/*\n Initialising to one to stop java dividing by 0 when it shouldn't\n\t\t\t */\n\t\t\tredCountA = 0;\n\t\t\tredCountB = 0;\n\t\t\tredCountC = 0;\n\t\t\tredCountD = 0;\n\t\t\tredCountE = 0;\n\t\t\tredCentroidA.setLocation(0,0);\n\t\t\tredCentroidB.setLocation(0,0);\n\t\t\tredCentroidC.setLocation(0,0);\n\t\t\tredCentroidD.setLocation(0,0);\n\t\t\tredCentroidE.setLocation(0,0);\n\n\t\t\tblueCountA = 0;\n\t\t\tblueCountB = 0;\n\t\t\tblueCountC = 0;\n\t\t\tblueCountD = 0;\n\t\t\tblueCountE = 0;\n\t\t\tblueCentroidA.setLocation(0,0);\n\t\t\tblueCentroidB.setLocation(0,0);\n\t\t\tblueCentroidC.setLocation(0,0);\n\t\t\tblueCentroidD.setLocation(0,0);\n\t\t\tblueCentroidE.setLocation(0,0);\n\n\t\t\tyellowCountA = 0;\n\t\t\tyellowCountB = 0;\n\t\t\tyellowCountC = 0;\n\t\t\tyellowCountD = 0;\n\t\t\tyellowCountE = 0;\n\t\t\tyellowCentroidA.setLocation(0,0);\n\t\t\tyellowCentroidB.setLocation(0,0);\n\t\t\tyellowCentroidC.setLocation(0,0);\n\t\t\tyellowCentroidD.setLocation(0,0);\n\t\t\tyellowCentroidE.setLocation(0,0);\n\n\t\t\t//Vision.logger.debug(\"Iterating image\");\n\t\t\tfor (int i = left; i < right; i++) {\n\t\t\t\tfor (int j = top; j < bottom; j++) {\n\t\t\t\t\t//Vision.logger.debug(\"Oh dear (i,j) = \" + Integer.toString(i) + \",\" + Integer.toString(j) + \")\");\n\t\t\t\t\tc = new Color(img.getRGB(i,j));\n\n\t\t\t\t\tGB = Math.abs((c.getBlue() - c.getGreen()));\n\t\t\t\t\tRG = Math.abs((c.getRed() - c.getGreen()));\n\t\t\t\t\t//RB = Math.abs((c.getRed() - c.getBlue()));\n\n\t\t\t\t\tif(isRed(c, GB)){ // was inside RB > 50 && RG > 50\n\t\t\t\t\t\timg.setRGB(i, j, Color.red.getRGB()); //Red Ball\n\t\t\t\t\t\trandy = Math.random();\n\t\t\t\t\t\tif (randy > 0 && randy <= 0.2){\t\t\t\t\t\t \n\t\t\t\t\t\t\tredCountA++;\n\t\t\t\t\t\t\tredCentroidA.setLocation(redCentroidA.getX() + i, redCentroidA.getY() + j);\n\t\t\t\t\t\t}else if (randy > 0.2 && randy <= 0.4){\n\t\t\t\t\t\t\tredCountB++;\n\t\t\t\t\t\t\tredCentroidB.setLocation(redCentroidB.getX() + i, redCentroidB.getY() + j);\n\t\t\t\t\t\t}else if (randy > 0.4 && randy <= 0.6){\n\t\t\t\t\t\t\tredCountC++;\n\t\t\t\t\t\t\tredCentroidC.setLocation(redCentroidC.getX() + i, redCentroidC.getY() + j);\n\t\t\t\t\t\t}else if (randy > 0.6 && randy <= 0.8){\n\t\t\t\t\t\t\tredCountD++;\n\t\t\t\t\t\t\tredCentroidD.setLocation(redCentroidD.getX() + i, redCentroidD.getY() + j);\n\t\t\t\t\t\t}else if (randy > 0.8 && randy <= 1){\n\t\t\t\t\t\t\tredCountE++;\n\t\t\t\t\t\t\tredCentroidE.setLocation(redCentroidE.getX() + i, redCentroidE.getY() + j);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\telse if (isYellow(c)) {\n\t\t\t\t\t\tsetCs(i,j,right,left,top,bottom, img);\n\t\t\t\t\t\tif (isYellow(cS) && isYellow(cE) && isYellow(cEE) && isYellow(cEN) && isYellow(cSS) && isYellow(cSW) ){\n\t\t\t\t\t\t\timg.setRGB(i, j, Color.yellow.getRGB()); // Yellow robot\n\t\t\t\t\t\t\tyellowRobotX.add(i);\n\t\t\t\t\t\t\tyellowRobotY.add(j);\n\t\t\t\t\t\t\trandy = Math.random();\n\t\t\t\t\t\t\tif (randy > 0 && randy <= 0.2){\t\t\t\t\t\t \n\t\t\t\t\t\t\t\tyellowCountA++;\n\t\t\t\t\t\t\t\tyellowCentroidA.setLocation(yellowCentroidA.getX() + i, yellowCentroidA.getY() + j);\n\t\t\t\t\t\t\t}else if (randy > 0.2 && randy <= 0.4){\n\t\t\t\t\t\t\t\tyellowCountB++;\n\t\t\t\t\t\t\t\tyellowCentroidB.setLocation(yellowCentroidB.getX() + i, yellowCentroidB.getY() + j);\n\t\t\t\t\t\t\t}else if (randy > 0.4 && randy <= 0.6){\n\t\t\t\t\t\t\t\tyellowCountC++;\n\t\t\t\t\t\t\t\tyellowCentroidC.setLocation(yellowCentroidC.getX() + i, yellowCentroidC.getY() + j);\n\t\t\t\t\t\t\t}else if (randy > 0.6 && randy <= 0.8){\n\t\t\t\t\t\t\t\tyellowCountD++;\n\t\t\t\t\t\t\t\tyellowCentroidD.setLocation(yellowCentroidD.getX() + i, yellowCentroidD.getY() + j);\n\t\t\t\t\t\t\t}else if (randy > 0.8 && randy <= 1){\n\t\t\t\t\t\t\t\tyellowCountE++;\n\t\t\t\t\t\t\t\tyellowCentroidE.setLocation(yellowCentroidE.getX() + i, yellowCentroidE.getY() + j);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tyellowPixels.add(new Point(i,j));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (isBlue(c)){\n\t\t\t\t\t\tsetCs(i,j,right,left,top,bottom, img);\n\t\t\t\t\t\tif (isBlue(cS) && isBlue(cE) && isBlue(cEE) && isBlue(cEN) && isBlue(cSS) && isBlue(cSW) ){\n\t\t\t\t\t\t\timg.setRGB(i, j, Color.blue.getRGB()); // Blue robot \n\t\t\t\t\t\t\tblueRobotX.add(i);\n\t\t\t\t\t\t\tblueRobotY.add(j);\n\t\t\t\t\t\t\trandy = Math.random();\n\t\t\t\t\t\t\tif (randy > 0 && randy <= 0.2){\t\t\t\t\t\t \n\t\t\t\t\t\t\t\tblueCountA++;\n\t\t\t\t\t\t\t\tblueCentroidA.setLocation(blueCentroidA.getX() + i, blueCentroidA.getY() + j);\n\t\t\t\t\t\t\t}else if (randy > 0.2 && randy <= 0.4){\n\t\t\t\t\t\t\t\tblueCountB++;\n\t\t\t\t\t\t\t\tblueCentroidB.setLocation(blueCentroidB.getX() + i, blueCentroidB.getY() + j);\n\t\t\t\t\t\t\t}else if (randy > 0.4 && randy <= 0.6){\n\t\t\t\t\t\t\t\tblueCountC++;\n\t\t\t\t\t\t\t\tblueCentroidC.setLocation(blueCentroidC.getX() + i, blueCentroidC.getY() + j);\n\t\t\t\t\t\t\t}else if (randy > 0.6 && randy <= 0.8){\n\t\t\t\t\t\t\t\tblueCountD++;\n\t\t\t\t\t\t\t\tblueCentroidD.setLocation(blueCentroidD.getX() + i, blueCentroidD.getY() + j);\n\t\t\t\t\t\t\t}else if (randy > 0.8 && randy <= 1){\n\t\t\t\t\t\t\t\tblueCountE++;\n\t\t\t\t\t\t\t\tblueCentroidE.setLocation(blueCentroidE.getX() + i, blueCentroidE.getY() + j);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbluePixels.add(new Point(i,j));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//make blue thresholds for the different pitches in that [pitch][x] style\n\t\t\t\t\t}\n\t\t\t\t\telse if (isGreen(c,GB,RG)) {\n\t\t\t\t\t\timg.setRGB(i,j, Color.green.getRGB()); // GreenPlates \n\t\t\t\t\t\tif (Point.distance(\tworldState.getBlueRobot().getPosition().getCentre().x,\n\t\t\t\t\t\t\t\tworldState.getBlueRobot().getPosition().getCentre().y,\n\t\t\t\t\t\t\t\ti,j) < 34) {\n\t\t\t\t\t\t\tblueGreenPlate.add(new Point(i,j));\n\t\t\t\t\t\t} \n\t\t\t\t\t\tif (Point.distance(\tworldState.getYellowRobot().getPosition().getCentre().x,\n\t\t\t\t\t\t\t\tworldState.getYellowRobot().getPosition().getCentre().y,\n\t\t\t\t\t\t\t\ti,j) < 34){\n\t\t\t\t\t\t\tyellowGreenPlate.add(new Point(i,j));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (redCountA == 0) redCountA++;\n\t\t\tif (redCountB == 0) redCountB++;\n\t\t\tif (redCountC == 0) redCountC++;\n\t\t\tif (redCountD == 0) redCountD++;\n\t\t\tif (redCountE == 0) redCountE++;\n\t\t\tif (blueCountA == 0) blueCountA++;\n\t\t\tif (blueCountB == 0) blueCountB++;\n\t\t\tif (blueCountC == 0) blueCountC++;\n\t\t\tif (blueCountD == 0) blueCountD++;\n\t\t\tif (blueCountE == 0) blueCountE++;\n\t\t\tif (yellowCountA == 0) yellowCountA++;\n\t\t\tif (yellowCountB == 0) yellowCountB++;\n\t\t\tif (yellowCountC == 0) yellowCountC++;\n\t\t\tif (yellowCountD == 0) yellowCountD++;\n\t\t\tif (yellowCountE == 0) yellowCountE++;\n\n\n\t\t\t//TODO: Run these points through the parralax fix\n\t\t\ttotalRedX = 0;\n\t\t\ttotalRedY = 0;\n\t\t\tnumRedCentroids = 0;\n\n\n\t\t\tredCentroidA.setLocation(redCentroidA.getX()/redCountA, redCentroidA.getY()/redCountA);\n\t\t\tredCentroidB.setLocation(redCentroidB.getX()/redCountB, redCentroidB.getY()/redCountB);\n\t\t\tredCentroidC.setLocation(redCentroidC.getX()/redCountC, redCentroidC.getY()/redCountC);\n\t\t\tredCentroidD.setLocation(redCentroidD.getX()/redCountD, redCentroidD.getY()/redCountD);\n\t\t\tredCentroidE.setLocation(redCentroidE.getX()/redCountE, redCentroidE.getY()/redCountE);\n\n\t\t\ttotalYellowX = 0;\n\t\t\ttotalYellowY = 0;\n\t\t\tnumYellowCentroids = 0;\n\n\n\t\t\tyellowCentroidA.setLocation(yellowCentroidA.getX()/yellowCountA, yellowCentroidA.getY()/yellowCountA);\n\t\t\tyellowCentroidB.setLocation(yellowCentroidB.getX()/yellowCountB, yellowCentroidB.getY()/yellowCountB);\n\t\t\tyellowCentroidC.setLocation(yellowCentroidC.getX()/yellowCountC, yellowCentroidC.getY()/yellowCountC);\n\t\t\tyellowCentroidD.setLocation(yellowCentroidD.getX()/yellowCountD, yellowCentroidD.getY()/yellowCountD);\n\t\t\tyellowCentroidE.setLocation(yellowCentroidE.getX()/yellowCountE, yellowCentroidE.getY()/yellowCountE);\n\n\t\t\ttotalBlueX = 0;\n\t\t\ttotalBlueY = 0;\n\t\t\tnumBlueCentroids = 0;\n\n\n\t\t\tblueCentroidA.setLocation(blueCentroidA.getX()/blueCountA, blueCentroidA.getY()/blueCountA);\n\t\t\tblueCentroidB.setLocation(blueCentroidB.getX()/blueCountB, blueCentroidB.getY()/blueCountB);\n\t\t\tblueCentroidC.setLocation(blueCentroidC.getX()/blueCountC, blueCentroidC.getY()/blueCountC);\n\t\t\tblueCentroidD.setLocation(blueCentroidD.getX()/blueCountD, blueCentroidD.getY()/blueCountD);\n\t\t\tblueCentroidE.setLocation(blueCentroidE.getX()/blueCountE, blueCentroidE.getY()/blueCountE);\n\n\t\t\tc = new Color(img.getRGB((int)redCentroidA.getX(), (int)redCentroidA.getY()));\n\t\t\tif (isRed(c, GB)) {\n\t\t\t\ttotalRedX += redCentroidA.getX();\n\t\t\t\ttotalRedY += redCentroidA.getY();\n\t\t\t\tnumRedCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)redCentroidB.getX(), (int)redCentroidB.getY()));\n\t\t\tif (isRed(c, GB)) {\n\t\t\t\ttotalRedX += redCentroidB.getX();\n\t\t\t\ttotalRedY += redCentroidB.getY();\n\t\t\t\tnumRedCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)redCentroidC.getX(), (int)redCentroidC.getY()));\n\t\t\tif (isRed(c, GB)) {\n\t\t\t\ttotalRedX += redCentroidC.getX();\n\t\t\t\ttotalRedY += redCentroidC.getY();\n\t\t\t\tnumRedCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)redCentroidD.getX(), (int)redCentroidD.getY()));\n\t\t\tif (isRed(c, GB)) {\n\t\t\t\ttotalRedX += redCentroidD.getX();\n\t\t\t\ttotalRedY += redCentroidD.getY();\n\t\t\t\tnumRedCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)redCentroidE.getX(), (int)redCentroidE.getY()));\n\t\t\tif (isRed(c, GB)) {\n\t\t\t\ttotalRedX += redCentroidE.getX();\n\t\t\t\ttotalRedY += redCentroidE.getY();\n\t\t\t\tnumRedCentroids++;\n\t\t\t}\n\n\t\t\tif (numRedCentroids == 0){\n\t\t\t\tnumRedCentroids++;\n\t\t\t}\n\n\t\t\tredX = (int)(totalRedX/numRedCentroids);\n\t\t\tredY = (int)(totalRedY/numRedCentroids);\n\n\t\t\tc = new Color(img.getRGB((int)yellowCentroidA.getX(), (int)yellowCentroidA.getY()));\n\t\t\tif (isYellow(c)) {\n\t\t\t\ttotalYellowX += yellowCentroidA.getX();\n\t\t\t\ttotalYellowY += yellowCentroidA.getY();\n\t\t\t\tnumYellowCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)yellowCentroidB.getX(), (int)yellowCentroidB.getY()));\n\t\t\tif (isYellow(c)) {\n\t\t\t\ttotalYellowX += yellowCentroidB.getX();\n\t\t\t\ttotalYellowY += yellowCentroidB.getY();\n\t\t\t\tnumYellowCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)yellowCentroidC.getX(), (int)yellowCentroidC.getY()));\n\t\t\tif (isYellow(c)) {\n\t\t\t\ttotalYellowX += yellowCentroidC.getX();\n\t\t\t\ttotalYellowY += yellowCentroidC.getY();\n\t\t\t\tnumYellowCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)yellowCentroidD.getX(), (int)yellowCentroidD.getY()));\n\t\t\tif (isYellow(c)) {\n\t\t\t\ttotalYellowX += yellowCentroidD.getX();\n\t\t\t\ttotalYellowY += yellowCentroidD.getY();\n\t\t\t\tnumYellowCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)yellowCentroidE.getX(), (int)yellowCentroidE.getY()));\n\t\t\tif (isYellow(c)) {\n\t\t\t\ttotalYellowX += yellowCentroidE.getX();\n\t\t\t\ttotalYellowY += yellowCentroidE.getY();\n\t\t\t\tnumYellowCentroids++;\n\t\t\t}\n\n\t\t\tif (numYellowCentroids == 0){\n\t\t\t\tnumYellowCentroids++;\n\t\t\t}\n\n\t\t\tyellowX = (int)(totalYellowX/numYellowCentroids);\n\t\t\tyellowY = (int)(totalYellowY/numYellowCentroids);\n\n\t\t\tc = new Color(img.getRGB((int)blueCentroidA.getX(), (int)blueCentroidA.getY()));\n\t\t\tif (isBlue(c)) {\n\t\t\t\ttotalBlueX += blueCentroidA.getX();\n\t\t\t\ttotalBlueY += blueCentroidA.getY();\n\t\t\t\tnumBlueCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)blueCentroidB.getX(), (int)blueCentroidB.getY()));\n\t\t\tif (isBlue(c)) {\n\t\t\t\ttotalBlueX += blueCentroidB.getX();\n\t\t\t\ttotalBlueY += blueCentroidB.getY();\n\t\t\t\tnumBlueCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)blueCentroidC.getX(), (int)blueCentroidC.getY()));\n\t\t\tif (isBlue(c)) {\n\t\t\t\ttotalBlueX += blueCentroidC.getX();\n\t\t\t\ttotalBlueY += blueCentroidC.getY();\n\t\t\t\tnumBlueCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)blueCentroidD.getX(), (int)blueCentroidD.getY()));\n\t\t\tif (isBlue(c)) {\n\t\t\t\ttotalBlueX += blueCentroidD.getX();\n\t\t\t\ttotalBlueY += blueCentroidD.getY();\n\t\t\t\tnumBlueCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)blueCentroidE.getX(), (int)blueCentroidE.getY()));\n\t\t\tif (isBlue(c)) {\n\t\t\t\ttotalBlueX += blueCentroidE.getX();\n\t\t\t\ttotalBlueY += blueCentroidE.getY();\n\t\t\t\tnumBlueCentroids++;\n\t\t\t}\n\n\t\t\tif (numBlueCentroids == 0){\n\t\t\t\tnumBlueCentroids++;\n\t\t\t}\n\n\t\t\tblueX = (int)(totalBlueX/numBlueCentroids);\n\t\t\tblueY = (int)(totalBlueY/numBlueCentroids);\n\n\t\t\tblueGreenPlate4Points = plate.getCorners(blueGreenPlate);\n\t\t\tyellowGreenPlate4Points = plate.getCorners(yellowGreenPlate);\n\n\t\t\tworldState.getBlueRobot().getPosition().setCorners(blueGreenPlate4Points);\n\t\t\tworldState.getYellowRobot().getPosition().setCorners(yellowGreenPlate4Points);\n\n\t\t\tPoint fixBall = new Point(redX,redY);\n\t\t\tif ((redX != 0) && (redY != 0)) {\n\t\t\t\tif (worldState.getBarrelFix()){\n\t\t\t\t\tworldState.setBallPosition(fixBall);\n\t\t\t\t}else{ \n\t\t\t\t\tworldState.setBallPosition(DistortionFix.barrelCorrected(fixBall));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tPoint fixBlue = new Point(blueX,blueY);\n\t\t\tif ((blueX != 0) && (blueY != 0)) {\n\t\t\t\tif (worldState.getBarrelFix()){\n\t\t\t\t\tworldState.setBlueRobotPosition(fixParallax(fixBlue,worldState.getBlueRobot()));\n\t\t\t\t}else{\n\t\t\t\t\tworldState.setBlueRobotPosition(fixParallax(DistortionFix.barrelCorrected(fixBlue),worldState.getBlueRobot()));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tPoint fixYell = new Point(yellowX,yellowY);\n\t\t\tif ((yellowX != 0) && (yellowY != 0)) {\n\t\t\t\tif (worldState.getBarrelFix()){\n\t\t\t\t\tworldState.setYellowRobotPosition(fixParallax(fixYell,worldState.getYellowRobot()));\n\t\t\t\t}else{\n\t\t\t\t\tworldState.setYellowRobotPosition(fixParallax(DistortionFix.barrelCorrected(fixYell),worldState.getYellowRobot()));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor(Point p : bluePixels){\n\n\t\t\t\tif( plate.isInRectangle(p,blueGreenPlate4Points) ){\n\t\t\t\t\tif (worldState.getBarrelFix()){\n\t\t\t\t\t\tnewBluePixels.add(fixParallax(p,worldState.getBlueRobot()));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tnewBluePixels.add(fixParallax(DistortionFix.barrelCorrected(p),worldState.getBlueRobot()));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(Point p : yellowPixels){\n\n\t\t\t\tif( plate.isInRectangle(p,yellowGreenPlate4Points) ){\n\t\t\t\t\tif (worldState.getBarrelFix()){\n\t\t\t\t\t\tnewYellowPixels.add(fixParallax(p,worldState.getYellowRobot()));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tnewYellowPixels.add(fixParallax(DistortionFix.barrelCorrected(p),worldState.getYellowRobot()));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tworldState.setBluePixels(newBluePixels);\n\t\t\tworldState.setYellowPixels(newYellowPixels);\n\n\t\t\t//The above is supposed to filter the pixels and pick up only the T pixels, but the orientation then is always with the (0,0) point \n\n\n\t\t\tblueGreenPlate.clear();\n\t\t\tyellowGreenPlate.clear();\n\n\t\t}\n\n\t\treturn img;\n\n\t}", "private static void reduceNoise(Mat image) {\n\n\t\t// create structuring element that will be used to \"dilate\" and \"erode\"\n\t\t// image. the element chosen here is a 3px by 3px rectangle\n\t\tMat erodeElement = Imgproc.getStructuringElement(Imgproc.MORPH_RECT,\n\t\t\t\tnew Size(1, 1));\n\n\t\t// dilate with larger element so make sure object is nicely visible\n\t\tMat dilateElement = Imgproc.getStructuringElement(Imgproc.MORPH_RECT,\n\t\t\t\tnew Size(12, 12));\n\n\t\t// Erode will shrink the grouping of pixels\n\t\tImgproc.erode(image, image, erodeElement);\n\t\tImgproc.erode(image, image, erodeElement);\n\t\tImgproc.erode(image, image, erodeElement);\n\n\t\t// // Dilate will expand the grouping of pixels\n\t\tImgproc.dilate(image, image, dilateElement);\n\t\tImgproc.dilate(image, image, dilateElement);\n\t\t// Imgproc.dilate(image, image, dilateElement);\n\n\t}", "public void run(ImageProcessor ip) {\n ImagePlus impDark = WindowManager.getImage(DarkiD);\n ImageStack DarkStack = impDark.getStack();\n int width = DarkStack.getProcessor(1).getWidth();\n int height = DarkStack.getProcessor(1).getHeight();\n int dim = width * height;\n \n // Let's assign & declare all the local variables. \n //The pix-by-pix sum of the stack\n double[] sum;\n sum = new double[dim];\n \n //The pix-by-pix average of the stack\n double[] average;\n average = new double[dim];\n \n //The DARK signal pixel array\n double[] DARKpixels;\n DARKpixels = new double[dim];\n \n /* Scan the stack to weed out pics w/ pixel > saturation, then sum \n pix-by-pix through the stack. */\n int k = 0;\n for(int i=1; i<=DarkStack.getSize(); i++){\n double imgMax = DarkStack.getProcessor(i).getStatistics().max;\n if (imgMax < saturation){\n short[] pixels = (short[]) (DarkStack.getPixels(i));\n for (int j=0; j<dim; j++){\n sum[j] += (double)(pixels[j] & 0xffff);\n }\n } else \n k++;\n } \n \n // Average pix-by-pix\n for(int i=0; i<dim; i++){\n average[i] = (double) (sum[i]/(DarkStack.getSize() - k ));\n }\n \n /* Subtract off READ signal and normalize per exposure time. If \n a pixel has a value less than 0, then set it to zero.\n */\n ImagePlus impREAD = WindowManager.getImage(READiD);\n ImageProcessor READ_ip = impREAD.getProcessor();\n float[] READpixels = (float[]) ( READ_ip.getPixels() ); \n for(int i =0; i<dim; i++){\n DARKpixels[i] = (double)( (average[i] - READpixels[i])\n /(DarkTime - READTime) );\n if (DARKpixels[i]< 0)\n DARKpixels[i]=0; \n }\n \n // Make DARK image from pixels then show it. \n ImageProcessor DARK_ip = new FloatProcessor(width, \n height,DARKpixels); \n ImagePlus impDARK = new ImagePlus(\"DARK\",DARK_ip);\n impDARK.show();\n impDARK.draw();\n IJ.run(impDARK, \"Enhance Contrast\", \"saturated=0.35\");\n \n //Print out specs of the DARK image.\n ResultsTable rt = new ResultsTable();\n rt.incrementCounter();\n rt.addValue(\"Mean\",DARK_ip.getStatistics().mean);\n rt.addValue(\"Max\",DARK_ip.getStatistics().max);\n rt.addValue(\"Min\",DARK_ip.getStatistics().min);\n rt.addValue(\"Std.Dev.\",DARK_ip.getStatistics().stdDev);\n rt.showRowNumbers(false);\n rt.show(\"Results\");\n \n\t}", "@Override\n\tpublic Number filteredReading() {\t\n\t// Check we have any readings.\n\tif (buffer.size() == 0) return new Double(0.0);\n\n\tSensorReading reading = null;\n\tdouble sum = 0.0;\n\tdouble avge = 0.0;\n\tint index = 0;\n\n\t// Loop over buffered samples.\n\tIterator it = buffer.iterator();\n\twhile (it.hasNext()) {\n\t reading = (SensorReading)it.next();\n\t avge = avge + reading.getContinuousReading();\n\t index++;\n\t}\n\tlogger.log(2, \"Av-Filter\", name, \"filteredReading\",\"Returned: \"+\n\t\t (avge/index)+\" using \"+index+\" samples.\");\n\treturn new Double(avge / index);\n }", "private double processImg() {\n\n\t\ttry {\n\t\t\timgPreview.setVisibility(View.VISIBLE);\n\n\t\t\t// bitmap factory\n\t\t\tBitmapFactory.Options options = new BitmapFactory.Options();\n\n\t\t\t// downsizing image as it throws OutOfMemory Exception for larger\n\t\t\t// images\n\t\t\toptions.inSampleSize = 8;\n\n\t\t\tbitmap_ref = BitmapFactory.decodeFile(fileUriSafe.getPath(),\n\t\t\t\t\toptions);\n\n\t\t\tbitmap_sample = BitmapFactory.decodeFile(fileUriMole.getPath(),\n\t\t\t\t\toptions);\n\n\t\t\t//convert from bitmap to Mat\n\t\t\tMat ref = new Mat(bitmap_ref.getHeight(), bitmap_ref.getWidth(), CvType.CV_8UC4);\n\t\t\tMat sample = new Mat(bitmap_sample.getHeight(), bitmap_sample.getWidth(), CvType.CV_8UC4);\n\t\t\tMat mask = new Mat(bitmap_sample.getHeight(),bitmap_sample.getWidth(),CvType.CV_8UC4);\n\t\t\tMat sample2calcgrad = new Mat(bitmap_sample.getHeight(), bitmap_sample.getWidth(), CvType.CV_8UC4);\n\n\t\t\tUtils.bitmapToMat(bitmap_ref, ref);\n\t\t\tUtils.bitmapToMat(bitmap_sample, sample);\n\t\t\tUtils.bitmapToMat(bitmap_sample,sample2calcgrad);\n\n\t\t\t//normalize image based on reference\t\t\t\n\t\t\t//sample = normalizeImg(sample, ref);\n\n\t\t\t//Using Sobel filter to calculate gradient\n\t\t\tMat grad_x = new Mat();\n\t\t\tMat grad_y = new Mat();\n\t\t\tMat abs_grad_x = new Mat();\n\t\t\tMat abs_grad_y = new Mat();\n\t\t\tMat gradVals = new Mat();\n\t\t\tMat sample_gray = new Mat(bitmap_sample.getHeight(),bitmap_sample.getWidth(),CvType.CV_8UC1);\n\t\t\tImgproc.cvtColor(sample2calcgrad, sample_gray, Imgproc.COLOR_BGRA2GRAY);\n\t\t\tImgproc.GaussianBlur(sample_gray, sample_gray, new Size(5,5), 0);\n\n\t\t\t//Gradient X\n\t\t\tImgproc.Sobel(sample_gray, grad_x, CvType.CV_8UC1, 1, 0);\n\t\t\tCore.convertScaleAbs(grad_x, abs_grad_x,10,0);\n\n\t\t\t//Gradient Y\n\t\t\tImgproc.Sobel(sample_gray, grad_y, CvType.CV_8UC1, 0, 1);\n\t\t\tCore.convertScaleAbs(grad_y,abs_grad_y, 10, 0);\n\n\t\t\t//combine with grad = sqrt(gx^2 + gy^2)\n\t\t\tCore.addWeighted(abs_grad_x, .5, abs_grad_y, .5, 0, gradVals);\n\n\n\t\t\t//Using CANNY to further smooth Gaussian blurred image; extract contours\n\t\t\tImgproc.Canny(sample_gray, mIntermediateMat, 80, 90);\n\n\t\t\t//find contours of filtered image\n\t\t\tList <MatOfPoint> contours = new ArrayList<MatOfPoint>();\n\t\t\tImgproc.findContours(mIntermediateMat, contours, mHierarchy, Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE);\n\n\t\t\t// Find max contour area\n\t\t\tdouble maxArea = 0;\n\t\t\tIterator<MatOfPoint> each = contours.iterator();\n\t\t\twhile (each.hasNext()) {\n\t\t\t\tMatOfPoint wrapper = each.next();\n\t\t\t\tdouble area = Imgproc.contourArea(wrapper);\n\t\t\t\tif (area > maxArea)\n\t\t\t\t\tmaxArea = area;\n\t\t\t}\n\n\t\t\t// Filter contours by area and only keep those above thresh value\n\t\t\tmContours.clear();\n\t\t\teach = contours.iterator();\n\t\t\twhile (each.hasNext()) {\n\t\t\t\tMatOfPoint contour = each.next();\n\t\t\t\tif (Imgproc.contourArea(contour) > mMinContourArea*maxArea) {\n\t\t\t\t\tmContours.add(contour);\n\t\t\t\t\tborder.addAll(contour.toList());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//segment border into 8 parts \n\t\t\t//calc gradient along contour segment & normalize based on number of points in border\n\t\t\t//upto 7 points at end of border list ignored\n\t\t\tdouble [] seg_val = new double [8];\n\t\t\tint seg_len = border.size()/8;\n\t\t\tfor(int i = 0; i<8; i++){\n\t\t\t\tdouble contourGradientSum = 0;\n\t\t\t\tfor(int j=i*seg_len; j<(i+1)*seg_len;j++){\n\t\t\t\t\tPoint pt = border.get(j);\n\t\t\t\t\tint x = (int) pt.x;\n\t\t\t\t\tint y = (int) pt.y;\t\t\t\n\t\t\t\t\tcontourGradientSum += Core.mean(gradVals.submat(y-1, y+1, x-1, x+1)).val[0];\n\t\t\t\t}\n\t\t\t\tseg_val[i]=contourGradientSum/seg_len;\n\t\t\t}\n\n\n\t\t\tLog.v(TAG, \"grad vals: [\" + seg_val[0] + \",\" + seg_val[1] + \",\" \n\t\t\t\t\t+ seg_val[2] + \",\"+ seg_val[3] + \",\"\n\t\t\t\t\t+ seg_val[4] + \",\"+ seg_val[5] + \",\"\n\t\t\t\t\t+ seg_val[6] + \",\"+ seg_val[7] + \"]\");\n\t\t\t\n\t\t\tdouble thresh = 140;\n\t\t\tdouble score = 0;\n\n\t\t\tfor(double val:seg_val){\n\t\t\t\tif (val<=thresh){\n\t\t\t\t\tscore++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(score<8){\n\t\t\t\tscore += mContours.size()/7;\n\t\t\t\tscore = Math.min(8,score);\n\t\t\t}\n\n\n\n\t\t\tLog.v(TAG, \"score: \" +score);\n\t\t\tLog.v(TAG, \"Contours count: \" + mContours.size());\n\t\t\tLog.v(TAG, \"Border size: \" + border.size());\n\t\t\tImgproc.drawContours(sample, mContours, -1, CONTOUR_COLOR);\n\t\t\tImgproc.drawContours(mask, mContours, -1, COLOR_WHITE, -1);\n\t\t\tborders = mask;\n\n\t\t\t//display image with contours\n\t\t\tUtils.matToBitmap(sample, bitmap_sample);\n\t\t\timgPreview.setImageBitmap(bitmap_sample);\n\t\t\timgPreview.setFocusable(true);\n\n\t\t\treturn score;\n\n\t\t\t//\t\t\t\n\t\t} catch (NullPointerException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn -1;\n\t}", "private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }", "public static Image filtroGrisAzul(Image img){\n WritableImage resultImg = new WritableImage((int)img.getWidth(),(int)img.getHeight());\n PixelReader pixelr = img.getPixelReader();\n PixelWriter pixelw = resultImg.getPixelWriter();\n \n for (int i = 0; i < img.getHeight(); i++) {\n for (int j = 0; j < img.getWidth(); j++) {\n Color color = pixelr.getColor(j, i);\n double blue;\n blue = color.getBlue();\n blue *= 255;\n pixelw.setColor(j, i, Color.rgb((int)blue, (int)blue, (int)blue));\n }\n }\n \n return resultImg;\n }", "public static CropRegion findFace(int[][] grayscale, boolean doDebugOutput, boolean measureTime) {\r\n int[][] debugGrayscale = null; // will be used only if doDebugOutput is true.\r\n\r\n if (doDebugOutput) {\r\n doDebugOutput(\"grayscale.jpg\", grayscale);\r\n }\r\n\r\n if (measureTime) {\r\n lastRecordedTime = System.currentTimeMillis();\r\n }\r\n\r\n int[][] horiz = horizontalFilter(grayscale);\r\n int[][] vertical = verticalFilter(grayscale);\r\n int h = grayscale.length;\r\n int w = grayscale[0].length;\r\n margin = Math.max(10, Math.min(h / 60, w / 60));\r\n int[][] res = new int[h][w];\r\n for (int i = 0; i < h; i++) {\r\n for (int j = 0; j < w; j++) {\r\n res[i][j] = (int) Math.sqrt((horiz[i][j] * horiz[i][j] + vertical[i][j]\r\n * vertical[i][j]));\r\n }\r\n }\r\n if (doDebugOutput) {\r\n doDebugOutput(\"before_smoothing.jpg\", res);\r\n }\r\n\r\n if(measureTime) {\r\n printTimeTaken(\"Linear filters\");\r\n }\r\n\r\n int[][] res2 = new Smoother(res).smoothIt();\r\n if (doDebugOutput) {\r\n doDebugOutput(\"after_smoothing.jpg\", res2);\r\n }\r\n if(measureTime) {\r\n printTimeTaken(\"Smoothing\");\r\n }\r\n\r\n int[][] aggHoriz = aggregatorHorizontal(res2, new int[][] { { 0, w - 1 } });\r\n int eyes = findEyes(aggHoriz);\r\n if (doDebugOutput) {\r\n debugGrayscale = Arrays.copyOf(aggHoriz, aggHoriz.length);\r\n for (int i = 0; i < res2[0].length; i++) {\r\n debugGrayscale[eyes - 1][i] = 255;\r\n debugGrayscale[eyes][i] = 255;\r\n debugGrayscale[eyes + 1][i] = 255;\r\n }\r\n doDebugOutput(\"eye_line.jpg\", debugGrayscale);\r\n }\r\n\r\n if(measureTime) {\r\n printTimeTaken(\"Find eyes horizonatal\");\r\n }\r\n\r\n int[][] aggVertical = aggregatorVertical(res2, eyes - h / 20, eyes + h / 20);\r\n Integer[] eyeXs = null;\r\n try {\r\n eyeXs = findEyeXs(aggVertical);\r\n\r\n if (doDebugOutput) {\r\n for (int i = 0; i < debugGrayscale.length; i++) {\r\n if (i > margin && i < debugGrayscale.length - margin) {\r\n continue;\r\n }\r\n for (int j = 0; j < debugGrayscale[0].length; j++) {\r\n debugGrayscale[i][j] = aggVertical[i][j];\r\n }\r\n }\r\n for (Integer i : eyeXs) {\r\n for (int j = 0; j < debugGrayscale.length; j++) {\r\n debugGrayscale[j][i] = 255;\r\n debugGrayscale[j][i - 1] = 255;\r\n debugGrayscale[j][i + 1] = 255;\r\n }\r\n }\r\n doDebugOutput(\"eye_boxes.jpg\", debugGrayscale);\r\n }\r\n\r\n if(measureTime) {\r\n printTimeTaken(\"Find eye boxes\");\r\n }\r\n\r\n aggHoriz = aggregatorHorizontal(res2, new int[][] { { eyeXs[2], eyeXs[0] },\r\n { eyeXs[1], eyeXs[3] } });\r\n for (int i = 0; i < h; i++) {\r\n for (int j = 0; j < w; j++) {\r\n if (j <= margin || (w - j) <= margin) {\r\n res[i][j] = aggHoriz[i][j];\r\n } else if (i <= margin || (h - i) <= margin) {\r\n res[i][j] = aggVertical[i][j];\r\n }\r\n }\r\n }\r\n // int top = findTopOfHead(aggHoriz, margin / 2);\r\n // top = topHelper(aggHoriz, top + 1, aggHoriz[top][0] * 2);\r\n int difference = eyeXs[2] - eyeXs[3];\r\n int before = eyeXs[1] - difference / 2;\r\n int after = eyeXs[0] + difference / 2;\r\n int horizDiff = (9 * (eyeXs[0] - eyeXs[1])) / 10;\r\n int beforeHoriz = eyes - horizDiff;\r\n int afterHoriz = eyes + (horizDiff * 3) / 2;\r\n for (int i = before; i < after; i++) {\r\n res[beforeHoriz][i] = 255;\r\n res[afterHoriz][i] = 255;\r\n res[eyes][i] = 255;\r\n }\r\n for (int i = beforeHoriz; i < afterHoriz; i++) {\r\n res[i][before] = 255;\r\n res[i][after] = 255;\r\n }\r\n\r\n if (doDebugOutput) {\r\n doDebugOutput(\"detected_face.jpg\", res);\r\n }\r\n\r\n if(measureTime) {\r\n printTimeTaken(\"Detect face\");\r\n }\r\n\r\n int faceWidth = after - before;\r\n int faceHeight = afterHoriz - beforeHoriz;\r\n int upFaceHeight = eyes - beforeHoriz;\r\n CropRegion region = new CropRegion();\r\n region.x1 = Math.max(margin + 1, beforeHoriz - (2 * upFaceHeight) / 3);\r\n region.y1 = Math.max(margin + 1, before - (3 * faceWidth) / 7);\r\n region.x2 = Math.min(h - margin - 1, afterHoriz + (3 * faceHeight) / 7);\r\n region.y2 = Math.min(w - margin - 1, after + (3 * faceWidth) / 7);\r\n\r\n if (doDebugOutput) {\r\n debugGrayscale = Arrays.copyOf(res, res.length);\r\n for (int i = region.x1; i < region.x2; i++) {\r\n debugGrayscale[i][region.y1] = 255;\r\n debugGrayscale[i][region.y2] = 255;\r\n }\r\n for (int i = region.y1; i < region.y2; i++) {\r\n debugGrayscale[region.x1][i] = 255;\r\n debugGrayscale[region.x2][i] = 255;\r\n }\r\n doDebugOutput(\"face_region.jpg\", debugGrayscale);\r\n }\r\n\r\n return ImageScaler.chooseMostAppropriateRegion(region, w * h);\r\n } catch (RuntimeException e) {\r\n CropRegion cropRegion = new CropRegion();\r\n cropRegion.x1 = 0;\r\n cropRegion.y1 = 0;\r\n cropRegion.x2 = 240;\r\n cropRegion.y2 = 320;\r\n System.err.println(\"Failed to find the face\");\r\n return cropRegion;\r\n }\r\n }", "public void myFilter(int start, int end)\n {\n Pixel[] originPixel = this.getPixels();\n //loop through all pixels in the calling object and parameter \n for(int index=start;index<=end;index++){\n originPixel[index].setGreen(originPixel[index].getBlue());\n originPixel[index].setBlue(originPixel[index].getRed());\n originPixel[index].setRed(originPixel[index].getGreen()); \n }\n }", "public void directCompute() {\r\n\t\t\tshort[] rgb = new short[3];\r\n\t\t\tint offset = yMin * width;\r\n\t\t\tfor (int y = yMin; y < yMax; y++) {\r\n\t\t\t\tfor (int x = 0; x < width; x++) {\r\n\t\t\t\t\tPoint3D screenPoint = screenCorner.add(xAxis.scalarMultiply(x * 1.0 / (width - 1) * horizontal))\r\n\t\t\t\t\t\t\t.sub(yAxis.scalarMultiply(y * 1.0 / (height - 1) * vertical));\r\n\r\n\t\t\t\t\tRay ray = Ray.fromPoints(eye, screenPoint);\r\n\t\t\t\t\ttracer(scene, ray, rgb);\r\n\t\t\t\t\t// applying color to pixel\r\n\t\t\t\t\tred[offset] = rgb[0] > 255 ? 255 : rgb[0];\r\n\t\t\t\t\tgreen[offset] = rgb[1] > 255 ? 255 : rgb[1];\r\n\t\t\t\t\tblue[offset] = rgb[2] > 255 ? 255 : rgb[2];\r\n\r\n\t\t\t\t\toffset++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "@Test\n public void testSharpenABlurredImage() {\n\n IImage newImage = new Blur().applyFilter(this.checkerboard);\n\n List<List<Pixel>> result = new ArrayList<>();\n List<Pixel> row1 = new ArrayList<>();\n row1.add(new Pixel(80, 80, 80, new Posn(0, 0)));\n row1.add(new Pixel(64, 64, 64, new Posn(1, 0)));\n List<Pixel> row2 = new ArrayList<>();\n row2.add(new Pixel(64, 64, 64, new Posn(0, 1)));\n row2.add(new Pixel(80, 80, 80, new Posn(1, 1)));\n result.add(row1);\n result.add(row2);\n IImage resultImage = new Image(result, 255);\n\n assertEquals(resultImage, newImage);\n\n IImage newImage2 = new Sharpen().applyFilter(newImage);\n\n List<List<Pixel>> result2 = new ArrayList<>();\n List<Pixel> row01 = new ArrayList<>();\n row01.add(new Pixel(132, 132, 132, new Posn(0, 0)));\n row01.add(new Pixel(120, 120, 120, new Posn(1, 0)));\n List<Pixel> row02 = new ArrayList<>();\n row02.add(new Pixel(120, 120, 120, new Posn(0, 1)));\n row02.add(new Pixel(132, 132, 132, new Posn(1, 1)));\n result2.add(row01);\n result2.add(row02);\n IImage resultImage2 = new Image(result2, 255);\n\n assertEquals(resultImage2, newImage2);\n\n\n\n\n }", "void removeMatching(MetricFilter filter);", "private Operation filterOperation(Operation op) {\n\t\t\tif (op instanceof ImageOperation) {\n\t\t\t\tImage i = ((ImageOperation) op).getImage();\n\t\t\t\tDimension d = ImageSize.get(i);\n\t\t\t\tBufferedImage bi = new BufferedImage(d.width, d.height,\n\t\t\t\t\t\tBufferedImage.TYPE_INT_ARGB);\n\t\t\t\tGraphics2D g3 = bi.createGraphics();\n\t\t\t\tg3.drawImage(i, 0, 0, null);\n\t\t\t\tg3.dispose();\n\t\t\t\t((ImageOperation) op).setImage(bi);\n\t\t\t}\n\t\t\treturn op;\n\t\t}", "public void blurImage()\r\n {\r\n if (!isChanged && !isBlured )\r\n {\r\n cropedEdited = cropedPart;\r\n }\r\n\t float[] elements = {1/9f, 1/9f, 1/9f, 1/9f,1/9f,1/9f,1/9f,1/9f,1/9f,1/9f}; \r\n\t Kernel kernel = new Kernel(3, 3, elements); \r\n\t BufferedImageOp blur = new ConvolveOp(kernel); \r\n\t cropedEdited = blur.filter(cropedEdited, null);\r\n repaint();\r\n }", "public void negative(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 255-pixels[0];\r\n ww[1] = 255-pixels[1];\r\n ww[2] = 255-pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n\r\n }", "public void process5(Mat rgbaImage) {\n\n\n\n Imgproc.cvtColor(rgbaImage,mPyrDownMat,Imgproc.COLOR_RGBA2GRAY);\n //Imgproc.medianBlur(rgbaImage,rgbaImage,9);\n\n //Imgproc.cvtColor(rgbaImage, rgbaImage, Imgproc.COLOR_RGBA2GRAY);\n //Imgproc.blur(mPyrDownMat,mPyrDownMat,temp_size);\n Imgproc.GaussianBlur(mPyrDownMat, mPyrDownMat,new Size(5,5), 0);\n //Imgproc.threshold(mPyrDownMat,mPyrDownMat,0,maxTreshold,Imgproc.THRESH_OTSU);\n //Imgproc.threshold(mPyrDownMat,mPyrDownMat,minTreshold,maxTreshold,Imgproc.THRESH_BINARY_INV);\n\n Imgproc.adaptiveThreshold(mPyrDownMat,mPyrDownMat,maxTreshold,Imgproc.ADAPTIVE_THRESH_MEAN_C,Imgproc.THRESH_BINARY_INV,75,10);\n\n //Imgproc.Canny(rgbaImage,rgbaImage,minTreshold,maxTreshold,3,true);\n //Imgproc.dilate(rgbaImage, rgbaImage, new Mat());\n //Imgproc.erode(rgbaImage,rgbaImage,new Mat());\n\n\n\n //Imgproc.Canny(mPyrDownMat,mPyrDownMat,10,100,3,true);\n\n //Imgproc.pyrDown(rgbaImage, mPyrDownMat);\n //Imgproc.pyrDown(mPyrDownMat, mPyrDownMat);\n\n\n //Imgproc.cvtColor(mPyrDownMat, mHsvMat, Imgproc.COLOR_RGB2HSV_FULL);\n\n //Core.inRange(mHsvMat, mLowerBound, mUpperBound, mMask);\n //Imgproc.dilate(mMask, mDilatedMask, new Mat());\n\n List<MatOfPoint> contours = new ArrayList<MatOfPoint>();\n\n //Imgproc.findContours(mDilatedMask, contours, mHierarchy, Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE);\n\n //Imgproc.findContours(rgbaImage, contours, new Mat(), Imgproc.RETR_TREE, Imgproc.CHAIN_APPROX_SIMPLE);\n\n /*\n // Find max contour area\n double maxArea = 0;\n Iterator<MatOfPoint> each = contours.iterator();\n while (each.hasNext()) {\n MatOfPoint wrapper = each.next();\n double area = Imgproc.contourArea(wrapper);\n if (area > maxArea){\n maxArea = area;\n //Log.e(\"Max Area\", \"wtf.. \" + maxArea);\n }\n\n }*/\n/*\n Iterator<MatOfPoint> each = contours.iterator();\n // Filter contours by area and resize to fit the original image size\n mContours.clear();\n each = contours.iterator();\n\n\n //Center Calculation init\n meanCenterX = 0;\n SameCenterContour = 0;\n Point temp_point = new Point(0,0);\n\n int temp_point_y = 0;\n\n\n\n while (each.hasNext()) {\n MatOfPoint contour = each.next();\n\n //Log.e(TAG, \"Sizes: \" + Imgproc.contourArea(contour) + \" Max: \" + mMinContourArea*maxArea);\n if (Imgproc.contourArea(contour) > 0) {\n mContours.add(contour);\n\n\n //Change image view to show what is founded\n Mat m = new Mat();\n\n //Draw bounding rect\n Rect temp_rec = Imgproc.boundingRect(contour);\n Imgproc.rectangle(rgbaImage,temp_rec.tl(),temp_rec.br(),ColorBlobDetectionActivity.CONTOUR_COLOR,6);\n\n //Log.e(TAG, \"temprec x: \" + temp_rec.tl().x + \" temrec width: \" + temp_rec.width);\n //Log.e(TAG, \"temprec : \" + temp_rec.tl().y + \" temrec width: \" + temp_rec.height);\n\n MatOfPoint2f mMOP2f1 = new MatOfPoint2f();\n MatOfPoint2f approx = new MatOfPoint2f();\n*/\n\n /*contour.convertTo(mMOP2f1,CvType.CV_32FC2);\n Imgproc.approxPolyDP(mMOP2f1,approx,Imgproc.arcLength(mMOP2f1,true)*0.02,true);\n\n if (approx.rows() >= 4){\n Point tr = approx.toList().get(0);\n Point br = approx.toList().get(1);\n Point bl = approx.toList().get(2);\n Point tl = approx.toList().get(3);\n\n //temp_rec.tl().x -= temp_rec.width;\n //temp_rec.tl().y -= temp_rec.height;\n Imgproc.circle(rgbaImage,tr,1,new Scalar(255,0,0,255),4);\n Imgproc.circle(rgbaImage,br,1,new Scalar(255,100,0,255),4);\n Imgproc.circle(rgbaImage,bl,1,new Scalar(255,100,250,255),4);\n Imgproc.circle(rgbaImage,tl,1,new Scalar(255,100,100,255),4);\n\n }*/\n/*\n Point tr = new Point(temp_rec.tl().x+temp_rec.size().width,temp_rec.tl().y);\n Point bl = new Point(temp_rec.br().x-temp_rec.size().width,temp_rec.br().y);\n\n Imgproc.circle(rgbaImage,temp_rec.tl(),1,new Scalar(0,0,255,255),4);\n Imgproc.circle(rgbaImage,tr,1,new Scalar(255,255,0,255),4);\n Imgproc.circle(rgbaImage,temp_rec.br(),1,new Scalar(255,0,0,255),4);\n Imgproc.circle(rgbaImage,bl,1,new Scalar(255,0,255,255),4);\n\n //Draw mid\n\n Moments p = Imgproc.moments(contour, false);\n int x = (int) (p.get_m10() / p.get_m00());\n int y = (int) (p.get_m01() / p.get_m00());\n\n\n //Check if they are in the same vertical line\n\n meanCenterX += x;\n*/\n /*\n if (contours.size() > 14) {\n if (temp_point.x == x)\n SameCenterContour++;\n\n }*/\n/*\n Imgproc.circle(rgbaImage, new Point(x, y), 1, new Scalar(255,49,0,255),4);\n Imgproc.line(rgbaImage,new Point(x,y), new Point(x,0),new Scalar(255,49,0,255),4);\n centers.add(x);\n /*\n //set preview\n m = rgbaImage.submat(temp_rec);\n mBitmap = Bitmap.createBitmap(m.width(),m.height(),Bitmap.Config.ARGB_8888);\n Utils.matToBitmap(m,mBitmap);*//*\n }\n }//end while all contours*/\n\n\n\n\n /*mContours.clear();\n each = contours.iterator();\n MatOfPoint2f approx = new MatOfPoint2f();\n MatOfPoint2f mMOP2f1 = new MatOfPoint2f();\n MatOfPoint mMOP = new MatOfPoint();\n while (each.hasNext()) {\n\n MatOfPoint contour = each.next();\n contour.convertTo(mMOP2f1,CvType.CV_32FC2);\n Imgproc.approxPolyDP(mMOP2f1,approx,Imgproc.arcLength(mMOP2f1,true)*0.02,true);\n approx.convertTo(mMOP, CvType.CV_32S);\n\n if(approx.rows()==4 && Imgproc.isContourConvex(mMOP) ){\n //Log.e(\"contour\", \"Contour area\" + Imgproc.contourArea(contour) + \"Max Area\");\n if (Imgproc.contourArea(contour) > maxArea){\n MatOfPoint temp = new MatOfPoint();\n approx.convertTo(temp,CvType.CV_32S);\n Core.multiply(temp, new Scalar(4,4), temp);\n mContours.add(temp);\n\n\n Rect temp_rec = Imgproc.boundingRect(temp);\n\n Imgproc.rectangle(rgbaImage,temp_rec.tl(),temp_rec.br(),ColorBlobDetectionActivity.CONTOUR_COLOR,6);\n\n\n /*Core.multiply(approx,new Scalar(4,4),approx);\n Mat src = new Mat(4,1, CvType.CV_32FC2);\n\n Log.e(TAG,\"\" + (int)approx.toList().get(0).y + (int)approx.toList().get(0).x + \"\\n\" +\n (int)approx.toList().get(1).y +(int)approx.toList().get(1).x + \"\\n\" +\n (int)approx.toList().get(2).y + (int)approx.toList().get(2).x + \"\\n\" +\n (int)approx.toList().get(3).y + (int)approx.toList().get(3).x);\n\n src.put((int)approx.toList().get(0).y, (int)approx.toList().get(0).x,\n (int)approx.toList().get(1).y, (int)approx.toList().get(1).x,\n (int)approx.toList().get(2).y, (int)approx.toList().get(2).x,\n (int)approx.toList().get(3).y, (int)approx.toList().get(3).x\n );\n\n Mat dst = new Mat(4,1,CvType.CV_32FC2);\n dst.put(0,0,0,temp.width(),temp.height(),temp.width(),temp.height(),0);\n\n Mat perspectiveTransform = Imgproc.getPerspectiveTransform(src,dst);\n Imgproc.warpPerspective(temp,temp,perspectiveTransform, new Size(temp.cols(), temp.rows()));\n\n Mat m = new Mat();\n\n temp_rec = Imgproc.boundingRect(temp);\n m = rgbaImage.submat(temp_rec);\n mBitmap = Bitmap.createBitmap(m.width(),m.height(),Bitmap.Config.ARGB_8888);\n Utils.matToBitmap(m,mBitmap);\n\n }\n\n }\n\n }*/\n Mat circles = new Mat();\n\n\n Imgproc.HoughCircles(mPyrDownMat,circles,Imgproc.CV_HOUGH_GRADIENT,dp,minDist,param1,param2,minRadius,maxRadius);\n\n //Imgproc.HoughCircles(rgbaImage,circles,Imgproc.CV_HOUGH_GRADIENT,1,20,23,46,0,0);\n Log.e(\"Circles\", \"Total circle count:\" + circles.cols());\n Mat circleBoundRect = new Mat();\n for (int i = 0; i < circles.cols(); i++) {\n double mCircle[] = circles.get(0,i);\n\n int x = (int) Math.round(mCircle[0]);\n int y = (int) Math.round(mCircle[1]);\n int r = (int) Math.round(mCircle[2]);\n\n Point center = new Point(x ,y);\n\n Point tl = new Point(x-r,y-r);\n Point br = new Point(x+r,y+r);\n\n Rect circleBoundRect_temp = new Rect(tl,br);\n Log.e(\"Circles\",\"x: \"+ x + \"y: \"+y + \"r: \"+r);\n\n try {\n circleBoundRect = mPyrDownMat.submat(circleBoundRect_temp);\n }\n catch (Exception e){\n Log.e(\"Circles Exception\",e.toString());\n }\n double percentage = Core.countNonZero(circleBoundRect)/(circleBoundRect.size().width*circleBoundRect.size().height);\n if (percentage> 0.6){\n Imgproc.rectangle(rgbaImage,tl,br,new Scalar(247,0,255),3);\n }\n\n else if (percentage < 0.6 && percentage>0.3){\n Imgproc.rectangle(rgbaImage,tl,br,new Scalar(0,255,0),3);\n }\n\n //Log.e(\"Circles\",\"\"+Core.countNonZero(circleBoundRect)/(circleBoundRect.size().width*circleBoundRect.size().height));\n //draw circle\n //Imgproc.circle(rgbaImage,center,r,new Scalar(57,58,153),4);\n //draw center\n //Imgproc.circle(rgbaImage,center,3,new Scalar(57,58,153),5);\n\n\n\n }\n\n mBitmap = Bitmap.createBitmap(rgbaImage.width(),rgbaImage.height(),Bitmap.Config.ARGB_8888);\n Utils.matToBitmap(rgbaImage,mBitmap);\n\n }", "public static Mat acquireMedian(Mat[] buffert)\n {\n Mat average_image = new Mat(buffert[0].height(),buffert[0].width(), CvType.CV_8U);\n int l = 0;\n // Go through each pixel in in each image\n for(int i = 0; i < buffert[0].width();i++)\n for(int j = 0; j < buffert[0].height();j++)\n {\n int sum = 0;\n for(int k = 0; k < buffert.length;k++)\n {\n double[] value = buffert[k].get(j,i); //the value need to be stored in an array\n sum+=value[0]; //adds all the pixel values together at pixel position (i, j).\n }\n double[] average_value = {((sum)/(double)buffert.length)};\n average_image.put(j, i, average_value); // Put the calculated average pixel value in result image\n }\n return average_image;\n }", "private Mat segmentRedColorViaInverting(Mat bgr) {\n Mat bgrInverted = new Mat();\n Mat hsvInverted = new Mat();\n Mat maskInv = new Mat();\n Core.bitwise_not(bgr, bgrInverted);\n Imgproc.cvtColor(bgrInverted, hsvInverted, Imgproc.COLOR_BGR2HSV);\n inRange(hsvInverted, new Scalar(90 - MAX_COLOR_CHANNEL_OFFSET, 70, 50), new Scalar(90 + MAX_COLOR_CHANNEL_OFFSET, 255, 255), maskInv);\n return maskInv;\n }", "public static int[] edgeEnhanceFilter(int[] data, int[] LoGdata, int w, int h) {\n int[] newData = new int[w * h];\n\n int radius = 3;\n double g = Math.PI * radius * radius / 2d;\n\n // relative distance list of radius r\n ArrayList<Point> rdists = new ArrayList<Point>();\n for (int rx = -radius; rx <= radius; rx++) {\n for (int ry = -radius; ry <= radius; ry++) {\n if (rx * rx + ry * ry <= (radius + 0.5) * (radius + 0.5)) {\n // within the circle\n rdists.add(new Point(rx, ry));\n }\n }\n }\n\n for (int x = 0; x < w; x++) {\n for (int y = 0; y < h; y++) {\n int index = y * w + x;\n\n // calculate mthres\n double mthres = 0;\n for (Point p : rdists) {\n int xx = x + p.x, yy = y + p.y;\n if (xx >= 0 && xx < w && yy >= 0 && yy < h) {\n double sechx = Lab.distance(data[index], data[(y + p.y) * w + (x + p.x)]) / 8d;\n mthres += Math.pow(2d / (Math.exp(sechx) + Math.exp(-sechx)), 5d);\n }\n }\n\n if (LoGdata[index] >= -3) {\n mthres /= rdists.size();\n mthres = Math.pow(mthres, 3d);\n mthres *= rdists.size();\n }\n\n int val = 0;\n if (mthres <= g) {\n val = (int) ((g - mthres) / g * 255d);\n }\n\n newData[index] = RGB.rgb(val, val, val);\n }\n }\n return newData;\n }", "private double normalizeImageValue(double value){\n return value/(31);\n }", "public Bitmap rgbAverageContrastAugmentationRS(Bitmap bmp) {\n\n\n\n RenderScript rs = RenderScript.create(getContext()); //Create base renderscript\n\n Allocation input = Allocation.createFromBitmap(rs, bmp); //Bitmap input\n Allocation output = Allocation.createTyped(rs, input.getType(), Allocation.USAGE_SCRIPT ); //Bitmap output\n\n ScriptC_histogram histoScript = new ScriptC_histogram(rs);\n\n histoScript.set_RGB(true);\n\n histoScript.set_size(bmp.getWidth() * bmp.getHeight());\n\n short[] LUTrgb;\n\n LUTrgb = histoScript.reduce_LUTCumulatedHistogram(input).get(); //Get result\n\n histoScript.destroy();\n\n ScriptC_computeLut lut = new ScriptC_computeLut(rs);\n\n lut.set_lutSingle(LUTrgb);\n\n lut.forEach_assignLutRGBAverage(input,output);\n\n\n //Keep only one chann\n output.copyTo(bmp);\n input.destroy();\n output.destroy();\n lut.destroy();\n rs.destroy();\n\n\n\n\n\n\n return bmp;\n }", "public void findEdgesAndThreshold() {\n\t\tActiveImageConverter.convertToGray16();\n\t\tContrastEnhancer enhancer = new ContrastEnhancer();\n\t\tenhancer.equalize(ActiveImage);\n\t\tActiveImageProcessor = ActiveImage.getProcessor();\n\t\tActiveImageProcessor.findEdges();\n\t\tActiveImageProcessor.sqr(); // turns the gradient into gradient squared\n\t\tActiveImageProcessor.sqr(); // further enhances the good edges\n\t\tenhancer.equalize(ActiveImage);\n\t\tdouble mean = ActiveImage.getStatistics().mean;\n\t\tdouble max = ActiveImage.getStatistics().max;\n\t\tActiveImageProcessor.setThreshold(mean*8,max,ActiveImageProcessor.OVER_UNDER_LUT);\n\t\tif(userInput)\n\t\t{\n\t\t\tIJ.run(ActiveImage,\"Threshold...\",\"\");\n\t\t\tnew WaitForUserDialog(\"OK\").show();\n\t\t\tif (WindowManager.getWindow(\"Threshold\")!= null){\n\t\t\t\tIJ.selectWindow(\"Threshold\");\n\t\t\t\tIJ.run(\"Close\"); \n\t\t\t}\n\t\t}\n\t\tIJ.run(ActiveImage,\"Convert to Mask\",\"\");\n\t\tIJ.run(ActiveImage,\"Skeletonize\",\"\");\n\t\treturn;\n\t}", "public static WritableImage getAverage(WritableImage a, WritableImage b) {\n\t\tWritableImage result = new WritableImage((int)a.getWidth(), \n\t\t\t\t(int)a.getHeight());\n\t\tPixelWriter writer = result.getPixelWriter();\n\t\tPixelReader aPixels = a.getPixelReader();\n\t\tPixelReader bPixels = b.getPixelReader();\n\t\t\n\t\tfor (int y = 0; y < a.getHeight(); y ++) {\n\t\t\tfor (int x = 0; x < a.getWidth(); x ++) {\n\t\t\t\tColor color = getAverageColor(\n\t\t\t\t\t\taPixels.getColor(x, y), \n\t\t\t\t\t\tbPixels.getColor(x, y));\n\t\t\t\twriter.setColor(x, y, color);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "private static native void niBlackThreshold_0(long _src_nativeObj, long _dst_nativeObj, double maxValue, int type, int blockSize, double k, int binarizationMethod);", "public Range getPossibleAverages() {\n int overallAverage = getMissingAwareAverage(getTilesOffset(1), getFractionWidth()*getFractionHeight());\n if (overallAverage == Util.MISSING_GREY) {\n return new Range(0, 255);\n }\n // average = overallAverage*(1-getMissingPixelsFraction())+dynamic*getMissingPixelsFraction()\n return new Range(Math.max(overallAverage-MAX_DYNAMIC_DISTANCE,\n (int) (overallAverage * (1 - getMissingPixelsFraction()))),\n Math.min(overallAverage+MAX_DYNAMIC_DISTANCE,\n (int) (overallAverage*(1-getMissingPixelsFraction()) +\n 255*getMissingPixelsFraction())));\n }", "public void updateFilter() {\n Texture2dProgram.ProgramType programType;\n float[] kernel = null;\n float colorAdj = 0.0f;\n\n Log.d(TAG, \"Updating filter to \" + mNewFilter);\n switch (mNewFilter) {\n case CameraActivity.FILTER_NONE:\n programType = Texture2dProgram.ProgramType.TEXTURE_EXT;\n break;\n case CameraActivity.FILTER_BLACK_WHITE:\n // (In a previous version the TEXTURE_EXT_BW variant was enabled by a flag called\n // ROSE_COLORED_GLASSES, because the shader set the red channel to the B&W color\n // and green/blue to zero.)\n programType = Texture2dProgram.ProgramType.TEXTURE_EXT_BW;\n break;\n case CameraActivity.FILTER_BLUR:\n programType = Texture2dProgram.ProgramType.TEXTURE_EXT_FILT;\n kernel = new float[] {\n 1f/16f, 2f/16f, 1f/16f,\n 2f/16f, 4f/16f, 2f/16f,\n 1f/16f, 2f/16f, 1f/16f };\n break;\n case CameraActivity.FILTER_SHARPEN:\n programType = Texture2dProgram.ProgramType.TEXTURE_EXT_FILT;\n kernel = new float[] {\n 0f, -1f, 0f,\n -1f, 5f, -1f,\n 0f, -1f, 0f };\n break;\n case CameraActivity.FILTER_EDGE_DETECT:\n programType = Texture2dProgram.ProgramType.TEXTURE_EXT_FILT;\n kernel = new float[] {\n -1f, -1f, -1f,\n -1f, 8f, -1f,\n -1f, -1f, -1f };\n break;\n case CameraActivity.FILTER_EMBOSS:\n programType = Texture2dProgram.ProgramType.TEXTURE_EXT_FILT;\n kernel = new float[] {\n 2f, 0f, 0f,\n 0f, -1f, 0f,\n 0f, 0f, -1f };\n colorAdj = 0.5f;\n break;\n default:\n throw new RuntimeException(\"Unknown filter mode \" + mNewFilter);\n }\n\n // Do we need a whole new program? (We want to avoid doing this if we don't have\n // too -- compiling a program could be expensive.)\n if (programType != mFullScreen.getProgram().getProgramType()) {\n mFullScreen.changeProgram(new Texture2dProgram(programType));\n // If we created a new program, we need to initialize the texture width/height.\n mIncomingSizeUpdated = true;\n }\n\n // Update the filter kernel (if any).\n if (kernel != null) {\n mFullScreen.getProgram().setKernel(kernel, colorAdj);\n }\n\n mCurrentFilter = mNewFilter;\n }", "@Override\n public void filter(BoundingBox3d bounds) {\n filter = new boolean[points.size()];\n for (int i = 0; i < filter.length; i++)\n filter[i] = bounds.contains(points.get(i).xyz);\n }", "public void adjustIntensity()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n\tdouble dbL = (double)(L-1);\r\n\tshort maxI;\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\t\tmaxI = (short)Math.min(L-1, \r\n\t\t Math.round((L-1) * maxIntensity(hue[row][col]/dbL,\r\n\t\t saturation[row][col]/dbL)));\r\n\t\tintensity[row][col] =\r\n\t\t (short)Math.min(intensity[row][col], maxI);\r\n\t }\r\n\t}\r\n }", "public static boolean[][] apply(BufferedImage img){\n int largura = img.getWidth();\r\n int altura = img.getHeight();\r\n \r\n //Imagem de saida\r\n BufferedImage outImage = new BufferedImage(largura, altura, BufferedImage.TYPE_3BYTE_BGR);\r\n \r\n //matriz de saida\r\n boolean[][] output = new boolean[largura][altura];\r\n \r\n //calculando os valores do CIVE\r\n for (int x = 0; x < largura; x++) {\r\n for (int y = 0; y < altura; y++) {\r\n double red = Color.getColor(\"red\", img.getRGB(x, y)).getRed();\r\n double green = Color.getColor(\"green\", img.getRGB(x, y)).getGreen();\r\n \r\n if (green > red ) {\r\n output[x][y] = true;\r\n } else {\r\n output[x][y] = false;\r\n }\r\n \r\n }\r\n }\r\n\r\n return output;\r\n }", "@Test\n public void filter() throws IOException {\n Layer newTestLayer = ImageUtil.readJPEGPNG(\"spencer.jpeg\");\n Layer newTestLayerBlur = ImageUtil.readJPEGPNG(\"spencer.jpeg\");\n new Blur().filter(newTestLayerBlur);\n assertTrue(newTestLayer.getPixels() != newTestLayerBlur.getPixels());\n }", "void trackFilteredObject(com.ilos.wiser.ILOSDataCollection.Object theObject, Mat threshold, Mat HSV, Mat cameraFeed, String colour, int counter) {\n ArrayList<com.ilos.wiser.ILOSDataCollection.Object> Objects = new ArrayList<>();\n Mat temp = new Mat();\n threshold.copyTo(temp);\n //Contours track the edges of the binary image\n List<MatOfPoint> contours = new ArrayList<>();\n Mat hierarchy = new Mat();\n boolean redFound = false;\n boolean blueFound = false;\n //Copies contours to the list contours\n Imgproc.findContours(temp,contours,hierarchy,Imgproc.RETR_EXTERNAL,Imgproc.CHAIN_APPROX_SIMPLE);\n boolean objectFound = false;\n if (!hierarchy.empty()) {\n for (int i = 0; i >=0; i = (int)hierarchy.get(i, 0)[1]) {\n MatOfPoint contour = contours.get(i);\n Moments moment = Imgproc.moments(contour);\n double area = moment.m00;\n if(area > MIN_AREA) {\n com.ilos.wiser.ILOSDataCollection.Object object = new com.ilos.wiser.ILOSDataCollection.Object(counter);\n //sets fields for the object based on the moment class\n object.setXPos(moment.m10/area);\n object.setYPos(moment.m01/area);\n object.type = theObject.type;\n object.colour = theObject.colour;\n //Tags if each object has been found to track how long it has been off screen for\n if(object.colour == new Scalar(255,0,0)){\n redFound = true;\n }\n if(object.colour == new Scalar(0,255,0)){\n blueFound = true;\n }\n //Appends a list of the object that are seen on the current frame\n Objects.add(object);\n\n objectFound = true;\n\n }else {objectFound = false;}\n }\n if(!redFound){\n if(redStart==1) {\n redStart = System.currentTimeMillis();\n }\n else{\n redEnd = System.currentTimeMillis();\n }\n if(redStart!=1 && redEnd!=0) {\n redGone = redEnd - redStart;\n if(redGone > 300) {\n System.out.println(\"RED OFF SCREEN: \" + redGone);\n }\n redStart = 1;\n redEnd = 0;\n }\n\n }\n if(!blueFound){\n if(blueStart==1) {\n blueStart = System.currentTimeMillis();\n }\n else{\n blueEnd = System.currentTimeMillis();\n }\n if(blueStart!=1 && blueEnd!=0) {\n blueGone = blueEnd - blueStart;\n if(blueGone > 300) {\n System.out.println(\"BLUE OFF SCREEN\" + blueGone);\n }\n blueStart = 1;\n blueEnd = 0;\n }\n }\n if(objectFound == true && collectData) {\n //This does all of the highlighting of the circles on the scren\n drawObject(Objects, mRgba, temp, contours, hierarchy);\n }\n //If collection is finished\n if(!collectData && redList.size()>0 && blueList.size()>0){\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n coordText.setText(\"Press back to select a new path!\");\n }\n });\n }\n }\n }", "public void fuzzify() {\n ImageArray newCopy = currentIm.copy();\n \n int rows= currentIm.getRows();\n int cols= currentIm.getCols();\n \n for(int rr = 1; rr < rows-1; rr++){\n \n for(int cc = 1; cc < cols-1; cc++){\n fuzPixel(rr,cc,newCopy);\n \n }\n \n }\n \n currentIm = newCopy.copy();\n \n \n }", "private static native void bilateralTextureFilter_0(long src_nativeObj, long dst_nativeObj, int fr, int numIter, double sigmaAlpha, double sigmaAvg);", "private void equalize(BufferedImage img) {\n \t\tfloat minSat = Float.MAX_VALUE, maxSat = Float.MIN_VALUE;\n \t\tfloat minVal = Float.MAX_VALUE, maxVal = Float.MIN_VALUE;\n \t\t\n \t\tint[] prgb = { 0, 0, 0 };\n \t\tfloat[] hsv = { 0, 0, 0 };\n \t\t\n \t\tint[] valCount = new int[16];\n \t\t\n \t\tfor (int y = 0; y < img.getHeight(); y++) {\n \t\t\tfor (int x = 0; x < img.getWidth(); x++) {\n \t\t\t\tint pixel = img.getRGB(x, y);\n \t\t\t\tpixelToRGB(pixel, prgb);\n \t\t\t\trgbToHsv(prgb[0], prgb[1], prgb[2], hsv);\n \t\t\t\tminSat = Math.min(hsv[1], minSat);\n \t\t\t\tmaxSat = Math.max(hsv[1], maxSat);\n \t\t\t\tminVal = Math.min(hsv[2], minVal);\n \t\t\t\tmaxVal = Math.max(hsv[2], maxVal);\n \t\t\t\tvalCount[(int) (hsv[2] / 16)]++;\n \t\t\t}\n \t\t}\n \t\t\n \t\tint maxPt = -1;\n \t\tfor (int i = 1; i < 15; i++) {\n \t\t\tif (maxPt == -1 || valCount[i] >= valCount[maxPt]) {\n \t\t\t\tmaxPt = i;\n \t\t\t}\n \t\t}\n \t\t\n \t\tint valueMidpoint = maxPt * 16;\n \t\t\n \t\tSystem.out.println(\"Equalize: sat = \"+minSat+\" to \" +maxSat+\"; val = \" + minVal + \" to \" + maxVal+\"; value midpoint = \" + valueMidpoint);\n \t\tfloat satScale = 1.0f - minSat;\n \t\tfloat valScale = 255 - minVal;\n \t\tfloat satDiff = maxSat - minSat;\n \t\tfloat valDiff = maxVal - minVal;\n \t\t\n \t\tfor (int y = 0; y < img.getHeight(); y++) {\n \t\t\tfor (int x = 0; x < img.getWidth(); x++) {\n \t\t\t\tint pixel = img.getRGB(x, y);\n \t\t\t\tpixelToRGB(pixel, prgb);\n \t\t\t\trgbToHsv(prgb[0], prgb[1], prgb[2], hsv);\n \t\t\t\t\n \t\t\t\tif (satDiff < 0.5)\n \t\t\t\t\thsv[1] = ((hsv[1] - minSat) / satDiff) * satScale + minSat;\n \t\t\t\tif (valDiff < 128)\n \t\t\t\t\thsv[2] = ((hsv[2] - minVal) / valDiff) * valScale + minVal;\n \n \t\t\t\thsvToRgb(hsv[0], hsv[1], hsv[2], prgb);\n \t\t\t\t\n \t\t\t\timg.setRGB(x, y, rgb8ToPixel(prgb) | (pixel & 0xff000000));\n \t\t\t}\n \t\t}\n \t}", "public float update(PImage newFrame) {\n\t\tthresholdBuffer.copy(newFrame, 0, 0, newFrame.width, newFrame.height, 0, 0, thresholdBuffer.width, thresholdBuffer.height);\n\n\t\t// run threshold filter\n\t\tThresholdFilter.instance().setCutoff(cutoff);\n\t\tThresholdFilter.instance().applyTo(thresholdBuffer);\n\t\t\n\t\t// analyze diff pixels\n\t\tfloat numPixels = thresholdBuffer.width * thresholdBuffer.height;\n\t\tfloat whitePixels = 0;\n\t\tthresholdBuffer.loadPixels();\n\t\tfor (int x = 0; x < thresholdBuffer.width; x++) {\n\t\t\tfor (int y = 0; y < thresholdBuffer.height; y++) {\n\t\t\t\tint pixelColor = ImageUtil.getPixelColor(thresholdBuffer, x, y);\n\t\t\t\tfloat r = ColorUtil.redFromColorInt(pixelColor) / 255f;\n\t\t\t\tif(r > 0.5f) whitePixels += r;\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t// update float buffer\n\t\tthresholdCalc.update(whitePixels / numPixels);\n\t\treturn thresholdCalc.average();\n\t}", "public void unaverage() {\n\t\tif (!averaged)\n\t\t\tthrow new AssertionError(\"can't unaverage twice!!\");\n\t\t\n\t\tfor (int i = 0; i < w.length; i++)\n\t\t\tw[i] = (w[i] + wupdates[i])/(t+1.0);\n\t\t\n\t\tscale = 1.0;\n\t\taveraged = false;\n\t}", "public void filter(Mat image){\n\n int totalBytes = (int)(image.total() * image.elemSize()); // Number of bytes in the image\n byte[] buffer = new byte[totalBytes];\n image.get(0,0,buffer); // Copy the matrix contents in byte array buffer\n for (int i=0; i<totalBytes; i++){\n if (i%3==0) // Refers to the blue channel\n buffer[i] = 0;\n }\n image.put(0,0,buffer); // Copy the byte array to native storage\n }", "private static void applyOperation(ImageProcessor input, ImageProcessor output, StructureElement structureElement,\r\n\t\t\t\t\t\t\t\t\t Type type) {\r\n\t\tint thresholdInclusive = -1;\r\n\t\tif (type == Type.ERODE) {\r\n\t\t\tint sum = 0;\r\n\t\t\tfor (int x = 0; x < structureElement.getWidth(); x++) {\r\n\t\t\t\tfor (int y = 0; y < structureElement.getHeight(); y++) {\r\n\t\t\t\t\tif (structureElement.get(x, y)) {\r\n\t\t\t\t\t\tsum++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthresholdInclusive = sum;\r\n\t\t\t}\r\n\t\t} else if (type == Type.DILATE) {\r\n\t\t\tthresholdInclusive = 1;\r\n\t\t} else {\r\n\t\t\tthrow new RuntimeException(\"Unknown type: \" + type);\r\n\t\t}\r\n\r\n\t\tint maxX = input.getWidth() - structureElement.getWidth();// off by 1?\r\n\t\tint maxY = input.getHeight() - structureElement.getHeight();// off by 1?\r\n\r\n\t\tfor (int x = 0; x < input.getWidth(); x++) {\r\n\t\t\tfor (int y = 0; y < input.getHeight(); y++) {\r\n\t\t\t\toutput.set(x, y, BLACK);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (int x = 0; x < maxX; x++) {\r\n\t\t\tfor (int y = 0; y < maxY; y++) {\r\n\t\t\t\tint sum = 0;\r\n\t\t\t\tfor (int i = 0; i < structureElement.getWidth(); i++) {\r\n\t\t\t\t\tfor (int j = 0; j < structureElement.getHeight(); j++) {\r\n\t\t\t\t\t\tboolean set = (input.getPixel(x + i, y + j) > 127) && structureElement.get(i, j);\r\n\t\t\t\t\t\tif (set) {\r\n\t\t\t\t\t\t\tsum++;\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\tint newValue = (sum >= thresholdInclusive) ? WHITE : BLACK;\r\n\t\t\t\toutput.putPixel(x + structureElement.anchorX, y + structureElement.anchorY, newValue);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static double findAndRemoveMean( double[] inArray ) {\r\n if ((inArray == null) || (inArray.length == 0)) {\r\n return Double.MIN_VALUE;\r\n }\r\n double meanToZero;\r\n ArrayStats arrmean = new ArrayStats( inArray );\r\n meanToZero = arrmean.getMean();\r\n ArrayOps.removeValue(inArray, meanToZero);\r\n return meanToZero;\r\n }", "public static < T extends RealType< T > > boolean averageAllChannels( final Image< T > target, final int[] offset, final ImagePlus imp, final int timepoint )\n\t{\n\t\tfinal int numChannels = imp.getNChannels();\n\t\t\n\t\tif ( imp.getType() == ImagePlus.GRAY8 )\n\t\t{\n\t\t\tfinal ArrayList< Image< UnsignedByteType > > images = new ArrayList<Image<UnsignedByteType>>();\n\n\t\t\t// first get wrapped instances of all channels\n\t\t\tfor ( int c = 1; c <= numChannels; ++c )\n\t\t\t\timages.add( getWrappedImageUnsignedByte( imp, c, timepoint ) );\t\t\t\n\n\t\t\taverageAllChannels( target, images, offset );\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\telse if ( imp.getType() == ImagePlus.GRAY16 )\n\t\t{\n\t\t\tfinal ArrayList< Image< UnsignedShortType > > images = new ArrayList<Image<UnsignedShortType>>();\n\n\t\t\t// first get wrapped instances of all channels\n\t\t\tfor ( int c = 1; c <= numChannels; ++c )\n\t\t\t\timages.add( getWrappedImageUnsignedShort( imp, c, timepoint ) );\t\t\t\n\n\t\t\taverageAllChannels( target, images, offset );\n\t\t\treturn true;\n\t\t}\n\t\telse if ( imp.getType() == ImagePlus.GRAY32 )\n\t\t{\n\t\t\tfinal ArrayList< Image< FloatType > > images = new ArrayList<Image<FloatType>>();\n\n\t\t\t// first get wrapped instances of all channels\n\t\t\tfor ( int c = 1; c <= numChannels; ++c )\n\t\t\t\timages.add( getWrappedImageFloat( imp, c, timepoint ) );\n\t\t\t\n\t\t\taverageAllChannels( target, images, offset );\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tLog.error( \"Unknow image type: \" + imp.getType() );\n\t\t\treturn false;\n\t\t}\n\t}", "private Mat segmentRedColor(Mat bgr) {\n Mat mask1 = new Mat();\n Mat mask2 = new Mat();\n Mat normal = new Mat();\n Mat hsv = new Mat();\n Imgproc.cvtColor(bgr, hsv, Imgproc.COLOR_BGR2HSV, 3);\n inRange(hsv, new Scalar(0, 120, 50), new Scalar(MAX_COLOR_CHANNEL_OFFSET, 255, 255), mask1);\n inRange(hsv, new Scalar(170, 120, 50), new Scalar(180, 255, 255), mask2);\n Core.bitwise_or(mask1, mask2, normal);\n return mask1;\n }", "AveragingFilter(Sensor sensor, int samples) {\n\tsuper(sensor, samples);\n }", "void example8() {\n\n\t\t// setup some data\n\t\t\n\t\tIndexedDataSource<Float64Member> list = ArrayStorage.allocate(G.DBL.construct(), 9);\n\t\t\n\t\t// fill it with random values\n\t\t\n\t\tFill.compute(G.DBL, G.DBL.random(), list);\n\t\t\n\t\t// build a mask\n\t\t\n\t\tIndexedDataSource<BooleanMember> mask =\n\t\t\t\tnom.bdezonia.zorbage.storage.Storage.allocate(\n\t\t\t\t\t\tG.BOOL.construct(), \n\t\t\t\t\t\tnew boolean[] {true, false, false, true, false, false, true, true, true});\n\t\t\n\t\t// make the filter\n\t\t\n\t\tIndexedDataSource<Float64Member> maskedData = new MaskedDataSource<>(list, mask);\n\t\t\n\t\t// do some computations\n\t\t\n\t\tmaskedData.size(); // equals 5\n\t\t\n\t\t// 3rd value in the masked data = the 7th value of the original list\n\t\t\n\t\tFloat64Member value = G.DBL.construct();\n\t\t\n\t\tmaskedData.get(3, value);\n\t\t\n\t\t// compute a value on data only where the mask is true in the original dataset\n\t\t\n\t\tMean.compute(G.DBL, maskedData, value);\n\t}", "@Override\r\n public synchronized void onFilteredAccelerometerValuesChange(float[] filteredValues, float[] rotatedValues) {\r\n getPeakValue(rotatedValues[indexOfInterest]);\r\n\r\n if (event.isOngoing()) { //check for event status\r\n evaluate(indexOfInterest);\r\n } else {\r\n interrupt();\r\n }\r\n }", "public static void main(String[] args) {\n PixelateFilter pixelateFilter = new PixelateFilter(new File(args[0]), new File(args[1]), Integer.parseInt(args[2]));\n pixelateFilter.export(new File(args[1]));\n }", "int computePartial(\n int[][] pixelV);", "@Override\n public double[] find(BufferedImage image, boolean debug) throws IOException {\n\n ListDisplayPanel panel = debug ? new ListDisplayPanel() : null;\n\n List<Shape> shapes = ImageProcessingPipeline.fromBufferedImage(image, panel)\n .gray()\n .medianBlur(3) // this is fairly critical\n .edges()\n .dilate()\n .contours()\n .polygons(0.05, 0.05)\n .getExternalShapes();\n\n int expectedWidth = 40 * 3; // 40mm\n int expectedHeight = 20 * 3; // 20mm\n int tolerancePct = 40;\n List<Shape> filtered = GeometryUtils.filterByArea(shapes, expectedWidth, expectedHeight, tolerancePct);\n List<Shape> nonOverlapping = GeometryUtils.filterNonOverlappingBoundingBoxes(filtered);\n\n if (debug) {\n System.out.println(shapes);\n System.out.println(filtered);\n System.out.println(nonOverlapping);\n ShowImages.showWindow(panel, \"Binary Operations\", true);\n }\n return new double[] { nonOverlapping.size() % 3 }; // just return as an int mod 3\n }", "private void setAverageColor(int x, int y, int n) {\n\t\tint[] avgValues = this.getAveragedValsOfSquare(x, y, n);\n\n\t\tfor (int i = x; i < (x+n); i++) {\n\t\t\tfor (int j = y; j < (y+n); j++) {\n\t\t\t\t// check for the border\n\t\t\t\tif (i < this.getPictureWidth() && j < this.getPictureHeight()) {\n\t\t\t\t\tthis.canvas.setPixelColor(i, j, avgValues[0],avgValues[1],avgValues[2]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t}", "int[][][] blurImage(int[][][] imageArray, int height, int width);", "public void updateSMA(){\n audioInput.read(audioBuffer, 0, bufferSize);\n Complex [] FFTarr = doFFT(shortToDouble(audioBuffer));\n FFTarr = bandPassFilter(FFTarr);\n double sum = 0;\n for(int i = 0; i<FFTarr.length;i++){\n sum+=Math.abs(FFTarr[i].re()); // take the absolute value of the FFT raw value\n }\n double bandPassAverage = sum/FFTarr.length;\n Log.d(LOGTAG, \"bandPassAverage: \" + bandPassAverage);\n\n //Cut out loud samples, otherwise compute rolling average as usual\n if(bandPassAverage>THROW_OUT_THRESHOLD){\n mySMA.compute(mySMA.currentAverage());\n }else {\n mySMA.compute(bandPassAverage);\n }\n }", "static int filter(int distance) {\n if (distance >= MAX_SENSOR_DIST && invalidSampleCount < INVALID_SAMPLE_LIMIT) {\n // bad value, increment the filter value and return the distance remembered from before\n invalidSampleCount++;\n return prevDistance;\n } else {\n if (distance < MAX_SENSOR_DIST) {\n invalidSampleCount = 0; // reset filter and remember the input distance.\n }\n prevDistance = distance;\n return distance;\n }\n }", "public void setFilterIntensity(float value) {\n if(mNativeAddress != 0)\n nativeSetFilterIntensity(mNativeAddress, value);\n }", "public int[] getUniquePixelValues() {\r\n\tint imageLength = originalRGB.length;\r\n\tif (imageLength==0){\r\n\t\treturn null;\r\n\t}\r\n\t\r\n\tint pixelValueArray[] = new int[1];\r\n\tpixelValueArray[0] = originalRGB[0];\r\n\r\n\tfor (int i=0;i<imageLength;i++){\r\n\t\tint currPixel = originalRGB[i];\r\n\r\n\t\t//\r\n\t\t// look for current pixel in list\r\n\t\t//\r\n\t\tboolean found = false;\r\n\t\tfor (int j=0;j<pixelValueArray.length;j++){\r\n\t\t\tif (pixelValueArray[j]==currPixel){\r\n\t\t\t\tfound = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//\r\n\t\t// if current pixel not found, extend list and add pixel to end\r\n\t\t//\r\n\t\tif (!found){\r\n\t\t\tint newArray[] = new int[pixelValueArray.length+1];\r\n\t\t\tfor (int j=0;j<pixelValueArray.length;j++){\r\n\t\t\t\tnewArray[j] = pixelValueArray[j];\r\n\t\t\t}\r\n\t\t\tnewArray[pixelValueArray.length] = currPixel;\r\n\t\t\tpixelValueArray = newArray;\r\n\t\t}\r\n\t}\r\n\treturn pixelValueArray;\r\n}" ]
[ "0.6343062", "0.6096489", "0.60949755", "0.6035945", "0.60337144", "0.59873503", "0.5963015", "0.5929465", "0.584168", "0.58130974", "0.57554793", "0.57162666", "0.57089835", "0.5671828", "0.5662621", "0.56499", "0.56494635", "0.56124467", "0.553768", "0.5537501", "0.5537174", "0.5412097", "0.5382641", "0.53773564", "0.5366269", "0.5359512", "0.53447175", "0.532714", "0.5325222", "0.53120494", "0.5289931", "0.5282389", "0.52715224", "0.5268484", "0.52624655", "0.52377176", "0.52041125", "0.5183338", "0.51735455", "0.5162533", "0.5159252", "0.5154443", "0.5135497", "0.513236", "0.5125998", "0.51085985", "0.50925016", "0.5064356", "0.50637513", "0.5060591", "0.50308245", "0.5022322", "0.50180024", "0.5012589", "0.50056136", "0.50047815", "0.49971682", "0.49811864", "0.49726316", "0.4970725", "0.49701253", "0.49692044", "0.49612752", "0.49559084", "0.49525926", "0.4952566", "0.49448663", "0.49389654", "0.4937551", "0.49281108", "0.49203414", "0.4916757", "0.49042696", "0.49041545", "0.48978522", "0.48897797", "0.4882749", "0.48812807", "0.48769322", "0.48728114", "0.48717344", "0.48709646", "0.48685548", "0.48651594", "0.4864197", "0.48587835", "0.48405263", "0.48387557", "0.48360893", "0.48313916", "0.48210934", "0.48146266", "0.4811349", "0.48061478", "0.48034889", "0.47971842", "0.4796424", "0.47901252", "0.4785753", "0.477698", "0.47767597" ]
0.0
-1
average at point i,j
public static Integer pointAverage(int i, int j, Integer[][] matrix) { assert(i > 0 && i < matrix.length && j > 0 && j < matrix[0].length); int sum = 0; for (int k = -1; k < 2; k++) { for (int l = -1; l < 2; l++) { sum += matrix[i + k][j + l]; } } return (Integer)(int)Math.round((double)sum / 9); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int getAverage(int i, int j, int[][] image)\r\n\t{\n int[][] directions={{0,-1},{0,1},{1,0},{-1,0},{1,-1}, {1,1}, {-1,-1}, {-1,1}};\r\n\t\tint sum = image[i][j];\r\n\t\tint average = 0;\r\n\t\tint noOfElements = 1;\r\n\t\t\r\n\t\tfor(int[] dir : directions)\r\n\t\t{\r\n\t\t\tint x = i + dir[0];\r\n\t\t\tint y = j + dir[1];\r\n\t\t\t\r\n\t\t\tif(x >= 0 && y >= 0 && x < image.length && y < image[0].length)\r\n\t\t\t{\r\n\t\t\t\tsum += image[x][y];\r\n\t\t\t\tnoOfElements++;\r\n\t\t\t}\r\n\t\t}\r\n\t\taverage = sum / noOfElements;\r\n\t\treturn average;\r\n\t}", "double average();", "public double average(){\r\n\t\t//create variable to hold the values\r\n\t\tdouble average = 0;\r\n\t\t\r\n\t\tfor (int i = 0; i < this.data.length; i++){\r\n\t\t\t//add current index\r\n\t\t\taverage += this.data[i];\r\n\t\t\t}\r\n\t\treturn (average/this.data.length);\r\n\t}", "double avg(){\n\t\tdouble sum = 0.0;\n\t\tfor(int i=0;i<num.length;i++)\n\t\t\tsum+=num[i].doubleValue();\n\t\treturn sum/num.length;\n\t}", "public double average(){\n double avg = 0;\n double sum = 0;\n for (T t : arr) {\n // sum += t.doubleValue();\n }\n\n return sum / arr.length;\n }", "public Double computeAverage(){\n\t\tdouble total = 0; //double used to keep total value of elements in arr to determine average\n\t\t\n\t\tfor(int i = 0; i < arr.length; i++)//loop through array and add the total\n\t\t{\n\t\t\ttotal += arr[i].doubleValue(); //add current value of element in arr to total's value\n\t\t}\n\t\t\n\t\tDouble result = total/arr.length; //returns the average as a Double\n\t\t\n\t\treturn result;\n\t}", "private double calcAverage(int startIndex, int endIndex) {\n\t\t\n\t\t// total for the scores\n\t\tdouble total = 0;\n\t\t\n\t\t// loop between indexes and add the scores\n\t\tfor (int i = startIndex; i < endIndex; i++) \n\t\t\ttotal += scores.get(i);\n\t\t\n\t\t// return the average\n\t\treturn total / (endIndex - startIndex);\n\t}", "public float getAverageBetweenPoint(){\n return getMetric()/list.size();\n }", "public static double Average(int[][] matrix){\n double total = 0;\n double promedio =0;\n double divisor = 0;\n \n for(int i=0; i<matrix.length; i++){\n for (int j=0;j<matrix[i].length;j++ ) {\n \n total += matrix[i][j];\n } \n divisor = matrix[i].length * matrix.length; \n promedio = total / divisor; \n }\n \n return promedio;\n }", "@Override\n\tpublic int avg() {\n\t\treturn (this.sum()/3);\n\t}", "public double average(int first, int last){\n double final = 0;\n for(int i = first; i < last; i++){\n final += scores[i];\n }\n return final/(last-first+1);\n}", "public double mean()\n {\n double sum = 0.0;\n for(int t = 0; t<size; t++)\n sum += x[t];\n return sum/size;\n }", "public void findAvg()\n {\n for(int i = 0; i <= scores.length-1; i++)\n {\n for (int j = 0; j <= scores[0].length-1; j++)\n {\n total += scores[i][j];\n }\n }\n System.out.println(\"The class average test score is \" + \n total/24 + \".\");\n }", "double average() { // used double b/c I want decimal places\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tsum = sum + array[i];\n\t\t}\n\t\tdouble average = (double) sum / array.length;\n\t\treturn average;\n\n\t}", "public static int[][] average(int[][] pixels){\r\n\t\t\t\r\n\t\t\tint height = pixels.length;\r\n\t\t\tint width = pixels[0].length;\r\n\t\t\t\r\n\t\t\t//Apply Average Filter\r\n\t for (int v = 1; v < height; v++) {\r\n\t for (int u = 1; u < width; u++) {\r\n\t \r\n\t int sum = 0;\r\n\t for (int j = -1; j <=1; j++) {\r\n\t for (int i = -1; i <= 1; i++) {\r\n\t if((u + (j) >= 0 && v + (i) >= 0 && u+(j) < width && v + (i) < height)){\r\n\t \tint p = pixels[v+(i)][u+(j)];\r\n\t \tsum = sum + p;\r\n\t }\r\n\t }\r\n\t }\r\n\r\n\t int q = (int) (sum /9);\r\n\t aResult[v][u] = q;\r\n\t }\r\n\t }\r\n\t return aResult;\r\n\t\t}", "@Override\n public Double average() {\n return (sum() / (double) count());\n }", "static double calculateAverage(int[] array) {\n\n double sum = 0;\n\n for (int i = 0; i < array.length; i++) {\n\n sum = sum + (double) array[i];\n\n\n }\n\n return sum / array.length;//returning average\n\n }", "public double getAverage(){\n double total = 0;\n for(double s : scores)total += s;\n return total/scores.length;\n }", "public int average()\n {\n int average = 0;\n int sum = 0;\n\n for ( int index = 0; index < data.length; index++ )\n {\n sum = sum + data[index];\n }\n average = sum / data.length;\n\n return average;\n }", "public double calcAvg() {\n\t\treturn (double)calcSum() / data.size();\n }", "public double getAverage()\n {\n return getSum() / 2.0;\n }", "public double arithmeticalMean(double[] arr) {\n return 0;\n }", "double average(double[] doubles) {\n double total = 0.0;\n //int count = 0;\n for (double d: doubles) {\n total = total + d;\n //count = count + 1;\n }\n //return total / count;\n return total / doubles.length;\n }", "public double getAvg(){\n double avg=0;\n for(int x=0; x<max; x++){\n avg=avg+times[x];\n }\n avg=avg/max;\n return avg;\n }", "public void getAvg()\n {\n this.avg = sum/intData.length;\n }", "public double getAverage(){\n return getTotal()/array.length;\n }", "public static int average(int[]data){\n \n int sum = 0;\n int n = 0;\n for(int i = 0; i < data.length-1; i++) {\n \n n++;\n sum += data[i];\n }\n\n return sum/n;\n }", "public double getAverage(){\r\n\t\tdouble sum=0;\r\n\t\tfor(Iterator<T> it=this.iterator();it.hasNext();){\r\n\t\t\tsum+=it.next().doubleValue();\r\n\t\t}\r\n\t\treturn sum/this.size();\r\n\t}", "float average(int[] input) {\n\t\tfloat average = 0;\n\t\tint sum = 0;\n\t\tfor (int index = 0; index < input.length; index++) {\t\t//loop to get sum of numbers\n\t\t\tsum = sum + input[index];\n\t\t}\n\t\taverage = (float) sum / (input.length);\t\t//average calculation\n\t\treturn average;\n\t}", "static double average(double[] data){\n\n // Initializing total placeholder \n double total = 0;\n\n // Traversing data array and adding to total sum\n for (double d : data) {\n total += d;\n }\n\n // Computing average\n double average = (double) total / data.length;\n\n return average;\n }", "public static double findMean(ArrayList<Integer> arr) {\n\t\tint length = arr.size();\n\t\tint sum = 0;\n\t\tfor(int i : arr) { sum += i; }\n\t\treturn (double)sum/length;\n\t}", "public static double getAverage(int[][] numbers) {\n int totalNumberOfElements = 10; // (2 rows * 5 column)\n return getTotal(numbers) / totalNumberOfElements;\n }", "@Override\n public double findAverage() {\n double average = 0;\n for (Student key : map.keySet()) {\n average += map.get(key).getValue();\n }\n average /= map.keySet().size();\n return average;\n }", "public static double average(ArrayList<Double> nums){\n double sum = 0.0;\n for(Double num : nums){\n sum += num;\n }\n return sum / nums.size();\n }", "public void calcAvg(){\n\t\taverage = hits/atbat;\n\t\t\n\t}", "public int average() {\n int total = 0;\n\n for (int score : scores) {\n total += score;\n }\n\n return total / scores.length;\n }", "public double average() {\n return average(0.0);\n }", "public static double getAverage(int arr[][], int row) {\t// 算陣列所有數平均值\n\t\t/* Overloading Method */\n\t\tint sum = 0, count = 0;\n\t\tdouble result;\n\t\t\t\n\t\t\tfor (int j = 0; j < arr[row].length; j++) {\n\t\t\t\tsum += arr[row][j];\n\t\t\t\tcount++;\n\t\t\t}\n\t\tresult = (double) sum / count;\n\t\treturn result;\n\t}", "public static Double[][] operationAvgPooling(Double[][] matrix, int w, int h) {\n int i, j;\n Double[][] output = new Double[i = matrix.length - h + 1][j = matrix[0].length - w + 1];\n for (int y = 0; y < i; y = y + 1) {\n for (int x = 0; x < j; x = x + 1) {\n double avg = 0;\n for (int yy = 0; yy < h; yy++) {\n for (int xx = 0; xx < w; xx++) {\n double l = matrix[y + yy][x + xx];\n avg += l;\n }\n }\n output[y][x] = avg / (h * w);\n }\n }\n return output;\n }", "public double getAverage(){\n int total = 0; //inicializa o total\n \n //soma notas de um aluno\n for(int grade: grades){\n total += grade;\n }\n \n return (double) total/grades.length;\n }", "public static void main(String[] args) {\nint[][] array= {{95,86},{83,92,96},{78,83,93,87,88}};\nint sum = 0;\ndouble avg = 0.0;\nint avgnum =0;\n\nfor(int i=0; i<array.length; i++ ) {\n\tfor(int k=0; k<array[i].length; k++) {\n\t\tsum += array[i][k];\n \t\t\t\t\n\t}\n\tavgnum += array[i].length;\n}\nSystem.out.println(\"array �迭�� �� ���� \" + sum);\navg = (double) sum/ avgnum;\nSystem.out.println(\"array �迭�� ��� ���� \" + avg);\n\t}", "private Color averageAround(RenderedImage i, double px, double py) {\n\t\t// Get an iterator for the image.\n\t\tRandomIter iterator = RandomIterFactory.create(i, null);\n\t\t// Get memory for a pixel and for the accumulator.\n\t\tdouble[] pixel = new double[3];\n\t\tdouble[] accum = new double[3];\n\t\t// The size of the sampling area.\n\t\tint sampleSize = 10;\n\t\tint numPixels = 0;\n\t\t// Sample the pixels.\n\t\tfor (double x = px * baseSize - sampleSize; x < px * baseSize\n\t\t\t\t+ sampleSize; x++) {\n\t\t\tfor (double y = py * baseSize - sampleSize; y < py * baseSize\n\t\t\t\t\t+ sampleSize; y++) {\n\t\t\t\titerator.getPixel((int) x, (int) y, pixel);\n\t\t\t\taccum[0] += pixel[0];\n\t\t\t\taccum[1] += pixel[1];\n\t\t\t\taccum[2] += pixel[2];\n\t\t\t\tnumPixels++;\n\t\t\t}\n\t\t}\n\t\t// Average the accumulated values.\n\t\taccum[0] /= numPixels;\n\t\taccum[1] /= numPixels;\n\t\taccum[2] /= numPixels;\n\t\treturn new Color((int) accum[0], (int) accum[1], (int) accum[2]);\n\t}", "public static double getAverage(double[][] array)\r\n\t{\r\n\t\tint count = 0;\r\n\t\tList<Double> lineSumList = new ArrayList<Double>();\r\n\t\tfor( int i = 0; i < array.length; i++ ) {\r\n\t\t\tdouble lineSum = Σ(array[i]);\r\n\t\t\tlineSumList.add(lineSum);\r\n\t\t\tcount += array[i].length;\r\n\t\t}\r\n\t\tdouble sum = Σ(lineSumList);\r\n\t\t\r\n\t\tif (sum == 0 || array.length == 0)\r\n\t\t\treturn 0;\r\n\t\treturn sum / count;\r\n\t}", "public double average() {\n double average = 0;\n for (int i = 0; i < studentList.size(); i++) {\n Student student = studentList.get(i);\n average += student.average();\n }\n average /= studentList.size();\n return average;\n }", "public static Double[][] operationAvgPooling(Double[][] matrix, int w, int h, int s) {\n if (s < 1) s = 1;\n int fSizeY = matrix.length;\n int kSizeY = h;\n int fSizeX = matrix[0].length;\n int kSizeX = w;\n int p = 0;\n int i, j;\n Double[][] output = new Double[i = ((matrix.length - h) / s) + 1][j = ((matrix[0].length - w) / s) + 1];\n for (int y = 0; y < i; y = y + 1) {\n for (int x = 0; x < j; x = x + 1) {\n double avg = 0;\n for (int yy = 0; yy < h; yy++) {\n for (int xx = 0; xx < w; xx++) {\n double l = matrix[y + yy][x + xx];\n avg += l;\n }\n }\n output[y][x] = avg / (h * w);\n }\n }\n return output;\n }", "public static double getAverage(int start, double[] d) {\n double average = 0;\n for (int i = 0; i < 110; i++) {\n average = average + d[i];\n }\n return average / 110;\n }", "public double average()\n\t{\n\t\tif (arraySize > 0)\n\t\t{\n\t\t\tdouble sum = this.sum();\n\t\t\treturn sum / arraySize;\n\t\t}\n\t\tSystem.out.println(\"Syntax error, array is empty.\");\n\t\treturn -1;\n\t}", "public static double average(int[] arr)\n {\n // your code goes here\n\t\tdouble sum =0;\n int i;\n for(i=0;i< arr.length;i++)\n {\n sum+=arr[i];\n }\n\t\t\n\t\treturn sum/arr.length; \n\t}", "public void parseAverages(){\r\n\t\tfor(int i = 1; i < x.size(); i++){\r\n\t\t\tdouble avg = (x.get(i) + x.get(i-1)) / 2;\r\n\t\t\tx.set(i, avg);\r\n\t\t}\r\n\t}", "@Override\n\tpublic double avg() {\n\t\treturn total()/4.0;\n\t}", "static double averageDoubleArray(double[] inputArray) {\n\t\tdouble doubleSum = 00.00;\n\t\tfor (double element : inputArray) { \n\t\t\tdoubleSum += element;\n\t\t}\n\t\tdouble average = doubleSum / inputArray.length; \n\t\treturn average;\n\t}", "public Integer average(int[] arr3){\n\t\tSystem.out.println(\"Get Average\");\n\t\tint sum = 0;\n\t\tfor(int d = 0; d < arr3.length; d++){\n\t\t\tsum += arr3[d];\n\t\t}\n\t\tSystem.out.println(sum/arr3.length);\n\t\treturn 0;\n\t}", "private static int getAverage(ArrayList<Integer> inList) \n\t{\n\t\tint add = 0; \n\t\tint mean = 0; \n\t\tfor(int pos = 0; pos < inList.size(); ++pos)\n\t\t{\n\t\t\tadd = add + inList.get(pos);\n\t\t\t\n\t\t}\n\t\t\n\t\tmean = add/inList.size(); \n\t\t\n\t\treturn mean; \n\t\t\n\t}", "public double findmaxavg(int[] nums, int k){\r\n\t\tdouble res = Integer.MIN_VALUE;\r\n\t\tfor (int s = 0; s < nums.length -k + 1; s++) {\r\n\t\t\tdouble sum = 0;\r\n\t\t\tfor (int i = 0; i < k; i++) {\r\n\t\t\t\tsum+=nums[i+s];\r\n\t\t\t}\r\n\t\t\tres = Math.max(res, sum/k);\r\n\t\t}\r\n\t\treturn res;\t\t\r\n\t//Time complexity : O(n*k). \r\n\t//Space complexity : O(1).\r\n\t\r\n\t\t\r\n\t\t\r\n\r\n\t}", "public static double m(int i){\n double sum = 0;\n for (int j = 1; j <= i; j++)\n sum += j / (j + 1.0);\n return sum;\n }", "public void findAverage(int[] arr){\n int sum = 0;\n for(int val : arr){\n sum += val;\n }\n System.out.println( \"Average: \" + sum / arr.length);\n }", "public void average(TreeNode t, int i , List<Double> sum, List<Integer> count){\n\t\tif(t == null)\n\t\t\treturn;\n\t\t\n\t\tif(i < sum.size()){\n\t\t\tsum.set(i, sum.get(i)+t.data);\n\t\t\tcount.set(i, count.get(i)+1);\n\t\t}else{\n\t\t\tsum.add(1.0 * t.data);\n\t\t\tcount.add(1);\n\t\t}\n\t\t\n\t\taverage(t.left, i+1, sum, count);\n\t\taverage(t.right, i+1, sum, count);\n\t}", "public void average() {\n\t\tif (averaged)\n\t\t\tthrow new AssertionError(\"can't average twice!!\");\n\t\t\n\t\tscale = 1.0/(double)t;\n\t\t\n\t\tfor (int i = 0; i < w.length; i++)\n\t\t\tw[i] = (t+1.0)*w[i] - wupdates[i];\n\t\t\n\t\taveraged = true;\n\t\n\t}", "public double getMeanValuePixels() {\n\t\tdouble avg = 0;\n\n\t\tfor (int i = 0; i < width; i++) {\n\t\t\tfor (int j = 0; j < height; j++) {\n\t\t\t\tavg += this.image[i][j];\n\t\t\t}\n\t\t}\n\t\tavg /= this.getQtyPixels();\n\n\t\treturn avg;\n\t}", "public double area() {\n double sum = 0.0;\n for (int i = 0; i < N; i++) {\n sum = sum + (a[i].x * a[i+1].y) - (a[i].y * a[i+1].x);\n }\n return 0.5 * sum;\n }", "public static void main(String[] args) {\n\n float d = (float)sum(3.0f, (float)2.0);\n System.out.println(d);\n\n double d2=avg(3.0,2.0);\n System.out.println(d2);\n//\n// int[] list={1,2};\n// list={2,3};\n\n\n\n }", "private static Vector3f average(Vector3f a, Vector3f b) {\r\n\t\treturn new Vector3f(a.x + (b.x - a.x) / 2, a.y + (b.y - a.y) / 2, a.z + (b.z - a.z) / 2);\r\n\t}", "public double mean() {\n double resultat = 0;\n for (int i = 0; i < tab.size(); i++) {\n for (int j = 0; j < tab.get(i).size(); j++) {\n resultat += Double.parseDouble(tab.get(i).get(j));\n }\n }\n resultat = (resultat / (tab.size() + tab.get(0).size() - 1));\n System.out.println(\"Mean colonne:\" + resultat);\n return resultat;\n }", "public static double mean(double[][] mat) { \n int counter = 0;\n double total = 0;\n for (int row = 0; row < mat.length; row++){\n for (int column = 0; column < mat[0].length; column++){\n total += mat[row][column];\n }\n }\n return total/counter;\n }", "public static double average (double ... numbers)\r\n\t{", "public double averageOfArray() {\n double sum = 0;\n double average = 0;\n int i;\n for (i = 0; i < sirDeLa1La100.length; i++) {\n sum = sum + sirDeLa1La100[i];\n }\n average = sum / sirDeLa1La100.length;\n return average;\n }", "public double pesoArista(int i, int j) {\n ListaConPI<Adyacente> l = elArray[i];\n for (l.inicio(); !l.esFin(); l.siguiente())\n if (l.recuperar().getDestino() == j) \n return l.recuperar().getPeso();\n return 0.0;\n }", "public static double averagePPG(int[][] scores, int p)\n {\n \n int row = p; \n double total = 0; \n \n //the column index changes, but the row index stays the same\n for(int col = 0; col < scores[row].length; col++)\n {\n total = total + scores[row][col]; \n }\n \n double average = (total / scores[row].length); //average the total for that row (player)\n return average;\n \n }", "public static double average(double[] array){\n double sum = 0;\n for (int i = 0; i < array.length; i++) {\n sum += array[i];\n }\n return sum/array.length;\n }", "abstract Double getWeight(int i, int j);", "public native MagickImage averageImages() throws MagickException;", "public static Integer[][] averager(Integer[][] matrixIn) {\n\t\tInteger[][] extendedMatrixInteger = expandMatrix(matrixIn);\n\t\tInteger[][] resultIntegers = new Integer[matrixIn.length][matrixIn[0].length];\n\t\tfor (int i = 0; i < resultIntegers.length; i++) {\n\t\t\tfor (int j = 0; j < resultIntegers[0].length; j++) {\n\t\t\t\tresultIntegers[i][j] = pointAverage(i + 1, j + 1, extendedMatrixInteger);\n\t\t\t}\n\t\t}\n\t\treturn resultIntegers;\n\t}", "public double mean(double data[]) {\r\n\t\tdouble mean = 0;\r\n\t\ttry {\r\n\t\t\tfor(int i=0;i<data.length;i++) {\r\n\t\t\t\tmean =mean+data[i];\r\n\t\t\t}\r\n\t\t\tmean = mean / data.length;\r\n\t\t}\r\n\t\tcatch(Exception e) {\r\n\t\t\tDataMaster.logger.warning(e.toString());\r\n\t\t\t//e.printStackTrace();\r\n\t\t}\r\n\t\treturn mean;\r\n\t}", "public static double avg(int[] arr) {\n double sum = 0.0;\n for (int a : arr) sum += a;\n return sum / arr.length;\n }", "public void calculateAverage() {\n\n if (turn == 1) {\n p1.setTotalScore(p1.getTotalScore() + turnScore);\n\n p1.setTotalDarts(p1.getTotalDarts() + 1);\n\n float p1Average = p1.getTotalScore() / p1.getTotalDarts();\n p1.setAverage(p1Average);\n\n } else if (turn == 2) {\n p2.setTotalDarts(p2.getTotalDarts() + 1);\n p2.setTotalScore(p2.getTotalScore() + turnScore);\n\n float p2Average = p2.getTotalScore() / p2.getTotalDarts();\n p2.setAverage(p2Average);\n }\n\n\n }", "public static int average(int[] array){\n int sum = 0;\n for (int i = 0; i < array.length; i++) {\n sum += array[i];\n }\n return sum/array.length;\n }", "public void updateToAverageOf(Vector<DataPoint> objects) { \t\n double[] average = new double[values.length];\n for (int i = 0; i < objects.size(); i++) {\n \t//POEY comment: position is a calculated value of a pixel\n Position position = objects.elementAt(i).position;\n for (int j = 0; j < average.length; j++) {\n average[j] += position.values[j];\n }\n }\n for (int i = 0; i < average.length; i++) {\n \t//POEY comment: objects.size() = the number of members in a cluster\n average[i] /= objects.size();\n }\n values = average;\n }", "public static double avg(double[] array) {\r\n\t\tdouble ret = sum(array);\r\n\t\treturn ret / array.length;\r\n\t}", "private double average(LinkedList<Double> lastSums2) {\n\t\tOptionalDouble average = lastSums2.stream().mapToDouble(a -> a).average();\n\t\treturn average.getAsDouble();\n\t}", "public static double getAveg(int[] scores) {\r\n\t\r\n\t\tint sum = 0;\r\n\t\tfor (int i = 0; i < scores.length; ++i) {\r\n\t\t\tsum += scores[i];\r\n\t\t}\r\n\t\t\r\n\t\treturn ((double)(sum))/(scores.length);\r\n\t\r\n\t}", "public static void calculateAverage(double[] inputArray, int limit)\r\n\t{\r\n\t\tIMovingAverage<Double> movingAvg = new MovingAverageImpl<Double>(limit);\r\n\t\tfor(double element : inputArray)\r\n\t\t{\r\n\t\t\tmovingAvg.add(element);\r\n\t\t\tSystem.out.println(\"Moving average is = \" +movingAvg.getAverage());\r\n\t\t}\r\n\t\tSystem.out.println(\"*********************************************************\");\r\n\t}", "private int[] getAveragedVals(int x, int y, int n, int m) {\n\t\tint[] rtn = new int[NUM_TRIANGLE_SIDES];\n\t\tint avgRed = 0;\n\t\tint avgGreen = 0;\n\t\tint avgBlue = 0;\n\t\tint totalPixels = 0;\n\n\t\tfor (int i = x; i < (x+n); i++) {\n\t\t\tfor (int j = y; j < (y+m); j++) {\n\t\t\t\tif (j < this.getPictureHeight() && i < this.getPictureWidth()) {\n\t\t\t\t\tavgRed += this.image.getPixelRed(i,j);\n\t\t\t\t\tavgGreen += this.image.getPixelGreen(i,j);\n\t\t\t\t\tavgBlue += this.image.getPixelBlue(i,j);\n\t\t\t\t\ttotalPixels++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (totalPixels == 0) {\n\t\t\trtn[0] = 255;\t\t\n\t\t\trtn[1] = 255;\n\t\t\trtn[2] = 255;\n\t\t\treturn rtn;\n\t\t}\n\n\t\trtn[0] = avgRed / totalPixels;\t\t\n\t\trtn[1] = avgGreen / totalPixels;\n\t\trtn[2] = avgBlue / totalPixels;\n\t\treturn rtn;\n\t}", "private float calculateAverage(List<Float> tempVoltages) {\r\n\t\t\r\n\t\tfloat runningTotal = 0;\r\n\t\tfor(float i : tempVoltages){\r\n\t\t\trunningTotal += i;\r\n\t\t}\r\n\t\trunningTotal /= tempVoltages.size();\r\n\t\treturn runningTotal;\r\n\t}", "private List<Double> sumMeanX(List<Business> business, double avg) {\n\t\tList<Double> sumMean = new ArrayList<Double>();\n\n\t\tfor (Business biz : business) {\n\t\t\tint price = biz.getPrice();\n\t\t\tsumMean.add(price - avg);\n\t\t}\n\t\treturn sumMean;\n\t}", "public float averageAnswers() {\n\t\tfloat out = 0;\n\t\t\n\t\tIterator<SolveResult> iter = super.iterator();\n\t\t\n\t\twhile(iter.hasNext()) {\n\t\t\tSolveResult thisResult = iter.next();\n\t\t\tfloat clues = ResultSet.clueCount(thisResult.puzzle);\n\t\t\tfloat cardinality = thisResult.puzzle.getCardinality();\n\t\t\tfloat conflicts = thisResult.puzzle.conflictCount();\n\t\t\t\n\t\t\tif(!(cardinality - clues - conflicts < 0)) {\n\t\t\t\tout += ((cardinality - clues - conflicts) / (81 - clues));\n\t\t\t}\n\t\t}\n\t\treturn out / super.size();\n\t}", "public double getAverage(User user) throws Exception;", "public static BufferedImage average(BufferedImage image, int value) {\n //3-position array where we store R,G,B values of every pixel\n int[] colors;\n //3-position array where we will store the mean value of every pixel of every channel\n int[] meanColor = new int[3];\n //mean values for every channel\n double meanRed, meanGreen, meanBlue;\n //Create a tessela form the original image so we can modify its pixels\n WritableRaster bitmap = (WritableRaster) image.getData();\n WritableRaster tesela = bitmap.createWritableChild(image.getMinX(), image.getMinY(), image.getWidth(), image.getHeight(), 0,0, null);\n //Image iteration\n for (int x = 0; x < image.getWidth()-1; x++){\n for (int y = 0; y < image.getHeight()-1; y++) {\n int red = 0, green=0, blue = 0;\n //Window iteration\n for (int f =-value; f <= value; f++) {\n for (int k = -value; k <= value; k++) {\n //Get every window coordinate, but first check if they actually exist (not out of bounds)\n if (y+(f)>=0 && x+(k)>=0 && y+(f) < image.getHeight() && x+(k)<image.getWidth()) {\n //Temporal store of the value of every channel so then we can compute the mean\n colors = getPixelColor(image,x+k,y+f);\n red += colors[0];\n green += colors[1];\n blue += colors[2];\n }\n }\n }\n //To compute the mean of every color we have to compute the 'distance'+1\n int distance = (value - (-value)+1)*(value - (-value)+1);\n //For every channel, compute the new pixel value\n meanRed = red / distance;\n meanColor[0] = (int) meanRed; \n meanGreen = green / distance;\n meanColor[1] = (int) meanGreen;\n meanBlue = blue / distance;\n meanColor[2] = (int) meanBlue;\n bitmap.setPixel(x,y,meanColor);\n }\n }\n //Create the averaged image and return it\n BufferedImage subImage = new BufferedImage(image.getColorModel(),tesela,image.isAlphaPremultiplied(),null);\n return subImage;\n }", "public static double average(double number1, double number2, double number3) {\n\t\treturn (number1 + number2 + number3) / 2;\r\n\t\t\r\n\t}", "public static double average(ArrayList<Integer> list) {\n double average = (double) sum(list);\n return average / list.size();\n }", "private float calculateMean()\n { \n int numberEmployees = employees.size();\n float total = 0, meanGrossPay = 0;\n // Create an array of all gross pays\n float[] allGrossPay = new float[numberEmployees];\n \n // Call method to return an array of float containing all gross pays\n allGrossPay = calculateAllGrossPay();\n // Find total gross pay\n for (int i = 0; i < numberEmployees; i++)\n {\n total += allGrossPay[i];\n }\n // Find mean and return it\n if (numberEmployees > 0)\n {\n meanGrossPay = total/numberEmployees;\n \n }\n return meanGrossPay;\n }", "private double computeMean(List<Integer> intList) {\n double count = 0;\n for (Integer i : intList) {\n count += i;\n }\n return count / intList.size();\n }", "public static void arrayAttributes(){\n int[] x= {1, 5, 10, -2};\n int[] y={0,0,0};\n int sum=0;\n int avg=0;\n int max=x[0];\n int min=x[0];\n for (int i =0; i<x.length; i++){\n sum=sum+x[i];\n if (x[i]>max){\n max=x[i];\n }\n if (x[i]<min){\n min=x[i];\n }\n }\n avg=sum/x.length;\n y[0]=max;\n y[1]=min;\n y[2]=avg;\n for (int j=0; j<y.length; j++){\n System.out.println(y[j]); \n }\n}", "public static int\n /**\n * \n * @param left\n * an integer\n * @param right\n * an integer\n * @return the average of left and right. The number will round towards zero\n * if the average is not a whole number\n * @pre both left and right numbers should not be greater than\n * Integer.Max_Value or smaller than Integer.Min_Value\n */\n average (int left, int right)\n {\n /**\n * In the original program, it was possible that the sum of left and right\n * exceeds Integer.Max_Value or Integer.Min_Value even when either left or\n * right is within the boundaries. Therefore, we solve this problem by\n * dividing the left and right numbers first, and then sum them up.\n */\n double avg = left / 2.0 + right / 2.0;\n return (int) avg;\n }", "private double[] mean(Population pop) {\n double[] value = new double[pop.getIndividual(0).getNumGenes()];\n //for all individuals\n Iterator<Individual> it = pop.getIterator();\n while (it.hasNext()) {\n Individual ind = it.next();\n //sum the value of the gene\n for (int i = 0; i < value.length; i++) {\n value[i] += ind.getGeneValue(i);\n }\n }\n //divide by the number of individuals\n double factor = 1.0 / pop.getNumGenotypes();\n for (int i = 0; i < value.length; i++) {\n value[i] *=factor;\n }\n return value;\n }", "public static void calculateAverage(int[] inputArray, int limit)\r\n\t{\r\n\t\tIMovingAverage<Integer> movingAvg = new MovingAverageImpl<Integer>(limit);\r\n\t\tfor(int element : inputArray)\r\n\t\t{\r\n\t\t\tmovingAvg.add(element);\r\n\t\t\tSystem.out.println(\"Moving average is = \" +movingAvg.getAverage());\r\n\t\t}\r\n\t\tSystem.out.println(\"*********************************************************\");\r\n\t}", "public static double average (double ... s4){\n double suma = 0.0;\n for (double value : s4) {\n suma += value;\n }\n return suma / s4.length;\n }", "public static double average(int[] array) {\n\t\tif (array.length == 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tdouble avg = 0;\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tavg += array[i];\n\t\t}\n\t\treturn avg / array.length;\n\t}", "@Override\r\n\tpublic int average(GradeBean param) {\n\t\treturn 0;\r\n\t}", "public double computeArea()\n {\n int len = _points.size();\n Point p1 = _points.get(len - 1);\n\n double area = 0.0;\n\n // Compute based on Green's Theorem.\n for(int i = 0; i < len; i++)\n {\n Point p2 = _points.get(i);\n area += (p2.x + p1.x)*(p2.y - p1.y);\n p1 = p2; // Shift p2 to p1.\n }\n\n return -area / 2.0;\n }", "public static double average(double number1, double number2) {\n\t\treturn (number1 + number2) / 2;\r\n\t\t\r\n\t}" ]
[ "0.71032757", "0.6919905", "0.68497723", "0.6660948", "0.6448659", "0.6415216", "0.6410296", "0.63966256", "0.62988025", "0.6268973", "0.624897", "0.6193147", "0.61556786", "0.6120896", "0.606779", "0.606085", "0.60541207", "0.60510933", "0.6007963", "0.5996444", "0.59548724", "0.594824", "0.5944591", "0.5943413", "0.59228814", "0.591214", "0.5910943", "0.5901102", "0.58830786", "0.587549", "0.5872746", "0.5869451", "0.5868019", "0.58471", "0.5824788", "0.5819394", "0.58117974", "0.5806318", "0.5796708", "0.57924104", "0.57869947", "0.57781386", "0.57703084", "0.5763265", "0.5751127", "0.57499135", "0.574912", "0.57320875", "0.57127774", "0.5694789", "0.5681327", "0.56782216", "0.56739855", "0.56707966", "0.5662324", "0.5651832", "0.5644478", "0.5642336", "0.5629841", "0.5627117", "0.56216735", "0.5606701", "0.5591426", "0.55908066", "0.5590195", "0.5574577", "0.5567336", "0.55642724", "0.55443263", "0.55413866", "0.55394316", "0.55378145", "0.5529045", "0.55153596", "0.5509906", "0.5506217", "0.5505836", "0.54995507", "0.5488464", "0.5483143", "0.54752856", "0.5471639", "0.5468608", "0.54650897", "0.54642326", "0.54563415", "0.5447202", "0.5447156", "0.5430569", "0.542783", "0.5427339", "0.54239726", "0.54214126", "0.5417051", "0.5413672", "0.5412045", "0.54107946", "0.53986114", "0.53918666", "0.53866947" ]
0.7273803
0
Log.e(TAG, "onStart()"); initialize the state if is necessary
@Override public void onStart() { if (state == null) { state = new CoverState(); } // call the model and update the state state.titulo = model.getTitulo(); state.comenzar=model.getComenzar(); // use passed state if is necessary }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void onStart() {\n\t\tsuper.onStart();\n\t\t// super.onRestoreInstanceState(outState);\n\n\t\tif (D)\n\t\t\tLog.e(TAG, \"++ ON START ++\");\n\t}", "@Override\n protected void onStart() {\n super.onStart();\n Log.d(LOG_TAG,\"onStart\");\n }", "@Override\n protected void onStart() {\n super.onStart();\n\n Log.d(TAG, \"now running: onStart\");\n }", "@Override\n protected void onStart() {\n super.onStart();\n Log.e(TAG, \"onStart\");\n }", "@Override\n protected void onStart() {\n super.onStart();\n Log.d(tag, \"The onStart() event\");\n }", "@Override\n protected void onStart() {\n super.onStart();\n Log.d(TAG, \"onStart() called\");\n }", "@Override\n protected void onStart() {\n super.onStart();\n Log.d(msg, \"The onStart() event\");\n }", "@Override\n protected void onStart() {\n super.onStart();\n Log.d(msg, \"The onStart() event\");\n }", "@Override\n protected void onStart() {\n Log.i(\"G53MDP\", \"Main onStart\");\n super.onStart();\n }", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tLog.v(TAG, \"onStart())\");\n\t}", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tLog.v(\"tag\",\"onStart\" );\n\t}", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tLog.e(TAG, \"onStart\");\n\t}", "@Override\n\tpublic void onStart() {\n\t\tsuper.onStart();\n\t\tLog.i(TAG, \"onStart\");\n\t}", "@Override\n protected void onStart() {\n super.onStart();\n infoLog(\"onStart\");\n }", "@Override\r\n public void onStart ()\r\n {\r\n \tLog.d(TAG,\"onStart start\");\r\n\t \tsuper.onStart (); \r\n }", "@Override\n protected void onStart() {\n super.onStart();\n Log.d(\"STATO\",\"START\");\n }", "@Override\n\tpublic void onStart() {\n\t\tsuper.onStart();\n\t\tmStart = false;\n\t}", "public void onStart() {\n super.onStart();\n ApplicationStateMonitor.getInstance().activityStarted();\n }", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tLogger.d(TAG, \"onStart.....\");\n\t}", "public void onStart() {\n super.onStart();\n }", "@Override\r\n public void onStart() {\n super.onStart();\r\n }", "@Override\n public void onStart() {\n super.onStart();\n Log.d(Constants.ERROR_TAG_ACTIVITY_ONE, Constants.ON_START);\n }", "@Override\n\t\tprotected void onStart() {\n\t\t\tsuper.onStart();\n\t\t\tToast.makeText(getApplicationContext(), \"onStart\", Toast.LENGTH_SHORT).show();\n\n\t\t\tLog.d(msg, \"The onStart() event\");\n\t\t}", "protected void onStart ()\n\t{\n\t\tsuper.onStart ();\n\t}", "@Override\r\n\tpublic void onStart() {\n\t\tsuper.onStart();\r\n\t}", "@Override\r\n\tpublic void onStart() {\n\t\tsuper.onStart();\r\n\t}", "@Override\n public void onStart() {\n super.onStart();\n\t\t\n }", "@Override\n\tprotected void onStart()\n\t{\n\t\tsuper.onStart();\n\t}", "@Override\n public void onStart() {\n super.onStart();\n }", "@Override\r\n\tprotected void onStart() {\n\t\tsuper.onStart();\r\n\t}", "@Override\r\n\tprotected void onStart() {\n\t\tsuper.onStart();\r\n\t}", "@Override\r\n\tprotected void onStart() {\n\t\tsuper.onStart();\r\n\t}", "@Override\r\n\tprotected void onStart() {\n\t\tsuper.onStart();\r\n\t}", "@Override\r\n\tprotected void onStart() {\n\t\tsuper.onStart();\r\n\t}", "@Override\n\t\t\t\tpublic void onStart() {\n\t\t\t\t\tsuper.onStart();\n\t\t\t\t}", "@Override\n\t\t\t\tpublic void onStart() {\n\t\t\t\t\tsuper.onStart();\n\t\t\t\t}", "@Override\n\t\t\tpublic void onStart()\n\t\t\t{\n\t\t\t\tsuper.onStart();\n\t\t\t}", "@Override\n\tpublic void onStart() {\n\t\tsuper.onStart();\n\t}", "@Override\n\tpublic void onStart() {\n\t\tsuper.onStart();\n\t}", "@Override\n\tpublic void onStart() {\n\t\tsuper.onStart();\n\t}", "@Override\n\tpublic void onStart() {\n\t\tsuper.onStart();\n\t}", "@Override\n\tpublic void onStart() {\n\t\tsuper.onStart();\n\t}", "@Override\n\tpublic void onStart() {\n\t\tsuper.onStart();\n\t}", "@Override\n protected void onStart() {\n super.onStart();\n }", "@Override\n protected void onStart() {\n super.onStart();\n }", "@Override\n protected void onStart() {\n super.onStart();\n }", "@Override\n protected void onStart() {\n super.onStart();\n }", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tLog.e(\"xx\", \"onstart\");\n\n\t\t\t}", "public void onStart() {\n }", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t}", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t}", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t}", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t}", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t}", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t}", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t}", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t}", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t}", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t}", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t}", "@Override\r\n public void onStart(){\r\n super.onStart();\r\n\r\n }", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tLog.e(\"xx\",\"onstart\");\n\n\t\t\t}", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tLog.e(\"xx\",\"onstart\");\n\n\t\t\t}", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tLog.e(\"xx\",\"onstart\");\n\n\t\t\t}", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tLog.e(\"xx\",\"onstart\");\n\n\t\t\t}", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tLog.e(\"xx\",\"onstart\");\n\n\t\t\t}", "@Override\n\t\tprotected void onStart() {\n\t\t\tsuper.onStart();\n\t\t}", "@Override\n public void onStart() {\n System.out.println(\"ONstart\");\n super.onStart();\n\n }", "@Override\n public void onStart(){\n super.onStart();\n }", "public void onStart() {\n }", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tLog.i(TAG, module + \" Entra por onStart\");\n\n\t}", "@Override\n protected void onStart() {\n super.onStart();\n }", "@Override\r\n\tprotected void onStart() {\n\t\tsuper.onStart();\r\n\t\tLog.d(\"maintab\", \"maintab_MainActivity------onStart\");\r\n\t}", "@Override\n protected void onStart() {\n super.onStart();\n\n }", "@Override\n public void onStart() {\n }", "@Override\n public void onStart() {\n }", "@Override\n public void onStart() {\n }", "@Override\n public void onStart() {\n }", "@Override\n public void onStart() {\n }", "@Override\n public void onStart() {\n }", "@Override\n public void onStart() {\n }", "@Override\n public void onStart() {\n }", "@Override\n public void onStart() {\n }", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tSystem.out.println(\"onStart...\");\n\t}", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tSystem.out.println(\"Método onStart\");\n\t}", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tLog.d(TAG, \"onStart() - ThreeActivity - Activity становиться видимым\");\n\t}", "@Override\n\t\t\t\tpublic void onStart() {\n\t\t\t\t}", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tLog.d(\"RituNavi\", \"MainTestActivity onStart\");\n\t}", "public void onStart() {\n\t\t\n\t}", "@Override\n\t\t\t\t\tpublic void onStart() {\n\n\t\t\t\t\t}", "@Override\r\n protected void onStart() {\r\n // TODO Auto-generated method stub\r\n super.onStart();\r\n\r\n\r\n }", "@Override\n\tpublic void onStart() {\n\n\t}", "@Override\n\tpublic void onStart() {\n\n\t}", "@Override\n\tprotected void onStart(){\n\t\tsuper.onStart();\n\t\tLog.d(msg, \"HomePageActivity onStart() event\");\n\t}", "@Override\n public void onStart() {\n Log.e(TAG, \"detect the lifecycleowner--- started\");\n }", "public void onStart() {\n super.onStart();\n getStockVerification();\n }", "void onStart() {\n\n }", "@Override\n public void onStart()\n {\n }", "@Override\n protected void onStart() {\n super.onStart();\n xHelper.log(\"goapp\",\"BoardActivity onStart\");\n }", "@Override\r\n public void onStart() {\r\n super.onStart();\r\n UserDataManager.instantiateManager(this);\r\n refreshData();\r\n }", "public void onStart() {\n\t\tsuper.onStart();\n\t\tXMLManager.verifyXMLIntegrity(this);\n\t\trefreshActivityContents();\n\t}" ]
[ "0.82618994", "0.8203911", "0.81873506", "0.8169785", "0.81659937", "0.81657606", "0.8150328", "0.8150328", "0.8096554", "0.80689555", "0.80495083", "0.80473834", "0.8009864", "0.8006305", "0.7984468", "0.7979311", "0.7950174", "0.7933293", "0.7926859", "0.79052013", "0.78753006", "0.7871629", "0.7827014", "0.78223985", "0.7821627", "0.7821627", "0.7806057", "0.77878124", "0.7783493", "0.7783209", "0.7783209", "0.7783209", "0.7783209", "0.7783209", "0.77777225", "0.77777225", "0.7758406", "0.77544415", "0.77544415", "0.77544415", "0.77544415", "0.77544415", "0.77544415", "0.7749391", "0.7749391", "0.7749391", "0.7749391", "0.773749", "0.77254516", "0.7723309", "0.7723309", "0.7723309", "0.7723309", "0.7723309", "0.7723309", "0.7723309", "0.7723309", "0.7723309", "0.7723309", "0.7723309", "0.7716892", "0.77164245", "0.77164245", "0.77164245", "0.77164245", "0.77164245", "0.77141273", "0.77107924", "0.76785004", "0.7673848", "0.76455355", "0.76331246", "0.763121", "0.76276064", "0.7623263", "0.7623263", "0.7623263", "0.7623263", "0.7623263", "0.7623263", "0.7623263", "0.7623263", "0.7623263", "0.7618204", "0.76057065", "0.7601261", "0.7591729", "0.7576327", "0.7543081", "0.7539623", "0.7522947", "0.7481027", "0.7481027", "0.7475773", "0.74752355", "0.74477315", "0.7446409", "0.7442084", "0.7439549", "0.74394834", "0.7436443" ]
0.0
-1
Log.e(TAG, "onRestart()"); update the model if is necessary
@Override public void onRestart() { model.onRestartScreen(state.titulo,state.comenzar); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public void onRestart() {\r\n super.onRestart();\r\n refreshData();\r\n }", "@Override\r\n\tprotected void onRestart() {\n\t\tsuper.onRestart();\r\n\t}", "@Override\r\n\tprotected void onRestart() {\n\t\tsuper.onRestart();\r\n\t}", "@Override\r\n\tprotected void onRestart() {\n\t\tsuper.onRestart();\r\n\t}", "@Override\r\n protected void onRestart() {\n\tsuper.onRestart();\r\n }", "@Override\n protected void onRestart() {\n super.onRestart();\n\n }", "@Override\n protected void onRestart() {\n super.onRestart();\n }", "@Override\n protected void onRestart() {\n super.onRestart();\n }", "@Override\n \tprotected void onRestart() {\n \t\tsuper.onRestart();\n \t\tLog.d(TAG, \"onRestart\");\n \t}", "@Override\n protected void onRestart() {\n super.onRestart();\n recreate();\n }", "@Override\n\tprotected void onRestart() {\n\t\tsuper.onRestart();\n\t}", "@Override\n\tprotected void onRestart() {\n\t\tsuper.onRestart();\n\t}", "@Override\n\tprotected void onRestart() {\n\t\tsuper.onRestart();\n\t}", "@Override\n \tprotected void onRestart() {\n \t\tsuper.onRestart();\n \t}", "private void restart(){\n model.init();\n view.refreshPieces();\n start();\n }", "@Override\n\tprotected void onRestart() {\n\t\tsuper.onRestart();\n\t\tLog.v(TAG, \" onRestart()\");\n\t}", "@Override\n\tprotected void onRestart() {\n\t\tsuper.onRestart();\n\t\tLog.v(\"tag\",\"onRestart\" );\n\t}", "@Override\n protected void onRestart() {\n super.onRestart();\n Log.v(TAG, \"Invoked onRestart()\");\n\n }", "protected void onRestart ()\n\t{\n\t\tsuper.onRestart ();\n\t}", "@Override\n protected void onRestart() {\n super.onRestart();\n xHelper.log(\"goapp\",\"BoardActivity onRestart\");\n }", "@Override\n\tprotected void onRestart() {\n\t\t// TODO Auto-generated method stub\n\t\tsuper.onRestart();\n\t\tLog.e(\"mainactivity\", \"restarted\");\n\t}", "@Override\r\n\tprotected void onRestart() {\n\t\tXSDK.getInstance().onRestart();\r\n\t\tsuper.onRestart();\r\n\t}", "@Override\n\tprotected void onRestart() {\n\t\tsuper.onRestart();\n\t\tLog.d(TAG, \"onRestart() - ThreeActivity - перезапуск Activity\");\n\t}", "@Override\n\t\tprotected void onRestart() {\n\t\tsuper.onRestart();\n\t\tToast.makeText(getApplicationContext(), \"onRestart\", Toast.LENGTH_SHORT).show();\n\n\t\t}", "@Override\n protected void onRestart(){\n super.onRestart();\n Log.d(TAG_INFO,\"application restarted\");\n }", "@Override\n protected void onRestart(){\n super.onRestart();\n Log.d(TAG_INFO,\"application restarted\");\n }", "@Override\n\tprotected void onRestart() {\n\t\tsuper.onRestart();\n\t\tLog.d(\"tag\", \"-------onRestart-------\");\n\t\t// 刷新listview\n\t}", "@Override\n public void onRestart() {\n super.onRestart();\n Log.d(Constants.ERROR_TAG_ACTIVITY_ONE, Constants.ON_RESTART);\n }", "@Override\r\n protected void onRestart() {\n super.onRestart();\r\n mapview.onRestart();\r\n }", "@Override\n\tprotected void onRestart() {\n\t\tsuper.onRestart();\n\t\tLog.d(\"RituNavi\", \"MainTestActivity onRestart\");\n\t}", "@Override\n protected void onRestart() {\n super.onRestart();\n if(mvTencentMapView != null) {\n mvTencentMapView.onRestart();\n }\n }", "@Override\n\tprotected void onRestart() {\n\t\tsuper.onRestart();\n\t\tif (adapter != null) {\n\t\t\tadapter.initPlayerEngine();\n\t\t\tadapter.notifyDataSetChanged();\n\t\t}\n\t}", "@Override\n\tprotected void onRestart() {\n\t\tsuper.onRestart();\n\t\ttActivityDisplay.setText(\"On Restart Called\");\n\t}", "@Override\n protected void onRestart() {\n super.onRestart();\n mMapView.onRestart();\n }", "void notifyRestart();", "@Override\n\tprotected void onRestart() {\n\t\tsuper.onRestart();\n\t\tmp.start();\n\t}", "@Override\n public void restart() {\n }", "@Override\n protected void onRestart() {\n super.onRestart();\n handler.postDelayed(myRun, speed);\n }", "public void onRestart() {\r\n\t\tLog.w(LOG_TAG, \"Simple iMeeting base view = \" + this\r\n\t\t\t\t+ \" onRestart method not implement\");\r\n\t}", "public void onRestart(Bundle params) {\n }", "@Override\n\tprotected void onRestart() {\n\t\tLog.i(LOG_TAG, \"onPause\");\n\t\tsuper.onRestart();\n\t\ttemp = new StringBuilder();\n\t}", "@Override\n\tpublic void restart() {\n\t\t\n\t}", "@Override\n\tprotected void onStart() {\n\t\tsuper.onRestart();\n\t}", "@Override\n protected void onRestart() {\n\n super.onRestart();\n\n // Shows a toast message (a pop-up message)\n Toast toast = Toast.makeText(getBaseContext(), \"FirstActivity.onRestart()\", Toast.LENGTH_SHORT);\n toast.show();\n }", "@Override\n protected void onRestart() {\n super.onRestart();\n Intent returnIntent = new Intent();\n setResult(RESULT_CANCELED, returnIntent);\n onRestart = true;\n finish();\n }", "public void restart()\n\t{\n\t\tinit();\n\t}", "@Override\n\tpublic void onResume() {\n\t\tsuper.onResume();\n\t\tifneedUpdate();\n\t}", "@Override\n\tprotected void onRestart() {\n\t\tsuper.onRestart();\n\t\tMCommerceApp mApp = (MCommerceApp) getApplication();\n\t\tif (mApp.isContinueShopping() == true) {\n\t\t\tmApp.setContinueShopping(false);\n\t\t\tfinish();\n\t\t}\n\n\t}", "private void onRestart() {\n new Handler().post(new Runnable() {\n\n @Override\n public void run()\n {\n Intent intent = getActivity().getIntent();\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK\n | Intent.FLAG_ACTIVITY_NO_ANIMATION);\n getActivity().overridePendingTransition(0, 0);\n getActivity().finish();\n\n getActivity().overridePendingTransition(0, 0);\n startActivity(intent);\n }\n });\n }", "@Override\n public void restart() {\n LOG.info(\"Restarting...\");\n stopService();\n startService();\n }", "@Override\r\n protected void onRestart() {\n super.onRestart();\r\n viewPager.setCurrentItem(0);\r\n\r\n }", "@Override\n public void onRestart() {\n super.onRestart();\n app.connectToPacemakerAPI(this);\n }", "public void restart() {\n\t\tthis.restartEvent.emit();\n\t}", "@Override\n\tprotected void onRestart() {\n\t\tshowPhoto(0);\n\t\tsuper.onRestart();\n\t}", "@Override\n\tprotected void onRestart() {\n\t\tString log_msg = \"onRestart()\";\n\n\t\tLog.d(\"[\" + \"ShowMapActv.java : \"\n\t\t\t\t+ +Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t+ \" : \"\n\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getMethodName()\n\t\t\t\t+ \"]\", log_msg);\n\t\tsuper.onRestart();\n\t}", "private void onRestart() {\n init();\r\n bazar.initialisation();\r\n onJouer();\r\n Reponse.setText(\"\");\r\n bazar.setChance(5);\r\n nbrChance.setText(\"Il vous reste 5 chances\");\r\n Question.setText(\"Veuillez saisir votre réponse ici :\");\r\n\r\n\r\n }", "protected void restart()\r\n \t{\r\n \t\tspielen();\r\n \t}", "private void prepareRestart(){\n view.getScore().setText(getScore());\n view.getControlsBox().getChildren().clear();\n view.getControlsBox().getChildren().addAll(view.getRestart());\n view.refreshPieces();\n view.getRestart().setOnAction(event -> restart());\n }", "public void restart();", "public void restart() {\r\n\t\tstart();\r\n\t}", "@Override\n\tprotected void onRestart() {\n\t\tsuper.onRestart();\n\t\tGetSettingFormFile();\n\t}", "protected void restart() {\r\n\t\tthis.stop();\r\n\t\tthis.start();\r\n\t}", "@Override\r\n public void onResume() {\r\n super.onResume();\r\n refreshData();\r\n }", "@Override\n protected void onResume() {\n super.onResume();\n if (is_resume) {\n is_resume = false;\n } else {\n Music.restart(mContext);\n }\n }", "protected abstract void restartImpl();", "@Override\n\tpublic void onRestart() {\n\t\tsuper.onRestart();\n\n\t\tSystem.out.println(\"!!!!!!!!!!!!!!!onRestart\");\n\t\tLanguageConvertPreferenceClass.loadLocale(getApplicationContext());\n\t}", "@Override\n public void onRestart() { // After a pause OR at startup\n super.onRestart();\n Log.d(TAG, \"onRestart: Refreshing user's list of groups\");\n\n //Rebuild the list of groups the user is in\n this.view = findViewById(R.id.userInformation);\n results.clear();\n this.setupUserView(view);\n }", "@Override\r\n\tprotected void onResume() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tsuper.onResume();\r\n\t\t\r\n\t\trefresh();\r\n\t}", "@Override\n protected void onRestart() {\n super.onRestart();\n MobclickAgent.onPageStart(\"ACGwenDangActivity\");\n MobclickAgent.onResume(this); // 统计时长\n }", "@Override\r\n\tprotected void onRestart() {\n\t\tsuper.onRestart();\r\n\t\t//init();\r\n\t\tLog.d(\"1111\",\"on restart\");\r\n\t\tDisplayMetrics dm = new DisplayMetrics();\r\n\t\tthis.getWindowManager().getDefaultDisplay().getMetrics(dm);\r\n\t\twidth = dm.widthPixels;\r\n\t\tfileList = FileTools.getUrls(GlobalApp.DOWNLOAD_PATH);\r\n\t\tmGridViewAdapter = null;\r\n\t\tLog.d(\"1111\",\"new LocalPhotoAdapter\");\r\n\t\t\tmGridViewAdapter = new LocalPhotoAdapter(LocalPhotoWallActivity.this,fileList, mGridView,width);\r\n\t\t\t//mGridViewAdapter.notifyDataSetInvalidated();\r\n\t\t\tmGridView.setAdapter(mGridViewAdapter);\r\n\t\t\tmGridViewAdapter.notifyDataSetInvalidated();\r\n\t\t\ttotalNum.setText(fileList.length+\" files\");\t\r\n\t\t\tmGridView.invalidate();\r\n\t\t\r\n\t}", "@Override\n T restart();", "public void restart()\n\t{\n\t\tstop();\n\t\treset();\n\t\tstart();\n\t}", "@Override\n protected void onRestart() {\n \tsuper.onRestart();\n \tSystem.out.println(\"onRestart\");\n \tif(thread == null){\n \t\tthread = new FlashThread();\n \t\tthread.start();\n \t}\n }", "private void restartButtonActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_restartButtonActionPerformed\n\tPlatypusGUI.getInstance().resetModel();\n\tparent.showNextView();\n }", "public void processRestart(){\n destroyWorkerQueue();\n initWorkerQueue();\n }", "@Override\n public void onResume() {\n super.onResume();\n model.setActivityID(0);\n }", "@Override\n protected void onResume() {\n super.onResume();\n updateUI();\n }", "@Override\n\tprotected void onRestart() {\n\t\tsuper.onRestart();\n\t\tshowProcessDialog(\"正在进入聊天室\");\n\t\tnew Thread(new SmackThread()).start();\n\t}", "private void handleRestart() throws Exception\n {\n\n String result = \"The game is restarted.\\n\"; // this message will be output to the log window\n printResult.clear();//clear the log window messages\n printResult.add(result); // output to the log window\n listViewSelectedHospital = null; // no department is selected for the human player in the UI\n listViewSelectedDoctor = null; // no doctor is selected for the human player in the UI\n game.gameData.loadGameData(\"players.txt\"); // reload data from the players.txt file\n humanPlayer = game.gameData.getPlayers().get(0); // get the human player from the loaded data\n computerPlayer_1 = game.gameData.getPlayers().get(1); // get computer player 1 from the loaded data\n computerPlayer_2 = game.gameData.getPlayers().get(1); // get computer player 1 from the loaded data\n\n // init the various listviews with the loaded data, these lists will be updated to the UI\n update();\n\n // set up the listener to check the mouse selection on department and doctor in the displayed ListViews\n initListView();\n\n\n }", "public void RestartGame()\n {\n \n }", "@Override\n public void restart(){\n balls.reInit();\n majGui();\n }", "@Override\n public void onResume()\n {\n super.onResume();\n //Refresh your stuff here\n }", "public void s_restart() {\n\n leftButton.setVisibility(View.VISIBLE);\n upButton.setVisibility(View.VISIBLE);\n rightButton.setVisibility(View.VISIBLE);\n\n visible = true;\n TransitionSet set = new TransitionSet()\n .addTransition(new Scale(0.7f))\n .addTransition(new Fade())\n .setInterpolator(visible ? new LinearOutSlowInInterpolator() :\n new FastOutLinearInInterpolator());\n\n TransitionManager.beginDelayedTransition(turn_signals, set);\n turn_signals.setVisibility(visible ? View.GONE : View.VISIBLE);\n\n approve.setVisibility(View.GONE);\n declined.setVisibility(View.GONE);\n result.setVisibility(View.VISIBLE);\n\n everyOther = !everyOther;\n\n // calls the function to display the correct approve or deny icons\n result(everyOther);\n }", "@Override\n public void onResume() {\n \tsuper.onResume();\n \tLog.i(\"ONRESUME\", \"ONRESUME\");\n \treloadSavedState();\n }", "@Override\n public void onResume() {\n }", "@Override\r\n\tprotected void onResume() {\n\t\t\r\n\t}", "@Override\n\tprotected void on_world_restart(int world_count) {\n\n\t}", "@Override\n public void onResume()\n {\n super.onResume();\n //Refresh your stuff here\n\n }", "private void restartHandler() {\n ((ChessPanel) this.getParent()).getGameEngine().reset();\n }", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\tLog.d(\"tag\", \"-------onResume-------\");\n\t\trefreshList();// 刷新listview\n\t\tinitComponent();\n\t}", "private void retryCall() {\n MyViewModel factory = new MyViewModel(this.getApplication(), Integer.toString(ids));\n weatherViewModel = new ViewModelProvider(this, factory).get(WeatherViewModel.class);\n weatherViewModel.init();\n weatherViewModel.getWeatherRepo().observe(this, this::getResponsFromLiveData);\n }", "@Override\r\n\tpublic void onResume() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onResume() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onResume() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onResume() {\n\t\t\r\n\t}", "public void restart() {\r\n\t\tthis.cancel = false;\r\n\t}", "public void restart() {\n\n\t\t//Reset the list of Mho locations\n\t\tmhoLocations.clear();\n\n\t\t//Generate a unique map of game elements again\n\t\tgenerateMap();\n\n\t\t//reset gameOver and win variables\n\t\tgameOver = false;\n\t\twin = false;\n\n\t\t//repaint the board\n\t\tboard.repaint();\n\t}", "@Override\n public void onResume() {\n view.get().onDataUpdated(state);\n view.get().activateButton();\n\n }", "@Override\r\n\tpublic void onResume() {\n\t\tsuper.onResume();\r\n\t}", "@Override\r\n\tpublic void onResume() {\n\t\tsuper.onResume();\r\n\t}" ]
[ "0.8190517", "0.80023426", "0.80023426", "0.80023426", "0.79861873", "0.7982207", "0.7980516", "0.7980516", "0.7961039", "0.7947923", "0.79317546", "0.79317546", "0.79317546", "0.7884466", "0.78769356", "0.78680193", "0.7817902", "0.78173447", "0.7802308", "0.77225125", "0.7707834", "0.7694407", "0.7691029", "0.76756436", "0.7652187", "0.7652187", "0.76129454", "0.75878793", "0.74326235", "0.74157983", "0.7370751", "0.7315809", "0.72916496", "0.7279977", "0.72570515", "0.7253814", "0.7249146", "0.7239726", "0.7130149", "0.706484", "0.69869864", "0.6967773", "0.6962872", "0.6822001", "0.681478", "0.6783574", "0.6760945", "0.67561626", "0.67525977", "0.67120296", "0.66972375", "0.6665169", "0.6649476", "0.6631892", "0.6621847", "0.6617624", "0.66162556", "0.6519795", "0.64980674", "0.6452545", "0.6440794", "0.64268273", "0.6409805", "0.6366899", "0.63579744", "0.63427025", "0.63400733", "0.6317153", "0.6280378", "0.626501", "0.6231572", "0.6225924", "0.6218341", "0.6214596", "0.62059295", "0.6200662", "0.6184612", "0.6166262", "0.6105104", "0.6062189", "0.60579765", "0.6046861", "0.60326546", "0.6029441", "0.6024489", "0.6012845", "0.59989166", "0.59777766", "0.59702414", "0.5967298", "0.5963457", "0.5962054", "0.5962054", "0.5962054", "0.5962054", "0.59575224", "0.5947006", "0.5943299", "0.59429735", "0.59429735" ]
0.759426
27
Log.e(TAG, "onResume()"); use passed state if is necessary call the model and update the state state.data = model.getStoredData(); update the view
@Override public void onResume() { view.get().onDataUpdated(state); view.get().activateButton(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onResume() {\n super.onResume();\n initViewData();\n initdata();\n }", "@Override\r\n public void onResume() {\r\n super.onResume();\r\n refreshData();\r\n }", "@Override\n protected void onResume() {\n super.onResume();\n loadData();\n }", "@Override\n protected void onResume() {\n super.onResume();\n loadData();\n }", "@Override\n public void onResume() {\n \tsuper.onResume();\n \tLog.i(\"ONRESUME\", \"ONRESUME\");\n \treloadSavedState();\n }", "@Override\r\n\tprotected void onResume() {\n\t\tsuper.onResume();\r\n\r\n\t\tqueryData();\r\n\t}", "@Override\r\n\tprotected void onResume() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tsuper.onResume();\r\n\t\t\r\n\t\trefresh();\r\n\t}", "@Override\n\tpublic void onResume() {\n\t\tsuper.onResume();\n\t\tifneedUpdate();\n\t}", "@Override\n public void onResume()\n {\n super.onResume();\n empty = true;\n loadData();\n initializeUI();\n }", "@Override\n public void onResume() {\n super.onResume();\n refreshContent();\n }", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\tLog.d(\"tag\", \"-------onResume-------\");\n\t\trefreshList();// 刷新listview\n\t\tinitComponent();\n\t}", "@Override\n protected void onResume() {\n super.onResume();\n\n // Populate the views with patient data.\n if (mPatient != null)\n populatePatientData();\n }", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\tquerytonlistdata();\n\t}", "@Override\n public void onResume()\n {\n super.onResume();\n //Refresh your stuff here\n }", "@Override\n public void onResume() {\n }", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\trefreshNoteList();//刷新记事列表\n\t}", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\tsetMemory();\n\t}", "@Override\r\n\tpublic void onResume() {\n\t\tsuper.onResume();\r\n\t\t\r\n\t}", "@Override\n protected void onResume() {\n super.onResume();\n updateUI();\n }", "public void onResume() {\n\t\tsuper.onResume();\n\t\tthis.getDataFromSql(ID);\n\t}", "@Override\r\n\tprotected void onResume() {\n\t\tsuper.onResume();\r\n\t\t\r\n\t}", "@Override\r\n\tprotected void onResume() {\n\t\tsuper.onResume();\r\n\t\t\r\n\t}", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\t\n\t\tinsertView();\n\t}", "@Override\r\n\tpublic void onResume() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onResume() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onResume() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onResume() {\n\t\t\r\n\t}", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\tmGLView.onResume();\n\t}", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\tv.resume();\n\t\t\n\t}", "@Override\n\t\tprotected void onResume() {\n\t\t\tsuper.onResume();\n\t\t}", "@Override\r\n\tprotected void onResume() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onResume() {\n\t\tsuper.onResume();\r\n\t}", "@Override\r\n\tpublic void onResume() {\n\t\tsuper.onResume();\r\n\t}", "@Override\r\n\tpublic void onResume() {\n\t\tsuper.onResume();\r\n\t}", "@Override\r\n\tprotected void onResume() {\n\t\tsuper.onResume();\r\n\r\n\t}", "@Override\r\n\tprotected void onResume() {\n\t\tsuper.onResume();\r\n\r\n\t}", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\t \n\t}", "@Override\r\n\tprotected void onResume() {\n\t\tsuper.onResume();\r\n\t}", "@Override\r\n\tprotected void onResume() {\n\t\tsuper.onResume();\r\n\t}", "@Override\r\n\tprotected void onResume() {\n\t\tsuper.onResume();\r\n\t}", "@Override\r\n\tprotected void onResume() {\n\t\tsuper.onResume();\r\n\t}", "@Override\r\n\tprotected void onResume() {\n\t\tsuper.onResume();\r\n\t}", "@Override\r\n\tprotected void onResume() {\n\t\tsuper.onResume();\r\n\t}", "@Override\r\n\tprotected void onResume() {\n\t\tsuper.onResume();\r\n\t}", "@Override\r\n\tprotected void onResume() {\n\t\tsuper.onResume();\r\n\t}", "@Override\r\n\tprotected void onResume() {\n\t\tsuper.onResume();\r\n\t}", "@Override\r\n\tprotected void onResume() {\n\t\tsuper.onResume();\r\n\t}", "@Override\n public void onResume() {\n\n super.onResume();\n orderDishFragment.refreshDish();//refresh soldout dish state when it is commit by myself\n }", "@Override\n public void onResume()\n {\n super.onResume();\n //Refresh your stuff here\n\n }", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\trefreshListView();\n\t}", "@Override\n\tpublic void onResume() {\n\n\t}", "@Override\n\tpublic void onResume() {\n\n\t}", "@Override\n public void onResume() {\n super.onResume();\n model.setActivityID(0);\n }", "@Override\n public void onResume(){\n super.onResume();\n new Database();\n Auth.addAuthListener();\n fetchData();\n updateUIMode();\n }", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\t\t\t\n\t\t\t\t\n\t}", "@Override\n public void onResume() {\n super.onResume();\n if (!mSwipeRefreshLayout.isRefreshing())\n loadDataFromDatabase();\n }", "@Override\n \tprotected void onResume() {\n \t\tsuper.onResume();\n \t\tLog.d(TAG, \"onResume\");\n \t}", "@Override\n\tpublic void onResume() {\n\t\tsuper.onResume();\n\n\t}", "@Override\n\tpublic void onResume() {\n\t\tsuper.onResume();\n\n\t}", "@Override\n\tprotected void onResume() \n\t{\n\t\tsuper.onResume();\n\t}", "@Override\r\n protected void onResume() {\n super.onResume();\r\n Log.i(TAG, \"onResume\");\r\n\r\n }", "@Override\r\n protected void onResume() {\n\tsuper.onResume();\r\n }", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\t\n\t}", "@Override\n \tprotected void onResume() {\n \t\tsuper.onResume();\n \t}", "@Override\n \tprotected void onResume() {\n \t\tsuper.onResume();\n \t}", "@Override\n\tpublic void onResume() {\n\t\tsuper.onResume();\n\t}", "@Override\n\tpublic void onResume() {\n\t\tsuper.onResume();\n\t}", "@Override\n\tpublic void onResume() {\n\t\tsuper.onResume();\n\t}", "@Override\n\tpublic void onResume() {\n\t\tsuper.onResume();\n\t}", "@Override\n\tpublic void onResume() {\n\t\tsuper.onResume();\n\t}", "@Override\n\tpublic void onResume() {\n\t\tsuper.onResume();\n\t}", "@Override\n\tpublic void onResume() {\n\t\tsuper.onResume();\n\t}", "@Override\n public void onResume() {\n super.onResume();\n }", "@Override\n public void onResume() {\n super.onResume();\n }", "@Override\n public void onResume() {\n super.onResume();\n }", "@Override\n public void onResume() {\n super.onResume();\n }", "@Override\n public void onResume() {\n super.onResume();\n }", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\n\t}", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\n\t}", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\n\t}", "@Override\n\tprotected void onResume()\n\t{\n\t\tsuper.onResume();\n\n\t}", "@Override\n protected void onResume() {\n super.onResume();\n }", "@Override\n protected void onResume() {\n super.onResume();\n }", "@Override\n protected void onResume() {\n super.onResume();\n }", "@Override\n protected void onResume() {\n super.onResume();\n }", "@Override\n\tprotected void onResume()\n\t{\n\t\tsuper.onResume();\n\t}", "@Override\n protected void onResume() {\n super.onResume();\n\n Log.d(LOG_TAG, \"onResume()\");\n\n\n\n }", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t}", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t}", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t}", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t}", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t}", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t}", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t}", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t}", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t}", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t}", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t}", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t}", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t}" ]
[ "0.7886354", "0.7828271", "0.76944995", "0.76944995", "0.75982666", "0.72660196", "0.72137535", "0.7208568", "0.7203889", "0.71921504", "0.71521044", "0.70726097", "0.7029319", "0.7020808", "0.6984223", "0.69752955", "0.6946484", "0.6931786", "0.69220155", "0.6911666", "0.69111925", "0.69111925", "0.6909051", "0.69082296", "0.69082296", "0.69082296", "0.69082296", "0.6903749", "0.69032955", "0.6876709", "0.685694", "0.68557066", "0.68557066", "0.68557066", "0.6847491", "0.6847491", "0.68432516", "0.6833978", "0.6833978", "0.6833978", "0.6833978", "0.6833978", "0.6833978", "0.6833978", "0.6833978", "0.6833978", "0.6833978", "0.68297637", "0.68255436", "0.6817628", "0.68103576", "0.68103576", "0.67920965", "0.6790075", "0.6786905", "0.67825145", "0.6775915", "0.67713434", "0.67713434", "0.6770626", "0.6755511", "0.6754389", "0.67510104", "0.67471945", "0.67471945", "0.67468333", "0.67468333", "0.67468333", "0.67468333", "0.67468333", "0.67468333", "0.67468333", "0.6742671", "0.6742671", "0.6742671", "0.6742671", "0.6742671", "0.6737388", "0.6737388", "0.6737388", "0.6730126", "0.6727233", "0.6727233", "0.6727233", "0.6727233", "0.6727135", "0.6726278", "0.67246455", "0.67246455", "0.67246455", "0.67246455", "0.67246455", "0.67246455", "0.67246455", "0.67246455", "0.67246455", "0.67246455", "0.67246455", "0.67246455", "0.67246455" ]
0.7504827
5
/ 1. Add two queues 2. Depth queue/ Node queue.
public static void connect(TreeLinkNode root) { if(root==null) return; LinkedList<TreeLinkNode> nodeQueue = new LinkedList<TreeLinkNode>(); LinkedList<Integer> depthQueue = new LinkedList<Integer>(); if(root!=null){ nodeQueue.offer(root); depthQueue.offer(1); } while(!nodeQueue.isEmpty()){ TreeLinkNode topNode = nodeQueue.poll(); int depth = depthQueue.poll(); if(depthQueue.isEmpty()){ topNode.next = null; } else if(depthQueue.peek() > depth){ topNode.next = null; } else { topNode.next = nodeQueue.peek(); } if(topNode.left!=null){ nodeQueue.offer(topNode.left); depthQueue.offer(depth+1); } if(topNode.right!=null){ nodeQueue.offer(topNode.right); depthQueue.offer(depth+1); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static LinkedQueue mergeSortedQueues(LinkedQueue q1, LinkedQueue q2) {\n // Replace the following line with your solution.\n LinkedQueue bigQueue = new LinkedQueue();\n while (!q1.isEmpty() && !q2.isEmpty())\n {\n try\n {\n Object qOneItem = q1.front();\n Object qTwoItem = q2.front();\n if (((Comparable) qOneItem).compareTo(qTwoItem) > 0)\n {\n bigQueue.enqueue(q2.dequeue());\n }\n else if (((Comparable) qOneItem).compareTo(qTwoItem) < 0)\n {\n bigQueue.enqueue(q1.dequeue()); \n }\n else\n {\n bigQueue.enqueue(q1.dequeue()); \n bigQueue.enqueue(q2.dequeue());\n }\n }\n catch (QueueEmptyException e)\n {\n e.printStackTrace(); \n }\n }\n \n if (!q1.isEmpty())\n {\n bigQueue.append(q1);\n }\n if (!q2.isEmpty())\n {\n bigQueue.append(q2);\n }\n \n return bigQueue;\n }", "public QueueUsingTwoStacks() \n {\n stack1 = new Stack<Item>();\n stack2 = new Stack<Item>();\n }", "@Override\n\tpublic void addQueues(Queue... queue) {\n\t\tsuper.addQueues(queue);\n\t\tqueuesChanged();\n\t}", "private void addFromQueue()\n\t{\n\t\twhile( humanQueue.size()>0 )\n\t\t\thumans.add(humanQueue.remove(0));\n\t\twhile( zombieQueue.size()>0 )\n\t\t\tzombies.add(zombieQueue.remove(0));\n\t}", "Queue<IMotion> addToQueue(Queue<IMotion> motionQueue);", "@Override\n\tpublic void addToQueue() {\n\t}", "private void bfs() {\n\t\tQueue<Node> q = new ArrayDeque<>();\n\t\tq.add(treeNodes.get(0));\n\t\twhile (!q.isEmpty()) {\n\t\t\tint size = q.size();\n\t\t\tfor (int i = 0; i < size; i++) {\n\t\t\t\tNode curr = q.poll();\n\t\t\t\ttime += curr.informTime;\n\t\t\t\tSet<Node> nextNodes = curr.nextNodes;\n\t\t\t\tif (nextNodes == null || curr.id == treeNodes.get(0).id)\n\t\t\t\t\tcontinue;\n\t\t\t\tfor (Node node : nextNodes) {\n\t\t\t\t\tq.add(node);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "public static void main(String args[]) {\r\n /* Create a queue with items 1 2 3 */\r\n Queue q = new Queue();\r\n q.stack1 = new Stack<>();\r\n q.stack2 = new Stack<>();\r\n enQueue(q, 1);\r\n enQueue(q, 2);\r\n enQueue(q, 3);\r\n\r\n /* Dequeue items */\r\n System.out.print(deQueue(q) + \" \");\r\n System.out.print(deQueue(q) + \" \");\r\n System.out.println(deQueue(q) + \" \");\r\n }", "public static LinkedQueue<Object> merge(LinkedQueue<Object> q1, LinkedQueue<Object> q2) {\n if (q1.size() == 0) {\n return q2;\n } else if (q2.size() == 0) {\n return q1;\n }\n\n LinkedQueue<Object> mergeQueue = new LinkedQueue<>();\n int i = 0;\n int j = 0;\n int size1 = q1.size();\n int size2 = q2.size();\n\n while (i < size1 && j < size2) {\n int flag = q1.peek().toString().compareTo(q2.peek().toString());\n if (flag < 0) {\n mergeQueue.enqueue(q1.dequeue());\n i++;\n } else {\n mergeQueue.enqueue(q2.dequeue());\n j++;\n }\n }\n\n while (i < size1) {\n mergeQueue.enqueue(q1.dequeue());\n i++;\n }\n while (j < size2) {\n mergeQueue.enqueue(q2.dequeue());\n j++;\n }\n\n return mergeQueue;\n }", "private void addToMoveQueue() {\n\t\tSimulation.INSTANCE.getMoveQueue().offer(new Move(prevNode, currentNode));\n\t}", "public static void levelOrderLinewise1(Node node){\r\n Queue<Node> mainq = new ArrayDeque<>();\r\n Queue<Node> childq = new ArrayDeque<>();\r\n \r\n //Adding root in mainq\r\n mainq.add(node);\r\n \r\n while(mainq.size()>0){\r\n //1. get + remove\r\n Node rem = mainq.remove();\r\n \r\n //2. Print \r\n System.out.print(rem.data + \" \");\r\n \r\n //3. Add children of node to Childq\r\n for(Node child : rem.children){\r\n childq.add(child);\r\n }\r\n \r\n //Check if size of mainq got 0 then print \"enter\" and swap the mainq and childq\r\n if(mainq.size()==0){\r\n System.out.println();\r\n Queue<Node> temp = new ArrayDeque<>();\r\n temp = mainq;\r\n mainq = childq;\r\n childq = temp;\r\n }\r\n }\r\n }", "public static LinkedQueue makeQueueOfQueues(LinkedQueue q) {\n // Replace the following line with your solution.\n LinkedQueue overall = new LinkedQueue();\n while (!q.isEmpty())\n {\n try \n {\n LinkedQueue single = new LinkedQueue();\n single.enqueue(q.dequeue());\n overall.enqueue(single);\n } \n catch (QueueEmptyException e) \n {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } \n }\n \n return overall;\n }", "static void levelOrder(Queue<Node> q1) \n\t{\n\t\tif(q1.isEmpty())\n\t\t\treturn;\n\t\tQueue<Node> q=new LinkedList<Node>();\n\t\twhile(!q1.isEmpty()) {\n\t\t\t\n\t\t\tNode temp=q1.poll();\n\t\t\tif(temp.left!=null) {\n\t\t\t\tq.add(temp.left);\n\t\t\t}\n\t\t\tif(temp.right!=null) {\n\t\t\t\tq.add(temp.right);\n\t\t\t}\n\t\t}\n\t\tif(!q.isEmpty())\n\t\t\tSystem.out.println(q.peek().key);\n\t\tlevelOrder(q);\n\t}", "public void enqueue( MyTreeNode<T> treeNode ) {\n\t\tQueueNode newNode = new QueueNode(treeNode);\n\t\t// the queue is empty\n\t\tif ( tail == null ) {\n\t\t\t// the tail and the head point to the same only element in the collection\n\t\t\tthis.tail = newNode;\n\t\t\tthis.head = newNode;\n\t\t// the queue is not empty\n\t\t} else {\n\t\t\t// the second from the end item of the collection keeps track with the tail\n\t\t\tthis.tail.next = newNode;\n\t\t\t// the new element becomes the tail of the collection\n\t\t\tthis.tail = newNode;\n\t\t}\n\t}", "public MyStack() {\n queueA = new LinkedList<>();\n queueB = new LinkedList<>();\n }", "void enqueue(T data) \n { \n \n // Create a new LL node \n LinkedListQueue temp = new LinkedListQueue(data); \n \n // If queue is empty, then new node is front and rear both \n if (this.rear == null) { \n this.front = this.rear = temp; \n return; \n } \n \n // Add the new node at the end of queue and change rear \n this.rear.next = temp; \n this.rear = temp; \n }", "@Test (timeout=5000)\n public void test2Queue() throws IOException {\n Configuration conf = getConfiguration();\n\n QueueManager manager = new QueueManager(conf);\n manager.setSchedulerInfo(\"first\", \"queueInfo\");\n manager.setSchedulerInfo(\"second\", \"queueInfoqueueInfo\");\n\n Queue root = manager.getRoot();\n \n // test children queues\n assertTrue(root.getChildren().size() == 2);\n Iterator<Queue> iterator = root.getChildren().iterator();\n Queue firstSubQueue = iterator.next();\n assertEquals(\"first\", firstSubQueue.getName());\n assertThat(\n firstSubQueue.getAcls().get(\"mapred.queue.first.acl-submit-job\")\n .toString()).isEqualTo(\n \"Users [user1, user2] and members of \" +\n \"the groups [group1, group2] are allowed\");\n Queue secondSubQueue = iterator.next();\n assertEquals(\"second\", secondSubQueue.getName());\n\n assertThat(firstSubQueue.getState().getStateName()).isEqualTo(\"running\");\n assertThat(secondSubQueue.getState().getStateName()).isEqualTo(\"stopped\");\n assertTrue(manager.isRunning(\"first\"));\n assertFalse(manager.isRunning(\"second\"));\n\n assertThat(firstSubQueue.getSchedulingInfo()).isEqualTo(\"queueInfo\");\n assertThat(secondSubQueue.getSchedulingInfo())\n .isEqualTo(\"queueInfoqueueInfo\");\n // test leaf queue\n Set<String> template = new HashSet<String>();\n template.add(\"first\");\n template.add(\"second\");\n assertEquals(manager.getLeafQueueNames(), template);\n }", "public MyQueue() {\n left = new Stack<>();\n right = new Stack<>();\n }", "public static void queueVsStack() {\n\n Queue<String> collection1 = new PriorityQueue<>();\n collection1.add(\"banana\");\n collection1.add(\"orange\");\n collection1.add(\"apple\");\n\n //what will be printed\n System.out.println(collection1.iterator().next());\n\n Deque<String> collection2 = new ArrayDeque<>();\n collection2.addFirst(\"banana\");\n collection2.addFirst(\"apple\");\n collection2.addFirst(\"orange\");\n\n //what will be printed\n System.out.println(collection2.iterator().next());\n\n }", "void enqueue(Node n) {\n if (queueSet.contains(n)) {\n return;\n }\n queueSet.add(n);\n queue.addFirst(n);\n }", "public QueueADT<QuadNode> inOrder2(QuadNode node,QueueADT<QuadNode> queue){\n\t\tif(node==null) { return queue; }\n\t\telse\n\t\t{\n\t\t\tqueue=inOrder1(node.getNorthEast(),queue);\n\t\t\tqueue=inOrder1(node.getNorthWest(),queue);\n\t\t\tif(isLeaf(node)) { queue.enqueue(node); return queue; }\n\t\t\tqueue=inOrder1(node.getSouthEast(),queue);\n\t\t\tqueue=inOrder1(node.getSouthWest(),queue);\n\t\t\treturn queue;\n\t\t}\n\t}", "public QueueADT<QuadNode> order2(QuadNode node, QueueADT<QuadNode> queue) {\n\t\tif (node == null) {\n\t\t\treturn queue;\n\t\t} else {\n\t\t\tqueue = order2(node.getSouthWest(), queue);\n\t\t\tqueue = order2(node.getSouthEast(), queue);\n\t\t\tqueue = order2(node.getNorthWest(), queue);\n\t\t\tqueue = order2(node.getNorthEast(), queue);\n\t\t\tif (isLeaf(node)) {\n\t\t\t\tqueue.enqueue(node);\n\t\t\t\tvisit(node);\n\t\t\t\treturn queue;\n\t\t\t}\n\t\t\treturn queue;\n\t\t}\n\t}", "public static void mergeSort(LinkedQueue q) {\n // Your solution here.\n LinkedQueue temp = ListSorts.makeQueueOfQueues(q);\n if (temp.isEmpty())\n {\n return;\n }\n while (temp.size() != 1)\n {\n try\n {\n Object queueOne = temp.dequeue();\n Object queueTwo = temp.dequeue();\n LinkedQueue temp2 = ListSorts.mergeSortedQueues((LinkedQueue) \n queueOne, (LinkedQueue) queueTwo);\n temp.enqueue(temp2);\n }\n catch (QueueEmptyException e)\n {\n e.printStackTrace(); \n }\n }\n \n try \n {\n q.append((LinkedQueue) temp.dequeue());\n } \n catch (QueueEmptyException e) \n {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } \n }", "public void push(int x) {\n queue2.offer(x);\n while (!queue1.isEmpty()) {\n queue2.offer(queue1.poll());\n }\n Queue<Integer> temp = queue1;\n queue1 = queue2;\n queue2 = temp;\n\n\n }", "public MyStack() {\n queue1=new LinkedList();\n queue2=new LinkedList();\n }", "public void queueUsage() {\n\t\t//use LinkedList as a queue\n\t\tQueue<String> q = new LinkedList<String>();\n\t\tq.add(\"1\");\n\t\tq.add(\"2\");\n\t\tq.add(\"3\");\n\t\tq.add(\"10\");\n\t\tq.add(\"11\");\n\t\tint[] a;\n\n\t\tLinkedBlockingQueue<String> bq = new LinkedBlockingQueue<String>();\n\t\t\n\t\t//ArrayBlockingQueue needs to set the size when created.\n\t\tArrayBlockingQueue<String> aq = new ArrayBlockingQueue<String>(100);\n\t\t\n\t\tPriorityBlockingQueue<String> pq = new PriorityBlockingQueue<String>();\n\t\t\n//\t\tDelayQueue<String> dq = new DelayQueue<String>(); \n\t\t\n\t}", "public QueueADT<QuadNode> postOrder(QuadNode node,QueueADT<QuadNode> queue){\n\t\tif(node==null) { return queue;}\n\t\telse\n\t\t{\n\t\t\tqueue=postOrder(node.getNorthEast(),queue);\n\t\t\tqueue=postOrder(node.getNorthWest(),queue);\n\t\t\tqueue=postOrder(node.getSouthEast(),queue);\n\t\t\tqueue=postOrder(node.getSouthWest(),queue);\n\t\t\tif(isLeaf(node)) { queue.enqueue(node); return queue;}\n\t\t\treturn queue;\n\t\t}\n\t}", "public static void pushCostlyOperation(){\r\n Queue<Integer> queue=new LinkedList<>();\r\n Queue<Integer> supportQueue=new LinkedList<>();\r\n Queue<Integer> testQueue=new LinkedList<>();\r\n for(int i=0;i<10;++i){\r\n while(!queue.isEmpty())\r\n supportQueue.add(queue.poll());\r\n\r\n queue.add(i*i);\r\n testQueue.add(i*i);\r\n while(!supportQueue.isEmpty())\r\n queue.add(supportQueue.poll());\r\n\r\n System.out.println(queue);\r\n System.out.println(testQueue);\r\n System.out.println();\r\n }\r\n }", "static void enQueue(Queue q, int x) {\r\n push(q.stack1, x);\r\n }", "public static void main(String[] args) {\n Queue<Integer> queue = new LinkedListQueue<>();\n\n for (int i = 0; i < 21; i++) {\n queue.enqueue(i);\n System.out.println(queue);\n }\n\n for (int i = 0; i < 16; i++) {\n queue.dequeue();\n System.out.println(queue);\n }\n System.out.println(queue);\n }", "public boolean addToQueue(Passenger p, int index1, int index2, CarPosition c) {\n if (!containsFloor(floors, p.getOrigin())) {\n System.out.println(\"1!\"); \n return false;\n } \n if (!containsFloor(floors, p.getDestination())) {\n System.out.println(\"2!\");\n for(int i = 0; i < floors.length; i++) {\n System.out.print(\" \" + floors[i]);\n }\n return false;\n }\n if (index2 <= index1) {\n return false;\n }\n if (index1 < 0 || index1 > queue.size()) {\n return false;\n }\n if (index2 < 0 || index2 > queue.size() + 1) {\n return false;\n }\n \n ElevatorQueueObject q1 = new ElevatorQueueObject(\n p, ElevatorAction.PICKUP, CarPosition.NULL\n );\n ElevatorQueueObject q2 = new ElevatorQueueObject(\n p, ElevatorAction.DROPOFF, CarPosition.NULL\n );\n \n queue.add(index1, q1);\n queue.add(index2, q2);\n \n return true;\n }", "private void enQueue(int data) {\n\t\tif (front == null && rear == null) {\n\t\t\tNode newNode = new Node(data);\n\t\t\tfront = rear = newNode;\n\t\t\treturn;\n\t\t} else {\n\t\t\tNode newNode = new Node(data);\n\t\t\trear.next = newNode;\n\t\t\trear = newNode;\n\t\t}\n\t}", "public 用栈实现队列() {\n stack1 = new LinkedList<>();\n stack2 = new LinkedList<>();\n }", "public static void showNodeQueue(AYQueue<Node> q)\n {\n for (int i = 0; i < q.size(); i++)\n {\n Node node = q.dequeue();\n System.out.format(\"Element #%d = [%s]%n\", i, node.getNodeID());\n q.enqueue(node);\n } //for\n\n }", "public MyQueue() {\n stk1 = new Stack<>();\n stk2 = new Stack<>();\n }", "private void traversal(List<Node> result, Queue<Node> q ) {\n\t\twhile(!q.isEmpty()) {\r\n\t\t\tNode head = q.poll();\r\n\t\t\tresult.add(head);\r\n\t\t\tif(head.left != null) {\r\n\t\t\t\tq.add(head.left);\r\n\t\t\t}\r\n\t\t\tif(head.right != null) {\r\n\t\t\t\tq.add(head.right);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void bfs()\n{\n Queue q=new LinkedList();\n q.add(this.rootNode);\n printNode(this.rootNode);\n rootNode.visited=true;\n while(!q.isEmpty())\n {\n Node n=(Node)q.remove();\n Node child=null;\n while((child=getUnvisitedChildNode(n))!=null)\n {\n child.visited=true;\n printNode(child);\n q.add(child);\n }\n }\n //Clear visited property of nodes\n clearNodes();\n}", "public void push(int x) {\n // Write your code here\n if (queue1.isEmpty() && queue2.isEmpty()) {\n queue1.offer(x);\n } else if (!queue1.isEmpty()) {\n queue1.offer(x);\n } else {\n queue2.offer(x);\n }\n }", "public interface Queue {\n\tpublic Set getGatheredElements();\n\tpublic Set getProcessedElements();\n\tpublic int getQueueSize(int level);\n\tpublic int getProcessedSize();\n\tpublic int getGatheredSize();\n\tpublic void setMaxElements(int elements);\n\tpublic Object pop(int level);\n\tpublic boolean push(Object task, int level);\n\tpublic void clear();\n}", "public void enqueue (Item item){\n Node<Item> oldLast = last;\n last = new Node<Item>();\n last.item = item;\n last.next = null;\n if(isEmpty()) {first = last;}\n else oldLast.next = last;\n N++;\n }", "public void bfs(Queue<Integer> queue, int visited[]) {\n if (queue.isEmpty()) {\n return;\n }\n\n int root = queue.poll();\n\n if (visited[root] == 1) {\n bfs(queue, visited);\n return;//alreadu into consideration\n }\n\n\n System.out.printf(\"Exploring of node %d has started\\n\", root);\n visited[root] = 1;\n\n\n for (int i = 0; i < adjMatrix[root].size(); i++) {\n if (visited[adjMatrix[root].get(i)] == 1 || visited[adjMatrix[root].get(i)] == 2) {\n continue;\n }\n queue.add(adjMatrix[root].get(i));\n }\n bfs(queue, visited);\n System.out.printf(\"Exploring of node %d has end\\n\", root);\n visited[root] = 2;\n }", "public static Deque<Integer> merge(Deque<Integer> d1, Deque<Integer> d2) {\n int size1=d1.getSize();\n int size2=d2.getSize();\n LinkedListDeque<Integer> deque=new LinkedListDeque();\n\n int count1 =0, count2=0;\n \n int length = size1+size2;\n \n \n \n int temp1=0;\n int temp2=0;\n \n \n \n for(int i=0; i<length; i++){\n \n try {\n temp1 = d1.popFromFront();\n } catch (Exception ex) {\n System.out.println(ex.getMessage());\n }\n \n try {\n temp2 = d2.popFromFront();\n } catch (Exception ex) {\n System.out.println(ex.getMessage());\n }\n \n if(count1==size1){\n deque.pushToBack(temp2);\n count2++;\n }else if(count2 == size2){\n deque.pushToBack(temp1);\n count1++;\n }\n else if(temp1<temp2){\n deque.pushToBack(temp1);\n count1++;\n d2.pushToFront(temp2);\n } else{\n deque.pushToBack(temp2);\n d1.pushToFront(temp1);\n count2++; \n }\n \n }\n \n \n\nreturn deque;\n}", "public static void levelOrderLinewise3(Node node){\r\n Queue<Node> mainq = new ArrayDeque<>();\r\n \r\n //Adding root in mainq\r\n mainq.add(node);\r\n \r\n while(mainq.size()>0){\r\n \r\n //Size of queue is obtained and then we iterate it for size times, this will ensure for printing for same level\r\n int sz = mainq.size();\r\n \r\n while(sz > 0){\r\n //1. get + remove\r\n Node rem = mainq.remove();\r\n \r\n //2. Print \r\n System.out.print(rem.data + \" \");\r\n \r\n //3. Add children of node to mainq\r\n for(Node child : rem.children){\r\n mainq.add(child);\r\n }\r\n sz--;\r\n } \r\n //Above level completed so print \"Enter\"\r\n System.out.println();\r\n }\r\n }", "public static void main(String[] args) {\n CircleArrayQueue circleArrayQueue = new CircleArrayQueue(4);\n circleArrayQueue.addQueue(1);\n circleArrayQueue.addQueue(2);\n circleArrayQueue.addQueue(3);\n System.out.println(circleArrayQueue.getQueue());\n circleArrayQueue.showQueue();\n// System.out.println(circleArrayQueue.getQueue());\n// System.out.println(circleArrayQueue.getQueue());\n circleArrayQueue.addQueue(4);\n circleArrayQueue.showQueue();\n\n System.out.println(circleArrayQueue.getQueue());\n circleArrayQueue.showQueue();\n\n circleArrayQueue.addQueue(5);\n circleArrayQueue.showQueue();\n System.out.println(circleArrayQueue.getQueue());\n circleArrayQueue.showQueue();\n\n circleArrayQueue.addQueue(5);\n circleArrayQueue.showQueue();\n// System.out.println(circleArrayQueue.getQueue());\n }", "public void breadthFirst() {\n\t\tQueue<Node> queue = new ArrayDeque<>();\n\t\tqueue.add(root);\n\t\twhile(!queue.isEmpty()) {\n\t\t\tif(queue.peek().left!=null)\n\t\t\t\tqueue.add(queue.peek().left);\n\t\t\tif(queue.peek().right!=null)\n\t\t\t\tqueue.add(queue.peek().right);\n\t\t\tSystem.out.println(queue.poll().data);\n\t\t}\n\t}", "public void enqueue(Item item) \n {\n stack1.push(item);\n }", "public void breadthFirstSearch(){\n Deque<Node> q = new ArrayDeque<>(); // In an interview just write Queue ? Issue is java 8 only has priority queue, \n // meaning I have to pass it a COMPARABLE for the Node class\n if (this.root == null){\n return;\n }\n \n q.add(this.root);\n while(q.isEmpty() == false){\n Node n = (Node) q.remove();\n System.out.print(n.val + \", \");\n if (n.left != null){\n q.add(n.left);\n }\n if (n.right != null){\n q.add(n.right);\n }\n }\n }", "public void push(int x) {\n if(!queueA.isEmpty()){\n queueA.add(x);\n }else if(!queueB.isEmpty()){\n queueB.add(x);\n }else{\n queueA.add(x);\n }\n }", "public QueueExplorator() {\n\t\tqueue = new LinkedQueue<Square>();\t\n\t}", "public void enQueue(LinkedListQueue queue)\n {\n if(queue == null){throw new IllegalArgumentException();}\n if(queue == this){throw new IllegalArgumentException();}\n\n if(this.isEmpty())\n {\n this.front = queue.front;\n this.rear = queue.rear;\n }\n else\n {\n if(!queue.isEmpty())\n {\n this.rear.setNext(queue.front);\n this.rear = queue.rear;\n }\n }\n\n queue.removeAll();\n }", "public void enqueue(X item) {\n QueueNode<X> new_last = new QueueNode<X>(item);\n if (last != null)\n last.next = new_last;\n last = new_last;\n if (first == null)\n first = last;\n }", "public void enqueue(E item) {\n Node<E> oldlast = last;\n last = new Node<E>();\n last.item = item;\n last.next = null;\n if (isEmpty()) first = last;\n else oldlast.next = last;\n n++;\n }", "void enqueue(int idNumber, int arrival_time) \r\n\t { \r\n\t \r\n\t // Create a new LL node \r\n\t QNode temp = new QNode(idNumber, arrival_time); \r\n\t \r\n\t // If queue is empty, then new node is front and rear both \r\n\t if (this.rear == null) \r\n\t { \r\n\t this.front = this.rear = temp; \r\n\t size++;\r\n\t maxSize++;\r\n\t return; \r\n\t } \r\n\t \r\n\t // Add the new node at the end of queue and change rear \r\n\t else {\r\n\t \tthis.rear.next = temp;\r\n\t \tthis.rear = temp; \r\n\t \tsize++;\r\n\t \tmaxSize++;\r\n\t }\r\n\t \r\n\t }", "public void pop() {\n // Write your code here\n if (!queue1.isEmpty()) {\n while (queue1.size() > 1) {\n queue2.offer(queue1.poll());\n }\n queue1.poll();\n } else if (!queue2.isEmpty()) {\n while (queue2.size() > 1) {\n queue1.offer(queue2.poll());\n }\n queue2.poll();\n }\n }", "String addReceiveQueue();", "public void swapEventQueues ()\r\n {\n myNextEventQueue.addAll(0, myCurrentEventQueue);\r\n myCurrentEventQueue.clear();\r\n\r\n LinkedList<IFiredEvent> temp = myCurrentEventQueue;\r\n\r\n myCurrentEventQueue = myNextEventQueue;\r\n // for memory efficiency, recycle the old queue\r\n myNextEventQueue = temp;\r\n myNextEventQueue.clear();\r\n }", "public void enQueue(Object data)\n {\n Node temp = new Node(data, null);\n if(this.isEmpty())\n {\n this.front = temp;\n this.rear = temp;\n }\n else\n {\n this.rear.setNext(temp);\n this.rear = temp;\n }\n }", "@Builds(rule=\"<sub>\")\n\t\tprivate void handleSub(Deque<Object> q)\n\t\t{\n\t\t\tDummyObject o2 = (DummyObject) q.pop(); // o2\n\t\t\tDummyObject o1 = (DummyObject) q.pop(); // o1\n\t\t\tq.pop(); // symbol\n\t\t\tAdd a = new Add();\n\t\t\ta.left = o1;\n\t\t\ta.right = o2;\n\t\t\tq.push(a);\n\t\t}", "@Override\n\tpublic void enqueue(E e) {\n\t\tNode node = new Node();\n\t\tnode.element = e;\n\t\tnode.next = null;\n\t\t\n\t\tif (last != null)\n\t\t\tlast.next = node;\n\t\telse\n\t\t\tfirst = node;\n\t\tlast = node;\n\t\t\n\t}", "public MyStack2() {\n q1 = new ArrayDeque<>();\n q2 = new ArrayDeque<>();\n }", "public static int runBFS(int[][]map, coordinate src1, coordinate src2){\n\t \n boolean visited[][] = new boolean[dim][dim]; //visited boolean 2d array that is the same size as 2d map\n coordinate visit1[][]=new coordinate[dim][dim]; // this is the one used to hold previous location\n coordinate visit2[][]=new coordinate[dim][dim]; // this is the one used to hold previous location\n\t \n\t visit1[0][0]=new coordinate(0,0); //same as BFS\n \n\t visit2[dim-1][dim-1] = new coordinate(dim-1,dim-1);\n\t //marked both the 0,0 and dim-1, dim-1 srcs as visited\n\t \n\t Queue<QueueNode> queue1 = new LinkedList<>(); //queue for src1\n\t Queue<QueueNode> queue2 = new LinkedList<>(); //queue for src2\n\t \n\t QueueNode sn1 = new QueueNode(src1, 0, src1); //src node 1 queue node\n\t QueueNode sn2 = new QueueNode(src2, 0, src2);\n\t \n\t ArrayList<coordinate> pathHold1 = new ArrayList<>(); //for first path\n\t ArrayList<coordinate> pathHold2 = new ArrayList<>(); //for second path \n\t \n\t visited[src1.x][src1.y] = true; //mark the start node as visited inside of the visited boolean 2d array for first src\n\t visited[src2.x][src2.y] = true; //mark the start node as visited inside of the visited boolean 2d array for second src\n\t \n\t System.out.println();\n\t \n\t queue1.add(sn1);\n\t queue2.add(sn2);\n\t //added the start nodes\n\t \n\t QueueNode current1 = null;\n\t QueueNode current2 = null;\n\t //to be used later to hold current node being looked at\n\t coordinate c1 = null;\n\t coordinate c2 = null;\n\t\t//coordinates to be examined\n\t \n\t while(!queue1.isEmpty()&&!queue2.isEmpty()){\n\t //keep iterating so long as queues have items -- but if one becomes empty, check at each iteration\n\t\t\t//to avoid null pointer so we are not dequeuing from empty queue\n int maxFringe = 0;\n\t\t//use this to check max fringe at each time we add to either queue\n if(queue1.size()>maxFringe || queue2.size()>0) {\n \t if(queue1.size()>maxFringe) {\n \t\t maxFringe=queue1.size();\n \t }else {\n \t\t maxFringe=queue2.size();\n \t }\n }\n\t \n\t \tif(!queue1.isEmpty()) { \n\t\t\t\t//while first queue is not empty, pop\n\t \t\t current1 = queue1.peek(); // this is n\n\t c1 = current1.point;\n\t \t\t visited[c1.x][c1.y]=true; //mark this node as visited, will check neighbors later\n\t boolean inFringe = false;\n\t inFringe = compareFringe(c1, queue2); //see if intersect or not\n\t \n\t \n\t // compare current point to the queue2 fringe. If not in fringe\n\t if(inFringe) {\n\t \t //we have found the duplicate \n\t \t System.out.println(\"duplicate\");\n\t \t intersect = c1;\n\t\t System.out.println(\"Intersect is :\"+c1.x+\",\"+c1.y);\n\t\t visit1[c1.x][c1.y]=current1.prev; //set prev node or where we came from\n\t\t \n\t\t System.out.println(\"We have reached our goal!\");\n\t\t \n\t\t if(current2 != null) {\n\t\t\t\t\t //so long as paths have values, add length and return\n\t\t return current1.pathTotal+current2.pathTotal;\n\t\t }else {\n\t\t\t\t\t //else return only one path \n\t\t \t return current1.pathTotal;\n\t\t }\n\t }\n\t\t\t\t//this is getting the neighbors, same as BFS\n\t \n\t int row1 = 0;\n\t int col1 = 0;\n\t \n\t for (int i = 0; i < 4; i++) { \n\t row1= c1.x + rowNum1[i]; \n\t col1 = c1.y + colNum1[i]; \n\t //grab neighbor of current\n\t if (cellValid(row1, col1) && map[row1][col1] == 1 && !visited[row1][col1]){ \n\t \t \n\t // mark cell as visited and enqueue it \n\t visited[row1][col1] = true; //we visited the node so mark it\n\t visit1[row1][col1] = new coordinate(c1.x, c1.y); //set prev as current coord\n\n\t QueueNode Adjcell = new QueueNode(new coordinate(row1, col1), current1.pathTotal + 1, new coordinate(row1-rowNum1[i], col1-colNum1[i])); \n\t queue1.add(Adjcell); //make it a queueNode to add to q1 for first path\n\t }else if(cellValid(row1, col1) && map[row1][col1] == 1 && (visited[row1][col1]&&visit2[row1][col1]!=null)){\n\t \t // System.out.println(\"already visited\"+row1+\",\"+col1); \n\t\t\t\t //check if already visited and valid (not off grid) and = 1 so we can take path -- \n\t\t\t\t //if so, this means we found intersect\n\t\t\t\t //make sure node has been visited in other path to guarantee it is intersect\n\t \t intersect=new coordinate(row1,col1); //set intersect\n\t \t visit1[intersect.x][intersect.y]=new coordinate(c1.x, c1.y); //set where we came from\n\t \t //current1.pathTotal++;\n\t \t printfin(visit1, visit2); //used to print final path -- set map\n \n int nodesExplored1 = 0;\n int nodesExplored2 = 0;\n for(coordinate coor : pathHold1){\n nodesExplored1++;\n }\n for(coordinate coor : pathHold2){\n nodesExplored2++;\n }\n\t\t\t\t \n\t\t\t\t //get number of nodes expanded in each path, add together\n\n int fin = nodesExplored1+nodesExplored2; //this is final explored nodes in each path\n System.out.println(\"Nodes explored: \" + fin);\n \n\t \t return pathsize; //return total pathsize\n\t \t //break;\n\t }\n\t \n\t \n\t } \n\t //once all of the neighbors have been visited, dequeue from queue 1 in path 1\n\t queue1.remove(); \n\t pathHold1.add(c1); //add to explored\n\t \n\t }\n\t \t//now to the same in path2 from (dim-1, dim-1) as src2\n\t \tif(!queue2.isEmpty()) {\n\t \t\t\n\t \t\t current2 = queue2.peek(); // this is n\n\t c2 = current2.point;\n\t \t\t visited[c2.x][c2.y]=true;\n\t boolean inFringe = false;\n\t inFringe = compareFringe(c2, queue1);\n\t \n\t // compare current point to the queue2 fringe. If not in fringe\n\t if(inFringe) {\n\t \t //we have found the duplicate \n\t \t System.out.println(\"duplicate\");\n\t \t intersect = c2;\n\t\t // System.out.println(\"Intersect is :\"+c2.x+\",\"+c2.y);\n\t\t visit2[c2.x][c2.y]=current2.prev;\n\t\t \n\t\t System.out.println(\"We have reached our goal!\");\n\t\t \n\t\t \n\t\t if(current1 != null) {\n\t\t\t return current1.pathTotal+current2.pathTotal;\n\t\t\t }else {\n\t\t\t \t return current2.pathTotal;\n\t\t\t }\n\t }\n\t \n\t \t// get neighbors\n\t int row2 = 0;\n\t int col2 = 0;\n\t \n\t for (int i = 0; i < 4; i++) { \n\t row2= c2.x + rowNum2[i]; \n\t col2 = c2.y + colNum2[i]; \n\t \n\t \n\t if (cellValid(row2, col2) && map[row2][col2] == 1 && !visited[row2][col2]){ \n\t \t \n\t // mark cell as visited and enqueue it \n\t visited[row2][col2] = true; \n\t visit2[row2][col2] = new coordinate(c2.x, c2.y);\n\n\t QueueNode Adjcell2 = new QueueNode(new coordinate(row2, col2), current2.pathTotal + 1, new coordinate(row2-rowNum2[i], col2-colNum2[i])); \n\t queue2.add(Adjcell2);\n\t }else if(cellValid(row2, col2) && map[row2][col2] == 1 && (visited[row2][col2]&&visit1[row2][col2]!=null)){\n\t \t \n\t \t intersect=new coordinate(row2,col2);\n\t \t \n\t \t visit2[intersect.x][intersect.y]=new coordinate(c2.x, c2.y);\n\t \n\t \n\t printfin(visit1, visit2);\n\t int nodesExplored1 = 0;\n int nodesExplored2 = 0;\n for(coordinate coor : pathHold1){\n nodesExplored1++;\n }\n for(coordinate coor : pathHold2){\n nodesExplored2++;\n }\n\n int fin = nodesExplored1+nodesExplored2;\n System.out.println(\"Nodes explored: \" + fin);\n\t \t return pathsize;\n\t \t \n\t }\n\t \n\t } \n\t //once all of the neighbors have been visited, dequeue \n\t queue2.remove(); \n\t pathHold2.add(c2);\n\t \t\t\n\t \t}\n\n\t }\n \n int nodesExplored1 = 0;\n int nodesExplored2 = 0;\n for(coordinate coor : pathHold1){\n nodesExplored1++;\n }\n for(coordinate coor : pathHold2){\n nodesExplored2++;\n }\n\n int fin = nodesExplored1+nodesExplored2;\n System.out.println(\"Nodes explored: \" + fin);\n\t //if here, means no path was found\n\t return -1;\n\t \n\t }", "public MyQueue() {\n rearStack = new Stack();\n frontStack = new Stack();\n }", "void enqueue(Node n) {\r\n\t\tEntry add = new Entry(n);\r\n\t\tlast.prev.nextSet(add);\r\n\t\tadd.prevSet(last.prev);\r\n\t\tadd.nextSet(last);\r\n\t\tlast.prevSet(add);\r\n\t\tlength++;\r\n\t}", "void dequeue() \n { \n // If queue is empty, return NULL. \n if (this.front == null) \n return; \n \n // Store previous front and move front one node ahead \n LinkedListQueue temp = this.front; \n this.front = this.front.next; \n \n // If front becomes NULL, then change rear also as NULL \n if (this.front == null) \n this.rear = null; \n }", "private Queue<Integer> breadthSearch(int i, int j, Queue<Integer> queue, Queue<Integer> path) {\n while(queue.size() != 0) {\n queue.poll();\n }//while\n return new LinkedList();\n }", "public QueueADT<QuadNode> order1(QuadNode node, QueueADT<QuadNode> queue) {\n\t\tif (node == null) {\n\t\t\treturn queue;\n\t\t}\n\t\tif (isLeaf(node)) {\n\t\t\tqueue.enqueue(node);\n\t\t\tvisit(node);\n\t\t\treturn queue;\n\t\t} else {\n\t\t\tqueue = order1(node.getNorthEast(), queue);\n\t\t\tqueue = order2(node.getNorthWest(), queue);\n\t\t\tqueue = order3(node.getSouthEast(), queue);\n\t\t\tqueue = order4(node.getSouthWest(), queue);\n\t\t\treturn queue;\n\t\t}\n\t}", "public void addQueue(SensorData latest) {\r\n//\t\tMap<String,Integer> latestLog = latest.getSSIDs();\r\n//\t\tLog.v(LOG_TAG, latestLog.keySet().toString());\r\n// \tif( latestLog!=null && passedLog!=null ){\r\n// \tdouble nowRatio = OverlapRatio.between( latestLog, passedLog );\r\n// \tif( nowRatio!=-1 && nowRatio!=0 ){\r\n// \ttimeQueue.add( latest.getTime( MatchingConstants.PARAM_STRING[MatchingConstants.SN_WiFi] ) );\r\n// \toverlapRatioQueue.add( (float)nowRatio );\r\n// \tFloat f = overlapRatioQueue.getLast();\r\n// \tif( f!=null ){\r\n// \tLog.v( LOG_TAG, \"NowRatio=\" + f.toString() + \",Size=\" + overlapRatioQueue.size() );\r\n// \t}\r\n// \t}\r\n// \t}\r\n// \tpassedLog = latestLog;\r\n\t}", "private void fillQueue(Node node) {\n if (node == null) {\n return;\n }\n fillQueue(node.leftChild);\n queue.offer(node.value);\n fillQueue(node.rightChild);\n }", "public I0304MyQueue() {\n nums = new Stack<>();\n temp = new Stack<>();\n }", "public MyQueue() {\n s1 = new Stack<>();\n s2 = new Stack<>();\n }", "public QueueHandler(int numberOfQueues){\n queues = new ArrayList<LinkedList<Passenger>>();\n closed = false;\n \n for(int i = 0; i < numberOfQueues; i++) {\n \tqueues.add(new LinkedList<Passenger>());\n }\n }", "public void enqueue(Item item){\r\n\t\tNode<Item> newNode = new Node<Item>();\r\n\t\tnewNode.item = item;\r\n\t\tnewNode.next = null;\r\n\t\tif(last == null){\r\n\t\t\tfirst = newNode;\r\n\t\t}\r\n\t\telse\r\n\t\t\tlast.next = newNode;\r\n\t\tlast = newNode;\r\n\t}", "private void updateQueues(CSQueueStore existingQueues,\n CSQueueStore newQueues) {\n CapacitySchedulerConfiguration conf = csContext.getConfiguration();\n for (CSQueue queue : newQueues.getQueues()) {\n if (existingQueues.get(queue.getQueuePath()) == null) {\n existingQueues.add(queue);\n }\n }\n\n for (CSQueue queue : existingQueues.getQueues()) {\n boolean isDanglingDynamicQueue = isDanglingDynamicQueue(\n newQueues, existingQueues, queue);\n boolean isRemovable = isDanglingDynamicQueue || !isDynamicQueue(queue)\n && newQueues.get(queue.getQueuePath()) == null\n && !(queue instanceof AutoCreatedLeafQueue &&\n conf.isAutoCreateChildQueueEnabled(queue.getParent().getQueuePath()));\n\n if (isRemovable) {\n existingQueues.remove(queue);\n }\n }\n\n }", "public static void main(String[] args) {\n Queue<QueueData> q1 = new LinkedList<>();\n List<String> testArList = new ArrayList<>();\n testArList.add(0, \"1\");\n for (int i = 0; i < 10; i++){\n // ArrayList의 add와 같은 기능을 가졌다.\n // 하지만, 자료구조의 특성상, 특정 인덱스에 add하는 메소드는 없다.\n q1.add(new QueueData(i, (int) (Math.random() * 1000)));\n }\n System.out.println(q1);\n // peek() : 0번째 인덱스 즉 head에 해당하는 데이터를 살펴본다. 해당 데이터가 없을 경우\n // null이 출력된다. 검색된 데이터는 삭제되지 않고 그대로 남는다.\n System.out.println(q1.peek());\n System.out.println(\"peek\");\n System.out.println(q1);\n\n // element() : peek과 동일한 기능을 가졌지만, 차이점은 해당 데이터가 없을때,\n // 예외처리를 해준다.\n System.out.println(q1.element());\n System.out.println(\"element\");\n System.out.println(q1);\n\n // Enqueue : 추가\n q1.offer(new QueueData(q1.size(), (int) (Math.random() * 1000))); // 실패시 예외발생\n System.out.println(\"offer\");\n System.out.println(q1);\n q1.add(new QueueData(q1.size(), (int) (Math.random() * 1000))); // 실패시 false 리턴\n System.out.println(\"add\");\n System.out.println(q1);\n\n // Dequeue : 삭제\n q1.remove(); // 삭제 실패시, 예외 발생\n System.out.println(\"remove\");\n System.out.println(q1);\n System.out.println(\"poll\");\n q1.poll(); // 실패시 false 리턴\n System.out.println(q1);\n \n // 조건부 삭제\n System.out.println(\"remove if idx % 10 == 0\");\n q1.removeIf(queueData -> queueData.idx % 10 == 0);\n System.out.println(q1);\n\n // priority Queue(우선순위 큐)\n // 가장 가중치가 낮은 순서로 poll, peek()을 할 수 있는 자료구조다.\n // Min Heap로 데이터를 sort 시켜놓고 출력하는 자료구조.\n // 데이터의 크기를 뒤죽박죽 아무렇게 넣어도 의도에 따라 오름차순 혹은 내림차순으로\n // poll(), peek() 할 수 있다.\n Queue<QueueData> pQueue = new PriorityQueue<>();\n pQueue.add(new QueueData(0, (int) (Math.random() * 1000)));\n pQueue.add(new QueueData(9, (int) (Math.random() * 1000)));\n pQueue.add(new QueueData(2, (int) (Math.random() * 1000)));\n pQueue.add(new QueueData(5, (int) (Math.random() * 1000)));\n pQueue.add(new QueueData(4, (int) (Math.random() * 1000)));\n\n System.out.println(pQueue.poll());\n System.out.println(pQueue.poll());\n System.out.println(pQueue.poll());\n System.out.println(pQueue.poll());\n System.out.println(pQueue.remove()); // 더이상 삭제할 수 없을 때, 예외처리(프로그램 종료)\n System.out.println(pQueue.poll()); // 더이상 삭제할 수 없을 때, null 출력\n System.out.println(pQueue.size());\n }", "private static <T> boolean equalsDeque(Deque<T> queue1, Deque<T> queue2) {\n if (queue1.size() != queue2.size()) { return false; }\n List<T> copy1 = new ArrayList<>(queue1);\n List<T> copy2 = new ArrayList<>(queue2);\n return copy1.equals(copy2);\n }", "public static void main(String[] args) {\n\t\tQueue<Integer> queue = new LinkedList<>();\n\t\t// Add elements\n\t\tqueue.offer(10);\n\t\tqueue.offer(2);\n\t\tqueue.offer(3);\n\t\tqueue.offer(4);\n\t\tqueue.offer(5);\n\t\tqueue.offer(6);\n\t\tqueue.offer(9);\n\t\t// Remove an element from the [front]\n\t\tqueue.poll();\n\t\t// Take a look at the front element\n\t\tint frontElement = queue.peek();\n\t\t// Get the size of the queue\n\t\tint queueSize = queue.size();\n\t\t// Determine whether the queue is empty\n\t\tboolean isEmptyQueue = queue.isEmpty();\n\t\tSystem.out.println(\"A Queue: front element is \" + frontElement + \" with size of \" + queueSize);\n\t\t\n\t\tSystem.out.println(maxInQueue1(queue));\n\t\tSystem.out.println(maxInQueue2(queue));\n\n\t\t// Create an empty stack [Double end queue]\n\t\tDeque<Integer> stack = new LinkedList<>();\n\t\t// Add elements\n\t\tstack.push(1);\n\t\tstack.push(2);\n\t\tstack.push(3);\n\t\tstack.push(4);\n\t\tstack.push(5);\n\t\t// Remove an element from the [top]\n\t\tstack.pop();\n\t\t// Take a look at the [top] element\n\t\tint topElement = stack.peek();\n\t\t// Get the size of the stack\n\t\tint stackSize = stack.size();\n\t\t// Determine whether the queue is empty\n\t\tboolean isEmptyStack = stack.isEmpty();\n\t\tSystem.out.println(\n\t\t\t\t\"A stack(implemented with deque): top element is \" + topElement + \" with size of \" + stackSize);\n\t\n\t\tSystem.out.println(sumOfStack1(stack)); // 10\n\t\tSystem.out.println(sumOfStack2(stack)); // 10, also clear the stack.\n\t\tSystem.out.println(sumOfStack1(stack)); // 0\n\t\tSystem.out.println(9_0000_0012); // 0\n\t}", "public void enqueue(T item) {\n\t\tNode<T> oldlast = last;\n\t\tlast = new Node<>();\n\t\tlast.item = item;\n\t\tlast.next = null;\n\t\tif (isEmpty()) first = last;\n\t\telse oldlast.next = last;\n\t\tN++;\n\t}", "public StackWithOneQueue() {\n this.queue = new LinkedList<>();\n }", "public void queue(Object newItem){\n if(isFull()){\n System.out.println(\"queue is full\");\n return;\n }\n ArrayQueue[++rear] = newItem;\n if(front == -1)\n front = 0;\n \n }", "static WeakOrderQueue newQueue(Recycler.Stack<?> stack, Thread thread)\r\n/* 233: */ {\r\n/* 234:260 */ WeakOrderQueue queue = new WeakOrderQueue(stack, thread);\r\n/* 235: */ \r\n/* 236: */ \r\n/* 237:263 */ stack.setHead(queue);\r\n/* 238:264 */ return queue;\r\n/* 239: */ }", "public void push(int x) {\n if (queue1.isEmpty() && queue2.isEmpty()){\n queue1.offer(x);\n }else {\n if (!queue1.isEmpty()){\n queue1.offer(x);\n }\n if (!queue2.isEmpty()){\n queue2.offer(x);\n }\n }\n }", "public interface MyQueue {\n\n // add to tail\n void enqueue(Object obj);\n\n // remove from head\n Object dequeue();\n\n}", "public MyQueue2() {\n storeStack = new Stack<>();\n }", "public int top() {\n // Write your code here\n int ret = 0;\n if (!queue1.isEmpty()) {\n while (queue1.size() > 1) {\n queue2.offer(queue1.poll());\n }\n ret = queue1.peek();\n queue2.offer(queue1.poll());\n } else if (!queue2.isEmpty()) {\n while (queue2.size() > 1) {\n queue1.offer(queue2.poll());\n }\n ret = queue2.peek();\n queue1.offer(queue2.poll());\n }\n return ret;\n }", "public static void main(String[] args) {\n\t\t\n\t\tStackUsing2Queues my=new StackUsing2Queues();\n\t\tmy.push(1);\n\t\tmy.push(2);\n\t\tmy.push(3);\n\t\tmy.push(4);\n\t\t\n\t\tSystem.out.println(my.poll());\n\t\tSystem.out.println(my.top());\n\t\tSystem.out.println(my.poll());\n\t\tmy.push(5);\n\t\tSystem.out.println(my.top());\n\t\tSystem.out.println(my.poll());\n\t\tSystem.out.println(my.poll());\n\n\t}", "public static void main(String[] args) {\n Queue queue = new Queue();\n // Inserting elements in Circular Queue\n queue.enQueue(24);\n queue.enQueue(94);\n queue.enQueue(6);\n queue.enQueue(18);\n queue.enQueue(20);\n queue.enQueue(19);\n queue.enQueue(11);\n\n // Display elements present in Circular Queue\n queue.displayQueue();\n\n // Deleting elements from Circular Queue\n System.out.println(\"Deleted value = \" + queue.deQueue());\n System.out.println(\"Deleted value = \" + queue.deQueue());\n\n // Remaining elements in Circular Queue\n queue.displayQueue();\n\n queue.enQueue(1);\n queue.enQueue(92);\n queue.displayQueue();\n }", "public QueueADT<QuadNode> inOrder1(QuadNode node,QueueADT<QuadNode> queue) {\n\t\tif(node==null) { return queue; }\n\t\telse\n\t\t{\n\t\t\tqueue=inOrder1(node.getNorthEast(),queue);\n\t\t\tif(isLeaf(node)) { queue.enqueue(node); return queue;}\n\t\t\tqueue=inOrder1(node.getNorthWest(),queue);\n\t\t\tqueue=inOrder1(node.getSouthEast(),queue);\n\t\t\tqueue=inOrder1(node.getSouthWest(),queue);\n\t\t\treturn queue;\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tCreate_queue new_queue= new Create_queue();\n\t\tnew_queue.enqueu(12);\n\t\tnew_queue.enqueu(5);\n\t\tnew_queue.enqueu(36);\n\t\tnew_queue.enqueu(5);\n\t\tSystem.out.println(new_queue);\n\t\tnew_queue.dequeu();\n\t\tSystem.out.println(new_queue);\n\t\tnew_queue.enqueu(10);\n\t\tnew_queue.enqueu(8);\n\t\tnew_queue.enqueu(2);\n\t\tnew_queue.enqueu(14);\n\t\tSystem.out.println(new_queue);\n\t\tnew_queue.dequeu();\n\t\tnew_queue.dequeu();\n\t\tSystem.out.println(new_queue);\n\t\tSystem.out.println(new_queue);\n\t\tnew_queue.enqueu(32);\n\t\tnew_queue.enqueu(11);\n\t\tnew_queue.enqueu(21);\n\t\tnew_queue.enqueu(44);\n\t\tnew_queue.enqueu(46);\n\t\tSystem.out.println(new_queue);\n\t\tnew_queue.enqueu(50);\n\t\tSystem.out.println(new_queue);\n\t\tnew_queue.dequeu();\n\t\tSystem.out.println(new_queue);\n\t\tnew_queue.enqueu(100);\n\t\tSystem.out.println(new_queue);\n\t\tSystem.out.println(new_queue.peek());\n\t\tnew_queue.dequeu();\n\t\tSystem.out.println(new_queue.peek());\n\t\t\n\t\t\n\t}", "public void push(int x) {\n if(q1.isEmpty()) {\n q1.add(x);\n while(q2.size() > 0) {\n q1.add(q2.poll());\n }\n } else {\n q2.add(x);\n while(q1.size() > 0){\n q2.add(q1.poll());\n }\n }\n }", "public TwoStaImpQue() {\n this.stack1 = new Stack<>();\n this.stack2 = new Stack<>();\n }", "public void push(int x) {\n \n q2.offer(x);\n \n while(!q1.isEmpty()) {\n q2.offer(q1.poll());\n }\n \n Queue tmp = q1;\n q1 = q2;\n q2 = tmp;\n \n }", "public MyQueue232() {\n stackIn = new Stack<Integer>();\n stackOut = new Stack<Integer>();\n isIn = true;\n }", "public void enqueue ()\n {\n count++;\n questionList.add(newQuestion);\n //System.out.println(\"Question #\"+ totNumQ + \" is added to the queue.\");\n }", "public MyQueue() {\n s1 = new Stack<Integer>();\n s2 = new Stack<Integer>();\n }", "public HuffmanTree(Queue<Node> queue) {\r\n while (queue.size() > 1) {\r\n Node left = queue.poll();\r\n Node right = queue.poll();\r\n Node node = new Node('-', left.f + right.f, left, right);\r\n queue.add(node);\r\n }\r\n this.root = queue.peek();\r\n\r\n //initial two maps\r\n this.initialTable(this.root, \"\");\r\n\r\n }", "static int deQueue(Queue q) {\r\n int x;\r\n\r\n /* If both stacks are empty then error */\r\n if (q.stack1.isEmpty() && q.stack2.isEmpty()) {\r\n System.out.println(\"Q is empty\");\r\n System.exit(0);\r\n }\r\n\r\n /*\r\n * Move elements from stack1 to stack 2 only if\r\n * stack2 is empty\r\n */\r\n if (q.stack2.isEmpty()) {\r\n while (!q.stack1.isEmpty()) {\r\n x = pop(q.stack1);\r\n push(q.stack2, x);\r\n }\r\n }\r\n x = pop(q.stack2);\r\n return x;\r\n }", "public static void main(String[] args) {\n\t\tCircularQueueTwo cq = new CircularQueueTwo();\r\n\t\t\tcq.enqueue(1);\r\n\t\t\tcq.enqueue(2);\r\n\t\t\tcq.enqueue(3);\r\n\t\t\tcq.enqueue(4);\r\n\t\t\tcq.enqueue(5);\r\n\t\t\tcq.enqueue(6);\r\n\t\t\tcq.enqueue(7);\r\n\t\t\tcq.enqueue(8);\r\n\t\t\tcq.enqueue(9);\r\n\t\t\tcq.enqueue(10);\r\n\t\t\r\n\t\t\tcq.printQueue();\r\n\t\t\tcq.dequeue();\r\n\t\t\tcq.printQueue();\r\n\t\t\tcq.enqueue(11);\r\n\t\t\tcq.printQueue();\r\n\t\t\tcq.dequeue();\r\n\t\t\tcq.dequeue();\r\n\t\t\tcq.printQueue();\r\n\r\n\t\t\tcq.enqueue(12);\r\n\t\t\tcq.printQueue();\r\n\r\n\r\n\t}", "private void addRootNodeToQueue(Queue<Node> queue) {\n final Integer INDEX_BEFORE_SOURCE_START = -1;\n ArrayList<Integer> indexesBeforeSourceStart = new ArrayList<Integer>();\n indexesBeforeSourceStart.add(INDEX_BEFORE_SOURCE_START);\n indexesBeforeSourceStart.add(INDEX_BEFORE_SOURCE_START);\n\n // root node has empty value and no letters from either source string\n Node root = new Node(\"\", indexesBeforeSourceStart, null);\n queue.add(root);\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in, \"utf-8\");\n CircularLinkedList<String> q = new CircularLinkedList<String>();\n while (sc.hasNext()) {\n q.append(sc.next());\n System.out.println(\"Elements in queue:\\t\\t\\t\" + q);\n System.out.println(\"Number of elements in queue:\\t\\t\" + q.size());\n }\n while (! q.isEmpty()) {\n System.out.println(\"Returned element from queue:\\t\\t\" + q.getFirst());\n System.out.println(\"Elements in queue:\\t\\t\\t\" + q);\n System.out.println(\"Number of elements in queue:\\t\\t\" + q.size());\n }\n\n sc = new Scanner(System.in, \"utf-8\");\n while (sc.hasNext()) {\n q.prepend(sc.next());\n System.out.println(\"Elements in queue:\\t\\t\\t\" + q);\n System.out.println(\"Number of elements in queue:\\t\\t\" + q.size());\n }\n while (! q.isEmpty()) {\n System.out.println(\"Returned element from queue:\\t\\t\" + q.getLast());\n System.out.println(\"Elements in queue:\\t\\t\\t\" + q);\n System.out.println(\"Number of elements in queue:\\t\\t\" + q.size());\n }\n }", "public static void levelOrder(Node node){\r\n Queue<Node> qu = new ArrayDeque<>();\r\n qu.add(node);\r\n \r\n while(qu.size()>0){\r\n //1. get + remove\r\n Node rem = qu.remove();\r\n \r\n //2. Print \r\n System.out.print(rem.data + \" \");\r\n \r\n //3. Add children of node to Queue\r\n for(Node child : rem.children){\r\n qu.add(child);\r\n }\r\n }\r\n \r\n }", "public TwoPartCircularLinkedQueue() {\n\t\tfreeNode = new Node(null, null);\n\t\tfreeNode.next = freeNode;\n\t\tqueueNode = freeNode;\n\t}" ]
[ "0.6545364", "0.6530064", "0.649245", "0.6437221", "0.6398429", "0.6380712", "0.62460005", "0.6231949", "0.6170284", "0.6153377", "0.6120313", "0.6113965", "0.61008406", "0.6089407", "0.59816456", "0.5972369", "0.59535843", "0.5939959", "0.5938277", "0.5919334", "0.5899982", "0.58985454", "0.58893675", "0.58783925", "0.5868421", "0.5850971", "0.5850669", "0.58494353", "0.5831811", "0.5814998", "0.57922816", "0.57902974", "0.5775129", "0.5760716", "0.57489896", "0.5744587", "0.5735685", "0.5731988", "0.57294494", "0.5723595", "0.5722312", "0.5707435", "0.56968856", "0.5696426", "0.56961757", "0.56947577", "0.5692573", "0.5689636", "0.5655164", "0.5652806", "0.56500304", "0.56487817", "0.5634327", "0.5632563", "0.56301105", "0.5626037", "0.5625209", "0.5618476", "0.56143355", "0.56098145", "0.55937916", "0.5586576", "0.55865365", "0.55757713", "0.55670756", "0.5566175", "0.5561085", "0.5552966", "0.55503774", "0.55447596", "0.55408955", "0.5527133", "0.5523637", "0.551383", "0.55136687", "0.551343", "0.55122846", "0.550791", "0.55073345", "0.5504483", "0.5504239", "0.5492418", "0.5486461", "0.5484538", "0.5476897", "0.54732585", "0.54719365", "0.5467817", "0.5460971", "0.545324", "0.5453171", "0.5449635", "0.5434651", "0.543003", "0.54219884", "0.54170144", "0.54162085", "0.54147583", "0.54085076", "0.5403538", "0.54022557" ]
0.0
-1
private static final String LOWER = "abcdefghijklmnopqrstuvwxyz"; private static final String UPPER = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; private static final String DIGITS = "0123456789"; private static final String PUNCTUATION = "$_."; / this method generates password 8 symbols length with numeric and alphabetical characters
public String generate() { String result = RandomStringUtils.random(8,true,true); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static String genString(){\n final String ALPHA_NUMERIC_STRING =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n int pwLength = 14; //The longer the password, the more likely the user is to change it.\n StringBuilder pw = new StringBuilder();\n while (pwLength-- != 0) {\n int character = (int)(Math.random()*ALPHA_NUMERIC_STRING.length());\n pw.append(ALPHA_NUMERIC_STRING.charAt(character));\n }\n return pw.toString(); //\n }", "public String createPassword() {\n String alphabet= \"abcdefghijklmnopqrstuvwxyz\";\n int count=0;\n String randomPass=\"\";\n while (count<this.length){\n randomPass+=alphabet.charAt(this.randomNumber.nextInt(alphabet.length()-1));\n count++;\n }\n return randomPass;\n }", "public String generatePassword() {\n List<char[]> allAllowed = new ArrayList<>();\n if (uppercase) {\n allAllowed.add(UPPERCASE);\n }\n if (lowercase) {\n allAllowed.add(LOWERCASE);\n }\n if (numbers) {\n allAllowed.add(NUMBERS);\n }\n if (symbols) {\n allAllowed.add(SYMBOLS);\n }\n\n //Use cryptographically secure random number generator\n Random random = new SecureRandom();\n\n StringBuilder password = new StringBuilder();\n\n // Random chars\n for (int i = 0; i < length - allAllowed.size(); i++) {\n char[] characterType = allAllowed.get(random.nextInt(allAllowed.size()));\n password.append(characterType[random.nextInt(characterType.length)]);\n }\n\n //Ensure password policy is met by inserting required random chars in random positions\n for (char[] category : allAllowed) {\n password.insert(random.nextInt(password.length()), category[random.nextInt(category.length)]);\n }\n return password.toString();\n }", "private String newPassword() {\n\t\tchar[] vet = new char[10];\n\t\tfor(int i=0; i<10; i++) {\n\t\t\tvet[i] = randomChar();\n\t\t}\n\t\treturn new String(vet);\n\t}", "public static String generatePass(){\r\n \r\n String password = new Random().ints(10, 33, 122).collect(StringBuilder::new,\r\n StringBuilder::appendCodePoint, StringBuilder::append)\r\n .toString();\r\n return password;\r\n\r\n }", "public String createPassword() {\n while (i < length){\n temp += abc.charAt(random.nextInt(26));\n i++;\n }\n\n this.password = this.temp;\n this.temp = \"\";\n this.i = 0;\n return password;\n }", "private String getPassword(){\n System.out.println(\"Enter the Password Minimum Of 8 Charters\");\n return sc.next();\n }", "private String generatePass(int passwdLength, int minDigits, List<Boolean> options)\n {\n PasswordGenerator pg = new PasswordGenerator(passwdLength, minDigits, options);\n\n return pg.generatePasswd();\n }", "public String generatePassword(int size) {\n\n int wordIndx = getRandomWord();\n String newPassword = threeCharWords.get(wordIndx);\n return newPassword + getRandomNumber(size);\n\n\n }", "public void makePassword() {\n String str = \"\";\r\n StringBuilder strBuilder = new StringBuilder(str);\r\n Random generator = new Random();\r\n int[] senha = new int[6];\r\n for (int i = 0; i < 6; i++) {\r\n senha[i] = generator.nextInt(10);\r\n strBuilder.append(Integer.toString(senha[i]));\r\n }\r\n str = strBuilder.toString();\r\n this.setPassword(str);\r\n //passwordList.add(l);\r\n }", "public String generatePassword(){\n\t\treturn \"a\" + super.generatePassword() + \"1\";\n\t}", "protected void validatePassword(){\n //Only Checking For Word Type Password With Minimum Of 8 Digits, At Least One Capital Letter,At Least One Number,At Least One Special Character\n Boolean password = Pattern.matches(\"^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9](?=.*[!@#$%^&*()])).{8,}$\",getPassword());\n System.out.println(passwordResult(password));\n }", "public static String createPassword()\r\n\t{\r\n\t\treturn getRandomPwd(4);\r\n\t}", "public static String randomPassword(int len) {\n System.out.println(\"IN AUTO HASH\");\n String chars = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijk\"\n +\"lmnopqrstuvwxyz!@#$%&\";\n Random rnd = new Random();\n StringBuilder sb = new StringBuilder(len);\n for (int i = 0; i < len; i++)\n sb.append(chars.charAt(rnd.nextInt(chars.length())));\n return sb.toString();\n }", "String password();", "private String getTempPassword(int length) {\r\n\t\tRandom rand = new Random(9845936902l);\r\n\t\tchar[] buf = new char[length];\r\n\t\tfor (int idx = 0; idx < buf.length; ++idx)\r\n\t\t\tbuf[idx] = symbols[rand.nextInt(symbols.length)];\r\n\t\treturn new String(buf);\r\n\t}", "public String generateOTP() {\n String values = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\"; //characters to use in password\n Random random = new Random();\n char[] password = new char[6]; //setting password size to 6\n IntStream.range(0, password.length).forEach(i -> password[i] = values.charAt(random.nextInt(values.length())));\n return String.valueOf(password);\n }", "public String encode( String password );", "private String randomPassword(int length) {\r\n\t\t\tString passwordSet=\"ABCDEFGHIJKLMNOPQRSTUWXYZ0123456789!@#$%\";\r\n\t\t\tchar [] password = new char[length];\r\n\t\t\tfor(int i=0; i<length; i++) {\r\n\t\t\t\tint rand=(int)(Math.random() * passwordSet.length());\r\n\t\t\t\tpassword[i] = passwordSet.charAt(rand);\r\n\t\t\t\tSystem.out.println(rand);\r\n\t\t\t\tSystem.out.println(passwordSet.charAt(rand));\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\treturn new String(password);\r\n\t\t\t\r\n\t\t}", "public void generateRandomPassword() {\n\t\tString randomPassword = \"\";\n\t\tchar[] chars = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\".toCharArray();\n\t\tjava.util.Random random = new java.util.Random();\n\t\tfor (int i = 0; i < 20; i++) {\n\t\t char c = chars[random.nextInt(chars.length)];\n\t\t randomPassword += c;\n\t\t}\n\t\tthis.password = randomPassword;\n\t}", "private String randomPassword(int length) {\r\n\t\tString passSet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\";\r\n\t\tchar[] password = new char[length];\r\n\t\tfor(int i=0;i<length;i++) {\r\n\t\t\tint ind = (int) (Math.random()*passSet.length());\r\n\t\t\tpassword[i] = passSet.charAt(ind);\r\n\t\t}\r\n\t\treturn new String(password);\r\n\t}", "public static synchronized String getRandomPassword() {\n\t\t StringBuilder password = new StringBuilder();\n\t\t int j = 0;\n\t\t for (int i = 0; i < MINLENGTHOFPASSWORD; i++) {\n\t\t \t//System.out.println(\"J is \"+j);\n\t\t password.append(getRandomPasswordCharacters(j));\n\t\t j++;\n\t\t \n\t\t if (j == 4) {\n\t\t j = 0;\n\t\t }\n\t\t }\n\t\t return password.toString();\n\t\t}", "private String randomPassword(int length){\r\n\t\tString passwordSet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!?$#@\";\r\n\t\t\tchar[] password = new char[length];\r\n\t\t\t\t\r\n\t\t\tfor(int i = 0; i < length; i++){\r\n\t\t\t\tint rand = (int) (Math.random() * passwordSet.length());\r\n\t\t\t\tpassword[i] = passwordSet.charAt(rand);\r\n\t\t\t}\r\n\t\treturn new String(password);\r\n\t}", "public String encodePassword(String normalPassword, String key);", "void mo33731Pw();", "String getNewPassword();", "Password getPsw();", "public String generateMP() {\n\t\t\tString characters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~`!@#$%^&*()-_=+[{]}\\\\|;:\\'\\\",<.>/?\";\n\t\t\tString pwd = RandomStringUtils.random(15, 0, 0, false, false, characters.toCharArray(), new SecureRandom());\n\t\t\treturn pwd;\n\t\t}", "protected String generatePassword(int bytes) {\n \n Random r = new SecureRandom();\n byte[] tempBytes = new byte[bytes];\n r.nextBytes(tempBytes);\n return Base64.getEncoder().encodeToString(tempBytes);\n\n }", "void genKey(){\n Random rand = new Random();\n int key_length = 16;\n String key_alpha = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n StringBuilder sb = new StringBuilder(key_length);\n for(int i = 0; i < key_length; i++){\n int j = rand.nextInt(key_alpha.length());\n char c = key_alpha.charAt(j);\n sb.append(c);\n }\n this.key = sb.toString();\n }", "public String generate(int length) {\r\n\t\tString chars = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\";\r\n\t\tString pass = \"\";\r\n\t\tfor (int x = 0; x < length; x++) {\r\n\t\t\tint i = (int) Math.floor(Math.random() * 62);\r\n\t\t\tpass += chars.charAt(i);\r\n\t\t}\r\n\r\n\t\treturn pass;\r\n\t}", "public PasswordGenerator(int length, Random random, String symbols)\n {\n if (length < 1)\n {\n throw new IllegalArgumentException(\"String length must be 1 or more\");\n }\n if (symbols.length() < 2)\n {\n throw new IllegalArgumentException(\"There must be at least 2 symbols to chose from\");\n }\n\n this.random = random;\n this.symbols = symbols.toCharArray();\n this.buf = new char[length];\n }", "private Object String(char[] password) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tString password;\r\n\t\tint num;\r\n\r\n\t\tpassword = scan.next();\r\n\t\tscan.close();\r\n\r\n\t\tfor (int i = 0; i < 10; i++) {\r\n\t\t\tnum = password.charAt(i) + 2;\r\n\r\n\t\t\tif (num > 122) {\r\n\t\t\t\tnum -= 122;\r\n\t\t\t\tnum += 96;\r\n\t\t\t}\r\n\t\t\tSystem.out.printf(\"%c\", num);\r\n\t\t}\r\n\r\n\t}", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "public static void main(String[] args) {\n\t\t\r\n\t\tSupplier<String>randomPassword=()->{\r\n\t\t\t\r\n\t\t\tString otp=\"\";\r\n\t\t\t\r\n\t\t\tSupplier<Integer>digit=()->(int)(Math.random()*10);\r\n\t\t\t\r\n\t\t\tString symbol=\"ABCDEFGHIJKLMNOPQRSTUVWXYZ@#$\";\r\n\t\t\tSupplier<Character>character=()->symbol.charAt((int)(Math.random()*29));\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tfor(int i=0;i<=8;i++) {\r\n\t\t\t\tif(i%2==1) {\r\n\t\t\t\t\totp=otp+digit.get();\r\n\t\t\t\t}else {\r\n\t\t\t\t\totp=otp+character.get();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn otp;\r\n\t\t};\r\n\t\t\r\n\t\tSystem.out.println(\"Your 8 digit otp is :\"+randomPassword.get());\r\n\r\n\t}", "public Demo() {\n\t\t/**\n\t\t * A simple strength algorithm for this demo.\n\t\t */\n\t\tfinal StrengthAlgorithm sa = new StrengthAlgorithm() {\n\n\t\t\t@Override\n\t\t\tpublic void strengthAlgorithm(String s) {\n\t\t\t\t// If you want to customize the algorithm for other languages,\n\t\t\t\t// simply change the strings.\n\t\t\t\tString lowercase = \"abcdefghijklmnopqrstuvwxyzåäö\";\n\t\t\t\tString uppercase = \"ABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ\";\n\t\t\t\tString numbers = \"0123456789\";\n\t\t\t\tString symbols = \"!\\\"#¤%&/()=?@£$€{[]};,:._-'*\";\n\n\t\t\t\t// TODO: Add a filter that informs you that certain words\n\t\t\t\t// shouldn't be used. For example \"password\", number sequences\n\t\t\t\t// like \"1234\" etc.\n\n\t\t\t\tboolean hasUpper = false;\n\t\t\t\tboolean hasLower = false;\n\t\t\t\tboolean hasNumber = false;\n\t\t\t\tboolean hasSymbol = false;\n\n\t\t\t\tif (s.length() >= 8) {\n\t\t\t\t\tPasswordStrengthMeter.score++;\n\t\t\t\t\tif (s.length() >= 12)\n\t\t\t\t\t\tPasswordStrengthMeter.score++;\n\t\t\t\t}\n\t\t\t\tfor (int i = 0; i < lowercase.length(); i++) {\n\t\t\t\t\tif (memberOf(lowercase.charAt(i), s))\n\t\t\t\t\t\thasLower = true;\n\t\t\t\t}\n\t\t\t\tfor (int i = 0; i < uppercase.length(); i++) {\n\t\t\t\t\tif (memberOf(uppercase.charAt(i), s))\n\t\t\t\t\t\thasUpper = true;\n\t\t\t\t}\n\t\t\t\tfor (int i = 0; i < numbers.length(); i++) {\n\t\t\t\t\tif (memberOf(numbers.charAt(i), s))\n\t\t\t\t\t\thasNumber = true;\n\t\t\t\t}\n\t\t\t\tfor (int i = 0; i < symbols.length(); i++) {\n\t\t\t\t\tif (memberOf(symbols.charAt(i), s))\n\t\t\t\t\t\thasSymbol = true;\n\t\t\t\t}\n\t\t\t\tif (hasUpper && hasLower)\n\t\t\t\t\tPasswordStrengthMeter.score++;\n\t\t\t\tif (hasNumber)\n\t\t\t\t\tPasswordStrengthMeter.score++;\n\t\t\t\tif (hasSymbol)\n\t\t\t\t\tPasswordStrengthMeter.score++;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic boolean memberOf(char c, String s) {\n\t\t\t\tboolean member = false;\n\t\t\t\tfor (int i = 0; s.length() > i; i++)\n\t\t\t\t\tif (c == s.charAt(i)) {\n\t\t\t\t\t\tmember = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\treturn member;\n\t\t\t}\n\t\t};\n\n\t\tPasswordStrengthMeter psm = new PasswordStrengthMeter(sa);\n\n\t\t/**\n\t\t * Creates a listener for the input field. From here you can decide how\n\t\t * the strength of the password should be displayed.\n\t\t */\n\t\tpsm.addInputFieldListener(new KeyListener() {\n\n\t\t\t@Override\n\t\t\tpublic void keyTyped(KeyEvent e) {\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void keyReleased(KeyEvent e) {\n\t\t\t\tPasswordStrengthMeter.score = 0; // reset score\n\t\t\t\tsa.strengthAlgorithm(PasswordStrengthMeter.inputField.getText());\n\t\t\t\tPasswordStrengthMeter.commentLabel\n\t\t\t\t\t\t.setText(\"Password strength: \"\n\t\t\t\t\t\t\t\t+ PasswordStrengthMeter.score + \" / 5\");\n\t\t\t\tPasswordStrengthMeter.resultLabel.setOpaque(true);\n\t\t\t\tPasswordStrengthMeter.resultLabel2.setOpaque(true);\n\t\t\t\tif (PasswordStrengthMeter.inputField.getText().length() == 0) {\n\t\t\t\t\t// Label is reset if all text is deleted from the input\n\t\t\t\t\t// field.\n\t\t\t\t\tPasswordStrengthMeter.resultLabel.setText(\"\");\n\t\t\t\t\tPasswordStrengthMeter.resultLabel.setBackground(null);\n\t\t\t\t\tPasswordStrengthMeter.resultLabel2.setBackground(null);\n\t\t\t\t}\n\t\t\t\tif (PasswordStrengthMeter.score == 1) {\n\t\t\t\t\tPasswordStrengthMeter.resultLabel.setText(\"REALLY BAD\");\n\t\t\t\t\tPasswordStrengthMeter.resultLabel.setBackground(Color.RED);\n\t\t\t\t\tPasswordStrengthMeter.resultLabel2.setBackground(Color.RED);\n\t\t\t\t}\n\t\t\t\tif (PasswordStrengthMeter.score == 2) {\n\t\t\t\t\tPasswordStrengthMeter.resultLabel.setText(\"WEAK\");\n\t\t\t\t\tPasswordStrengthMeter.resultLabel\n\t\t\t\t\t\t\t.setBackground(Color.ORANGE);\n\t\t\t\t\tPasswordStrengthMeter.resultLabel2\n\t\t\t\t\t\t\t.setBackground(Color.ORANGE);\n\t\t\t\t}\n\t\t\t\tif (PasswordStrengthMeter.score == 3) {\n\t\t\t\t\tPasswordStrengthMeter.resultLabel.setText(\"OK\");\n\t\t\t\t\tPasswordStrengthMeter.resultLabel\n\t\t\t\t\t\t\t.setBackground(Color.YELLOW);\n\t\t\t\t\tPasswordStrengthMeter.resultLabel2\n\t\t\t\t\t\t\t.setBackground(Color.YELLOW);\n\t\t\t\t}\n\t\t\t\tif (PasswordStrengthMeter.score == 4) {\n\t\t\t\t\tPasswordStrengthMeter.resultLabel.setText(\"GOOD\");\n\t\t\t\t\tPasswordStrengthMeter.resultLabel.setBackground(Color.CYAN);\n\t\t\t\t\tPasswordStrengthMeter.resultLabel2\n\t\t\t\t\t\t\t.setBackground(Color.CYAN);\n\t\t\t\t}\n\t\t\t\tif (PasswordStrengthMeter.score == 5) {\n\t\t\t\t\tPasswordStrengthMeter.resultLabel.setText(\"EXCELLENT\");\n\t\t\t\t\tPasswordStrengthMeter.resultLabel\n\t\t\t\t\t\t\t.setBackground(Color.GREEN);\n\t\t\t\t\tPasswordStrengthMeter.resultLabel2\n\t\t\t\t\t\t\t.setBackground(Color.GREEN);\n\t\t\t\t}\n\n\t\t\t\t// TODO: Allow the user to change how the strength of the\n\t\t\t\t// password is displayed. For example by showing it as a\n\t\t\t\t// percentage.\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t}\n\t\t});\n\n\t\tJScrollPane scroll = new JScrollPane(psm);\n\n\t\t// WINDOW SETTINGS //\n\t\tadd(scroll);\n\t\tsetTitle(\"Password Strength Meter\");\n\t\tsetVisible(true);\n\t\tpack();\n\t\tsetDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);\n\t}", "String getUserPassword();", "public static String determinePasswordStrength(String password)\r\n {\r\n double passwordlength = password.length();\r\n ArrayList<Long> possibilties= new ArrayList<Long>();\r\n double countedPossibilities = 0;\r\n double totalPossibilties = 0;\r\n ArrayList<String> counterArray = new ArrayList<String>();\r\n String longestMatchingWord = \"\";\r\n\r\n File fileToRead = new File(\"dictionary.txt\");\r\n boolean hasUpper = false;\r\n boolean hasLower = false;\r\n boolean hasNumber = false;\r\n boolean hasSpecial = false;\r\n boolean isUpper = false;\r\n boolean isLower = false;\r\n boolean isNumber = false;\r\n boolean isSpecial = false;\r\n\r\n for(int i = 0; i < password.length(); i++)\r\n {\r\n\r\n if(\"abcdefghijklmnopkrstuvwxyz\".contains(Character.toString(password.charAt(i))) && !hasLower)\r\n {\r\n hasLower = true;\r\n countedPossibilities = countedPossibilities + 26;\r\n }\r\n else if(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".contains(Character.toString(password.charAt(i))) && !hasUpper)\r\n {\r\n hasUpper = true;\r\n countedPossibilities = countedPossibilities + 26;\r\n }\r\n else if(\"0123456789\".contains(Character.toString(password.charAt(i))) && !hasNumber)\r\n {\r\n hasNumber= true;\r\n countedPossibilities = countedPossibilities + 10;\r\n }\r\n else if(\" ,!”#$%&’()*+,-./:;<=>?@[\\\\]^_`{|}~\".contains(Character.toString(password.charAt(i))) && !hasSpecial)\r\n {\r\n hasSpecial = true;\r\n countedPossibilities = countedPossibilities + 33;\r\n }\r\n\r\n }\r\n double centuries = 0;\r\n double years = 0;\r\n double days = 0;\r\n double hours = 0;\r\n double minutes = 0;\r\n double seconds = 0;\r\n double tempcenturies = 0;\r\n double tempyears = 0;\r\n double tempdays = 0;\r\n double temphours = 0;\r\n double tempminutes = 0;\r\n double tempseconds2 = 0;\r\n double tempseconds = 0;\r\n double point = 0.00000037;\r\n double point1 = 3.8;\r\n\r\n// BigDecimal E = new BigDecimal(Math.E);\r\n// BigInteger fivehundread = new BigInteger(\"1000\");\r\n// BigInteger zero = new BigInteger(\"0\");\r\n //BigDecimal centuries = new BigDecimal(\"0\");\r\n\r\n ///////////////INSERT Dictionary Attack Here//////////////////////\r\n try {\r\n BufferedReader reader = new BufferedReader(new FileReader(fileToRead));\r\n String wordInFile = \"\";\r\n\r\n while ((wordInFile = reader.readLine()) != null) {\r\n //System.out.println(wordInFile);\r\n wordInFile = wordInFile.toLowerCase();\r\n if (wordInFile.length() > 3) {\r\n if (password.contains(wordInFile))\r\n {\r\n if(longestMatchingWord.length() < wordInFile.length())\r\n {\r\n longestMatchingWord = wordInFile;\r\n }\r\n }\r\n }\r\n }\r\n for (int i = 0; i < longestMatchingWord.length(); i++) {\r\n if (\"abcdefghijklmnopkrstuvwxyz\".contains(Character.toString(password.charAt(i)))) {\r\n //isLower = true;\r\n //countedPossibilities = countedPossibilities.add(BigDecimal.valueOf(26));\r\n passwordlength--;\r\n //System.out.println(passwordlength);\r\n }\r\n else if (\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".contains(Character.toString(password.charAt(i)))) {\r\n //isUpper = true;\r\n //countedPossibilities = countedPossibilities.add(BigDecimal.valueOf(26));\r\n passwordlength--;\r\n }\r\n else if (\"0123456789\".contains(Character.toString(password.charAt(i)))) {\r\n //isNumber = true;\r\n //countedPossibilities = countedPossibilities.add(BigDecimal.valueOf(10));\r\n passwordlength--;\r\n }\r\n else if (\" ,!”#$%&’()*+,-./:;<=>?@[\\\\]^_`{|}~\".contains(Character.toString(password.charAt(i)))) {\r\n //isSpecial = true;\r\n //countedPossibilities = countedPossibilities.add(BigDecimal.valueOf(33));\r\n passwordlength--;\r\n }\r\n\r\n }\r\n }\r\n catch (FileNotFoundException e)\r\n {\r\n\r\n }\r\n catch(IOException e)\r\n {\r\n System.out.println(\"didnt read file\");\r\n }\r\n\r\n // Algorithm is here\r\n //y =3.7*e(3.8x) rounded to 4 to fit into big decimal\r\n\r\n totalPossibilties = (Math.pow(countedPossibilities, passwordlength));\r\n tempseconds2 = point*Math.pow(Math.E, totalPossibilties*4);\r\n tempseconds = tempseconds2;\r\n\r\n if (tempseconds == 0)\r\n {\r\n\r\n }\r\n else if (tempseconds > 1)\r\n {\r\n\r\n }\r\n else\r\n {\r\n tempseconds = 0;\r\n }\r\n\r\n\r\n seconds = tempseconds % 60;\r\n tempminutes = tempseconds / 60;\r\n minutes = tempminutes % 60;\r\n temphours = tempminutes / 60;\r\n hours = temphours % 24;\r\n tempdays = temphours / 24;\r\n days = tempdays % 365;\r\n tempyears = tempdays / 365;\r\n\r\n if(tempyears > 500)\r\n {\r\n return (\"Greater than 500\" + \" years \");\r\n }\r\n //years = tempcenturies.divide(BigInteger.valueOf(100));\r\n //System.out.println(tempyears.toString() + \" years \" + days.toString() + \" days \" + hours.toString() + \" hours \" + minutes.toString() + \" minutes \" + seconds.toString() + \" seconds\");\r\n else\r\n {\r\n return (tempyears + \" years \" + days + \" days \" + hours + \" hours \" + minutes + \" minutes \" + seconds + \" seconds\");\r\n }\r\n }", "public static String rndLetterString() {\r\n int spLen = RBytes.rndInt(10, 20);\r\n char[] c = RBytes.rndCharArray('a', 'z');\r\n char[] C = RBytes.rndCharArray('A', 'Z');\r\n char[] d = RBytes.rndCharArray('0', '9');\r\n String special = \"\";\r\n for (int s = 0; s < spLen; s++) {\r\n special += \"!@#$%^&*()-_~`=+:;.,\";\r\n }\r\n String s1 = new String(c) + new String(d) + new String(C) + special;\r\n return shaffleString(s1);\r\n }", "private String encrypt_password(String password)\r\n\t{\r\n\t\tString generated_password = null;\r\n try\r\n {\r\n\r\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\r\n md.update(password.getBytes());\r\n byte[] bytes = md.digest();\r\n StringBuilder sb = new StringBuilder();\r\n for(int i=0; i< bytes.length ;i++)\r\n {\r\n sb.append(Integer.toString((bytes[i] & 0xff) + 0x100, 16).substring(1));\r\n }\r\n generated_password=sb.toString();\r\n }\r\n catch (NoSuchAlgorithmException e)\r\n {\r\n \r\n }\r\n return generated_password;\r\n\t}", "public static void main(String[] args) {\n System.out.println(generateRandomPassword(8));\n }", "public static void main(String[] args) {\n\r\n\t\tString password = \"$$ Welcome to 1st Automation Interview $$\" ;\r\n\t\t\r\n\t\tSystem.out.println(password.charAt(5));\r\n\r\n\t\tint lettercount = 0 , digitcount = 0 , specialcount = 0 ; \r\n\r\n\t\tPattern letter = Pattern.compile(\"[a-zA-z]\");\r\n\t\tPattern digit = Pattern.compile(\"[0-9]\");\r\n\t\tPattern special = Pattern.compile (\"[!@#$%&*()_+=|<>?{}\\\\[\\\\]~-]\");\r\n\t\t//Pattern eight = Pattern.compile (\".{8}\");\r\n\r\n\r\n\t\tMatcher hasLetter = letter.matcher(password);\r\n\t\tMatcher hasDigit = digit.matcher(password);\r\n\t\tMatcher hasSpecial = special.matcher(password);\r\n\r\n\r\n\t\tfor (int i = 0 ;password.length()<i ; i++) {\r\n\r\n\t\t\tif(hasLetter.find(password.charAt(i))) {\r\n\r\n\t\t\t\tlettercount++ ;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tSystem.out.println(lettercount);\r\n\r\n\t\t/*while ( hasLetter.find()) {\r\n\t\t\tlettercount++ ; \r\n\r\n\r\n\r\n\t\t} System.out.println(lettercount);\r\n\r\n\t\twhile (hasDigit.find()) {\r\n\t\t\tdigitcount++ ; \r\n\t\t\tSystem.out.println(hasDigit.group());\r\n\t\t} \r\n\t\tSystem.out.println(digitcount);\r\n\r\n\t\twhile ( hasSpecial.find()) {\r\n\t\t\tSystem.out.println(hasSpecial.group());\r\n\r\n\t\t\tspecialcount++;\r\n\t\t}System.out.println(specialcount);\r\n\t\t */\r\n\r\n\r\n\t}", "public static String keyGen(String password) {\n\n String duplicatePassword = String.valueOf(password.charAt(0));\n //This will be the duplicate of the pw & will be used to delete repeats\n //The first character of password is added to this no matter what\n\n boolean duplicate = false;\n //This boolean stores whether or not the character is duplicated\n\n for (int i = 0; i < password.length(); i++) {\n //This will actually duplicate possibleSolutions into duplicateList\n for (int j = 0; j < duplicatePassword.length(); j++) {\n if (password.charAt(i) == duplicatePassword.charAt(j)) {\n duplicate = true;\n }\n }\n if (duplicate == false) {\n //If the char makes it through the loop without being a repeat\n duplicatePassword += password.charAt(i);\n } else {\n duplicate = false;\n }\n }\n password = duplicatePassword;\n\n String genesisKey = password; //Places pw at the start of initialKey\n boolean isTheCharacterAlreadyInThePassword;\n\n for (int i = 0; i < allCharacters.length(); i++) {\n isTheCharacterAlreadyInThePassword = false;\n for (int j = 0; j < password.length(); j++) {\n if (allCharacters.charAt(i) == password.charAt(j)) {\n isTheCharacterAlreadyInThePassword = true;\n }\n }\n if (isTheCharacterAlreadyInThePassword == false) {\n genesisKey += allCharacters.charAt(i);\n }\n }\n\n initialKey = genesisKey; //initialKey created\n return initialKey;\n\n }", "private String generateNewPassword() throws Exception\n {\n if(this.weblisketSession != null && \n this.weblisketSession.getId() != null)\n {\n int startIndex = this.weblisketSession.getId().length();\n if(startIndex >= 8)\n {\n return this.weblisketSession.getId().substring(startIndex - 8);\n }\n else\n {\n throw new Exception(\"Error Generating New Password\");\n }\n }\n else\n {\n throw new Exception(\"No Session Available For Generating New Password\");\n }\n }", "private String getPasswordFor(String name) {\n return new StringBuilder().append(PASSWORD_FOR).append(\" '\").append(name).append(\"': \").toString();\n }", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "@Test\n public void testPasswordMinLength()\n {\n String invalid = repeatM(7);\n owner.setPassword(invalid);\n assertInvalid(owner, \"password\", \"Password must be at least 8 characters in length\", invalid);\n }", "public static String randAlnumSym(){\n int n;\n String result = null;\n switch (CAPS){\n case 0:\n n = rand.nextInt(94);\n if (n>83){\n result = String.valueOf(n-84);\n }else {\n result = String.valueOf(KEYBOARD.charAt(rand.nextInt(84))); //both\n }\n break;\n case 1:\n n = rand.nextInt(68);\n if (n>57){\n result = String.valueOf(n-58);\n }else if (n > 25){\n result = randSym();\n }else {\n result = randLower();\n }\n break;\n case 2:\n n = rand.nextInt(68);\n if (n>57){\n result = String.valueOf(n-58);\n }else if (n > 25){\n result = randSym();\n }else {\n result = randUpper();\n }\n break;\n }\n return result;\n }", "public static String makeItStrong(String s){\r\n //noOfChanges = the minimum number of changes\r\n int noOfChanges = 0;\r\n Random r = new Random();\r\n // a new character used for replacement\r\n char newChar = 0;\r\n\r\n Password password = new Password(s);\r\n String newPassword = password.getPassword();\r\n Password strongerPassword = new Password(newPassword);\r\n\r\n //if the inserted password is already strong returns 0\r\n if(strongerPassword.checkIfStrong())\r\n return \"0\";\r\n\r\n //if the password doesn't have any digit one will be added\r\n if(!strongerPassword.hasDigit()) {\r\n newPassword = newPassword.concat(String.valueOf(r.nextInt(10)));\r\n noOfChanges ++;\r\n\r\n }\r\n\r\n //if the password doesn't have any lowercase letters one will be added\r\n if(!strongerPassword.hasLowercase()){\r\n newChar = (char) ('a' + r.nextInt(26));\r\n newPassword = newPassword.concat(String.valueOf(newChar).toLowerCase());\r\n noOfChanges ++;\r\n }\r\n\r\n //if the password doesn't have any uppercase, one will be added\r\n if(!strongerPassword.hasUppercase()){\r\n newChar = (char) ('A' + r.nextInt(26));\r\n newPassword = newPassword.concat(String.valueOf(newChar).toUpperCase());\r\n noOfChanges ++;\r\n }\r\n\r\n //if the length of the possible-modified password is less than 6 will be inserted the minimum number of characters\r\n //in order for the length to be 6\r\n if (newPassword.length() < 6) {\r\n for (int i = 0; i < 6 - newPassword.length(); i++) {\r\n newPassword = newPassword.concat(String.valueOf(newChar));\r\n noOfChanges++;\r\n }\r\n }\r\n\r\n //if the length of the possible-modified password is bigger than 20, will be deleted the minimum number of characters\r\n //in order for the length to be 20\r\n if(password.getPassword().length() > 20) {\r\n for (int i = 0; i <= password.getPassword().length() - 20; i++) {\r\n strongerPassword = new Password(strongerPassword.deletion());\r\n newPassword = strongerPassword.getPassword();\r\n noOfChanges++;\r\n }\r\n if(!strongerPassword.hasDigit()){\r\n newPassword = newPassword.concat(String.valueOf(r.nextInt(10)));\r\n }\r\n }\r\n\r\n //if there are are more than 2 identical characters, one of the character will be either removed or replaced\r\n if(strongerPassword.charactersNearEachOther()){\r\n\r\n char[] passwordToChar = newPassword.toCharArray(); //creating an array of characters with the passwords length\r\n StringBuffer stringBuffer = new StringBuffer(newPassword);\r\n\r\n for( int i = 0; i < newPassword.length()-1; i++) {\r\n if (passwordToChar[i] == passwordToChar[i + 1]){\r\n\r\n //checking if the password would have the right length if a character will be deleted,\r\n //then going further withe the deletion of one of the duplicate characters\r\n if (new Password(strongerPassword.deletion()).checkLength()) {\r\n newPassword = String.valueOf(stringBuffer.deleteCharAt(i));\r\n noOfChanges++;\r\n i++;\r\n }\r\n //if the length would be too short, one of the duplicate characters will be replaced with a random character\r\n //if newChar(the random character) is the same as the character to be deleted, we'll get another random value\r\n else if (!new Password(strongerPassword.deletion()).checkLength()) {\r\n\r\n if (newChar != passwordToChar[i]){\r\n newPassword = strongerPassword.replacement(passwordToChar[i], newChar);\r\n noOfChanges ++;\r\n }\r\n else {\r\n newChar = (char) ('A' + r.nextInt(26));\r\n newPassword = strongerPassword.replacement(passwordToChar[i], newChar);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return \"An alternative for your password to be stronger: \" + newPassword +\r\n \"\\nThe minimum number of changes: \" + noOfChanges;\r\n }", "public char[] getPassword();", "public NoLowerAlphaException()\r\n { \r\n super(\"The password must contain at least one lowercase alphabetic character\"); \r\n }", "public static String generatePasswort(String passwort) {\n Validator.check(!passwort.isEmpty(), ERR_MSG_PASSWORD_EMPTY);\n\n StringBuilder sb = new StringBuilder();\n\n byte[] mdbytes = verschlüsselePasswort(passwort);\n Validator.check(mdbytes != null, ERR_MSG_PASSWORT);\n\n for (byte mdbyte : mdbytes) {\n sb.append(Integer.toString((mdbyte & 0xff) + 0x100, 16).substring(1));\n }\n\n return sb.toString();\n }", "public void setPassword(String password)\n {\n String passwordRegex = \"^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{8,}$\";\n Pattern passwordPattern = Pattern.compile(passwordRegex);\n Matcher passwordMatcher = passwordPattern.matcher(password);\n if(passwordMatcher.matches())\n {\n this.password=password;\n }\n else\n {\n this.password=\"\";\n }\n }", "@Test\n\t void testPassword() {\n\t\tString expected=passwordEncoder.encode(\"faizan@123\");\n\t\tString actual=user.getPassword();\n\t\tassertNotEquals(expected, actual);\n\t}", "public String CheckPassword(String Password)\n\t{\n\t\tif(Pattern.matches(\"(?=.*[$#@!%^&*])(?=.*[0-9])(?=.*[A-Z]).{8,20}$\",Password))\n\t\treturn \"HAPPY\";\n\t\telse \n\t\treturn \"SAD\";\n\t}", "static String getSaltString() {\n String SALTCHARS = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\";\n StringBuilder salt = new StringBuilder();\n Random rnd = new Random();\n while (salt.length() < 18) { // length of the random string.\n int index = (int) (rnd.nextFloat() * SALTCHARS.length());\n salt.append(SALTCHARS.charAt(index));\n }\n String saltStr = salt.toString();\n return saltStr;\n }", "public static String generatePassPhrase(int length) {\n LOG.debug(\"generate new random passphrase with length: \" + length);\n final char[] allowableCharacters = new char[]{'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'm',\n 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G',\n 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '2', '3', '4',\n '5', '6', '7', '8', '9'};\n\n StringBuilder pass = new StringBuilder();\n for (int i = 0; i < length; i++) {\n pass.append(allowableCharacters[RandomUtils.nextInt(0, allowableCharacters.length)]);\n }\n return pass.toString();\n }", "public static String getPassword()\n\t{\n\t\tScanner kb = new Scanner(System.in);\n\n\t\tp(\"Guideline for password:\");\n\t\tp(\"The password should be at least six characters long.\");\n\t\tp(\"The password should contain at least one uppercase and at least one lowercase letter.\");\n\t\tp(\"The password should have at least one digit.\");\n\t\tp(\"Enter a password:\");\n\t\treturn kb.nextLine();\n\t}", "public String Crypt(String s);", "public static String getMobileAdminPassword(){\n\t\treturn \"wildspace12\";\n\t}", "public String getPassword() {\r\n\t\t// Get the password\r\n\t\tchar []code = password.getPassword();\r\n\t\t\r\n\t\t// Make the password string\r\n\t\tString password = \"\";\r\n\t\t\r\n\t\t// convert the char[] to string\r\n\t\tfor (char c: code){\r\n\t\t\tpassword += c;\r\n\t\t}\r\n\t\t\r\n\t\t// Return the password string\r\n\t\treturn password;\r\n\t}", "private String encrypt (String password){\r\n String encrypted = \"\";\r\n char temp;\r\n int ASCII;\r\n //For each letter in password.\r\n for (int i = 0; i < password.length(); i++){\r\n temp = password.charAt(i);\r\n ASCII = (int) temp;\r\n //If the letter is a character.\r\n if (ASCII >= 32 && ASCII <= 127){\r\n int x = ASCII - 32;\r\n x = (x + 6) % 96; /*Mod the characters so that it cannot go over the amount.\r\n The letters are all shifted plus 6 characters along. */\r\n encrypted += (char) (x + 32);\r\n }\r\n }\r\n return encrypted;\r\n }", "@Test\n public void _1passwordPasswordTest() {\n // TODO: test _1passwordPassword\n }", "private String newCode(int length) {\n Random rnd = new SecureRandom();\n StringBuilder code = new StringBuilder(length);\n do {\n code.setLength(0);\n while (code.length() < length) {\n if (rnd.nextBoolean()) { // append a new letter or digit?\n char letter = (char) ('a' + rnd.nextInt(26));\n code.append(rnd.nextBoolean() ? Character.toUpperCase(letter) : letter);\n } else {\n code.append(rnd.nextInt(10));\n }\n }\n } while (exists(code.toString()));\n return code.toString();\n }", "@Test\n public void testPasswordLowerBound()\n {\n String valid = repeatM(8);\n owner.setPassword(valid);\n assertEquals(0, validator.validate(owner).size());\n }", "public void createPassword(String userid, String password) {\n\t\tif (password.length()>=12){\n\t\t\tif(password.matches(\".*\\\\d.*\")&&password.matches(\".*[!@#$%^&*].*\")&&!password.equals(password.toLowerCase())&& !password.equals(password.toUpperCase())){\n\t\t\t\tString salt= generateSalt();\n\t\t\t\tpwds.put(userid,encrypt(password,salt));\n\t\t\t\tsalts.put(userid,salt);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"bad password\");\n\n\t\t\t}\n\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"bad password\");\n\n\t\t}\n\n\n\t}", "public String generatePassword(Node node);", "private void generatePasswords() {\n\t\tif(passwords != null) {\n\t\t\treturn;\n\t\t}\n\t\tpasswords = new String[10];\n\t\tint index = 0;\n\t\twhile(index < passwords.length) {\n\t\t\tpasswords[index] = generatePassword();\n\t\t\tindex++;\n\t\t}\n\t}", "public String toString(){\n return String.format(\"Vigenere Cipher (password='%s')\", password);\n }", "public static void main(String[] args) {\n\t\t\n\t\tfinal String letters = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*\";\n\n\t\t// b. have a random number generator\n\n\t\tRandom rand = new Random();\n\n\t\t// c. use the random generator to get the charAt a random location based on the\n\t\t// number of characters\n\n\t\tchar char1 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char2 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char3 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char4 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char5 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char6 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char7 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char8 = letters.charAt(rand.nextInt(letters.length()));\n\t\t// d. concatenate the characters together to get the word\n\n\t\tSystem.out.println(\"\" + char1 + char2 + char3 + char4 + char5 + char6 + char7 + char8);\n\t\tSystem.out.println(String.valueOf(char1)+String.valueOf(char2)+String.valueOf(char3)+String.valueOf(char4)+String.valueOf(char5)+String.valueOf(char6)+String.valueOf(char7)+String.valueOf(char8));\n\t\t\t\t\n\n\t\t\n\t\t\n\t\t//Build a username generator absed on lastname and firstname inputs from the user\n\t\t//Conditions: \n\t\t//\t\t\tNo more than 1 username can include either the whole first or last name\n\t\t//\t\t\tAt least 1 username should include numbers\n\t\t//\t\t\tThere needs to be a random component in at least 2 name generations\n\t\t//\t\t\tThe usernames should adhere to the characteristics of typical usernames\n\t\t\n\t\tfinal String numbers = \"1234567890.\";\n\t\tScanner scan = new Scanner(System.in);\n\t\tSystem.out.println(\"Type in your first name > \");\n\t\tString fName = scan.nextLine();\n\t\tSystem.out.println(\"Type in your last name > \");\n\t\tString lName = scan.nextLine();\n\t\t\n\t\tString part1 = fName.toLowerCase().substring(0, rand.nextInt(fName.length()));\n\t\tString part2 = lName.toLowerCase().substring(0, rand.nextInt(lName.length()));\n\t\t\n\t\tSystem.out.println(\"A possible username \" + part1+part2);\n\t\t\n\t\tString part3 = String.valueOf(numbers.charAt(rand.nextInt(numbers.length())));\n\t\tString part4 = String.valueOf(numbers.charAt(rand.nextInt(numbers.length())));\n\t\t\n\t\tSystem.out.println(\"A possible username \" + part1+part2+part3+part4);\n\t\t\n\t\t//Take inputs and Build a decision tree that decides whether to issue a loan or not\n\t\t\n\t\t//https://www.brcommunity.com/images/articles/b624-2full.png\n\t\t\t\n\n\t}", "public static boolean enforcePasswordComplexity(String password, int minLength, int maxLength,\n boolean allowUppercase, boolean requireUppercase,\n boolean allowLowercase, boolean requireLowercase,\n boolean allowNumber, boolean requireNumber,\n boolean allowSpace, boolean requireSpace,\n boolean allowSymbol, boolean requireSymbol) throws NoSuchAlgorithmException {\n\n boolean containsUppercase = false;\n boolean containsLowercase = false;\n boolean containsNumber = false;\n boolean containsSymbol = false;\n boolean containsSpace = false;\n\n if (password == null) {\n return false;\n }\n\n if (password.length() < minLength || password.length() > maxLength) {\n return false;\n }\n\n for (int i = 0; i < password.length(); i++) {\n\n char c = password.charAt(i);\n\n if (Character.isLetter(c)) {\n if (Character.isUpperCase(c)) {\n if (allowUppercase) {\n containsUppercase = true;\n } else {\n return false;\n }\n } else {\n if (allowLowercase) {\n containsLowercase = true;\n } else {\n return false;\n }\n }\n } else if (Character.isDigit(c)) {\n if (allowNumber) {\n containsNumber = true;\n } else {\n return false;\n }\n } else if (c == ' ') {\n if (allowSpace) {\n containsSpace = true;\n } else {\n return false;\n }\n } else if (c >= 0x21 && c <= 0x2F) {\n if (allowSymbol) {\n containsSymbol = true;\n } else {\n return false;\n }\n } else if (c >= 0x3A && c <= 0x40) {\n if (allowSymbol) {\n containsSymbol = true;\n } else {\n return false;\n }\n } else if (c >= 0x5B && c <= 0x60) {\n if (allowSymbol) {\n containsSymbol = true;\n } else {\n return false;\n }\n } else if (c >= 0x7B && c <= 0x7E) {\n if (allowSymbol) {\n containsSymbol = true;\n } else {\n return false;\n }\n } else {\n return false; // anything else, we fail\n }\n }\n\n if (requireSymbol && !containsSymbol) {\n return false;\n }\n\n if (requireUppercase && !containsUppercase) {\n return false;\n }\n\n if (requireLowercase && !containsLowercase) {\n return false;\n }\n\n if (requireNumber && !containsNumber) {\n return false;\n }\n\n if (requireSpace && !containsSpace) {\n return false;\n }\n\n if (requireSymbol && !containsSymbol) {\n return false;\n }\n\n return true;\n }", "public static String encodePassword(String password) {\r\n\t\t\r\n\t\tbyte[] uniqueKey = password.getBytes();\r\n\t\tbyte[] hash = null;\r\n\t\ttry {\r\n\t\t\thash = MessageDigest.getInstance(\"MD5\").digest(uniqueKey);\r\n\t\t} catch (NoSuchAlgorithmException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tStringBuffer hashString = new StringBuffer();\r\n\t\tfor ( int i = 0; i < hash.length; ++i ) {\r\n\t\t\tString hex = Integer.toHexString(hash[i]);\r\n\t\t\tif ( hex.length() == 1 ) {\r\n\t\t\t hashString.append('0');\r\n\t\t\t hashString.append(hex.charAt(hex.length()-1));\r\n\t\t\t} else {\r\n\t\t\t hashString.append(hex.substring(hex.length()-2));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn hashString.toString();\r\n\t}", "private String lookupPassword(String user) {\n\treturn \"happy8\";\r\n\t}", "String getTemporaryPassword();", "public static void generateGoodPasswords(DLB dictionary) throws FileNotFoundException {\n\t\t\n int counter =0;\n PrintWriter textFile = new PrintWriter(\"all_passwords.txt\");\n char[] password = new char[5];\n String posChar = \"bcdefghjklmnopqrstuvwxyz23567890!@$^_*\";\n for (int c0 = 0; c0 < posChar.length(); c0++) {\n for (int c1 = 0; c1 < posChar.length(); c1++) {\n for (int c2 = 0; c2 < posChar.length(); c2++) {\n for (int c3 = 0; c3 < posChar.length(); c3++) {\n for (int c4 = 0; c4 < posChar.length(); c4++) {\n password[0] = posChar.charAt(c0);\n password[1] = posChar.charAt(c1);\n password[2] = posChar.charAt(c2);\n password[3] = posChar.charAt(c3);\n password[4] = posChar.charAt(c4);\n String pw = new String(password);\n int numLetter = getNumLetters(password);\n if (numLetter > 0 && numLetter < 4) {\n int numNum = getNumNumbers(password);\n if (numNum > 0 && numNum < 3) {\n int numSymbol = getNumSymbols(password);\n if (numSymbol > 0 && numSymbol < 3) {\n\n if (checkForWords(password, dictionary)) {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// long endTime = System.nanoTime();\n\t\t\t\t\t\t\t\t\t\t\t// long duration = (endTime - startTime);\n textFile.println(pw);\n\t\t\t\t\t\t\t\t\t\t\t// textFile.println(\", \" + duration);\n }\n\n }\n }\n }\n\n }\n }\n }\n }\n }\n textFile.close();\n }", "private boolean requiresLettersOrSymbols() {\n return mPasswordMinLetters + mPasswordMinUpperCase\n + mPasswordMinLowerCase + mPasswordMinSymbols + mPasswordMinNonLetter > 0;\n }", "private String getToken() {\n\t\tString numbers = \"0123456789\";\n\t\tRandom rndm_method = new Random();\n String OTP = \"\";\n for (int i = 0; i < 4; i++)\n {\n \tOTP = OTP+numbers.charAt(rndm_method.nextInt(numbers.length()));\n \n }\n return OTP;\n\t}", "public interface PasswordEncoder {\r\n\r\n public String encode(char password[]);\r\n\r\n public boolean compare(String encoded, char plain[]);\r\n\r\n}", "public String generateOTP(String username){\n sendOTP(username);\n return new String(\"pass\");\n }", "public java.lang.String getPassword();", "public String getPassword();", "public String getPassword();", "public static void main(String[] args) {\n\t\tPassword p = new Password();\n\t\tString epassword = \"ff6b6db0b2f4506c074343f20805a39ca856bf3a\";\n\t\tString passText = \"123456\";\n\t\tString id = \"371328198106084016\";\n\t\tString salt = p.getSalt(id);\n\t\tString sp = p.getPassphrase(salt, passText);\n\t\tSystem.out.println(\"salt : +\" + salt +\" passphrase: \"+sp);\n\t\tSystem.out.println(p.matchPassphrase(sp, salt, passText) + \"--------------- for real :\");\n\t\tsalt =\"SjZ1MmwxIDIzMiw2IDEyOTA5MTE1MSAxNDE6ODE2NjEgM1A4TQ==\";\n\t\tsp = \"11895b3270e3fd9038252d4fd45400b6fa30de4f\";\n\t\tSystem.out.println(p.matchPassphrase(sp, salt, \"123456\"));\n\t}", "@Test\r\n\tpublic void testIsValidPasswordNoLowerAlpha()\r\n\t{\r\n\t\ttry{\r\n\t\t\tassertTrue(PasswordCheckerUtility.isValidPassword(\"RAINBOW\"));\r\n\t\t}\r\n\t\tcatch(NoLowerAlphaException e)\r\n\t\t{\r\n\t\t\tassertTrue(\"Successfully threw a NoLowerAlphaExcepetion\",true);\r\n\t\t}\r\n\t}", "private static void setCharUse(String bool){\r\n\r\n if(bool.charAt(0)=='t' || bool.charAt(0)=='T'){\r\n /* At the 0'th index char 't' simply represent\r\n * in generating the password lower case can be used.\r\n */\r\n\r\n passwordGenerator.setUseLower(true);\r\n }\r\n else if(bool.charAt(0)=='f' || bool.charAt(0)=='F') {\r\n /* At the 0'th index char 'f' simply represent\r\n * in generating the password lower case cannot be used.\r\n */\r\n passwordGenerator.setUseLower(false);\r\n }\r\n else {\r\n /* If user type any other letter instead of 't' of 'f'\r\n * programme simply display there is some error pls\r\n * check the help menu for more info.\r\n */\r\n help();\r\n }\r\n\r\n if(bool.charAt(1)=='t' || bool.charAt(1)=='T'){\r\n /* At the 1'th index char 't' simply represent\r\n * in generating the password upper case can be used.\r\n */\r\n passwordGenerator.setUseUpper(true);\r\n }\r\n else if(bool.charAt(1)=='f' || bool.charAt(1)=='F') {\r\n /* At the 1'th index char 'f' simply represent\r\n * in generating the password upper case cannot be used.\r\n */\r\n passwordGenerator.setUseUpper(false);\r\n }\r\n else {\r\n help();\r\n }\r\n if(bool.charAt(2)=='t' || bool.charAt(2)=='T'){\r\n /* At the 2'th index char 't' simply represent\r\n * in generating the password digits can be used.\r\n */\r\n passwordGenerator.setUseDigit(true);\r\n }\r\n else if(bool.charAt(2)=='f' || bool.charAt(2)=='F') {\r\n /* At the 2'th index char 'f' simply represent\r\n * in generating the password digits cannot be used.\r\n */\r\n passwordGenerator.setUseDigit(false);\r\n }\r\n else {\r\n help();\r\n }\r\n if(bool.charAt(3)=='t' || bool.charAt(3)=='T'){\r\n /* At the 3'th index char 't' simply represent\r\n * in generating the password special character can be used.\r\n */\r\n passwordGenerator.setUseSpecialChar(true);\r\n }\r\n else if(bool.charAt(3)=='f' || bool.charAt(3)=='F') {\r\n /* At the 3'th index char 'f' simply represent\r\n * in generating the password special character cannot be used.\r\n */\r\n passwordGenerator.setUseSpecialChar(false);\r\n }\r\n else {\r\n help();\r\n }\r\n }", "public VigenereCipher(String password,Alphabet alphabet) {\n super(alphabet); //call to parent class\n this.password = password;\n }" ]
[ "0.77406114", "0.75439173", "0.7517851", "0.73572844", "0.7225396", "0.70924175", "0.69967484", "0.69691956", "0.6837955", "0.6822274", "0.67922825", "0.677996", "0.67750657", "0.67222697", "0.6703335", "0.6642647", "0.6625367", "0.65740186", "0.6551252", "0.65147203", "0.6484211", "0.64842105", "0.64345425", "0.6433256", "0.6426653", "0.64018446", "0.63584155", "0.6345997", "0.632468", "0.62995833", "0.6296942", "0.6292734", "0.62770194", "0.6252575", "0.6239523", "0.6239523", "0.6239523", "0.6239523", "0.6239523", "0.6239523", "0.6239523", "0.6239523", "0.6239523", "0.6237603", "0.62352866", "0.6228764", "0.620764", "0.6199121", "0.6179197", "0.6175841", "0.6175399", "0.6172324", "0.6163841", "0.61621034", "0.6126526", "0.6126526", "0.6126526", "0.6126526", "0.6126526", "0.6126526", "0.6126526", "0.6120997", "0.61140954", "0.60981715", "0.6087305", "0.60819536", "0.60568976", "0.6046044", "0.60294354", "0.60245514", "0.6020833", "0.5999978", "0.5989927", "0.5988025", "0.5983502", "0.5976154", "0.59743625", "0.5962222", "0.5945874", "0.5944692", "0.5931171", "0.59276026", "0.5897256", "0.5892786", "0.58801633", "0.5878706", "0.58720505", "0.5834918", "0.5834307", "0.58319986", "0.5822982", "0.581234", "0.58087176", "0.5805335", "0.5800223", "0.5794042", "0.5794042", "0.57934034", "0.5789168", "0.5787636", "0.57768583" ]
0.0
-1
Created by Devon on 2017/12/14.
public interface AboutUsNavigator { void onUpdateApp(String msg, String downloadUrl); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "private stendhal() {\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}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void anular() {\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\n \n }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n public void func_104112_b() {\n \n }", "private static void cajas() {\n\t\t\n\t}", "@Override\n public void init() {\n }", "@Override\n 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\r\n\tpublic void rozmnozovat() {\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 dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n protected void initialize() \n {\n \n }", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void gravarBd() {\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\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n public void init() {}", "public void mo38117a() {\n }", "private void init() {\n\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "private void m50366E() {\n }", "protected boolean func_70814_o() { return true; }", "@Override\n public void memoria() {\n \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\n public void initialize() { \n }", "@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}", "@Override\n protected void init() {\n }", "@Override\r\n\tpublic void init() {}", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "public void mo4359a() {\n }", "@Override\n\tpublic void afterInit() {\n\t\t\n\t}", "@Override\n\tpublic void afterInit() {\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}", "private void kk12() {\n\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n\tpublic void init() {\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\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\n public void settings() {\n // TODO Auto-generated method stub\n \n }", "@Override\n public int getSize() {\n return 1;\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "Consumable() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}" ]
[ "0.6014521", "0.5753501", "0.5731396", "0.57297254", "0.564808", "0.5616808", "0.5616808", "0.5539621", "0.55205095", "0.54849666", "0.5479971", "0.547974", "0.5473567", "0.5469077", "0.54661167", "0.5465052", "0.5456866", "0.5451074", "0.54472274", "0.54395425", "0.5416094", "0.54124457", "0.54026335", "0.5402579", "0.5402579", "0.5402579", "0.5402579", "0.5402579", "0.5402579", "0.54025567", "0.538248", "0.538248", "0.538248", "0.538248", "0.538248", "0.53807133", "0.53807133", "0.5376048", "0.5369129", "0.5353021", "0.535124", "0.5338758", "0.53318226", "0.533118", "0.53265095", "0.53136915", "0.53136915", "0.5311135", "0.53068525", "0.5305535", "0.5302954", "0.53029215", "0.5301021", "0.5301021", "0.5289401", "0.5281698", "0.52730465", "0.5271155", "0.5271155", "0.5271155", "0.52688247", "0.52588594", "0.5252684", "0.5252684", "0.5252684", "0.5251649", "0.5251105", "0.52508396", "0.52507603", "0.5248155", "0.5243888", "0.522847", "0.52278113", "0.52278113", "0.5223489", "0.5223489", "0.5223489", "0.52212846", "0.5220787", "0.51981246", "0.5195071", "0.5195071", "0.5195071", "0.5195071", "0.5195071", "0.5195071", "0.5195071", "0.51925284", "0.51763743", "0.51763743", "0.51763743", "0.517611", "0.51632357", "0.51609844", "0.51602846", "0.5157428", "0.51516736", "0.5151147", "0.51475835", "0.5137369", "0.5137159" ]
0.0
-1
/ / / / / / / / / / / / / / / / / / / / / / / / / / / /
protected void parseURL(URL paramURL, String paramString, int paramInt1, int paramInt2) { /* 126 */ String str1 = paramURL.getProtocol(); /* 127 */ String str2 = paramURL.getAuthority(); /* 128 */ String str3 = paramURL.getUserInfo(); /* 129 */ String str4 = paramURL.getHost(); /* 130 */ int i = paramURL.getPort(); /* 131 */ String str5 = paramURL.getPath(); /* 132 */ String str6 = paramURL.getQuery(); /* */ /* */ /* 135 */ String str7 = paramURL.getRef(); /* */ /* 137 */ boolean bool1 = false; /* 138 */ boolean bool2 = false; /* */ /* */ /* */ /* 142 */ if (paramInt1 < paramInt2) { /* 143 */ int k = paramString.indexOf('?'); /* 144 */ bool2 = (k == paramInt1) ? true : false; /* 145 */ if (k != -1 && k < paramInt2) { /* 146 */ str6 = paramString.substring(k + 1, paramInt2); /* 147 */ if (paramInt2 > k) /* 148 */ paramInt2 = k; /* 149 */ paramString = paramString.substring(0, k); /* */ } /* */ } /* */ /* 153 */ int j = 0; /* */ /* */ /* */ /* */ /* */ /* 159 */ boolean bool3 = (paramInt1 <= paramInt2 - 4 && paramString.charAt(paramInt1) == '/' && paramString.charAt(paramInt1 + 1) == '/' && paramString.charAt(paramInt1 + 2) == '/' && paramString.charAt(paramInt1 + 3) == '/') ? true : false; /* 160 */ if (!bool3 && paramInt1 <= paramInt2 - 2 && paramString.charAt(paramInt1) == '/' && paramString /* 161 */ .charAt(paramInt1 + 1) == '/') { /* 162 */ paramInt1 += 2; /* 163 */ j = paramString.indexOf('/', paramInt1); /* 164 */ if (j < 0 || j > paramInt2) { /* 165 */ j = paramString.indexOf('?', paramInt1); /* 166 */ if (j < 0 || j > paramInt2) { /* 167 */ j = paramInt2; /* */ } /* */ } /* 170 */ str4 = str2 = paramString.substring(paramInt1, j); /* */ /* 172 */ int k = str2.indexOf('@'); /* 173 */ if (k != -1) { /* 174 */ if (k != str2.lastIndexOf('@')) { /* */ /* 176 */ str3 = null; /* 177 */ str4 = null; /* */ } else { /* 179 */ str3 = str2.substring(0, k); /* 180 */ str4 = str2.substring(k + 1); /* */ } /* */ } else { /* 183 */ str3 = null; /* */ } /* 185 */ if (str4 != null) { /* */ /* */ /* 188 */ if (str4.length() > 0 && str4.charAt(0) == '[') { /* 189 */ if ((k = str4.indexOf(']')) > 2) { /* */ /* 191 */ String str = str4; /* 192 */ str4 = str.substring(0, k + 1); /* */ /* 194 */ if (!IPAddressUtil.isIPv6LiteralAddress(str4.substring(1, k))) { /* 195 */ throw new IllegalArgumentException("Invalid host: " + str4); /* */ } /* */ /* */ /* 199 */ i = -1; /* 200 */ if (str.length() > k + 1) { /* 201 */ if (str.charAt(k + 1) == ':') { /* 202 */ k++; /* */ /* 204 */ if (str.length() > k + 1) { /* 205 */ i = Integer.parseInt(str.substring(k + 1)); /* */ } /* */ } else { /* 208 */ throw new IllegalArgumentException("Invalid authority field: " + str2); /* */ } /* */ } /* */ } else { /* */ /* 213 */ throw new IllegalArgumentException("Invalid authority field: " + str2); /* */ } /* */ } else { /* */ /* 217 */ k = str4.indexOf(':'); /* 218 */ i = -1; /* 219 */ if (k >= 0) { /* */ /* 221 */ if (str4.length() > k + 1) { /* 222 */ i = Integer.parseInt(str4.substring(k + 1)); /* */ } /* 224 */ str4 = str4.substring(0, k); /* */ } /* */ } /* */ } else { /* 228 */ str4 = ""; /* */ } /* 230 */ if (i < -1) { /* 231 */ throw new IllegalArgumentException("Invalid port number :" + i); /* */ } /* 233 */ paramInt1 = j; /* */ /* */ /* 236 */ if (str2 != null && str2.length() > 0) { /* 237 */ str5 = ""; /* */ } /* */ } /* 240 */ if (str4 == null) { /* 241 */ str4 = ""; /* */ } /* */ /* */ /* 245 */ if (paramInt1 < paramInt2) { /* 246 */ if (paramString.charAt(paramInt1) == '/') { /* 247 */ str5 = paramString.substring(paramInt1, paramInt2); /* 248 */ } else if (str5 != null && str5.length() > 0) { /* 249 */ bool1 = true; /* 250 */ int k = str5.lastIndexOf('/'); /* 251 */ String str = ""; /* 252 */ if (k == -1 && str2 != null) { /* 253 */ str = "/"; /* */ } /* 255 */ str5 = str5.substring(0, k + 1) + str + paramString.substring(paramInt1, paramInt2); /* */ } else { /* */ /* 258 */ String str = (str2 != null) ? "/" : ""; /* 259 */ str5 = str + paramString.substring(paramInt1, paramInt2); /* */ } /* 261 */ } else if (bool2 && str5 != null) { /* 262 */ int k = str5.lastIndexOf('/'); /* 263 */ if (k < 0) /* 264 */ k = 0; /* 265 */ str5 = str5.substring(0, k) + "/"; /* */ } /* 267 */ if (str5 == null) { /* 268 */ str5 = ""; /* */ } /* 270 */ if (bool1) { /* */ /* 272 */ while ((j = str5.indexOf("/./")) >= 0) { /* 273 */ str5 = str5.substring(0, j) + str5.substring(j + 2); /* */ } /* */ /* 276 */ j = 0; /* 277 */ while ((j = str5.indexOf("/../", j)) >= 0) { /* */ /* */ /* */ /* */ /* */ /* */ /* 284 */ if (j > 0 && (paramInt2 = str5.lastIndexOf('/', j - 1)) >= 0 && str5 /* 285 */ .indexOf("/../", paramInt2) != 0) { /* 286 */ str5 = str5.substring(0, paramInt2) + str5.substring(j + 3); /* 287 */ j = 0; continue; /* */ } /* 289 */ j += 3; /* */ } /* */ /* */ /* */ /* 294 */ j = str5.indexOf("/.."); /* 295 */ while (str5.endsWith("/..") && (paramInt2 = str5.lastIndexOf('/', j - 1)) >= 0) { /* 296 */ str5 = str5.substring(0, paramInt2 + 1); /* */ } /* */ /* */ /* */ /* */ /* 302 */ if (str5.startsWith("./") && str5.length() > 2) { /* 303 */ str5 = str5.substring(2); /* */ } /* */ /* 306 */ if (str5.endsWith("/.")) { /* 307 */ str5 = str5.substring(0, str5.length() - 1); /* */ } /* */ } /* 310 */ setURL(paramURL, str1, str4, i, str2, str3, str5, str6, str7); /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static int getNumPatterns() { return 64; }", "double passer();", "private double[] getExtents(){\n return new double[] { -90, -180, 90, 180 };\n }", "void mo33732Px();", "public void method_4270() {}", "public Integer getWidth(){return this.width;}", "public void gored() {\n\t\t\n\t}", "private int parent(int i){return (i-1)/2;}", "public int getBlockLength()\r\n/* 45: */ {\r\n/* 46:107 */ return -32;\r\n/* 47: */ }", "@Override\n\tpublic int sount() {\n\t\treturn 0;\n\t}", "public int getInternalBlockLength()\r\n/* 40: */ {\r\n/* 41: 95 */ return 32;\r\n/* 42: */ }", "double seBlesser();", "int getSize ();", "int getWidth() {return width;}", "private int leftChild(int i){return 2*i+1;}", "private void poetries() {\n\n\t}", "static int size_of_inx(String passed){\n\t\treturn 1;\n\t}", "@Override\n\tprotected void interr() {\n\t}", "int width();", "@Override\n public void perish() {\n \n }", "int getTribeSize();", "static int size_of_xra(String passed){\n\t\treturn 1;\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n public int getSize() {\n return 1;\n }", "public int length() { return 1+maxidx; }", "public byte[] initialValue() {\n return new byte[]{(byte) -1, (byte) -40, (byte) -1, (byte) -37, (byte) 0, (byte) 67, (byte) 0, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -64, (byte) 0, (byte) 17, (byte) 8, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 3, (byte) 1, (byte) 34, (byte) 0, (byte) 2, (byte) 17, (byte) 0, (byte) 3, (byte) 17, (byte) 0, (byte) -1, (byte) -60, (byte) 0, (byte) 31, (byte) 0, (byte) 0, (byte) 1, (byte) 5, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9, (byte) 10, (byte) 11, (byte) -1, (byte) -60, (byte) 0, (byte) -75, (byte) 16, (byte) 0, (byte) 2, (byte) 1, (byte) 3, (byte) 3, (byte) 2, (byte) 4, (byte) 3, (byte) 5, (byte) 5, (byte) 4, (byte) 4, (byte) 0, (byte) 0, (byte) 1, (byte) 125, (byte) 1, (byte) 2, (byte) 3, (byte) 0, (byte) 4, (byte) 17, (byte) 5, (byte) 18, (byte) 33, (byte) 49, (byte) 65, (byte) 6, (byte) 19, (byte) 81, (byte) 97, (byte) 7, (byte) 34, (byte) 113, (byte) 20, (byte) 50, (byte) -127, (byte) -111, (byte) -95, (byte) 8, (byte) 35, (byte) 66, (byte) -79, (byte) -63, (byte) 21, (byte) 82, (byte) -47, (byte) -16, (byte) 36, (byte) 51, (byte) 98, (byte) 114, (byte) -126, (byte) 9, (byte) 10, (byte) 22, (byte) 23, (byte) 24, (byte) 25, (byte) 26, (byte) 37, (byte) 38, (byte) 39, (byte) 40, (byte) 41, (byte) 42, (byte) 52, (byte) 53, (byte) 54, (byte) 55, (byte) 56, (byte) 57, (byte) 58, (byte) 67, (byte) 68, (byte) 69, (byte) 70, (byte) 71, (byte) 72, (byte) 73, (byte) 74, (byte) 83, (byte) 84, (byte) 85, (byte) 86, (byte) 87, (byte) 88, (byte) 89, (byte) 90, (byte) 99, (byte) 100, (byte) 101, (byte) 102, (byte) 103, (byte) 104, (byte) 105, (byte) 106, (byte) 115, (byte) 116, (byte) 117, (byte) 118, (byte) 119, (byte) 120, (byte) 121, (byte) 122, (byte) -125, (byte) -124, (byte) -123, (byte) -122, (byte) -121, (byte) -120, (byte) -119, (byte) -118, (byte) -110, (byte) -109, (byte) -108, (byte) -107, (byte) -106, (byte) -105, (byte) -104, (byte) -103, (byte) -102, (byte) -94, (byte) -93, (byte) -92, (byte) -91, (byte) -90, (byte) -89, (byte) -88, (byte) -87, (byte) -86, (byte) -78, (byte) -77, (byte) -76, (byte) -75, (byte) -74, (byte) -73, (byte) -72, (byte) -71, (byte) -70, (byte) -62, (byte) -61, (byte) -60, (byte) -59, (byte) -58, (byte) -57, (byte) -56, (byte) -55, (byte) -54, (byte) -46, (byte) -45, (byte) -44, (byte) -43, (byte) -42, (byte) -41, (byte) -40, (byte) -39, (byte) -38, (byte) -31, (byte) -30, (byte) -29, (byte) -28, (byte) -27, (byte) -26, (byte) -25, (byte) -24, (byte) -23, (byte) -22, (byte) -15, (byte) -14, (byte) -13, (byte) -12, (byte) -11, (byte) -10, (byte) -9, (byte) -8, (byte) -7, (byte) -6, (byte) -1, (byte) -60, (byte) 0, (byte) 31, (byte) 1, (byte) 0, (byte) 3, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9, (byte) 10, (byte) 11, (byte) -1, (byte) -60, (byte) 0, (byte) -75, (byte) 17, (byte) 0, (byte) 2, (byte) 1, (byte) 2, (byte) 4, (byte) 4, (byte) 3, (byte) 4, (byte) 7, (byte) 5, (byte) 4, (byte) 4, (byte) 0, (byte) 1, (byte) 2, (byte) 119, (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 17, (byte) 4, (byte) 5, (byte) 33, (byte) 49, (byte) 6, (byte) 18, (byte) 65, (byte) 81, (byte) 7, (byte) 97, (byte) 113, (byte) 19, (byte) 34, (byte) 50, (byte) -127, (byte) 8, (byte) 20, (byte) 66, (byte) -111, (byte) -95, (byte) -79, (byte) -63, (byte) 9, (byte) 35, (byte) 51, (byte) 82, (byte) -16, (byte) 21, (byte) 98, (byte) 114, (byte) -47, (byte) 10, (byte) 22, (byte) 36, (byte) 52, (byte) -31, (byte) 37, (byte) -15, (byte) 23, (byte) 24, (byte) 25, (byte) 26, (byte) 38, (byte) 39, (byte) 40, (byte) 41, (byte) 42, (byte) 53, (byte) 54, (byte) 55, (byte) 56, (byte) 57, (byte) 58, (byte) 67, (byte) 68, (byte) 69, (byte) 70, (byte) 71, (byte) 72, (byte) 73, (byte) 74, (byte) 83, (byte) 84, (byte) 85, (byte) 86, (byte) 87, (byte) 88, (byte) 89, (byte) 90, (byte) 99, (byte) 100, (byte) 101, (byte) 102, (byte) 103, (byte) 104, (byte) 105, (byte) 106, (byte) 115, (byte) 116, (byte) 117, (byte) 118, (byte) 119, (byte) 120, (byte) 121, (byte) 122, (byte) -126, (byte) -125, (byte) -124, (byte) -123, (byte) -122, (byte) -121, (byte) -120, (byte) -119, (byte) -118, (byte) -110, (byte) -109, (byte) -108, (byte) -107, (byte) -106, (byte) -105, (byte) -104, (byte) -103, (byte) -102, (byte) -94, (byte) -93, (byte) -92, (byte) -91, (byte) -90, (byte) -89, (byte) -88, (byte) -87, (byte) -86, (byte) -78, (byte) -77, (byte) -76, (byte) -75, (byte) -74, (byte) -73, (byte) -72, (byte) -71, (byte) -70, (byte) -62, (byte) -61, (byte) -60, (byte) -59, (byte) -58, (byte) -57, (byte) -56, (byte) -55, (byte) -54, (byte) -46, (byte) -45, (byte) -44, (byte) -43, (byte) -42, (byte) -41, (byte) -40, (byte) -39, (byte) -38, (byte) -30, (byte) -29, (byte) -28, (byte) -27, (byte) -26, (byte) -25, (byte) -24, (byte) -23, (byte) -22, (byte) -14, (byte) -13, (byte) -12, (byte) -11, (byte) -10, (byte) -9, (byte) -8, (byte) -7, (byte) -6, (byte) -1, (byte) -38, (byte) 0, (byte) 12, (byte) 3, (byte) 1, (byte) 0, (byte) 2, (byte) 17, (byte) 3, (byte) 17, (byte) 0, (byte) 63, (byte) 0, (byte) -114, (byte) -118, (byte) 40, (byte) -96, (byte) 15, (byte) -1, (byte) -39};\n }", "public abstract void bepaalGrootte();", "public int getTakeSpace() {\n return 0;\n }", "public void getTile_B8();", "int fixedSize();", "int memSize() {\n return super.memSize() + 4 * 4; }", "public int generateRoshambo(){\n ;]\n\n }", "private void m50366E() {\n }", "public abstract void mo56925d();", "static int size_of_xthl(String passed){\n\t\treturn 1;\n\t}", "public void skystonePos4() {\n }", "@Override\r\n\tpublic int size() {\n\t\treturn 27;\r\n\t}", "static int size_of_rpo(String passed){\n\t\treturn 1;\n\t}", "public int getEdgeCount() \n {\n return 3;\n }", "public abstract int mo9754s();", "public int getSize(){return _size;}", "public interface Probing {\r\n\t/**\r\n\t * Get an alternate hash position\r\n\t * @param key The original key\r\n\t * @param i How many spaces are occupied already\r\n\t * @param max How many spaces are available\r\n\t * @return A new position for the key\r\n\t */\r\n\tpublic int getHash(int key, int i, int max);\r\n}", "public abstract int getSpotsNeeded();", "@Override\n public int getSize() {\n return 64;\n }", "@Override\n protected int mapSize() {\n return left.size()+right.size()-hidden.size();\n }", "public int getWidth() {\r\n\treturn this.width;\r\n}", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "static int size_of_shld(String passed){\n\t\treturn 3;\n\t}", "public void verliesLeven() {\r\n\t\t\r\n\t}", "@Override\n public int getSize() {\n\treturn 0;\n }", "@Override\n\tpublic float getWidth() {\n\t\treturn 26;\n\t}", "public double getWidth() {\n return this.size * 2.0; \n }", "public interface ITechLinker extends ITechByteObject {\r\n \r\n /**\r\n * \r\n */\r\n public static final int LINKER_BASIC_SIZE = A_OBJECT_BASIC_SIZE + 5;\r\n\r\n /**\r\n * \r\n */\r\n public static final int LINKER_OFFSET_01_TYPE1 = A_OBJECT_BASIC_SIZE;\r\n\r\n /**\r\n * \r\n */\r\n public static final int LINKER_OFFSET_02_DATA4 = A_OBJECT_BASIC_SIZE + 1;\r\n\r\n}", "static int size_of_rp(String passed){\n\t\treturn 1;\n\t}", "@Override\n\tpublic int computeSize() {\n\t\treturn 36;\n\t}", "private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }", "protected int getWidth()\n\t{\n\t\treturn 0;\n\t}", "public void mo21877s() {\n }", "int align();", "static int size_of_xri(String passed){\n\t\treturn 2;\n\t}", "public int getSize(){return this.size;}", "default int getCompositeBitLength() {\n return getHighBitLength() + getLowBitLength();\n }", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\n }", "public int get_resource_distance() {\n return 1;\r\n }", "public static int size_parentId() {\n return (16 / 8);\n }", "@Override\n public int width()\n {\n return widthCent; //Charlie Gao helped me debug the issue here\n }", "long getWidth();", "int getSpriteArraySize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int size() {\n int basic = ((offset() + 4) & ~3) - offset() + 8;\n /* Add 8*number of offsets */\n return basic + targetsOp.length*8;\n }", "private void level7() {\n }", "double getNewWidth();", "public static int size_parent() {\n return (8 / 8);\n }", "long getSize();", "@Override\n protected long advanceH(final long k) {\n return 5 * k - 2;\n }", "public abstract String mo9239aw();", "public abstract String mo118046b();", "int getKeySize();", "long getMid();", "long getMid();", "private void kk12() {\n\n\t}", "void mo57277b();", "@Override\n public String toString()\n {\n\treturn getClass().getSimpleName() + \" (\" + getLength() + \"x\" + getWidth() + \")\";\n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "static int size_of_rz(String passed){\n\t\treturn 1;\n\t}", "public abstract int mo8526p();", "@Override\r\n\tpublic int operar() {\n\t\treturn 0;\r\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "public void skystonePos6() {\n }" ]
[ "0.5150234", "0.51409507", "0.5115881", "0.50840217", "0.500553", "0.50016564", "0.4993842", "0.4991954", "0.4972456", "0.49624422", "0.49493468", "0.4933417", "0.49317768", "0.49295402", "0.49191913", "0.49125338", "0.49100533", "0.49095747", "0.49088156", "0.48982656", "0.48923448", "0.48872903", "0.48850387", "0.48728403", "0.48708487", "0.48532677", "0.48500523", "0.48479903", "0.48457775", "0.48399022", "0.4838962", "0.4837924", "0.48353893", "0.4835113", "0.48341995", "0.48274103", "0.4824194", "0.48207915", "0.48188564", "0.4818289", "0.4817438", "0.48143148", "0.48132792", "0.4805217", "0.4803261", "0.47997957", "0.47961062", "0.47940195", "0.47911614", "0.47892773", "0.47854674", "0.47838303", "0.47796378", "0.47784021", "0.47676972", "0.4765487", "0.4765189", "0.47640085", "0.4762104", "0.47597563", "0.47593778", "0.47576043", "0.4755336", "0.4751557", "0.47515175", "0.47514042", "0.47501507", "0.47454962", "0.4744656", "0.4744656", "0.4744656", "0.4744656", "0.4744656", "0.4744656", "0.4744656", "0.4744656", "0.4744656", "0.4744656", "0.4744656", "0.4744656", "0.4744656", "0.47391316", "0.47374767", "0.47332007", "0.4728761", "0.47227168", "0.47220162", "0.4720675", "0.47175118", "0.4717067", "0.47170314", "0.47170314", "0.47133628", "0.4713117", "0.47070348", "0.47008193", "0.47006696", "0.4699828", "0.46984562", "0.46964493", "0.46945134" ]
0.0
-1
/ / / / / / / /
protected int getDefaultPort() { /* 320 */ return -1; /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int parent(int i){return (i-1)/2;}", "private int leftChild(int i){return 2*i+1;}", "public void divide() {\n\t\t\n\t}", "private int rightChild(int i){return 2*i+2;}", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "public abstract void bepaalGrootte();", "public static void bottomHalf() {\n\n for(int i = 1; i <= SIZE; i++) {\n for(int j = 1; j <= i - 1; j++) {\n System.out.print(\" \");\n }\n \n\t System.out.print(\"\\\\_\");\n\t for(int j = 3*SIZE-i; j >= i; j--) {\n\t System.out.print(\"/\\\\\");\n\t }\n\t System.out.println(\"_/\");\n }\n }", "double passer();", "public String ring();", "public void gored() {\n\t\t\n\t}", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\n }", "public double getWidth() {\n return this.left.getLeft(0) - this.right.getRight(0); \n }", "private static Object[] newPath(int length, Object[] leaf) {\n Object[] node = leaf;\n for (int i = 0; i < length; i += 5) {\n node = new Object[] { node };\n }\n return node;\n }", "int getWidth() {return width;}", "public String toString(){ return \"DIV\";}", "public abstract String division();", "public void getTile_B8();", "public double getWidth() {\n return this.size * 2.0; \n }", "public Integer getWidth(){return this.width;}", "int width();", "private double[] getExtents(){\n return new double[] { -90, -180, 90, 180 };\n }", "private void pointer(Graphics image,int x,int y,int height,int b,int dir) {\n\n\t\tint[] xt=new int[3];\n\t\tint[] yt=new int[3];\n\n\t\tif(dir==0) {\n\t\t\txt[0]=x;\n\t\t\txt[1]=xt[2]=x+height;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=y+b/2;\n\t\t\tyt[2]=y-b/2;\n\t\t} else {\n\t\t\txt[0]=x;\n\t\t\txt[1]=x+b/2;\n\t\t\txt[2]=x-b/2;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=yt[2]=y-height;\n\t\t}\n\t\timage.fillPolygon(xt,yt,3);\n\t}", "@Override\n public void bfs() {\n\n }", "private int leftChild(int index){\n\t\treturn (2*index) +1;\n\t}", "double volume(){\n return width*height*depth;\n }", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "private int get_right_child(int index){\r\n return 2 * index + 2;\r\n }", "private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }", "@Override\npublic void processDirection() {\n\t\n}", "Operations operations();", "public double getWidth() { return _width<0? -_width : _width; }", "public int generateRoshambo(){\n ;]\n\n }", "public static void main(String[] args) {\n\n\n for(int a=0; a<7;a++){\n for(int b=0;b<7-a;b++){\n System.out.print(\" \");\n }\n for(int c=0; c<=a;c++){\n System.out.print(\"* \");\n }\n System.out.println(\" \");\n }\n\n }", "static void pyramid(){\n\t}", "public static void sizePathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze five = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\t//System.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = five.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber + n)){\n\t\t\t\t\t\tS.unionBySize(randomNumber+n, randomNumber);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'u');\n\t\t\t\t\t\t//S.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.unionBySize(randomNumber, randomNumber+1);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(five, n);\n\t\tuserSelection_SolveMaze(n);\n\n\t\tStdDraw.show(0);\n\t\tfive.draw();\n\t\tfive.printCellNumbers();\t\n\t}", "public void SubRect(){\n\t\n}", "protected boolean\nshouldCompactPathLists()\n//\n////////////////////////////////////////////////////////////////////////\n{\n return true;\n}", "public double getWidth() {\n return this.getRight(this.tree.getRight(0)) - this.getLeft(this.tree.getLeft(0)); \n }", "private static void breadcrumbArrow(int width, int height, int indent, int c1, int c2) {\n\n\t\tdouble x0 = 0, y0 = height / 2d;\n\t\tdouble x1 = indent, y1 = 0;\n\t\tdouble x2 = indent, y2 = height / 2d;\n\t\tdouble x3 = indent, y3 = height;\n\t\tdouble x4 = width, y4 = 0;\n\t\tdouble x5 = width, y5 = height / 2d;\n\t\tdouble x6 = width, y6 = height;\n\t\tdouble x7 = indent + width, y7 = 0;\n\t\tdouble x8 = indent + width, y8 = height;\n\n\t\tint fc1 = ColorHelper.mixAlphaColors(c1, c2, 0);\n\t\tint fc2 = ColorHelper.mixAlphaColors(c1, c2, (indent)/(width + 2f * indent));\n\t\tint fc3 = ColorHelper.mixAlphaColors(c1, c2, (indent + width)/(width + 2f * indent));\n\t\tint fc4 = ColorHelper.mixAlphaColors(c1, c2, 1);\n\n\t\tRenderSystem.disableTexture();\n\t\tRenderSystem.enableBlend();\n\t\tRenderSystem.disableAlphaTest();\n\t\tRenderSystem.defaultBlendFunc();\n\t\tRenderSystem.shadeModel(GL11.GL_SMOOTH);\n\n\t\tTessellator tessellator = Tessellator.getInstance();\n\t\tBufferBuilder bufferbuilder = tessellator.getBuffer();\n\t\tbufferbuilder.begin(GL11.GL_TRIANGLES, DefaultVertexFormats.POSITION_COLOR);\n\n\t\tbufferbuilder.vertex(x0, y0, 0).color(fc1 >> 16 & 0xFF, fc1 >> 8 & 0xFF, fc1 & 0xFF, fc1 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x1, y1, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x2, y2, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x0, y0, 0).color(fc1 >> 16 & 0xFF, fc1 >> 8 & 0xFF, fc1 & 0xFF, fc1 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x2, y2, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x1, y1, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x6, y6, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x5, y5, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x7, y7, 0).color(fc4 >> 16 & 0xFF, fc4 >> 8 & 0xFF, fc4 & 0xFF, fc4 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x6, y6, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x5, y5, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x8, y8, 0).color(fc4 >> 16 & 0xFF, fc4 >> 8 & 0xFF, fc4 & 0xFF, fc4 >> 24 & 0xFF).endVertex();\n\n\t\ttessellator.draw();\n\t\tRenderSystem.shadeModel(GL11.GL_FLAT);\n\t\tRenderSystem.disableBlend();\n\t\tRenderSystem.enableAlphaTest();\n\t\tRenderSystem.enableTexture();\n\t}", "void sharpen();", "void sharpen();", "void mo33732Px();", "void walk() {\n\t\t\n\t}", "public void skystonePos4() {\n }", "private void traversePath()\n\t{\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t}", "@Override\r\n\tpublic void walk() {\n\r\n\t}", "public static void unionPathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze two = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\tSystem.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = two.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber+n) != S.findAndCompress(randomNumber)){\n\t\t\t\t\t\tS.union(randomNumber+n, randomNumber);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'u');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.union(randomNumber, randomNumber+1);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(two, n);\n\t\tuserSelection_SolveMaze(n);\n\n\n\t\tStdDraw.show(0);\n\t\ttwo.draw();\n\t\ttwo.printCellNumbers();\n\t}", "public double getPerimiter(){return (2*height +2*width);}", "public void foundLeaf(int width, int height, int level, int currX, int currY, int location) {\n level = level +2;\n if (location == 1) {\n\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - ( (new Double(spatialHeight / Math.pow(2, level ))).intValue()),\n currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY * 2,\n Color.BLACK);\n\n\n canvas.addLine(((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue())) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n currX,\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n\n }\n\n if (location == 2) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n ( currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n (currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n\n\n }\n\n if (location == 3) {\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY,\n Color.BLACK);\n\n\n\n canvas.addLine((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n\tcurrY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n (currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n }\n\n if (location == 4) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY,\n Color.BLACK);\n\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue() + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), Color.BLACK);\n\n\n }\n\n\n\n\n }", "public static void main(String[] args) {\n\t\tScanner obj=new Scanner(System.in);\r\n\t\tint a=0;\r\n\t\tint count=0;\r\n System.out.println(\"enter size\");\r\n\t\ta=obj.nextInt();\r\n\t\tint m=2*a+1;\r\n\t\tint n=2*a+2;\r\n\t\tint mid=(m+1)/2;\r\n\t\tfor(int i=1;i<=m;i++)\r\n\t\t{\r\n\t\t\tcount=0;\r\n\t\t\tfor(int j=1;j<=n;j++)\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t\tif((i==1)||(i==m)||(j==1)||(j==n))//frame begin\r\n\t\t\t\t{\r\n\t\t\t\t\tif((i==1)||(i==m))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"+\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t {\r\n\t\t\t\t\t\t\tSystem.out.print(\"|\");//frame left and right\r\n\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//frame end\r\n\t\t\t\telse if (i<mid)//upper-half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t for(int l=1;l<=2*i-4;l++)\r\n\t\t\t\t {\r\n\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\tSystem.out.print(\"\\\\\");\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end of upper half\r\n\t\t\t\telse if(i>mid)//lower half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfor(int k=mid;k<i;k++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t System.out.print(\"\\\\\");\r\n\t\t\t\t\t for(int l=2*m-6;l>2*i-4;l--)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t }\r\n\t\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t\t for(int k=mid;k<i;k++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t\t\t}//end of lower half\r\n\t\t\t\telse if(i==mid)//middle part\r\n\t\t\t\t{\r\n\t\t\t\t\tif(j==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"<\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(j==n-1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\">\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i%2==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"=\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end\r\n\t\t\t}//end-of-j\r\n\t\t\tSystem.out.println();\r\n\t\t}//end\r\n\r\n\t}", "double getNewWidth();", "Parallelogram(){\n length = width = height = 0;\n }", "int[] union(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n\t\t//Please fill in the program here\r\n\t\tst[0] = incCapacity();\r\n\t\taddEdge(st[0], epssymbol, s1);\r\n\t\taddEdge(st[0], epssymbol, s2);\r\n\t\tst[1] = incCapacity();\r\n\t\taddEdge(t1, epssymbol, st[1]);\r\n\t\taddEdge(t2, epssymbol, st[1]);\r\n\r\n\t\treturn st;\r\n\t}", "long getWidth();", "public int getWidth() {\r\n\treturn this.width;\r\n}", "double getPerimeter(){\n return 2*height+width;\n }", "public int getEdgeCount() \n {\n return 3;\n }", "double Volume(){\r\n return Height * Width * Depth;\r\n }", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "public void draw(){\n for(int i = 1; i <= height; i++){\n for(int s = 1; s <= i; s++)\n System.out.print(\"*\");\n System.out.println();\n }\n }", "public void stg() {\n\n\t}", "@Override\n\tpublic void walk() {\n\t\t\n\t}", "private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }", "public void lowerFlatbed(){\n flatbed.lowerFlatbed();\n }", "double seBlesser();", "public void leerPlanesDietas();", "public static void main(String[] args) {\n\t\tfor(int j=0;j<8;j++){\n\t\t\tfor(int i=0;i<8;i++){\n\t\t\t\t//上下两侧\n\t\t\t\tif(j==0||j==7){\n\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t}else{\n\t\t\t\t\t//中间\n\t\t\t\t\tif(i>0&&i<7){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public int my_leaf_count();", "public static String makeShapeA() {\n\tString result = \"\";\n\t\tfor (int i = 0; i < 8 ; i++) {\n\t\t\tresult+=printHash(i);\n\t\t\t\n\t\t}return result;\n\t\t\t//System.out.println(printHash(i));\n\t\t}", "public String getRing();", "void doubleBox(int sides, float x1, float y1, float z1, float x2, float y2, float z2)\r\n/* 100: */ {\r\n/* 101: 99 */ int s2 = sides << 1 & 0x2A | sides >> 1 & 0x15;\r\n/* 102: */ \r\n/* 103:101 */ this.context.renderBox(sides, x1, y1, z1, x2, y2, z2);\r\n/* 104:102 */ this.context.renderBox(s2, x2, y2, z2, x1, y1, z1);\r\n/* 105: */ }", "public int getWidth(){\n return width;\n }", "@Override\n protected void paint2d(Graphics2D g) {\n \n }", "private int get_left_child(int index){\r\n return 2 * index + 1;\r\n }", "public static void part2(){\n\t\n System.out.println(\"\\\\\"); //Outer wall\n System.out.println(\"\\\\\");\n System.out.println(\"\\\\\");\n for(int i = 0; i <= 16; i++){ //loop created to display top of the door\n\n \tSystem.out.print(\"-\");\n\n\t}\n System.out.println(\"\");\n System.out.println(\"\\\\\\t\\t| \\t(\\\")\"); //The door and the stick figure\n System.out.println(\"\\\\\\t\\t|\\t-|-\");\n System.out.println(\"\\\\\\t o | \\t |\");\n System.out.println(\"\\\\\\t\\t|\\t /\\\\\");\n System.out.println(\"\\\\\\t\\t|\\t/ \\\\\");\n\t\t\n }", "int fi(int x, int y) {\n\t\treturn (x + 1) + (width + 2) * (y + 1);\n\t}", "protected int parent(int i) { return (i - 1) / 2; }", "public void draw4x4 (char design){\n System.out.println(\"\"+design+design+design+design);\n System.out.println(design+\" \"+design);\n System.out.println(design+\" \"+design);\n System.out.println(\"\"+design+design+design+design);\n}", "private int get_parent(int index){\r\n return (index-1)/2;\r\n }", "@Override\r\n\tpublic double perimeter() {\n\t\treturn 2*length*breadth;\r\n\t}", "protected int getWidth()\n\t{\n\t\treturn 0;\n\t}", "static int getNumPatterns() { return 64; }", "public void renderCenterBlock(int cons, int side, int end)\r\n/* 143: */ {\r\n/* 144:135 */ if (cons == 0)\r\n/* 145: */ {\r\n/* 146:136 */ this.context.setTex(end);\r\n/* 147:137 */ doubleBox(63, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F);\r\n/* 148:138 */ return;\r\n/* 149: */ }\r\n/* 150:139 */ if (cons == 3)\r\n/* 151: */ {\r\n/* 152:140 */ this.context.setTexFlags(1773);\r\n/* 153:141 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 154:142 */ doubleBox(60, 0.375F, 0.0F, 0.375F, 0.625F, 1.0F, 0.625F);\r\n/* 155:143 */ return;\r\n/* 156: */ }\r\n/* 157:144 */ if (cons == 12)\r\n/* 158: */ {\r\n/* 159:145 */ this.context.setTexFlags(184365);\r\n/* 160:146 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 161:147 */ doubleBox(51, 0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 1.0F);\r\n/* 162:148 */ return;\r\n/* 163: */ }\r\n/* 164:149 */ if (cons == 48)\r\n/* 165: */ {\r\n/* 166:150 */ this.context.setTexFlags(187200);\r\n/* 167:151 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 168:152 */ doubleBox(15, 0.0F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);\r\n/* 169:153 */ return;\r\n/* 170: */ }\r\n/* 171:155 */ this.context.setTex(end);\r\n/* 172:156 */ doubleBox(0x3F ^ cons, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F);\r\n/* 173:157 */ if ((cons & 0x1) > 0)\r\n/* 174: */ {\r\n/* 175:158 */ this.context.setTexFlags(1773);\r\n/* 176:159 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 177:160 */ doubleBox(60, 0.375F, 0.0F, 0.375F, 0.625F, 0.375F, 0.625F);\r\n/* 178: */ }\r\n/* 179:162 */ if ((cons & 0x2) > 0)\r\n/* 180: */ {\r\n/* 181:163 */ this.context.setTexFlags(1773);\r\n/* 182:164 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 183:165 */ doubleBox(60, 0.375F, 0.625F, 0.375F, 0.625F, 1.0F, 0.625F);\r\n/* 184: */ }\r\n/* 185:167 */ if ((cons & 0x4) > 0)\r\n/* 186: */ {\r\n/* 187:168 */ this.context.setTexFlags(184365);\r\n/* 188:169 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 189:170 */ doubleBox(51, 0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 0.375F);\r\n/* 190: */ }\r\n/* 191:172 */ if ((cons & 0x8) > 0)\r\n/* 192: */ {\r\n/* 193:173 */ this.context.setTexFlags(184365);\r\n/* 194:174 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 195:175 */ doubleBox(51, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F, 1.0F);\r\n/* 196: */ }\r\n/* 197:177 */ if ((cons & 0x10) > 0)\r\n/* 198: */ {\r\n/* 199:178 */ this.context.setTexFlags(187200);\r\n/* 200:179 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 201:180 */ doubleBox(15, 0.0F, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F);\r\n/* 202: */ }\r\n/* 203:182 */ if ((cons & 0x20) > 0)\r\n/* 204: */ {\r\n/* 205:183 */ this.context.setTexFlags(187200);\r\n/* 206:184 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 207:185 */ doubleBox(15, 0.625F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);\r\n/* 208: */ }\r\n/* 209: */ }", "private void buildPath() {\r\n int xNext = 1;\r\n int yNext = map.getStartPos() + 1;\r\n CellLayered before = cells[yNext][xNext];\r\n while(true)\r\n {\r\n Byte[] xy = map.getDirection(xNext-1, yNext-1);\r\n xNext = xNext + xy[0];\r\n yNext = yNext + xy[1];\r\n\r\n CellLayered next = cells[yNext][xNext];\r\n\r\n if(xy[0]==-1)\r\n before.setRight(false);\r\n else\r\n before.setRight(true);\r\n before.setPath(true);\r\n if(next==null)\r\n break;\r\n\r\n before.setNextInPath(next);\r\n before = next;\r\n }\r\n }", "public abstract double getBaseWidth();", "private void render() {\n StringBuilder builder = new StringBuilder();\n builder.append(horizontalEdge).append(\"\\n\");\n for (int i = 0; i < this.height; i++) {\n builder.append(VERTICAL_CHAR);\n for (int j = 0; j < this.width; j++) {\n builder.append(pixels[i][j]);\n }\n builder.append(VERTICAL_CHAR);\n builder.append(\"\\n\");\n }\n builder.append(horizontalEdge);\n System.out.printf(builder.toString());\n }", "public\nstatic\nvoid\nmain(String args[]) \n\n{ \n\nBinaryTree tree = \nnew\nBinaryTree(); \n\ntree.root = \nnew\nNode(\n20\n); \n\ntree.root.left = \nnew\nNode(\n8\n); \n\ntree.root.left.left = \nnew\nNode(\n4\n); \n\ntree.root.left.right = \nnew\nNode(\n12\n); \n\ntree.root.left.right.left = \nnew\nNode(\n10\n); \n\ntree.root.left.right.right = \nnew\nNode(\n14\n); \n\ntree.root.right = \nnew\nNode(\n22\n); \n\ntree.root.right.right = \nnew\nNode(\n25\n); \n\ntree.printBoundary(tree.root); \n\n}", "public int upright();", "private void createPath(Direction d, int width, Point p1, Point p2) {\n\t\t// Determine how far away from the center the corners are\n\t\tint sideOneOffset = 0;\t// Top or Left depending on path direction\n\t\tint sideTwoOffset = 0;\t// Bot or Right depending on path direction\n\t\t// If the width is odd, balance the offsets\n\t\tif (width % 2 != 0) {\t\n\t\t\tsideOneOffset = sideTwoOffset = ((width / 2) + 1);\n\t\t} else {\n\t\t\t// If the width is even, the offsets will be off by 1\n\t\t\tsideOneOffset = width;\n\t\t\tsideTwoOffset = width - 1;\n\t\t}\n\t\tif (d == Direction.LEFT || d == Direction.RIGHT) {\n\t\t\t// If the direction is left then we want to swap the points\n\t\t\t// to pretend like the direction was right (so the following code works)\n\t\t\tif (d == Direction.LEFT) {\n\t\t\t\tPoint tempP = p2;\n\t\t\t\tp2 = p1;\n\t\t\t\tp1 = tempP;\n\t\t\t}\n\t\t\t// Set the four corners\n\t\t\tpathSquares.add(new PathSquare(\"top-left\", new Point(p1.x, p1.y - sideOneOffset)));\n\t\t\tpathSquares.add(new PathSquare(\"bot-left\", new Point(p1.x, p1.y + sideTwoOffset)));\n\t\t\tpathSquares.add(new PathSquare(\"top-right\", new Point(p2.x, p1.y - sideOneOffset)));\n\t\t\tpathSquares.add(new PathSquare(\"bot-right\", new Point(p2.x, p1.y + sideTwoOffset)));\n\t\t\t// Set the left and right walls\n\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\t// (i - width/2) ensures that p1.y is the center of the path (top to bottom)\n\t\t\t\tpathSquares.add(new PathSquare(\"left\", new Point(p1.x, p1.y + (i - width/2))));\n\t\t\t\tpathSquares.add(new PathSquare(\"right\", new Point(p2.x, p2.y + (i - width/2))));\n\t\t\t}\n\t\t\t// Set middle path and top/bottom padding (horizontal Oreo!)\n\t\t\tfor (int col = p1.x + 1, endCol = p2.x; col < endCol; col++) {\n\t\t\t\t// Add the top wafer\n\t\t\t\tpathSquares.add(new PathSquare(\"top\", new Point(col, p1.y - sideOneOffset)));\t\t\t\t\n\t\t\t\t// Add the delicious cream filling\n\t\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\t\tpathSquares.add(new PathSquare(\"middle\", new Point(col, p1.y + (i - width /2))));\n\t\t\t\t}\t\t\t\t\n\t\t\t\t// Add the bottom wafer\n\t\t\t\tpathSquares.add(new PathSquare(\"bot\", new Point(col, p1.y + sideTwoOffset)));\n\t\t\t}\n\t\t} else {\n\t\t\t// If the direction is up then we want to swap the points\n\t\t\t// to pretend like the direction was down (so the following code works)\n\t\t\tif (d == Direction.UP) {\n\t\t\t\tPoint tempP = p2;\n\t\t\t\tp2 = p1;\n\t\t\t\tp1 = tempP;\n\t\t\t}\n\t\t\t// Set the four corners\n\t\t\tpathSquares.add(new PathSquare(\"top-left\", new Point(p1.x - sideOneOffset, p1.y)));\n\t\t\tpathSquares.add(new PathSquare(\"bot-left\", new Point(p2.x - sideOneOffset, p2.y)));\n\t\t\tpathSquares.add(new PathSquare(\"top-right\", new Point(p1.x + sideTwoOffset, p1.y)));\n\t\t\tpathSquares.add(new PathSquare(\"bot-right\", new Point(p2.x + sideTwoOffset, p2.y)));\n\t\t\t// Set the top and bottom walls\n\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\t// (i - width/2) ensures that p1.x is the center of the path (left to right)\n\t\t\t\tpathSquares.add(new PathSquare(\"top\", new Point(p1.x + (i - width /2), p1.y)));\n\t\t\t\tpathSquares.add(new PathSquare(\"bot\", new Point(p2.x + (i - width /2), p2.y)));\n\t\t\t}\n\t\t\t// Set middle path and left/right padding (vertical Oreo!)\n\t\t\tfor (int row = p1.y + 1, endRow = p2.y; row < endRow; row++) {\n\t\t\t\t// Add the left wafer\n\t\t\t\tpathSquares.add(new PathSquare(\"left\", new Point(p1.x - sideOneOffset, row)));\t\t\t\t\n\t\t\t\t// Add the delicious cream filling\n\t\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\t\tpathSquares.add(new PathSquare(\"middle\", new Point(p1.x + (i - width /2), row)));\n\t\t\t\t}\t\t\t\t\n\t\t\t\t// Add the right wafer\n\t\t\t\tpathSquares.add(new PathSquare(\"right\", new Point(p1.x + sideTwoOffset, row)));\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "@Override\n public String toString()\n {\n\treturn getClass().getSimpleName() + \" (\" + getLength() + \"x\" + getWidth() + \")\";\n }", "private byte r() {\r\n\t\treturn (left_map == 0 ) ? (byte) 1 : 0;\r\n\t}", "public int getDireccion(Pixel p) {\r\n\t\tif (x == p.x && y < p.y)\r\n\t\t\treturn DIR_N;\r\n\t\tif (x > p.x && y < p.y){\r\n\t\t\tdouble distancia = this.distancia(p);\r\n\t\t\tif (distancia <= 1){\r\n\t\t\t\treturn DIR_NE;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tint distanciaX = Math.abs(x - p.x);\r\n\t\t\t\tint distanciaY = Math.abs(y - p.y);\r\n\t\t\t\tif (distanciaX == distanciaY)\r\n\t\t\t\t\treturn DIR_NE;\r\n\t\t\t\telse if (distanciaX > distanciaY)\r\n\t\t\t\t\treturn DIR_E;\r\n\t\t\t\telse \r\n\t\t\t\t\treturn DIR_N;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (x < p.x && y < p.y){\r\n\t\t\tdouble distancia = this.distancia(p);\r\n\t\t\tif (distancia <= 1){\r\n\t\t\t\treturn DIR_NO;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tint distanciaX = Math.abs(x - p.x);\r\n\t\t\t\tint distanciaY = Math.abs(y - p.y);\r\n\t\t\t\tif (distanciaX == distanciaY)\r\n\t\t\t\t\treturn DIR_NO;\r\n\t\t\t\telse if (distanciaX > distanciaY)\r\n\t\t\t\t\treturn DIR_O;\r\n\t\t\t\telse \r\n\t\t\t\t\treturn DIR_N;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (x == p.x && y > p.y)\r\n\t\t\treturn DIR_S;\r\n\t\tif (x > p.x && y > p.y){\r\n\t\t\tdouble distancia = this.distancia(p);\r\n\t\t\tif (distancia <= 1){\r\n\t\t\t\treturn DIR_SE;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tint distanciaX = Math.abs(x - p.x);\r\n\t\t\t\tint distanciaY = Math.abs(y - p.y);\r\n\t\t\t\tif (distanciaX == distanciaY)\r\n\t\t\t\t\treturn DIR_SE;\r\n\t\t\t\telse if (distanciaX > distanciaY)\r\n\t\t\t\t\treturn DIR_E;\r\n\t\t\t\telse \r\n\t\t\t\t\treturn DIR_S;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (x < p.x && y > p.y){\r\n\t\t\tdouble distancia = this.distancia(p);\r\n\t\t\tif (distancia <= 1){\r\n\t\t\t\treturn DIR_SO;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tint distanciaX = Math.abs(x - p.x);\r\n\t\t\t\tint distanciaY = Math.abs(y - p.y);\r\n\t\t\t\tif (distanciaX == distanciaY)\r\n\t\t\t\t\treturn DIR_SO;\r\n\t\t\t\telse if (distanciaX > distanciaY)\r\n\t\t\t\t\treturn DIR_O;\r\n\t\t\t\telse \r\n\t\t\t\t\treturn DIR_S;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (x > p.x && y == p.y)\r\n\t\t\treturn DIR_E;\r\n\t\tif (x < p.x && y == p.y)\r\n\t\t\treturn DIR_O;\r\n\t\treturn -1;\r\n\t}", "void block(Directions dir);", "@Override\r\n public void draw()\r\n {\n\r\n }", "int getWidth1();", "@Override\n\tpublic float getWidth() {\n\t\treturn 26;\n\t}", "int expand();", "int getR();", "private int right(int parent) {\n\t\treturn parent*2+2;\n\t}", "public void snare();" ]
[ "0.5504823", "0.5413094", "0.5298108", "0.5237958", "0.52057725", "0.51480854", "0.51014477", "0.5076274", "0.50370175", "0.5031899", "0.5009797", "0.49817896", "0.49811566", "0.49784452", "0.49735388", "0.49627006", "0.49372548", "0.49290594", "0.4903707", "0.48934108", "0.4878939", "0.4860075", "0.48544562", "0.4847358", "0.48438695", "0.48437318", "0.48403123", "0.48289442", "0.48271352", "0.48219612", "0.4818483", "0.48034295", "0.48024192", "0.48018914", "0.48009858", "0.4797853", "0.47961506", "0.478993", "0.4789918", "0.478966", "0.478966", "0.4779238", "0.47784376", "0.47748163", "0.47724795", "0.47665668", "0.47662878", "0.47662205", "0.47643167", "0.47592244", "0.47585812", "0.47567576", "0.47495124", "0.47482064", "0.47480425", "0.47416696", "0.474135", "0.47398707", "0.47332573", "0.47332573", "0.47304", "0.47280556", "0.47245854", "0.47211567", "0.4720323", "0.47194302", "0.4711546", "0.47108907", "0.47098887", "0.47094592", "0.4707412", "0.47063076", "0.46961385", "0.46920377", "0.46896923", "0.4689688", "0.4689318", "0.46891385", "0.46864203", "0.46842313", "0.46748105", "0.46732214", "0.46722558", "0.46684888", "0.46652383", "0.46647808", "0.4662467", "0.46576455", "0.4653903", "0.46515787", "0.46470305", "0.46462518", "0.46434262", "0.46422386", "0.4641314", "0.46409357", "0.46407336", "0.46388745", "0.46369398", "0.46310073", "0.46295714" ]
0.0
-1
/ / / / / / / / / / / / / /
protected boolean equals(URL paramURL1, URL paramURL2) { /* 336 */ String str1 = paramURL1.getRef(); /* 337 */ String str2 = paramURL2.getRef(); /* 338 */ return ((str1 == str2 || (str1 != null && str1.equals(str2))) && /* 339 */ sameFile(paramURL1, paramURL2)); /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int parent(int i){return (i-1)/2;}", "private int leftChild(int i){return 2*i+1;}", "private int rightChild(int i){return 2*i+2;}", "public void divide() {\n\t\t\n\t}", "private double[] getExtents(){\n return new double[] { -90, -180, 90, 180 };\n }", "int getWidth() {return width;}", "double passer();", "public Integer getWidth(){return this.width;}", "public abstract void bepaalGrootte();", "int width();", "public double getWidth() {\n return this.size * 2.0; \n }", "public void getTile_B8();", "public double getWidth() {\n return this.left.getLeft(0) - this.right.getRight(0); \n }", "public void gored() {\n\t\t\n\t}", "private static Object[] newPath(int length, Object[] leaf) {\n Object[] node = leaf;\n for (int i = 0; i < length; i += 5) {\n node = new Object[] { node };\n }\n return node;\n }", "static int getNumPatterns() { return 64; }", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "public String ring();", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\n }", "public static void bottomHalf() {\n\n for(int i = 1; i <= SIZE; i++) {\n for(int j = 1; j <= i - 1; j++) {\n System.out.print(\" \");\n }\n \n\t System.out.print(\"\\\\_\");\n\t for(int j = 3*SIZE-i; j >= i; j--) {\n\t System.out.print(\"/\\\\\");\n\t }\n\t System.out.println(\"_/\");\n }\n }", "public String toString(){ return \"DIV\";}", "public int getEdgeCount() \n {\n return 3;\n }", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "private int leftChild(int index){\n\t\treturn (2*index) +1;\n\t}", "int getTribeSize();", "@Override\n protected int mapSize() {\n return left.size()+right.size()-hidden.size();\n }", "public double getWidth() { return _width<0? -_width : _width; }", "long getWidth();", "public int getWidth() {\r\n\treturn this.width;\r\n}", "double getNewWidth();", "void mo33732Px();", "public int my_leaf_count();", "public abstract String division();", "public int generateRoshambo(){\n ;]\n\n }", "double seBlesser();", "@Override\n public void bfs() {\n\n }", "private int get_right_child(int index){\r\n return 2 * index + 2;\r\n }", "public static int size_parent() {\n return (8 / 8);\n }", "@Override\n\tpublic float getWidth() {\n\t\treturn 26;\n\t}", "public abstract int getSpotsNeeded();", "public static void sizePathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze five = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\t//System.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = five.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber + n)){\n\t\t\t\t\t\tS.unionBySize(randomNumber+n, randomNumber);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'u');\n\t\t\t\t\t\t//S.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.unionBySize(randomNumber, randomNumber+1);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(five, n);\n\t\tuserSelection_SolveMaze(n);\n\n\t\tStdDraw.show(0);\n\t\tfive.draw();\n\t\tfive.printCellNumbers();\t\n\t}", "protected int getWidth()\n\t{\n\t\treturn 0;\n\t}", "private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }", "public int getBlockLength()\r\n/* 45: */ {\r\n/* 46:107 */ return -32;\r\n/* 47: */ }", "@Override\npublic void processDirection() {\n\t\n}", "protected boolean\nshouldCompactPathLists()\n//\n////////////////////////////////////////////////////////////////////////\n{\n return true;\n}", "@Override\n public String toString()\n {\n\treturn getClass().getSimpleName() + \" (\" + getLength() + \"x\" + getWidth() + \")\";\n }", "public void leerPlanesDietas();", "public int getWidth(){\n return width;\n }", "long getMid();", "long getMid();", "int expand();", "int getSpriteArraySize();", "public void skystonePos4() {\n }", "public double getWidth() {\n return this.getRight(this.tree.getRight(0)) - this.getLeft(this.tree.getLeft(0)); \n }", "private int get_left_child(int index){\r\n return 2 * index + 1;\r\n }", "public abstract double getBaseWidth();", "public String getRing();", "Operations operations();", "int[] union(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n\t\t//Please fill in the program here\r\n\t\tst[0] = incCapacity();\r\n\t\taddEdge(st[0], epssymbol, s1);\r\n\t\taddEdge(st[0], epssymbol, s2);\r\n\t\tst[1] = incCapacity();\r\n\t\taddEdge(t1, epssymbol, st[1]);\r\n\t\taddEdge(t2, epssymbol, st[1]);\r\n\r\n\t\treturn st;\r\n\t}", "double volume(){\n return width*height*depth;\n }", "public double getPerimiter(){return (2*height +2*width);}", "@Override\r\n\tpublic int getWidth() {\n\t\treturn 0;\r\n\t}", "public int getWidth()\n {return width;}", "public static int size_parentId() {\n return (16 / 8);\n }", "public static void main(String[] args) {\n\t\tScanner obj=new Scanner(System.in);\r\n\t\tint a=0;\r\n\t\tint count=0;\r\n System.out.println(\"enter size\");\r\n\t\ta=obj.nextInt();\r\n\t\tint m=2*a+1;\r\n\t\tint n=2*a+2;\r\n\t\tint mid=(m+1)/2;\r\n\t\tfor(int i=1;i<=m;i++)\r\n\t\t{\r\n\t\t\tcount=0;\r\n\t\t\tfor(int j=1;j<=n;j++)\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t\tif((i==1)||(i==m)||(j==1)||(j==n))//frame begin\r\n\t\t\t\t{\r\n\t\t\t\t\tif((i==1)||(i==m))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"+\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t {\r\n\t\t\t\t\t\t\tSystem.out.print(\"|\");//frame left and right\r\n\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//frame end\r\n\t\t\t\telse if (i<mid)//upper-half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t for(int l=1;l<=2*i-4;l++)\r\n\t\t\t\t {\r\n\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\tSystem.out.print(\"\\\\\");\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end of upper half\r\n\t\t\t\telse if(i>mid)//lower half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfor(int k=mid;k<i;k++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t System.out.print(\"\\\\\");\r\n\t\t\t\t\t for(int l=2*m-6;l>2*i-4;l--)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t }\r\n\t\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t\t for(int k=mid;k<i;k++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t\t\t}//end of lower half\r\n\t\t\t\telse if(i==mid)//middle part\r\n\t\t\t\t{\r\n\t\t\t\t\tif(j==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"<\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(j==n-1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\">\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i%2==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"=\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end\r\n\t\t\t}//end-of-j\r\n\t\t\tSystem.out.println();\r\n\t\t}//end\r\n\r\n\t}", "int getSize ();", "public int getTakeSpace() {\n return 0;\n }", "private int get_parent(int index){\r\n return (index-1)/2;\r\n }", "int depth();", "int depth();", "public void lowerFlatbed(){\n flatbed.lowerFlatbed();\n }", "@Override\n\tpublic int taille() {\n\t\treturn 1;\n\t}", "protected int parent(int i) { return (i - 1) / 2; }", "@Override\n\tprotected void interr() {\n\t}", "private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }", "private byte r() {\r\n\t\treturn (left_map == 0 ) ? (byte) 1 : 0;\r\n\t}", "String directsTo();", "Parallelogram(){\n length = width = height = 0;\n }", "public String getRingback();", "@Override\r\n\tpublic void walk() {\n\r\n\t}", "static void pyramid(){\n\t}", "@Override\n public int width()\n {\n return widthCent; //Charlie Gao helped me debug the issue here\n }", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "@Override\n\tpublic int sount() {\n\t\treturn 0;\n\t}" ]
[ "0.5488944", "0.539108", "0.5100269", "0.50899094", "0.5069534", "0.50693107", "0.5066066", "0.5061679", "0.50442266", "0.5015036", "0.5014165", "0.5003645", "0.49693072", "0.49573815", "0.49514338", "0.49499622", "0.49293876", "0.4927479", "0.4927194", "0.4917197", "0.4910142", "0.49028116", "0.49017558", "0.48824358", "0.48823863", "0.48808914", "0.48726714", "0.48720384", "0.48627836", "0.4855107", "0.4846415", "0.4840881", "0.48384443", "0.48339868", "0.4824593", "0.48169047", "0.48134097", "0.48049474", "0.48004088", "0.47979838", "0.47910494", "0.47845936", "0.47841045", "0.47744447", "0.47726467", "0.4771947", "0.47681993", "0.47658527", "0.47648957", "0.4755676", "0.4755676", "0.4753695", "0.4753143", "0.4752926", "0.4749071", "0.47434685", "0.47425613", "0.47384033", "0.47334346", "0.47321105", "0.4731059", "0.4729468", "0.4726481", "0.47170335", "0.4715351", "0.4713396", "0.47059113", "0.4705429", "0.4704641", "0.4699736", "0.4699736", "0.4697979", "0.46902624", "0.46879697", "0.46878612", "0.46878", "0.46871263", "0.46857345", "0.4682048", "0.46810246", "0.46779624", "0.46697363", "0.46669462", "0.46661317", "0.46661317", "0.46661317", "0.46661317", "0.46661317", "0.46661317", "0.46661317", "0.46661317", "0.46661317", "0.46661317", "0.46661317", "0.46661317", "0.46661317", "0.46661317", "0.46661317", "0.46661317", "0.46661317", "0.46645147" ]
0.0
-1
/ / / / / / / / / /
protected int hashCode(URL paramURL) { /* 351 */ int i = 0; /* */ /* */ /* 354 */ String str1 = paramURL.getProtocol(); /* 355 */ if (str1 != null) { /* 356 */ i += str1.hashCode(); /* */ } /* */ /* 359 */ InetAddress inetAddress = getHostAddress(paramURL); /* 360 */ if (inetAddress != null) { /* 361 */ i += inetAddress.hashCode(); /* */ } else { /* 363 */ String str = paramURL.getHost(); /* 364 */ if (str != null) { /* 365 */ i += str.toLowerCase().hashCode(); /* */ } /* */ } /* */ /* 369 */ String str2 = paramURL.getFile(); /* 370 */ if (str2 != null) { /* 371 */ i += str2.hashCode(); /* */ } /* */ /* 374 */ if (paramURL.getPort() == -1) { /* 375 */ i += getDefaultPort(); /* */ } else { /* 377 */ i += paramURL.getPort(); /* */ } /* */ /* 380 */ String str3 = paramURL.getRef(); /* 381 */ if (str3 != null) { /* 382 */ i += str3.hashCode(); /* */ } /* 384 */ return i; /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int parent(int i){return (i-1)/2;}", "private int leftChild(int i){return 2*i+1;}", "private int rightChild(int i){return 2*i+2;}", "public void divide() {\n\t\t\n\t}", "public abstract void bepaalGrootte();", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "double passer();", "int getWidth() {return width;}", "public static void bottomHalf() {\n\n for(int i = 1; i <= SIZE; i++) {\n for(int j = 1; j <= i - 1; j++) {\n System.out.print(\" \");\n }\n \n\t System.out.print(\"\\\\_\");\n\t for(int j = 3*SIZE-i; j >= i; j--) {\n\t System.out.print(\"/\\\\\");\n\t }\n\t System.out.println(\"_/\");\n }\n }", "public double getWidth() {\n return this.left.getLeft(0) - this.right.getRight(0); \n }", "public String ring();", "private static Object[] newPath(int length, Object[] leaf) {\n Object[] node = leaf;\n for (int i = 0; i < length; i += 5) {\n node = new Object[] { node };\n }\n return node;\n }", "public Integer getWidth(){return this.width;}", "public double getWidth() {\n return this.size * 2.0; \n }", "public void gored() {\n\t\t\n\t}", "public void getTile_B8();", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\n }", "private double[] getExtents(){\n return new double[] { -90, -180, 90, 180 };\n }", "public String toString(){ return \"DIV\";}", "int width();", "public abstract String division();", "private int leftChild(int index){\n\t\treturn (2*index) +1;\n\t}", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "private int get_right_child(int index){\r\n return 2 * index + 2;\r\n }", "public double getWidth() { return _width<0? -_width : _width; }", "@Override\n public void bfs() {\n\n }", "public int getEdgeCount() \n {\n return 3;\n }", "private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }", "public int getWidth() {\r\n\treturn this.width;\r\n}", "@Override\npublic void processDirection() {\n\t\n}", "double getNewWidth();", "long getWidth();", "public double getWidth() {\n return this.getRight(this.tree.getRight(0)) - this.getLeft(this.tree.getLeft(0)); \n }", "public int generateRoshambo(){\n ;]\n\n }", "double volume(){\n return width*height*depth;\n }", "public static void sizePathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze five = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\t//System.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = five.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber + n)){\n\t\t\t\t\t\tS.unionBySize(randomNumber+n, randomNumber);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'u');\n\t\t\t\t\t\t//S.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.unionBySize(randomNumber, randomNumber+1);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(five, n);\n\t\tuserSelection_SolveMaze(n);\n\n\t\tStdDraw.show(0);\n\t\tfive.draw();\n\t\tfive.printCellNumbers();\t\n\t}", "public int my_leaf_count();", "protected boolean\nshouldCompactPathLists()\n//\n////////////////////////////////////////////////////////////////////////\n{\n return true;\n}", "Operations operations();", "static int getNumPatterns() { return 64; }", "void mo33732Px();", "public double getPerimiter(){return (2*height +2*width);}", "double seBlesser();", "public void SubRect(){\n\t\n}", "private int get_left_child(int index){\r\n return 2 * index + 1;\r\n }", "@Override\n protected int mapSize() {\n return left.size()+right.size()-hidden.size();\n }", "@Override\r\n\tpublic void walk() {\n\r\n\t}", "public void skystonePos4() {\n }", "int[] union(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n\t\t//Please fill in the program here\r\n\t\tst[0] = incCapacity();\r\n\t\taddEdge(st[0], epssymbol, s1);\r\n\t\taddEdge(st[0], epssymbol, s2);\r\n\t\tst[1] = incCapacity();\r\n\t\taddEdge(t1, epssymbol, st[1]);\r\n\t\taddEdge(t2, epssymbol, st[1]);\r\n\r\n\t\treturn st;\r\n\t}", "public int getWidth(){\n return width;\n }", "static void pyramid(){\n\t}", "private void pointer(Graphics image,int x,int y,int height,int b,int dir) {\n\n\t\tint[] xt=new int[3];\n\t\tint[] yt=new int[3];\n\n\t\tif(dir==0) {\n\t\t\txt[0]=x;\n\t\t\txt[1]=xt[2]=x+height;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=y+b/2;\n\t\t\tyt[2]=y-b/2;\n\t\t} else {\n\t\t\txt[0]=x;\n\t\t\txt[1]=x+b/2;\n\t\t\txt[2]=x-b/2;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=yt[2]=y-height;\n\t\t}\n\t\timage.fillPolygon(xt,yt,3);\n\t}", "public void leerPlanesDietas();", "public String getRing();", "private int get_parent(int index){\r\n return (index-1)/2;\r\n }", "public static void main(String[] args) {\n\t\tScanner obj=new Scanner(System.in);\r\n\t\tint a=0;\r\n\t\tint count=0;\r\n System.out.println(\"enter size\");\r\n\t\ta=obj.nextInt();\r\n\t\tint m=2*a+1;\r\n\t\tint n=2*a+2;\r\n\t\tint mid=(m+1)/2;\r\n\t\tfor(int i=1;i<=m;i++)\r\n\t\t{\r\n\t\t\tcount=0;\r\n\t\t\tfor(int j=1;j<=n;j++)\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t\tif((i==1)||(i==m)||(j==1)||(j==n))//frame begin\r\n\t\t\t\t{\r\n\t\t\t\t\tif((i==1)||(i==m))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"+\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t {\r\n\t\t\t\t\t\t\tSystem.out.print(\"|\");//frame left and right\r\n\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//frame end\r\n\t\t\t\telse if (i<mid)//upper-half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t for(int l=1;l<=2*i-4;l++)\r\n\t\t\t\t {\r\n\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\tSystem.out.print(\"\\\\\");\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end of upper half\r\n\t\t\t\telse if(i>mid)//lower half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfor(int k=mid;k<i;k++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t System.out.print(\"\\\\\");\r\n\t\t\t\t\t for(int l=2*m-6;l>2*i-4;l--)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t }\r\n\t\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t\t for(int k=mid;k<i;k++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t\t\t}//end of lower half\r\n\t\t\t\telse if(i==mid)//middle part\r\n\t\t\t\t{\r\n\t\t\t\t\tif(j==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"<\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(j==n-1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\">\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i%2==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"=\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end\r\n\t\t\t}//end-of-j\r\n\t\t\tSystem.out.println();\r\n\t\t}//end\r\n\r\n\t}", "protected int getWidth()\n\t{\n\t\treturn 0;\n\t}", "@Override\n public String toString()\n {\n\treturn getClass().getSimpleName() + \" (\" + getLength() + \"x\" + getWidth() + \")\";\n }", "protected int parent(int i) { return (i - 1) / 2; }", "void walk() {\n\t\t\n\t}", "int getTribeSize();", "public void lowerFlatbed(){\n flatbed.lowerFlatbed();\n }", "@Override\n\tpublic float getWidth() {\n\t\treturn 26;\n\t}", "@Override\n\tpublic void walk() {\n\t\t\n\t}", "public abstract double getBaseWidth();", "Parallelogram(){\n length = width = height = 0;\n }", "double Volume(){\r\n return Height * Width * Depth;\r\n }", "public void foundLeaf(int width, int height, int level, int currX, int currY, int location) {\n level = level +2;\n if (location == 1) {\n\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - ( (new Double(spatialHeight / Math.pow(2, level ))).intValue()),\n currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY * 2,\n Color.BLACK);\n\n\n canvas.addLine(((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue())) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n currX,\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n\n }\n\n if (location == 2) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n ( currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n (currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n\n\n }\n\n if (location == 3) {\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY,\n Color.BLACK);\n\n\n\n canvas.addLine((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n\tcurrY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n (currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n }\n\n if (location == 4) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY,\n Color.BLACK);\n\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue() + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), Color.BLACK);\n\n\n }\n\n\n\n\n }", "public static void main(String[] args) {\n\n\n for(int a=0; a<7;a++){\n for(int b=0;b<7-a;b++){\n System.out.print(\" \");\n }\n for(int c=0; c<=a;c++){\n System.out.print(\"* \");\n }\n System.out.println(\" \");\n }\n\n }", "public static void unionPathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze two = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\tSystem.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = two.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber+n) != S.findAndCompress(randomNumber)){\n\t\t\t\t\t\tS.union(randomNumber+n, randomNumber);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'u');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.union(randomNumber, randomNumber+1);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(two, n);\n\t\tuserSelection_SolveMaze(n);\n\n\n\t\tStdDraw.show(0);\n\t\ttwo.draw();\n\t\ttwo.printCellNumbers();\n\t}", "double getPerimeter(){\n return 2*height+width;\n }", "void sharpen();", "void sharpen();", "private static void breadcrumbArrow(int width, int height, int indent, int c1, int c2) {\n\n\t\tdouble x0 = 0, y0 = height / 2d;\n\t\tdouble x1 = indent, y1 = 0;\n\t\tdouble x2 = indent, y2 = height / 2d;\n\t\tdouble x3 = indent, y3 = height;\n\t\tdouble x4 = width, y4 = 0;\n\t\tdouble x5 = width, y5 = height / 2d;\n\t\tdouble x6 = width, y6 = height;\n\t\tdouble x7 = indent + width, y7 = 0;\n\t\tdouble x8 = indent + width, y8 = height;\n\n\t\tint fc1 = ColorHelper.mixAlphaColors(c1, c2, 0);\n\t\tint fc2 = ColorHelper.mixAlphaColors(c1, c2, (indent)/(width + 2f * indent));\n\t\tint fc3 = ColorHelper.mixAlphaColors(c1, c2, (indent + width)/(width + 2f * indent));\n\t\tint fc4 = ColorHelper.mixAlphaColors(c1, c2, 1);\n\n\t\tRenderSystem.disableTexture();\n\t\tRenderSystem.enableBlend();\n\t\tRenderSystem.disableAlphaTest();\n\t\tRenderSystem.defaultBlendFunc();\n\t\tRenderSystem.shadeModel(GL11.GL_SMOOTH);\n\n\t\tTessellator tessellator = Tessellator.getInstance();\n\t\tBufferBuilder bufferbuilder = tessellator.getBuffer();\n\t\tbufferbuilder.begin(GL11.GL_TRIANGLES, DefaultVertexFormats.POSITION_COLOR);\n\n\t\tbufferbuilder.vertex(x0, y0, 0).color(fc1 >> 16 & 0xFF, fc1 >> 8 & 0xFF, fc1 & 0xFF, fc1 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x1, y1, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x2, y2, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x0, y0, 0).color(fc1 >> 16 & 0xFF, fc1 >> 8 & 0xFF, fc1 & 0xFF, fc1 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x2, y2, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x1, y1, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x6, y6, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x5, y5, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x7, y7, 0).color(fc4 >> 16 & 0xFF, fc4 >> 8 & 0xFF, fc4 & 0xFF, fc4 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x6, y6, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x5, y5, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x8, y8, 0).color(fc4 >> 16 & 0xFF, fc4 >> 8 & 0xFF, fc4 & 0xFF, fc4 >> 24 & 0xFF).endVertex();\n\n\t\ttessellator.draw();\n\t\tRenderSystem.shadeModel(GL11.GL_FLAT);\n\t\tRenderSystem.disableBlend();\n\t\tRenderSystem.enableAlphaTest();\n\t\tRenderSystem.enableTexture();\n\t}", "public static String makeShapeA() {\n\tString result = \"\";\n\t\tfor (int i = 0; i < 8 ; i++) {\n\t\t\tresult+=printHash(i);\n\t\t\t\n\t\t}return result;\n\t\t\t//System.out.println(printHash(i));\n\t\t}", "int expand();", "private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }", "private void traversePath()\n\t{\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t}", "public static int size_parent() {\n return (8 / 8);\n }", "private byte r() {\r\n\t\treturn (left_map == 0 ) ? (byte) 1 : 0;\r\n\t}", "public int getWidth()\n {return width;}", "@Override\r\n\tpublic int getWidth() {\n\t\treturn 0;\r\n\t}", "@Override\r\n\tpublic double perimeter() {\n\t\treturn 2*length*breadth;\r\n\t}", "String directsTo();", "int depth();", "int depth();", "int getWidth1();", "public int upright();", "public abstract int getSpotsNeeded();", "public void stg() {\n\n\t}", "int getR();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();" ]
[ "0.5541769", "0.5447091", "0.52284503", "0.52142066", "0.51102245", "0.50959545", "0.50605327", "0.50371885", "0.503437", "0.5012711", "0.5003366", "0.5003288", "0.4998852", "0.4996254", "0.4989499", "0.49863338", "0.49803245", "0.4978323", "0.4968147", "0.49572036", "0.49168345", "0.49044955", "0.48952344", "0.48821634", "0.48601338", "0.4846347", "0.48384827", "0.4827754", "0.48222578", "0.48201355", "0.4819656", "0.48183927", "0.48118797", "0.48097536", "0.4805348", "0.48041534", "0.48027214", "0.479491", "0.47866014", "0.47839433", "0.4780406", "0.47717", "0.47622883", "0.4761401", "0.47601745", "0.47600007", "0.47567952", "0.4754087", "0.47500402", "0.47497866", "0.47489122", "0.4748109", "0.47467375", "0.47455987", "0.47428787", "0.47377756", "0.47311124", "0.47289905", "0.47274366", "0.47256365", "0.472515", "0.47250992", "0.4719933", "0.47190267", "0.47183937", "0.47179362", "0.47156602", "0.47124547", "0.47114754", "0.47053504", "0.4700622", "0.46995232", "0.46995232", "0.4697086", "0.46957397", "0.4693219", "0.46900696", "0.46806863", "0.4680373", "0.46765286", "0.4675941", "0.46741652", "0.46727815", "0.46717626", "0.46686068", "0.46686068", "0.46653858", "0.46611428", "0.46591255", "0.4656794", "0.46547443", "0.46521318", "0.46521318", "0.46521318", "0.46521318", "0.46521318", "0.46521318", "0.46521318", "0.46521318", "0.46521318", "0.46521318" ]
0.0
-1
/ / / / / / / / / / / / / /
protected boolean sameFile(URL paramURL1, URL paramURL2) { /* 400 */ if (paramURL1.getProtocol() != paramURL2.getProtocol() && (paramURL1 /* 401 */ .getProtocol() == null || /* 402 */ !paramURL1.getProtocol().equalsIgnoreCase(paramURL2.getProtocol()))) { /* 403 */ return false; /* */ } /* */ /* 406 */ if (paramURL1.getFile() != paramURL2.getFile() && (paramURL1 /* 407 */ .getFile() == null || !paramURL1.getFile().equals(paramURL2.getFile()))) { /* 408 */ return false; /* */ } /* */ /* */ /* 412 */ int i = (paramURL1.getPort() != -1) ? paramURL1.getPort() : paramURL1.handler.getDefaultPort(); /* 413 */ int j = (paramURL2.getPort() != -1) ? paramURL2.getPort() : paramURL2.handler.getDefaultPort(); /* 414 */ if (i != j) { /* 415 */ return false; /* */ } /* */ /* 418 */ if (!hostsEqual(paramURL1, paramURL2)) { /* 419 */ return false; /* */ } /* 421 */ return true; /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int parent(int i){return (i-1)/2;}", "private int leftChild(int i){return 2*i+1;}", "private int rightChild(int i){return 2*i+2;}", "public void divide() {\n\t\t\n\t}", "private double[] getExtents(){\n return new double[] { -90, -180, 90, 180 };\n }", "int getWidth() {return width;}", "double passer();", "public Integer getWidth(){return this.width;}", "public abstract void bepaalGrootte();", "int width();", "public double getWidth() {\n return this.size * 2.0; \n }", "public void getTile_B8();", "public double getWidth() {\n return this.left.getLeft(0) - this.right.getRight(0); \n }", "public void gored() {\n\t\t\n\t}", "private static Object[] newPath(int length, Object[] leaf) {\n Object[] node = leaf;\n for (int i = 0; i < length; i += 5) {\n node = new Object[] { node };\n }\n return node;\n }", "static int getNumPatterns() { return 64; }", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "public String ring();", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\n }", "public static void bottomHalf() {\n\n for(int i = 1; i <= SIZE; i++) {\n for(int j = 1; j <= i - 1; j++) {\n System.out.print(\" \");\n }\n \n\t System.out.print(\"\\\\_\");\n\t for(int j = 3*SIZE-i; j >= i; j--) {\n\t System.out.print(\"/\\\\\");\n\t }\n\t System.out.println(\"_/\");\n }\n }", "public String toString(){ return \"DIV\";}", "public int getEdgeCount() \n {\n return 3;\n }", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "int getTribeSize();", "private int leftChild(int index){\n\t\treturn (2*index) +1;\n\t}", "@Override\n protected int mapSize() {\n return left.size()+right.size()-hidden.size();\n }", "public double getWidth() { return _width<0? -_width : _width; }", "long getWidth();", "public int getWidth() {\r\n\treturn this.width;\r\n}", "double getNewWidth();", "void mo33732Px();", "public int my_leaf_count();", "public abstract String division();", "public int generateRoshambo(){\n ;]\n\n }", "double seBlesser();", "@Override\n public void bfs() {\n\n }", "private int get_right_child(int index){\r\n return 2 * index + 2;\r\n }", "public static int size_parent() {\n return (8 / 8);\n }", "@Override\n\tpublic float getWidth() {\n\t\treturn 26;\n\t}", "public abstract int getSpotsNeeded();", "public static void sizePathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze five = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\t//System.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = five.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber + n)){\n\t\t\t\t\t\tS.unionBySize(randomNumber+n, randomNumber);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'u');\n\t\t\t\t\t\t//S.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.unionBySize(randomNumber, randomNumber+1);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(five, n);\n\t\tuserSelection_SolveMaze(n);\n\n\t\tStdDraw.show(0);\n\t\tfive.draw();\n\t\tfive.printCellNumbers();\t\n\t}", "protected int getWidth()\n\t{\n\t\treturn 0;\n\t}", "private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }", "public int getBlockLength()\r\n/* 45: */ {\r\n/* 46:107 */ return -32;\r\n/* 47: */ }", "@Override\npublic void processDirection() {\n\t\n}", "protected boolean\nshouldCompactPathLists()\n//\n////////////////////////////////////////////////////////////////////////\n{\n return true;\n}", "@Override\n public String toString()\n {\n\treturn getClass().getSimpleName() + \" (\" + getLength() + \"x\" + getWidth() + \")\";\n }", "public void leerPlanesDietas();", "public int getWidth(){\n return width;\n }", "long getMid();", "long getMid();", "int expand();", "int getSpriteArraySize();", "public void skystonePos4() {\n }", "public double getWidth() {\n return this.getRight(this.tree.getRight(0)) - this.getLeft(this.tree.getLeft(0)); \n }", "private int get_left_child(int index){\r\n return 2 * index + 1;\r\n }", "public abstract double getBaseWidth();", "public String getRing();", "Operations operations();", "int[] union(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n\t\t//Please fill in the program here\r\n\t\tst[0] = incCapacity();\r\n\t\taddEdge(st[0], epssymbol, s1);\r\n\t\taddEdge(st[0], epssymbol, s2);\r\n\t\tst[1] = incCapacity();\r\n\t\taddEdge(t1, epssymbol, st[1]);\r\n\t\taddEdge(t2, epssymbol, st[1]);\r\n\r\n\t\treturn st;\r\n\t}", "double volume(){\n return width*height*depth;\n }", "public double getPerimiter(){return (2*height +2*width);}", "@Override\r\n\tpublic int getWidth() {\n\t\treturn 0;\r\n\t}", "public int getWidth()\n {return width;}", "public static int size_parentId() {\n return (16 / 8);\n }", "public static void main(String[] args) {\n\t\tScanner obj=new Scanner(System.in);\r\n\t\tint a=0;\r\n\t\tint count=0;\r\n System.out.println(\"enter size\");\r\n\t\ta=obj.nextInt();\r\n\t\tint m=2*a+1;\r\n\t\tint n=2*a+2;\r\n\t\tint mid=(m+1)/2;\r\n\t\tfor(int i=1;i<=m;i++)\r\n\t\t{\r\n\t\t\tcount=0;\r\n\t\t\tfor(int j=1;j<=n;j++)\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t\tif((i==1)||(i==m)||(j==1)||(j==n))//frame begin\r\n\t\t\t\t{\r\n\t\t\t\t\tif((i==1)||(i==m))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"+\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t {\r\n\t\t\t\t\t\t\tSystem.out.print(\"|\");//frame left and right\r\n\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//frame end\r\n\t\t\t\telse if (i<mid)//upper-half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t for(int l=1;l<=2*i-4;l++)\r\n\t\t\t\t {\r\n\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\tSystem.out.print(\"\\\\\");\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end of upper half\r\n\t\t\t\telse if(i>mid)//lower half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfor(int k=mid;k<i;k++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t System.out.print(\"\\\\\");\r\n\t\t\t\t\t for(int l=2*m-6;l>2*i-4;l--)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t }\r\n\t\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t\t for(int k=mid;k<i;k++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t\t\t}//end of lower half\r\n\t\t\t\telse if(i==mid)//middle part\r\n\t\t\t\t{\r\n\t\t\t\t\tif(j==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"<\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(j==n-1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\">\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i%2==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"=\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end\r\n\t\t\t}//end-of-j\r\n\t\t\tSystem.out.println();\r\n\t\t}//end\r\n\r\n\t}", "int getSize ();", "public int getTakeSpace() {\n return 0;\n }", "private int get_parent(int index){\r\n return (index-1)/2;\r\n }", "int depth();", "int depth();", "public void lowerFlatbed(){\n flatbed.lowerFlatbed();\n }", "@Override\n\tpublic int taille() {\n\t\treturn 1;\n\t}", "private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }", "protected int parent(int i) { return (i - 1) / 2; }", "private byte r() {\r\n\t\treturn (left_map == 0 ) ? (byte) 1 : 0;\r\n\t}", "@Override\n\tprotected void interr() {\n\t}", "String directsTo();", "Parallelogram(){\n length = width = height = 0;\n }", "public String getRingback();", "@Override\r\n\tpublic void walk() {\n\r\n\t}", "static void pyramid(){\n\t}", "@Override\n public int width()\n {\n return widthCent; //Charlie Gao helped me debug the issue here\n }", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "@Override\n\tpublic int sount() {\n\t\treturn 0;\n\t}" ]
[ "0.54895246", "0.5391585", "0.510078", "0.50899523", "0.5070096", "0.50695544", "0.50661993", "0.50623107", "0.5044784", "0.5015931", "0.50145376", "0.5004029", "0.49699992", "0.49574012", "0.49504334", "0.49500474", "0.49294454", "0.49273536", "0.4926886", "0.49166405", "0.49106985", "0.49022916", "0.49009427", "0.4883001", "0.48827583", "0.48803282", "0.48737806", "0.487266", "0.48634207", "0.48554507", "0.48473683", "0.4841166", "0.48387823", "0.48344997", "0.48257118", "0.48173678", "0.48138088", "0.4805466", "0.48006618", "0.47977746", "0.47903746", "0.4785075", "0.47835562", "0.47755992", "0.47729924", "0.47719675", "0.4768252", "0.4765362", "0.47650853", "0.47563383", "0.47563383", "0.47545764", "0.4753172", "0.47531456", "0.47496068", "0.4743782", "0.4743567", "0.47383043", "0.47338662", "0.4731805", "0.47312346", "0.47295257", "0.47266436", "0.4717186", "0.4715465", "0.47135437", "0.47072896", "0.470609", "0.47048897", "0.46997377", "0.46997377", "0.46976393", "0.46903175", "0.4688422", "0.4688389", "0.46881628", "0.46878272", "0.46859786", "0.46813232", "0.46810633", "0.4678094", "0.4668673", "0.46670106", "0.46666604", "0.46666604", "0.46666604", "0.46666604", "0.46666604", "0.46666604", "0.46666604", "0.46666604", "0.46666604", "0.46666604", "0.46666604", "0.46666604", "0.46666604", "0.46666604", "0.46666604", "0.46666604", "0.46666604", "0.46658048" ]
0.0
-1
/ / / / / / / / / / /
protected synchronized InetAddress getHostAddress(URL paramURL) { /* 434 */ if (paramURL.hostAddress != null) { /* 435 */ return paramURL.hostAddress; /* */ } /* 437 */ String str = paramURL.getHost(); /* 438 */ if (str == null || str.equals("")) { /* 439 */ return null; /* */ } /* */ try { /* 442 */ paramURL.hostAddress = InetAddress.getByName(str); /* 443 */ } catch (UnknownHostException unknownHostException) { /* 444 */ return null; /* 445 */ } catch (SecurityException securityException) { /* 446 */ return null; /* */ } /* */ /* 449 */ return paramURL.hostAddress; /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int parent(int i){return (i-1)/2;}", "private int leftChild(int i){return 2*i+1;}", "private int rightChild(int i){return 2*i+2;}", "public void divide() {\n\t\t\n\t}", "public abstract void bepaalGrootte();", "double passer();", "int getWidth() {return width;}", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "public Integer getWidth(){return this.width;}", "public double getWidth() {\n return this.size * 2.0; \n }", "public double getWidth() {\n return this.left.getLeft(0) - this.right.getRight(0); \n }", "private double[] getExtents(){\n return new double[] { -90, -180, 90, 180 };\n }", "public static void bottomHalf() {\n\n for(int i = 1; i <= SIZE; i++) {\n for(int j = 1; j <= i - 1; j++) {\n System.out.print(\" \");\n }\n \n\t System.out.print(\"\\\\_\");\n\t for(int j = 3*SIZE-i; j >= i; j--) {\n\t System.out.print(\"/\\\\\");\n\t }\n\t System.out.println(\"_/\");\n }\n }", "public void getTile_B8();", "private static Object[] newPath(int length, Object[] leaf) {\n Object[] node = leaf;\n for (int i = 0; i < length; i += 5) {\n node = new Object[] { node };\n }\n return node;\n }", "public String ring();", "int width();", "public void gored() {\n\t\t\n\t}", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\n }", "public String toString(){ return \"DIV\";}", "private int leftChild(int index){\n\t\treturn (2*index) +1;\n\t}", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "public abstract String division();", "private int get_right_child(int index){\r\n return 2 * index + 2;\r\n }", "public double getWidth() { return _width<0? -_width : _width; }", "public int getEdgeCount() \n {\n return 3;\n }", "public int getWidth() {\r\n\treturn this.width;\r\n}", "long getWidth();", "@Override\n public void bfs() {\n\n }", "double getNewWidth();", "static int getNumPatterns() { return 64; }", "public int my_leaf_count();", "private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }", "public int generateRoshambo(){\n ;]\n\n }", "@Override\npublic void processDirection() {\n\t\n}", "public double getWidth() {\n return this.getRight(this.tree.getRight(0)) - this.getLeft(this.tree.getLeft(0)); \n }", "@Override\n protected int mapSize() {\n return left.size()+right.size()-hidden.size();\n }", "public static void sizePathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze five = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\t//System.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = five.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber + n)){\n\t\t\t\t\t\tS.unionBySize(randomNumber+n, randomNumber);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'u');\n\t\t\t\t\t\t//S.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.unionBySize(randomNumber, randomNumber+1);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(five, n);\n\t\tuserSelection_SolveMaze(n);\n\n\t\tStdDraw.show(0);\n\t\tfive.draw();\n\t\tfive.printCellNumbers();\t\n\t}", "void mo33732Px();", "protected boolean\nshouldCompactPathLists()\n//\n////////////////////////////////////////////////////////////////////////\n{\n return true;\n}", "double volume(){\n return width*height*depth;\n }", "double seBlesser();", "int getTribeSize();", "Operations operations();", "private int get_left_child(int index){\r\n return 2 * index + 1;\r\n }", "public double getPerimiter(){return (2*height +2*width);}", "public int getWidth(){\n return width;\n }", "public void leerPlanesDietas();", "public void skystonePos4() {\n }", "protected int getWidth()\n\t{\n\t\treturn 0;\n\t}", "public String getRing();", "@Override\n public String toString()\n {\n\treturn getClass().getSimpleName() + \" (\" + getLength() + \"x\" + getWidth() + \")\";\n }", "@Override\n\tpublic float getWidth() {\n\t\treturn 26;\n\t}", "int[] union(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n\t\t//Please fill in the program here\r\n\t\tst[0] = incCapacity();\r\n\t\taddEdge(st[0], epssymbol, s1);\r\n\t\taddEdge(st[0], epssymbol, s2);\r\n\t\tst[1] = incCapacity();\r\n\t\taddEdge(t1, epssymbol, st[1]);\r\n\t\taddEdge(t2, epssymbol, st[1]);\r\n\r\n\t\treturn st;\r\n\t}", "private int get_parent(int index){\r\n return (index-1)/2;\r\n }", "@Override\r\n\tpublic void walk() {\n\r\n\t}", "public void SubRect(){\n\t\n}", "public abstract double getBaseWidth();", "public static void main(String[] args) {\n\t\tScanner obj=new Scanner(System.in);\r\n\t\tint a=0;\r\n\t\tint count=0;\r\n System.out.println(\"enter size\");\r\n\t\ta=obj.nextInt();\r\n\t\tint m=2*a+1;\r\n\t\tint n=2*a+2;\r\n\t\tint mid=(m+1)/2;\r\n\t\tfor(int i=1;i<=m;i++)\r\n\t\t{\r\n\t\t\tcount=0;\r\n\t\t\tfor(int j=1;j<=n;j++)\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t\tif((i==1)||(i==m)||(j==1)||(j==n))//frame begin\r\n\t\t\t\t{\r\n\t\t\t\t\tif((i==1)||(i==m))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"+\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t {\r\n\t\t\t\t\t\t\tSystem.out.print(\"|\");//frame left and right\r\n\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//frame end\r\n\t\t\t\telse if (i<mid)//upper-half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t for(int l=1;l<=2*i-4;l++)\r\n\t\t\t\t {\r\n\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\tSystem.out.print(\"\\\\\");\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end of upper half\r\n\t\t\t\telse if(i>mid)//lower half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfor(int k=mid;k<i;k++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t System.out.print(\"\\\\\");\r\n\t\t\t\t\t for(int l=2*m-6;l>2*i-4;l--)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t }\r\n\t\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t\t for(int k=mid;k<i;k++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t\t\t}//end of lower half\r\n\t\t\t\telse if(i==mid)//middle part\r\n\t\t\t\t{\r\n\t\t\t\t\tif(j==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"<\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(j==n-1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\">\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i%2==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"=\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end\r\n\t\t\t}//end-of-j\r\n\t\t\tSystem.out.println();\r\n\t\t}//end\r\n\r\n\t}", "protected int parent(int i) { return (i - 1) / 2; }", "static void pyramid(){\n\t}", "public static int size_parent() {\n return (8 / 8);\n }", "public void lowerFlatbed(){\n flatbed.lowerFlatbed();\n }", "int expand();", "public abstract int getSpotsNeeded();", "Parallelogram(){\n length = width = height = 0;\n }", "@Override\n\tpublic void walk() {\n\t\t\n\t}", "double Volume(){\r\n return Height * Width * Depth;\r\n }", "void walk() {\n\t\t\n\t}", "public int getWidth()\n {return width;}", "private void pointer(Graphics image,int x,int y,int height,int b,int dir) {\n\n\t\tint[] xt=new int[3];\n\t\tint[] yt=new int[3];\n\n\t\tif(dir==0) {\n\t\t\txt[0]=x;\n\t\t\txt[1]=xt[2]=x+height;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=y+b/2;\n\t\t\tyt[2]=y-b/2;\n\t\t} else {\n\t\t\txt[0]=x;\n\t\t\txt[1]=x+b/2;\n\t\t\txt[2]=x-b/2;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=yt[2]=y-height;\n\t\t}\n\t\timage.fillPolygon(xt,yt,3);\n\t}", "@Override\r\n\tpublic int getWidth() {\n\t\treturn 0;\r\n\t}", "private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }", "long getMid();", "long getMid();", "int depth();", "int depth();", "private byte r() {\r\n\t\treturn (left_map == 0 ) ? (byte) 1 : 0;\r\n\t}", "public static String makeShapeA() {\n\tString result = \"\";\n\t\tfor (int i = 0; i < 8 ; i++) {\n\t\t\tresult+=printHash(i);\n\t\t\t\n\t\t}return result;\n\t\t\t//System.out.println(printHash(i));\n\t\t}", "String directsTo();", "int getSpriteArraySize();", "public void foundLeaf(int width, int height, int level, int currX, int currY, int location) {\n level = level +2;\n if (location == 1) {\n\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - ( (new Double(spatialHeight / Math.pow(2, level ))).intValue()),\n currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY * 2,\n Color.BLACK);\n\n\n canvas.addLine(((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue())) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n currX,\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n\n }\n\n if (location == 2) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n ( currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n (currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n\n\n }\n\n if (location == 3) {\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY,\n Color.BLACK);\n\n\n\n canvas.addLine((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n\tcurrY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n (currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n }\n\n if (location == 4) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY,\n Color.BLACK);\n\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue() + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), Color.BLACK);\n\n\n }\n\n\n\n\n }", "public static void unionPathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze two = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\tSystem.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = two.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber+n) != S.findAndCompress(randomNumber)){\n\t\t\t\t\t\tS.union(randomNumber+n, randomNumber);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'u');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.union(randomNumber, randomNumber+1);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(two, n);\n\t\tuserSelection_SolveMaze(n);\n\n\n\t\tStdDraw.show(0);\n\t\ttwo.draw();\n\t\ttwo.printCellNumbers();\n\t}", "double getPerimeter(){\n return 2*height+width;\n }", "public static void main(String[] args) {\n\n\n for(int a=0; a<7;a++){\n for(int b=0;b<7-a;b++){\n System.out.print(\" \");\n }\n for(int c=0; c<=a;c++){\n System.out.print(\"* \");\n }\n System.out.println(\" \");\n }\n\n }", "int getWidth1();", "public String getRingback();", "void sharpen();", "void sharpen();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();" ]
[ "0.55397105", "0.54437053", "0.5204512", "0.51804096", "0.50937134", "0.5059022", "0.5054623", "0.50449234", "0.50269794", "0.5012348", "0.501193", "0.50112987", "0.5003606", "0.4999849", "0.49978024", "0.49852726", "0.49802312", "0.49788785", "0.49669135", "0.4958197", "0.4911064", "0.49109", "0.48967147", "0.48771945", "0.48715413", "0.48661727", "0.48434192", "0.4841665", "0.4840984", "0.48366112", "0.48327473", "0.4826068", "0.48210338", "0.48160994", "0.48109686", "0.48060757", "0.4804933", "0.48034516", "0.4794736", "0.4792987", "0.47882947", "0.47821987", "0.47797695", "0.47712424", "0.47696742", "0.47660574", "0.47627276", "0.4757568", "0.47524834", "0.47521633", "0.47516158", "0.47494435", "0.4748832", "0.4747543", "0.4746704", "0.47423482", "0.4734842", "0.4732427", "0.47313237", "0.47279117", "0.47277367", "0.47268367", "0.472316", "0.4715467", "0.47091395", "0.47073016", "0.47048545", "0.47031873", "0.46964198", "0.46960735", "0.46956956", "0.46955624", "0.46875823", "0.46874177", "0.46874177", "0.46872193", "0.46872193", "0.46867445", "0.4686492", "0.4683999", "0.468332", "0.46817744", "0.46795037", "0.4674891", "0.46723998", "0.46693015", "0.4668736", "0.46671015", "0.46671015", "0.46651345", "0.46651345", "0.46651345", "0.46651345", "0.46651345", "0.46651345", "0.46651345", "0.46651345", "0.46651345", "0.46651345", "0.46651345", "0.46651345" ]
0.0
-1
/ / / / / / / / / /
protected boolean hostsEqual(URL paramURL1, URL paramURL2) { /* 461 */ InetAddress inetAddress1 = getHostAddress(paramURL1); /* 462 */ InetAddress inetAddress2 = getHostAddress(paramURL2); /* */ /* 464 */ if (inetAddress1 != null && inetAddress2 != null) { /* 465 */ return inetAddress1.equals(inetAddress2); /* */ } /* 467 */ if (paramURL1.getHost() != null && paramURL2.getHost() != null) { /* 468 */ return paramURL1.getHost().equalsIgnoreCase(paramURL2.getHost()); /* */ } /* 470 */ return (paramURL1.getHost() == null && paramURL2.getHost() == null); /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int parent(int i){return (i-1)/2;}", "private int leftChild(int i){return 2*i+1;}", "private int rightChild(int i){return 2*i+2;}", "public void divide() {\n\t\t\n\t}", "public abstract void bepaalGrootte();", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "double passer();", "int getWidth() {return width;}", "public static void bottomHalf() {\n\n for(int i = 1; i <= SIZE; i++) {\n for(int j = 1; j <= i - 1; j++) {\n System.out.print(\" \");\n }\n \n\t System.out.print(\"\\\\_\");\n\t for(int j = 3*SIZE-i; j >= i; j--) {\n\t System.out.print(\"/\\\\\");\n\t }\n\t System.out.println(\"_/\");\n }\n }", "public double getWidth() {\n return this.left.getLeft(0) - this.right.getRight(0); \n }", "public String ring();", "private static Object[] newPath(int length, Object[] leaf) {\n Object[] node = leaf;\n for (int i = 0; i < length; i += 5) {\n node = new Object[] { node };\n }\n return node;\n }", "public Integer getWidth(){return this.width;}", "public double getWidth() {\n return this.size * 2.0; \n }", "public void gored() {\n\t\t\n\t}", "public void getTile_B8();", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\n }", "private double[] getExtents(){\n return new double[] { -90, -180, 90, 180 };\n }", "public String toString(){ return \"DIV\";}", "int width();", "public abstract String division();", "private int leftChild(int index){\n\t\treturn (2*index) +1;\n\t}", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "private int get_right_child(int index){\r\n return 2 * index + 2;\r\n }", "public double getWidth() { return _width<0? -_width : _width; }", "@Override\n public void bfs() {\n\n }", "public int getEdgeCount() \n {\n return 3;\n }", "private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }", "public int getWidth() {\r\n\treturn this.width;\r\n}", "@Override\npublic void processDirection() {\n\t\n}", "double getNewWidth();", "long getWidth();", "public int generateRoshambo(){\n ;]\n\n }", "public double getWidth() {\n return this.getRight(this.tree.getRight(0)) - this.getLeft(this.tree.getLeft(0)); \n }", "double volume(){\n return width*height*depth;\n }", "public static void sizePathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze five = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\t//System.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = five.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber + n)){\n\t\t\t\t\t\tS.unionBySize(randomNumber+n, randomNumber);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'u');\n\t\t\t\t\t\t//S.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.unionBySize(randomNumber, randomNumber+1);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(five, n);\n\t\tuserSelection_SolveMaze(n);\n\n\t\tStdDraw.show(0);\n\t\tfive.draw();\n\t\tfive.printCellNumbers();\t\n\t}", "public int my_leaf_count();", "protected boolean\nshouldCompactPathLists()\n//\n////////////////////////////////////////////////////////////////////////\n{\n return true;\n}", "Operations operations();", "static int getNumPatterns() { return 64; }", "void mo33732Px();", "public double getPerimiter(){return (2*height +2*width);}", "double seBlesser();", "public void SubRect(){\n\t\n}", "@Override\n protected int mapSize() {\n return left.size()+right.size()-hidden.size();\n }", "private int get_left_child(int index){\r\n return 2 * index + 1;\r\n }", "@Override\r\n\tpublic void walk() {\n\r\n\t}", "public void skystonePos4() {\n }", "int[] union(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n\t\t//Please fill in the program here\r\n\t\tst[0] = incCapacity();\r\n\t\taddEdge(st[0], epssymbol, s1);\r\n\t\taddEdge(st[0], epssymbol, s2);\r\n\t\tst[1] = incCapacity();\r\n\t\taddEdge(t1, epssymbol, st[1]);\r\n\t\taddEdge(t2, epssymbol, st[1]);\r\n\r\n\t\treturn st;\r\n\t}", "public int getWidth(){\n return width;\n }", "static void pyramid(){\n\t}", "public void leerPlanesDietas();", "private void pointer(Graphics image,int x,int y,int height,int b,int dir) {\n\n\t\tint[] xt=new int[3];\n\t\tint[] yt=new int[3];\n\n\t\tif(dir==0) {\n\t\t\txt[0]=x;\n\t\t\txt[1]=xt[2]=x+height;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=y+b/2;\n\t\t\tyt[2]=y-b/2;\n\t\t} else {\n\t\t\txt[0]=x;\n\t\t\txt[1]=x+b/2;\n\t\t\txt[2]=x-b/2;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=yt[2]=y-height;\n\t\t}\n\t\timage.fillPolygon(xt,yt,3);\n\t}", "public String getRing();", "private int get_parent(int index){\r\n return (index-1)/2;\r\n }", "public static void main(String[] args) {\n\t\tScanner obj=new Scanner(System.in);\r\n\t\tint a=0;\r\n\t\tint count=0;\r\n System.out.println(\"enter size\");\r\n\t\ta=obj.nextInt();\r\n\t\tint m=2*a+1;\r\n\t\tint n=2*a+2;\r\n\t\tint mid=(m+1)/2;\r\n\t\tfor(int i=1;i<=m;i++)\r\n\t\t{\r\n\t\t\tcount=0;\r\n\t\t\tfor(int j=1;j<=n;j++)\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t\tif((i==1)||(i==m)||(j==1)||(j==n))//frame begin\r\n\t\t\t\t{\r\n\t\t\t\t\tif((i==1)||(i==m))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"+\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t {\r\n\t\t\t\t\t\t\tSystem.out.print(\"|\");//frame left and right\r\n\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//frame end\r\n\t\t\t\telse if (i<mid)//upper-half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t for(int l=1;l<=2*i-4;l++)\r\n\t\t\t\t {\r\n\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\tSystem.out.print(\"\\\\\");\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end of upper half\r\n\t\t\t\telse if(i>mid)//lower half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfor(int k=mid;k<i;k++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t System.out.print(\"\\\\\");\r\n\t\t\t\t\t for(int l=2*m-6;l>2*i-4;l--)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t }\r\n\t\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t\t for(int k=mid;k<i;k++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t\t\t}//end of lower half\r\n\t\t\t\telse if(i==mid)//middle part\r\n\t\t\t\t{\r\n\t\t\t\t\tif(j==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"<\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(j==n-1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\">\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i%2==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"=\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end\r\n\t\t\t}//end-of-j\r\n\t\t\tSystem.out.println();\r\n\t\t}//end\r\n\r\n\t}", "protected int getWidth()\n\t{\n\t\treturn 0;\n\t}", "@Override\n public String toString()\n {\n\treturn getClass().getSimpleName() + \" (\" + getLength() + \"x\" + getWidth() + \")\";\n }", "public void lowerFlatbed(){\n flatbed.lowerFlatbed();\n }", "void walk() {\n\t\t\n\t}", "protected int parent(int i) { return (i - 1) / 2; }", "int getTribeSize();", "@Override\n\tpublic float getWidth() {\n\t\treturn 26;\n\t}", "@Override\n\tpublic void walk() {\n\t\t\n\t}", "Parallelogram(){\n length = width = height = 0;\n }", "public abstract double getBaseWidth();", "double Volume(){\r\n return Height * Width * Depth;\r\n }", "public void foundLeaf(int width, int height, int level, int currX, int currY, int location) {\n level = level +2;\n if (location == 1) {\n\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - ( (new Double(spatialHeight / Math.pow(2, level ))).intValue()),\n currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY * 2,\n Color.BLACK);\n\n\n canvas.addLine(((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue())) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n currX,\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n\n }\n\n if (location == 2) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n ( currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n (currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n\n\n }\n\n if (location == 3) {\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY,\n Color.BLACK);\n\n\n\n canvas.addLine((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n\tcurrY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n (currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n }\n\n if (location == 4) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY,\n Color.BLACK);\n\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue() + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), Color.BLACK);\n\n\n }\n\n\n\n\n }", "public static void main(String[] args) {\n\n\n for(int a=0; a<7;a++){\n for(int b=0;b<7-a;b++){\n System.out.print(\" \");\n }\n for(int c=0; c<=a;c++){\n System.out.print(\"* \");\n }\n System.out.println(\" \");\n }\n\n }", "public static void unionPathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze two = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\tSystem.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = two.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber+n) != S.findAndCompress(randomNumber)){\n\t\t\t\t\t\tS.union(randomNumber+n, randomNumber);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'u');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.union(randomNumber, randomNumber+1);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(two, n);\n\t\tuserSelection_SolveMaze(n);\n\n\n\t\tStdDraw.show(0);\n\t\ttwo.draw();\n\t\ttwo.printCellNumbers();\n\t}", "void sharpen();", "void sharpen();", "double getPerimeter(){\n return 2*height+width;\n }", "private static void breadcrumbArrow(int width, int height, int indent, int c1, int c2) {\n\n\t\tdouble x0 = 0, y0 = height / 2d;\n\t\tdouble x1 = indent, y1 = 0;\n\t\tdouble x2 = indent, y2 = height / 2d;\n\t\tdouble x3 = indent, y3 = height;\n\t\tdouble x4 = width, y4 = 0;\n\t\tdouble x5 = width, y5 = height / 2d;\n\t\tdouble x6 = width, y6 = height;\n\t\tdouble x7 = indent + width, y7 = 0;\n\t\tdouble x8 = indent + width, y8 = height;\n\n\t\tint fc1 = ColorHelper.mixAlphaColors(c1, c2, 0);\n\t\tint fc2 = ColorHelper.mixAlphaColors(c1, c2, (indent)/(width + 2f * indent));\n\t\tint fc3 = ColorHelper.mixAlphaColors(c1, c2, (indent + width)/(width + 2f * indent));\n\t\tint fc4 = ColorHelper.mixAlphaColors(c1, c2, 1);\n\n\t\tRenderSystem.disableTexture();\n\t\tRenderSystem.enableBlend();\n\t\tRenderSystem.disableAlphaTest();\n\t\tRenderSystem.defaultBlendFunc();\n\t\tRenderSystem.shadeModel(GL11.GL_SMOOTH);\n\n\t\tTessellator tessellator = Tessellator.getInstance();\n\t\tBufferBuilder bufferbuilder = tessellator.getBuffer();\n\t\tbufferbuilder.begin(GL11.GL_TRIANGLES, DefaultVertexFormats.POSITION_COLOR);\n\n\t\tbufferbuilder.vertex(x0, y0, 0).color(fc1 >> 16 & 0xFF, fc1 >> 8 & 0xFF, fc1 & 0xFF, fc1 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x1, y1, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x2, y2, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x0, y0, 0).color(fc1 >> 16 & 0xFF, fc1 >> 8 & 0xFF, fc1 & 0xFF, fc1 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x2, y2, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x1, y1, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x6, y6, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x5, y5, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x7, y7, 0).color(fc4 >> 16 & 0xFF, fc4 >> 8 & 0xFF, fc4 & 0xFF, fc4 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x6, y6, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x5, y5, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x8, y8, 0).color(fc4 >> 16 & 0xFF, fc4 >> 8 & 0xFF, fc4 & 0xFF, fc4 >> 24 & 0xFF).endVertex();\n\n\t\ttessellator.draw();\n\t\tRenderSystem.shadeModel(GL11.GL_FLAT);\n\t\tRenderSystem.disableBlend();\n\t\tRenderSystem.enableAlphaTest();\n\t\tRenderSystem.enableTexture();\n\t}", "public static String makeShapeA() {\n\tString result = \"\";\n\t\tfor (int i = 0; i < 8 ; i++) {\n\t\t\tresult+=printHash(i);\n\t\t\t\n\t\t}return result;\n\t\t\t//System.out.println(printHash(i));\n\t\t}", "int expand();", "private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }", "private void traversePath()\n\t{\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t}", "private byte r() {\r\n\t\treturn (left_map == 0 ) ? (byte) 1 : 0;\r\n\t}", "public static int size_parent() {\n return (8 / 8);\n }", "public int getWidth()\n {return width;}", "@Override\r\n\tpublic int getWidth() {\n\t\treturn 0;\r\n\t}", "@Override\r\n\tpublic double perimeter() {\n\t\treturn 2*length*breadth;\r\n\t}", "String directsTo();", "int depth();", "int depth();", "int getWidth1();", "public abstract int getSpotsNeeded();", "public int upright();", "public void stg() {\n\n\t}", "int getR();", "int fi(int x, int y) {\n\t\treturn (x + 1) + (width + 2) * (y + 1);\n\t}", "public String getRingback();", "double getWidth();", "double getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();" ]
[ "0.5540896", "0.5446543", "0.5227331", "0.52141076", "0.5111389", "0.50963986", "0.50654864", "0.5038032", "0.50336593", "0.501189", "0.50033337", "0.5002645", "0.4999724", "0.4997505", "0.49938273", "0.4988672", "0.4982446", "0.49785286", "0.4967535", "0.49578318", "0.4915642", "0.49043542", "0.4896837", "0.48817068", "0.48615584", "0.48489416", "0.4838888", "0.48292333", "0.48239383", "0.48229367", "0.48212478", "0.48193154", "0.48124096", "0.48111546", "0.4806745", "0.4804178", "0.48025957", "0.47942734", "0.4787015", "0.47851548", "0.47835702", "0.47725245", "0.47664967", "0.476185", "0.4760751", "0.47598377", "0.4759025", "0.4757917", "0.47506076", "0.47504088", "0.47497043", "0.47486544", "0.4747894", "0.4746228", "0.4741946", "0.47376034", "0.47327974", "0.47300422", "0.4727591", "0.47272107", "0.47263286", "0.47261053", "0.47214398", "0.47212386", "0.47205597", "0.47184741", "0.47169027", "0.47127956", "0.47109538", "0.47052673", "0.47015747", "0.47015747", "0.47005445", "0.46963036", "0.46961927", "0.46945545", "0.46940103", "0.46804753", "0.4678816", "0.46784258", "0.4676913", "0.46759227", "0.46728146", "0.46719387", "0.46686554", "0.46686554", "0.4666156", "0.46614605", "0.46611053", "0.466004", "0.46565068", "0.46531367", "0.4652937", "0.4652573", "0.4652573", "0.46524948", "0.46524948", "0.46524948", "0.46524948", "0.46524948", "0.46524948" ]
0.0
-1
/ / / / / / / / / / /
protected String toExternalForm(URL paramURL) { /* 483 */ int i = paramURL.getProtocol().length() + 1; /* 484 */ if (paramURL.getAuthority() != null && paramURL.getAuthority().length() > 0) /* 485 */ i += 2 + paramURL.getAuthority().length(); /* 486 */ if (paramURL.getPath() != null) { /* 487 */ i += paramURL.getPath().length(); /* */ } /* 489 */ if (paramURL.getQuery() != null) { /* 490 */ i += 1 + paramURL.getQuery().length(); /* */ } /* 492 */ if (paramURL.getRef() != null) { /* 493 */ i += 1 + paramURL.getRef().length(); /* */ } /* 495 */ StringBuffer stringBuffer = new StringBuffer(i); /* 496 */ stringBuffer.append(paramURL.getProtocol()); /* 497 */ stringBuffer.append(":"); /* 498 */ if (paramURL.getAuthority() != null && paramURL.getAuthority().length() > 0) { /* 499 */ stringBuffer.append("//"); /* 500 */ stringBuffer.append(paramURL.getAuthority()); /* */ } /* 502 */ if (paramURL.getPath() != null) { /* 503 */ stringBuffer.append(paramURL.getPath()); /* */ } /* 505 */ if (paramURL.getQuery() != null) { /* 506 */ stringBuffer.append('?'); /* 507 */ stringBuffer.append(paramURL.getQuery()); /* */ } /* 509 */ if (paramURL.getRef() != null) { /* 510 */ stringBuffer.append("#"); /* 511 */ stringBuffer.append(paramURL.getRef()); /* */ } /* 513 */ return stringBuffer.toString(); /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int parent(int i){return (i-1)/2;}", "private int leftChild(int i){return 2*i+1;}", "private int rightChild(int i){return 2*i+2;}", "public void divide() {\n\t\t\n\t}", "public abstract void bepaalGrootte();", "double passer();", "int getWidth() {return width;}", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "public Integer getWidth(){return this.width;}", "public double getWidth() {\n return this.size * 2.0; \n }", "public double getWidth() {\n return this.left.getLeft(0) - this.right.getRight(0); \n }", "private double[] getExtents(){\n return new double[] { -90, -180, 90, 180 };\n }", "public static void bottomHalf() {\n\n for(int i = 1; i <= SIZE; i++) {\n for(int j = 1; j <= i - 1; j++) {\n System.out.print(\" \");\n }\n \n\t System.out.print(\"\\\\_\");\n\t for(int j = 3*SIZE-i; j >= i; j--) {\n\t System.out.print(\"/\\\\\");\n\t }\n\t System.out.println(\"_/\");\n }\n }", "public void getTile_B8();", "private static Object[] newPath(int length, Object[] leaf) {\n Object[] node = leaf;\n for (int i = 0; i < length; i += 5) {\n node = new Object[] { node };\n }\n return node;\n }", "public String ring();", "int width();", "public void gored() {\n\t\t\n\t}", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\n }", "public String toString(){ return \"DIV\";}", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "private int leftChild(int index){\n\t\treturn (2*index) +1;\n\t}", "public abstract String division();", "private int get_right_child(int index){\r\n return 2 * index + 2;\r\n }", "public double getWidth() { return _width<0? -_width : _width; }", "public int getEdgeCount() \n {\n return 3;\n }", "public int getWidth() {\r\n\treturn this.width;\r\n}", "long getWidth();", "@Override\n public void bfs() {\n\n }", "double getNewWidth();", "static int getNumPatterns() { return 64; }", "public int my_leaf_count();", "private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }", "public int generateRoshambo(){\n ;]\n\n }", "@Override\npublic void processDirection() {\n\t\n}", "public double getWidth() {\n return this.getRight(this.tree.getRight(0)) - this.getLeft(this.tree.getLeft(0)); \n }", "@Override\n protected int mapSize() {\n return left.size()+right.size()-hidden.size();\n }", "public static void sizePathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze five = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\t//System.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = five.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber + n)){\n\t\t\t\t\t\tS.unionBySize(randomNumber+n, randomNumber);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'u');\n\t\t\t\t\t\t//S.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.unionBySize(randomNumber, randomNumber+1);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(five, n);\n\t\tuserSelection_SolveMaze(n);\n\n\t\tStdDraw.show(0);\n\t\tfive.draw();\n\t\tfive.printCellNumbers();\t\n\t}", "void mo33732Px();", "protected boolean\nshouldCompactPathLists()\n//\n////////////////////////////////////////////////////////////////////////\n{\n return true;\n}", "double volume(){\n return width*height*depth;\n }", "double seBlesser();", "int getTribeSize();", "Operations operations();", "private int get_left_child(int index){\r\n return 2 * index + 1;\r\n }", "public double getPerimiter(){return (2*height +2*width);}", "public int getWidth(){\n return width;\n }", "public void leerPlanesDietas();", "protected int getWidth()\n\t{\n\t\treturn 0;\n\t}", "public void skystonePos4() {\n }", "public String getRing();", "@Override\n public String toString()\n {\n\treturn getClass().getSimpleName() + \" (\" + getLength() + \"x\" + getWidth() + \")\";\n }", "@Override\n\tpublic float getWidth() {\n\t\treturn 26;\n\t}", "int[] union(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n\t\t//Please fill in the program here\r\n\t\tst[0] = incCapacity();\r\n\t\taddEdge(st[0], epssymbol, s1);\r\n\t\taddEdge(st[0], epssymbol, s2);\r\n\t\tst[1] = incCapacity();\r\n\t\taddEdge(t1, epssymbol, st[1]);\r\n\t\taddEdge(t2, epssymbol, st[1]);\r\n\r\n\t\treturn st;\r\n\t}", "private int get_parent(int index){\r\n return (index-1)/2;\r\n }", "@Override\r\n\tpublic void walk() {\n\r\n\t}", "public void SubRect(){\n\t\n}", "public static void main(String[] args) {\n\t\tScanner obj=new Scanner(System.in);\r\n\t\tint a=0;\r\n\t\tint count=0;\r\n System.out.println(\"enter size\");\r\n\t\ta=obj.nextInt();\r\n\t\tint m=2*a+1;\r\n\t\tint n=2*a+2;\r\n\t\tint mid=(m+1)/2;\r\n\t\tfor(int i=1;i<=m;i++)\r\n\t\t{\r\n\t\t\tcount=0;\r\n\t\t\tfor(int j=1;j<=n;j++)\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t\tif((i==1)||(i==m)||(j==1)||(j==n))//frame begin\r\n\t\t\t\t{\r\n\t\t\t\t\tif((i==1)||(i==m))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"+\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t {\r\n\t\t\t\t\t\t\tSystem.out.print(\"|\");//frame left and right\r\n\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//frame end\r\n\t\t\t\telse if (i<mid)//upper-half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t for(int l=1;l<=2*i-4;l++)\r\n\t\t\t\t {\r\n\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\tSystem.out.print(\"\\\\\");\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end of upper half\r\n\t\t\t\telse if(i>mid)//lower half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfor(int k=mid;k<i;k++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t System.out.print(\"\\\\\");\r\n\t\t\t\t\t for(int l=2*m-6;l>2*i-4;l--)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t }\r\n\t\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t\t for(int k=mid;k<i;k++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t\t\t}//end of lower half\r\n\t\t\t\telse if(i==mid)//middle part\r\n\t\t\t\t{\r\n\t\t\t\t\tif(j==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"<\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(j==n-1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\">\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i%2==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"=\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end\r\n\t\t\t}//end-of-j\r\n\t\t\tSystem.out.println();\r\n\t\t}//end\r\n\r\n\t}", "public abstract double getBaseWidth();", "protected int parent(int i) { return (i - 1) / 2; }", "public static int size_parent() {\n return (8 / 8);\n }", "static void pyramid(){\n\t}", "public void lowerFlatbed(){\n flatbed.lowerFlatbed();\n }", "int expand();", "public abstract int getSpotsNeeded();", "Parallelogram(){\n length = width = height = 0;\n }", "@Override\n\tpublic void walk() {\n\t\t\n\t}", "double Volume(){\r\n return Height * Width * Depth;\r\n }", "private void pointer(Graphics image,int x,int y,int height,int b,int dir) {\n\n\t\tint[] xt=new int[3];\n\t\tint[] yt=new int[3];\n\n\t\tif(dir==0) {\n\t\t\txt[0]=x;\n\t\t\txt[1]=xt[2]=x+height;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=y+b/2;\n\t\t\tyt[2]=y-b/2;\n\t\t} else {\n\t\t\txt[0]=x;\n\t\t\txt[1]=x+b/2;\n\t\t\txt[2]=x-b/2;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=yt[2]=y-height;\n\t\t}\n\t\timage.fillPolygon(xt,yt,3);\n\t}", "public int getWidth()\n {return width;}", "void walk() {\n\t\t\n\t}", "@Override\r\n\tpublic int getWidth() {\n\t\treturn 0;\r\n\t}", "long getMid();", "long getMid();", "public static String makeShapeA() {\n\tString result = \"\";\n\t\tfor (int i = 0; i < 8 ; i++) {\n\t\t\tresult+=printHash(i);\n\t\t\t\n\t\t}return result;\n\t\t\t//System.out.println(printHash(i));\n\t\t}", "int depth();", "int depth();", "private byte r() {\r\n\t\treturn (left_map == 0 ) ? (byte) 1 : 0;\r\n\t}", "private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }", "int getSpriteArraySize();", "public void foundLeaf(int width, int height, int level, int currX, int currY, int location) {\n level = level +2;\n if (location == 1) {\n\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - ( (new Double(spatialHeight / Math.pow(2, level ))).intValue()),\n currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY * 2,\n Color.BLACK);\n\n\n canvas.addLine(((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue())) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n currX,\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n\n }\n\n if (location == 2) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n ( currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n (currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n\n\n }\n\n if (location == 3) {\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY,\n Color.BLACK);\n\n\n\n canvas.addLine((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n\tcurrY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n (currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n }\n\n if (location == 4) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY,\n Color.BLACK);\n\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue() + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), Color.BLACK);\n\n\n }\n\n\n\n\n }", "String directsTo();", "public static void unionPathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze two = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\tSystem.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = two.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber+n) != S.findAndCompress(randomNumber)){\n\t\t\t\t\t\tS.union(randomNumber+n, randomNumber);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'u');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.union(randomNumber, randomNumber+1);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(two, n);\n\t\tuserSelection_SolveMaze(n);\n\n\n\t\tStdDraw.show(0);\n\t\ttwo.draw();\n\t\ttwo.printCellNumbers();\n\t}", "double getPerimeter(){\n return 2*height+width;\n }", "public static void main(String[] args) {\n\n\n for(int a=0; a<7;a++){\n for(int b=0;b<7-a;b++){\n System.out.print(\" \");\n }\n for(int c=0; c<=a;c++){\n System.out.print(\"* \");\n }\n System.out.println(\" \");\n }\n\n }", "int getWidth1();", "void sharpen();", "void sharpen();", "public String getRingback();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();" ]
[ "0.55399466", "0.5443876", "0.52045697", "0.51806474", "0.5094128", "0.50592", "0.5054664", "0.50454694", "0.50268364", "0.50132203", "0.5012506", "0.50112844", "0.50044596", "0.49996305", "0.499802", "0.49844983", "0.498055", "0.49782547", "0.49679092", "0.49582762", "0.4911767", "0.4911061", "0.48968992", "0.4877054", "0.4871841", "0.4866369", "0.48431775", "0.48422047", "0.48409557", "0.48369882", "0.48331037", "0.48273882", "0.48223722", "0.4815669", "0.4810049", "0.4806627", "0.48063534", "0.48049983", "0.47950453", "0.4792885", "0.478879", "0.47814485", "0.47804892", "0.4771149", "0.476971", "0.4767484", "0.47626838", "0.47575572", "0.47520304", "0.47519246", "0.4750338", "0.4749407", "0.47493348", "0.47474238", "0.4746467", "0.47418123", "0.47342435", "0.47328722", "0.47325733", "0.47281516", "0.4727451", "0.47269553", "0.47226632", "0.4715277", "0.47095272", "0.47083881", "0.4704314", "0.47037", "0.4696463", "0.4696039", "0.4696013", "0.46956718", "0.4687439", "0.4687439", "0.46874273", "0.46873394", "0.46873394", "0.4687064", "0.46868482", "0.46837968", "0.4683627", "0.46829212", "0.46805394", "0.4675486", "0.46726555", "0.4669489", "0.46670854", "0.46670854", "0.4666837", "0.46654302", "0.46654302", "0.46654302", "0.46654302", "0.46654302", "0.46654302", "0.46654302", "0.46654302", "0.46654302", "0.46654302", "0.46654302", "0.46654302" ]
0.0
-1
/ / / / / / / / / / / / / / / / / / / / / / /
protected void setURL(URL paramURL, String paramString1, String paramString2, int paramInt, String paramString3, String paramString4, String paramString5, String paramString6, String paramString7) { /* 538 */ if (this != paramURL.handler) { /* 539 */ throw new SecurityException("handler for url different from this handler"); /* */ } /* 541 */ if (paramString2 != null && paramURL.isBuiltinStreamHandler(this)) { /* 542 */ String str = IPAddressUtil.checkHostString(paramString2); /* 543 */ if (str != null) throw new IllegalArgumentException(str); /* */ /* */ } /* 546 */ paramURL.set(paramURL.getProtocol(), paramString2, paramInt, paramString3, paramString4, paramString5, paramString6, paramString7); /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int parent(int i){return (i-1)/2;}", "static int getNumPatterns() { return 64; }", "double passer();", "private double[] getExtents(){\n return new double[] { -90, -180, 90, 180 };\n }", "private int leftChild(int i){return 2*i+1;}", "public Integer getWidth(){return this.width;}", "void mo33732Px();", "int getWidth() {return width;}", "int width();", "public void gored() {\n\t\t\n\t}", "public int getBlockLength()\r\n/* 45: */ {\r\n/* 46:107 */ return -32;\r\n/* 47: */ }", "int getTribeSize();", "public abstract void bepaalGrootte();", "public void getTile_B8();", "int getSize ();", "double seBlesser();", "@Override\n\tpublic int sount() {\n\t\treturn 0;\n\t}", "public int getInternalBlockLength()\r\n/* 40: */ {\r\n/* 41: 95 */ return 32;\r\n/* 42: */ }", "public void method_4270() {}", "public double getWidth() {\n return this.size * 2.0; \n }", "@Override\n protected int mapSize() {\n return left.size()+right.size()-hidden.size();\n }", "public int getEdgeCount() \n {\n return 3;\n }", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "public int generateRoshambo(){\n ;]\n\n }", "public int length() { return 1+maxidx; }", "public abstract int getSpotsNeeded();", "public int getTakeSpace() {\n return 0;\n }", "@Override\n\tprotected void interr() {\n\t}", "public int getWidth() {\r\n\treturn this.width;\r\n}", "static int size_of_inx(String passed){\n\t\treturn 1;\n\t}", "private void poetries() {\n\n\t}", "public void divide() {\n\t\t\n\t}", "@Override\n\tpublic float getWidth() {\n\t\treturn 26;\n\t}", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\n }", "long getWidth();", "static int size_of_xra(String passed){\n\t\treturn 1;\n\t}", "public static int size_parent() {\n return (8 / 8);\n }", "public void skystonePos4() {\n }", "public static int size_parentId() {\n return (16 / 8);\n }", "double getNewWidth();", "protected int getWidth()\n\t{\n\t\treturn 0;\n\t}", "@Override\n public int getSize() {\n return 1;\n }", "int getSpriteArraySize();", "@Override\n public void perish() {\n \n }", "int fixedSize();", "public double getWidth() { return _width<0? -_width : _width; }", "long getMid();", "long getMid();", "public String ring();", "int memSize() {\n return super.memSize() + 4 * 4; }", "int align();", "static int size_of_shld(String passed){\n\t\treturn 3;\n\t}", "public int getSize(){return _size;}", "@Override\n public void func_104112_b() {\n \n }", "static int size_of_xthl(String passed){\n\t\treturn 1;\n\t}", "static int size_of_rpo(String passed){\n\t\treturn 1;\n\t}", "@Override\n public void bfs() {\n\n }", "private static Object[] newPath(int length, Object[] leaf) {\n Object[] node = leaf;\n for (int i = 0; i < length; i += 5) {\n node = new Object[] { node };\n }\n return node;\n }", "@Override\n public String toString()\n {\n\treturn getClass().getSimpleName() + \" (\" + getLength() + \"x\" + getWidth() + \")\";\n }", "private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }", "@Override\r\n\tpublic int size() {\n\t\treturn 27;\r\n\t}", "public void verliesLeven() {\r\n\t\t\r\n\t}", "public int my_leaf_count();", "int size() {\n int basic = ((offset() + 4) & ~3) - offset() + 8;\n /* Add 8*number of offsets */\n return basic + targetsOp.length*8;\n }", "public int getSize(){return this.size;}", "@Override\n public int width()\n {\n return widthCent; //Charlie Gao helped me debug the issue here\n }", "public abstract void mo56925d();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int expand();", "public int get_resource_distance() {\n return 1;\r\n }", "public void leerPlanesDietas();", "@Override\r\n\tpublic int getWidth() {\n\t\treturn 0;\r\n\t}", "@Override\n public int getSize() {\n\treturn 0;\n }", "@Override\n public int getSize() {\n return 64;\n }", "public double getWidth() {\n return this.left.getLeft(0) - this.right.getRight(0); \n }", "public byte[] initialValue() {\n return new byte[]{(byte) -1, (byte) -40, (byte) -1, (byte) -37, (byte) 0, (byte) 67, (byte) 0, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -64, (byte) 0, (byte) 17, (byte) 8, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 3, (byte) 1, (byte) 34, (byte) 0, (byte) 2, (byte) 17, (byte) 0, (byte) 3, (byte) 17, (byte) 0, (byte) -1, (byte) -60, (byte) 0, (byte) 31, (byte) 0, (byte) 0, (byte) 1, (byte) 5, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9, (byte) 10, (byte) 11, (byte) -1, (byte) -60, (byte) 0, (byte) -75, (byte) 16, (byte) 0, (byte) 2, (byte) 1, (byte) 3, (byte) 3, (byte) 2, (byte) 4, (byte) 3, (byte) 5, (byte) 5, (byte) 4, (byte) 4, (byte) 0, (byte) 0, (byte) 1, (byte) 125, (byte) 1, (byte) 2, (byte) 3, (byte) 0, (byte) 4, (byte) 17, (byte) 5, (byte) 18, (byte) 33, (byte) 49, (byte) 65, (byte) 6, (byte) 19, (byte) 81, (byte) 97, (byte) 7, (byte) 34, (byte) 113, (byte) 20, (byte) 50, (byte) -127, (byte) -111, (byte) -95, (byte) 8, (byte) 35, (byte) 66, (byte) -79, (byte) -63, (byte) 21, (byte) 82, (byte) -47, (byte) -16, (byte) 36, (byte) 51, (byte) 98, (byte) 114, (byte) -126, (byte) 9, (byte) 10, (byte) 22, (byte) 23, (byte) 24, (byte) 25, (byte) 26, (byte) 37, (byte) 38, (byte) 39, (byte) 40, (byte) 41, (byte) 42, (byte) 52, (byte) 53, (byte) 54, (byte) 55, (byte) 56, (byte) 57, (byte) 58, (byte) 67, (byte) 68, (byte) 69, (byte) 70, (byte) 71, (byte) 72, (byte) 73, (byte) 74, (byte) 83, (byte) 84, (byte) 85, (byte) 86, (byte) 87, (byte) 88, (byte) 89, (byte) 90, (byte) 99, (byte) 100, (byte) 101, (byte) 102, (byte) 103, (byte) 104, (byte) 105, (byte) 106, (byte) 115, (byte) 116, (byte) 117, (byte) 118, (byte) 119, (byte) 120, (byte) 121, (byte) 122, (byte) -125, (byte) -124, (byte) -123, (byte) -122, (byte) -121, (byte) -120, (byte) -119, (byte) -118, (byte) -110, (byte) -109, (byte) -108, (byte) -107, (byte) -106, (byte) -105, (byte) -104, (byte) -103, (byte) -102, (byte) -94, (byte) -93, (byte) -92, (byte) -91, (byte) -90, (byte) -89, (byte) -88, (byte) -87, (byte) -86, (byte) -78, (byte) -77, (byte) -76, (byte) -75, (byte) -74, (byte) -73, (byte) -72, (byte) -71, (byte) -70, (byte) -62, (byte) -61, (byte) -60, (byte) -59, (byte) -58, (byte) -57, (byte) -56, (byte) -55, (byte) -54, (byte) -46, (byte) -45, (byte) -44, (byte) -43, (byte) -42, (byte) -41, (byte) -40, (byte) -39, (byte) -38, (byte) -31, (byte) -30, (byte) -29, (byte) -28, (byte) -27, (byte) -26, (byte) -25, (byte) -24, (byte) -23, (byte) -22, (byte) -15, (byte) -14, (byte) -13, (byte) -12, (byte) -11, (byte) -10, (byte) -9, (byte) -8, (byte) -7, (byte) -6, (byte) -1, (byte) -60, (byte) 0, (byte) 31, (byte) 1, (byte) 0, (byte) 3, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9, (byte) 10, (byte) 11, (byte) -1, (byte) -60, (byte) 0, (byte) -75, (byte) 17, (byte) 0, (byte) 2, (byte) 1, (byte) 2, (byte) 4, (byte) 4, (byte) 3, (byte) 4, (byte) 7, (byte) 5, (byte) 4, (byte) 4, (byte) 0, (byte) 1, (byte) 2, (byte) 119, (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 17, (byte) 4, (byte) 5, (byte) 33, (byte) 49, (byte) 6, (byte) 18, (byte) 65, (byte) 81, (byte) 7, (byte) 97, (byte) 113, (byte) 19, (byte) 34, (byte) 50, (byte) -127, (byte) 8, (byte) 20, (byte) 66, (byte) -111, (byte) -95, (byte) -79, (byte) -63, (byte) 9, (byte) 35, (byte) 51, (byte) 82, (byte) -16, (byte) 21, (byte) 98, (byte) 114, (byte) -47, (byte) 10, (byte) 22, (byte) 36, (byte) 52, (byte) -31, (byte) 37, (byte) -15, (byte) 23, (byte) 24, (byte) 25, (byte) 26, (byte) 38, (byte) 39, (byte) 40, (byte) 41, (byte) 42, (byte) 53, (byte) 54, (byte) 55, (byte) 56, (byte) 57, (byte) 58, (byte) 67, (byte) 68, (byte) 69, (byte) 70, (byte) 71, (byte) 72, (byte) 73, (byte) 74, (byte) 83, (byte) 84, (byte) 85, (byte) 86, (byte) 87, (byte) 88, (byte) 89, (byte) 90, (byte) 99, (byte) 100, (byte) 101, (byte) 102, (byte) 103, (byte) 104, (byte) 105, (byte) 106, (byte) 115, (byte) 116, (byte) 117, (byte) 118, (byte) 119, (byte) 120, (byte) 121, (byte) 122, (byte) -126, (byte) -125, (byte) -124, (byte) -123, (byte) -122, (byte) -121, (byte) -120, (byte) -119, (byte) -118, (byte) -110, (byte) -109, (byte) -108, (byte) -107, (byte) -106, (byte) -105, (byte) -104, (byte) -103, (byte) -102, (byte) -94, (byte) -93, (byte) -92, (byte) -91, (byte) -90, (byte) -89, (byte) -88, (byte) -87, (byte) -86, (byte) -78, (byte) -77, (byte) -76, (byte) -75, (byte) -74, (byte) -73, (byte) -72, (byte) -71, (byte) -70, (byte) -62, (byte) -61, (byte) -60, (byte) -59, (byte) -58, (byte) -57, (byte) -56, (byte) -55, (byte) -54, (byte) -46, (byte) -45, (byte) -44, (byte) -43, (byte) -42, (byte) -41, (byte) -40, (byte) -39, (byte) -38, (byte) -30, (byte) -29, (byte) -28, (byte) -27, (byte) -26, (byte) -25, (byte) -24, (byte) -23, (byte) -22, (byte) -14, (byte) -13, (byte) -12, (byte) -11, (byte) -10, (byte) -9, (byte) -8, (byte) -7, (byte) -6, (byte) -1, (byte) -38, (byte) 0, (byte) 12, (byte) 3, (byte) 1, (byte) 0, (byte) 2, (byte) 17, (byte) 3, (byte) 17, (byte) 0, (byte) 63, (byte) 0, (byte) -114, (byte) -118, (byte) 40, (byte) -96, (byte) 15, (byte) -1, (byte) -39};\n }", "public abstract int mo9754s();", "@Override\n protected long advanceH(final long k) {\n return 5 * k - 2;\n }", "private int rightChild(int i){return 2*i+2;}", "@Override\npublic void processDirection() {\n\t\n}", "@Override\n\tpublic int taille() {\n\t\treturn 1;\n\t}", "@Override\r\n\tpublic int operar() {\n\t\treturn 0;\r\n\t}", "public interface Probing {\r\n\t/**\r\n\t * Get an alternate hash position\r\n\t * @param key The original key\r\n\t * @param i How many spaces are occupied already\r\n\t * @param max How many spaces are available\r\n\t * @return A new position for the key\r\n\t */\r\n\tpublic int getHash(int key, int i, int max);\r\n}", "public String toString(){ return \"DIV\";}", "static int size_of_rp(String passed){\n\t\treturn 1;\n\t}", "public int getWidth(){\n return width;\n }", "public abstract double getBaseWidth();", "@Override\n\tpublic int computeSize() {\n\t\treturn 36;\n\t}", "private void m50366E() {\n }" ]
[ "0.5172416", "0.51261884", "0.5123226", "0.51177007", "0.5086934", "0.50333786", "0.5010046", "0.4988667", "0.4968825", "0.49662834", "0.49486443", "0.49357387", "0.49139488", "0.49114957", "0.4903644", "0.49029875", "0.4886754", "0.48787475", "0.48749134", "0.4873312", "0.4873235", "0.48676565", "0.48595807", "0.48446092", "0.48363543", "0.48338538", "0.48307845", "0.48255128", "0.4825392", "0.48218346", "0.48216146", "0.481775", "0.4813212", "0.48129746", "0.48122588", "0.4805389", "0.47936493", "0.47923127", "0.4791539", "0.4788446", "0.4783367", "0.47828063", "0.47773093", "0.47747663", "0.47744197", "0.47599196", "0.47592005", "0.47592005", "0.47510657", "0.4749986", "0.47447735", "0.47443983", "0.47440025", "0.47422588", "0.47415844", "0.47414127", "0.4738614", "0.47360802", "0.47357243", "0.47354344", "0.47338414", "0.4732774", "0.47311053", "0.47243237", "0.4721734", "0.47215986", "0.4719854", "0.4718664", "0.4718664", "0.4718664", "0.4718664", "0.4718664", "0.4718664", "0.4718664", "0.4718664", "0.4718664", "0.4718664", "0.4718664", "0.4718664", "0.4718664", "0.47170216", "0.47163033", "0.47138837", "0.47099057", "0.47065014", "0.4705488", "0.47045058", "0.4703452", "0.47023037", "0.46978655", "0.46964854", "0.46959049", "0.46907955", "0.4688295", "0.46874523", "0.4687303", "0.46860346", "0.46841148", "0.4682583", "0.46822152", "0.4680733" ]
0.0
-1
/ / / / / / / / / / / / / / / / / / / / / / /
@Deprecated /* */ protected void setURL(URL paramURL, String paramString1, String paramString2, int paramInt, String paramString3, String paramString4) { /* 572 */ String str1 = null; /* 573 */ String str2 = null; /* 574 */ if (paramString2 != null && paramString2.length() != 0) { /* 575 */ str1 = (paramInt == -1) ? paramString2 : (paramString2 + ":" + paramInt); /* 576 */ int i = paramString2.lastIndexOf('@'); /* 577 */ if (i != -1) { /* 578 */ str2 = paramString2.substring(0, i); /* 579 */ paramString2 = paramString2.substring(i + 1); /* */ } /* */ } /* */ /* */ /* */ /* */ /* 586 */ String str3 = null; /* 587 */ String str4 = null; /* 588 */ if (paramString3 != null) { /* 589 */ int i = paramString3.lastIndexOf('?'); /* 590 */ if (i != -1) { /* 591 */ str4 = paramString3.substring(i + 1); /* 592 */ str3 = paramString3.substring(0, i); /* */ } else { /* 594 */ str3 = paramString3; /* */ } /* 596 */ } setURL(paramURL, paramString1, paramString2, paramInt, str1, str2, str3, str4, paramString4); /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int parent(int i){return (i-1)/2;}", "static int getNumPatterns() { return 64; }", "double passer();", "private double[] getExtents(){\n return new double[] { -90, -180, 90, 180 };\n }", "private int leftChild(int i){return 2*i+1;}", "public Integer getWidth(){return this.width;}", "void mo33732Px();", "int getWidth() {return width;}", "int width();", "public void gored() {\n\t\t\n\t}", "public int getBlockLength()\r\n/* 45: */ {\r\n/* 46:107 */ return -32;\r\n/* 47: */ }", "int getTribeSize();", "public void getTile_B8();", "public abstract void bepaalGrootte();", "int getSize ();", "double seBlesser();", "@Override\n\tpublic int sount() {\n\t\treturn 0;\n\t}", "public int getInternalBlockLength()\r\n/* 40: */ {\r\n/* 41: 95 */ return 32;\r\n/* 42: */ }", "public double getWidth() {\n return this.size * 2.0; \n }", "public void method_4270() {}", "@Override\n protected int mapSize() {\n return left.size()+right.size()-hidden.size();\n }", "public int getEdgeCount() \n {\n return 3;\n }", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "public int generateRoshambo(){\n ;]\n\n }", "public int length() { return 1+maxidx; }", "public abstract int getSpotsNeeded();", "public int getTakeSpace() {\n return 0;\n }", "public int getWidth() {\r\n\treturn this.width;\r\n}", "@Override\n\tprotected void interr() {\n\t}", "static int size_of_inx(String passed){\n\t\treturn 1;\n\t}", "private void poetries() {\n\n\t}", "public void divide() {\n\t\t\n\t}", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\n }", "@Override\n\tpublic float getWidth() {\n\t\treturn 26;\n\t}", "long getWidth();", "static int size_of_xra(String passed){\n\t\treturn 1;\n\t}", "public static int size_parent() {\n return (8 / 8);\n }", "public static int size_parentId() {\n return (16 / 8);\n }", "public void skystonePos4() {\n }", "double getNewWidth();", "@Override\n public int getSize() {\n return 1;\n }", "protected int getWidth()\n\t{\n\t\treturn 0;\n\t}", "int getSpriteArraySize();", "int fixedSize();", "@Override\n public void perish() {\n \n }", "long getMid();", "long getMid();", "public double getWidth() { return _width<0? -_width : _width; }", "public String ring();", "int memSize() {\n return super.memSize() + 4 * 4; }", "int align();", "static int size_of_shld(String passed){\n\t\treturn 3;\n\t}", "public int getSize(){return _size;}", "@Override\n public void func_104112_b() {\n \n }", "static int size_of_xthl(String passed){\n\t\treturn 1;\n\t}", "static int size_of_rpo(String passed){\n\t\treturn 1;\n\t}", "@Override\n public void bfs() {\n\n }", "@Override\n public String toString()\n {\n\treturn getClass().getSimpleName() + \" (\" + getLength() + \"x\" + getWidth() + \")\";\n }", "private static Object[] newPath(int length, Object[] leaf) {\n Object[] node = leaf;\n for (int i = 0; i < length; i += 5) {\n node = new Object[] { node };\n }\n return node;\n }", "private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }", "@Override\r\n\tpublic int size() {\n\t\treturn 27;\r\n\t}", "public void verliesLeven() {\r\n\t\t\r\n\t}", "public int my_leaf_count();", "int size() {\n int basic = ((offset() + 4) & ~3) - offset() + 8;\n /* Add 8*number of offsets */\n return basic + targetsOp.length*8;\n }", "public int getSize(){return this.size;}", "@Override\n public int width()\n {\n return widthCent; //Charlie Gao helped me debug the issue here\n }", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "int getSize();", "public abstract void mo56925d();", "int expand();", "public int get_resource_distance() {\n return 1;\r\n }", "public void leerPlanesDietas();", "@Override\r\n\tpublic int getWidth() {\n\t\treturn 0;\r\n\t}", "@Override\n public int getSize() {\n\treturn 0;\n }", "@Override\n public int getSize() {\n return 64;\n }", "public double getWidth() {\n return this.left.getLeft(0) - this.right.getRight(0); \n }", "public byte[] initialValue() {\n return new byte[]{(byte) -1, (byte) -40, (byte) -1, (byte) -37, (byte) 0, (byte) 67, (byte) 0, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -64, (byte) 0, (byte) 17, (byte) 8, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 3, (byte) 1, (byte) 34, (byte) 0, (byte) 2, (byte) 17, (byte) 0, (byte) 3, (byte) 17, (byte) 0, (byte) -1, (byte) -60, (byte) 0, (byte) 31, (byte) 0, (byte) 0, (byte) 1, (byte) 5, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9, (byte) 10, (byte) 11, (byte) -1, (byte) -60, (byte) 0, (byte) -75, (byte) 16, (byte) 0, (byte) 2, (byte) 1, (byte) 3, (byte) 3, (byte) 2, (byte) 4, (byte) 3, (byte) 5, (byte) 5, (byte) 4, (byte) 4, (byte) 0, (byte) 0, (byte) 1, (byte) 125, (byte) 1, (byte) 2, (byte) 3, (byte) 0, (byte) 4, (byte) 17, (byte) 5, (byte) 18, (byte) 33, (byte) 49, (byte) 65, (byte) 6, (byte) 19, (byte) 81, (byte) 97, (byte) 7, (byte) 34, (byte) 113, (byte) 20, (byte) 50, (byte) -127, (byte) -111, (byte) -95, (byte) 8, (byte) 35, (byte) 66, (byte) -79, (byte) -63, (byte) 21, (byte) 82, (byte) -47, (byte) -16, (byte) 36, (byte) 51, (byte) 98, (byte) 114, (byte) -126, (byte) 9, (byte) 10, (byte) 22, (byte) 23, (byte) 24, (byte) 25, (byte) 26, (byte) 37, (byte) 38, (byte) 39, (byte) 40, (byte) 41, (byte) 42, (byte) 52, (byte) 53, (byte) 54, (byte) 55, (byte) 56, (byte) 57, (byte) 58, (byte) 67, (byte) 68, (byte) 69, (byte) 70, (byte) 71, (byte) 72, (byte) 73, (byte) 74, (byte) 83, (byte) 84, (byte) 85, (byte) 86, (byte) 87, (byte) 88, (byte) 89, (byte) 90, (byte) 99, (byte) 100, (byte) 101, (byte) 102, (byte) 103, (byte) 104, (byte) 105, (byte) 106, (byte) 115, (byte) 116, (byte) 117, (byte) 118, (byte) 119, (byte) 120, (byte) 121, (byte) 122, (byte) -125, (byte) -124, (byte) -123, (byte) -122, (byte) -121, (byte) -120, (byte) -119, (byte) -118, (byte) -110, (byte) -109, (byte) -108, (byte) -107, (byte) -106, (byte) -105, (byte) -104, (byte) -103, (byte) -102, (byte) -94, (byte) -93, (byte) -92, (byte) -91, (byte) -90, (byte) -89, (byte) -88, (byte) -87, (byte) -86, (byte) -78, (byte) -77, (byte) -76, (byte) -75, (byte) -74, (byte) -73, (byte) -72, (byte) -71, (byte) -70, (byte) -62, (byte) -61, (byte) -60, (byte) -59, (byte) -58, (byte) -57, (byte) -56, (byte) -55, (byte) -54, (byte) -46, (byte) -45, (byte) -44, (byte) -43, (byte) -42, (byte) -41, (byte) -40, (byte) -39, (byte) -38, (byte) -31, (byte) -30, (byte) -29, (byte) -28, (byte) -27, (byte) -26, (byte) -25, (byte) -24, (byte) -23, (byte) -22, (byte) -15, (byte) -14, (byte) -13, (byte) -12, (byte) -11, (byte) -10, (byte) -9, (byte) -8, (byte) -7, (byte) -6, (byte) -1, (byte) -60, (byte) 0, (byte) 31, (byte) 1, (byte) 0, (byte) 3, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9, (byte) 10, (byte) 11, (byte) -1, (byte) -60, (byte) 0, (byte) -75, (byte) 17, (byte) 0, (byte) 2, (byte) 1, (byte) 2, (byte) 4, (byte) 4, (byte) 3, (byte) 4, (byte) 7, (byte) 5, (byte) 4, (byte) 4, (byte) 0, (byte) 1, (byte) 2, (byte) 119, (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 17, (byte) 4, (byte) 5, (byte) 33, (byte) 49, (byte) 6, (byte) 18, (byte) 65, (byte) 81, (byte) 7, (byte) 97, (byte) 113, (byte) 19, (byte) 34, (byte) 50, (byte) -127, (byte) 8, (byte) 20, (byte) 66, (byte) -111, (byte) -95, (byte) -79, (byte) -63, (byte) 9, (byte) 35, (byte) 51, (byte) 82, (byte) -16, (byte) 21, (byte) 98, (byte) 114, (byte) -47, (byte) 10, (byte) 22, (byte) 36, (byte) 52, (byte) -31, (byte) 37, (byte) -15, (byte) 23, (byte) 24, (byte) 25, (byte) 26, (byte) 38, (byte) 39, (byte) 40, (byte) 41, (byte) 42, (byte) 53, (byte) 54, (byte) 55, (byte) 56, (byte) 57, (byte) 58, (byte) 67, (byte) 68, (byte) 69, (byte) 70, (byte) 71, (byte) 72, (byte) 73, (byte) 74, (byte) 83, (byte) 84, (byte) 85, (byte) 86, (byte) 87, (byte) 88, (byte) 89, (byte) 90, (byte) 99, (byte) 100, (byte) 101, (byte) 102, (byte) 103, (byte) 104, (byte) 105, (byte) 106, (byte) 115, (byte) 116, (byte) 117, (byte) 118, (byte) 119, (byte) 120, (byte) 121, (byte) 122, (byte) -126, (byte) -125, (byte) -124, (byte) -123, (byte) -122, (byte) -121, (byte) -120, (byte) -119, (byte) -118, (byte) -110, (byte) -109, (byte) -108, (byte) -107, (byte) -106, (byte) -105, (byte) -104, (byte) -103, (byte) -102, (byte) -94, (byte) -93, (byte) -92, (byte) -91, (byte) -90, (byte) -89, (byte) -88, (byte) -87, (byte) -86, (byte) -78, (byte) -77, (byte) -76, (byte) -75, (byte) -74, (byte) -73, (byte) -72, (byte) -71, (byte) -70, (byte) -62, (byte) -61, (byte) -60, (byte) -59, (byte) -58, (byte) -57, (byte) -56, (byte) -55, (byte) -54, (byte) -46, (byte) -45, (byte) -44, (byte) -43, (byte) -42, (byte) -41, (byte) -40, (byte) -39, (byte) -38, (byte) -30, (byte) -29, (byte) -28, (byte) -27, (byte) -26, (byte) -25, (byte) -24, (byte) -23, (byte) -22, (byte) -14, (byte) -13, (byte) -12, (byte) -11, (byte) -10, (byte) -9, (byte) -8, (byte) -7, (byte) -6, (byte) -1, (byte) -38, (byte) 0, (byte) 12, (byte) 3, (byte) 1, (byte) 0, (byte) 2, (byte) 17, (byte) 3, (byte) 17, (byte) 0, (byte) 63, (byte) 0, (byte) -114, (byte) -118, (byte) 40, (byte) -96, (byte) 15, (byte) -1, (byte) -39};\n }", "public abstract int mo9754s();", "private int rightChild(int i){return 2*i+2;}", "@Override\n protected long advanceH(final long k) {\n return 5 * k - 2;\n }", "@Override\npublic void processDirection() {\n\t\n}", "@Override\n\tpublic int taille() {\n\t\treturn 1;\n\t}", "public String toString(){ return \"DIV\";}", "public interface Probing {\r\n\t/**\r\n\t * Get an alternate hash position\r\n\t * @param key The original key\r\n\t * @param i How many spaces are occupied already\r\n\t * @param max How many spaces are available\r\n\t * @return A new position for the key\r\n\t */\r\n\tpublic int getHash(int key, int i, int max);\r\n}", "@Override\r\n\tpublic int operar() {\n\t\treturn 0;\r\n\t}", "static int size_of_rp(String passed){\n\t\treturn 1;\n\t}", "public int getWidth(){\n return width;\n }", "@Override\n\tpublic int computeSize() {\n\t\treturn 36;\n\t}", "public abstract double getBaseWidth();", "private void m50366E() {\n }" ]
[ "0.51732004", "0.5126114", "0.51228195", "0.5118551", "0.50880027", "0.5033694", "0.50106776", "0.4988625", "0.49687558", "0.49650666", "0.4948651", "0.49365512", "0.4913192", "0.49131", "0.490398", "0.4901615", "0.48856953", "0.48788276", "0.4874461", "0.4873909", "0.4873416", "0.4867483", "0.48598662", "0.48450297", "0.4836396", "0.48344195", "0.4830441", "0.48252568", "0.48239273", "0.48214817", "0.48207784", "0.4817815", "0.48134446", "0.48132047", "0.48127973", "0.48048237", "0.4793557", "0.47922248", "0.47921932", "0.4787816", "0.47825745", "0.47825366", "0.47785756", "0.47747308", "0.4772825", "0.47605217", "0.47605217", "0.47601104", "0.47512877", "0.4749399", "0.4744829", "0.47443846", "0.47442773", "0.47416693", "0.47413135", "0.47409692", "0.47381216", "0.4736556", "0.47363904", "0.47355705", "0.47331086", "0.47319138", "0.4731223", "0.47239426", "0.4722223", "0.472091", "0.4718797", "0.4718797", "0.4718797", "0.4718797", "0.4718797", "0.4718797", "0.4718797", "0.4718797", "0.4718797", "0.4718797", "0.4718797", "0.4718797", "0.4718797", "0.47186846", "0.47169062", "0.4715947", "0.47143543", "0.47092628", "0.47059625", "0.4705936", "0.4705121", "0.47041014", "0.47018117", "0.46979496", "0.4697845", "0.4695493", "0.4690313", "0.4687873", "0.46877733", "0.4687651", "0.468547", "0.46842065", "0.4682359", "0.46821833", "0.46799967" ]
0.0
-1
remove private access modifier to fix compile time error
ParentClassTwo() { int i = 100; System.out.println(i); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean isPrivate() {\n return true;\n }", "private MigrationInstantiationUtil() {\n\t\tthrow new IllegalAccessError();\n\t}", "@Test\n public void testNoPrivateAccessForProperties6a() {\n testError(\n srcs(\n \"/** @const */ var ns = {};\"\n + \"/** @constructor */ ns.Foo = function() {}; \"\n + \"/** @private */ ns.Foo.prototype.bar_ = function() {};\",\n \"/** @constructor \\n * @extends {ns.Foo} */ \"\n + \"ns.SubFoo = function() {};\"\n + \"ns.SubFoo.prototype.bar_ = function() {};\"),\n BAD_PRIVATE_PROPERTY_ACCESS);\n }", "private Utility() {\n throw new IllegalAccessError();\n }", "private stendhal() {\n\t}", "@Test\n\tvoid onPrivateMethod() {\n\t\tString classContent =\n\t\t//@formatter:off\n\t\t\t\t\"package methodinterception;\"\n\n\t\t\t\t+ \"import io.github.swingboot.concurrency.AssertUi;\"\n\t\t\t\t\n\t\t\t\t+ \"public class N {\"\n\t\t\t\t+ \"\tpublic N() {}\"\n\t\t\t\t\n\t\t\t\t+ \"\t@AssertUi\"\n\t\t\t\t+ \"\tprivate void doSomething() {}\"\n\t\t\t\t\n\t\t\t\t+ \"}\";\n\t\t//@formatter:on\n\t\tReflectException ex = assertThrows(ReflectException.class, () -> compile(\"N\", classContent));\n\t\tassertTrue(ex.getMessage().toLowerCase().contains(\"private methods\"));\n\t}", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:33:59.917 -0500\", hash_original_method = \"4F6254C867328A153FDD5BD23453E816\", hash_generated_method = \"627F9C594B5D3368AD9A21A5E43D2CB8\")\n \nprivate Extensions() {}", "private Validations() {\n\t\tthrow new IllegalAccessError(\"Shouldn't be instantiated.\");\n\t}", "@Test\n public void testNoPrivateAccessForProperties7() {\n testError(\n srcs(\n \"/** @constructor */ function Foo() {} \"\n + \"/** @private */ Foo.prototype.bar_ = function() {};\"\n + \"/** @constructor \\n * @extends {Foo} */ \"\n + \"function SubFoo() {};\"\n + \"SubFoo.prototype.bar_ = function() {};\",\n \"SubFoo.prototype.baz = function() { this.bar_(); }\"),\n BAD_PRIVATE_PROPERTY_ACCESS);\n }", "private void someUtilityMethod() {\n }", "private void someUtilityMethod() {\n }", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:02:04.534 -0500\", hash_original_method = \"E4DEB0C107DDB25A537EF0E89F1C04F8\", hash_generated_method = \"2E76AFD8C90588F5139C0C2D28CAEA05\")\n \nprivate static int translateCodingErrorAction(CodingErrorAction action) {\n if (action == CodingErrorAction.REPORT) {\n return 0;\n } else if (action == CodingErrorAction.IGNORE) {\n return 1;\n } else if (action == CodingErrorAction.REPLACE) {\n return 2;\n } else {\n throw new AssertionError(); // Someone changed the enum.\n }\n }", "public boolean isPrivate() {\n return false;\n }", "private Constantes() {\r\n\t\t// No way\r\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\n public boolean getAllowPrivateConstructors()\n {\n \treturn allowPrivateConstructors;\n }", "private abstract void privateabstract();", "@Test\n public void testNoPrivateAccessForProperties6() {\n test(\n srcs(\n lines(\n \"/** @constructor */\",\n \"function Foo() {}\",\n \"\",\n \"/** @private */\",\n \"Foo.prototype.bar_ = function() {};\"),\n lines(\n \"/**\",\n \" * @constructor\",\n \" * @extends {Foo}\",\n \" */\",\n \"function SubFoo() {};\",\n \"\",\n \"SubFoo.prototype.bar_ = function() {};\")),\n error(BAD_PRIVATE_PROPERTY_ACCESS));\n }", "private PropertyAccess() {\n\t\tsuper();\n\t}", "@Test\n public void testPrivateAccessForProperties3() {\n testError(\n srcs(\n \"/** @constructor */ function Foo() {}\"\n + \"/** @private */ Foo.prototype.bar_ = function() {}; (new Foo).bar_();\",\n \"Foo.prototype.baz = function() { this.bar_(); };\"),\n BAD_PRIVATE_PROPERTY_ACCESS);\n }", "private URIs() {\r\n throw new IllegalAccessError();\r\n }", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:33:59.663 -0500\", hash_original_method = \"7BA2DC4B038FD72F399C633B1C4B5B34\", hash_generated_method = \"3D1B22AE31FE9AB2658DC3713C91A6C9\")\n \nprivate Groups() {}", "public boolean isAccessible() {\n return false;\n }", "public void checkPublic() {\n }", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:32:41.996 -0500\", hash_original_method = \"CB9D9CAF93B6F7C6AC078700B30D5B3A\", hash_generated_method = \"6EEF3712392D06942F0E7086316BBAB4\")\n \n private void nativeConstructor(){\n }", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:33:59.877 -0500\", hash_original_method = \"6B80070A6DD2FB0EB3D1E45B8D1F67CF\", hash_generated_method = \"2A1ECFC7445D74F90AF7029089D02160\")\n \nprivate Organizations() {}", "private Helper() {\r\n // do nothing\r\n }", "private static boolean needsPrivateLookup(Member m) {\n int classModifiers = m.getDeclaringClass().getModifiers();\n return !((Modifier.isPublic(classModifiers) || Modifier.isProtected(classModifiers)) && Modifier.isPublic(m.getModifiers()));\n }", "@Override\n\tpublic boolean isPublic() {\n\t\treturn false;\n\t}", "private Utils() {\n\t}", "private Utils() {\n\t}", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:33:59.504 -0500\", hash_original_method = \"F5E3085137E37D29F0F8CB3C296F1F57\", hash_generated_method = \"47D4A76F75042B03A266F16D90E98429\")\n \nprivate Contacts() {}", "private CommonMethods() {\n }", "public ImpossibleAccessException() {\n super(Constants.IMPOSSIBLE_ACCESS);\n }", "private PermissionHelper() {}", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:33:59.514 -0500\", hash_original_method = \"E49204FD271E895B10D86A1AFEA21B04\", hash_generated_method = \"59B3C6A592AE63BEE2BC1CC1723B36DF\")\n \nprivate Settings() {}", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:32:42.000 -0500\", hash_original_method = \"46D026C452E34CB5D17D4D7413C83210\", hash_generated_method = \"78C5016E7109D19F8AD63CF42C68ACE4\")\n \n private void nativeFinalize(){\n }", "private ChainingMethods() {\n // private constructor\n\n }", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:33:59.809 -0500\", hash_original_method = \"AC0A5CAC5D79A50D0A1A1A7D60109A25\", hash_generated_method = \"DDCD510819A32FF7BD9558A5CE176D29\")\n \nprivate ContactMethods() {}", "private Utils() {}", "private Utils() {}", "private Utils() {}", "private Utils() {}", "private Get() {}", "private Get() {}", "private Helper() {\r\n // empty\r\n }", "private Util() {\n }", "private DPSingletonLazyLoading(){\r\n\t\tthrow new RuntimeException();//You can still access private constructor by reflection and calling setAccessible(true)\r\n\t}", "private Util() { }", "boolean isPrivate();", "private NettyHttpUtil() {\n\t\t// do nothing.\n\t}", "private Utils()\n {\n // Private constructor to prevent instantiation\n }", "private PortletRequestUtils() {\r\n\t\tthrow new UnsupportedOperationException();\r\n\t}", "private PermissionUtil() {\n throw new IllegalStateException(\"you can't instantiate PermissionUtil!\");\n }", "@Test\n public void testPrivateCtor() throws Exception {\n Constructor<?> privateCtor = Helper.class.getDeclaredConstructors()[0];\n assertTrue(Modifier.isPrivate(privateCtor.getModifiers()));\n privateCtor.setAccessible(true);\n privateCtor.newInstance(new Object[] {});\n }", "public static void preventIllegalAccessWarnings()\n {\n // Example \"annoying\" trace:\n // WARNING: An illegal reflective access operation has occurred\n // WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:...)\n // WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil\n // WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations\n // WARNING: All illegal access operations will be denied in a future release\n try\n {\n Class<?> c = Class.forName(\"jdk.internal.module.IllegalAccessLogger\");\n Field f = c.getDeclaredField(\"logger\");\n f.setAccessible(true);\n f.set(null, null);\n }\n catch (Exception e)\n {\n // ignore\n }\n }", "private PluginUtils() {\n\t\t//\t\tthrow new IllegalAccessError(\"Don't instantiate me. I'm a utility class!\");\n\t}", "private MApi() {}", "private CollectionUtils() {\n\t\tthrow new UnsupportedOperationException();\n\t}", "private AccessorModels() {\n // Private constructor to prevent instantiation\n }", "private Util()\n {\n // Empty default ctor, defined to override access scope.\n }", "private Utility() {\n\t}", "private String getSomePrivateInfo() {\r\n \treturn \"private information of MySubject\";\r\n }", "private SparkseeUtils()\n {\n /*\n * Intentionally left empty.\n */\n }", "private Util() {\n }", "private Util() {\n }", "private ATCres() {\r\n // prevent to instantiate this class\r\n }", "@Override\n public boolean getAllowPrivateNameConflicts()\n {\n \treturn allowPrivateNameConflicts;\n }", "private Unescaper() {\n\n\t}", "public void setPrivate()\n {\n ensureLoaded();\n m_flags.setPrivate();\n setModified(true);\n }", "private SecurityConsts()\r\n\t{\r\n\r\n\t}", "private TMCourse() {\n\t}", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:33:59.900 -0500\", hash_original_method = \"BDD10C58ECCC962A5941D61E3DCCB1CC\", hash_generated_method = \"CC96DF6BBA141BCD4483A4EED9B38592\")\n \nprivate Photos() {}", "public static void main(String[] args) {\n\t\n\tAccesingModifiers.hello();//heryerden accessable \n\tAccesingModifiers.hello1();\n\tAccesingModifiers.hello2();\n\t\n\t//AccesingModifiers.hello3(); not acceptable since permission is set to private\n\t\n}", "public static boolean canAccessFieldsDirectly(){\n return false; //TODO codavaj!!\n }", "private UtilsCache() {\n\t\tsuper();\n\t}", "private AppUtils() {\n throw new UnsupportedOperationException(\"cannot be instantiated\");\n }", "private Infer() {\n\n }", "protected HashSet getNoAccess(){\n return tester.noAccess;\n }", "private Quantify()\n {\n throw new UnsupportedOperationException(\"Instantiation of utility classes is not supported.\");\n }", "void m1864a() {\r\n }", "@IgnoreForbiddenApisErrors(reason = \"SecurityManager is deprecated in JDK17\")\n\tprivate static Field getAccessible(Field original) {\n\t\tSecurityManager sm = System.getSecurityManager();\n\t\tif ( sm != null ) {\n\t\t\tsm.checkPermission( HibernateValidatorPermission.ACCESS_PRIVATE_MEMBERS );\n\t\t}\n\n\t\tClass<?> clazz = original.getDeclaringClass();\n\n\t\treturn run( GetDeclaredField.andMakeAccessible( clazz, original.getName() ) );\n\t}", "@Hide\n private final zzs zzahx() {\n }", "private Topography()\n\t{\n\t\tthrow new IllegalStateException(\"This is an utility class, it can not be instantiated\");\n\t}", "private Public() {\n super(\"public\", null);\n }", "private ObjectMacroFront() {\n\n throw new InternalException(\"this class may not have instances\");\n }", "@Test //ExSkip\n public void fieldPrivate() throws Exception {\n // Open a Corel WordPerfect document which we have converted to .docx format.\n Document doc = new Document(getMyDir() + \"Field sample - PRIVATE.docx\");\n\n // WordPerfect 5.x/6.x documents like the one we have loaded may contain PRIVATE fields.\n // Microsoft Word preserves PRIVATE fields during load/save operations,\n // but provides no functionality for them.\n FieldPrivate field = (FieldPrivate) doc.getRange().getFields().get(0);\n\n Assert.assertEquals(\" PRIVATE \\\"My value\\\" \", field.getFieldCode());\n Assert.assertEquals(FieldType.FIELD_PRIVATE, field.getType());\n\n // We can also insert PRIVATE fields using a document builder.\n DocumentBuilder builder = new DocumentBuilder(doc);\n builder.insertField(FieldType.FIELD_PRIVATE, true);\n\n // These fields are not a viable way of protecting sensitive information.\n // Unless backward compatibility with older versions of WordPerfect is essential,\n // we can safely remove these fields. We can do this using a DocumentVisiitor implementation.\n Assert.assertEquals(2, doc.getRange().getFields().getCount());\n\n FieldPrivateRemover remover = new FieldPrivateRemover();\n doc.accept(remover);\n\n Assert.assertEquals(remover.getFieldsRemovedCount(), 2);\n Assert.assertEquals(doc.getRange().getFields().getCount(), 0);\n }", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:33:59.726 -0500\", hash_original_method = \"9948141C64D53CA8E17E7FD2EBA08DA8\", hash_generated_method = \"CD57B10B47E4384F9C72F867F5045C16\")\n \nprivate GroupMembership() {}", "private S3Utils() {\n throw new UnsupportedOperationException(\"This class cannot be instantiated\");\n }", "@Override\n protected void prot() {\n }", "private LevelConstants() {\n\t\t\n\t}", "@Test\n public void testNoPackagePrivateAccessForProperties6() {\n testError(\n srcs(\n SourceFile.fromCode(\n Compiler.joinPathParts(\"foo\", \"bar.js\"),\n \"/** @constructor */ function Foo() {} \"\n + \"/** @package */ Foo.prototype.bar = function() {};\"),\n SourceFile.fromCode(\n Compiler.joinPathParts(\"baz\", \"quux.js\"),\n \"/** @constructor \\n * @extends {Foo} */ \"\n + \"function SubFoo() {};\"\n + \"SubFoo.prototype.bar = function() {};\")),\n error(BAD_PACKAGE_PROPERTY_ACCESS));\n }", "private Utils() {\n }", "private Utils() {\n }", "private Utils() {\n }", "private Utils() {\n }", "private Utils() {\n }", "private ExampleVersion() {\n throw new UnsupportedOperationException(\"Illegal constructor call.\");\n }", "@Test\n public void testPrivateAccessForNames2() {\n testSame(\"function foo_() {}; foo_();\");\n testSame(srcs(\"function foo_() {};\", \"foo_();\"));\n }", "public void makeReadOnly();", "@Test\n public void testNoPackagePrivateAccessForProperties7() {\n testError(\n srcs(\n SourceFile.fromCode(\n Compiler.joinPathParts(\"foo\", \"bar.js\"),\n \"/** @constructor */ function Foo() {} \"\n + \"/** @package */ Foo.prototype.bar = function() {};\"\n + \"/** @constructor \\n * @extends {Foo} */ \"\n + \"function SubFoo() {};\"\n + \"SubFoo.prototype.bar = function() {};\"),\n SourceFile.fromCode(\n Compiler.joinPathParts(\"baz\", \"quux.js\"),\n \"SubFoo.prototype.baz = function() { this.bar(); }\")),\n error(BAD_PACKAGE_PROPERTY_ACCESS));\n }" ]
[ "0.70031226", "0.6811", "0.66314745", "0.65679514", "0.64991534", "0.64872533", "0.64868003", "0.6478248", "0.64577156", "0.64545006", "0.64545006", "0.6453651", "0.6392097", "0.63411325", "0.63394064", "0.6336644", "0.6301709", "0.62521803", "0.62270665", "0.62101644", "0.6208414", "0.61681646", "0.61514", "0.61233413", "0.61215323", "0.6117319", "0.6116368", "0.61146504", "0.60970324", "0.60691214", "0.60691214", "0.60630053", "0.6059419", "0.6032508", "0.6022473", "0.6016296", "0.60153353", "0.60097426", "0.6008391", "0.59731114", "0.59731114", "0.59731114", "0.59731114", "0.5969763", "0.5969763", "0.5950426", "0.5944046", "0.59378594", "0.59318066", "0.5922224", "0.5900385", "0.5879933", "0.5875804", "0.586003", "0.58418405", "0.5837065", "0.5837057", "0.5825614", "0.58153635", "0.5807091", "0.57829976", "0.5748556", "0.574487", "0.5734134", "0.5732861", "0.5732861", "0.5731331", "0.57264966", "0.5721046", "0.5717097", "0.57124835", "0.5706358", "0.5704387", "0.5704007", "0.5703581", "0.5699752", "0.5694647", "0.56924415", "0.5689798", "0.56789535", "0.5677875", "0.56715065", "0.56699073", "0.5654141", "0.56536794", "0.5648603", "0.5646081", "0.5645907", "0.56443644", "0.5643699", "0.564279", "0.56351376", "0.562887", "0.562887", "0.562887", "0.562887", "0.562887", "0.5627615", "0.5624131", "0.5619416", "0.56175756" ]
0.0
-1
Best time to buy and sell stocks II
public int max(int[] prices){ int sum = 0; for(int i=1;i<prices.length;i++){ if((prices[i]-prices[i-1])>0){ sum += (prices[i]-prices[i-1]); } } return sum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void buyStock(double askPrice, int shares, int tradeTime) {\n }", "@Override \n\tpublic TradeAction tick(double price) {\n\t\tma10before=average(priceQ10);\n\t\t\n\t\tif (priceQ10.size()<10)\n\t\t{\n\t\t\tpriceQ10.offer(price);\n\t\t}\n\t\tif(priceQ10.size()==10)\n\t\t{\n\t\t\tpriceQ10.poll();\n\t\t\tpriceQ10.offer(price);\t\t\n\t\t}\n\t\t\n\t\t ma10after=average(priceQ10);\n\t\t \n\t\t// 60 days moving average\n\t\tma60before=average(priceQ60);\n\t\tif (priceQ60.size()<60)\n\t\t{\n\t\t\tpriceQ60.offer(price);\n\t\t}\n\t\tif(priceQ60.size()==60)\n\t\t{\n\t\t\tpriceQ60.poll();\n\t\t\tpriceQ60.offer(price);\t\t\n\t\t}\n\t\tma60after=average(priceQ60);\n\t\t\t\n\t\t//buy when its 10 day moving average goes above the 60 day moving average\n\t\tif((ma10before < ma60before) & (ma10after > ma60after))\n\t\t{\n\t\t\tprofit = profit - price;\n\t\t\t//System.out.println(\"buy\");\n\t\t\t//System.out.println(\"profit is\");\n\t\t\t//System.out.println(profit);\n\t\t\tif(mark==1){\n\t\t\t\tmark=-1;\n\t\t\t\treturn TradeAction.BUY;\n\t\t\t}\n\t\t\telse \n\t\t\t\treturn TradeAction.DO_NOTHING;\n\t\t\t\n\t\t}\n\t\t//buy when its 10 day moving average goes below the 60 day moving average\n\t\tif((ma10before > ma60before) & (ma10after < ma60after))\n\t\t{\n\t\t\tprofit = profit + price;\n\t\t\t//System.out.println(\"sell\");\n\t\t\t//System.out.println(\"profit is\");\n\t\t\t//System.out.println(profit);\n\t\t\tif(mark==-1){\n\t\t\t\tmark=1;\n\t\t\t\treturn TradeAction.SELL;\n\t\t\t}\n\t\t\telse \n\t\t\t\treturn TradeAction.DO_NOTHING;\n\t\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn TradeAction.DO_NOTHING;\t\t\t\n\t\t}\n\n\t}", "public void sell() {\n for (Company x : _market.getCompanies()) {\n if (x.getRisk() > _confidence || x.numLeft() < 3 || x.getRisk() < _confidence - 15){\n if (_stocks.get(x) == 1) {\n _stocks.remove(x);\n } else {\n _stocks.put(x, _stocks.get(x) - 1);\n }\n _money += x.getPrice();\n x.gain();\n break;\n } else {\n _happy = true;\n }\n }\n }", "private BigDecimal getStock(Producto producto, Bodega bodega, Date fechaDesde, Date fechaHasta)\r\n/* 48: */ {\r\n/* 49:74 */ BigDecimal stock = BigDecimal.ZERO;\r\n/* 50:75 */ for (InventarioProducto inventarioProducto : this.servicioInventarioProducto.obtenerMovimientos(producto.getIdOrganizacion(), producto, bodega, fechaDesde, fechaHasta)) {\r\n/* 51:77 */ if (inventarioProducto.getOperacion() == 1) {\r\n/* 52:78 */ stock = stock.add(inventarioProducto.getCantidad());\r\n/* 53:79 */ } else if (inventarioProducto.getOperacion() == -1) {\r\n/* 54:80 */ stock = stock.subtract(inventarioProducto.getCantidad());\r\n/* 55: */ }\r\n/* 56: */ }\r\n/* 57:83 */ return stock;\r\n/* 58: */ }", "static Stock getStock(String symbol) { \n\t\tString sym = symbol.toUpperCase();\n\t\tdouble price = 0.0;\n\t\tint volume = 0;\n\t\tdouble pe = 0.0;\n\t\tdouble eps = 0.0;\n\t\tdouble week52low = 0.0;\n\t\tdouble week52high = 0.0;\n\t\tdouble daylow = 0.0;\n\t\tdouble dayhigh = 0.0;\n\t\tdouble movingav50day = 0.0;\n\t\tdouble marketcap = 0.0;\n\t\n\t\ttry { \n\t\t\t\n\t\t\t// Retrieve CSV File\n\t\t\tURL yahoo = new URL(\"http://finance.yahoo.com/d/quotes.csv?s=\"+ symbol + \"&f=l1vr2ejkghm3j3\");\n\t\t\tURLConnection connection = yahoo.openConnection(); \n\t\t\tInputStreamReader is = new InputStreamReader(connection.getInputStream());\n\t\t\tBufferedReader br = new BufferedReader(is); \n\t\t\t\n\t\t\t// Parse CSV Into Array\n\t\t\tString line = br.readLine(); \n\t\t\tString[] stockinfo = line.split(\",\"); \n\t\t\t\n\t\t\t// Check Our Data\n\t\t\tif (Pattern.matches(\"N/A\", stockinfo[0])) { \n\t\t\t\tprice = 0.00; \n\t\t\t} else { \n\t\t\t\tprice = Double.parseDouble(stockinfo[0]); \n\t\t\t} \n\t\t\t\n\t\t\tif (Pattern.matches(\"N/A\", stockinfo[1])) { \n\t\t\t\tvolume = 0; \n\t\t\t} else { \n\t\t\t\tvolume = Integer.parseInt(stockinfo[1]); \n\t\t\t} \n\t \n\t\t\tif (Pattern.matches(\"N/A\", stockinfo[2])) { \n\t\t\t\tpe = 0; \n\t\t\t} else { \n\t\t\t\tpe = Double.parseDouble(stockinfo[2]); \n\t\t\t}\n \n\t\t\tif (Pattern.matches(\"N/A\", stockinfo[3])) { \n\t\t\t\teps = 0; \n\t\t\t} else { \n\t\t\t\teps = Double.parseDouble(stockinfo[3]); \n\t\t\t}\n\t\t\t \n\t\t\tif (Pattern.matches(\"N/A\", stockinfo[4])) { \n\t\t\t\tweek52low = 0; \n\t\t\t} else { \n\t\t\t\tweek52low = Double.parseDouble(stockinfo[4]); \n\t\t\t}\n\t\t\t \n\t\t\tif (Pattern.matches(\"N/A\", stockinfo[5])) { \n\t\t\t\tweek52high = 0; \n\t\t\t} else { \n\t\t\t\tweek52high = Double.parseDouble(stockinfo[5]); \n\t\t\t} \n\t\t\t\n\t\t\tif (Pattern.matches(\"N/A\", stockinfo[6])) { \n\t\t\t\tdaylow = 0; \n\t\t\t} else { \n\t\t\t\tdaylow = Double.parseDouble(stockinfo[6]); \n\t\t\t}\n\t\t\t\t \n\t\t\tif (Pattern.matches(\"N/A\", stockinfo[7])) { \n\t\t\t\tdayhigh = 0; \n\t\t\t} else { \n\t\t\t\tdayhigh = Double.parseDouble(stockinfo[7]); \n\t\t\t} \n\t\t\t\n\t\t\tif (Pattern.matches(\"N/A - N/A\", stockinfo[8])) { \n\t\t\t\tmovingav50day = 0; \n\t\t\t} else { \n\t\t\t\tmovingav50day = Double.parseDouble(stockinfo[8]); \n\t\t\t}\n\t\t\t\t \n\t\t\tif (Pattern.matches(\"N/A\", stockinfo[9])) { \n\t\t\t\tmarketcap = 0; \n\t\t\t} else { \n\t\t\t\tmarketcap = Double.parseDouble(stockinfo[9]); \n\t\t\t} \n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\tLogger log = Logger.getLogger(StockHelper.class.getName()); \n\t\t\tlog.log(Level.SEVERE, e.toString(), e);\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\treturn new Stock(sym, price, volume, pe, eps, week52low, week52high, daylow, dayhigh, movingav50day, marketcap);\n\t\t\n\t}", "@Override\n\tpublic int getBuyQty(Stock2 s, ICashAccount ac) {\n double useableMny = 0;\n int buyMnt = 0;\n int maxMnt = 0;\n \n Map<String, StockBuySellEntry> lstTrades = TradeStrategyImp.getLstTradeForStocks();\n StockBuySellEntry sbs = lstTrades.get(s.getID());\n\t if (sbs != null && !sbs.is_buy_point)\n\t {\n\t \tbuyMnt = sbs.quantity;\n\t \tlog.info(\"stock:\" + s.getID() + \" with qty:\" + sbs.quantity + \" already, buy same back\");\n\t }\n\t else if (ac != null) {\n useableMny = ac.getMaxMnyForTrade();\n maxMnt = (int)(useableMny/s.getCur_pri()) / 100 * 100;\n \n \tbuyMnt = maxMnt;\n log.info(\"getBuyQty, useableMny:\" + useableMny + \" buyMnt:\" + buyMnt + \" maxMnt:\" + maxMnt);\n }\n\t\treturn buyMnt;\n\t}", "public void update() \n\t{\n\t\tString inst = \"\";\n\t\tfloat cash = getCash();\n\t\tfloat quantity = getPosition(inst);\n\t\tfloat price = getPrice(inst);\n\n\t\t_data.add(new Float(price));\n\t\t\n\t\tif (_data.size() > _period)\n\t\t{\n\t\t\t_data.remove(0);\n\t\t\n\t\t\tfloat min = Float.MAX_VALUE;\n\t\t\tfloat max = Float.MIN_VALUE;\n\t\t\t\n\t\t\tfor (int i = 0; i < _data.size(); i++)\n\t\t\t{\n\t\t\t\tFloat value = (Float)_data.get(i);\n\t\t\t\t\n\t\t\t\tif (value.floatValue() > max)\n\t\t\t\t{\n\t\t\t\t\tmax = value.floatValue();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (value.floatValue() < min)\n\t\t\t\t{\n\t\t\t\t\tmin = value.floatValue();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfloat buylevel = min + (min * _minwin);\n\t\t\tfloat sellevel = max - (max * _maxloss);\n\t\t\tfloat sellevel2 = min + (min * _maxwin);\n\t\t\t\n\t\t\t// if price has risen by min win\n\t\t\t// but is below maximum win and\n\t\t\t// below maximum loss then buy\n\t\t\tif (price > buylevel && \n\t\t\t\t\tprice < sellevel2 &&\n\t\t\t\t\tbuylevel < sellevel &&\n\t\t\t\t\tprice > _previous)\n\t\t\t{\n\t\t\t\tif (cash > 0) \n\t\t\t\t{\n\t\t\t\t\taddAmountOrder(inst, cash);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (price < sellevel &&\n\t\t\t\t\tbuylevel > sellevel &&\n\t\t\t\t\tprice < _previous)\n\t\t\t{\n\t\t\t\tif (quantity > 0)\n\t\t\t\t{\n\t\t\t\t\taddQuantityOrder(inst, -quantity);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (price > sellevel2 &&\n\t\t\t\t\tprice > _previous)\n\t\t\t{\n\t\t\t\tif (quantity > 0)\n\t\t\t\t{\n\t\t\t\t\taddQuantityOrder(inst, -quantity);\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t_data.remove(0);\n\t\t}\n\t\t\n\t\t_previous = price;\n\t}", "int getSellCurrent();", "int getSellQuantity();", "int getBuyCurrent();", "private void buy() {\n if (asset >= S_I.getPirce()) {\n Item item = S_I.buy();\n asset -= item.getPrice();\n S_I.setAsset(asset);\n } else {\n System.out.println(\"cannot afford\");\n }\n }", "private void analyzeStocks(JSONArray stockArray){\n\t\tbuyArray = new JSONArray();\n\t\tsellArray = new JSONArray();\n\n\t\tfor(int a = 0; a < stockArray.length(); a++){\n\n\t\t\t// Some objects dont always have correct values\n\t\t\tif (!stockArray.getJSONObject(a).isNull(\"DividendYield\") \n\t\t\t\t\t&& !stockArray.getJSONObject(a).isNull(\"FiftydayMovingAverage\")\n\t\t\t\t\t&& !stockArray.getJSONObject(a).isNull(\"Bid\")\n\t\t\t\t\t&& !stockArray.getJSONObject(a).isNull(\"PERatio\")){\n\n\n\n\t\t\t\tdouble fiftyDayAvg = stockArray.getJSONObject(a).getDouble(\"FiftydayMovingAverage\");\n\t\t\t\tdouble bid = stockArray.getJSONObject(a).getDouble(\"Bid\");\n\t\t\t\tdouble divYield = stockArray.getJSONObject(a).getDouble(\"DividendYield\");\n\t\t\t\tdouble peRatio = stockArray.getJSONObject(a).getDouble(\"PERatio\");\n\n\t\t\t\t//Parse Market Cap - form: 205B (int)+(string)\n\t\t\t\tString marketCap = stockArray.getJSONObject(a).getString(\"MarketCapitalization\");\n\t\t\t\tString marketCapSuf = marketCap.substring(marketCap.length()-1);\n\t\t\t\tdouble marketCapAmt = Double.parseDouble(marketCap.substring(0, marketCap.length()-1));\n\t\t\t\tmarketCapAmt = marketCapAmt*suffixes.get(marketCapSuf);\n\n\t\t\t\t//Large checks\n\t\t\t\tif(marketCapAmt >= (10*suffixes.get(\"B\"))){\n\t\t\t\t\tif((bid < fiftyDayAvg*largefiftyWeekPercBuy)\t\t\t//Buy\n\t\t\t\t\t\t\t&& (divYield > largeYield) \n\t\t\t\t\t\t\t&& (peRatio < largePEBuy)){\n\n\t\t\t\t\t\tbuyArray.put(stockArray.getJSONObject(a));\n\t\t\t\t\t}\n\t\t\t\t\telse if((bid > fiftyDayAvg*largefiftyWeekPercSell)\t\t//Sell\n\t\t\t\t\t\t\t&& (peRatio > largePESell)){\n\n\t\t\t\t\t\tsellArray.put(stockArray.getJSONObject(a));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//Medium checks\n\t\t\t\telse if(marketCapAmt >= (2*suffixes.get(\"B\"))){\t\n\t\t\t\t\tif((bid < fiftyDayAvg*medfiftyWeekPercBuy)\t\t\t\t//Buy\n\t\t\t\t\t\t\t&& (divYield > medYield) \n\t\t\t\t\t\t\t&& (peRatio < medPEBuy)){\n\n\t\t\t\t\t\tbuyArray.put(stockArray.getJSONObject(a));\n\t\t\t\t\t}\n\t\t\t\t\telse if((bid > fiftyDayAvg*medfiftyWeekPercSell)\t\t//Sell\n\t\t\t\t\t\t\t&& (peRatio > medPESell)){\n\n\t\t\t\t\t\tsellArray.put(stockArray.getJSONObject(a));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Small\tchecks\n\t\t\t\telse if(marketCapAmt >= (300*suffixes.get(\"M\"))){\t\t\t\t\n\t\t\t\t\tif((bid < fiftyDayAvg*smfiftyWeekPercBuy)\t\t\t\t//Buy\n\t\t\t\t\t\t\t&& (divYield > smYield) \n\t\t\t\t\t\t\t&& (peRatio < smPEBuy)){\n\n\t\t\t\t\t\tbuyArray.put(stockArray.getJSONObject(a));\n\t\t\t\t\t}\n\t\t\t\t\telse if((bid > fiftyDayAvg*smfiftyWeekPercSell)\t\t\t//Sell\n\t\t\t\t\t\t\t&& (peRatio > smPESell)){\n\n\t\t\t\t\t\tsellArray.put(stockArray.getJSONObject(a));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Test\n\t\tpublic void testGetBestBid()\n\t\t{\n\t\t\tassertEquals(\"Best bid incorrect\", buyOrder2, exchange.getBestBid(stock));\n\t\t\t\n\t\t}", "int getBuyQuantity();", "public HashMap<String, ArrayList[]> determineSale() {\n HashMap<String, ArrayList[]> ordersMap = new HashMap<>();\n ordersMap.put(\"ms\", new ArrayList<Integer>[2]);\n ordersMap.put(\"gs\", new ArrayList<Integer>[2]);\n ordersMap.put(\"xlf\", new ArrayList<Integer>[2]);\n ordersMap.put(\"wfc\", new ArrayList<Integer>[2]);\n ordersMap.put(\"bond\", new ArrayList<Integer>[2]);\n\n Integer temp;\n int ind = 0;\n ArrayList<Integer> prices = ordersMap.get(\"bond\")[0];\n ArrayList<Integer> quantities = ordersMap.get(\"bond\")[1];\n for (int i = 0; i < 3; i++) {\n temp = bondsBuy.poll();\n if (prices.get(ind).equals(temp)) {\n quantities.set(ind, quantities.get(ind) + 1);\n } else {\n prices.add(temp);\n quantities.add(1);\n ind++;\n }\n }\n ind = 0;\n prices = ordersMap.get(\"gs\")[0];\n quantities = ordersMap.get(\"gs\")[1];\n for (int i = 0; i < 2; i++) {\n temp = bondsBuy.poll();\n if (prices.get(ind).equals(temp)) {\n quantities.set(ind, quantities.get(ind) + 1);\n } else {\n prices.add(temp);\n quantities.add(1);\n ind++;\n }\n } \n ind = 0;\n prices = ordersMap.get(\"ms\")[0];\n quantities = ordersMap.get(\"ms\")[1]; \n for (int i = 0; i < 3; i++) {\n temp = bondsBuy.poll();\n if (prices.get(ind).equals(temp)) {\n quantities.set(ind, quantities.get(ind) + 1);\n } else {\n prices.add(temp);\n quantities.add(1);\n ind++;\n }\n }\n ind = 0;\n prices = ordersMap.get(\"wfc\")[0];\n quantities = ordersMap.get(\"wfc\")[1]; \n for (int i = 0; i < 2; i++) {\n temp = bondsBuy.poll();\n if (prices.get(ind).equals(temp)) {\n quantities.set(ind, quantities.get(ind) + 1);;\n } else {\n prices.add(temp);\n quantities.add(1);\n ind++;\n }\n }\n ind = 0;\n prices = ordersMap.get(\"xlf\")[0];\n quantities = ordersMap.get(\"xlf\")[1]; \n for (int i = 0; i < 10; i++) {\n temp = bondsBuy.poll();\n if (prices.get(ind).equals(temp)) {\n quantities.set(ind, quantities.get(ind) + 1);\n } else {\n prices.add(temp);\n quantities.add(1);\n ind++;\n }\n }\n return ordersMap;\n }", "private void trade_shortsell() {\n\t\ttext_code.setText(code);\n\t\t\n\t\tDecimalFormat df=new DecimalFormat(\"#.00\");\n\t\ttext_uprice.setText(df.format(Double.parseDouble(information[2])*1.1) );//涨停价\n\t\t\n\t\ttext_downprice.setText(df.format(Double.parseDouble(information[2])*0.9));//跌停价\n\t\t\n\t\t//getfundown().setText(homepage.get_table_userinfo().getItem(1).getText(1));//可用资金\n\t\t\n\t\t//double d1 = Double.parseDouble(homepage.get_table_userinfo().getItem(1).getText(1));\n\t\t//double d2 = Double.parseDouble(information[3]);\n\t\t//text_limitnum.setText(Integer.toString( (int)(d1/d2) ) );//可卖数量\n\t\t\n\n\t}", "void buyStock(String portfolio, String stock, Integer count, Date date)\r\n throws IllegalArgumentException;", "public interface IStockOperations<T extends Stock> {\n\n /**\n * Exercise a. i.\n * \n * @param stock\n * the stock being evaluated\n * @param marketPrice\n * the established market price\n * \n * @return the stock dividend yield\n */\n public double calculateDividendYield(T stock, double marketPrice);\n\n /**\n * Exercise a. ii.\n * \n * @param stock\n * the stock being evaluated\n * @param marketPrice\n * the established market price\n * \n * @return the stock Price/Earnings ratio\n */\n public double calculatePeRatio(T stock, double marketPrice);\n\n /**\n * Exercise a. iii.\n * \n * @param stock\n * the stock being transacted\n * @param nShares\n * number of shares traded\n * @param tradeIndicator\n * indication if it's a sell or buy trade\n * @param tradePrice\n * the trade price\n * \n * @return a stock trade record object\n */\n public StockTrade recordTrade(T stock, int nShares, TradeIndicator tradeIndicator, double tradePrice);\n\n /**\n * Exercise a. iv.\n * \n * @param gbceStock\n * @param timeSpanInMinutes\n * calculate trades for the past n minutes\n * \n * @return the stocks volume weighted stock price\n */\n public double calculateVolumeWeightedStockPrice(T stock, int timeSpanInMinutes);\n\n /**\n * Exercise b.\n * \n * @param allStocks\n * The list of all available stocks\n * @return GBCE Price share index\n */\n public double calculateGBCEAllShareIndex(List<T> allStocks);\n}", "private static int buyLowSellHigh(int[] prices) {\n int minPrice = Integer.MAX_VALUE;\n int maxProfit = Integer.MIN_VALUE;\n\n for (int v : prices) {\n if (minPrice == Integer.MAX_VALUE) {\n // update min price for the first time\n minPrice = v;\n } else if (v > minPrice) {\n // calculate profit since the stock price is > minPrice\n int profit = v - minPrice;\n maxProfit = Math.max(maxProfit, profit);\n } else {\n // either v is equal to or smaller than minPrice, then update it\n minPrice = v;\n }\n }\n System.out.printf(\"minPrice: %d\\n\", minPrice);\n return maxProfit;\n }", "long getQuantite();", "private void botTrading(){\n if(game.isCardPositive(game.getHighestSharePriceStock())){\n int numShares = player.getFunds()/(game.getHighestSharePriceStock().getSharePrice()+3);\n player.getShares().set(game.getIndex(game.getHighestSharePriceStock()), player.getShares().get(game.getIndex(game.getHighestSharePriceStock())) + numShares);\n player.setFunds(-numShares*(game.getHighestSharePriceStock().getSharePrice()+3));\n }\n }", "public int calcMarketPrice() {\r\n player = Context.getInstance().getPlayer();\r\n //Random r = new Random();\r\n int techLevel = player.getCurrentPlanet().getTechLevel();\r\n Event event = player.getCurrentPlanet().getEvent();\r\n Resource resource = player.getCurrentPlanet().getResource();\r\n double price = basePrice;\r\n price += (ipl * (techLevel - mtlb)) + variance;\r\n if (player.getCurrentPlanet().getTechLevel() == this.ttp) {\r\n price *= Context.TECH_PRICE_MULT;\r\n }\r\n if (event.equals(this.ie)) {\r\n price *= event.getUpMult();\r\n } else if (event.equals(this.de)) {\r\n price *= event.getDownMult();\r\n }\r\n if (resource.equals(this.cr)) {\r\n price *= resource.getDownMult();\r\n } else if (resource.equals(this.er)) {\r\n price *= resource.getUpMult();\r\n }\r\n price *= (((double) player.getTrader() / DFIFTY) + 1.0);\r\n int finalPrice = (int) price;\r\n if (player.getTrader() > 0) {\r\n double discountedPrice = price;\r\n double trader = (double) player.getTrader();\r\n discountedPrice -= (price) * (4.0 * trader / PERCENT);\r\n return (int) discountedPrice;\r\n } else {\r\n return finalPrice;\r\n }\r\n }", "@Test\n public void notSell() {\n Game game = Game.getInstance();\n Player player = new Player(\"ED\", 4, 4, 4,\n 4, SolarSystems.GHAVI);\n game.setPlayer(player);\n game.getPlayer().getShip().getShipCargo().add(new CargoItem(2, Goods.Water));\n game.getPlayer().getShip().getShipCargo().add(new CargoItem(1, Goods.Food));\n game.getPlayer().getShip().getShipCargo().add(new CargoItem(0, Goods.Furs));\n CargoItem good = game.getPlayer().getShip().getShipCargo().get(2);\n \n int oldCredits = game.getPlayer().getCredits();\n good.getGood().sell(good.getGood(), 1);\n \n CargoItem water = game.getPlayer().getShip().getShipCargo().get(0);\n CargoItem food = game.getPlayer().getShip().getShipCargo().get(1);\n water.setQuantity(2);\n food.setQuantity(1);\n good.setQuantity(0);\n //int P = good.getGood().getPrice(1);\n int curr = game.getPlayer().getCredits();\n //boolean qn = water.getQuantity() == 2 && food.getQuantity() == 1 && good.getQuantity() == 0;\n boolean check = water.getQuantity() == 2;\n System.out.print(curr);\n assertEquals(curr, oldCredits);\n }", "public void ExecuteSellOrder() throws SQLException, InvalidOrderException, InvalidAssetException, NegativePriceException, UnitException {\n // Current asset instance\n Asset currentAsset = Asset.findAsset(this.assetID);\n\n // Check if just ordered asset has corresponding order\n\n // Find buy orders of same asset\n Statement smt = connection.createStatement();\n String sqlFindOrder\n = \"SELECT * FROM orders WHERE assetID = '\" + assetID + \"' and orderType = 'BUY' \" +\n \"and orderStatus = 'INCOMPLETE' and unitID != '\" + this.unitID + \"' \" +\n \"ORDER BY orderTime;\";\n ResultSet buyOrders = smt.executeQuery(sqlFindOrder);\n\n // List to store corresponding buy orders of the same asset\n ArrayList<Order> matchingOrders = new ArrayList<>();\n\n // Add queried rows as new Buy Orders in list\n while (buyOrders.next()) {\n matchingOrders.add(\n new BuyOrder(\n buyOrders.getString(\"orderID\"),\n buyOrders.getString(\"userID\"),\n buyOrders.getString(\"unitID\"),\n buyOrders.getString(\"assetID\"),\n buyOrders.getString(\"orderTime\").substring(0,19),\n OrderStatus.valueOf(buyOrders.getString(\"orderStatus\")),\n OrderType.valueOf(buyOrders.getString(\"orderType\")),\n buyOrders.getDouble(\"orderPrice\"),\n buyOrders.getInt(\"orderQuantity\"),\n buyOrders.getInt(\"quantFilled\"),\n buyOrders.getInt(\"quantRemain\")\n )\n );\n }\n\n // Remove orders if the buy bid is less than the sell ask\n matchingOrders.removeIf(buys -> (buys.orderPrice < this.orderPrice));\n\n // List to store required orders that can fully/partially or completely not fill order\n ArrayList<Order> requiredOrders = new ArrayList<>();\n\n // Required asset amount to facilitate quantity of this order\n int requiredQuant = this.quantRemain;\n\n // Loop through orders matching conditions and append as many orders possible to\n // fully/partially facilitate this order\n for (int i = 0; i < matchingOrders.size(); i++) {\n // Stores quantity of current order in matchingOrders list\n int quantity = matchingOrders.get(i).quantRemain;\n if (requiredQuant > 0) {\n requiredOrders.add(matchingOrders.get(i));\n requiredQuant -= quantity;\n } else if (requiredQuant <= 0) {\n break;\n }\n }\n\n // If requiredOrders is filled it can either\n // - Have enough buy orders to fully facilitate the sell order\n // * Complete sell order (set COMPLETE flag, 0 quant remain, max quant fill)\n // * Update buyer and seller inventory numbers\n // * Change buy order (INCOMPLETE, quantFilled, quantRemain)\n // - Have enough buy orders to partially fill the sell order\n // * Complete the corresponding buy order/s (set COMPLETE flag, 0 quant remain, max quant fill)\n // * Change sell order (INCOMPLETE, change quant remain, change quant filled)\n // * Add inventory entry and update corresponding inventory numbers\n\n for (int i = 0; i < requiredOrders.size(); i++) {\n // How much this order has remaining to fill\n int sellQuant = this.quantRemain;\n // How much can this corresponding order faciliate of this order\n int buyQuant = requiredOrders.get(i).quantRemain;\n\n // Track executed quantity\n int executed = 0;\n\n if (buyQuant > sellQuant) {\n // When this order has more than the quantity required to fill remaining units\n\n // Stores how many more units the buy order has over this sell order\n this.quantFilled += sellQuant;\n this.quantRemain -= sellQuant;\n\n // Deduct the amount remaining of the sell order from the quantity remaining in the buy order\n requiredOrders.get(i).quantRemain -= sellQuant;\n requiredOrders.get(i).quantFilled += sellQuant;\n executed = sellQuant;\n\n // Change quantities in database\n ChangeQuantRemainFilled(this.quantRemain, this.quantFilled);\n requiredOrders.get(i).ChangeQuantRemainFilled(requiredOrders.get(i).quantRemain, requiredOrders.get(i).quantFilled);\n\n // Set complete status of this order\n this.ChangeStatus(OrderStatus.COMPLETE);\n\n } else if (buyQuant == sellQuant) {\n // When this order has exactly the same amount required to fill remaining units\n\n // Stores how many more units the buy order has over this sell order\n this.quantFilled += sellQuant;\n this.quantRemain -= sellQuant;\n\n // Deduct the amount remaining of the sell order from the quantity remaining in the buy order\n requiredOrders.get(i).quantRemain -= sellQuant;\n requiredOrders.get(i).quantFilled += sellQuant;\n executed = sellQuant;\n\n assert requiredOrders.get(i).quantRemain == 0;\n assert requiredOrders.get(i).quantFilled == requiredOrders.get(i).orderQuant;\n\n // Change quantities in database\n this.ChangeQuantRemainFilled(this.quantRemain, this.quantFilled);\n requiredOrders.get(i).ChangeQuantRemainFilled(requiredOrders.get(i).quantRemain, requiredOrders.get(i).quantFilled);\n\n // Set complete status of this order\n this.ChangeStatus(OrderStatus.COMPLETE);\n requiredOrders.get(i).ChangeStatus(OrderStatus.COMPLETE);\n\n } else {\n // When this order has less than required amount to fill remaining units\n\n // Stores how many more units the buy order has over this sell order\n this.quantFilled += requiredOrders.get(i).quantRemain;\n this.quantRemain -= requiredOrders.get(i).quantRemain;\n\n assert this.quantRemain + this.quantFilled == this.orderQuant;\n\n // Deduct the amount remaining of the sell order from the quantity remaining in the buy order\n requiredOrders.get(i).quantRemain -= buyQuant;\n requiredOrders.get(i).quantFilled += buyQuant;\n executed = buyQuant;\n\n assert requiredOrders.get(i).quantRemain == 0;\n assert requiredOrders.get(i).quantFilled == requiredOrders.get(i).orderQuant;\n\n // Change quantities in database\n ChangeQuantRemainFilled(this.quantRemain, this.quantFilled);\n requiredOrders.get(i).ChangeQuantRemainFilled(requiredOrders.get(i).quantRemain, requiredOrders.get(i).quantFilled);\n\n // Set complete status of this order\n ChangeStatus(OrderStatus.INCOMPLETE);\n requiredOrders.get(i).ChangeStatus(OrderStatus.COMPLETE);\n\n }\n\n // Change asset price\n currentAsset.SetPrice(requiredOrders.get(i).orderPrice);\n\n // Change inventory amounts\n new InventoryItem(this.unitID, this.assetID, requiredOrders.get(i).orderPrice, -executed, this.orderID);\n new InventoryItem(requiredOrders.get(i).unitID, requiredOrders.get(i).assetID, requiredOrders.get(i).orderPrice, executed, requiredOrders.get(i).orderID);\n\n // Set credit balance of units\n Unit sellerUnit = Unit.getUnit(this.unitID);\n sellerUnit.ChangeUnitBalance(this.unitID, requiredOrders.get(i).orderPrice * executed);\n Unit buyerUnit = Unit.getUnit(requiredOrders.get(i).unitID);\n buyerUnit.ChangeUnitBalance(requiredOrders.get(i).unitID, -requiredOrders.get(i).orderPrice * executed);\n }\n\n // If requiredOrders is empty, no current buy orders are able to facilitate sell order\n\n // Modify watchlist balances\n\n }", "public TransactionResponse sell() {\r\n \t\ttry {\r\n \t\t\tTransactionResponse response = new TransactionResponse(hp);\r\n \t\t\tCalculation calc = hc.getCalculation();\r\n \t\t\tAccount acc = hc.getAccount();\r\n \t\t\tLanguageFile L = hc.getLanguageFile();\r\n \t\t\tLog log = hc.getLog();\r\n \t\t\tNotification not = hc.getNotify();\r\n \t\t\tInfoSignHandler isign = hc.getInfoSignHandler();\r\n \t\t\tString playerecon = hp.getEconomy();\r\n \t\t\tint id = hyperObject.getId();\r\n \t\t\tint data = hyperObject.getData();\r\n \t\t\tString name = hyperObject.getName();\r\n \t\t\tif (giveInventory == null) {\r\n \t\t\t\tgiveInventory = hp.getPlayer().getInventory();\r\n \t\t\t}\r\n \t\t\tif (amount > 0) {\r\n \t\t\t\tif (id >= 0) {\r\n \t\t\t\t\tint totalitems = im.countItems(id, data, giveInventory);\r\n \t\t\t\t\tif (totalitems < amount) {\r\n \t\t\t\t\t\tboolean sellRemaining = hc.getYaml().getConfig().getBoolean(\"config.sell-remaining-if-less-than-requested-amount\");\r\n \t\t\t\t\t\tif (sellRemaining) {\r\n \t\t\t\t\t\t\tamount = totalitems;\r\n \t\t\t\t\t\t} else {\t\r\n \t\t\t\t\t\t\tresponse.addFailed(L.f(L.get(\"YOU_DONT_HAVE_ENOUGH\"), name), hyperObject);\r\n \t\t\t\t\t\t\treturn response;\t\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t}\r\n \t\t\t\t\tif (amount > 0) {\r\n \t\t\t\t\t\tdouble price = hyperObject.getValue(amount, hp);\r\n \t\t\t\t\t\tBoolean toomuch = false;\r\n \t\t\t\t\t\tif (price == 3235624645000.7) {\r\n \t\t\t\t\t\t\ttoomuch = true;\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tif (!toomuch) {\r\n \t\t\t\t\t\t\tint maxi = hyperObject.getMaxInitial();\r\n \t\t\t\t\t\t\tboolean isstatic = false;\r\n \t\t\t\t\t\t\tboolean isinitial = false;\r\n \t\t\t\t\t\t\tisinitial = Boolean.parseBoolean(hyperObject.getInitiation());\r\n \t\t\t\t\t\t\tisstatic = Boolean.parseBoolean(hyperObject.getIsstatic());\r\n \t\t\t\t\t\t\tif ((amount > maxi) && !isstatic && isinitial) {\r\n \t\t\t\t\t\t\t\tamount = maxi;\r\n \t\t\t\t\t\t\t\tprice = hyperObject.getValue(amount, hp);\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\tboolean sunlimited = hc.getYaml().getConfig().getBoolean(\"config.shop-has-unlimited-money\");\r\n \t\t\t\t\t\t\tif (acc.checkshopBalance(price) || sunlimited) {\r\n \t\t\t\t\t\t\t\tif (maxi == 0) {\r\n \t\t\t\t\t\t\t\t\tprice = hyperObject.getValue(amount, hp);\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tim.removeItems(id, data, amount, giveInventory);\r\n \t\t\t\t\t\t\t\tdouble shopstock = 0;\r\n \t\t\t\t\t\t\t\tshopstock = hyperObject.getStock();\r\n \t\t\t\t\t\t\t\tif (!Boolean.parseBoolean(hyperObject.getIsstatic()) || !hc.getConfig().getBoolean(\"config.unlimited-stock-for-static-items\")) {\r\n \t\t\t\t\t\t\t\t\thyperObject.setStock(shopstock + amount);\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tint maxi2 = hyperObject.getMaxInitial();\r\n \t\t\t\t\t\t\t\tif (maxi2 == 0) {\r\n \t\t\t\t\t\t\t\t\thyperObject.setInitiation(\"false\");\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tdouble salestax = hp.getSalesTax(price);\r\n \t\t\t\t\t\t\t\tacc.deposit(price - salestax, hp.getPlayer());\r\n \t\t\t\t\t\t\t\tacc.withdrawShop(price - salestax);\r\n \t\t\t\t\t\t\t\tif (sunlimited) {\r\n \t\t\t\t\t\t\t\t\tString globalaccount = hc.getYaml().getConfig().getString(\"config.global-shop-account\");\r\n \t\t\t\t\t\t\t\t\tacc.setBalance(0, globalaccount);\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\t\r\n \t\t\t\t\t\t\t\tresponse.addSuccess(L.f(L.get(\"SELL_MESSAGE\"), amount, calc.twoDecimals(price), name, calc.twoDecimals(salestax)), price - salestax, hyperObject);\r\n \t\t\t\t\t\t\t\tresponse.setSuccessful();\r\n \t\t\t\t\t\t\t\tString type = \"dynamic\";\r\n \t\t\t\t\t\t\t\tif (Boolean.parseBoolean(hyperObject.getInitiation())) {\r\n \t\t\t\t\t\t\t\t\ttype = \"initial\";\r\n \t\t\t\t\t\t\t\t} else if (Boolean.parseBoolean(hyperObject.getIsstatic())) {\r\n \t\t\t\t\t\t\t\t\ttype = \"static\";\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tlog.writeSQLLog(hp.getName(), \"sale\", name, (double) amount, calc.twoDecimals(price - salestax), calc.twoDecimals(salestax), playerecon, type);\r\n \t\t\t\t\t\t\t\tisign.updateSigns();\r\n \t\t\t\t\t\t\t\tnot.setNotify(name, null, playerecon);\r\n \t\t\t\t\t\t\t\tnot.sendNotification();\r\n \t\t\t\t\t\t\t\treturn response;\r\n \t\t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\t\tresponse.addFailed(L.get(\"SHOP_NOT_ENOUGH_MONEY\"), hyperObject);\r\n \t\t\t\t\t\t\t\treturn response;\t\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\tresponse.addFailed(L.f(L.get(\"CURRENTLY_CANT_SELL_MORE_THAN\"), hyperObject.getStock(), name), hyperObject);\r\n \t\t\t\t\t\t\treturn response;\t\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\tresponse.addFailed(L.f(L.get(\"YOU_DONT_HAVE_ENOUGH\"), name), hyperObject);\r\n \t\t\t\t\t\treturn response;\t\r\n \t\t\t\t\t}\r\n \t\t\t\t} else {\r\n \t\t\t\t\tresponse.addFailed(L.f(L.get(\"CANNOT_BE_SOLD_WITH\"), name), hyperObject);\r\n \t\t\t\t\treturn response;\t\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\tresponse.addFailed(L.f(L.get(\"CANT_SELL_LESS_THAN_ONE\"), name), hyperObject);\r\n \t\t\t\treturn response;\t\r\n \t\t\t}\r\n \t\t} catch (Exception e) {\r\n \t\t\tString info = \"Transaction sell() passed values name='\" + hyperObject.getName() + \"', player='\" + hp.getName() + \"', id='\" + hyperObject.getId() + \"', data='\" + hyperObject.getData() + \"', amount='\" + amount + \"'\";\r\n \t\t\tnew HyperError(e, info);\r\n \t\t\treturn new TransactionResponse(hp);\r\n \t\t}\r\n \t}", "@Test\n public void testBuyTwoGetOneFree_1() throws Exception {\n Product apple = new Product(\n \"Apple\",\n \"SKU-0003\",\n ToMoney.from(\n Composite.function(Multiply.by(40),\n BinaryFunctionUnaryFunction.adapt(new UnaryCompositeBinaryFunction<Number, Number, Number>(Subtract.instance(),\n new Identity<Number>(),\n Divide.by(3))))));\n\n assertEquals(new Money(0*40),apple.getPrice(0));\n assertEquals(new Money(1*40),apple.getPrice(1));\n assertEquals(new Money(2*40),apple.getPrice(2));\n assertEquals(new Money(2*40),apple.getPrice(3));\n assertEquals(new Money(3*40),apple.getPrice(4));\n assertEquals(new Money(4*40),apple.getPrice(5));\n assertEquals(new Money(4*40),apple.getPrice(6));\n assertEquals(new Money(5*40),apple.getPrice(7));\n assertEquals(new Money(6*40),apple.getPrice(8));\n assertEquals(new Money(6*40),apple.getPrice(9));\n assertEquals(new Money(7*40),apple.getPrice(10));\n }", "private void botBuy(Stock stock, int numShares){\n player.getShares().set(game.getIndex(stock), player.getShares().get(game.getIndex(stock)) + numShares);\n player.setFunds(-numShares*(stock.getSharePrice()+3));\n System.out.println(\"purchase made\"); //rem\n }", "public static void main(String[] args) throws InterruptedException {\n Item item1 = new Item(\"Coca-cola\", 200);\n System.out.println(\"Price before discount: \" + item1.getPrice());\n System.out.println(\"Price after discount: \" + item1.calculateDiscount()); //should be same price, 200, there's no doscount for this type\n\n ItemWithDiscount item2 = new ItemWithDiscount(\"Coca-cola Zero\", 2.0);\n System.out.println(\"\\nPrice before discount: \" + item2.getPrice());\n item2.setDiscount(10);\n System.out.println(\"Price after discount: \" + item2.calculateDiscount()); // 2 - 0.2 = 1.8\n\n\n //CHECK BUY PAY DISCOUNT\n BuyMorePayLess item04 = new BuyMorePayLess(\"Milk\", 10);\n BuyMorePayLess item05 = new BuyMorePayLess(\"Milk\", 10);\n BuyMorePayLess item06 = new BuyMorePayLess(\"Milk\", 1);\n item04.setBuyPayOffer(3,2);\n item04.calculateDiscount();\n\n //Check TakeItAll discount\n ItemTakeItAll item07 = new ItemTakeItAll(\"Tuna\",5.00);\n ItemTakeItAll item08 = new ItemTakeItAll(\"Tuna\",5.00);\n\n// item07.setDiscount(10);\n item07.setMinimumNumber(1);\n System.out.println(\"##################\" + item07.calculateDiscount());\n\n // USERS\n LoyalCustomer customer01 = new LoyalCustomer(\"Giorgi Tsipuria\", \"giobaski\", \"123\",\n \"Gonsiori 33\",\"55945239\");\n\n //B A S K E T S\n Basket basket01 = new Basket(\"Tartu 46\", \"Kairi\", customer01);\n basket01.insertItem(item1); //200 -> 200\n basket01.insertItem(item2); // 2.0 -> 1.8\n System.out.println(\"Total payment in basket: \" + basket01.caclulatePayment()); //201.8 + 201.8 * 0.1 = 221.98\n\n\n\n\n\n //1. Create Store\n Store store = new Store(\"Raua 16\");\n\n //2. sign into store\n Cashier currentCashier = store.cashierAuthentication();\n\n //3.\n Menu currentMenu = store.openMenu();\n\n //4. new basket\n currentMenu.openNewBasket(customer01);\n\n\n //5.Cashier starts adding items into new basket\n System.out.println(currentMenu.getBasket());\n currentMenu.getBasket().insertItem(item1);\n currentMenu.getBasket().insertItem(item2);\n\n\n System.out.println(\"######Basket By ID:\");\n currentMenu.printBasketInfoById(2);\n System.out.println(\"########\");\n\n\n //6. Calculate total price for the current basket\n currentMenu.getBasket().caclulatePayment();\n System.out.println(currentMenu.getBasket());\n System.out.println(\"currents items: \");\n System.out.println(currentMenu.getBasket().getItems());\n\n //7. Logout cashier\n Thread.sleep(10000);\n currentMenu.exit();\n\n\n // Additional features\n System.out.println(\"points of the loyal customer: \" + customer01.getPoints());\n\n System.out.println(\"Bonus for cashier: \" + currentCashier.calculateBonus() + \" Euros\");\n\n\n\n\n\n\n }", "private void checkSecondPriceAuctions() {\n\n // Get all auctions of according type.\n TypedQuery<Auction> auctionByTypeQuery = getAuctionByTypeQuery(AuctionType.SECOND_PRICE);\n List<Auction> secondPriceResultList = auctionByTypeQuery.getResultList();\n\n // Get current timestamp for comparison.\n DateTime now = new DateTime(DateTimeZone.forID(\"Europe/Berlin\"));\n Date nowDate = now.toDate();\n\n // Filter all auctions that have timed out.\n List<Auction> timeoutSecondPriceAuctions = secondPriceResultList\n .stream()\n .filter(auction -> nowDate.compareTo(auction.getEndTime()) == 1 && auction.isRunning()).collect(Collectors.toList());\n\n // Check if there are any auction that have timed out.\n if (timeoutSecondPriceAuctions.size() > 0) {\n\n for (Auction auction : timeoutSecondPriceAuctions) {\n\n // Stop auction and get its bidders.\n auction.setRunning(false);\n List<Bid> auctionBids = new ArrayList<>();\n List<Bidder> bidder = auction.getBidder();\n\n // Continue only if there are any bidders.\n if (bidder.size() > 0) {\n\n for (Bidder bidderElem : bidder) {\n auctionBids.addAll(bidderElem.getBids());\n }\n\n // Find winner only if registered bidders have bidden.\n if (auctionBids.size() > 0) {\n\n // Sort bids ascending according to their value.\n auctionBids.sort(new BidComperator());\n Bid winningBid = auctionBids.get(0);\n\n // If there is only one bid the bidder has to pay the price\n // originally entered by the article owner, which is basically the second highest\n // amount possible.\n BigDecimal priceToPay = null;\n if (auctionBids.size() == 1) {\n priceToPay = auction.getPrice();\n } else {\n // If there is more than one bid, the winner is still the bidder with\n // the highest bid, but the price he has to pay is the second highest bid.\n priceToPay = auctionBids.get(1).getAmount();\n }\n\n // Get user from Liferay to have access to user related data such as name and mail address.\n long winningUserId = winningBid.getBidder().getUserId();\n try {\n\n User userById = UserLocalServiceUtil.getUserById(winningUserId);\n AuctionResult auctionResult = new AuctionResult();\n auctionResult.setDescription(auction.getArticle().getShortDesc());\n auctionResult.setPrice(priceToPay);\n auctionResult.setFirstName(userById.getFirstName());\n auctionResult.setSurname(userById.getLastName());\n auctionResult.setMail(userById.getEmailAddress());\n auctionResult.setAuctionType(auction.getAuctionType());\n entityManager.persist(auctionResult);\n } catch (Exception e) {\n\n entityManager.getTransaction().rollback();\n }\n }\n }\n }\n }\n }", "public double getStockFinal(long pv) {\n float entree = 0 ;\n float sortie = 0 ;\n\n ArrayList<Produit> produits = null ;\n if (pv==0) produits = produitDAO.getAll();\n else produits = produitDAO.getAllByPv(pv) ;\n\n ArrayList<Mouvement> mouvements = null;\n\n double valeur = 0 ;\n double total = 0 ;\n double quantite = 0 ;\n double cmpu = 0 ;\n double restant = 0 ;\n double qsortie = 0 ;\n double qentree = 0 ;\n // Vente par produit\n Mouvement mouvement = null ;\n Operation operation = null ;\n\n for (int i = 0; i < produits.size(); i++) {\n try {\n mouvements = mouvementDAO.getManyByProductInterval(produits.get(i).getId_externe(),DAOBase.formatter2.parse(datedebut),DAOBase.formatter2.parse(datefin)) ;\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n if (mouvements != null){\n valeur = 0 ;\n quantite = 0 ;\n restant = 0 ;\n qentree = 0 ;\n cmpu = 0 ;\n qsortie = 0 ;\n\n for (int j = 0; j < mouvements.size(); j++) {\n mouvement = mouvements.get(j) ;\n operation = operationDAO.getOne(mouvement.getOperation_id()) ;\n if (operation==null || (operation.getAnnuler()==1 && operation.getDateannulation().before(new Date())) || operation.getTypeOperation_id().startsWith(OperationDAO.CMD)) continue;\n\n //if (pv!=0 && caisseDAO.getOne(operation.getCaisse_id()).getPointVente_id()!=pv) continue;\n if (j==0)\n if (mouvement.getRestant()==mouvement.getQuantite() && mouvement.getEntree()==0){\n restant = 0 ;\n }\n else restant = mouvement.getRestant() ;\n\n if (mouvement.getEntree()==0) {\n valeur -= mouvement.getPrixA() * mouvement.getQuantite() ;\n qentree += mouvement.getQuantite() ;\n cmpu = mouvement.getPrixA() ;\n }\n else {\n valeur += mouvement.getCmup() * mouvement.getQuantite() ;\n qsortie += mouvement.getQuantite() ;\n }\n /*\n if (restant!=0) cmpu = valeur / restant ;\n else cmpu = mouvement.getCmup() ;\n */\n }\n\n quantite = restant + qentree - qsortie ;\n total+=Math.abs(valeur) ;\n }\n }\n\n return total;\n }", "@Override\n public void buy(double limitPrice, int quantity) {\n Boolean allBought = false;\n Iterator iter1 = sellOrders.entrySet().iterator();\n while(iter1.hasNext()) {\n HashMap.Entry entry = (HashMap.Entry) iter1.next();\n if(limitPrice >= (Double)entry.getKey()) {\n if(quantity <= (Integer)entry.getValue()) {\n allBought = true;\n sellOrders.put((Double)entry.getKey(),(Integer)entry.getValue()-quantity) ;\n }\n else {\n quantity = quantity - (Integer)entry.getValue();\n sellOrders.put((Double)entry.getKey(),0);\n }\n }\n\n }\n if(!allBought) {\n\n if (buyOrders.containsKey(limitPrice))\n buyOrders.put(limitPrice, buyOrders.get(limitPrice) + quantity);\n else\n buyOrders.put(limitPrice, quantity);\n }\n cleanUp();\n\n }", "public void trade(CheeseConnoisseur c) {\n try {\n if (this.hold.getType() == null || c.hold.getType() == null) {\n CheeseConnoisseur n = this;\n } else if (this.hold.equals(c.hold)) {\n CheeseConnoisseur n = this;\n } else {\n CheeseConnoisseur higher = this.hold.getPrice() > c.hold.getPrice() ? this : c;\n CheeseConnoisseur lower = this.hold.getPrice() < c.hold.getPrice() ? this : c;\n double diff = higher.hold.getPrice() - lower.hold.getPrice();\n System.out.println(diff);\n if (this.hold.getPrice() > c.hold.getPrice() && c.money >= diff) {\n c.money -= diff;\n this.money += diff;\n this.hold.beTraded();\n c.hold.beTraded();\n Cheese tmp = this.hold;\n this.hold = c.hold;\n c.hold = tmp;\n } else if (this.hold.getPrice() < c.hold.getPrice() && this.money >= diff) {\n c.money += diff;\n this.money -= diff;\n this.hold.beTraded();\n c.hold.beTraded();\n Cheese tmp = this.hold;\n this.hold = c.hold;\n c.hold = tmp;\n } else {\n CheeseConnoisseur n = this;\n }\n }\n } catch (Exception e) {\n System.out.println(\"Fail to trade\");\n }\n\n }", "@SuppressWarnings(\"unused\")\r\n\tprivate int[] helper(int buyId, int[] price) {\r\n\t\tint maxProfit = 0;\r\n\t\tint sellDay = -1;\r\n\t\tfor (int i = buyId + 1; i < price.length; i++) {\r\n\t\t\tint currentProfit = price[i] - price[buyId];\r\n\t\t\tif (currentProfit >= 0 && currentProfit >= maxProfit) {\r\n\t\t\t\tmaxProfit = currentProfit;\r\n\t\t\t\tsellDay = i;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn new int[] { maxProfit, sellDay };\r\n\t}", "private void summarizeTimeslot ()\n {\n if (null == brokers) {\n // first time through\n brokers = new ArrayList<>();\n stats = new HashMap<>();\n\n data.print(\"Broker Name,\");\n data.print(\"Power Type,\");\n data.print(\"Customers,\");\n data.print(\"Usage (kWh),\");\n data.println(\"Income Gained\");\n\n // set up the maps of brokers, and stats by power type\n for (Broker broker : brokerRepo.findRetailBrokers())\n {\n brokers.add(broker);\n stats.put(broker, new HashMap<>());\n for (PowerType type : powerTypes)\n {\n StatsTracked theseStats = new StatsTracked();\n HashMap<PowerType, StatsTracked> map = stats.get(broker);\n map.put(type, theseStats);\n stats.put(broker, map);\n }\n }\n\n // store customer statistics\n\n }\n\n if (ttx.size() > 0) {\n // there are some signups and withdraws here\n for (TariffTransaction tx : ttx) {\n Broker broker = tx.getBroker();\n PowerType type = tx.getTariffSpec().getPowerType();\n HashMap<PowerType, StatsTracked> brokerMap = stats.get(broker);\n StatsTracked theseStats = brokerMap.get(type);\n if (tx.getTxType() == TariffTransaction.Type.CONSUME ||\n tx.getTxType() == TariffTransaction.Type.PRODUCE) {\n theseStats.updateUsage(tx.getKWh());\n theseStats.updateProfit(tx.getCharge());\n }\n else if (tx.getTxType() == TariffTransaction.Type.SIGNUP)\n theseStats.updateCustomers(tx.getCustomerCount());\n\n // reupdate the tracking...\n brokerMap.put(type, theseStats);\n stats.put(broker, brokerMap);\n }\n }\n ttx.clear();\n }", "@Test\n\t\tpublic void testGetBestOffer()\n\t\t{\t\t\t\n\t\t\tassertEquals(\"Best bid incorrect\", sellOrder1, exchange.getBestOffer(stock));\n\t\t}", "private void updateStocks(StockTransferTransactionRequest item) {\n\n Integer updatedQuantity = item.getQuantity();\n StockTraderServiceFactoryIF serviceFactory = new StockTraderServiceFactory();\n DematServiceIF dematService = serviceFactory.dematService();\n\n Optional<Integer> oldQuantity = dematService.getStockStatus(item.getUserName(),\n item.getStock());\n if(oldQuantity != null && oldQuantity.get() > 0) {\n updatedQuantity = oldQuantity.get() + item.getQuantity();\n }\n try(Connection conn = DriverManager.getConnection(Constants.DB_URL,\n Constants.USER,\n Constants.PASS);\n PreparedStatement stmt = conn.prepareStatement(\n Constants.MERGE_STOCK)) {\n stmt.setString(1, item.getUserName());\n stmt.setString(2, item.getStock().toString());\n stmt.setInt(3, updatedQuantity);\n stmt.execute();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n }", "public Order getSellOrder(int[] spotPrices, int[] futurePrices, int pos,\r\n long money, int restDay) {\r\n\r\n /* Information available for trading:\r\n spotPrices[]: Time series of spot prices. It provides 120 elements from spotPrices[0]\r\n to spotPrices[119]. The element spotPrices[119] is the latest.\r\n futurePrices[]: Time series of futures price. It provides 60 elements from futurePrices[0]\r\n to futurePrices[59]. The element futurePrices[59] is the latest.\r\n Before opening the market, same values with spot prices are given.\r\n If no contract is made in the market, value -1 is given.\r\n pos: Position of the agent. Positive is buying position. Negative is selling.\r\n money: Available cash. Note that type 'long' is used because of needed precision.\r\n restDay: Number of remaining transaction to the closing of the market. */\r\n\r\n Order order = new Order(); // Object to return values.\r\n\r\n order.buysell = Order.SELL;\r\n // Cancel decision if it may increase the position\r\n if (pos < -fMaxPosition) {\r\n order.buysell = Order.NONE;\r\n return order;\r\n }\r\n\r\n int latestFuturePrice = futurePrices[futurePrices.length - 1];\r\n if (latestFuturePrice < 0) {\r\n order.buysell = Order.NONE;\r\n return order;\r\n } // If previous price is invalid, it makes no order.\r\n\r\n order.price = (int) ( (double) latestFuturePrice * (1.0 + fSpreadRatio));\r\n\r\n order.quant = fMinQuant + fRandom.nextInt(fMaxQuant - fMinQuant + 1);\r\n\r\n // Message\r\n message(\"Sell\" + \", price = \" + order.price + \", volume = \" + order.quant +\r\n \" )\");\r\n\r\n return order;\r\n }", "private boolean ItemStockCalculation(String item) {\n\t\tboolean state = false;\n\t\tif (item.equals(\"F\")) {\n\t\t\tstate = getSetUpMachine().getFork_stock() > 0 ? true : false;\n\t\t\tif (state) {\n\t\t\t\tint mainStock = getSetUpMachine().getStock_size();\n\t\t\t\tgetSetUpMachine().setStock_size(mainStock - 1);\n\n\t\t\t\tint stock = getSetUpMachine().getFork_stock();\n\n\t\t\t\tgetSetUpMachine().setFork_stock(stock - 1);\n\n\t\t\t}\n\t\t} else if (item.equals(\"N\")) {\n\t\t\tstate = getSetUpMachine().getNapkin_stock() > 0 ? true : false;\n\t\t\tif (state) {\n\t\t\t\tint stock = getSetUpMachine().getNapkin_stock();\n\t\t\t\tint mainStock = getSetUpMachine().getStock_size();\n\t\t\t\tgetSetUpMachine().setStock_size(mainStock - 1);\n\t\t\t\tgetSetUpMachine().setNapkin_stock(stock - 1);\n\t\t\t}\n\t\t} else if (item.equals(\"S\")) {\n\t\t\tstate = getSetUpMachine().getSpoon_stock() > 0 ? true : false;\n\t\t\tif (state) {\n\t\t\t\tint stock = getSetUpMachine().getSpoon_stock();\n\t\t\t\tint mainStock = getSetUpMachine().getStock_size();\n\t\t\t\tgetSetUpMachine().setStock_size(mainStock - 1);\n\t\t\t\tgetSetUpMachine().setSpoon_stock(stock - 1);\n\t\t\t}\n\t\t} else if (item.equals(\"K\")) {\n\t\t\tstate = getSetUpMachine().getKnife_stock() > 0 ? true : false;\n\t\t\tif (state) {\n\t\t\t\tint stock = getSetUpMachine().getKnife_stock();\n\t\t\t\tint mainStock = getSetUpMachine().getStock_size();\n\t\t\t\tgetSetUpMachine().setStock_size(mainStock - 1);\n\t\t\t\tgetSetUpMachine().setKnife_stock(stock - 1);\n\t\t\t}\n\t\t}\n\t\treturn state;\n\t}", "private void addSellCashTrade( final Trade trade )\n throws CloneNotSupportedException {\n\n // Check if the number of active units is greater than or equal to\n // the number of units that have been sold. If not, it is an error\n // condition. We are not handling short sell scenarios.\n if( getNumActiveCashUnits() < trade.getUnits() ) {\n logger.error( \"Selling more than active untis. Error condition\" ) ;\n logger.error( \" SYMBOL = \" + trade.getSymbol() ) ;\n logger.error( \" active units = \" + getNumActiveCashUnits() ) ;\n logger.error( \" sell units = \" + trade.getUnits() ) ;\n throw new IllegalArgumentException( \"Trying to sell more than \" +\n \"what we have. Bad bad..\" ) ;\n }\n\n // Selling happens in FIFO order.\n int qtyMatched = 0 ;\n Trade buyTrade = null ;\n int buyActUnits = 0 ;\n int sellUnitsLeft = trade.getUnits() ;\n Trade sellTrade= null ;\n\n // While we have not quenched all the units of the sell trade, we\n // continue matching it against our buy orders. Assumption is that if\n // we receive a sell order, we must have enough buy orders already\n // registered to quench the sell order. Else we have an error condition\n while( qtyMatched != trade.getUnits() ) {\n\n // Clone the sell order. In case one sell order matches multiple\n // buy orders, we need to attach a clone of the sell order with\n // appropriate quantity matched to each buy order.\n sellTrade = ( Trade )trade.clone() ;\n\n // Get the first buy order which has still some active units left.\n buyTrade = this.posHldCashTrades.get( 0 ) ;\n\n // Determine how many active units we are dealing with.\n buyActUnits = buyTrade.getNumActiveUnits() ;\n\n // If the buy active units are greater than the sell units left,\n // it implies that the complete sell order will be used up here.\n if( buyActUnits >= sellUnitsLeft ) {\n\n // Increase the total quantity matched by the sell units left.\n qtyMatched += sellUnitsLeft ;\n buyTrade.setMatchedUnits( buyTrade.getMatchedUnits() + sellUnitsLeft ) ;\n sellTrade.setMatchedUnits( sellUnitsLeft ) ;\n sellUnitsLeft = 0 ;\n }\n else {\n // If the sell units are more than the current buy units, it\n // implies that this sell order spans multiple buy orders.\n qtyMatched += buyActUnits ;\n\n // The buy order is completely matched. Hence the matched units\n // is equal to the number of buy units.\n buyTrade.setMatchedUnits( buyTrade.getUnits() ) ;\n\n // Set the number of units matched for this sell trade.\n sellTrade.setMatchedUnits( buyActUnits ) ;\n sellUnitsLeft -= buyActUnits ;\n }\n\n buyTrade.addSellTrade( sellTrade ) ;\n\n // If the buy order is completely matched, remove it from the list\n // of positive holdings and move it to the zero holdings list.\n if( buyTrade.getNumActiveUnits() == 0 ) {\n this.posHldCashTrades.remove( 0 ) ;\n }\n }\n }", "public Order getBuyOrder(int[] spotPrices, int[] futurePrices, int pos,\r\n long money, int restDay) {\r\n\r\n /* Information available for trading:\r\n spotPrices[]: Time series of spot prices. It provides 120 elements from spotPrices[0]\r\n to spotPrices[119]. The element spotPrices[119] is the latest.\r\n futurePrices[]: Time series of futures price. It provides 60 elements from futurePrices[0]\r\n to futurePrices[59]. The element futurePrices[59] is the latest.\r\n Before opening the market, same values with spot prices are given.\r\n If no contract is made in the market, value -1 is given.\r\n pos: Position of the agent. Positive is buying position. Negative is selling.\r\n money: Available cash. Note that type 'long' is used because of needed precision.\r\n restDay: Number of remaining transaction to the closing of the market. */\r\n\r\n Order order = new Order(); // Object to return values.\r\n\r\n order.buysell = Order.BUY;\r\n // Cancel decision if it may increase absolute value of the position\r\n if (pos > fMaxPosition) {\r\n order.buysell = Order.NONE;\r\n return order;\r\n }\r\n\r\n int latestFuturePrice = futurePrices[futurePrices.length - 1];\r\n if (latestFuturePrice < 0) {\r\n order.buysell = Order.NONE;\r\n return order;\r\n } // If previous price is invalid, it makes no order.\r\n order.price = (int) ( (double) latestFuturePrice * (1.0 - fSpreadRatio));\r\n\r\n if (order.price < 1) {\r\n order.price = 1;\r\n\r\n }\r\n order.quant = fMinQuant + fRandom.nextInt(fMaxQuant - fMinQuant + 1);\r\n\r\n // Message\r\n message(\"Buy\" + \", price = \" + order.price + \", volume = \" + order.quant +\r\n \" )\");\r\n\r\n return order;\r\n }", "public synchronized void openMarket() throws InvalidDataException {\n\t\tPrice buyPrice = getBuySide().topOfBookPrice();\n\t\tPrice sellPrice = getSellSide().topOfBookPrice();\n\t\tif (buyPrice == null || sellPrice == null) return;\n\t\twhile(buyPrice.greaterOrEqual(sellPrice) || buyPrice.isMarket() || sellPrice.isMarket()) {\n\t\t\tArrayList<Tradable> topOfBuySide = getBuySide().getEntriesAtPrice(buyPrice);\n\t\t\tHashMap<String, FillMessage> allFills = null;\n\t\t\tArrayList<Tradable> toRemove = new ArrayList<Tradable>();\n\t\t\tfor (Tradable t: topOfBuySide) {\n\t\t\t\tallFills = getSellSide().tryTrade(t);\n\t\t\t\tif (t.getRemainingVolume() == 0) toRemove.add(t);\n\t\t\t}\n\t\t\tfor (Tradable t: toRemove) {\n\t\t\t\tgetBuySide().removeTradable(t);\n\t\t\t}\n\t\t\tupdateCurrentMarket();\n\t\t\tPrice lastSalePrice = determineLastSalePrice(allFills);\n\t\t\tint lastSaleVolume = determineLastSaleQuantity(allFills);\n\t\t\tLastSalePublisher.getInstance().publishLastSale(getStock(), lastSalePrice, lastSaleVolume);\n\t\t\tbuyPrice = getBuySide().topOfBookPrice();\n\t\t\tsellPrice = getSellSide().topOfBookPrice();\n\t\t\tif (buyPrice == null || sellPrice == null) break;\n\t\t}\n\t}", "public interface StockItem {\n String getSymbol();\n\n String getName();\n\n BigDecimal getValue();\n\n int getVolume();\n\n Date getLastTradeDateTime();\n\n BigDecimal getGains();\n\n BigDecimal getOpenValue();\n\n BigDecimal getCloseValue();\n}", "public void doLogicBuy() {\n\t\tif (!player.isHuman) {\n\t\t\tif (player.money > estimatedFee * 1.5) //\n\t\t\t{\n\t\t\t\tint free = (int) (player.money - estimatedFee * 1.5);\n\t\t\t\tCell c = board.getCells().get(player.position);\n\t\t\t\tif (c instanceof TradeableCell) {\n\t\t\t\t\tTradeableCell tc = (TradeableCell) c;\n\t\t\t\t\tif (tc.getOwner() == null && tc.getPrice() < free) {\n\t\t\t\t\t\ttc.buy(player);\n\t\t\t\t\t\tboard.addMessage(\"Just bought\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "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}", "@Test\n\tpublic void test_PNL_2Deals_Sell_Buy_R(){\n\t\tpa.addTransaction(new Trade(new Date(), new Date(), \"\", 0.10, AAPL, 10.0, -10.0));\n\t\tpa.addTransaction(new Trade(new Date(), new Date(), \"\", 0.10, AAPL, 15.0, 10.0));\n\t\tassertEquals( \"-50.00\", nf.format(new PNLImpl(pa, AAPL).getPNLRealized(false)) );\n\t}", "@Override\r\n\tpublic double getManufactureTime() {\r\n\t\tdouble highTime = 0;\r\n\t\t\r\n\t\tfor(Product p: parts) {\r\n\t\t\tif(p.getManufactureTime() > highTime)\r\n\t\t\t\thighTime = p.getManufactureTime();\r\n\t\t}\r\n\t\t\r\n\t\treturn highTime;\r\n\t}", "public void addAndShift(){\n Requests.remove(0);\r\n float targetPrice;\r\n\r\n int sORb = rng.nextInt(2);\r\n if(sORb==0){\r\n targetPrice = (float)(((rng.nextGaussian())*sDev) + meanSellPrice + (sellVolume*sDev*0.03));\r\n if(targetPrice<0){\r\n targetPrice = 0;\r\n }\r\n int ass = ((rng.nextInt(4)+1)); \r\n int aType = rng.nextInt(3); \r\n switch(aType){\r\n case 0: Requests.add(new SellRequest(\"Pork Bellies\", (targetPrice*1.28f), (ass*40000)));\r\n break;\r\n case 1: Requests.add(new SellRequest(\"Frozen Orange Juice Concentrate\", (targetPrice*1.57f), (ass*15000)));\r\n break;\r\n case 2: Requests.add(new SellRequest(\"Soybeans\", (targetPrice*14.05f), (ass*5000)));\r\n }\r\n }\r\n if(sORb==1){\r\n targetPrice = (float)(((rng.nextGaussian())*sDev) + meanBuyPrice - (buyVolume*sDev*0.03));\r\n if(targetPrice<0){\r\n targetPrice = 0;\r\n }\r\n int ass = ((rng.nextInt(4)+1));\r\n int aType = rng.nextInt(3); \r\n switch(aType){\r\n case 0: Requests.add(new BuyRequest(\"Pork Bellies\", (targetPrice*1.28f), (40000*ass)));\r\n break;\r\n case 1: Requests.add(new BuyRequest(\"Frozen Orange Juice Concentrate\", (targetPrice*1.57f), (ass*15000)));\r\n break;\r\n case 2: Requests.add(new BuyRequest(\"Soybeans\", (targetPrice*14.05f), (ass*5000)));\r\n }\r\n }\r\n if(sellVolume > 0){\r\n sellVolume = sellVolume -1;\r\n }\r\n if(buyVolume > 0){\r\n buyVolume = buyVolume -1;\r\n }\r\n printRequest(Requests.size()-1);\r\n lowestSellPrice();\r\n highestBuyPrice();\r\n }", "@Override\n public void sell(double limitPrice, int quantity) {\n Boolean allSold = false;\n Iterator iter1 = buyOrders.entrySet().iterator();\n while(iter1.hasNext()) {\n HashMap.Entry entry = (HashMap.Entry)iter1.next();\n if(limitPrice <= (Double)entry.getKey()) {\n if(quantity < (Integer)entry.getValue()) {\n allSold = true;\n buyOrders.put((Double)entry.getKey(),(Integer)entry.getValue()-quantity) ;\n quantity =0;\n break;\n }\n }\n }\n if(!allSold){\n if(sellOrders.containsKey(limitPrice)) sellOrders.put(limitPrice,sellOrders.get(limitPrice) + quantity);\n else sellOrders.put(limitPrice,quantity);\n }\n cleanUp();\n\n\n }", "public synchronized String buyTicket() {\r\n Random r = new Random();\r\n int buyTckDuration = r.nextInt(3000)+1000;\r\n String timestamp = \"NULL\";\r\n if (isValid_ToBuyTicket()) {\r\n this.tktSold += 1;\r\n try {\r\n Thread.sleep(buyTckDuration);\r\n } catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n// System.out.println(\"Sold a new ticket, today's sales num: \" + this.tktSold);\r\n\r\n // we still need to create a real ticket with a timestamps\r\n // some code()\r\n\r\n String postfix = getPostfix();\r\n timestamp = \"T\" + postfix;\r\n return timestamp;\r\n\r\n }else{\r\n System.out.println(\"Your ticket request denied!\");\r\n return timestamp;\r\n }\r\n\r\n }", "@Test\r\n public void test() {\r\n Configuration.getInstance().setDeductIncomeTax(false);\r\n\r\n String symbol = \"TST\";\r\n Stock stock = new Stock(symbol, \"Test Stock\");\r\n stock.setPrice(10.00);\r\n stock.setDivRate(1.00);\r\n\r\n // Initial (empty) position.\r\n Position position = new Position(stock);\r\n Assert.assertEquals(0, position.getNoOfShares());\r\n Assert.assertEquals(0.00, position.getCurrentCost(), DELTA);\r\n Assert.assertEquals(0.00, position.getCurrentValue(), DELTA);\r\n Assert.assertEquals(0.00, position.getCurrentResult(), DELTA);\r\n Assert.assertEquals(0.00, position.getTotalCost(), DELTA);\r\n Assert.assertEquals(0.00, position.getAnnualIncome(), DELTA);\r\n Assert.assertEquals(0.00, position.getYieldOnCost(), DELTA);\r\n Assert.assertEquals(0.00, position.getTotalIncome(), DELTA);\r\n Assert.assertEquals(0.00, position.getTotalReturn(), DELTA);\r\n Assert.assertEquals(0.00, position.getTotalReturnPercentage(), DELTA);\r\n\r\n // BUY 100 @ $20 ($5 costs)\r\n stock.setPrice(20.00);\r\n position.addTransaction(TestUtil.createTransaction(1, 1L, TransactionType.BUY, symbol, 100, 20.00, 5.00));\r\n Assert.assertEquals(100, position.getNoOfShares());\r\n Assert.assertEquals(2005.00, position.getCurrentCost(), DELTA);\r\n Assert.assertEquals(2000.00, position.getCurrentValue(), DELTA);\r\n Assert.assertEquals(-5.00, position.getCurrentResult(), DELTA);\r\n Assert.assertEquals(2005.00, position.getTotalCost(), DELTA);\r\n Assert.assertEquals(100.00, position.getAnnualIncome(), DELTA);\r\n Assert.assertEquals(4.99, position.getYieldOnCost(), DELTA);\r\n Assert.assertEquals(0.00, position.getTotalIncome(), DELTA);\r\n Assert.assertEquals(-5.00, position.getTotalReturn(), DELTA);\r\n Assert.assertEquals(-0.25, position.getTotalReturnPercentage(), DELTA);\r\n\r\n // DIVIDEND 100 @ $1.00\r\n position.addTransaction(TestUtil.createTransaction(2, 2L, TransactionType.DIVIDEND, symbol, 100, 1.00, 0.00));\r\n Assert.assertEquals(100, position.getNoOfShares());\r\n Assert.assertEquals(2005.00, position.getCurrentCost(), DELTA);\r\n Assert.assertEquals(2000.00, position.getCurrentValue(), DELTA);\r\n Assert.assertEquals(-5.00, position.getCurrentResult(), DELTA);\r\n Assert.assertEquals(2005.00, position.getTotalCost(), DELTA);\r\n Assert.assertEquals(100.00, position.getAnnualIncome(), DELTA);\r\n Assert.assertEquals(4.99, position.getYieldOnCost(), DELTA);\r\n Assert.assertEquals(100.00, position.getTotalIncome(), DELTA);\r\n Assert.assertEquals(+95.00, position.getTotalReturn(), DELTA);\r\n Assert.assertEquals(+4.74, position.getTotalReturnPercentage(), DELTA);\r\n\r\n // Price drops to $10\r\n stock.setPrice(10.00);\r\n Assert.assertEquals(100, position.getNoOfShares());\r\n Assert.assertEquals(2005.00, position.getCurrentCost(), DELTA);\r\n Assert.assertEquals(1000.00, position.getCurrentValue(), DELTA);\r\n Assert.assertEquals(-1005.00, position.getCurrentResult(), DELTA);\r\n Assert.assertEquals(-50.12, position.getCurrentResultPercentage(), DELTA);\r\n Assert.assertEquals(2005.00, position.getTotalCost(), DELTA);\r\n Assert.assertEquals(100.00, position.getAnnualIncome(), DELTA);\r\n Assert.assertEquals(4.99, position.getYieldOnCost(), DELTA);\r\n Assert.assertEquals(100.00, position.getTotalIncome(), DELTA);\r\n Assert.assertEquals(-905.00, position.getTotalReturn(), DELTA);\r\n Assert.assertEquals(-45.14, position.getTotalReturnPercentage(), DELTA);\r\n\r\n // BUY another 100 @ $10 ($5 costs)\r\n position.addTransaction(TestUtil.createTransaction(3, 3L, TransactionType.BUY, symbol, 100, 10.00, 5.00));\r\n Assert.assertEquals(200, position.getNoOfShares());\r\n Assert.assertEquals(3010.00, position.getCurrentCost(), DELTA);\r\n Assert.assertEquals(2000.00, position.getCurrentValue(), DELTA);\r\n Assert.assertEquals(-1010.00, position.getCurrentResult(), DELTA);\r\n Assert.assertEquals(-33.55, position.getCurrentResultPercentage(), DELTA);\r\n Assert.assertEquals(3010.00, position.getTotalCost(), DELTA);\r\n Assert.assertEquals(200.00, position.getAnnualIncome(), DELTA);\r\n Assert.assertEquals(6.64, position.getYieldOnCost(), DELTA);\r\n Assert.assertEquals(100.00, position.getTotalIncome(), DELTA);\r\n Assert.assertEquals(-910.00, position.getTotalReturn(), DELTA);\r\n Assert.assertEquals(-30.23, position.getTotalReturnPercentage(), DELTA);\r\n\r\n // Price raises to $20 again\r\n stock.setPrice(20.00);\r\n Assert.assertEquals(200, position.getNoOfShares());\r\n Assert.assertEquals(3010.00, position.getCurrentCost(), DELTA);\r\n Assert.assertEquals(4000.00, position.getCurrentValue(), DELTA);\r\n Assert.assertEquals(+990.00, position.getCurrentResult(), DELTA);\r\n Assert.assertEquals(+32.89, position.getCurrentResultPercentage(), DELTA);\r\n Assert.assertEquals(3010.00, position.getTotalCost(), DELTA);\r\n Assert.assertEquals(200.00, position.getAnnualIncome(), DELTA);\r\n Assert.assertEquals(6.64, position.getYieldOnCost(), DELTA);\r\n Assert.assertEquals(100.00, position.getTotalIncome(), DELTA);\r\n Assert.assertEquals(+1090.00, position.getTotalReturn(), DELTA);\r\n Assert.assertEquals(+36.21, position.getTotalReturnPercentage(), DELTA);\r\n\r\n // DIVIDEND 200 @ $1.25\r\n stock.setDivRate(1.25);\r\n position.addTransaction(TestUtil.createTransaction(4, 4L, TransactionType.DIVIDEND, symbol, 200, 1.25, 0.00));\r\n Assert.assertEquals(200, position.getNoOfShares());\r\n Assert.assertEquals(3010.00, position.getCurrentCost(), DELTA);\r\n Assert.assertEquals(4000.00, position.getCurrentValue(), DELTA);\r\n Assert.assertEquals(+990.00, position.getCurrentResult(), DELTA);\r\n Assert.assertEquals(+32.89, position.getCurrentResultPercentage(), DELTA);\r\n Assert.assertEquals(3010.00, position.getTotalCost(), DELTA);\r\n Assert.assertEquals(250.00, position.getAnnualIncome(), DELTA);\r\n Assert.assertEquals(8.31, position.getYieldOnCost(), DELTA);\r\n Assert.assertEquals(350.00, position.getTotalIncome(), DELTA);\r\n Assert.assertEquals(+1340.00, position.getTotalReturn(), DELTA);\r\n Assert.assertEquals(+44.52, position.getTotalReturnPercentage(), DELTA);\r\n\r\n // SELL 200 @ $20 ($10 costs)\r\n position.addTransaction(TestUtil.createTransaction(5, 5L, TransactionType.SELL, symbol, 200, 20.00, 10.00));\r\n Assert.assertEquals(0, position.getNoOfShares());\r\n Assert.assertEquals(0.00, position.getCurrentCost(), DELTA);\r\n Assert.assertEquals(0.00, position.getCurrentValue(), DELTA);\r\n Assert.assertEquals(0.00, position.getCurrentResult(), DELTA);\r\n Assert.assertEquals(0.00, position.getCurrentResultPercentage(), DELTA);\r\n Assert.assertEquals(3020.00, position.getTotalCost(), DELTA);\r\n Assert.assertEquals(0.00, position.getAnnualIncome(), DELTA);\r\n Assert.assertEquals(0.00, position.getYieldOnCost(), DELTA);\r\n Assert.assertEquals(350.00, position.getTotalIncome(), DELTA);\r\n Assert.assertEquals(+1330.00, position.getTotalReturn(), DELTA);\r\n Assert.assertEquals(+44.04, position.getTotalReturnPercentage(), DELTA);\r\n }", "public void checkAndExecute(){\n if(priceListener.getSecurityPrice() < buyPrice){\n executionService.buy(security, buyPrice, 100);\n // if the price < buyPrice then executionService.buy(buyquantity)\n }else if ( priceListener.getSecurityPrice() > sellPrice ) {\n executionService.sell(security, buyPrice, 100);\n }\n }", "@Test\n public void testCurrentMarketPosition ()\n {\n initializeService();\n accountingService.addMarketTransaction(bob,\n timeslotRepo.findBySerialNumber(2), 0.5, -45.0);\n accountingService.addMarketTransaction(bob,\n timeslotRepo.findBySerialNumber(2), 0.3, -31.0);\n accountingService.addMarketTransaction(bob,\n timeslotRepo.findBySerialNumber(3), 0.7, -43.0);\n accountingService.addMarketTransaction(jim,\n timeslotRepo.findBySerialNumber(2), 0.4, -35.0);\n accountingService.addMarketTransaction(jim,\n timeslotRepo.findBySerialNumber(2), -0.2, 20.0);\n assertEquals(5, accountingService.getPendingTransactions().size(), \"correct number in list\");\n accountingService.activate(timeService.getCurrentTime(), 3);\n // current timeslot is 4, should be 0 mkt posn\n assertEquals(0.0, accountingService.getCurrentMarketPosition (bob), 1e-6, \"correct position, bob, ts4\");\n assertEquals(0.0, accountingService.getCurrentMarketPosition (jim), 1e-6, \"correct position, jim, ts4\");\n // move forward to timeslot 5 and try again\n timeService.setCurrentTime(timeService.getCurrentTime().plus(TimeService.HOUR));\n assertEquals(0.8, accountingService.getCurrentMarketPosition (bob), 1e-6, \"correct position, bob, ts5\");\n assertEquals(0.2, accountingService.getCurrentMarketPosition (jim), 1e-6, \"correct position, jim, ts5\");\n // another hour and try again\n timeService.setCurrentTime(timeService.getCurrentTime().plus(TimeService.HOUR));\n assertEquals(0.7, accountingService.getCurrentMarketPosition (bob), 1e-6, \"correct position, bob, ts5\");\n assertEquals(0.0, accountingService.getCurrentMarketPosition (jim), 1e-6, \"correct position, jim, ts5\");\n }", "protected BigDecimal reword(){\n\t\tif(getNowAct() == 0){\n\t\t\treturn(rewordBuy());\n\t\t}\n\t\t//keep\n\t\telse if(getNowAct() == 1){\n\t\t\treturn(rewordWait());\n\t\t}\n\t\t//sell\n\t\telse if(getNowAct() == 2){\n\t\t\treturn(rewordSell());\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"getNowAct : \" + getNowAct() + \"\\nerror occur.\");\n\t\t\tSystem.exit(2);\n\t\t\treturn(null);\n\t\t}\n\t}", "@Test\n\tpublic void test_PNL_2Deals_Buy_Sell_R(){\n\t\tpa.addTransaction(new Trade(new Date(), new Date(), \"\", 0.10, AAPL, 10.0, 10.0));\n\t\tpa.addTransaction(new Trade(new Date(), new Date(), \"\", 0.10, AAPL, 15.0, -10.0));\n\t\tassertEquals( \"50.00\", nf.format(new PNLImpl(pa, AAPL).getPNLRealized(false)) );\n\t}", "@Test\n public void testSell() {\n Game game = Game.getInstance();\n Player player = new Player(\"Chisom\", 2, 2, 2,\n 2, SolarSystems.SOMEBI);\n game.setPlayer(player);\n game.getPlayer().getShip().getShipCargo().add(new CargoItem(2, Goods.Water));\n game.getPlayer().getShip().getShipCargo().add(new CargoItem(1, Goods.Food));\n game.getPlayer().getShip().getShipCargo().add(new CargoItem(1, Goods.Furs));\n CargoItem good = game.getPlayer().getShip().getShipCargo().get(2);\n good.getGood().sell(good.getGood(), 1);\n CargoItem water = game.getPlayer().getShip().getShipCargo().get(0);\n water.setQuantity(2);\n CargoItem food = game.getPlayer().getShip().getShipCargo().get(1);\n food.setQuantity(1);\n good.setQuantity(0);\n int P = good.getGood().getPrice(1);\n int total = game.getPlayer().getCredits();\n boolean quan = water.getQuantity() == 2 && food.getQuantity() == 1 && good.getQuantity() == 0;\n boolean check = water.getQuantity() == 2;\n System.out.print(total);\n assertTrue(quan && total == 1560);\n //assertEquals(true, quan && total == 1560);\n }", "@Test\n public void testMarketOrder() throws InterruptedException {\n setUp();\n testMatchingEngine.start();\n\n NewOrder nosB1 = createLimitOrder(\"BUY1\", Side.BUY, 100, 100.1, System.currentTimeMillis());\n clientSession.sendNewOrder(nosB1);\n NewOrder nosB2 = createLimitOrder(\"BUY2\", Side.BUY, 200, 99.99, System.currentTimeMillis());\n clientSession.sendNewOrder(nosB2);\n NewOrder nosB3 = createLimitOrder(\"BUY3\", Side.BUY, 300, 99.79, System.currentTimeMillis());\n clientSession.sendNewOrder(nosB3);\n\n // Sell Order with Qty=150 and Market Order\n NewOrder nosS1 = createMarketOrder(\"SELL1\", Side.SELL, 700, System.currentTimeMillis());\n clientSession.sendNewOrder(nosS1);\n\n List<Event> msg = clientSession.getMessagesInQueue();\n assertEquals(7, msg.size());\n\n Trade t = ( Trade) msg.get(0);\n assertEquals( t.getLastTradedPrice().value() , new Price(100.1).value() );\n assertEquals( t.getLastTradedQty() , 100 );\n t = ( Trade) msg.get(1);\n assertEquals( t.getLastTradedPrice().value() , new Price(100.1).value() );\n assertEquals( t.getLastTradedQty() , 100 );\n t = ( Trade) msg.get(2);\n assertEquals( t.getLastTradedPrice().value() , new Price(99.99).value() );\n assertEquals( t.getLastTradedQty() , 200 );\n t = ( Trade) msg.get(3);\n assertEquals( t.getLastTradedPrice().value() , new Price(99.99).value() );\n assertEquals( t.getLastTradedQty() , 200 );\n t = ( Trade) msg.get(4);\n assertEquals( t.getLastTradedPrice().value() , new Price(99.79).value() );\n assertEquals( t.getLastTradedQty() , 300 );\n t = ( Trade) msg.get(5);\n assertEquals( t.getLastTradedPrice().value() , new Price(99.79).value() );\n assertEquals( t.getLastTradedQty() , 300 );\n Canceled t1 = ( Canceled) msg.get(6);\n assertEquals( t1.getCanceledQty() , 100 );\n }", "int getSellCurrentRaw();", "int getQuantite();", "int getQuantite();", "private ArrayList<TY_SaleEligibleItems> getTentativeSellItems(TY_Scrip_PositionModel posModel, Date sellDate) throws EX_General\n\t{\n\t\tArrayList<TY_SaleEligibleItems> allItems = null;\n\t\t// 2. Get Buy Positions Items with ETQ > 0\n\t\tArrayList<OB_Positions_Item> buyItemsposETQ = posModel.getScPosItems().stream().filter(x -> x.getTxnType().equals(SCEenums.txnType.BUY))\n\t\t .filter(w -> w.getETQ() > 0).collect(Collectors.toCollection(ArrayList::new));\n\t\tif (buyItemsposETQ != null && dateSrv != null)\n\t\t{\n\t\t\t// 3.Calculate Days difference for Each of the Items thus obtained\n\t\t\tallItems = new ArrayList<TY_SaleEligibleItems>();\n\n\t\t\tfor ( OB_Positions_Item posItem : buyItemsposETQ )\n\t\t\t{\n\t\t\t\tint daysDiff = 0;\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tdaysDiff = dateSrv.getNumDaysbwSqlSysDates(posItem.getTxnDate(), sellDate);\n\t\t\t\t}\n\t\t\t\tcatch (ParseException e)\n\t\t\t\t{\n\t\t\t\t\tEX_General egen = new EX_General(\"ERR_DATE_PARSE\", new Object[]\n\t\t\t\t\t{ e.getMessage()\n\t\t\t\t\t});\n\t\t\t\t\tthrow egen;\n\t\t\t\t}\n\n\t\t\t\tTY_SaleEligibleItems eligItem = new TY_SaleEligibleItems(posItem.getPrimaryKey_Int(), daysDiff, posItem.getETQ(), 0);\n\t\t\t\tallItems.add(eligItem);\n\t\t\t}\n\t\t}\n\t\treturn allItems;\n\t}", "@Override\n\tpublic int getStock() {\n\t\treturn 2;\n\t}", "@Override\n\tpublic double GetValue() {\n\t\tdouble spot = inputs.getSpot();\n\t\tdouble strike = inputs.getStrike();\n\t\tdouble vol = inputs.getVol();\n\t\tint noSteps=inputs.getNoSteps();\n\t\tdouble expiry=inputs.getExpiry();\n\t OptionType type=inputs.getType();\n\t ExerciseType exercise=inputs.getExercise();\n\t InterestRate interestRate=inputs.getR();\n\t\t\n\t double timestep = expiry/noSteps;\n\t double DF = Math.exp(-interestRate.GetRate(1.)*timestep);\n\t double temp1 = Math.exp((interestRate.GetRate(1.) + vol * vol)*timestep);\n\t double temp2 = 0.5 * (DF + temp1);\n\t double up = temp2 + Math.sqrt(temp2*temp2 - 1);\n\t double down = 1/ up;\n\t double probaUp = (Math.exp(interestRate.GetRate(1.) * timestep) - down)/(up -down) ;\n\t double probaDown = 1 - probaUp;\n\n\t //stock price tree\n\t\tstockPrice[0][0]=spot;\n\t for (int n = 1; n <= noSteps; n ++) {\n for (int j = n; j > 0; j--){\n \tstockPrice[j][n] = up * stockPrice[j-1][n-1];\n }\n \t\tstockPrice[0][n] = down * stockPrice[0][n-1];\n }\n\t \n\t //last column set payoffs\n\t\tfor (int j = 0; j <= noSteps; j++) {\n\t\t\t\tif(type.equals(OptionType.CALL)) {\n\t\t\t\t\tpayOff[j][noSteps] = Math.max(this.stockPrice[j][noSteps] - strike, .0);\n\t\t\t\t}else {\n\t\t\t\t\tpayOff[j][noSteps] = Math.max(strike - this.stockPrice[j][noSteps], .0);\n\t\t\t\t}\n\t\t}\n\n\t\t\n\t //payoff tree in backwardation\n\t \n\t for (int i = noSteps ; i >= 1; i--) {\n for (int j = 0; j <= i-1; j++) {\n\t \tif(exercise.equals(ExerciseType.AMERICAN)) { \n\t //American\t\n\t \t\tif(type.equals(OptionType.CALL)) {\n\t \t\t\t\tpayOff[j][i-1] = Math.max(DF * (probaUp * payOff[j+1][i] + probaDown * payOff[j][i]) ,\n\t \t\t\t\tMath.max(this.stockPrice[j][i-1] - strike, .0));\n\t \t\t\t\n\t \t\t}else \tpayOff[j][i-1] = Math.max(DF * (probaUp * payOff[j+1][i] + probaDown * payOff[j][i]) ,\n\t \t\t\t\tMath.max(strike - this.stockPrice[j][i-1] , .0));\n\t \t}else { \n\t \t\t\t//European put and call option\n\t \t\t\t\tpayOff[j][i-1] = DF * (probaUp * payOff[j+1][i] + probaDown * payOff[j][i]);\n\t }\n }\n }\n\t \n\t double deltaUp = (payOff[0][2]-payOff[1][2])/(stockPrice[0][2]-stockPrice[1][2]);\n\t double deltaDown = (payOff[1][2]-payOff[2][2])/(stockPrice[1][2]-stockPrice[2][2]);\n\t delta = (deltaUp + deltaDown) /2;\n\t gamma = (deltaUp-deltaDown)/((stockPrice[0][2]-stockPrice[2][2])/2);\n\t theta = (payOff[1][2]-payOff[0][0])/(365*2*timestep);//time in days\n\t \n\t long rounded = Math.round(payOff[0][0]*10000);\n\t return rounded/10000.0;\n\t}", "private double generateSellPrice(ShipType type) {\n return type.getPrice();\n }", "public double getPrice(RequiredSpecs specs, int waitingTime){\r\n\t\tdouble priceMemory;\r\n\t\tdouble priceCPU;\r\n\t\tif(canRun(specs)){\r\n\t\t\tpriceMemory = specs.getMemory()*this.pricePerMemoryUnit*(1 - getFractionMemoryTaken());\r\n\t\t\tpriceCPU = specs.getCpu()*this.pricePerCpuUnit*(1 - getFractionCpuTaken());\r\n\t\t}else{\r\n\t\t\tpriceMemory = specs.getMemory()*this.pricePerMemoryUnit - this.discountPerWaitingSecond * waitingTime;\r\n\t\t\tpriceCPU = specs.getCpu()*this.pricePerCpuUnit - this.discountPerWaitingSecond * waitingTime;\r\n\t\t}\r\n\t\tdouble finalPrice = (priceMemory + priceCPU)*specs.getTime()*this.pricePerSecond;\r\n\t\tif(finalPrice <= 0){\r\n\t\t\treturn this.minPrice;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn (priceMemory + priceCPU)*specs.getTime()*this.pricePerSecond;\r\n\t\t}\r\n\t}", "List<Trade> getTrades(Stock stock, int minutes);", "public static void findBestDaysToTrade(int[] values) {\n\n int highestDiff = 0;\n int dayToBuy = -1, dayToSell = -1;\n\n int curSmallInx = 0;\n int curSmallValue = values[0];\n\n for (int inx = 1; inx < values.length; inx++) {\n int curValue = values[inx];\n\n // If we find smaller index, record it & continue\n if (curValue < curSmallValue) {\n curSmallValue = curValue;\n curSmallInx = inx;\n continue;\n }\n\n // If we find a greater difference value, then record it\n if ((curValue-curSmallValue) > highestDiff) {\n highestDiff = curSmallValue = curValue;\n dayToBuy = curSmallInx;\n dayToSell = inx;\n }\n }\n\n System.out.println (\"dayToBuy: \" + (dayToBuy+1) + \", dayToSell: \" + (dayToSell+1) + \", margin: \" + highestDiff);\n }", "int getBuyCurrentRaw();", "@Test\n public void HappyDailyIncomeForStore(){\n Integer productID1 = store.getProductID(\"computer\");\n tradingSystem.AddProductToCart(NconnID, storeID, productID1, 3);\n tradingSystem.subscriberPurchase(NofetID, NconnID, \"123456789\", \"4\",\"2022\" , \"123\", \"123456789\", \"Rager 101\",\"Beer Sheva\",\"Israel\",\"8458527\");\n\n Double dailyIncome = store.getDailyIncome();\n assertEquals(dailyIncome, 9000.0);\n }", "public void sellItem(int i){\n Product p = stock.get(i);\n if(p.getQuantity() > 0) {\n if(getCustomerMoney() > p.getCost()) {\n p.decreaseQuantity(1);\n for (Coin c : customerMoney) {\n bank.add(c);\n }\n customerMoney = new ArrayList<>();\n System.out.println(\"1 \" + p.getName() + \" was bought.\");\n } else {\n System.out.println(\"Insufficient Funds...\");\n }\n } else {\n System.out.println(stock.get(i).getName() + \" is out of stock...\");\n }\n }", "public boolean buy() throws Exception {\n\n int jogador = this.jogadorAtual();\n\n String lugar = this.tabuleiro.getPlaceName(posicoes[jogador]);\n // System.out.println(\"lugar[jogador]\" + lugar);\n boolean posicaoCompravel = this.posicaoCompravel(posicoes[jogador]);\n boolean isEstatal = this.isPosicaoEstatal(this.posicoes[jogador]);\n\n if (posicaoCompravel || (isEstatal && this.publicServices == true && verificaSeServicoPublicoFoiComprado(this.posicoes[jogador]))) {\n\n if (posicaoCompravel || (isEstatal && this.publicServices == true)) {\n this.listaJogadores.get(jogadorAtual()).addQuantidadeCompanhias();\n\n }\n int posicaoTabuleiro = posicoes[jogador];\n int preco = this.tabuleiro.getLugarPrecoCompra(posicaoTabuleiro);\n Jogador j = listaJogadores.get(jogador);\n this.terminarAVez();\n if (preco <= j.getDinheiro()) {\n this.print(\"\\tPossui dinheiro para a compra!\");\n j.retirarDinheiro(preco);\n this.Donos.put(posicaoTabuleiro, j.getNome());\n\n String nomeLugar = this.tabuleiro.getPlaceName(posicaoTabuleiro);\n j.addPropriedade(nomeLugar);\n if (nomeLugar.equals(\"Reading Railroad\") || nomeLugar.equals(\"Pennsylvania Railroad\") ||\n nomeLugar.equals(\"B & O Railroad\") || nomeLugar.equals(\"Short Line Railroad\")) {\n DonosFerrovias[jogador]++;\n }\n this.print(\"\\tVocê adquiriu \" + nomeLugar + \" por \" + preco);\n this.print(\"\\tAtual dinheiro: \" + j.getDinheiro());\n if (j.temPropriedades() && hipotecaAtiva) {\n j.adicionarComandoHipotecar();\n }\n if (j.verificaSeTemGrupo(posicaoTabuleiro)) {\n if (this.build == true) {\n j.adicionarComandoBuild();\n }\n\n this.tabuleiro.duplicarAluguelGrupo(posicaoTabuleiro);\n\n }\n } else {\n this.print(\"\\tNão possui dinheiro para realizar a compra!\");\n throw new Exception(\"Not enough money\");\n }\n\n } else {\n\n if (this.jaTemDono(posicoes[jogador])) {\n throw new Exception(\"Deed for this place is not for sale\");\n }\n\n if (isEstatal && this.publicServices == false) {\n throw new Exception(\"Deed for this place is not for sale\");\n }\n if (!posicaoCompravel) {\n throw new Exception(\"Place doesn't have a deed to be bought\");\n }\n }\n\n\n\n return false;\n\n\n\n }", "@SuppressWarnings(\"FeatureEnvy\")\n @SuppressLint(\"SetTextI18n\")\n @Override\n public void sellItem(String goods, int price) {\n @SuppressWarnings(\"ChainedMethodCall\") int max = player.getInven().get(goods.toLowerCase());\n if ((max - Integer.parseInt(inputStr)) >= 0) {\n player.getInven().put(goods.toLowerCase(), player.getInven().get(goods.toLowerCase())\n -Integer.parseInt(inputStr));\n player.setCargo(player.getCargo() - Integer.parseInt(inputStr));\n player.setCredit(player.getCredit() + (Integer.parseInt(inputStr) * price));\n bay.setText(String.valueOf(player.getCargo()) + \"/\" + player.getSpaceship().getBay());\n credit.setText(String.valueOf(player.getCredit()) + \" Cr\");\n setupInverntory();\n Toast.makeText(getApplicationContext(), \"You sold \" + inputStr + \" \" + goods,\n Toast.LENGTH_LONG).show();\n } else {\n Toast.makeText(getApplicationContext(),\n \"You can not sell anymore. Check your bay.\", Toast.LENGTH_LONG).show();\n }\n }", "private int getPrice(HardwareSet hws, boolean used){\n if(isNull(hws)) return 0;\n return used ? hws.getTotalSellPrice() : hws.getTotalPrice();\n }", "void compute() {\n\n if (random.nextBoolean()) {\n value = value + random.nextInt(variation);\n ask = value + random.nextInt(variation / 2);\n bid = value + random.nextInt(variation / 2);\n } else {\n value = value - random.nextInt(variation);\n ask = value - random.nextInt(variation / 2);\n bid = value - random.nextInt(variation / 2);\n }\n\n if (value <= 0) {\n value = 1.0;\n }\n if (ask <= 0) {\n ask = 1.0;\n }\n if (bid <= 0) {\n bid = 1.0;\n }\n\n if (random.nextBoolean()) {\n // Adjust share\n int shareVariation = random.nextInt(100);\n if (shareVariation > 0 && share + shareVariation < stocks) {\n share += shareVariation;\n } else if (shareVariation < 0 && share + shareVariation > 0) {\n share += shareVariation;\n }\n }\n }", "int getWaitTime(int arrival_time, QNode temp) {\r\n\t \t //1. this is the case when the first person arrives before 9 a.m.\r\n\t \t if (arrival_time <32400) {\r\n\t \t\t //for the wait time of the first person\r\n\t\t \t if (size== maxSize) {\r\n\t\t \t\t\t this.front.wait_time = 32400-arrival_time;\r\n\t\t \t\t\t this.front.service_timeEnding = 32700;\r\n\t\t \t\t\t savewait.add(this.front.wait_time);\r\n\t\t \t\t\t return this.front.wait_time;\r\n\t\t \r\n\t\t \t }\r\n\t\t \t //for the rest of them\r\n\t\t \t else {\r\n\t\t \t\t //if there is no waiting\r\n\t\t \t\t if (temp.service_timeEnding< arrival_time) {\r\n\t\t \t\t\t this.front.wait_time= 0;\r\n\t\t \t\t\t this.front.service_timeEnding = arrival_time +300;\r\n\t\t \t\t\t if (this.front.arrival_time+this.front.wait_time+300 !=this.front.service_timeEnding) {\r\n\t\t \t\t\t\t numberCustomers++;\r\n\t\t \t\t\t }\r\n\t\t \t\t\t savewait.add(this.front.wait_time);\r\n\t\t \t\t\t return this.front.wait_time;\r\n\t\t \t\t\t \r\n\t\t \t\t }\r\n\t\t \t\t //if there is waiting and there is person before you\r\n\t\t \t\t else {\r\n\t\t\t\t \tthis.front.wait_time = temp.service_timeEnding - arrival_time;\r\n\t\t\t\t \tthis.front.service_timeEnding = arrival_time +this.front.wait_time +300;\r\n\t\t\t\t \tif (this.front.service_timeEnding< this.front.wait_time) {\r\n\t\t \t\t\t\t numberCustomers++;\r\n\t\t \t\t\t }\r\n\t\t\t\t \t//save wait time\r\n\t\t\t\t \tsavewait.add(this.front.wait_time);\r\n\t\t\t\t \treturn this.front.wait_time;\r\n\t\t \t\t \r\n\t\t \t\t }\r\n\t\t \t\t \r\n\t\t \t }\r\n\t \t }\r\n\t \t \r\n\t \t //this is the case when the first person arrives after 9\r\n\t \t else {\r\n\t \t\t //for the first person arriving\r\n\t\t \t if (size ==maxSize ) {\r\n\t\t \t\t\t this.front.wait_time = 0;\r\n\t\t \t\t\t this.front.service_timeEnding = arrival_time +300;\r\n\t\t \t\t\t savewait.add(this.front.wait_time);\r\n\t\t \t\t\t return this.front.wait_time;\r\n\t\t \t }\r\n\t\t \t //for the rest of them\r\n\t\t \t else {\r\n\t\t \t\t //if there is no waiting\r\n\t\t \t\t if (temp.service_timeEnding< arrival_time) {\r\n\t\t \t\t\t this.front.wait_time= 0;\r\n\t\t \t\t\t this.front.service_timeEnding = arrival_time +300;\r\n\t\t \t\t\t if (this.front.service_timeEnding!= this.front.wait_time) {\r\n\t\t \t\t\t\t numberCustomers++;\r\n\t\t \t\t\t }\r\n\t\t \t\t\t savewait.add(this.front.wait_time);\r\n\t\t \t\t\t return this.front.wait_time;\r\n\t\t \t\t\t \r\n\t\t \t\t }\r\n\t\t \t\t //if there is a waiting\r\n\t\t \t\t else {\r\n\t\t\t\t \tthis.front.wait_time = temp.service_timeEnding - arrival_time;\r\n\t\t\t\t \tthis.front.service_timeEnding = arrival_time +this.front.wait_time +300;\r\n\t\t\t\t \tif (this.front.service_timeEnding!= this.front.wait_time) {\r\n\t\t \t\t\t\t numberCustomers++;\r\n\t\t \t\t\t }\r\n\t\t\t\t \tsavewait.add(this.front.wait_time);\r\n\t\t\t\t \treturn this.front.wait_time;\r\n\t\t \t\t\r\n\t\t \t\t \r\n\t\t \t\t }\r\n\t\t \t \r\n\t \t \r\n\t \t\r\n\t \t }\r\n\t \t }\r\n\t }", "public static void main (String [] args) throws IOException {\n BufferedReader f = new BufferedReader(new FileReader(\"buylow.in\"));\n // input file name goes above\n PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(\"buylow.out\")));\n // Use StringTokenizer vs. readLine/split -- lots faster\n StringTokenizer st = new StringTokenizer(f.readLine());\n // Get line, break into tokens\n int n = Integer.parseInt(st.nextToken());\n int[] price = new int[n];\n int[] dp = new int[n];\n BigInteger[] times = new BigInteger[n];\n for(int i = 0; i < n; i++){\n times[i] = BigInteger.ZERO;\n }\n st = new StringTokenizer(f.readLine());\n for(int i = 0; i < n; i++){\n if(!st.hasMoreTokens())\n st = new StringTokenizer(f.readLine());\n int current = Integer.parseInt(st.nextToken());\n price[i] = current;\n int max = 1;\n for(int j = i - 1; j >= 0; j--){\n if(price[j] > current){\n if(dp[j] + 1 > max){\n max = dp[j] + 1;\n }\n }\n }\n dp[i] = max;\n if(max == 1){\n times[i] = BigInteger.ONE;\n }\n else {\n HashSet<Integer> got = new HashSet<>();\n for(int j = i - 1; j >= 0; j--){\n if(price[j] > current)\n if(dp[j] + 1 == max){\n if(!got.contains(price[j])){\n got.add(price[j]);\n times[i] = times[i].add(times[j]);\n }\n }\n }\n }\n }\n int max = 0;\n for(int i = 0; i < n; i++){\n if(dp[i] > max)\n max = dp[i];\n }\n BigInteger result = BigInteger.ZERO;\n HashSet<Integer> got = new HashSet<>();\n for(int i = n - 1; i >= 0; i--){\n if(dp[i] == max)\n if(!got.contains(price[i])){\n got.add(price[i]);\n result = result.add(times[i]);\n }\n }\n out.println(max + \" \" + result.toString()); // output result\n out.close(); // close the output file\n }", "public double calculateWIP() {\n\t\tdouble totalDeliveryRate = 0.0;\n\t\tdouble totalLeadTime = 0.0;\n LinkedList<Card> completedCards = BoardManager.get().getCurrentBoard().getCardsOf(Role.COMPLETED_WORK);\n for (Card card : completedCards) {\n totalLeadTime += (int) DAYS.between(card.getCreationDate(versions), card.getCompletionDate(versions));\n\t\t\ttotalDeliveryRate += card.getStoryPoints();\t\n\n }\n\t\ttotalDeliveryRate = totalDeliveryRate/ (BoardManager.get().getCurrentBoard().getAge()); // avrage of cards delivered per time unit\n\t\ttotalLeadTime = totalLeadTime / completedCards.size(); // avarage time it takes to finish a card\n return Math.round(totalDeliveryRate * totalLeadTime * 100D) / 100D;\n }", "public static long stockmax(List<Integer> prices) {\n\t\t// Write your code here\n\t\tlong profit=0L;\n\t\tlong maxSoFar=0L;\n\t\t for (int i = prices.size() - 1; i > -1 ; i--) {\n\t if (prices.get(i) >= maxSoFar) {\n\t maxSoFar = prices.get(i);\n\t }\n\t profit += maxSoFar - prices.get(i);\n\t }\n\t return profit;\n\t}", "void openSuperMarketSimulation()\r\n\t{\n\t\t\r\n\t\tqueueManager = new QueueManager(shoppingQueue);\r\n\t\tdataManager = new DataCollector();\r\n\t\ttimerLoop.start();\r\n\t\tsuperMarketTime.timerStart();\r\n//\t\twhile(timerLoop.isRunning())\r\n//\t\t{\r\n//\t\t\t\r\n//\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//CLOSE THE MARKET :(((\r\n\t}", "public Date getBuy_time() {\r\n\t\treturn buy_time;\r\n\t}", "public double getTimeForClose();", "public interface VendingMachine {\n long getPrice(Item item);\n void insertCoin(Coin coin);\n List<Coin> refund();\n Bucket<Item, List<Coin>> dispenseItemAndChange();\n void reset();\n}", "String getStockData(String symbol) throws Exception\n\t{\n\t\tfinal String urlHalf1 = \"https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=\";\n\t\tfinal String urlHalf2 = \"&apikey=\";\n\t\tfinal String apiKey = \"FKS0EU9E4K4UQDXI\";\n\n\t\tString url = urlHalf1 + symbol + urlHalf2 + apiKey;\n\n\t\tJsonParser parser = new JsonParser();\n\n\t\tString hitUrl = url;\n\t\tString jsonData = getJsonData(hitUrl);\n\n\t\tJsonElement jsonTree = parser.parse(jsonData);\n\n\t\tString returnData = \"\";\n\n\t\tif (jsonTree.isJsonObject())\n\t\t{\n\t\t\tJsonObject jsonObject = jsonTree.getAsJsonObject();\n\n\t\t\tJsonElement timeSeries = jsonObject.get(\"Time Series (Daily)\");\n\n\t\t\tif (timeSeries.isJsonObject())\n\t\t\t{\n\t\t\t\tJsonObject timeObject = timeSeries.getAsJsonObject();\n\n\t\t\t\tDate date = new Date();\n\n\t\t\t\tCalendar calendar = new GregorianCalendar();\n\t\t\t\tcalendar.setTime(date);\n\n\t\t\t\t// Loop until we reach most recent Friday (market closes on Friday)\n\t\t\t\twhile (calendar.get(Calendar.DAY_OF_WEEK) < Calendar.FRIDAY\n\t\t\t\t\t\t|| calendar.get(Calendar.DAY_OF_WEEK) > Calendar.FRIDAY)\n\t\t\t\t{\n\t\t\t\t\tcalendar.add(Calendar.DAY_OF_MONTH, -1);\n\t\t\t\t}\n\n\t\t\t\tint year = calendar.get(Calendar.YEAR);\n\t\t\t\tint month = calendar.get(Calendar.MONTH) + 1;\n\t\t\t\tint day = calendar.get(Calendar.DAY_OF_MONTH);\n\n\t\t\t\tString dayToString = Integer.toString(day);\n\n\t\t\t\tif (dayToString.length() == 1)\n\t\t\t\t\tdayToString = \"0\" + dayToString;\n\n\t\t\t\tJsonElement currentData = timeObject.get(year + \"-\" + month + \"-\" + dayToString);\n\n\t\t\t\tif (currentData.isJsonObject())\n\t\t\t\t{\n\t\t\t\t\tJsonObject dataObject = currentData.getAsJsonObject();\n\n\t\t\t\t\tJsonElement openPrice = dataObject.get(\"1. open\");\n\t\t\t\t\tJsonElement closePrice = dataObject.get(\"4. close\");\n\t\t\t\t\tJsonElement highPrice = dataObject.get(\"2. high\");\n\t\t\t\t\tJsonElement lowPrice = dataObject.get(\"3. low\");\n\n\t\t\t\t\treturnData = year + \"-\" + month + \"-\" + dayToString + \" - \" + symbol + \": Opening price: $\"\n\t\t\t\t\t\t\t+ openPrice.getAsString() + \" / Closing price: $\" + closePrice.getAsString()\n\t\t\t\t\t\t\t+ \" / High price: $\" + highPrice.getAsString() + \" / Low price: $\" + lowPrice.getAsString();\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\treturn returnData;\n\t}", "public static void main(String[] args) throws Exception {\n \r\n long beginTime = System.nanoTime();\r\n for (int i = 0; i < 50000000; i++) {\r\n// System.out.println(getFlowNo());\r\n getFlowNo();\r\n \r\n }\r\n long endTime = System.nanoTime();\r\n System.out.println(\"onLineWithTransaction cost:\"+((endTime-beginTime)/1000000000) + \"s \" + ((endTime-beginTime)%1000000000) + \"us\");\r\n// \r\n// System.out.println(System.currentTimeMillis());\r\n// TimeUnit.SECONDS.sleep(3);\r\n// System.out.println(System.currentTimeMillis());\r\n }", "@Override\r\n public void onClick(View view) {\n Log.d(\"WTF Buy stock at ppl detail\", \"0001 data:\" + StockData.getStockData(1).getDescription());\r\n Log.d(\"WTF Buy stock at ppl detail\", \"Current M: \" + CommonAccount.getCurrentAccount().getCurrentCash());\r\n\r\n CommonAccount.getCurrentAccount().stockBuySell(1, 100);\r\n Log.d(\"WTF Buy stock at ppl detail\", \"After M: \" + CommonAccount.getCurrentAccount().getCurrentCash());\r\n\r\n Log.d(\"WTF Buy stock at ppl detail\", \"Amount of 0001:\" + CommonAccount.getCurrentAccount().getStockInventory(1));\r\n\r\n\r\n try {\r\n CommonAccount.updateCurrentAccount(activity_ppl_details.this);\r\n }\r\n catch (Exception e)\r\n {\r\n Log.e(\"Cannot stock buy\", e.getMessage());\r\n }\r\n\r\n// Intent intent = new Intent(activity_ppl_details.this, activity_ppl_status.class);\r\n// startActivity(intent);\r\n\r\n Intent returnIntent = new Intent();\r\n setResult(RESULT_OK, returnIntent);\r\n\r\n finish();\r\n\r\n }", "public abstract double sensingTime();", "Price getTradePrice();", "public void dailyInventoryCheck(){\n\n\t\tint i;\n\t\tStock tempStock, tempRestockTracker;\n\t\tint listSizeInventory = this.inventory.size();\n\t\tfor(i = 0; i < listSizeInventory; i++){\n\n\t\t\t\tif(this.inventory.get(i).getStock() == 0){\n\t\t\t\t\t//If stock is 0 add 1 to the out of stock counnter then reset it to the inventory level\n\t\t\t\t\tthis.inventory.get(i).setStock(inventoryLevel);\n\t\t\t\t\tthis.inventoryOrdersDone.get(i).addStock(1);\n\t\t\t\t\t//inventoryOrdersDone.set(i,tempRestockTracker);\n\t\t\t\t\t//tempStock.setStock(inventoryLevel);\n\t\t\t\t\t//this.inventory.set(i,tempStock);\n\t\t\t\t}\n\t\t\t}\n\n\t}", "void reachedCashierAt(int time) {\n reachedCashier = true;\n timeSpentInQueue = time - timeCreated;\n }", "public void buyFuelUpgrades()\n {\n if(play_state.getMoney() >= fuel_upgrade_cost) {\n play_state.setMoney(play_state.getMoney() - fuel_upgrade_cost);\n fuel_upgrade_cost += 100;\n play_state.getDriller().addMax_fuel(10);\n }\n }", "public void operateTheBoatForAmountOfTime(double time){// pass 1 as a time\n\t\t if(time > 0.0 && time <= 5.0 ){\n \tdouble fuelUsage = EfficiencyOfTheBoatMotor*currentSpeedOfTheBoat*currentSpeedOfTheBoat*time;\n \tfuelUsage = fuelUsage/10000;//since we have hp, and miles we have to divide by 10000 to get result in gallons \n double realTime; \n // Determine if we run out of fuel\n\t if(fuelUsage > amountOfFuelInTheTank){ \n\t realTime = time * (amountOfFuelInTheTank/fuelUsage); \n\t amountOfFuelInTheTank=0.0 ;\n\t }else{\n\t \tamountOfFuelInTheTank-=fuelUsage; \n\t realTime = time;\n\t }\n\t DistanceTraveled +=currentSpeedOfTheBoat * realTime; \n\t }\n\t }", "private synchronized int determineLastSaleQuantity(HashMap<String, FillMessage> fills) throws InvalidDataException {\n\t\tif (fills == null) throw new InvalidDataException(\"Fills cannot be null.\");\n\t\tArrayList<FillMessage> msgs = new ArrayList<FillMessage>(fills.values()); \n\t\t//Collections.sort(msgs);\n\t\tCollections.sort(msgs);\n\t\tCollections.reverse(msgs);\n\t\treturn msgs.get(0).getVolume();\n\t}", "private long finTime(){\n \n long result = 0, time = 0;\n Integer[] temp;\n \n while(!this.prior.isEmpty()){\n \n // getting the head of the queue and removing it\n temp = this.prior.poll();\n \n // printing some temp. results\n //System.out.println(\"weight \" + temp[0] + \" length/time \" + temp[1]);\n \n // callculate the finishing time\n time += temp[1];\n \n // calculate the weighted time, we want to minimise\n result += (temp[0]*time);\n }\n return result;\n }", "private void generateTrades() {\n\t\tSystem.out.println(\"\\nGenerating fake trade records for stock: \" + stockSymbol);\n Random rd = new Random();\n \n for (int i = 0; i < 5; i++) {\n // Create arbitrary timestamp and TradeRecord data \n \t// within the last 20 minutes\n \n int minutes = rd.nextInt(21);\n int sharesQty = rd.nextInt(100) + 1;\n boolean isBuy = rd.nextBoolean();\n double price = (rd.nextDouble() + 0.1) * 100;\n // truncate price to 2 decimal places\n String tmpPrc = String.format(Locale.ENGLISH, \"%.2f\", price);\n price = Double.parseDouble(tmpPrc);\n TradeRecordType indicator = isBuy ? TradeRecordType.BUY : TradeRecordType.SELL;\n \n Calendar cal = Calendar.getInstance();\n cal.add(Calendar.MINUTE, -minutes);\n Date date = cal.getTime();\n \n // Create and save fake trade record\n TradeRecord rec = new TradeRecord(date, sharesQty, indicator, price);\n System.out.println(rec);\n this.stockTrades.put(date, rec);\n }\n }", "public void buy(int num) {\r\n\t\t// Make sure there is one in stock and enough gold and in market rooms\r\n\t\tif (marketItemCount[num-1] > 0 && currentPlayer.getGold() >= 7 && (currentPlayer.getCurrentRoom() == 18 || currentPlayer.getCurrentRoom() == 19 || currentPlayer.getCurrentRoom() == 24 || currentPlayer.getCurrentRoom() == 25)) {\r\n\t\t\t// Adjust item index based on how many left\r\n\t\t\tint itemIndex = 0;\r\n\t\t\tif (num == 2) itemIndex = 2;\r\n\t\t\tif (num == 3) itemIndex = 4;\r\n\t\t\twhile (market[itemIndex] == null) {\r\n\t\t\t\titemIndex++;\r\n\t\t\t}\r\n\t\t\tcurrentPlayer.pickup(market[itemIndex]);\r\n\t\t\tcurrentPlayer.updateGold(-7);\r\n\t\t\taddEvent(\"``\"+currentName+\"`` bought a \"+market[itemIndex].substring(0,market[itemIndex].length()-1).replace(\"1\",\"\"),true);\r\n\t\t\taddHistory(market[itemIndex].substring(0,market[itemIndex].length()-1).replace(\"1\",\"\").toUpperCase());\r\n\t\t\tmarket[itemIndex] = null;\r\n\t\t\tmarketItemCount[num-1] -= 1;\r\n\t\t\tupdateMarketAndTreasures(false);\r\n\t\t\tupdatePlayArea(currentPlayer, false);\r\n\t\t\t//updateDungeonRow(currentPlayer, false);\r\n\t\t\tupdateInfo(currentPlayer, false);\r\n\t\t}\r\n\t}", "public static double getGraidentBasedOnTradingDays(IGraphLine aLine, TreeSet<AbstractGraphPoint> listOfTradingDays) {\r\n double result = 0;\r\n if (null != aLine && null != listOfTradingDays) {\r\n AbstractGraphPoint myCurrStart = aLine.getCurrentC();\r\n AbstractGraphPoint myCurrEnd = aLine.getCurrentE();\r\n if (myCurrStart.getDateAsNumber() != myCurrEnd.getDateAsNumber()) {\r\n// TreeSet<AbstractGraphPoint> tDay = new TreeSet<AbstractGraphPoint>(AbstractGraphPoint.TimeComparator);\r\n// tDay.addAll(listOfTradingDays);\r\n //Calc P1\r\n //Get Market close time on start day\r\n Calendar endTrading = DTUtil.deepCopyCalendar(myCurrStart.getCalDate());\r\n endTrading.setTimeZone(DTConstants.EXCH_TIME_ZONE);\r\n endTrading.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_CLOSING_HOUR);\r\n endTrading.set(Calendar.MINUTE, DTConstants.EXCH_CLOSING_MIN);\r\n endTrading.set(Calendar.SECOND, DTConstants.EXCH_CLOSING_SEC);\r\n double p1 = endTrading.getTimeInMillis() - myCurrStart.getCalDate().getTimeInMillis();\r\n //double p1 = endTrading.getTimeInMillis() - (myCurrStart.getCalDate().getTimeInMillis() - DTConstants.MILLSECS_PER_HOUR);\r\n //Now calculate P2\r\n //Get Market open time on end day\r\n Calendar startTrading = DTUtil.deepCopyCalendar(myCurrEnd.getCalDate());\r\n startTrading.setTimeZone(DTConstants.EXCH_TIME_ZONE);\r\n startTrading.set(Calendar.HOUR_OF_DAY, DTConstants.EXCH_OPENING_HOUR);\r\n startTrading.set(Calendar.MINUTE, DTConstants.EXCH_OPENING_MIN);\r\n startTrading.set(Calendar.SECOND, DTConstants.EXCH_OPENING_SEC);\r\n double p2 = (myCurrEnd.getCalDate().getTimeInMillis() - startTrading.getTimeInMillis());\r\n //double p2 = (myCurrEnd.getCalDate().getTimeInMillis() - DTConstants.MILLSECS_PER_HOUR) - startTrading.getTimeInMillis();\r\n //Now calc P3\r\n //Get count of trading days from list\r\n// int currStartDay = myCurrStart.getDateAsNumber();\r\n// int currEndDay = myCurrEnd.getDateAsNumber();\r\n// NavigableSet<AbstractGraphPoint> subSet = new TreeSet<AbstractGraphPoint>();\r\n// for(AbstractGraphPoint currPoint : tDay){\r\n// int currDay = currPoint.getDateAsNumber();\r\n// if(currDay > currStartDay && currDay < currEndDay){\r\n// subSet.add(currPoint);\r\n// }\r\n// }\r\n NavigableSet<AbstractGraphPoint> subSet = listOfTradingDays.subSet(myCurrStart, false, myCurrEnd, false);\r\n ArrayList<AbstractGraphPoint> theSet = new ArrayList<AbstractGraphPoint>();\r\n theSet.addAll(subSet);\r\n for (AbstractGraphPoint currPoint : theSet) {\r\n if (currPoint.getDateAsNumber() == myCurrStart.getDateAsNumber() || currPoint.getDateAsNumber() == myCurrEnd.getDateAsNumber()) {\r\n subSet.remove(currPoint);\r\n }\r\n }\r\n double dayCount = subSet.size();\r\n double p3 = dayCount * DTUtil.msPerTradingDay();\r\n\r\n //Sum all three parts as deltaX\r\n double deltaX = p1 + p2 + p3;\r\n double deltaY = myCurrEnd.getLastPrice() - myCurrStart.getLastPrice();\r\n\r\n //Gradient is deltaY / deltaX\r\n result = deltaY / deltaX;\r\n\r\n System.out.println(\"Delta Y = \" + deltaY);\r\n System.out.println(\"Delta X = \" + deltaX);\r\n System.out.println(aLine.toString());\r\n } else {\r\n result = aLine.getGradient();\r\n System.out.println(aLine.toString());\r\n }\r\n }\r\n return result;\r\n }", "public static void simulate (\r\n double maxtime,\r\n double arrival_rate,\r\n double service_rate0,\r\n double service_rate1,\r\n double service_rate2, \r\n double service_rate3_1,\r\n double service_rate3_2,\r\n double service_rate3_3,\r\n double p1,double p2,double p3,int k, double p01, double p02, double p3out, double p31, double p32)\r\n {\n StateB sysB = new StateB();\r\n \r\n double time= 0;\r\n double value2= ExpB.getExp(arrival_rate);\r\n\r\n EventB e1 = new EventB(time+value2,\"Birth\",\"Null\");\r\n EventB e2= new EventB(time+value2,\"Moniter\",\"Null\");\r\n Schedule.add(e1);\r\n Schedule.add(e2);\r\n \r\n while(time < maxtime){\r\n EventB next = Schedule.remove();\r\n time= next.time;\r\n next.function(maxtime,arrival_rate,service_rate0,service_rate1,service_rate2, service_rate3_1,\r\n service_rate3_2,service_rate3_3,p1,p2,p3,k,p01,p02,p3out,p31,p32,sysB);\r\n \r\n \r\n \r\n\r\n }\r\n // System.out.println(Double.toString(sysB.t_busy_time0) );\r\n // System.out.println(Double.toString(sysB.t_busy_time1) );\r\n // System.out.println(Double.toString(sysB.Qlength0) );\r\n // System.out.println(Double.toString(sysB.Qlength1) );\r\n // System.out.println(Double.toString(sysB.monitering_event) );\r\n // System.out.println(Double.toString(sysB.num_drop) );\r\n // System.out.println(Double.toString(sysB.completed_request) );\r\n // System.out.println(Double.toString(sysB.t_response_time) );\r\n\r\n System.out.println();\r\n double util0 = sysB.t_busy_time0 / maxtime;\r\n System.out.println(\"S0 UTIL:\"+ \" \" + Double.toString(util0) );\r\n double qlen0 = sysB.Qlength0/ sysB.monitering_event;\r\n System.out.println(\"S0 QLEN:\"+\" \"+ Double.toString(qlen0) );\r\n double Tresp0 = sysB.t_response_time0/sysB.completed_request0;\r\n System.out.println(\"S0 TRESP:\" + \" \"+ Double.toString(Tresp0) );\r\n \r\n System.out.println();\r\n \r\n double util11 = sysB.t_busy_time11/ maxtime;\r\n System.out.println(\"S1,1 UTIL:\"+ \" \" + Double.toString(util11) );\r\n double util12 = sysB.t_busy_time12/ maxtime;\r\n System.out.println(\"S1,2 UTIL:\"+ \" \" + Double.toString(util12) );\r\n double qlen11 = sysB.Qlength1/ sysB.monitering_event;\r\n System.out.println(\"S1 QLEN:\"+\" \"+ Double.toString(qlen11) );\r\n double Tresp11 = sysB.t_response_time1/ sysB.completed_request1;\r\n System.out.println(\"S1 TRESP:\" + \" \"+ Double.toString(Tresp11) );\r\n \r\n \r\n // System.out.println();\r\n // double util12 = sysB.t_busy_time12/ maxtime;\r\n // System.out.println(\"S1,2 UTIL:\"+ \" \" + Double.toString(util12) );\r\n // double qlen12 = sysB.Qlength1/ sysB.monitering_event;\r\n // System.out.println(\"S1,2 QLEN:\"+\" \"+ Double.toString(qlen12) );\r\n // double Tresp12 = sysB.t_response_time12/sysB.completed_request12;\r\n // System.out.println(\"S1,2 TRESP:\" + \" \"+ Double.toString(Tresp12) );\r\n\r\n System.out.println();\r\n double util2 = sysB.t_busy_time2/ maxtime;\r\n System.out.println(\"S2 UTIL:\"+ \" \" + Double.toString(util2) );\r\n double qlen2 = sysB.Qlength2/ sysB.monitering_event;\r\n System.out.println(\"S2 QLEN:\"+\" \"+ Double.toString(qlen2) );\r\n double Tresp2 = sysB.t_response_time2/sysB.completed_request2;\r\n System.out.println(\"S2 TRESP:\" + \" \"+ Double.toString(Tresp2) );\r\n System.out.println(\"S2 DROPPED:\" + \" \"+ Integer.toString(sysB.num_drop));\r\n\r\n System.out.println();\r\n double util3 = sysB.t_busy_time3/ maxtime;\r\n System.out.println(\"S3 UTIL:\"+ \" \" + Double.toString(util3) );\r\n double qlen3 = sysB.Qlength3/ sysB.monitering_event;\r\n System.out.println(\"S3 QLEN:\"+\" \"+ Double.toString(qlen3) );\r\n double Tresp3 = sysB.t_response_time3/sysB.completed_request3;\r\n System.out.println(\"S3 TRESP:\" + \" \"+ Double.toString(Tresp3) );\r\n\r\n \r\n\r\n System.out.println();\r\n\r\n double qtotal = (sysB.Qlength0 + sysB.Qlength1 + sysB.Qlength2+sysB.Qlength3) / sysB.monitering_event;\r\n System.out.println(\"QTOT:\"+\" \"+ Double.toString(qtotal) );\r\n // double Totalresp= sysB.t_response_time0 + sysB.t_response_time2 +sysB.t_response_time11 +sysB.t_response_time12 + sysB.t_response_time3;\r\n \r\n double total = sysB.t_response_timefinal/sysB.completed_system;\r\n \r\n System.out.println(\"TRESP:\"+ \" \" + Double.toString(total));\r\n // System.out.println(sysB.Qlength1);\r\n // System.out.println(sysB.Qlength2);\r\n // System.out.println(sysB.Qlength3);\r\n // System.out.println(sysB.Qlength0);\r\n \r\n // System.out.println(\"TRESP:\"+ \" \" + Double.toString(TTRESP));\r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n }", "public int TransBuy(Long userid,Long compid,Long newbalance,Double amount)throws SQLException {\n\tjava.util.Date d=new java.util.Date();\r\n\tSimpleDateFormat sd=new SimpleDateFormat(\"dd-MMM-yy\");\r\n\tString sdate=sd.format(d);\r\n\tResultSet rs1=DbConnect.getStatement().executeQuery(\"select * from transaction where type='purchase' and bywhom='self' and comp_id=\"+compid+\" and DATEOFTRANS='\"+sdate+\"' and user_id=\"+userid+\"\");\r\n\tif(rs1.next()==true)\r\n\t{\r\n\t\tint l=DbConnect.getStatement().executeUpdate(\"update transaction set amount=amount+\"+amount+\",SHAREAMOUNT=SHAREAMOUNT+\"+newbalance+\" where type='purchase' and bywhom='self' and comp_id=\"+compid+\" and DATEOFTRANS='\"+sdate+\"' and user_id=\"+userid+\" \");\r\n\t}\r\n\telse\r\n\t{\r\n\t\tint i=DbConnect.getStatement().executeUpdate(\"Insert into transaction values(trans_seq.nextval,\"+userid+\",'\"+sdate+\"',\"+amount+\",'purchase','self',\"+compid+\",\"+newbalance+\")\");\r\n\r\n\t}\r\n\t\tResultSet rss=DbConnect.getStatement().executeQuery(\"select * from FINALALLOCATION where user_id=\"+userid+\" and comp_id=\"+compid+\" \");\r\n\tif(rss.next()==true)\r\n\t{\r\n\t\tint j=DbConnect.getStatement().executeUpdate(\"update FINALALLOCATION set no_share=no_share+\"+newbalance+\" where user_id=\"+userid+\" and comp_id=\"+compid+\" \");\t\r\n\t}\r\n\telse\r\n\t{\r\n\t\tint k=DbConnect.getStatement().executeUpdate(\"insert into FINALALLOCATION values(\"+userid+\",\"+compid+\",\"+newbalance+\")\");\r\n\t}\r\n\treturn 1;\r\n}", "public void changeStockVal() {\n double old = _stockVal;\n _stockVal = 0;\n for (Company x : _stocks.keySet()) {\n _stockVal += x.getPrice() * _stocks.get(x);\n }\n _stockValChanged = _stockVal - old;\n\n }", "public Date getActualSellingTime() {\n return actualSellingTime;\n }", "String getBackOffMultiplier();", "@Override\n public void actionPerformed(ActionEvent e) {\n if (String.valueOf(txtScannedItem.getText()).equals(\"\")) {\n\n JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),\n \"You did not enter a product.\",\n \"No Item Found\",\n JOptionPane.WARNING_MESSAGE);\n }\n\n Stock addedStock = new Stock();\n addedStock.setItemID(txtScannedItem.getText());\n\n try{\n for (int a = 0; a < subStock.size(); a ++) {\n if (addedStock.getItemID().equals(subStock.get(a).getItemID())) {\n\n txtBasket.setText(\"\");\n //Gets the value of the stock levels\n int CustStock = subStock.get(a).getQuantity();\n\n //Gets the value of the active stock levels\n int activeShop = subStock.get(a).getActiveStock();\n\n //A variable for the total of Stock - Active stock\n int newStockNum = 0;\n\n\n //Checks to see if stock is at 0, if not for the stock calculation\n if(subStock.get(a).getQuantity() == 0){\n\n txtScannedItem.setText(\"\");\n\n //Shoots a message to notify the customer that their scanned item has now more stock\n JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),\n \"No more stock of: \" + subStock.get(a).getItemName(),\n \"No more Stock\",\n JOptionPane.WARNING_MESSAGE);\n\n }else{\n activeShop += 1;\n\n newStockNum = CustStock - activeShop;\n }\n\n subStock.get(a).setActiveStock(activeShop);\n subStock.get(a).setQuantity(newStockNum);\n\n display.saveStock();\n\n //for each object inside this object do this\n for(Stock stock : subStock){\n //Ensures items that have not been scanned are left out the basket\n if(stock.getActiveStock() > 0){\n txtBasket.append(stock.getActiveStock() + \" x \" + \"\"\n + stock.getItemName() + \".....£\"\n + String.format(\"%.02f\", stock.getItemPrice())\n + \" each\" + \"\\n\");\n }\n }\n float basketTotal = subStock.get(a).getItemPrice();\n //Provides a middle ground so that the accumulated total is displayed\n float runningTotal = Float.sum(basketTotal, finalTotal);\n finalTotal = runningTotal;\n\n //Shows the final total of the compiled basket\n String priceToString = String.format(\"%.02f\", finalTotal);\n lblTotal.setText(\"Total: \" + \" £ \" + priceToString);\n break;\n }\n }\n\n //Places the items in the txt in an Object (For threading)\n currentReceipt = txtBasket.getText();\n\n }catch (Exception i){\n i.printStackTrace();\n }\n\n //Clears the scanned item txt field\n txtScannedItem.setText(\"\");\n }" ]
[ "0.721406", "0.6931918", "0.6159907", "0.6100278", "0.6081196", "0.60721457", "0.6016599", "0.59862924", "0.59729093", "0.5942486", "0.5940168", "0.5938706", "0.5913399", "0.5896128", "0.5879833", "0.5876131", "0.5858387", "0.58461964", "0.5845592", "0.58421284", "0.5836359", "0.5834852", "0.580836", "0.57926893", "0.5758925", "0.57502186", "0.57356143", "0.56666255", "0.56628245", "0.56617725", "0.56400573", "0.5638521", "0.56233937", "0.5599583", "0.55886304", "0.55704373", "0.55523914", "0.55450565", "0.5531986", "0.5531611", "0.55218345", "0.5503762", "0.550334", "0.54955834", "0.54576206", "0.54569495", "0.54565585", "0.5449696", "0.54422164", "0.5439883", "0.54333085", "0.5428467", "0.54236305", "0.54198956", "0.54164827", "0.54123104", "0.54118615", "0.540934", "0.540934", "0.5397471", "0.5395329", "0.53880143", "0.53808624", "0.5380785", "0.537749", "0.5369109", "0.5367246", "0.53539187", "0.5349595", "0.533969", "0.5339028", "0.533422", "0.5332252", "0.5327665", "0.5326575", "0.5323189", "0.532276", "0.53107876", "0.5305725", "0.53017604", "0.5297977", "0.52963716", "0.52898943", "0.5286459", "0.5286073", "0.52805257", "0.527973", "0.52759284", "0.5273022", "0.5272198", "0.52682656", "0.52596664", "0.5258972", "0.5257059", "0.5244689", "0.52303004", "0.52275616", "0.5224313", "0.5220904", "0.52175826", "0.5214904" ]
0.0
-1
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_category, container, false); rvCats = view.findViewById(R.id.rvCats); dataViewCats = view.findViewById(R.id.dataViewCats); errorViewCats = view.findViewById(R.id.errorViewCats); btnUploadRequirement = view.findViewById(R.id.btnUploadRequirement); inputSearch = view.findViewById(R.id.inputSearch); slider = view.findViewById(R.id.banner_slider); // sliderImageList.addAll(response.body()); slider.setAdapter(new MainSliderAdapter()); slider.setSelectedSlide(0); // getSliderImages(); getAllCategories(); //recycler view rvCats.setHasFixedSize(true); GridLayoutManager llm = new GridLayoutManager(getActivity(),3); // LinearLayoutManager llm = new LinearLayoutManager(getActivity()); // llm.setOrientation(LinearLayoutManager.VERTICAL); rvCats.setLayoutManager(llm); categoryAdapter = new CategoryAdapter(getActivity(),catList); categoryAdapter.setCatClickListner(this); rvCats.setAdapter(categoryAdapter); //recycler ended productAutoCompleteAdapter = new ProductAutoCompleteAdapter(getActivity(),productsList); inputSearch.setAdapter(productAutoCompleteAdapter); productAutoCompleteAdapter.setSugClickListner(this); btnUploadRequirement.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { checkPermission(); } }); return view; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.wallpager_layout, null);\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_invit_friends, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_zhuye, container, false);\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_posts, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n return inflater.inflate(R.layout.ilustration_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_sow_drug_cost_per_week, container, false);\n\n db = new DataBaseAdapter(getActivity());\n hc = new HelperClass();\n pop = new FeedSowsFragment();\n\n infltr = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n parent = (LinearLayout) v.findViewById(R.id.layout_for_add);\n tvTotalCost = (TextView) v.findViewById(R.id.totalCost);\n\n getData();\n setData();\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_stream_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_event, container, false);\n\n\n\n\n\n\n\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_feed, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.screen_select_list_student, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_overall, container, false);\n mNamesLayout = (LinearLayout) rootView.findViewById(R.id.fragment_overall_names_layout);\n mOverallView = (OverallView) rootView.findViewById(R.id.fragment_overall_view);\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState)\n {\n\n\n view = inflater.inflate(R.layout.fragment_earning_fragmant, container, false);\n ini(view);\n return view;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n super.onCreateView(inflater, container, savedInstanceState);\n final View rootview = inflater.inflate(R.layout.activity_email_frag, container, false);\n ConfigInnerElements(rootview);\n return rootview;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\trootView = inflater.inflate(R.layout.fragment_attack_armor, container, false);\r\n\r\n\t\tfindInterfaceElements();\r\n\t\taddRangeSelector();\r\n\t\tupdateHeadings();\r\n\t\tsetListeners();\r\n\r\n\t\tsetFromData();\r\n\r\n\t\treturn rootView;\r\n\t}", "@SuppressLint(\"InflateParams\")\r\n\t@Override\r\n\tpublic View initLayout(LayoutInflater inflater) {\n\t\tView view = inflater.inflate(R.layout.frag_customer_all, null);\r\n\t\treturn view;\r\n\t}", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_fore_cast, container, false);\r\n initView();\r\n mainLayout.setVisibility(View.GONE);\r\n apiInterface = RestClinet.getClient().create(ApiInterface.class);\r\n loadData();\r\n return view;\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_friend, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_detail, container, false);\n image = rootView.findViewById(R.id.fr_image);\n name = rootView.findViewById(R.id.fr_name);\n phoneNumber = rootView.findViewById(R.id.fr_phone_number);\n email = rootView.findViewById(R.id.fr_email);\n street = rootView.findViewById(R.id.fr_street);\n city = rootView.findViewById(R.id.fr_city);\n state = rootView.findViewById(R.id.fr_state);\n zipcode = rootView.findViewById(R.id.fr_zipcode);\n dBrith = rootView.findViewById(R.id.date_brith);\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_pm25, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_kkbox_playlist, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_feed_pager, container, false);\n\n// loadData();\n\n findViews(rootView);\n\n setViews();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n layout = (FrameLayout) inflater.inflate(R.layout.fragment_actualites, container, false);\n\n relLayout = (RelativeLayout) layout.findViewById(R.id.relLayoutActus);\n\n initListView();\n getXMLData();\n\n return layout;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.frag_post_prayer_video, container, false);\n setCustomDesign();\n setCustomClickListeners();\n return rootView;\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.lf_em4305_fragment, container, false);\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_recordings, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view=inflater.inflate(R.layout.fragment_category, container, false);\n initView(view);\n bindRefreshListener();\n loadParams();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_cm_box_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_layout12, container, false);\n\n iniv();\n\n init();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_details, container, false);\n //return inflater.inflate(R.layout.fragment_details, container, false);\n getIntentValues();\n initViews();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_mem_body_blood, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_qiugouxiaoxi, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_coll_blank, container, false);\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_attendance_divide, container, false);\n\n initView(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.show_program_fragment, parent, false);\n }", "@Override\n public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,\n @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.visualization_fragment, container, false);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_category_details_page, container, false);\n initializeAll();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n final View v = inflater.inflate(R.layout.fragemnt_reserve, container, false);\n\n\n\n\n return v;\n }", "protected int getLayoutResId() {\n return R.layout.activity_fragment;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_all_quizs, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n role = getArguments().getInt(\"role\");\n rootview = inflater.inflate(R.layout.fragment_application, container, false);\n layout = rootview.findViewById(R.id.patentDetails);\n progressBar = rootview.findViewById(R.id.progressBar);\n try {\n run();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return rootview;\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\tview = inflater.inflate(R.layout.fragment_zhu, null);\n\t\tinitView();\n\t\tinitData();\n\t\treturn view;\n\t}", "@Override\n\t\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)\n\t\t{\n\t\t\tView rootView = inflater.inflate(R.layout.maimfragment, container, false);\n\t\t\treturn rootView;\n\t\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n // Inflate the layout for this fragment\n return inflater.inflate(R.layout.fragment__record__week, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_porishongkhan, container, false);\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_dashboard, container, false);\n resultsRv = view.findViewById(R.id.db_results_rv);\n resultText = view.findViewById(R.id.db_search_empty);\n progressBar = view.findViewById(R.id.db_progressbar);\n lastVisitText = view.findViewById(R.id.db_last_visit);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(getLayoutId(), container, false);\n init(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_feedback, container, false);\n self = getActivity();\n initUI(view);\n initControlUI();\n initData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_service_summery, container, false);\n tvVoiceMS = v.findViewById(R.id.tvVoiceValue);\n tvDataMS = v.findViewById(R.id.tvdataValue);\n tvSMSMS = v.findViewById(R.id.tvSMSValue);\n tvVoiceFL = v.findViewById(R.id.tvVoiceFLValue);\n tvDataBS = v.findViewById(R.id.tvDataBRValue);\n tvTotal = v.findViewById(R.id.tvTotalAccountvalue);\n return v;\n }", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_clan_rank_details, container, false);\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_star_wars_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_lei, container, false);\n\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_quotation, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_wode_ragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n\n\n\n\n\n return inflater.inflate(R.layout.fragment_appoint_list, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n if (rootView == null) {\n rootView = inflater.inflate(R.layout.fragment_ip_info, container, false);\n initView();\n }\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_offer, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_rooms, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\n View view = inflater.inflate(R.layout.fragment_img_eva, container, false);\n\n getSendData();\n\n initView(view);\n\n initData();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_project_collection, container, false);\n ButterKnife.bind(this, view);\n fragment = this;\n initView();\n getCollectionType();\n // getCategoryList();\n initBroadcastReceiver();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_yzm, container, false);\n initView(view);\n return view;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\t\tmainLayout = inflater.inflate(R.layout.fragment_play, container, false);\r\n\t\treturn mainLayout;\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_invite_request, container, false);\n initialiseVariables();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n getLocationPermission();\n return inflater.inflate(R.layout.centrum_fragment, container, false);\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_habit_type_details, container, false);\n\n habitTitle = rootView.findViewById(R.id.textViewTitle);\n habitReason = rootView.findViewById(R.id.textViewReason);\n habitStartDate = rootView.findViewById(R.id.textViewStartDate);\n habitWeeklyPlan = rootView.findViewById(R.id.textViewWeeklyPlan);\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_information_friends4, container, false);\n\n if (getArguments() != null) {\n FriendsID = getArguments().getString(\"keyFriends\");\n }\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_post_details, container, false);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_hotel, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_bus_inquiry, container, false);\n initView();\n initData();\n initDialog();\n getDataFromNet();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_weather, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_srgl, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_ground_detail_frgment, container, false);\n init();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_book_appointment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_wheretogo, container, false);\n ids();\n setup();\n click();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n binding = DataBindingUtil\n .inflate(inflater, R.layout.fragment_learning_leaders, container, false);\n init();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_end_game_tab, container, false);\n\n setupWidgets();\n setupTextFields(view);\n setupSpinners(view);\n\n // Inflate the layout for this fragment\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.memoir_fragment, container, false);\n\n getUserIdFromSharedPref();\n configureUI(view);\n configureSortSpinner();\n configureFilterSpinner();\n\n networkConnection = new NetworkConnection();\n new GetAllMemoirTask().execute();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_jadwal, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_delivery_detail, container, false);\n initialise();\n\n\n\n return view;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_4, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_all_product, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_group_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment06_7, container, false);\n initView(view);\n setLegend();\n setXAxis();\n setYAxis();\n setData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_downloadables, container, false);\n }", "@Override\n public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.movie_list_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_like, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_hall, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_unit_main, container, false);\n TextView mTxvBusinessAassistant = (TextView) view.findViewById(R.id.txv_business_assistant);\n TextView mTxvCardINformation = (TextView) view.findViewById(R.id.txv_card_information);\n RelativeLayout mRelOfficialWebsite = (RelativeLayout) view.findViewById(R.id.rel_official_website);\n RelativeLayout mRelPictureAblum = (RelativeLayout) view.findViewById(R.id.rel_picture_album);\n TextView mTxvQrCodeCard = (TextView) view.findViewById(R.id.txv_qr_code_card);\n TextView mTxvShareCard = (TextView) view.findViewById(R.id.txv_share_card);\n mTxvBusinessAassistant.setOnClickListener(this.mOnClickListener);\n mTxvCardINformation.setOnClickListener(this.mOnClickListener);\n mRelOfficialWebsite.setOnClickListener(this.mOnClickListener);\n mRelPictureAblum.setOnClickListener(this.mOnClickListener);\n mTxvQrCodeCard.setOnClickListener(this.mOnClickListener);\n mTxvShareCard.setOnClickListener(this.mOnClickListener);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_moviespage, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_s, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_overview, container, false);\n\n initOverviewComponents(view);\n registerListeners();\n initTagListener();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_bahan_ajar, container, false);\n initView(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n root = (ViewGroup) inflater.inflate(R.layout.money_main, container, false);\n context = getActivity();\n initHeaderView(root);\n initView(root);\n\n getDate();\n initEvetn();\n return root;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_historical_event, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_event_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_video, container, false);\n unbinder = ButterKnife.bind(this, view);\n initView();\n initData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n v= inflater.inflate(R.layout.fragment_post_contacts, container, false);\n this.mapping(v);\n return v;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_measures, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_feed, container, false);\n findViews(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_surah_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_data_binded, container, false);\n }" ]
[ "0.6739604", "0.67235583", "0.6721706", "0.6698254", "0.6691869", "0.6687986", "0.66869223", "0.6684548", "0.66766286", "0.6674615", "0.66654444", "0.66654384", "0.6664403", "0.66596216", "0.6653321", "0.6647136", "0.66423255", "0.66388357", "0.6637491", "0.6634193", "0.6625158", "0.66195583", "0.66164845", "0.6608733", "0.6596594", "0.65928894", "0.6585293", "0.65842897", "0.65730995", "0.6571248", "0.6569152", "0.65689117", "0.656853", "0.6566686", "0.65652984", "0.6553419", "0.65525705", "0.65432084", "0.6542382", "0.65411425", "0.6538022", "0.65366334", "0.65355957", "0.6535043", "0.65329415", "0.65311074", "0.65310687", "0.6528645", "0.65277404", "0.6525902", "0.6524516", "0.6524048", "0.65232015", "0.65224624", "0.65185034", "0.65130377", "0.6512968", "0.65122765", "0.65116245", "0.65106046", "0.65103024", "0.6509013", "0.65088093", "0.6508651", "0.6508225", "0.6504662", "0.650149", "0.65011525", "0.6500686", "0.64974767", "0.64935696", "0.6492234", "0.6490034", "0.6487609", "0.6487216", "0.64872116", "0.6486594", "0.64861935", "0.6486018", "0.6484269", "0.648366", "0.6481476", "0.6481086", "0.6480985", "0.6480396", "0.64797544", "0.647696", "0.64758915", "0.6475649", "0.6474114", "0.6474004", "0.6470706", "0.6470275", "0.64702207", "0.6470039", "0.6467449", "0.646602", "0.6462256", "0.64617974", "0.6461681", "0.6461214" ]
0.0
-1
Create a new share dialog.
public ShareDialogW(final AppW app, Widget anchor, Widget geogebraButton, String shareURL) { super(app.getPanel(), app); this.anchor = anchor; this.app = app; this.loc = app.getLocalization(); this.shareURL = shareURL; this.geogebraButton = geogebraButton; this.setGlassEnabled(true); this.getCaption().setText(app.getLocalization().getMenu("Share")); this.contentPanel = new VerticalPanel(); this.contentPanel.add(getTabPanel()); this.add(this.contentPanel); addStyleName("shareDialog"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void gppShare_openBasicShareDialog () {\n\t\tGPPShare.sharedInstance().shareDialog().open();\n\t}", "public void dialogShare()\n\t {\n\t \tAlertDialog.Builder builder = new AlertDialog.Builder(this); \n\t \tbuilder\n\t \t.setMessage(\"Congratulations! you just finished the \" + dayName + \" workout!! Do you want to tell your friends?\")\n\t \t.setTitle(\"Share with your Friends?\")\n\t .setCancelable(false)\n\t .setNegativeButton(\"Yes\", new DialogInterface.OnClickListener() {\n\t \t//since they said yes, we are going to show them the share dialog\n\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\tIntent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);\n\t\t\t\t\tsharingIntent.setType(\"text/plain\");\n\t\t\t\t\tString URL = \"http://market.android.com/details?id=com.appsmarttech.ultitrack92\";\n\t\t\t\t\tString shareBody = \"I just completed \" + dayID + \" of the P90X, and I tracked it using UltiTrack! get it here \" + URL;\n\t\t\t\t\tsharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, \"I am Awesome!!!\");\n\t\t\t\t\tsharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);\n\t\t\t\t\tstartActivity(Intent.createChooser(sharingIntent, \"Share via\"));\n\t\t\t\t\tfinish();\n\t\t\t\t\t\n\t\t\t\t}\n\t })\n\n\t .setPositiveButton(\"No\", new DialogInterface.OnClickListener() {\n\t public void onClick(DialogInterface dialog, int which) {\n\t\t\t\t//since they said no, we take them to the launch activity\n\t \t\n\t\t\t\tstartActivity(intent);\n\t\t\t\t}\n\t });\n\t \t\n\t \tAlertDialog alert = builder.create();\n\t \t\n\t \talert.show();\n\t }", "@Override\n\tpublic void onShareButton() {\n\t\tDialogs.getShareEditDialog(this, false).show();\n\t}", "private void createShareIntent() {\n String body2 = TEXT_TO_SHARE2;\n\n //Step 2: Create the shareIntent with action 'Intent.ACTION_SEND'\n Intent sendIntent = new Intent(Intent.ACTION_SEND);\n\n //Step 3: Specify the intent type\n //E.g. shareIntent.setType(\"text/plain\");\n sendIntent.setType(\"text/plain\");\n\n //Step 4: Add the text to share as an extra data (Intent.EXTRA_TEXT)\n sendIntent.putExtra(Intent.EXTRA_TEXT, body2);\n\n Intent shareIntent = Intent.createChooser(sendIntent, null);\n\n //Step 5: Start shareIntent\n startActivity(shareIntent);\n\n }", "@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tAlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(\n\t\t\t\t\tMainActivity.nowcontext);\n\t\n\t\t\t\t// set title\n\t\t\t alertDialogBuilder.setTitle(\"Share on FaceBook\");\n\t\n\t\t\t\t// set dialog message\n\t\t\t\t\n\t\t\t\talertDialogBuilder\n\t\t\t\t\t.setMessage(\"You will share it on FaceBook!\")\n\t\t\t\t\t.setCancelable(false)\n\t\t\t\t\t.setPositiveButton(\"Yes\",new DialogInterface.OnClickListener() {\n\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,int id) {\n\t\t\t\t\t\t\t// if this button is clicked, close\n\t\t\t\t\t\t\t// current activity\n\t\t\t\t\t\t\t fbsharecode();\n\t\t\t\t\t\t}\n\t\t\t\t\t })\n\t\t\t\t\t.setNegativeButton(\"No\",new DialogInterface.OnClickListener() {\n\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,int id) {\n\t\t\t\t\t\t\t// if this button is clicked, just close\n\t\t\t\t\t\t\t// the dialog box and do nothing\n\t\t\t\t\t\t\tdialog.cancel();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\n\t\t\t\t\t// create alert dialog\n\t\t\t\t\tAlertDialog alertDialog = alertDialogBuilder.create();\n\t\n\t\t\t\t\t// show it\n\t\t\t\t\talertDialog.show();\n\t\t\t\t\tmsharePopupWindow.dismiss(); \n\t\t\t\t\tisup=false;\n\t\t\t\n\t\t\t\t}", "@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tAlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(\n\t\t\t\t\tMainActivity.nowcontext);\n\t\n\t\t\t\t// set title\n\t\t\t alertDialogBuilder.setTitle(\"Share on FaceBook\");\n\t\n\t\t\t\t// set dialog message\n\t\t\t\t\n\t\t\t\talertDialogBuilder\n\t\t\t\t\t.setMessage(\"You will share it on FaceBook!\")\n\t\t\t\t\t.setCancelable(false)\n\t\t\t\t\t.setPositiveButton(\"Yes\",new DialogInterface.OnClickListener() {\n\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,int id) {\n\t\t\t\t\t\t\t// if this button is clicked, close\n\t\t\t\t\t\t\t// current activity\n\t\t\t\t\t\t\t fbsharecode();\n\t\t\t\t\t\t}\n\t\t\t\t\t })\n\t\t\t\t\t.setNegativeButton(\"No\",new DialogInterface.OnClickListener() {\n\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,int id) {\n\t\t\t\t\t\t\t// if this button is clicked, just close\n\t\t\t\t\t\t\t// the dialog box and do nothing\n\t\t\t\t\t\t\tdialog.cancel();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\n\t\t\t\t\t// create alert dialog\n\t\t\t\t\tAlertDialog alertDialog = alertDialogBuilder.create();\n\t\n\t\t\t\t\t// show it\n\t\t\t\t\talertDialog.show();\n\t\t\t\t\tmsharePopupsmallWindow.dismiss(); \n\t\t\t\t\tisup=false;\n\t\t\t\n\t\t\t\t}", "protected void addShare() {\n \t\t((InputMethodManager) this.getContext().getSystemService(\n \t\t\t\tContext.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(\n \t\t\t\tthis.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);\n \t\tIntent intent = new Intent(Intent.ACTION_SEND);\n \t\tArrayList<String> images = this.mNoteItemModel.getImages();\n \t\tLog.i(TAG, images.toString());\n \t\tif (images.isEmpty())\n \t\t\tintent.setType(\"text/plain\");\n \t\telse if (images.size() == 1) {\n \t\t\tintent.setType(\"image/*\");\n \t\t} else if (images.size() > 1) {\n \t\t\tintent.setAction(Intent.ACTION_SEND_MULTIPLE);\n \t\t\tintent.setType(\"images/*\");\n \t\t}\n \t\tintent.putExtra(Intent.EXTRA_TITLE, \"Share my note...\");\n \t\tintent.putExtra(Intent.EXTRA_TEXT, this.mNoteItemModel.getContent());\n \t\tif (images.size() == 1) {\n \t\t\tUri uri = this.mNoteItemModel.getImageUri(images.get(0));\n \t\t\tintent.putExtra(Intent.EXTRA_STREAM, uri);\n \t\t} else if (images.size() > 1) {\n \t\t\tArrayList<Uri> uris = new ArrayList<Uri>();\n \t\t\tfor (String image : images) {\n \t\t\t\turis.add(this.mNoteItemModel.getImageUri(image));\n \t\t\t}\n \t\t\tintent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);\n \t\t}\n \t\tthis.getContext().startActivity(Intent.createChooser(intent, \"Share\"));\n \t}", "public void share(View view){\n Toast.makeText(this, \"Loading share options ...\", Toast.LENGTH_SHORT).show();\n //Create an intent to share\n Intent sharingIntent = new Intent(Intent.ACTION_SEND);\n sharingIntent.setType(\"text/plain\");\n String shareBody = \"You should check out \" + getString(R.string.app_name) + \", an app where you can easily find books at the school library!\";\n if(currentBook.title != null)\n shareBody = \"Check out \\\"\" + currentBook.title + \"\\\", a book that I found with the app, \" + getString(R.string.app_name);\n sharingIntent.putExtra(Intent.EXTRA_SUBJECT, \"\" + getString(R.string.app_name));\n sharingIntent.putExtra(Intent.EXTRA_TEXT, shareBody);\n startActivity(Intent.createChooser(sharingIntent, \"Share via\"));\n }", "protected void shareIt() {\n\t\tIntent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);\r\n\t\tsharingIntent.setType(\"text/plain\");\r\n\t\tString shareBody = content.getText().toString();\r\n\t\tsharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, \"Sharing\");\r\n\t\tsharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);\r\n\t\tstartActivity(Intent.createChooser(sharingIntent, \"Share via\"));\r\n\t}", "@Override\n public void onClick(View view) {\n Intent sharingIntent = new Intent(Intent.ACTION_SEND);\n sharingIntent.setType(\"text/plain\");\n sharingIntent.putExtra(Intent.EXTRA_TITLE,title );\n sharingIntent.putExtra(Intent.EXTRA_TEXT,description);\n startActivity(Intent.createChooser(sharingIntent,\"Share using\"));\n\n }", "private void publishShareDialog(String url, String description){\n FacebookDialog shareDialog = new FacebookDialog.ShareDialogBuilder(this)\n .setLink(url)\n .setDescription(description)\n .build();\n uiHelper.trackPendingDialogCall(shareDialog.present());\n }", "public void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\tIntent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);\n\t\t\t\t\tsharingIntent.setType(\"text/plain\");\n\t\t\t\t\tString URL = \"http://market.android.com/details?id=com.appsmarttech.ultitrack92\";\n\t\t\t\t\tString shareBody = \"I just completed \" + dayID + \" of the P90X, and I tracked it using UltiTrack! get it here \" + URL;\n\t\t\t\t\tsharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, \"I am Awesome!!!\");\n\t\t\t\t\tsharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);\n\t\t\t\t\tstartActivity(Intent.createChooser(sharingIntent, \"Share via\"));\n\t\t\t\t\tfinish();\n\t\t\t\t\t\n\t\t\t\t}", "private void launchShareIntent() {\n Intent sendIntent = new Intent();\n sendIntent.setAction(Intent.ACTION_SEND);\n sendIntent.putExtra(Intent.EXTRA_TEXT, gif.getFullGif().getUrl());\n sendIntent.setType(\"text/plain\");\n startActivity(Intent.createChooser(sendIntent, getString(R.string.share_dialog_title)));\n }", "@Override\n public void onClick(View v) {\n String shareBody =item.title.toString()+\"\\n\\n\"+getResources().getString(R.string.item_show)+\"\\n\"+ Config.APP_IMAGES_URL.replace(\"uploads/\",\"share/\")+item.id;\n Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);\n sharingIntent.setType(\"text/plain\");\n sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);\n sharingIntent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.app_name));\n startActivity(Intent.createChooser(sharingIntent, getResources().getString(R.string.app_name)));\n }", "@Override\r\n\tpublic Share create(long shareId) {\r\n\t\tShare share = new ShareImpl();\r\n\r\n\t\tshare.setNew(true);\r\n\t\tshare.setPrimaryKey(shareId);\r\n\r\n\t\tString uuid = PortalUUIDUtil.generate();\r\n\r\n\t\tshare.setUuid(uuid);\r\n\r\n\t\tshare.setCompanyId(companyProvider.getCompanyId());\r\n\r\n\t\treturn share;\r\n\t}", "@PostMapping(value = \"/profile/{idSender}/share\")\n\tpublic void share(@PathVariable long idSender, @RequestBody CreateShareForm createShareForm, Errors errors) {\n\n\t\t// check if entities constraints are respected\n\t\tconstraintViolationCheck(errors);\n\n\t\tshareServices.createShare(idSender, createShareForm);\n\t}", "@Override\n public void onClick(View v) {\n Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);\n sharingIntent.setType(\"text/plain\");\n String shareBody = caption + \" - \" + description;\n sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, \"Sobers Stories\");\n sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);\n startActivity(Intent.createChooser(sharingIntent, \"Share With Friends\"));\n\n }", "private void showDialog(){\n AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity());\n LayoutInflater inflater = this.getLayoutInflater();\n View dialogView= inflater.inflate(R.layout.dialog_after_share, null);\n dialogBuilder.setView(dialogView);\n\n //Show the dialog\n final AlertDialog alert = dialogBuilder.show();\n alert.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));\n alert.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);\n alert.setCancelable(false);\n TextView okTV = dialogView.findViewById(R.id.ok1);\n\n okTV.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n alert.hide();\n }\n });\n }", "@Override\n\t\t\tpublic void onClick(View v)\n\t\t\t{\n\t\t\t\tDialog dialog=new Dialog(Glory.this);\n\t\t\t\tdialog.setContentView(R.layout.share_dialog_layout);\n\t\t\t\tdialog.setTitle(\"Share Via\");\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfbIcon=(TextView)dialog.findViewById(R.id.fb_icon);\n\t\t\t\ttwitterIcon=(TextView)dialog.findViewById(R.id.twitter_icon);\n\t\t\t\tgPlusIcon=(TextView)dialog.findViewById(R.id.gplus_icon);\n\t\t\t\t\n\t\t\t\tfbIcon.setTypeface(font);\n\t\t\t\ttwitterIcon.setTypeface(font);\n\t\t\t\tgPlusIcon.setTypeface(font);\n\t\t\t\n\t\t\t\t\n\t\t\t\tfbIcon.setOnClickListener(new OnClickListener() \n\t\t\t\t{\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(View v) \n\t\t\t\t\t{\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\tString url = \"https://www.facebook.com/dialog/feed?app_id=1507764116109075&\" +\n\t\t\t\t\t\t\t\t \t \"link=https://play.google.com/store/apps/details?id=com.achyuthnfn.cnbfinal&\" +\n\t\t\t\t\t\t\t\t \t \"caption=GuessIn&\" +\n\t\t\t\t\t\t\t\t \t \"description=\"+Uri.parse(\"My smartphone just thought of a word and I guessed it in \"+attempts+\" attempts. Check out the new game by @nfnlabs called GuessIn!\")+\n\t\t\t\t\t\t\t\t \t \"&redirect_uri=https://www.facebook.com/connect/login_success.html\"+\n\t\t\t\t\t\t\t\t \t \"&picture=http://nfnlabs.in/wp-content/uploads/2014/06/Share%20Image.png\";\n\t\t\t\t\t\tIntent intent=new Intent(Intent.ACTION_VIEW);\n\t\t\t\t\t\tintent.setData(Uri.parse(url));\n\t\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\ttwitterIcon.setOnClickListener(new OnClickListener() \n\t\t\t\t{\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\tString url = \"https://twitter.com/intent/tweet?text=My smartphone just thought of a word and I guessed it in \"+attempts+\" attempts. Check out Guessin by @nfnlabs:&url=\"+Uri.parse(\"http://goo.gl/CGmGEx\");\n\t\t\t\t\t\tIntent intent=new Intent(Intent.ACTION_VIEW);\n\t\t\t\t\t\tUri uri=Uri.parse(url);\n\t\t\t\t\t\tintent.setData(uri);\n\t\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tgPlusIcon.setOnClickListener(new OnClickListener() {\n\t\t\t\t\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\tIntent intent= new PlusShare.Builder(Glory.this)\n\t\t\t\t\t\t\t.setText(\"My smartphone just thought of a word and I guessed it in \"+attempts+\" attempts. Check out the new game by @nfnlabs called GuessIn!\")\n\t\t\t\t\t\t\t.setType(\"text/plain\")\n\t\t\t\t\t\t\t.setContentUrl(Uri.parse(\"https://play.google.com/store/apps/details?id=com.achyuthnfn.cnbfinal\"))\n\t\t\t\t\t\t\t.getIntent();\n\t\t\t\t\t\tstartActivityForResult(intent, 0);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tdialog.show();\n\t\t\t}", "protected void showShare() {\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\tAppDataItemText textItem;\n \t\t\t\ttry {\n \t\t\t\t\ttextItem = (AppDataItemText)item;\n \t\t\t\t\t\n \t\t\t\t\tIntent sharingIntent = new Intent(Intent.ACTION_SEND);\n \t\t\t\t\tsharingIntent.setType(\"text/plain\");\n \t\t\t\t\t//sharingIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] { \"[email protected]\" });\n \t\t\t\t\tsharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, textItem.getItemText());\n \t\t\t\t\tstartActivity(Intent.createChooser(sharingIntent,\"Compartir contenido\"));\n \n \t\t\t\t}catch (ClassCastException e) {\n \t\t\t\t}\n \t\t\t}\n \t\t} catch (InvalidFileException e) {\n \t\t}\n \t}", "private void share(String title, String text)\n {\n Intent sendIntent = new Intent();\n sendIntent.setAction(Intent.ACTION_SEND);\n sendIntent.putExtra(Intent.EXTRA_TEXT, text);\n sendIntent.setType(\"text/plain\");\n startActivity(Intent.createChooser(sendIntent, title));\n }", "public abstract Dialog createDialog(DialogDescriptor descriptor);", "private void publishFeedDialog() {\n\t\tBundle postParams = new Bundle();\n postParams.putString(\"name\", \"Care Apps\");\n postParams.putString(\"description\", description);\n postParams.putString(\"picture\", profile_path);\n \n\t WebDialog feedDialog = (new WebDialog.FeedDialogBuilder(this,com.facebook.Session.getActiveSession(),postParams))\n\t .setOnCompleteListener(new OnCompleteListener() {\n\t @Override\n\t public void onComplete(Bundle values,\n\t FacebookException error) {\n\t if (error == null) {\n\t final String postId = values.getString(\"post_id\");\n\t if (postId != null) {\n\t Toast.makeText(FB_ShareActivity.this,\n\t \"Posted story, id: \"+postId,\n\t Toast.LENGTH_SHORT).show();\n\t onBackPressed();\n\t } else {\n\t Toast.makeText(FB_ShareActivity.this, \n\t \"Publish cancelled\", \n\t Toast.LENGTH_SHORT).show();\n\t onBackPressed();\n\t }\n\t } \n\t else if (error instanceof FacebookOperationCanceledException) {\n\t Toast.makeText(FB_ShareActivity.this, \n\t \"Publish cancelled\", \n\t Toast.LENGTH_SHORT).show();\n\t onBackPressed();\n\t } \n\t else {\n\t Toast.makeText(FB_ShareActivity.this, \n\t \"Error posting story\", \n\t Toast.LENGTH_SHORT).show();\n\t onBackPressed();\n\t }\n\t }\n\t })\n\t .build();\n\t feedDialog.show();\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_share, container, false);\n\n try {\n Intent shareIntent = new Intent(Intent.ACTION_SEND);\n shareIntent.setType(\"text/plain\");\n shareIntent.putExtra(Intent.EXTRA_SUBJECT, \"RannaGhar\");\n String shareMessage= \"\\nLet me recommend you this application\\n\\n\";\n shareMessage = shareMessage + \"https://play.google.com/store/apps/details?id=\" + BuildConfig.APPLICATION_ID +\"\\n\\n\";\n shareIntent.putExtra(Intent.EXTRA_TEXT, shareMessage);\n startActivity(Intent.createChooser(shareIntent, \"choose one\"));\n } catch(Exception e) {\n //e.toString();\n }\n\n return view;\n }", "@Override\n \t\t\tpublic void onClick(View v) {\n \t\t\t\tNoteEditView.this.addShare();\n \t\t\t}", "@Override\r\n public void onClick(View v) {\n UMImage urlImage = new UMImage(LotteryListActivity.this,\r\n share.getImage());\r\n new ShareAction(LotteryListActivity.this)\r\n .setPlatform(SHARE_MEDIA.SINA)\r\n .withText(share.getContent()).withTitle(share.getTitle()).withMedia(urlImage)\r\n .withTargetUrl(share.getUrl())\r\n .setCallback(umShareListener).share();\r\n\r\n }", "public void Share(String url) {\n Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);\n sharingIntent.setType(\"text/plain\");\n sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, url);\n Intent createChooser = Intent.createChooser(sharingIntent, \"Share via\");\n createChooser.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(createChooser);\n }", "@Override\n\t\tpublic void onClick(View v) {\n\t\t\tif(share!=null){\n\t\t\t\tif(v.getId()==R.id.QQShare){\n\t\t\t\t\tshare.QQShare();\n\t\t\t\t}else if(v.getId()==R.id.SinaShare){\n\t\t\t\t\tshare.SinaShare();\n\t\t\t\t}else if(v.getId()==R.id.WxShare){\n\t\t\t\t\tshare.WxShare();\n\t\t\t\t}else if(v.getId()==R.id.QQKJShare){\n\t\t\t\t\tshare.QQKJShare();\n\t\t\t\t}else if(v.getId()==R.id.SmsShare){\n\t\t\t\t\tshare.SMSShare();\n\t\t\t\t}\n\t\t\t}\n\t\t\tpw.dismiss();\n\t\t\t\n\t\t}", "public Dialog onCreateDialog(Bundle savedInstanceState) {\n\t\tAlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\r\n\t\tLayoutInflater inflater = getActivity().getLayoutInflater();\r\n\t\tView dialogView = inflater.inflate(R.layout.posted, null);\r\n\r\n\t\tbuilder.setTitle(\"Posted Message to:\");\r\n\t\tbuilder.setView(dialogView);\r\n\t\tfinal AlertDialog dialog = builder.show();\r\n\t\t//dialog.getWindow().setLayout(520, 525);\r\n\t\t\r\n\t\tTextView message = (TextView) dialog.findViewById(R.id.sites_posted);\r\n\t\tmessage.setText(sites);\r\n\r\n\t\tButton done = (Button) dialog.findViewById(R.id.done);\r\n\t\tdone.setOnClickListener(new OnClickListener(){\r\n\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\t// TODO open social media options\r\n\t\t\t\tdialog.cancel();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\treturn dialog;\r\n\t}", "private void addShareAction() {\n\t\t// TODO Auto-generated method stub\n\t\tWindow window = getWindow();\n\t\tint width = getWindowManager().getDefaultDisplay().getWidth();\n\t\tint height = getWindowManager().getDefaultDisplay().getHeight();\n\t\tString shareContent = \"\" + 100 * mRightResultCount/mImagesID.size();\n\t\tString mShareFileName = File.separator + \"/color_blindness_result.png\";\n\t\t\n\t\tIntent shareIntent = new Intent(Intent.ACTION_SEND);\n\t\tFile file = ScreenShotForShare.GetScreenShotFile(window, width, height, mShareFileName); \n\t\tif (file != null)\n\t\t\tshareIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));\n\t\tshareIntent.setType(\"text/image/png\"); \n\t\tshareIntent.putExtra(Intent.EXTRA_SUBJECT, \"\");\n\t\tshareIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.shareResult, shareContent) + \"%\");\n \tstartActivity(Intent.createChooser(shareIntent, getString(R.string.share))); \n\t}", "private void shareRecipe(){\n Intent shareRecipeIntent = new Intent();\n shareRecipeIntent.setAction(Intent.ACTION_SEND);\n shareRecipeIntent.putExtra(Intent.EXTRA_TITLE, \"Check out this recipe that I found on My Recipes Book\");\n shareRecipeIntent.putExtra(Intent.EXTRA_TEXT, setTextForSharing());\n shareRecipeIntent.setType(\"text/plain\");\n startActivity(Intent.createChooser(shareRecipeIntent, getResources().getString(R.string.share_intent_text)));\n }", "@Override\r\n public void onClick(View v) {\n UMImage urlImage = new UMImage(LotteryListActivity.this,\r\n share.getImage());\r\n new ShareAction(LotteryListActivity.this)\r\n .setPlatform(SHARE_MEDIA.WEIXIN)\r\n .withText(share.getContent()).withTitle(share.getTitle()).withMedia(urlImage)\r\n .withTargetUrl(share.getUrl())\r\n .setCallback(umShareListener).share();\r\n\r\n }", "private void shareLink(View v) {\n Intent share = new Intent(Intent.ACTION_SEND);\n\n // If you want to share a png image only, you can do:\n // setType(\"image/png\"); OR for jpeg: setType(\"image/jpeg\");\n share.setType(\"image/*\");\n\n // Make sure you put example png image named myImage.png in your\n // directory\n\n\n Log.d(\"\", \"PATH:\" + path);\n\n File imageFileToShare = new File(path);\n Uri uri = Uri.fromFile(imageFileToShare);\n share.putExtra(Intent.EXTRA_TEXT, \"https://play.google.com/store/apps/details?id=btech.natural.wallpaper\");\n share.putExtra(Intent.EXTRA_STREAM, uri);\n\n startActivity(Intent.createChooser(share, \"Share Image!\"));\n }", "private Intent Shareintent(){\n Intent Shareintent = new Intent(Intent.ACTION_SEND);\n Shareintent.setType(\"text/html\");\n Shareintent.putExtra(Intent.EXTRA_SUBJECT, \"SUBJECT\");\n Shareintent.putExtra(Intent.EXTRA_TEXT, \"http://www.habeshastudent.com/m/video.html\");\n return Shareintent;\n\n\n }", "@Override\r\n public void onClick(View v) {\n UMImage urlImage = new UMImage(LotteryListActivity.this,\r\n share.getImage());\r\n new ShareAction(LotteryListActivity.this)\r\n .setPlatform(SHARE_MEDIA.WEIXIN_CIRCLE)\r\n .withText(share.getContent()).withTitle(share.getTitle()).withMedia(urlImage)\r\n .withTargetUrl(share.getUrl())\r\n .setCallback(umShareListener).share();\r\n\r\n }", "@Override\n public void onClick(View v) {\n\n dialog = new Dialog(context);\n dialog.setContentView(R.layout.custom_dialog_layout);\n dialog.show();\n\n TextView mytxt=dialog.findViewById(R.id.custom_dialog_txtview);\n mytxt.setText(holder.txtTitle.getText().toString());\n copy=dialog.findViewById(R.id.copy);\n share=dialog.findViewById(R.id.share);\n whatsapp=dialog.findViewById(R.id.whatsAppshare);\n\n adView1=dialog.findViewById(R.id.bannerAd_dialog1);\n adView2=dialog.findViewById(R.id.bannerAd_dialog2);\n\n //request ad to admob server\n AdRequest adRequest1 = new AdRequest.Builder().build();\n\n //add ad to Adview object\n adView1.loadAd(adRequest1);\n\n\n //request ad to admob server\n AdRequest adRequest2 = new AdRequest.Builder().build();\n\n //add ad to Adview object\n adView2.loadAd(adRequest2);\n\n\n // for direct whatsapp share\n whatsapp.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n// Intent intent=context.getPackageManager().getLaunchIntentForPackage(\"com.whatsapp\");\n// context.startActivity(intent);\n Intent intent = new Intent(Intent.ACTION_SEND);\n intent.setType(\"text/plain\");\n intent.setPackage(\"com.whatsapp\");\n intent.putExtra(Intent.EXTRA_TEXT, \"\"+holder.txtTitle.getText());\n try{\n context.startActivity(intent);\n } catch (ActivityNotFoundException ex) {\n AlertDialog.Builder ab=new AlertDialog.Builder(context);\n ab.setTitle(\"Sorry!!\");\n ab.setMessage(\"WhatsApp is not installed in your device\");\n ab.setNegativeButton(\"Close\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n }\n });\n ab.show();\n\n }\n }\n });\n //simple share code\n share.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n ClipboardManager myClipboard;\n myClipboard= (ClipboardManager) context.getSystemService(CLIPBOARD_SERVICE);\n\n ClipData myclip;\n\n String text=holder.txtTitle.getText().toString();\n myclip=ClipData.newPlainText(\"text\",text);\n myClipboard.setPrimaryClip(myclip);\n\n Intent sharingIntent=new Intent(android.content.Intent.ACTION_SEND);\n sharingIntent.setType(\"text/plain\");\n String shareBody=text;\n sharingIntent.putExtra(Intent.EXTRA_SUBJECT,\"Subject here\");\n sharingIntent.putExtra(Intent.EXTRA_TEXT,shareBody);\n context.startActivity(Intent.createChooser(sharingIntent,\"Share via\"));\n\n }\n });\n copy.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n ClipboardManager myClipboard;\n myClipboard= (ClipboardManager) context.getSystemService(CLIPBOARD_SERVICE);\n\n ClipData myclip;\n\n String text=holder.txtTitle.getText().toString();\n myclip=ClipData.newPlainText(\"text\",text);\n myClipboard.setPrimaryClip(myclip);\n Toast.makeText(context, \"कॉपी हो गया \", Toast.LENGTH_SHORT).show();\n\n }\n });\n }", "public interface ShareLinkDialogMvpPresenter<V extends MvpView> extends MvpPresenter<V> {\n\n void onSourceShareSelected(Intent shareIntent, ResolveInfo resolveInfo, String linkUrl);\n}", "private void shareFlipzu() {\n\t\t\n\t\t//create the intent \n\t\tIntent shareIntent = \n\t\t new Intent(android.content.Intent.ACTION_SEND); \n\t\t \n\t\t//set the type \n\t\tshareIntent.setType(\"text/plain\"); \n\t\t \n\t\t//add a subject \n\t\tshareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, \n\t\t \"Check out this cool App\");\t\t\n\t\t \n\t\t//build the body of the message to be shared \n\t\tString shareMessage = \"Flipzu, live audio broadcast from your Android phone: https://market.android.com/details?id=\" + APP_PNAME; \n\t\t \n\t\t//add the message \n\t\tshareIntent.putExtra(android.content.Intent.EXTRA_TEXT, \n\t\t shareMessage); \n\t\t \n\t\t//start the chooser for sharing \n\t\tstartActivity(Intent.createChooser(shareIntent, \n\t\t getText(R.string.share_app))); \n\n\t}", "private void sharePlan(){\n Intent shareIntent = new Intent(Intent.ACTION_SEND);\n shareIntent.setType(\"text/plain\");\n shareIntent.putExtra(Intent.EXTRA_SUBJECT, \"My Planit Plan\");\n shareIntent.putExtra(Intent.EXTRA_TEXT,\n \"Hi All! This is my plan made using Planit! www.planit.com/10293987\");\n startActivity(Intent.createChooser(shareIntent, \"Share with\"));\n }", "public static void onClickShareButton(Context context) {\n Intent sendIntent = new Intent();\n sendIntent.setAction(Intent.ACTION_SEND);\n sendIntent.putExtra(Intent.EXTRA_TEXT, context.getResources().getString(R.string.share_msg));\n sendIntent.setType(\"*/*\");\n context.startActivity(sendIntent);\n }", "@Override\r\n\tpublic void ShowShare(Context _in_context, String _in_data) {\n\t\tTypeSDKLogger.e( \"ShowShare\");\r\n\t}", "@Override\n public void onClick(View v) {\n NewBucketDialogFragment newBucketDialogFragment = NewBucketDialogFragment.newInstance();\n newBucketDialogFragment.setTargetFragment(BucketListFragment.this, REQ_CODE_NEW_BUCKET);\n newBucketDialogFragment.show(getFragmentManager(), NewBucketDialogFragment.TAG);\n }", "public void postToFB(View view) {\n\n// Toast.makeText(getBaseContext(), \"Posted Story on Timeline\", Toast.LENGTH_SHORT).show();\n\n if (ShareDialog.canShow(ShareLinkContent.class)) {\n ShareLinkContent linkContent = null;\n try {\n linkContent = new ShareLinkContent.Builder()\n .setContentTitle(basic.getString(\"title\"))\n .setContentUrl(Uri.parse(basic.getString(\"viewItemURL\")))\n .setContentDescription(\n ((TextView) findViewById(R.id.price)).getText().toString() + \"\\n\" +\n ((TextView) findViewById(R.id.shippingInfo)).getText().toString()\n )\n .setImageUrl(Uri.parse(basic.getString(\"galleryURL\")))\n .build();\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n// if(linkContent != null)\n shareDialog.show(linkContent);\n\n// ShareLinkContent content = new ShareLinkContent.Builder()\n// .setContentUrl(Uri.parse(\"https://developers.facebook.com\"))\n// .build();\n//\n// shareDialog.show(content);\n\n\n }\n }", "public interface ShareController {\r\n\r\n\t/** Share with dialog */\r\n\tvoid share();\r\n\r\n\t/** Share natively */\r\n\tvoid getBase64();\r\n}", "public void gppShare_setURLToShareAndOpen (String urlToShare) {\n\t\tGPPShare.sharedInstance().shareDialog().setURLToShare(new NSURL(urlToShare)).open();\n\t}", "public static Intent createShareIntent(String title) {\n Intent shareIntent = new Intent(Intent.ACTION_SEND);\n shareIntent.setType(\"text/plain\");\n shareIntent.putExtra(Intent.EXTRA_TEXT, title);\n return shareIntent;\n }", "public void onClick(DialogInterface dialog,int id) {\n\t\t\t\t\t\t\t fbsharecode();\n\t\t\t\t\t\t}", "public void onClick(DialogInterface dialog,int id) {\n\t\t\t\t\t\t\t fbsharecode();\n\t\t\t\t\t\t}", "public void shareToFacebook(View view) {\n // more config: https://developers.facebook.com/docs/sharing/android\n\n String quoteMessage = \"Check out this fantastic film: \" + movieTitle\n + \" (\" + movieReleaseDate + \") -- MyMovieMemoir App\";\n\n if (ShareDialog.canShow(ShareLinkContent.class)) {\n ShareLinkContent linkContent = new ShareLinkContent.Builder()\n .setQuote(quoteMessage)\n .setContentUrl(Uri.parse(imageURL))\n .build();\n shareDialog.show(linkContent);\n }\n }", "public void share(View view) {\n if (urlImage != \"\") {\n try {\n new ShareOnFacebook(bitmapArray, this).share();\n } catch (Exception e) {\n e.printStackTrace();\n Intent mIntentFacebookBrowser = new Intent(Intent.ACTION_SEND);\n String mStringURL = \"https://www.facebook.com/sharer/sharer.php?u=\" + urlImage;\n mIntentFacebookBrowser = new Intent(Intent.ACTION_VIEW, Uri.parse(mStringURL));\n startActivity(mIntentFacebookBrowser);\n }\n }\n }", "@Override\r\n\tpublic void ShowShare(Context _in_context, String _in_data) {\n\t\tTypeSDKLogger.e(\"ShowShare\");\r\n\t}", "private AssignFSADialog() {\r\n super(Hub.getMainWindow(), Hub.string(\"TD_assignFSATitle\"));\r\n addWindowListener(new WindowAdapter() {\r\n @Override\r\n public void windowClosing(WindowEvent e) {\r\n onEscapeEvent();\r\n }\r\n });\r\n this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);\r\n this.setMinimumSize(new Dimension(300, 10));\r\n\r\n Box mainBox = Box.createHorizontalBox();\r\n mainBox.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));\r\n Box newBox = Box.createVerticalBox();\r\n newBox.add(new JLabel(\" \"));\r\n newBox.add(new JButton(new NewFSAAction()));\r\n mainBox.add(newBox);\r\n\r\n mainBox.add(Box.createRigidArea(new Dimension(5, 0)));\r\n\r\n openModelsCombo = new JComboBox();\r\n openModelsCombo.setRenderer(new JLabelListRenderer());\r\n Box modelsBox = Box.createVerticalBox();\r\n Box titleBox = Box.createHorizontalBox();\r\n titleBox.add(new JLabel(Hub.string(\"TD_openModels\")));\r\n titleBox.add(Box.createHorizontalGlue());\r\n modelsBox.add(titleBox);\r\n modelsBox.add(openModelsCombo);\r\n mainBox.add(modelsBox);\r\n\r\n mainBox.add(Box.createRigidArea(new Dimension(5, 0)));\r\n\r\n templatesCombo = new JComboBox();\r\n templatesCombo.setRenderer(new JLabelListRenderer());\r\n Box templatesBox = Box.createVerticalBox();\r\n titleBox = Box.createHorizontalBox();\r\n titleBox.add(new JLabel(Hub.string(\"TD_templates\")));\r\n titleBox.add(Box.createHorizontalGlue());\r\n templatesBox.add(titleBox);\r\n templatesBox.add(templatesCombo);\r\n mainBox.add(templatesBox);\r\n\r\n getContentPane().add(mainBox);\r\n\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if(id==R.id.action_share){\n Intent shareintent = Share.share(content);\n startActivity(Intent.createChooser(shareintent, getResources().getString(R.string.app_name)));\n\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n\tpublic ToolStripButton getShareButton() {\n\t\treturn shareButton;\n\t}", "public Dialog<String> createDialog() {\n\t\t// Creating a dialog\n\t\tDialog<String> dialog = new Dialog<String>();\n\n\t\tButtonType type = new ButtonType(\"Ok\", ButtonData.OK_DONE);\n\t\tdialog.getDialogPane().getButtonTypes().add(type);\n\t\treturn dialog;\n\t}", "@Override\n protected void sendChooserIntent(WindowAndroid windowAndroid, Intent sharingIntent) {\n super.sendChooserIntent(windowAndroid, sharingIntent);\n }", "public void onClickShare(MenuItem mi) {\n mCanvas.getSurfaceView().queueEvent(new Runnable() {public void run() {\n mCanvas.save(mSavePath, PaintPaint.AUTOSAVE);\n File file = new File(mSavePath+PaintPaint.AUTOSAVE);\n Intent intent = new Intent(android.content.Intent.ACTION_SEND);\n intent.setType(\"image/png\");\n intent.putExtra(Intent.EXTRA_STREAM,Uri.fromFile(file));\n startActivity(Intent.createChooser(intent, \"Share image\"));\n }});\n }", "private void setUpShareAppListener() {\n shareAppButton.setOnClickListener(v -> {\n try {\n Intent i = new Intent(Intent.ACTION_SEND);\n i.setType(\"text/plain\");\n i.putExtra(Intent.EXTRA_SUBJECT, getResources().getString(R.string.app_name));\n String aux = \"Download the app\\n\";\n aux = aux + \"https://drive.google.com/file/d/11oh5KY-V3GAdRjmZECbD5cOD1T8syDJs/view?usp=sharing\" + getBaseContext().getPackageName();\n i.putExtra(Intent.EXTRA_TEXT, aux);\n startActivity(i);\n } catch (Exception e) {\n }\n });\n }", "public void sharePage(){\n Intent shareIntent = new Intent(Intent.ACTION_VIEW);\n shareIntent.setData(Uri.parse(\"http://192.168.43.105:5000\"));//edit url\n startActivity(shareIntent);\n }", "protected abstract JDialog createDialog();", "private Intent getDefaultShareIntent(){\n Intent intent = new Intent(Intent.ACTION_SEND);\n intent.setType(\"text/plain\");\n intent.putExtra(Intent.EXTRA_SUBJECT, \"SUBJECT\");\n intent.putExtra(Intent.EXTRA_TEXT,\"Extra Text\");\n return intent;\n }", "public void shareApp() {\n Intent shareIntent = new Intent(Intent.ACTION_SEND);\n shareIntent.setType(\"text/*\");\n shareIntent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.app_name));\n shareIntent.putExtra(Intent.EXTRA_TEXT, \"Try this \" + getResources().getString(R.string.app_name) + \" App: https://play.google.com/store/apps/details?id=\" + getApplicationContext().getPackageName());\n startActivity(Intent.createChooser(shareIntent, \"Share Using\"));\n }", "private void createAndShowDialog(final String message, final String title) {\n final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity ());\n\n builder.setMessage(message);\n builder.setTitle(title);\n builder.create().show();\n }", "public void onClick(DialogInterface dialog, int which) {\n\t\t\tString uuid = \"\";\n\t\t\tString weixinName = \"\";\n\t\t\tSettings.shareTypeTag = typeTag;\n\t\t\tSettings.shareUuid = getWeiboUuid();\n\t\t\tswitch (typeTag) {\n\t\t\tcase 1:\n\t\t\t\t// 1:分享餐厅\n\t\t\t\tuuid = getRestaurantId();\n\t\t\t\tweixinName = getWeixinName();\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t// 2:软件分享\n\t\t\t\tuuid = \"\";\n\t\t\t\tweixinName = getWeixinName();\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t// 3:推荐分享\n\t\t\t\tuuid = getRestaurantId();\n\t\t\t\tweixinName = getWeixinName();\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t// 4:外卖分享\n\t\t\t\tuuid = getRestaurantId();\n\t\t\t\tweixinName = getWeixinName();\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\t// 5:wap分享\n\t\t\t\tuuid = getRestaurantId();\n\t\t\t\tweixinName = getWeixinName();\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\t// 6:秘币分享\n\t\t\t\tuuid = getRestaurantId();\n\t\t\t\tweixinName = getWeixinName();\n\t\t\t\tbreak;\n\t\t\tdefault: // 其它分享\n\t\t\t\tuuid = getRestaurantId();\n\t\t\t\tweixinName = getWeixinName();\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tswitch (which) {\n\t\t\tcase 0:\n\n\t\t\t\t// ----\n\t\t\t\tOpenPageDataTracer.getInstance().addEvent(\"分享-短信\", uuid);\n\t\t\t\t// -----\n\n\t\t\t\ttry {\n\t\t\t\t\tString info = makeSMSinfo();\n\t\t\t\t\tActivityUtil.sendSMS(MainFrameActivity.this, \"\", info);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tDialogUtil.showToast(MainFrameActivity.this, \"对不起,暂时无法分享\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 1:\n\n\t\t\t\t// ----\n\t\t\t\tOpenPageDataTracer.getInstance().addEvent(\"分享-邮件\", uuid);\n\t\t\t\t// -----\n\n\t\t\t\ttry {\n\t\t\t\t\tString emailInfo = makeEmailInfo();\n\t\t\t\t\tActivityUtil.callEmail((Activity) MainFrameActivity.this, \"\", \"看看这家餐厅怎么样\", emailInfo);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tDialogUtil.showToast(MainFrameActivity.this, \"对不起,暂时无法分享\");\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t// ----\n\t\t\t\tOpenPageDataTracer.getInstance().addEvent(\"分享-微博\", uuid);\n\t\t\t\t// -----\n\n\t\t\t\tString weiboInfo = makeWeiboInfo();\n\t\t\t\tString weiboUuid = \"\";\n\t\t\t\tweiboUuid = getWeiboUuid();\n\t\t\t\tBundle bundle = new Bundle();\n\t\t\t\tbundle.putString(Settings.BUNDLE_KEY_WEIBO_DETAIL, weiboInfo);\n\t\t\t\tbundle.putString(Settings.BUNDLE_REST_ID, weiboUuid);\n\t\t\t\tbundle.putInt(Settings.BUNDLE_KEY_TYPE, typeTag);// 1:分享餐厅\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 2:软件分享\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 3:推荐分享\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 4:外卖分享\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 5:wap分享\n\n\t\t\t\tActivityUtil.jump(MainFrameActivity.this, ShareToWeiboActivity.class, 0, bundle);\n\t\t\t\tbreak;\n\n\t\t\tcase 3:// 分享到微信\n\n\t\t\t\t// ----\n\t\t\t\tOpenPageDataTracer.getInstance().addEvent(\"分享-微信\", uuid);\n\t\t\t\t// -----\n\t\t\t\tSettings.wxTypeTag = 1;\n\n\t\t\t\tString info = \"\";\n\t\t\t\tif (CheckUtil.isEmpty(makeWeiXinInfo())) {\n\t\t\t\t\tinfo = makeWeiboInfo() + \"【来自小秘书客户端】http://www.xiaomishu.com/o/app\";\n\t\t\t\t} else {\n\t\t\t\t\tinfo = makeWeiXinInfo();\n\t\t\t\t}\n\t\t\t\tbundle = new Bundle();\n\t\t\t\tbundle.putString(Settings.BUNDLE_KEY_SHARE_DETAIL, info);\n\t\t\t\tbundle.putString(Settings.BUNDLE_REST_ID, uuid);\n\t\t\t\tbundle.putString(Settings.BUNDLE_REST_NAME, weixinName);\n\t\t\t\tbundle.putString(Settings.BUNDLE_REST_IMAGE_URL, getRestaurantUrl() != null ? getRestaurantUrl().trim() : getRestaurantUrl()); // 送给微信的时候,要trim一下\n\t\t\t\tbundle.putString(Settings.BUNDLE_REST_LINK_URL, getRestaurantLinkUrl() != null ? getRestaurantLinkUrl().trim() : getRestaurantLinkUrl());// 送给微信的时候,要trim一下\n\t\t\t\tbundle.putInt(Settings.BUNDLE_KEY_TYPE, 1); // 1分享到微信,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 2//分享到微信朋友圈\n\t\t\t\tActivityUtil.jump(MainFrameActivity.this, ShareToWeiXinActivity.class, 0, bundle);\n\t\t\t\tbreak;\n\n\t\t\tcase 4:// 分享到微信朋友圈\n\n\t\t\t\t// ----\n\t\t\t\tOpenPageDataTracer.getInstance().addEvent(\"分享-朋友圈\", uuid);\n\t\t\t\t// -----\n\t\t\t\tSettings.wxTypeTag = 2;\n\t\t\t\tString infoP = \"\";\n\t\t\t\tif (CheckUtil.isEmpty(makeWeiXinInfo())) {\n\t\t\t\t\tinfoP = makeWeiboInfo() + \"【来自小秘书客户端】http://www.xiaomishu.com/o/app\";\n\t\t\t\t} else {\n\t\t\t\t\tinfoP = makeWeiXinInfo();\n\t\t\t\t}\n\t\t\t\tbundle = new Bundle();\n\t\t\t\tbundle.putString(Settings.BUNDLE_KEY_SHARE_DETAIL, infoP);\n\t\t\t\tbundle.putString(Settings.BUNDLE_REST_ID, uuid);\n\t\t\t\tbundle.putString(Settings.BUNDLE_REST_NAME, weixinName);\n\t\t\t\tbundle.putString(Settings.BUNDLE_REST_IMAGE_URL, getRestaurantUrl() != null ? getRestaurantUrl().trim() : getRestaurantUrl());// 送给微信的时候,要trim一下\n\t\t\t\tbundle.putString(Settings.BUNDLE_REST_LINK_URL, getRestaurantLinkUrl() != null ? getRestaurantLinkUrl().trim() : getRestaurantLinkUrl());// 送给微信的时候,要trim一下\n\t\t\t\tbundle.putInt(Settings.BUNDLE_KEY_TYPE, 2);// 1分享到微信,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 2//分享到微信朋友圈\n\t\t\t\tActivityUtil.jump(MainFrameActivity.this, ShareToWeiXinActivity.class, 0, bundle);\n\t\t\t\tbreak;\n\t\t\tdefault: // 其它分享\n\t\t\t\t// shareOther();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "private void tjshowShare() {\n\t\tShareSDK.initSDK(getActivity(), \"171a7e7c3c736\");\n\t\tOnekeyShare oks = new OnekeyShare();\n\t\t// 关闭sso授权\n\t\toks.disableSSOWhenAuthorize();\n\n\t\t// 分享时Notification的图标和文字 2.5.9以后的版本不调用此方法\n\t\t// oks.setNotification(R.drawable.ic_launcher,\n\t\t// getString(R.string.app_name));\n\t\t// 信息分享时电话\n//\t\toks.setAddress(zhuproduct.getData().getStore_info().getStore_tel());\n\t\t// title标题,印象笔记、邮箱、信息、微信、人人网和QQ空间使用\n\t\toks.setTitle(\"【餐餐抢】\");\n\t\t// titleUrl是标题的网络链接,仅在人人网和QQ空间使用\n\t\toks.setTitleUrl(SharedUtil.getStringValue(\n\t\t\t\tSharedCommon.MALL_QRCODE_IMG_AZ_URL, \"\"));\n\t\t// text是分享文本,所有平台都需要这个字段\n\t\toks.setText(\"作为你的好朋友,我忍不住给你推荐一个平台帮你暴增客流量,提升营业额,别犹豫,相信我!马上入驻吧!\");\n\t\t// imagePath是图片的本地路径,Linked-In以外的平台都支持此参数\n\t\toks.setImagePath(SharedUtil.getStringValue(SharedCommon.MALL_FX, \"\"));// 确保SDcard下面存在此张图片\n\t\toks.setImageUrl(SharedUtil.getStringValue(SharedCommon.MALL_FX, \"\"));\n\t\t// url仅在微信(包括好友和朋友圈)中使用\n\t\toks.setUrl(\"http://www.28yun.com/api_wap/tmpl/merchant/merchant_enter.html\");\n\t\t// comment是我对这条分享的评论,仅在人人网和QQ空间使用\n\t\toks.setComment(\"我是测试评论文本\");\n\t\t// site是分享此内容的网站名称,仅在QQ空间使用\n\t\toks.setSite(getString(R.string.app_name));\n\t\t// siteUrl是分享此内容的网站地址,仅在QQ空间使用\n\t\toks.setSiteUrl(SharedUtil.getStringValue(\n\t\t\t\tSharedCommon.MALL_QRCODE_IMG_AZ_URL, \"\"));\n\n\t\t// 启动分享GUI\n\t\toks.show(getActivity());\n\t}", "private void shareImage() {\n Intent share = new Intent(Intent.ACTION_SEND);\n\n // If you want to share a png image only, you can do:\n // setType(\"image/png\"); OR for jpeg: setType(\"image/jpeg\");\n share.setType(\"image/*\");\n\n // Make sure you put example png image named myImage.png in your\n // directory\n\n\n Log.d(\"PATH\", \"PATH:\" + path);\n\n File imageFileToShare = new File(path);\n Uri uri = Uri.fromFile(imageFileToShare);\n //share.putExtra(Intent.EXTRA_TEXT, \"https://play.google.com/store/apps/details?id=kailash.natural.wallpaper\");\n share.putExtra(Intent.EXTRA_STREAM, uri);\n\n startActivity(Intent.createChooser(share, \"Share Image!\"));\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.action_share) {\n createShareIntent();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n\r\n switch (item.getItemId()) {\r\n\r\n case R.id.mShare:\r\n\r\n Intent i = new Intent(\r\n\r\n android.content.Intent.ACTION_SEND);\r\n\r\n i.setType(\"text/plain\");\r\n\r\n i.putExtra(\r\n\r\n android.content.Intent.EXTRA_TEXT, \"This is my grocery list\");\r\n\r\n startActivity(Intent.createChooser(\r\n\r\n i,\r\n\r\n \"Share using\"));\r\n\r\n break;\r\n\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n\r\n }", "public static SPSSDialog getNewInstance(FormDef form)\n\t{\n\t\tinstance = new SPSSDialog(form);\n\t\treturn instance;\n\t}", "private void _fbAppShare(Activity act, UiLifecycleHelper uiHelper, String link, String description)\n {\n try {\n FacebookDialog shareDialog = new FacebookDialog.ShareDialogBuilder(act)\n .setLink(link != null && !link.equals(\"\") ? link : \"\")\n .setDescription(description != null && !description.equals(\"\") ? description : \"\")\n .build();\n uiHelper.trackPendingDialogCall(shareDialog.present());\n } catch (FacebookException ex) {\n String urlParameters = String.format(Constants.FB_SHARE_URL,\n act.getString(R.string.app_url), act.getString(R.string.app_name));\n Utilities.getInstance().openURL(act, urlParameters);\n }\n }", "@Override\n public void projectOpened() {\n ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);\n JPanel myContentPanel = new JPanel(new BorderLayout());\n ShareToolWin toolWin = new ShareToolWin();\n myContentPanel.add(toolWin.getRootPanel(), BorderLayout.CENTER);\n ToolWindow toolWindow = toolWindowManager.registerToolWindow(TOOL_WINDOW_ID, false, ToolWindowAnchor.LEFT);\n toolWindow.getComponent().add(myContentPanel);\n }", "public void onShareclicked(MenuItem mi) {\n\t\tSmartImageView ivImage = (SmartImageView) findViewById(R.id.ivResult);\r\n\t\tUri bmpUri = getLocalBitmapUri(ivImage);\r\n\t\tif (bmpUri != null) {\r\n\t\t\t// Construct a ShareIntent with link to image\r\n\t\t\tIntent shareIntent = new Intent();\r\n\t\t\tshareIntent.setAction(Intent.ACTION_SEND);\r\n\t\t\tshareIntent.putExtra(Intent.EXTRA_STREAM, bmpUri);\r\n\t\t\tshareIntent.setType(\"image/*\");\r\n\t\t\t// Launch sharing dialog for image\r\n\t\t\tstartActivity(Intent.createChooser(shareIntent, \"Share Content\"));\r\n\t\t} else {\r\n\t\t\tLog.e(\"ERROR\", \"Image sending failed\");\r\n\t\t}\r\n\t\t\r\n\t}", "public static void showShareAppButton() {\n shareAppButton.show();\n }", "private void createAndShowDialog(final String message, final String title) {\n final AlertDialog.Builder builder = new AlertDialog.Builder(this);\n\n builder.setMessage(message);\n builder.setTitle(title);\n builder.create().show();\n }", "@Override\r\n\t\t\tpublic void onClick(View v)\r\n\t\t\t{\n\t\t\t\tshareViaFacebook();\r\n\t\t\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent i = new Intent(Intent.ACTION_SEND);\n\t\t\t\ti.setType(\"text/plain\");\n\t\t\t\ti.putExtra(Intent.EXTRA_SUBJECT, \"Sharing URL\");\n\t\t\t\ti.putExtra(Intent.EXTRA_TEXT, prodUrl);\n\t\t\t\tstartActivity(Intent.createChooser(i, \"Share URL\"));\n\t\t\t}", "private void setShareIntent(String text) {\n\n Intent sendIntent = new Intent();\n sendIntent.setAction(Intent.ACTION_SEND);\n sendIntent.putExtra(Intent.EXTRA_TEXT, text);\n sendIntent.setType(\"text/plain\");\n\n if (shareActionProvider != null) {\n shareActionProvider.setShareIntent(sendIntent);\n }\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent intent = new Intent(Intent.ACTION_SEND);\n\n\t\t\t\tFile f = new File(imagePath);\n\t\t\t\tif (f != null && f.exists() && f.isFile()) {\n\t\t\t\t\tintent.setType(\"image/jpg\");\n\t\t\t\t\tUri u = Uri.fromFile(f);\n\t\t\t\t\tintent.putExtra(Intent.EXTRA_STREAM, u);\n\t\t\t\t}\n\t\t\t\tintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\t\t\tstartActivity(Intent.createChooser(intent, \"分享图片\"));\n\t\t\t}", "private void genSharedPostOnFacebook () {\n shareLinkContent = new ShareLinkContent.Builder()\n .setContentTitle(\"Your Title\")\n .setContentDescription(\"Your Description\")\n .setContentUrl(Uri.parse(\"URL[will open website or app]\"))\n .setImageUrl(Uri.parse(\"image or logo [if playstore or app store url then no need of this image url]\"))\n .build();\n\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.details, menu);\n\n // Set up ShareActionProvider's default share intent\n mShareActionProvider = (ShareActionProvider) menu.findItem(R.id.action_share).getActionProvider();\n mShareActionProvider.setShareIntent(getDefaultIntent());\n\n return true;\n }", "@Override\n public Control createDialogArea(Composite parent) {\n Composite top = (Composite) super.createDialogArea(parent);\n\n /*\n * Create the main layout for the shell.\n */\n GridLayout mainLayout = new GridLayout(1, false);\n mainLayout.verticalSpacing = 15;\n top.setLayout(mainLayout);\n GridData mainLayoutData = new GridData(SWT.FILL, SWT.FILL, true, true);\n top.setLayoutData(mainLayoutData);\n\n createStormTypeArea(top);\n createViewerArea(top);\n createTransmitArea(top);\n\n /*\n * Sets dialog title\n */\n getShell().setText(\"View/Send PSH\");\n\n // Update GUI from PshData.\n updateGui(pshData);\n\n return top;\n }", "@Override\n\tpublic void onClick(View v) {\n\t\tIntent sharingIntent = new Intent(android.content.Intent.ACTION_SEND); \n\t\tsharingIntent.setType(\"text/plain\");\n\t\tString shareBody = \"I scored \"+score+\" points!How much can you score?Install the game Space Prowler from the Play Store now!\";\n\t\tsharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, \"Subject Here\");\n\t\tsharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);\n\t\tstartActivity(Intent.createChooser(sharingIntent, \"Share via\"));\n\t\t\n\t}", "private void createForumDialog() {\n AlertDialog.Builder dialog = new AlertDialog.Builder(Objects.requireNonNull(this),\n R.style.AlertDialogTheme);\n dialog.setTitle(R.string.add_new_forum_title);\n dialog.setMessage(R.string.add_new_forum_description);\n\n View newForumDialog = getLayoutInflater().inflate(R.layout.new_forum_dialog, null);\n dialog.setView(newForumDialog);\n\n AlertDialog alertDialog = dialog.create();\n setAddForumButtonListener(alertDialog, newForumDialog);\n\n alertDialog.show();\n }", "public void addRelationshipDialog() { new RelationshipDialog(); }", "@Override\n\t\t\t\t\t\tpublic void onClick(View arg0) {\n Intent share=new Intent(android.content.Intent.ACTION_SEND);\n\n share.setType(\"text/plain\");\n share.putExtra(android.content.Intent.EXTRA_SUBJECT,news.getTitle());\n share.putExtra(android.content.Intent.EXTRA_TEXT,\"Follow the link : \"+MainActivity.base_url+news.getAbsolute_url()+\" to read more\");\n startActivity(Intent.createChooser(share,\"Share via\"));\n\t\t\t\t\t\t}", "@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n filename = getArguments().getString(\"filename\");\n username = getArguments().getString(\"username\");\n workingDIR = getArguments().getString(\"workingDIR\");\n builder.setTitle(R.string.copy_move_file_select_options_title)\n .setItems(R.array.file__move_copy_dialog_options, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n onSelect(which);\n }\n });\n return builder.create();\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_detail, menu);\n MenuItem mi = menu.findItem(R.id.shareid);\n\n sap = (ShareActionProvider) MenuItemCompat.getActionProvider(mi);\n Intent iu = new Intent(Intent.ACTION_SEND);\n TextView tv = (TextView) findViewById(R.id.my_weat);\n data = tv.getText().toString();\n iu.setType(\"text/plain\");\n Log.e(\"hello\", data);\n iu.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);\n iu.putExtra(Intent.EXTRA_TEXT, data + \" #Sunshineapp\");\n if(sap!=null) {\n Log.e(\"uclicked\", \"share button\");\n sap.setShareIntent(iu);\n //startActivity(iu);\n }\n return true;\n }", "public void crearDialogo() {\r\n final PantallaCompletaDialog a2 = PantallaCompletaDialog.a(getString(R.string.hubo_error), getString(R.string.no_hay_internet), getString(R.string.cerrar).toUpperCase(), R.drawable.ic_error);\r\n a2.f4589b = new a() {\r\n public void onClick(View view) {\r\n a2.dismiss();\r\n }\r\n };\r\n a2.show(getParentFragmentManager(), \"TAG\");\r\n }", "public void publishEvents() {\n Bundle params = new Bundle();\n params.putString(\"name\", \"Reserva Cancha Finder\");\n params.putString(\"caption\", \"CanchaFinder\");\n params.putString(\"description\", Seleccion);\n params.putString(\"link\", \"http://www.solweb.co/reservas/CanchaFinder/index.php\");\n params.putString(\"picture\",\"http://www.solweb.co/reservas/api_movil/ic_launcher.png\");\n\n WebDialog feedDialog = (new WebDialog.FeedDialogBuilder(this,currentSession, params))\n .setOnCompleteListener(new WebDialog.OnCompleteListener() {\n\n @Override\n public void onComplete(Bundle values,FacebookException error) {\n if (error == null) {\n // When the story is posted, echo the success\n // and the post Id.\n final String postId = values.getString(\"post_id\");\n if (postId != null) {\n // do some stuff\n } else {\n // User clicked the Cancel button\n Toast.makeText(getApplicationContext(),\n \"Publish cancelled\", Toast.LENGTH_SHORT).show();\n }\n } else if (error instanceof FacebookOperationCanceledException) {\n // User clicked the \"x\" button\n Toast.makeText(getApplicationContext(),\n \"Publish cancelled\", Toast.LENGTH_SHORT).show();\n } else {\n // Generic, ex: network error\n Toast.makeText(getApplicationContext(),\n \"Error posting story\", Toast.LENGTH_SHORT).show();\n }\n }\n\n }).setFrom(\"\").build();\n feedDialog.show();\n\n }", "private void showShareView() {\n Timber.d(\"showShareView\");\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu){\n\n getMenuInflater().inflate(R.menu.menu_aboutus, menu);\n\n// Inflate the menu; this adds items to the action bar if it is present.\n\n MenuItem shareItem = menu.findItem(R.id.menu_share);\n myShareActionProvider = (ShareActionProvider) MenuItemCompat.getActionProvider(shareItem);\n myShareActionProvider.setShareHistoryFileName(\n ShareActionProvider.DEFAULT_SHARE_HISTORY_FILE_NAME);\n myShareActionProvider.setShareIntent(Shareintent());\n\n return super.onCreateOptionsMenu(menu);\n\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.action_settings) {\n\n Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);\n sharingIntent.setType(\"text/plain\");\n String shareBody = \"https://play.google.com/store/apps/details?id=lohitprojects.bitcointrack&hl=en\";\n String shareContent1=\"\\n✦ Bitcoin Track\\n\";\n String shareContent2=\"✦ Everything you need to know about Bitcoin \\n✦ Live bitcoin rate Tracking in any Currency | Wallets | Mining | Historical Records\";\n String shareContent3 = \"\\n✦ \";\n sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, \"Subject Here\");\n sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareContent1+shareContent2+shareContent3+shareBody);\n startActivity(Intent.createChooser(sharingIntent, \"Share via\"));\n\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_one_page, menu);\n\n\n //Setting up the Share Action Provider\n provider = (ShareActionProvider) menu.findItem(R.id.menu_share).getActionProvider();\n provider.setShareIntent(getDefaultShareIntent());\n return super.onCreateOptionsMenu(menu);\n }", "public StandardDialog() {\n super();\n init();\n }", "public void shareViaWhatsappNativeOption() {\n nativeWhatsappShareButton.click();\n }", "public void onShareAdded(ShareEntry shareEntry);", "private void openCreateAccountDialog()\n {\n testDialog();\n\n }", "public PaySuccessDialog create() {\r\n LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\r\n View layout = inflater.inflate(R.layout.paysucdialog, null);\r\n final PaySuccessDialog dialog = new PaySuccessDialog(context,R.style.Dialog);\r\n ImageView img_success = (ImageView)layout.findViewById(R.id.img_success);\r\n img_success.setOnClickListener(new View.OnClickListener() {\r\n\t\t\t\t\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void onClick(View v) {\r\n\t\t\t\t\r\n\t\t\t\t\tdialog.dismiss();\r\n\t\t\t\t}\r\n\t\t\t});\r\n \r\n dialog.setContentView(layout);\r\n return dialog;\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case R.id.clear_basket:\n dialog = new MyDialog();\n dialog.show(getFragmentManager(), \"MyFragment\");\n return true;\n\n case R.id.shareText:\n Intent sendIntent = new Intent();\n sendIntent.setAction(Intent.ACTION_SEND);\n\n int countList = listView.getCount();\n String share = \"\";\n\n for (int i = countList - 1; i >= 0; i--) {\n share = fAdapter.getItem(i)+ \", \"+share;\n }\n\n sendIntent.putExtra(Intent.EXTRA_TEXT, share);\n sendIntent.setType(\"text/plain\");\n startActivity(sendIntent);\n\n\n\n return true;\n\n case R.id.action_settings:\n Intent i = new Intent(this,SettingsActivity.class);\n startActivityForResult(i, 1);\n return true;\n\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n switch (id) {\n case R.id.logout:\n // signout();\n return true;\n\n case R.id.share:\n\n String nombre, correo;\n nombre = mAuth.getCurrentUser().getDisplayName();\n correo = mAuth.getCurrentUser().getEmail();\n Intent sendIntent = new Intent();\n sendIntent.setAction(Intent.ACTION_SEND);\n sendIntent.putExtra(Intent.EXTRA_TEXT, nombre + \"\\n\" + correo);\n sendIntent.setType(\"text/plain\");\n startActivity(sendIntent);\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n\n\n }" ]
[ "0.7066393", "0.6952598", "0.6720757", "0.6511692", "0.645118", "0.6436104", "0.6383183", "0.6369246", "0.6203918", "0.61606795", "0.61382735", "0.6089796", "0.6076493", "0.6042249", "0.6029662", "0.60220414", "0.60005885", "0.5938497", "0.5932639", "0.5927596", "0.59259164", "0.5903049", "0.5858511", "0.58378446", "0.5829663", "0.57951534", "0.5786501", "0.5741549", "0.57262546", "0.5704869", "0.5700733", "0.5683508", "0.568013", "0.5653401", "0.5653261", "0.563269", "0.5616868", "0.5594212", "0.5590304", "0.55784637", "0.5566317", "0.55474776", "0.5546709", "0.55444306", "0.55394197", "0.55232054", "0.55171615", "0.55171615", "0.5493529", "0.5484124", "0.5469592", "0.5458384", "0.54533833", "0.54384786", "0.5435321", "0.5432319", "0.54233116", "0.54114723", "0.5403476", "0.53963953", "0.5390428", "0.5386797", "0.53747547", "0.5353948", "0.5351029", "0.5345363", "0.5345002", "0.5344941", "0.5339106", "0.53370476", "0.5335183", "0.5326687", "0.53222084", "0.5313736", "0.5313116", "0.5298998", "0.52926457", "0.5291133", "0.5290979", "0.5287886", "0.5266557", "0.5261056", "0.52558345", "0.52557856", "0.5240328", "0.52373004", "0.5234985", "0.5234132", "0.5231229", "0.52253944", "0.52173984", "0.5209656", "0.52079916", "0.51945883", "0.5191525", "0.51828563", "0.5182601", "0.51769376", "0.5175227", "0.5161517" ]
0.6274852
8
Copy sharing link to clipboard
protected void copyLinkToClipboard() { app.copyTextToSystemClipboard(getURL()); link.selectAll(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@FXML\n private void copyUrl() {\n final Clipboard clipboard = Clipboard.getSystemClipboard();\n final ClipboardContent url = new ClipboardContent();\n url.putString(HELP_URL);\n clipboard.setContent(url);\n }", "@FXML\n private void copyGoto() {\n final Clipboard clipboard = Clipboard.getSystemClipboard();\n final ClipboardContent url = new ClipboardContent();\n url.putString(GOTO_MESSAGE);\n clipboard.setContent(url);\n }", "private void copyToClipboard(String text)\n {\n Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard();\n cb.setContents(new StringSelection(text), null);\n }", "@FXML\n private void copyHelp() {\n final Clipboard clipboard = Clipboard.getSystemClipboard();\n final ClipboardContent url = new ClipboardContent();\n url.putString(HELP);\n clipboard.setContent(url);\n }", "private static void copyToClipBoard(){\n String password= passwordGenerator.generatePassword();\r\n\r\n /* For copying in windows\r\n * This will copy the password in clipboard in windows\r\n */\r\n//\t\tInitialising the toolkit and clipboard\r\n Toolkit toolkit = Toolkit.getDefaultToolkit();\r\n Clipboard clipboard = toolkit.getSystemClipboard();\r\n\r\n//\t\tclipboard.setContents takes to argument 1st is the string which has to store and 2nd is the name of clipboard owner\r\n StringSelection selection=new StringSelection(password);\r\n clipboard.setContents(selection,null);\r\n\r\n /* For copying in linux distribution\r\n * This will copy the password in xclip in linux\r\n */\r\n Runtime runtime=Runtime.getRuntime();\r\n Process p=null;\r\n try {\r\n p=runtime.exec(new String[]{\"sh\",\"-c\",\"echo\"+password+\" | xclip -selection clipboard\"});\r\n }\r\n catch (Exception e){\r\n System.out.println(e);\r\n }\r\n System.out.println(\"Password copied into clipboard\");\r\n }", "private void directToClipboard(String text) {\n\t\tthis.systemClipboard.setContents(new StringSelection(text), null);\n\t}", "@FXML\n private void copyEdit() {\n final Clipboard clipboard = Clipboard.getSystemClipboard();\n final ClipboardContent url = new ClipboardContent();\n url.putString(EDIT_MESSAGE);\n clipboard.setContent(url);\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 }", "public void paste() {\n pasteClipboard(getToolkit().getSystemClipboard());\n }", "public void copyText() {\n ((ClipboardManager) getActivity().getSystemService(\"clipboard\")).setPrimaryClip(ClipData.newPlainText(\"textFromCoolapk\", this.mBinding.text.getText()));\n Toast.show(getActivity(), \"结果已复制\");\n }", "public void copyToClipboard(View view) {\n //Get the text from the text view\n TextView resultTextView = findViewById(R.id.result_text_view);\n String resultText = resultTextView.getText().toString();\n\n //Copy the Text to the clipboard\n ClipboardManager clipboardManager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);\n ClipData dataClip = ClipData.newPlainText(CLIP_TEXT_KEY, resultText);\n clipboardManager.setPrimaryClip(dataClip);\n\n //Tell the user that the text has been copied to the clipboard\n Toast.makeText(this, \"Copied to Clipboard\", Toast.LENGTH_SHORT).show();\n\n\n }", "public void copySelection() {\n RTGraphComponent.RenderContext myrc = (RTGraphComponent.RenderContext) (getRTComponent().getRTRenderContext()); if (myrc == null) return;\n Clipboard clipboard = getToolkit().getSystemClipboard();\n StringBuffer sb = new StringBuffer();\n Iterator<String> it = (myrc.filterEntities(getRTParent().getSelectedEntities())).iterator();\n while (it.hasNext()) sb.append(it.next() + \"\\n\");\n StringSelection selection = new StringSelection(sb.toString());\n clipboard.setContents(selection, null);\n }", "public void copySelection() {\r\n \t\t// Bertoli Marco\r\n \t\tclipboard.copy();\r\n \t}", "public static void copy(String s) {\n Clipboard c = Toolkit.getDefaultToolkit().getSystemClipboard();\n StringSelection t = new StringSelection(s);\n c.setContents(t, t);\n }", "private void copyToClipboard(int contentType) {\n\n String clipboardText = null;\n ClipData clip;\n\n switch (contentType) {\n case COPY_STATION_ALL:\n // set clip text\n if (mThisStation.getMetadata() != null) {\n clipboardText = mThisStation.getStationName() + \" - \" + mThisStation.getMetadata() + \" (\" + mThisStation.getStreamUri().toString() + \")\";\n } else {\n clipboardText = mThisStation.getStationName() + \" (\" + mThisStation.getStreamUri().toString() + \")\";\n }\n // notify user\n Toast.makeText(mActivity, mActivity.getString(R.string.toastmessage_station_copied), Toast.LENGTH_SHORT).show();\n break;\n\n case COPY_STATION_METADATA:\n // set clip text and notify user\n if (mThisStation.getMetadata() != null) {\n clipboardText = mThisStation.getMetadata();\n }\n Toast.makeText(mActivity, mActivity.getString(R.string.toastmessage_copied_to_clipboard_metadata), Toast.LENGTH_SHORT).show();\n break;\n\n case COPY_STREAM_URL:\n // set clip text and notify user\n if (mThisStation.getStreamUri() != null) {\n clipboardText = mThisStation.getStreamUri().toString();\n }\n Toast.makeText(mActivity, mActivity.getString(R.string.toastmessage_copied_to_clipboard_url), Toast.LENGTH_SHORT).show();\n break;\n\n }\n\n // create clip and to clipboard\n if (clipboardText != null) {\n clip = ClipData.newPlainText(\"simple text\", clipboardText);\n ClipboardManager cm = (ClipboardManager) mActivity.getSystemService(Context.CLIPBOARD_SERVICE);\n cm.setPrimaryClip(clip);\n }\n\n }", "public void pasteText(){\n try{\n CharSequence text = mClipboardManager.getTextFromClipboard();\n if(text != null && mConnection != null){\n mConnection.commitText(text, 0);\n }\n }catch(Exception e){\n e.printStackTrace();\n Toast.makeText(getContext(),e.toString(),Toast.LENGTH_SHORT).show();\n }\n }", "@FXML\n private void copySummary() {\n final Clipboard clipboard = Clipboard.getSystemClipboard();\n final ClipboardContent url = new ClipboardContent();\n url.putString(SUMMARY_MESSAGE);\n clipboard.setContent(url);\n }", "@SuppressWarnings(\"deprecation\")\n @Override\n public void onClick(View arg0) {\n CopyText3 = copyTxt3.getText().toString();\n if (CopyText3.length() != 0) {\n if (sdk < android.os.Build.VERSION_CODES.HONEYCOMB) {\n android.text.ClipboardManager clipboard = (android.text.ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);\n clipboard.setText(CopyText3);\n Toast.makeText(getApplicationContext(), \"Text Telah Ter-Copy ke Clipboard\", Toast.LENGTH_SHORT).show();\n } else {\n android.content.ClipboardManager clipboard = (android.content.ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);\n android.content.ClipData clip = android.content.ClipData.newPlainText(\"Clip\", CopyText3);\n Toast.makeText(getApplicationContext(), \"Text Telah Ter-Copy ke Clipboard\", Toast.LENGTH_SHORT).show();\n clipboard.setPrimaryClip(clip);\n }\n } else {\n Toast.makeText(getApplicationContext(), \"Nothing to Copy\", Toast.LENGTH_SHORT).show();\n }\n }", "public void toClipboard(String text) {\n\t\tthis.executor.schedule(new ClearClipBoardTask(), secondsToClearClipboard, TimeUnit.SECONDS);\n\t\tdirectToClipboard(text);\n\t}", "@Override\n public void onClick(View v) {\n copyToClipboard(COPY_STREAM_URL);\n mStationDataSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);\n }", "public void Share(String url) {\n Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);\n sharingIntent.setType(\"text/plain\");\n sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, url);\n Intent createChooser = Intent.createChooser(sharingIntent, \"Share via\");\n createChooser.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(createChooser);\n }", "public void screenshotToClipboard() {\n Image image = getScreenshot();\n Clipboard clipboard = Clipboard.getSystemClipboard();\n final ClipboardContent content = new ClipboardContent();\n content.putImage(image);\n clipboard.setContent(content);\n LOGGER.atInfo().log(\"Copied screenshot to clipboard\");\n }", "public void addFromClipboard() { genericClipboard(SetOp.ADD); }", "@SuppressWarnings(\"deprecation\")\n @Override\n public void onClick(View arg0) {\n CopyText4 = copyTxt4.getText().toString();\n if (CopyText4.length() != 0) {\n if (sdk < android.os.Build.VERSION_CODES.HONEYCOMB) {\n android.text.ClipboardManager clipboard = (android.text.ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);\n clipboard.setText(CopyText4);\n Toast.makeText(getApplicationContext(), \"Text Telah Ter-Copy ke Clipboard\", Toast.LENGTH_SHORT).show();\n } else {\n android.content.ClipboardManager clipboard = (android.content.ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);\n android.content.ClipData clip = android.content.ClipData.newPlainText(\"Clip\", CopyText4);\n Toast.makeText(getApplicationContext(), \"Text Telah Ter-Copy ke Clipboard\", Toast.LENGTH_SHORT).show();\n clipboard.setPrimaryClip(clip);\n }\n } else {\n Toast.makeText(getApplicationContext(), \"Text Kosong, Tidak ada apapun yang ter-Copy\", Toast.LENGTH_SHORT).show();\n }\n }", "public static void copyToClipboard(Context context, String location) {\n ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);\n ClipData clip = ClipData.newPlainText(context.getString(R.string.pref_file_location_output_title), location);\n clipboard.setPrimaryClip(clip);\n }", "public void shareApp(String link) {\n\n\n String shareBody = link + \"\\n\" + \"https://play.google.com/store/apps/details?id=\" + getApplicationContext().getPackageName();\n\n Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);\n sharingIntent.setType(\"text/plain\");\n sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, getResources().getString(R.string.app_name) + \" -Download App from playstore\");\n sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody + \"\\n\" + \"Promo code-\" + new SessionManager(this).getREFERAL_CODE());\n\n Intent i = new Intent(Intent.createChooser(sharingIntent, \"Share via\"));\n startActivity(i);\n\n\n }", "public void copyText(){\n try{\n if(mCursor.isSelected()){\n mClipboardManager.setTextToClipboard(getText().subContent(mCursor.getLeftLine(),\n mCursor.getLeftColumn(),\n mCursor.getRightLine(),\n mCursor.getRightColumn()).toString());\n }\n }catch(Exception e){\n e.printStackTrace();\n Toast.makeText(getContext(),e.toString(),Toast.LENGTH_SHORT).show();\n }\n }", "@FXML\n private void copyDelete() {\n final Clipboard clipboard = Clipboard.getSystemClipboard();\n final ClipboardContent url = new ClipboardContent();\n url.putString(DELETE_MESSAGE);\n clipboard.setContent(url);\n }", "public void linkShare() {\n\t\tclientOutput.println(\">>> Link do vaseg drajva je: \" + new File(\"drive\").getAbsolutePath() + \"\\\\\" + username);\n\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tClipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();\r\n\t\t\t\tString copyString = ta_content.getText().toString();\r\n\t\t\t\tif (copyString != null) {\r\n\t\t\t\t\tStringSelection contents = new StringSelection(copyString);\r\n\t\t\t\t\tclipboard.setContents(contents, null);\r\n\t\t\t\t}\r\n\t\t\t}", "public void addToClipboard(String path) {\n try {\n PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(this.clipboardPath, true)));\n out.println(path);\n out.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void copy() throws Exception {\n\t\topenPrimaryButtonDropdown();\n\t\tgetControl(\"copyButton\").click();\n\t}", "protected void shareIt() {\n\t\tIntent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);\r\n\t\tsharingIntent.setType(\"text/plain\");\r\n\t\tString shareBody = content.getText().toString();\r\n\t\tsharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, \"Sharing\");\r\n\t\tsharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);\r\n\t\tstartActivity(Intent.createChooser(sharingIntent, \"Share via\"));\r\n\t}", "private void shareLink(View v) {\n Intent share = new Intent(Intent.ACTION_SEND);\n\n // If you want to share a png image only, you can do:\n // setType(\"image/png\"); OR for jpeg: setType(\"image/jpeg\");\n share.setType(\"image/*\");\n\n // Make sure you put example png image named myImage.png in your\n // directory\n\n\n Log.d(\"\", \"PATH:\" + path);\n\n File imageFileToShare = new File(path);\n Uri uri = Uri.fromFile(imageFileToShare);\n share.putExtra(Intent.EXTRA_TEXT, \"https://play.google.com/store/apps/details?id=btech.natural.wallpaper\");\n share.putExtra(Intent.EXTRA_STREAM, uri);\n\n startActivity(Intent.createChooser(share, \"Share Image!\"));\n }", "public String getClipboardContents() {\n\t\tString result = \"\";\n\t\tClipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();\n\t\t// odd: the Object param of getContents is not currently used\n\t\tTransferable contents = clipboard.getContents(null);\n\t\tboolean hasTransferableText = (contents != null) && contents.isDataFlavorSupported(DataFlavor.stringFlavor);\n\t\tif (hasTransferableText) {\n\t\t\ttry {\n\t\t\t\tresult = (String) contents.getTransferData(DataFlavor.stringFlavor);\n\t\t\t\ttfURL.setText(result);\n\t\t\t} catch (UnsupportedFlavorException | IOException ex) {\n\t\t\t\tSystem.out.println(ex);\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "@Override\n public void copy() {\n clipboard.setContents(getSelectionAsList(false));\n }", "@Override\n public void copyToClipboard (boolean shft, boolean alt) {\n RTGraphComponent.RenderContext myrc = (RTGraphComponent.RenderContext) getRTComponent().rc;\n if (shft == false && alt == false) copySelection();\n else if (shft == true && myrc != null) Utils.copyToClipboard(myrc.getBase());\n }", "public void setClipboard(Collection<Object> clipboard)\n {\n this.clipboard = clipboard;\n }", "@Override\n public void onCopySuggestion(String text) {\n mUrlInput.setText(text, true);\n }", "public void onPressCopyDescription(View view) {\r\n TextView textView = findViewById(R.id.textDescription);\r\n String text = textView.getText().toString();\r\n\r\n if (text.equals(\"\"))\r\n return;\r\n\r\n ClipboardManager clipManager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);\r\n ClipData data = ClipData.newPlainText(\"text\", text);\r\n clipManager.setPrimaryClip(data);\r\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent i = new Intent(Intent.ACTION_SEND);\n\t\t\t\ti.setType(\"text/plain\");\n\t\t\t\ti.putExtra(Intent.EXTRA_SUBJECT, \"Sharing URL\");\n\t\t\t\ti.putExtra(Intent.EXTRA_TEXT, prodUrl);\n\t\t\t\tstartActivity(Intent.createChooser(i, \"Share URL\"));\n\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void onClick(View arg0) {\n Intent share=new Intent(android.content.Intent.ACTION_SEND);\n\n share.setType(\"text/plain\");\n share.putExtra(android.content.Intent.EXTRA_SUBJECT,news.getTitle());\n share.putExtra(android.content.Intent.EXTRA_TEXT,\"Follow the link : \"+MainActivity.base_url+news.getAbsolute_url()+\" to read more\");\n startActivity(Intent.createChooser(share,\"Share via\"));\n\t\t\t\t\t\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case R.id.action_copy:\n SystemUtils.copy(result, this);\n Toast.makeText(this, \"复制到剪贴版\", Toast.LENGTH_SHORT).show();\n break;\n case R.id.action_share:\n Intent sendIntent = new Intent();\n sendIntent.setAction(Intent.ACTION_SEND);\n sendIntent.putExtra(Intent.EXTRA_TEXT, result);\n sendIntent.setType(\"text/plain\");\n startActivity(Intent.createChooser(sendIntent, \"分享二维码内容\"));\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public void onClick(View v) {\n String shareBody =item.title.toString()+\"\\n\\n\"+getResources().getString(R.string.item_show)+\"\\n\"+ Config.APP_IMAGES_URL.replace(\"uploads/\",\"share/\")+item.id;\n Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);\n sharingIntent.setType(\"text/plain\");\n sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);\n sharingIntent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.app_name));\n startActivity(Intent.createChooser(sharingIntent, getResources().getString(R.string.app_name)));\n }", "public void showCopyMenu() {\n new AlertDialog.Builder(getContext()).setItems(\n R.array.copypaste_menu_items,\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n String intentStr = null;\n switch (which) {\n case 0:\n ClipboardManager clip = (ClipboardManager) getContext()\n .getSystemService(\n Context.CLIPBOARD_SERVICE);\n if (clip != null) {\n clip.setText(mSelectedText);\n Toast.makeText(getContext(),\n R.string.text_copied,\n Toast.LENGTH_SHORT).show();\n }\n break;\n case 1:\n try {\n Uri uri = Uri.parse(\"sms:\");\n Intent intent = new Intent(\n Intent.ACTION_SENDTO, uri);\n intent.putExtra(\"sms_body\", mSelectedText);\n intent.putExtra(\"exit_on_send\", true);\n getContext().startActivity(intent);\n } catch (ActivityNotFoundException e) {\n e.printStackTrace();\n }\n break;\n case 2:\n try {\n Intent intent = new Intent();\n intent.setAction(\"com.motorola.createnote\");\n intent.putExtra(\"CLIPBOARD\", mSelectedText);\n getContext().startActivity(intent);\n } catch (ActivityNotFoundException e) {\n e.printStackTrace();\n }\n break;\n case 3:\n try {\n String broadcastAddress = String.format(\n \"%s://%s/%s\", \"searchWord\",\n \"powerword\", mSelectedText);\n Intent intent = new Intent(\n Intent.ACTION_VIEW, Uri\n .parse(broadcastAddress));\n getContext().startActivity(intent);\n } catch (ActivityNotFoundException e) {\n e.printStackTrace();\n }\n break;\n default:\n break;\n }\n\n clearSelection(true);\n\n }\n }).setOnCancelListener(new DialogInterface.OnCancelListener() {\n public void onCancel(DialogInterface dialog) {\n clearSelection(true);\n }\n }).show();\n }", "public void sharePage(){\n Intent shareIntent = new Intent(Intent.ACTION_VIEW);\n shareIntent.setData(Uri.parse(\"http://192.168.43.105:5000\"));//edit url\n startActivity(shareIntent);\n }", "private Intent Shareintent(){\n Intent Shareintent = new Intent(Intent.ACTION_SEND);\n Shareintent.setType(\"text/html\");\n Shareintent.putExtra(Intent.EXTRA_SUBJECT, \"SUBJECT\");\n Shareintent.putExtra(Intent.EXTRA_TEXT, \"http://www.habeshastudent.com/m/video.html\");\n return Shareintent;\n\n\n }", "@Override\n\t\t\tpublic boolean onLongClick(View v) {\n\t\t\t\tClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);\n\t\t\t\t\n\t\t\t\tpaste_clip_data = clipboard.getText().toString();\n\t\t\t\t\n\t\t\t\tif (!TextUtils.isEmpty(paste_clip_data) && paste_btn.getVisibility() == View.GONE){\n\t\t\t\t\t\n\t\t\t \t\n\t\t\t \tpaste_btn.setVisibility(View.VISIBLE);\n\t\t\t \t\n\t\t\t }\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t}", "public void pasteSelection() {\r\n \t\t// Bertoli Marco\r\n \t\tclipboard.paste();\r\n \r\n \t\t// If more than one stations are present enables link button\r\n \t\tif (graph.getModel().getRootCount() > 1) {\r\n \t\t\tsetConnect.setEnabled(true);\r\n \t\t}\r\n \t\t// If one station is present show select button\r\n \t\tif (graph.getModel().getRootCount() >= 1) {\r\n \t\t\tactivateSelect();\r\n \t\t}\r\n \t}", "public void checkClipboardContents() {\n\t\tClipboard c = Toolkit.getDefaultToolkit().getSystemClipboard();\n\t\tString is_youtube_link_l = \"youtube.com\"; // youtube url long version\n\t\tString is_youtube_link_s = \"youtu.be\";\n\t\ttry {\n\t\t\tString paste = (String) c.getContents(null).getTransferData(DataFlavor.stringFlavor);\n\t\t\tif (this.isActive()) {\n\t\t\t\tif (paste.toLowerCase().contains(is_youtube_link_l.toLowerCase())\n\t\t\t\t\t\t|| paste.toLowerCase().contains(is_youtube_link_s.toLowerCase())) {\n\t\t\t\t\tSystem.out.println(\"Youtube url detected, placing it in the textbox\");\n\t\t\t\t\tlblStatus.setText(\"Youtube url detected, placing it in the textbox\");\n\t\t\t\t\ttfURL.setText(paste);\n\t\t\t\t} else {\n\t\t\t\t\tlblStatus.setText(\"NON Youtube text detected in the clipboard, ignoring it\");\n\t\t\t\t\tSystem.out.println(\"NON Youtube text detected in the clipboard, ignoring it\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (paste.toLowerCase().contains(is_youtube_link_l.toLowerCase())\n\t\t\t\t\t\t|| paste.toLowerCase().contains(is_youtube_link_s.toLowerCase()) && autoMode == false) {\n\t\t\t\t\tSystem.out.println(\"Youtube url detected, open the application window\");\n\t\t\t\t\ttrayIcon.displayMessage(\"Youtube\", \"Youtube link has been detected!\", TrayIcon.MessageType.INFO);\n\t\t\t\t} else if (paste.toLowerCase().contains(is_youtube_link_l.toLowerCase())\n\t\t\t\t\t\t|| paste.toLowerCase().contains(is_youtube_link_s.toLowerCase()) && autoMode == true) {\n\t\t\t\t\tsetClipboardContents(modifyURL(returnRegex(), convertString()));// add the converted url to the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// clipboard\n\t\t\t\t\tSystem.out.println(\"Youtube url detected, converted url placed in your clipboard\");\n\t\t\t\t\ttrayIcon.displayMessage(\"Youtube\", \"Youtube link detected! Converted link in your clipboard\",\n\t\t\t\t\t\t\tTrayIcon.MessageType.INFO);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"NON Youtube text detected, ignoring it minimized\");\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} catch (IOException error) {\n\t\t\tSystem.out.println(\"Error\" + error.getMessage());\n\t\t} catch (UnsupportedFlavorException flavorexcept) {\n\t\t\tSystem.out.println(\"Error\" + flavorexcept.getMessage());\n\t\t}\n\t}", "public void copy() {\n\t\tcmd = new CopyCommand(editor);\n\t\tinvoker = new MiniEditorInvoker(cmd);\n\t\tinvoker.action();\n\t}", "public String getUrlForSharing() {\n PostData pd = getAdapter().getPost(mPager.getCurrentItem());\n return pd.getUrl();\n }", "public void selectFromClipboard() { genericClipboard(SetOp.SELECT); }", "@JavascriptInterface\n public void shareUrl(String title, String url) {\n Intent share = new Intent(android.content.Intent.ACTION_SEND);\n share.setType(\"text/plain\");\n\n // Add data to the intent, the receiving app will decide\n // what to do with it.\n share.putExtra(Intent.EXTRA_SUBJECT, title);\n share.putExtra(Intent.EXTRA_TEXT, url);\n\n mContext.startActivity(Intent.createChooser(share, \"Share blog post!\"));\n }", "public void doCopy() {\n if (renderPieces.size() == 0) {\n System.out.println(\"Nothing is selected for copy operation.\");\n return;\n }\n StringBuffer sb = new StringBuffer();\n\n textBuffer.renderInit();\n Text text;\n if (!reversed) {\n while ((text = textBuffer.getTextToRender()) != null) {\n sb.append(text.getText());\n }\n } else {\n while ((text = textBuffer.getPreToRender()) != null) {\n sb.append(text);\n }\n String reversedText = sb.toString();\n sb = new StringBuffer();\n for (int i = reversedText.length()-1; i >= 0; i -= 1) {\n sb.append(reversedText.charAt(i));\n }\n }\n Clipboard clipboard = Clipboard.getSystemClipboard();\n ClipboardContent content = new ClipboardContent();\n content.putString(sb.toString());\n clipboard.setContent(content);\n System.out.println(\"Copy succeed.\");\n }", "private void setClipboard(Shape c) { clipboard = c; }", "public void setClipboardContents( String aString ){\n StringSelection stringSelection = new StringSelection( aString );\n Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();\n clipboard.setContents( stringSelection, (ClipboardOwner) this );\n }", "public void copyNode ()\n {\n Clipboard clipboard = _tree.getToolkit().getSystemClipboard();\n clipboard.setContents(_tree.createClipboardTransferable(), ConfigEditor.this);\n _clipclass = group.getConfigClass();\n _paste.setEnabled(!_readOnly);\n }", "@Override\n\tpublic void editorCopy()\n\t{\n\t\tclipboard = stringBuffer.substring(selectionStart,selectionEnd);\n\n\t\tSystem.out.println(\"DEBUG: performing Copy\" + clipboard) ;\n\t}", "@Source(\"gr/grnet/pithos/resources/editcopy.png\")\n ImageResource copy();", "@Override\r\n\tpublic void paste() {\n\t\t\r\n\t}", "private void handleCopyingTextToClipboard(String text){\n Intent intent = new Intent(getContext(), ClipboardEventHandler.class);\n intent.putExtra(\"action\", \"switch\");\n intent.putExtra(\"content\", text);\n\n getContext().startService(intent);\n\n Snackbar.make(getView(), getString(R.string.COPIED_BEGINNIG) + \" \" +\"\\\"\"+ text +\"\\\"\" + \" \" + getString(R.string.COPIED_END), Snackbar.LENGTH_SHORT).show();\n }", "@Source(\"gr/grnet/pithos/resources/editpaste.png\")\n ImageResource paste();", "default void setClipboardText(String text) {\n setClipboard(ClipboardContentType.PLAINTEXT, Base64\n .getMimeEncoder()\n .encode(text.getBytes(StandardCharsets.UTF_8)));\n }", "default String getClipboard(ClipboardContentType contentType) {\n return CommandExecutionHelper.execute(this, new AbstractMap.SimpleEntry<>(GET_CLIPBOARD,\n prepareArguments(\"contentType\", contentType.name().toLowerCase())));\n }", "@FXML\n private void copyExit() {\n final Clipboard clipboard = Clipboard.getSystemClipboard();\n final ClipboardContent url = new ClipboardContent();\n url.putString(EXIT_MESSAGE);\n clipboard.setContent(url);\n }", "public final void mT__238() throws RecognitionException {\n try {\n int _type = T__238;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalMyDsl.g:236:8: ( 'copy' )\n // InternalMyDsl.g:236:10: 'copy'\n {\n match(\"copy\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public void copy(ICopyContext context) {\n\tPictogramElement[] pes = context.getPictogramElements();\n\tObject[] bos = new Object[pes.length];\n\tfor (int i = 0; i < pes.length; i++) {\n\t PictogramElement pe = pes[i];\n\t bos[i] = getBusinessObjectForPictogramElement(pe);\n\t}\n\t// put all business objects to the clipboard\n\tputToClipboard(bos);\n }", "@Override\n public void onClick(View view) {\n Intent sharingIntent = new Intent(Intent.ACTION_SEND);\n sharingIntent.setType(\"text/plain\");\n sharingIntent.putExtra(Intent.EXTRA_TITLE,title );\n sharingIntent.putExtra(Intent.EXTRA_TEXT,description);\n startActivity(Intent.createChooser(sharingIntent,\"Share using\"));\n\n }", "public void share(View view){\n Toast.makeText(this, \"Loading share options ...\", Toast.LENGTH_SHORT).show();\n //Create an intent to share\n Intent sharingIntent = new Intent(Intent.ACTION_SEND);\n sharingIntent.setType(\"text/plain\");\n String shareBody = \"You should check out \" + getString(R.string.app_name) + \", an app where you can easily find books at the school library!\";\n if(currentBook.title != null)\n shareBody = \"Check out \\\"\" + currentBook.title + \"\\\", a book that I found with the app, \" + getString(R.string.app_name);\n sharingIntent.putExtra(Intent.EXTRA_SUBJECT, \"\" + getString(R.string.app_name));\n sharingIntent.putExtra(Intent.EXTRA_TEXT, shareBody);\n startActivity(Intent.createChooser(sharingIntent, \"Share via\"));\n }", "public final java.awt.datatransfer.Clipboard getClipboard()\r\n {\r\n return _theClipboard;\r\n }", "public void addToClipboard(ArrayList<String> paths) {\n try {\n PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(this.clipboardPath, true)));\n for (String path : paths) {\n out.println(path);\n }\n out.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void share(String title, String text)\n {\n Intent sendIntent = new Intent();\n sendIntent.setAction(Intent.ACTION_SEND);\n sendIntent.putExtra(Intent.EXTRA_TEXT, text);\n sendIntent.setType(\"text/plain\");\n startActivity(Intent.createChooser(sendIntent, title));\n }", "public Buffer getClipboard() {\n return clipboard.getCopy();\n }", "public void performCopy() {\n \t\ttext.copy();\n \t}", "@Override\n public void pasteFromClipboard (boolean shft, boolean alt) {\n if (shft == false && alt == false) selectFromClipboard();\n }", "private void launchShareIntent() {\n Intent sendIntent = new Intent();\n sendIntent.setAction(Intent.ACTION_SEND);\n sendIntent.putExtra(Intent.EXTRA_TEXT, gif.getFullGif().getUrl());\n sendIntent.setType(\"text/plain\");\n startActivity(Intent.createChooser(sendIntent, getString(R.string.share_dialog_title)));\n }", "void onBottomQDMPasteClicked();", "default String getClipboardText() {\n byte[] base64decodedBytes = Base64\n .getMimeDecoder()\n .decode(getClipboard(ClipboardContentType.PLAINTEXT));\n return new String(base64decodedBytes, StandardCharsets.UTF_8);\n }", "public void setClipboardContents(String aString) {\n\t\tStringSelection stringSelection = new StringSelection(aString);\n\t\tClipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();\n\t\tclipboard.setContents(stringSelection, this);\n\t}", "public static void attachShareIntent(Context context, ImageButton button, String url) {\n String subject = context.getResources().getString(R.string.intent_subject);\n String title = context.getResources().getString(R.string.intent_title);\n button.setOnClickListener(view -> {\n Intent sharingIntent = new Intent(Intent.ACTION_SEND);\n sharingIntent.setType(\"text/plain\");\n sharingIntent.putExtra(Intent.EXTRA_SUBJECT, subject);\n sharingIntent.putExtra(Intent.EXTRA_TEXT, url);\n context.startActivity(Intent.createChooser(sharingIntent, title));\n });\n }", "@Override\n public boolean canPaste(Clipboard clipboard) {\n return false;\n }", "public void paste() {\n\t\tcmd = new PasteCommand(editor);\n\t\tinvoker = new MiniEditorInvoker(cmd);\n\t\tinvoker.action();\n\t}", "@org.jetbrains.annotations.NotNull()\n public final com.stripe.android.model.StripeIntent.NextActionData.RedirectToUrl copy(@org.jetbrains.annotations.NotNull()\n android.net.Uri url, @org.jetbrains.annotations.Nullable()\n java.lang.String returnUrl) {\n return null;\n }", "@Override\n\t\t\tpublic void onPrimaryClipChanged() {\n\t\t\t\tClipData data = mClipboard.getPrimaryClip();\n\t\t\t\tItem item = data.getItemAt(0);\n\t\t\t\tLog.e(ClientSocketThread.TAG, \"复制文字========:\"+item.getText());\t\n \t\t\t\tsendSocketDataTotalLen = item.getText().toString().getBytes().length+4;\n\t\t\t\tsendTotalLen = FileUtil.intToByte(sendSocketDataTotalLen);\n\t\t\t\tsendSocketDataCategories =7;\n\t\t\t\tsendCategories = FileUtil.intToByte(sendSocketDataCategories);\n\t\t\t\tbyte[] sendDataBuffer = new byte[sendSocketDataTotalLen+4];\n\t\t\t\tSystem.arraycopy(sendTotalLen, 0, sendDataBuffer, 0, 4);\n\t\t\t\tSystem.arraycopy(sendCategories, 0, sendDataBuffer, 4, 4);\n\t\t\t\tSystem.arraycopy(item.getText().toString().getBytes(), 0, sendDataBuffer, 8, item.getText().toString().getBytes().length);\n\t\t\t\tThreadReadWriterIOSocket.writeDataToSocket(sendDataBuffer);\n\t\t\t}", "@SuppressLint({\"NewApi\"})\n private void copyHintToClipboard(String str, String str2) {\n if (Build.VERSION.SDK_INT >= 11) {\n ((ClipboardManager) this.cordova.getActivity().getSystemService(\"clipboard\")).setPrimaryClip(ClipData.newPlainText(str2, str));\n }\n }", "@Override\n public void onClick(View v) {\n Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);\n sharingIntent.setType(\"text/plain\");\n String shareBody = caption + \" - \" + description;\n sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, \"Sobers Stories\");\n sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);\n startActivity(Intent.createChooser(sharingIntent, \"Share With Friends\"));\n\n }", "protected OwClipboard getClipboard()\r\n {\r\n return ((OwMainAppContext) getContext()).getClipboard();\r\n }", "@Override\n\tpublic void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo) {\n\t\tsuper.onCreateContextMenu(menu, v, menuInfo);\n\t\t\n\t\tmenu.add(0, v.getId(), 0, \"Copy\");\n\t\t\n\t\tTextView cop = (TextView) v;\n\t\t\n\t\tClipboardManager cb = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);\n\t\tcb.setText(cop.getText());\n\t}", "private static void copyFile(File scrFile, File file) {\n\t\r\n}", "private JButton getCopyButton() {\n if (copyButton == null) {\n copyButton = new JButton();\n copyButton.setText(\"Copy\");\n copyButton.setToolTipText(\"Copy settings from an existing site to a new site\");\n copyButton.setActionCommand(\"Copy\");\n copyButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent e) {\n copySelectedBalloonSettings();\n }\n });\n }\n return copyButton;\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tCheckBoxTreeNode node=(CheckBoxTreeNode)path.getLastPathComponent();\n\t\t\t\tString nodeName=(String)node.getUserObject();\n\t\t\t\tStringSelection nodeNameSelection=new StringSelection(nodeName);\n\t\t\t\tClipboard clip=websiteListTree.getToolkit().getSystemClipboard();\n\t\t\t\tclip.setContents(nodeNameSelection, null);\n\t\t\t}", "private void sharePlan(){\n Intent shareIntent = new Intent(Intent.ACTION_SEND);\n shareIntent.setType(\"text/plain\");\n shareIntent.putExtra(Intent.EXTRA_SUBJECT, \"My Planit Plan\");\n shareIntent.putExtra(Intent.EXTRA_TEXT,\n \"Hi All! This is my plan made using Planit! www.planit.com/10293987\");\n startActivity(Intent.createChooser(shareIntent, \"Share with\"));\n }", "public void pasteSystemSelection() {\n Clipboard systemSelection = getToolkit().getSystemSelection();\n if (systemSelection != null) {\n pasteClipboard(systemSelection);\n }\n }", "protected void addShare() {\n \t\t((InputMethodManager) this.getContext().getSystemService(\n \t\t\t\tContext.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(\n \t\t\t\tthis.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);\n \t\tIntent intent = new Intent(Intent.ACTION_SEND);\n \t\tArrayList<String> images = this.mNoteItemModel.getImages();\n \t\tLog.i(TAG, images.toString());\n \t\tif (images.isEmpty())\n \t\t\tintent.setType(\"text/plain\");\n \t\telse if (images.size() == 1) {\n \t\t\tintent.setType(\"image/*\");\n \t\t} else if (images.size() > 1) {\n \t\t\tintent.setAction(Intent.ACTION_SEND_MULTIPLE);\n \t\t\tintent.setType(\"images/*\");\n \t\t}\n \t\tintent.putExtra(Intent.EXTRA_TITLE, \"Share my note...\");\n \t\tintent.putExtra(Intent.EXTRA_TEXT, this.mNoteItemModel.getContent());\n \t\tif (images.size() == 1) {\n \t\t\tUri uri = this.mNoteItemModel.getImageUri(images.get(0));\n \t\t\tintent.putExtra(Intent.EXTRA_STREAM, uri);\n \t\t} else if (images.size() > 1) {\n \t\t\tArrayList<Uri> uris = new ArrayList<Uri>();\n \t\t\tfor (String image : images) {\n \t\t\t\turis.add(this.mNoteItemModel.getImageUri(image));\n \t\t\t}\n \t\t\tintent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);\n \t\t}\n \t\tthis.getContext().startActivity(Intent.createChooser(intent, \"Share\"));\n \t}", "static public Link getContentsLink(Item copyIntoFolderComposer) {\n\t\treturn copyIntoFolderComposer.getOutgoingLink(CopyComposerCST.COPY_INTO_FOLDER_COMPOSER_lt_CONTENTS);\n\t}", "static void setCopying(){isCopying=true;}", "public void copyCode(ActionEvent actionEvent) {\n content.putString(String.valueOf(teamCombobox.getValue().getTeamCode()));\n clipboard.setContent(content);\n displayMessage(messagePane,\"Code copied\",false);\n }", "@Override\n public boolean onOptionsItemSelected(@NonNull MenuItem item) {\n switch (item.getItemId()) {\n case R.id.action_share:\n Intent intent = new Intent(Intent.ACTION_SEND);\n intent.setType(\"text/plain\");\n String link;\n //Test if its from google or b-ok\n if(book.getVolumeInfo().getWebLink().contains(\"books.google.com\")) {\n link = book.getVolumeInfo().getWebLink();\n }\n else {\n link = \"https://1lib.eu\" + book.getVolumeInfo().getWebLink();\n }\n intent.putExtra(Intent.EXTRA_TEXT, link);\n startActivity(Intent.createChooser(intent, \"Share with\"));\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "protected void genericClipboard(SetOp op) {\n RTGraphComponent.RenderContext myrc = (RTGraphComponent.RenderContext) (getRTComponent().getRTRenderContext()); if (myrc == null) return;\n Clipboard clipboard = getToolkit().getSystemClipboard();\n Transferable trans = clipboard.getContents(this);\n if (trans != null && trans.isDataFlavorSupported(DataFlavor.stringFlavor)) {\n try {\n\t // Extract the entities\n String clip = (String) trans.getTransferData(DataFlavor.stringFlavor);\n List<SubText> al = EntityExtractor.list(clip);\n\n // Also, extract just the single lines\n\t if (strictMatches() == false) {\n StringTokenizer st = new StringTokenizer(clip, \"\\n\");\n\t while (st.hasMoreTokens()) {\n\t String str = st.nextToken();\n\t // Remove before and after whitespaces...\n\t while (str.length() > 0 && (str.charAt(0) == ' ' || str.charAt(0) == '\\t')) \n\t str = str.substring(1,str.length());\n\t while (str.length() > 0 && (str.charAt(str.length()-1) == ' ' || str.charAt(str.length()-1) == '\\t'))\n\t str = str.substring(0,str.length()-1);\n al.add(new Entity(str,str,null,0,0));\n\t }\n }\n\n\t // Get the new items\n\t Set<String> new_set = new HashSet<String>();\n for (int i=0;i<al.size();i++) { \n\t String clip_str = al.get(i).toString();\n Iterator<String> it = entity_to_wxy.keySet().iterator();\n while (it.hasNext()) {\n\t String entity = it.next();\n\t // Check for a concat\n\t if (entity.indexOf(BundlesDT.DELIM) >= 0) entity = entity.substring(entity.lastIndexOf(BundlesDT.DELIM)+1, entity.length());\n\t if (Utils.isIPv4CIDR(clip_str) && Utils.isIPv4(entity) && Utils.ipMatchesCIDR(entity, clip_str))\n\t new_set.add(entity);\n\t if (entity.indexOf(clip_str) >= 0) \n\t new_set.add(entity);\n }\n\t }\n\n\t // Get the old items\n\t Set<String> old_set = new HashSet<String>(myrc.filterEntities(getRTParent().getSelectedEntities()));\n\n\t // Do the set operation\n\t switch (op) {\n\t case SELECT: getRTParent().setSelectedEntities(new_set);\n\t break;\n\t case ADD: new_set.addAll(old_set);\n\t getRTParent().setSelectedEntities(new_set);\n\t\t\t break;\n\t case REMOVE: old_set.removeAll(new_set);\n\t getRTParent().setSelectedEntities(old_set);\n\t\t\t break;\n\t case INTERSECT: old_set.retainAll(new_set);\n\t getRTParent().setSelectedEntities(old_set);\n\t\t\t break;\n\t }\n } catch (UnsupportedFlavorException ufe) {\n System.err.println(\"genericClipboard failed... unsupported data flavor : \" + ufe);\n ufe.printStackTrace(System.err);\n } catch (IOException ioe) {\n System.err.println(\"genericClipboard failed... io exception : \" + ioe);\n ioe.printStackTrace(System.err);\n }\n }\n }" ]
[ "0.7745089", "0.67493945", "0.66512465", "0.6580002", "0.6568256", "0.65657777", "0.6499258", "0.6386924", "0.63378716", "0.63128453", "0.62688386", "0.61786574", "0.6178483", "0.6171299", "0.61654025", "0.6158195", "0.6150541", "0.61153144", "0.6076092", "0.60744566", "0.6070445", "0.60698444", "0.60224396", "0.6008842", "0.59786123", "0.5970939", "0.5961661", "0.5958355", "0.5950883", "0.59107476", "0.5900357", "0.58854645", "0.58819866", "0.5881544", "0.5871326", "0.5852326", "0.582238", "0.58185047", "0.5791575", "0.5784419", "0.57648754", "0.57574743", "0.574287", "0.572669", "0.57243633", "0.56903076", "0.56557626", "0.5648871", "0.5625824", "0.56257814", "0.5613308", "0.55997515", "0.5599739", "0.55939716", "0.5582264", "0.55430716", "0.5536487", "0.5528493", "0.5516828", "0.55034035", "0.54572153", "0.5434489", "0.5432579", "0.54320717", "0.54236627", "0.5420979", "0.54152596", "0.54040545", "0.53919315", "0.5380228", "0.536077", "0.53604287", "0.5355614", "0.53551257", "0.5330446", "0.5317067", "0.5315718", "0.5312801", "0.5312061", "0.530395", "0.53031296", "0.5295223", "0.5292916", "0.5286185", "0.52845436", "0.528062", "0.5278085", "0.5271393", "0.5270059", "0.5252799", "0.5247656", "0.5236937", "0.52263844", "0.5204231", "0.51973706", "0.5196897", "0.5195517", "0.5192036", "0.518995", "0.5188584" ]
0.85535204
0
User: SametCokpinar Date: 17/12/14 Time: 23:11
public interface BabyInfoRepository extends JpaRepository<BabyInfo, Integer> { @Query("SELECT bi FROM BabyInfo bi WHERE bi.user.id = :user_id") BabyInfo findByUser(@Param("user_id") Integer id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Long getUserCreated();", "private void getUserInfo() {\n\t}", "public String getUsername()\r\n/* 11: */ {\r\n/* 12:30 */ return this.username;\r\n/* 13: */ }", "private static String getStamp() {\n\t\t\t return new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\r\n\t\t}", "long getLoginAt();", "public java.lang.String getUserCreated() {\n\t\treturn _tempNoTiceShipMessage.getUserCreated();\n\t}", "Long getUserUpdated();", "@Override\r\n public String toString() {\r\n return timeStamp + username + \": \" + message;\r\n }", "public java.lang.String getUser(){\r\n return localUser;\r\n }", "public java.lang.String getUser(){\r\n return localUser;\r\n }", "public java.lang.String getUser(){\r\n return localUser;\r\n }", "UserInfo getUserInfo();", "public String getTimestamp() \n{\n Calendar now = Calendar.getInstance();\n return String.format(\"20%1$ty-%1$tm-%1$td_%1$tHh%1$tMm%1$tSs\", now);\n}", "@Override\n public String toString() {\n SimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd'@'HH:mm:ss\");\n String userInformation = new String();\n Date date = new Date();\n userInformation = \"[\" + username + \" - \" +\n socket.getInetAddress().getHostAddress() +\n \":\" + socket.getPort() + \" - \" + formatter.format(date)\n + \"]: \";\n return userInformation;\n }", "public int getUserTime() {\n\t\treturn this.userTime;\n\t}", "java.lang.String getUser();", "public static void main(String[] args) throws Exception {\n Calendar cal = Calendar.getInstance();\n SimpleDateFormat simpleformat = new SimpleDateFormat(\"E, dd MMM yyyy HH:mm:ss Z\");\n System.out.println(\"Today's date and time = \"+simpleformat.format(cal.getTime()));\n // displaying date\n simpleformat = new SimpleDateFormat(\"dd/MMMM/yyyy\");\n String str = simpleformat.format(new Date());\n System.out.println(\"Current Date = \"+str);\n // current time\n simpleformat = new SimpleDateFormat(\"HH:mm:ss\");\n String strTime = simpleformat.format(new Date());\n System.out.println(\"Current Time = \"+strTime);\n // displaying hour in HH format\n simpleformat = new SimpleDateFormat(\"HH\");\n String strHour = simpleformat.format(new Date());\n System.out.println(\"Hour in HH format = \"+strHour);\n\n\n\n //formato ideal\n simpleformat = new SimpleDateFormat(\"dd/MM/yyyy - HH:mm:ss\");\n String strTimeDay = simpleformat.format(new Date());\n System.out.println(\"Dia e Hora = \" + strTimeDay);\n\n }", "public long getCreatedByUser();", "public java.lang.String getTimeStamp(){\r\n return localTimeStamp;\r\n }", "String timeCreated();", "public String parseUser(String userLine) {\n final int START_OF_USER_NAME = 6;\n \t\tString userName = userLine.substring(\n START_OF_USER_NAME, userLine.indexOf(\"Date: \") - 1).trim();\n \n \t\treturn userName;\n \t}", "private void logUser() {\n }", "int getSignOnTime();", "public void printUserInfo(){\n System.out.print(\"Username: \"+ getName() + \"\\n\" + \"Birthday: \"+getBirthday()+ \"\\n\"+ \"Hometown: \"+getHome()+ \"\\n\"+ \"About: \" +getAbout()+ \" \\n\"+ \"Subscribers: \" + getSubscriptions());\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn \"[\" + this.getTimestamp() + \"] \" + this.getOwnerName() + \" -> \" + this.getText();\n\t}", "private void loggedInUser() {\n\t\t\n\t}", "void setUserCreated(final Long userCreated);", "@Override\n public String toString(){\n return String.format(\"ApplicationUser ehrId: '%s', shimmerId: '%s', shimKey: '%s', is logged in: '%s'\", applicationUserId.getEhrId(), shimmerId, getApplicationUserId().getShimKey());\n }", "public int getL1UserInformation();", "public Date getCreateTime()\n/* */ {\n/* 177 */ return this.createTime;\n/* */ }", "@Override\n public String toString() {\n return getUserName() + \" on \" + getDate() + \"\\n\" + message + \"\\nType: \" + getType();\n }", "private static String getTime() {\n\t\tDate getDate = new Date();\n\t\tString timeFormat = \"M/d/yy hh:mma\";\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(timeFormat);\n\t\treturn \"[\" + sdf.format(getDate) + \"]\\t\";\n\t}", "Date getLastLogin();", "public final String mo69547a() {\n return \"user\";\n }", "public String toString()\r\n/* 61: */ {\r\n/* 62:75 */ return \"User [username=\" + this.username + \", password=\" + this.password + \", email=\" + this.email + \", phone=\" + this.phone + \"]\";\r\n/* 63: */ }", "private String getTimestamp() {\n return Calendar.getInstance().getTime().toString();\n }", "public void mo23018c() {\n this.f26122b.edit().putLong(\"last.last.show.attend\", System.currentTimeMillis()).apply();\n }", "public int getTimeOfSession();", "private static String getTimeStamp()\r\n\t{\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd_HH.mm.ss\");\r\n\t\tDate date = new Date();\r\n\t\treturn dateFormat.format(date);\r\n\t}", "public static boolean isPassOneHour(String pass)\n {\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n Date date = new Date();\n String current = dateFormat.format(date);\n\n //Extract current data time all values\n\n int current_year = Integer.parseInt(current.substring(0, 4));\n int current_month = Integer.parseInt(current.substring(5,7))-1;\n int current_day = Integer.parseInt(current.substring(8,10));\n\n int current_hour = Integer.parseInt(current.substring(11,13));\n int current_minute = Integer.parseInt(current.substring(14,16));\n int current_seconds = Integer.parseInt(current.substring(17));\n\n //String pass = \"2016-10-05 10:14:00\";\n\n //Extract last update data (pass from parameter\n\n int year = Integer.parseInt(pass.substring(0, 4));\n int month = Integer.parseInt(pass.substring(5,7))-1;\n int day = Integer.parseInt(pass.substring(8,10));\n\n int hour = Integer.parseInt(pass.substring(11,13));\n int minute = Integer.parseInt(pass.substring(14,16));\n int seconds = Integer.parseInt(pass.substring(17));\n\n\n System.out.println(\"CURRENT: \" + current_year+\"/\"+current_month+\"/\"+current_day+\" \"+current_hour+\":\"+current_minute+\":\"+current_seconds);\n\n System.out.println(\"PASS: \" + year+\"/\"+month+\"/\"+day+\" \"+hour+\":\"+minute+\":\"+seconds);\n\n if (current_year == year)\n {\n if (current_month == month)\n {\n if (current_day == day)\n {\n if (current_hour > hour)\n {\n if ((current_hour - hour > 1))\n {\n //Bi ordu gutxienez\n System.out.println(\"Bi ordu gutxienez: \" + (current_hour) + \" / \" + hour);\n return true;\n }\n else\n {\n if (((current_minute + 60) - minute ) < 60)\n {\n //Ordu barruan dago\n System.out.println(\"Ordu barruan nago ez delako 60 minutu pasa: \" + ((current_minute + 60) - minute ));\n return false;\n }\n else\n {\n //Refresh\n System.out.println(\"Eguneratu, ordu bat pasa da gutxienez: \" + ((current_minute + 60) - minute ));\n return true;\n }\n }\n\n }\n }\n }\n }\n return false;\n }", "public Long getUserId()\n/* */ {\n/* 73 */ return this.userId;\n/* */ }", "private long now() {\n\treturn System.currentTimeMillis();\n }", "public long getTimeLogged(){\r\n\t\treturn timeLogged;\r\n\t}", "private String getDate()\r\n\t{\r\n\t\tCalendar cal = Calendar.getInstance();\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\r\n\t\treturn sdf.format(cal.getTime());\r\n\t}", "@Override\n public String toString() {\n return this.getTimestamp().atZone(ZoneId.of(\"Europe/Vienna\")).format(DateTimeFormatter.ofPattern(\"dd.MM.yyyy HH:mm\"))\n + \" \" + this.getFirstName()\n + \" \" + this.getLastName().substring(0,1) + \".\"\n //+ \", \" + this.getTelephoneNo()\n //+ \" (\" + this.getEmail() + \")\"\n ;\n }", "private void responseMonitor(List<User> returnedUsers, User returnedUserFromEdit){\n String USER_NAME= returnedUserFromEdit.getName();\n String USER_EMAIL = returnedUserFromEdit.getEmail();\n Long UserID = returnedUserFromEdit.getId();\n Toast.makeText(this,getString(R.string.returned)+ USER_NAME+ \" , \"+ USER_EMAIL+\" , \"+ UserID,Toast.LENGTH_LONG).show();\n }", "public int getTime() { return _time; }", "@Override\r\n\tpublic String gettime() {\n\t\treturn user.gettime();\r\n\t}", "public long timeOfCreation() {\n\t\treturn timeOfCreation ;\n\t}", "String getUser();", "String getUser();", "private static void oneUserExample()\t{\n\t}", "public Date getUserCreateTime() {\r\n return userCreateTime;\r\n }", "public int getCreatedTime() {\n return createdTime_;\n }", "@Override\n\tpublic String whoami() {\n\t\treturn \"개발자\";\n\t}", "@Override\n public String toString() {\n String output = \"User Info for: \" + getId();\n output += \"\\n\\tName: \" + getFirstName() + \" \" + getLastName();\n output += \"\\n\\tCreated on: \" + DF.format(getEnrolDate());\n output += \"\\n\\tLast access: \" + DF.format(getLastAccess());\n \n return output;\n }", "public void displayUserInformations() {\n println(\"getLocation(): \"+user.getLocation());\n println(\"getFriendsCount(): \"+user.getFriendsCount());\n println(\"getFollowersCount(): \"+user.getFollowersCount());\n println(\"getDescription(): \"+user.getDescription());\n println(\"getCreatedAt() : \"+user.getCreatedAt() );\n println(\"getDescriptionURLEntities(): \"+user.getDescriptionURLEntities());\n println(\"getFavouritesCount() : \"+user.getFavouritesCount() );\n }", "U getCreateby();", "private String getCurrentTime() {\n DateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\");\n Date date = new Date();\n return dateFormat.format(date);\n }", "U getUpdateby();", "@Override\n\tpublic String getTimeAndDate() throws RemoteException {\n\tDate date = new Date();\n\tSystem.out.println(date.toString());\n\treturn date.toString();\n\t}", "long getRetrievedTime();", "private static String getDate() {\n return new SimpleDateFormat(\"yyyyMMddHHmmss\").format\n (new Date(System.currentTimeMillis()));\n }", "public Date getGmtLogin() {\n return gmtLogin;\n }", "public String toString() {\r\n \t\treturn \"\\\"\" + _name + \"\\\" by \" + _creator;\r\n \t}", "public int getCreatedBy();", "public int getCreatedBy();", "public int getCreatedBy();", "public int getCreatedBy();", "public int getCreatedBy();", "public int getCreatedBy();", "public int getCreatedBy();", "public int getCreatedBy();", "public int getCreatedBy();", "public int getCreatedBy();", "public int getCreatedBy();", "public int getCreatedBy();", "public int getCreatedBy();", "@Override\r\n public String toString() {\r\n return pontosTimeMandante + \" x \" + pontosTimeVisitante + \" - \" + (isFinalizado() ? \"Finalizado\" : \"Em andamento\");\r\n }", "public static String timestamp(){\n\t\tDate date = new Date();\n\t\tDateFormat hourdateFormat = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss \");\n\t\treturn hourdateFormat.format(date);\n\t}", "private static void printDetail() {\n System.out.println(\"Welcome to LockedMe.com\");\n System.out.println(\"Version: 1.0\");\n System.out.println(\"Developer: Sherman Xu\");\n System.out.println(\"[email protected]\");\n }", "public Date getDateCreated(){return DATE_CREATED;}", "@Override\n public String toString() {\n return \"\\r\\nUser: \" + user + \" Message: \" + message +\" \\r\\n\" ;\n }", "@Override\n\tpublic void GetServerUser() {\n\n\t}", "public UserInfo() {\r\n\t\t// TODO Auto-generated constructor stub\r\n\t}", "public int getLastLogin() {\n\t \t return lastLogin; \n\t}", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "public GETINFO(int time, String userName) {\n\t\tsuper(Operation.GETINFO);\n\t\tusername = userName;\n\t\tthis.time = time;\n\t\t //this.operation = Operation.GETINFO;\n\t}", "public Date getSOHTimestamp() {\r\n/* 265 */ return this._SOHTimestamp;\r\n/* */ }", "@NonNull\n public String toString(){\n return this.hora+\":\"+this.minutos+\" \"+this.segundos+\" Sec \"+this.dia+\"/\"+this.mes+\"/\"+this.anno;\n }", "long getTimeBoltBBoltC();", "public Calendar getCreationDate() throws IOException {\n/* 238 */ return getCOSObject().getDate(COSName.CREATION_DATE);\n/* */ }", "public synchronized static String getRew3UserId() {\n return \"userId\";\n }", "double getClientTime();", "@Override\n public String toString() {\n return username;\n }", "int getCreatedBy();", "public int getEditedTime() {\n return editedTime_;\n }", "public int getUser1Y_ID();", "public int getUser1Z_ID();", "@Override\n public String toString() {\n return getUsername();\n }" ]
[ "0.59850466", "0.5828177", "0.5813386", "0.57778716", "0.56043804", "0.5585059", "0.5527926", "0.5495024", "0.5485443", "0.5485443", "0.5485443", "0.5460306", "0.54291457", "0.54243875", "0.54107064", "0.5377989", "0.53711355", "0.53695405", "0.5365236", "0.5358144", "0.5352531", "0.5340539", "0.5338259", "0.5333464", "0.53181255", "0.52964544", "0.528871", "0.52827954", "0.52470106", "0.52265954", "0.52260965", "0.52253705", "0.52187335", "0.5212688", "0.5205872", "0.5205463", "0.51991194", "0.5194786", "0.51934016", "0.5191666", "0.51774746", "0.5176265", "0.51762605", "0.51526767", "0.51401895", "0.5138387", "0.5136475", "0.51331735", "0.5131347", "0.51285386", "0.51285386", "0.5127919", "0.51219344", "0.5121155", "0.5116627", "0.5116581", "0.5108734", "0.51083475", "0.5107679", "0.5104389", "0.5081459", "0.50794256", "0.50770426", "0.506387", "0.5060714", "0.50552094", "0.50552094", "0.50552094", "0.50552094", "0.50552094", "0.50552094", "0.50552094", "0.50552094", "0.50552094", "0.50552094", "0.50552094", "0.50552094", "0.50552094", "0.50542027", "0.5052562", "0.5051755", "0.5047377", "0.5046427", "0.5045391", "0.5045293", "0.5044352", "0.50419843", "0.50419843", "0.5039906", "0.5035638", "0.5034951", "0.5032257", "0.50297886", "0.50295794", "0.50268793", "0.5026545", "0.50208056", "0.5020456", "0.5016497", "0.50150263", "0.50125456" ]
0.0
-1
Created by Ankit on 12/27/2017.
public interface MarkAsReadNotificationCallback { void onNotificationMarkedAsRead(int pos); void onNotificationMarkAsReadFailed(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "public final void mo51373a() {\n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "public void mo38117a() {\n }", "private void poetries() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\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\n\tprotected void interr() {\n\t}", "private void m50366E() {\n }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "public void mo4359a() {\n }", "private static void cajas() {\n\t\t\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "private void kk12() {\n\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "private void init() {\n\n\t}", "@Override\n public void init() {\n }", "@Override\n protected void getExras() {\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 protected void initialize() {\n\n \n }", "@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\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@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 init() {\n }", "@Override\n public void init() {}", "@Override\r\n\tpublic void init() {}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\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 public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\n protected void initialize() \n {\n \n }", "public void mo12628c() {\n }", "public void mo6081a() {\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\tpublic void ligar() {\n\t\t\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "private void strin() {\n\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tpublic void init() {\n\t}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "public void mo12930a() {\n }", "private Rekenhulp()\n\t{\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "public void m23075a() {\n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n public void memoria() {\n \n }", "public final void mo91715d() {\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "public void mo55254a() {\n }", "public void mo21779D() {\n }", "@Override\n\t\tpublic void init() {\n\t\t}", "protected void mo6255a() {\n }", "@Override\n public int retroceder() {\n return 0;\n }", "public void mo21877s() {\n }", "public void Tyre() {\n\t\t\r\n\t}" ]
[ "0.600492", "0.58365196", "0.58291996", "0.57908744", "0.5717027", "0.5685721", "0.5685721", "0.56790334", "0.56535006", "0.5609167", "0.559915", "0.5597043", "0.5584709", "0.5581932", "0.5575914", "0.5561707", "0.5558119", "0.5535029", "0.55297774", "0.5518671", "0.5517876", "0.5514219", "0.551048", "0.5507322", "0.5507322", "0.5507322", "0.5507322", "0.5507322", "0.548998", "0.54833245", "0.5469921", "0.5454305", "0.54466355", "0.5439955", "0.54367316", "0.54365057", "0.5433512", "0.54053164", "0.5404737", "0.5404737", "0.5404737", "0.5404737", "0.5404737", "0.5404737", "0.5404737", "0.5403069", "0.5400019", "0.5400019", "0.53934443", "0.53838164", "0.5375673", "0.5375673", "0.5375673", "0.5375673", "0.5375673", "0.5375673", "0.53707635", "0.53707635", "0.53707635", "0.53653055", "0.536499", "0.53640676", "0.53531057", "0.5352174", "0.5348855", "0.5348855", "0.5348855", "0.534475", "0.534475", "0.53441066", "0.5342032", "0.5335199", "0.53345734", "0.53345734", "0.53345734", "0.53298557", "0.5318892", "0.53113115", "0.53035843", "0.5302091", "0.5301373", "0.5292147", "0.52905715", "0.5286319", "0.5282477", "0.52784216", "0.527454", "0.52706957", "0.52617425", "0.5260229", "0.5260229", "0.5256347", "0.5248272", "0.52367616", "0.52338576", "0.5223839", "0.5221653", "0.5219839", "0.52162784", "0.52137613", "0.5210653" ]
0.0
-1
generates and returns a Map with randomized scenery and predetermined size and path
public static Map generateRandomMapWithPath(){ Map map = new Map(20,20,(int)System.currentTimeMillis(),0.25); // x size, y size try { Queue<int[]> corners = new LinkedList<int[]>(); // add corners to the queue // lines between corners must be strictly vertical or horizontal // it is assumed that such filtering will be done during gametime // by restricting player's input // otherwise, no path will be drawn on the map corners.add(new int[] {0,3}); corners.add(new int[] {15,3}); corners.add(new int[] {15,15}); corners.add(new int[] {6,15}); corners.add(new int[] {6,8}); corners.add(new int[] {2,8}); // build path map.buildNewPath(corners); } catch (PathException e) { e.printStackTrace(); } return map; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void generate()\r\n {\r\n mapPieces = myMap.Generate3();\r\n mapWidth = myMap.getMapWidth();\r\n mapHeight = myMap.getMapHeight();\r\n }", "private void generateMap() {\n\n\t\t//Used to ensure unique locations of each Gameboard element\n\t\tboolean[][] spaceUsed = new boolean[12][12];\n\n\t\t//A running total of fences generated\n\t\tint fencesGenerated = 0;\n\n\t\t//A running total of Mhos generated\n\t\tint mhosGenerated = 0;\n\n\t\t//Fill the board with spaces and spikes on the edge\n\t\tfor (int i = 0; i < 12; i++) {\n\t\t\tfor (int j = 0; j < 12; j++) {\n\t\t\t\tmap[i][j] = new BlankSpace(i, j, board);\n\t\t\t\tif (i == 0 || i == 11 || j ==0 || j == 11) {\n\t\t\t\t\tmap[i][j] = new Fence(i, j, board);\n\t\t\t\t\tspaceUsed[i][j] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//Generate 20 spikes in unique locations\n\t\twhile (fencesGenerated < 20) {\n\t\t\tint x = 1+(int)(Math.random()*10);\n\t\t\tint y = 1+(int)(Math.random()*10);\n\n\t\t\tif(spaceUsed[x][y]==false) {\n\t\t\t\tmap[x][y] = new Fence(x, y, board);\n\t\t\t\tspaceUsed[x][y] = true;\n\t\t\t\tfencesGenerated++;\n\t\t\t}\n\t\t}\n\n\t\t//Generate 12 mhos in unique locations\n\t\twhile (mhosGenerated < 12) {\n\t\t\tint x = 1+(int)(Math.random()*10);\n\t\t\tint y = 1+(int)(Math.random()*10);\n\n\t\t\tif(spaceUsed[x][y]==false) {\n\t\t\t\tmap[x][y] = new Mho(x, y, board);\n\n\t\t\t\tmhoLocations.add(x);\n\t\t\t\tmhoLocations.add(y);\n\n\t\t\t\tspaceUsed[x][y] = true;\n\n\t\t\t\tmhosGenerated++;\n\t\t\t}\n\t\t}\n\n\t\t//Generate a player in a unique location\n\t\twhile (true) {\n\t\t\tint x = 1+(int)(Math.random()*10);\n\t\t\tint y = 1+(int)(Math.random()*10);\n\n\t\t\tif(spaceUsed[x][y]==false) {\n\t\t\t\tmap[x][y] = new Player(x, y, board);\n\t\t\t\tplayerLocation[0] = x;\n\t\t\t\tplayerLocation[1] = y;\n\t\t\t\tnewPlayerLocation[0] = x;\n\t\t\t\tnewPlayerLocation[1] = y;\n\t\t\t\tspaceUsed[x][y] = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "public MapGen()//Collect images, create Platform list, create grassy array and generate a random integer as the map wideness\n\t{\n\t\tblocksWide= ThreadLocalRandom.current().nextInt(32, 64 + 1);\n\t\tclouds=kit.getImage(\"Resources/SkyBackground.jpg\");\n\t\tdirt=kit.getImage(\"Resources/Dirt.png\");\n\t\tgrass[0]=kit.getImage(\"Resources/Grass.png\");\n\t\tgrass[1]=kit.getImage(\"Resources/Grass1.png\");\n\t\tgrass[2]=kit.getImage(\"Resources/Grass2.png\");\n\t\tplatforms=new ArrayList<Platform>();\n\t\tgrassy=new int[blocksWide];\n\t\tgrassT=new int[blocksWide];\n\t\tgenerateTerrain();\n\t\t\n\t\t\n\t\t\n\t}", "public void generateRandomMap() {\n\n\t}", "public void createWorldMap() {\r\n\t\tdo {\r\n\t\t\t//\t\t@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Recursive map generation method over here@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n\t\t\t//Generation loop 1 *ADDS VEIN STARTS AND GRASS*\r\n\r\n\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\r\n\t\t\t\t\tif (Math.random()*10000>9999) { //randomly spawn a conore vein start\r\n\t\t\t\t\t\ttileMap[i][j] = new ConoreTile (conore, true);\r\n\t\t\t\t\t\tconoreCount++;\r\n\t\t\t\t\t}else if (Math.random()*10000>9999){\r\n\t\t\t\t\t\ttileMap[i][j] = new KannaiteTile(kanna, true);\r\n\t\t\t\t\t\tkannaiteCount++;\r\n\t\t\t\t\t}else if(Math.random()*10000>9999){\r\n\t\t\t\t\t\ttileMap[i][j] = new FuelTile(fuel, true);\r\n\t\t\t\t\t\tfuelCount++;\r\n\t\t\t\t\t}else if(Math.random()*10000>9999) {\r\n\t\t\t\t\t\ttileMap[i][j] = new ForestTile(forest, true);\r\n\t\t\t\t\t\tforestCount++;\r\n\t\t\t\t\t}else if(Math.random()*10000>9999){\r\n\t\t\t\t\t\ttileMap[i][j] = new OilTile(oil,true);\r\n\t\t\t\t\t}else if(Math.random()*10000>9997) {\r\n\t\t\t\t\t\ttileMap[i][j] = new MountainTile(mountain, true);\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\ttileMap[i][j] = new GrassTile(dirt);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} // End for loop \r\n\t\t\t} // End for loop\r\n\t\t\t//End generation loop 1\r\n\r\n\t\t\t//Generation loop 2 *EXPANDS ON THE VEINS*\r\n\t\t\tdo {\r\n\t\t\t\tif (conoreCount<6) {\r\n\t\t\t\t\ttileMap[(int)Math.random()*200][(int)Math.random()*200] = new ConoreTile (conore,true);\r\n\t\t\t\t\tconoreCount++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tconorePass = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (kannaiteCount<6) {\r\n\t\t\t\t\ttileMap[(int)Math.random()*200][(int)Math.random()*200] = new KannaiteTile (kanna,true);\r\n\t\t\t\t\tkannaiteCount++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tkannaitePass = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (fuelCount<6) {\r\n\t\t\t\t\ttileMap[(int)Math.random()*200][(int)Math.random()*200] = new FuelTile (fuel,true);\r\n\t\t\t\t\tfuelCount++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tfuelPass = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (forestCount<6) {\r\n\t\t\t\t\ttileMap[(int)Math.random()*200][(int)Math.random()*200] = new ForestTile (forest,true);\r\n\t\t\t\t\tforestCount++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tforestPass = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tSystem.out.println(\"Conore: \" + conoreCount + \" - \" + conorePass);\r\n\t\t\t\tSystem.out.println(\"Kannaite: \" + kannaiteCount + \" - \" + kannaitePass);\r\n\t\t\t\tSystem.out.println(\"Fuel: \" + fuelCount + \" - \" + fuelPass);\r\n\t\t\t\tSystem.out.println(\"Forest: \" + forestCount + \" - \" + forestPass);\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t}while(!conorePass || !kannaitePass || !fuelPass || !forestPass);\r\n\r\n\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\t\t\t\t\tbuildConore(i,j);\r\n\t\t\t\t\tbuildKannaite(i,j);\r\n\t\t\t\t\tbuildFuel(i,j);\r\n\t\t\t\t\tbuildForest(i,j);\r\n\t\t\t\t}//End of for loop\r\n\t\t\t}//End of for loop\r\n\t\t\t//End of generation loop 2\r\n\r\n\t\t\t//Generation loop 3 *COUNT ORES*\r\n\t\t\tint loop3Count = 0;\r\n\t\t\tconorePass = false;\r\n\t\t\tkannaitePass = false;\r\n\t\t\tfuelPass = false;\r\n\t\t\tforestPass = false;\r\n\t\t\tdo {\r\n\t\t\t\tconoreCount = 0;\r\n\t\t\t\tkannaiteCount = 0;\r\n\t\t\t\tfuelCount = 0;\r\n\t\t\t\tforestCount = 0;\r\n\t\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\t\t\t\t\t\tif (tileMap[i][j] instanceof ConoreTile) {\r\n\t\t\t\t\t\t\tconoreCount++;\r\n\t\t\t\t\t\t}else if(tileMap[i][j] instanceof KannaiteTile) {\r\n\t\t\t\t\t\t\tkannaiteCount++;\r\n\t\t\t\t\t\t}else if(tileMap[i][j] instanceof FuelTile) {\r\n\t\t\t\t\t\t\tfuelCount++;\r\n\t\t\t\t\t\t}else if(tileMap[i][j] instanceof ForestTile) {\r\n\t\t\t\t\t\t\tforestCount++;\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\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\t\t\t\t\t\tif (conoreCount < 220) {\r\n\t\t\t\t\t\t\tbuildConore(i,j);\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tconorePass = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (kannaiteCount < 220) {\r\n\t\t\t\t\t\t\tbuildKannaite(i,j);\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tkannaitePass = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (fuelCount< 220) {\r\n\t\t\t\t\t\t\tbuildFuel(i,j);\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tfuelPass = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (forestCount < 220) {\r\n\t\t\t\t\t\t\tbuildForest(i,j);\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tforestPass = true;\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\tSystem.out.println(\"Conore: \" + conoreCount + \" - \" + conorePass);\r\n\t\t\t\tSystem.out.println(\"Kannaite: \" + kannaiteCount + \" - \" + kannaitePass);\r\n\t\t\t\tSystem.out.println(\"Fuel: \" + fuelCount + \" - \" + fuelPass);\r\n\t\t\t\tSystem.out.println(\"Forest: \" + forestCount + \" - \" + forestPass);\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t\tloop3Count++;\r\n\t\t\t\tif (loop3Count > 100) {\r\n\t\t\t\t\tSystem.out.println(\"map generation failed! restarting\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}while(!conorePass || !kannaitePass || !fuelPass || !forestPass);\r\n\t\t\t//END OF LOOP 3\r\n\r\n\t\t\t//LOOP 4: THE MOUNTAIN & OIL LOOP\r\n\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\t\t\t\t\tbuildMountain(i,j);\r\n\t\t\t\t\tbuildOil(i,j);\r\n\t\t\t\t}\r\n\t\t\t}//End of THE Mountain & OIL LOOP\r\n\r\n\t\t\t//ADD MINIMUM AMOUNT OF ORES\r\n\r\n\t\t\t//Generation Loop 5 *FINAL SETUP*\r\n\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\r\n\t\t\t\t\tif(i == 1 || j == 1 || i == tileMap.length-2 || j == tileMap[i].length-2) {\r\n\t\t\t\t\t\ttileMap[i][j] = new DesertTile(desert);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (i == 0 || j == 0 || i == tileMap.length-1 || j == tileMap[i].length-1) {\r\n\t\t\t\t\t\ttileMap[i][j] = new WaterTile(water);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}//End of for loop\r\n\t\t\t}//End of for loop\r\n\t\t\t//End of generation loop 5\r\n\t\t\t//mapToString();//TEST RUN\r\n\t\t} while(!conorePass || !kannaitePass || !fuelPass || !forestPass); // End createWorldMap method\r\n\t}", "private void generateMap(){\n int[] blockStepX = {X_STEP, 0, -X_STEP, -X_STEP, 0, X_STEP};\n int[] blockStepY = {Y_STEP_ONE, Y_STEP_TWO, Y_STEP_ONE, -Y_STEP_ONE, -Y_STEP_TWO, -Y_STEP_ONE};\n int blockSpecialValue = 0;\n int cellSpecial = 0;\n\n mapCells[origin.x/10][origin.y/10] = new EschatonCell(new CellPosition(0, 0, 0),\n new Point(origin.x, origin.y), blockSpecialValue);\n\n cellGrid[0][0][0] = new EschatonCell(new CellPosition(0, 0, 0),\n new Point(origin.x, origin.y), blockSpecialValue);\n\n for (int distanceFromOrigin = 0; distanceFromOrigin < config.getSizeOfMap();\n distanceFromOrigin++){\n\n int[] blockXVals = {origin.x,\n origin.x + X_STEP * distanceFromOrigin,\n origin.x + X_STEP * distanceFromOrigin,\n origin.x,\n origin.x - X_STEP * distanceFromOrigin,\n origin.x - X_STEP * distanceFromOrigin};\n\n int[] blockYVals = {origin.y - Y_STEP_TWO * distanceFromOrigin,\n origin.y - Y_STEP_ONE * distanceFromOrigin,\n origin.y + Y_STEP_ONE * distanceFromOrigin,\n origin.y + Y_STEP_TWO * distanceFromOrigin,\n origin.y + Y_STEP_ONE * distanceFromOrigin,\n origin.y - Y_STEP_ONE * distanceFromOrigin};\n\n blockSpecialValue = getRandomNumber(distanceFromOrigin, 0, 0);\n\n for (int block = 0; block < NUMBER_OF_BLOCKS; block ++){\n\n int blockXOrdinal = blockXVals[block];\n int blockYOrdinal = blockYVals[block];\n\n for (int blockSize = 0; blockSize < distanceFromOrigin; blockSize++){\n if(blockSpecialValue == blockSize){\n cellSpecial = getRandomNumber(2, 1, 1);\n }else {\n cellSpecial = 0;\n }\n cellGrid [distanceFromOrigin][block+1][blockSize+1] = makeNewCell(\n new CellPosition(distanceFromOrigin,block+1, blockSize+1),\n new Point(blockXOrdinal + blockStepX[block] * (blockSize + 1),\n blockYOrdinal + blockStepY[block] * (blockSize + 1)), cellSpecial);\n }\n }\n }\n }", "@Override\n\tprotected void generateMap() {\n\t\t//read map from tmx\n\t\tmap = null;\n\t\tfinal String tmx = \"res/tiles/map.tmx\";\n\t\ttry {\n\t\t\tTMXMapReader mapReader = new TMXMapReader();\n\t\t\tmap = mapReader.readMap(tmx);\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tTileLayer layer = (TileLayer)map.getLayer(0);\n\n\t\ttiles = new PropertyTile[layer.getWidth()][layer.getHeight()];\n\t\tfor(int x=0; x<layer.getWidth(); x++) {\n\t\t\tfor(int y=0; y<layer.getHeight(); y++) {\n\t\t\t\tTile tile = layer.getTileAt(x, y);\n\t\t\t\tString type = (String)tile.getProperties().get(\"type\");\n\t\t\t\ttiles[x][y] = new PropertyTile(tile, TileType.valueOf(type.toUpperCase()));\n\t\t\t\ttiles[x][y].setImage(tile.getImage());\n\t\t\t}\n\t\t}\n\t\t\n\t\t//generate animated tiles from river tileset\n\t\tTileSet riverset = map.getTileSets().get(1);\n\t\tList<AnimatedTile> animatedTiles = new ArrayList<>();\n\t\tfor(int i=0; i<5; i++) {\n\t\t\tTile[] frames = new Tile[3];\n\t\t\tIterator<Tile> iterator = riverset.iterator();\n\t\t\twhile(iterator.hasNext()) {\n\t\t\t\tTile tile = iterator.next();\n\t\t\t\tint rtile = Integer.parseInt(tile.getProperties().getProperty(\"tile\"));\n\t\t\t\tint frame = Integer.parseInt(tile.getProperties().getProperty(\"frame\"));\n\t\t\t\tif(rtile == i+1) {\n\t\t\t\t\tframes[frame-1] = tile;\n\t\t\t\t}\n\t\t\t}\n\t\t\tAnimatedTile aTile = new AnimatedTile(frames);\n\t\t\tanimatedTiles.add(aTile);\n\t\t}\n\n\t\t//replace tiles in map with animated tiles\n//\t\tfor(int x=0; x<layer.getWidth(); x++) {\n//\t\t\tfor(int y=0; y<layer.getHeight(); y++) {\n//\t\t\t\tTile tile = layer.getTileAt(x, y);\n//\t\t\t\tif(tile.getProperties().containsKey(\"animated\")) {\n//\t\t\t\t\tint rtile = Integer.parseInt(tile.getProperties().getProperty(\"tile\"));\n//\t\t\t\t\tlayer.setTileAt(x, y, animatedTiles.get(rtile-1));\t\t\t\t\t\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n\t}", "private void generateMap () {\n for (int i = 0 ; i < n ; i++) {\n mapCoordinate[i] = new CoordinateInfo(100 * random.nextFloat(), 100 * random.nextFloat());\n\n for (int j = 0 ; j <= i ; j++) {\n mapDistance[i][j] = mapDistance[j][i] = getDistance(mapCoordinate[i], mapCoordinate[j]);\n }\n }\n }", "public void randomGenerateMap(int width, int height, int monsterChance, int objectChance) \r\n {\r\n for (int x = 0; x < width; x++) \r\n {\r\n for (int y = 0; y < height; y++) \r\n {\r\n Room r = new Room(x, y);\r\n if (random.nextInt(100) <= monsterChance) \r\n {\r\n r.addMonster(MonsterGenerator.GenerateRandomMonster());\r\n }\r\n if (random.nextInt(100) < objectChance)\r\n {\r\n RoomObject tempObj = RoomObjectGenerator.GenerateRandomObject();\r\n if (tempObj != null)\r\n {\r\n r.addObject(tempObj);\r\n }\r\n }\r\n map.add(r);\r\n }\r\n }\r\n currentRoom = getRoom(0, 0);\r\n if (currentRoom.getMonster() != null) \r\n {\r\n currentRoom.removeMonster();\r\n }\r\n placeMandatoryObjects();\r\n placeMandatoryItems();\r\n prepareMerchant();\r\n }", "public void makeMap(){\r\n\t\tint m =1;\r\n\t\t//EnvironObj temp = new EnvironObj(null, 0, 0);\r\n\t\tfor(int i=0; i<map.size(); i++){\r\n\t\t\tfor(int j =0; j<map.get(i).size(); j++){\r\n\t\t\t\tString o = map.get(i).get(j);\r\n\t\t\t\t//System.out.println(\"grabbing o from map, o = \" + o);\r\n\t\t\t\tif(o.equals(\"t\")){\r\n\t\t\t\t\ttemp = new EnvironObj(\"treee.png\", j+m, i*20);\r\n\t\t\t\t\tobjectList.add(temp);\r\n\t\t\t\t\tm+=10;\r\n\t\t\t\t\t//System.out.println(\"objectList: \" + objectList);\r\n\t\t\t\t}else if(o.equals(\"p\")){\r\n\t\t\t\t\ttemp = new EnvironObj(\"path.png\", j+m, i*20, true);\r\n\t\t\t\t\t//dont need to add to obj list bc its always in back\r\n\t\t\t\t\twalkables.add(temp);\r\n\r\n\t\t\t\t}else if(o.equals(\"h\")){\r\n\t\t\t\t\ttemp = new EnvironObj(\"house.png\", j+m, i*20);\r\n\t\t\t\t\tobjectList.add(temp);\r\n\t\t\t\t}else if(o.equals(\"g\")){\r\n\t\t\t\t\tm+=10;\r\n\t\t\t\t}\r\n\t\t\t\telse if(!o.equals(\"g\")){\r\n\t\t\t\t\tString fn = o +\".txt\";\r\n\t\t\t\t\tSystem.out.println(\"filename for NPC: \" + fn);\r\n\t\t\t\t\tnp = new NPC(o, fn, j+m, i*20);\r\n\t\t\t\t\tm+=10;\r\n\t\t\t\t\tcharacters.add(np);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tm=0;\r\n\t\t}\r\n\t}", "public void createMap() {\n\t\tArrayList<String>boardMap = new ArrayList<String>(); //boardmap on tiedostosta ladattu maailman malli\n\t\t\n\t\t//2. try catch blocki, ei jaksa laittaa metodeja heittämään poikkeuksia\n\t\ttry {\n\t\t\tboardMap = loadMap(); //ladataan data boardMap muuttujaan tiedostosta\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\t\t\n\t\t\n\t\t// 3. j=rivit, i=merkit yksittäisellä rivillä\n\t\tfor(int j=0; j<boardMap.size();j++){ \t\t//..rivien lkm (boardMap.size) = alkioiden lkm. \n\t\t\tfor(int i=0; i<boardMap.get(j).length(); i++){\t\t//..merkkien lkm rivillä (alkion Stringin pituus .length)\n\t\t\t\tCharacter hexType = boardMap.get(j).charAt(i);\t//tuodaan tietyltä riviltä, yksittäinen MERKKI hexType -muuttujaan\n\t\t\t\tworld.add(new Hex(i, j, hexType.toString()));\t//Luodaan uusi HEXa maailmaan, Character -merkki muutetaan Stringiksi että Hex konstructori hyväksyy sen.\n\t\t\t}\n\t\t}\n\t\tconvertEmptyHex();\n\t}", "public static void makeGrid (Species map[][], int numSheepStart, int numWolfStart, int numPlantStart, int sheepHealth, int plantHealth, int wolfHealth, int plantSpawnRate) {\n \n // Declare coordinates to randomly spawn species\n int y = 0;\n int x = 0;\n \n // Initialise plants\n Plant plant;\n \n // Spawn plants\n for (int i = 0; i < numPlantStart; i++) {\n \n // Choose random coordinates to spawn\n y = (int)(Math.random() * map[0].length); \n x = (int)(Math.random() * map.length);\n \n // Checks for an empty space\n if (map[y][x] == null) { \n \n // Choose a random plant (50% chance healthy, 25% poisonous or energizing)\n int plantChoice = (int) Math.ceil(Math.random() * 100);\n \n // Create the new plants\n if ((plantChoice <= 100) && (plantChoice >= 50)) {\n plant = new HealthyPlant(plantHealth, x, y, plantSpawnRate);\n } else if ((plantChoice < 50) && (plantChoice >= 25)) {\n plant = new EnergizingPlant(plantHealth, x, y, plantSpawnRate);\n } else {\n plant = new PoisonousPlant(plantHealth, x, y, plantSpawnRate);\n }\n \n // Set plant coordinates\n plant.setX(x);\n plant.setY(y);\n map[y][x] = plant;\n \n // No space\n } else { \n i -= 1;\n }\n \n }\n \n // Spawn sheep\n for (int i = 0; i < numSheepStart; i++) { \n \n // Choose random coordinates to spawn\n y = (int)(Math.random() * map[0].length); \n x = (int)(Math.random() * map.length);\n \n // Checks for an empty space\n if (map[y][x] == null) {\n \n // Create new sheep\n Sheep sheep = new Sheep(sheepHealth, x, y, 5); \n \n // Set sheep coordinates\n sheep.setX(x);\n sheep.setY(y);\n map[y][x] = sheep;\n \n // No space\n } else { \n i -= 1; \n }\n \n }\n \n // Spawn wolves\n for (int i = 0; i < numWolfStart; i++) { \n \n // Choose random coordinates to spawn\n y = (int)(Math.random() * map[0].length); \n x = (int)(Math.random() * map.length);\n \n // Checks for an empty space\n if (map[y][x] == null) { \n \n // Create new wolf\n Wolf wolf = new Wolf(wolfHealth, x, y, 5); \n \n // Set wolf coordinates\n wolf.setX(x);\n wolf.setY(y);\n map[y][x] = wolf; \n \n // No space\n } else { \n i -= 1; \n }\n }\n \n }", "@Override\n public void create() {\n theMap = new ObjectSet<>(2048, 0.5f);\n generate();\n }", "private void createMaps() {\r\n\t\tint SIZE = 100;\r\n\t\tint x = 0, y = -1;\r\n\t\tfor (int i = 0; i < SIZE; i++) {\r\n\t\t\tif (i % 10 == 0) {\r\n\t\t\t\tx = 0;\r\n\t\t\t\ty = y + 1;\r\n\t\t\t}\r\n\t\t\tshipStateMap.put(new Point(x, y), 0);\r\n\t\t\tshipTypeMap.put(new Point(x, y), 0);\r\n\t\t\tx++;\r\n\t\t}\r\n\t}", "protected static LinkedList<Location> generateLocations() {\n int i = 0;\n LinkedList<Location> list = new LinkedList<Location>();\n ClassLoader classLoader = Thread.currentThread().getContextClassLoader();\n ImagePacker gearImgs = new ImagePacker();\n\n try {\n gearImgs.readDirectory(new File(Objects.requireNonNull(classLoader.getResource(\"assets/gear-tiles\")).getPath()));\n } catch (Exception e) {\n e.printStackTrace();\n }\n for (i = 0; i < GEARTILES; i++) {\n list.add(new Location(LocationType.GEAR).withImg(gearImgs.popImg()));\n }\n list.get((int)(Math.random()*list.size())).toggleStartingLoc();\n\n Image waterImg = new Image(Objects.requireNonNull(classLoader.getResource(\"assets/water/water-tile.jpg\")).toString());\n for (i = 0; i < WATERTILES; i++) {\n list.add(new Location(LocationType.WELL).withImg(waterImg));\n }\n\n Image waterFakeImg = new Image(Objects.requireNonNull(classLoader.getResource(\"assets/water/water-fake-tile.jpg\")).toString());\n for (i = 0; i < WATERFAKETILES; i++) {\n list.add(new Location(LocationType.MIRAGE).withImg(waterFakeImg));\n }\n\n //TODO: Finish images\n for (i = 0; i < LANDINGPADTILES; i++) {\n list.add(new Location(LocationType.LANDINGPAD).withImg(new Image(Objects.requireNonNull(classLoader.getResource(\"assets/other-tiles/landing-pad.jpg\")).toString())));\n }\n for (i = 0; i < TUNNELTILES; i++) {\n list.add(new Location(LocationType.TUNNEL).withImg(new Image(Objects.requireNonNull(classLoader.getResource(\"assets/other-tiles/tunnel.jpg\")).toString())));\n }\n list.add(new Clue(Artifact.COMPASS, Clue.Orientation.NS).withImg(new Image(Objects.requireNonNull(classLoader.getResource(\"assets/other-tiles/compass-UD.jpg\")).toString())));\n list.add(new Clue(Artifact.COMPASS, Clue.Orientation.EW).withImg(new Image(Objects.requireNonNull(classLoader.getResource(\"assets/other-tiles/compass-LR.jpg\")).toString())));\n list.add(new Clue(Artifact.PROPELLER, Clue.Orientation.NS).withImg(new Image(Objects.requireNonNull(classLoader.getResource(\"assets/other-tiles/propeller-UD.jpg\")).toString())));\n list.add(new Clue(Artifact.PROPELLER, Clue.Orientation.EW).withImg(new Image(Objects.requireNonNull(classLoader.getResource(\"assets/other-tiles/propeller-LR.jpg\")).toString())));\n list.add(new Clue(Artifact.ENGINE, Clue.Orientation.NS).withImg(new Image(Objects.requireNonNull(classLoader.getResource(\"assets/other-tiles/motor-UD.jpg\")).toString())));\n list.add(new Clue(Artifact.ENGINE, Clue.Orientation.EW).withImg(new Image(Objects.requireNonNull(classLoader.getResource(\"assets/other-tiles/motor-LR.jpg\")).toString())));\n list.add(new Clue(Artifact.CRYSTAL, Clue.Orientation.NS).withImg(new Image(Objects.requireNonNull(classLoader.getResource(\"assets/other-tiles/monolith-UD.jpg\")).toString())));\n list.add(new Clue(Artifact.CRYSTAL, Clue.Orientation.EW).withImg(new Image(Objects.requireNonNull(classLoader.getResource(\"assets/other-tiles/monolith-LR.jpg\")).toString())));\n\n return list;\n }", "public Map(String level) {\n this.level = level;\n terrains = new String[]{\"r\", \"p\", \"m1\", \"m2\", \"m3\"};\n\n //if default random\n if (level.equals(\"default\")) {\n String[] defaultLevel = {\n \"p\", \"p\", \"m1\", \"p\", \"r\", \"p\", \"m3\", \"p\", \"p\",\n \"p\", \"m1\", \"p\", \"p\", \"r\", \"p\", \"p\", \"p\", \"m3\",\n \"m3\", \"p\", \"p\", \"p\", \"t\", \"p\", \"p\", \"p\", \"m1\",\n \"p\", \"m2\", \"p\", \"p\", \"r\", \"p\", \"m2\", \"p\", \"p\",\n \"p\", \"p\", \"m2\", \"p\", \"r\", \"p\", \"p\", \"p\", \"m2\"};\n int j = 0;\n for (int i = 0; i < tiles.length; i++) {\n for (int k = 0; k < tiles[0].length; k++, j++) {\n tiles[i][k] = new Tile(i, k, defaultLevel[j]);\n }\n }\n }\n\n // if random level\n if (level.equals(\"random\")) {\n for (int i = 0; i < tiles.length; i++) {\n for (int k = 0; k < tiles[0].length; k++) {\n String ter = terrains[(int) (Math.random() * (terrains.length - 1))];\n tiles[i][k] = new Tile(i, k, ter);\n }\n }\n tiles[2][4] = new Tile(2, 4, \"t\");\n }\n }", "private void addMountains() {\n int randRow = 0;\n int randColumn = 0;\n int randValue = 0;\n do {\n randRow = (int)(Math.round(Math.random()*(MAP_LENGTH-4))) + 2;\n randColumn = (int)(Math.round(Math.random()*(MAP_LENGTH-4))) + 2;\n for (int i = (randRow - 2); i < (randRow + 2); i++) {\n for (int j = (randColumn - 2); j < (randColumn + 2); j++) {\n if ((tileMap[i][j].getTerrain() instanceof Grass) && (tileMap[i][j].isEmpty())) {\n randValue = (int)(Math.round(Math.random()));\n if (randValue == 0) {\n tileMap[i][j] = new Space(new Mountain(i, j)); //Create a mountain\n }\n }\n }\n }\n } while (!checkMountainCoverage());\n }", "protected void createMaps() {\n\t\tBlueSchellingCell bCell = new BlueSchellingCell();\n\t\tOrangeSchellingCell oCell = new OrangeSchellingCell();\n\t\tEmptyCell eCell = new EmptyCell();\n\t\tTreeCell tCell = new TreeCell();\n\t\tBurningTreeCell bTCell = new BurningTreeCell();\n\t\tEmptyLandCell eLCell = new EmptyLandCell();\n\n\t\tLiveCell lCell = new LiveCell();\n\t\tDeadCell dCell = new DeadCell();\n\t\tGreenRPSCell gcell = new GreenRPSCell();\n\t\tRedRPSCell rcell = new RedRPSCell();\n\t\tBlueRPSCell blcell = new BlueRPSCell();\n\t\tWhiteRPSCell wcell = new WhiteRPSCell();\n\n\t\tFishCell fCell = new FishCell();\n\t\tSharkCell sCell = new SharkCell();\n\n\t\tAntGroupCell aCell = new AntGroupCell();\n\n\t\tsegregation.put('b', bCell);\n\t\tsegregation.put('o', oCell);\n\t\tsegregation.put('e', eCell);\n\n\t\tgameOfLife.put('l', lCell);\n\t\tgameOfLife.put('d', dCell);\n\n\t\trps.put('g', gcell);\n\t\trps.put('r', rcell);\n\t\trps.put('b', blcell);\n\t\trps.put('w', wcell);\n\n\t\tspreadingWildfire.put('t', tCell);\n\t\tspreadingWildfire.put('b', bTCell);\n\t\tspreadingWildfire.put('e', eLCell);\n\n\t\twaTor.put('f', fCell);\n\t\twaTor.put('s', sCell);\n\t\twaTor.put('e', eCell);\n\n\t\tforagingAnts.put('a', aCell);\n\t\tforagingAnts.put('e', eCell);\n\t\tinitExportMap();\n\n\t\tinitCountMap();\n\t}", "void randomBlock() {\n\t\t// map generate (int map)\n\t\tfor (int i = 0; i < mapX; i += 2) {\n\t\t\tfor (int j = 0; j < mapY; j += 2) {\n\t\t\t\tint r = (int) Math.random() * 4;\n\t\t\t\tif (r == 0) {\n\t\t\t\t\ttileMap[i][j] = new Tile(i, j, 1);\n\t\t\t\t\ttileMap[i + 1][j] = new Tile(i + 1, j, 1);\n\t\t\t\t\ttileMap[i][j + 1] = new Tile(i, j + 1, 1);\n\t\t\t\t\ttileMap[i + 1][j + 1] = new Tile(i + 1, j + 1, 1);\n\n\t\t\t\t} else {\n\t\t\t\t\ttileMap[i][j] = new Tile(i, j, 0);\n\t\t\t\t\ttileMap[i + 1][j] = new Tile(i + 1, j, 0);\n\t\t\t\t\ttileMap[i][j + 1] = new Tile(i, j + 1, 0);\n\t\t\t\t\ttileMap[i + 1][j + 1] = new Tile(i + 1, j + 1, 0);\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void genRandomMonsters() {\n int numMonsters;\n Random rand = new Random();\n numMonstersByType = new HashMap<>();\n\n //Randomly select the amount of monsters based on the type of room this is.\n if (contents.contains(roomContents.MONSTERS)) {\n numMonsters = rand.nextInt(5) + 4;\n } else {\n numMonsters = rand.nextInt(4);\n }\n\n //For each monster, randomly select a type\n for (int i = 0; i < numMonsters; i++) {\n int type = rand.nextInt(3) + 1;\n if (numMonstersByType.containsKey(type)) {\n numMonstersByType.put(type, numMonstersByType.get(type) + 1);\n } else {\n numMonstersByType.put(type, 1);\n }\n }\n }", "public void generate()\n {\n System.out.println(\"Initial allocated space for Set: Not supported\");\n// System.out.println(\"Initial allocated space for Set: \" + theMap.capacity());\n final long startTime = TimeUtils.nanoTime();\n Mnemonic m = new Mnemonic(123456789L);\n// GridPoint2 gp = new GridPoint2(0, 0);\n for (int x = -width; x < width; x++) {\n for (int y = -height; y < height; y++) {\n// for (int z = -height; z < height; z++) {\n\n// long z = (x & 0xFFFFFFFFL) << 32 | (y & 0xFFFFFFFFL);\n// z = ((z & 0x00000000ffff0000L) << 16) | ((z >>> 16) & 0x00000000ffff0000L) | (z & 0xffff00000000ffffL);\n// z = ((z & 0x0000ff000000ff00L) << 8 ) | ((z >>> 8 ) & 0x0000ff000000ff00L) | (z & 0xff0000ffff0000ffL);\n// z = ((z & 0x00f000f000f000f0L) << 4 ) | ((z >>> 4 ) & 0x00f000f000f000f0L) | (z & 0xf00ff00ff00ff00fL);\n// z = ((z & 0x0c0c0c0c0c0c0c0cL) << 2 ) | ((z >>> 2 ) & 0x0c0c0c0c0c0c0c0cL) | (z & 0xc3c3c3c3c3c3c3c3L);\n// z = ((z & 0x2222222222222222L) << 1 ) | ((z >>> 1 ) & 0x2222222222222222L) | (z & 0x9999999999999999L);\n// theMap.put(z, null); // uses 23312536 bytes of heap\n// long z = szudzik(x, y);\n// theMap.put(z, null); // uses 18331216 bytes of heap?\n// unSzudzik(pair, z);\n// theMap.put(0xC13FA9A902A6328FL * x ^ 0x91E10DA5C79E7B1DL * y, null); // uses 23312576 bytes of heap\n// theMap.put((x & 0xFFFFFFFFL) << 32 | (y & 0xFFFFFFFFL), null); // uses 28555456 bytes of heap\n theMap.add(new Vector2(x - width * 0.5f, y - height * 0.5f)); // crashes out of heap with 720 Vector2\n// gp.set(x, y);\n// theMap.add(gp.hashCode());\n// long r, s;\n// r = (x ^ 0xa0761d65L) * (y ^ 0x8ebc6af1L);\n// s = 0xa0761d65L * (z ^ 0x589965cdL);\n// r -= r >> 32;\n// s -= s >> 32;\n// r = ((r ^ s) + 0xeb44accbL) * 0xeb44acc8L;\n// theMap.add((int)(r - (r >> 32)));\n\n// theMap.add(m.toMnemonic(szudzik(x, y)));\n }\n }\n// }\n// final GridPoint2 gp = new GridPoint2(x, y);\n// final int gpHash = gp.hashCode(); // uses the updated GridPoint2 hashCode(), not the current GDX code\n// theMap.put(gp, gpHash | 0xFF000000); //value doesn't matter; this was supposed to test ObjectMap\n //theMap.put(gp, (53 * 53 + x + 53 * y) | 0xFF000000); //this is what the hashCodes would look like for the current code\n \n //final int gpHash = x * 0xC13F + y * 0x91E1; // updated hashCode()\n //// In the updated hashCode(), numbers are based on the plastic constant, which is\n //// like the golden ratio but with better properties for 2D spaces. These don't need to be prime.\n \n //final int gpHash = 53 * 53 + x + 53 * y; // equivalent to current hashCode()\n long taken = TimeUtils.timeSinceNanos(startTime);\n System.out.println(taken + \"ns taken, about 10 to the \" + Math.log10(taken) + \" power.\");\n// System.out.println(\"Post-assign allocated space for Set: \" + theMap.capacity());\n System.out.println(\"Post-assign allocated space for Set: Not supported\");\n }", "public static Tile[][] setUpMap() {\n\n Tile[][] tiles = new Tile[5][9];\n String[][] defaultMapLayout = GameMap.getMapLayout();\n\n for (int i = 0; i < 5; i++) {\n\n for (int j = 0; j < 9; j++) {\n\n String tileType = defaultMapLayout[i][j];\n\n if (tileType.equals(\"P\")) {\n Tile newTileName = new Plain();\n tiles[i][j] = newTileName;\n\n } else if (tileType.equals(\"R\")) {\n Tile newTileName = new River();\n tiles[i][j] = newTileName;\n\n } else if (tileType.equals(\"M1\")) {\n Tile newTileName = new Mountain1();\n tiles[i][j] = newTileName;\n\n } else if (tileType.equals(\"M2\")) {\n Tile newTileName = new Mountain2();\n tiles[i][j] = newTileName;\n\n } else if (tileType.equals(\"M3\")) {\n Tile newTileName = new Mountain3();\n tiles[i][j] = newTileName;\n\n } else if (tileType.equals(\"SM\")) {\n Tile newTileName = new SwampMonster();\n tiles[i][j] = newTileName;\n\n } else if (tileType.equals(\"O\")) {\n Tile newTileName = new Ocean();\n tiles[i][j] = newTileName;\n\n } else if (tileType.equals(\"G\")) {\n Tile newTileName = new Grass();\n tiles[i][j] = newTileName;\n\n } else if (tileType.equals(\"V\")) {\n Tile newTileName = new Volcano();\n tiles[i][j] = newTileName;\n\n }else {\n Tile newTileName = new Plain();\n tiles[i][j] = newTileName;\n newTileName.setOwner(null);\n }\n\n }\n }\n return tiles;\n }", "public static void createMap()\n\t\t\t{\n\t\t\tmap = new Vector<Location>(4);\n\t\n\t\t\tLocation location1 = new Location(\"the southwest room.\",\"You see doors to the north and east.\");\n\t\t\tLocation location2 = new Location(\"the southeast room.\",\"You see doors to the north and west.\");\n\t\t\tLocation location3 = new Location(\"the northwest room.\",\"You see doors to the south and east.\");\n\t\t\tLocation location4 = new Location(\"the northeast room.\",\"You see doors to the south and west.\");\n\n\t\t\tmap.addElement(location1);\n\t\t\tmap.addElement(location2);\n\t\t\tmap.addElement(location3);\n\t\t\tmap.addElement(location4);\n\t\t\t\n\t\t\t// This section defines the exits found in each location and the \n\t\t\t// locations to which they lead.\n\t\t\tlocation1.addExit(new Exit(Exit.north, location3));\n\t\t\tlocation1.addExit(new Exit(Exit.east, location2));\n\t\t\tlocation2.addExit(new Exit(Exit.north, location4));\n\t\t\tlocation2.addExit(new Exit(Exit.west, location1));\n\t\t\tlocation3.addExit(new Exit(Exit.south, location1));\n\t\t\tlocation3.addExit(new Exit(Exit.east, location4));\n\t\t\tlocation4.addExit(new Exit(Exit.west, location3));\n\t\t\tlocation4.addExit(new Exit(Exit.south, location2));\n\t\t\t\n\t\t\tcurrentLocation = location1;\t\t\t\t\n\t\t\t}", "private item[][] newMap() \r\n\t{\n\t\tinitialItems=50;\r\n\t\t\r\n\t\titem cReg = new item(\"cash register\");\r\n\t\titem door = new item(\"door\");\r\n\t\t\r\n\t\titem[][] array = new item[][] {\r\n\t\t {wall(), wall(), wall(), wall(), wall(), wall(), wall(), wall(), wall(), wall()},\r\n\t\t {wall(), path(), path(), path(), path(), path(), path(), path(), path(), wall()},\r\n\t\t {wall(), path(), hPhn(), hPhn(), hPhn(), hPhn(), hPhn(), hPhn(), path(), wall()},\r\n\t\t {wall(), path(), path(), path(), path(), path(), path(), path(), path(), wall()},\r\n\t\t {wall(), path(), hPhn(), hPhn(), hPhn(), hPhn(), hPhn(), hPhn(), path(), wall()},\r\n\t\t {wall(), path(), path(), path(), path(), path(), path(), path(), path(), wall()},\r\n\t\t {wall(), path(), path(), path(), hPhn(), path(), hPhn(), path(), hPhn(), wall()},\r\n\t\t {wall(), path(), path(), path(), hPhn(), path(), hPhn(), path(), hPhn(), wall()},\r\n\t\t {wall(), cReg, cReg, path(), path(), path(), hPhn(), path(), hPhn(), wall()},\r\n\t\t {wall(), wall(), wall(), wall(), wall(), wall(), wall(), door, wall(), wall()},\r\n\t\t {wall(), wall(), wall(), wall(), wall(), wall(), wall(), wall(), wall(), wall()},\r\n\t\t};\r\n\t\t\r\n\t\tdoorX=7;\r\n\t\tdoorY=9;\r\n\t\t\r\n\t\treturn array;\r\n\t}", "public Map<Position, String> createGraphics(){\n\n Map<Position, String> justObjectGraphs = this.ALLObjects.stream()\n .collect(Collectors.toMap(MapObject::getPozycja, MapObject::getDrawSymbol) );\n\n Map<Position, String> emptyGraphs = this.getMapa().getEmptyPositions().stream()\n .collect(Collectors.toMap(poz -> poz , poz -> \" \") );\n\n Map<Position, String> wynik = new TreeMap<>();\n wynik.putAll(justObjectGraphs);\n wynik.putAll(emptyGraphs);\n\n return wynik;\n }", "protected void putMonsters() {\n\t\tRandom rand = new Random();\n\t\tfor (int monsterCount = 0; monsterCount < 4; monsterCount++){\n\t\t\tint x, y;\n\t\t\tdo {\n\t\t\t\tx = rand.nextInt(xSize);\n\t\t\t\ty = rand.nextInt(ySize);\n\t\t\t} while((levelSetup[x][y] instanceof SimpleRoom) && (x == 0 & y == 0) && !levelSetup[x][y].hasItem());\n\t\t\tlevelSetup[x][y].putMonster(new BasicMonster());\n\t\t}\n\t}", "public void generateTerrain()\n\t{\n\t\tint rand;\n\t\tint starting=(int)(blocksWide*0.45);//Choose the first grass block\n\t\tblocksTall=(int)(blocksWide*0.6);\n\t\tfor(int i=0;i<blocksWide;i++)\n\t\t{\n\t\t\t//Determine whether the next block will go up a level, down a level or stay the same (55% chance of staying the same)\n\t\t\trand=ThreadLocalRandom.current().nextInt(0,3);\t\n\t\t\tif(rand!=0)\n\t\t\t{\n\t\t\t\trand=ThreadLocalRandom.current().nextInt(-1,2);\n\t\t\t}\n\t\t\tif(starting+rand<blocksTall-2 && starting+rand>4)\t//Make sure new position isn't too close to the top or bottom\n\t\t\t{\n\t\t\t\tstarting+=rand;\n\t\t\t}\n\t\t\tgrassy[i]=starting;\n\t\t\tgrassT[i]=ThreadLocalRandom.current().nextInt(0,3);\n\t\t\t//Generate a platform to allow for collision detection\n\t\t\tplatforms.add(new Platform((double)i/blocksWide,(double)starting/blocksTall,1.0/blocksWide,1.0/blocksWide));\n\t\t}\n\t\tplatforms.add(new Platform(0.0,0.0,0.0,0.0));\n\t}", "public void makePathList() {\r\n\t\tPath p = new Path(false,false,false,false);\r\n\t\tfor(int i=0; i<15; i++) {\r\n\t\t\tp = p.randomizePath(p.makeCornerPath());\r\n\t\t\t_list.add(p);\r\n\t\t}\r\n\t\tfor(int i=0; i<13; i++) {\r\n\t\t\tp = p.randomizePath(p.makeStraightPath());\r\n\t\t\t_list.add(p);\r\n\t\t}\r\n\t\tfor(int i=0; i<6; i++) {\r\n\t\t\tp = p.randomizePath(p.makeTPath());\r\n\t\t\t_list.add(p);\r\n\t\t}\r\n\t\tCollections.shuffle(_list);\r\n\t}", "private void createMapOfFourthType() {\n\n this.typeOfMap=4;\n matrixOfSquares[0][0] = createSquare( ColorOfFigure_Square.RED, true,0,0);\n matrixOfSquares[0][1] = createSquare( ColorOfFigure_Square.BLUE, true,0,1);\n matrixOfSquares[0][2] = createSquare(true, ColorOfFigure_Square.BLUE, true,0,2);\n matrixOfSquares[0][3] = null;\n matrixOfSquares[1][0] = createSquare(true, ColorOfFigure_Square.RED, true,1,0);\n matrixOfSquares[1][1] = createSquare( ColorOfFigure_Square.PURPLE, true,1,1);\n matrixOfSquares[1][2] = createSquare( ColorOfFigure_Square.PURPLE, true,1,2);\n matrixOfSquares[1][3] = createSquare( ColorOfFigure_Square.YELLOW, true,1,3);\n matrixOfSquares[2][0] = createSquare( ColorOfFigure_Square.GREY, true,2,0);\n matrixOfSquares[2][1] = createSquare( ColorOfFigure_Square.GREY, true,2,1);\n matrixOfSquares[2][2] = createSquare( ColorOfFigure_Square.GREY, true,2,2);\n matrixOfSquares[2][3] = createSquare(true, ColorOfFigure_Square.YELLOW, true,2,3);\n }", "public static Map readMap(MapName s)\n {\n Map map = new Map(1);\n try\n {\n MapReader run = new MapReader();\n System.out.println(s.toString());\n Scanner mapReader = new Scanner(run.getClass().getResourceAsStream(\"/\"+s.toString()+\".jwmap\"));\n ArrayList<String[]> numberLines = new ArrayList<String[]>();\n int dim = mapReader.nextInt();\n mapReader.nextLine();\n for(int gh = 0 ; gh < dim; gh++)\n {\n String[] nums = mapReader.nextLine().split(\" \");\n numberLines.add(nums);\n }\n int[][] newMap = new int[numberLines.size()][numberLines.size()];\n \n for(int i = 0; i < numberLines.size();i++)\n {\n for(int h = 0; h < numberLines.get(i).length;h++)\n {\n newMap[i][h] = Integer.parseInt(numberLines.get(i)[h]);\n }\n }\n map.loadMap(newMap);\n \n TreeMap<Integer,ArrayList<Integer>> spawn1 = map.getSpawn1();\n TreeMap<Integer,ArrayList<Integer>> spawn2 = map.getSpawn2();\n \n String line = \"\";\n while(mapReader.hasNextLine() && (line = mapReader.nextLine()).contains(\"spawn1\"))\n {\n Scanner in = new Scanner(line);\n in.next();\n int x = in.nextInt();\n spawn1.put(x, new ArrayList<Integer>());\n while(in.hasNextInt())\n {\n spawn1.get(x).add(in.nextInt());\n }\n }\n \n if(!line.equals(\"\"))\n {\n Scanner in = new Scanner(line);\n in.next();\n int x = in.nextInt();\n spawn2.put(x, new ArrayList<Integer>());\n while(in.hasNextInt())\n {\n spawn2.get(x).add(in.nextInt());\n }\n }\n while(mapReader.hasNextLine() && (line = mapReader.nextLine()).contains(\"spawn2\"))\n {\n Scanner in = new Scanner(line);\n in.next();\n int x = in.nextInt();\n spawn2.put(x, new ArrayList<Integer>());\n while(in.hasNextInt())\n {\n spawn2.get(x).add(in.nextInt());\n }\n }\n }\n catch (Exception ex)\n {\n JOptionPane.showMessageDialog(null, \"Corrupted file!\");\n }\n return map;\n }", "private void createMapOfFirstType() {\n\n this.typeOfMap=1;\n matrixOfSquares[0][0] = createSquare( ColorOfFigure_Square.BLUE, true, 0, 0);\n matrixOfSquares[0][1] = createSquare( ColorOfFigure_Square.BLUE, false, 0, 1);\n matrixOfSquares[0][2] = createSquare(true, ColorOfFigure_Square.BLUE, true,0,2);\n matrixOfSquares[0][3] = null;\n matrixOfSquares[1][1] = createSquare( ColorOfFigure_Square.RED, true,1,1);\n matrixOfSquares[1][0] = createSquare(true, ColorOfFigure_Square.RED, true,1,0);\n matrixOfSquares[1][2] = createSquare( ColorOfFigure_Square.RED, true,1,2);\n matrixOfSquares[1][3] = createSquare( ColorOfFigure_Square.YELLOW, true,1,3);\n matrixOfSquares[2][0] = null;\n matrixOfSquares[2][1] = createSquare( ColorOfFigure_Square.GREY, true,2,1);\n matrixOfSquares[2][2] = createSquare( ColorOfFigure_Square.GREY, true,2,2);\n matrixOfSquares[2][3] = createSquare(true, ColorOfFigure_Square.YELLOW, true,2,3);\n\n }", "private void createMonsters() {\n monsters = new ArrayList<Monster>();\n\n Integer value;\n Integer key;\n for(Map.Entry<Integer, Integer> entry : characterLoader.getMonsters().entrySet()){\n\n key = entry.getKey();\n value = entry.getValue();\n\n for(int i=0;i<value;i++) {\n\n Point newPoint = findEmptyCell();\n\n switch (key) {\n\n // Case Ghost\n case LabyrinthFactory.GHOST:\n monsters.add(new Ghost(newPoint.x, newPoint.y));\n break;\n\n // Case Troll\n case LabyrinthFactory.TROLL:\n monsters.add(new Troll(newPoint.x, newPoint.y));\n break;\n }\n }\n }\n\n playThread();\n }", "private void createTurtleMap () {\n turtleInstructions.put(\"Forward\", new TurtleForward());\n turtleInstructions.put(\"Backward\", new TurtleBackward());\n turtleInstructions.put(\"Right\", new TurtleRight());\n turtleInstructions.put(\"Left\", new TurtleLeft());\n turtleInstructions.put(\"SetHeading\", new TurtleSetHeading());\n turtleInstructions.put(\"SetTowards\", new TurtleSetTowards());\n turtleInstructions.put(\"SetPosition\", new TurtleSetPosition());\n turtleInstructions.put(\"PenUp\", new TurtlePenUp());\n turtleInstructions.put(\"PenDown\", new TurtlePenDown());\n turtleInstructions.put(\"ShowTurtle\", new TurtleShowTurtle());\n turtleInstructions.put(\"HideTurtle\", new TurtleHideTurtle());\n turtleInstructions.put(\"Home\", new TurtleHome());\n turtleInstructions.put(\"ClearScreen\", new TurtleClearScreen());\n turtleInstructions.put(\"XCoordinate\", new TurtleXCor());\n turtleInstructions.put(\"YCoordinate\", new TurtleYCor());\n turtleInstructions.put(\"Heading\", new TurtleHeading());\n turtleInstructions.put(\"IsPenDown\", new TurtleIsPenDown());\n turtleInstructions.put(\"IsShowing\", new TurtleIsShowing()); \n displayInstructions.put(\"SetBackground\", new DisplaySetBackground());\n displayInstructions.put(\"SetPenColor\", new DisplaySetPenColor());\n displayInstructions.put(\"SetPenSize\", new DisplaySetPenSize());\n displayInstructions.put(\"SetShape\", new DisplaySetShape());\n displayInstructions.put(\"SetPalette\", new DisplaySetPalette());\n displayInstructions.put(\"GetPenColor\", new DisplayPenColor());\n displayInstructions.put(\"GetShape\", new DisplayShape());\n displayInstructions.put(\"Stamp\", new DisplayStamp());\n displayInstructions.put(\"ClearStamps\", new DisplayClearStamps());\n multiTurtleInstructions.put(\"ID\", new TurtleID());\n multiTurtleInstructions.put(\"Turtles\", new TurtleTurtles());\n multiTurtleInstructions.put(\"Tell\", new TurtleTellMulti());\n // multiTurtleInstructions.put(\"Ask\", new TurtleAsk());\n //multiTurtleInstructions.put(\"AskWith\", new TurtleAskWith());\n }", "private void fillImageMap() {\n Image shipImage;\n try {\n shipImage = ImageIO.read(getClass().getResource(\"img/patrol_boat.png\"));\n imageMap.put(ShipType.PATROL_BOAT, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/patrol_boat_sunken.png\"));\n imageMap.put(ShipType.PATROL_BOAT_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_horizontal.gif\"));\n imageMap.put(ShipType.CRUISER_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_horizontal_sunken.gif\"));\n imageMap.put(ShipType.CRUISER_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_vertical.gif\"));\n imageMap.put(ShipType.CRUISER_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_vertical_sunken.gif\"));\n imageMap.put(ShipType.CRUISER_VERTICAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_horizontal.gif\"));\n imageMap.put(ShipType.SUBMARINE_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_horizontal_sunken.gif\"));\n imageMap.put(ShipType.SUBMARINE_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_vertical.gif\"));\n imageMap.put(ShipType.SUBMARINE_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_vertical_sunken.gif\"));\n imageMap.put(ShipType.SUBMARINE_VERTICAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_horizontal.gif\"));\n imageMap.put(ShipType.BATTLESHIP_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_horizontal_sunken.gif\"));\n imageMap.put(ShipType.BATTLESHIP_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_vertical.gif\"));\n imageMap.put(ShipType.BATTLESHIP_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_vertical_sunken.gif\"));\n imageMap.put(ShipType.BATTLESHIP_VERTICAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_horizontal.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_horizontal_sunken.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_vertical.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_vertical_sunken.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_VERTICAL_SUNKEN, shipImage);\n } catch(IOException e) {\n e.printStackTrace();\n }\n }", "private void swellMountains(Square[][]Squares, int rows, int columns, int[][] terrainLoc)\n {\n int swellRand = (int) Math.sqrt(grid);\n int swellRand2 = (int) Math.sqrt(grid);\n int swellTolerance;\n \n // make sure that the mountains are swelled in proportion to the grid shape\n if(columns>rows)\n {\n swellTolerance = rows/25+1;\n }\n else\n {\n swellTolerance = columns/25+1;\n }\n \n // creating new mountains around the seeds\n \n // going through every second row \n for (int a = 1; a < rows-2 ; a=a+2)\n {\n // going through every column\n for (int b = 1 ; b < columns-2 ; b++)\n { \n if (terrainLoc[a][b] == 1)\n {\n // if a mountain seed is found, start making a bigger mountain on it by creating\n // three differently shaped rectangles out of mountain tiles\n int scRand;\n \n // loop for going through each rectangle\n for(int c=0;c<3;c++)\n {\n // loop for randoming mountain tiles 20 times around the seed\n for(int d = 0;d<20;d++)\n {\n // create a vertical rectangle\n if(c==0)\n {\n swellRand = (int) ((Math.random() * Math.sqrt(grid))/20)+1;\n swellRand2 = (int) ((Math.random() * Math.sqrt(grid))/40)+1;\n }\n // create a horizontal rectangle\n if (c == 1)\n {\n swellRand = (int) ((Math.random() * Math.sqrt(grid))/40)+1;\n swellRand2 = (int) ((Math.random() * Math.sqrt(grid))/20)+1;\n }\n // create a square\n if (c==2)\n {\n swellRand = (int) ((Math.random() * Math.sqrt(grid))/30)+1;\n swellRand2 = (int) ((Math.random() * Math.sqrt(grid))/30)+1;\n }\n \n // randoming the actual place for a tile and making sure it does not go over the array\n scRand = (int) (Math.random() * 8) + 1;\n \n switch (scRand)\n {\n case 1:\n if(a+swellRand < rows && b+swellRand2 < columns)\n Squares[a+swellRand][b+swellRand2].setTerrain(1);\n \n case 2:\n if(a-swellRand >= 0 && b-swellRand2 >=0)\n Squares[a-swellRand][b-swellRand2].setTerrain(1);\n \n case 3: \n if(a+swellRand < rows && b-swellRand2 >=0)\n Squares[a+swellRand][b-swellRand2].setTerrain(1);\n \n case 4:\n if(a-swellRand > 0 && b+swellRand2 < columns)\n Squares[a-swellRand][b+swellRand2].setTerrain(1);\n \n case 5:\n if(a<rows && a>=0 && b+swellRand < columns)\n Squares[a][b+swellRand].setTerrain(1);\n \n case 6:\n if(a<rows && a>=0 && b-swellRand >= 0)\n Squares[a][b-swellRand].setTerrain(1);\n\n case 7:\n if(a+swellRand < rows && b>=0 && b<columns)\n Squares[a+swellRand][b].setTerrain(1);\n\n case 8:\n if(a-swellRand >= 0 && b>=0 && b<columns)\n Squares[a-swellRand][b].setTerrain(1);\n }\n }\n }\n }\n }\n }\n }", "private void setupDefaultTerrainMap() {\n defaultTerrainKindMap.put(getHashCodeofPair(-7,1), TerrainKind.SMALL_FISHERY);\n defaultTerrainKindMap.put(getHashCodeofPair(7,1), TerrainKind.SMALL_FISHERY);\n defaultTerrainKindMap.put(getHashCodeofPair(-7,-1), TerrainKind.SMALL_FISHERY);\n defaultTerrainKindMap.put(getHashCodeofPair(7,-1), TerrainKind.SMALL_FISHERY);\n defaultTerrainKindMap.put(getHashCodeofPair(0,4), TerrainKind.SMALL_FISHERY);\n defaultTerrainKindMap.put(getHashCodeofPair(2,4), TerrainKind.SMALL_FISHERY);\n\n defaultTerrainKindMap.put(getHashCodeofPair(0,-2), TerrainKind.BIG_FISHERY);\n defaultTerrainKindMap.put(getHashCodeofPair(-3,-3), TerrainKind.FIELDS);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(1,-3), TerrainKind.HILLS);\n \t \tdefaultTerrainKindMap.put(getHashCodeofPair(3,-3), TerrainKind.SEA);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(-4,-2), TerrainKind.FOREST);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(-2,-2), TerrainKind.MOUNTAINS);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(-1,-3), TerrainKind.PASTURE);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(2,-2), TerrainKind.PASTURE);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(4,-2), TerrainKind.SEA);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(-5,-1), TerrainKind.SEA);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(-3,-1), TerrainKind.HILLS);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(-1,-1), TerrainKind.PASTURE);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(1,-1), TerrainKind.MOUNTAINS);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(3,-1), TerrainKind.FIELDS);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(5,-1), TerrainKind.SEA);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(-6,0), TerrainKind.HILLS);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(-4,0), TerrainKind.SEA);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(-2,0), TerrainKind.FOREST);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(0,0), TerrainKind.FOREST);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(2,0), TerrainKind.PASTURE);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(4,0), TerrainKind.SEA);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(6,0), TerrainKind.HILLS);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(-5,1), TerrainKind.MOUNTAINS);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(-3,1), TerrainKind.SEA);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(-1,1), TerrainKind.SEA);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(1,1), TerrainKind.SEA);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(3,1), TerrainKind.SEA);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(5,1), TerrainKind.GOLDFIELD);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(-4,2), TerrainKind.SEA);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(-2,2), TerrainKind.GOLDFIELD);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(0,2), TerrainKind.FIELDS);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(2,2), TerrainKind.PASTURE);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(4,2), TerrainKind.SEA);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(-3,3), TerrainKind.SEA);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(-1,3), TerrainKind.SEA);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(1,3), TerrainKind.MOUNTAINS);\n\t\tdefaultTerrainKindMap.put(getHashCodeofPair(3,3), TerrainKind.SEA);\n\t}", "public Map<Integer, Integer> generateMap(int size){\n Map<Integer, Integer> data = new HashMap<>();\n for (int i = 0; i < size; i++){\n data.put(i, i);\n }\n return data;\n }", "public TiledMap createMap() {\n map_inter = new MapTile[g_logic.MAP_WIDTH][g_logic.MAP_HEIGHT];\n \n //drawing stuff\n tiles = new Texture(Gdx.files.internal(\"packed/terrain.png\"));\n TextureRegion[][] splitTiles = TextureRegion.split(tiles, 54, 54);\n map = new TiledMap();\n MapLayers layers = map.getLayers();\n TiledMapTileLayer new_layer = new TiledMapTileLayer(g_logic.MAP_WIDTH, g_logic.MAP_HEIGHT, g_logic.ISO_WIDTH, g_logic.ISO_HEIGHT);\n \n //actual generation\n for (int x = 0; x < g_logic.MAP_WIDTH; x++) \n {\n for (int y = 0; y < g_logic.MAP_HEIGHT; y++) \n {\n char chara = '.';\n int ty = 0;\n int tx;\n if (x == 0 || x == g_logic.MAP_WIDTH-1)\n {\n tx = 1;\n chara = '#';\n }\n else\n {\n tx = 0; \n chara = '.';\n }\n \n //set up map tiles\n MapTile tile = new MapTile(x, y, tx, ty, chara);\n Gdx.app.log(\"Map gen\", \"Created a map tile @\" + x + \",\" + y + \" \" + tx + \" \" + ty + \" \" + chara);\n \n //put them in the internal map\n putInterMap(tile, x, y);\n \n //set up renderer cells\n TiledMapTileLayer.Cell cell = new TiledMapTileLayer.Cell();\n //y,x\n cell.setTile(new StaticTiledMapTile(splitTiles[tile.getTextureY()][tile.getTextureX()]));\n new_layer.setCell(x, y, cell);\n }\n }\n \n \n float y_off = g_logic.getYOffset();\n new_layer.setOffsetY(y_off);\n layers.add(new_layer);\n \n g_logic.setInterMap(map_inter);\n\n return map;\n }", "public static void reproduce (Species [][] map, int sheepHealth, int wolfHealth, int plantHealth) {\n \n // Place the baby\n int babyY, babyX;\n \n // Check if the baby has been placed\n int spawned = 0;\n \n for (int y = 0; y < map[0].length; y++){\n for (int x = 0; x < map.length; x++){\n \n boolean [][] breeding = breedChoice (map, x, y, plantHealth);\n \n // Sheep upwards to breed with\n if (breeding[0][0]) {\n ((Sheep)map[y][x]).reproduceHealthLost(10);\n ((Sheep)map[y-1][x]).reproduceHealthLost(10);\n \n // Make baby sheep\n Sheep sheep = new Sheep(sheepHealth, x, y);\n \n // Place the baby sheep\n do {\n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = sheep;\n spawned = 1;\n }\n } while (spawned == 0);\n \n // Sheep downwards to breed with\n } else if (breeding[1][0]) {\n ((Sheep)map[y][x]).reproduceHealthLost(10);\n ((Sheep)map[y+1][x]).reproduceHealthLost(10);\n \n // Make baby sheep\n Sheep sheep = new Sheep(sheepHealth, x, y);\n \n // Place the baby sheep\n do {\n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = sheep;\n spawned = 1;\n }\n } while (spawned == 0);\n \n // Sheep to the left to breed with\n } else if (breeding[2][0]) {\n ((Sheep)map[y][x]).reproduceHealthLost(10);\n ((Sheep)map[y][x-1]).reproduceHealthLost(10);\n \n // Make baby sheep\n Sheep sheep = new Sheep(sheepHealth, x, y);\n \n // Place the baby sheep\n do {\n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = sheep;\n spawned = 1;\n }\n } while (spawned == 0);\n \n // Sheep to the right to breed with\n } else if (breeding[3][0]) {\n ((Sheep)map[y][x]).reproduceHealthLost(10);\n ((Sheep)map[y][x+1]).reproduceHealthLost(10);\n \n // Make baby sheep\n Sheep sheep = new Sheep(sheepHealth, x, y);\n \n // Place the baby sheep\n do {\n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = sheep;\n spawned = 1;\n }\n } while (spawned == 0);\n \n // Wolf upwards to breed with\n } else if (breeding[0][1]) {\n ((Wolf)map[y][x]).reproduceHealthLost(10);\n ((Wolf)map[y-1][x]).reproduceHealthLost(10);\n \n // Make baby wolf\n Wolf wolf = new Wolf(wolfHealth, x, y);\n \n // Place the baby wolf\n do { \n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = wolf;\n spawned = 1; \n }\n } while (spawned == 0);\n \n // Wolf downwards to breed with\n } else if (breeding[1][1]) {\n ((Wolf)map[y][x]).reproduceHealthLost(10);\n ((Wolf)map[y+1][x]).reproduceHealthLost(10);\n \n // Make baby wolf\n Wolf wolf = new Wolf(wolfHealth, x, y);\n \n // Place the baby wolf\n do { \n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = wolf;\n spawned = 1; \n }\n } while (spawned == 0);\n \n // Wolf to the left to breed with\n } else if (breeding[2][1]) {\n ((Wolf)map[y][x]).reproduceHealthLost(10);\n ((Wolf)map[y][x-1]).reproduceHealthLost(10);\n \n // Make baby wolf\n Wolf wolf = new Wolf(wolfHealth, x, y);\n \n // Place the baby wolf\n do { \n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = wolf;\n spawned = 1; \n }\n } while (spawned == 0);\n \n // Wolf to the right to breed with\n } else if (breeding[3][1]) {\n ((Wolf)map[y][x]).reproduceHealthLost(10);\n ((Wolf)map[y][x+1]).reproduceHealthLost(10);\n \n // Make baby wolf\n Wolf wolf = new Wolf(wolfHealth, x, y);\n \n // Place the baby wolf\n do { \n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = wolf;\n spawned = 1; \n }\n } while (spawned == 0);\n \n }\n \n }\n }\n \n }", "private void generateMap(){\n if(currDirections != null){\n\n\t \tPoint edge = new Point(mapPanel.getWidth(), mapPanel.getHeight());\n \tmapPanel.paintImmediately(0, 0, edge.x, edge.y);\n\t \t\n\t \t\n\t \t// setup advanced graphics object\n\t Graphics2D g = (Graphics2D)mapPanel.getGraphics();\n\t g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n\t g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);\n\n\t \n\t Route rt = currDirections.getRoute();\n\t\n\t boolean singleStreet = rt.getGeoSegments().size() == 1;\n\t Route contextRoute = (!singleStreet ? rt : \n\t \t\tnew Route( virtualGPS.findFullSegment(rt.getEndingGeoSegment()) ) );\n\t \n\t // calculate the longitude and latitude bounds\n\t int[] bounds = calculateCoverage( contextRoute , edge);\n\t \n\t Collection<StreetSegment> map = virtualGPS.getContext(bounds, contextRoute);\n\t \n\t \n\t // draw every segment of the map\n\t g.setColor(Color.GRAY);\n\t for(GeoSegment gs : map){\n\t \tdrawSegment(g, bounds, edge, gs);\n\t }\n\t \n\t // draw the path over the produced map in BLUE\n\t g.setColor(Color.BLUE);\n\t for(GeoFeature gf : rt.getGeoFeatures()){\n\t for(GeoSegment gs : gf.getGeoSegments()){\n\t\t \tdrawSegment(g, bounds, edge, gs);\n\t }\n\t Point start = derivePoint(bounds, edge, gf.getStart());\n\t Point end = derivePoint(bounds, edge, gf.getEnd());\n\t \n\t int dX = (int)(Math.abs(start.x - end.x) / 2.0);\n\t int dY = (int)(Math.abs(start.y - end.y) / 2.0);\n\n if(!jCheckBoxHideStreetNames.isSelected()){\n \tg.setFont(new Font(g.getFont().getFontName(), Font.BOLD, g.getFont().getSize()));\n \tg.drawString(gf.getName(), start.x + (start.x<end.x ? dX : -dX),\n \t\t\tstart.y + (start.y<end.y ? dY : -dY));\n }\n\t }\n }\n }", "public MapPanel(int size, int style)\r\n {\r\n this.setLayout(new BorderLayout());\r\n zoom = 32;//set initail zoom to 32;\r\n\t\t\t\tyear = -4000;\r\n\r\n //set up initial key movements\r\n keyUp = KeyEvent.VK_W;\r\n keyLeft = KeyEvent.VK_A;\r\n keyRight = KeyEvent.VK_D;\r\n keyDown = KeyEvent.VK_S;\r\n keyZoom = KeyEvent.VK_Z;\r\n\r\n if(size == 100 && style == 2)\r\n {\r\n //create the map\r\n myMap = GWMap.getGWMap();\r\n if (myMap == null)\r\n {\r\n GWMap.create(size, size, 100, 3, (float) 50.0, (float) 33.0, 2, 4);\r\n myMap = GWMap.getGWMap();\r\n }\r\n else\r\n myMap.reCreate(size, size, 100, 3, (float) 50.0, (float) 33.0, 2, 4);\r\n generate();\r\n }\r\n\r\n else if(size == 75 && style == 2)\r\n {\r\n //create the map\r\n myMap = GWMap.getGWMap();\r\n if (myMap == null)\r\n {\r\n GWMap.create(size, size, 75, 3, (float) 50.0, (float) 33.0, 2, 4);\r\n myMap = GWMap.getGWMap();\r\n }\r\n else\r\n myMap.reCreate(size, size, 75, 3, (float) 50.0, (float) 33.0, 2, 4);\r\n generate();\r\n }\r\n\r\n else if(size == 50 && style == 2)\r\n {\r\n //create the map\r\n myMap = GWMap.getGWMap();\r\n if (myMap == null)\r\n {\r\n GWMap.create(size, size, 50, 2, (float) 50.0, (float) 33.0, 2, 4);\r\n myMap = GWMap.getGWMap();\r\n }\r\n else\r\n myMap.reCreate(size, size, 50, 2, (float) 50.0, (float) 33.0, 2, 4);\r\n generate();\r\n }\r\n\r\n if(size == 100 && style == 1)\r\n {\r\n //create the map\r\n myMap = GWMap.getGWMap();\r\n if (myMap == null)\r\n {\r\n GWMap.create(size, size, 10, 1, (float) 50.0, (float) 33.0, 2, 4);\r\n myMap = GWMap.getGWMap();\r\n }\r\n else\r\n myMap.reCreate(size, size, 10, 1, (float) 50.0, (float) 33.0, 2, 4);\r\n generate();\r\n }\r\n\r\n else if(size == 75 && style == 1)\r\n {\r\n //create the map\r\n myMap = GWMap.getGWMap();\r\n if (myMap == null)\r\n {\r\n GWMap.create(size, size, 10, 1, (float) 50.0, (float) 33.0, 2, 4);\r\n myMap = GWMap.getGWMap();\r\n }\r\n else\r\n myMap.reCreate(size, size, 10, 1, (float) 50.0, (float) 33.0, 2, 4);\r\n generate();\r\n }\r\n\r\n else if(size == 50 && style == 1)\r\n {\r\n //create the map\r\n myMap = GWMap.getGWMap();\r\n if (myMap == null)\r\n {\r\n GWMap.create(size, size, 7, 1, (float) 50.0, (float) 33.0, 2, 4);\r\n myMap = GWMap.getGWMap();\r\n }\r\n else\r\n myMap.reCreate(size, size, 7, 1, (float) 50.0, (float) 33.0, 2, 4);\r\n generate();\r\n }\r\n\r\n if(size == 100 && style == 3)\r\n {\r\n //create the map\r\n myMap = GWMap.getGWMap();\r\n if (myMap == null)\r\n {\r\n GWMap.create(size, size, 120, 1, (float) 50.0, (float) 33.0, 2, 4);\r\n myMap = GWMap.getGWMap();\r\n }\r\n else\r\n myMap.reCreate(size, size, 120, 1, (float) 50.0, (float) 33.0, 2, 4);\r\n generate();\r\n }\r\n\r\n else if(size == 75 && style == 3)\r\n {\r\n //create the map\r\n myMap = GWMap.getGWMap();\r\n if (myMap == null)\r\n {\r\n GWMap.create(size, size, 100, 1, (float) 50.0, (float) 33.0, 2, 4);\r\n myMap = GWMap.getGWMap();\r\n }\r\n else\r\n myMap.reCreate(size, size, 100, 1, (float) 50.0, (float) 33.0, 2, 4);\r\n generate();\r\n }\r\n\r\n else if(size == 50 && style == 3)\r\n {\r\n //create the map\r\n myMap = GWMap.getGWMap();\r\n if (myMap == null)\r\n {\r\n GWMap.create(size, size, 75, 0, (float) 50.0, (float) 33.0, 2, 4);\r\n myMap = GWMap.getGWMap();\r\n }\r\n else\r\n myMap.reCreate(size, size, 75, 0, (float) 50.0, (float) 33.0, 2, 4);\r\n generate();\r\n }\r\n\r\n //set up the cursor\r\n cursor = Cursor.getPredefinedCursor(Cursor.HAND_CURSOR);\r\n\r\n //set up the buttons\r\n leftButton = new JButton();\r\n leftButton.setFocusable(false);\r\n leftButton.setBorder(null);\r\n leftButton.setContentAreaFilled(false);\r\n leftButton.setCursor(cursor);\r\n iconDefault = new ImageIcon(\"images/left.gif\");\r\n leftButton.setIcon(iconDefault);\r\n\r\n rightButton = new JButton();\r\n rightButton.setFocusable(false);\r\n rightButton.setBorder(null);\r\n rightButton.setContentAreaFilled(false);\r\n rightButton.setCursor(cursor);\r\n iconDefault = new ImageIcon(\"images/right.gif\");\r\n rightButton.setIcon(iconDefault);\r\n\r\n upButton = new JButton();\r\n upButton.setFocusable(false);\r\n upButton.setBorder(null);\r\n upButton.setContentAreaFilled(false);\r\n upButton.setCursor(cursor);\r\n iconDefault = new ImageIcon(\"images/up.gif\");\r\n upButton.setIcon(iconDefault);\r\n\r\n downButton = new JButton();\r\n downButton.setFocusable(false);\r\n downButton.setBorder(null);\r\n downButton.setContentAreaFilled(false);\r\n downButton.setCursor(cursor);\r\n iconDefault = new ImageIcon(\"images/down.gif\");\r\n downButton.setIcon(iconDefault);\r\n\r\n leftButton.addActionListener(this);\r\n rightButton.addActionListener(this);\r\n upButton.addActionListener(this);\r\n downButton.addActionListener(this);\r\n\r\n //set up the panels\r\n worldPanel = new WorldPanel();\r\n this.add(worldPanel, BorderLayout.CENTER);\r\n\r\n southPanel = new JPanel(new FlowLayout());\r\n southPanel.setBackground(Color.black);\r\n southPanel.add(leftButton);\r\n\t\t\t\tsouthPanel.add(upButton);\r\n southPanel.add(downButton);\r\n southPanel.add(rightButton);\r\n this.add(southPanel, BorderLayout.SOUTH);\r\n\r\n miniMap = new MiniMap();\r\n unitPanel = new UnitInfoPanel();\r\n\r\n eastPanel1 = new JPanel(new BorderLayout());\r\n eastPanel1.setBackground(Color.black);\r\n eastPanel1.add(miniMap ,BorderLayout.SOUTH);\r\n eastPanel1.add(unitPanel, BorderLayout.CENTER);\r\n this.add(eastPanel1, BorderLayout.EAST);\r\n\r\n //create initial map\r\n worldPanel.setInitialMap(mapPieces, mapWidth, mapHeight);\r\n miniMap.setMap(mapPieces, mapWidth, mapHeight, 12, 12);\r\n int x = worldPanel.getFirstX();\r\n int y = worldPanel.getFirstY();\r\n miniMap.setNewXY(x,y,21,15);\r\n addKeyListener(this);\r\n this.setBackground(Color.black);\r\n this.requestFocus();\r\n }", "public void initMap(String path) {\n \tgameState = StateParser.makeGame(path);\n\t\tintel = gameState.getCtrlIntel();\t\n\t\tsnakes = gameState.getSnake();\n\t\tmap = gameState.getMap();\n }", "public Map(int r, int c){\r\n try {\r\n bomb = new Image(new FileInputStream(\"Minesweeper_Images/bomb.png\"));\r\n zero = new Image(new FileInputStream(\"Minesweeper_Images/zero.png\"));\r\n one = new Image(new FileInputStream(\"Minesweeper_Images/one.png\"));\r\n two = new Image(new FileInputStream(\"Minesweeper_Images/two.png\"));\r\n three = new Image(new FileInputStream(\"Minesweeper_Images/three.png\"));\r\n four = new Image(new FileInputStream(\"Minesweeper_Images/four.png\"));\r\n five = new Image(new FileInputStream(\"Minesweeper_Images/five.png\"));\r\n six = new Image(new FileInputStream(\"Minesweeper_Images/six.png\"));\r\n seven = new Image(new FileInputStream(\"Minesweeper_Images/seven.png\"));\r\n eight = new Image(new FileInputStream(\"Minesweeper_Images/eight.png\"));\r\n flag = new Image(new FileInputStream(\"Minesweeper_Images/flag.png\"));\r\n square = new Image(new FileInputStream(\"Minesweeper_Images/square.png\"));\r\n } catch (FileNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n map = new Square[r][c];\r\n for(int row = 0; row<map.length; row++){\r\n for(int col = 0; col<map[0].length; col++){\r\n map[row][col] = new Square();\r\n //map[row][col].setVisual(\" \");\r\n int x = row;\r\n int y = col;\r\n map[row][col].setVisual(square);\r\n map[row][col].getSquareButton().setOnMouseClicked(e->{\r\n if(e.getButton() == MouseButton.PRIMARY){\r\n revealArea(x, y);\r\n }\r\n if(e.getButton() == MouseButton.SECONDARY){\r\n flag(x, y);\r\n if(win() == true){\r\n System.out.println(\"WIN\");\r\n EndBox.end(\"Win\", \"YOU WIN!!!\");\r\n System.exit(0);\r\n }\r\n }\r\n });\r\n\r\n\r\n }\r\n\r\n }\r\n }", "private void addItems() {\n int random3 = 0;\n for (int i = 0; i < MAP_LENGTH; i++) {\n for (int j = 0; j < MAP_LENGTH; j++) {\n random3 = (int)(Math.round(Math.random()*9));\n if (tileMap[i][j].getTerrain() instanceof Grass) {\n if (adjacentCity(i, j) && tileMap[i][j].getCity() == null) { //Only have an item if possibly within city borders\n if (random3 == 0) {\n tileMap[i][j].setResource(new Fruit(i,j)); //Rep Fruit\n } else if (random3 == 1) {\n tileMap[i][j].setResource(new Animal(i,j)); //Rep Animal\n } else if (random3 == 2) {\n tileMap[i][j].setResource(new Forest(i,j)); //Rep Trees (forest)\n } else if (random3 == 3) {\n tileMap[i][j].setResource(new Crop(i,j)); //Rep Crop\n }\n }\n } else {\n if (adjacentCity(i, j)) {\n if (random3 < 2) {\n tileMap[i][j].setResource(new Fish(i, j)); //Rep fish\n } else if (random3 == 4) {\n if (Math.random() < 0.5) {\n tileMap[i][j].setResource(new Whale(i, j)); //Rep whale\n }\n }\n }\n }\n }\n }\n }", "private void growMap() {\n\t\tshort chunkId;\n\n\t\t// Fill until full\n\t\twhile (end % STORED_CHUNKS != currChunk % STORED_CHUNKS || end == 0) {\n\t\t\tchunkId = (short) random.nextInt(chunks.length);\n\t\t\tmap[end % STORED_CHUNKS] = chunkId;\n\t\t\tchunks[chunkId].setupToStage(stage, end * MapChunk.WIDTH * tileSize, 0);\n\t\t\tend++;\n\t\t}\n\t}", "@Override\r\n\tpublic void createSprites(World world) {\r\n \t// the height of the map since 0,0 in Tiled is in the top left\r\n // compared to the TiledMap's 0,0 in the bottom left\r\n int height = 2400;\r\n\r\n // file locations of different trees\r\n TextureAtlas atlas = new TextureAtlas(\"Game Tilesets/Trees/Trees.pack\");\r\n Skin skin = new Skin();\r\n skin.addRegions(atlas);\r\n TextureRegion T2 = skin.getRegion(\"T2\");\r\n TextureRegion T3 = skin.getRegion(\"T3\");\r\n TextureRegion T7 = skin.getRegion(\"T7\");\r\n TextureRegion T9 = skin.getRegion(\"T9\");\r\n TextureRegion T10 = skin.getRegion(\"T10\");\r\n \r\n // add all of the trees\r\n \tthis.addSprite(new ObjectSprites(T2, 236, height - 1490));\r\n \r\n this.addSprite(new ObjectSprites(T9, 622, height - 1907));\r\n this.addSprite(new ObjectSprites(T9, 683, height - 1687));\r\n this.addSprite(new ObjectSprites(T9, 174, height - 1851));\r\n this.addSprite(new ObjectSprites(T9, 361, height - 1643));\r\n \r\n this.addSprite(new ObjectSprites(T10, 572, height - 1354));\r\n this.addSprite(new ObjectSprites(T10, 0, height - 1475));\r\n this.addSprite(new ObjectSprites(T10, -9, height - 1707));\r\n this.addSprite(new ObjectSprites(T10, 675, height - 1479));\r\n this.addSprite(new ObjectSprites(T10, 416, height - 1903));\r\n\r\n this.addSprite(new ObjectSprites(T3, 428, height - 1453));\r\n this.addSprite(new ObjectSprites(T3, 596, height - 1122));\r\n this.addSprite(new ObjectSprites(T3, -32, height - 988));\r\n this.addSprite(new ObjectSprites(T3, 476, height - 864));\r\n this.addSprite(new ObjectSprites(T3, 640, height - 725));\r\n this.addSprite(new ObjectSprites(T3, 424, height - 2123));\r\n \r\n this.addSprite(new ObjectSprites(T7, 145, height - 1347));\r\n this.addSprite(new ObjectSprites(T7, 83, height - 1935));\r\n this.addSprite(new ObjectSprites(T7, 585, height - 2031));\r\n this.addSprite(new ObjectSprites(T7, 290, height - 2304));\r\n \r\n Bandit b1 = new Bandit();\r\n b1.defineBody(world, 215, 1305);\r\n super.addSprite(b1);\r\n \r\n Bandit b2 = new Bandit();\r\n b2.defineBody(world, 60, 1445);\r\n super.addSprite(b2);\r\n \r\n Bandit b3 = new Bandit();\r\n b3.defineBody(world, 90, 1640);\r\n super.addSprite(b3);\r\n \r\n Bandit b4 = new Bandit();\r\n b4.defineBody(world, 530, 1740);\r\n super.addSprite(b4);\r\n \r\n Bandit b5 = new Bandit();\r\n b5.defineBody(world, 730, 1655);\r\n super.addSprite(b5);\r\n \r\n Bandit b6 = new Bandit();\r\n b6.defineBody(world, 90, 2235);\r\n super.addSprite(b6);\r\n \r\n Bandit b7 = new Bandit();\r\n b7.defineBody(world, 715, 1490);\r\n super.addSprite(b7);\r\n \r\n Bandit b8 = new Bandit();\r\n b8.defineBody(world, 318, 1605);\r\n super.addSprite(b8);\r\n }", "public void createMap(boolean randomNumbers, boolean randomHexes, boolean randomPorts) {\n\t\t\n\t\tif (randomNumbers)\n\t\t\tplaceRandomNumbers();\n\t\telse\n\t\t\tplaceDefaultnumbers();\n\t\t\n\t\tif (randomHexes) {\n\t\t\t\n\t\t\thexGrid.setRandomTypes();\n\t\t\trobber = hexGrid.getDesertLocation();\n\t\t}\n\t\t\t\n\t\telse {\n\t\t\n\t\t\thexGrid.setDefaultTypes();\n//\t\t\trobber = new HexLocation(0, -2);\n\t\t}\n\t\tif (randomPorts)\n\t\t\tcreateRandomPorts();\n\t\telse\n\t\t\tcreateDefaultPorts();\n\t}", "@Override\n\tpublic HashMap<Position, Node> generate(){\n\t\tNode tempNode;\n\t\tPosition tempPosition;\n\t\tif(map != null && map.isEmpty()){\n\t\t\tfor(int y=0; y<numNodesY; y++){\n\t\t\t\tfor(int x=0; x<numNodesX; x++){\n\t\t\t\t\ttempPosition = new Position(x*nodeDistance, \n\t\t\t\t\t\t\ty*nodeDistance);\n\t\t\t\t\ttempNode = new Node(field, tempPosition,\n\t\t\t\t\t\t\tnodeSignalStrength,\n\t\t\t\t\t\t\tagentLife,\n\t\t\t\t\t\t\trequestLife);\n\t\t\t\t\tmap.put(tempPosition, tempNode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn new HashMap<Position, Node>(map);\n\t}", "public void generateShape() {\n\n //TODO for tetris game - copy added to Tetris\n Shape newShape = null;\n //if(GAME_TO_TEST==GameEnum.TETRIS){\n //newShape = TetrisShapeFactory.getRandomShape(this.board);\n //} else if (GAME_TO_TEST== GameEnum.DRMARIO){\n //newShape = DrMarioShapeFactory.getRandomShape(this.board);\n //}\n\n //Temporary\n //-------------------------------------//\n Image image = null;\n try {\n image = new Image(new FileInputStream(\"resources/BlockPurple.png\"));\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n\n int spawnColIndex = 0;\n int spawnRowIndex = 0;\n int tileSize = 0;\n boolean setColor = false;\n boolean setTileBorder = false; //toggle to add boarder to tile\n boolean setImage = true;\n spawnColIndex = (board.gridWidth-1)/2; //half of board width\n spawnRowIndex = 0;\n tileSize = board.tileSize;\n\n Tile tile1 = new Tile(tileSize, setColor, Color.VIOLET, setTileBorder, setImage, image, spawnColIndex,spawnRowIndex, 0 , Direction.DOWN); //Center Tile\n Tile tile2 = new Tile(tileSize, setColor, Color.VIOLET, setTileBorder, setImage, image, spawnColIndex,spawnRowIndex,1 , Direction.RIGHT);\n Tile tile3 = new Tile(tileSize, setColor, Color.VIOLET, setTileBorder, setImage, image, spawnColIndex,spawnRowIndex, 1 , Direction.LEFT);\n Tile tile4 = new Tile(tileSize, setColor, Color.VIOLET, setTileBorder, setImage, image, spawnColIndex,spawnRowIndex, 1 , Direction.DOWN);\n\n List<Tile> tiles = new ArrayList<Tile>();\n tiles.add(tile1);\n tiles.add(tile2);\n tiles.add(tile3);\n tiles.add(tile4);\n newShape = new Shape(tiles);\n\n //set newly created shape as the currently active shape\n this.currentActiveShape = newShape;\n\n //check if spawn area is occupied\n boolean isOccupied =false;\n for (Tile newTile : this.currentActiveShape.tiles) {\n if(this.board.getTile(newTile.columnIndex,newTile.rowIndex)!=null){\n isOccupied = true;\n }\n }\n\n //TODO\n //check if shape reaches top\n if(!isOccupied){\n //add tiles to board\n for (Tile newTile : this.currentActiveShape.tiles) {\n this.board.placeTile(newTile);\n }\n } else {\n //TODO later add Game Over JavaFx message\n System.out.println(\"GAME OVER\");\n\n //TODO Finishlater\n //Text gameoverText = new Text(10,20,\"GAME OVER\");\n //gameoverText.setFill(Color.RED);\n //gameoverText.setX( 100/*( ((board.gridWidth-1)*tileSize)/2)*/ );\n //gameoverText.setY( 100/*( ((board.gridHeight-1)*tileSize)/2)*/ );\n //gameoverText.setStyle(\"-fx-font: 70 arial;\");\n //this.group.getChildren().add(gameoverText);\n\n //Text t = new Text();\n //t.setX(20.0f);\n //t.setY(65.0f);\n //t.setX(100);\n //t.setY(200);\n //t.setText(\"Perspective\");\n //t.setFill(Color.YELLOW);\n //t.setFont(Font.font(null, FontWeight.BOLD, 36));\n //this.group.getChildren().add(t);\n //this.pane.getChildren().add(t);\n\n //System.exit(0);\n }\n\n }", "public static Pane createMapView(ObservableGameState obsGS\n , ObjectProperty<ClaimRouteHandler> claimRouteH\n , CardChooser cardChooser){\n Pane carte = new Pane();\n carte.getStylesheets().addAll(\"map.css\",\"colors.css\");\n ImageView imageView = new ImageView();\n carte.getChildren().add(imageView);\n //creating each road\n for (Route route: ChMap.routes()){\n //create route group and set basic params like color/level\n Group routeGroup = setRouteParams(route);\n //creating each piece of a road (case on map)\n for (int i=1; i<= route.length();++i){\n Group caseOnMap = caseOnMap(route,i);\n routeGroup.getChildren().add(caseOnMap);\n }\n //adding a listener on who owns the route\n obsGS.owner(route).addListener((observable, oldValue, newValue) ->\n routeGroup.getStyleClass().add(newValue.name()));\n //making sure the player can't click on a road when they can't get possession of it\n routeGroup.disableProperty().bind(\n claimRouteH.isNull().or(obsGS.claimable(route).not()));\n //launches the protocol of getting a new route\n routeGroup.setOnMouseClicked( event -> {\n\n List<SortedBag<Card>> possibleClaimCards = obsGS.possibleClaimCards(route);\n //if the player has only one combination of possible cards, there's no need to elaborate\n if (possibleClaimCards.size() == 1)\n claimRouteH.get().onClaimRoute(route, possibleClaimCards.get(0));\n //bunch of handlers show the possibilities on screen and handle the choice made by the player\n else {\n ChooseCardsHandler chooseCardsH =\n chosenCards -> claimRouteH.get().onClaimRoute(route, chosenCards);\n cardChooser.chooseCards(possibleClaimCards, chooseCardsH);\n }\n });\n //adding the route with everything connected to the highest parent -> the Pane\n carte.getChildren().add(routeGroup);\n }\n return carte;\n }", "private static BufferedImage getMap(int art, GameModel gameModel, Color mapC, Color skyC){\n\n BufferedImage image = new BufferedImage(2800,1800,BufferedImage.TYPE_4BYTE_ABGR);\n\n int genauigkeit = 400;\n\n int[] mapX = new int[genauigkeit + 2];\n int[] mapY = new int[genauigkeit + 2];\n\n mapX[genauigkeit + 1] = 0;\n mapX[genauigkeit] = GameLoop.imgW;\n\n mapY[genauigkeit + 1] = GameLoop.imgH;\n mapY[genauigkeit] = GameLoop.imgH;\n\n double[] rnd = new double[8];\n\n for(int i = 0;i < 4;i++){\n rnd[i] = Math.random() * 0.1;\n rnd[i+4] = Math.random();\n }\n\n for(int i = 0;i < genauigkeit;i++){\n mapX[i] = (int) (GameLoop.imgW/(double)genauigkeit * (i));\n\n switch(art){\n case 1:\n mapY[i] = (int) (gameModel.getHeight()/(double)2 + Math.sin(i * 0.1) * gameModel.getHeight()/8);\n break;\n case 2:\n mapY[i] = (int) (gameModel.getHeight()/(double)2 + Math.sin(i * 0.01) * gameModel.getHeight()/8);\n break;\n case 3:\n mapY[i] = (int) (gameModel.getHeight()/(double)2 + Math.sin(i * 0.1) * gameModel.getHeight()/12 + i);\n break;\n case 4:\n mapY[i] = (int) (gameModel.getHeight()*0.8 - 1/(2000 + Math.pow(i - (genauigkeit - 2)/2.0,2)) * 1500000);\n break;\n case 5:\n mapY[i] = (int) (gameModel.getHeight()/(double)2 + Math.pow(Math.sin(i * 0.03),3) * gameModel.getHeight()/4);\n break;\n case 6:\n mapY[i] = (int) (gameModel.getHeight()/2.0);\n mapY[i] += Math.sin(i * (rnd[0])) * rnd[4] * gameModel.getHeight()*0.1;\n mapY[i] += Math.sin(i * (rnd[1])) * rnd[5] * gameModel.getHeight()*0.1;\n mapY[i] += Math.sin(i * (rnd[2])) * rnd[6] * gameModel.getHeight()*0.1;\n mapY[i] += Math.sin(i * (rnd[3])) * rnd[7] * gameModel.getHeight()*0.1;\n\n\n\n\n\n }\n\n }\n\n Polygon map = new Polygon(mapX,mapY,genauigkeit+2);\n\n Graphics2D g2d = image.createGraphics();\n\n g2d.setColor(skyC);\n\n g2d.fillRect(0,0,2800,1800);\n\n g2d.setColor(mapC);\n\n g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_BILINEAR);\n\n g2d.fillPolygon(map);\n\n return image;\n }", "private void generateLevel() {\n\t\tgenerateBorder();\n\t\tfor (int y = 1; y < height - 1; y++) {\n\t\t\tfor (int x = 1; x < height - 1; x++) {\n\t\t\t\tif (random.nextInt(2) == 1) {\n\t\t\t\t\ttiles[x + y * width] = new Tile(Sprite.getGrass(), false, x, y);\n\t\t\t\t\trandForest(x, y);\n\t\t\t\t} else {\n\t\t\t\t\ttiles[x + y * width] = new Tile(Sprite.getDirt(), false, x, y);\n\t\t\t\t\trandOre(x, y);\n\t\t\t\t}\n\t\t\t\tif (x == 4 && y == 4) {\n\t\t\t\t\ttiles[x + y * width] = new Tile(Sprite.getGrass(), false, x, y);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "private void createBitMap() {\n bitMap = bitMap.copy(bitMap.getConfig(), true);\n Canvas canvas = new Canvas(bitMap);\n Paint paint = new Paint();\n paint.setAntiAlias(true);\n paint.setColor(Color.BLACK);\n paint.setStyle(Paint.Style.STROKE);\n paint.setStrokeWidth(4.5f);\n canvas.drawCircle(50, 50, 30, paint);\n winningBitMap = winningBitMap.copy(winningBitMap.getConfig(), true);\n Canvas canvas2 = new Canvas(winningBitMap);\n paint.setAntiAlias(true);\n paint.setColor(Color.GREEN);\n paint.setStyle(Paint.Style.FILL);\n paint.setStrokeWidth(4.5f);\n canvas2.drawCircle(50, 50, 30, paint);\n bitMapWin = winningBitMap.copy(winningBitMap.getConfig(), true);\n Canvas canvas3 = new Canvas(bitMapWin);\n paint.setAntiAlias(true);\n paint.setColor(Color.MAGENTA);\n paint.setStyle(Paint.Style.FILL);\n paint.setStrokeWidth(4.5f);\n canvas3.drawCircle(50, 50, 30, paint);\n bitMapCat = winningBitMap.copy(winningBitMap.getConfig(), true);\n Canvas canvas4 = new Canvas(bitMapCat);\n paint.setAntiAlias(true);\n paint.setColor(Color.DKGRAY);\n paint.setStyle(Paint.Style.FILL);\n paint.setStrokeWidth(4.5f);\n canvas4.drawCircle(50, 50, 30, paint);\n }", "public void randomize() {\r\n\t\tRandom random = new Random();// random generator used to get random int\r\n\t\tint r;// will hold the random int\r\n\t\tint num;// will hold the filtered random int that determines with entity to use for a tile\r\n\t\tfor (int i = 0; i < WIDTH_TILES; i++) {// loops x-coords\r\n\t\t\tfor (int j = 0; j < HEIGHT_TILES; j++) {// loops y-coords\r\n\t\t\t\tr = random.nextInt(32);// gets random int from 0 to 32\r\n\t\t\t\tif (r < 4) num = 0; else if (r < 8) num = 1; else if (r < 31) num = 2; else num = 3;// distributes different objects\r\n\t\t\t\tif (nodes[i * WIDTH_TILES + j].isOccupied() == false) {// if tile empty or random chosen\r\n\t\t\t\t\tnodes[i * WIDTH_TILES + j] = new Node(new Point(i * BOARD_WIDTH / WIDTH_TILES, j * BOARD_WIDTH / HEIGHT_TILES), new ImageIcon(icons[num]).getImage(), true, occupants[num]);// creates random tile\r\n\t\t\t\t}// if (random)\r\n\t\t\t}// for (j)\r\n\t\t}// for (i)\r\n\t}", "public static void sizePathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze five = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\t//System.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = five.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber + n)){\n\t\t\t\t\t\tS.unionBySize(randomNumber+n, randomNumber);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'u');\n\t\t\t\t\t\t//S.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.unionBySize(randomNumber, randomNumber+1);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(five, n);\n\t\tuserSelection_SolveMaze(n);\n\n\t\tStdDraw.show(0);\n\t\tfive.draw();\n\t\tfive.printCellNumbers();\t\n\t}", "private void generateDistanceMap(Coordinate productLocation)\n {\n // Create a copy of the current map to use when making the distance map\n String mapCopy = saveMapData();\n\n // Initialize the distance map using the saved map data\n Scanner mapLoader = new Scanner(mapCopy);\n mapLoader.useDelimiter(\"_\");\n\n // Find the paths/walls in the map\n for(int j = 0; j < mapSizeY; j++)\n {\n for(int i = 0; i < mapSizeX; i++)\n {\n if(mapLoader.hasNextInt())\n {\n // Check if the current tile is a path\n if(mapLoader.nextInt() == 2)\n {\n distanceMap[i][j] = -2; // Value of -2 is used to mark paths that do not have a known distance to the product\n }\n else // If the tile is not a path\n {\n distanceMap[i][j] = -1; // Value of -1 is used to mark tiles with obstructions the pathfinder can not go through\n }\n }\n }\n }\n\n // Set the location of the product\n distanceMap[productLocation.getX()][productLocation.getY()] = 0; // Value of 0 is used to mark tiles containing the product\n\n // Find the distance to the product for each tile that is capable of reaching the product\n for (int mappingCycle = 1; mappingCycle <= (mapSizeX * mapSizeY); mappingCycle++)\n {\n // Variable used to track how many tiles have been updated this cycle\n int tilesUpdated = 0;\n\n // Check each tile in the distance map\n for (int j = 0; j < mapSizeY; j++)\n {\n for (int i = 0; i < mapSizeX; i++)\n {\n // Check if the current tile is a path that does not have a known distance\n if(distanceMap[i][j] == -2)\n {\n // Check if the tile is next to a tile whose distance was found in the previous cycle\n // If the tile is next to a tile whose distance was found in the previous cycle, set the distance of the tile to the current mapping cycle\n\n // Check the tile to the left (-X Direction)\n if (i > 0) { if (distanceMap[i - 1][j] == (mappingCycle - 1)) { distanceMap[i][j] = mappingCycle; } }\n\n // Check the tile to the right (+X Direction)\n if (i < (mapSizeX - 1)) { if (distanceMap[i + 1][j] == (mappingCycle - 1)) { distanceMap[i][j] = mappingCycle; } }\n\n // Check the tile above the current tile (-Y Direction)\n if (j > 0) { if (distanceMap[i][j - 1] == (mappingCycle - 1)) { distanceMap[i][j] = mappingCycle; } }\n\n // Check the tile below the current tile (+Y Direction)\n if (j < (mapSizeY - 1)) { if (distanceMap[i][j + 1] == (mappingCycle - 1)) { distanceMap[i][j] = mappingCycle; } }\n\n // Increment count of updated tiles if the current tile was changed\n if(distanceMap[i][j] != -2)\n {\n tilesUpdated++;\n }\n }\n }\n }\n\n // End the process early if no tiles were updated this cycle\n if(tilesUpdated == 0)\n {\n mappingCycle = (mapSizeX * mapSizeY) + 1;\n }\n }\n }", "@Override\n\tpublic void populateMap(CityWorldGenerator generator, PlatMap platmap) {\n\t\tgetSchematics(generator).populate(generator, platmap);\n\t\t\n\t\t// random fluff!\n\t\tOdds platmapOdds = platmap.getOddsGenerator();\n\t\tShapeProvider shapeProvider = generator.shapeProvider;\n\t\tint waterDepth = ParkLot.getWaterDepth(platmapOdds);\n\t\t\n\t\t// backfill with buildings and parks\n\t\tfor (int x = 0; x < PlatMap.Width; x++) {\n\t\t\tfor (int z = 0; z < PlatMap.Width; z++) {\n\t\t\t\tPlatLot current = platmap.getLot(x, z);\n\t\t\t\tif (current == null) {\n\t\t\t\t\t\n\t\t\t\t\t//TODO I need to come up with a more elegant way of doing this!\n\t\t\t\t\tif (generator.settings.includeBuildings) {\n\n\t\t\t\t\t\t// what to build?\n\t\t\t\t\t\tboolean buildPark = platmapOdds.playOdds(oddsOfParks);\n\t\t\t\t\t\tif (buildPark)\n\t\t\t\t\t\t\tcurrent = getPark(generator, platmap, platmapOdds, platmap.originX + x, platmap.originZ + z, waterDepth);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tcurrent = getBackfillLot(generator, platmap, platmapOdds, platmap.originX + x, platmap.originZ + z);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// see if the previous chunk is the same type\n\t\t\t\t\t\tPlatLot previous = null;\n\t\t\t\t\t\tif (x > 0 && current.isConnectable(platmap.getLot(x - 1, z))) {\n\t\t\t\t\t\t\tprevious = platmap.getLot(x - 1, z);\n\t\t\t\t\t\t} else if (z > 0 && current.isConnectable(platmap.getLot(x, z - 1))) {\n\t\t\t\t\t\t\tprevious = platmap.getLot(x, z - 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if there was a similar previous one then copy it... maybe\n\t\t\t\t\t\tif (previous != null && !shapeProvider.isIsolatedLotAt(platmap.originX + x, platmap.originZ + z, oddsOfIsolatedLots)) {\n\t\t\t\t\t\t\tcurrent.makeConnected(previous);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// 2 by 2 at a minimum if at all possible\n\t\t\t\t\t\t} else if (!buildPark && x < PlatMap.Width - 1 && z < PlatMap.Width - 1) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// is there room?\n\t\t\t\t\t\t\tPlatLot toEast = platmap.getLot(x + 1, z);\n\t\t\t\t\t\t\tPlatLot toSouth = platmap.getLot(x, z + 1);\n\t\t\t\t\t\t\tPlatLot toSouthEast = platmap.getLot(x + 1, z + 1);\n\t\t\t\t\t\t\tif (toEast == null && toSouth == null && toSouthEast == null) {\n\t\t\t\t\t\t\t\ttoEast = current.newLike(platmap, platmap.originX + x + 1, platmap.originZ + z);\n\t\t\t\t\t\t\t\ttoEast.makeConnected(current);\n\t\t\t\t\t\t\t\tplatmap.setLot(x + 1, z, toEast);\n\n\t\t\t\t\t\t\t\ttoSouth = current.newLike(platmap, platmap.originX + x, platmap.originZ + z + 1);\n\t\t\t\t\t\t\t\ttoSouth.makeConnected(current);\n\t\t\t\t\t\t\t\tplatmap.setLot(x, z + 1, toSouth);\n\n\t\t\t\t\t\t\t\ttoSouthEast = current.newLike(platmap, platmap.originX + x + 1, platmap.originZ + z + 1);\n\t\t\t\t\t\t\t\ttoSouthEast.makeConnected(current);\n\t\t\t\t\t\t\t\tplatmap.setLot(x + 1, z + 1, toSouthEast);\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\t// remember what we did\n\t\t\t\t\tif (current != null)\n\t\t\t\t\t\tplatmap.setLot(x, z, current);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// validate each lot\n\t\tfor (int x = 0; x < PlatMap.Width; x++) {\n\t\t\tfor (int z = 0; z < PlatMap.Width; z++) {\n\t\t\t\tPlatLot current = platmap.getLot(x, z);\n\t\t\t\tif (current != null) {\n\t\t\t\t\tPlatLot replacement = current.validateLot(platmap, x, z);\n\t\t\t\t\tif (replacement != null)\n\t\t\t\t\t\tplatmap.setLot(x, z, replacement);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void createMapOfSecondType(){\n\n this.typeOfMap=2;\n matrixOfSquares[0][0] = createSquare( ColorOfFigure_Square.BLUE, true,0,0);\n matrixOfSquares[0][1] = createSquare( ColorOfFigure_Square.BLUE, false,0,1);\n matrixOfSquares[0][2] = createSquare(true, ColorOfFigure_Square.BLUE, true,0,2);\n matrixOfSquares[0][3] = createSquare( ColorOfFigure_Square.GREEN, true,0,3);\n matrixOfSquares[1][0] = createSquare(true, ColorOfFigure_Square.RED, true,1,0);\n matrixOfSquares[1][1] = createSquare( ColorOfFigure_Square.RED, true,1,1);\n matrixOfSquares[1][2] = createSquare( ColorOfFigure_Square.YELLOW, true,1,2);\n matrixOfSquares[1][3] = createSquare( ColorOfFigure_Square.YELLOW, true,1,3);\n matrixOfSquares[2][0] = null;\n matrixOfSquares[2][1] = createSquare( ColorOfFigure_Square.GREY, true,2,1);\n matrixOfSquares[2][2] = createSquare( ColorOfFigure_Square.YELLOW, true,2,2);\n matrixOfSquares[2][3] = createSquare(true, ColorOfFigure_Square.YELLOW, false,2,3);\n\n\n }", "public void initTiles()\n {\n PropertiesManager props = PropertiesManager.getPropertiesManager(); \n String imgPath = props.getProperty(MahjongSolitairePropertyType.IMG_PATH);\n int spriteTypeID = 0;\n SpriteType sT;\n \n // WE'LL RENDER ALL THE TILES ON TOP OF THE BLANK TILE\n String blankTileFileName = props.getProperty(MahjongSolitairePropertyType.BLANK_TILE_IMAGE_NAME);\n BufferedImage blankTileImage = miniGame.loadImageWithColorKey(imgPath + blankTileFileName, COLOR_KEY);\n ((MahjongSolitairePanel)(miniGame.getCanvas())).setBlankTileImage(blankTileImage);\n \n // THIS IS A HIGHLIGHTED BLANK TILE FOR WHEN THE PLAYER SELECTS ONE\n String blankTileSelectedFileName = props.getProperty(MahjongSolitairePropertyType.BLANK_TILE_SELECTED_IMAGE_NAME);\n BufferedImage blankTileSelectedImage = miniGame.loadImageWithColorKey(imgPath + blankTileSelectedFileName, COLOR_KEY);\n ((MahjongSolitairePanel)(miniGame.getCanvas())).setBlankTileSelectedImage(blankTileSelectedImage);\n \n // FIRST THE TYPE A TILES, OF WHICH THERE IS ONLY ONE OF EACH\n // THIS IS ANALOGOUS TO THE SEASON TILES IN FLAVORLESS MAHJONG\n ArrayList<String> typeATiles = props.getPropertyOptionsList(MahjongSolitairePropertyType.TYPE_A_TILES);\n for (int i = 0; i < typeATiles.size(); i++)\n {\n String imgFile = imgPath + typeATiles.get(i); \n sT = initTileSpriteType(imgFile, TILE_SPRITE_TYPE_PREFIX + spriteTypeID);\n initTile(sT, TILE_A_TYPE);\n spriteTypeID++;\n }\n \n // THEN THE TYPE B TILES, WHICH ALSO ONLY HAVE ONE OF EACH\n // THIS IS ANALOGOUS TO THE FLOWER TILES IN FLAVORLESS MAHJONG\n ArrayList<String> typeBTiles = props.getPropertyOptionsList(MahjongSolitairePropertyType.TYPE_B_TILES);\n for (int i = 0; i < typeBTiles.size(); i++)\n {\n String imgFile = imgPath + typeBTiles.get(i); \n sT = initTileSpriteType(imgFile, TILE_SPRITE_TYPE_PREFIX + spriteTypeID);\n initTile(sT, TILE_B_TYPE);\n spriteTypeID++;\n }\n \n // AND THEN TYPE C, FOR WHICH THERE ARE 4 OF EACH \n // THIS IS ANALOGOUS TO THE CHARACTER AND NUMBER TILES IN FLAVORLESS MAHJONG\n ArrayList<String> typeCTiles = props.getPropertyOptionsList(MahjongSolitairePropertyType.TYPE_C_TILES);\n for (int i = 0; i < typeCTiles.size(); i++)\n {\n String imgFile = imgPath + typeCTiles.get(i);\n sT = initTileSpriteType(imgFile, TILE_SPRITE_TYPE_PREFIX + spriteTypeID); \n for (int j = 0; j < 4; j++)\n {\n initTile(sT, TILE_C_TYPE);\n }\n spriteTypeID++;\n }\n }", "private void generateSprites() {\n final int PIXEL_ZOMBIE_SKIN = 0xa0ff90;\n final int PIXEL_SKIN = 0xFF9993;\n\n int pix = 0;\n for (int i = 0; i < 18; i++) {\n int skin = PIXEL_SKIN;\n int clothes = 0xFFffff;\n\n if (i > 0) {\n skin = PIXEL_ZOMBIE_SKIN;\n clothes = (random.nextInt(0x1000000) & 0x7f7f7f);\n }\n for (int t = 0; t < 4; t++) {\n for (int d = 0; d < 16; d++) {\n double dir = d * Math.PI * 2 / 16.0;\n\n if (t == 1)\n dir += 0.5 * Math.PI * 2 / 16.0;\n if (t == 3)\n dir -= 0.5 * Math.PI * 2 / 16.0;\n\n // if (i == 17)\n // {\n // dir = d * Math.PI * 2 / 64;\n // }\n\n double cos = Math.cos(dir);\n double sin = Math.sin(dir);\n\n for (int y = 0; y < 12; y++) {\n int col = 0x000000;\n for (int x = 0; x < 12; x++) {\n int xPix = (int) (cos * (x - 6) + sin * (y - 6) + 6.5);\n int yPix = (int) (cos * (y - 6) - sin * (x - 6) + 6.5);\n\n if (i == 17) {\n if (xPix > 3 && xPix < 9 && yPix > 3 && yPix < 9) {\n col = 0xff0000 + (t & 1) * 0xff00;\n }\n } else {\n if (t == 1 && xPix > 1 && xPix < 4 && yPix > 3 && yPix < 8)\n col = skin;\n if (t == 3 && xPix > 8 && xPix < 11 && yPix > 3 && yPix < 8)\n col = skin;\n\n if (xPix > 1 && xPix < 11 && yPix > 5 && yPix < 8) {\n col = clothes;\n }\n if (xPix > 4 && xPix < 8 && yPix > 4 && yPix < 8) {\n col = skin;\n }\n }\n sprites[pix++] = col;\n\n // If we just drew a pixel, make the next one an almost-black\n // pixel, and if it's already an almost-black one, make it\n // transparent (full black). (This is all honored only if the\n // next pixel isn't actually set to something else.) This takes\n // advantage of the left-to-right scanning of the sprite\n // generation to create a slight shadow effect on each sprite.\n if (col > 1) {\n col = 1;\n } else {\n col = 0;\n }\n }\n }\n }\n }\n }\n }", "public void setInitMap(int size,String[][] text) {\n\t\tfor(int i=0;i<this.size;i++) {\n\t\t\tfor(int j=0;j<this.size;j++) {\n\t\t\t\tthis.map[i][j] = text[i][j];\n\t\t\t\tif(map[i][j].equals(\"p\")) {\n\t\t\t\t\tsetPlayer(i,j,map[i][j]);\n\t\t\t\t}\n\t\t\t\telse if(map[i][j].equals(\"h\")||map[i][j].equals(\"s\")||map[i][j].equals(\"H\")||map[i][j].equals(\"c\")) {\n\t\t\t\t\tsetEnemy(i,j,map[i][j]);\n\t\t\t\t}\n\t\t\t\telse if(!(map[i][j].equals(\" \")||map[i][j].equals(\"*\"))){\n\t\t\t\t\tsetItemList(i,j,map[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}", "public void generete() {\n int minQuantFig = 1,\r\n maxQuantFig = 10,\r\n minNum = 1,\r\n maxNum = 100,\r\n minColor = 0,\r\n maxColor = (int)colors.length - 1,\r\n\r\n // Initialize figures property for random calculations\r\n randomColor = 0,\r\n randomFigure = 0,\r\n\r\n // Squere property\r\n randomSideLength = 0,\r\n\r\n // Circle property\r\n randomRadius = 0,\r\n \r\n // IsoscelesRightTriangle property \r\n randomHypotenus = 0,\r\n \r\n // Trapizoid properties\r\n randomBaseA = 0,\r\n randomBaseB = 0,\r\n randomAltitude = 0;\r\n\r\n // Generate random number to set figueres's quantaty\r\n setFigureQuantaty( generateWholoeNumInRange(minQuantFig, maxQuantFig) );\r\n\r\n for( int i = 0; i < getFigureQuantaty(); i++ ) {\r\n\r\n // Convert double random value to int and close it in range from 1 to number of elements in array\r\n randomFigure = (int)( Math.random() * figures.length );\r\n \r\n randomColor = generateWholoeNumInRange( minColor, maxColor ); // Get random color's index from colors array\r\n\r\n // Create new figure depending on randomFigure \r\n switch (figures[randomFigure]) {\r\n\r\n case \"Circle\":\r\n\r\n randomRadius = generateWholoeNumInRange( minNum, maxNum ); // Get random value of circle's radius;\r\n\r\n Circle newCircle = new Circle( colors[randomColor], randomRadius ); // Initialize Circle with random parameters\r\n\r\n newCircle.drawFigure();\r\n \r\n break;\r\n\r\n case \"Squere\":\r\n\r\n randomSideLength = generateWholoeNumInRange( minNum, maxNum ); // Get random value of side length;\r\n\r\n Squere newSquere = new Squere( colors[randomColor], randomSideLength ); // Initialize Circle with random parameters\r\n\r\n newSquere.drawFigure();\r\n\r\n break;\r\n\r\n case \"Triangle\":\r\n\r\n randomSideLength = generateWholoeNumInRange( minNum, maxNum ); // Get random value of side length;\r\n\r\n randomHypotenus = generateWholoeNumInRange( minNum, maxNum ); // Get random value of hypotenus;\r\n\r\n IsoscelesRightTriangle newTriangle = new IsoscelesRightTriangle( colors[randomColor], randomSideLength, randomHypotenus ); // Initialize Circle with random parameters\r\n\r\n newTriangle.drawFigure();\r\n\r\n break;\r\n\r\n case \"Trapezoid\":\r\n\r\n randomBaseA = generateWholoeNumInRange( minNum, maxNum ); // Get random value of trapizoid's side A;\r\n\r\n randomBaseB = generateWholoeNumInRange( minNum, maxNum ); // Get random value of trapizoid's side B;\r\n\r\n randomAltitude = generateWholoeNumInRange( minNum, maxNum ); // Get random value of trapizoid's altitude;\r\n\r\n Trapezoid newTrapezoid = new Trapezoid( colors[randomColor], randomBaseA, randomBaseB, randomAltitude ); // Create new Trapezoid with random parameters\r\n\r\n newTrapezoid.drawFigure();\r\n\r\n break;\r\n\r\n };\r\n };\r\n }", "public void drawMap() {\r\n\t\tfor (int x = 0; x < map.dimensionsx; x++) {\r\n\t\t\tfor (int y = 0; y < map.dimensionsy; y++) {\r\n\t\t\t\tRectangle rect = new Rectangle(x * scalingFactor, y * scalingFactor, scalingFactor, scalingFactor);\r\n\t\t\t\trect.setStroke(Color.BLACK);\r\n\t\t\t\tif (islandMap[x][y]) {\r\n\t\t\t\t\tImage isl = new Image(\"island.jpg\", 50, 50, true, true);\r\n\t\t\t\t\tislandIV = new ImageView(isl);\r\n\t\t\t\t\tislandIV.setX(x * scalingFactor);\r\n\t\t\t\t\tislandIV.setY(y * scalingFactor);\r\n\t\t\t\t\troot.getChildren().add(islandIV);\r\n\t\t\t\t} else {\r\n\t\t\t\t\trect.setFill(Color.PALETURQUOISE);\r\n\t\t\t\t\troot.getChildren().add(rect);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void generateCustomGameConfiguration() {\n // GameConfig.getInstance().setMapWidthX(20);\n // GameConfig.getInstance().setMapHeightY(20);\n // GameConfig.getInstance().setMaxEnergyPirateValue(100);\n // GameConfig.getInstance().setMonkeyErraticSpeed(1000);\n // GameConfig.getInstance().setMonkeyHunterSpeed(750);\n // GameConfig.getInstance().setRumEnergyValue(10);\n // GameConfig.getInstance().setTimeRumVisibility(10000);\n // GameConfig.getInstance().setRumList(Brain.getInstance().getObjectManager().getRumList());\n // GameConfig.getInstance().setSquaresList(Brain.getInstance().getMapManager().getMap().getSquareList());\n // ArrayList<Monkey> monkeyArrayList = new ArrayList<Monkey>();\n // for(int i=0;i<10;i++) {\n // if (i % 2 == 0) {\n // monkeyArrayList.add(new Monkey(PositionUtils.getSpawnPosition(\n // Map.getInstance().getGroundSquareList(),\n // CharacterManager.getInstance(Brain.getInstance()).getCharacterList(),\n // ObjectManager.getInstance(Brain.getInstance()).getObjectList()\n // ), Monkey.MonkeyType.ERRATIC));\n // } else {\n // monkeyArrayList.add(new Monkey(PositionUtils.getSpawnPosition(\n // Map.getInstance().getGroundSquareList(),\n // CharacterManager.getInstance(Brain.getInstance()).getCharacterList(),\n // ObjectManager.getInstance(Brain.getInstance()).getObjectList()\n // ), Monkey.MonkeyType.HUNTER));\n // }\n // }\n // GameConfig.getInstance().setMonkeyList(monkeyArrayList);\n // for(int i=0;i< Brain.getInstance().getMapManager().getMap().getSquareList().size();i++) {\n // for (int j = 0; j < Brain.getInstance().getMapManager().getMap().getSquareList().get(i).size(); j++) {\n // if (i == 0 || j==0 || i == GameConfig.getInstance().getMapWidthX()-1\n // || j == GameConfig.getInstance().getMapHeightY()-1) {\n // Brain.getInstance().getMapManager().getMap().getSquareList().get(i).get(j)\n // .setSquareType(Square.SquareType.SEA);\n // }else{\n // Brain.getInstance().getMapManager().getMap().getSquareList().get(i).get(j)\n // .setSquareType(Square.SquareType.GROUND);\n // }\n // }\n // }\n // GameConfig.getInstance().setSquaresList(Brain.getInstance().getMapManager().getMap().getSquareList());\n // saveGameConfiguration();\n }", "private void createMapOfThirdType(){\n\n this.typeOfMap=3;\n matrixOfSquares[0][0] = createSquare( ColorOfFigure_Square.RED, true,0,0);\n matrixOfSquares[0][1] = createSquare( ColorOfFigure_Square.BLUE, true,0,1);\n matrixOfSquares[0][2] = createSquare(true, ColorOfFigure_Square.BLUE, true,0,2);\n matrixOfSquares[0][3] = createSquare( ColorOfFigure_Square.GREEN, true,0,3);\n matrixOfSquares[1][0] = createSquare(true, ColorOfFigure_Square.RED, true,1,0);\n matrixOfSquares[1][1] = createSquare( ColorOfFigure_Square.PURPLE, true,1,1);\n matrixOfSquares[1][2] = createSquare( ColorOfFigure_Square.YELLOW, true,1,2);\n matrixOfSquares[1][3] = createSquare( ColorOfFigure_Square.YELLOW, true,1,3);\n matrixOfSquares[2][0] = createSquare( ColorOfFigure_Square.GREY, true,2,0);\n matrixOfSquares[2][1] = createSquare( ColorOfFigure_Square.GREY, true,2,1);\n matrixOfSquares[2][2] = createSquare( ColorOfFigure_Square.YELLOW, true,2,2);\n matrixOfSquares[2][3] = createSquare(true, ColorOfFigure_Square.YELLOW, false,2,3);\n\n }", "private static ResourceLocation getRandomMonster(Random rand)\n\t{\n\t\tRandomCollection<ResourceLocation> monsters = new RandomCollection<ResourceLocation>();\n\t\t\n\t\tmonsters.add(10, EntityList.getKey(EntityZombie.class));\n\t\tmonsters.add(10, EntityList.getKey(EntitySkeleton.class));\n\t\tmonsters.add(10, EntityList.getKey(EntitySpider.class));\n\t\tmonsters.add(7, EntityList.getKey(EntityGhost.class));\n\t\tmonsters.add(7, EntityList.getKey(EntityBarbarian.class));\n\t\t//monsters.add(4, EntityList.getKey(EntityBandit.class));\n\t\tmonsters.add(3, EntityList.getKey(EntityBanshee.class));\n\t\tmonsters.add(1, EntityList.getKey(EntityGolem.class));\n\t\t\n\t\treturn monsters.next(rand);\n\t}", "public void saveMap(String name){\n\t\tString path = new File (\".\").getAbsolutePath();\n\t\t//System.out.println(path);\n\t\tObjectOutputStream outputStream=null;\n\t\t\n\t\tString fileName=path.concat(\"//Maps//\"+name+\".txt\");\n\t\tFile file = new File(fileName);\n\t\t\n\t\n\t\t\n\t\ttry {\n\t\t\tFileOutputStream fileOutputStream =new FileOutputStream(file);\n\t\t\toutputStream = new ObjectOutputStream(fileOutputStream);\n\t\t\n\t\t\toutputStream.writeInt(getWidth());\n\t\t\toutputStream.writeInt(getHeight());\n\t\t\t\n\t\t\tfor (Path p : temp){\n\t\t\t\toutputStream.writeInt(p.getPos());\n\t\t\t}\n\t\t\toutputStream.writeInt(-1);\n\t\t\t\n\t\t\toutputStream.flush();\n\t\t\toutputStream.close();\n\t\t\tsaveMapName(name);\n\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"Problem opening the file \"+name+\".txt\");\n\t\t\t//e.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Problem with output to file \"+name+\".txt\");\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\n\n\n\t}", "@SuppressWarnings(\"all\")\r\n\tpublic Map(String map, Location mapLocation){\r\n\t\tMapPreset preset = MapPreset.presets.get(map);\r\n\t\tif (preset != null){\r\n\t\t\t\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tfinal World world = mapLocation.getWorld();\r\n\t\t\t\tfinal double x = mapLocation.getX();\r\n\t\t\t\tfinal double y = mapLocation.getY();\r\n\t\t\t\tfinal double z = mapLocation.getZ();\r\n\t\t\t\tfinal float pitch = mapLocation.getPitch();\r\n\t\t\t\tfinal float yaw = mapLocation.getYaw();\r\n\t\t\t\t\t\t\r\n\t\t\t\tfinal Float[] alliesBase = preset.getSpawnAllies();\r\n\t\t\t\tfinal Float[] axisBase = preset.getSpawnAxis();\r\n\t\t\t\t\r\n\t\t\t\tfinal Float[] bombA = preset.getBombA();\r\n\t\t\t\tfinal Float[] bombB = preset.getBombB();\r\n\t\t\t\t\r\n\t\t\t\tfinal Float[] domA = preset.getDomA();\r\n\t\t\t\tfinal Float[] domB = preset.getDomB();\r\n\t\t\t\tfinal Float[] domC = preset.getDomC();\r\n\t\t\t\t\r\n\t\t\t\tmainSpawn = mapLocation;\r\n\t\t\t\talliesSpawn = new Location(\r\n\t\t\t\t\t\tworld, \r\n\t\t\t\t\t\tx + alliesBase[0], \r\n\t\t\t\t\t\ty + alliesBase[1], \r\n\t\t\t\t\t\tz + alliesBase[2],\r\n\t\t\t\t\t\talliesBase[3], \r\n\t\t\t\t\t\talliesBase[4]);\r\n\t\t\t\t\r\n\t\t\t\taxisSpawn = new Location(\r\n\t\t\t\t\t\tworld, \r\n\t\t\t\t\t\tx + axisBase[0], \r\n\t\t\t\t\t\ty + axisBase[1], \r\n\t\t\t\t\t\tz + axisBase[2],\r\n\t\t\t\t\t\taxisBase[3], \r\n\t\t\t\t\t\taxisBase[4]);\r\n\t\t\t\t\r\n\t\t\t\tthis.bombA = new Location(\r\n\t\t\t\t\t\tworld, \r\n\t\t\t\t\t\tx + bombA[0], \r\n\t\t\t\t\t\ty + bombA[1], \r\n\t\t\t\t\t\tz + bombA[2],\r\n\t\t\t\t\t\tbombA[3], \r\n\t\t\t\t\t\tbombA[4]);\r\n\t\t\t\t\r\n\t\t\t\tthis.bombB = new Location(\r\n\t\t\t\t\t\tworld, \r\n\t\t\t\t\t\tx + bombB[0], \r\n\t\t\t\t\t\ty + bombB[1], \r\n\t\t\t\t\t\tz + bombB[2],\r\n\t\t\t\t\t\tbombB[3], \r\n\t\t\t\t\t\tbombB[4]);\r\n\t\t\t\t\r\n\t\t\t\tthis.domA = new Location(\r\n\t\t\t\t\t\tworld, \r\n\t\t\t\t\t\tx + domA[0], \r\n\t\t\t\t\t\ty + domA[1], \r\n\t\t\t\t\t\tz + domA[2],\r\n\t\t\t\t\t\tdomA[3], \r\n\t\t\t\t\t\tdomA[4]);\r\n\t\t\t\t\r\n\t\t\t\tthis.domB = new Location(\r\n\t\t\t\t\t\tworld, \r\n\t\t\t\t\t\tx + domB[0], \r\n\t\t\t\t\t\ty + domB[1], \r\n\t\t\t\t\t\tz + domB[2],\r\n\t\t\t\t\t\tdomB[3], \r\n\t\t\t\t\t\tdomB[4]);\r\n\t\t\t\t\r\n\t\t\t\tthis.domC = new Location(\r\n\t\t\t\t\t\tworld, \r\n\t\t\t\t\t\tx + domC[0], \r\n\t\t\t\t\t\ty + domC[1], \r\n\t\t\t\t\t\tz + domC[2],\r\n\t\t\t\t\t\tdomC[3], \r\n\t\t\t\t\t\tdomC[4]);\r\n\t\t\t\t\r\n\t\t\t\tfor (Float[] spawnpoint : preset.getSpawnpoints()){\r\n\t\t\t\t\tspawnsList.add(new Location(\r\n\t\t\t\t\t\t\tworld, \r\n\t\t\t\t\t\t\tx + spawnpoint[0], \r\n\t\t\t\t\t\t\ty + spawnpoint[1], \r\n\t\t\t\t\t\t\tz + spawnpoint[2], \r\n\t\t\t\t\t\t\tspawnpoint[3], \r\n\t\t\t\t\t\t\tspawnpoint[4]));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tmapID = maps.size()+1;\r\n\t\t\t\tmapName = map;\r\n\t\t\t\tmapAvailable.add(mapID);\r\n\t\t\t\tmaps.put(maps.size()+1, this);\r\n\t\t\t} catch (Exception e){\r\n\t\t\t\tFPSCaste.log(\"Something went wrong! disabling map: \" + map, Level.WARNING);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tFPSCaste.log(\"Could not initialise the Map \" + map, Level.WARNING);\r\n\t\t}\r\n\t}", "public void createMinimap() {\n if (gameField.getFields().size() == 1024) {\n rootSize = 32;\n blockSize = 8;\n } else { //if size == 64^2 == 4096\n rootSize = 64;\n blockSize = 4;\n }\n int magnification = gameFieldController.getMagnification();\n if (AdvancedWarsApplication.getInstance().getGameScreenCon().base.getScene() != null) {\n positionBoxSizeX = blockSize *\n (AdvancedWarsApplication.getInstance().getGameScreenCon().base.getScene().getWidth() / (rootSize * magnification));\n\n positionBoxSizeY = blockSize *\n (AdvancedWarsApplication.getInstance().getGameScreenCon().base.getScene().getHeight() / (rootSize * magnification));\n } else {\n //for offline test\n positionBoxSizeX = (blockSize * 1920) / (rootSize * magnification);\n positionBoxSizeY = (blockSize * 1080) / (rootSize * magnification);\n }\n\n for (int i = 0; i < rootSize; ++i) {\n for (int j = 0; j < rootSize; ++j) {\n Field currentField = gameField.getFields().get(i * rootSize + j);\n Rectangle rectangle = new Rectangle(blockSize, blockSize);\n if (!currentField.getType().equals(\"Grass\")) {\n if (currentField.getType().equals(\"Water\")) {\n rectangle.setFill(Color.rgb(11, 89, 139));\n } else if (currentField.getType().equals(\"Forest\")) {\n rectangle.setFill(Color.rgb(38, 106, 0));\n } else { //if currentField equals Mountain\n rectangle.setFill(Color.rgb(95, 111, 54));\n }\n rectangle.relocate((i * blockSize) + 1, (j * blockSize) + 1);\n drawPane.getChildren().add(rectangle);\n }\n }\n }\n Rectangle rect = new Rectangle(positionBoxSizeX, positionBoxSizeY);\n Rectangle clip = new Rectangle(1, 1, positionBoxSizeX - 2, positionBoxSizeY - 2);\n positionBox = Shape.subtract(rect, clip);\n positionBox.setFill(Color.WHITE);\n drawPane.getChildren().add(positionBox);\n isCreated = true;\n }", "private void setupVariant1TerrainMap() {\n\n\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-4,-4), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-2,-4), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(0,-4), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(2,-4), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(4,-4), TerrainKind.SEA);\n\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-5,-3), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-3,-3), TerrainKind.FIELDS);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-1,-3), TerrainKind.PASTURE);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(1,-3), TerrainKind.HILLS);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(3,-3), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(5,-3), TerrainKind.SEA);\n\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-6,-2), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-4,-2), TerrainKind.FOREST);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-2,-2), TerrainKind.MOUNTAINS);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(0,-2), TerrainKind.BIG_FISHERY);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(2,-2), TerrainKind.PASTURE);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(4,-2), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(6,-2), TerrainKind.SEA);\n\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-7,-1), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-5,-1), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-3,-1), TerrainKind.HILLS);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-1,-1), TerrainKind.PASTURE);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(1,-1), TerrainKind.MOUNTAINS);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(3,-1), TerrainKind.FIELDS);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(5,-1), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(7,-1), TerrainKind.SEA);\n\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-8,0), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-6,0), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-4,0), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-2,0), TerrainKind.FOREST);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(0,0), TerrainKind.FOREST);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(2,0), TerrainKind.PASTURE);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(4,0), TerrainKind.SMALL_FISHERY);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(6,0), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(8,0), TerrainKind.SEA);\n\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-7,1), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-5,1), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-3,1), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-1,1), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(1,1), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(3,1), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(5,1), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(7,1), TerrainKind.SEA);\n\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-8,2), TerrainKind.SMALL_FISHERY);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-6,2), TerrainKind.MOUNTAINS);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-4,2), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-2,2), TerrainKind.GOLDFIELD);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(0,2), TerrainKind.FIELDS);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(2,2), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(4,2), TerrainKind.HILLS);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(6,2), TerrainKind.MOUNTAINS);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(8,2), TerrainKind.SMALL_FISHERY);\n\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-7,3), TerrainKind.SMALL_FISHERY);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-5,3), TerrainKind.PASTURE);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-3,3), TerrainKind.MOUNTAINS);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-1,3), TerrainKind.PASTURE);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(1,3), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(3,3), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(5,3), TerrainKind.GOLDFIELD);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(7,3), TerrainKind.SMALL_FISHERY);\n\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-6,4), TerrainKind.SMALL_FISHERY);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-4,4), TerrainKind.HILLS);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(-2,4), TerrainKind.HILLS);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(0,4), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(2,4), TerrainKind.SEA);\n\t\tvariant1TerrainKindMap.put(getHashCodeofPair(4,4), TerrainKind.FOREST);\n\t}", "TiledMap loadMap(String path);", "private void setUpMap() {\n if (points.size()>2) {\n drawCircle();\n }\n\n\n }", "public abstract void createMap();", "public static void main(String[] args) throws FileNotFoundException {\n\r\n\t\tRandom random = new Random();\r\n\t\tMap<String, String[][]> mapTM = new HashMap<String, String[][]>();\r\n\t\tMap<String, List<String>> map = new HashMap<String, List<String>>();\r\n\r\n\t\tArrayList<String> list1 = new ArrayList<String>();\r\n\t\tlist1.add(\"T\");\r\n\t\tlist1.add(\"E\");\r\n\t\tlist1.add(\"M\");\r\n\t\tlist1.add(\"P\");\r\n\t\tlist1.add(\"C\");\r\n\t\tlist1.add(\"SS\");\r\n\r\n\t\tArrayList<String> list2 = new ArrayList<String>();\r\n\t\tlist2.add(\"T\");\r\n\t\tlist2.add(\"E\");\r\n\t\tlist2.add(\"M\");\r\n\t\tlist2.add(\"P\");\r\n\t\tlist2.add(\"C\");\r\n\t\tlist2.add(\"SS\");\r\n\r\n\t\tArrayList<String> list3 = new ArrayList<String>();\r\n\t\tlist3.add(\"T\");\r\n\t\tlist3.add(\"E\");\r\n\t\tlist3.add(\"M\");\r\n\t\tlist3.add(\"P\");\r\n\t\tlist3.add(\"C\");\r\n\t\tlist3.add(\"SS\");\r\n\t\t\r\n\t\tArrayList<String> list4 = new ArrayList<String>();\r\n\t\tlist4.add(\"T\");\r\n\t\tlist4.add(\"Ex\");\r\n\t\tlist4.add(\"M\");\r\n\t\tlist4.add(\"Px\");\r\n\t\tlist4.add(\"C\");\r\n\t\tlist4.add(\"ScS\");\r\n\r\n\t\tArrayList<String> list5 = new ArrayList<String>();\r\n\t\tlist5.add(\"Tf\");\r\n\t\tlist5.add(\"E\");\r\n\t\tlist5.add(\"M\");\r\n\t\tlist5.add(\"Pd\");\r\n\t\tlist5.add(\"C\");\r\n\t\tlist5.add(\"SS\");\r\n\r\n\t\tArrayList<String> list6 = new ArrayList<String>();\r\n\t\tlist6.add(\"Tf\");\r\n\t\tlist6.add(\"E\");\r\n\t\tlist6.add(\"Mf\");\r\n\t\tlist6.add(\"P\");\r\n\t\tlist6.add(\"Cd\");\r\n\t\tlist6.add(\"SS\");\r\n\r\n\t\tmap.put(\"C1\", list1);\r\n\t\tmap.put(\"C2\", list2);\r\n\t\tmap.put(\"C3\", list3);\r\n\t\tmap.put(\"C4\", list4);\r\n\t\tmap.put(\"C5\", list5);\r\n\t\tmap.put(\"C6\", list6);\r\n\t\t\r\n\t\tList<String> keys = new ArrayList<String>(map.keySet());\r\n\t\tCollections.shuffle(keys);\r\n\r\n\t\tfor (Object string : keys) {\r\n\t\t\tint row = 6;\r\n\t\t\tint column = 8;\r\n\t\t\tint i = 0;\r\n\t\t\tint j = 0;\r\n\t\t\tboolean reset =false;\r\n\t\t\tString[][] stringArray = new String[row][column];\r\n\t\t\tList<String> temp = map.get(string);\r\n\t\t\tCollections.shuffle(temp);\r\n\t\t\tfor (int iterator = 0; iterator < column; iterator++) {\r\n\t\t\t\t\r\n\t\t\t\tif(iterator >= temp.size()){\r\n\t\t\t\t\tint randomInteger = random.nextInt(temp.size());\r\n\t\t\t\t\tstringArray[i][j] = temp.get(randomInteger);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstringArray[i][j] = temp.get(iterator);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfor(Object string01 : keys){\r\n\t\t\t\t\tif(mapTM.get(string01) != null && !string01.equals(string)){\r\n\t\t\t\t\t\tString[][] temp01 = mapTM.get(string01);\r\n\t\t\t\t\t\tif(temp01[i][j] != null && temp01[i][j].equals(stringArray[i][j])){\r\n\t\t\t\t\t\t\tj = 0;\r\n\t\t\t\t\t\t\tCollections.shuffle(temp);\r\n\t\t\t\t\t\t\titerator = -1;\r\n\t\t\t\t\t\t\treset = true;\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\tif(reset){\r\n\t\t\t\t\treset = false;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (j < column && j != column - 1) {\r\n\t\t\t\t\tj++;\r\n\t\t\t\t} else if (j == column - 1 && i != row - 1) {\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\tj = 0;\r\n\t\t\t\t\tCollections.shuffle(temp);\r\n\t\t\t\t\titerator = -1;\r\n\t\t\t\t} else if (j == column - 1 && i == row - 1) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tmapTM.put((String) string, stringArray);\r\n\t\t}\r\n\t\t\r\n\t\tfor (Map.Entry<String, String[][]> entry : mapTM.entrySet()) {\r\n\t\t\tSystem.out.println(entry.getKey());\r\n\t\t\tSystem.out.println(Arrays.deepToString(entry.getValue()));\r\n\t\t}\r\n\r\n\t}", "private void loadMap(String path) {\n\t\ttry {\n\t\t\tfor(Player p : players)\tp.clear();\n\t\t\tmap.players = players;\n\t\t\tmap.setPlayerNumber(playerNumber);\n\t\t\tfor(Player p : map.players) {\n\t\t\t\tp.setMap(map);\n\t\t\t\tp.setArmies(map.getInitialArmiesNumber());\n\t\t\t}\n\t\t\tmap.setPlayerNumber(map.players.size());\n\t\t\tmap.load(path);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n protected void generateTiles() {\n }", "public void initTiles() {\n\t\ttileList.add(new Go());\n\n\t\t// Brown properties\n\t\tProperty mediterranean = new Property(\"Mediterranean\");\n\t\tProperty balticAve = new Property(\"Baltic Avenue\");\n\n\t\t// Light blue properties\n\t\tProperty orientalAve = new Property(\"Oriental Avenue\");\n\t\tProperty vermontAve = new Property(\"Vermont Avenue\");\n\t\tProperty connecticutAve = new Property(\"Connecticut Avenue\");\n\n\t\t// Magenta properties\n\t\tProperty stCharles = new Property(\"St. Charles Place\");\n\t\tProperty statesAve = new Property(\"States Avenue\");\n\t\tProperty virginiaAve = new Property(\"Virginia Avenue\");\n\n\t\t// Orange properties\n\t\tProperty stJames = new Property(\"St. James Place\");\n\t\tProperty tennesseeAve = new Property(\"Tennessee Avenue\");\n\t\tProperty newYorkAve = new Property(\"New York Avenue\");\n\n\t\t// Red properties\n\t\tProperty kentuckyAve = new Property(\"Kentucky Avenue\");\n\t\tProperty indianaAve = new Property(\"Indiana Avenue\");\n\t\tProperty illinoisAve = new Property(\"Illinois Avenue\");\n\n\t\t// Yellow Properties\n\t\tProperty atlanticAve = new Property(\"Atlantic Avenue\");\n\t\tProperty ventnorAve = new Property(\"Ventnor Avenue\");\n\t\tProperty marvinGard = new Property(\"Marvin Gardins\");\n\n\t\t// Green Properties\n\t\tProperty pacificAve = new Property(\"Pacific Avenue\");\n\t\tProperty northCar = new Property(\"North Carolina Avenue\");\n\t\tProperty pennsylvannia = new Property(\"Pennsylvania Avenue\");\n\n\t\t// Dark blue properties\n\t\tProperty parkPlace = new Property(\"Park Place\");\n\t\tProperty boardWalk = new Property(\"Boardwalk\");\n\n\t\t// Tax tiles\n\t\tTaxTile incomeTax = new TaxTile(\"Income Tax\", 200);\n\t\tTaxTile luxuryTax = new TaxTile(\"Luxury Tax\", 100);\n\n\t\t// Utilities\n\t\tUtility electric = new Utility(\"Electric Company\");\n\t\tUtility water = new Utility(\"Water Works\");\n\n\t\t// Railroads\n\t\tRailroad reading = new Railroad(\"Reading\");\n\t\tRailroad pennRail = new Railroad(\"Pennsylvania\");\n\t\tRailroad bno = new Railroad(\"B & O\");\n\t\tRailroad shortLine = new Railroad(\"Short Line\");\n\n\t\t// Chance and community chest\n\t\tChance chance = new Chance();\n\t\tCommunity chest = new Community();\n\n\t\t// Adds the properties by color in accordance with their position on the board\n\t\t// adds color + placement of piece to a list of their respective colors\n\t\tbrown.add(1);\n\t\tbrown.add(3);\n\t\trailroads.add(5);\n\t\tlightBlue.add(6);\n\t\tlightBlue.add(8);\n\t\tlightBlue.add(9);\n\t\tmagenta.add(11);\n\t\tutilities.add(12);\n\t\tmagenta.add(13);\n\t\tmagenta.add(14);\n\t\trailroads.add(15);\n\t\torange.add(16);\n\t\torange.add(18);\n\t\torange.add(19);\n\t\tred.add(21);\n\t\tred.add(23);\n\t\tred.add(24);\n\t\trailroads.add(25);\n\t\tyellow.add(26);\n\t\tyellow.add(27);\n\t\tutilities.add(28);\n\t\tyellow.add(29);\n\t\tgreen.add(31);\n\t\tgreen.add(32);\n\t\tgreen.add(34);\n\t\trailroads.add(35);\n\t\tdarkBlue.add(37);\n\t\tdarkBlue.add(39);\n\n\t\t// tileList is the list of tiles of the board where each tile is representative of a place on the board\n\t\t// adds each tile is chronological order beginning of the board \"go\"\n\t\t//this list includes: properties, taxes, railroads, chance, community chest\n\t\t\n\t\ttileList.add(new Go());\n\n\t\ttileList.add(mediterranean);\n\t\ttileList.add(chest);\n\t\ttileList.add(balticAve);\n\t\ttileList.add(incomeTax);\n\t\ttileList.add(reading);\n\t\ttileList.add(orientalAve);\n\t\ttileList.add(chance);\t\n\t\ttileList.add(vermontAve);\n\t\ttileList.add(connecticutAve);\n\n\t\ttileList.add(new Jail());\n\t\t\t\n\t\ttileList.add(stCharles);\n\t\ttileList.add(electric);\t\t\t\n\t\ttileList.add(statesAve);\t\t\t\n\t\ttileList.add(virginiaAve);\n\t\ttileList.add(pennRail);\n\t\ttileList.add(stJames);\t\n\t\ttileList.add(chest);\n\t\ttileList.add(tennesseeAve);\t\t\t\n\t\ttileList.add(newYorkAve);\n\n\t\ttileList.add(new FreeParking());\n\t\t\t\n\t\ttileList.add(kentuckyAve);\t\t\n\t\ttileList.add(chance);\t\n\t\ttileList.add(indianaAve);\t\t\t\n\t\ttileList.add(illinoisAve);\n\t\ttileList.add(bno);\n\t\ttileList.add(atlanticAve);\t\t\t\n\t\ttileList.add(ventnorAve);\n\t\ttileList.add(water);\n\t\ttileList.add(marvinGard);\n\n\t\ttileList.add(new GoToJail());\n\t\t\t\t\t\n\t\ttileList.add(pacificAve);\t\t\t\n\t\ttileList.add(northCar);\n\t\ttileList.add(chest);\t\t\t\n\t\ttileList.add(pennsylvannia);\n\t\ttileList.add(shortLine);\n\t\ttileList.add(chance);\n\t\ttileList.add(parkPlace);\n\t\ttileList.add(luxuryTax);\n\t\ttileList.add(boardWalk);\n\t}", "public void drawMap() {\n\t\tRoad[] roads = map.getRoads();\r\n\t\tfor (Road r : roads) {\r\n\t\t\tif (r.turn) {\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road = true;\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_vert = true;\r\n\t\t\t} else if (r.direction == Direction.NORTH)\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_north = true;\r\n\t\t\telse if (r.direction == Direction.SOUTH)\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_south = true;\r\n\t\t\telse if (r.direction == Direction.WEST)\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_west = true;\r\n\t\t\telse if (r.direction == Direction.EAST)\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_east = true;\r\n\t\t\ttry {\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].updateImage();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void spawnTrees() {\n int spawnNum = this.random.nextInt(10) + 20;\n if (this.treeTiles.size() >= 30) { // max 30 trees\n spawnNum = 0;\n }\n for (int i = 0; i < spawnNum; i++) {\n String tree = trees[this.random.nextInt(trees.length)];\n int y = this.random.nextInt(this.getMap().length);\n Tile spawnTile = this.getMapAt(this.random.nextInt(this.getMap()[y].length), y);\n Tile centerTile;\n if ((spawnTile != null) && this.inMap(spawnTile.getX()-2, spawnTile.getY()-1)) {\n centerTile = this.getMapAt(spawnTile.getX()-2, spawnTile.getY()-1);\n } else {\n centerTile = null;\n }\n if ((spawnTile != null) && (spawnTile instanceof GroundTile)\n && (centerTile != null) && (centerTile instanceof GroundTile)\n && (spawnTile.getContent() == null)) {\n ExtrinsicTree newTree = new ExtrinsicTree(tree);\n newTree.setStage(17);\n spawnTile.setContent(newTree);\n this.treeTiles.add(spawnTile);\n }\n }\n }", "@SuppressWarnings(\"unchecked\")\r\n private void newMap() throws IOException, ClassNotFoundException {\r\n this.music_map.clear();\r\n if (needNewMap()) {\r\n if (!save_file.exists()) {\r\n System.out.println(\"DIZIONARIO NON PRESENTE\");\r\n System.out.println(\"CREAZIONE NUOVO DIZIONARIO IN CORSO...\");\r\n\r\n this.setTarget();\r\n\r\n this.recoursiveMapCreation(this.music_root);\r\n this.saveMap();\r\n } else {\r\n System.out.println(\"DIZIONARIO NON AGGIORNATO\");\r\n if (!UtilFunctions.newDictionaryRequest(this.save_file, this.music_root)) {\r\n System.out.println(\"AGGIORNAMENTO DIZIONARIO RIFIUTATO\");\r\n FileInputStream f = new FileInputStream(this.save_file);\r\n ObjectInputStream o = new ObjectInputStream(f);\r\n this.music_map.putAll((Map<String, String[]>) o.readObject());\r\n current.set(ProgressDialog.TOTAL.get());\r\n } else {\r\n System.out.println(\"CREAZIONE NUOVO DIZIONARIO IN CORSO...\");\r\n this.setTarget();\r\n this.recoursiveMapCreation(this.music_root);\r\n this.saveMap();\r\n }\r\n }\r\n } else {\r\n System.out.println(\"DIZIONARIO GIA' PRESENTE\");\r\n FileInputStream f = new FileInputStream(this.save_file);\r\n ObjectInputStream o = new ObjectInputStream(f);\r\n this.music_map.putAll((Map<String, String[]>) o.readObject());\r\n current.set(ProgressDialog.TOTAL.get());\r\n }\r\n }", "private static Map<DiscreteState,Double> createMap(int vectSize, int mapSize) {\n\t\tMap<DiscreteState,Double> map = new HashMap<DiscreteState,Double>();\n\t\tint n = (int) Math.min(mapSize, Math.pow(2, vectSize));\n\t\twhile (map.size() < n) {\n\t\t\tdouble[] addition = new double[vectSize];\n\t\t\tfor (int i = 0; i < vectSize; i++) addition[i] = Math.round(Math.random());\n\t\t\tmap.put(new DiscreteState(addition), Math.random());\n\t\t}\n\t\treturn map;\n\t}", "public Map<String, Kingdom> generateAllRulers() {\n Map<String, String> kingdomWithAnimal;\n kingdomWithAnimal = kingdomRepository.getRulersWithAnimal();\n Map<String, Kingdom> kingdoms = new HashMap<>();\n for (String emblem : kingdomWithAnimal.keySet()) {\n Kingdom kingdom = new Kingdom(emblem, kingdomWithAnimal.get(emblem));\n kingdom.makeCipherFromAnimalName();\n kingdoms.put(emblem, kingdom);\n }\n return kingdoms;\n }", "private void createRandomGame() {\n ArrayList<int[]> usedCoordinates = new ArrayList<>();\n\n // make sure the board is empty\n emptyBoard();\n\n //find different coordinates\n while (usedCoordinates.size() < 25) {\n int[] temp = new int[]{randomNumberGenerator.generateInteger(size), randomNumberGenerator.generateInteger(size)};\n\n // default contains(arraylist) doesn't work because it compares hashcodes\n if (! contains(usedCoordinates, temp)) {\n usedCoordinates.add(temp);\n }\n }\n\n for (int[] usedCoordinate : usedCoordinates) {\n board.setSquare(usedCoordinate[0], usedCoordinate[1], randomNumberGenerator.generateInteger(size) + 1);\n }\n\n //save start locations\n startLocations = usedCoordinates;\n }", "private void drawShapes() {\n\n // get a polygon shape object\n SKPolygon polygon = new SKPolygon();\n // set the polygon's nodes\n List<SKCoordinate> nodes = new ArrayList<SKCoordinate>();\n nodes.add(new SKCoordinate(-122.4342, 37.7765));\n nodes.add(new SKCoordinate(-122.4141, 37.7765));\n nodes.add(new SKCoordinate(-122.4342, 37.7620));\n polygon.setNodes(nodes);\n // set the outline size\n polygon.setOutlineSize(3);\n // set colors used to render the polygon\n polygon.setOutlineColor(new float[]{1f, 0f, 0f, 1f});\n polygon.setColor(new float[]{1f, 0f, 0f, 0.2f});\n // render the polygon on the map\n mapView.addPolygon(polygon);\n\n // get a circle mask shape object\n SKCircle circleMask = new SKCircle();\n // set the shape's mask scale\n circleMask.setMaskedObjectScale(1.3f);\n // set the colors\n circleMask.setColor(new float[]{1f, 1f, 0.5f, 0.67f});\n circleMask.setOutlineColor(new float[]{0f, 0f, 0f, 1f});\n circleMask.setOutlineSize(3);\n // set circle center and radius\n circleMask.setCircleCenter(new SKCoordinate(-122.4200, 37.7665));\n circleMask.setRadius(300);\n // set outline properties\n circleMask.setOutlineDottedPixelsSkip(6);\n circleMask.setOutlineDottedPixelsSolid(10);\n // set the number of points for rendering the circle\n circleMask.setNumberOfPoints(150);\n // render the circle mask\n mapView.addCircle(circleMask);\n\n\n // get a polyline object\n SKPolyline polyline = new SKPolyline();\n // set the nodes on the polyline\n nodes = new ArrayList<SKCoordinate>();\n nodes.add(new SKCoordinate(-122.4342, 37.7898));\n nodes.add(new SKCoordinate(-122.4141, 37.7898));\n nodes.add(new SKCoordinate(-122.4342, 37.7753));\n polyline.setNodes(nodes);\n // set polyline color\n polyline.setColor(new float[]{0f, 0f, 1f, 1f});\n // set properties for the outline\n polyline.setOutlineColor(new float[]{0f, 0f, 1f, 1f});\n polyline.setOutlineSize(4);\n polyline.setOutlineDottedPixelsSolid(3);\n polyline.setOutlineDottedPixelsSkip(3);\n mapView.addPolyline(polyline);\n }", "public HashMap<String, Integer> play(){\n\t\t\n\t\tHashMap<String, Integer> result = new HashMap<String, Integer>();\n\t\tint gamesRandom = 0;\n\t\tint gamesDefault = 0;\n\t\tint draws = 0;\n\t\t\n\t\tfor(int i=1; i<= 100; i++){\n\t\t\tString shape = getRandomShape();\n\t\t\tint winner = getWinner(Shape.valueOf(shape));\n\t\t\tif(winner == RANDOM_PLAYER_INT){\n\t\t\t\tgamesRandom++;\n\t\t\t}\n\t\t\telse if(winner == DEFAULT_PLAYER_INT){\n\t\t\t\tgamesDefault++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tdraws++;\n\t\t\t}\n\t\t\ttrackGame(shape, i);\n\t\t}\n\t\tresult.put(RANDOM_PLAYER_STR, gamesRandom);\n\t\tresult.put(DEFAULT_PLAYER_STR, gamesDefault);\n\t\tresult.put(DRAW_STR, draws);\n\t\tprintResult(result);\n\t\treturn result;\n\t}", "public void generateLevel() {\n\t\tfor (int y = 0; y < this.height; y++) {\n\t\t\tfor (int x = 0; x < this.width; x++) {\n\t\t\t\tif (x * y % 10 < 5)\n\t\t\t\t\ttiles[x + y * width] = Tile.GRASS.getId();\n\t\t\t\telse\n\t\t\t\t\ttiles[x + y * width] = Tile.STONE.getId();\n\t\t\t}\n\t\t}\n\t}", "public static void createDeviceMap() {\n\t\ttry {\n\t\t\tSmapStreamList sat = new SmapStreamList();\n\t\t\tMap<String, SmapDevice> saMap = sat.convertToSADevices();\n\t\t\tFileWriter fw = new FileWriter(device_map_file);\t\t\t\n\t\t\tString json = sat.gson.toJson(saMap);\n\t\t\tfw.write(json);\n\t\t\tfw.close();\n\t\t\trenderText(json);\n\t\t} catch (Exception e) {\n\t\t\trenderText(e);\n\t\t}\n\t}", "public Tile[] generate() {\n Tile[] tiles = generateTiles();\n calculatePathfindingGrid(tiles);\n return tiles;\n }", "public void findRandomPath() {\n\n int length = this.alphabet.length; // # char in alpha\n char letter;\n // numStates++; //starting at 2 because this is the next state in the\n // memory for the episodes\n\n do {\n numStates++;\n letter = randomChar(length);\n sensor = this.env.tick(letter); // updates sensor\n // encode sensors to make into an episode to store in memory\n int encodedSensorValue = encodeSensors(sensor);\n episodicMemory.add(new Episode(letter, encodedSensorValue,\n numStates));\n\n } while (!sensor[IS_GOAL]);\n }", "public void buildMap(){\n map =mapFactory.createMap(level);\n RefLinks.SetMap(map);\n }", "@Override\n\tprotected void generateTiles() {\n\t}", "public void createWall() { // make case statement?\n\t\tRandom ran = new Random();\n\t\tint range = 6 - 1 + 1; // max - min + min\n\t\tint random = ran.nextInt(range) + 1; // add min\n\n\t\t//each wall is a 64 by 32 chunk \n\t\t//which stack to create different structures.\n\t\t\n\t\tWall w; \n\t\tPoint[] points = new Point[11];\n\t\tpoints[0] = new Point(640, -32);\n\t\tpoints[1] = new Point(640, 0);\n\t\tpoints[2] = new Point(640, 32); // top\n\t\tpoints[3] = new Point(640, 384);\n\t\tpoints[4] = new Point(640, 416);\n\n\t\tif (random == 1) {\n\t\t\tpoints[5] = new Point(640, 64);\n\t\t\tpoints[6] = new Point(640, 96);\n\t\t\tpoints[7] = new Point(640, 128); // top\n\t\t\tpoints[8] = new Point(640, 288);\n\t\t\tpoints[9] = new Point(640, 320);\n\t\t\tpoints[10] = new Point(640, 352); // bottom\n\t\t} else if (random == 2) {\n\t\t\tpoints[5] = new Point(640, 64);\n\t\t\tpoints[6] = new Point(640, 96); // top\n\t\t\tpoints[7] = new Point(640, 256);\n\t\t\tpoints[8] = new Point(640, 288); // bottom\n\t\t\tpoints[9] = new Point(640, 320);\n\t\t\tpoints[10] = new Point(640, 352); // bottom\n\t\t} else if (random == 3) {\n\t\t\tpoints[5] = new Point(640, 64);\n\t\t\tpoints[6] = new Point(640, 96);\n\t\t\tpoints[7] = new Point(640, 128); // top\n\t\t\tpoints[8] = new Point(640, 160);\n\t\t\tpoints[9] = new Point(640, 192); // top\n\t\t\tpoints[10] = new Point(640, 352); // bottom\n\t\t} else if (random == 4) {\n\t\t\tpoints[5] = new Point(640, 64);\n\t\t\tpoints[6] = new Point(640, 96);\n\t\t\tpoints[7] = new Point(640, 128); // top\n\t\t\tpoints[8] = new Point(640, 160);\n\t\t\tpoints[9] = new Point(640, 192);\n\t\t\tpoints[10] = new Point(640, 224); // top\n\t\t} else if (random == 5) {\n\t\t\tpoints[5] = new Point(640, 64); // top\n\t\t\tpoints[6] = new Point(640, 224);\n\t\t\tpoints[7] = new Point(640, 256);\n\t\t\tpoints[8] = new Point(640, 288); // bottom\n\t\t\tpoints[9] = new Point(640, 320);\n\t\t\tpoints[10] = new Point(640, 352); // bottom\n\t\t} else if (random == 6) {\n\t\t\tpoints[5] = new Point(640, 192);\n\t\t\tpoints[6] = new Point(640, 224);\n\t\t\tpoints[7] = new Point(640, 256); // bottom\n\t\t\tpoints[8] = new Point(640, 288);\n\t\t\tpoints[9] = new Point(640, 320);\n\t\t\tpoints[10] = new Point(640, 352); // bottom\n\t\t}\n\n\t\tfor (int i = 0; i < points.length; i++) { // adds walls\n\t\t\tw = new Wall();\n\t\t\tw.setBounds(new Rectangle(points[i].x, points[i].y, 64, 32));\n\t\t\twalls.add(w);\n\t\t}\n\t\tWall c; // adds a single checkpoint\n\t\tc = new Wall();\n\t\tcheckPoints.add(c);\n\t\tc.setBounds(new Rectangle(640, 320, 32, 32));\n\t}", "public Map<T, V> populateMap() {\n Map<T, V> map = new HashMap<>();\n for (int i = 0; i < entryNumber; i++) {\n cacheKeys[i] = (T) Integer.toString(random.nextInt(1000000000));\n String key = cacheKeys[i].toString();\n map.put((T) key, (V) Integer.toString(random.nextInt(1000000000)));\n }\n return map;\n }", "public void cargarGameScreenTiled() {\n\n musicaTiled = get(rutaMusica, Music.class);\n musicaTiled.setLooping(true);\n platMusicInGame();\n\n TextureAtlas atlas = get(atlasTiledStuff, TextureAtlas.class);\n tiledMap = get(rutaTiled, TiledMap.class);\n\n SkeletonJson json = new SkeletonJson(atlas);\n json.setScale(.01f);\n ponySkeletonData = json.readSkeletonData(Gdx.files.internal(\"data/animaciones/personajes.json\"));\n // ponySkeletonData = json.readSkeletonData(Gdx.files.internal(\"data/animaciones/characters.json\"));\n json.setScale(.004f);\n skeletonBombData = json.readSkeletonData(Gdx.files.internal(\"data/animaciones/bombs.json\"));\n bombAnim = skeletonBombData.findAnimation(\"b1\");\n bombExAnim = skeletonBombData.findAnimation(\"b2x\");\n\n json.setScale(.005f);\n skeletonMonedaData = json.readSkeletonData(Gdx.files.internal(\"data/animaciones/coin.json\"));\n monedaAnim = skeletonMonedaData.findAnimation(\"normal\");\n monedaTomadaAnim = skeletonMonedaData.findAnimation(\"plus1\");\n\n json.setScale(.009f);\n chileSkeletonData = json.readSkeletonData(Gdx.files.internal(\"data/animaciones/chile.json\"));\n chileAnim = chileSkeletonData.findAnimation(\"normal\");\n chileTomadaAnim = chileSkeletonData.findAnimation(\"toospicy\");\n\n json.setScale(.009f);\n globoSkeletonData = json.readSkeletonData(Gdx.files.internal(\"data/animaciones/ballons.json\"));\n globoAnim = globoSkeletonData.findAnimation(\"normal\");\n globoTomadaAnim = globoSkeletonData.findAnimation(\"plus5\");\n\n json.setScale(.009f);\n dulceSkeletonData = json.readSkeletonData(Gdx.files.internal(\"data/animaciones/chocolate.json\"));\n dulceAnim = dulceSkeletonData.findAnimation(\"normal\");\n dulceTomadaAnim = dulceSkeletonData.findAnimation(\"speedup\");\n\n medallaPrimerLugar = atlas.findRegion(\"imagenes/podio/1stplacetrophy\");\n medallaSegundoLugar = atlas.findRegion(\"imagenes/podio/2ndplace\");\n medallaTercerLugar = atlas.findRegion(\"imagenes/podio/3rdplace\");\n congratulations = atlas.findRegion(\"imagenes/podio/congratulations\");\n youLose = atlas.findRegion(\"imagenes/podio/youlose\");\n timeUp = atlas.findRegion(\"imagenes/podio/timeup\");\n\n // json.setScale(.003f);\n // SkeletonData fuegoSkeletonData = json.readSkeletonData(Gdx.files.internal(\"data/animaciones/bombs.json\"));\n // fuegoAnim = fuegoSkeletonData.findAnimation(\"firedancing\");\n // fuegoSkeleton = new Skeleton(fuegoSkeletonData);\n\n json.setScale(.01f);\n SkeletonData fondoSkeletonData = json.readSkeletonData(Gdx.files.internal(\"data/animaciones/background.json\"));\n fondoAnim = fondoSkeletonData.findAnimation(\"animation\");\n fondoSkeleton = new Skeleton(fondoSkeletonData);\n\n //\n // json.setScale(.011f);\n // SkeletonData fogataSkeletonData = json.readSkeletonData(Gdx.files.internal(\"data/animaciones/fogata.json\"));\n // fogataAnim = fogataSkeletonData.findAnimation(\"fogata\");\n // fogataSkeleton = new Skeleton(fogataSkeletonData);\n //\n // json.setScale(.005f);\n // SkeletonData plumaSkeletonData = json.readSkeletonData(Gdx.files.internal(\"data/animaciones/feather.json\"));\n // plumaAnim = plumaSkeletonData.findAnimation(\"pluma\");\n // plumaSkeleton = new Skeleton(plumaSkeletonData);\n //\n // json.setScale(.011f);\n // SkeletonData bloodStoneSkeletonData = json.readSkeletonData(Gdx.files.internal(\"data/animaciones/bloodstone.json\"));\n // bloodStoneAnim = bloodStoneSkeletonData.findAnimation(\"animation\");\n // bloodStoneSkeleton = new Skeleton(bloodStoneSkeletonData);\n //\n // SkeletonData bloodStone2SkeletonData = json.readSkeletonData(Gdx.files.internal(\"data/animaciones/bloodstones.json\"));\n // bloodStone2Anim = bloodStone2SkeletonData.findAnimation(\"glow1\");\n // bloodStone2Skeleton = new Skeleton(bloodStone2SkeletonData);\n\n fondo = atlas.findRegion(\"imagenes/fondo\");\n\n padIzq = new NinePatchDrawable(new NinePatch(atlas.findRegion(\"Interfaz/pad_izq\")));\n padDer = new NinePatchDrawable(new NinePatch(atlas.findRegion(\"Interfaz/pad_derecha\")));\n btBombaDown = new NinePatchDrawable(new NinePatch(atlas.findRegion(\"Interfaz/bombasalpresionar\")));\n btBombaUp = new NinePatchDrawable(new NinePatch(atlas.findRegion(\"Interfaz/bombasinpresionar\")));\n\n btJumpDown = new NinePatchDrawable(new NinePatch(atlas.findRegion(\"Interfaz/saltoalpresionar\")));\n btJumpUp = new NinePatchDrawable(new NinePatch(atlas.findRegion(\"Interfaz/saltosinpresionar\")));\n // btTroncoUp = new NinePatchDrawable(new NinePatch(atlas.findRegion(\"Interfaz/botontroncosinpresionar\")));\n // btTroncoDown = new NinePatchDrawable(new NinePatch(atlas.findRegion(\"Interfaz/botontroncopresionado\")));\n\n btTroncoUp = new NinePatchDrawable(new NinePatch(atlas.findRegion(\"Interfaz/btPlatanoTachuelas\")));\n btTroncoDown = new NinePatchDrawable(new NinePatch(atlas.findRegion(\"Interfaz/btPlatanoTachuelasPresionado\")));\n\n btPauseUp = new NinePatchDrawable(new NinePatch(atlas.findRegion(\"Interfaz/pause\")));\n\n indicador = atlas.findRegion(\"Interfaz/indicador\");\n indicadorCloud = atlas.findRegion(\"Interfaz/icono000\");\n indicadorCientifico = atlas.findRegion(\"Interfaz/icono001\");\n indicadorMinion = atlas.findRegion(\"Interfaz/icono002\");\n indicadorNatylol = atlas.findRegion(\"Interfaz/icono003\");\n indicadorLighthingAlba = atlas.findRegion(\"Interfaz/icono004\");\n indicadorIgnis = atlas.findRegion(\"Interfaz/icono005\");\n\n perfilRegionCloud = atlas.findRegion(\"perfiles/cloud\");\n perfilRegionNatylol = atlas.findRegion(\"perfiles/natylol\");\n perfilRegionIgnis = atlas.findRegion(\"perfiles/ignis\");\n perfilRegionCientifico = atlas.findRegion(\"perfiles/scientist\");\n perfilRegionLAlba = atlas.findRegion(\"perfiles/lightingalba\");\n perfilRegionEnemigo = atlas.findRegion(\"perfiles/enemy\");\n\n lugaresMarco = atlas.findRegion(\"Interfaz/lugares\");\n\n moneda = atlas.findRegion(\"moneda\");\n\n tronco = atlas.findRegion(\"tachuelas\");\n tachuelas = atlas.findRegion(\"tachuelas\");\n platano = atlas.findRegion(\"platano\");\n\n pickCoin = get(\"data/musica/coin.mp3\");\n jump = get(\"data/musica/salto.mp3\");\n }", "public static final Triple<List<DirectedGraphNode>,\n DirectedGraphWeightFunction,\n CoordinateMap> getRandomGraph(\n int size,\n float elf,\n Random r,\n HeuristicFunction f) {\n ArrayList<DirectedGraphNode> graph =\n new ArrayList<DirectedGraphNode>(size);\n DirectedGraphWeightFunction w = new DirectedGraphWeightFunction();\n CoordinateMap m = new CoordinateMap(2, size);\n\n for (int i = 0; i < size; ++i) {\n DirectedGraphNode u = new DirectedGraphNode(\"\" + i);\n graph.add(u);\n m.put(u, getRandomCoordinates(2, r, 1000));\n }\n\n for (int i = 0; i < size; ++i) {\n for (int j = 0; j < size; ++j) {\n if (r.nextFloat() < elf) {\n graph.get(i).addChild(graph.get(j));\n w.put(graph.get(i),\n graph.get(j),\n 1.5 * f.get(m.get(graph.get(i)),\n m.get(graph.get(j))));\n }\n }\n }\n\n for (int i = 0; i < size - 1; ++i) {\n graph.get(i).addChild(graph.get(i + 1));\n w.put(graph.get(i),\n graph.get(i + 1),\n 1.5 * f.get(m.get(graph.get(i)),\n m.get(graph.get(i + 1))));\n }\n\n graph.get(size - 1).addChild(graph.get(0));\n w.put(graph.get(size - 1),\n graph.get(0),\n 1.5 * f.get(m.get(graph.get(size - 1)),\n m.get(graph.get(0))));\n\n return new Triple<List<DirectedGraphNode>,\n DirectedGraphWeightFunction,\n CoordinateMap>(graph, w, m);\n\n }", "public static void loadTiles() {\n\t\tTILE_SETS.put(\"grass\", TileSet.loadTileSet(\"plains\"));\n\t}", "public MSGeneratorMap(int size,double entropy){\n this.SIZE=size;\n this.board=initBoard();\n this.NUMBOMBS = (int)Math.floor(entropy*SIZE*SIZE);\n }", "private static void createMap()\r\n {\r\n position = new String[8][8];\r\n for(int i=0;i<8;i++)\r\n {\r\n int z=0;\r\n for(int j=72;j>=65;j--)\r\n {\r\n position[i][z]=(char)j+\"\"+(i+1); //uses ascii char placement for letters\r\n z++;\r\n }\r\n }\r\n \r\n }", "public List<ImageResourceWrapper> getMap() {\n // Declare a new list to hold the rendering info for the physics objects.\n List<ImageResourceWrapper> rtrnResources = new ArrayList<>();\n for(PhysicsEntity physicsEntity : this.physModel.getEntities()) {\n // Get the graphics entity corresponding to the current physics entity.\n GraphicsEntity graphicsEntity = this.graphModel.getEntityByID(physicsEntity.getId());\n String imgResource = graphicsEntity.getImgResId(physicsEntity.getOrientation());\n rtrnResources.add(new ImageResourceWrapper(new Point(physicsEntity.getPosition().x, physicsEntity.getPosition().y), imgResource));\n }\n for(Objective objective : this.gameStateModel.getObjectives()) {\n GraphicsEntity graphicsEntity = this.graphModel.getEntityByID(objective.getId());\n // TODO: Orientation for objectives\n String imgResource = graphicsEntity.getImgResId(0);\n rtrnResources.add(new ImageResourceWrapper(new Point(objective.getPosition().x, objective.getPosition().y), imgResource));\n }\n return rtrnResources;\n }", "public void buildEmptyMap() {\n this.emptyMap = new BufferedImage(this.boulderDashModel.getArea().getDimensionWidth() * zoom, this.boulderDashModel.getArea().getDimensionHeight() * zoom, BufferedImage.TYPE_INT_RGB);\n final Graphics2D graphics = (Graphics2D) this.emptyMap.getGraphics();\n graphics.drawImage(this.boulderDashModel.getArea().getImage(), 0, 0, this.boulderDashModel.getArea().getDimensionWidth() * zoom, this.boulderDashModel.getArea().getDimensionHeight() * zoom, null);\n }" ]
[ "0.6740716", "0.6607893", "0.65881026", "0.6515128", "0.6496061", "0.6288699", "0.6204378", "0.6184032", "0.61786467", "0.6134924", "0.6091407", "0.6022559", "0.6002087", "0.5992427", "0.5919591", "0.59158456", "0.59102166", "0.5898555", "0.58251506", "0.5812399", "0.5798577", "0.5794153", "0.5792487", "0.5782849", "0.576579", "0.5754719", "0.5728287", "0.57165545", "0.5703231", "0.56962264", "0.56626046", "0.56297666", "0.5629754", "0.56035787", "0.5593099", "0.5567366", "0.5560688", "0.5545556", "0.553824", "0.55336756", "0.5520547", "0.55128604", "0.55079865", "0.55027807", "0.5471026", "0.5470815", "0.5470179", "0.5467447", "0.5464603", "0.54636925", "0.54633045", "0.5440177", "0.5437547", "0.5433255", "0.54322886", "0.542003", "0.541239", "0.5400722", "0.5379941", "0.53727806", "0.53694326", "0.5369278", "0.536908", "0.5365945", "0.535595", "0.5351672", "0.5333714", "0.5333181", "0.5331342", "0.5323467", "0.5310262", "0.53078324", "0.5299732", "0.52764106", "0.52756435", "0.5273087", "0.5272689", "0.5253238", "0.52407444", "0.5238379", "0.5236694", "0.5236503", "0.52346367", "0.52308464", "0.5216483", "0.52159286", "0.5202685", "0.5201557", "0.5196197", "0.51922125", "0.51852024", "0.51837635", "0.51806664", "0.5177858", "0.5174423", "0.5162604", "0.5160155", "0.51580596", "0.5157228", "0.5153272" ]
0.7712257
0
Creates new form ticket
public ticket() { initComponents(); this.mostrar(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@PostMapping(value=\"/create\")\n\tpublic Ticket creatTicket(@RequestBody Ticket ticket){\n\t\treturn ticketBookingService.createTicket(ticket);\n\t}", "int createTicket(Ticket ticket, int userId);", "@Override\n\tpublic int createTicket(Booking_ticket bt) {\n\t\treturn btr.createTicket(bt);\n\t}", "public static void createTicket(Ticket ticket) {\n try {\n Connection conn = Main.conn;\n PreparedStatement statement = conn.prepareStatement(\"INSERT INTO bs_tickets (username, admin, status, question, server, date_created, date_accepted, date_resolved) VALUES (?, ?, ?, ?, ?, ?, ?, ?)\");\n\n statement.setString(1, ticket.username);\n statement.setString(2, ticket.admin);\n statement.setString(3, ticket.status);\n statement.setString(4, ticket.question);\n statement.setString(5, ticket.server);\n statement.setInt(6, ticket.date_created);\n statement.setInt(7, ticket.date_accepted);\n statement.setInt(8, ticket.date_resolved);\n\n statement.executeUpdate();\n }\n catch (SQLException e) {\n e.printStackTrace();\n }\n }", "@PostMapping(\"/tickets\")\n @Timed\n public ResponseEntity<Ticket> createTicket(@Valid @RequestBody Ticket ticket) throws URISyntaxException {\n log.debug(\"REST request to save Ticket : {}\", ticket);\n if (ticket.getId() != null) {\n throw new BadRequestAlertException(\"A new ticket cannot already have an ID\", ENTITY_NAME, \"idexists\");\n }\n Ticket result = ticketRepository.save(ticket);\n return ResponseEntity.created(new URI(\"/api/tickets/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))\n .body(result);\n }", "public ticket() {\n initComponents();\n autoID();\n }", "@Override\n\tpublic void createTicket(TicketData request , StreamObserver<TicketData> responseObserver) {\n\t\tSystem.out.println(\"Requested to store a new Ticket\");\n\n\t\tTicket t = SimpleTicketStore.CreateTicket(\n\t\t\t\trequest.getReporter()\n\t\t\t\t,request.getTopic()\n\t\t\t\t,de.uniba.rz.entities.Status.values()[request.getStatusValue()]\n\t\t\t\t\t\t,request.getDescription()\n\t\t\t\t\t\t,de.uniba.rz.entities.Type.values()[request.getTypeValue()]\n\t\t\t\t\t\t\t\t,Priority.values()[request.getPriorityValue()]\n\t\t\t\t);\n\n\t\tTicketData tdata = Ticket2TicketData(t);\n\n\t\tresponseObserver.onNext(tdata);\n\t\tresponseObserver.onCompleted();\n\n\t}", "Ticket(int id)//Instanciacion del constructor de la clase con sus respectivos parametros.\r\n {\r\n ticketID=id;//inicializacion de atributo de la clase con los parametros recibidos en el constructor.\r\n }", "public Tickets createTicket(Users user) {\n Tickets tickets = new Tickets();\n tickets.setTicketId(UUID.randomUUID().toString());\n tickets.setId(user.getId());\n entityManager.persist(tickets);\n return tickets;\n }", "public Ticket() {\n\n }", "public void createTicke(String ticketNumber, String branchName, int numberOnQ, String service, long waitingTime,\n String ticketDate, String estimatedTicketDate){\n editor.putString(KEY_TICKET_NUMBER, ticketNumber);\n\n // Storing Password in pref\n editor.putString(KEY_BRANCE_NAME, branchName);\n\n // Storing Password in pref\n editor.putInt(KEY_NUMBER_ON_QUEUE, numberOnQ);\n\n // Storing Password in pref\n editor.putString(KEY_SERVICE, service);\n\n // Storing Password in pref\n editor.putLong(KEY_WAITING_TIME, waitingTime);\n\n // Storing Password in pref\n editor.putString(KEY_TICKET_DATE, ticketDate);\n\n // Storing Password in pref\n editor.putString(KEY_ESTIMATED_DATE, estimatedTicketDate);\n\n // commit changes\n editor.commit();\n }", "public boolean crearNuevoTicket(Ticket ticket, Usuario usuario) {\n\n try {\n\n //Se determina el tiempo de vida del ticket según el SLA\n int tiempoDeVida = ticket.getItemProductonumeroSerial().getContratonumero().getSlaid().getTiempoDeSolucion();\n Calendar c = Calendar.getInstance();\n c.add(Calendar.HOUR, tiempoDeVida);\n ticket.setTiempoDeVida(c.getTime());\n //Se indica la fecha máxima de cierre\n ticket.setFechaDeCierre(c.getTime());\n //Se indica la fecha actual como fecha de creacion\n ticket.setFechaDeCreacion(new Date());\n //se ingresa la fecha de última modificación\n ticket.setFechaDeModificacion(ticket.getFechaDeCreacion());\n //Se determina el tiempo de actualizacion segun el SLA\n //int tiempoDeActualizacion = ticket.getItemProductonumeroSerial().getContratonumero().getSlaid().getTiempoDeActualizacionDeEscalacion();\n //Información del ticket y el sla\n Sla ticketSla = ticket.getItemProductonumeroSerial().getContratonumero().getSlaid();\n PrioridadTicket prioridadTicket = ticket.getPrioridadTicketcodigo();\n int tiempoDeActualizacion = prioridadTicket.getValor() == 1 ? ticketSla.getTiempoRespuestaPrioridadAlta() : prioridadTicket.getValor() == 2 ? ticketSla.getTiempoRespuestaPrioridadMedia() : ticketSla.getTiempoRespuestaPrioridadBaja();\n //Se añade el tiempo de actualización para pos-validación según SLA\n c = Calendar.getInstance();\n c.add(Calendar.HOUR, tiempoDeActualizacion);\n //Se hacen verificaciones por tipo de disponibilidad es decir 24x7 o 8x5\n int horaActual = c.get(Calendar.HOUR_OF_DAY);\n int diaDeLaSemana = c.get(Calendar.DAY_OF_WEEK);\n if (ticket.getItemProductonumeroSerial().getContratonumero().getSlaid().getTipoDisponibilidadid().getDisponibilidad().equals(\"8x5\") && (diaDeLaSemana == Calendar.SATURDAY || diaDeLaSemana == Calendar.SUNDAY || (diaDeLaSemana == Calendar.FRIDAY && horaActual > 17))) {\n if (diaDeLaSemana == Calendar.FRIDAY) {\n c.add(Calendar.DAY_OF_MONTH, 3);\n } else if (diaDeLaSemana == Calendar.SATURDAY) {\n c.add(Calendar.DAY_OF_MONTH, 2);\n } else {\n c.add(Calendar.DAY_OF_MONTH, 1);\n }\n c.set(Calendar.HOUR_OF_DAY, 8);\n c.set(Calendar.MINUTE, 0);\n c.set(Calendar.SECOND, 0);\n } else if (ticket.getItemProductonumeroSerial().getContratonumero().getSlaid().getTipoDisponibilidadid().getDisponibilidad().equals(\"8x5\") && (horaActual < 8 || horaActual > 17) && (diaDeLaSemana != Calendar.SATURDAY && diaDeLaSemana != Calendar.SUNDAY)) {\n if (horaActual > 17) {\n c.add(Calendar.DAY_OF_MONTH, 1);\n }\n c.set(Calendar.HOUR_OF_DAY, 8);\n c.set(Calendar.MINUTE, 0);\n c.set(Calendar.SECOND, 0);\n }\n ticket.setFechaDeProximaActualizacion(c.getTime());\n if (ticket.getFechaDeProximaActualizacion().compareTo(ticket.getFechaDeCierre()) > 0) {\n Calendar cierre = Calendar.getInstance();\n cierre.setTime(c.getTime());\n cierre.add(Calendar.HOUR, tiempoDeVida);\n ticket.setFechaDeCierre(cierre.getTime());\n }\n //Se indica la persona que crea el ticket\n ticket.setUsuarioidcreador(usuario);\n //Se indica el usuario propietario por defecto y el responsable (Soporte HELPDESK)\n Usuario usuarioHelpdek = this.usuarioFacade.obtenerUsuarioPorCorreoElectronico(\"[email protected]\");\n ticket.setUsuarioidpropietario(usuarioHelpdek);\n ticket.setUsuarioidresponsable(usuarioHelpdek);\n //Se indica el estado actual del ticket\n EstadoTicket estadoNuevo = this.estadoTicketFacade.find(1);\n ticket.setEstadoTicketcodigo(estadoNuevo);\n //Creamos el ticket\n this.ticketFacade.create(ticket);\n //Creamos el Notificador\n TareaTicketInfo tareaTicketInfo = new TareaTicketInfo(\"t_sla\" + ticket.getTicketNumber(), \"Notificador SLA ticket# \" + ticket.getTicketNumber(), \"LoteTareaNotificarSLA\", ticket);\n //Información del ticket y el sla\n //Sla ticketSla = ticket.getItemProductonumeroSerial().getContratonumero().getSlaid();\n //PrioridadTicket prioridadTicket = ticket.getPrioridadTicketcodigo();\n String hora = prioridadTicket.getValor() == 1 ? String.valueOf(ticketSla.getTiempoRespuestaPrioridadAlta()) : prioridadTicket.getValor() == 2 ? String.valueOf(ticketSla.getTiempoRespuestaPrioridadMedia()) : String.valueOf(ticketSla.getTiempoRespuestaPrioridadBaja());\n //Definir la hora de inicio\n //c = Calendar.getInstance();\n //c.add(Calendar.HOUR, Integer.parseInt(hora));\n c.add(Calendar.MINUTE, -30);\n tareaTicketInfo.setStartDate(c.getTime());\n tareaTicketInfo.setEndDate(ticket.getFechaDeCierre());\n tareaTicketInfo.setSecond(String.valueOf(c.get(Calendar.SECOND)));\n tareaTicketInfo.setMinute(String.valueOf(c.get(Calendar.MINUTE)) + \"/10\");\n tareaTicketInfo.setHour(String.valueOf(c.get(Calendar.HOUR_OF_DAY)));\n tareaTicketInfo.setMonth(\"*\");\n tareaTicketInfo.setDayOfMonth(\"*\");\n tareaTicketInfo.setDayOfWeek(ticketSla.getTipoDisponibilidadid().getDisponibilidad().equals(\"8x5\") ? \"Mon, Tue, Wed, Thu, Fri\" : \"*\");\n tareaTicketInfo.setYear(\"*\");\n tareaTicketInfo.setDescription(\"Tarea SLA para ticket# \" + ticket.getTicketNumber());\n this.notificadorServicio.createJob(tareaTicketInfo);\n\n //Se añade un historico del evento\n HistorialDeTicket historialDeTicket = new HistorialDeTicket();\n historialDeTicket.setEventoTicketcodigo(this.eventoTicketFacade.find(1));\n historialDeTicket.setFechaDelEvento(new Date());\n historialDeTicket.setOrden(this.historialDeTicketFacade.obtenerOrdenDeHistorialDeTicket(ticket));\n historialDeTicket.setUsuarioid(ticket.getUsuarioidcreador());\n historialDeTicket.setTicketticketNumber(ticket);\n this.historialDeTicketFacade.create(historialDeTicket);\n\n } catch (Exception e) {\n e.printStackTrace();\n return false;\n }\n\n return true;\n }", "@Test\n\tpublic void createTicketTest() {\n\t\tService.createTicket(new TicketCreation(), \"username\");\n\t\tMockito.verify(TicketDao, times(1)).createTicket(Mockito.any(TicketCreation.class), Mockito.anyString());\n\t}", "public VentanaVentaTicket() {\n \n initComponents();\n VentanaVentaTicket.textoArea.append(\"************SPICY FACTORY***************\\n\");\n VentanaVentaTicket.textoArea.append(\"~~~~~~~~Detalle de la Venta ~~~~~~~~~~~~\\n\");\n VentanaVentaTicket.textoArea.append(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\\n\");\n \n }", "public void XxGamMaCreateTicket(Number nPayment, \n OAPageContext pageContext) {\n //Buscamos el Payment con el id para poder asociarlo con el nuevo ticket\n // searchPayment(nPayment);\n //Obteniendo el registro actual de XxGamMaTicketPVORowImpl\n XxGamMaPaymentReqVORowImpl rowXxGamMaPaymentReqVO = null;\n rowXxGamMaPaymentReqVO = (XxGamMaPaymentReqVORowImpl)getCurrentRow();\n\n RowIterator riXxGamMaPaymentPVO = null;\n //Verificando que el row no venga vacio\n if (rowXxGamMaPaymentReqVO == null) {\n throw new OAException(\"No es posible crear el ticket\", \n OAException.ERROR);\n\n }\n //Obteniendo el row iterador de ticket para los vuelos\n riXxGamMaPaymentPVO = rowXxGamMaPaymentReqVO.getXxGamMaTicketPVO();\n if (riXxGamMaPaymentPVO == null) {\n throw new OAException(\"No es posible crear el ticket\", \n OAException.ERROR);\n\n }\n XxGamMaTicketPVOImpl voXxGamMaTicketPVOImpl = null;\n //Creamos variable de AM para obtener su referencia\n XxGamModAntAMImpl amXxGamModAnt = null;\n try {\n /** AGAA Obtiene la Filial **/\n String filial = \n (String)pageContext.getTransactionValue(\"orgNameEmp\");\n\n //Obtenemos el AM\n amXxGamModAnt = getXxGamModAntAM();\n //Obtenemos la referencia a la implementacion de la VO deTicket\n voXxGamMaTicketPVOImpl = amXxGamModAnt.getXxGamMaTicketPVO3();\n //Llamamos el metodo para agregar un nuevo vuelo\n voXxGamMaTicketPVOImpl.addNewTicket(filial);\n } catch (Exception e) {\n e.printStackTrace();\n throw new OAException(\"No es posible crear el ticket\", \n OAException.ERROR);\n }\n }", "public Ticket(String name, String descrip, int caseNum, int status, int priority, String solution) {\n\tthis.name = name;\n\tthis.descrip = descrip;\n\tthis.caseNum = caseNum;\n\tthis.status = status;\n\tthis.priority = priority;\n\tthis.solution = solution;\n }", "@FXML\r\n private void handleButtonCreateTicket() {\r\n MobileApplication.getInstance().addViewFactory(NEWTICKET_VIEW, () -> new NewTicketView(NEWTICKET_VIEW).getView());\r\n MobileApplication.getInstance().switchView(NEWTICKET_VIEW);\r\n\r\n }", "@Override\n\tpublic IAdhocTicket createTicket(String carparkId) {\n\t\tcurrentTicketNo++; // when a ticket is issued, ticketNo increments by 1\n\t\tIAdhocTicket adhocTicket = factory.make(carparkId, currentTicketNo); \n\t\t// make ticket in factory with the new ticketNo\n\t\tadhocTicketList.add(adhocTicket);\n\t\treturn adhocTicket;\n\t}", "public Ticket createTicket(int numLines) {\r\n\t\tList<Line> lineList = new ArrayList<Line>();\r\n\t\tint ticketScore = 0;\r\n\t\tfor (int i=0; i < numLines; i++) {\r\n\t\t\tList<Integer> lineSeq = generateLine();\r\n\t\t\tint lineScore = generateScore(lineSeq);\r\n\t\t\tticketScore += lineScore;\r\n\t\t\tLine line = new Line();\r\n\t\t\tline.setLine(lineSeq);\r\n\t\t\tline.setLineScore(lineScore);\r\n\t\t\tlineList.add(line);\r\n\t\t}\r\n\t\tList<Line> sortedLineList = sortLines(lineList);\r\n\t\t\r\n\t\tTicket ticket = new Ticket(id,numLines,sortedLineList,ticketScore);\r\n\t\tid += 1;\r\n\t\tticketList.add(ticket);\r\n\t\treturn ticket;\r\n\t}", "public Ticket() {\n\t\tticketStatus = TICKET_STATUS_OPEN;\n\t}", "public Team create(TeamDTO teamForm);", "public static void createTicket(String toT){\n\r\n\t\tTicket total=new Ticket();\r\n\r\n\t\tif (toT.equalsIgnoreCase(\"Phone\")){\t\t\t\t\t\t\t\t\t\t\t\t\t//type of ticket is phone\r\n\r\n\t\t\tPhoneCall pc = new PhoneCall();\t\t\t\t\t\t\t\t\t\t\t\t\t//Creating a phone object\r\n\t\t\tSystem.out.println(\"\\n Assign Ticket Details\\n\");\t\t\t\t\t\t\t\t\r\n\t\t\tassignTicket(pc,toT);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//assigning the basic ticket details\r\n\r\n\t\t\ttotal=pc.contactHandler();\t\t\t\t\t\t\t\t\t\t\t\t\t\t//calling the contact handler method\r\n\r\n\t\t\tT.add(total);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//adding the details in transcript\r\n\t\t\t//System.out.println(\"Testing\");\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t\telse if (toT.equalsIgnoreCase(\"inperson\")){\t\t\t\t\t\t\t\t\t\t\t//type of ticket is inperson\r\n\r\n\r\n\t\t\tInPerson ip=new InPerson();\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Creating a inperson object\r\n\t\t\tassignTicket(ip,toT);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//assigning the basic ticket details\r\n\t\t\ttotal=ip.contactHandler();\t\t\t\t\t\t\t\t\t\t\t\t\t\t//calling the contact handler method\r\n\r\n\t\t\tT.add(total);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//adding the details in transcript\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\telse if (toT.equalsIgnoreCase(\"email\"));{\t\t\t\t\t\t\t\t\t\t\t//type of ticket is email\r\n\r\n\t\t\tString email=\"\";\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\tString line=\"\";\r\n\t\t\tSystem.out.println(\"Enter the email Provided\\n\");\r\n\t\t\tSystem.out.println(\"Please enter your ID, name,phoneNumber,Address,serviceID,ServiceStartDate,ServiceEndDate , rest of email\\n\");\r\n\t\t\twhile(true){ // For taking input.Each sentence should end with \".\" and Representative goes to next line by pressing enter. \"Exit\" is used to get out of loop\r\n\t\t\t\t/*\r\n\t\t\t\t * Please enter the Email in ID,Name,PhnNumber,Address,ServiceID,ServiceStartDate,ServiceEndDate and rest of mail with \".\" after each line\r\n\t\t\t\t */\r\n\r\n\t\t\t\tline=Sc.nextLine(); // Infinite loop till \"exit\" is pressed\r\n\t\t\t\temail+=line;\r\n\t\t\t\tif(line.equalsIgnoreCase(\"\"))\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tArrayList<String>sentenceList=new ArrayList<String>(Arrays.asList(email.split(\"\\\\.\")));\t\t\t\t\t\t//splitting the email based on \".\"\t\t\t\r\n\r\n\t\t\tString ID=sentenceList.get(0);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//get first element from Sentencelist\t\t\t\t\t\t\t\t\t\r\n\t\t\tsentenceList.remove(0);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//remove the first element\r\n\t\t\tString Name=sentenceList.get(0);\r\n\t\t\tsentenceList.remove(0);\r\n\t\t\tint PhnNumber=Integer.parseInt(sentenceList.get(0));\r\n\t\t\tsentenceList.remove(0);\r\n\t\t\tString Address=sentenceList.get(0);\r\n\t\t\tsentenceList.remove(0);\r\n\t\t\tString ServiceID=sentenceList.get(0);\r\n\t\t\tsentenceList.remove(0);\r\n\t\t\tString ServiceStartDate=sentenceList.get(0);\r\n\t\t\tsentenceList.remove(0);\r\n\t\t\tString ServiceEndDate=sentenceList.get(0);\r\n\t\t\tsentenceList.remove(0);\r\n\t\t\tString Email=String.join(\". \",sentenceList);\r\n\r\n\r\n\t\t\tEmail em=new Email(ID,Name,PhnNumber,Address,ServiceID,ServiceStartDate,ServiceEndDate);\t\t\t\t\t//creating the email object\r\n\t\t\tassignTicket(em,toT);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//assigning the ticket\r\n\t\t\ttotal=em.contactHandler(Email);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//calling the email contacthandler\r\n\t\t\tT.add(total);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//adding the ticket to arraylist\r\n\t\t}\r\n\t\treturn ;\r\n\t\t//updateTicket();\r\n\r\n\t}", "public phonecallTicket makeTicket(int id, String who, String phone,String tag, String date,String problem, String notes, String status){\n \n phonecallTicket ticket = new phonecallTicket(id, who, phone, tag, date, problem, notes, status);\n currentticket = ticket;\n return ticket;\n }", "public tickets ()\r\n {\r\n firstName = \" \"; //set to empty string. Pass in user input.\r\n lastName = \" \";\r\n venueName = \"Litchfield Recreation Center\"; \r\n performanceName = \"Hamlet\";\r\n performanceDate = \"May 8, 2020\";\r\n performanceTime = \"6:30PM\";\r\n \r\n }", "void setTicket(Ticket ticket) {\n this.ticket = ticket;\n }", "@PostMapping(\"/prix-tickets\")\n @Timed\n public ResponseEntity<PrixTicketDTO> createPrixTicket(@RequestBody PrixTicketDTO prixTicketDTO) throws URISyntaxException {\n log.debug(\"REST request to save PrixTicket : {}\", prixTicketDTO);\n if (prixTicketDTO.getId() != null) {\n throw new BadRequestAlertException(\"A new prixTicket cannot already have an ID\", ENTITY_NAME, \"idexists\");\n }\n PrixTicketDTO result = prixTicketService.save(prixTicketDTO);\n return ResponseEntity.created(new URI(\"/api/prix-tickets/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))\n .body(result);\n }", "public Ticket_AddResponse() {\n initComponents();\n }", "public Ticket(String destination, int price)\n {\n this.destination = destination;\n this.price = price;\n issueDateTime = new Date();\n \n }", "@Override\n\tpublic GetJiraTicketResponseDTO createJiraTicket(Integer id) {\n\t\treturn null;\n\t}", "public TestTicket() {\n\t}", "public Ticket() throws GeneralSecurityException {\n macAlgorithm = new TicketMac();\n \n //TODO: Change hmac key according to your need\n byte[] hmacKey = new byte[16];\n macAlgorithm.setKey(hmacKey);\n \n ul = new Commands();\n utils = new Utilities(ul);\n }", "@Test\n\tpublic void testCreateTicketFail() {\n\t}", "public TAccountTicketFlow(){}", "public void insertTicket(Ticket t){if(!this.inProgress()){this.currentTicket = t;}}", "public Ticket() {\n initComponents();\n setLocationRelativeTo(null);\n Calendar Cal= Calendar.getInstance();\n String fec= Cal.get(Cal.DATE)+\"/\"+(Cal.get(Cal.MONTH)+1)+\"/\"+Cal.get(Cal.YEAR);\n fecha.setText(fec);\n }", "public Ticket(String name, javax.money.MonetaryAmount price, Festival festival){\n this.name = name;\n this.price = price;\n this.festival = festival;\n }", "public static Result newForm() {\n return ok(newForm.render(palletForm, setOfArticleForm));\n }", "public PurchaseNewTicket() {\n initComponents();\n mLoadMovieName();\n mLoadTime();\n }", "public static void assignTicket(Ticket ticket,String toT){\r\n\r\n\t\tDate dateCreated=new Date();\t\t\t\t\t\t\t\t\t\t\t\t\t\t//getting the current date\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"dd-MM-yyyy HH:mm:ss\");\r\n\t\t//int ticketID=1000;\r\n\r\n\t\twhile(true){\r\n\t\t\tticket.ticketID=Integer.toString(ticketID);\t\t\t\t\t\t\t\t\t\t//converting the ticket id to string and assigning it to ticket id.\r\n\t\t\tticketID++;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\r\n\t\tif(toT.equalsIgnoreCase(\"Phone\")){\t\t\t\t\t\t\t\t\t\t\t\t\t//if type of ticket is phone\r\n\t\t\tticket.CustomerRepID=arrayRepresentativeIDs[0];\t\t\t\t\t\t\t\t\t//assigning the ticket to representative 0\r\n\t\t}\r\n\t\telse if(toT.equalsIgnoreCase(\"InPerson\")){\t\t\t\t\t\t\t\t\t\t\t//if type of ticket is inperson\r\n\t\t\tticket.CustomerRepID=arrayRepresentativeIDs[1];\t\t\t\t\t\t\t\t\t//assigning the ticket to representative 1\r\n\t\t}\r\n\t\telse if(toT.equalsIgnoreCase(\"Email\")){\t\t\t\t\t\t\t\t\t\t\t\t//if type of ticket is email\r\n\t\t\tticket.CustomerRepID=arrayRepresentativeIDs[2];\t\t\t\t\t\t\t\t\t//assigning the ticket to representative 2\r\n\t\t}\r\n\r\n\t\tticket.CustomerserviceRepID=Integer.toString(new Random().nextInt(arrayServiceIDs.length));\t\t//randomly assigning the service representative id\r\n\t\tticket.DateCreated=dateFormat.format(dateCreated);\r\n\t\t\r\n\r\n\r\n\t}", "@Override\n\tpublic void createForm(ERForm form) {\n\t\t\tString sql = \"insert into project1.reimbursementInfo (userName, fullName, thedate, eventstartdate, thelocation, description, thecost, gradingformat, passingpercentage, eventtype, filename,status,reason) values (?,?,?,?,?,?,?,?,?,?,?,?,?);\";\n\t\t\ttry {PreparedStatement stmt = conn.prepareCall(sql);\n\t\t\t//RID should auto increment, so this isnt necessary\n\t\t\t\n\t\t\tstmt.setString(1, form.getUserName());\n\t\t\tstmt.setString(2, form.getFullName());\n\t\t\tstmt.setDate(3, Date.valueOf(form.getTheDate()));\n\t\t\tstmt.setDate(4, Date.valueOf(form.getEventStartDate()));\n\t\t\tstmt.setString(5, form.getTheLocation());\n\t\t\tstmt.setString(6, form.getDescription());\n\t\t\tstmt.setDouble(7, form.getTheCost());\n\t\t\tstmt.setString(8, form.getGradingFormat());\n\t\t\tstmt.setString(9, form.getPassingPercentage());\n\t\t\tstmt.setString(10, form.getEventType());\n\t\t\tstmt.setString(11, form.getFileName());\n\t\t\tstmt.setString(12, \"pending\");\n\t\t\tstmt.setString(13, \"\");\n\t\t\tstmt.executeUpdate();\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Test\r\n public void addEventTicketInstance() {\r\n System.out.println(\"addEventTicketInstance begin\");\r\n\r\n // Read an event ticket instance from a JSON file.\r\n HwWalletObject instance =\r\n JSONObject.parseObject(CommonUtil.readJSONFile(\"EventTicketInstance.json\"), HwWalletObject.class);\r\n\r\n // Validate parameters.\r\n boolean isValidInstance = HwWalletObjectUtil.validateInstance(instance);\r\n if (!isValidInstance) {\r\n System.out.println(\"Invalid instance parameters.\");\r\n return;\r\n }\r\n\r\n // Post the new event ticket instance to HMS wallet server.\r\n String urlSegment = \"eventticket/instance\";\r\n HwWalletObject responseInstance =\r\n walletBuildService.postHwWalletObjectToWalletServer(urlSegment, CommonUtil.toJson(instance));\r\n System.out.println(\"Posted event ticket instance: \" + CommonUtil.toJson(responseInstance));\r\n }", "public static void sendTicket(Ticket t) throws SQLException {\r\n\t\ttools.Search.deleteTicket(t.getMesa());\r\n\t\tif(t.getProductosComanda().size() == 0) {\r\n\t\t\tm.getTicketsFrame().setTicketOnTable(t);\r\n\t\t\tm.getTablesFrame().setTicketOnTable(t.getMesa());\r\n\t\t\tbbddManager.TicketDBManager.deleteComanda(t.getMesa());\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tticketsBar.add(t);\r\n\t\t\r\n\r\n\t\tm.getTicketsFrame().setTicketOnTable(t);\r\n\t\tm.getTablesFrame().setTicketOnTable(t.getMesa());\r\n\t\tbbddManager.TicketDBManager.insertComanda(t);\r\n\t}", "public void addTicket(phonecallTicket ticket){\n try {\n \n System.out.println(\"Number of tickets? \" + (total()+1));\n String insert =\"INSERT INTO JEREMY.TICKET \"\n + \"(ID,NAME,PHONE,TAG,DATE,PROBLEM,NOTES,STATUS) \"\n + \"VALUES \"\n \n + \"(\" + (total() +1) +\",'\"\n +ticket.who+\"','\"\n +ticket.phone+\"','\"\n +ticket.tag+\"',' \"\n +ticket.date+\"',' \"\n +ticket.problem+\"',' \"\n +ticket.notes+\"','\"\n +\"NEW\"+\"')\";\n \n System.out.println(insert);\n \n stmt.executeUpdate(insert);\n \n rs = stmt.executeQuery(\"SELECT * FROM JEREMY.TICKET\");\n total();\n } catch (Exception e) {\n System.out.println(\"SQL problem \" + e);\n }\n tickets.add(ticket);\n }", "public GTLServiceTicket() {}", "Paper addNewPaper(PaperForm form, Long courseId)throws Exception;", "@PostMapping( value = \"/new\", params = \"auto\" )\n public String createEventFormAutoPopulate( @ModelAttribute CreateEventForm createEventForm )\n {\n // provide default values to make user submission easier\n createEventForm.setSummary( \"A new event....\" );\n createEventForm.setDescription( \"This was autopopulated to save time creating a valid event.\" );\n createEventForm.setWhen( new Date() );\n\n // make the attendee not the current user\n CalendarUser currentUser = userContext.getCurrentUser();\n int attendeeId = currentUser.getId() == 0 ? 1 : 0;\n CalendarUser attendee = calendarService.getUser( attendeeId );\n createEventForm.setAttendeeEmail( attendee.getEmail() );\n\n return \"events/create\";\n }", "public String createQuiz() {\n quiz = quizEJB.createQuiz(quiz);\n quizList = quizEJB.listQuiz();\n FacesContext.getCurrentInstance().addMessage(\"successForm:successInput\", new FacesMessage(FacesMessage.SEVERITY_INFO, \"Success\", \"New record added successfully\"));\n return \"quiz-list.xhtml\";\n }", "FORM createFORM();", "public abstract void onNewPatchset(TicketModel ticket);", "public Ticket(){\n\t\tpass = new Passenger();\n\t}", "@Override\n\tpublic void create(CreateCoinForm form) throws Exception {\n\t}", "public void clickCreate() {\n\t\tbtnCreate.click();\n\t}", "public void createTask(){\n final String name = newTaskNameField.getText().toString();\n final String description = newTaskDescriptionField.getText().toString();\n\n if (name.isEmpty()){\n newTaskNameField.setText(\"Please Enter a name\");\n newTaskNameField.requestFocus();\n newTaskNameField.selectAll();\n return;\n }\n\n if (description.isEmpty()){\n newTaskDescriptionField.setText(\"Please Enter a Description\");\n newTaskDescriptionField.requestFocus();\n newTaskDescriptionField.selectAll();\n return;\n }\n\n if(!getValidDate(newtaskDateField.getText().toString())) {\n handleInvalidDate();\n return;\n }\n\n if(newTaskAssignee == null) {\n newTaskAssigneeField.setText(\"Please assign a user\");\n newTaskAssigneeField.selectAll();\n return;\n }\n\n TaskManager.sharedInstance().CreateTask(name, description, newTaskAssignee, DueDate, false);\n newTaskDialog.dismiss();\n }", "public RegularTicket(int ticketNumber){\n\t\tthis.ticketNumber = ticketNumber;\n\t}", "public void addTicket(){\n RequestQueue rq = Volley.newRequestQueue(getApplicationContext());\n\n StringRequest request = new StringRequest(Request.Method.POST, ticketURL, new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n //display\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error)\n {\n error.printStackTrace();\n }\n }) {\n @Override\n public String getBodyContentType() {\n return \"application/json; charset=utf-8\";\n }\n\n @Override\n public byte[] getBody() {\n Gson gson = new Gson();\n String json = gson.toJson(1);\n\n try{ return (json).getBytes(\"utf-8\"); }\n catch (UnsupportedEncodingException e) { return null; }\n }\n };\n rq.add(request);\n }", "public void addTicket(Ticket ticket) {\n\t\ttickets.add(ticket);\n\t\tticket.setUser(this);\n\t}", "public static void create(Formulario form){\n daoFormulario.create(form);\n }", "int createTicketHistory(TicketHistory ticketHistory, int ticketId, int userId);", "public void createActionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\n\t}", "public TicketBooking() {\n initComponents();\n }", "@RequestMapping(method = RequestMethod.GET)\n \tpublic String createForm(Model model, ForgotLoginForm form) {\n \t\tmodel.addAttribute(\"form\", form);\n \t\treturn \"forgotlogin/index\";\n \t}", "public void setTicketId(int value) {\r\n this.ticketId = value;\r\n }", "public void create(Post post) {\r\n jdbcOp.update(SQL_INSERT_TICKET,\r\n post.getCustomerName(),\r\n post.getSubject(), \r\n post.getBody(),\r\n post.getCategories());\r\n// for (String role : user.getRoles()) {\r\n// jdbcOp.update(SQL_INSERT_ROLE,\r\n// user.getUsername(),\r\n// role); \r\n }", "public void saveTicket(Ticket ticket) throws DavException;", "private void createBtnActionPerformed(java.awt.event.ActionEvent evt) {\n\n staff.setName(regName.getText());\n staff.setID(regID.getText());\n staff.setPassword(regPwd.getText());\n staff.setPosition(regPos.getSelectedItem().toString());\n staff.setGender(regGender.getSelectedItem().toString());\n staff.setEmail(regEmail.getText());\n staff.setPhoneNo(regPhone.getText());\n staff.addStaff();\n if (staff.getPosition().equals(\"Vet\")) {\n Vet vet = new Vet();\n vet.setExpertise(regExp.getSelectedItem().toString());\n vet.setExpertise_2(regExp2.getSelectedItem().toString());\n vet.addExpertise(staff.getID());\n }\n JOptionPane.showMessageDialog(null, \"User added to database\");\n updateJTable();\n }", "public Event createBooking(RequestContext context) {\n\tHotel hotel = (Hotel) context.getFlowScope().get(\"hotel\");\n\tUser user = (User) context.getConversationScope().get(\"user\");\n\tBooking booking = new Booking(hotel, user);\n\tEntityManager em = (EntityManager) context.getFlowScope().get(\"entityManager\");\n\tem.persist(booking);\n\tcontext.getFlowScope().put(\"booking\", booking);\n\treturn success();\n }", "@GetMapping(\"/create\")\n public ModelAndView create(@ModelAttribute(\"form\") final CardCreateForm form) {\n return getCreateForm(form);\n }", "public void setTicketId(int value) {\n this.ticketId = value;\n }", "private SessionTicket createUniqueSessionTicket() {\n String ticket = UUID.randomUUID().toString();\n SessionTicket sessionTicket = new SessionTicket();\n sessionTicket.setTicket(ticket);\n return sessionTicket;\n }", "@ApiMethod(name = \"createContact\", path = \"contact\", httpMethod = HttpMethod.POST)\n\tpublic Contact createContact(final ContactForm form) {\n\t\tfinal Key<Contact> key = Contact.allocateKey();\n\t\tContact contact = new Contact(key.getId(), form);\n\n\t\tofy().save().entity(contact).now();\n\n\t\treturn contact;\n\t}", "public Ticket getTicket() {\n return ticket;\n }", "public void setTicketId(Integer ticketId) {\r\n this.ticketId = ticketId;\r\n }", "public void setTicketType(String ticketTypeOf)\r\n {\r\n ticketType = ticketTypeOf;\r\n }", "@Test\n public void createValidFlightFromGUI() {\n JButton buttonAddFlight = addFlight.getButtonAddFlight();\n\n addFlight.getTxtflightname().setText(\"TEST_FLIGHT_NAME\");\n addFlight.getTxtdate().setDate(new Date(2021, 3, 30));\n addFlight.getTxtdtime().setText(\"TEST_DEPART_TIME\");\n addFlight.getTxtarrtime().setText(\"TEST_ARRIVAL_TIME\");\n addFlight.getTxtflightcharge().setText(\"TEST_FLIGHT_CHARGE\");\n addFlight.getTxtsource().setSelectedIndex(0);\n addFlight.getTxtdepart().setSelectedIndex(0);\n\n Mockito.when(mockDAO.createFlight(Mockito.any(Flight.class))).thenReturn(true);\n buttonAddFlight.doClick();\n robot.keyPress(KeyEvent.VK_ENTER);\n robot.keyRelease(KeyEvent.VK_ENTER);\n Mockito.verify(mockDAO).createFlight(Mockito.any(Flight.class));\n }", "public String formCreated()\r\n {\r\n return formError(\"201 Created\",\"Object was created\");\r\n }", "public static Result startNewForm() {\r\n\t\tString formName = ChangeOrderForm.NAME;\r\n\t\tDecision firstDecision = CMSGuidedFormFill.startNewForm(formName,\r\n\t\t\t\tCMSSession.getEmployeeName(), CMSSession.getEmployeeId());\r\n\t\treturn ok(backdrop.render(firstDecision));\r\n\t}", "@Test\n\tpublic void testCreateTicketOk() {\n\t\tArrayList<Object> p = new ArrayList<Object>();\n\t\tp.add(new TGame(\"FORTNITE\", 6, 20.0, 1, 2, \"descripcion\", \"Shooter\"));\n\t\tTTicket tt = new TTicket(1, p);\n\t\tassertEquals();\n\t}", "public TicketContent(Ticket ticket) {\n this(ticket, null);\n }", "private void setDataForTicket(){\n int rowId = ticketGui.getSelectedRowId();\n Ticket ticket = controller.getTicketById(rowId);\n\n // setting the data from the ticket i got to the popup gui\n clientNameTextField.setText(ticket.getClientName());\n starIdTextField.setText(ticket.getStarId());\n emailTextField.setText(ticket.getEmail());\n phoneNumberTextField.setText(ticket.getPhoneNumber());\n deviceModelTextField.setText(ticket.getModel());\n descriptionTextArea.setText(ticket.getDescription());\n clubMemberNameTextField.setText(ticket.getMemberName());\n resolutionTextArea.setText(ticket.getResolution());\n\n }", "@RequestMapping(value = \"/report.create\", method = RequestMethod.GET)\n @ResponseBody public ModelAndView newreportForm(HttpSession session) throws Exception {\n ModelAndView mav = new ModelAndView();\n mav.setViewName(\"/sysAdmin/reports/details\");\n\n //Create a new blank provider.\n reports report = new reports();\n \n mav.addObject(\"btnValue\", \"Create\");\n mav.addObject(\"reportdetails\", report);\n\n return mav;\n }", "@Override\n\t@Transactional\n\tpublic LotteryTicket createLotteryTicket(LotteryTicketRequest lotteryTicketRequest) {\n\t\tcheckLotteryTicketRequest(lotteryTicketRequest);\n\t\ttry {\n\t\t\t// Create a lottery ticket\n\t\t\tLotteryTicket lotteryTicket = lotteryTicketRepository.save(new LotteryTicket());\n\n\t\t\t// Create lines per ticket\n\t\t\tList<LotteryTicketLine> linesList = createTicketLines(lotteryTicketRequest.getNumberOfLines(),\n\t\t\t\t\tlotteryTicket);\n\t\t\tlineRepository.saveAll(linesList);\n\t\t\tlotteryTicket.setLotteryTicketLine(linesList);\n\n\t\t\t// Return ticket response\n\t\t\treturn lotteryTicket;\n\t\t} catch (Exception exception) {\n\t\t\tLOGGER.error(\"Something went wrong in createLotteryTicket\" + exception);\n\t\t\tthrow new InternalServerError(\"Something went wrong in creating lottery ticket\");\n\t\t}\n\t}", "@RequestMapping(value = \"onlineticketlist.htm\", method = RequestMethod.GET, params = \"newticket\")\n public String newTicket(@ModelAttribute(\"LoginUserBean\") LoginUserBean lub, @ModelAttribute(\"onlineticketing\") OnlineTicketing onlineticket, Map<String, Object> model) {\n onlineticket.setUsername(lub.getUsername());\n List onLineTicketList = onlineTicketDAO.getTicketList(lub.getUserid());\n model.put(\"onlineticketlist\", onLineTicketList);\n return \"redirect:/onlineticket.htm\";\n }", "@PostMapping(consumes = \"application/json\")\n\tpublic void create (@Valid @RequestBody Bug bug) {\n\t\tbugService.createBug(bug);\n\t}", "public int createDBEntry() {\n\t\tint i = 0;\n\t\ttry {\n\t\t\tConnection con;\n\t\t\tcon = ConnectionUtil.getConnection();\n\t\t\tStatement statement = con.createStatement();\n\n\t\t\tStringBuffer strBuf = new StringBuffer();\n\t\t\tstrBuf.append(\"insert into Ticket(ticketID,\");\n\t\t\tstrBuf.append(\"ticketDate, \");\n\t\t\tstrBuf.append(\"bugTitle, \");\n\t\t\tstrBuf.append(\"bugDescription, \");\n\t\t\tstrBuf.append(\"bugCategory, \");\n\t\t\tstrBuf.append(\"projectName, \");\n\t\t\tstrBuf.append(\"projectVersion, \");\n\t\t\tstrBuf.append(\"assignedToDev, \");\n\t\t\tstrBuf.append(\"priority, \");\n\t\t\tstrBuf.append(\"status, \");\n\t\t\tstrBuf.append(\"comments, \");\n\t\t\tstrBuf.append(\"targetDueDate, \");\n\t\t\tstrBuf.append(\"ticketCreatedBy \");\t\n\t\t\tstrBuf.append(\") values (last_insert_id(), \");\n\t\t\tstrBuf.append(\"'\" + this.ticketDate + \"', \");\n\t\t\tstrBuf.append(\"'\" + this.bugTitle + \"', \");\t\t\t\t\n\t\t\tstrBuf.append(\"'\" + this.bugDescription + \"', \");\n\t\t\tstrBuf.append(\"'\" + this.bugCategory + \"', \");\n\t\t\tstrBuf.append(\"'\" + this.projectName + \"', \");\n\t\t\tstrBuf.append(\"'\" + this.projectVersion + \"', \");\n\t\t\tstrBuf.append(\"'\" + this.assignedToDevName + \"', \");\n\t\t\tstrBuf.append(\"'\" + this.ticketPriority + \"', \");\n\t\t\tstrBuf.append(\"'\" + this.ticketStatus + \"', \");\n\t\t\tstrBuf.append(\"'\" + this.comments + \"', \");\n\t\t\tstrBuf.append(\"'\" + this.targetDueDate + \"', \");\n\t\t\tstrBuf.append(\"'\" + this.TicketCreatedBy + \"'\");\n\t\t\tstrBuf.append(\")\");\n\n\t\t\ti = statement.executeUpdate(strBuf.toString());\t\t\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn i;\n\t}", "private void createSubject(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n // Formulareingaben prüfen\n String name = request.getParameter(\"name\");\n\n Subject subject = new Subject(name);\n List<String> errors = this.validationBean.validate(subject);\n\n // Neue Kategorie anlegen\n if (errors.isEmpty()) {\n this.subjectBean.saveNew(subject);\n }\n\n // Browser auffordern, die Seite neuzuladen\n if (!errors.isEmpty()) {\n FormValues formValues = new FormValues();\n formValues.setValues(request.getParameterMap());\n formValues.setErrors(errors);\n\n HttpSession session = request.getSession();\n session.setAttribute(\"subjects_form\", formValues);\n }\n\n response.sendRedirect(request.getRequestURI());\n }", "void requestTicket(String customerName)\n {\n\ttc.customerName = customerName;\n\ttc.run(); // Sells ticket. Prints ticket to console.\n }", "public com.vportal.portlet.vfaq.model.FAQComment create(long id);", "@RequestMapping(value = \"/newFact/{fact}\", method = { RequestMethod.GET, RequestMethod.POST })\n\tpublic void newFact(HttpServletRequest req, HttpServletResponse resp, @PathVariable String fact, Model model) throws IOException, ServletException {\n\t\tfactDao.addNewFact(fact);\n\t}", "@GetMapping(\"/service_requests/new\")\n public String newServiceRequest(Model model){\n String role = userService.getRole(userService.getCurrentUserName());\n model.addAttribute(\"role\", role);\n\n model.addAttribute(\"serviceRequest\", new ServiceRequest());\n\n return \"/forms/new_servicerequest.html\";\n }", "void create(Feedback entity);", "@Test\n public void newTeacher() {\n driver.get(\"http://localhost:3000/teacher\");\n log.info(() -> \"Successfully enter the localhost:3000/teacher for adding a new teacher. time: \" + LocalDateTime.now());\n\n //Button for opening teacher form\n WebElement buttonPlus = driver.findElement(By.xpath(\"/html/body/div/div/main/div[2]/button\"));\n buttonPlus.click();\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\n TeacherForm teacherForm = new TeacherForm(driver);\n Assertions.assertTrue(teacherForm.isInitialized());\n log.info(() -> \"Teacher form is initialized! time: \" + LocalDateTime.now());\n //I found save button with xpath\n teacherForm.setSaveButton(\"/html/body/div/div/main/div[2]/div[2]/form/div[4]/button[1]\");\n teacherForm.newTeacher(\"Mirko\",\"Vukovic\", \"[email protected]\");\n\n ReceiptPage newTeacherForm = teacherForm.submitSave();\n log.info(() -> \"Submit new teacher was successfully! time: \" + LocalDateTime.now());\n Assertions.assertTrue(newTeacherForm.isInitialized());\n }", "public boolean ingresarPrimerContactoDeTicket(Ticket ticket, Usuario usuario) {\n try {\n //Se agrega la información de actualización y modificación\n ticket.setFechaDeModificacion(new Date());\n Calendar c = Calendar.getInstance();\n c.add(Calendar.HOUR, ticket.getItemProductonumeroSerial().getContratonumero().getSlaid().getTiempoDeActualizacionDeEscalacion());\n ticket.setFechaDeProximaActualizacion(c.getTime());\n //Se modifica el ticket y se agrega en el historial\n this.ticketFacade.edit(ticket);\n HistorialDeTicket historialDeTicket = new HistorialDeTicket();\n historialDeTicket.setEventoTicketcodigo(this.eventoTicketFacade.find(7));\n historialDeTicket.setFechaDelEvento(ticket.getFechaDePrimerContacto());\n historialDeTicket.setOrden(this.historialDeTicketFacade.obtenerOrdenDeHistorialDeTicket(ticket));\n historialDeTicket.setUsuarioid(usuario);\n historialDeTicket.setTicketticketNumber(ticket);\n this.historialDeTicketFacade.create(historialDeTicket);\n //Eliminamos el notificador de primer contacto\n Timer tarea = this.notificadorServicio.getTareaInfoById(\"t_sla\" + ticket.getTicketNumber());\n if (tarea != null) {\n tarea.cancel();\n }\n //Creamos el notificador de actualización de ticket\n TareaTicketInfo tareaTicketInfo = new TareaTicketInfo(\"t_update\" + ticket.getTicketNumber(), \"Notificador Actualizacion ticket# \" + ticket.getTicketNumber(), \"LoteTareaNotificarTiempoDeActualizacion\", ticket);\n Sla ticketSla = ticket.getItemProductonumeroSerial().getContratonumero().getSlaid();\n c = Calendar.getInstance();\n c.add(Calendar.HOUR, ticketSla.getTiempoDeActualizacionDeEscalacion());\n tareaTicketInfo.setStartDate(c.getTime());\n tareaTicketInfo.setSecond(String.valueOf(c.get(Calendar.SECOND)));\n tareaTicketInfo.setMinute(String.valueOf(c.get(Calendar.MINUTE)));\n tareaTicketInfo.setHour(String.valueOf(c.get(Calendar.HOUR_OF_DAY)) + \"/\" + ticketSla.getTiempoDeActualizacionDeEscalacion());\n c = Calendar.getInstance();\n c.add(Calendar.HOUR, ticketSla.getTiempoDeSolucion());\n tareaTicketInfo.setEndDate(c.getTime());\n tareaTicketInfo.setMonth(\"*\");\n tareaTicketInfo.setDayOfMonth(\"*\");\n tareaTicketInfo.setDayOfWeek(ticketSla.getTipoDisponibilidadid().getDisponibilidad().equals(\"8x5\") ? \"Mon, Tue, Wed, Thu, Fri\" : \"*\");\n tareaTicketInfo.setYear(\"*\");\n tareaTicketInfo.setDescription(\"Tarea Actualizacion para ticket# \" + ticket.getTicketNumber());\n this.notificadorServicio.createJob(tareaTicketInfo);\n } catch (Exception e) {\n e.printStackTrace();\n return false;\n }\n return true;\n }", "public void addTicket(LotteryTicket ticket)\r\n\t{\r\n\t\tlotteryTickets.add(ticket);\r\n\t}", "public String actionCreateNew() {\r\n \t\tsetBook(new Book());\r\n \t\treturn \"new\";\r\n \t}", "private void createForumDialog() {\n AlertDialog.Builder dialog = new AlertDialog.Builder(Objects.requireNonNull(this),\n R.style.AlertDialogTheme);\n dialog.setTitle(R.string.add_new_forum_title);\n dialog.setMessage(R.string.add_new_forum_description);\n\n View newForumDialog = getLayoutInflater().inflate(R.layout.new_forum_dialog, null);\n dialog.setView(newForumDialog);\n\n AlertDialog alertDialog = dialog.create();\n setAddForumButtonListener(alertDialog, newForumDialog);\n\n alertDialog.show();\n }", "protected Ticket<SESSION> newTicket() {\n synchronized (manager) {\n if (isConnectionStopped) {\n throw new IllegalStateException(\"Connection has been stopped\");\n }\n TicketImpl ticketImpl = new TicketImpl();\n tickets.add(ticketImpl);\n return ticketImpl;\n }\n }", "com.soa.SolicitarCreditoDocument.SolicitarCredito addNewSolicitarCredito();", "@PostMapping(\"/createAccount\")\n public ModelAndView createNewAccount(AccountCreateDTO createDTO){\n ModelAndView modelAndView = new ModelAndView();\n\n accountService.createAccount(createDTO);\n modelAndView.addObject(\"successMessage\", \"Account has been created\");\n modelAndView.setViewName(\"accountPage\");\n\n return modelAndView;\n }", "@GetMapping(value = \"/create\") // https://localhost:8080/etiquetasTipoDisenio/create\n\tpublic String create(Model model) {\n\t\tetiquetasTipoDisenio etiquetasTipoDisenio = new etiquetasTipoDisenio();\n\t\tmodel.addAttribute(\"title\", \"Registro de una nuev entrega\");\n\t\tmodel.addAttribute(\"etiquetasTipoDisenio\", etiquetasTipoDisenio); // similar al ViewBag\n\t\treturn \"etiquetasTipoDisenio/form\"; // la ubicacion de la vista\n\t}", "public String create() {\n\n if (log.isDebugEnabled()) {\n log.debug(\"create()\");\n }\n FacesContext context = FacesContext.getCurrentInstance();\n StringBuffer sb = registration(context);\n sb.append(\"?action=Create\");\n forward(context, sb.toString());\n return (null);\n\n }" ]
[ "0.7035293", "0.68661964", "0.68439424", "0.6737605", "0.6506499", "0.6417886", "0.62837154", "0.627456", "0.6274538", "0.62290895", "0.6213337", "0.61334515", "0.6123787", "0.608298", "0.59805405", "0.59723866", "0.59683615", "0.5926423", "0.59124076", "0.5910399", "0.5866557", "0.5863232", "0.5837694", "0.58239895", "0.58209246", "0.5814998", "0.5812721", "0.58095884", "0.58064634", "0.5783534", "0.57796717", "0.571281", "0.570933", "0.57092935", "0.5699552", "0.5684512", "0.5659557", "0.56588894", "0.5656856", "0.5630737", "0.5629857", "0.56245774", "0.5602863", "0.5558905", "0.5533537", "0.5527317", "0.5519085", "0.5518508", "0.55161667", "0.5513586", "0.5508157", "0.55038315", "0.5488099", "0.5485583", "0.54731476", "0.5461593", "0.5437129", "0.5426457", "0.5416029", "0.54035544", "0.5367145", "0.53654504", "0.53600883", "0.5350734", "0.5348272", "0.5347942", "0.5328131", "0.5323624", "0.5314856", "0.53104347", "0.53062266", "0.5294381", "0.5280447", "0.525744", "0.52516043", "0.5247811", "0.52403927", "0.52363634", "0.52351046", "0.5233719", "0.52315634", "0.5231296", "0.523028", "0.522801", "0.52254486", "0.5223499", "0.52163464", "0.52149373", "0.5209607", "0.5203567", "0.5185492", "0.51780945", "0.51585805", "0.5158498", "0.51568556", "0.515657", "0.5143728", "0.51424354", "0.5138648", "0.5131761" ]
0.5903458
20
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); nomTicket = new javax.swing.JLabel(); folioTicket = new javax.swing.JLabel(); backBtn = new javax.swing.JButton(); detalle = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); detalleCompra = new javax.swing.JScrollPane(); compra = new javax.swing.JTextArea(); jLabel8 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setUndecorated(true); getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jLabel1.setFont(new java.awt.Font("Maku", 0, 48)); // NOI18N jLabel1.setForeground(new java.awt.Color(255, 255, 255)); jLabel1.setText("Compra realizada"); getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 20, -1, -1)); nomTicket.setFont(new java.awt.Font("Maku", 0, 24)); // NOI18N nomTicket.setForeground(new java.awt.Color(255, 255, 255)); nomTicket.setText("Nombre: "); getContentPane().add(nomTicket, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 90, 220, 20)); folioTicket.setFont(new java.awt.Font("Maku", 0, 24)); // NOI18N folioTicket.setForeground(new java.awt.Color(255, 255, 255)); folioTicket.setText("Folio: "); getContentPane().add(folioTicket, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 130, -1, -1)); backBtn.setText("Regresar"); backBtn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { backBtnActionPerformed(evt); } }); getContentPane().add(backBtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(520, 210, -1, -1)); detalle.setFont(new java.awt.Font("Maku", 0, 24)); // NOI18N detalle.setForeground(new java.awt.Color(255, 255, 255)); detalle.setText("Detalle de compra: "); getContentPane().add(detalle, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 170, 450, 40)); jButton1.setText("Salir"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); getContentPane().add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(530, 350, -1, -1)); compra.setEditable(false); compra.setColumns(20); compra.setRows(5); detalleCompra.setViewportView(compra); getContentPane().add(detalleCompra, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 210, 480, 170)); jLabel8.setFont(new java.awt.Font("Maku", 0, 24)); // NOI18N jLabel8.setForeground(new java.awt.Color(255, 255, 255)); jLabel8.setIcon(new javax.swing.ImageIcon("/Users/indra/Desktop/fondo3.jpeg")); // NOI18N jLabel8.setText("jLabel8"); getContentPane().add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 620, 400)); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n initComponents();\n }", "public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }", "public FormListRemarking() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n \n }", "public FormPemilihan() {\n initComponents();\n }", "public GUIForm() { \n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "public TorneoForm() {\n initComponents();\n }", "public FormCompra() {\n initComponents();\n }", "public muveletek() {\n initComponents();\n }", "public Interfax_D() {\n initComponents();\n }", "public quanlixe_form() {\n initComponents();\n }", "public SettingsForm() {\n initComponents();\n }", "public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public Soru1() {\n initComponents();\n }", "public FMainForm() {\n initComponents();\n this.setResizable(false);\n setLocationRelativeTo(null);\n }", "public soal2GUI() {\n initComponents();\n }", "public EindopdrachtGUI() {\n initComponents();\n }", "public MechanicForm() {\n initComponents();\n }", "public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }", "public BloodDonationGUI() {\n initComponents();\n }", "public quotaGUI() {\n initComponents();\n }", "public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }", "public PatientUI() {\n initComponents();\n }", "public myForm() {\n\t\t\tinitComponents();\n\t\t}", "public Oddeven() {\n initComponents();\n }", "public intrebarea() {\n initComponents();\n }", "public Magasin() {\n initComponents();\n }", "public RadioUI()\n {\n initComponents();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public ZobrazUdalost() {\n initComponents();\n }", "public FormUtama() {\n initComponents();\n }", "public p0() {\n initComponents();\n }", "public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }", "public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }", "public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }", "public form2() {\n initComponents();\n }", "public MainForm() {\n\t\tsuper(\"Hospital\", List.IMPLICIT);\n\n\t\tstartComponents();\n\t}", "public kunde() {\n initComponents();\n }", "public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }", "public MusteriEkle() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public DESHBORDPANAL() {\n initComponents();\n }", "public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }", "public frmVenda() {\n initComponents();\n }", "public Botonera() {\n initComponents();\n }", "public FrmMenu() {\n initComponents();\n }", "public OffertoryGUI() {\n initComponents();\n setTypes();\n }", "public JFFornecedores() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }", "public vpemesanan1() {\n initComponents();\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "public Kost() {\n initComponents();\n }", "public FormHorarioSSE() {\n initComponents();\n }", "public frmacceso() {\n initComponents();\n }", "public UploadForm() {\n initComponents();\n }", "public HW3() {\n initComponents();\n }", "public Managing_Staff_Main_Form() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "public sinavlar2() {\n initComponents();\n }", "public P0405() {\n initComponents();\n }", "public IssueBookForm() {\n initComponents();\n }", "public MiFrame2() {\n initComponents();\n }", "public Choose1() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n\n String oldAuthor = prefs.get(\"AUTHOR\", \"\");\n if(oldAuthor != null) {\n this.authorTextField.setText(oldAuthor);\n }\n String oldBook = prefs.get(\"BOOK\", \"\");\n if(oldBook != null) {\n this.bookTextField.setText(oldBook);\n }\n String oldDisc = prefs.get(\"DISC\", \"\");\n if(oldDisc != null) {\n try {\n int oldDiscNum = Integer.parseInt(oldDisc);\n oldDiscNum++;\n this.discNumberTextField.setText(Integer.toString(oldDiscNum));\n } catch (Exception ex) {\n this.discNumberTextField.setText(oldDisc);\n }\n this.bookTextField.setText(oldBook);\n }\n\n\n }", "public GUI_StudentInfo() {\n initComponents();\n }", "public JFrmPrincipal() {\n initComponents();\n }", "public Lihat_Dokter_Keseluruhan() {\n initComponents();\n }", "public bt526() {\n initComponents();\n }", "public Pemilihan_Dokter() {\n initComponents();\n }", "public Ablak() {\n initComponents();\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\" desc=\"Generated\n\t// Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tlabel1 = new java.awt.Label();\n\t\tlabel2 = new java.awt.Label();\n\t\tlabel3 = new java.awt.Label();\n\t\tlabel4 = new java.awt.Label();\n\t\tlabel5 = new java.awt.Label();\n\t\tlabel6 = new java.awt.Label();\n\t\tlabel7 = new java.awt.Label();\n\t\tlabel8 = new java.awt.Label();\n\t\tlabel9 = new java.awt.Label();\n\t\tlabel10 = new java.awt.Label();\n\t\ttextField1 = new java.awt.TextField();\n\t\ttextField2 = new java.awt.TextField();\n\t\tlabel14 = new java.awt.Label();\n\t\tlabel15 = new java.awt.Label();\n\t\tlabel16 = new java.awt.Label();\n\t\ttextField3 = new java.awt.TextField();\n\t\ttextField4 = new java.awt.TextField();\n\t\ttextField5 = new java.awt.TextField();\n\t\tlabel17 = new java.awt.Label();\n\t\tlabel18 = new java.awt.Label();\n\t\tlabel19 = new java.awt.Label();\n\t\tlabel20 = new java.awt.Label();\n\t\tlabel21 = new java.awt.Label();\n\t\tlabel22 = new java.awt.Label();\n\t\ttextField6 = new java.awt.TextField();\n\t\ttextField7 = new java.awt.TextField();\n\t\ttextField8 = new java.awt.TextField();\n\t\tlabel23 = new java.awt.Label();\n\t\ttextField9 = new java.awt.TextField();\n\t\ttextField10 = new java.awt.TextField();\n\t\ttextField11 = new java.awt.TextField();\n\t\ttextField12 = new java.awt.TextField();\n\t\tlabel24 = new java.awt.Label();\n\t\tlabel25 = new java.awt.Label();\n\t\tlabel26 = new java.awt.Label();\n\t\tlabel27 = new java.awt.Label();\n\t\tlabel28 = new java.awt.Label();\n\t\tlabel30 = new java.awt.Label();\n\t\tlabel31 = new java.awt.Label();\n\t\tlabel32 = new java.awt.Label();\n\t\tjButton1 = new javax.swing.JButton();\n\n\t\tlabel1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel1.setText(\"It seems that some of the buttons on the ATM machine are not working!\");\n\n\t\tlabel2.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel2.setText(\"Unfortunately these numbers are exactly what Professor has to use to type in his password.\");\n\n\t\tlabel3.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel3.setText(\n\t\t\t\t\"If you want to eat tonight, you have to help him out and construct the numbers of the password with the working buttons and math operators.\");\n\n\t\tlabel4.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tlabel4.setText(\"Denver's Password: 2792\");\n\n\t\tlabel5.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel5.setText(\"import java.util.Scanner;\\n\");\n\n\t\tlabel6.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel6.setText(\"public class ATM{\");\n\n\t\tlabel7.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel7.setText(\"public static void main(String[] args){\");\n\n\t\tlabel8.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel8.setText(\"System.out.print(\");\n\n\t\tlabel9.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel9.setText(\" -\");\n\n\t\tlabel10.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel10.setText(\");\");\n\n\t\ttextField1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttextField1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tlabel14.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel14.setText(\"System.out.print( (\");\n\n\t\tlabel15.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel15.setText(\"System.out.print(\");\n\n\t\tlabel16.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel16.setText(\"System.out.print( ( (\");\n\n\t\tlabel17.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel17.setText(\")\");\n\n\t\tlabel18.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel18.setText(\" +\");\n\n\t\tlabel19.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel19.setText(\");\");\n\n\t\tlabel20.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel20.setText(\" /\");\n\n\t\tlabel21.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel21.setText(\" %\");\n\n\t\tlabel22.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel22.setText(\" +\");\n\n\t\tlabel23.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel23.setText(\");\");\n\n\t\tlabel24.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel24.setText(\" +\");\n\n\t\tlabel25.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel25.setText(\" /\");\n\n\t\tlabel26.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel26.setText(\" *\");\n\n\t\tlabel27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tlabel27.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel27.setText(\")\");\n\n\t\tlabel28.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel28.setText(\")\");\n\n\t\tlabel30.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel30.setText(\"}\");\n\n\t\tlabel31.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel31.setText(\"}\");\n\n\t\tlabel32.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel32.setText(\");\");\n\n\t\tjButton1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tjButton1.setText(\"Check\");\n\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tjButton1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(28).addGroup(layout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING).addComponent(getDoneButton()).addComponent(jButton1)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, 774, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addGap(92).addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15, GroupLayout.PREFERRED_SIZE, 145,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(37))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(174)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(7)))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label23, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20).addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(23).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16, GroupLayout.PREFERRED_SIZE, 177,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup().addGroup(layout.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(19)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(78)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(76)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(75)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(27))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel23,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(29)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))))\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGap(30)\n\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(25)\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(26).addComponent(jButton1).addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(getDoneButton()).addContainerGap(23, Short.MAX_VALUE)));\n\t\tthis.setLayout(layout);\n\n\t\tlabel16.getAccessibleContext().setAccessibleName(\"System.out.print( ( (\");\n\t\tlabel17.getAccessibleContext().setAccessibleName(\"\");\n\t\tlabel18.getAccessibleContext().setAccessibleName(\" +\");\n\t}", "public Pregunta23() {\n initComponents();\n }", "public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }", "public AvtekOkno() {\n initComponents();\n }", "public busdet() {\n initComponents();\n }", "public ViewPrescriptionForm() {\n initComponents();\n }", "public Ventaform() {\n initComponents();\n }", "public Kuis2() {\n initComponents();\n }", "public CreateAccount_GUI() {\n initComponents();\n }", "public POS1() {\n initComponents();\n }", "public Carrera() {\n initComponents();\n }", "public EqGUI() {\n initComponents();\n }", "public JFriau() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setTitle(\"BuNus - Budaya Nusantara\");\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setBackground(new java.awt.Color(204, 204, 204));\n setMinimumSize(new java.awt.Dimension(1, 1));\n setPreferredSize(new java.awt.Dimension(760, 402));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 750, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n }", "public nokno() {\n initComponents();\n }", "public dokter() {\n initComponents();\n }", "public ConverterGUI() {\n initComponents();\n }", "public hitungan() {\n initComponents();\n }", "public Modify() {\n initComponents();\n }", "public frmAddIncidencias() {\n initComponents();\n }", "public FP_Calculator_GUI() {\n initComponents();\n \n setVisible(true);\n }" ]
[ "0.7319573", "0.72908455", "0.72908455", "0.72908455", "0.7286827", "0.7248724", "0.7213511", "0.7208325", "0.7195998", "0.7190202", "0.7184771", "0.7158966", "0.7147921", "0.7093225", "0.7080275", "0.7057302", "0.69875276", "0.6977057", "0.6955658", "0.6953942", "0.69454855", "0.6942884", "0.6935925", "0.69316167", "0.692865", "0.6925198", "0.69251573", "0.69119257", "0.6911172", "0.68930143", "0.68928415", "0.6890789", "0.6890435", "0.68890977", "0.68831456", "0.6881887", "0.68808997", "0.6878897", "0.6876147", "0.68747145", "0.6872147", "0.6859808", "0.6856282", "0.6855344", "0.68553185", "0.685469", "0.6853377", "0.68523794", "0.68523794", "0.68436074", "0.68373406", "0.6837167", "0.68286663", "0.68283236", "0.6826517", "0.682448", "0.6823606", "0.68170947", "0.6817084", "0.681006", "0.6809135", "0.68087894", "0.68084186", "0.68076634", "0.6802823", "0.6795054", "0.67939687", "0.67926705", "0.6791137", "0.6789317", "0.6788968", "0.6788417", "0.6782546", "0.67662394", "0.67658025", "0.6765246", "0.6756509", "0.67557156", "0.6752202", "0.6750687", "0.6742804", "0.6739344", "0.6736661", "0.67360824", "0.67333126", "0.6727312", "0.67265683", "0.6720307", "0.67165637", "0.67146873", "0.6714614", "0.67091054", "0.67075574", "0.6704629", "0.6700793", "0.6700504", "0.6699442", "0.6697844", "0.66946405", "0.66912174", "0.6690615" ]
0.0
-1
Helper methods Calculate the MD5 of a byte array.
private static String md5(byte[] b) { try { MessageDigest md = MessageDigest.getInstance("MD5"); md.reset(); md.update(b); byte[] digest = md.digest(); StringBuffer sb = new StringBuffer(); for (int i=0; i<digest.length; i++) { String a = Integer.toHexString(0xff & digest[i]); if (a.length() == 1) a = "0" + a; sb.append(a); } return sb.toString(); } catch (NoSuchAlgorithmException e) { writeLog(e); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static byte[] computeMD5Hash(byte[] data) throws NoSuchAlgorithmException, IOException {\n return computeMD5Hash(new ByteArrayInputStream(data));\n }", "public static byte[] encryptMD5(final byte[] data) {\n return hashTemplate(data, \"MD5\");\n }", "@Test\n public void md5Checksum() throws NoSuchAlgorithmException {\n String string = Utils.md5Checksum(\"abcde fghijk lmn op\");\n Assert.assertEquals(\"1580420c86bbc3b356f6c40d46b53fc8\", string);\n }", "private String m34495c(byte[] bArr) {\n MessageDigest a = m34492a(\"MD5\");\n a.update(bArr);\n return m34494b(a.digest());\n }", "public static String md5(String message) {\n String digest = null;\n try {\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n byte[] hash = md.digest(message.getBytes(\"UTF-8\"));\n\n //converting byte array to HexadecimalString\n StringBuilder sb = new StringBuilder(2 * hash.length);\n for (byte b : hash) {\n sb.append(String.format(\"%02x\", b & 0xff));\n }\n digest = sb.toString();\n } catch (UnsupportedEncodingException ex) {\n log.error(\"UnsupportedEncodingException\",ex);\n } catch (NoSuchAlgorithmException ex) {\n log.error(\"NoSuchAlgorithmException\",ex);\n }\n\n return digest;\n }", "public static byte[] computeMD5Hash(InputStream is) throws NoSuchAlgorithmException, IOException {\n BufferedInputStream bis = new BufferedInputStream(is);\n try {\n MessageDigest messageDigest = MessageDigest.getInstance(\"MD5\");\n byte[] buffer = new byte[16384];\n int bytesRead = -1;\n while ((bytesRead = bis.read(buffer, 0, buffer.length)) != -1) {\n messageDigest.update(buffer, 0, bytesRead);\n }\n return messageDigest.digest();\n } finally {\n try {\n bis.close();\n } catch (Exception e) {\n System.err.println(\"Unable to close input stream of hash candidate: \" + e);\n }\n }\n }", "public String MD5(String md5) {\n try {\n java.security.MessageDigest md = java.security.MessageDigest.getInstance(\"MD5\");\n byte[] array = md.digest(md5.getBytes());\n StringBuffer sb = new StringBuffer();\n for (int i = 0; i < array.length; ++i) {\n sb.append(Integer.toHexString((array[i] & 0xFF) | 0x100).substring(1,3));\n }\n return sb.toString();\n } catch (java.security.NoSuchAlgorithmException e) {\n }\n return null;\n }", "private static String getMD5Checksum(String filename) throws Exception {\r\n\t\tbyte[] b = createChecksum(filename);\r\n\t\tStringBuilder result = new StringBuilder();\r\n\t\tfor (byte v : b) {\r\n\t\t\tresult.append(Integer.toString((v & 0xff) + 0x100, 16).substring(1));\r\n\t\t}\r\n\t\treturn result.toString();\r\n\t}", "public static String computeMD5Hash(String password) {\n StringBuffer MD5Hash = new StringBuffer();\n\n try {\n // Create MD5 Hash\n MessageDigest digest = MessageDigest.getInstance(\"MD5\");\n digest.update(password.getBytes());\n byte messageDigest[] = digest.digest();\n\n for (int i = 0; i < messageDigest.length; i++)\n {\n String h = Integer.toHexString(0xFF & messageDigest[i]);\n while (h.length() < 2)\n h = \"0\" + h;\n MD5Hash.append(h);\n }\n\n }\n catch (NoSuchAlgorithmException e)\n {\n e.printStackTrace();\n }\n\n return MD5Hash.toString();\n }", "public String md5(String md5StringInput) {\n try {\n java.security.MessageDigest md = java.security.MessageDigest.getInstance(\"MD5\");\n byte[] array = md.digest(md5StringInput.getBytes());\n StringBuffer sb = new StringBuffer();\n for (int i = 0; i < array.length; ++i) {\n sb.append(Integer.toHexString((array[i] & 0xFF) | 0x100).substring(1,3));\n }\n return sb.toString();\n } catch (java.security.NoSuchAlgorithmException e) {\n }\n return null;\n }", "private String md5(String input) {\r\n\t\tString md5 = null;\r\n\t\tif (null == input)\r\n\t\t\treturn null;\r\n\r\n\t\ttry {\r\n\t\t\tMessageDigest digest = MessageDigest.getInstance(\"MD5\");\r\n\t\t\tdigest.update(input.getBytes(), 0, input.length());\r\n\t\t\tmd5 = new BigInteger(1, digest.digest()).toString(16);\r\n\t\t} catch (NoSuchAlgorithmException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn md5;\r\n\t}", "public byte[] getMD5() {\n return MD5;\n }", "public static String getMD5Hash(String string) {\r\n\t\tMessageDigest digest;\r\n\t\ttry {\r\n\t\t\tdigest = java.security.MessageDigest.getInstance(\"MD5\");\r\n\t\t\tdigest.update(string.getBytes());\r\n\t\t\tfinal byte[] hash = digest.digest();\r\n\t\t\tfinal StringBuilder result = new StringBuilder(hash.length);\r\n\t\t\tfor (int i = 0; i < hash.length; i++) {\r\n\t\t\t\tresult.append(Integer.toString((hash[i] & 0xff) + 0x100, 16)\r\n\t\t\t\t\t\t.substring(1));\r\n\t\t\t}\r\n\t\t\treturn result.toString();\r\n\t\t} catch (final NoSuchAlgorithmException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn \"error\";\r\n\t\t}\r\n\t}", "static String md5test(String text,String returnType) {\n String result=null;\n if (returnType.equals(\"str\")){\n result = DigestUtils.md5Hex(text);\n System.out.println(result); // 5d41402abc4b2a76b9719d911017c592\n }else if(returnType.equals(\"byteArray\")){\n byte[] res = DigestUtils.md5(text);\n System.out.println(byteToHex(res));// 5d41402abc4b2a76b9719d911017c592\n }\n //new String((byte[]) res)\n return result;\n}", "private String md5(final String s)\n\t{\n\t\ttry {\n\t\t\t// Create MD5 Hash\n\t\t\tMessageDigest digest = MessageDigest.getInstance(\"MD5\");\n\t\t\tdigest.update(s.getBytes());\n\t\t\tbyte messageDigest[] = digest.digest();\n\n\t\t\t// Create Hex String\n\t\t\tStringBuffer hexString = new StringBuffer();\n\t\t\tfor (int i=0; i<messageDigest.length; i++) {\n\t\t\t\tString h = Integer.toHexString(0xFF & messageDigest[i]);\n\t\t\t\twhile (h.length() < 2) h = \"0\" + h;\n\t\t\t\thexString.append(h);\n\t\t\t}\n\t\t\treturn hexString.toString();\n\t\t} catch(NoSuchAlgorithmException e) {\n\t\t\t//Logger.logStackTrace(TAG,e);\n\t\t}\n\t\treturn \"\";\n\t}", "public String md5(String s) {\n try {\n // Create MD5 Hash\n MessageDigest digest = java.security.MessageDigest.getInstance(\"MD5\");\n digest.update(s.getBytes());\n byte messageDigest[] = digest.digest();\n\n // Create Hex String\n StringBuffer hexString = new StringBuffer();\n for (int i = 0; i < messageDigest.length; i++)\n hexString.append(Integer.toHexString(0xFF & messageDigest[i]));\n return hexString.toString();\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n return \"\";\n }", "private static byte[] generateMD5(String info) throws\n UnsupportedEncodingException, NoSuchAlgorithmException {\n byte[] inputData = info.getBytes(\"UTF-8\");\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n md.update(inputData);\n byte[] digest= md.digest();\n return digest;\n }", "private String md5(String message) throws java.security.NoSuchAlgorithmException\n\t{\n\t\tMessageDigest md5 = null;\n\t\ttry {\n\t\t\tmd5 = MessageDigest.getInstance(\"MD5\");\n\t\t}\n\t\tcatch (java.security.NoSuchAlgorithmException ex) {\n\t\t\tex.printStackTrace();\n\t\t\tthrow ex;\n\t\t}\n\t\tbyte[] dig = md5.digest((byte[]) message.getBytes());\n\t\tStringBuffer code = new StringBuffer();\n\t\tfor (int i = 0; i < dig.length; ++i)\n\t\t{\n\t\t\tcode.append(Integer.toHexString(0x0100 + (dig[i] & 0x00FF)).substring(1));\n\t\t}\n\t\treturn code.toString();\n\t}", "public static String computeMD5(String filename) throws Exception {\r\n byte[] b = createGenericChecksum(filename, 0);\r\n String result = \"\";\r\n for (int i = 0; i < b.length; i++) {\r\n result += Integer.toString((b[i] & 0xff) + 0x100, 16).substring(1);\r\n }\r\n return result;\r\n }", "private static String md5(final String s) {\n final String MD5 = \"MD5\";\n try {\n // Create MD5 Hash\n MessageDigest digest = java.security.MessageDigest\n .getInstance(MD5);\n digest.update(s.getBytes());\n byte messageDigest[] = digest.digest();\n\n // Create Hex String\n StringBuilder hexString = new StringBuilder();\n for (byte aMessageDigest : messageDigest) {\n String h = Integer.toHexString(0xFF & aMessageDigest);\n while (h.length() < 2)\n h = \"0\" + h;\n hexString.append(h);\n }\n return hexString.toString();\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n return \"\";\n }", "public static String createMd5(String value)\r\n\t{ \r\n\t\ttry \r\n\t\t{\r\n\t\t\tMessageDigest md = MessageDigest.getInstance(\"MD5\");\t\t\t\r\n\t\t\tbyte[] hashInBytes = md.digest(value.getBytes(StandardCharsets.UTF_8));\r\n\t\t\tStringBuilder sb = new StringBuilder();\r\n\t for (byte b : hashInBytes) \r\n\t {\r\n\t sb.append(String.format(\"%02x\", b));\r\n\t }\r\n\t return sb.toString();\r\n\t\t}\r\n\t\tcatch(Exception ex)\r\n\t\t{\r\n\t\t\t\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}", "protected static String md5(final String string) {\n try {\n final MessageDigest m = MessageDigest.getInstance(\"MD5\");\n m.update(string.getBytes(), 0, string.length());\n return new BigInteger(1, m.digest()).toString(16);\n } catch (NoSuchAlgorithmException e) {\n return \"\";\n }\n }", "public static String getMD5(String s) {\n try {\n MessageDigest m = MessageDigest.getInstance(\"MD5\");\n m.update(s.getBytes(), 0, s.length());\n return \"\" + new BigInteger(1, m.digest()).toString(16);\n } catch (NoSuchAlgorithmException e) {\n logger.error(\"MD5 is not supported !!!\");\n }\n return s;\n }", "public static String getMD5(String string) throws NoSuchAlgorithmException, IOException {\n MessageDigest md5;\n md5 = MessageDigest.getInstance(\"MD5\");\n\n try (DigestInputStream stream = new DigestInputStream(new ByteArrayInputStream(string.getBytes()), md5)) {\n byte[] buffer = new byte[8192];\n while (true) {\n if ((stream.read(buffer) == -1)) break;\n }\n StringBuilder sb = new StringBuilder();\n for (byte b : md5.digest()) {\n sb.append(Integer.toString((b & 0xff) + 0x100, 16).substring(1));\n }\n return sb.toString();\n }\n }", "public static byte[] MD5(String ran, String strKey){\n \n \tString clientSecretKey = ran + strKey;\n MessageDigest m = null;\n \n try {\n \t\n m = MessageDigest.getInstance(\"MD5\");\n \n } \n catch (NoSuchAlgorithmException ex) {\n \t\n ex.printStackTrace();\n \n }\n \n m.reset();\n m.update(clientSecretKey.getBytes());\n byte[] digest = m.digest();\n \n return digest;\n \n }", "private String getFileMd5Checksum(String filename){\n\t\ttry {\n\t\t\tbyte[] fileBytes = Files.readAllBytes(Paths.get(FILES_ROOT + filename));\n\t\t\tbyte[] fileHash = MessageDigest.getInstance(\"MD5\").digest(fileBytes);\n\n\t\t\treturn DatatypeConverter.printHexBinary(fileHash);\n\t\t} catch (IOException e) {\n\t\t\t// TODO: Handle file doesn't exist\n\t\t\treturn \"\";\n\t\t} catch (Exception e) {\n\t\t\treturn \"\";\n\t\t}\n\t}", "public static String md5(String str) {\n MessageDigest messageDigest = null;\n try {\n messageDigest = MessageDigest.getInstance(\"MD5\");\n messageDigest.reset();\n messageDigest.update(str.getBytes(\"UTF-8\"));\n } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {\n // do nothing\n }\n byte[] byteArray = messageDigest.digest();\n StringBuffer md5StrBuff = new StringBuffer();\n for (int i = 0; i < byteArray.length; i++) {\n if (Integer.toHexString(0xFF & byteArray[i]).length() == 1)\n md5StrBuff.append(\"0\").append(Integer.toHexString(0xFF & byteArray[i]));\n else\n md5StrBuff.append(Integer.toHexString(0xFF & byteArray[i]));\n }\n return md5StrBuff.toString();\n }", "private String toMD5(String password)\n {\n try {\n MessageDigest m = MessageDigest.getInstance(\"MD5\");\n \n m.update(password.getBytes(),0,password.length());\n \n return new BigInteger(1, m.digest()).toString(16);\n } catch (NoSuchAlgorithmException ex) {\n Logger.getLogger(User.class.getName()).log(Level.SEVERE, null, ex);\n }\n return \"\";\n }", "public static String md5(final String data) {\n return ByteString.encodeUtf8(data).md5().hex().toLowerCase();\n }", "public static byte[] createCheckSum(String filename) throws Exception {\n InputStream fis = new FileInputStream(filename);\n\n byte[] buffer = new byte[1024];\n MessageDigest complete = MessageDigest.getInstance(\"MD5\");\n int numRead;\n\n do {\n numRead = fis.read(buffer);\n if (numRead > 0) {\n complete.update(buffer, 0, numRead);\n }\n } while (numRead != -1);\n\n fis.close();\n // Return MD5 Hash\n return complete.digest();\n }", "public static String md5(String password){\n byte[] data = messageDigest.digest(password.getBytes());\n return byteToHex(data);\n }", "public String encodeByMD5(String string) {\n\t\t\tif (string == null) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\tMessageDigest messageDigest = MessageDigest.getInstance(\"MD5\");\r\n\t\t\t\t\r\n\t\t\t\t//使用平台的默认字符集将此 String 编码为 byte 序列,并将结果存储到一个新的 byte 数组中。\r\n\t\t\t\t//将byte数组给摘要\r\n\t\t\t\tmessageDigest.update(string.getBytes());\r\n\t\t\t\t//通过执行诸如填充之类的最终操作完成哈希计算。在调用此方法之后,摘要被重置。 \r\n\t\t\t\t//返回:\r\n\t\t\t\t//存放哈希值结果的 byte 数组。\r\n\t\t\t\t\r\n\t\t\t\treturn getFormattedText(messageDigest.digest());\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tthrow new RuntimeException(e);\r\n\t\t\t}\r\n\t\t}", "public static String encryptMD5ToString(final byte[] data) {\n return bytes2HexString(encryptMD5(data));\n }", "private static byte[] m14295fl(String str) {\n try {\n MessageDigest instance = MessageDigest.getInstance(\"MD5\");\n if (instance == null) {\n return str.getBytes();\n }\n instance.update(str.getBytes());\n return instance.digest();\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n return str.getBytes();\n }\n }", "byte[] digest();", "public static String getMd5(String input) {\n try {\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n\n byte[] messageDigest = md.digest(input.getBytes());\n\n BigInteger no = new BigInteger(1, messageDigest);\n\n String hashtext = no.toString(16);\n while (hashtext.length() < 32) {\n hashtext = \"0\" + hashtext;\n }\n return hashtext;\n } catch (NoSuchAlgorithmException e) {\n throw new RuntimeException(e);\n }\n }", "public static String getMD5Sum(String variable) throws NoSuchAlgorithmException{\t\n\t\tMessageDigest md=MessageDigest.getInstance(\"MD5\");\n\t\tmd.update(variable.getBytes());\n\t\treturn new BigInteger(1,md.digest()).toString(16);\n\t}", "private static String MD5Password(String password) {\n String md = org.apache.commons.codec.digest.DigestUtils.md5Hex(password);\n return md;\n }", "public static String md5(String pass)\n {\n try{\n MessageDigest md=MessageDigest.getInstance(\"MD5\");\n byte[] messageDigest=md.digest(pass.getBytes());\n BigInteger num=new BigInteger(1,messageDigest);\n String hashText=num.toString(16);\n while(hashText.length()<32)\n {\n hashText=\"0\"+hashText;\n } \n return hashText; \n }\n catch(Exception e)\n { \n throw new RuntimeException(e);\n } \n }", "public byte[] MD5(File archivo) throws OpenSSL_Exception {\n\t\tString[] comando = new String[]{ \"openssl\" , \"dgst\" , \"-md5\" , archivo.getAbsolutePath()};\n\t\tProcess terminal = null;\n\t\ttry { terminal = Runtime.getRuntime().exec(comando); } catch (IOException e) { \n\t\t\tthrow new OpenSSL_Exception(\"No se puede ejecutar el comando en el terminal\");\n\t\t}\n\t\t// --- > Leemos la salida error del comando\n\t\tBufferedReader errors = new BufferedReader(new InputStreamReader(terminal.getErrorStream()));\n\t\tString linea = \"\" , error = \"\" ;\n\t\ttry { while( (linea = errors.readLine()) != null) error += linea + \"\\n\"; } catch (IOException e) {\n\t\t\tthrow new OpenSSL_Exception(\"No se puede leer el error que ha producido el comando\");\n\t\t}\n\t\t// --- > Si hubo salida error lanzamos al excepcion con el error\n\t\tif(!error.equals(\"\"))throw new OpenSSL_Exception(\"Error al ejecutar el comando:\\n\" + error );\n\t\t// --- > Leemos el resultado obtenido\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(terminal.getInputStream()));\n\t\tString res = \"\";\n\t\ttry { while((linea = in.readLine()) != null) res += linea; } catch (IOException e) {\n\t\t\tthrow new OpenSSL_Exception(\"No se puede leer el resultado que ha producido el comando\");\n\t\t}\n\t\treturn res.substring(res.lastIndexOf(\" \") + 1 ).getBytes();\n\t}", "public static String getmd5(String saltedPassword) {\n\t\tmd5MessageDigest.get().update(saltedPassword.getBytes());\n\t\treturn toHex(md5MessageDigest.get().digest());\n\t}", "public byte[] MD5(String texto) throws OpenSSL_Exception {\n\t\tString[] comando = new String[]{ \"openssl\" , \"dgst\" , \"-md5\"};\n\t\tProcess terminal = null;\n\t\ttry { terminal = Runtime.getRuntime().exec(comando); } catch (IOException e) { \n\t\t\tthrow new OpenSSL_Exception(\"No se puede ejecutar el comando en el terminal\");\n\t\t}\n\t\t// --- > Mandamos el texto \n\t\tPrintWriter out = new PrintWriter(terminal.getOutputStream());\n\t\tout.print(texto);\n\t\tout.flush();\n\t\tout.close();\n\t\t// --- > Leemos la salida error del comando\n\t\tBufferedReader errors = new BufferedReader(new InputStreamReader(terminal.getErrorStream()));\n\t\tString linea = \"\" , error = \"\" ;\n\t\ttry { while( (linea = errors.readLine()) != null) error += linea + \"\\n\"; } catch (IOException e) {\n\t\t\tthrow new OpenSSL_Exception(\"No se puede leer el error que ha producido el comando\");\n\t\t}\n\t\t// --- > Si hubo salida error lanzamos al excepcion con el error\n\t\tif(!error.equals(\"\"))throw new OpenSSL_Exception(\"Error al ejecutar el comando:\\n\" + error );\n\t\t// --- > Leemos el resultado obtenido\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(terminal.getInputStream()));\n\t\tString res = \"\";\n\t\ttry { while((linea = in.readLine()) != null) res += linea; } catch (IOException e) {\n\t\t\tthrow new OpenSSL_Exception(\"No se puede leer el resultado que ha producido el comando\");\n\t\t}\n\t\treturn res.getBytes();\n\t}", "public MD5(String texto) throws Exception {\n this.md5 = MessageDigest.getInstance(\"MD5\");\n this.texto = texto;\n this.byTexto = texto.getBytes();\n calcMD5();\n }", "public String getMD5() {\n return hash;\n }", "static String generateChecksum(String filename) {\n\n try {\n // Instantiating file and Hashing Algorithm.\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n FileInputStream file = new FileInputStream(filename);\n\n // Generation of checksum.\n byte[] dataBytes = new byte[1024];\n int nread;\n\n while ((nread = file.read(dataBytes)) != -1) {\n md.update(dataBytes, 0, nread);\n }\n\n byte[] mdbytes = md.digest();\n\n // Convert byte to hex.\n StringBuilder hexString = new StringBuilder();\n\n for (byte mdbyte : mdbytes) {\n String hex = Integer.toHexString(0xff & mdbyte);\n if (hex.length() == 1) hexString.append('0');\n hexString.append(hex);\n }\n\n // Return checksum as completed string.\n return hexString.toString();\n\n } catch (NoSuchAlgorithmException | IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public static String getStringMD5(String src) {\n\t\tMessageDigest messageDigest = null;\n\t\tbyte[] srcBytes = src.getBytes();\n\t\ttry {\n\t\t\tmessageDigest = MessageDigest.getInstance(\"MD5\");\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tmessageDigest.update(srcBytes, 0, srcBytes.length);\n\t\tBigInteger bigInt = new BigInteger(1, messageDigest.digest());\n\t\treturn bigInt.toString(16);\n\t}", "public String getMD5(String txt){\n String md5output;\n md5output = txt;\n try {\n MessageDigest m = MessageDigest.getInstance(\"MD5\");\n m.reset();\n m.update(md5output.getBytes());\n byte[] digest = m.digest();\n BigInteger bigInt = new BigInteger(1,digest);\n md5output = bigInt.toString(16);\n } catch (Exception e) {\n md5output = null;\n } finally{\n return md5output;\n }\n \n }", "public static String md5(String inputFile) {\r\n String md5 = null;\r\n logger.debug(\"Start to calculate hashcode (SHA1) for {}\", inputFile);\r\n try (DigestInputStream digestIn = new DigestInputStream(new FileInputStream(inputFile),\r\n MessageDigest.getInstance(\"SHA1\"))) {\r\n byte[] buffer = new byte[1024 * 1024];\r\n while (digestIn.read(buffer) > 0) {\r\n // do nothing\r\n }\r\n md5 = toHexString(digestIn.getMessageDigest().digest());\r\n } catch (NoSuchAlgorithmException | IOException e) {\r\n logger.warn(\"Fail to md5 for {} ({})\", inputFile, e.getMessage());\r\n }\r\n logger.debug(\"End to calculate hashcode (SHA1) for {}, {}\", inputFile, md5);\r\n return md5;\r\n }", "public static String computeMD5FileHash (File file) throws Exception {\n byte[] b = createFileChecksum(file);\n String result = \"\";\n\n for (int i=0; i < b.length; i++) {\n result += Integer.toString( ( b[i] & 0xff ) + 0x100, 16).substring( 1 );\n }\n return result;\n }", "public static String calcHash(String input) {\n try {\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n md.update(input.toLowerCase().getBytes(\"UTF8\"));\n byte[] digest = md.digest();\n StringBuilder sb = new StringBuilder();\n for (byte b : digest) {\n sb.append(hexDigit(b>>4));\n sb.append(hexDigit(b));\n }\n return sb.toString();\n } catch (Exception ex) {\n throw new RuntimeException(ex.getMessage(), ex);\n }\n }", "private static String md5(String str) {\n\n if (str == null) {\n return null;\n }\n\n MessageDigest messageDigest = null;\n\n try {\n messageDigest = MessageDigest.getInstance(HttpConf.signType);\n messageDigest.reset();\n messageDigest.update(str.getBytes(HttpConf.charset));\n } catch (NoSuchAlgorithmException e) {\n\n return str;\n } catch (UnsupportedEncodingException e) {\n return str;\n }\n\n byte[] byteArray = messageDigest.digest();\n\n StringBuffer md5StrBuff = new StringBuffer();\n\n for (int i = 0; i < byteArray.length; i++) {\n if (Integer.toHexString(0xFF & byteArray[i]).length() == 1) {\n md5StrBuff.append(\"0\").append(Integer.toHexString(0xFF & byteArray[i]));\n } else {\n md5StrBuff.append(Integer.toHexString(0xFF & byteArray[i]));\n }\n }\n\n return md5StrBuff.toString();\n }", "public static String toMD5(final String str) {\n\t\treturn MD5.toMD5(str);\n\n\t\t//linux下常有不同结果故弃之\n\t\t//return CryptTool.md5Digest(str);\n\t}", "public static String encryptedByMD5(String password) {\n StringBuilder result = new StringBuilder();\n try {\n byte[] pass = MessageDigest\n .getInstance(\"MD5\")\n .digest(password.getBytes());\n\n for (byte b : pass) {\n int salt = b & 0xCA; //Salt\n String saltString = Integer.toHexString(salt);\n if (1 == saltString.length()) {\n result.append(\"0\");\n }\n result.append(saltString);\n }\n return result.toString();\n } catch (NoSuchAlgorithmException e) {\n LOG.error(\"No MD5 Algorithm in this System! \", e);\n throw new RuntimeException(\"Could not encrypt the user password in this system!\", e);\n }\n }", "public static String getFileMD5(String path) {\n\t\treturn getFileMD5(new File(path));\n\t}", "public static MessageDigest getMessageDigest ()\n {\n try {\n return MessageDigest.getInstance(\"MD5\");\n } catch (NoSuchAlgorithmException nsae) {\n throw new RuntimeException(\"JVM does not support MD5. Gurp!\");\n }\n }", "byte[] getDigest();", "public static String getFileMD5(File file) {\n\t\tMessageDigest messageDigest = null;\n\t\tFileInputStream fileInStream = null;\n\t\tbyte buffer[] = new byte[1024];\n\t\tint length = -1;\n\t\ttry {\n\t\t\tmessageDigest = MessageDigest.getInstance(\"MD5\");\n\t\t\tfileInStream = new FileInputStream(file);\n\t\t\twhile ((length = fileInStream.read(buffer, 0, 1024)) != -1) {\n\t\t\t\tmessageDigest.update(buffer, 0, length);\n\t\t\t}\n\t\t\tfileInStream.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t\tBigInteger bigInt = new BigInteger(1, messageDigest.digest());\n\t\treturn bigInt.toString(16);\n\t}", "public byte[] macAlgorithm(SecretKey encryptionkey, byte[] message) throws Exception\n {\n Mac mac = Mac.getInstance(\"HmacMD5\");\t\t// MAC mode\n mac.init(encryptionkey);\t\t// Initialize mac\n\n byte[] digest = mac.doFinal(message);\t\t// Finish the MAC Operation\n return digest;\n }", "public static String str2MD5(String strs) {\n StringBuffer sb = new StringBuffer();\n try {\n MessageDigest digest = MessageDigest.getInstance(\"MD5\");\n byte[] bs = digest.digest(strs.getBytes());\n /*\n * after encryption is -128 to 127 ,is not safe\n * use it to binary operation,get new encryption result\n *\n * 0000 0011 0000 0100 0010 0000 0110 0001\n * &0000 0000 0000 0000 0000 0000 1111 1111\n * ---------------------------------------------\n * 0000 0000 0000 0000 0000 0000 0110 0001\n *\n * change to 16 bit\n */\n for (byte b : bs) {\n int x = b & 255;\n String s = Integer.toHexString(x);\n if (x < 16) {\n sb.append(\"0\");\n }\n sb.append(s);\n }\n\n } catch (Exception e) {\n System.out.println(\"encryption lose\");\n }\n return sb.toString();\n }", "public String getMD5Checksum(String pid, String dsName) throws FedoraException, IOException {\r\n try {\r\n return getDatastreamProperty(pid, dsName, DatastreamProfile.DatastreamProperty.DS_CHECKSUM);\r\n } catch (XPathExpressionException ex) {\r\n throw new FedoraException(ex);\r\n } catch (SAXException ex) {\r\n throw new FedoraException(ex);\r\n } catch (ParserConfigurationException ex) {\r\n throw new FedoraException(ex);\r\n }\r\n }", "private byte[] getCheckSum(byte[] checksum){\r\n\treturn Arrays.copyOfRange(checksum, 0, 4);\r\n}", "public static String encryptMD5(String st) {\n MessageDigest messageDigest;\n byte[] digest = new byte[0];\n try {\n messageDigest = MessageDigest.getInstance(DefaultValueConstants.DEFAULT_ENCRYPTING_ALGORITHM);\n messageDigest.reset();\n messageDigest.update(st.getBytes());\n digest = messageDigest.digest();\n } catch (NoSuchAlgorithmException e) {\n log.error(e);\n }\n BigInteger bigInt = new BigInteger(1, digest);\n String md5Hex = bigInt.toString(16);\n while (md5Hex.length() < 32) {\n md5Hex = \"0\" + md5Hex;\n }\n return md5Hex;\n }", "protected String getMd5Hash(String token) {\n\n MessageDigest m;\n\t\ttry {\n\t\t\tm = MessageDigest.getInstance(\"MD5\");\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\tthrow new IllegalStateException(e);\n\t\t}\n m.update(token.getBytes());\n \n byte[] digest = m.digest();\n BigInteger bigInt = new BigInteger(1,digest);\n String hashtext = bigInt.toString(16);\n \n // Now we need to zero pad it if you actually want the full 32 chars.\n while(hashtext.length() < 32 ){\n hashtext = \"0\"+hashtext;\n }\n \n return hashtext;\n\t}", "public static byte[] encodeWithMD5(String origin) throws NoSuchAlgorithmException {\n return encode(origin, MD5Utils.MD5);\n }", "private byte[] digestMsg(byte[][] parsedMsg) {\n\n int a, b, c, d, e, f, g, h;\n int[] hashValues = new int[8];\n\n // Initialize hash values for the first iteration, as per section 5.3.3\n System.arraycopy(H, 0, hashValues, 0, 8);\n\n // Iterate through the input message blocks\n for (int i = 0; i < parsedMsg.length; i++) {\n // 1. Prepare message schedule\n fillWords(parsedMsg[i]);\n\n // 2. Initialize working variables with hash values of previous iteration\n a = hashValues[0];\n b = hashValues[1];\n c = hashValues[2];\n d = hashValues[3];\n e = hashValues[4];\n f = hashValues[5];\n g = hashValues[6];\n h = hashValues[7];\n\n // 3. Compute updated working variables\n for (int t = 0; t < 64; t++) {\n int T1 = h + Sum1(e) + Ch(e, f, g) + K[t] + words[t];\n int T2 = Sum0(a) + Maj(a, b, c);\n h = g;\n g = f;\n f = e;\n e = d + T1;\n d = c;\n c = b;\n b = a;\n a = T1 + T2;\n }\n\n // 4. Update hash values\n hashValues[0] = a + hashValues[0];\n hashValues[1] = b + hashValues[1];\n hashValues[2] = c + hashValues[2];\n hashValues[3] = d + hashValues[3];\n hashValues[4] = e + hashValues[4];\n hashValues[5] = f + hashValues[5];\n hashValues[6] = g + hashValues[6];\n hashValues[7] = h + hashValues[7];\n }\n\n\n // Finalize the hash value\n // Concatenate the hash values to one 256-bit output byte[]\n byte[] digest = new byte[32];\n for (int i = 0; i < 8; i++) {\n System.arraycopy(intToBytes(hashValues[i]), 0, digest, 4 * i, 4);\n }\n\n return digest;\n }", "public String getMd5Hash() {\n return md5Hash;\n }", "public synchronized byte[] generateMd5Bytes(Item item) throws Exception {\n\t\tif(profile == null) {\n\t\t\tthrow new IllegalArgumentException(\"profile cannot be null, please provide a profile by calling setProfile(MetadataProfile profile) before calling this method\");\n\t\t}\n\t\t\n\t\tfor(MetadataItem field : profile.getMetadata()) {\n\t\t\tString fieldValue = field.evaluate(item);\n\t\t\tif(fieldValue != null) {\n\t\t\t\tmd5Digester.update(fieldValue.getBytes());\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(includeItemText) {\n\t\t\tmd5Digester.update(item.getTextObject().toString().getBytes(Charset.forName(\"utf8\")));\n\t\t}\n\t\t\n\t\t// Capture our result and then cleanup for the next call\n\t\tbyte[] result = md5Digester.digest();\n\t\tmd5Digester.reset();\n\t\t\n\t\treturn result;\n\t}", "public static String hash(String data) {\n\t MessageDigest md;\n\t\ttry {\n\t\t\tmd = MessageDigest.getInstance(\"MD5\");\n\t\t md.update(data.getBytes());\n\t\t byte[] digest = md.digest();\n\t\t char[] HEX_ARRAY = \"0123456789ABCDEF\".toCharArray();\n\t char[] hexChars = new char[digest.length * 2];\n\t for (int j = 0; j < digest.length; j++) {\n\t int v = digest[j] & 0xFF;\n\t hexChars[j * 2] = HEX_ARRAY[v >>> 4];\n\t hexChars[j * 2 + 1] = HEX_ARRAY[v & 0x0F];\n\t }\n\t return new String(hexChars);\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n return null;\n\t}", "public static String getMD5(File file) throws IOException, NoSuchAlgorithmException {\n return getChecksum(file, MessageDigest.getInstance(\"MD5\"));\n }", "public static String getMobileAdminPasswordMD5(){\n\t\treturn \"e3e6c68051fdfdf177c8933bfd76de48\";\n\t}", "private String computeDigest(boolean paramBoolean, String paramString1, char[] paramArrayOfchar, String paramString2, String paramString3, String paramString4, String paramString5, String paramString6, String paramString7) throws NoSuchAlgorithmException {\n/* 470 */ String str1, str3, str5, str2 = this.params.getAlgorithm();\n/* 471 */ boolean bool = str2.equalsIgnoreCase(\"MD5-sess\");\n/* */ \n/* 473 */ MessageDigest messageDigest = MessageDigest.getInstance(bool ? \"MD5\" : str2);\n/* */ \n/* 475 */ if (bool) {\n/* 476 */ if ((str1 = this.params.getCachedHA1()) == null) {\n/* 477 */ str3 = paramString1 + \":\" + paramString2 + \":\";\n/* 478 */ String str7 = encode(str3, paramArrayOfchar, messageDigest);\n/* 479 */ String str6 = str7 + \":\" + paramString5 + \":\" + paramString6;\n/* 480 */ str1 = encode(str6, (char[])null, messageDigest);\n/* 481 */ this.params.setCachedHA1(str1);\n/* */ } \n/* */ } else {\n/* 484 */ String str = paramString1 + \":\" + paramString2 + \":\";\n/* 485 */ str1 = encode(str, paramArrayOfchar, messageDigest);\n/* */ } \n/* */ \n/* */ \n/* 489 */ if (paramBoolean) {\n/* 490 */ str3 = paramString3 + \":\" + paramString4;\n/* */ } else {\n/* 492 */ str3 = \":\" + paramString4;\n/* */ } \n/* 494 */ String str4 = encode(str3, (char[])null, messageDigest);\n/* */ \n/* */ \n/* 497 */ if (this.params.authQop()) {\n/* 498 */ str5 = str1 + \":\" + paramString5 + \":\" + paramString7 + \":\" + paramString6 + \":auth:\" + str4;\n/* */ }\n/* */ else {\n/* */ \n/* 502 */ str5 = str1 + \":\" + paramString5 + \":\" + str4;\n/* */ } \n/* */ \n/* */ \n/* 506 */ return encode(str5, (char[])null, messageDigest);\n/* */ }", "public static byte[] digestPassword(String password) {\n byte[] b = password.getBytes();\n try {\n java.security.MessageDigest digest = java.security.MessageDigest.getInstance(\"MD5\");\n synchronized (digest) {\n digest.reset();\n b = digest.digest(password.getBytes());\n }\n } catch (java.security.NoSuchAlgorithmException nsa) {\n }\n return b;\n }", "private String m34493b(String str) {\n MessageDigest a = m34492a(\"MD5\");\n a.update(str.getBytes(\"UTF-8\"));\n return m34494b(a.digest());\n }", "public String byteArrayToCheckSum(byte[] byteArray)\n/* */ {\n/* 305 */ char[] hexDigits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };\n/* */ \n/* */ \n/* 308 */ char[] resultCharArray = new char[byteArray.length * 2];\n/* */ \n/* 310 */ int index = 0;\n/* 311 */ for (byte b : byteArray)\n/* */ {\n/* 313 */ resultCharArray[(index++)] = hexDigits[(b >>> 4 & 0xF)];\n/* 314 */ resultCharArray[(index++)] = hexDigits[(b & 0xF)];\n/* */ }\n/* */ \n/* */ \n/* 318 */ return new String(resultCharArray);\n/* */ }", "public static void md5(File outputFile) throws ConverterException {\r\n\t\ttry {\r\n\t\t\tFileInputStream fileInputStream = new FileInputStream(outputFile);\r\n\t\t\tBufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);\r\n\t\t\t\r\n\t\t\tbyte[] datei = bufferedInputStream.readAllBytes();\r\n\t\t\tMessageDigest md = MessageDigest.getInstance(\"MD5\");\r\n\t\t\tbyte[] md5 = md.digest(datei);\r\n\t\t\tfor (int i = 0; i < md5.length; i++) {\r\n\t\t\t\tSystem.out.print(String.format(\"%02X\", md5[i]));\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\" File Length: \" + outputFile.length());\r\n\t\t\tSystem.out.println();\r\n\t\t\t\r\n\t\t\tbufferedInputStream.close();\r\n\t\t\tfileInputStream.close();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tthrow new ConverterException(\"Datei kann nicht gefunden werden\");\r\n\t\t} catch (IOException e) {\r\n\t\t\tthrow new ConverterException(\"Beim Lesen der Datei ist ein Fehler aufgetreten\");\r\n\t\t} catch (NoSuchAlgorithmException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "protected byte[] getHMAC(byte[] Ki, byte[] seqnum, byte[] msg, int start, int len) throws SaslException {\n byte[] seqAndMsg = new byte[4 + len];\n System.arraycopy(seqnum, 0, seqAndMsg, 0, 4);\n System.arraycopy(msg, start, seqAndMsg, 4, len);\n try {\n SecretKey keyKi = new SecretKeySpec(Ki, \"HmacMD5\");\n Mac m = Mac.getInstance(\"HmacMD5\");\n m.init(keyKi);\n m.update(seqAndMsg);\n byte[] hMAC_MD5 = m.doFinal();\n byte macBuffer[] = new byte[10];\n System.arraycopy(hMAC_MD5, 0, macBuffer, 0, 10);\n return macBuffer;\n } catch (InvalidKeyException e) {\n throw new SaslException(\"DIGEST-MD5: Invalid bytes used for \" + \"key of HMAC-MD5 hash.\", e);\n } catch (NoSuchAlgorithmException e) {\n throw new SaslException(\"DIGEST-MD5: Error creating \" + \"instance of MD5 digest algorithm\", e);\n }\n }", "public static String computeOnce(String str) {\n str = (str == null) ? \"\" : str;\n MessageDigest md5 = null;\n try {\n md5 = MessageDigest.getInstance(\"MD5\");\n } catch (Exception e) {\n throw new ExternalException();\n }\n // convert input String to a char[]\n // convert that char[] to byte[]\n // get the md5 digest as byte[]\n // bit-wise AND that byte[] with 0xff\n // prepend \"0\" to the output StringBuffer to make sure that we don't end\n // up with\n // something like \"e21ff\" instead of \"e201ff\"\n\n char[] charArray = str.toCharArray();\n\n byte[] byteArray = new byte[charArray.length];\n\n for (int i = 0; i < charArray.length; i++)\n byteArray[i] = (byte) charArray[i];\n\n byte[] md5Bytes = md5.digest(byteArray);\n\n StringBuffer hexValue = new StringBuffer();\n\n for (int i = 0; i < md5Bytes.length; i++) {\n int val = (md5Bytes[i]) & 0xff;\n if (val < 16)\n hexValue.append(\"0\");\n hexValue.append(Integer.toHexString(val));\n }\n\n return hexValue.toString();\n }", "public byte[] getContentMd5() {\n return CoreUtils.clone(this.contentMd5);\n }", "private static String getFileChecksum(File file) throws IOException, NoSuchAlgorithmException {\n FileInputStream fis = new FileInputStream(file);\n\n // Use MD5 algorithm\n MessageDigest digest = MessageDigest.getInstance(\"MD5\");\n\n // Create byte array to read data in chunks\n byte[] byteArray = new byte[1024];\n int bytesCount = 0;\n\n // Read file data and update in message digest\n while ((bytesCount = fis.read(byteArray)) != -1) {\n digest.update(byteArray, 0, bytesCount);\n }\n ;\n\n // close the stream; We don't need it now.\n fis.close();\n\n // Get the hash's bytes\n byte[] bytes = digest.digest();\n\n // This bytes[] has bytes in decimal format;\n // Convert it to hexadecimal format\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < bytes.length; i++) {\n sb.append(Integer.toString((bytes[i] & 0xff) + 0x100, 16).substring(1));\n }\n\n // return complete hash\n return sb.toString();\n }", "public void atualizarMD5(String pMd5) throws ACBrException {\n int ret = ACBrAACInterop.INSTANCE.AAC_AtualizarMD5(getHandle(), toUTF8(pMd5));\n checkResult(ret);\n }", "public static String fileMD5(File file) {\n\t\tFileInputStream fis = null;\n\t\tString md5 = null;\n\t\ttry {\n\t\t\tfis = new FileInputStream(file);\n\t\t\tmd5 = org.apache.commons.codec.digest.DigestUtils.md5Hex(fis);\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"!!!\", e);\n\t\t} finally {\n\t\t\tCloseUtils.close(fis);\n\t\t}\n\t\treturn md5;\n\t}", "public static byte[] encryptHmacMD5(final byte[] data, final byte[] key) {\n return hmacTemplate(data, key, \"HmacMD5\");\n }", "public static String getFileMD5(File file) {\n if (!file.isFile()) {\n return null;\n }\n MessageDigest digest = null;\n FileInputStream in = null;\n byte buffer[] = new byte[1024];\n int len;\n try {\n digest = MessageDigest.getInstance(\"MD5\");\n in = new FileInputStream(file);\n while ((len = in.read(buffer, 0, 1024)) != -1) {\n digest.update(buffer, 0, len);\n }\n in.close();\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n BigInteger bigInt = new BigInteger(1, digest.digest());\n String md5 = bigInt.toString(16);\n while (md5.length() < 32)\n md5 = \"0\" + md5;\n return md5;\n }", "public String get_Md5_Hash(String sStringToEncode) throws Exception {\n String sRetval = \"\";\n StringBuffer sb = new StringBuffer();\n\n try {\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n byte[] messageDigest = md.digest(sStringToEncode.getBytes(\"UTF-8\"));\n BigInteger number = new BigInteger(1, messageDigest);\n String hashtext = number.toString(16);\n sRetval = hashtext;\n } catch (Exception e) {\n throw new Exception(\"get_Md5_Hash : \" + e);\n }\n return sRetval;\n }", "private static long calculateChecksum(final byte[] array) {\n final long crc;\n\n if ((array != null) && (array.length > 0)) {\n final Checksum checksum = new CRC32();\n checksum.update(array, 0, array.length);\n\n crc = checksum.getValue();\n } else {\n crc = 0;\n }\n\n return crc;\n }", "public byte[] getHash()\n\t{\n\t\treturn md5.getHash();\n\t}", "protected void md5file(File file) throws IOException {\n if (file.isDirectory()) {\n throw new IllegalArgumentException(\"Only files can be check summed !\");\n }\n\n // calculating the output\n byte[] md5 = DigestUtils.md5(new FileInputStream(file));\n\n // getting the output file\n File outputFile = new File(file.getAbsolutePath() + \".md5\");\n Files.write(Paths.get(outputFile.getAbsolutePath()), md5);\n\n }", "public String getMD5ForGame(String gameId) {\n return \"TODO\";\n }", "public static byte[] encryptMD5File(final File file) {\n if (file == null) return null;\n FileInputStream fis = null;\n DigestInputStream digestInputStream;\n try {\n fis = new FileInputStream(file);\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n digestInputStream = new DigestInputStream(fis, md);\n byte[] buffer = new byte[256 * 1024];\n while (true) {\n if (!(digestInputStream.read(buffer) > 0)) break;\n }\n md = digestInputStream.getMessageDigest();\n return md.digest();\n } catch (NoSuchAlgorithmException | IOException e) {\n e.printStackTrace();\n return null;\n } finally {\n try {\n if (fis != null) {\n fis.close();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "java.lang.String getChecksum();", "public static String md5PasswordCrypt(String password) throws AutoDeployException {\n try {\n byte[] hash = MessageDigest.getInstance(\"MD5\").digest(password.getBytes());\n StringBuffer hashString = new StringBuffer();\n for (int i = 0; i < hash.length; i++) {\n String hex = Integer.toHexString(hash[i]);\n if (hex.length() == 1) {\n hashString.append('0');\n hashString.append(hex.charAt(hex.length() - 1));\n } else {\n hashString.append(hex.substring(hex.length() - 2));\n }\n }\n return hashString.toString();\n } catch (Exception e) {\n log.error(\"Can't crypt the password due to an unexpected error : \" + e.getMessage());\n throw new AutoDeployException(\"Cant' crypt the password due to an unexpected error : \" + e.getMessage());\n }\n }", "public static String fileMD5(String filePath) {\n\t\tFileInputStream fis = null;\n\t\tString md5 = null;\n\t\ttry {\n\t\t\tfis = new FileInputStream(new File(filePath));\n\t\t\tmd5 = org.apache.commons.codec.digest.DigestUtils.md5Hex(fis);\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"!!!\", e);\n\t\t} finally {\n\t\t\tCloseUtils.close(fis);\n\t\t}\n\t\treturn md5;\n\t}", "public String getHash(String str) throws Exception{\n\t\t\n\t\tMessageDigest md = MessageDigest.getInstance(\"MD5\");\n md.update(str.getBytes());\n \n byte byteData[] = md.digest();\n \n //convert the byte to hex format method 1\n StringBuffer sb = new StringBuffer();\n for (int i = 0; i < byteData.length; i++) {\n sb.append(Integer.toString((byteData[i] & 0xff) + 0x100, 16).substring(1));\n }\n \n String hex = sb.toString();\n System.out.println(hex);\n return hex; \n}", "public void setMD5Result(String md5) throws FrameException {\n \tinfoElements.put(new Integer(InfoElement.MD5_RESULT), md5.getBytes());\n }", "public MD5Hash(String s) {\n\t\tif(s.length() != 32) throw new IllegalArgumentException(\"Hash must have 32 characters\");\n\t\thashString = s;\n\t}", "public static String checksum(byte[] bytes) {\n MessageDigest messageDigest = null;\n\n try {\n messageDigest = MessageDigest.getInstance(\"SHA1\");\n } catch (final NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n\n if (messageDigest == null) {\n return null;\n }\n\n messageDigest.update(bytes);\n final byte[] mdbytes = messageDigest.digest();\n\n // convert the byte to hex format\n final StringBuffer sb = new StringBuffer(\"\");\n\n for (int i = 0; i < mdbytes.length; i++) {\n sb.append(Integer.toString((mdbytes[i] & 0xff) + 0x100, 16).substring(1));\n }\n\n return sb.toString();\n }", "public static byte[] doubleDigest(byte[] input, int offset, int length) {\n synchronized (digest) {\n digest.reset();\n digest.update(input, offset, length);\n byte[] first = digest.digest();\n return digest.digest(first);\n }\n }", "public static byte[] doubleDigest(byte[] input) {\n\t\treturn digest(digest(input));\n\t}", "public static byte[] digest(byte contents[][]) {\n CCNDigestHelper dh = new CCNDigestHelper();\n for (int i = 0; i < contents.length; ++i) {\n if (null != contents[i]) dh.update(contents[i], 0, contents[i].length);\n }\n return dh.digest();\n }", "public String getHash(final String password) throws NoSuchAlgorithmException, UnsupportedEncodingException {\n final MessageDigest digest = MessageDigest.getInstance(\"MD5\");\n byte[] md5hash;\n digest.update(password.getBytes(\"utf-8\"), 0, password.length());\n md5hash = digest.digest();\n return convertToHex(md5hash);\n }" ]
[ "0.76019365", "0.72932655", "0.6905904", "0.6886757", "0.687514", "0.6714659", "0.67101455", "0.66962993", "0.66317225", "0.65178984", "0.650664", "0.64962137", "0.6484929", "0.6458433", "0.64561903", "0.6449335", "0.6448639", "0.6443883", "0.6414999", "0.64062685", "0.6391587", "0.6373393", "0.6355962", "0.6348151", "0.6325852", "0.6323849", "0.6311357", "0.6308401", "0.62417126", "0.62306654", "0.6227433", "0.6221382", "0.62169546", "0.61865675", "0.6175123", "0.6168109", "0.61544615", "0.6149038", "0.61180764", "0.60857683", "0.6049332", "0.5992342", "0.5970627", "0.59499246", "0.59324056", "0.5913124", "0.59064364", "0.58921206", "0.58841294", "0.5883857", "0.5859825", "0.5840923", "0.5832861", "0.5825758", "0.5802425", "0.5800228", "0.57688445", "0.5757467", "0.5700959", "0.5677018", "0.5667465", "0.5655347", "0.5653332", "0.56507516", "0.564296", "0.5641048", "0.56373453", "0.5629244", "0.5624407", "0.5622439", "0.5613471", "0.56117207", "0.56112534", "0.5595839", "0.5595115", "0.5590211", "0.5581727", "0.5577885", "0.5571853", "0.55612266", "0.5552657", "0.5519599", "0.55092955", "0.54952043", "0.54931796", "0.549047", "0.5489377", "0.5488672", "0.5475906", "0.5471223", "0.54702514", "0.54473734", "0.5438113", "0.5433473", "0.54299057", "0.54212797", "0.5404577", "0.5387545", "0.5386686", "0.5370529" ]
0.7588894
1
Writes the given message to the log file.
private static void writeLog(String s) { if (logFile == null) createLogFile(); LogTools.println(s); LogTools.flush(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void writeToLogFile(String message)\r\n {\n try\r\n {\r\n logWriter.write(message);\r\n logWriter.newLine();\r\n }\r\n catch (Exception ex)\r\n {\r\n System.out.println(\"Error writing message '\" + message +\r\n \"' to log file : \" + ex.getMessage());\r\n System.exit(1);\r\n }\r\n }", "private static void write(String message) {\n\t\tFile log = new File(filePath);\t// File for the database log\n\t\tboolean isNew = false;\t\t\t// Stores if the file created is a new or an old one\n\t\t\n\t\ttry {\n\t\t\tif (!log.exists()) {\n\t\t\t\tisNew = log.createNewFile();\n\t\t\t} // End if\n\t\t\tPrintWriter pw = new PrintWriter(new FileWriter(log, true));\n\t\t\t\n\t\t\tif (Boolean.TRUE.equals(isNew)) {\n\t\t\t\tpw.append(\"Database operations log:\");\n\t\t\t} // End if\n\t\t\tpw.append(message);\n\t\t\tpw.close();\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public synchronized void writeLogMessage(String message){\n\t\tTimestamp timeStamp= new Timestamp(System.currentTimeMillis());\n\t\tString key = this.sessionName + \" \" + timeStamp;\n\t\tString value = message; \n\t\ttry {\n\t\t\tPrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(this.filename, true)));\n\t\t\tout.println(key + \" : \" + value);\n\t\t\tout.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"There was an error writing to the log\");\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\n\t}", "public void log(String message)\n {\n try \n {\n BufferedWriter errorLogWriter = new BufferedWriter(new FileWriter(this.errorLog));\n errorLogWriter.write(Logger.dateFormat.format(Calendar.getInstance().getTime()));\n errorLogWriter.write(message);\n errorLogWriter.close();\n }\n catch (IOException ex)\n {\n System.err.println(\"Cannot write into log : \" + ex.getMessage());\n }\n }", "public static void log(String message) {\n\t\t\r\n\t\ttry{\r\n\t\t if(!log.exists()){\r\n\t\t System.out.println(\"We had to make a new file.\");\r\n\t\t log.createNewFile();\r\n\t\t }\r\n\r\n\t\t FileWriter fileWriter = new FileWriter(log, !firstWrite);\r\n\r\n\t\t BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);\r\n\t\t bufferedWriter.write(message + '\\n');\r\n\t\t bufferedWriter.close();\r\n\t\t} catch(IOException e) {\r\n\t\t System.out.println(\"COULD NOT LOG!!\");\r\n\t\t}\r\n\t\t\r\n\t\tfirstWrite = false;\r\n\t}", "public void logInFile(String message) {\n\t\ttry {\n\t\t\tFile logFile = new File(\"exceptionLog.txt\");\n\t\t\tfw = new FileWriter(logFile,true);\n\t\t\tfw.write(message);\n\t\t\tfw.close();\n\t\t}catch(IOException e) {\n\t\t\te.getStackTrace();\n\t\t}\n\t}", "private static void addToLog(String message) {\n\t\ttry {\n\t\t\tDateFormat df = new SimpleDateFormat(\"dd/MM/yy HH:mm:ss:SS\");\n\t\t\tDate dateobj = new Date();\n\t\t\tlog.write(df.format(dateobj) + \": \" + message + \"\\n\");\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Error With the Log File\");\n\t\t\tSystem.err.println(\"Exiting...\");\n\t\t\tSystem.exit(1);\n\t\t};\n\t}", "private void writeToLog(String logMessage) throws IOException {\n\t\tLogWriter.write(logMessage);\n\t\tLogWriter.newLine();\n\t}", "public static void writeToLog(String filename,String log)\r\n\t{\n\t\ttry \r\n\t\t{\r\n\t\t\tString str = log + \" at \" + new Date() + \"\\n\";\r\n\t\t\tFiles.write(Paths.get(\"log.log\"),str.getBytes(),StandardOpenOption.APPEND);\r\n\t\t\t/*PrintWriter out = new PrintWriter(f);\r\n\t\t\tout.append(log + \" at \" + new Date());\r\n\t\t\tout.flush();\r\n\t\t\tout.close();*/\r\n\t\t} \r\n\t\tcatch (FileNotFoundException e) \r\n\t\t{\r\n\t\t\tSystem.err.println(\"FNE: \" + e.getMessage());\r\n\t\t} \r\n\t\tcatch (IOException e)\r\n\t\t{\r\n\t\t\tSystem.err.println(\"IOE: \" + e.getMessage());\r\n\t\t}\r\n\t\t\r\n\t}", "public void writeToFile(String messageToWrite) throws IOException {\n writer.write(messageToWrite);\n }", "public static void log(String message) {\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\");\n Timestamp timestamp = new Timestamp(System.currentTimeMillis());\n String log = sdf.format(timestamp) + \" - \" + message;\n System.out.println(log);\n try {\n writeLogToFile(log, LOG_FILE_PATH);\n } catch (IOException e) {\n System.err.println(e.getMessage());\n }\n }", "private static void writeToFile(final String message, final File toFile) {\n toFile.getParentFile().mkdirs();\n BufferedWriter writer = null;\n try {\n writer = new BufferedWriter(new FileWriter(toFile));\n writer.write(message);\n } \n catch (IOException e) {\n log.error(\"Error writing file=\"+toFile, e);\n } \n finally {\n if (writer != null) {\n try {\n writer.close();\n } \n catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n }", "public static void write(String channel, String msg) {\n\t\ttry {\n\t\t\tDate date = new Date();\n\t\t\tFormat day = new SimpleDateFormat(\"dd-MMM-yyyy\");\n\t\t\tFormat time = new SimpleDateFormat(\"HH:mm:ss\");\n\t\t\t\n\t\t\tBufferedWriter out = new BufferedWriter(new FileWriter(IrcConfig.logPath + channel + \"-\" + day.format(date), true));\n\t\t\tout.write(\"[\" + time.format(date) + \"] \" + msg + \"\\n\");\n\t\t\tout.close();\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tSystem.out.println(\"Something went wrong with writing to a file: \" + e.getMessage());\n\t\t}\n\t}", "public static void write(String path, String message) {\r\n\t\t\r\n\t\t// open the file\r\n\t\tFile file = new File(path);\r\n\t\t\r\n\t\t\r\n\t\t// if the file does not exist try to create one\r\n\t\tif (!file.exists())\r\n\t\t\tfile = createFile(path);\r\n\t\t\r\n\t\t\r\n\t\t// write to the file\r\n\t\ttry {\r\n\t\t\t// open stream\r\n\t\t\tFileWriter fWrite = new FileWriter(file);\r\n\t\t\tBufferedWriter bufferedWriter = new BufferedWriter(fWrite);\r\n\t\t\t\r\n\t\t\t// write new lines if any was found\r\n\t\t\tfor (String i : message.split(\"(\\n)+\")) {\r\n\t\t\t\tbufferedWriter.write(i);\r\n\t\t\t\tbufferedWriter.newLine();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// close anything was opened\r\n\t\t\tbufferedWriter.close();\r\n\t\t\tfWrite.close();\r\n\r\n\t\t} catch (Exception e) {\r\n\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public void writeLog(String log){\n //Create, if no files.\n if(!this.loggingFile.exists()){\n try {\n this.loggingFile.createNewFile();\n FileWriter fileWriter = new FileWriter(this.loggingFile, true);\n BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);\n bufferedWriter.write(log);\n bufferedWriter.newLine();\n bufferedWriter.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n //Open the file.\n else{\n try {\n synchronized (this.loggingFile) {\n FileWriter fileWriter = new FileWriter(this.loggingFile, true);\n BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);\n bufferedWriter.write(log);\n bufferedWriter.newLine();\n bufferedWriter.close();\n }\n }catch (IOException e){\n e.printStackTrace();\n }\n }\n\n }", "public void writeToLogFile(String entry) {\r\n\t\ttry{\r\n\t\t\tStringBuilder out = new StringBuilder(50);\r\n\t\t\tCalendar cal = Calendar.getInstance();\r\n\t\t SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);\r\n\t\t out.append(sdf.format(cal.getTime()) + \";\" + entry);\r\n\t\t \r\n\t\t this.write(out);\r\n\t\t}catch (Exception e){\r\n\t\t System.err.println(\"Error: \" + e.getMessage());\r\n\t\t}\r\n\t}", "public void logToFile(String Message){\n\t\tProperties log4jProperties = new Properties();\n\t\tlog4jProperties.setProperty(\"log4j.rootLogger\", \"INFO, FILE\");\n\t\tlog4jProperties.setProperty(\"log4j.appender.FILE\", \"org.apache.log4j.RollingFileAppender\");\n\t\tlog4jProperties.setProperty(\"log4j.appender.FILE.file\", \"log.txt\");\n\t\tlog4jProperties.setProperty(\"log4j.appender.FILE.layout\", \"org.apache.log4j.PatternLayout\");\n\t\tlog4jProperties.setProperty(\"log4j.appender.FILE.layout.ConversionPattern\", \"%-5p %c %x - %m%n\");\n\t\tlog4jProperties.setProperty(\"log4j.appender.FILE.immediateFlush\", \"false\");\n\t\tlog4jProperties.setProperty(\"log4j.appender.FILE.Append\", \"true\");\n\t\tPropertyConfigurator.configure(log4jProperties);\n\t\tlog.info(Message);\n\t}", "public void writeLineToLog(String message){\n if(logWriter!=null) {\n logWriter.writeToLog(message);\n }\n else{\n logWriter = new CleanSweepLogWriterImpl();\n logWriter.writeToLog(message);\n }\n }", "public void write(String message) throws DukeException {\n try {\n this.writer.write(message);\n } catch (IOException e) {\n throw Ui.ioException(e);\n }\n }", "public static void writeFile(String msg){\n\t\ttry { \n File f1 = new File(\"/Users/snehithraj/eclipse-workspace/ThreePhaseCommit/src/ServerDB.txt\");\n if(!f1.exists()) {\n f1.createNewFile();\n } \n FileWriter fileWriter = new FileWriter(f1.getName(),true);\n BufferedWriter bw = new BufferedWriter(fileWriter);\n bw.write(msg);\n bw.close();\n } catch(IOException e){\n e.printStackTrace();\n }\n }", "private boolean writeToFile(String message) \n\t{\n\t BufferedWriter writer = null;\n\t boolean status = false;\n\t\ttry {\n\t\t\twriter = new BufferedWriter(new FileWriter(outputFile, true));\n\t\t\twriter.write(\"\\n\"+message);\n\t\t writer.close();\n\t\t status = true;\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Error occured in writing output to file: \"+e.getLocalizedMessage());\n\t\t\ttry {\n\t\t\t\tif(writer!=null) {\n\t\t\t\t\twriter.close();\n\t\t\t\t}\n\t\t\t} catch (IOException e1) {\n\t\t\t\tSystem.err.println(\"Error occured in closing filewriter: \"+e1.getLocalizedMessage());\n\t\t\t}\n\t\t\treturn status;\n\t\t}\n\t\treturn status; \n\t \n\t}", "protected void writeLog(String text){\n File logFile = new File(logFilePath);\n try {\n FileWriter fr = new FileWriter(logFile, true);\n fr.write(String.format(\"%s:\\t%s\\n\", getCurrentDate(), text));\n fr.close();\n } catch (IOException e){\n e.printStackTrace();\n }\n }", "static void Output(String filename, String message){\n FileOutputStream out;\n DataOutputStream data;\n try {\n out = new FileOutputStream(filename);\n data = new DataOutputStream(out);\n data.writeBytes(message);\n data.close();\n }\n catch (FileNotFoundException ex){\n System.out.println(\"File to open file for writing\");\n }\n catch (IOException ex) {\n System.out.println(\"RuntimeException on writing/closing file\");\n }\n }", "public void writeToLog(String sMsg)\r\n {\r\n wsBaseCommandExecuter.writeToLog(sMsg);\r\n }", "public void writeToFile(String msg, boolean flag) {\n\t\ttry {\n\n\t\t\t// writing without overwriting\n\t\t\tPrintWriter out = new PrintWriter(new FileWriter(fileName));\n\t\t\tout.append(msg);\n\t\t\tout.close();\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void writeMessageInDataFile(String message){\n try {\n String messageToWrite = \"\\n\" + this + message;\n messagesManager.add(messageToWrite); // adds last message to last 15 messages queue\n Files.write(Paths.get(\"messages.txt\"), messageToWrite.getBytes(), StandardOpenOption.APPEND); // writes last message in messages database\n }catch (IOException e) {\n System.err.println(\"*** ERROR ***\\nCouldn't write in data file.\");\n }\n }", "public void writeToControllerGameLog(String message) {\n controller.getUIController().writeToLogBox(message);\n }", "public void generateLogFile() {\n\t\tFileOperations operator = new FileOperations(path);\n\t\toperator.writeFile(buildLogContent());\n\t}", "protected static void writeLog(String content) {\n String filename = \"results.out\";\n FileWriter out;\n\n try {\n out = new FileWriter(filename, true);\n out.write(content + \"\\n\");\n out.close();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "boolean log(String msg) {\n String name = \"log_peer[\" + id + \"]\" + \".log\";\n java.util.Date date = new java.util.Date();\n Timestamp ts = new Timestamp(date.getTime());\n msg = \"[\" + ts + \"]: \" + msg;\n try (PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(name, true)))) {\n out.println(msg);\n } catch (IOException e) {\n //exception handling left as an exercise for the reader\n System.out.println(e);\n return false;\n }\n return true;\n }", "public static void saveOutputLog(String logText, File file)\n {\n try(BufferedWriter bw = new BufferedWriter(new FileWriter(file)))\n {\n bw.write(logText);\n }\n \n catch(IOException e)\n {\n JOptionPane.showMessageDialog(null, \"[Error] Failed to save output log\");\n }\n }", "public void writeToFile(String msg, String filePath, boolean append){\n try{\n FileWriter myWriter = new FileWriter(filePath, append);\n myWriter.write(msg);\n myWriter.close();\n System.out.println(\"Successfully wrote to the file.\");\n } catch(IOException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n }", "private void write(String msg) {\n\t\tIterator<LogListener> listeners = this.eventListeners.iterator();\n\t\twhile (listeners.hasNext()) {\n\t\t\tlisteners.next().writeLog(msg);\n\t\t}\n\t}", "public void write(String message){\n this.write(message, false);\n }", "public void log(String message) {\n\t}", "void write(String message) {\n this.message = message;\n }", "private void writeTo(String logEntry, File logFile) throws IOException {\n try (FileWriter logFileWriter = new FileWriter(logFile, true);) {\n logFileWriter.write(logEntry);\n logFileWriter.write(System.lineSeparator());\n logFileWriter.flush();\n logFileWriter.close();\n }\n}", "private void write(String msg)\r\n {\r\n System.out.println(msg);\r\n if (report_ != null) {\r\n report_.write(msg);\r\n }\r\n }", "public static void write(String message) {\n System.out.println(message);\n }", "public void writeLog() {\n\n\t}", "public void writeLog() {\n\n\t}", "public void writeLog() {\n\n\t}", "private static void writeLog(Exception e) {\n if (logFile == null) createLogFile();\n LogTools.trace(e);\n LogTools.flush();\n }", "public void writeLog(Exception e, String... data){\r\n // Print to console for us to read\r\n System.out.println(\"Error: \" + e);\r\n System.out.print(\"Log: \");\r\n for(int i = 0; i < data.length; i ++){\r\n System.out.println(data[i]);\r\n }\r\n System.out.println(\"\");\r\n \r\n // Write to file\r\n try{\r\n bw.append(\"Error: \" + e);\r\n bw.append(System.lineSeparator());\r\n bw.append(\"Log: \");\r\n for(int i = 0; i < data.length; i ++){\r\n bw.append(data[i]);\r\n bw.append(System.lineSeparator());\r\n }\r\n bw.append(System.lineSeparator());\r\n bw.close();\r\n }\r\n catch(IOException ioe){\r\n System.out.println(\"Error creating file in DLException.java\\nError: \" + ioe);\r\n }\r\n }", "public void writeToLog(Level level, Object msg) {\n\t\tif(this.loggingFlag)\n\t\t\tthis.logger.log(level, \"MonitoringAgent\" + \": \" + msg);\n\t}", "public static void log(String file, String data) {\n\t\ttry {\n\t\t\twriteData(file, data);\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Fatal error while logging Data!\");\n\t\t}\n\t}", "public void log(String message) {\n\t\tlogger.info(message);\n\t}", "@Override\n\tpublic void log(String msg) throws IOException {\n\t\t\n\t}", "private void log(String message) {\n System.out.println( message );\n sb.append( message ).append( \"\\n\" );\n }", "public void writeLog(){\n\t\ttry\n\t\t{\n\t\t\tFileWriter writer = new FileWriter(\"toptrumps.log\");\n\t\t\twriter.write(log);\n\t\t\twriter.close();\n\t\t\tSystem.out.println(\"log saved to toptrumps.log\");\n\t\t\t\n\t\t\tDataBaseCon.gameInfo(winName, countRounds, roundWins);\n\t\t\tDataBaseCon.numGames();\n\t\t\tDataBaseCon.humanWins();\n\t\t\tDataBaseCon.aIWins();\n\t\t\tDataBaseCon.avgDraws();\n\t\t\tDataBaseCon.maxDraws();\n\t\t\t\n\t\t} catch (IOException e)\n\t\t{\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void log(String message) {\n logger.log(\"[\" + game.getName() + \"] \" + message);\n }", "public static void writeMessage(String message) {\n writeMessage(Level.INFO, message);\n }", "public void log(String message) {\r\n log.append(\"[\" + new SimpleDateFormat(\"HH:mm:ss\").format(new Date()) + \"] \" + message + \"\\n\");\r\n System.out.println(\"[\" + new SimpleDateFormat(\"HH:mm:ss\").format(new Date()) + \"] \" + message);\r\n }", "void write(LogBuffer lb) throws IOException\n {\n try {\n if (lb.rewind)\n {\n channel.position(0);\n ++rewindCounter;\n lb.rewind = false;\n }\n\n bytesWritten += channel.write(lb.buffer);\n position = channel.position();\n } catch (IOException e) {\n // BUG 303907 - add message to IOException\n IOException ioe = new IOException(\"LogFile.write(): attempting to write \" + \n file.getName() + \" [\" + e.getMessage() + \"]\");\n ioe.setStackTrace(e.getStackTrace());\n throw ioe;\n }\n }", "public static void writeLogToFile(String log, String filePath) throws IOException {\n File file = new File(filePath);\n if (file.createNewFile() || file.exists()) {\n try (BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file)))) {\n String result = \"\";\n String line;\n while ((line = br.readLine()) != null) {\n result = String.format(\"%s%n%s\", result, line);\n }\n result = log + result;\n if (file.delete()) {\n try (FileOutputStream fos = new FileOutputStream(file)) {\n fos.write(result.getBytes());\n fos.flush();\n }\n }\n } catch (Exception e) {\n System.err.println(e.getMessage());\n }\n }\n }", "public static void append(String path, String message) {\t\r\n\t\twrite(path, read(path).concat(\"\\n\" + message));\r\n\t}", "private void log(String message) {\n System.out.println(message);\n }", "public void log(String message, int loglevel) {\n if (managingPc != null) {\n managingPc.log(message, loglevel);\n } else {\n (loglevel > Project.MSG_WARN ? System.out : System.err).println(message);\n }\n }", "private void log(String message) {\n System.out.println(message);\n }", "private void logToFile() {\n }", "private void saveLog (String Tag, String Message) {\n Log.v(TAG, \"Init save log data\");\n String message = Tag + \" - \" + Message + \"\\n\";\n try {\n File file = new File(context.getExternalFilesDir(null).getAbsolutePath() + \"logcat.txt\");\n Log.v(TAG, \"SaveLog() - declare file success: \" + file);\n if(!file.exists()) {\n file.createNewFile();\n Log.v(TAG, \"SaveLog() - Check file exist: \");\n } else {\n FileOutputStream fos = new FileOutputStream(file,true);\n Log.v(TAG, \"SaveLog() - File exist\");\n fos.write(message.getBytes());\n Log.v(TAG, \"SaveLog() - Write data success\");\n fos.close();\n }\n Log.v(TAG, \"saveData() - Save success\");\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n Log.v(TAG, e.getMessage());\n } catch (Exception e ) {\n e.printStackTrace();\n Log.v(TAG, e.getMessage());\n }\n }", "public void log(String text) {\r\n open();\r\n if (mCurrentFileStream != null) {\r\n try {\r\n mCurrentFileStream.write((text + \"\\r\\n\").getBytes());\r\n mCurrentFileStream.flush();\r\n } catch (IOException e) {\r\n Log.e(LOG_TAG, \"Failed writing log message\", e);\r\n close();\r\n }\r\n }\r\n }", "void log(Message message);", "public void log(String message)\n {\n try {inner.log(message);}\n catch (IOException e)\n\t{addFailure(e);}\n }", "public static void toFile(String fileName, String content, boolean appendFlag)\n\t{\n\t\t// crea un file di log con il nome passato come parametro nella sottocartella della webapp\n\t\t\tFile logFile = new File( fileName );\n\t\t\tFile logPath = new File( logFile.getParent() );\n\t\ttry {\n\t\t\tif ( !logPath.exists() )\n\t\t\t\tlogPath.mkdirs();\n\t\t\t\n\t\t\tFileOutputStream fos = new FileOutputStream( fileName, appendFlag );\n\t\t\tPrintWriter logWriter = new PrintWriter( fos );\n\t\t\tlogWriter.println(content);\n\t\t\tlogWriter.close();\n\t\t\t\n\t\t} catch ( Exception e ) {\n\t\t\t// qualsiasi eccezione nella stampa del log non deve essere bloccante\n\t\t\tString astks = \"*************************************\";\n\t\t\tString ecc = astks+\"\\n* Eccezione catturata, ma non gestita\\n\"+astks+\"\\n\"; \n\t\t\tSystem.err.println( ecc+ \"FileUtils.toFile() - Errore nel tentativo di scrivere il logfile\\n\"+logFile.getName()+\"\\nnella cartella\\n\"+logPath.getAbsolutePath() );\n\t\t\te.printStackTrace();\n\t\t\tSystem.err.println( \"\\n\"+astks );\n\t\t} \n\t}", "protected void log(String message) {\n task.log(message);\n }", "public synchronized void add (Message message) throws IOException {\n list.add(message);\n\n FileWriter fileWriter = null;\n BufferedWriter bufferedWriter = null;\n\n try {\n fileWriter = new FileWriter(file, true);\n bufferedWriter = new BufferedWriter(fileWriter);\n bufferedWriter.write(message.longToString());\n bufferedWriter.newLine();\n } finally {\n if (bufferedWriter != null) {\n bufferedWriter.close();\n }\n\n if (fileWriter != null) {\n fileWriter.close();\n }\n }\n }", "public void saveToLog(String log){\n \n File logfile = new File(System.getProperty(\"user.home\"), \"db_logfile\" + DwenguinoBlocklyArduinoPlugin.startTimestamp + \".txt\");\n try {\n BufferedWriter bWriter = new BufferedWriter(new PrintWriter(logfile));\n bWriter.write(log);\n bWriter.flush();\n bWriter.close();\n \n } catch (IOException ex) {\n Logger.getLogger(DwenguinoBlocklyServer.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "protected void logMessage(String message) {\n\n m_Log.logMessage(message);\n }", "public void log(String entry) throws IOException{\n out.write(entry + System.getProperty(\"line.separator\", \"\\r\\n\"));\n out.flush();\n }", "public abstract WriteResult writeSystemLog(Log log);", "public synchronized void log(String msg) {\n\t\tSystem.err.println(msg);\n\t}", "public void log(String message) {\n log(message, MSG_INFO);\n }", "private static void createLogFile() {\n try {\n String date = new Date().toString().replaceAll(\":\", \"-\");\n logFile = new FileWriter(\"bio-formats-test-\" + date + \".log\");\n TestLogger log = new TestLogger(logFile);\n LogTools.setLog(log);\n }\n catch (IOException e) { }\n }", "public void addToFile(String pathName, String message) throws IOException{\n FileOutputStream fos = new FileOutputStream(pathName, true);\n message = \"\\n\" + message;\n fos.write(message.getBytes());\n fos.close();\n\n }", "private static synchronized void writeLog(String text, int level )\n\t{\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"[\"+DateUtil.toTime(System.currentTimeMillis(),DateUtil.DATE_FORMATE_HOUR_MINUTE_SECOND)+\"]\");\n\t\tswitch (level) {\n\t\tcase Log.VERBOSE:\n\t\t\tsb.append(\"[VERBOSE]\\t\");\n\t\t\tbreak;\n\t\tcase Log.DEBUG:\n\t\t\tsb.append(\"[DEBUG]\\t\");\n\t\t\tbreak;\n\t\tcase Log.INFO:\n\t\t\tsb.append(\"[INFO ]\\t\");\n\t\t\tbreak;\n\t\tcase Log.WARN:\n\t\t\tsb.append(\"[WARN ]\\t\");\n\t\t\tbreak;\n\t\tcase Log.ERROR:\n\t\t\tsb.append(\"[ERROR]\\t\");\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tRandomAccessFile raf = null;\n\t\ttry {\n\t\t\tString fileName = PERSIST_PATH+\"_\"+DateUtil.toTime(System.currentTimeMillis(), DateUtil.DATE_DEFAULT_FORMATE);\n\t\t\tFile logFile = new File(fileName);\n\t\t\tif(!logFile.exists())\n\t\t\t{\n\t\t\t\tUtil.initExternalDir(false);\n\t\t\t\tlogFile.createNewFile();\n\t\t\t}\n\t\t\traf = new RandomAccessFile(fileName, \"rw\");\n\t\t\traf.seek(raf.length());\n\t\t\traf.writeBytes(sb.toString()+text+\"\\r\\n\");\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tif(raf!=null)\n\t\t\t{\n\t\t\t\ttry {\n\t\t\t\t\traf.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void write(String message) {\n System.out.println(\"Sent \" + message + \" to client \" + client + \".\");\n out.println(message);\n }", "@Override\n public void log(String message) {\n }", "private static void log(String message) {\n System.out.println(message);\n }", "private static final void log(String msg) {\n\t\tlog.println(msg);\n\t}", "private void log(String msg) {\r\n\t\tif(this.out != null) {\r\n\t\t\tthis.out.println(msg);\r\n\t\t\tthis.out.flush();\r\n\t\t}\r\n\t}", "public final void toLogFile() {\n\t\tRetroTectorEngine.toLogFile(\"Error message from \" + THESTRINGS[0] + \":\");\n\t\tfor (int i=1; i<THESTRINGS.length; i++) {\n\t\t\tRetroTectorEngine.toLogFile(THESTRINGS[i]);\n\t\t}\n\t}", "private void log(String message) {\n if (this.listener != null) {\n message = \"CollabNet Tracker: \" + message;\n this.listener.getLogger().println(message);\n }\n }", "public void log(String message) {\n StringBuilder builder = new StringBuilder();\n LocalDateTime timeOfException = LocalDateTime.now();\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm:ss\");\n\n builder.append(this.exceptionLog);\n builder.append(message + \"\\n\");\n builder.append(timeOfException.format(formatter) + \"\\n\\n\");\n\n this.exceptionLog = builder.toString();\n }", "private void log(String msg) {\r\n\t\tif (logger != null) {\r\n\t\t\tlogger.append(msg);\r\n\t\t\tlogger.println();\r\n\t\t}\r\n\t}", "public void appendLog(String text) {\r\n\t\tFile logFile = new File(\"sdcard/\" + application.LOGFILENAME);\r\n\t\tif (!logFile.exists()) {\r\n\t\t\ttry {\r\n\t\t\t\tlogFile.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\ttry {\r\n\t\t\tBufferedWriter buf = new BufferedWriter(new FileWriter(logFile, true));\r\n\t\t\tCalendar calendar = Calendar.getInstance();\r\n\t\t\ttry {\r\n\t\t\t\tSystem.err.println(\"Logged Date-Time : \" + calendar.getTime().toLocaleString());\r\n\t\t\t} catch (Throwable e) {\r\n\t\t\t}\r\n\t\t\tbuf.append(\"Logged Date-Time : \" + calendar.getTime().toLocaleString());\r\n\t\t\tbuf.append(\"\\n\\n\");\r\n\t\t\tbuf.append(text);\r\n\t\t\tbuf.newLine();\r\n\t\t\tbuf.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void log(String msg) {\n\n\t}", "public static void log(String message) {\n int niveau = JournalLogger.ERROR;\n \n JournalLogger.log(niveau, JournalLogger.FAC_FLOW_SVC,\n niveau,message, null);\n }", "void log(String message) {\n System.out.println(buildMessage(message));\n }", "public void writeToExceptionLog(String report);", "static void Logger(String writeToFile) throws IOException {\n // setting up file, handler, and formatter - all logs will be appended\n FileHandler fileHandler = new FileHandler(\"JokeLogger.txt\", true);\n SimpleFormatter fileFormatter = new SimpleFormatter();\n fileHandler.setFormatter(fileFormatter);\n\n // open logger\n Logger logger = Logger.getLogger(\"JokeServer\");\n logger.addHandler(fileHandler);\n\n // write to log and close handler after\n logger.info(writeToFile);\n fileHandler.close();\n }", "private void log(String message) {\r\n\t\tif (AxisDisplaySettingsPanel.printLog && Main.isLoggingEnabled()) {\r\n\t\t\tSystem.out.println(this.getClass().getName() + \".\" + message);\r\n\t\t}\r\n\t}", "public void logs(Object message) {\n System.out.println(message.toString());\n }", "private static void writeLog(String log) {\n\t\twriteLog(log, true);\n\t}", "public void logPrivateMessage(Message message) {\r\n\r\n\t\ttry(FileWriter fw = new FileWriter(message.getNickName() + \"_logfile.txt\", true);\r\n\t\t\t\tBufferedWriter bw = new BufferedWriter(fw);\r\n\t\t\t\tPrintWriter out = new PrintWriter(bw))\r\n\t\t{\r\n\t\t\tout.print(\"<\" + message.getNickName() + \"> \" + message.getMesssage());\r\n\t\t\tSystem.out.println(\"<\" + message.getNickName() + \"> \" + message.getMesssage());\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} \r\n\t}", "protected static void errorLog(float error){\n\n\t\tString logString = error + \"\\n\";\n\t\ttry {\n\t\t\tFiles.write(Paths.get(\"errorLog.txt\"), logString.getBytes(), StandardOpenOption.APPEND);\n\t\t}catch (IOException e) {\n\t\t\t//exception handling left as an exercise for the reader\n\t\t}\n\t}", "public void writeChatServerMessage(String message) {\n\t\tSystem.out.println(\"WRITING \" + message);\n\t\tif(m_chatSession != null)\n\t\t\tm_chatSession.write(message);\n\t}", "public void write(String message) {\n Log.d(TAG, \"...Data to send: \" + message + \"...\");\n byte[] msgBuffer = message.getBytes();\n try {\n mmOutStream.write(msgBuffer);\n } catch (IOException e) {\n Log.d(TAG, \"...Error data send: \" + e.getMessage() + \"...\");\n }\n }", "public void write(String message) {\n Log.d(TAG, \"...Data to send: \" + message + \"...\");\n byte[] msgBuffer = message.getBytes();\n try {\n mmOutStream.write(msgBuffer);\n } catch (IOException e) {\n Log.d(TAG, \"...Error data send: \" + e.getMessage() + \"...\");\n }\n }", "public void log (Object msg) {\n getLogEvent().addMessage (msg);\n }" ]
[ "0.82407886", "0.7644205", "0.71965337", "0.7190746", "0.71340454", "0.7058267", "0.69504845", "0.6904716", "0.68471295", "0.6766018", "0.6740373", "0.6610022", "0.65713984", "0.6488232", "0.6470848", "0.646313", "0.6452214", "0.6387233", "0.63134646", "0.62971866", "0.6234424", "0.6229056", "0.6195344", "0.61630887", "0.61508816", "0.61503804", "0.60925186", "0.6071342", "0.605595", "0.60179514", "0.60100543", "0.59242374", "0.5912017", "0.58864135", "0.5851797", "0.58295536", "0.5818457", "0.5809392", "0.5805751", "0.5791815", "0.5791815", "0.5791815", "0.5784458", "0.5739559", "0.57337976", "0.5705827", "0.57049304", "0.5696329", "0.56831205", "0.56667227", "0.56343776", "0.5604393", "0.56042224", "0.5571776", "0.55642647", "0.55416286", "0.55323493", "0.55271375", "0.5525678", "0.5518859", "0.5515867", "0.5513979", "0.54972917", "0.54933244", "0.5493156", "0.54928094", "0.54840124", "0.54772645", "0.5471756", "0.54627544", "0.5456534", "0.5449178", "0.54326487", "0.542961", "0.5416889", "0.5406178", "0.53916216", "0.53772545", "0.53727156", "0.53675103", "0.53661144", "0.5365464", "0.53610855", "0.53543633", "0.5353776", "0.534767", "0.5336402", "0.53322434", "0.5331214", "0.5319984", "0.5317997", "0.5308776", "0.5299744", "0.5290214", "0.5265817", "0.52632457", "0.5262128", "0.52618927", "0.52618927", "0.526066" ]
0.5808431
38
Writes the given exception's stack trace to the log file.
private static void writeLog(Exception e) { if (logFile == null) createLogFile(); LogTools.trace(e); LogTools.flush(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void logException(Exception e)\n throws Exception {\n\n FileWriter write = null;\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\n Date date = new Date();\n\n try {\n write = new FileWriter(\"c:\\\\temp\\\\CaseOperationException.log\", true);\n PrintWriter print_line = new PrintWriter(write);\n print_line.printf(dateFormat.format(date) + \"\\n\");\n e.printStackTrace(print_line);\n print_line.close();\n } catch (IOException exc) {\n }\n\n throw e;\n }", "public void writeToExceptionLog(String report);", "public static void logException(Exception ex) {\n try {\n File exLog = new File(filePath);\n FileOutputStream outputStream = new FileOutputStream(exLog);\n ex.printStackTrace(new PrintStream(outputStream));\n outputStream.flush();\n outputStream.close();\n\n } catch (IOException ioE) {\n System.exit(1);\n }\n }", "public static void logException(Exception exception) {\n if (DEBUG) {\n try {\n Writer writer = new StringWriter();\n exception.printStackTrace(new PrintWriter(writer));\n Log.e(\"NLP: >Exception::\", \"\" + writer.toString());\n exception.printStackTrace();\n } catch (Exception ignore) {\n Logger.log(\"Exception print error\");\n }\n\n }\n }", "public void writeLog(Exception e, String... data){\r\n // Print to console for us to read\r\n System.out.println(\"Error: \" + e);\r\n System.out.print(\"Log: \");\r\n for(int i = 0; i < data.length; i ++){\r\n System.out.println(data[i]);\r\n }\r\n System.out.println(\"\");\r\n \r\n // Write to file\r\n try{\r\n bw.append(\"Error: \" + e);\r\n bw.append(System.lineSeparator());\r\n bw.append(\"Log: \");\r\n for(int i = 0; i < data.length; i ++){\r\n bw.append(data[i]);\r\n bw.append(System.lineSeparator());\r\n }\r\n bw.append(System.lineSeparator());\r\n bw.close();\r\n }\r\n catch(IOException ioe){\r\n System.out.println(\"Error creating file in DLException.java\\nError: \" + ioe);\r\n }\r\n }", "public static void writePrintStackTrace(TestContext context, Exception e) {\n\t\tcontext.getLogger().error(getPrintStackTraceAsString(e));\n\t}", "public static void writePrintStackTrace(TestContext context, Throwable e) {\n\t\tcontext.getLogger().error(getPrintStackTraceAsString(e));\n\t}", "public void logInFile(String message) {\n\t\ttry {\n\t\t\tFile logFile = new File(\"exceptionLog.txt\");\n\t\t\tfw = new FileWriter(logFile,true);\n\t\t\tfw.write(message);\n\t\t\tfw.close();\n\t\t}catch(IOException e) {\n\t\t\te.getStackTrace();\n\t\t}\n\t}", "public static void printStackTraceToLogger(Logger logger, Exception e) {\n\t\tStringWriter sw = new StringWriter();\n\t\te.printStackTrace(new PrintWriter(sw));\n\t\tlogger.error(sw.toString());\n\t}", "@Test\n\tpublic final void testWriteException() {\n\t\tLog.write(LogMessageSeverity.WARNING, LogWriteMode.QUEUED,\n\t\t\t\tnew RuntimeException(\"This is our test assertion exception\"), \"Unit Tests\",\n\t\t\t\t\"Test of logging exception attachment.\", null);\n\n\t\tLog.write(LogMessageSeverity.WARNING, LogWriteMode.QUEUED,\n\t\t\t\tnew RuntimeException(\"This is our top exception\",\n\t\t\t\t\t\tnew RuntimeException(\"This is our middle exception\",\n\t\t\t\t\t\t\t\tnew RuntimeException(\"This is our bottom exception\"))),\n\t\t\t\t\"Unit Tests\", \"Test of logging exception attachment with nested exceptions.\", null);\n\t}", "public void log(String message) {\n StringBuilder builder = new StringBuilder();\n LocalDateTime timeOfException = LocalDateTime.now();\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm:ss\");\n\n builder.append(this.exceptionLog);\n builder.append(message + \"\\n\");\n builder.append(timeOfException.format(formatter) + \"\\n\\n\");\n\n this.exceptionLog = builder.toString();\n }", "private void writeToLogFile(String message)\r\n {\n try\r\n {\r\n logWriter.write(message);\r\n logWriter.newLine();\r\n }\r\n catch (Exception ex)\r\n {\r\n System.out.println(\"Error writing message '\" + message +\r\n \"' to log file : \" + ex.getMessage());\r\n System.exit(1);\r\n }\r\n }", "void logStackTrace(String pMessage, Exception pE)\n{\n\n Logger.getLogger(getClass().getName()).log(Level.SEVERE, pMessage, pE);\n\n}", "public static void report(Exception e) {\n\t\tStringWriter stackTrace = new StringWriter();\n\t\te.printStackTrace(new PrintWriter(stackTrace));\n\t\tlogger.severe(e.getLocalizedMessage());\n\t\tlogger.severe(stackTrace.toString());\n\t}", "private void log(Throwable t) {\r\n StringWriter sw = new StringWriter();\r\n PrintWriter w = new PrintWriter(sw);\r\n t.printStackTrace(w);\r\n w.close();\r\n log(sw.toString(), Project.MSG_ERR);\r\n }", "public static void writeToLog(String filename,String log)\r\n\t{\n\t\ttry \r\n\t\t{\r\n\t\t\tString str = log + \" at \" + new Date() + \"\\n\";\r\n\t\t\tFiles.write(Paths.get(\"log.log\"),str.getBytes(),StandardOpenOption.APPEND);\r\n\t\t\t/*PrintWriter out = new PrintWriter(f);\r\n\t\t\tout.append(log + \" at \" + new Date());\r\n\t\t\tout.flush();\r\n\t\t\tout.close();*/\r\n\t\t} \r\n\t\tcatch (FileNotFoundException e) \r\n\t\t{\r\n\t\t\tSystem.err.println(\"FNE: \" + e.getMessage());\r\n\t\t} \r\n\t\tcatch (IOException e)\r\n\t\t{\r\n\t\t\tSystem.err.println(\"IOE: \" + e.getMessage());\r\n\t\t}\r\n\t\t\r\n\t}", "public static void dumpLog() {\n\t\t\n\t\tif (log == null) {\n\t\t\t// We have no log! We must be accessing this entirely statically. Create a new log. \n\t\t\tnew Auditor(); // This will create the log for us. \n\t\t}\n\n\t\t// Try to open the log for writing.\n\t\ttry {\n\t\t\tFileWriter logOut = new FileWriter(log);\n\n\t\t\t// Write to the log.\n\t\t\tlogOut.write( trail.toString() );\n\n\t\t\t// Close the log writer.\n\t\t\tlogOut.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// Close the log file itself.\n\t\t// Apparently we can't? TODO: Look into this. \n\n\t}", "private static final void log(Throwable e) {\n\t\tlog.println(e);\n\t}", "public DLException(Exception e, String... data){\r\n try{\r\n bw = new BufferedWriter(new FileWriter(\"ErrorLog.txt\", true));\r\n }\r\n catch(IOException ioe){\r\n System.out.println(\"Error creating file in DLException.java\\nError: \" + ioe);\r\n }\r\n writeLog(e, data);\r\n }", "private void printStackTrace( Exception e )\n {\n logger.printStackTrace( e, 1 );\n }", "void printStackTrace(PrintWriter writer);", "public static void printStackTrace(Throwable ex) {\n if (outputEnabled) {\n synchronized (out) {\n ex.printStackTrace(out);\n }\n }\n }", "public void writeEvent(LogEvent logEvent) throws Exception {\n appendObjectToLog(logEvent);\n }", "public void log(String message)\n {\n try \n {\n BufferedWriter errorLogWriter = new BufferedWriter(new FileWriter(this.errorLog));\n errorLogWriter.write(Logger.dateFormat.format(Calendar.getInstance().getTime()));\n errorLogWriter.write(message);\n errorLogWriter.close();\n }\n catch (IOException ex)\n {\n System.err.println(\"Cannot write into log : \" + ex.getMessage());\n }\n }", "public void logException(Throwable t){\n\t\tSpagoBITracer.debug(SpagoBIConstants.NAME_MODULE, this.getClass().getName(), \n\t\t\t\t \"logException\", t.getClass().getName() + \":\" + t.getMessage());\n\t}", "public static String stackTrace(Exception exception) {\n\t\tStringWriter writer = new StringWriter();\n\t\tPrintWriter printWriter = new PrintWriter(writer);\n\t\texception.printStackTrace(printWriter);\n\t\tprintWriter.flush();\n\n\t\tString stackTrace = writer.toString();\n\t\treturn stackTrace;\n\t}", "private static void reportException(Exception poException) {\n\t\tSystem.err.println(\"Caught exception : \" + poException.getClass().getName());\n\t\tSystem.err.println(\"Message : \" + poException.getMessage());\n\t\tSystem.err.println(\"Stack Trace : \");\n\t\tpoException.printStackTrace(System.err);\n\t}", "private void logException(java.lang.Exception e) {\n }", "public static void logStackTrace(String TAG, Throwable e)\n\t{\n\t\tif (showlog)\n\t\t{\n\t\t\tTAG += AT + Thread.currentThread().getName();\n\t\t\t// Legend tells of NULL exceptions roaming the world of Java...\n\t\t\tif (e != null)\n\t\t\t{\n\t\t\t\t// Display exception type.\n\t\t\t\td(TAG, e.toString());\n\n\t\t\t\t// Display stack trace lines.\n\t\t\t\tfor (StackTraceElement elem : e.getStackTrace())\n\t\t\t\t{\n\t\t\t\t\t// Copies the format of Exception.printStackTrace().\n\t\t\t\t\td(TAG, \"at \" + elem.toString());\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\td(TAG, \"NULL exception passed to logStackTrace(). This should never happen!\");\n\t\t\t}\n\t\t}\n\t}", "public void writeToLogFile(String entry) {\r\n\t\ttry{\r\n\t\t\tStringBuilder out = new StringBuilder(50);\r\n\t\t\tCalendar cal = Calendar.getInstance();\r\n\t\t SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);\r\n\t\t out.append(sdf.format(cal.getTime()) + \";\" + entry);\r\n\t\t \r\n\t\t this.write(out);\r\n\t\t}catch (Exception e){\r\n\t\t System.err.println(\"Error: \" + e.getMessage());\r\n\t\t}\r\n\t}", "public static void reportException(Exception poException)\n\t{\n\t\tSystem.err.println(\"Caught exception : \" + poException.getClass().getName());\n\t\tSystem.err.println(\"Message : \" + poException.getMessage());\n\t\tSystem.err.println(\"Stack Trace : \");\n\t\tpoException.printStackTrace(System.err);\n\t}", "public static void log(Throwable e) {\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\tsb.append(e.toString());\r\n\t\tfor (StackTraceElement el : e.getStackTrace()) {\r\n\t\t\tsb.append(\"\\n\" + el);\r\n\t\t}\r\n\t\tsb.append(\"\\n-----------------------------------------------------------------\\n\");\r\n\t\tlog(sb.toString(), LoggerLevel.WARNING);\r\n\t}", "public void dumpLog(String filename){\n }", "void writeFormattedException(final String message,\n final Level level,\n final Writer out)\n throws IOException {\n JsonGenerator generator = new JsonFactory().createJsonGenerator(out);\n\n String backtrace = ExceptionUtils.getFullStackTrace(new Exception());\n String[] lines = backtrace.split(\"\\n\");\n StringBuilder builder = new StringBuilder();\n for (String line : lines) {\n if (!line.contains(\"com.greplin.gec.GecAppender.\")) {\n builder.append(line);\n builder.append(\"\\n\");\n }\n }\n backtrace = builder.toString();\n\n generator.writeStartObject();\n generator.writeStringField(\"project\", this.project);\n generator.writeStringField(\"environment\", this.environment);\n generator.writeStringField(\"serverName\", this.serverName);\n generator.writeStringField(\"backtrace\", backtrace);\n generator.writeStringField(\"message\", message);\n generator.writeStringField(\"logMessage\", message);\n generator.writeStringField(\"type\", \"N/A\");\n if (level != Level.ERROR) {\n generator.writeStringField(\"errorLevel\", level.toString());\n }\n writeContext(generator);\n generator.writeEndObject();\n generator.close();\n }", "protected static void errorLog(float error){\n\n\t\tString logString = error + \"\\n\";\n\t\ttry {\n\t\t\tFiles.write(Paths.get(\"errorLog.txt\"), logString.getBytes(), StandardOpenOption.APPEND);\n\t\t}catch (IOException e) {\n\t\t\t//exception handling left as an exercise for the reader\n\t\t}\n\t}", "void printException(Exception e,int level)\n { printLog(\"Exception: \"+ExceptionPrinter.getStackTraceOf(e),level);\n }", "public static void printStackTrace() {\n if (outputEnabled) {\n synchronized (out) {\n new Exception(\"Diagnostic Stack Trace\").printStackTrace(out); // NORES\n }\n }\n }", "@Test\n\tpublic final void testWriteTrace() {\n\t\tLog.trace(\"This is a call to Log.Trace with no arguments\");\n\t\tLog.trace(\"This is a call to Log.Trace with two arguments #1:%s, #2:%s\", 1, 2);\n\n\t\tLog.write(LogMessageSeverity.INFORMATION, \"Unit Tests\", null, \"This is a call to Log.Write with no arguments\");\n\t\tLog.write(LogMessageSeverity.INFORMATION, \"Unit Tests\", null,\n\t\t\t\t\"This is a call to Log.Write with two arguments #1:%s, #2:%s\", 1, 2);\n\n\t\tRuntimeException exception = new GibraltarException(\"This is a dummy exception to test API calls.\");\n\n\t\tLog.trace(exception, \"This is a call to Log.Trace with an exception and no arguments\");\n\t\tLog.trace(exception, \"This is a call to Log.Trace with an exception and two arguments #1:%s, #2:%s\", 1, 2);\n\n\t\tLog.write(LogMessageSeverity.WARNING, LogWriteMode.QUEUED, exception, \"Unit Tests\", null,\n\t\t\t\t\"This is a call to Log.Write with an exception and no arguments\");\n\t\tLog.write(LogMessageSeverity.WARNING, LogWriteMode.QUEUED, exception, \"Unit Tests\", null,\n\t\t\t\t\"This is a call to Log.Write with an exception and two arguments #1:%s, #2:%s\", 1, 2);\n\n\t\tLog.write(LogMessageSeverity.VERBOSE, \"Unit Tests\",\n\t\t\t\t\"This is a call to Log.Write with a caption and null description\", null);\n\t\tLog.write(LogMessageSeverity.VERBOSE, \"Unit Tests\",\n\t\t\t\t\"This is a call to Log.Write with a caption and description\", \"with no formatting arguments\");\n\t\tLog.write(LogMessageSeverity.VERBOSE, \"Unit Tests\",\n\t\t\t\t\"This is a call to Log.Write with a caption and description\",\n\t\t\t\t\"formatted with two arguments #1:%s, #2:%s\", 1, 2);\n\n\t\tLog.write(LogMessageSeverity.INFORMATION, LogWriteMode.WAIT_FOR_COMMIT, null, \"Unit Tests\",\n\t\t\t\t\"This is a call to Log.Write with WaitForCommit and null exception and with a caption and null description\",\n\t\t\t\tnull);\n\t}", "public void printStackTrace(){\n\t\tprintStackTrace(System.err);\n\t}", "public static synchronized void logError(Exception e) {\n\t\te.printStackTrace();\r\n\t}", "String exceptionToStackTrace( Exception e ) {\n StringWriter stringWriter = new StringWriter();\n PrintWriter printWriter = new PrintWriter(stringWriter);\n e.printStackTrace( printWriter );\n return stringWriter.toString();\n }", "private String saveCrashReportFile() {\r\n try {\r\n Log.d(LOG_TAG, \"Writing crash report file.\");\r\n long timestamp = System.currentTimeMillis();\r\n String isSilent = mCrashProperties.getProperty(IS_SILENT_KEY);\r\n String fileName = (isSilent != null ? SILENT_PREFIX : \"\") + \"stack-\" + timestamp + \".stacktrace\";\r\n FileOutputStream trace = mContext.openFileOutput(fileName, Context.MODE_PRIVATE);\r\n mCrashProperties.store(trace, \"\");\r\n trace.flush();\r\n trace.close();\r\n return fileName;\r\n } catch (Exception e) {\r\n Log.e(LOG_TAG, \"An error occured while writing the report file...\", e);\r\n }\r\n return null;\r\n }", "String getLogStackTrace();", "private void printStackTrace(Exception ex, GUILog gl) {\n StringWriter sw = new StringWriter();\n PrintWriter pw = new PrintWriter(sw);\n ex.printStackTrace(pw);\n gl.log(sw.toString()); // stack trace as a string\n ex.printStackTrace();\n }", "protected void logException(Exception e) {\r\n if (log.isErrorEnabled()) {\r\n log.logError(LogCodes.WPH2004E, e, e.getClass().getName() + \" processing field \");\r\n }\r\n }", "public void generateLogFile() {\n\t\tFileOperations operator = new FileOperations(path);\n\t\toperator.writeFile(buildLogContent());\n\t}", "private static void write(String message) {\n\t\tFile log = new File(filePath);\t// File for the database log\n\t\tboolean isNew = false;\t\t\t// Stores if the file created is a new or an old one\n\t\t\n\t\ttry {\n\t\t\tif (!log.exists()) {\n\t\t\t\tisNew = log.createNewFile();\n\t\t\t} // End if\n\t\t\tPrintWriter pw = new PrintWriter(new FileWriter(log, true));\n\t\t\t\n\t\t\tif (Boolean.TRUE.equals(isNew)) {\n\t\t\t\tpw.append(\"Database operations log:\");\n\t\t\t} // End if\n\t\t\tpw.append(message);\n\t\t\tpw.close();\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void writeTrace()\r\n {\r\n TGCreator creator = new TGCreator();\r\n TGTrace trace = creator.createTrace(JVM.getVM(), this.stateGraph);\r\n TraceGraphWriter tgWriter = new TraceGraphWriter(trace);\r\n\r\n if (this.traceCompressed)\r\n {\r\n this.filename += ITraceConstants.ZIP_FILE_SUFFIX;\r\n tgWriter.saveCompressed(new File(this.filename));\r\n }\r\n else\r\n {\r\n this.filename += ITraceConstants.XML_FILE_SUFFIX;\r\n tgWriter.save(new File(this.filename));\r\n }\r\n\r\n SymbolicExecutionTracerPlugin.log(Status.INFO,\r\n \"Symbolic Execution Tracer wrote \" + this.numEndStates\r\n + \" traces to \" + this.filename);\r\n }", "private void writeTo(String logEntry, File logFile) throws IOException {\n try (FileWriter logFileWriter = new FileWriter(logFile, true);) {\n logFileWriter.write(logEntry);\n logFileWriter.write(System.lineSeparator());\n logFileWriter.flush();\n logFileWriter.close();\n }\n}", "protected void setWriteException(Exception e) {\n\tif (writeException == null) writeException = e;\n }", "public static void writeError(Throwable JError, String JFilePath) {\n /*\n try\n\t\t{\n\t\tString JSdcardPath = JFilePath;\n\t\tif(JFilePath == null)\n\t\t{\n\t\t\tJSdcardPath = FILE_ROOT + \".Error/\";\n\t\t}\n\t\tmkdirs(FILE_ROOT);\n\t\tmkdirs(JSdcardPath);\n\n\t\tint JTotalError = new File(JSdcardPath).listFiles().length;\n\t\tString JNewFileName = JTotalError + \".txt\" ;\n\t\twriteObject( getStackTrace(JError), FILE_ROOT + \".Error/\", JNewFileName);\n\t\t}catch(IOException JE)\n\t\t{ }\n\t */\n }", "void write(TraceList traceList,File file) throws IOException;", "@Override\n public void uncaughtException(Thread thread, Throwable ex) {\n if (crashHandler != null) {\n try {\n //将crash log写入文件\n FileOutputStream fileOutputStream = new FileOutputStream(MainApplication.SEND_PATH + \"crash_log.txt\", true);\n PrintStream printStream = new PrintStream(fileOutputStream);\n printStream.print(\"log start:\\n\");\n Date date = new Date();\n printStream.print(\"Date:\" + date.toString());\n ex.printStackTrace(printStream);\n printStream.print(\"\\n\\n\\n\");\n printStream.flush();\n printStream.close();\n fileOutputStream.close();\n } catch (FileNotFoundException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n }", "@Test\r\n public void test_logException2_NoLogging() throws Exception {\r\n log = null;\r\n Exception res = LoggingWrapperUtility.logException(log, signature, exception, true, Level.WARN);\r\n\r\n assertSame(\"'logException' should be correct.\", exception, res);\r\n\r\n assertEquals(\"'logException' should be correct.\", 0, TestsHelper.readFile(TestsHelper.LOG_FILE).length());\r\n }", "public static void exceptionDescriptive(String errorCause, StackTraceElement l) throws IOException {\n\t\t\t String secondLine = \"Browser Shut-Down\", location = \"\";\n\t\t\t String packageNameOnly, classNameOnly, xml, detected, runtime, subtotal;\n\n\t\t\t packageNameOnly = l.getClassName().substring(0, l.getClassName().lastIndexOf(\".\"));\n\t\t\t classNameOnly = l.getClassName().substring(1 + l.getClassName().lastIndexOf(\".\"), l.getClassName().length());\n\t\t\t location = packageNameOnly + File.separator + classNameOnly + File.separator + l.getMethodName() + \", line # \" + l.getLineNumber();\n\t\t xml = \"<class name=\\\"\" + packageNameOnly + \".\" + classNameOnly + \"\\\"><methods><include name=\\\"\" + l.getMethodName() + \"\\\"/></methods></class>\";\n\t\t detected = getCurrentDateTimeFull();\n\t\t runtime = testRunTime(\"start.time\", System.currentTimeMillis());\n\t\t subtotal = testRunTime(\"ini.time\", System.currentTimeMillis());\n\t\t \t \n\t\t // APPEND A NEW LOG RECORDS:\n\t\t fileWriterPrinter(\"\\nError Cause: ---> \" + errorCause + \"\\nDescription: ---> \" + secondLine + \"\\n Location: ---> \" + location);\t\n\t\t if (fileExist(\"run.log\", false)) {\n\t\t\t fileWriter(\"run.log\", \"Error Cause: ---> \" + errorCause);\n\t\t\t fileWriter(\"run.log\", \"Description: ---> \" + secondLine);\n\t\t\t fileWriter(\"run.log\", \" Location: ---> \" + location);\t \t \n\t\t }\n\t\t \n\t\t // APPEND AN ERROR RECORD:\n\t\t\t fileWriter(\"failed.log\", \" Failure: #\" + fileScanner(\"failed.num\"));\n\t\t\t fileWriter(\"failed.log\", \" Test: #\" + fileScanner(\"test.num\"));\n\t\t\t fileWriter(\"failed.log\", \" Start: \" + convertCalendarMillisecondsAsStringToDateTimeHourMinSec(fileScanner(\"start.time\")));\n fileWriter(\"failed.log\", \" XML Path: \" + xml);\n\t\t\t fileWriter(\"failed.log\", \"Error Cause: ---> \" + errorCause);\n\t\t\t fileWriter(\"failed.log\", \"Description: ---> \" + secondLine);\n\t\t\t fileWriter(\"failed.log\", \" Location: ---> \" + location);\n\t\t\t fileWriter(\"failed.log\", \" Detected: \" + detected);\n\t\t \t fileWriter(\"failed.log\", \" Runtime: \" + runtime);\n\t\t \t fileWriter(\"failed.log\", \" Subtotal: \" + subtotal);\n\t\t \t fileWriter(\"failed.log\", \"\");\n\t\t \t \n\t\t // APPEND DESCRIPTIVE RECORD:\n\t\t\t Assert.assertFalse(true, \"\\n Error Cause: ---> \" + errorCause\n\t\t\t\t\t + \"\\n Description: ---> \" + secondLine\n\t\t\t\t\t + \"\\n Location: ---> \" + location\n\t\t\t\t\t\t\t\t\t + \"\\n Detected: ---> \" + detected\n\t\t\t\t\t\t\t\t\t + \"\\n Runtime: ---> \" + runtime\n\t\t\t\t\t\t\t\t\t + \"\\n Subtotal: ---> \" + subtotal\n\t\t\t\t\t + \"\\n\"\n\t\t\t\t\t\t\t + xml\n\t\t\t\t\t\t\t + \"\\n\"\n\t\t\t\t \t + \"\\nStack Traces:\");\t\t\t \n\t\t }", "public static String getExceptionStackTrace(Exception exception) {\n final StringBuilder sb = new StringBuilder(1024);\n sb.append(exception.getMessage());\n sb.append(\"\\n\");\n try (StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw)) {\n exception.printStackTrace(pw);\n sb.append(sw.toString());\n } catch (Exception e) {\n LOGGER.error(\"Exception while converting exception's stack trace to string!\\n{}\",\n e.getMessage());\n }\n return sb.toString();\n }", "@Test\r\n public void test_logException1() throws Exception {\r\n Exception res = LoggingWrapperUtility.logException(log, signature, exception);\r\n\r\n assertSame(\"'logException' should be correct.\", exception, res);\r\n\r\n TestsHelper.checkLog(\"logException\",\r\n \"ERROR\",\r\n \"Error in method [method_signature], details: Exception for testing.\",\r\n \"java.lang.Exception: Exception for testing.\");\r\n }", "@Test\r\n public void test_logException1_NoLogging() throws Exception {\r\n log = null;\r\n Exception res = LoggingWrapperUtility.logException(log, signature, exception);\r\n\r\n assertSame(\"'logException' should be correct.\", exception, res);\r\n\r\n assertEquals(\"'logException' should be correct.\", 0, TestsHelper.readFile(TestsHelper.LOG_FILE).length());\r\n }", "private static void logException(Exception e, Options opts) {\n if (opts.log_level > 3) {\n e.printStackTrace();\n } else {\n System.err.println(e.getMessage());\n }\n }", "public void writeLog(){\n\t\ttry\n\t\t{\n\t\t\tFileWriter writer = new FileWriter(\"toptrumps.log\");\n\t\t\twriter.write(log);\n\t\t\twriter.close();\n\t\t\tSystem.out.println(\"log saved to toptrumps.log\");\n\t\t\t\n\t\t\tDataBaseCon.gameInfo(winName, countRounds, roundWins);\n\t\t\tDataBaseCon.numGames();\n\t\t\tDataBaseCon.humanWins();\n\t\t\tDataBaseCon.aIWins();\n\t\t\tDataBaseCon.avgDraws();\n\t\t\tDataBaseCon.maxDraws();\n\t\t\t\n\t\t} catch (IOException e)\n\t\t{\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private String saveCrashInfo2File(Throwable throwable) {\n StringBuffer stringBuffer = new StringBuffer();\n Iterator iterator = this.infos.entrySet().iterator();\n do {\n if (!iterator.hasNext()) break;\n Map.Entry entry = (Map.Entry)iterator.next();\n String string2 = (String)entry.getKey();\n String string3 = (String)entry.getValue();\n stringBuffer.append(String.valueOf((Object)string2) + \"=\" + string3 + \"\\n\");\n } while (true);\n StringWriter stringWriter = new StringWriter();\n PrintWriter printWriter = new PrintWriter((Writer)stringWriter);\n throwable.printStackTrace(printWriter);\n Throwable throwable2 = throwable.getCause();\n do {\n if (throwable2 == null) {\n printWriter.close();\n stringBuffer.append(stringWriter.toString());\n long l = System.currentTimeMillis();\n String string4 = this.formatter.format(new Date());\n String string5 = \"crash-\" + string4 + \"-\" + l + \".log\";\n if (!Environment.getExternalStorageState().equals((Object)\"mounted\")) return string5;\n File file = new File(\"/sdcard/crash/\");\n if (!file.exists()) {\n file.mkdirs();\n }\n FileOutputStream fileOutputStream = new FileOutputStream(String.valueOf((Object)\"/sdcard/crash/\") + string5);\n fileOutputStream.write(stringBuffer.toString().getBytes());\n fileOutputStream.close();\n return string5;\n }\n throwable2.printStackTrace(printWriter);\n throwable2 = throwable2.getCause();\n } while (true);\n catch (Exception exception) {\n Log.e((String)\"CrashHandler\", (String)\"an error occured while writing file...\", (Throwable)exception);\n return null;\n }\n }", "@Test\r\n public void test_logException2() throws Exception {\r\n Exception res = LoggingWrapperUtility.logException(log, signature, exception, true, Level.WARN);\r\n\r\n assertSame(\"'logException' should be correct.\", exception, res);\r\n\r\n TestsHelper.checkLog(\"logException\",\r\n \"WARN\",\r\n \"] Error in method [method_signature], details: Exception for testing.\",\r\n \"java.lang.Exception: Exception for testing.\");\r\n }", "public void logAfterThrowing(JoinPoint joinPoint, Throwable e);", "public void printStackTrace() {\n printStackTrace(System.err);\n }", "private void log(IndexObjectException e) {\n\t\t\r\n\t}", "public static void traceAndLogException(EnvironmentImpl envImpl,\n String sourceClass,\n String sourceMethod,\n String msg,\n Throwable t) {\n String traceMsg = msg + \"\\n\" + getStackTrace(t);\n\n envMap.put(Thread.currentThread(), envImpl);\n try {\n envImpl.getLogger().logp\n (Level.SEVERE, sourceClass, sourceMethod, traceMsg);\n } finally {\n envMap.remove(Thread.currentThread());\n }\n Trace.trace(envImpl, traceMsg);\n }", "private String stackTraceToString( Throwable t ){\n StringWriter writer = new StringWriter();\n PrintWriter printWriter = new PrintWriter( writer );\n t.printStackTrace( printWriter );\n printWriter.flush();\n return writer.toString();\n }", "public void addException(Exception e ) {\n logger.info(Thread.currentThread().getStackTrace()[1].getMethodName());\n logger.debug(\"Adding new Exception -> \"+ e);\n exception = e;\n }", "private void MinorException(Exception ex) {\n logger.logException(ex);\n }", "@AfterThrowing(pointcut = \"errorPointcut()\", throwing = \"e\")\n public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {\n log.error(\"Exception in {}.{}({}) with cause = {}\", joinPoint.getSignature().getDeclaringTypeName(),\n joinPoint.getSignature().getName(), concatenateSignatureArgs(joinPoint.getArgs()), Util.traceException(e));\n }", "public final void toLogFile() {\n\t\tRetroTectorEngine.toLogFile(\"Error message from \" + THESTRINGS[0] + \":\");\n\t\tfor (int i=1; i<THESTRINGS.length; i++) {\n\t\t\tRetroTectorEngine.toLogFile(THESTRINGS[i]);\n\t\t}\n\t}", "public final void printStackTrace()\r\n {\r\n printStackTrace( System.err );\r\n }", "public static String getPrintStackTrace(Exception e){\n\t\tStringWriter sw = new StringWriter();\n\t\t//PrintWriter integrates with StringWriter\n\t\tPrintWriter pw = new PrintWriter(sw);\n\t\t//This line used to write in catch block then it will writes in the console prints upon the console\n\t\t//Basically prints the data upon the console\n\t\te.printStackTrace(pw);\n\t\t//it will converts to tostring method into some meaningful data\n\t\treturn sw.toString();\n\t}", "public static String getStackTrace( Throwable exception ) {\r\n\t\tStringWriter sw = new StringWriter();\r\n\t\tPrintWriter pw = new PrintWriter( sw );\r\n\t\texception.printStackTrace( pw );\r\n\t\treturn sw.toString();\r\n\t}", "public void trace(Object message, Throwable t)\n/* */ {\n/* 130 */ this.logger.trace(message, t);\n/* */ }", "private void printStackTraceHerder() {\n PrintStream printStream = System.err;\n synchronized (printStream) {\n System.err.println(super.getMessage() + \"; nested exception is:\");\n this.detail.printStackTrace();\n }\n }", "public void writeLineToLog(String message){\n if(logWriter!=null) {\n logWriter.writeToLog(message);\n }\n else{\n logWriter = new CleanSweepLogWriterImpl();\n logWriter.writeToLog(message);\n }\n }", "public void appendLogFile(String str)\n{\n if(fileWriter != null)\n {\n try { \n \n fileWriter.append(str); \n \n } catch (Exception e) { \n \n System.out.println(\"Error in CsvFileWriter !!!\"); \n e.printStackTrace(); \n \n } finally { \n \n try {\n \n fileWriter.flush(); \n //fileWriter.close(); \n \n } catch (IOException e) { \n \n System.out.println(\"Error while flushing/closing fileWriter !!!\"); \n e.printStackTrace(); \n } \n \n } \n }\n}", "public void writeError( Exception e\n , String errorString\n , String sqlText) {\n\n StackTraceElement[] elements = e.getStackTrace();\n\n writeln();\n writeln(\"+---------------+\");\n writeln(\"| PROGRAM ERROR |\");\n writeln(\"+-------------------------------------------------------------------------------+\");\n writeln(\"| ERROR STRING : \" + errorString);\n writeln(\"| MESSAGE : \" + e.getMessage());\n writeln(\"| CAUSE : \" + e.getCause());\n writeln(\"| STACK TRACE : \");\n for (int i=0, n=elements.length; i<n; i++) {\n writeln(\n \"| at \" + \n elements[i].getClassName() + \".\" + elements[i].getMethodName() +\n \"()\" +\n \" [FILE -> \" +\n (elements[i].getFileName() == null \n ? \"Unknown Source File\" \n : (elements[i].isNativeMethod() \n ? \"Native Method\" \n : elements[i].getFileName() + \":\" + \n elements[i].getLineNumber()\n )\n ) +\n \"]\");\n }\n\n if (sqlText != null) {\n writeln(\"| SQL TEXT : \\n\" + sqlText);\n }\n\n writeln(\"+-------------------------------------------------------------------------------+\");\n writeln();\n stop();\n\n }", "private void printException(Exception e,int level)\n { printLog(\"Exception: \"+ExceptionPrinter.getStackTraceOf(e),level);\n if (level<=Log.LEVEL_HIGH) e.printStackTrace();\n }", "public void printException(Level l, Throwable e) {\n if (repository.isDisabled(l.getSyslogEquivalent()))\n return;\n\n if (isEnabledFor(l)) {\n forcedLog(FQCN, Level.ERROR, e.toString(), null);\n LoggerPrintStream out = new LoggerPrintStream(this, l);\n e.printStackTrace(out);\n out.flush();\n }\n }", "private void logToFile() {\n }", "private void logBugInstancesToCsvFile(String workspacePath) {\n\t File logFile = new File(String.format(\"%s/LogFile.csv\", workspacePath));\n\t \n\t try {\n\t\t //we create the log file, if it already exists, this method will do nothing\n\t\t logFile.createNewFile();\n\t } catch (IOException e) {\n\t\t e.printStackTrace();\n\t }\n\t \n\t \n\t try {\n\t\t PrintWriter writer = new PrintWriter(logFile);\n\t\t \n\t\t StringBuilder sb = new StringBuilder();\n\t\t \n\t\t //preparing the columns of the csv file\n\t\t sb.append(\"Project\");\n\t\t sb.append(\",\");\n\t\t sb.append(\"Class path\");\n\t\t sb.append(\",\");\n\t\t sb.append(\"Line of the catch clause\");\n\t\t sb.append(\",\");\n\t\t sb.append(\"Line of the statement that throws the exception of the other type\");\n\t\t sb.append(\",\");\n\t\t sb.append(\"Type of destructive wrapping instance\");\n\t\t sb.append(\",\");\n\t\t sb.append(\"Type of the exception initialy caught\");\n\t\t sb.append(\",\");\n\t\t sb.append(\"Type of the exception thrown\");\n\t\t sb.append(\"\\n\");\n\t\t \n\t\t for (String projectName : projectDestructiveWrappingInstancesMap.keySet()) {\n\t\t\t HashSet<DestructiveWrappingInstance> destructiveWrappingInstancesInProj =\n\t\t\t\t\t projectDestructiveWrappingInstancesMap.get(projectName);\n\t\t\t \n\t\t\t //adding the info of each destructive wrapping instance that was flagged during the analysis\n\t\t\t for (DestructiveWrappingInstance destructiveWrappingInstance : destructiveWrappingInstancesInProj) {\n\t\t\t\t sb.append(projectName);\n\t\t\t\t sb.append(\",\");\n\t\t\t\t sb.append(destructiveWrappingInstance.getClassPath());\n\t\t\t\t sb.append(\",\");\n\t\t\t\t sb.append(destructiveWrappingInstance.getCatchClauseStartLine());\n\t\t\t\t sb.append(\",\");\n\t\t\t\t sb.append(destructiveWrappingInstance.getProblematicLineStartLine());\n\t\t\t\t sb.append(\",\");\n\t\t\t\t sb.append(destructiveWrappingInstance.getTypeOfInstance());\n\t\t\t\t sb.append(\",\");\n\t\t\t\t sb.append(destructiveWrappingInstance.getInitialExceptionCaught());\n\t\t\t\t sb.append(\",\");\n\t\t\t\t sb.append(destructiveWrappingInstance.getNewExceptionCaught());\n\t\t\t\t sb.append(\"\\n\");\n\t\t\t }\n\t\t }\n\t\t \n\t\t //writing the string that contains the info of all the destructive wrapping instances in the csv file\n\t\t writer.write(sb.toString());\n\t\t \n\t\t writer.close();\n\t } catch (FileNotFoundException e) {\n\t\t e.printStackTrace();\n\t }\n }", "private static void createLogFile() {\n try {\n String date = new Date().toString().replaceAll(\":\", \"-\");\n logFile = new FileWriter(\"bio-formats-test-\" + date + \".log\");\n TestLogger log = new TestLogger(logFile);\n LogTools.setLog(log);\n }\n catch (IOException e) { }\n }", "public void writeLog() {\n\n\t}", "public void writeLog() {\n\n\t}", "public void writeLog() {\n\n\t}", "@AfterThrowing(pointcut = \"controllerClassMethods()\", throwing = \"exception\")\n\tpublic void logAfterThrowingCall(JoinPoint joinPoint, SPFException exception) throws Throwable {\n\t\tSystem.out.println(\"--------------------------------------------------\");\n\t\tSystem.out.println(\"Esto es el @AfterThrowing de aspect\");\n\t\tSystem.out.println(\"--------------------------------------------------\");\n\t\tlog.error(\"Error [{}] Calling [{}]:[{}] returned error message : , [{}]\", exception.getHttpStatus(),\n\t\t\t\tjoinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName(),\n\t\t\t\texception.getMessage());\n\t}", "public static void debugException(Throwable exception) {\n\t\tif (ConfigurationRegister.getInstance().isDebug()) {\n\t\t\tSystem.out.println(\"DEBUG: \" + exception.toString());\n\t\t\texception.printStackTrace();\n\t\t}\n\t}", "public final void printStackTrace( PrintWriter writer )\r\n {\r\n super.printStackTrace( writer );\r\n // Only print causal stack traces if pre-JDK 1.4.\r\n if ( !JDK1_4 ) {\r\n Throwable t = getCause();\r\n while ( t != null ) {\r\n writer.println( \"Caused by: \" + t );\r\n t.printStackTrace( writer );\r\n if ( t instanceof CanyonException ) {\r\n t = ( ( CanyonException ) t ).getCause();\r\n } else {\r\n break;\r\n }\r\n }\r\n }\r\n }", "public static void log(String message) {\n\t\t\r\n\t\ttry{\r\n\t\t if(!log.exists()){\r\n\t\t System.out.println(\"We had to make a new file.\");\r\n\t\t log.createNewFile();\r\n\t\t }\r\n\r\n\t\t FileWriter fileWriter = new FileWriter(log, !firstWrite);\r\n\r\n\t\t BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);\r\n\t\t bufferedWriter.write(message + '\\n');\r\n\t\t bufferedWriter.close();\r\n\t\t} catch(IOException e) {\r\n\t\t System.out.println(\"COULD NOT LOG!!\");\r\n\t\t}\r\n\t\t\r\n\t\tfirstWrite = false;\r\n\t}", "public static String getStackMessage(Throwable exception) {\n\t\tStringWriter sw = new StringWriter();\n\t\tPrintWriter pw = new PrintWriter(sw);\n\t\tpw.print(\" [ \");\n\t\tpw.print(exception.getClass().getName());\n\t\tpw.print(\" ] \");\n\t\texception.printStackTrace(pw);\n\t\treturn sw.toString();\n\t}", "public void writeLog(String log){\n //Create, if no files.\n if(!this.loggingFile.exists()){\n try {\n this.loggingFile.createNewFile();\n FileWriter fileWriter = new FileWriter(this.loggingFile, true);\n BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);\n bufferedWriter.write(log);\n bufferedWriter.newLine();\n bufferedWriter.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n //Open the file.\n else{\n try {\n synchronized (this.loggingFile) {\n FileWriter fileWriter = new FileWriter(this.loggingFile, true);\n BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);\n bufferedWriter.write(log);\n bufferedWriter.newLine();\n bufferedWriter.close();\n }\n }catch (IOException e){\n e.printStackTrace();\n }\n }\n\n }", "public static void fnPrintException(Exception e)\n\t{\n\t\te.printStackTrace();\n\t}", "public void writeError( Exception e\n , String errorString) {\n writeError(e, errorString, null);\n }", "public static void log(String message) {\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\");\n Timestamp timestamp = new Timestamp(System.currentTimeMillis());\n String log = sdf.format(timestamp) + \" - \" + message;\n System.out.println(log);\n try {\n writeLogToFile(log, LOG_FILE_PATH);\n } catch (IOException e) {\n System.err.println(e.getMessage());\n }\n }", "public static void printStackTrace(SQLException e) {\r\n printStackTrace(e, new PrintWriter(System.err));\r\n }", "private void logError(String msg)\n {\n GlobeRedirector.errorLog.write(msg);\n }", "public WriteException(String message)\n {\n super(message);\n }", "@Override\r\n public void uncaughtException(Thread thread, Throwable e) {\n if (isUiThread()) {\r\n writeLogToFile(thread, e);\r\n } else {\r\n //handle non UI thread throw uncaught exception\r\n new Handler(Looper.getMainLooper()).post(() ->\r\n writeLogToFile(thread, e));\r\n }\r\n }" ]
[ "0.7028894", "0.6875037", "0.6669865", "0.6306367", "0.6206776", "0.60590595", "0.5954751", "0.59085274", "0.5836363", "0.5685799", "0.5622718", "0.5585704", "0.5520188", "0.5509488", "0.54816264", "0.54591876", "0.54235023", "0.5402763", "0.53973335", "0.5378108", "0.5277015", "0.5206057", "0.5195166", "0.5176721", "0.51706845", "0.5143247", "0.5094036", "0.50397784", "0.5006723", "0.4986923", "0.4944407", "0.49294537", "0.492889", "0.49145594", "0.49123868", "0.49047875", "0.48992768", "0.48980924", "0.48870224", "0.48448455", "0.48250034", "0.47976676", "0.47915676", "0.47690445", "0.47655565", "0.47643363", "0.47482112", "0.47431844", "0.47366828", "0.47134352", "0.47114727", "0.4707141", "0.4695717", "0.46950555", "0.46843228", "0.46830413", "0.4662179", "0.4661022", "0.46578243", "0.46428096", "0.46324036", "0.4621941", "0.46214834", "0.45955124", "0.45793965", "0.45680517", "0.45658287", "0.45523924", "0.4549887", "0.45418698", "0.45409155", "0.45370066", "0.4533535", "0.451831", "0.45156288", "0.45126006", "0.44988066", "0.44894692", "0.44840124", "0.4474967", "0.44523728", "0.4446394", "0.44381166", "0.44365713", "0.4434664", "0.4434664", "0.4434664", "0.4429316", "0.44281924", "0.4426666", "0.44243494", "0.4416966", "0.44091004", "0.4402177", "0.44015107", "0.44014832", "0.43914765", "0.438918", "0.43802315", "0.4378828" ]
0.71013504
0
Creates a new log file.
private static void createLogFile() { try { String date = new Date().toString().replaceAll(":", "-"); logFile = new FileWriter("bio-formats-test-" + date + ".log"); TestLogger log = new TestLogger(logFile); LogTools.setLog(log); } catch (IOException e) { } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void generateLogFile() {\n\t\tFileOperations operator = new FileOperations(path);\n\t\toperator.writeFile(buildLogContent());\n\t}", "public File newLogFile() {\n File flog = null;\n try {\n this.logFileName = getTimestamp() + \".xml\";\n this.pathToLogFile = logFileFolder + logFileName;\n URL logURL = new URL(this.pathToLogFile);\n flog = new File(logURL.toURI());\n if (!flog.exists()) {\n flog.createNewFile();\n }\n } catch (Exception ex) {\n log.error(\"newLogFile :\"+ ex.getMessage());\n } finally{\n this.fLogFile = flog;\n return flog;\n }\n }", "public void createLogFile(int peerID) {\n String filename = \"peer_\" + peerID + \"/log_peer_\" + peerID + \".log\";\n File output = new File(\"peer_\" + peerID);\n output.mkdir();\n\n File file = new File(filename);\n\n try {\n if(!file.exists()) {\n file.createNewFile();\n FileWriter fw = new FileWriter(file.getAbsoluteFile(), true);\n BufferedWriter bw = new BufferedWriter(fw);\n bw.write(\"Log File for peer_\" + peerID + \".\");\n bw.newLine();\n bw.close();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static void CreateFile(){\n try{\n new File(\"wipimages\").mkdir();\n logscommissions.createNewFile();\n }catch(Exception e){\n e.printStackTrace();\n System.out.println(\"CreateFile Failed\\n\");\n }\n }", "private void openLogFile()\r\n {\n try\r\n {\r\n GregorianCalendar gc = new GregorianCalendar();\r\n runTS = su.reformatDate(\"now\", null, DTFMT);\r\n logFile = new File(logDir + File.separator + runTS + \"_identifyFTPRequests_log.txt\");\r\n logWriter = new BufferedWriter(new FileWriter(logFile));\r\n String now = su.DateToString(gc.getTime(), DTFMT);\r\n writeToLogFile(\"identifyFTPRequests processing started at \" +\r\n now.substring(8, 10) + \":\" + now.substring(10, 12) + \".\" +\r\n now.substring(12, 14) + \" on \" + now.substring(6, 8) + \"/\" +\r\n now.substring(4, 6) + \"/\" + now.substring(0, 4));\r\n }\r\n catch (Exception ex)\r\n {\r\n System.out.println(\"Error opening log file: \" + ex.getMessage());\r\n System.exit(1);\r\n }\r\n }", "public void openLogFile(String filename) throws IOException {\n\n if (objectOutputStream != null) {\n objectOutputStream.close();\n objectOutputStream = null;\n }\n\n if (new File(filename).exists()) {\n // Open for append\n fileOutputStream = new FileOutputStream(filename, true);\n objectOutputStream = new ObjectOutputStream(fileOutputStream);\n outputLogFilename = filename;\n } else {\n fileOutputStream = new FileOutputStream(filename);\n objectOutputStream = new ObjectOutputStream(fileOutputStream);\n outputLogFilename = filename;\n }\n }", "public void writeLog(String log){\n //Create, if no files.\n if(!this.loggingFile.exists()){\n try {\n this.loggingFile.createNewFile();\n FileWriter fileWriter = new FileWriter(this.loggingFile, true);\n BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);\n bufferedWriter.write(log);\n bufferedWriter.newLine();\n bufferedWriter.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n //Open the file.\n else{\n try {\n synchronized (this.loggingFile) {\n FileWriter fileWriter = new FileWriter(this.loggingFile, true);\n BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);\n bufferedWriter.write(log);\n bufferedWriter.newLine();\n bufferedWriter.close();\n }\n }catch (IOException e){\n e.printStackTrace();\n }\n }\n\n }", "public void createLogFile() {\n\t\tBufferedWriter out = null;\n\t\ttry {\n\t\t\tFile root = Environment.getExternalStorageDirectory();\n\t\t\tLog.e(\"SD CARD WRITE ERROR : \", \"SD CARD mounted and writable? \"\n\t\t\t\t\t+ root.canWrite());\n\t\t\tif (root.canWrite()) {\n\t\t\t\tFile gpxfile = new File(root, \"ReadConfigLog.txt\");\n\t\t\t\tFileWriter gpxwriter = new FileWriter(gpxfile);\n\t\t\t\tout = new BufferedWriter(gpxwriter);\n\t\t\t\tout.write(\"Hello world\");\n\t\t\t\t// out.close();\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tLog.e(\"SD CARD READ ERROR : \", \"Problem reading SD CARD\");\n\t\t\tLog.e(\"SD CARD LOG ERROR : \", \"Please take logs using Logcat\");\n\t\t\tLog.e(\"<<<<<<<<<<WifiPreference>>>>>>>>>>>>\",\n\t\t\t\t\t\"Could not write file \" + e.getMessage());\n\t\t}\n\t}", "public static void writeToLog(String filename,String log)\r\n\t{\n\t\ttry \r\n\t\t{\r\n\t\t\tString str = log + \" at \" + new Date() + \"\\n\";\r\n\t\t\tFiles.write(Paths.get(\"log.log\"),str.getBytes(),StandardOpenOption.APPEND);\r\n\t\t\t/*PrintWriter out = new PrintWriter(f);\r\n\t\t\tout.append(log + \" at \" + new Date());\r\n\t\t\tout.flush();\r\n\t\t\tout.close();*/\r\n\t\t} \r\n\t\tcatch (FileNotFoundException e) \r\n\t\t{\r\n\t\t\tSystem.err.println(\"FNE: \" + e.getMessage());\r\n\t\t} \r\n\t\tcatch (IOException e)\r\n\t\t{\r\n\t\t\tSystem.err.println(\"IOE: \" + e.getMessage());\r\n\t\t}\r\n\t\t\r\n\t}", "public static LogFile createLogFile(Path p) throws StructureException {\n if (!Files.isRegularFile(p))\n throw new StructureException(StructureException.Type.NOT_FILE);\n\n return new LogFile(p);\n }", "public void makeLogFile(long lognum, long seq, Slice key, Slice val) {\n\t\t String fname = FileName.getLogFileName(dbname, lognum);\n\t\t Object0<WritableFile> file0 = new Object0<>();\n\t\t Status s = env.newWritableFile(fname, file0);\n\t\t assertTrue(s.ok());\n\t\t LogWriter writer = new LogWriter(file0.getValue());\n\t\t WriteBatch batch = new WriteBatch();\n\t\t batch.put(key, val);\n\t\t WriteBatchInternal.setSequence(batch, seq);\n\t\t assertTrue(writer.addRecord(WriteBatchInternal.contents(batch)).ok());\n\t\t assertTrue(file0.getValue().flush().ok());\n\t\t file0.getValue().delete();;\n\t\t}", "private static void write(String message) {\n\t\tFile log = new File(filePath);\t// File for the database log\n\t\tboolean isNew = false;\t\t\t// Stores if the file created is a new or an old one\n\t\t\n\t\ttry {\n\t\t\tif (!log.exists()) {\n\t\t\t\tisNew = log.createNewFile();\n\t\t\t} // End if\n\t\t\tPrintWriter pw = new PrintWriter(new FileWriter(log, true));\n\t\t\t\n\t\t\tif (Boolean.TRUE.equals(isNew)) {\n\t\t\t\tpw.append(\"Database operations log:\");\n\t\t\t} // End if\n\t\t\tpw.append(message);\n\t\t\tpw.close();\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void log(String message) {\n\t\t\r\n\t\ttry{\r\n\t\t if(!log.exists()){\r\n\t\t System.out.println(\"We had to make a new file.\");\r\n\t\t log.createNewFile();\r\n\t\t }\r\n\r\n\t\t FileWriter fileWriter = new FileWriter(log, !firstWrite);\r\n\r\n\t\t BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);\r\n\t\t bufferedWriter.write(message + '\\n');\r\n\t\t bufferedWriter.close();\r\n\t\t} catch(IOException e) {\r\n\t\t System.out.println(\"COULD NOT LOG!!\");\r\n\t\t}\r\n\t\t\r\n\t\tfirstWrite = false;\r\n\t}", "private void open()\n {\n try\n {\n // Found how to append to a file here \n //http://stackoverflow.com/questions/1625234/how-to-append-text-to-an-existing-file-in-java\n r = new PrintWriter( new BufferedWriter(new FileWriter(filePath, true)));\n }\n catch( IOException e )\n {\n r = null;\n UI.println(\"An error occored when operning stream to the log file.\\n This game wont be logged\");\n Trace.println(e);\n }\n }", "void createFile()\n {\n //Check if file already exists\n try {\n File myObj = new File(\"src/main/java/ex45/exercise45_output.txt\");\n if (myObj.createNewFile()) {\n System.out.println(\"File created: \" + myObj.getName());// created\n } else {\n System.out.println(\"File already exists.\"); //exists\n }\n //Error check\n } catch (IOException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n }", "private void logToFile() {\n }", "public static void printCreateNewFile() {\n System.out.println(Message.CREATE_NEW_FILE);\n }", "private FSDataOutputStream createNewFile() throws Exception {\n\t\tlogger.traceEntry();\n\t\tPath newFile = new Path(rootDirectory, \"dim_\" + System.currentTimeMillis() + \".json\");\n\t\tlogger.debug(\"Creating file \" + newFile.getName());\n\t\tFSDataOutputStream dataOutputStream = null;\n\n\t\tif (!hadoopFileSystem.exists(newFile)) {\n\t\t\tdataOutputStream = hadoopFileSystem.create(newFile);\n\t\t} else {\n\t\t\tdataOutputStream = hadoopFileSystem.append(newFile);\n\t\t}\n\n\t\tdataOutputStreams.clear();\n\t\tdataOutputStreams.add(dataOutputStream);\n\t\tlogger.traceExit();\n\t\treturn dataOutputStream;\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 }", "protected BuildLog\n (\n final String fileName,\n final int buffer\n ) \n throws IOException\n {\n File logDir = new File(\"log\");\n if (!logDir.exists()) logDir.mkdirs();\n out = new PrintWriter\n (\n new BufferedWriter\n (\n new FileWriter(\"log\" + fileName, StandardCharsets.UTF_8), \n buffer\n )\n );\n }", "void setLogFile(File log);", "public void filecreate(String Response_details) throws IOException\n\t{\n\t\tFileWriter myWriter = new FileWriter(\"D://Loadtime.txt\",true);\n\t\tmyWriter.write(Response_details+System.lineSeparator());\n\t\tmyWriter.close();\n\t\tSystem.out.println(\"Successfully wrote to the file.\");\n\t\t\n\t\t\n\t}", "public void writeToLogFile(String entry) {\r\n\t\ttry{\r\n\t\t\tStringBuilder out = new StringBuilder(50);\r\n\t\t\tCalendar cal = Calendar.getInstance();\r\n\t\t SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);\r\n\t\t out.append(sdf.format(cal.getTime()) + \";\" + entry);\r\n\t\t \r\n\t\t this.write(out);\r\n\t\t}catch (Exception e){\r\n\t\t System.err.println(\"Error: \" + e.getMessage());\r\n\t\t}\r\n\t}", "public void createFile(File file) {\n\t\tif (file.exists())\n\t\t\treturn;\n\t\ttry {\n\t\t\tfile.createNewFile();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private static void addToLog(String message) {\n\t\ttry {\n\t\t\tDateFormat df = new SimpleDateFormat(\"dd/MM/yy HH:mm:ss:SS\");\n\t\t\tDate dateobj = new Date();\n\t\t\tlog.write(df.format(dateobj) + \": \" + message + \"\\n\");\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Error With the Log File\");\n\t\t\tSystem.err.println(\"Exiting...\");\n\t\t\tSystem.exit(1);\n\t\t};\n\t}", "private void createPropertiesFile(final File configFile) throws IOException {\n if (configFile.createNewFile()) {\n FileWriter writer = new FileWriter(configFile);\n writer.append(\"ch.hslu.vsk.server.port=1337\\n\");\n writer.append(\"ch.hslu.vsk.server.logfile=\");\n writer.flush();\n writer.close();\n }\n }", "public void createFile(File file) throws IOException {\n if (!file.exists()) {\n file.createNewFile();\n }\n }", "public static void generateLogFile (int numberOfMembers, int numberOfTimestamps) {\n\t\ttry {\n\t\t\tPath logFile = Files.createTempFile(\"logFile\", \".txt\");\n\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(logFile.toFile()));\n\t\t\tRandom rand = new Random();\n\t\t\tLinkedList<String> list = new LinkedList<>();\n\t\t\tfor (int i = 0; i < numberOfTimestamps; i++) {\n\t\t\t\tint hours = rand.nextInt(24);\n\t\t\t\tint minutes = rand.nextInt(60);\n\t\t\t\tint seconds = rand.nextInt(60);\n\t\t\t\tint p = rand.nextInt(numberOfMembers);\n\t\t\t\tint q;\n\t\t\t\tdo {\n\t\t\t\tq = rand.nextInt(numberOfMembers);\n\t\t\t\t} while (q == p);\n\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\tsb.append(hours);\n\t\t\t\tsb.append(\":\");\n\t\t\t\tsb.append(minutes);\n\t\t\t\tsb.append(\":\");\n\t\t\t\tsb.append(seconds);\n\t\t\t\tsb.append(\" \");\n\t\t\t\tsb.append(p);\n\t\t\t\tsb.append(\" \");\n\t\t\t\tsb.append(q);\n\t\t\t\tsb.append(\"\\n\");\n\t\t\t\tlist.add(sb.toString());\n\t\t\t}\n\t\t\tCollections.sort(list);\n\t\t\tfor (String line : list) {\n\t\t\t\tbw.write(line);\t\n\t\t\t}\n\t\t\tbw.close();\n\t\t\tpath = logFile.toString();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void CreateFile (String filename) {\r\n\t\t try {\r\n\t\t File myObj = new File(filename + \".txt\");\r\n\t\t if (myObj.createNewFile()) {\r\n\t\t System.out.println(\"File created: \" + myObj.getName());\r\n\t\t } else {\r\n\t\t System.out.println(\"File already exists.\");\r\n\t\t }\r\n\t\t } catch (IOException e) {\r\n\t\t System.out.println(\"An error occurred.\");\r\n\t\t e.printStackTrace();\r\n\t\t }\r\n\t\t }", "public static void createFile(File source) {\n try {\n if (!source.createNewFile()) {\n throw new IOException();\n }\n } catch (IOException e) {\n throw new RuntimeException(\"Failed to create file: \" + source.getAbsolutePath(), e);\n }\n }", "public static void createLogsFolder(String name) {\r\n\t\tcreateLogsFolder(name, \"./src/logs/\");\r\n\t}", "private String generateFileName() {\n\t\t\n\t\treturn \"/tmp/logger.java_log\" + new Random().nextInt();\n\t}", "public static void createNewFile(File file) {\n\t\ttry {\n\t\t\tfile.createNewFile();\n\t\t} catch (Exception exp) {\n\t\t\tthrow new RuntimeException(exp);\n\t\t}\n\t}", "private void createTransactionLog(String deltaLakeTableLocation)\n throws IOException\n {\n File deltaTableLogLocation = new File(new File(URI.create(deltaLakeTableLocation)), \"_delta_log\");\n verify(deltaTableLogLocation.mkdirs(), \"mkdirs() on '%s' failed\", deltaTableLogLocation);\n String entry = Resources.toString(Resources.getResource(\"deltalake/person/_delta_log/00000000000000000000.json\"), UTF_8);\n Files.writeString(new File(deltaTableLogLocation, \"00000000000000000000.json\").toPath(), entry);\n }", "private void createScheduleFile() {\n try {\n File scheduleFile = new File(filePath, \"schedule.txt\");\n// FileWriter fw = new FileWriter(scheduleFile);\n\n OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream(scheduleFile), StandardCharsets.UTF_8);\n osw.write(\"SCHEDULE:\\n\" + schedule);\n osw.close();\n\n System.out.println(\"schedule.txt successfully created.\");\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public FileAppender createNewFileAppender(String appenderName, String logFilePath) {\n\t FileAppender appender = new FileAppender();\n\t appender.setName(appenderName);\n\t appender.setLayout(new EnhancedPatternLayout(\"%d %-5p %C.%M(%F:%L) - %m%n\"));\n\t appender.setFile(logFilePath);\n\t appender.setAppend(false);\n\t appender.activateOptions();\n\t Logger.getRootLogger().addAppender(appender);\n\t return appender;\n\t}", "public static void createLogsFolder(String name, String folderPath) {\r\n\t\tFile path = new File(folderPath);\r\n\t\tFile file = new File(folderPath+name+\".txt\");\r\n\t\tif(!file.exists()) {\r\n\t\t\tpath.mkdirs();\r\n\t\t\ttry {file.createNewFile();} catch (IOException e) {System.err.println(\"The file \\\"\"+name+\"\\\" cannot be created : \"+e.getMessage());}\r\n\t\t}\r\n\t}", "private static void createLogger() {\n logger = myLogger.createHtmlLogger(\"JRECEIPTS\", Options.LOG_PATH + \"Receipts\", 262144, true, 1);\n// boolean append = true;\n// int limit = 1000000; // 1 Mb\n// int numLogFiles = 5;\n// FileHandler fh = new FileHandler(Options.LOG_PATH + \"Receipts_%g.html\", limit, numLogFiles, true);\n// fh.setFormatter(new SimpleFormatter());\n// // Add to the desired logger\n// logger = Logger.getLogger(\"Receipts\");\n// logger.addHandler(fh);\n }", "private void writeToLogFile(String message)\r\n {\n try\r\n {\r\n logWriter.write(message);\r\n logWriter.newLine();\r\n }\r\n catch (Exception ex)\r\n {\r\n System.out.println(\"Error writing message '\" + message +\r\n \"' to log file : \" + ex.getMessage());\r\n System.exit(1);\r\n }\r\n }", "public void open() {\r\n if (mFailedOpen) {\r\n return;\r\n }\r\n\r\n File base = new File(mBaseFileName);\r\n if (mMaxLogSizeBytes > 0 && base.length() > (mMaxLogSizeBytes / mNumSegments - 1024)) {\r\n Log.d(LOG_TAG, \"Log file exceeds maximum size\");\r\n close();\r\n renameLogs();\r\n open();\r\n } else if (mCurrentFileStream == null) {\r\n try {\r\n mCurrentFileStream = new FileOutputStream(mBaseFileName, true);\r\n } catch (FileNotFoundException e) {\r\n Log.e(LOG_TAG, \"Could not open log file \" + e.getMessage());\r\n mFailedOpen = true;\r\n mCurrentFileStream = null;\r\n }\r\n }\r\n }", "private void closeLogFile()\r\n {\n try\r\n {\r\n GregorianCalendar gc = new GregorianCalendar();\r\n String now = su.DateToString(gc.getTime(), DTFMT);\r\n writeToLogFile(\"identifyFTPRequests processing ended at \" +\r\n now.substring(8, 10) + \":\" + now.substring(10, 12) + \".\" +\r\n now.substring(12, 14) + \" on \" + now.substring(6, 8) + \"/\" +\r\n now.substring(4, 6) + \"/\" + now.substring(0, 4));\r\n logWriter.close();\r\n }\r\n catch (Exception ex)\r\n {\r\n System.out.println(\"Error closing log file: \" + ex.getMessage());\r\n System.exit(1);\r\n }\r\n }", "public Log()\n {\n filePath = String.format(\"log-%d.sl\", System.currentTimeMillis());\n\n open();\n }", "public static void dumpLog() {\n\t\t\n\t\tif (log == null) {\n\t\t\t// We have no log! We must be accessing this entirely statically. Create a new log. \n\t\t\tnew Auditor(); // This will create the log for us. \n\t\t}\n\n\t\t// Try to open the log for writing.\n\t\ttry {\n\t\t\tFileWriter logOut = new FileWriter(log);\n\n\t\t\t// Write to the log.\n\t\t\tlogOut.write( trail.toString() );\n\n\t\t\t// Close the log writer.\n\t\t\tlogOut.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// Close the log file itself.\n\t\t// Apparently we can't? TODO: Look into this. \n\n\t}", "private static void writeToFile(final String message, final File toFile) {\n toFile.getParentFile().mkdirs();\n BufferedWriter writer = null;\n try {\n writer = new BufferedWriter(new FileWriter(toFile));\n writer.write(message);\n } \n catch (IOException e) {\n log.error(\"Error writing file=\"+toFile, e);\n } \n finally {\n if (writer != null) {\n try {\n writer.close();\n } \n catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n }", "@Override\n public File createFile(String path) throws IOException {\n String pathStr=path+fileSeparator+\"Mail.json\";\n File file = new File(pathStr);\n file.createNewFile();\n return file;\n }", "void setupFileLogging();", "public void logToFile(String Message){\n\t\tProperties log4jProperties = new Properties();\n\t\tlog4jProperties.setProperty(\"log4j.rootLogger\", \"INFO, FILE\");\n\t\tlog4jProperties.setProperty(\"log4j.appender.FILE\", \"org.apache.log4j.RollingFileAppender\");\n\t\tlog4jProperties.setProperty(\"log4j.appender.FILE.file\", \"log.txt\");\n\t\tlog4jProperties.setProperty(\"log4j.appender.FILE.layout\", \"org.apache.log4j.PatternLayout\");\n\t\tlog4jProperties.setProperty(\"log4j.appender.FILE.layout.ConversionPattern\", \"%-5p %c %x - %m%n\");\n\t\tlog4jProperties.setProperty(\"log4j.appender.FILE.immediateFlush\", \"false\");\n\t\tlog4jProperties.setProperty(\"log4j.appender.FILE.Append\", \"true\");\n\t\tPropertyConfigurator.configure(log4jProperties);\n\t\tlog.info(Message);\n\t}", "public void create_loginFile(String account){\n try {\n outputStreamWriter = new OutputStreamWriter(context.openFileOutput(Constant.LOGIN_FILE, Context.MODE_PRIVATE));\n outputStreamWriter.write(account+\" logged in,\");\n outputStreamWriter.close();\n }\n catch (Exception e){\n Message.logMessages(\"ERROR: \",e.toString());\n }\n }", "BufferedLogChannel createNewLogForCompaction() throws IOException;", "abstract protected String getLogFileName();", "public void createEditLog(long startingTransactionId) throws IOException {\n mEditLog = new EditLog(mEditLogPath, false, startingTransactionId);\n }", "LogFile(File file)\n {\n this.file = file;\n }", "public void saveToLog(String log){\n \n File logfile = new File(System.getProperty(\"user.home\"), \"db_logfile\" + DwenguinoBlocklyArduinoPlugin.startTimestamp + \".txt\");\n try {\n BufferedWriter bWriter = new BufferedWriter(new PrintWriter(logfile));\n bWriter.write(log);\n bWriter.flush();\n bWriter.close();\n \n } catch (IOException ex) {\n Logger.getLogger(DwenguinoBlocklyServer.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "Path getLogFilePath();", "public static void createFile(String name)\n {\n file = new File(name);\n try\n {\n if(file.exists())\n {\n file.delete();\n file.createNewFile();\n }else file.createNewFile();\n \n fileWriter = new FileWriter(file);\n fileWriter.append(\"Generation, \");\n fileWriter.append(\"Fitness, \");\n fileWriter.append(\"Average\\n\");\n \n }catch (IOException e) \n {\n System.out.println(e);\n }\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 Log(String fp)\n {\n this.filePath = fp;\n\n open();\n }", "@Override\n public CreateLogPatternResult createLogPattern(CreateLogPatternRequest request) {\n request = beforeClientExecution(request);\n return executeCreateLogPattern(request);\n }", "public Auditor () {\n\n\t\t// Create a new log file without deleting existing logs. Use the current time. \n\t\ttry {\n\t\t\tlog = new File( \"log: \" + Double.toString( new Date().getTime()) + \".txt\" );\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "public static File createNewFile(String filename){\n try {\n File outputFile = new File(filename + \".csv\");\n\n //Creates File\n outputFile.createNewFile();\n\n return outputFile;\n\n } catch (IOException ex) {\n Logger.getLogger(CSVWriter.class.getName()).log(Level.SEVERE, null, ex);\n return null;\n }\n }", "public void log(String logThis){\n\t\t\n\t\t DateFormat df = new SimpleDateFormat(\"MM/dd/yyyy HH:mm:ss\");\n\t Date today = Calendar.getInstance().getTime();\n\t String reportDate = df.format(today);\n\t\t\n\t\t\t{\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tFile log = new File(\"C:\\\\Users\\\\Student\\\\Downloads\\\\m1-java-capstone-vending-machine-A-Copy\\\\m1-java-capstone-vending-machine\\\\Log.txt\");\t\n\t\t\t\tBufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(log, true));\n\n\t\t bufferedWriter.write(reportDate + \"||\" + logThis);\n\t\t bufferedWriter.newLine();\n\n\t\t bufferedWriter.close();\n\t\t\t\t\n\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\t\n\t}", "private static void setupLogger(String path, String filename, Level level) throws IOException {\n Path logDir = Paths.get(path, filename + \"_log\");\n\t\tif (!Files.exists(logDir)) {\n\t\t\tFiles.createDirectories(logDir);\n\t\t}\n\t\tString fileName = logDir.resolve(\"searsia.log\").toString();\n Handler fileHandler = new FileHandler(fileName, 1048576, 100, true);\n fileHandler.setFormatter(new SimpleFormatter());\n LogManager.getLogManager().reset();\n\t\tLOGGER.addHandler(fileHandler);\n\t\tLOGGER.setLevel(level);\n\t\tLOGGER.warning(\"Searsia restart\");\n\t}", "@Override\n protected void createFile(String directoryName, String fileNamePrefix) {\n }", "public void activateFileMode() {\n try {\n mFileHandler = new FileHandler(\"messagesLog/\" + System.currentTimeMillis() + \".log\");\n } catch (IOException pE) {\n pE.printStackTrace();\n }\n logger.addHandler(mFileHandler);\n }", "public void writeLog(){\n\t\ttry\n\t\t{\n\t\t\tFileWriter writer = new FileWriter(\"toptrumps.log\");\n\t\t\twriter.write(log);\n\t\t\twriter.close();\n\t\t\tSystem.out.println(\"log saved to toptrumps.log\");\n\t\t\t\n\t\t\tDataBaseCon.gameInfo(winName, countRounds, roundWins);\n\t\t\tDataBaseCon.numGames();\n\t\t\tDataBaseCon.humanWins();\n\t\t\tDataBaseCon.aIWins();\n\t\t\tDataBaseCon.avgDraws();\n\t\t\tDataBaseCon.maxDraws();\n\t\t\t\n\t\t} catch (IOException e)\n\t\t{\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n\tpublic void update() {\n\t\tFile logFile = new File(AppStorage.getInstance().getLogFileLocation());\n\t\tlogFile.getParentFile().mkdirs();\n\n\t\ttry {\n\t\t\tFileHandler fileHandler = new FileHandler(AppStorage.getInstance().getLogFileLocation(), true);\n\t\t\tSimpleFormatter formatter = new SimpleFormatter();\n\t\t\tfileHandler.setFormatter(formatter);\n\n\t\t\twhile (logger.getHandlers().length > 0) {\n\t\t\t\tFileHandler prevFileHandler = (FileHandler)logger.getHandlers()[0];\n\t\t\t\tlogger.removeHandler(prevFileHandler);\n\t\t\t\tprevFileHandler.close();\n\t\t\t}\n\n\t\t\tlogger.addHandler(fileHandler);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void createFile (String filePath){\n try{\n File newFile = new File(filePath);\n if(newFile.createNewFile()){\n System.out.println(\"File created: \"+newFile.getName());\n } else {\n System.out.println(\"File already exists.\");\n }\n } catch (IOException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n }", "protected void writeLog(String text){\n File logFile = new File(logFilePath);\n try {\n FileWriter fr = new FileWriter(logFile, true);\n fr.write(String.format(\"%s:\\t%s\\n\", getCurrentDate(), text));\n fr.close();\n } catch (IOException e){\n e.printStackTrace();\n }\n }", "private void writeTo(String logEntry, File logFile) throws IOException {\n try (FileWriter logFileWriter = new FileWriter(logFile, true);) {\n logFileWriter.write(logEntry);\n logFileWriter.write(System.lineSeparator());\n logFileWriter.flush();\n logFileWriter.close();\n }\n}", "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 }", "private void createFileHierarchie() throws IOException {\r\n\t\tlog.debug(\"START: SBIWebServer.createFileHierarchie\");\r\n\t\t// Create logs directory if not exist\r\n\t\tPath logPath = Paths.get(DEFAULT_LOG_LOCATION);\r\n\t\tif (!Files.exists(logPath)) {\r\n\t\t\tFiles.createDirectory(Paths.get(DEFAULT_LOG_LOCATION));\r\n\t\t\tlog.debug(\"Directory \"+DEFAULT_LOG_LOCATION+\" created\");\r\n\t\t}else {\r\n\t\t\tlog.debug(\"Directory \"+DEFAULT_LOG_LOCATION+\" already exists\");\r\n\t\t}\r\n\t\t\r\n\t\t// Create default server.xml\r\n\t\tPath serverConfigPath = Paths.get(CONFIG_SERVER_LOCATION);\r\n\t\tif (!Files.exists(serverConfigPath)) {\r\n\t\t\tXmlServerConfig xml = ConfigurationFactory.createDefaultXmlServerConfig();\r\n\t\t\ttry {\r\n\t\t\t\tXmlHelper.storeXml(xml, new File(CONFIG_SERVER_LOCATION));\r\n\t\t\t\tlog.debug(\"File \"+CONFIG_SERVER_LOCATION+\" created\");\r\n\t\t\t} catch (JAXBException e) {\r\n\t\t\t\tlog.error(\"Cannot store \"+CONFIG_SERVER_LOCATION,e);\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tlog.debug(\"File \"+CONFIG_SERVER_LOCATION+\" already exists\");\r\n\t\t}\r\n\t\tlog.debug(\"END: SBIWebServer.createFileHierarchie\");\r\n\t}", "LogFile open(String fileMode) throws LogConfigurationException, FileNotFoundException\n {\n this.fileMode = fileMode;\n\n // remember whether the file existed or not\n newFile = !file.exists();\n \n // if it already existed, but length is zero, then it is still a new file\n if (!newFile) newFile = file.length() == 0;\n \n channel = new RandomAccessFile(file, fileMode).getChannel();\n assert channel != null : \"RandomAccessFile() returns null\";\n \n // FEATURE 300922; lock file to prevent simultanious access\n try {\n lock = channel.tryLock();\n // TODO log lock event\n // if (lock != null) System.err.println(file.getName() + \" locked\");\n } catch (IOException e) {\n throw new LogConfigurationException(e);\n }\n if (lock == null) {\n // TODO: log lock failed\n // System.err.println(file.getName() + \" unable to lock\");\n throw new LogConfigurationException(\"Unable to obtain lock on \" + file.getAbsolutePath());\n }\n if (lock.isShared()) {\n // TODO: log lock is shared\n // System.err.println(file.getName() + \" lock is shared\");\n throw new LogConfigurationException(\"Shared lock on \" + file.getAbsolutePath());\n }\n // TODO: log lock acquired\n // System.err.println(file.getName() + \" open\");\n \n return this;\n }", "private void writeLog(){\n\t\tStringBuilder str = new StringBuilder();\r\n\t\tstr.append(System.currentTimeMillis() + \", \");\r\n\t\tstr.append(fileInfo.getCreator() + \", \");\r\n\t\tstr.append(fileInfo.getFileName() + \", \");\r\n\t\tstr.append(fileInfo.getFileLength() + \", \");\r\n\t\tstr.append(networkSize + \", \");\r\n\t\tstr.append(fileInfo.getN1() + \", \");\r\n\t\tstr.append(fileInfo.getK1() + \", \");\r\n\t\tstr.append(fileInfo.getN2() + \", \");\r\n\t\tstr.append(fileInfo.getK2() + \", \");\r\n\t\tstr.append(logger.getDiff(logger.topStart, logger.topEnd-Constants.TOPOLOGY_DISCOVERY_TIMEOUT)+ \", \");\r\n\t\tstr.append(logger.getDiff(logger.optStart, logger.optStop) + \", \");\r\n\t\tstr.append(logger.getDiff(logger.encryStart, logger.encryStop) + \", \");\r\n\t\tstr.append(logger.getDiff(logger.distStart, logger.distStop) + \"\\n\");\r\n\t\t\r\n\t\tString tmp=\"\t\";\r\n\t\tfor(Integer i : fileInfo.getKeyStorage())\r\n\t\t\ttmp += i + \",\";\r\n\t\ttmp += \"\\n\";\r\n\t\tstr.append(tmp);\r\n\t\t\r\n\t\ttmp=\"\t\";\r\n\t\tfor(Integer i : fileInfo.getFileStorage())\r\n\t\t\ttmp += i + \",\";\r\n\t\ttmp += \"\\n\";\r\n\t\tstr.append(tmp);\t\t\r\n\t\t//dataLogger.appendSensorData(LogFileName.FILE_CREATION, str.toString());\t\t\r\n\t\t\r\n\t\t// Topology Discovery\r\n\t\tstr.delete(0, str.length()-1);\r\n\t\tstr.append(Node.getInstance().getNodeId() + \", \");\t\t\t\r\n\t\tstr.append(\"TopologyDisc, \");\r\n\t\tstr.append(networkSize + \", \" + n1 + \", \" + k1 + \", \" + n2 + \", \" + k2 + \", \");\r\n\t\tstr.append(logger.topStart + \", \");\r\n\t\tstr.append(logger.getDiff(logger.topStart, logger.topEnd-Constants.TOPOLOGY_DISCOVERY_TIMEOUT ) + \", \");\r\n\t\tstr.append(\"\\n\");\t\t\t\t\r\n\t\t//dataLogger.appendSensorData(LogFileName.TIMES, str.toString());\r\n\t\t\r\n\t\t// Optimization\r\n\t\tstr.delete(0, str.length()-1);\r\n\t\tstr.append(Node.getInstance().getNodeId() + \", \");\t\t\t\r\n\t\tstr.append(\"Optimization, \");\r\n\t\tstr.append(networkSize + \", \" + n1 + \", \" + k1 + \", \" + n2 + \", \" + k2 + \", \");\r\n\t\tstr.append(logger.optStart + \", \");\r\n\t\tstr.append(logger.getDiff(logger.optStart, logger.optStop) + \", \");\r\n\t\tstr.append(\"\\n\");\r\n\t\t//dataLogger.appendSensorData(LogFileName.TIMES, str.toString());\t\t\r\n\t\t\r\n\t\t\r\n\t\t// File Distribution\r\n\t\tstr.delete(0, str.length()-1);\r\n\t\tstr.append(Node.getInstance().getNodeId() + \", \");\t\t\t\r\n\t\tstr.append(\"FileDistribution, \");\r\n\t\tstr.append(networkSize + \", \" + n1 + \", \" + k1 + \", \" + n2 + \", \" + k2 + \", \");\r\n\t\tstr.append(fileInfo.getFileLength() + \", \");\r\n\t\tstr.append(logger.distStart + \", \");\r\n\t\tstr.append(logger.getDiff(logger.distStart, logger.distStop) + \", \");\r\n\t\tstr.append(\"\\n\\n\");\r\n\t\t//dataLogger.appendSensorData(LogFileName.TIMES, str.toString());\t\t\r\n\t}", "private void createFile(PonsFileFactory ponsFileFactory, Profile profile){\n moveX(profile);\n ponsFileFactory.setProfile(profile);\n String text = ponsFileFactory.createPonsFile();\n String profileName = profile.getName();\n WriteFile.write(text,pathTextField.getText() + \"/\" + profileName.substring(0,profileName.indexOf(\".\")));\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 }", "public void createNewImageFile(){\n fillNewImage();\n\n try {\n ImageIO.write(newImage, imageFileType, new File(k + \"_Colored_\" + fileName.substring(0,fileName.length() - 4) + \".\" + imageFileType));\n } catch (IOException e){\n e.printStackTrace();\n }\n \n }", "public static void writeLogToFile(String log, String filePath) throws IOException {\n File file = new File(filePath);\n if (file.createNewFile() || file.exists()) {\n try (BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file)))) {\n String result = \"\";\n String line;\n while ((line = br.readLine()) != null) {\n result = String.format(\"%s%n%s\", result, line);\n }\n result = log + result;\n if (file.delete()) {\n try (FileOutputStream fos = new FileOutputStream(file)) {\n fos.write(result.getBytes());\n fos.flush();\n }\n }\n } catch (Exception e) {\n System.err.println(e.getMessage());\n }\n }\n }", "public File getLoggerFile() throws IOException {\n var logFilePath = this.serverProperties.getProperty(LOGFILE);\n File logFile = null;\n if (logFilePath == null || logFilePath.isEmpty()) {\n System.out.println(\"No valid LogFile defined, logging to tmp File...\");\n logFile = File.createTempFile(\"server\", \".log\");\n } else {\n logFile = new File(logFilePath);\n }\n\n this.createFileIfNotExisting(logFile);\n\n System.out.println(String.format(\"Logging to file : '%s'\", logFile.getAbsoluteFile()));\n return logFile;\n }", "public void logOpen() throws IOException {\n\t\t\t\t// Initialization:\n\t\t\t\tfileCleaner(\"failed.log\");\n\t\t\t\tfileCleaner(\"failed.num\");\n\t\t\t\tfileCleaner(\"finish.time\");\n\t\t\t\tfileCleaner(\"ini.time\");\n\t\t\t\tfileCleaner(\"run.log\");\n\t\t\t\tfileCleaner(\"print.log\");\n\t\t\t\tfileCleaner(\"start.time\");\n\t\t\t\tfileCleaner(\"stack.trace\");\n\t\t\t\tfileCleaner(\"test.num\");\n\t\t\t\tfileCleaner(\"wait.log\");\n\t\t\t\tfileCleaner(\"xml.path\");\n\t\t\t\tfileCleaner(\"source.html\");\n\t\t\t\tString time = getCurrentDateTimeFull(); // System.out.print(\" TEST START: \" + time + \"\\n\");\n\t\t\t\tfileWriter(\"ini.time\", convertLongToString(System.currentTimeMillis()));\n\t\t\t\t// Initial Log record:\n\t\t\t\tfileWriter(\"run.log\", \" TEST START: \" + time);\n\t\t\t\tfileWriter(\"run.log\", \"\");\n\t\t\t}", "public void createFiles() {\r\n try {\r\n FileWriter file = new FileWriter(registerNumber + \".txt\");\r\n file.write(\"Name : \" + name + \"\\n\");\r\n file.write(\"Surname : \" + surname + \"\\n\");\r\n file.write(\"Registration Number : \" + registerNumber + \"\\n\");\r\n file.write(\"Position : \" + position + \"\\n\");\r\n file.write(\"Year of Start : \" + yearOfStart + \"\\n\");\r\n file.write(\"Total Salary : \" + Math.round(totalSalary) + \".00 TL\" +\"\\n\");\r\n file.close();\r\n }\r\n catch(IOException e) {\r\n e.printStackTrace();\r\n }\r\n }", "private void createresultDir() throws IOException\n\t{\n\t\tString datepattern = \"yyyy-MM-dd\";\n\t\tSimpleDateFormat sdf =new SimpleDateFormat(datepattern);\n\t\t RESULTDIR = Parameters.RESULT_LOCAL_DIR+'/'+sdf.format(new Date());\n\t\t boolean exists = (new File(Parameters.RESULT_LOCAL_DIR)).exists();\n\t\t if (!exists)\n\t\t\t (new File(Parameters.RESULT_LOCAL_DIR)).mkdirs();\n\t\t exists = (new File(RESULTDIR)).exists();\n\t\t if (!exists)\n\t\t\t (new File(RESULTDIR)).mkdirs();\n\t\t boolean append = true;\n\t FileHandler fh = new FileHandler(RESULTDIR+\"/report.log\", append);\n\t fh.setFormatter(new LogFormatter());\n\t logfile.addHandler(fh);\n\t}", "public void makeProgressFile() {\n progressData = new File(wnwData, \"progress.dat\");\n try {\n progressData.createNewFile();\n } catch (IOException e) {\n e.printStackTrace();\n }\n progressData.setWritable(true);\n }", "private void createFile(String fileName, String content) throws IOException {\n File file = new File(fileName);\n if (!file.exists()) {\n file.createNewFile();\n }\n FileWriter fileWriter = new FileWriter(fileName, false);\n fileWriter.append(content);\n fileWriter.close();\n }", "private void CreateNewFile() {\n\tcheckState();\n\t\n\tif (CanR=CanW=true)\n\t{\n\t\t\n\t\ttry {\n\t\t root = Environment.getExternalStorageDirectory();\n\t\t \n\t\t if (root.canWrite()){\n\t\t gpxfile = new File(root, \"Speed_SD.csv\");\n\t\t gpxwriter = new FileWriter(gpxfile,true);\n\t\t out = new BufferedWriter(gpxwriter);\nout.append(\"\"+\",\"+\"\"+\",\"+\"\");\n\t\t out.newLine();\n\t\t }\n\t\t} catch (IOException e) {\n\t\t //Log.e(, \"Could not write file \" + e.getMessage());\ne.printStackTrace();\n\t\t\n\t}\n\t\t\n}\n\t\t}", "public RollingFileAppender createNewRollingFileAppender(String appenderName, String logFilePath, String maxFileSize, int maxBackups) {\n\t\tRollingFileAppender appender = new RollingFileAppender();\n\t appender.setName(appenderName);\n\t appender.setLayout(new EnhancedPatternLayout(\"%d %-5p %C.%M(%F:%L) - %m%n\"));\n\t appender.setFile(logFilePath);\n\t appender.setAppend(true);\n\t appender.setMaxFileSize(maxFileSize);\n\t appender.setMaxBackupIndex(maxBackups);\n\t appender.activateOptions();\n\t Logger.getRootLogger().addAppender(appender);\n\t return appender;\n\t}", "public String genLogFilePath() {\n\n\t\tString logFileName = generateFileName();\n\t\tString logFilePath = FileIoUtils.getLogFilePathPrefix(logFileName)\n\t\t\t\t+ \"/\" + logFileName;\n\t\treturn logFilePath;\n\n\t}", "private Debugger(String fileName)\n {\n try\n { \n // Create a new log file\n FileOutputStream fos = new FileOutputStream(fileName, false);\n BufferedOutputStream bf = new BufferedOutputStream(fos);\n log = new PrintWriter(bf, true); \n \n // Set stderr to go to the log file\n System.setErr(new PrintStream(bf));\n }\n catch(IOException e)\n {\n System.out.println(\n \"[DEBUGGER] Error to generate log file\\n\" + e\n );\n e.printStackTrace();\n }\n }", "private static void createFile(String fileType) throws Exception {\n DateTimeFormatter dtf = DateTimeFormatter.ofPattern(\"yyyy-MM-dd-HH-mm-ss\");\n LocalDateTime now = LocalDateTime.now();\n File xmlFile = new File(System.getProperty(\"user.dir\")+\"/data/saved/\"+dtf.format(now) + fileType + \".xml\");\n OutputFormat out = new OutputFormat();\n out.setIndent(5);\n FileOutputStream fos = new FileOutputStream(xmlFile);\n XML11Serializer serializer = new XML11Serializer(fos, out);\n serializer.serialize(xmlDoc);\n\n }", "@TaskAction\n public void create() {\n dir.mkdirs();\n getChmod().chmod(dir, dirMode);\n }", "public boolean logFile(boolean checkLogin) {\r\n // duong dan de luu file logFile\r\n String pathName = \"C:\\\\RFID\";\r\n File file = new File(pathName);\r\n // kiem tra thu muc co ton tai chua,neu chua thi tao thu muc\r\n if (!file.isDirectory()) {\r\n file.mkdirs();\r\n }\r\n // kiem tra tao tin co ton tai chua, neu chua thi tao tap tin\r\n pathName = \"C:\\\\RFID\\\\LogFile\";\r\n file = new File(pathName);\r\n if (!file.exists()) {\r\n try {\r\n file.createNewFile();\r\n } catch (IOException e) {\r\n //e.printStackTrace();\r\n return false;\r\n }\r\n }\r\n // ghi du lieu vao file\r\n try {\r\n FileWriter fr = new FileWriter(file, true);\r\n Date date = new Date();\r\n String str = date.getDate() + \" \" + date.getTime() + \" \" + this.username;\r\n if (checkLogin) {\r\n str += \" Login\\r\\n\";\r\n } else {\r\n str += \" Logout\\r\\n\";\r\n }\r\n fr.write(str);\r\n fr.close();\r\n return true;\r\n } catch (IOException e) {\r\n //e.printStackTrace();\r\n return false;\r\n }\r\n }", "public static File createFile(String filename){\n try {\n File outputFile = new File(filename + \".csv\");\n\n //Prevent File Overwrite\n int tmp = 1;\n while (outputFile.exists()){\n outputFile = new File(filename + \".csv\" + \".\" + tmp);\n tmp++;\n }\n\n //Creates File\n outputFile.createNewFile();\n\n return outputFile;\n\n } catch (IOException ex) {\n Logger.getLogger(CSVWriter.class.getName()).log(Level.SEVERE, null, ex);\n return null;\n }\n }", "private void createWriter() throws IOException {\n if (outputFile.exists()) {\n outputFile.delete();\n }\n FileWriter outFw = null;\n try {\n outFw = new FileWriter(outputFile.getAbsolutePath());\n } catch (IOException e) {\n LOG.error(\"Can not create writer for {} {}\", outputFile.getAbsolutePath(), e);\n throw e;\n }\n this.bufferedWriter = new BufferedWriter(outFw);\n writeOutputLine(\"User Agent - started\");\n }", "public void createFile(String fname) {\n\t\tprintMsg(\"running createFiles() in \\\"\" + this.getClass().getName() + \"\\\" class.\");\n\t\t\n\t\t// Check if the scratch directory exists, create it if it doesn't\n\t\tPath rootpath = Paths.get(theRootPath);\n\t\tcreateScratchDirectory(rootpath);\n\n\t\t// Check if the file name is null or empty, if it is, use default name\n\t\tPath filepath = null;\n\t\tif(fname == null || fname.isEmpty()) {\n\t\t\tfilepath = Paths.get(rootpath + System.getProperty(\"file.separator\") + theFilename);\n\t\t} else {\n\t\t\tfilepath = Paths.get(rootpath + System.getProperty(\"file.separator\") + fname);\n\t\t}\n\t\t\n\t\t// Create file\n\t\ttry {\n\t\t\t// If file exists already, don't override it.\n\t\t\tif(!Files.exists(filepath)) {\n\t\t\t\tFiles.createFile(filepath);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "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}", "@Override\n public synchronized void record(LogEvent le) {\n \n le.setDateEvent(new Date());\n System.out.println(\"Записывается в \"+name+\" лог с датой: \"+SDF.format(le.getDateEvent()));\n String message = layout.getMessage(le);\n \n if (isRotation){\n try {\n if (Files.size(file.toPath())>=maxSize){\n System.out.println(\"Размер файла\" +file.getName()+\" был превышен!\");\n file = getRotationFile(file);\n \n if (changeXML){\n changeXML(file.toPath(), config, name);\n }\n }\n } catch (FileNotFoundException f){\n System.out.println(\"Ошибка ввода-вывода в RollingFileAppender\");\n System.out.println(\"Файд не найден! \"+f.getMessage());\n } catch (IOException ex){\n System.out.println(\"Ошибка ввода-вывода в RollingFileAppender\");\n System.out.println(\"Ошибка в проверке размера файла: \"+ex.getMessage());\n }\n }\n \n try(OutputStreamWriter writer \n = new OutputStreamWriter(Files.newOutputStream(file.toPath(),\n StandardOpenOption.APPEND, StandardOpenOption.WRITE,\n StandardOpenOption.CREATE, StandardOpenOption.DSYNC) )){\n String m2 = new String(message.getBytes(\"UTF-8\"));\n writer.append(m2);\n } catch (IOException ex){\n System.out.println(\"Ошибка ввода-вывода в FileAppender \"+ex.getMessage());\n }\n }", "private static void initializeLog(Properties config)\n {\n // log.file.level = [ ALL | DEBUG | INFO | WARN | ERROR | FATAL ]\n\n try\n {\n PatternLayout layout;\n\n String pattern = config.getProperty(\"log.file.layout\");\n if (null == pattern)\n {\n layout = new PatternLayout(PatternLayout.TTCC_CONVERSION_PATTERN);\n }\n else\n {\n layout = new PatternLayout(pattern);\n }\n // System.out.println(\"Log4j pattern = \" + pattern);\n // System.out.println(\"Log4j layout = \" + layout);\n\n String fileName = basedir + File.separator + config.getProperty(\"log.dir\") +\n File.separator + config.getProperty(\"log.file\");\n // System.out.println(\"Log4j fileName = \" + fileName);\n\n RollingFileAppender appender = new RollingFileAppender(layout, fileName, true);\n appender.setMaxFileSize(config.getProperty(\"log.file.max.size\"));\n int maxBackup = 14; // default if property not available\n try\n {\n maxBackup = Integer.parseInt(config.getProperty(\"log.file.max.backup\"));\n }\n catch (NumberFormatException e) { }\n appender.setMaxBackupIndex(maxBackup);\n // System.out.println(\"Log4j maxBackup = \" + maxBackup);\n\n Logger log = Logger.getRootLogger();\n log.addAppender(appender);\n log.setLevel(Level.toLevel(config.getProperty(\"log.file.priority\")));\n }\n catch (IOException e)\n {\n System.err.println(\"FAILURE: Error opening log file\");\n System.err.println(e.getMessage());\n System.exit(BAD_RUN);\n }\n }", "public void dumpLog(String filename){\n }", "public void logInFile(String message) {\n\t\ttry {\n\t\t\tFile logFile = new File(\"exceptionLog.txt\");\n\t\t\tfw = new FileWriter(logFile,true);\n\t\t\tfw.write(message);\n\t\t\tfw.close();\n\t\t}catch(IOException e) {\n\t\t\te.getStackTrace();\n\t\t}\n\t}", "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 void saveLog (String Tag, String Message) {\n Log.v(TAG, \"Init save log data\");\n String message = Tag + \" - \" + Message + \"\\n\";\n try {\n File file = new File(context.getExternalFilesDir(null).getAbsolutePath() + \"logcat.txt\");\n Log.v(TAG, \"SaveLog() - declare file success: \" + file);\n if(!file.exists()) {\n file.createNewFile();\n Log.v(TAG, \"SaveLog() - Check file exist: \");\n } else {\n FileOutputStream fos = new FileOutputStream(file,true);\n Log.v(TAG, \"SaveLog() - File exist\");\n fos.write(message.getBytes());\n Log.v(TAG, \"SaveLog() - Write data success\");\n fos.close();\n }\n Log.v(TAG, \"saveData() - Save success\");\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n Log.v(TAG, e.getMessage());\n } catch (Exception e ) {\n e.printStackTrace();\n Log.v(TAG, e.getMessage());\n }\n }" ]
[ "0.7405505", "0.73198014", "0.68619996", "0.68516904", "0.6744006", "0.6611598", "0.6581435", "0.647166", "0.6380269", "0.6224488", "0.6155248", "0.6141097", "0.6044822", "0.6018784", "0.5986607", "0.5980471", "0.59775645", "0.5937923", "0.59151304", "0.58682764", "0.5861391", "0.5841663", "0.5840473", "0.5840118", "0.5835857", "0.58052427", "0.57943875", "0.57820374", "0.5778924", "0.57773", "0.57479197", "0.5745778", "0.5740255", "0.5737074", "0.5725591", "0.57253695", "0.57223034", "0.57173675", "0.57098037", "0.5683363", "0.56688523", "0.56639606", "0.5658682", "0.56415486", "0.56302345", "0.56277996", "0.5616865", "0.561621", "0.5608266", "0.5599571", "0.55851984", "0.556785", "0.5567106", "0.5563472", "0.55593896", "0.5558163", "0.5552017", "0.55341554", "0.5532385", "0.55158794", "0.55081993", "0.55032593", "0.54997975", "0.54562956", "0.54550755", "0.5445723", "0.5442531", "0.54413956", "0.5436323", "0.5432619", "0.54191816", "0.5419162", "0.5415307", "0.54117966", "0.5398577", "0.53959894", "0.5394653", "0.53935903", "0.5388519", "0.53857154", "0.53562516", "0.5354385", "0.5338986", "0.5320649", "0.5308662", "0.5307187", "0.5304183", "0.52718216", "0.5254116", "0.524466", "0.52439296", "0.52394456", "0.52321684", "0.5231886", "0.5228532", "0.5220021", "0.5219486", "0.52176183", "0.52172524", "0.52113956" ]
0.7862514
0
Recursively generate a list of files to test.
private static void getFiles(String root, Vector files) { Location f = new Location(root); String[] subs = f.list(); if (subs == null) subs = new String[0]; Arrays.sort(subs); // make sure that if a config file exists, it is first on the list for (int i=0; i<subs.length; i++) { if (subs[i].endsWith(".bioformats") && i != 0) { String tmp = subs[0]; subs[0] = subs[i]; subs[i] = tmp; break; } } if (subs == null) { LogTools.println("Invalid directory: " + root); return; } ImageReader ir = new ImageReader(); Vector similarFiles = new Vector(); for (int i=0; i<subs.length; i++) { LogTools.println("Checking file " + subs[i]); subs[i] = new Location(root, subs[i]).getAbsolutePath(); if (isBadFile(subs[i]) || similarFiles.contains(subs[i])) { LogTools.println(subs[i] + " is a bad file"); String[] matching = new FilePattern(subs[i]).getFiles(); for (int j=0; j<matching.length; j++) { similarFiles.add(new Location(root, matching[j]).getAbsolutePath()); } continue; } Location file = new Location(subs[i]); if (file.isDirectory()) getFiles(subs[i], files); else if (file.getName().equals(".bioformats")) { // special config file for the test suite configFiles.add(file.getAbsolutePath()); } else { if (ir.isThisType(subs[i])) { LogTools.println("Adding " + subs[i]); files.add(file.getAbsolutePath()); } else LogTools.println(subs[i] + " has invalid type"); } file = null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void generateFileList() {\r\n \r\n for (FileSet fileSet : cmtFileSetList) {\r\n DirectoryScanner dirScanner = fileSet.getDirectoryScanner();\r\n dirScanner.scan();\r\n String[] filelist = dirScanner.getIncludedFiles();\r\n String lineSeparator = System.getProperty(\"line.separator\");\r\n String fileSeparator = System.getProperty(\"file.separator\");\r\n \r\n BufferedWriter outputFile = null;\r\n try {\r\n outputFile = new BufferedWriter(new FileWriter(input));\r\n for (String file : filelist) {\r\n outputFile.write(dirScanner.getBasedir().toString() + fileSeparator + file\r\n + lineSeparator);\r\n }\r\n } catch (IOException e) {\r\n throw new BuildException(\"Not able to generate file list for 'cmt'. \", e);\r\n } finally {\r\n try {\r\n if (outputFile != null) {\r\n outputFile.close();\r\n }\r\n } catch (IOException ex) {\r\n // ignore exception\r\n ex = null;\r\n }\r\n }\r\n }\r\n }", "void generateFileList(File node, FileFilter filter) {\n\n //add file only\n if (node.isFile()) {\n fileList.add(generateZipEntry(node.getAbsoluteFile().toString()));\n }\n\n if (node.isDirectory()) {\n File[] subNote = node.listFiles(filter);\n assert subNote != null;\n for (File file : subNote) {\n generateFileList(new File(node, file.getName()), filter);\n }\n }\n\n }", "@Test\n public void testGenerateXMLList() throws Exception {\n System.out.println(\"generateXMLList\");\n File path = new File(\"./\");\n XMLListGenerator instance = new XMLListGenerator(\"http://dipforge.sourceforge.net/\", \n path.getPath(), DirectoryUtil.recurseDirectory(path, \"java\"));\n\n String expResult = instance.generateXMLList();\n String result = instance.generateXMLList();\n System.out.println(result);\n assertEquals(expResult, result);\n\n instance = new XMLListGenerator(\"http://dipforge.sourceforge.net/\",\n path.getPath(), DirectoryUtil.recurseDirectory(path, \".java\"),\".java\");\n\n expResult = instance.generateXMLList();\n result = instance.generateXMLList();\n System.out.println(result);\n assertEquals(expResult, result);\n\n }", "public List<File> createJunitFiles(List<ExecutableSequence> sequences) {\n\t\tList<File> ret = new ArrayList<File>();\n\t\tret.addAll(createJunitTestFiles(sequences));\n\t\tret.add(writeDriverFile());\n\t\treturn ret;\n\t}", "public List<Path> getTestFiles() throws Exception {\n try (Stream<Path> stream = Files.list(Paths.get(BibTeXMLImporterTest.class.getResource(\"\").toURI()))) {\n return stream.filter(p -> !Files.isDirectory(p)).collect(Collectors.toList());\n }\n\n }", "public ScanResult getFilesRecursively() {\n\n final ScanResult scanResult = new ScanResult();\n try {\n Files.walkFileTree(this.basePath, new SimpleFileVisitor<Path>() {\n @Override\n public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n if (!attrs.isDirectory() && PICTURE_MATCHER.accept(file.toFile())) {\n scanResult.addEntry(convert(file));\n System.out.println(file.toFile());\n }\n return FileVisitResult.CONTINUE;\n }\n });\n } catch (IOException e) {\n // intentional fallthrough\n }\n\n return new ScanResult();\n }", "public void testGetChildren() throws IOException {\n FileObject fobj = getFileObject(testFile);\n FileObject parent = fobj.getParent();\n parent = parent.createFolder(\"parent\");\n File pFile = getFile(parent);\n for (int i = 0; i < 10; i++) {\n assertTrue(new File(pFile, \"file\" + i).createNewFile());\n assertTrue(new File(pFile, \"fold\" + i).mkdir());\n }\n monitor.reset();\n FileObject[] children = parent.getChildren();\n //20 x children, 1 x File.listFiles \n monitor.getResults().assertResult(21, StatFiles.ALL);\n monitor.getResults().assertResult(21, StatFiles.READ);\n //second time\n monitor.reset();\n children = parent.getChildren();\n monitor.getResults().assertResult(0, StatFiles.ALL);\n }", "@TestFactory\n Stream<DynamicTest> codeGenRun_TRUE() {\n // Compile all trueFiles to test that they can be run\n this.compileTrueFiles();\n\n // Get the java compiler and compile all the code-generated java files into .class files\n JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\n compiler.run(null, null, null, this.getAllBlockPaths());\n\n ClassLoader classLoader;\n try {\n classLoader = new URLClassLoader(new URL[]{new File(\"src\" + File.separator).toURI().toURL()});\n } catch (MalformedURLException e) {\n throw new RuntimeException(e);\n }\n\n File codeGenTrueFolder = new File(CODE_GEN_FOLDER);\n File[] subDirectories = new File(codeGenTrueFolder.getPath()).listFiles(File::isDirectory);\n\n // Make empty stream of dynamic tests to use later\n Stream<DynamicTest> testStream = Stream.empty();\n\n // Go through all directories with class files in them\n for (File subDir : subDirectories) {\n List<File> filesInDir = Arrays.asList(Objects.requireNonNull(subDir.listFiles()));\n\n // Make a stream of all class files to run (Valid main blocks)\n Stream<DynamicTest> testInDir = filesInDir.stream()\n .filter(file -> file.getName().contains(\".class\"))\n .filter(file -> this.isValidMainBlock(file, classLoader))\n .map(file -> DynamicTest.dynamicTest(\"Testing [\" + subDir.getName() + \"]: '\" + file.getName() + \"'\",\n () -> testAutoGenBlock(getBlockClassFromFile(file, classLoader))));\n\n testStream = Stream.concat(testStream, testInDir);\n }\n\n return testStream;\n }", "public List<File> createJunitFiles(List<ExecutableSequence> sequences,\n\t\t\tList<Class<?>> allClasses) {\n\t\tList<File> ret = new ArrayList<File>();\n\t\tret.addAll(createJunitTestFiles(sequences));\n\t\tret.add(writeDriverFile(allClasses));\n\t\treturn ret;\n\t}", "public List<File> createJunitTestFiles(List<ExecutableSequence> sequences,\n\t\t\tString junitTestsClassName) {\n\t\tif (sequences.size() == 0) {\n\t\t\tSystem.out\n\t\t\t\t\t.println(\"No sequences given to createJunitFiles. No Junit class created.\");\n\t\t\treturn new ArrayList<File>();\n\t\t}\n\n\t\t// Create the output directory.\n\t\tFile dir = getDir();\n\t\tif (!dir.exists()) {\n\t\t\tboolean success = dir.mkdirs();\n\t\t\tif (!success) {\n\t\t\t\tthrow new Error(\"Unable to create directory: \"\n\t\t\t\t\t\t+ dir.getAbsolutePath());\n\t\t\t}\n\t\t} else {\n\t\t\t// JJ\n\t\t\tFile[] files = dir.listFiles();\n\t\t\tfor (int i = 0; i < files.length; i++) {\n\t\t\t\tif (files[i].toString().contains(\"RandoopTest\"))\n\t\t\t\t\tfiles[i].delete();\n\t\t\t}\n\t\t}\n\n\t\tList<File> ret = new ArrayList<File>();\n\t\tList<List<ExecutableSequence>> subSuites = CollectionsExt\n\t\t\t\t.<ExecutableSequence> chunkUp(\n\t\t\t\t\t\tnew ArrayList<ExecutableSequence>(sequences),\n\t\t\t\t\t\ttestsPerFile);\n\t\tfor (int i = 0; i < subSuites.size(); i++) {\n\t\t\tret.add(writeSubSuite(subSuites.get(i), i, junitTestsClassName));\n\t\t}\n\t\tcreatedSequencesAndClasses.put(junitTestsClassName, subSuites);\n\t\treturn ret;\n\t}", "private static ArrayList<File> buildFilesArray() {\n ArrayList<File> result = new ArrayList<>();\n rAddFilesToArray(workingDirectory, result);\n return result;\n }", "protected List <WebFile> getSourceDirChildFiles()\n{\n // Iterate over source dir and add child packages and files\n List children = new ArrayList();\n for(WebFile child : getFile().getFiles()) {\n if(child.isDir() && child.getType().length()==0)\n addPackageDirFiles(child, children);\n else children.add(child);\n }\n \n return children;\n}", "private List<File> getFileList(File root){\n\t List<File> returnable = new ArrayList<File>();\n\t if(root.exists()){\n\t\t for(File currentSubFile : root.listFiles()){\n\t\t\t if(currentSubFile.isDirectory()){\n\t\t\t\t returnable.addAll(getFileList(currentSubFile));\n\t\t\t } else {\n\t\t\t\t returnable.add(currentSubFile);\n\t\t\t }\n\t\t }\n\t }\n\t return returnable;\n }", "private Collection<File> getInputFiles(String docRoot) {\r\n File dir = new File(docRoot);\r\n if (testXMLDir == null || !dir.isDirectory() || !dir.canRead()) {\r\n throw new RuntimeException(\"unable to read from this directory: \" + testXMLDir);\r\n }\r\n Collection<File> xmlFiles = new ArrayList<File>();\r\n xmlFiles = listFileNames(dir,xmlFiles);\r\n return xmlFiles;\r\n }", "private static List<File> listChildFiles(File dir) throws IOException {\n\t\t List<File> allFiles = new ArrayList<File>();\n\t\t \n\t\t File[] childFiles = dir.listFiles();\n\t\t for (File file : childFiles) {\n\t\t if (file.isFile()) {\n\t\t allFiles.add(file);\n\t\t } else {\n\t\t List<File> files = listChildFiles(file);\n\t\t allFiles.addAll(files);\n\t\t }\n\t\t }\n\t\t return allFiles;\n\t\t }", "public List<File> createJunitTestFiles(List<ExecutableSequence> sequences) {\n\t\treturn createJunitTestFiles(sequences, junitDriverClassName);\n\t}", "@Test\n public void testGetSubDirectories() {\n System.out.println(\"getSubDirectories from a folder containing 2 subdirectories\");\n String path = System.getProperty(\"user.dir\")+fSeparator+\"MyDiaryBook\"+fSeparator+\"Users\"+fSeparator+\"Panagiwtis Georgiadis\"\n +fSeparator+\"Entries\";\n \n FilesDao instance = new FilesDao();\n File entriesFile = new File(path);\n File subFolder;\n String[] children = entriesFile.list();\n File[] expResult = new File[entriesFile.list().length];\n \n for(int i=0;i<entriesFile.list().length;i++)\n {\n subFolder = new File(path+fSeparator+children[i]);\n if(subFolder.isDirectory())\n expResult[i] = subFolder; \n }\n \n File[] result = instance.getSubDirectories(path);\n \n assertArrayEquals(expResult, result);\n }", "@Test\n public void testGetFilesList() {\n System.out.println(\"getFilesList from existing folder with existing subfiles\");\n String entryPath = folder.toString()+fSeparator+\"Images\";\n FilesDao instance = new FilesDao();\n String[] expResult = new String[2];\n expResult[0] = \"testImg.jpg\";\n expResult[1] = \"testImg2.jpg\";\n String[] result;\n try{\n result = instance.getFilesList(entryPath);\n }catch(EntryException ex){\n result = null;\n }\n assertArrayEquals(expResult, result);\n }", "@Override\r\n\tpublic String globFilesDirectories(String[] args) {\r\n\t\treturn globHelper(args);\r\n\t}", "public void testGetChildrenCaches() throws IOException {\n FileObject fobj = getFileObject(testFile);\n FileObject parent = fobj.getParent();\n List<FileObject> l = new ArrayList<FileObject>();\n parent = parent.createFolder(\"parent\");\n for (int i = 0; i < 20; i++) {\n l.add(parent.createData(\"file\" + i + \".txt\"));\n }\n\n monitor.reset();\n //20 x FileObject + 1 File.listFiles\n FileObject[] children = parent.getChildren();\n monitor.getResults().assertResult(1, StatFiles.ALL);\n monitor.getResults().assertResult(1, StatFiles.READ);\n for (FileObject ch : children) {\n assertNull(\"No sibling\", FileUtil.findBrother(ch, \"exe\"));\n }\n monitor.getResults().assertResult(1, StatFiles.ALL);\n monitor.getResults().assertResult(1, StatFiles.READ);\n }", "List<? extends Test> build() throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException{\n\t\tfor(String eachPositive:this.listOfPositive){\n\t\t\tcreateTest(eachPositive, getPositiveFileContent(eachPositive));\n\t\t}\n\t\tfor(String eachNegative:this.listOfNegative){\n\t\t\tcreateTest(eachNegative, getNegativeFileContent(eachNegative));\n\t\t}\n\t\t\n\t\t// create class loader\n\t\tURLClassLoader classLoader = URLClassLoader.newInstance(new URL[] { new File(PATH_BASE).toURI().toURL() });\n\t\t\n\t\t// load all classes\n\t\tList<NamedTestCase> returnValue=new ArrayList<NamedTestCase>(this.listOfNegative.size()+this.listOfPositive.size());\n\t\tfor(String eachPositive:this.listOfPositive){\n\t\t\tClass<?> cls = Class.forName(eachPositive, true, classLoader);\n\t\t\treturnValue.add((NamedTestCase)cls.newInstance());\n\t\t}\n\t\tfor(String eachNegative:this.listOfNegative){\n\t\t\tClass<?> cls = Class.forName(eachNegative, true, classLoader);\n\t\t\treturnValue.add((NamedTestCase)cls.newInstance());\n\t\t}\n\n\t\t// sort for output\n\t\tCollections.sort(returnValue, new Comparator<NamedTestCase>(){\n\t\t\t@Override\n\t\t\tpublic int compare(NamedTestCase o1, NamedTestCase o2) {\n\t\t\t\treturn o2.getName().compareTo(o1.getName());\n\t\t\t}\n\t\t});\n\t\treturn returnValue; \n\t}", "@Test\n public void testLsDirectoryAndFileRSub() {\n FileTree myTree = new FileTree();\n String[] paths = {\"file\", \"file/file1\", \"file/file2\", \"file/file1/file3\"};\n try {\n myTree.mkdir(paths);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"Could not create directory\");\n }\n String result = \"\";\n try {\n myTree.makeFile(\"fileA\");\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"could not create file\");\n }\n try {\n myTree.cd(\"/file/file1\");\n } catch (NotDirectoryException e) {\n fail(\"could not cd into directory\");\n }\n try {\n myTree.makeFile(\"fileB\");\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"could not create file\");\n }\n try {\n myTree.cd(\"/file/file1/file3\");\n } catch (NotDirectoryException e) {\n fail(\"could not cd into directory\");\n }\n try {\n myTree.makeFile(\"fileC\");\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"could not create file\");\n }\n try {\n myTree.cd(\"/\");\n } catch (NotDirectoryException e) {\n fail(\"could not cd into directory\");\n }\n String[] empty_path = {};\n try {\n result = myTree.ls(true, empty_path);\n } catch (InvalidPathException e1) {\n fail(\"Could not find the directories\");\n }\n\n assertEquals(result, \"Path at /: \\nfile\\nfileA\\nPath at /file: \"\n + \"\\nfile1\\nfile2\\nPath at /file/file1: \\nfile3\\nfileB\\nPath at \"\n + \"/file/file1/file3: \\nfileC\\nPath at /file/file2: \\n\");\n }", "private ArrayList<char[]> subdirectoriesToFiles(ArrayList<char[]> currentList, ArrayList<char[]> fullFileList) throws IOException {\t\t\n\t\tfor (File file: currentList) {\n\t\t\tif (isJavaFile(file)) \n\t\t\t\tfullFileList.add(file);\n\t\t\telse if (file.isDirectory()){\n\t\t\t\t$.log(file.toString());\n\t\t\t\tsubdirectoriesToFiles(file.getAbsolutePath(), fullFileList);\n\t\t\t}\n\t\t\telse if (isJarFile(file))\n\t\t\t\tsubdirectoriesToFiles(jarToFile(file), fullFileList);\n\t\t}\n\t\treturn fullFileList;\n\t}", "private static void createSeededFiles(String type, int seedNum, int trainNum, int testNum, File sourceDirectory,\n File destinationDirectory) {\n\n File trainDirectory = new File(destinationDirectory.getAbsolutePath() + \"/train\");\n if(trainNum > 0 && !trainDirectory.exists()) {\n trainDirectory.mkdir();\n }\n File testDirectory = new File(destinationDirectory.getAbsolutePath() + \"/test\");\n if(testNum > 0 && !testDirectory.exists()) {\n testDirectory.mkdir();\n }\n\n //for each language, we want to create a directory for that language, then parse trees/sentences through each of the novels listed there\n File[] languages = sourceDirectory.listFiles();\n File[] trainDirectoryLanguages = new File[languages.length];\n File[] testDirectoryLanguages = new File[languages.length];\n for (int i = 0; i < languages.length; i++) {\n if (languages[i].getName().startsWith(\".\")) {\n continue;\n }\n trainDirectoryLanguages[i] = new File(trainDirectory.getAbsolutePath() + \"/\" + languages[i].getName());\n testDirectoryLanguages[i] = new File(testDirectory.getAbsolutePath() + \"/\" + languages[i].getName());\n if (trainNum > 0)\n makeNewDirectoryIfNotExists(trainDirectoryLanguages[i]);\n if (testNum > 0)\n makeNewDirectoryIfNotExists(testDirectoryLanguages[i]);\n\n File[] novels = languages[i].listFiles();\n for (int j = 0; j < novels.length; j++) {\n if (novels[j].getName().startsWith(\".\")) {\n continue;\n }\n try {\n BufferedReader read = new BufferedReader(new FileReader(novels[j]));\n //name w/o .txt\n String fileShortName = novels[j].getName().substring(0, novels[j].getName().length()-4);\n String line;\n //max number of stuff we want to read is based on our inputs\n int maxFiles = testNum + trainNum;\n long maxLines = (long) maxFiles * (long) seedNum;\n int lineCount = 0;\n int fileCount = 1;\n //File currentFile = createNewNumberedFile(trainDirectoryLanguages[i].getAbsolutePath() + \"/\" + fileShortName, fileCount);\n String pathToUse = (fileCount <= trainNum) ? trainDirectoryLanguages[i].getAbsolutePath() :\n testDirectoryLanguages[i].getAbsolutePath();\n File currentFile = createNewNumberedFile(pathToUse + \"/\" + fileShortName, fileCount);\n PrintWriter pw = new PrintWriter(currentFile);\n\n //this is the part that varies based on calling for text or trees.\n switch (type) {\n case \"text\":\n while ((line = read.readLine()) != null && lineCount < maxLines ) {\n pw.println(line);\n lineCount++;\n //when our lineCount mod seedNum is 0, we want to create another PrintWriter\n if (lineCount % seedNum == 0) {\n fileCount++;\n //put in train or test, depending on our current file count.\n if (fileCount <= maxFiles) {\n pathToUse = (fileCount <= trainNum) ? trainDirectoryLanguages[i].getAbsolutePath() :\n testDirectoryLanguages[i].getAbsolutePath();\n currentFile = createNewNumberedFile(pathToUse + \"/\" + fileShortName, fileCount);\n pw.flush();\n pw.close();\n pw = new PrintWriter(currentFile);\n }\n }\n }\n break;\n case \"tree\":\n //need to build a Treebank... lifting code from HW 3 to aid in this.\n Options op = new Options();\n op.doDep = false;\n op.doPCFG = true;\n op.setOptions(\"-goodPCFG\", \"-evals\", \"tsv\");\n Treebank treeBank = op.tlpParams.diskTreebank();\n treeBank.loadPath(novels[j]);\n Iterator<Tree> it = treeBank.iterator();\n while((it.hasNext()) && lineCount < maxLines) {\n lineCount++;\n Tree t = it.next();\n t.pennPrint(pw);\n if (lineCount % seedNum == 0) {\n fileCount++;\n //put in train or test, depending on our current file count.\n if (fileCount <= maxFiles) {\n pathToUse = (fileCount <= trainNum) ? trainDirectoryLanguages[i].getAbsolutePath() :\n testDirectoryLanguages[i].getAbsolutePath();\n currentFile = createNewNumberedFile(pathToUse + \"/\" + fileShortName, fileCount);\n pw.flush();\n pw.close();\n pw = new PrintWriter(currentFile);\n }\n }\n }\n break;\n }\n pw.flush();\n pw.close();\n //if numlines is not equal to maxlines then we'll remove the last file.\n if (lineCount != maxLines) {\n currentFile = createNewNumberedFile(pathToUse + \"/\" + fileShortName, fileCount);\n currentFile.delete();\n }\n } catch (IOException e) {\n System.err.println(\"Exception caught while reading \" + novels[j] + \":\");\n e.printStackTrace();\n }\n }\n\n\n }\n\n\n }", "private List<DMTFile> listFilesRecursive(String path) {\n\t\tList<DMTFile> list = new ArrayList<DMTFile>();\n\t\tDMTFile file = getFile(path); //Get the real file\n\t\t\n\t\tif (null != file ){ //It checks if the file exists\n\t\t\tif (! file.isDirectory()){\n\t\t\t\tlist.add(file);\n\t\t\t} else {\n\t\t\t\tDMTFile[] files = listFilesWithoutConsoleMessage(file.getPath());\n\t\t\t\tfor (int x = 0; x < files.length; x++) {\n\t\t\t\t\tDMTFile childFile = files[x];\t\t \n\t\t\t\t\tif (childFile.isDirectory()){\n\t\t\t\t\t\tlist.addAll(listFilesRecursive(childFile.getPath()));\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlist.add(childFile);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn list;\n\t}", "private RecursiveFilesystemTraversalValue traverseAndAssertFiles(\n TraversalRequest params, ResolvedFile... expectedFilesIgnoringMetadata) throws Exception {\n RecursiveFilesystemTraversalValue result = evalTraversalRequest(params);\n Map<PathFragment, ResolvedFile> nameToActualResolvedFiles = new HashMap<>();\n for (ResolvedFile act : result.getTransitiveFiles().toList()) {\n // We can't compare directly, since metadata would be different, so we compare\n // by comparing the results of public method calls..\n nameToActualResolvedFiles.put(act.getNameInSymlinkTree(), act);\n }\n assertExpectedResolvedFilesPresent(nameToActualResolvedFiles, expectedFilesIgnoringMetadata);\n return result;\n }", "public static void main(String[] args) {\n\t\tFile src = new File(\"src\");\n\t\tFile[] file = src.listFiles();\n\t\tif (file != null) {\n\t\t\tfor (File file2 : file) {\n\t\t\t\tFile[] subfolder = file2.listFiles();\n\t\t\t\tif (subfolder != null) {\n\t\t\t\t\tfor (File file4 : subfolder) {\n\t\t\t\t\t\tString filename = file4.getAbsolutePath();\n\t\t\t\t\t\tSystem.out.println(filename);\n\t\t\t\t\t\tif (filename.contains(\".java\")) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tFileWriter fw = new FileWriter(filename, true);\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 * NOTE: To append to a file that already exists, add true as a second parameter\n\t\t\t\t\t\t\t\t * when calling the FileWriter constructor. (e.g. FileWriter fw = new\n\t\t\t\t\t\t\t\t * FileWriter(\"src/_00_Intro_To_File_Input_and_Output/test2.txt\", true);)\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t// subdirectory file.subfile\n\t\t\t\t\t\t\t\tfw.write(\"//Copyright Roshan Sood 2021\");\n\n\t\t\t\t\t\t\t\tfw.close();\n\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n}", "private void get_file_List() {\n\tString file_name=null;\r\n\tfor (int i = 0; i < listOfFiles.length; i++) \r\n\t {\r\n\t \r\n\t if (listOfFiles[i].isFile()) \r\n\t {\r\n\t\t file_name = listOfFiles[i].getName();\r\n\t if (file_name.endsWith(\".xml\") || file_name.endsWith(\".XML\"))\r\n\t {\r\n\t file_list.add(file_name) ;\r\n\t }\r\n\t }\r\n\t }\r\n\t\r\n}", "public StupidContainer generateFileList() throws Exception {\n\t\tint tries = 0;\n\t\tStupidContainer parsingResults;\n\n\t\tdo {\n\t\t\ttries++;\n\t\t\tparsingResults = populateFileList();\n\n\t\t\tif (parsingResults.sourceFiles == null)\n\t\t\t\tcontinue;\n\n\t\t\tif (checkValidCodebase(parsingResults.sourceFiles.size()))\n\t\t\t\tbreak;\n\n\t\t} while (tries < ATTEMPTS);\n\n\t\tif (tries > ATTEMPTS)\n\t\t\treturn null;\n\n\t\treturn parsingResults;\n\t}", "public void addAllRecursively(Collection<? extends File> someResourceFiles) {\n\t\tfor (File tempResourceFile : someResourceFiles) {\n\t\t\taddRecursively(tempResourceFile);\n\t\t}\n\t}", "AntiIterator<FsPath> listFilesAndDirectories(FsPath dir);", "List<Path> getFiles();", "private static void rAddFilesToArray(File workingDirectory, ArrayList<File> result) {\n File[] fileList = workingDirectory.listFiles();\n if (fileList == null) return;\n for (File file : fileList) {\n String name = file.getName();\n int lastDotIndex = name.lastIndexOf('.');\n String ext = (lastDotIndex == -1) ? \"\" : name.substring(lastDotIndex + 1);\n if (file.isDirectory())\n rAddFilesToArray(file, result);\n if (!file.equals(remainderFile) && ext.equals(\"xml\")) {\n result.add(file);\n }\n }\n }", "@Test\n @Ignore\n public void testGlobExpansion() throws IOException {\n String container = \"test-container\" + randomUUID();\n BlobContainerClient blobContainerClient =\n azureBlobStoreFileSystem.getClient().createBlobContainer(container);\n\n // Create files\n List<String> blobNames = new ArrayList<>();\n blobNames.add(\"testdirectory/file1name\");\n blobNames.add(\"testdirectory/file2name\");\n blobNames.add(\"testdirectory/file3name\");\n blobNames.add(\"testdirectory/otherfile\");\n blobNames.add(\"testotherdirectory/file4name\");\n for (String blob : blobNames) {\n blobContainerClient.getBlobClient(blob).uploadFromFile(\"src/test/resources/in.txt\");\n }\n\n // Test patterns\n {\n AzfsResourceId pattern =\n AzfsResourceId.fromUri(\"azfs://account/\" + container + \"/testdirectory/file*\");\n List<String> expectedFiles =\n ImmutableList.of(\n \"azfs://account/\" + container + \"/testdirectory/file1name\",\n \"azfs://account/\" + container + \"/testdirectory/file2name\",\n \"azfs://account/\" + container + \"/testdirectory/file3name\");\n\n assertThat(\n expectedFiles, contains(toFilenames(azureBlobStoreFileSystem.expand(pattern)).toArray()));\n }\n\n {\n AzfsResourceId pattern =\n AzfsResourceId.fromUri(\"azfs://account/\" + container + \"/testdirectory/file[1-3]*\");\n List<String> expectedFiles =\n ImmutableList.of(\n \"azfs://account/\" + container + \"/testdirectory/file1name\",\n \"azfs://account/\" + container + \"/testdirectory/file2name\",\n \"azfs://account/\" + container + \"/testdirectory/file3name\");\n\n assertThat(\n expectedFiles, contains(toFilenames(azureBlobStoreFileSystem.expand(pattern)).toArray()));\n }\n\n {\n AzfsResourceId pattern =\n AzfsResourceId.fromUri(\"azfs://account/\" + container + \"/testdirectory/file?name\");\n List<String> expectedFiles =\n ImmutableList.of(\n \"azfs://account/\" + container + \"/testdirectory/file1name\",\n \"azfs://account/\" + container + \"/testdirectory/file2name\",\n \"azfs://account/\" + container + \"/testdirectory/file3name\");\n\n assertThat(\n expectedFiles, contains(toFilenames(azureBlobStoreFileSystem.expand(pattern)).toArray()));\n }\n\n {\n AzfsResourceId pattern =\n AzfsResourceId.fromUri(\"azfs://account/\" + container + \"/test*ectory/fi*name\");\n List<String> expectedFiles =\n ImmutableList.of(\n \"azfs://account/\" + container + \"/testdirectory/file1name\",\n \"azfs://account/\" + container + \"/testdirectory/file2name\",\n \"azfs://account/\" + container + \"/testdirectory/file3name\",\n \"azfs://account/\" + container + \"/testotherdirectory/file4name\");\n\n assertThat(\n expectedFiles, contains(toFilenames(azureBlobStoreFileSystem.expand(pattern)).toArray()));\n }\n\n // Clean up\n blobContainerClient.delete();\n }", "public static void main(String[] args) {\n\n File dir = new File(\"D:/test.txt\");\n FileFilter fr = (File f) -> f.isDirectory();\n File[] fs = dir.listFiles(fr);\n }", "private void generateClassFiles(ClassTree classtree) {\n String[] packageNames = configuration.classDocCatalog.packageNames();\n for (int packageNameIndex = 0; packageNameIndex < packageNames.length;\n packageNameIndex++) {\n generateClassFiles(configuration.classDocCatalog.allClasses(\n packageNames[packageNameIndex]), classtree);\n }\n }", "public static void genTestTree(Path root, int num1K, int num4K, int num4M, int num16M, int num64M, int num128M)\n throws IOException {\n genFiles(root, num1K, 1024);\n genFiles(root, num4K, 4 * 1024);\n genFiles(root, num4M, 4 * 1024 * 1024);\n genFiles(root, num16M, 16 * 1024 * 1024);\n genFiles(root, num64M, 64 * 1024 * 1024);\n genFiles(root, num128M, 128 * 1024 * 1024);\n }", "private ObservableList<TreeItem<Path>> buildChildren() {\r\n if (Files.isDirectory(getValue())) {\r\n try {\r\n\r\n return Files.list(getValue())\r\n .map(FileTreeItem::new)\r\n .collect(Collectors.toCollection(() -> FXCollections.observableArrayList()));\r\n\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n return FXCollections.emptyObservableList();\r\n } \r\n }\r\n\r\n return FXCollections.emptyObservableList();\r\n }", "private ArrayList<char[]> subdirectoriesToFiles(String inputDir, ArrayList<char[]> fullFileList) throws IOException {\n\t\tArrayList<char[]> currentList =\n\t\t\t\tnew ArrayList<char[]>(Arrays.asList(new File(inputDir).listFiles()));\n\t\t\n\t\tfor (File file: currentList) {\n\t\t\tif (isJavaFile(file)) \n\t\t\t\tfullFileList.add(file);\n\t\t\t\n\t\t\telse if (file.isDirectory())\n\t\t\t\tsubdirectoriesToFiles(file.getPath(), fullFileList);\n\t\t\t\n\t\t\telse if (isJarFile(file))\n\t\t\t\tsubdirectoriesToFiles(jarToFile(file), fullFileList);\n\t\t}\n\t\treturn fullFileList;\n\t}", "static Stream<File> allFilesIn(File folder) \r\n\t{\r\n\t\tFile[] children = folder.listFiles();\r\n\t\tStream<File> descendants = Arrays.stream(children).filter(File::isDirectory).flatMap(Program::allFilesIn);\r\n\t\treturn Stream.concat(descendants, Arrays.stream(children).filter(File::isFile));\r\n\t}", "public void should_read_files_in_directory() throws IOException {\n File tempDir = Files.createTempDir();\n tempDir.deleteOnExit();\n // json file\n File file1 = File.createTempFile(\"file1\", \".json\", tempDir);\n String content1 = \"content1\";\n Files.write(content1.getBytes(), file1);\n // n1ql file\n File file2 = File.createTempFile(\"file2\", \".N1QL\", tempDir);\n String content2 = \"content2\";\n Files.write(content2.getBytes(), file2);\n // txt file\n Files.write(getRandomString().getBytes(), File.createTempFile(getRandomString(), \".txt\", tempDir));\n\n // When we read files in this directory with extension filter\n Map<String, String> result = FileUtils.readFilesInDirectory(tempDir.toPath(), \"json\", \"n1ql\");\n\n // Then we should have file content matching this extension\n Assert.assertEquals(2, result.size());\n Assert.assertEquals(content1, result.get(file1.getName()));\n Assert.assertEquals(content2, result.get(file2.getName()));\n}", "@Override\r\n\tpublic String globMultiLevel(String[] args) {\r\n\t\treturn globHelper(args);\r\n\t}", "@Override\n protected List<String> compute() {\n List<String> fileNames = new ArrayList<>();\n\n // FolderProcessor tasks to store the sub-tasks that are going to process the sub-folders stored inside folder.\n List<FolderProcessor> subTasks = new ArrayList<>();\n\n // Get the content of the folder.\n File file = new File(path);\n File content[] = file.listFiles();\n\n //For each element in the folder, if there is a subfolder, create a new FolderProcessor object\n //and execute it asynchronously using the fork() method.\n for (int i = 0; i < content.length; i++) {\n if (content[i].isDirectory()) {\n FolderProcessor task = new FolderProcessor(content[i].getAbsolutePath(), extension);\n task.fork();\n subTasks.add(task);\n } else {\n //Otherwise, compare the extension of the file with the extension you are looking for using the checkFile() method\n //and, if they are equal, store the full path of the file in the list of strings declared earlier.\n\n if (checkFile(content[i].getName())) {\n fileNames.add(content[i].getAbsolutePath());\n }\n }\n }\n\n //If the list of the FolderProcessor sub-tasks has more than 50 elements,\n //write a message to the console to indicate this circumstance.\n if (subTasks.size() > 50) {\n System.out.printf(\"%s: %d tasks ran.\\n\", file.getAbsolutePath(), subTasks.size());\n }\n\n // Add the results from the sub-tasks.\n addResultsFrommSubTasks(fileNames, subTasks);\n\n return fileNames;\n }", "public static void listOfFiles(File dirPath){\n\t\tFile filesList[] = dirPath.listFiles();\r\n \r\n\t\t// For loop on each item in array \r\n for(File file : filesList) {\r\n if(file.isFile()) {\r\n System.out.println(file.getName());\r\n } else {\r\n \t // Run the method on each nested folder\r\n \t listOfFiles(file);\r\n }\r\n }\r\n }", "public static void main(String[] args) {\n String startDir = \"E:/DEKSTOP/Projets/photosortTest\";\n\n //We list what is in this folder :\n\n System.out.println(\"\\n\\n\\nListing of files recursively : \\n\");\n\n printListFilesRecursive(startDir);\n\n //Then we create 2 directories\n createDirectory(startDir, \"css_files\");\n createDirectory(startDir, \"js_files\");\n\n //Then we select all the js file and move it to /js_file, same for css files\n List<String> list_js = new ArrayList<>();\n List<String> list_css = new ArrayList<>();\n\n listFilesRecursiveByExtension(startDir,\"js\",list_js);\n listFilesRecursiveByExtension(startDir,\"css\",list_css);\n\n for (String item_js : list_js){\n copyFile(item_js,startDir+\"/js_files\",new File(item_js).getName());\n }\n\n\n for (String item_css : list_css){\n copyFile(item_css,startDir+\"/css_files\",new File(item_css).getName());\n }\n System.out.println(\"Listing of file dummy : \\n\");\n //array in which we will store the names of files and directories\n\n printDummyListFiles(startDir);\n\n\n\n\n System.out.println(\"\\n\\n\\nListing of JS files recursively : \\n\");\n\n printListFilesRecursiveByExtension(startDir, \"map\");\n\n System.out.println(\"\\n\\n\\nListing of JS files recursively : \\n\");\n\n printListFilesRecursiveByExtension(startDir, \"map\");\n }", "private static void iteratorFilePath(File file){\n while(file.isDirectory()){\n for(File f : file.listFiles()){\n System.out.println(f.getPath());\n iteratorFilePath(f);\n }\n break;\n }\n }", "public static void builtTree\n ( ArrayList<DefaultMutableTreeNode> treeArray , \n int recursion , DefaultMutableTreeNode selected , \n boolean enableDirs , boolean enableFiles )\n {\n int m;\n if (recursion<0) { m = DEFAULT_RECURSION_LIMIT; }\n else { m = recursion; }\n for ( int k=0; k<m; k++ )\n {\n boolean request = false;\n // Start cycle for entries\n int n = treeArray.size();\n for ( int i=0; i<n; i++ )\n {\n DefaultMutableTreeNode x1 = treeArray.get(i);\n // Support selective mode, skip if not selected\n if ( (selected != null) & ( selected != x1 ) ) continue;\n // Analyse current entry, skip if already handled\n ListEntry x2 = (ListEntry)x1.getUserObject();\n if ( x2.handled == true ) continue;\n request = true;\n x2.failed = false;\n // Start handling current entry\n String x3 = x2.path;\n File file1 = new File( x3 );\n boolean exists1 = file1.exists();\n boolean directory1=false;\n if (exists1) { directory1 = file1.isDirectory(); }\n // Handling directory: make list of childs directories/files\n if ( exists1 & directory1 )\n {\n String[] list = file1.list();\n int count=0;\n if ( list != null ) count = list.length;\n for ( int j=0; j<count; j++ )\n {\n String s1 = list[j];\n String s2 = x3+\"/\"+s1;\n File file2 = new File(s2);\n boolean dir = file2.isDirectory();\n if ( ( enableDirs & dir ) | ( enableFiles & !dir ) )\n {\n ListEntry y1 = \n new ListEntry ( s1, \"\", s2, false, false );\n DefaultMutableTreeNode y2 = \n new DefaultMutableTreeNode( y1 );\n treeArray.add( y2 );\n x1.add( y2 );\n x1.setAllowsChildren( true ); // this entry is DIRECTORY\n }\n }\n }\n // Handling file: read content\n if ( exists1 & !directory1 )\n {\n int readSize = 0;\n //\n StringBuilder data = new StringBuilder(\"\");\n FileInputStream fis;\n byte[] array = new byte[BUFFER_SIZE];\n try \n { \n fis = new FileInputStream(file1);\n readSize = fis.read(array); \n fis.close();\n }\n catch ( Exception e ) \n // { data = \"N/A : \" + e; x2.failed=true; }\n { data.append( \"N/A : \" + e ); x2.failed = true; }\n char c1;\n for (int j=0; j<readSize; j++)\n { \n c1 = (char)array[j];\n // if ( (c1=='\\n') | (c1=='\\r') ) { data = data + \" \"; }\n if ( ( c1 == '\\n' ) | (c1 == '\\r' ) ) { data.append( \" \" ); }\n else \n { \n if ( ( c1 < ' ' )|( c1 > 'z' ) ) { c1 = '_'; }\n // data = data + c1;\n data.append( c1 );\n }\n }\n x2.name2 = data.toString();\n x2.leaf = true;\n x1.setAllowsChildren( false ); // this entry is FILE\n }\n // End cycle for entries\n x2.handled = true;\n }\n // End cycle for recursion\n if (request==false) break;\n }\n }", "public List<Object[]> gatherData() {\n String testDir = System.getProperty(\"test.dir\");\n logger.info(\"Data from: \" + testDir);\n String testFilter = System.getProperty(\"test.filter\");\n List<Object[]> result = new ArrayList<Object[]>();\n File testDirFile = new File(testDir);\n File rootConfigFile = new File(testDirFile, \"config.properties\");\n Properties rootProp = new Properties();\n InputStream rootIn = null;\n try {\n rootIn = new FileInputStream(rootConfigFile);\n rootProp.load(rootIn);\n } catch (IOException e) {\n // if we can't get root properties, we just take empty root\n // properties\n rootProp = new Properties();\n } finally {\n IOUtils.closeQuietly(rootIn);\n }\n\n File[] childFiles = null;\n if (testFilter == null) {\n childFiles = testDirFile.listFiles();\n } else {\n String[] wildcards = testFilter.split(\";\");\n childFiles = testDirFile\n .listFiles((FilenameFilter) new WildcardFileFilter(\n wildcards));\n }\n int idx = 0;\n for (File child : childFiles) {\n if (child.isDirectory() && directoryContainsConfig(child)) {\n File configFile = new File(child, \"config.properties\");\n Properties prop = new Properties();\n InputStream in = null;\n try {\n in = new FileInputStream(configFile);\n prop.load(in);\n \n String parent = prop.getProperty(PARENT_CFG);\n if(parent != null) {\n \tFile parentFile = new File(child, parent);\n \tif(parentFile.exists()) {\n \t\tprop.clear();\n \t\tprop.load(new FileInputStream(parentFile));\n \t\tprop.load(new FileInputStream(configFile));\n \t}\n }\n \n if (isSupportedTestType(prop)) {\n Object[] data = extractDataFromConfig(configFile,\n rootProp, prop);\n result.add(data);\n String testName = idx + \"-\" + data[1].toString();\n ((BaseSignatureTestData)data[2]).setUniqueUnitTestName(testName);\n idx++;\n }\n } catch (IOException e) {\n logger.warn(\n \"Could not run test with config:\"\n + configFile.getAbsolutePath(), e);\n } finally {\n if (in != null)\n IOUtils.closeQuietly(in);\n }\n }\n }\n return result;\n }", "private void addPackageDirFiles(WebFile aDir, List aList)\n{\n boolean hasNonPkgFile = false;\n for(WebFile child : aDir.getFiles())\n if(child.isDir() && child.getType().length()==0)\n addPackageDirFiles(child, aList);\n else hasNonPkgFile = true;\n if(hasNonPkgFile || aDir.getFileCount()==0) aList.add(aDir);\n}", "private static LinkedList<String> addAllSubDirs(File dir, LinkedList<String> list) {\n\t\tString [] dirListing = dir.list();\n\t\tfor (String subDirName : dirListing) {\n\t\t\tFile subdir = new File(dir.getPath() + System.getProperty(\"file.separator\") + subDirName);\n\t\t\tif (subdir.isDirectory()) {\n\t\t\t\tif (containsJavaFiles(subdir))\n\t\t\t\t\tlist.add(subdir.getPath());\n\t\t\t\tlist = addAllSubDirs(subdir, list);\n\t\t\t}\n\t\t}\n\t\treturn list;\n\t}", "@Test\n public void testGetDirectoryList() {\n System.out.println(\"getDirectoryList for existing folder with subfolders\");\n String entriesPath = folder.toString();\n FilesDao instance = new FilesDao();\n String[] expResult = new String[4];\n expResult[0]=\"EmptyFolder\";\n expResult[1]=\"Images\";\n expResult[2]=\"Texts\";\n expResult[3]=\"Videos\";\n Arrays.sort(expResult);\n String[] result;\n try{\n result = instance.getDirectoryList(entriesPath);\n Arrays.sort(result);\n }catch(EntryException ex){\n result = null;\n }\n \n assertArrayEquals(expResult, result);\n }", "public void getSourceJavaFilesForOneRepository(File dir, FilenameFilter searchSuffix, ArrayList<File> al) {\n\n\t\tFile[] files = dir.listFiles();\t\t\n\t\tfor(File f : files) {\n\t\t\tString lowercaseName = f.getName().toLowerCase();\n\t\t\tif(lowercaseName.indexOf(\"test\")!=-1)\n\t\t\t{\n\t\t\t\t/* we do not consider test files in our study */\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t if(f.isDirectory()){\n\t\t\t\t /* iterate over every directory */\n\t\t\t\t getSourceJavaFilesForOneRepository(f, searchSuffix, al);\t\t\n\t\t\t } else {\n\t\t\t\t /* returns the desired java files */\n\t\t\t\t if(searchSuffix.accept(dir, f.getName())){\n\t\t\t\t\t al.add(f);\n\t\t\t\t }\n\t\t\t }\n\t\t\t}\n\t\t}\n\t}", "private static void showFiles(File[] files) {\n\t\t for (File file : files) {\r\n\t\t if (file.isDirectory()) {\r\n\t\t // System.out.println(\"Directory: \" + file.getName());\r\n\t\t showFiles(file.listFiles()); // Calls same method again.\r\n\t\t } else {\r\n\t\t // System.out.println(\"File: \" + file.getName());\r\n\t\t }\r\n\t\t }\r\n\t\t\r\n\t}", "@Test\n public void testTraversalOfGeneratedDirectory() throws Exception {\n assertTraversalOfDirectory(derivedArtifact(\"dir\"));\n }", "private List<Path> listSourceFiles(Path dir) throws IOException {\n\t\tList<Path> result = new ArrayList<>();\n\t\ttry (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, \"*.json\")) {\n\t\t\tfor (Path entry: stream) {\n\t\t\t\tresult.add(entry);\n\t\t\t}\n\t\t} catch (DirectoryIteratorException ex) {\n\t\t\t// I/O error encounted during the iteration, the cause is an IOException\n\t\t\tthrow ex.getCause();\n\t\t}\n\t\treturn result;\n\t}", "public static String[] listFilesAsArray() {\n\t\t// Recursively find all .java files\n\t\tFile path = new File(Project.pathWorkspace());\n\t\tFilenameFilter filter = new FilenameFilter() {\n\n\t\t\tpublic boolean accept(File directory, String fileName) {\n\t\t\t\treturn fileName.endsWith(\".java\");\n\t\t\t}\n\t\t};\n\t\tCollection<File> files = listFiles(path, filter, true);\n\n\t\tArrayList<File> t = new ArrayList<File>(files);\n\t\tfor (int i = 0; i < t.size(); i++) {\n\t\t\tString s = t.get(i).getAbsolutePath();\n\t\t\tif (s.contains(\"XX\") || s.contains(\"testingpackage\") || s.contains(\"datageneration\")) {\n\t\t\t\tt.remove(t.get(i));\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\t\tfiles = t;\n\n\t\t// Convert the Collection into an array\n\t\tFile[] allJavaFiles = new File[files.size()];\n\t\tfiles.toArray(allJavaFiles);\n\n\t\tString[] allTestClasses = new String[allJavaFiles.length];\n\t\tString temp = \"\";\n\n\t\t// convert file path to full package declaration for the class\n\t\tfor (int i = 0; i < allJavaFiles.length; i++) {\n\t\t\ttemp = allJavaFiles[i].toString();\n\t\t\ttemp = temp.replace(\".java\", \"\").replace(\"\\\\\", \".\"); // remove .java convert backslash\n\t\t\tif (temp.indexOf(\"com.textura\") < 0) {\n\t\t\t\tallTestClasses[i] = \"null\";\n\t\t\t} else {\n\t\t\t\ttemp = temp.substring(temp.indexOf(\"com.textura\"));\n\t\t\t\ttemp = temp.replace(\"com.\", \"\");\n\t\t\t\tallTestClasses[i] = temp;\n\t\t\t}\n\t\t}\n\t\treturn allTestClasses;\n\t}", "public GlobFileSet recurse()\n\t\t{\n\t\tm_recurse = true;\n\t\treturn (this);\n\t\t}", "@Test\n public void tagFilesShouldReturnNonEmptyTagFiles() throws Exception {\n //given\n givenInfoMessageCode();\n\n //when\n List<IFileSpec> tagFiles = tagDelegator.tagFiles(fileSpecs, LABEL_NAME, opts);\n //then\n assertThat(tagFiles.size(), is(1));\n assertThat(tagFiles.get(0).getDepotPathString(), is(TEST_FILE_DEPOT_PATH));\n }", "private static void listFiles(File rootFile, String filename, List<File> fileList) {\n File[] files_ = rootFile.listFiles();\n if(files_ != null) {\n for(File file : files_) {\n if(file.isFile() && file.getName().equalsIgnoreCase(filename))\n \t fileList.add(file);\n else\n listFiles(file, filename, fileList);\n }\n }\n }", "public static void main(String[] args) { String dirname = \"/home/diego/IdeaProjects/JAVAStuff/src/tmp/dirTest.txt\";\n// File d = new File(dirname);\n// d.mkdirs();\n//\n File file = null;\n String[] paths;\n\n try {\n file = new File(\"/home/diego/IdeaProjects/JAVAStuff/src\");\n paths = file.list();\n\n for(String s: paths) {\n System.out.println(s);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n\n }", "@Override\n public String getFileList() {\n StringBuilder string = null;\n //if (parentFile.isDirectory()) {\n File parentFile = currentDir;\n string = new StringBuilder();\n for (File childFile : parentFile.listFiles()) {\n try {\n //TODO: Verify that Paths.get() is retrieving a valid path relative to the project's location.\n Path file = Paths.get(childFile.getPath());\n\n BasicFileAttributes attr = Files.readAttributes(file, BasicFileAttributes.class);\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"M\");\n String month = dateFormat.format(attr.creationTime().toMillis());\n dateFormat.applyPattern(\"d\");\n String dayOfMonth = dateFormat.format(attr.creationTime().toMillis());\n dateFormat.applyPattern(\"y\");\n String year = dateFormat.format(attr.creationTime().toMillis());\n\n char fileType = childFile.isDirectory() ? 'd' : '-'; //'-' represents a file.\n string.append(String.format(\"%srw-r--r--\", fileType)); //Linux style permissions\n string.append(\"\\t\");\n string.append(\"1\"); //?\n string.append(\" \");\n string.append(\"0\"); //?\n string.append(\"\\t\");\n string.append(\"0\"); //?\n string.append(\"\\t\");\n string.append(childFile.length()); //Length\n string.append(\" \");\n string.append(month); //Month\n string.append(\" \");\n string.append(dayOfMonth); //Day\n string.append(\" \");\n string.append(\" \");\n string.append(year); //Year\n string.append(\" \");\n string.append(childFile.getName());\n string.append(System.getProperty(\"line.separator\"));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n //}\n\n String format = \"%S\\t%d %d\\t%d\\t%d %S %d %d %S\";\n //return \"-rw-r--r-- 1 0 0 1073741824000 Feb 19 2016 1000GB.zip\";\n if (!string.equals(null)) {\n return string.toString();\n } else {\n return \"Error when creating file list.\";\n }\n }", "private static void runTests() {\r\n\t\tfor (int i = 0; i < testFiles.length; i++) {\r\n\t\t\tConverter file = new Converter(testFiles[i]);\r\n\t\t\tfile.convert();\r\n\t\t\tSystem.out.println(\"---------\");\r\n\t\t}\r\n\t}", "public static ArrayList<File> getListXMLFiles(File parentDir) {\n ArrayList<File> inFiles = new ArrayList<File>();\n File[] files = parentDir.listFiles();\n for (File file : files) {\n if (file.isDirectory()) {\n inFiles.addAll(getListXMLFiles(file));\n } else {\n if(file.getName().endsWith(\".xml\")){\n inFiles.add(file);\n }\n }\n }\n return inFiles;\n }", "public List <WebFile> getChildFiles()\n{\n if(_type==FileType.SOURCE_DIR) return getSourceDirChildFiles();\n return _file.getFiles();\n}", "private static List<File> rootFiles(final File metaDir) throws IOException {\n File containerFile = new File(metaDir, \"container.xml\");\n if(!containerFile.exists()) {\n throw new IOException(\"Missing 'META-INF/container.xml'\");\n }\n\n List<File> rootFiles = Lists.newArrayListWithExpectedSize(2);\n try(FileInputStream fis = new FileInputStream(containerFile)) {\n Document doc = Jsoup.parse(fis, Charsets.UTF_8.name(), \"\", Parser.xmlParser());\n Elements elements = doc.select(\"rootfile[full-path]\");\n for(Element element : elements) {\n String path = element.attr(\"full-path\").trim();\n if(path.isEmpty()) {\n continue;\n } else if(path.startsWith(\"/\")) {\n path = path.substring(1);\n }\n File rootFile = new File(metaDir.getParent(), path);\n if(!rootFile.exists()) {\n throw new IOException(String.format(\"Missing file, '%s'\", rootFile.getAbsolutePath()));\n }\n rootFiles.add(rootFile);\n }\n }\n\n return rootFiles;\n }", "private static void buildDir (File dir) \n\t\tthrows Exception\n\t{\n\t\tFile[] contents = dir.listFiles();\n\t\tfor (int i = 0; i < contents.length; i++) {\n\t\t\tFile file = contents[i];\n\t\t\tif (file.isDirectory()) {\n\t\t\t\tbuildDir(file);\n\t\t\t} else if (file.getName().endsWith(\".xml\")) {\n\t\t\t\tbuildFile(file);\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void testFileSwitchAllowsExcludeOfChildren() throws Exception {\n final File testDir = ResourceExtractor.simpleExtractResources(getClass(), RESOURCE_PATH);\n Verifier verifier = newVerifier(testDir.getAbsolutePath());\n\n verifier.addCliArgument(\"-f\");\n verifier.addCliArgument(\"module-a\");\n verifier.addCliArgument(\"--non-recursive\");\n verifier.setLogFileName(\"log-non-recursive.txt\");\n verifier.addCliArgument(\"compile\");\n verifier.execute();\n verifyTextNotInLog(verifier, \"Building module-a-1 1.0\");\n }", "private void checkThruFileTree(File f[], CachedUrlSet myCUS){\n String exclUrlStem = \"http://www.example.com/branch1/branch1/branch1/\";\n\n for (int ix=0; ix<f.length; ix++) {\n\t if (f[ix].isDirectory()) {\n\t // get all the files and links there and iterate\n\t checkThruFileTree(f[ix].listFiles(), myCUS);\n\t } else {\n\n\t // get the f[ix] 's level information\n\t String fileUrl = sau.mapContentFileNameToUrl(f[ix].getAbsolutePath());\n\t int fileLevel = sau.getLinkDepth(fileUrl);\n\t log.debug2(\"File: \" + fileUrl + \" in Level \" + fileLevel);\n\n\t CachedUrl cu = sau.makeCachedUrl(fileUrl);\n\t if (fileLevel <= maxDepth\n\t && !StringUtil.startsWithIgnoreCase(fileUrl, exclUrlStem)) {\n\t assertTrue(cu + \" has no content\", cu.hasContent());\n\t } else {\n\t assertFalse(cu + \" has content when it shouldn't\",\n\t\t\t cu.hasContent());\n\t }\n\t }\n }\n return; // when all \"File\" in the array are checked\n }", "@Test\n public void testLsDirectoryAndFileR() {\n FileTree myTree = new FileTree();\n String[] paths = {\"file\"};\n try {\n myTree.mkdir(paths);\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"Could not create directory\");\n }\n String result = \"\";\n try {\n myTree.makeFile(\"file1\");\n } catch (NotDirectoryException | AlreadyExistException e) {\n fail(\"could not create file\");\n }\n String[] empty_path = {};\n try {\n result = myTree.ls(true, empty_path);\n } catch (InvalidPathException e1) {\n fail(\"Could not find the directories\");\n }\n\n assertEquals(result, \"Path at /: \\nfile\\nfile1\\nPath at /file: \\n\");\n }", "@Test\n public void testConstructor_Custom_Store_File() {\n\n File file = new File(\n System.getProperty(\"java.io.tmpdir\") + File.separator + \"oasis-list-testConstructor_Custom_Store_File\");\n file.mkdirs();\n file.deleteOnExit();\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(file);\n Collection c = Arrays.asList(1, 1, 7, 7, 1, 1, 1);\n instance.addAll(c);\n\n File[] subDirs = file.listFiles();\n\n assertNotNull(subDirs);\n }", "@Test\n public void shouldReturnNonEmptyTagFiles() throws Exception {\n //given\n givenInfoMessageCode();\n //when\n List<IFileSpec> tagFiles = tagDelegator.tagFiles(\n fileSpecs,\n LABEL_NAME,\n listOnly1,\n delete1);\n //then\n assertThat(tagFiles.size(), is(1));\n assertThat(tagFiles.get(0).getDepotPathString(), is(TEST_FILE_DEPOT_PATH));\n }", "GitFile[] getFilesImpl() throws Exception\n {\n TreeWalk twalk = new TreeWalk(getRepo()); twalk.addTree(_rev);\n List <GitFile> files = new ArrayList();\n while(twalk.next()) {\n ObjectId id = twalk.getObjectId(0);\n RevObject rid = getRevObject(id);\n String path = _path + (_path.length()>1? \"/\" : \"\") + twalk.getNameString();\n GitFile child = rid instanceof RevTree? new GitTree((RevTree)rid, path) : new GitBlob((RevBlob)rid, path);\n files.add(child);\n }\n return files.toArray(new GitFile[files.size()]);\n }", "private void getAllFiles(File dir, List<File> fileList) throws IOException {\r\n File[] files = dir.listFiles();\r\n if(files != null){\r\n for (File file : files) {\r\n // Do not add the directories that we need to skip\r\n if(!isDirectoryToSkip(file.getName())){\r\n fileList.add(file);\r\n if (file.isDirectory()) {\r\n getAllFiles(file, fileList);\r\n }\r\n }\r\n }\r\n }\r\n }", "private void createFiles(CodeGeneratorConfiguration config,\n \t\t\tString pathPrefix, ProgressFunction progressFunction,\n \t\t\tlong schemaElements, long currentCount, long interval)\n \t\t\tthrows GraphIOException {\n \t\tGraphCodeGenerator graphCodeGenerator = new GraphCodeGenerator(\n \t\t\t\tgraphClass, packagePrefix, GRAPH_IMPLEMENTATION_PACKAGE, name,\n \t\t\t\tconfig);\n \t\tgraphCodeGenerator.createFiles(pathPrefix);\n \n \t\tfor (VertexClass vertexClass : graphClass.getVertexClasses()) {\n \t\t\tVertexCodeGenerator codeGen = new VertexCodeGenerator(vertexClass,\n \t\t\t\t\tpackagePrefix, GRAPH_IMPLEMENTATION_PACKAGE, config);\n \t\t\tcodeGen.createFiles(pathPrefix);\n \t\t\tif (progressFunction != null) {\n \t\t\t\tschemaElements++;\n \t\t\t\tcurrentCount++;\n \t\t\t\tif (currentCount == interval) {\n \t\t\t\t\tprogressFunction.progress(schemaElements);\n \t\t\t\t\tcurrentCount = 0;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \n \t\tfor (EdgeClass edgeClass : graphClass.getEdgeClasses()) {\n \t\t\tCodeGenerator codeGen = new EdgeCodeGenerator(edgeClass,\n \t\t\t\t\tpackagePrefix, GRAPH_IMPLEMENTATION_PACKAGE, config);\n \t\t\tcodeGen.createFiles(pathPrefix);\n \n \t\t\tif (!edgeClass.isAbstract()) {\n \t\t\t\tcodeGen = new ReversedEdgeCodeGenerator(edgeClass,\n \t\t\t\t\t\tpackagePrefix, GRAPH_IMPLEMENTATION_PACKAGE, config);\n \t\t\t\tcodeGen.createFiles(pathPrefix);\n \t\t\t}\n \t\t\tif (progressFunction != null) {\n \t\t\t\tschemaElements++;\n \t\t\t\tcurrentCount++;\n \t\t\t\tif (currentCount == interval) {\n \t\t\t\t\tprogressFunction.progress(schemaElements);\n \t\t\t\t\tcurrentCount = 0;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \n \t\t// build records and enums\n \t\tfor (Domain domain : getRecordDomains()) {\n \t\t\t// also generate an abstract class for Records\n \t\t\tCodeGenerator rcode = new RecordCodeGenerator(\n \t\t\t\t\t(RecordDomain) domain, packagePrefix,\n \t\t\t\t\tGRAPH_IMPLEMENTATION_PACKAGE, config);\n \t\t\trcode.createFiles(pathPrefix);\n \t\t\tif (progressFunction != null) {\n \t\t\t\tschemaElements++;\n \t\t\t\tcurrentCount++;\n \t\t\t\tif (currentCount == interval) {\n \t\t\t\t\tprogressFunction.progress(schemaElements);\n \t\t\t\t\tcurrentCount = 0;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\tfor (Domain domain : getEnumDomains()) {\n \t\t\tCodeGenerator ecode = new EnumCodeGenerator((EnumDomain) domain,\n \t\t\t\t\tpackagePrefix, GRAPH_IMPLEMENTATION_PACKAGE);\n \t\t\tecode.createFiles(pathPrefix);\n \t\t}\n \t\tif (progressFunction != null) {\n \t\t\tschemaElements++;\n \t\t\tcurrentCount++;\n \t\t\tif (currentCount == interval) {\n \t\t\t\tprogressFunction.progress(schemaElements);\n \t\t\t\tcurrentCount = 0;\n \t\t\t}\n \t\t}\n \t}", "private void prepareAssignmentFiles() {\n for (Assignment assignment : assignments) {\n //---------- initialize the assignmentFiles array list ----------\n assignment.assignmentFiles = new ArrayList<>();\n\n //create a temporary assignment files array list\n ArrayList<File> assignmentFiles = new ArrayList<>();\n\n //---------- call the recursive findAssignmentFiles method ----------\n findAssignmentFiles(assignmentFiles, assignment.assignmentDirectory);\n\n //---------- set the language for the assignment ----------\n if (language.equals( IAGConstant.LANGUAGE_AUTO) ) {\n assignment.language = autoDetectLanguage(assignmentFiles);\n }\n else {\n assignment.language = language;\n }\n\n String[] extensions;\n\n switch (assignment.language) {\n case IAGConstant.LANGUAGE_PYTHON3:\n extensions = IAGConstant.PYTHON_EXTENSIONS;\n break;\n case IAGConstant.LANGUAGE_CPP:\n extensions = IAGConstant.CPP_EXTENSIONS;\n break;\n default: //unable to determine the language\n extensions = new String[] {};\n }\n\n //add only files of the right type to the assignment file list\n for (File f: assignmentFiles) {\n String f_extension = getFileExtension(f).toLowerCase();\n if (Arrays.asList(extensions).contains(f_extension)){\n //---------- if the extension on the file matches\n // one of the extension in the extensions list, add\n // it to the programming files list. ----------\n assignment.assignmentFiles.add(f);\n }\n }\n assignment.bAutoGraded = false; //indicate the assignment has not yet been auto-graded\n }\n\n }", "public static List<Path> getPackageFiles(\n Path directory, boolean recursive, Map<String, Documentation> pkgDocs)\n throws IOException, ShadowException {\n try (DirectoryStream<Path> stream = Files.newDirectoryStream(directory)) {\n List<Path> files = new ArrayList<>();\n\n for (Path filePath : stream) {\n // Capture all source files\n if (filePath.toString().endsWith(SRC_EXTENSION)) files.add(filePath);\n // Capture any package-info files\n else if (filePath.getFileName().toString().equals(PKG_INFO_FILE))\n processPackageInfo(filePath, pkgDocs);\n // Recurse into subdirectories if desired\n else if (recursive && Files.isDirectory(filePath))\n files.addAll(getPackageFiles(filePath, true, pkgDocs));\n }\n return files;\n }\n }", "@Test\r\n public void testGetChangedFileList() throws IOException {\n helper.exportRevChangedFiles(PJ_ROOT, 1, LOCAL_ROOT);\r\n helper.exportRevChangedFiles(PJ_ROOT, 4, LOCAL_ROOT);\r\n //helper.exportRevChangedFiles(PJ_ROOT, -1, LOCAL_ROOT);\r\n //helper.exportRevChangedFiles(9, 9, true);\r\n }", "@Test\n public void testStoreFileAlphabetical() {\n\n File file1 = new File(\"c\");\n File file2 = new File(\"b\");\n File file3 = new File(\"a\");\n parent.storeFile(file1);\n parent.storeFile(file2);\n parent.storeFile(file3);\n ArrayList<File> output = parent.getStoredFiles();\n ArrayList<File> expected = new ArrayList<File>();\n expected.add(file3);\n expected.add(file2);\n expected.add(file1);\n assertEquals(output, expected);\n }", "public abstract List<String> getFiles( );", "private static List<TestSetup> getTests() {\n PivotPicker middlePiv = Quick::alwaysPickMiddle;\n\n // Pivot Pickers\n PivotPicker leftPiv = Quick::alwaysPickLeftmost;\n PivotPicker rightPiv = Quick::alwaysPickRightmost;\n PivotPicker motPiv = Quick::medianOfThree;\n PivotPicker[] pivots = {leftPiv, middlePiv, rightPiv, motPiv};\n String[] pivotNames = {\"Always Pick Leftmost\", \"Always Pick Middle\", \"Always Pick Rightmost\", \"Median Of Three\"};\n\n // Partitioning methods\n Partitioner jonPart = (array, left, right, pivot) -> partition_Jon(array, left, right, pivot);\n Partitioner lomutoPart = Quick::partition_Lomuto;\n Partitioner hoarePart = Quick::partition_Hoare;\n Partitioner[] partitioners = {lomutoPart, hoarePart};\n String[] partNames = {\"lomuto\", \"hoare\"};\n\n // Subsort methods and sizes\n Subsort insertionSub = Quick::insertionSort;\n Subsort[] subsorts = {insertionSub};\n String[] subsortNames = {\"insertion\"};\n List<Integer> sizes = new ArrayList<>();\n for (int i = 3; i < 128; i = 1 + (int) (i * 1.45)) {\n sizes.add(i);\n }\n Integer[] subsortSizes = sizes.toArray(new Integer[sizes.size()]);\n\n // Data generators\n Generator randomGen = (size) -> {\n return generateArray(100, 999, size);\n };\n Generator sortedGen = (size) -> {\n int[] arr = new int[size];\n for (int i = 0; i < arr.length; i++) {\n arr[i] = i;\n }\n return arr;\n };\n Generator reversedGen = (size) -> {\n int[] arr = new int[size];\n for (int i = 0; i < arr.length; i++) {\n arr[i] = arr.length - i;\n }\n return arr;\n };\n Generator[] generators = {\n randomGen,\n //sortedGen, reversedGen,\n //(size) -> { return generateArray(10000, 99999, size, 0xDEADBEEF); },\n //(size) -> { return generateArray(10000, 99999, size, 0xCAFEBABE); },\n //(size) -> { return generateArray(10000, 99999, size, 0xBAADF00D); },\n\n };\n String[] generatorNames = {\n \"Random\",\n //\"sorted\", \"reversed\",\n //\"Sequence:0xDEADBEEF\",\n //\"Sequence:0xCAFEBABE\",\n //\"Sequence:0xBAADF00D\",\n };\n\n // Default test data\n TestSetup defaultTest = new TestSetup(\"Default\", null, null, 0, null, null);\n\n List<TestSetup> tests = new ArrayList<>();\n tests.add(defaultTest);\n List<TestSetup> temp = new ArrayList<>();\n { // Block for creating partition method variants\n\n\n // Create variations of the test with different partitioning methods\n for (TestSetup setup : tests) {\n\n for (int i = 0; i < partitioners.length; i++) {\n TestSetup variant = new TestSetup(setup, partNames[i]);\n variant.part = partitioners[i];\n temp.add(variant);\n }\n }\n }\n\n // Swap arrays (don't want to add to a collection we're iterating)\n tests = temp;\n temp = new ArrayList<>();\n // Create variations of the test with different pivot picking methods\n for (TestSetup setup : tests) {\n //temp.add(setup);\n\n for (int i = 0; i < pivots.length; i++) {\n TestSetup variant = new TestSetup(setup, setup.name + \" + \" + pivotNames[i]);\n variant.pivp = pivots[i];\n temp.add(variant);\n }\n }\n\n { // Block for creating generator (dataset) variants\n // Swap arrays (don't want to add to a collection we're iterating)\n tests = temp;\n temp = new ArrayList<>();\n\n // Create variations of the test with different data generation methods\n for (TestSetup setup : tests) {\n //temp.add(setup);\n\n for (int i = 0; i < generators.length; i++) {\n TestSetup variant = new TestSetup(setup, setup.name + \" on \" + generatorNames[i] + \" data\");\n variant.gen = generators[i];\n temp.add(variant);\n }\n }\n }\n\n\n { // Block for creating subsort variants\n // Swap arrays (don't want to add to a collection we're iterating)\n tests = temp;\n temp = new ArrayList<>();\n\n // Create variations of the test with different subsort methods and thresholds\n for (TestSetup setup : tests) {\n temp.add(setup);\n\n for (int i = 0; i < subsorts.length; i++) {\n // And also one version for each size!\n for (int k = 0; k < subsortSizes.length; k++) {\n TestSetup variant = new TestSetup(setup, setup.name + \"+\" + subsortNames[i] + \" below \" + subsortSizes[k]);\n variant.sst = subsortSizes[k];\n variant.ssort = subsorts[i];\n //temp.add(variant);\n\n TestSetup variant_finalSort = new TestSetup(variant, variant.name + \" once at end\");\n variant_finalSort.sortFinal = true;\n temp.add(variant_finalSort);\n }\n }\n }\n }\n\n\n // Return completed variation list\n return temp;\n }", "public static List<String> dummyListFiles(String startDir) {\n String[] array;\n List<String> list = new ArrayList<>();\n\n File f = new File(startDir);\n\n array = f.list();\n\n for (String item : array) {\n list.add(item);\n }\n\n return list;\n }", "@Test\n public void testGetSubFiles() {\n System.out.println(\"getSubFiles from Existing path with 2 images\");\n String path = folder.toString()+fSeparator+\"Images\";\n FilesDao instance = new FilesDao();\n \n File firstImageFile = new File(path+fSeparator+\"testImg.jpg\");\n File secondImageFile = new File(path+fSeparator+\"testImg2.jpg\");\n List<URI> expResult = new ArrayList<URI>();\n expResult.add(firstImageFile.toURI());\n expResult.add(secondImageFile.toURI());\n List<URI> result;\n try{\n result = instance.getSubFiles(path);\n }catch(EntryException ex){\n result = null;\n }\n assertEquals(\"Some message\",expResult, result);\n }", "private static void findAllFilesRecurse(File root, ArrayList<File> files, boolean recurse) {\n\t\tFile[] rootContents = root.listFiles();\n\t\tif (rootContents == null) {\n\t\t\tfiles.add(root);\n\t\t} else {\n\t\t\tfor (File f : rootContents) {\n\t\t\t\t// if it is a file or do not go deeper\n\t\t\t\tif (f.isFile() || !recurse) {\n\t\t\t\t\tfiles.add(f);\n\t\t\t\t} else if (recurse) { // directory\n\t\t\t\t\tfindAllFilesRecurse(f, files, true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected File[] getFiles() {\r\n DirectoryScanner scanner = new DirectoryScanner(rootDir,true,\"*.xml\");\r\n List<File> files = scanner.list();\r\n return files.toArray(new File[files.size()]);\r\n }", "void runTestSuites() throws InterruptedException {\n // all test suites are located under this directory\n String testSuiteDirectory = config.getTestSuiteDirectoryPathString();\n if (!testSuiteDirectory.endsWith(Constants.FILE_SEPARATOR)) {\n testSuiteDirectory += Constants.FILE_SEPARATOR;\n }\n\n String programNames = options.getValueFor(Constants.PROGRAMS_OPTION);\n String[] programNamesSeparated = programNames.split(Constants.COLON);\n\n // Find test subdirectories that match program names\n List<String> matchingDirectories;\n for (String programName : programNamesSeparated) {\n Path path = Paths.get(programName);\n String fname = path.getFileName().toString();\n programName = fname;\n DirectoryNameMatcher directoryFinder = new DirectoryNameMatcher(programName);\n try {\n Files.walkFileTree(Paths.get(testSuiteDirectory), directoryFinder);\n matchingDirectories = directoryFinder.getMatchingDirectories();\n if (matchingDirectories.isEmpty()) {\n Log.warn(messages.get(\"WRN001\", programName, testSuiteDirectory));\n }\n } catch (IOException ioException) {\n throw new PossibleInternalLogicErrorException(\n messages.get(\"ERR019\", programName));\n }\n\n for (String matchingDirectory : matchingDirectories) {\n TestSuiteConcatenator concatenator =\n new TestSuiteConcatenator(config, options);\n testSuite = concatenator.concatenateTestSuites(matchingDirectory);\n\n // Create READER for the Cobol source program to be tested\n StringBuilder cobolSourceInPath = new StringBuilder();\n cobolSourceInPath.append(System.getProperty(\"user.dir\"));\n cobolSourceInPath.append(Constants.FILE_SEPARATOR);\n cobolSourceInPath.append(config.getApplicationSourceDirectoryPathString());\n if (!cobolSourceInPath.toString().endsWith(Constants.FILE_SEPARATOR)) {\n cobolSourceInPath.append(Constants.FILE_SEPARATOR);\n }\n cobolSourceInPath.append(programName);\n\n List<String> applicationFilenameSuffixes = config.getApplicationFilenameSuffixes();\n for (String suffix : applicationFilenameSuffixes) {\n Log.debug(\"Driver looking for source file <\" + cobolSourceInPath.toString() + suffix + \">\");\n if (Files.isRegularFile(Paths.get(cobolSourceInPath.toString() + suffix))) {\n cobolSourceInPath.append(suffix);\n Log.debug(\"Driver recognized this file as a regular file: <\" + cobolSourceInPath.toString() + \">\");\n break;\n }\n }\n String cobolSourceInPathString = adjustPathString(cobolSourceInPath.toString());\n\n try {\n cobolSourceIn = new FileReader(cobolSourceInPathString);\n } catch (IOException cobolSourceInException) {\n throw new PossibleInternalLogicErrorException(\n messages.get(\"ERR018\", programName));\n }\n\n // Create WRITER for the test source program (copy of program to be tested plus test code)\n StringBuilder testSourceOutPath = new StringBuilder();\n testSourceOutPath.append(new File(Constants.EMPTY_STRING).getAbsolutePath());\n testSourceOutPath.append(Constants.FILE_SEPARATOR);\n testSourceOutPath.append(\n config.getString(Constants.TEST_PROGRAM_NAME_CONFIG_KEY,\n Constants.DEFAULT_TEST_PROGRAM_NAME));\n\n Log.debug(\"Driver.runTestSuites() testSourceOutPath: <\" + testSourceOutPath.toString() + \">\");\n\n try {\n testSourceOut = new FileWriter(testSourceOutPath.toString());\n } catch (IOException testSourceOutException) {\n throw new PossibleInternalLogicErrorException(\n messages.get(\"ERR016\", programName));\n }\n\n mergeTestSuitesIntoTheTestProgram();\n try {\n testSourceOut.close();\n } catch (IOException closeTestSourceOutException) {\n throw new PossibleInternalLogicErrorException(\n messages.get(\"ERR017\", programName));\n }\n\n // Compile and run the test program\n String processConfigKeyPrefix;\n ProcessLauncher launcher = null;\n switch (PlatformLookup.get()) {\n case LINUX :\n Log.debug(\"Driver launching Linux process\");\n processConfigKeyPrefix = \"linux\";\n launcher = new LinuxProcessLauncher(config);\n break;\n case WINDOWS :\n Log.debug(\"Driver launching Windows process\");\n processConfigKeyPrefix = \"windows\";\n launcher = new WindowsProcessLauncher(config);\n break;\n case OSX :\n Log.debug(\"Driver launching OS X process\");\n processConfigKeyPrefix = \"osx\";\n //launcher = new OSXProcessLauncher(config);\n break;\n case ZOS :\n Log.debug(\"Driver launching z/OS process\");\n processConfigKeyPrefix = \"zos\";\n //launcher = new ZOSProcessLauncher(config);\n break;\n default :\n Log.debug(\"Driver launching default process\");\n processConfigKeyPrefix = \"unix\";\n launcher = new LinuxProcessLauncher(config);\n break;\n }\n String processConfigKey = processConfigKeyPrefix + Constants.PROCESS_CONFIG_KEY;\n String processName = config.getString(processConfigKey);\n if (isBlank(processName)) {\n String errorMessage = messages.get(\"ERR021\", processConfigKey);\n Log.error(errorMessage);\n throw new PossibleInternalLogicErrorException(errorMessage);\n }\n if (launcher != null){\n Process process = launcher.run(testSourceOutPath.toString());\n int exitCode = 1;\n// try {\n exitCode = process.waitFor();\n// } catch (InterruptedException interruptedException) {\n// exitCode = 1;\n// }\n Log.info(messages.get(\"INF009\", processName, String.valueOf(exitCode)));\n }\n }\n }\n }", "@Test\n public void testStoreFile() {\n\n File file1 = new File(\"file1\");\n File file2 = new File(\"file2\");\n parent.storeFile(file1);\n parent.storeFile(file2);\n ArrayList<File> output = parent.getStoredFiles();\n ArrayList<File> expected = new ArrayList<File>();\n expected.add(file1);\n expected.add(file2);\n assertEquals(output, expected);\n }", "protected abstract void generatePackageFiles(ClassTree classtree) throws Exception;", "public static List<File> goFolder(File file) {\n File[] files = file.listFiles();\n for (File f : files) {\n if (!f.isDirectory()) {\n if (isCondition(f)) {\n fileList.add(f);\n }\n } else {\n goFolder(f);\n }\n }\n return fileList;\n }", "public static Path genSimpleTestTree(Path root, String name) throws IOException {\n Path tmp = root.resolve(name);\n\n Path t1 = tmp.resolve(\"test.txt\");\n Path t2 = tmp.resolve(Paths.get(\"dir\", \"file.txt\"));\n Path t3 = tmp.resolve(Paths.get(\"dir\", \"subDir\", \"child.txt\"));\n\n PathHelper.mkdirs(t2.getParent());\n PathHelper.mkdirs(t3.getParent());\n Files.write(t1, TEST1.getBytes(StandardCharsets.UTF_8));\n Files.write(t2, TEST2.getBytes(StandardCharsets.UTF_8));\n Files.write(t3, TEST3.getBytes(StandardCharsets.UTF_8));\n\n return tmp;\n }", "private void scanArgs(String [] args)\n{\n for (int i = 0; i < args.length; ++i) {\n if (args[i].startsWith(\"-\")) {\n \n }\n else { \n root_files.add(new File(args[i]));\n }\n }\n \n if (root_files.isEmpty()) {\n root_files.add(new File(DEFAULT_FILE));\n }\n if (output_file == null) output_file = new File(OUTPUT_FILE);\n}", "public static void printListFilesRecursive(String startDir) {\n File dir = new File(startDir);\n File[] files = dir.listFiles();\n\n if (files != null && files.length > 0) {\n for (File file : files) {\n //Check if the file is a directory\n if (file.isDirectory()) {\n System.out.println(\"-- \" + file.getName());\n printListFilesRecursive(file.getAbsolutePath());\n } else {\n System.out.println(file.getName());\n }\n }\n }\n }", "public static void main(String[] args) {\n\n File path = new File(args[0]);\n File resultFileAbsolutePath = new File(args[1]);\n File allFilesContent = new File(resultFileAbsolutePath.getParent()+\"/allFilesContent.txt\");\n FileUtils.renameFile(resultFileAbsolutePath, allFilesContent);\n\n List<File> filesList = new ArrayList<>();\n List<File> directoriesList = new ArrayList<>();\n\n File[] mainDirectoryArray = path.listFiles();\n checkAndAddFile(mainDirectoryArray, directoriesList, filesList);\n\n for (int i = 0; i < filesList.size(); i++) {\n if (filesList.get(i).length() > 50L) {\n filesList.remove(i--);\n }\n }\n\n Collections.sort(filesList, Comparator.comparing(File::getName));\n\n writeFiles(allFilesContent, filesList);\n }", "@Test\n public void testConstructor_Custom_Store_File_Overflow() {\n\n File file = new File(System.getProperty(\"java.io.tmpdir\") + File.separator\n + \"oasis-list-testConstructor_Custom_Store_File_Overflow\");\n file.mkdirs();\n file.deleteOnExit();\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(file);\n Collection c = Arrays.asList(1, 1, 7, 7, 1, 1, 1);\n instance.addAll(c);\n\n File[] subDirs = file.listFiles();\n\n assertNotNull(subDirs);\n }", "@Test\n public void testMatchNonGlobs() throws Exception {\n String container = \"test-container\" + randomUUID();\n BlobContainerClient blobContainerClient =\n azureBlobStoreFileSystem.getClient().createBlobContainer(container);\n\n List<String> blobNames = new ArrayList<>();\n blobNames.add(\"testdirectory/file1name\");\n blobNames.add(\"testdirectory/dir2name/\");\n blobNames.add(\"testdirectory/file4name\");\n // TODO: Also test match results where MatchResult.STATUS != OK (see gcs and s3 tests)\n\n for (String blob : blobNames) {\n blobContainerClient.getBlobClient(blob).uploadFromFile(\"src/test/resources/in.txt\");\n }\n\n List<String> specs =\n ImmutableList.of(\n \"azfs://account/\" + container + \"/testdirectory/file1name\",\n \"azfs://account/\" + container + \"/testdirectory/dir2name/\",\n \"azfs://account/\" + container + \"/testdirectory/file4name\");\n\n List<MatchResult> matchResults = azureBlobStoreFileSystem.match(specs);\n\n assertEquals(3, matchResults.size());\n assertThat(\n ImmutableList.of(\"azfs://account/\" + container + \"/testdirectory/file1name\"),\n contains(toFilenames(matchResults.get(0)).toArray()));\n assertThat(\n ImmutableList.of(\"azfs://account/\" + container + \"/testdirectory/dir2name/\"),\n contains(toFilenames(matchResults.get(1)).toArray()));\n assertThat(\n ImmutableList.of(\"azfs://account/\" + container + \"/testdirectory/file4name\"),\n contains(toFilenames(matchResults.get(2)).toArray()));\n\n blobContainerClient.delete();\n }", "protected void createFileList()\n {\n // get a sorted array of files\n File f = new File(appManagementDir);\n String[] files = f.list(new FileFilter(AppSettings.getFilter()));\n \n // get the adapter for this file list\n ArrayAdapter<String> a = (ArrayAdapter<String>)fileList.getAdapter();\n a.clear();\n \n // clear the check boxes\n fileList.clearChoices();\n \n if (files != null && files.length > 0)\n {\n Arrays.sort(files, 0, files.length, new Comparator<Object>() {\n \n @Override\n public int compare(Object object1, Object object2)\n {\n int comp = 0;\n if (object1 instanceof String \n && object2 instanceof String)\n {\n String str1 = (String)object1;\n String str2 = (String)object2;\n \n comp = str1.compareToIgnoreCase(str2);\n }\n \n return comp;\n }});\n \n \n // add all the files\n for (String fileName : files)\n {\n a.add(fileName);\n }\n \n fileList.invalidate();\n }\n }", "private static Stream<Path> listRecur(Path p) {\n if (Files.isDirectory(p)) {\n try {\n return Files.list(p).flatMap(DirectoryClassPath::listRecur);\n } catch (IOException e) {\n throw new UncheckedIOException(e);\n }\n } else {\n return Stream.of(p);\n }\n }", "public void test() {\n\t\tFile file = new File(\"/home/students/\");\r\n\t\t\r\n\t\tString[] list = file.list(new FilenameFilter() {\r\n\t\t\tpublic boolean accept(File dir, String name) {\r\n\t\t\t\tif (name.toLowerCase().endsWith(\".py\")) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tfor (String f : list) {\r\n\t\t\tSystem.out.println(f);\r\n\t\t}\r\n\t}", "private void searchDFS(File[] files, ArrayList<String> list) {\n\n\t\tfor (File file : files) {\n\t\t\tif (file.isDirectory()) {\n\t\t\t\tif (file.getAbsolutePath().endsWith(GIT)) {\n\t\t\t\t\tgitDir = file.getAbsolutePath();\n\t\t\t\t}\n\t\t\t\tsearchDFS(file.listFiles(), list);\n\t\t\t} else {\n\t\t\t\tif (file.getName().endsWith(EXTENSION)) {\n\t\t\t\t\tlist.add(file.getAbsolutePath());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private String[] nlstHelper(String args) {\n // Construct the name of the directory to list.\n String filename = currDirectory;\n if (args != null) {\n filename = filename + fileSeparator + args;\n }\n\n // Now get a File object, and see if the name we got exists and is a\n // directory.\n File f = new File(filename);\n\n if (f.exists() && f.isDirectory()) {\n return f.list();\n } else if (f.exists() && f.isFile()) {\n String[] allFiles = new String[1];\n allFiles[0] = f.getName();\n return allFiles;\n } else {\n return null;\n }\n }", "private void listAllClasses(List<Path> foundFiles, Path root) {\r\n if (root.toFile().isFile()) {\r\n foundFiles.add(root);\r\n } else {\r\n try (DirectoryStream<Path> stream = Files.newDirectoryStream(root, filter)) {\r\n for (Path path : stream) {\r\n if (Files.isDirectory(path)) {\r\n listAllClasses(foundFiles, path);\r\n } else {\r\n foundFiles.add(path);\r\n }\r\n }\r\n } catch (AccessDeniedException e) {\r\n logger.error(\"Access denied to directory {}\", root, e);\r\n } catch (IOException e) {\r\n logger.error(\"Error while reading directory {}\", root, e);\r\n }\r\n }\r\n }" ]
[ "0.6359392", "0.6210571", "0.61321604", "0.6079699", "0.60323364", "0.601823", "0.59447086", "0.59254074", "0.5846408", "0.5806602", "0.57957554", "0.5781735", "0.5721054", "0.5612527", "0.5608012", "0.5606742", "0.55880076", "0.5582889", "0.55784136", "0.5571612", "0.55576247", "0.5552554", "0.5531318", "0.5523912", "0.55114293", "0.55081004", "0.5460391", "0.54600495", "0.54540014", "0.5440102", "0.54391056", "0.5409817", "0.5404231", "0.5397345", "0.53962606", "0.5394618", "0.5393015", "0.5389384", "0.53818536", "0.537755", "0.5374021", "0.53728753", "0.53594375", "0.5353033", "0.53450257", "0.5343458", "0.53295356", "0.53278375", "0.5324831", "0.5317602", "0.53165317", "0.5312894", "0.5304806", "0.53001964", "0.52852285", "0.5265308", "0.52558833", "0.52544975", "0.5253451", "0.52490544", "0.52443767", "0.5236754", "0.5230488", "0.5228041", "0.5205588", "0.51864946", "0.5169016", "0.5166524", "0.5166077", "0.5166055", "0.51586235", "0.5151858", "0.51505464", "0.51487696", "0.51448786", "0.51332283", "0.5122064", "0.5121851", "0.5121435", "0.5110125", "0.50919306", "0.50853693", "0.50845486", "0.50806653", "0.50728273", "0.5070687", "0.5063643", "0.5062929", "0.50621575", "0.50577116", "0.50565386", "0.50563514", "0.50524956", "0.5051961", "0.5047812", "0.504681", "0.5044512", "0.50368065", "0.5032347", "0.50190663" ]
0.6020108
5
Determines if the given file is "bad" (bad files are not tested).
private static boolean isBadFile(String file) { for (int i=0; i<configFiles.size(); i++) { try { String s = (String) configFiles.get(i); if (!config.isParsed(s)) { config.addFile(s); } } catch (IOException exc) { LogTools.trace(exc); } } return !config.testFile(file) && !file.endsWith(".bioformats"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void invalidFileTest() {\n\t\t// Test error handling: invalid file\n\t\tfileName = \"invalid.txt\";\n\t\tactual = Helper.isValidFile(workDir, fileName);\n\t\tassertNull(actual);\n\n\t\t// Test error handling: invalid file\n\t\tfileName = \"./misc/secondinvalid.txt\";\n\t\tactual = Helper.isValidFile(workDir, fileName);\n\t\tassertNull(actual);\n\n\t\t// Test error handling: invalid file name with numbers\n\t\tfileName = \"12345\";\n\t\tactual = Helper.isValidFile(workDir, fileName);\n\t\tassertNull(actual);\n\n\t\t// Test error handling: invalid file name with spaces\n\t\tfileName = \"not a file\";\n\t\tactual = Helper.isValidFile(workDir, fileName);\n\t\tassertNull(actual);\n\n\t\t// Test error handling: blank file\n\t\tfileName = \"\";\n\t\tactual = Helper.isValidFile(workDir, fileName);\n\t\tassertNull(actual);\n\n\t\tfileName = \" \";\n\t\tactual = Helper.isValidFile(workDir, fileName);\n\t\tassertNull(actual);\n\n\t\tfileName = null;\n\t\tactual = Helper.isValidFile(workDir, fileName);\n\t\tassertNull(actual);\n\n\t}", "private boolean validateFile(String path) {\n return !path.equals(AppStrings.NO_FILE_PATH);\n }", "private void checkFail(String filename) throws IOException {\n\t\tChecker checker = new Checker();\n\t\ttry {\n\t\t\tthis.compiler.check(parse(filename));\n\t\t\tchecker.check(parse(filename));\n\t\t\tfail(filename + \" shouldn't check but did\");\n\t\t} catch (ParseException exc) {\n\t\t\t// this is the expected behaviour\n\t\t}\n\t}", "private boolean knownFailure(String fileName) {\r\n \t\tList<String> failures = new ArrayList<String>();\r\n \t\tfailures.add(\"Heading5\");\r\n \t\tfailures.add(\"HtmlCommentTest2\");\r\n \t\tfailures.add(\"HtmlMismatchTest3\");\r\n \t\tfailures.add(\"ImageLink2\"); // bad paragraph parsing - no <p> around <div> tags\r\n \t\tfailures.add(\"Inclusion~test\"); // template params not parsed in parser functions\r\n \t\tfailures.add(\"NestedTable1\");\r\n \t\tfailures.add(\"NestedTable2\");\r\n \t\tfailures.add(\"Paragraph13\");\r\n \t\tfailures.add(\"Paragraph15\"); // failure parsing of empty paragraphs with <nowiki>\r\n \t\tfailures.add(\"PreformattedInvalid1\");\r\n \t\tfailures.add(\"Template_-_Paramtest\");\r\n \t\tfailures.add(\"UnbalancedTag1\");\r\n \t\tfailures.add(\"UnbalancedTag3\");\r\n \t\treturn (failures.indexOf(fileName) != -1);\r\n \t}", "boolean getFileErr();", "private boolean isCorrectFile(File file) {\n\t\treturn file.getAbsolutePath().endsWith(\".gif\") || file.getAbsolutePath().endsWith(\".jpeg\")\n\t\t\t\t|| file.getAbsolutePath().endsWith(\".jpg\");\n\t}", "private boolean isAcceptableFile(File f) {\n \tif( f.getName().length() < 7 ) {\n \t\treturn false;\n \t}\n \t\n \tString extension = f.getName().substring( f.getName().length()-7, f.getName().length() );\n \tif ( !extension.equals(\".tessit\") ) {\n \t\treturn false;\n \t}\n \t\n \treturn true;\n }", "private static boolean checkFileType(String filename) {\r\n\t\treturn (filename.matches(\"(.*).bf\") || filename.matches(\"(.*).bmp\"));\r\n\t}", "boolean isFile() throws IOException;", "private File validateFile(String filename)\n {\n if (filename == null)\n {\n throw new IllegalArgumentException(\"Filename is null\");\n }\n File f = new File(filename);\n //if (!f.exists()) sometimes this throws false even if the program does exist.\n //{\n // throw new IllegalArgumentException(\"Path \"+filename+\" does not refer to a file\");\n //}\n return f;\n }", "private boolean isEmptyFile(String filename) {\n try (InputStream in = IO.openFile(filename)) {\n int b = in.read();\n return (b == -1);\n } catch (IOException ex) {\n throw IOX.exception(ex);\n }\n }", "public static boolean validateFile(final File f) throws IOException {\n if (f.exists() && f.isFile()) {\n DataInputStream in = null;\n try {\n in = new DataInputStream(new FileInputStream(f));\n int tupleLen = in.readInt();\n int tupleCount = in.readInt();\n long expectedFileLen = 8L * ((long) tupleLen) * tupleCount;\n return f.length() == expectedFileLen;\n } finally {\n if (in != null) {\n try {\n in.close();\n } catch (IOException e) {\n }\n }\n }\n }\n return false;\n }", "private boolean checkFile(String name) {\n return name.endsWith(extension);\n }", "private void checkFile() {\n \ttry {\n \t\tdata = new BufferedReader(\n \t\t\t\t new FileReader(textFile));\n \t\t\n \t}\n \tcatch(FileNotFoundException e)\n \t{\n \t\tSystem.out.println(\"The mentioned File is not found.\");\n System.out.println(\"\");\n\t\t\tSystem.exit(1);\n\t\t} catch (Exception ex) {\n\t\t\tSystem.out.println(\"The following error occured while reading the file.\");\n\t\t\tex.printStackTrace();\n\t\t\tSystem.exit(2);\n\t\t}\n }", "public void checkFile() {\n\t\tFile file = new File(\"src/Project11Problem1Alternative/names.txt\");\n\t\tSystem.out.println(file.exists() ? \"Exists!\" : \"Doesn't exist!\");\n\t\tSystem.out.println(file.canRead() ? \"Can read!\" : \"Can't read!\");\n\t\tSystem.out.println(file.canWrite() ? \"Can write!\" : \"Can't write!\");\n\t\tSystem.out.println(\"Name: \" + file.getName());\n\t\tSystem.out.println(\"Path: \" + file.getPath());\n\t\tSystem.out.println(\"Size: \" + file.length() + \" bytes\");\n\t}", "private boolean isIgnoredFile(String filename) {\n String[] splitClassName = filename.split(\"\\\\.\");\n return Arrays.asList(IGNORE_FILE).contains(splitClassName[splitClassName.length - 1]);\n }", "private boolean isValid() throws BadInputException {\n try {\n if( ! br.ready() ) \t\t\t\t\t\t//Is the reader ready?\n throw new BadInputException();\t\t//Must be a problem with the file, throw exception\n }\n catch(java.io.IOException e) {\n System.out.println(\"Error validating readability of file: \" + e.toString() );\n }\n\n return true;\n }", "private static boolean isValid(File dbFile) {\n Validate.notNull(dbFile);\n if (!dbFile.isFile()) {\n return false;\n }\n if (!isValidFileName(dbFile.getName())) {\n return false;\n }\n return Archiver.hasEntryName(dbFile, LIB_INFO_NAME);\n }", "boolean safeIsFile(FsPath path);", "public boolean fileCheck(String fileName) {\n ArrayList<String> includes = new ArrayList(Arrays.asList(\".mp4\", \".mkv\", \".avi\"));\n ArrayList<String> excludes = new ArrayList(Arrays.asList(\".jpg\"));\n boolean check = false;\n\n for (String hasThis : includes) { //check for one of the key file formats\n if (fileName.contains(hasThis)) {\n check = true;\n break;\n }\n }\n\n for (String doesntHave : excludes) { // if it has any of these, void the original assesment and return false\n if (fileName.contains(doesntHave)) {\n return false;\n }\n }\n\n return check;\n }", "private boolean canReadFile(File file) {\n if (!file.exists()) {\n log(log, Level.INFO, \"File \" + file.getAbsolutePath() + \" does not exist\");\n return false;\n }\n\n if (!file.canRead()) {\n log(log, Level.INFO, \"File \" + file.getAbsolutePath() + \" cannot be read\");\n\n return false;\n }\n\n return true;\n }", "public static boolean checkMagic(File file) throws IOException {\n\n // Attempt to extract the first 10 bytes. For files with fewer\n // than 10 bytes, use what the file contains.\n byte[] magic = new byte[2];\n FileInputStream fis = new FileInputStream(file);\n fis.read(magic);\n fis.close();\n\n return Arrays.equals(magic, PicoStructure.MAGIC);\n }", "@Test\n\tpublic void validFileTest() {\n\t\t// Test valid file with full file path\n\t\tworkDir = new File(workingDir);\n\t\texpected = validFile.getAbsolutePath();\n\t\tactual = Helper.isValidFile(workDir, validFile.getAbsolutePath());\n\t\tassertEquals(expected, actual.getAbsolutePath());\n\n\t\t// Test valid file with only file name\n\t\texpected = workDir.getAbsolutePath() + pathSep + fileName; // Bugs: OS\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// compatible \\\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// changed to /\n\t\tactual = Helper.isValidFile(workDir, fileName);\n\t\tassertEquals(expected, actual.getAbsolutePath());\n\t}", "public static boolean isValidFile(MultipartFile file) throws MyToysDefinedException {\r\n\t\tString contentType = file.getContentType();\r\n\t\tfor (String acceptedFileType : CommonConstants.ACCEPTED_FILE_TYPES) {\r\n\t\t\tif (contentType.contains(acceptedFileType)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tthrow new MyToysDefinedException(\"This file type is not accepted : \" + contentType);\r\n\t}", "private boolean existsFile(File testFile) {\n\t\tif (testFile.exists()) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean isFile() { return false; }", "public void testNonExistentFile() {\n TestWARCBatchJob job = new TestWARCBatchJob();\n boolean success =\n job.processFile(NON_EXISTENT_FILE, new ByteArrayOutputStream());\n assertEquals(\"Should record exactly one exception\",\n job.getExceptionArray().length, 1);\n assertFalse(\"Should fail on missing file\", success);\n }", "public boolean isValidFile(RandomAccessFile raf) throws IOException {\n // need a fast failure for non-GRADS files\n if (GradsDataDescriptorFile.failFast(raf))\n return false;\n raf.seek(0);\n\n // we think its a GRADS file, but we have lots of restrictions on what we can handle\n try {\n gradsDDF = new GradsDataDescriptorFile(raf.getLocation(), 5000);\n if (gradsDDF.error)\n return false;\n\n GradsDimension x = gradsDDF.getXDimension();\n GradsDimension y = gradsDDF.getYDimension();\n // J-\n\n return gradsDDF.getDataType() == null && // only handle raw binary\n gradsDDF.getDataFile() != null && !gradsDDF.hasProjection() && // can't handle projections\n !gradsDDF.getVariables().isEmpty() && // must have valid entries\n !gradsDDF.getDimensions().isEmpty() && (x.getSize() > 1) && (y.getSize() > 1); // can't handle cross sections\n // J+\n } catch (Exception ioe) {\n return false;\n }\n }", "private static void testBadChars() throws IOException {\n\t// say what output is expected\n\tSystem.err.println(\"\\nTEST BAD CHARS: BAD CHARS ON LINES 1-5\");\n\n\t// open input file\n\tFileReader inFile = null;\n\ttry {\n\t inFile = new FileReader(\"inBadChars\");\n\t} catch (FileNotFoundException ex) {\n\t System.err.println(\"File inBadChars not found.\");\n\t System.exit(-1);\n\t}\n\n\t// create and call the scanner\n\tYylex scanner = new Yylex(inFile);\n\tSymbol token = scanner.next_token();\n\tif (token.sym != sym.EOF) {\n\t System.err.println(\"ERROR TESTING BAD CHARS: not at EOF\");\n\t}\n }", "boolean hasPossiblyBad();", "public static boolean hasValidImageFile(String path) {\n boolean good = false;\n if (path.toLowerCase().endsWith(\".png\") || path.toLowerCase().endsWith(\".jpg\")) good = true;\n if (!good) return false;\n try {\n File f = new File(path);\n BufferedImage bi = ImageIO.read(f);\n if (!f.exists() || bi == null) return false;\n } catch (Exception e) {\n return false;\n }\n return true;\n }", "public static void checkFile(Path path) {\n\n if (!path.isAbsolute()) {\n System.out.format(\"%s must be an absolute path to a file.\", path);\n System.exit(0);\n } else if (!Files.exists(path)) {\n System.out.format(\"%s does not exist.\", path);\n System.exit(0);\n }\n\n // Verify that the path references a file\n try {\n BasicFileAttributes attr = Files.readAttributes(path, BasicFileAttributes.class);\n if (!attr.isRegularFile()) {\n System.out.format(\"%s is not a file.\", path);\n System.exit(0);\n }\n } catch (IOException e) {\n System.err.println(\"I/O error: \" + e);\n e.printStackTrace();\n System.exit(1);\n }\n }", "public boolean isFileMissing(Date timeNow, char typeOfFile) {\r\n boolean isMissing = false;\r\n String getFile = null;\r\n \r\n if(typeOfFile == 'S')\r\n getFile = this.getScaFile();\r\n else if(typeOfFile == 'I')\r\n getFile = this.getImpFile();\r\n \r\n if (getFile != null) {\r\n isMissing = false;\r\n } else {\r\n //If the file doesn't exists, check if the directory is older than one hour\r\n long hDiff = dtUtil.getHoursDif(this.getDirDate(), timeNow);\r\n if (hDiff > 1) {\r\n isMissing = true;\r\n }\r\n }\r\n \r\n return isMissing;\r\n }", "private boolean m20375d(File file) {\n C3927c b = DefaultDiskStorage.this.m20339b((DefaultDiskStorage) file);\n boolean z = false;\n if (b == null) {\n return false;\n }\n if (b.f17425a == \".tmp\") {\n return m20376e(file);\n }\n if (b.f17425a == \".cnt\") {\n z = true;\n }\n Preconditions.m20549b(z);\n return true;\n }", "public boolean loadFile(File f) throws IOException {\n\t\treturn false;\r\n\t}", "private static boolean checkURL(String file) {\n\t\tFile myFile = new File(file);\n\t\treturn myFile.exists() && !myFile.isDirectory();\n\t}", "public boolean hasFile(final String file);", "public boolean process(File file) throws IOException;", "protected abstract boolean isSample(File file);", "public boolean checkDocument(String fileName) throws IOException;", "protected void validateFile() {\r\n\t\tFile f = new File(FileUltil.joinPath(dOutputFolder, dFileName));\r\n\t\tif (f.exists() && !f.isDirectory()) {\r\n\t\t\tdFileName = \"Copy of \" + dFileName;\r\n\t\t\tvalidateFile();\r\n\t\t}\r\n\t}", "private boolean validateFile(JTextField fileTF,\n Component parentComp) {\n if (fileTF.getText().trim().length() == 0)\n {\n JOptionPane.showMessageDialog(parentComp,\n \"Please enter a file name in the file field\",\n \"No File Name\", JOptionPane.ERROR_MESSAGE);\n return false;\n }\n String text = fileTF.getText().trim();\n File file = new File(text);\n if (!file.exists())\n {\n JOptionPane\n .showMessageDialog(\n parentComp,\n \"The file you entered does not exist. Please enter a valid file name\",\n \"Incorrect File Name\", JOptionPane.ERROR_MESSAGE);\n return false;\n }\n return true;\n }", "public void rejects(String input, boolean isFilePath) {\n\t\ttry {\n\t\t\tif (isFilePath) {\n\t\t\t\tcompiler.parse(new File(input));\n\t\t\t} else {\n\t\t\t\tcompiler.parse(input);\n\t\t\t}\n\t\t\tAssert.fail(\"Should have failed, but passed (Input: \" + input + \")\");\n\t\t} catch (ParseException e) {\n\t\t\t// Pass the test\n\t\t\tSystem.out.println(\"Caught expected errors (Input: '\" + input + \"'): \");\n\t\t\te.print();\n\t\t\tSystem.out.println();\n\n\t\t} catch (IOException e) {\n\t\t\tAssert.fail(\"File does not exist\");\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public boolean isRegularFile() {\n\t\treturn isRegularFile;\n\t}", "public boolean canAbandonFile(OpenDefinitionsDocument doc) { return true; }", "public boolean canAbandonFile(OpenDefinitionsDocument doc) { return true; }", "private boolean isFileExist() {\n File check_file = getFilesDir();\n File[] file_check_array = check_file.listFiles();\n for (File current : file_check_array) {\n boolean user_file = isValidName(current.getName());\n if (user_file) {\n return true;\n }\n }\n return false;\n }", "public boolean isFile() { return true; }", "@Override\r\n\tpublic boolean isFile(String path) {\n\t\treturn false;\r\n\t}", "private boolean isFileNameAndModuleNotMatching(AuditEvent event) {\n return event.getFileName() == null\n || fileRegexp != null && !fileRegexp.matcher(event.getFileName()).find()\n || event.getLocalizedMessage() == null\n || moduleId != null && !moduleId.equals(event.getModuleId())\n || checkRegexp != null && !checkRegexp.matcher(event.getSourceName()).find();\n }", "private static boolean isValidFileName(String name) {\n\t\tif(name.indexOf('.') != -1 && name.length() != 0) return true;\n\t\telse System.out.println(\"\\nFilenames must include the file's extension.\"); return false;\n\t}", "public static boolean isValid(String fileFormat) {\r\n\t\tfor(FileFormats ff : FileFormats.values()) {\r\n\t\t\tif(ff.equals(fileFormat)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private boolean checkValidity(String path) {\n File checkFile = new File(path);\n return checkFile.exists();\n }", "private static boolean fileExists(String filename) {\n return new File(filename).exists();\n }", "public boolean didFilePassFilter(java.io.File file)\n {\n return (notFlag ^ fileNameToFilterBy.equals(file.getName()));\n }", "public static boolean isValid(FileFormats fileFormat) {\r\n\t\treturn FileFormats.isValid(fileFormat.toString());\r\n\t}", "public boolean fileIsFile(File file) {\n if (executionEnvironment.isLocal()) {\n return file.isFile();\n } else {\n return ProcessUtils.execute(executionEnvironment, \"test\", \"-f\", \"\\\"\" + file.getPath() + \"\\\"\").isOK(); //NOI18N\n }\n }", "private boolean isFileAccessible() {\n\t\ttry {\n\t\t\tif (!new File(fileUpload.getFilePath()).exists())\n\t\t\t\treturn false;\n\t\t\treturn true;\n\t\t} catch (SecurityException e) {\n\t\t\treturn false;\n\t\t}\n\t}", "@Test\n public void throwsIOExceptionWhenCannotHash() throws IOException {\n File nonExistent = new File(\"nonExistent.gb\");\n\n thrown.expect(IOException.class);\n // Can not use message due to FileNotFoundException containing localized text on some OS:es\n\n // Throws\n new GameFile(nonExistent);\n }", "@Test(timeout = 4000)\n public void test35() throws Throwable {\n FileUtil fileUtil0 = new FileUtil();\n boolean boolean0 = fileUtil0.isAgeGood((File) null);\n assertFalse(boolean0);\n }", "public boolean accepts(File f);", "private boolean isValidJpegHeaderBytes(RandomAccessFile file) throws IOException {\n\t\tbyte[] header = new byte[2];\n\t\tfile.read(header, 0, 2);\n\t\treturn (header[0] & 0xFF) == 0xFF && (header[1] & 0xFF) == 0xD8;\n\t}", "public boolean accept(File dir, String name) {\n boolean ok = false;\n StringTokenizer tokenizer = new StringTokenizer(name, \".\");\n /* There should be two parts. */\n if (tokenizer.countTokens() == 3) {\n String fileNumber = tokenizer.nextToken();\n String fileSuffix = tokenizer.nextToken();\n String repeat = tokenizer.nextToken();\n\n /* Check the length and the suffix. */\n if ((fileNumber.length() == 8) &&\n (fileSuffix.equals(\"bad\"))) {\n\n /* The first and third parts should be a numbers. */\n try {\n Integer.parseInt(fileNumber);\n Integer.parseInt(repeat);\n ok = true;\n } catch (NumberFormatException e) {\n ok = false;\n }\n }\n }\n\n return ok;\n }", "public static boolean isSafePath(File path) {\n // FIXME add os check here?\n Matcher matcher = safePathPattern.matcher(path.getAbsolutePath());\n return matcher.matches();\n }", "public static boolean isBinary(File file) throws IOException {\n\t\tInputStream in = null;\n\t\ttry {\n\t\t\tin = getInputStreamFromFile(file);\n\t\t\tbyte[] cc = new byte[IOUtils.DEFAULT_BUFFER]; // do a peek\n\t\t\tin.read(cc, 0, IOUtils.DEFAULT_BUFFER);\n\t\t\tfor (int i = 0; i < cc.length; i++) {\n\t\t\t\tint j = (int) cc[i];\n\t\t\t\tif (j < 32 || j > 127) {\n\t\t\t\t\tSystem.out.println((char) j);\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\t// all good\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tif (in != null)\n\t\t\t\tin.close();\n\t\t}\n\t\treturn true;\n\t}", "private boolean isCodeFile(File file) {\n return file.isFile() && file.getName().endsWith(CODE_FILE_EXTENSION);\n }", "private boolean isValidName(String guess_file) {\n int dot = guess_file.lastIndexOf(\".\");\n if (dot > 0) {\n String ext = guess_file.substring(dot + 1);\n if (!ext.equals(\"csv\")) {\n //We only want CSV files for parsing\n return false;\n }else if (ext.equals(\"csv\")){\n return true;\n }\n }\n return false;\n }", "public boolean isValidSong() { \n\t\tString filepath = aFilePath.toString();\n\t\tFile f = new File(filepath);\n\t\treturn f.exists();\n\t}", "private boolean isValid (DocFile file) {\n return file != null && Arrays.asList(Constants.VALIDDOCTYPES).contains(file.getFileType());\n }", "boolean hasFilePath();", "boolean isFile(FsPath path);", "boolean hasFileName();", "boolean hasFileName();", "public static boolean acceptsFile(File file)\n\t{\n\t\treturn acceptsExtension(extractExtension(file.getName()));\n\t}", "@Test\n\tpublic void invalidFileDirectoryTest() {\n\t\t// Test error handling: invalid file directory\n\t\tworkingDir = \"./misc/InvalidHelper\";\n\t\tFile f = new File(workingDir);\n\t\tassertFalse(Helper.isValidDirectory(f));\n\n\t\t// Test error handling: invalid file directory\n\t\tdirName = \"InvalidTest\";\n\t\tworkDir = new File(workingDir);\n\t\tactual = Helper.isValidDirectory(workDir, dirName);\n\t\tassertNull(actual);\n\n\t\t// Test error handling: invalid directory name with numbers\n\t\tdirName = \"54321\";\n\t\tactual = Helper.isValidDirectory(workDir, dirName);\n\t\tassertNull(actual);\n\n\t\t// Test error handling: invalid directory name with spaces\n\t\tdirName = \"not a directory\";\n\t\tactual = Helper.isValidDirectory(workDir, dirName);\n\t\tassertNull(actual);\n\n\t\t// Test error handling: blank directory\n\t\tdirName = \"\";\n\t\tactual = Helper.isValidDirectory(workDir, dirName);\n\t\tassertNull(actual);\n\n\t\tdirName = \" \";\n\t\tactual = Helper.isValidDirectory(workDir, dirName);\n\t\tassertNull(actual);\n\n\t\tdirName = null;\n\t\tactual = Helper.isValidDirectory(workDir, dirName);\n\t\tassertNull(actual);\n\n\t}", "protected void checkInputFile(final String inputFile)\r\n\t{\r\n\t\tif(inputFile == null)\r\n\t\t{\r\n\t\t\tthrow new NullPointerException(\"Given input file is null\");\r\n\t\t}\r\n\t\t\r\n\t\tif(inputFile.trim().isEmpty())\r\n\t\t{\r\n\t\t\tthrow new IllegalArgumentException(\"Name of the input file is empty\");\r\n\t\t}\r\n\t\t\r\n\t\tfinal File in = new File(inputFile);\r\n\t\tif (!in.canRead())\r\n\t\t{\r\n\t\t\tthrow new IllegalArgumentException(\"File \" + \r\n\t\t\t\t\t\t\t\t\t\t\t\tinputFile + \r\n\t\t\t\t\t\t\t\t\t\t\t\t\" does not exist or is not readable.\");\r\n\t\t}\r\n\t}", "public boolean isFile(String path);", "private boolean isValidFile(String sHTTPRequest) {\n String sRootFolder = \"/\" + ROOT_FOLDER.getName();\n return sAvailableFiles.contains(sRootFolder + sHTTPRequest.toLowerCase());\n }", "private boolean isJavaFile(File file){\n\t\tif(file.isFile())\n\t\t\treturn file.getName().toLowerCase().endsWith(\".java\");\n\t\treturn false;\n\t}", "boolean accept(String filename);", "public static boolean isFile(Path path) {\n\t\treturn Files.isRegularFile(path, LinkOption.NOFOLLOW_LINKS);\n\t}", "@Test\n\tpublic void testBadRead(){\n\t\ttry{\n\t\t\tXMLReader reader = new XMLReader(\"nonExistent\");\n\t\t\treader.close();\n\t\t\tfail(\"XMLReader should not have been able to read nonexistent file\");\n\t\t} catch (FileNotFoundException e){\n\t\t}\n\t}", "private boolean checkFile(Object[] fileObject) {\n for (Object lineObject : fileObject) {\n if (lineObject.toString().split(\",\").length != 11 || lineObject.toString().contains(\"%\")) {\n System.out.println(\"Check File Error on line: \" + lineObject.toString());\n return false;\n }\n }\n return true;\n }", "public static boolean isImageFile(String imageFile) {\n String img = imageFile.toLowerCase().trim();\n if (img.endsWith(\".gif\") || img.endsWith(\".jpg\") || \n img.endsWith(\".png\") || img.endsWith(\".jpeg\")) {\n return true;\n }\n return false;\n }", "@java.lang.Deprecated boolean hasFile();", "private static boolean hasThumbFile(String thumbFilePath) {\n File f = new File(thumbFilePath);\n if (f.exists() && f.isFile() && f.length() != 0) {\n return true;\n }\n return false;\n }", "public boolean checkFileDisplayed(String file) {\n return checkFileDisplayed(file, getComparator());\n }", "private void testReadFile() {\n System.out.println(\"------ TESTING : readFile(String filename) ------\");\n try{\n if(iTestFileList.readFile(sFile)){\n //throw exception if the values are not copied correctly\n if(iTestFileList.get(0) != 42175){\n throw new RuntimeException(\"FAILED -> readFile(String filename) not working correctly\");\n }\n if(iTestFileList.get(5) != 45545){\n throw new RuntimeException(\"FAILED -> readFile(String filename) not working correctly\");\n }\n if(iTestFileList.get(10) != 86908) {\n throw new RuntimeException(\"FAILED -> readFile(String filename) not working correctly\");\n }\n }\n else{\n throw new RuntimeException(\"FAILED -> readFile(String filename) not working correctly\");\n }\n }catch(RuntimeException e){\n System.out.print(e.getMessage());\n }\n System.out.print(\"\\n\");\n }", "@Test\n\tpublic void testisValidNoNotaTTFile() {\n\t\t// Setup\n\t\tString added = \"3\";\n\t\tString removed = \"5\";\n\t\tLine line = new Line(added, removed, \"dank.java\");\n\t\tList<String> types = new ArrayList<String>();\n\t\ttypes.add(\"tt\");\n\n\t\t// Exercise\n\t\tboolean valid = line.isValid(types);\n\n\t\t// Verify\n\t\tassertFalse(valid);\n\t}", "private boolean doesFileExist(String qualifiedFileName) throws FileNotFoundException {\n\t\t\n\t\t// First get a path object to where the file is.\n\t\t\n\t\tPath inWhichFolder = Paths.get(qualifiedFileName);\n\t\t\n\t\tboolean isFilePresent = (Files.exists(inWhichFolder) && Files.isReadable(inWhichFolder) && !Files.isDirectory(inWhichFolder));\n\t\t\n\t\tif (!isFilePresent) {\n\t\t\tthrow new FileNotFoundException(String.format(\"The file you specified '%s' does not exist or cannot be found!\", qualifiedFileName));\n\t\t\t\n\t\t}\n\t\t\n\t\t// If we're here then we should have a file that can be opened and read.\n\t\t\n\t\treturn isFilePresent;\n\t\t\n\t}", "public boolean fileExistance(String fileName) {\n File file = getActivity().getFileStreamPath(fileName);\n return file.exists();\n }", "private boolean checkFileExists(String fPath) {\n\t\tFile file = new File(fPath);\n\t\treturn file.exists();\n\t}", "private boolean isDataFile(File file) {\n \t\tboolean retVal = true;\n \t\tString name = file.getName();\n \t\tif((name.indexOf(TXT_EXTENSION) < 0) && (name.indexOf(CSV_EXTENSION) < 0)) retVal = false;\n \t\treturn retVal;\n \t}", "public boolean accept(File file) {\n \tString FileName = file.getName().toLowerCase();\n String FileSuffix = FileName.substring(FileName.lastIndexOf(\".\")+1);\n \treturn Arrays.asList(ValidTails).contains(FileSuffix) || file.isDirectory();\n }", "@Test\n\tpublic void testParseTagFile_Failure() throws IOException \n\t{\n\t\tString expected = \"aus-capitals|8\";\t\t\n\t\t\n\t\t// Act\n\t\t// need to be modified the hardcoded path with mocking\n\t\tString actual = TagFileParser.readTagFile(\"D:\\\\Learning\\\\testlocation\\\\aus-capitals.tag\");\n\t\t\n\t\t// Assert\t\t\n\t\tassertNotEquals(expected, actual);\t\n\t}", "public boolean fExists(){\n \n try(ObjectInputStream ois = new ObjectInputStream(new FileInputStream(file))){\n \n }\n catch (FileNotFoundException e){\n System.out.println(\"File not found\");\n return false;\n }\n catch (IOException e){\n System.out.println(\"Another exception\");\n return false;\n }\n\n return true;\n }", "public abstract boolean canDecodeInput(File file) throws IOException;", "private boolean isImage(File file) throws IOException {\n if (!file.isFile()) {\n return false;\n } else if (ImageIO.read(file) == null) // if cannot be read by imageIO, then not image\n {\n return false;\n }\n return true;\n }", "boolean hasSourceFile();", "private boolean isHidden(Path file) {\n try {\n return Files.isHidden(file);\n } catch (IOException ioe) {\n return false;\n }\n }" ]
[ "0.68585986", "0.68383515", "0.68334305", "0.67209303", "0.6669705", "0.6612015", "0.6558543", "0.6437392", "0.63469595", "0.6319177", "0.6295687", "0.6234895", "0.62336916", "0.61648047", "0.6139472", "0.61358494", "0.6110964", "0.60738873", "0.6063212", "0.60411644", "0.6029693", "0.60143715", "0.59917754", "0.5990703", "0.59766", "0.5967586", "0.5903256", "0.5884964", "0.5882355", "0.5846805", "0.5843911", "0.58298737", "0.5814871", "0.5809482", "0.57959944", "0.5767441", "0.57505953", "0.57348514", "0.572701", "0.5704413", "0.5703563", "0.56660414", "0.5665829", "0.56654876", "0.5664878", "0.5664878", "0.5654344", "0.56511366", "0.56422585", "0.562768", "0.56083876", "0.56058365", "0.55971134", "0.5594472", "0.55914927", "0.55811423", "0.55762047", "0.55657583", "0.5544585", "0.55339044", "0.55277926", "0.55171376", "0.5509964", "0.5507715", "0.5499253", "0.5499158", "0.5490103", "0.5489278", "0.5486351", "0.54849637", "0.54805577", "0.54692656", "0.54692656", "0.54682344", "0.5463939", "0.54439145", "0.5442186", "0.54336447", "0.54334277", "0.54331535", "0.5427377", "0.5418035", "0.5406366", "0.5397562", "0.53937525", "0.5381144", "0.5379803", "0.5376805", "0.536801", "0.53654", "0.5356731", "0.53553313", "0.53521657", "0.5350797", "0.53349274", "0.5332041", "0.53309226", "0.53268695", "0.53258866", "0.5322682" ]
0.7603215
0
TODO Autogenerated method stub
public static void main(String[] args) { Scanner sc = new Scanner(System.in); // int arr[]=new int[10]; // int odd[]=new int[10]; // int even[]=new int[10]; // int e=0,o=0; // System.out.println("enter total number"); // int n =sc.nextInt(); // System.out.println("enter array"); // for(int i=0;i<n;i++) // arr[i]=sc.nextInt(); // for(int var:arr) // { // if(var%2==0) // { // even[e]=var; // e++; // } // else // { // odd[o]=var; // o++; // } // } // System.out.println("even array"); // for(int var:even) // System.out.println(var); // System.out.println("odd array"); // for(int var:odd) // System.out.println(var); // // int arr[]=new int[5]; // int rev[]=new int [5]; // for(int i=0;i<5;i++) // arr[i]=sc.nextInt(); // int j=5; // for(int i=0;i<5;i++) // rev[i]=arr[--j]; // System.out.println("given array"); // for(int var:arr) // System.out.println(var); // System.out.println("reverse array"); // for(int var:rev) // System.out.println(var); // for(int i=1;i<6;i++) // { // for(int j=1;j<=i;j++) // System.out.print(i); // System.out.println(); // } }
{ "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
Return the list of property names.
public Map<String, Object> getTypeDefProperties() { if (typeDefProperties == null) { return null; } else if (typeDefProperties.isEmpty()) { return null; } else { return new HashMap<>(typeDefProperties); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String[] getPropertyNames();", "@Override\n public String[] getPropertyNames() {\n final String[] names = new String[this.properties.size()];\n this.properties.keySet().toArray(names);\n return names;\n }", "public String[] getPropertyNames()\n\t{\n\t\treturn _propertyNames;\n\t}", "public synchronized Enumeration<String> getPropertyNames() {\n return PropertyArray.enumerate(props);\n }", "public Enumeration getPropertyNames() {\r\n return properties.keys();\r\n }", "public ArrayList<String> getPropNames()\n {\n return this.prop_names;\n }", "public Enumeration getPropertyNames()\n {\n Hashtable props = getProperties();\n return (props != null) ? props.keys() : new Vector().elements();\n }", "java.util.Enumeration getPropertyNames();", "public Iterable<String> getPropertyKeys();", "public String[] getPropertyNames()\n {\n return ClassAnalyzer.getPropertyNames(m_Source.getClass());\n }", "public List <String> getPropertyNames()\n{\n // Get list from PropertyNamesMap - load if not found\n List <String> list = _propertyNamesMap.get(getClass());\n if(list==null) {\n _propertyNamesMap.put(getClass(), list = new ArrayList()); addPropNames(); }\n return list;\n}", "public final List<String> getPropertiesList()\n {\n\n List<String> allProps = new ArrayList<String>();\n Enumeration<?> e = this.fProp.propertyNames();\n\n while (e.hasMoreElements())\n {\n String key = (String) e.nextElement();\n String value = this.fProp.getProperty(key);\n allProps.add(key + \"=\" + value);\n } // end while\n\n Collections.sort(allProps);\n return allProps;\n\n }", "String[] getPropertyKeys();", "public Enumeration getPropertyNames()\n {\n final EnumerationUnion eu = new EnumerationUnion();\n if( properties != null )\n {\n eu.add( properties.keys() );\n }\n if( ancestors != null )\n {\n final int size = ancestors.size();\n for( int i = 0; i < size; i++ )\n {\n final ScriptingClass clazz = (ScriptingClass)\n ancestors.elementAt( i );\n eu.add( clazz.getPropertyNames() );\n }\n }\n try\n {\n final ScriptingClass object = getClassLoader().load( \"object\" );\n eu.add( object.getPropertyNames() );\n }\n catch( ScriptingClassNotFoundException e )\n {\n }\n return eu;\n }", "public static List<String> getAllPropNames(Provider propCat) {\n return PersistenceCfgProperties.getKeys(propCat);\n }", "@Override\n\t@SuppressWarnings(\"unchecked\")\n\t@Transactional(propagation = Propagation.SUPPORTS)\n\tpublic List<Property> findPropertyNames() \n\t{\n\t\tList<Property> details = entityManager.createNamedQuery(\"Property.readPropertyNames\").getResultList();\n\t\tlogger.info(\"Property Details are:\" + details);\n\t\treturn details;\n\t}", "@Override\n\t\tpublic Iterable<String> getPropertyKeys() {\n\t\t\treturn null;\n\t\t}", "String [] getPropertyNames(Long id) throws RemoteException;", "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 Set<String> getStringPropertyNames();", "public String[] listObjectNames();", "public Set<String> getKeys() {\n\t\t\treturn properties.keySet();\n\t\t}", "public List<NameValueProperty> getNameValueProperty() {\n\t\treturn nameValuePropertyList;\n\t}", "public Set<String> getFieldNames() {\n Set<String> names = new HashSet<String>();\n for (IdentifierProperties field : fields) {\n names.add(field.getName());\n }\n\n return names;\n }", "public List<String> propertyColumns() {\n return this.propertyColumns;\n }", "public static List<String> getProcessorNamePropertyConfigNames(NifiProperty property) {\n\n return getConfigPropertyKeysForNiFi(property).stream().map(k -> \"nifi.\" + toPropertyName(StringUtils.substringAfterLast(property.getProcessorType(), \".\") + \"[\"+property.getProcessorName()+\"].\" + k)).collect(Collectors.toList());\n }", "Property[] getProperties();", "public String getPropertyName();", "public ImmutableList<String> getMemberNames() {\n return members.stream().map(m -> m.getName()).collect(ImmutableList.toImmutableList());\n }", "public Set<Property> getPropertyKeys() {\n return nodeProperties != null ? nodeProperties.keySet() : Collections.<Property>emptySet();\n }", "String getPropertyName();", "public Set<String> stringPropertyNames() {\n return userConfig.stringPropertyNames();\n }", "public Iterator<String> getProperties() {\n List<String> list = Collections.emptyList();\n return list.iterator();\n }", "public Collection<ModuleProperty> getProperties();", "public List<String> getNames() {\n return names;\n }", "java.lang.String getProperties();", "public List<Property> properties(String name)\n\t{\n\t\treturn filter(p -> p.getName().equals(name) && p instanceof Property)\n\t\t\t\t.stream()\n\t\t\t\t\t.map(e -> (Property) e)\n\t\t\t\t\t.collect(Collectors.toList());\n\t}", "public Set getPropertyNames(){\n return this.vendorSpecificProperties;\n }", "ArrayList<PropertyMetadata> getProperties();", "public static List<String> getProcessorPropertyConfigNames(NifiProperty property) {\n return getConfigPropertyKeysForNiFi(property).stream().map(k -> \"nifi.\" + toPropertyName(StringUtils.substringAfterLast(property.getProcessorType(), \".\") + \".\" +k)).collect(Collectors.toList());\n }", "public String getPropertyName() {\n return this.propertyName;\n }", "public Set<String> keySet() {\n return _properties.keySet();\n }", "public String[] getFieldNames()\n {\n return this.fieldMap.keyArray(String.class);\n }", "public Enumeration enumeratePropertyNames() {\n return this.attributes.keys();\n }", "public Set<String> getNames() {\n\t\t//\t\tArrayList<String> names = new ArrayList<String>();\n\t\t//\t\tfor (NameSSA n : name.values())\n\t\t//\t\t\tnames.add(n.current());\n\t\treturn name.keySet();\n\t}", "public String getPropertyName()\n {\n return propertyName;\n }", "public Set<String> getDeclaredProperties() {\n \t\tfinal Set<String> ret = new HashSet<String>();\n \t\tret.addAll(complexProperties.keySet());\n \t\tret.addAll(simpleProperties.keySet());\n \t\tret.addAll(listProperties.keySet());\n \t\tret.addAll(setProperties.keySet());\n \t\tret.addAll(mapProperties.keySet());\n \t\treturn ret;\n \t}", "java.util.List<org.apache.calcite.avatica.proto.Responses.DatabasePropertyElement> \n getPropsList();", "String[] getPropertyNames(String opName) throws RemoteException;", "List<? extends T> getDeclaredProperties();", "StringMap getProperties();", "public ArrayList<String> getNames() {\n return names;\n }", "public List<NamedThing> getProperties() {\n // TODO this should be changed to AnyProperty type but it as impact everywhere\n List<NamedThing> properties = new ArrayList<>();\n List<Field> propertyFields = getAnyPropertyFields();\n for (Field f : propertyFields) {\n try {\n if (NamedThing.class.isAssignableFrom(f.getType())) {\n f.setAccessible(true);\n Object fValue = f.get(this);\n if (fValue != null) {\n NamedThing se = (NamedThing) fValue;\n properties.add(se);\n } // else not initalized but this is already handled in the initProperties that must be called\n // before the getProperties\n }\n } catch (IllegalAccessException e) {\n throw new TalendRuntimeException(CommonErrorCodes.UNEXPECTED_EXCEPTION, e);\n }\n }\n return properties;\n }", "public String[] getPropertyNames(final String inPrefix) {\n final String[] propertyNames = getPropertyNames();\n\n final String prefix = inPrefix.toLowerCase();\n\n final List<String> names = new ArrayList<>();\n for (final String propertyName : propertyNames) {\n if (propertyName.startsWith(prefix)) {\n names.add(propertyName);\n }\n }\n\n if (names.isEmpty()) {\n return null;\n }\n\n // Copy the strings from the List over to a String array.\n final String[] prefixNames = new String[names.size()];\n names.toArray(prefixNames);\n return prefixNames;\n }", "public String getPropertyName()\n {\n return Integer.toString(getLowNbrParticipants());\n }", "public String[] getNames() {\r\n\t\treturn this.context.getNames();\r\n\t}", "@Nonnull List<String> getNameList();", "public List<String> keysAsString() {\n\t\treturn iter.getItems().stream().map(e -> new String(e)).collect(toList());\n\t}", "public List<IPropertyDescriptor<T>> getProperties();", "public Enumeration getKeys() {\r\n PropertiesHolder propertiesHolder = this.getMergedProperties(Locale.getDefault());\r\n return propertiesHolder.getProperties().keys();\r\n }", "public String getPropName() {\n return m_propName;\n }", "Collection<String> names();", "public Iterator<String> getUserDefinedProperties();", "public String[] getFieldNames();", "public ArrayList<Property> getPropertyList()\r\n {\r\n return m_values;\r\n }", "public Map<String, String> getAllProperties()\n {\n return _propertyEntries;\n }", "public List<String> getPropertyOwners();", "public ImmutableList<String> getVariableNames() {\n return members.stream().map(m -> m.getShortName()).collect(ImmutableList.toImmutableList());\n }", "List<Object> getListProperty(Object name) throws JMSException;", "public Map<String, String> getNames() {\n return names;\n }", "public Set<Property> getProperties() {\r\n\t\treturn properties;\r\n\t}", "public List getAttributeNames() {\n log.debug(\"getAttributeNames()\");\n ResultSet resultSet = attrNST.selectRows(\"name\");\n return resultSet.toStringList(1);\n }", "public cto.framework.service.schema.Property[] getProperty() {\r\n cto.framework.service.schema.Property[] array = new cto.framework.service.schema.Property[0];\r\n return this._propertyList.toArray(array);\r\n }", "List<? extends T> getProperties();", "public static List<String> getGlobalAllProcessorsPropertyConfigNames(NifiProperty property) {\n return getConfigPropertyKeysForNiFi(property).stream().map(k ->\"nifi.all_processors.\" + toPropertyName(k)).collect(Collectors.toList());\n }", "public String[] getNames() {\n Enumeration namesEnum = keys();\n String[] namesArray = new String[size()];\n for (int i = 0; i < size(); i++) {\n namesArray[i] = (String) namesEnum.nextElement();\n }\n return namesArray;\n }", "public abstract List<PropertyType> getBuiltInProperties();", "public String [] getNames () { \n return this.listAttributes(); \n }", "static public Vector getPropertyValues (Properties props, String propName)\n{\n String propertyDelimiterName = \"property.token.delimiter\";\n String delimiter = props.getProperty (propertyDelimiterName, \"::\");\n\n String listStartTokenName = \"list.startToken\";\n String listStartToken = props.getProperty (listStartTokenName, \"(\");\n\n String listEndTokenName = \"list.endToken\";\n String listEndToken = props.getProperty (listEndTokenName, \")\");\n\n Vector result = new Vector ();\n String propString = props.getProperty (propName);\n if (propString == null)\n return result;\n String propStringTrimmed = propString.trim ();\n String [] tokens = Misc.parseList (propStringTrimmed, listStartToken, listEndToken, delimiter);\n\n for (int i=0; i < tokens.length; i++)\n result.add (tokens [i]);\n\n return result;\n\n}", "@Override\n\tpublic StringList getNames() {\n\t\tStringList ss = new StringList();\n\t\tss.add(\"java\");\n\t\treturn ss;\n\t}", "public Stream<String> getNames() {\n return names.stream();\n }", "public String[] listObjectNames(String path);", "public Enumeration<String> getPersonList() {\r\n\t\treturn this.persons.keys();\r\n\t}", "public ArrayList<String> getUnRequestedProperties()\n\t{\n\t\tArrayList<String> urp = new ArrayList<String>();\n\t\tfor (Object property : super.keySet())\n\t\t\tif (!requestedProperties.containsKey(((String)property).trim()))\n\t\t\t\turp.add(((String)property).trim());\n\t\tCollections.sort(urp);\n\t\treturn urp;\n\t}", "protected String getPropertyStrings() {\n\t\treturn \"Active:\" + activeProperty().getValue() + \", FromDataset:\" + isFromDataset() + \", Modified:\" + isModified();\n\t}", "@Transient\n\tpublic List<String> getRoleNames()\n\t{\n\t\tList<String> roleNames = new ArrayList<String>();\n\t\t\n\t\tfor (Role role : getRoles())\n\t\t{\n\t\t\troleNames.add(role.getRolename());\n\t\t}\n\t\t\n\t\treturn roleNames;\n\t}", "public String[] sortedStringKeys() {\n Set<String> keys = stringPropertyNames();\n String[] os = keys.toArray(new String[0]);\n Arrays.sort(os);\n return os;\n }", "PropertyName getName();", "protected String getPropertyName(){\n return propertyName;\n }", "List<String> getKeys();", "public String[] getNames() {\r\n\t\tfinal List<String> names=new ArrayList<>();\r\n\r\n\t\tString s;\r\n\t\tfor (Map.Entry<String,Map<String,Object>> entry1: data.entrySet()) {\r\n\t\t\ts=entry1.getKey();\r\n\t\t\tif (names.indexOf(s)<0) names.add(s);\r\n\t\t\tfor (Map.Entry<String,Object> entry2: entry1.getValue().entrySet()) {\r\n\t\t\t\ts=entry2.getKey();\r\n\t\t\t\tif (names.indexOf(s)<0) names.add(s);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn names.toArray(new String[0]);\r\n\t}", "public static synchronized List getFieldNames()\n {\n if (fieldNames == null)\n {\n fieldNames = new ArrayList();\n fieldNames.add(\"NewsletterId\");\n fieldNames.add(\"NewsletterCode\");\n fieldNames.add(\"Status\");\n fieldNames.add(\"Priority\");\n fieldNames.add(\"IssuedDate\");\n fieldNames.add(\"ClosedDate\");\n fieldNames.add(\"SentTime\");\n fieldNames.add(\"EmailFormat\");\n fieldNames.add(\"LanguageId\");\n fieldNames.add(\"CustomerCatId\");\n fieldNames.add(\"CustomerType\");\n fieldNames.add(\"CustLanguageId\");\n fieldNames.add(\"CustCountryId\");\n fieldNames.add(\"RelDocument\");\n fieldNames.add(\"RelDocStatus\");\n fieldNames.add(\"RelProjectId\");\n fieldNames.add(\"RelProductId\");\n fieldNames.add(\"ProjectId\");\n fieldNames.add(\"ProductId\");\n fieldNames.add(\"Subject\");\n fieldNames.add(\"Body\");\n fieldNames.add(\"Notes\");\n fieldNames.add(\"Created\");\n fieldNames.add(\"Modified\");\n fieldNames.add(\"CreatedBy\");\n fieldNames.add(\"ModifiedBy\");\n fieldNames = Collections.unmodifiableList(fieldNames);\n }\n return fieldNames;\n }", "@Override\n public java.lang.Object getNames() throws G2AccessException {\n java.lang.Object retnValue = getAttributeValue (SystemAttributeSymbols.NAMES_);\n return (java.lang.Object)retnValue;\n }", "@Override\n\tpublic List<Property> findAll() {\n\t\treturn pr.findAll();\n\t}", "public Set<String> getFieldNames ()\n\t{\n\t\treturn m_Fields.keySet();\n\t}", "Set<String> getNames();", "public Set<String> getModifiedPropertyNames() {\r\n return _modifiedProperties.getPropertyNames();\r\n }", "public Set<String> getModifiedPropertyNames() {\r\n return _modifiedProperties.getPropertyNames();\r\n }", "public Set<String> getModifiedPropertyNames() {\r\n return _modifiedProperties.getPropertyNames();\r\n }", "@Override\n protected Collection<String> getExpectedPropertyNames() {\n return new ArrayList<String>();\n }", "public String[] getNames() {\n\t\tString[] names = new String[functions.size()];\n\t\tint index = 0;\n\t\tfor (Enumeration en = functions.keys(); en.hasMoreElements(); index++) {\n\t\t\tnames[index] = (String) en.nextElement();\n\t\t}\n\t\treturn names;\n\t}" ]
[ "0.86516935", "0.8547107", "0.85068405", "0.8363414", "0.8285723", "0.82384443", "0.78645825", "0.78547317", "0.779694", "0.76242816", "0.7610533", "0.75976765", "0.74918544", "0.72689235", "0.72570145", "0.72068894", "0.719319", "0.7085782", "0.70228696", "0.7008102", "0.69349444", "0.69299537", "0.6830563", "0.68120134", "0.6779151", "0.67640424", "0.6760864", "0.67559695", "0.6731414", "0.6696968", "0.6683798", "0.668299", "0.6672746", "0.6668407", "0.6663433", "0.6655354", "0.66531277", "0.6651939", "0.6644736", "0.6603463", "0.6558126", "0.65511775", "0.65211195", "0.65185374", "0.6488047", "0.64653385", "0.64556015", "0.6447126", "0.64417124", "0.64331436", "0.6379708", "0.63775253", "0.6369481", "0.6362474", "0.63540834", "0.6328367", "0.6320852", "0.6319907", "0.63059604", "0.63049465", "0.63034225", "0.62933743", "0.62889594", "0.627674", "0.62696844", "0.6259043", "0.625857", "0.6252459", "0.6239179", "0.6229457", "0.6226343", "0.6202878", "0.61994636", "0.6186652", "0.61860496", "0.6184459", "0.618222", "0.61567736", "0.61560315", "0.61517227", "0.6148402", "0.6126731", "0.61243963", "0.6118103", "0.60959995", "0.60840577", "0.6083928", "0.60820097", "0.6081492", "0.607551", "0.6053437", "0.6032277", "0.60303605", "0.6022796", "0.6018839", "0.60019076", "0.6001768", "0.6001768", "0.6001768", "0.5999725", "0.599845" ]
0.0
-1
Set up the list of property names.
public void setTypeDefProperties(Map<String, Object> typeDefProperties) { this.typeDefProperties = typeDefProperties; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setPropNames(ArrayList<String> props)\n {\n this.prop_names = props;\n fireTableDataChanged();\n }", "protected final void addPropNames(String ... theNames) { Collections.addAll(getPropertyNames(), theNames); }", "public void setProperties(String prefix, Properties setList);", "public void setupProperties() {\n // left empty for subclass to override\n }", "protected void addPropNames()\n{\n addPropNames(\"Visible\", \"X\", \"Y\", \"Width\", \"Height\", \"Roll\", \"ScaleX\", \"ScaleY\",\n \"Font\", \"TextColor\", \"FillColor\", \"StrokeColor\", \"URL\");\n}", "@Override\n public String[] getPropertyNames() {\n final String[] names = new String[this.properties.size()];\n this.properties.keySet().toArray(names);\n return names;\n }", "public String[] getPropertyNames();", "public ArrayList<String> getPropNames()\n {\n return this.prop_names;\n }", "void initProperties()\n\t{\n\t\tpropertyPut(LIST_SIZE, 10);\n\t\tpropertyPut(LIST_LINE, 1);\n\t\tpropertyPut(LIST_MODULE, 1); // default to module #1\n\t\tpropertyPut(COLUMN_WIDTH, 70);\n\t\tpropertyPut(UPDATE_DELAY, 25);\n\t\tpropertyPut(HALT_TIMEOUT, 7000);\n\t\tpropertyPut(BPNUM, 0);\t\t\t\t// set current breakpoint number as something bad\n\t\tpropertyPut(LAST_FRAME_DEPTH, 0);\t\t// used to determine how much context information should be displayed\n\t\tpropertyPut(CURRENT_FRAME_DEPTH, 0); // used to determine how much context information should be displayed\n\t\tpropertyPut(DISPLAY_FRAME_NUMBER, 0); // houses the current frame we are viewing\n\t\tpropertyPut(FILE_LIST_WRAP, 999999); // default 1 file name per line\n\t\tpropertyPut(NO_WAITING, 0);\n\t\tpropertyPut(INFO_STACK_SHOW_THIS, 1); // show this pointer for info stack\n\t}", "public Set getPropertyNames(){\n return this.vendorSpecificProperties;\n }", "public synchronized Enumeration<String> getPropertyNames() {\n return PropertyArray.enumerate(props);\n }", "public String[] getPropertyNames()\n\t{\n\t\treturn _propertyNames;\n\t}", "public void setNameValueProperty(List<NameValueProperty> nameValueProperty) {\n\t\tthis.nameValuePropertyList = nameValueProperty;\n\t}", "public void setUp() {\r\n name1 = new Name(\"A\", \"B\");\r\n name2 = new Name(\"John\", \"Smith\", \"William\");\r\n name3 = new Name(\"Mary\", \"Will\");\r\n name4 = new Name(\"William\", \"Will\");\r\n }", "private static void initializeNames() {\n _names.add(\"Raymond\");\n _names.add(\"Mia\");\n _names.add(\"Maximus\");\n _names.add(\"Thomas\");\n _names.add(\"Candice\");\n\n _names.add(\"Maggie\");\n _names.add(\"Grant\");\n _names.add(\"Joni\");\n _names.add(\"Shirley\");\n _names.add(\"Alaska\");\n\n _names.add(\"Alice\");\n _names.add(\"Bob\");\n _names.add(\"Clark\");\n _names.add(\"Bill\");\n _names.add(\"Mike\");\n\n _names.add(\"Sara\");\n _names.add(\"Jim\");\n _names.add(\"Laura\");\n _names.add(\"Steve\");\n _names.add(\"Chris\");\n }", "public List <String> getPropertyNames()\n{\n // Get list from PropertyNamesMap - load if not found\n List <String> list = _propertyNamesMap.get(getClass());\n if(list==null) {\n _propertyNamesMap.put(getClass(), list = new ArrayList()); addPropNames(); }\n return list;\n}", "java.util.Enumeration getPropertyNames();", "private static String createNameForProperty(String prop) {\r\n if (prop == null)\r\n return \"property\";\r\n String theProp = prop;\r\n\r\n // remove last \"AnimationProperties\"\r\n if (theProp.length() > 10\r\n && theProp.substring(theProp.length() - 10).equalsIgnoreCase(\r\n \"properties\"))\r\n theProp = theProp.substring(0, theProp.length() - 10);\r\n // first char is lowercase\r\n if (theProp.length() > 0)\r\n theProp = theProp.toLowerCase().charAt(0) + theProp.substring(1);\r\n return theProp;\r\n }", "public EJCoreFrameworkExtensionPropertyListEntry()\n {\n _propertyEntries = new HashMap<String, String>();\n }", "public void setProperties(Properties setList);", "private static HashMap<String, DefinedProperty> initDefinedProperties() {\n\t\tHashMap<String, DefinedProperty> newList = new HashMap<String, DefinedProperty>();\n\t\t// common properties\n\t\taddProperty(newList, \"name\", DefinedPropertyType.STRING, \"\", DefinedProperty.ANY, false, false);\n\t\taddProperty(newList, \"desc\", DefinedPropertyType.STRING, \"\", DefinedProperty.ANY, false, false);\n\t\t// implicit default properties\n\t\taddProperty(newList, \"donttest\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.ANY, false, false);\n\t\taddProperty(newList, \"dontcompare\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.ANY, false, false);\n\t\t// interface properties\n\t\taddProperty(newList, \"use_interface\", DefinedPropertyType.STRING, \"\", DefinedProperty.REGSET | DefinedProperty.REG |DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"use_new_interface\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.REGSET | DefinedProperty.REG |DefinedProperty.FIELD, false, false);\n\t\t// reg + regset properties\n\t\taddProperty(newList, \"js_superset_check\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.REGSET | DefinedProperty.REG, false, false);\n\t\taddProperty(newList, \"external\", DefinedPropertyType.SPECIAL, null, DefinedProperty.REGSET | DefinedProperty.REG, false, false);\n\t\taddProperty(newList, \"repcount\", DefinedPropertyType.NUMBER, \"1\", DefinedProperty.REGSET | DefinedProperty.REG, true, false); // hidden\n\t\t// regset only properties\n\t\taddProperty(newList, \"js_macro_name\", DefinedPropertyType.STRING, \"\", DefinedProperty.REGSET, false, false);\n\t\taddProperty(newList, \"js_macro_mode\", DefinedPropertyType.STRING, \"STANDARD\", DefinedProperty.REGSET, false, false);\n\t\taddProperty(newList, \"js_namespace\", DefinedPropertyType.STRING, \"\", DefinedProperty.REGSET, false, false);\n\t\taddProperty(newList, \"js_typedef_name\", DefinedPropertyType.STRING, \"\", DefinedProperty.REGSET, false, false);\n\t\taddProperty(newList, \"js_instance_name\", DefinedPropertyType.STRING, \"\", DefinedProperty.REGSET, false, false);\n\t\taddProperty(newList, \"js_instance_repeat\", DefinedPropertyType.NUMBER, \"1\", DefinedProperty.REGSET, false, false);\n\t\t// reg only properties\n\t\taddProperty(newList, \"category\", DefinedPropertyType.STRING, \"\", DefinedProperty.REG, false, false);\n\t\taddProperty(newList, \"js_attributes\", DefinedPropertyType.STRING, \"false\", DefinedProperty.REG, false, false);\n\t\taddProperty(newList, \"aliasedId\", DefinedPropertyType.STRING, \"false\", DefinedProperty.REG, true, false); // hidden\n\t\taddProperty(newList, \"regwidth\", DefinedPropertyType.NUMBER, \"32\", DefinedProperty.REG, false, false);\n\t\taddProperty(newList, \"uvmreg_is_mem\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.REG, false, false);\n\t\taddProperty(newList, \"cppmod_prune\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.REG, false, false);\n\t\taddProperty(newList, \"uvmreg_prune\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.REG, false, false);\n\t\t// signal properties\n\t\taddProperty(newList, \"cpuif_reset\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.SIGNAL, false, false);\n\t\taddProperty(newList, \"field_reset\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.SIGNAL, false, false);\n\t\taddProperty(newList, \"activehigh\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.SIGNAL, false, false);\n\t\taddProperty(newList, \"activelow\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.SIGNAL, false, false);\n\t\taddProperty(newList, \"signalwidth\", DefinedPropertyType.NUMBER, \"1\", DefinedProperty.SIGNAL, false, false);\n\t\t// fieldset only properties\n\t\taddProperty(newList, \"fieldstructwidth\", DefinedPropertyType.NUMBER, \"1\", DefinedProperty.FIELDSET, false, false);\n\t\t// field properties\n\t\taddProperty(newList, \"rset\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"rclr\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"woclr\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"woset\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"we\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"wel\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"swwe\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"swwel\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"hwset\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"hwclr\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"swmod\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"swacc\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"sticky\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"stickybit\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"intr\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"anded\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"ored\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"xored\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"counter\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"overflow\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"reset\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"fieldwidth\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"singlepulse\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"underflow\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"incr\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"decr\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"incrwidth\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"decrwidth\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"incrvalue\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"decrvalue\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"saturate\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"incrsaturate\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"decrsaturate\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"threshold\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"incrthreshold\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"decrthreshold\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"sw\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"hw\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"precedence\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"encode\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"resetsignal\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"mask\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"enable\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"haltmask\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"haltenable\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"halt\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"next\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"nextposedge\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"nextnegedge\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"maskintrbits\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false); \n\t\taddProperty(newList, \"satoutput\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"sub_category\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\taddProperty(newList, \"rtl_coverage\", DefinedPropertyType.BOOLEAN, \"false\", DefinedProperty.FIELD, false, false);\n\t\t\n\t\t// override allowed property set if input type is jspec\n\t\tif (Ordt.hasInputType(Ordt.InputType.JSPEC)) {\n\t\t\tputProperty(newList, \"sub_category\", DefinedPropertyType.STRING, \"\", DefinedProperty.REGSET | DefinedProperty.REG | DefinedProperty.FIELDSET | DefinedProperty.FIELD, false, false);\n\t\t\tputProperty(newList, \"category\", DefinedPropertyType.STRING, \"\", DefinedProperty.REGSET | DefinedProperty.REG, false, false);\n\t\t\tputProperty(newList, \"js_attributes\", DefinedPropertyType.STRING, \"\", DefinedProperty.REGSET | DefinedProperty.REG, false, false);\n\t\t\tputProperty(newList, \"regwidth\", DefinedPropertyType.NUMBER, \"32\", DefinedProperty.REGSET | DefinedProperty.REG, false, false);\n\t\t\tputProperty(newList, \"address\", DefinedPropertyType.NUMBER, null, DefinedProperty.REGSET | DefinedProperty.REG, false, false);\n\t\t\tputProperty(newList, \"arrayidx1\", DefinedPropertyType.NUMBER, null, DefinedProperty.REGSET | DefinedProperty.REG, true, false); // hidden\n\t\t\tputProperty(newList, \"addrinc\", DefinedPropertyType.NUMBER, null, DefinedProperty.REGSET | DefinedProperty.REG, true, false); // hidden\n\t\t}\t\t\n\n\t\treturn newList;\n\t}", "public void initProperties() {\n propAssetClass = addProperty(AssetComponent.PROP_CLASS, \"MilitaryOrganization\");\n propAssetClass.setToolTip(PROP_CLASS_DESC);\n propUniqueID = addProperty(AssetComponent.PROP_UID, \"UTC/RTOrg\");\n propUniqueID.setToolTip(PROP_UID_DESC);\n propUnitName = addProperty(AssetComponent.PROP_UNITNAME, \"\");\n propUnitName.setToolTip(PROP_UNITNAME_DESC);\n propUIC = addProperty(PROP_UIC, \"\");\n propUIC.setToolTip(PROP_UIC_DESC);\n }", "@SuppressWarnings(\"checkstyle:avoidinlineconditionals\")\n private static void setUpNameList() {\n List<String> names = new ArrayList<>();\n String verb;\n String noun;\n for (int i = 0; i < NUMBER_OF_NAMES; i++) {\n verb = GenerationHelper.randomElement(verbs);\n noun = GenerationHelper.randomElement(nouns);\n String taskName = verb;\n taskName += \"aeiou\".contains(noun.subSequence(0, 1)) ? \" an \" : \" a \";\n taskName += noun;\n names.add(Character.toUpperCase(taskName.charAt(0)) + taskName.substring(1));\n }\n taskNames = new String[names.size()];\n names.toArray(taskNames);\n }", "public void setMembers( List<String> list )\r\n {\r\n specifiedMembers = new ArrayList<Dependency>();\r\n for ( String str: list )\r\n {\r\n Member member = null;\r\n int index = str.lastIndexOf( '.' );\r\n String className = str.substring( 0, index );\r\n String memberName = str.substring( index + 1 );\r\n Class<?> clazz = createClass( className );\r\n if ( memberName.endsWith( \"()\" ) )\r\n {\r\n memberName = memberName.substring( 0, memberName.lastIndexOf( \"()\" ) );\r\n member = findSimpleSetterMethod( clazz, memberName );\r\n }\r\n else\r\n {\r\n member = findField( clazz, memberName );\r\n }\r\n specifiedMembers.add( createDependency( member, \"\" ) );\r\n }\r\n }", "@Override\n\tpublic void addProperty(String name) {\n\t}", "public void setPropName(String name) {\n m_propName = name;\n }", "@Override\n\t\tpublic Iterable<String> getPropertyKeys() {\n\t\t\treturn null;\n\t\t}", "protected abstract String getPropertyPrefix();", "public Enumeration getPropertyNames() {\r\n return properties.keys();\r\n }", "void addProperties(Map<String, Object> propertiesListInput) {\n for (Map.Entry<String, Object> e : propertiesListInput.entrySet()) {\n if (properties.getProperty(e.getKey()) == null) {\n properties.addProperty(e.getKey(), e.getValue());\n }\n }\n }", "void setupPropertiesPostDeserialization() {\n initLayout();\n List<NamedThing> properties = getProperties();\n for (NamedThing prop : properties) {\n if (prop instanceof Properties) {\n ((Properties) prop).setupPropertiesPostDeserialization();\n } else {\n prop.setI18nMessageFormater(getI18nMessageFormater());\n }\n }\n\n }", "@Override\n protected Collection<String> getExpectedPropertyNames() {\n return new ArrayList<String>();\n }", "private void addProperties() {\n\t\tfor (PropertyGenerator pg : this.getPropertyGenerators()) {\n\t\t\tpg.generate();\n\t\t\tthis.enqueuePropertyTypeIfNeeded(pg);\n\t\t\tthis.addToSubBindingsIfNeeded(pg);\n\t\t}\n\t}", "static final String[] makePropertyNames(Object names[]) {\n String[] sn = new String[ names.length ];\n for (int i = 0; i < sn.length; i++) {\n sn[i] = (names[i] instanceof Named) ? \n ((Named) names[i]).getName() : (String) names[i];\n }\n return sn;\n }", "public void setPropertyPrefix(String prefix);", "public void populate(java.util.Map properties) throws LexComponentException;", "private void parseProperties()\n {\n List children = rootElement.getChildren(\"property\");\n\n for (Object aChildren : children)\n {\n Element child = (Element) aChildren;\n Property property = new Property(child, properties, this);\n }\n }", "public void addNames() {}", "public void addNames() {}", "public void setProperties(Map<String, List<String>> properties) {\n\t\tthis.properties = properties;\n\t}", "protected void sequence_PropertyName(ISerializationContext context, PropertyName semanticObject) {\n\t\tgenericSequencer.createSequence(context, semanticObject);\n\t}", "protected String getPropertyName(){\n return propertyName;\n }", "public void setToDoListTitles() {\n\n ArrayList<String> toDoListTitlesSetter = new ArrayList<String>();\n for (int i = 0; i < myList.size(); i++) {\n toDoListTitlesSetter.add(myList.get(i).get(0));\n }\n toDoListTitlesTemp.clear();\n for(int i = 0; i < toDoListTitlesSetter.size(); i++){\n toDoListTitlesTemp.add(toDoListTitlesSetter.get(i));\n }\n\n Log.i(TAG, \"we have set the list titles\");\n }", "private static Properties createLoaderProperties(String inPrefix) {\r\n Properties props = new Properties();\r\n props.setProperty(inPrefix + \"Property1\", \"Value1Prop\");\r\n props.setProperty(inPrefix + \"Property2\", \"Value2Prop\");\r\n return props;\r\n }", "private void initializePropertySubstitution() {\n log.debug(\"Initializing property substitution\");\r\n String discoveryBundleName = discoveryBootstrapService.getSymbolicBundleName();\r\n DiscoveryConfiguration discoveryConfiguration = getConfiguration(discoveryBundleName, DiscoveryConfiguration.class);\r\n\r\n // initialize discovery; may start a local discovery server and/or query existing servers\r\n Map<String, String> discoveryProperties = discoveryBootstrapService.initializeDiscovery(discoveryConfiguration);\r\n\r\n // register the properties learned from discovery (if any) under the \"discovery\" namespace\r\n this.addSubstitutionProperties(\"discovery\", discoveryProperties);\r\n }", "protected void setProperties(P[] properties) {\n\t\tthis.properties = properties;\n\t}", "void setListProperty(Object name, List<Object> list) throws JMSException;", "public Iterable<String> getPropertyKeys();", "private final Properties parseProperties(List<?> list) {\r\n\t\tProperties properties = new Properties();\r\n\t\tfor (Object o : list) {\r\n\t\t\tElement element = (Element) o;\r\n\t\t\tproperties.put(element.attributeValue(\"name\"), element.attributeValue(\"value\"));\r\n\t\t}\r\n\t\treturn properties;\r\n\t}", "private void addProperties() {\n\n\t\t/**\n\t\t * Add fusion.conf = src/test/resource\n\t\t */\n\t\tif (isPropertyRequired(\"fusion.conf.dir\")) {\n\t\t\texpect(bundleContextMock.getProperty(\"fusion.conf.dir\")).andReturn(\n\t\t\t\t\t\"src/test/resources/\").anyTimes();\n\t\t}\n\t\t/**\n\t\t * set fusion.process.dir\n\t\t */\n\t\tif (isPropertyRequired(\"fusion.process.dir\")) {\n\t\t\texpect(bundleContextMock.getProperty(\"fusion.process.dir\"))\n\t\t\t\t\t.andReturn(\"src/test/resources/\").anyTimes();\n\t\t}\n\n\t\t/**\n\t\t * set fusion.process.temp\n\t\t */\n\t\tif (isPropertyRequired(\"fusion.process.temp.dir\")) {\n\t\t\texpect(bundleContextMock.getProperty(\"fusion.process.temp.dir\"))\n\t\t\t\t\t.andReturn(\"src/test/resources/\").anyTimes();\n\t\t}\n\n\t\t/**\n\t\t * set fusion.home\n\t\t */\n\t\tif (isPropertyRequired(\"fusion.home\")) {\n\t\t\texpect(bundleContextMock.getProperty(\"fusion.home\")).andReturn(\n\t\t\t\t\t\"src/test/resources/\").anyTimes();\n\t\t}\n\t}", "@Override\r\n\tpublic void setProperty(Properties prop) {\n\t}", "String[] getPropertyKeys();", "public void addProperties( Properties props )\n {\n if ( props != null )\n {\n for ( Enumeration<?> e = props.propertyNames(); e.hasMoreElements(); )\n {\n // This LDAP attr is stored as a name-value pair separated by a ':'.\n String key = ( String ) e.nextElement();\n String val = props.getProperty( key );\n addProperty( key, val );\n }\n }\n }", "public static PropertyDescriptionBuilder<List<String>> listOfStringsProperty(String name) {\n // Trick to work-around type erasure\n // https://stackoverflow.com/a/30754982/2535153\n @SuppressWarnings(\"unchecked\")\n Class<List<String>> clazz = (Class<List<String>>)(Class<?>)List.class;\n return PropertyDescriptionBuilder.start(name, clazz, Parsers.parseList(Parsers::parseString));\n }", "public void setPropertyName (String propertyName) {\n\t\tthis.propertyName=propertyName;\n\t}", "protected static void initPropertyKey() {\n String path = URL_PREFIX + SCHEMA_PKS;\n\n createAndAssert(path, \"{\\n\"\n + \"\\\"name\\\": \\\"name\\\",\\n\"\n + \"\\\"data_type\\\": \\\"TEXT\\\",\\n\"\n + \"\\\"cardinality\\\": \\\"SINGLE\\\",\\n\"\n + \"\\\"check_exist\\\": false,\\n\"\n + \"\\\"properties\\\":[]\\n\"\n + \"}\", 202);\n createAndAssert(path, \"{\\n\"\n + \"\\\"name\\\": \\\"age\\\",\\n\"\n + \"\\\"data_type\\\": \\\"INT\\\",\\n\"\n + \"\\\"cardinality\\\": \\\"SINGLE\\\",\\n\"\n + \"\\\"check_exist\\\": false,\\n\"\n + \"\\\"properties\\\":[]\\n\"\n + \"}\", 202);\n createAndAssert(path, \"{\\n\"\n + \"\\\"name\\\": \\\"city\\\",\\n\"\n + \"\\\"data_type\\\": \\\"TEXT\\\",\\n\"\n + \"\\\"cardinality\\\": \\\"SINGLE\\\",\\n\"\n + \"\\\"check_exist\\\": false,\\n\"\n + \"\\\"properties\\\":[]\\n\"\n + \"}\", 202);\n createAndAssert(path, \"{\\n\"\n + \"\\\"name\\\": \\\"lang\\\",\\n\"\n + \"\\\"data_type\\\": \\\"TEXT\\\",\\n\"\n + \"\\\"cardinality\\\": \\\"SINGLE\\\",\\n\"\n + \"\\\"check_exist\\\": false,\\n\"\n + \"\\\"properties\\\":[]\\n\"\n + \"}\", 202);\n createAndAssert(path, \"{\\n\"\n + \"\\\"name\\\": \\\"date\\\",\\n\"\n + \"\\\"data_type\\\": \\\"TEXT\\\",\\n\"\n + \"\\\"cardinality\\\": \\\"SINGLE\\\",\\n\"\n + \"\\\"check_exist\\\": false,\\n\"\n + \"\\\"properties\\\":[]\\n\"\n + \"}\", 202);\n createAndAssert(path, \"{\\n\"\n + \"\\\"name\\\": \\\"price\\\",\\n\"\n + \"\\\"data_type\\\": \\\"INT\\\",\\n\"\n + \"\\\"cardinality\\\": \\\"SINGLE\\\",\\n\"\n + \"\\\"check_exist\\\": false,\\n\"\n + \"\\\"properties\\\":[]\\n\"\n + \"}\", 202);\n createAndAssert(path, \"{\\n\"\n + \"\\\"name\\\": \\\"weight\\\",\\n\"\n + \"\\\"data_type\\\": \\\"DOUBLE\\\",\\n\"\n + \"\\\"cardinality\\\": \\\"SINGLE\\\",\\n\"\n + \"\\\"check_exist\\\": false,\\n\"\n + \"\\\"properties\\\":[]\\n\"\n + \"}\", 202);\n }", "@Override\r\n\tpublic void setSortProperties(List<? extends ISortProperty> sortProperties) {\n\t\t\r\n\t}", "@Override\n public void loadFromProperties(PropertiesWrapper properties) {\n\n useForeignKeyPrefix = properties.getBoolean(\"namingConvention.useForeignKeyPrefix\", useForeignKeyPrefix);\n sequenceFormat = properties.get(\"namingConvention.sequenceFormat\", sequenceFormat);\n schema = properties.get(\"namingConvention.schema\", schema);\n }", "@Override\r\n\tpublic void setProperties(Properties properties) \r\n\t{\n\t}", "@Override\r\n\tpublic void setProperties(Properties properties) {\n\t\t\r\n\t}", "public static List<String> getProcessorNamePropertyConfigNames(NifiProperty property) {\n\n return getConfigPropertyKeysForNiFi(property).stream().map(k -> \"nifi.\" + toPropertyName(StringUtils.substringAfterLast(property.getProcessorType(), \".\") + \"[\"+property.getProcessorName()+\"].\" + k)).collect(Collectors.toList());\n }", "@Override\n public void afterPropertiesSet() {\n }", "public final List<String> getPropertiesList()\n {\n\n List<String> allProps = new ArrayList<String>();\n Enumeration<?> e = this.fProp.propertyNames();\n\n while (e.hasMoreElements())\n {\n String key = (String) e.nextElement();\n String value = this.fProp.getProperty(key);\n allProps.add(key + \"=\" + value);\n } // end while\n\n Collections.sort(allProps);\n return allProps;\n\n }", "public void setProperties(Properties properties);", "@Override\n protected void updateProperties() {\n }", "protected void fillMapFromProperties(Properties props)\n {\n Enumeration<?> en = props.propertyNames();\n\n while (en.hasMoreElements())\n {\n String propName = (String) en.nextElement();\n\n // ignore map, pattern_map; they are handled separately\n if (!propName.startsWith(\"map\") &&\n !propName.startsWith(\"pattern_map\"))\n {\n String propValue = props.getProperty(propName);\n String fieldDef[] = new String[4];\n fieldDef[0] = propName;\n fieldDef[3] = null;\n if (propValue.startsWith(\"\\\"\"))\n {\n // value is a constant if it starts with a quote\n fieldDef[1] = \"constant\";\n fieldDef[2] = propValue.trim().replaceAll(\"\\\"\", \"\");\n }\n else\n // not a constant\n {\n // split it into two pieces at first comma or space\n String values[] = propValue.split(\"[, ]+\", 2);\n if (values[0].startsWith(\"custom\") || values[0].equals(\"customDeleteRecordIfFieldEmpty\") ||\n values[0].startsWith(\"script\"))\n {\n fieldDef[1] = values[0];\n\n // parse sections of custom value assignment line in\n // _index.properties file\n String lastValues[];\n // get rid of empty parens\n if (values[1].indexOf(\"()\") != -1)\n values[1] = values[1].replace(\"()\", \"\");\n\n // index of first open paren after custom method name\n int parenIx = values[1].indexOf('(');\n\n // index of first unescaped comma after method name\n int commaIx = Utils.getIxUnescapedComma(values[1]);\n\n if (parenIx != -1 && commaIx != -1 && parenIx < commaIx) {\n // remainder should be split after close paren\n // followed by comma (optional spaces in between)\n lastValues = values[1].trim().split(\"\\\\) *,\", 2);\n\n // Reattach the closing parenthesis:\n if (lastValues.length == 2) lastValues[0] += \")\";\n }\n else\n // no parens - split comma preceded by optional spaces\n lastValues = values[1].trim().split(\" *,\", 2);\n\n fieldDef[2] = lastValues[0].trim();\n\n fieldDef[3] = lastValues.length > 1 ? lastValues[1].trim() : null;\n // is this a translation map?\n if (fieldDef[3] != null && fieldDef[3].contains(\"map\"))\n {\n try\n {\n fieldDef[3] = loadTranslationMap(props, fieldDef[3]);\n }\n catch (IllegalArgumentException e)\n {\n logger.error(\"Unable to find file containing specified translation map (\" + fieldDef[3] + \")\");\n throw new IllegalArgumentException(\"Error: Problems reading specified translation map (\" + fieldDef[3] + \")\");\n }\n }\n } // end custom\n else if (values[0].equals(\"xml\") ||\n values[0].equals(\"raw\") ||\n values[0].equals(\"date\") ||\n values[0].equals(\"json\") ||\n values[0].equals(\"json2\") ||\n values[0].equals(\"index_date\") ||\n values[0].equals(\"era\"))\n {\n fieldDef[1] = \"std\";\n fieldDef[2] = values[0];\n fieldDef[3] = values.length > 1 ? values[1].trim() : null;\n // NOTE: assuming no translation map here\n if (fieldDef[2].equals(\"era\") && fieldDef[3] != null)\n {\n try\n {\n fieldDef[3] = loadTranslationMap(props, fieldDef[3]);\n }\n catch (IllegalArgumentException e)\n {\n logger.error(\"Unable to find file containing specified translation map (\" + fieldDef[3] + \")\");\n throw new IllegalArgumentException(\"Error: Problems reading specified translation map (\" + fieldDef[3] + \")\");\n }\n }\n }\n else if (values[0].equalsIgnoreCase(\"FullRecordAsXML\") ||\n values[0].equalsIgnoreCase(\"FullRecordAsMARC\") ||\n values[0].equalsIgnoreCase(\"FullRecordAsJson\") ||\n values[0].equalsIgnoreCase(\"FullRecordAsJson2\") ||\n values[0].equalsIgnoreCase(\"FullRecordAsText\") ||\n values[0].equalsIgnoreCase(\"DateOfPublication\") ||\n values[0].equalsIgnoreCase(\"DateRecordIndexed\"))\n {\n fieldDef[1] = \"std\";\n fieldDef[2] = values[0];\n fieldDef[3] = values.length > 1 ? values[1].trim() : null;\n // NOTE: assuming no translation map here\n }\n else if (values.length == 1)\n {\n fieldDef[1] = \"all\";\n fieldDef[2] = values[0];\n fieldDef[3] = null;\n }\n else\n // other cases of field definitions\n {\n String values2[] = values[1].trim().split(\"[ ]*,[ ]*\", 2);\n fieldDef[1] = \"all\";\n if (values2[0].equals(\"first\") ||\n (values2.length > 1 && values2[1].equals(\"first\")))\n fieldDef[1] = \"first\";\n\n if (values2[0].startsWith(\"join\"))\n fieldDef[1] = values2[0];\n\n if ((values2.length > 1 && values2[1].startsWith(\"join\")))\n fieldDef[1] = values2[1];\n\n if (values2[0].equalsIgnoreCase(\"DeleteRecordIfFieldEmpty\") ||\n (values2.length > 1 && values2[1].equalsIgnoreCase(\"DeleteRecordIfFieldEmpty\")))\n fieldDef[1] = \"DeleteRecordIfFieldEmpty\";\n\n fieldDef[2] = values[0];\n fieldDef[3] = null;\n\n // might we have a translation map?\n if (!values2[0].equals(\"all\") &&\n !values2[0].equals(\"first\") &&\n !values2[0].startsWith(\"join\") &&\n !values2[0].equalsIgnoreCase(\"DeleteRecordIfFieldEmpty\"))\n {\n fieldDef[3] = values2[0].trim();\n if (fieldDef[3] != null)\n {\n try\n {\n fieldDef[3] = loadTranslationMap(props, fieldDef[3]);\n }\n catch (IllegalArgumentException e)\n {\n logger.error(\"Unable to find file containing specified translation map (\" + fieldDef[3] + \")\");\n throw new IllegalArgumentException(\"Error: Problems reading specified translation map (\" + fieldDef[3] + \")\");\n }\n }\n }\n } // other cases of field definitions\n\n } // not a constant\n\n fieldMap.put(propName, fieldDef);\n\n } // if not map or pattern_map\n\n } // while enumerating through property names\n\n // verify that fieldMap is valid\n verifyCustomMethodsAndTransMaps();\n }", "void setUpPlayerNames() {\n playerName.setText(this.player1.getName());\n computerName.setText(this.computer.getName());\n }", "public String getPropertyName()\n {\n return propertyName;\n }", "public Set<String> getStringPropertyNames();", "@Before\r\n\tpublic void setList() {\r\n\t\tthis.list = new DoubleList();\r\n\t\tfor (int i = 0; i < 15; i++) {\r\n\t\t\tlist.add(new Munitions(i, i + 1, \"iron\"));\r\n\t\t}\r\n\t}", "public void initialize() {\n\t\tcompartmentName = new SimpleStringProperty(compartment.getName());\t\t\n\t\tcompartmentId = new SimpleStringProperty(compartment.getId());\n\t\tcompartmentSBOTerm = new SimpleStringProperty(compartment.getSBOTermID());\n\t}", "protected void setFileProperties(String prefix, Properties props) {\n setSpatialIndexes(prefix, props);\n }", "void setPropertyKeySettings(List<PropertyKeySetting> settingList);", "@BeforeTest\n\t\tpublic void propCalling() throws IOException\n\t\t{\n\t\t\t\n\t\t\tIntializingProperties();\n\t\t}", "private void initializeNamesMap (Workspace[] wss) {\n // fill name mapping with proper values\n namesMap = new HashMap(wss.length * 2);\n for (int i = 0; i < wss.length; i++) {\n // create new string for each display name to be able to search\n // using '==' operator in findProgrammaticName(String displayName) method\n namesMap.put(wss[i].getName(), new String(wss[i].getDisplayName()));;\n }\n }", "@Override\n public void afterPropertiesSet() throws Exception {\n System.out.println(\"After Properties Set Method is called and Properties are set for \" + triangle.toString()\n + \" And \" + shapeService.toString());\n name = \"Vedika\";\n }", "@Override\r\n\tpublic void setProperties(Properties arg0) {\n\r\n\t}", "@Override\n\tpublic void setProperty(String propertyName, Object value) {\n\t\t\n\t}", "public PropertiesQDoxPropertyExpander() {\n super();\n }", "public static void setPropertiesName(String inName) {\r\n if (LOG.isDebugEnabled()) {\r\n LOG.debug(\"setPropertiesName: \" + inName);\r\n }\r\n if (inName == null) {\r\n throw new IllegalArgumentException(\"Can't set PropertiesName to null. Pass in a resource name.\");\r\n }\r\n\r\n ResourceBundle bundle = ResourceLoader.getProperties(inName);\r\n if (bundle != null) {\r\n getInstance().putAll(bundle);\r\n }\r\n\r\n // Load system properties over the top\r\n getInstance().loadSystemConfig();\r\n }", "@Test\n public void testGetPropertyAsList() {\n System.out.println(\"getPropertyAsList\");\n Properties props = new Properties();\n String key = \"testProp\";\n props.setProperty(key, \"alpha, beta, gamma\");\n List<String> expResult = Arrays.asList(\"alpha\", \"beta\", \"gamma\");\n List<String> result = EngineConfiguration.getPropertyAsList(props, key);\n assertEquals(expResult, result);\n }", "private void processPropertyPlaceHolders() {\n\t\tMap<String, PropertyResourceConfigurer> prcs = applicationContext.getBeansOfType(PropertyResourceConfigurer.class);\n\n\t\tif (!prcs.isEmpty() && applicationContext instanceof GenericApplicationContext) {\n\t\t\tBeanDefinition mapperScannerBean = ((GenericApplicationContext) applicationContext)\n\t\t\t\t\t.getBeanFactory().getBeanDefinition(beanName);\n\n\t\t\t// PropertyResourceConfigurer does not expose any methods to explicitly perform\n\t\t\t// property placeholder substitution. Instead, create a BeanFactory that just\n\t\t\t// contains this mapper scanner and post process the factory.\n\t\t\tDefaultListableBeanFactory factory = new DefaultListableBeanFactory();\n\t\t\tfactory.registerBeanDefinition(beanName, mapperScannerBean);\n\n\t\t\tfor (PropertyResourceConfigurer prc : prcs.values()) {\n\t\t\t\tprc.postProcessBeanFactory(factory);\n\t\t\t}\n\n\t\t\tPropertyValues values = mapperScannerBean.getPropertyValues();\n\n\t\t\tthis.basePackage = updatePropertyValue(\"basePackage\", values);\n\t\t\tthis.sqlSessionFactoryBeanName = updatePropertyValue(\"sqlSessionFactoryBeanName\", values);\n\t\t\tthis.sqlSessionTemplateBeanName = updatePropertyValue(\"sqlSessionTemplateBeanName\", values);\n\t\t}\n\t}", "String getPropertyName();", "@Override\n public void updateProperties() {\n // unneeded\n }", "public static void prtProperties() {\n prop.list(System.out);\n }", "public void setProperties(String primitive, AnimationProperties properties){\r\n\t\tpropMap.put(primitive, properties);\r\n\t}", "public String getPropertyName();", "public String getPropertyPrefix();", "public Property(String name) {\n super(SOME, NONE);\n this.name = name;\n }", "public void setPropertyFileName(String propertyfileName)\r\n\t{\r\n\t\t// propertyfileName = propertyFileName;\r\n\t\tpropertyFileName = propertyfileName;\r\n\t}", "public Iterator<String> getUserDefinedProperties();", "public void setProperties(String properties) throws ParseException {\n\t\tthis.m_corniInterpreter.clear();\n\t\tthis.m_corniInterpreter.parseProperties(properties);\n\t\t\n\t\tthis.m_attributes = m_corniInterpreter.getAttributes();\n\t\tthis.m_tagNames = m_corniInterpreter.getTagNames();\n\t}", "protected void setSpatialIndexes(String prefix, Properties p) {\n\n String listValue = p.getProperty(prefix + ShapeFileListProperty);\n\n if (Debug.debugging(\"shape\")) {\n Debug.output(getName() + \"| list = \\\"\" + listValue + \"\\\"\");\n }\n\n if (listValue == null) {\n Debug.error(\"No property \\\"\" + prefix + ShapeFileListProperty\n + \"\\\" found in application properties.\");\n return;\n }\n\n // Divide up the names ...\n StringTokenizer tokens = new StringTokenizer(listValue, \" \");\n Collection shapeFiles = new Vector();\n while (tokens.hasMoreTokens()) {\n shapeFiles.add(tokens.nextToken());\n }\n\n spatialIndexes = new Vector(shapeFiles.size());\n Iterator list = shapeFiles.iterator();\n\n while (list.hasNext()) {\n String listName = (String) list.next();\n SpatialIndexHandler sih = new SpatialIndexHandler(prefix + listName, p);\n spatialIndexes.add(sih);\n\n if (Debug.debugging(\"shape\")) {\n Debug.output(\"MultiShapeLayer adding: \" + sih);\n }\n }\n }", "public static void setFieldNameSeparators(boolean avoidSpecialChars) {\n\t\tif (avoidSpecialChars) {\n\t\t\t// Avoid using special characters in fieldnames, in case\n\t\t\t// this clashes with other Lucene-based software (such as e.g. Solr)\n\t\t\tPROP_SEP = \"_PR_\";\n\t\t\tALT_SEP = \"_AL_\";\n\t\t\tBOOKKEEPING_SEP = \"_BK_\";\n\t\t} else {\n\t\t\t// Lucene doesn't have any restrictions on characters in field names;\n\t\t\t// use the short, symbolic ones.\n\t\t\tPROP_SEP = \"%\";\n\t\t\tALT_SEP = \"@\";\n\t\t\tBOOKKEEPING_SEP = \"#\";\n\t\t}\n\n\t\tALT_SEP_LEN = ALT_SEP.length();\n\t\tPROP_SEP_LEN = PROP_SEP.length();\n\t\tBOOKKEEPING_SEP_LEN = BOOKKEEPING_SEP.length();\n\t}", "@Override\r\n public boolean isNameProperty() throws Exception\r\n {\n return false;\r\n }", "public Enumeration getPropertyNames()\n {\n Hashtable props = getProperties();\n return (props != null) ? props.keys() : new Vector().elements();\n }", "public void setProperty(String property) {\n }", "@Override\n public ImmutableList<String> getNameParts() {\n return names.toImmutable();\n }", "private static Map<String, String> createPropertiesAttrib() {\r\n Map<String, String> map = new HashMap<String, String>();\r\n map.put(\"Property1\", \"Value1SA\");\r\n map.put(\"Property3\", \"Value3SA\");\r\n return map;\r\n }", "public void setProperty(Properties properties) {\r\n this.properties = properties;\r\n }", "@Override\n\tpublic void setProperties(Properties p) {\n\t\t\n\t}" ]
[ "0.70904684", "0.69476867", "0.64889926", "0.6407308", "0.62123317", "0.61921257", "0.61724377", "0.6170876", "0.61554015", "0.6063915", "0.60191315", "0.60107", "0.59390205", "0.593549", "0.5934611", "0.5767028", "0.5747334", "0.5739407", "0.57322574", "0.57226455", "0.5678012", "0.5666332", "0.56614655", "0.5653986", "0.56524456", "0.5637975", "0.5628001", "0.5601621", "0.55799454", "0.55649894", "0.5546235", "0.55364686", "0.54689103", "0.54367584", "0.54219", "0.54151154", "0.5389974", "0.5374139", "0.5374139", "0.5356735", "0.53528553", "0.535163", "0.5318905", "0.53188884", "0.5302172", "0.5301872", "0.52983236", "0.5264655", "0.5259976", "0.52571845", "0.5255295", "0.52506363", "0.5247014", "0.52425694", "0.5240005", "0.5231196", "0.52268213", "0.5211273", "0.52019966", "0.51924384", "0.51855433", "0.51827747", "0.5178175", "0.51764625", "0.5176362", "0.5166406", "0.51584435", "0.5151104", "0.5151083", "0.51324904", "0.5124863", "0.51204115", "0.5114133", "0.51086843", "0.5106756", "0.50956076", "0.5094366", "0.50932306", "0.5088462", "0.5087695", "0.507489", "0.50701874", "0.5066636", "0.50600696", "0.5059737", "0.50583094", "0.5054309", "0.50380766", "0.50377804", "0.50342596", "0.50316477", "0.5029738", "0.50293124", "0.5026789", "0.5025422", "0.5018351", "0.5007526", "0.5002385", "0.499616", "0.49923673", "0.49892002" ]
0.0
-1
Validate that an object is equal depending on their stored values.
@Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (objectToCompare == null || getClass() != objectToCompare.getClass()) { return false; } TypeDefProperties that = (TypeDefProperties) objectToCompare; return Objects.equals(typeDefProperties, that.typeDefProperties); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean canEqual(Object obj);", "public void testEqualsObject() {\n\t\t\tTipoNodoLeisure tipo1 = new TipoNodoLeisure(Messages.getString(\"TipoNodoLeisureTest.0\")); //$NON-NLS-1$\n\t\t\tTipoNodoLeisure tipo2= new TipoNodoLeisure(Messages.getString(\"TipoNodoLeisureTest.1\")); //$NON-NLS-1$\n\t\t\tTipoNodoLeisure tipo3= new TipoNodoLeisure(Messages.getString(\"TipoNodoLeisureTest.2\")); //$NON-NLS-1$\n\t\t\tif (tipo1 != tipo1)\n\t\t\t\tfail(Messages.getString(\"TipoNodoLeisureTest.3\")); //$NON-NLS-1$\n\t\t\tif (!tipo1.equals(tipo2))\n\t\t\t\tfail(Messages.getString(\"TipoNodoLeisureTest.4\"));\t\t\t //$NON-NLS-1$\n\t\t\tif (tipo1.equals(tipo3))\n\t\t\t\tfail(Messages.getString(\"TipoNodoLeisureTest.5\"));\t //$NON-NLS-1$\n\t\t}", "@Test\n\tpublic void testEqualsObject_True() {\n\t\tbook3 = new Book(DEFAULT_TITLE, DEFAULT_AUTHOR, DEFAULT_YEAR, DEFAULT_ISBN);\n\t\tassertEquals(book1, book3);\n\t}", "public void testObjEqual()\n {\n assertEquals( true, Util.objEqual(null,null) );\n assertEquals( false,Util.objEqual(this,null) );\n assertEquals( false,Util.objEqual(null,this) );\n assertEquals( true, Util.objEqual(this,this) );\n assertEquals( true, Util.objEqual(\"12\",\"12\") );\n }", "@Test\r\n\tpublic void testEquality(){\n\t\t assertEquals(object1, object2);\r\n\t}", "public void testEqualsObject()\n {\n // Null check\n assertFalse(b1.equals(null));\n // Type mismatch\n assertFalse(b1.equals(\"a\"));\n\n // Reflexive\n assertTrue(b1.equals(b1));\n\n // In general, two empty boards\n assertTrue(b1.equals(b2));\n\n // Different contents\n b1.setCell(0, 0, Cell.RED1);\n assertFalse(b1.equals(b2));\n\n // Same Contents\n b2.setCell(0, 0, Cell.RED1);\n assertTrue(b1.equals(b2));\n\n // Some more complex cases\n b1.fromString(\"RRRBEEBBE\");\n assertFalse(b1.equals(b2));\n b2.fromString(\"RRRBEEBBE\");\n assertTrue(b1.equals(b2));\n\n }", "public void testEqualsObject()\n {\n Mana meme = new Mana( myMise );\n Assert.assertEquals( myMise, meme );\n \n System.out.println( myMise.toString());\n Mana autre = new Mana( 49 );\n Assert.assertFalse( myMise.equals( autre ));\n autre = new Mana( 50 );\n Assert.assertTrue( myMise.equals( autre ));\n }", "@Test\n public void testEquals_sameParameters() {\n CellIdentityNr cellIdentityNr =\n new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC_STR, MNC_STR, NCI,\n ALPHAL, ALPHAS, Collections.emptyList());\n CellIdentityNr anotherCellIdentityNr =\n new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC_STR, MNC_STR, NCI,\n ALPHAL, ALPHAS, Collections.emptyList());\n\n // THEN this two objects are equivalent\n assertThat(cellIdentityNr).isEqualTo(anotherCellIdentityNr);\n }", "boolean equalTo(ObjectPassDemo o) {\n return (o.a == a && o.b == b);\n }", "@Test\n @DisplayName(\"Test should detect equality between equal states.\")\n public void testShouldResultInEquality() {\n ObjectBag os1 = new ObjectBag(null, \"Hi\");\n ObjectBag os2 = new ObjectBag(null, \"Hi\");\n\n Assertions.assertThat(os1).isEqualTo(os2);\n }", "@Test\r\n public void ObjectsAreNotTheSame() {\n try_scorers = new Try_Scorers(\"Sharief\",\"Roman\",3,9);\r\n Assert.assertNotSame(try_scorers ,try_scorers.updateGamesPlayed(4),\"The Objects are the same\"); \r\n \r\n }", "public final void testSameObjectEquals() {\n final Transaction copy = testTransaction1;\n assertTrue(testTransaction1.equals(copy)); // pmd doesn't like either\n // way\n\n }", "@Test\n @DisplayName(\"Test should detect inequality between unequal states.\")\n public void testShouldResultInInequality() {\n ObjectBag os1 = new ObjectBag(null, \"Hi\");\n ObjectBag os2 = new ObjectBag(null, \"Goodbye\");\n\n Assertions.assertThat(os1).isNotEqualTo(os2);\n }", "@Test\n public void testEquals_differentParameters() {\n CellIdentityNr cellIdentityNr =\n new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC_STR, MNC_STR, NCI,\n ALPHAL, ALPHAS, Collections.emptyList());\n CellIdentityNr anotherCellIdentityNr =\n new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC_STR, MNC_STR, NCI + 1,\n ALPHAL, ALPHAS, Collections.emptyList());\n\n // THEN this two objects are different\n assertThat(cellIdentityNr).isNotEqualTo(anotherCellIdentityNr);\n }", "@Test\n public void testEqualsReturnsFalseOnDifferentIdVal() throws Exception {\n setRecordFieldValue(otherRecord, \"id\", 42L);\n\n boolean equals = record.equals(otherRecord);\n\n assertThat(equals, is(false));\n }", "@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Receta instance = new Receta();\n instance.setNombre(\"nom1\");\n Receta instance2 = new Receta();\n instance.setNombre(\"nom2\");\n boolean expResult = false;\n boolean result = instance.equals(instance2);\n assertEquals(expResult, result);\n }", "@SuppressWarnings(\"unlikely-arg-type\")\n @Test\n public void testEquals() {\n Order order = new Order(\"Test\", LocalTime.NOON, GridCoordinate.ZERO);\n Order same = new Order(\"Test\", LocalTime.NOON, GridCoordinate.ZERO);\n Order other = new Order(\"Test\", LocalTime.MIDNIGHT, GridCoordinate.ZERO);\n Order another = new Order(\"Test\", LocalTime.NOON, GridCoordinate.of(1, 1));\n Order more = new Order(\"Test2\", LocalTime.NOON, GridCoordinate.ZERO);\n\n Assert.assertTrue(\"Two objects with the same addresses should be equal.\", order.equals(order));\n Assert.assertFalse(\"Null check.\", order.equals(null));\n Assert.assertFalse(\"Type check.\", order.equals(\"\"));\n Assert.assertFalse(\"Different order times.\", order.equals(other));\n Assert.assertFalse(\"Different customer locations.\", order.equals(another));\n Assert.assertFalse(\"Different order IDs.\", order.equals(more));\n Assert.assertTrue(\"Same values.\", order.equals(same));\n }", "@NeededForTesting\n public static boolean areObjectsEqual(Object a, Object b) {\n return a == b || (a != null && a.equals(b));\n }", "@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Setting s = Setting.factory();\n Setting s1 = Setting.factory();\n Setting s2 = Setting.factory();\n Setting s3 = Setting.getSetting(\"test1\");\n Setting s4 = Setting.getSetting(\"test1\");\n\n Object o = null;\n Setting instance = s;\n assertFalse(s.equals(o));\n o = new Object();\n assertFalse(s.equals(o));\n assertFalse(s.equals(s1));\n assertEquals(s3, s4);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype. need more tests\");\n }", "@Test\n public void checkEquals() {\n EqualsVerifier.forClass(GenericMessageDto.class).usingGetClass()\n .suppress(Warning.NONFINAL_FIELDS).verify();\n }", "@Test\n public void equals_DifferentObjects_Test() {\n Assert.assertFalse(bq1.equals(ONE));\n }", "@SuppressWarnings({\"UnnecessaryLocalVariable\"})\n @Test\n void testEqualsAndHashCode(SoftAssertions softly) {\n SortOrder sortOrder0 = new SortOrder(\"i0\", true, false, true);\n SortOrder sortOrder1 = sortOrder0;\n SortOrder sortOrder2 = new SortOrder(\"i0\", true, false, true);\n\n softly.assertThat(sortOrder0.hashCode()).isEqualTo(sortOrder2.hashCode());\n //noinspection EqualsWithItself\n softly.assertThat(sortOrder0.equals(sortOrder0)).isTrue();\n //noinspection ConstantConditions\n softly.assertThat(sortOrder0.equals(sortOrder1)).isTrue();\n softly.assertThat(sortOrder0.equals(sortOrder2)).isTrue();\n\n SortOrder sortOrder3 = new SortOrder(\"i1\", true, false, true);\n softly.assertThat(sortOrder0.equals(sortOrder3)).isFalse();\n\n //noinspection EqualsBetweenInconvertibleTypes\n softly.assertThat(sortOrder0.equals(new SortOrders())).isFalse();\n }", "@Test\n public void equals() {\n Grade mathsCopy = new GradeBuilder(MATHS_GRADE).build();\n assertTrue(MATHS_GRADE.equals(mathsCopy));\n\n // same object -> returns true\n assertTrue(MATHS_GRADE.equals(MATHS_GRADE));\n\n // null -> returns false\n assertFalse(MATHS_GRADE.equals(null));\n\n // different type -> returns false\n assertFalse(MATHS_GRADE.equals(5));\n\n // different person -> returns false\n assertFalse(MATHS_GRADE.equals(SCIENCE_GRADE));\n\n // different subject name -> returns false\n Grade editedMaths = new GradeBuilder(MATHS_GRADE)\n .withSubject(VALID_SUBJECT_NAME_SCIENCE).build();\n assertFalse(MATHS_GRADE.equals(editedMaths));\n\n // different graded item -> returns false\n editedMaths = new GradeBuilder(MATHS_GRADE)\n .withGradedItem(VALID_GRADED_ITEM_SCIENCE).build();\n assertFalse(MATHS_GRADE.equals(editedMaths));\n\n // different grade -> returns false\n editedMaths = new GradeBuilder(MATHS_GRADE)\n .withGrade(VALID_GRADE_SCIENCE).build();\n assertFalse(MATHS_GRADE.equals(editedMaths));\n }", "@Test\n\tpublic void testEqualsObject_False() {\n\t\tassertNotEquals(book1, book2);;\n\t}", "public static boolean defaultEquals(DataValue obj1, Object obj2) {\r\n if (obj1 == obj2) return true;\r\n if (obj2 == null) return false;\r\n if (!(obj2 instanceof DataValue)) return false;\r\n DataValue other = (DataValue) obj2;\r\n if (!obj1.getName().equals(other.getName())) return false;\r\n if (obj1.getObject() == null) {\r\n if (other.getObject() != null) return false;\r\n } else if (obj1.getObject().getClass().isArray()) {\r\n if (!other.getObject().getClass().isArray()) return false;\r\n return Arrays.equals((byte[]) obj1.getObject(), (byte[]) other.getObject());\r\n } else {\r\n if (!obj1.getObject().equals(other.getObject())) return false;\r\n }\r\n return true;\r\n }", "public static void assertInEqualStrict( Object expected, Object actual ){\r\n\t\tassertInEqual( expected, actual );\r\n\t\tassertTrue( \r\n\t\t\tString.format(\"%s.hashcode() is expected to be inequal to %s.hashcode()\", expected, actual), \r\n\t\t\t!expected.equals(actual) );\t\r\n\t}", "@Test\n void equals1() {\n Student s1=new Student(\"emina\",\"milanovic\",18231);\n Student s2=new Student(\"emina\",\"milanovic\",18231);\n assertEquals(true,s1.equals(s2));\n }", "@Test\n public void testEqualsReturnsTrueOnIdenticalRecords() {\n boolean equals = record.equals(otherRecord);\n\n assertThat(equals, is(true));\n }", "@Test\n\tpublic void test_TCM__boolean_equals_Object() {\n\t\tfinal Attribute attribute = new Attribute(\"test\", \"value\");\n\n assertFalse(\"attribute equal to null\", attribute.equals(null));\n\n final Object object = attribute;\n assertTrue(\"object not equal to attribute\", attribute.equals(object));\n assertTrue(\"attribute not equal to object\", object.equals(attribute));\n\n // current implementation checks only for identity\n// final Attribute clonedAttribute = (Attribute) attribute.clone();\n// assertTrue(\"attribute not equal to its clone\", attribute.equals(clonedAttribute));\n// assertTrue(\"clone not equal to attribute\", clonedAttribute.equals(attribute));\n\t}", "@Test\n public void testEquals() {\n\tLoadCategoriesForm obj = new LoadCategoriesForm();\n\tobj.setLoadCategory(new LoadCategories());\n\tLoadCategoriesForm instance = new LoadCategoriesForm();\n\tinstance.setLoadCategory(new LoadCategories());\n\tboolean expResult = true;\n\tboolean result = instance.equals(obj);\n\tassertEquals(expResult, result);\n }", "@Test\n public void equals_trulyEqual() {\n SiteInfo si1 = new SiteInfo(\n Amount.valueOf(12000, SiteInfo.CUBIC_FOOT),\n Amount.valueOf(76, NonSI.FAHRENHEIT),\n Amount.valueOf(92, NonSI.FAHRENHEIT),\n Amount.valueOf(100, NonSI.FAHRENHEIT),\n Amount.valueOf(100, NonSI.FAHRENHEIT),\n 56,\n Damage.CLASS2,\n Country.USA,\n \"Default Site\"\n );\n SiteInfo si2 = new SiteInfo(\n Amount.valueOf(12000, SiteInfo.CUBIC_FOOT),\n Amount.valueOf(76, NonSI.FAHRENHEIT),\n Amount.valueOf(92, NonSI.FAHRENHEIT),\n Amount.valueOf(100, NonSI.FAHRENHEIT),\n Amount.valueOf(100, NonSI.FAHRENHEIT),\n 56,\n Damage.CLASS2,\n Country.USA,\n \"Default Site\"\n );\n\n Assert.assertEquals(si1, si2);\n }", "@Test\n\tpublic void testEquals1() {\n\t\tDistance d1 = new Distance(0, 0);\n\t\tDistance d2 = new Distance();\n\t\tassertEquals(false, d1.equals(d2));\n\t}", "@Test\n public void equals() {\n assertTrue(semester.equals(new Semester(1, 0)));\n\n // same object -> returns true\n assertTrue(semester.equals(semester));\n\n // null -> returns false\n assertFalse(semester.equals(null));\n\n // different type -> returns false\n assertFalse(semester.equals(5));\n\n // different year -> returns false\n assertFalse(semester.equals(new Semester(2, 0)));\n\n // different index -> returns false\n assertFalse(semester.equals(new Semester(1, 1)));\n\n // different modules -> returns false\n Semester differentSemester = new Semester(1, 0);\n differentSemester.addModules(getTypicalModules());\n assertFalse(semester.equals(differentSemester));\n }", "@Test\n public void equalsSameTest() {\n Device device2 = new Device(deviceID, token);\n assertEquals(device, device2);\n }", "@Test\n void testEquals() {\n final boolean expected_boolean = true;\n\n // Properties for the objects\n final String username = \"username\";\n final String name = \"their_name\";\n final String password = \"password\";\n\n // Create two LoginAccount objects\n LoginAccount first_account = new LoginAccount(username, name, password);\n LoginAccount second_account = new LoginAccount(username, name, password);\n\n // Variable to check\n boolean objects_are_equal = first_account.equals(second_account);\n\n // Assert that the two boolean values are the same\n assertEquals(expected_boolean, objects_are_equal);\n }", "@Test\n public void testEquals() {\n System.out.println(\"Animal.equals\");\n Animal newAnimal = new Animal(252, \"Candid Chandelier\", 10, \"Cheetah\", 202);\n assertTrue(animal1.equals(newAnimal));\n assertFalse(animal2.equals(newAnimal));\n }", "public boolean equals(Object o) {\r\n\t\tif (!(o instanceof IValuedField)) return false; //get rid of non fields\r\n\t\tIValuedField field= (IValuedField)o;\r\n\t\tboolean areEqual = type.equals(field.getType());//same type \r\n\t\tif (formal){\r\n\t\t\treturn (areEqual && field.isFormal());\r\n\t\t} else //the current field is actual\r\n\t\t\tif (((IValuedField) field).isFormal()) { //if the other is formal\r\n\t\t\t\treturn false;\r\n\t\t\t} else //if they're both actual then their values must match\r\n\t\t\t{\r\n\t\t\t\tif (varname != null) // there is a variable name\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif (!(o instanceof NameValueField))\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\telse //check that names match\r\n\t\t\t\t\t\tareEqual = (areEqual && (varname.equals(((NameValueField)field).getVarName())));\r\n\t\t\t\t\t}\r\n\t\t\t\treturn areEqual && value.equals(field.getValue()); //values are the same\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t}", "public abstract boolean equals(Object o);", "private static final boolean equal(Object a, Object b) {\n if (a == b)\n return true;\n if (a == null)\n return false;\n if (b == null)\n return false;\n return a.equals(b);\n }", "@Test\n public void testEquals_1() {\n LOGGER.info(\"testEquals_1\");\n final AtomString atomString = new AtomString(\"Hello\");\n final Atom atom = new AtomString(\"Hello\");\n final boolean actual = atomString.equals(atom);\n assertTrue(actual);\n }", "public boolean equals( Object obj );", "@Test\n public void equals() {\n CsvAdaptedPatient alice = new CsvAdaptedPatient(ALICE);\n CsvAdaptedPatient aliceCopy = new CsvAdaptedPatient(new PatientBuilder(ALICE).build());\n\n assertTrue(alice.equals(aliceCopy));\n\n // same object -> returns true\n assertTrue(alice.equals(alice));\n\n // null -> returns false\n assertFalse(alice.equals(null));\n\n // different type -> returns false\n assertFalse(alice.equals(5));\n\n // different patient -> returns false\n assertFalse(alice.equals(new CsvAdaptedPatient(BOB)));\n\n // different name -> returns false\n Patient editedAlice = new PatientBuilder(ALICE).withName(VALID_NAME_BOB).build();\n assertFalse(alice.equals(new CsvAdaptedPatient(editedAlice)));\n\n // different phone -> returns false\n editedAlice = new PatientBuilder(ALICE).withPhone(VALID_PHONE_BOB).build();\n assertFalse(alice.equals(new CsvAdaptedPatient(editedAlice)));\n\n // different address -> returns false\n editedAlice = new PatientBuilder(ALICE).withAddress(VALID_ADDRESS_BOB).build();\n assertFalse(alice.equals(new CsvAdaptedPatient(editedAlice)));\n\n // different remark -> returns false\n editedAlice = new PatientBuilder(ALICE).withRemark(VALID_REMARK_BOB).build();\n assertFalse(alice.equals(new CsvAdaptedPatient(editedAlice)));\n }", "boolean hasSameAs();", "@Test\n public void testEquals_2() {\n LOGGER.info(\"testEquals_2\");\n final AtomString atomString = new AtomString(\"Hello\");\n final Atom atom = new AtomString(\"Hej\");\n final boolean actual = atomString.equals(atom);\n assertFalse(actual);\n }", "@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Object object = null;\n Reserva instance = new Reserva();\n boolean expResult = false;\n boolean result = instance.equals(object);\n assertEquals(expResult, result);\n \n }", "@Test\n public void equals() {\n EditReminderDescriptor descriptorWithSameValues = new EditReminderDescriptor(DESC_REMINDER_MATHS);\n assertTrue(DESC_REMINDER_MATHS.equals(descriptorWithSameValues));\n\n // same object -> returns true\n assertTrue(DESC_REMINDER_MATHS.equals(DESC_REMINDER_MATHS));\n\n // null -> returns false\n assertFalse(DESC_REMINDER_MATHS.equals(null));\n\n // different types -> returns false\n assertFalse(DESC_REMINDER_MATHS.equals(5));\n\n // different values -> returns false\n assertFalse(DESC_REMINDER_MATHS.equals(DESC_REMINDER_SCIENCE));\n\n // different desc -> returns false\n EditReminderDescriptor editedMaths = new EditReminderDescriptorBuilder(DESC_REMINDER_MATHS)\n .withDescription(VALID_REMINDER_DESC_TWO).build();\n assertFalse(DESC_REMINDER_MATHS.equals(editedMaths));\n\n // different date -> returns false\n editedMaths = new EditReminderDescriptorBuilder(DESC_REMINDER_MATHS)\n .withReminderDate(VALID_REMINDER_DATE_TWO).build();\n assertFalse(DESC_REMINDER_MATHS.equals(editedMaths));\n }", "@Test\n public void equalsTest() {\n prepareEntitiesForEqualityTest();\n\n assertEquals(entity0, entity1);\n }", "public boolean equals(Object object);", "boolean equals(Object object);", "public boolean checker(Object primObj, Object equalObj, Object diffObj) {\n logger.log(Level.FINE, \"Primary object:: \" + primObj);\n logger.log(Level.FINE,\n \"Object that is equal to the primary one:: \" + equalObj);\n logger.log(Level.FINE,\n \"Object that is different from the primary one:: \" + diffObj);\n\n if (!primObj.equals(equalObj)) {\n logger.log(Level.FINE, primObj + \" isn't equal to \" + equalObj);\n return false;\n }\n\n if (primObj.equals(diffObj)) {\n logger.log(Level.FINE, primObj + \" is equal to \" + diffObj);\n return false;\n }\n\n /*\n * Check that toString() method invoked twice on the same object\n * produces equal String objects\n */\n logger.log(Level.FINE,\n \"Check that toString() method invoked twice on the same object\"\n + \" produces equal String objects ...\");\n String str1 = primObj.toString();\n String str2 = primObj.toString();\n\n if (!(str1.equals(str2))) {\n logger.log(Level.FINE,\n \"toString() method invoked twice on the same object\"\n + \" produces non-equal String objects:\\n\" + str1 + \"\\n\"\n + str2);\n return false;\n }\n logger.log(Level.FINE, \"\\tpassed\");\n\n /*\n * Check that 2 equal objects have equal string representations\n */\n logger.log(Level.FINE,\n \"Check that 2 equal objects have equal string\"\n + \" representations ...\");\n String primObj_str = primObj.toString();\n String equalObj_str = equalObj.toString();\n\n if (!(primObj_str.equals(equalObj_str))) {\n logger.log(Level.FINE,\n \"2 equal objects have non-equal string representations:\\n\"\n + primObj_str + \"\\n\" + equalObj_str);\n return false;\n }\n logger.log(Level.FINE, \"\\tpassed\");\n return true;\n }", "@Test\n public void testEquals() throws StoreException {\n System.out.println(\"equals\");\n boolean expResult = false;\n boolean result = instance.equals(new Object());\n assertEquals(result, expResult);\n\n assertEquals(instance.equals(Store.getInstance()), true);\n }", "@Test\n public void testEquals02() {\n System.out.println(\"equals\");\n Object otherObject = new SocialNetwork();\n boolean result = sn10.equals(otherObject);\n assertFalse(result);\n }", "public void testEquals()\n {\n // test passing null to equals returns false\n // (as specified in the JDK docs for Object)\n EthernetAddress x =\n new EthernetAddress(VALID_ETHERNET_ADDRESS_BYTE_ARRAY);\n assertFalse(\"equals(null) didn't return false\",\n x.equals((Object)null));\n \n // test passing an object which is not a EthernetAddress returns false\n assertFalse(\"x.equals(non_EthernetAddress_object) didn't return false\",\n x.equals(new Object()));\n \n // test a case where two EthernetAddresss are definitly not equal\n EthernetAddress w =\n new EthernetAddress(ANOTHER_VALID_ETHERNET_ADDRESS_BYTE_ARRAY);\n assertFalse(\"x == w didn't return false\",\n x == w);\n assertFalse(\"x.equals(w) didn't return false\",\n x.equals(w));\n\n // test refelexivity\n assertTrue(\"x.equals(x) didn't return true\",\n x.equals(x));\n \n // test symmetry\n EthernetAddress y =\n new EthernetAddress(VALID_ETHERNET_ADDRESS_BYTE_ARRAY);\n assertFalse(\"x == y didn't return false\",\n x == y);\n assertTrue(\"y.equals(x) didn't return true\",\n y.equals(x));\n assertTrue(\"x.equals(y) didn't return true\",\n x.equals(y));\n \n // now we'll test transitivity\n EthernetAddress z =\n new EthernetAddress(VALID_ETHERNET_ADDRESS_BYTE_ARRAY);\n assertFalse(\"x == y didn't return false\",\n x == y);\n assertFalse(\"x == y didn't return false\",\n y == z);\n assertFalse(\"x == y didn't return false\",\n x == z);\n assertTrue(\"x.equals(y) didn't return true\",\n x.equals(y));\n assertTrue(\"y.equals(z) didn't return true\",\n y.equals(z));\n assertTrue(\"x.equals(z) didn't return true\",\n x.equals(z));\n \n // test consistancy (this test is just calling equals multiple times)\n assertFalse(\"x == y didn't return false\",\n x == y);\n assertTrue(\"x.equals(y) didn't return true\",\n x.equals(y));\n assertTrue(\"x.equals(y) didn't return true\",\n x.equals(y));\n assertTrue(\"x.equals(y) didn't return true\",\n x.equals(y));\n }", "@Test\n public void equals() {\n Beneficiary animalShelterCopy = new BeneficiaryBuilder(ANIMAL_SHELTER).build();\n assertTrue(ANIMAL_SHELTER.equals(animalShelterCopy));\n\n // same object -> returns true\n assertTrue(ANIMAL_SHELTER.equals(ANIMAL_SHELTER));\n\n // null -> returns false\n assertFalse(ANIMAL_SHELTER.equals(null));\n\n // different type -> returns false\n assertFalse(ANIMAL_SHELTER.equals(5));\n\n // different beneficiary -> returns false\n assertFalse(ANIMAL_SHELTER.equals(BABES));\n\n // same name -> returns true\n Beneficiary editedAnimalShelter = new BeneficiaryBuilder(BABES).withName(VALID_NAME_ANIMAL_SHELTER).build();\n assertTrue(ANIMAL_SHELTER.equals(editedAnimalShelter));\n\n // same phone and email -> returns true\n editedAnimalShelter = new BeneficiaryBuilder(BABES)\n .withPhone(VALID_PHONE_ANIMAL_SHELTER).withEmail(VALID_EMAIL_ANIMAL_SHELTER).build();\n assertTrue(ANIMAL_SHELTER.equals(editedAnimalShelter));\n }", "public boolean equals(Object o);", "public abstract boolean equals(Object other);", "public boolean equals(Object obj);", "Equality createEquality();", "public boolean isEqual(Object objectname1, Object objectname2, Class<?> voClass) {\n\t\treturn false;\n\t}", "@Test\n\tpublic void testEquals() {\n\t\tPMUser user = new PMUser(\"Smith\", \"John\", \"[email protected]\");\n\t\tPark a = new Park(\"name\", \"address\", user);\n\t\tPark b = new Park(\"name\", \"address\", user);\n\t\tPark c = new Park(\"name\", \"different address\", user);\n\t\tassertEquals(a, a);\n\t\tassertEquals(a, b);\n\t\tassertEquals(b, a);\n\t\tassertFalse(a.equals(c));\n\t}", "boolean equals(Object o);", "boolean equals(Object o);", "boolean equals(Object o);", "boolean equals(Object o);", "boolean equals(Object o);", "@Override\r\n public boolean equals(Object o)\r\n {\r\n assert(true);\r\n if (o instanceof Size)\r\n {\r\n return ((Size)o).amount==amount&&((Size)o).type==type;\r\n }\r\n return false;\r\n }", "static public boolean testEquality(Object a, Object b) {\r\n\t\tif (a == null && b == null) // undefined == undefined\r\n\t\t\treturn true;\r\n\t\tif ((a == null || b == null) && (a instanceof JSNull || b instanceof JSNull)) // undefined or null\r\n\t\t\treturn true;\r\n\t\tif ((a == null && b instanceof JSNull) || (a == null && b instanceof JSNull)) // anything == undefined\r\n\t\t\treturn true;\r\n\t\tif (a == null || b == null) // anything equals null\r\n\t\t\treturn false;\r\n\t\treturn a.equals(b);\r\n\t}", "@Test\n public void testEquals() {\n \n Beneficiaire instance = ben2;\n Beneficiaire unAutreBeneficiaire = ben3;\n boolean expResult = false;\n boolean result = instance.equals(unAutreBeneficiaire);\n assertEquals(expResult, result);\n\n unAutreBeneficiaire = ben2;\n expResult = true;\n result = instance.equals(unAutreBeneficiaire);\n assertEquals(expResult, result);\n }", "@Test public void equalsTest() throws NegativeValueException {\n PetBunny pb1 = new PetBunny(\"Floppy\", \"Holland Lop\", 3.5);\n PetBunny same = new PetBunny(\"Floppy\", \"Holland Lop\", 3.5);\n PetBunny badName = new PetBunny(\"Flop\", \"Holland Lop\", 3.5);\n PetBunny badBreed = new PetBunny(\"Floppy\", \"Holland Plop\", 3.5);\n PetBunny badWeight = new PetBunny(\"Floppy\", \"Holland Lop\", 5.0);\n String nothing = \"test\";\n \n Assert.assertTrue(pb1.equals(same));\n Assert.assertFalse(pb1.equals(nothing));\n Assert.assertFalse(pb1.equals(badName));\n Assert.assertFalse(pb1.equals(badBreed));\n Assert.assertFalse(pb1.equals(badWeight));\n }", "private static void checkEqualsAndHashCodeMethods(Object lhs, Object rhs,\n boolean expectedResult) {\n if ((lhs == null) && (rhs == null)) {\n Assert.assertTrue(\n \"Your check is dubious...why would you expect null != null?\",\n expectedResult);\n return;\n }\n\n if ((lhs == null) || (rhs == null)) {\n Assert.assertFalse(\n \"Your check is dubious...why would you expect an object \"\n + \"to be equal to null?\", expectedResult);\n }\n\n if (lhs != null) {\n assertEquals(expectedResult, lhs.equals(rhs));\n }\n if (rhs != null) {\n assertEquals(expectedResult, rhs.equals(lhs));\n }\n\n if (expectedResult) {\n String hashMessage =\n \"hashCode() values for equal objects should be the same\";\n Assert.assertTrue(hashMessage, lhs.hashCode() == rhs.hashCode());\n }\n }", "@org.testng.annotations.Test\n public void test_equals_Symmetric()\n throws Exception {\n CategorieClient categorieClient = new CategorieClient(\"denis\", 1000, 10.2, 1.1, 1.2, false);\n Client x = new Client(\"Denis\", \"Denise\", \"Paris\", categorieClient);\n Client y = new Client(\"Denis\", \"Denise\", \"Paris\", categorieClient);\n Assert.assertTrue(x.equals(y) && y.equals(x));\n Assert.assertTrue(x.hashCode() == y.hashCode());\n }", "private boolean isValuesEqual(BinaryMessage tocmp, BinaryMessage original) {\n\t\tif(tocmp.getValue().equals(original.getValue())) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "@Test\n public void equalsTrueMySelf() {\n Player player1 = new Player(PlayerColor.BLACK, \"\");\n assertTrue(player1.equals(player1));\n assertTrue(player1.hashCode() == player1.hashCode());\n }", "public boolean mojeEquals(Obj o1, Obj o2) {\r\n\t\t//System.out.println(o1.getName() + \" \" + o2.getName());\r\n\t\tboolean sameRight = true; // 21.06.2020. provera prava pristupa\r\n\t\tboolean sameName = true;\t// 22.06.2020. ako nisu metode ne moraju da imaju isto ime\r\n\t\tboolean sameArrayType = true; //22.6.2020 ako je parametar niz mora isti tip niza da bude\r\n\t\t\r\n\t\tif (o1.getKind() == Obj.Meth && o2.getKind() == Obj.Meth) {\r\n\t\t\tsameRight = o1.getFpPos() == o2.getFpPos()+10; \r\n\t\t\tsameName = o1.getName().equals(o2.getName());\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (o1.getType().getKind() == Struct.Array && o2.getType().getKind() == Struct.Array) {\r\n\t\t\t\tif (!(o1.getType().getElemType() == o2.getType().getElemType())) { // ZA KLASE MOZDA TREBA equals\r\n\t\t\t\t\tsameArrayType = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// 16.08.2020.\r\n//\t\tif (o1.getType().getKind() == Struct.Class || o1.getType().getKind() == Struct.Interface)\r\n//\t\t\treturn true;\r\n\t\t\r\n\t\t\r\n\t\treturn o1.getKind() == o2.getKind() \r\n\t\t\t\t&& sameName\r\n\t\t\t\t&& o1.getType().equals(o2.getType())\r\n\t\t\t\t&& /*adr == other.adr*/ o1.getLevel() == o2.getLevel()\r\n\t\t\t\t&& equalsCompleteHash(o1.getLocalSymbols(), o2.getLocalSymbols())\r\n\t\t\t\t&& sameRight // 21.06.2020. provera prava pristupa\r\n\t\t\t\t&& sameArrayType; //22.6.2020 ako je parametar niz mora isti tip niza da bude\r\n\t}", "@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Commissioner instance = new Commissioner();\n Commissioner instance2 = new Commissioner();\n instance.setLogin(\"genie\");\n instance2.setLogin(\"genie\");\n boolean expResult = true;\n boolean result = instance.equals(instance2);\n assertEquals(expResult, result);\n }", "@Test\n public void testEquals01() {\n System.out.println(\"equals\");\n Object otherObject = new SocialNetwork();\n SocialNetwork sn = new SocialNetwork();\n boolean result = sn.equals(otherObject);\n assertTrue(result);\n }", "@Test\n\tpublic void testEqualsVerdadeiro() {\n\t\t\n\t\tassertTrue(contato1.equals(contato3));\n\t}", "boolean equals(Object obj);", "boolean equals(Object obj);", "@Test\n\tpublic void testEquals2() {\n\t\tDistance d2 = new Distance();\n\t\tDistance d4 = new Distance(1, 1);\n\t\tassertEquals(true, d2.equals(d4));\n\t}", "@Test\r\n public void testEquals() {\r\n Articulo art = new Articulo();\r\n articuloPrueba.setCodigo(1212);\r\n art.setCodigo(1212);\r\n boolean expResult = true;\r\n boolean result = articuloPrueba.equals(art);\r\n assertEquals(expResult, result);\r\n }", "@Test\n public void equals() {\n UpdateCommand.UpdateProfileDescriptor descriptorWithSameValues = new UpdateCommand\n .UpdateProfileDescriptor(UPDESC_1);\n assertTrue(UPDESC_1.equals(descriptorWithSameValues));\n\n // same object -> returns true\n assertTrue(UPDESC_1.equals(UPDESC_1));\n\n // null -> returns false\n assertFalse(UPDESC_1.equals(null));\n\n // different types -> returns false\n assertFalse(UPDESC_1.equals(5));\n\n // different values -> returns false\n assertFalse(UPDESC_1.equals(UPDESC_2));\n\n // different name -> returns false\n UpdateCommand.UpdateProfileDescriptor editedProfile = new UpdateProfileDescriptorBuilder(UPDESC_1)\n .withName(VALID_NAME_2).build();\n assertFalse(UPDESC_1.equals(editedProfile));\n\n // different id -> returns false\n editedProfile = new UpdateProfileDescriptorBuilder(UPDESC_1).withId(VALID_ID_2).build();\n assertFalse(UPDESC_1.equals(editedProfile));\n\n // different height -> returns false\n editedProfile = new UpdateProfileDescriptorBuilder(UPDESC_1).withHeight(VALID_HEIGHT_2).build();\n assertFalse(UPDESC_1.equals(editedProfile));\n\n // different weight -> returns false\n editedProfile = new UpdateProfileDescriptorBuilder(UPDESC_1).withWeight(VALID_WEIGHT_2).build();\n assertFalse(UPDESC_1.equals(editedProfile));\n }", "@Test\n public void equals() {\n Plan aliceCopy = new PersonBuilder(ALICE).build();\n assertTrue(ALICE.equals(aliceCopy));\n\n // same object -> returns true\n assertTrue(ALICE.equals(ALICE));\n\n // null -> returns false\n assertFalse(ALICE.equals(null));\n\n // different type -> returns false\n assertFalse(ALICE.equals(5));\n\n // different plan -> returns false\n assertFalse(ALICE.equals(BOB));\n\n // different name -> returns false\n Plan editedAlice = new PersonBuilder(ALICE).withName(VALID_NAME_BOB).build();\n assertFalse(ALICE.equals(editedAlice));\n\n // different address -> returns false\n editedAlice = new PersonBuilder(ALICE).withAddress(VALID_ADDRESS_BOB).build();\n assertFalse(ALICE.equals(editedAlice));\n\n // different tags -> returns false\n editedAlice = new PersonBuilder(ALICE).withTags(VALID_TAG_HUSBAND).build();\n assertFalse(ALICE.equals(editedAlice));\n }", "public static void assertEqualsStrict(Object expected, Object actual){\r\n\t\tassertEquals( expected, actual );\r\n\t\tassertEquals( \"hashcode() is not equal: \", expected.hashCode(), actual.hashCode());\r\n\t}", "public static boolean sameVersion(Object o1, Object o2) {\r\n checkVersionable(o1);\r\n checkVersionable(o2);\r\n return ((Versionable) o1).getVersionId() ==\r\n ((Versionable) o2).getVersionId();\r\n }", "@Test\n public void equals() {\n assertTrue(defaultGuiSettings.equals(defaultGuiSettings));\n assertTrue(userGuiSettings.equals(userGuiSettings));\n\n // same values -> return true\n assertTrue(defaultGuiSettings.equals(new GuiSettings()));\n assertTrue(userGuiSettings.equals(new GuiSettings(700, 900, 200, 300)));\n\n // null -> false\n assertFalse(defaultGuiSettings.equals(null));\n assertFalse(userGuiSettings.equals(null));\n\n // different type -> false\n assertFalse(defaultGuiSettings.equals(0.5f));\n assertFalse(userGuiSettings.equals(0.5f));\n\n // different window width -> false\n GuiSettings guiSettingsDifferentWindowWith = new GuiSettings(1234, 1234, 12, 34);\n assertFalse(userGuiSettings.equals(guiSettingsDifferentWindowWith));\n\n // different window coordinates -> false\n GuiSettings guiSettingsDifferentWindowCoordinate = new GuiSettings(700, 900, 20, 30);\n assertFalse(userGuiSettings.equals(guiSettingsDifferentWindowCoordinate));\n }", "@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Object obj = null;\n Usuario instance = null;\n boolean expResult = false;\n boolean result = instance.equals(obj);\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 }", "private boolean equalKeys(Object other) {\n if (this==other) {\n return true;\n }\n if (!(other instanceof User)) {\n return false;\n }\n User that = (User) other;\n if (this.getIduser() != that.getIduser()) {\n return false;\n }\n return true;\n }", "@Test\n public void testEquals() {\n Coctail c1 = new Coctail(\"coctail\", new Ingredient[]{ \n new Ingredient(\"ing1\"), new Ingredient(\"ing2\")});\n Coctail c2 = new Coctail(\"coctail\", new Ingredient[]{ \n new Ingredient(\"ing1\"), new Ingredient(\"ing2\")});\n assertEquals(c1, c2);\n }", "@Test\n public void testEqualsIdentical() {\n int userID = 0;\n int[] pref = new int[11];\n int[] health = new int[9];\n int[] diet = new int[5];\n int[] meal = new int[3];\n UserProfile up2 = new UserProfile(userID, pref, health, diet, meal);\n assertEquals(up, up2);\n }", "@Test\n public void testEquals_2()\n throws Exception {\n Project fixture = new Project();\n fixture.setWorkloadNames(\"\");\n fixture.setName(\"\");\n fixture.setScriptDriver(ScriptDriver.SilkPerformer);\n fixture.setWorkloads(new LinkedList());\n fixture.setComments(\"\");\n fixture.setProductName(\"\");\n Object obj = new Project();\n\n boolean result = fixture.equals(obj);\n\n assertEquals(true, result);\n }", "@Test\n public void equals() {\n Command commandCopy = new McqInputCommand(\"a\", mcqTest);\n assertTrue(G_MCQ_COMMAND.equals(commandCopy));\n\n // same object -> returns true\n assertTrue(commandCopy.equals(commandCopy));\n\n assertFalse(commandCopy.equals(null));\n\n // different type -> returns false\n assertFalse(commandCopy.equals(10));\n assertFalse(commandCopy.equals(\"TestString\"));\n }", "@Test\n public void equals() {\n Person aliceCopy = new PersonBuilder(ALICE).build();\n assertTrue(ALICE.equals(aliceCopy));\n\n // same object -> returns true\n assertTrue(ALICE.equals(ALICE));\n\n // null -> returns false\n assertFalse(ALICE.equals(null));\n\n // different type -> returns false\n assertFalse(ALICE.equals(5));\n\n // different person -> returns false\n assertFalse(ALICE.equals(BOB));\n\n // different name -> returns false\n Person editedAlice = new PersonBuilder(ALICE).withName(VALID_NAME_BOB).build();\n assertFalse(ALICE.equals(editedAlice));\n\n // different phone -> returns false\n editedAlice = new PersonBuilder(ALICE).withPhone(VALID_PHONE_BOB).build();\n assertFalse(ALICE.equals(editedAlice));\n\n // different email -> returns false\n editedAlice = new PersonBuilder(ALICE).withEmail(VALID_EMAIL_BOB).build();\n assertFalse(ALICE.equals(editedAlice));\n\n // different address -> returns false\n editedAlice = new PersonBuilder(ALICE).withAddress(VALID_ADDRESS_BOB).build();\n assertFalse(ALICE.equals(editedAlice));\n\n // different clientSources -> returns false\n editedAlice = new PersonBuilder(ALICE).withClientSources(VALID_CLIENTSOURCE_HUSBAND).build();\n assertFalse(ALICE.equals(editedAlice));\n\n // different note -> returns false\n editedAlice = new PersonBuilder(ALICE).withNote(VALID_NOTE_DOG).build();\n assertFalse(ALICE.equals(editedAlice));\n\n // different policy -> returns false\n editedAlice = new PersonBuilder(ALICE).withPolicy(VALID_POLICY_NAME_BOB, VALID_POLICY_DESCRIPTION_BOB).build();\n assertFalse(ALICE.equals(editedAlice));\n }", "private boolean valueEquals(Object val1, Object val2) {\n if (val1 == val2) {\n return true;\n }\n\n // One and only one of the value is null\n if (val1 == null || val2 == null) {\n return false;\n }\n\n return val1.equals(val2);\n }", "protected abstract boolean isEqual(E entryA, E entryB);", "public boolean isIdentical(Object o) {\n if (equals(o)) {\n Contact contact = (Contact) o;\n return firstName.equals(contact.firstName)\n && lastName.equals(contact.lastName)\n && phone.equals(contact.phone)\n && email.equals(contact.email)\n && dateOfBirth.equals(contact.dateOfBirth)\n && notes.equals(contact.notes);\n }\n\n return false;\n }", "@Test\n void testEqualsSameObject() {\n assertEquals(loginRequest1, loginRequest1);\n }", "@Override // com.google.common.base.Equivalence\n public boolean doEquivalent(Object a, Object b) {\n return false;\n }", "@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Object object = null;\n Paciente instance = new Paciente();\n boolean expResult = false;\n boolean result = instance.equals(object);\n assertEquals(expResult, result);\n\n }", "@Override // com.google.common.base.Equivalence\n public boolean doEquivalent(Object a, Object b) {\n return a.equals(b);\n }", "public boolean equal(Object obj1, Object obj2) {\n\t\treturn obj1.equals(obj2);\r\n\t}" ]
[ "0.727811", "0.7068401", "0.6955389", "0.68842167", "0.6832484", "0.6629597", "0.6586948", "0.65793437", "0.6575426", "0.6517404", "0.6397365", "0.6380287", "0.63767", "0.6365189", "0.63631916", "0.63558364", "0.63371146", "0.6330396", "0.63248724", "0.6323997", "0.63226235", "0.6321673", "0.6309834", "0.63035655", "0.6303414", "0.6275581", "0.62703454", "0.6268173", "0.62668484", "0.62648845", "0.62478405", "0.6245721", "0.6230222", "0.62187743", "0.6212326", "0.6199385", "0.61925405", "0.619241", "0.614866", "0.6141206", "0.6136306", "0.6135989", "0.61326396", "0.61323684", "0.6132076", "0.6125839", "0.61240417", "0.61111933", "0.6086261", "0.6074172", "0.607209", "0.607203", "0.60690784", "0.60639083", "0.6055012", "0.60532194", "0.60457945", "0.6041087", "0.6037124", "0.6032704", "0.6031708", "0.6031708", "0.6031708", "0.6031708", "0.6031708", "0.60295945", "0.6014343", "0.6012618", "0.60125285", "0.6010298", "0.60010916", "0.5998096", "0.5992961", "0.5989862", "0.5988467", "0.59856063", "0.5973883", "0.59719574", "0.59719574", "0.59682894", "0.5963804", "0.59447104", "0.5943255", "0.59411746", "0.59393924", "0.5928256", "0.59179085", "0.5911368", "0.5908989", "0.59011495", "0.58982545", "0.5896707", "0.58939224", "0.5891449", "0.5883267", "0.5880588", "0.58774865", "0.58753", "0.58728176", "0.5864337", "0.586431" ]
0.0
-1
Return a hash code based on the values of this object.
@Override public int hashCode() { return Objects.hash(typeDefProperties); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int hashcode();", "@Override\n public int hashCode() {\n return Objects.hash(this.getValue());\n }", "public int hashCode() {\n\t\tlong code = 0;\n\t\tint elements = _rowCount * _columnCount;\n\n\t\tfor (int i = 0; i < elements; i++) {\n\t\t\tcode += _value[i];\n\t\t}\n\n\t\treturn (int) code;\n\t}", "public int hashCode() {\r\n\t\treturn this.value().hashCode();\r\n\t}", "public int hashCode() {\n final int HASH_MULTIPLIER = 29;\n int h = HASH_MULTIPLIER * FName.hashCode() + LName.hashCode();\n h = HASH_MULTIPLIER * h + ((Integer)ID).hashCode();\n return h;\n }", "@Override\n public int hashCode() {\n // name's hashCode is multiplied by an arbitrary prime number (13)\n // in order to make sure there is a difference in the hashCode between\n // these two parameters:\n // name: a value: aa\n // name: aa value: a\n return key.hashCode() * 13 + (value == null ? 0 : value.hashCode());\n }", "public int hashCode()\n {\n int nHash = super.hashCode();\n\n StringBuilder buf = new StringBuilder(m_strDescription.toLowerCase()\n + m_strFieldType + m_strFieldName.toLowerCase() + m_strOperator\n + m_sequence + m_extOperator);\n Iterator iter = m_values.iterator();\n while (iter.hasNext())\n {\n buf.append((String) iter.next());\n }\n return nHash + buf.toString().hashCode() + (m_choices != null ?\n m_choices.hashCode() : 0);\n }", "@Override\n\tpublic int hashCode() {\n\t\t\n\t\treturn (int)id * name.hashCode() * email.hashCode();\n\t\t//int hash = new HashCodeBuilder(17,37).append(id).append(name); //can be added from Apache Commons Lang's HashCodeBuilder class\n\t}", "@Override\n public int hashCode() {\n int hash = 3;\n hash = 97 * hash + this.x;\n hash = 97 * hash + this.y;\n return hash;\n }", "public int hashCode()\n {\n return values().hashCode();\n }", "public int hashCode();", "public int hashCode();", "public int hashCode();", "public int hashCode();", "public int hashCode()\r\n {\r\n int hash = super.hashCode();\r\n hash ^= hashValue( m_name );\r\n hash ^= hashValue( m_classname );\r\n if( m_implicit )\r\n {\r\n hash ^= 35;\r\n }\r\n hash ^= hashValue( m_production );\r\n hash ^= hashArray( m_dependencies );\r\n hash ^= hashArray( m_inputs );\r\n hash ^= hashArray( m_validators );\r\n hash ^= hashValue( m_data );\r\n return hash;\r\n }", "public int hashCode() {\n int hash = 104473;\n if (token_ != null) {\n // Obtain unencrypted form as common base for comparison\n byte[] tkn = getToken();\n for (int i=0; i<tkn.length; i++)\n hash ^= (int)tkn[i];\n }\n hash ^= (type_ ^ 14401);\n hash ^= (timeoutInterval_ ^ 21327);\n hash ^= (isPrivate() ? 15501 : 12003);\n if (getPrincipal() != null)\n hash ^= getPrincipal().hashCode();\n if (getSystem() != null)\n hash ^= getSystem().getSystemName().hashCode();\n return hash;\n }", "@Override\n public int hashCode()\n {\n return this.value.hashCode();\n }", "@Override\r\n public int hashCode()\r\n {\r\n if(this.isEmpty()) return 0;\r\n\r\n /**\r\n * En este caso es recomendable usar la funcion Arrays.hashCode porque\r\n * garantiza un hash unico para cada array.\r\n * Si se usa la suma, los objetos \"ab\" y \"ba\" tendrian el mismo hash.\r\n */\r\n return Arrays.hashCode(this.table);\r\n }", "public int hashCode()\n {\n int code = 0;\n int i;\n int shift = 0;\n \n \t\tint byteLength = getLengthInBytes();\n for( i = 0; i < byteLength; i++)\n {\n code ^= (value[i] & 0xff)<<shift;\n shift += 8;\n if( 32 <= shift)\n shift = 0;\n }\n return code;\n }", "@Override\n public int hashCode() {\n int hash = 7;\n hash = 29 * hash + Objects.hashCode(this.id);\n hash = 29 * hash + Objects.hashCode(this.name);\n return hash;\n }", "int hashCode();", "int hashCode();", "@Override\n public int hashCode() {\n int hash = 17;\n hash = 31 * hash + month;\n hash = 31 * hash + day;\n hash = 31 * hash + year;\n return hash;\n }", "public int hashCode() {\n int hash = 0;\n hash = width;\n hash <<= 8;\n hash ^= height;\n hash <<= 8;\n hash ^= numBands;\n hash <<= 8;\n hash ^= dataType;\n hash <<= 8;\n for (int i = 0; i < bandOffsets.length; i++) {\n hash ^= bandOffsets[i];\n hash <<= 8;\n }\n for (int i = 0; i < bankIndices.length; i++) {\n hash ^= bankIndices[i];\n hash <<= 8;\n }\n hash ^= numBands;\n hash <<= 8;\n hash ^= numBanks;\n hash <<= 8;\n hash ^= scanlineStride;\n hash <<= 8;\n hash ^= pixelStride;\n return hash;\n }", "public int hashCode() {\n return Objects.hashCode(this);\n }", "public int hashCode() {\n // For speed, this hash code relies only on the hash codes of its select\n // and criteria clauses, not on the from, order by, or option clauses\n int myHash = 0;\n myHash = HashCodeUtil.hashCode(myHash, this.operation);\n myHash = HashCodeUtil.hashCode(myHash, getProjectedQuery());\n return myHash;\n }", "protected int computeHashCode() {\n return flags * 17\n + (var != null ? var.hashCode() : 0)\n + (num != null ? num.hashCode() : 0)\n + (str != null ? str.hashCode() : 0)\n + (object_labels != null ? object_labels.hashCode() : 0)\n + (getters != null ? getters.hashCode() : 0)\n + (setters != null ? setters.hashCode() : 0)\n + (excluded_strings != null ? excluded_strings.hashCode() : 0)\n + (included_strings != null ? included_strings.hashCode() : 0)\n + (functionPartitions != null ? functionPartitions.hashCode() : 0)\n + (functionTypeSignatures != null ? functionTypeSignatures.hashCode() : 0);\n }", "public int hashCode() {\n int hash = UtilConstants.HASH_INITIAL;\n hash = hash * UtilConstants.HASH_PRIME + (userId != null ? userId.hashCode() : 0);\n hash = hash * UtilConstants.HASH_PRIME + (role != null ? role.hashCode() : 0);\n return hash;\n }", "public int hashCode() {\n int result;\n result = (this.time != null ? this.time.hashCode() : 0);\n result = 29 * result + (this.value != null ? this.value.hashCode() : 0);\n return result;\n }", "public int hashCode() {\n\t\treturn hash(objects); //return the hash code of the objects\n\t}", "public int hashCode() {\n return hash.hashCode();\n }", "public int hashCode(){\n int hashcode = name == null ? 0 : name.hashCode() / 2;\n return hashcode += ( value == null ? 0 : value.hashCode()/2 );\n }", "@Override\n public int hashCode() {\n int hash = 7;\n hash = 71 * hash + this.id;\n hash = 71 * hash + Objects.hashCode(this.name);\n hash = 71 * hash + Objects.hashCode(this.cash);\n hash = 71 * hash + Objects.hashCode(this.skills);\n hash = 71 * hash + Objects.hashCode(this.potions);\n return hash;\n }", "public int hashCode() {\n return (name.ordinal() + 5) * 51;\n }", "public int hashCode() {\n return 37 * 17;\n }", "public int hashCode() {\n return lho.hashCode() + op.hashCode() + rho.hashCode();\n }", "public int hashCode() {\n\t\treturn new HashCodeBuilder().append(obox).append(wordOffsets).append(occlusions).toHashCode();\n\t}", "@Override\n public int hashCode() {\n Integer s_int = new Integer(\"223\");\n int result = Objects.hashCode(valueOf(sideLengthA));\n result = (31 * result) + Objects.hashCode(valueOf(sideLengthB));\n result = (31 * result) +Objects.hashCode(valueOf(sideLengthC));\n return result;\n }", "@Override\n public int hashCode() {\n int hash = 7;\n hash = 29 * hash + Objects.hashCode(this.firstName);\n hash = 29 * hash + Objects.hashCode(this.lastName);\n hash = 29 * hash + this.studentNumber;\n return hash;\n }", "@Override\n public int hashCode() {\n int hash = val;\n return hash;\n }", "public int hashCode()\n {\n int hash = 7;\n hash = 83 * hash + (counter != null ? counter.hashCode() : 0);\n return hash;\n }", "@Override\n\tpublic int hashCode()\n\t{\n\t\treturn values.hashCode();\n\t}", "public abstract int hashCode();", "public int hashCode()\n {\n return hash;\n }", "public int hashCode() {\r\n int result = 17;\r\n result = xCH(result, getTableDbName());\r\n result = xCH(result, getMemberAddressId());\r\n return result;\r\n }", "@Override\n public int hashCode() {\n // Declare hash and assign value\n int hash = 7;\n // Generate hash integer\n hash = 31 * hash + (int) this.getCrossingTime();\n hash = 31 * hash + (this.getName() == null ? 0 : this.getName().hashCode());\n return hash;\n }", "public final int hashCode() {\r\n return _value;\r\n }", "int\thashCode();", "public int hashCode() {\n int hc = 0;\n for (int i = 0; i < attributes.length; i += 2) {\n hc += attributes[i].hashCode() ^ attributes[i + 1].hashCode();\n }\n return hc;\n }", "@Override // com.google.common.base.Equivalence\n public int doHash(Object o) {\n return o.hashCode();\n }", "@Override\n public int hashCode() {\n return new HashCodeBuilder(17, 37)\n .append(getName())\n .append(getType())\n .toHashCode();\n }", "public int hashCode() {\n if (hashCode != 0){\n return hashCode;\n }\n return hashCode = computeHash();\n }", "public int hashCode() {\n return new HashCodeBuilder(7, 29)\n .append(meaning)\n .append(type)\n .append(target)\n .toHashCode(); \n }", "@Override\n public int hashCode() {\n return Objects.hash(myInt, myLong, myString, myBool, myOtherInt);\n }", "@Override\n public int hashCode() {\n \n final int code = 24;\n int result = 1;\n result = code * result + ((id == null) ? 0 : id.hashCode());\n return result;\n }", "@Override\n public int hashCode() {\n return (this.key == null ? 0 : this.key.hashCode()) ^ (this.value == null ? 0 : this.value.hashCode());\n }", "public int hashCode() {\n int result = 17;\n result = 37 * result + column;\n result = 37 * result + sortOrder.hashCode();\n return result;\n }", "@Override\n public int hashCode() {\n int hash = 7;\n hash = 43 * hash + this.id;\n hash = 43 * hash + this.size;\n hash = 43 * hash + Objects.hashCode(this.orientation);\n hash = 43 * hash + Objects.hashCode(this.currentPosition);\n return hash;\n }", "@Override\n public int hashCode() {\n return Objects.hash(getAverageRating(), getCount(), getMaxRating(), getMinRating());\n }", "public int hashCode() {\n long hash = UtilConstants.HASH_INITIAL;\n hash = hash * UtilConstants.HASH_PRIME + objectHashCode(getProjectName());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCodeFK(getDataProvider());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCodeFK(getPrimaryInvestigator());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCodeFK(getCreatedBy());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCode(getCreatedTime());\n return (int)(hash % Integer.MAX_VALUE);\n }", "public int hashCode() {\n\t\treturn toString().hashCode();\n\t}", "@Override\n\t public int hashCode();", "@Override\n public int hashCode() {\n return value;\n }", "public int hashCode()\n {\n return (int)(swigCPtr^(swigCPtr>>>32));\n }", "@Override\n public int hashCode() {\n int hash = 5;\n hash = 11 * hash + Objects.hashCode(this.color);\n return hash;\n }", "public int hashCode()\n {\n int hash = this.getClass().hashCode();\n\n hash = ( hash << 1 | hash >>> 31 ) ^ Arrays.hashCode(genome);\n\n return hash;\n }", "public int hashCode() {\n int result = 1;\n Object $pageSize = this.getPageSize();\n result = result * 59 + ($pageSize == null ? 43 : $pageSize.hashCode());\n Object $pageNo = this.getPageNo();\n result = result * 59 + ($pageNo == null ? 43 : $pageNo.hashCode());\n Object $sort = this.getSort();\n result = result * 59 + ($sort == null ? 43 : $sort.hashCode());\n Object $orderByField = this.getOrderByField();\n result = result * 59 + ($orderByField == null ? 43 : $orderByField.hashCode());\n return result;\n }", "@Override\n public int hashCode() {\n long longBits = Double.doubleToLongBits(this.size + this.unit.hashCode());\n return (int) (longBits ^ (longBits >>> 32));\n }", "@Override\r\n\t\t\t\tpublic int hashCode() {\r\n\t\t\t\t\t// Método hashcode aleatório projetado para ser geralmente único\r\n\t\t\t\t\treturn this.x + this.y * 256;\r\n\t\t\t\t}", "public int hashCode() {\n int result = 17;\n result = (37 * result)\n + ((nullCheck == null) ? 0 : nullCheck.hashCode());\n\n return result;\n }", "public int hashCode()\n\t{\n\t\treturn y<<16+x;\n\t}", "@Override\n\tpublic int hashCode() {\n\t\tfinal int prime = 31;\n\t\tint result = 1;\n\t\tresult = prime * result + ((color == null) ? 0 : color.hashCode());\n\t\tresult = prime * result + (int) (id ^ (id >>> 32));\n\t\tresult = prime * result + ((largeImage == null) ? 0 : largeImage.hashCode());\n\t\tlong temp;\n\t\ttemp = Double.doubleToLongBits(listPrice);\n\t\tresult = prime * result + (int) (temp ^ (temp >>> 32));\n\t\tresult = prime * result + ((mediumImage == null) ? 0 : mediumImage.hashCode());\n\t\tresult = prime * result + ((parentProduct == null) ? 0 : parentProduct.hashCode());\n\t\tresult = prime * result + (int) (quantityOnHand ^ (quantityOnHand >>> 32));\n\t\ttemp = Double.doubleToLongBits(salePrice);\n\t\tresult = prime * result + (int) (temp ^ (temp >>> 32));\n\t\tresult = prime * result + ((size == null) ? 0 : size.hashCode());\n\t\tresult = prime * result + ((smallImage == null) ? 0 : smallImage.hashCode());\n\t\treturn result;\n\t}", "public int hashCode() {\n return (7 + this.key.hashCode() + this.value.hashCode() / 5) \n + this.left.hashCode()\n + this.right.hashCode();\n }", "@Override\r\n\tpublic int hashCode() {\r\n\t\treturn Objects.hashCode(value);\r\n\t}", "public int hashCode(){\n \n long code;\n\n // Values in linear combination with two\n // prime numbers.\n\n code = ((21599*(long)value)+(20507*(long)n.value));\n code = code%(long)prime;\n return (int)code;\n }", "public synchronized int hashCode() {\n\t\treturn super.hashCode();\n\t}", "@Override\n public int hashCode() {\n int B = 31, M = 1000000007, code = 0;\n for(int pos = 0; pos < this.objectA.length(); pos++) {\n code = ((this.objectA.charAt(pos) - 'a') + B * code) % M;\n }\n return (code * this.objectB) % M;\n }", "public int hashCode()\n {\n int i = 0;\n if ( hasCode() )\n i ^= getCode().hashCode();\n return i;\n }", "public int hashCode() {\n\t\treturn BeanTools.createHashcode(id, consultContent, consultTime);\r\n\t}", "@Override\n public int hashCode()\n {\n return Objects.hash(value);\n }", "@Override\n public int hashCode()\n {\n return new HashCodeBuilder(17, 31).\n append(_name).\n toHashCode();\n }", "@Override\r\n public int hashCode() {\r\n int hash = 7;\r\n hash = 19 * hash + (int) (this.grauDeEquilibrio ^ (this.grauDeEquilibrio >>> 32));\r\n return hash;\r\n }", "@Override\r\n\tpublic int hashCode()\r\n\t{\r\n\t\tint hash = 1;\r\n\r\n\t\tif (containingExpression != null)\r\n\t\t{\r\n\t\t\thash = hash & Constants.HASH_PRIME + containingExpression.hashCode();\r\n\t\t}\r\n\r\n\t\tif (conditions != null)\r\n\t\t{\r\n\t\t\thash = hash * Constants.HASH_PRIME + new HashSet<ICondition>(conditions).hashCode();\r\n\t\t}\r\n\r\n\t\treturn hash;\r\n\t}", "@Override\r\n\tpublic int hashCode() {\n\t\tint result = 17;\r\n\t\tresult = 37*result+(int) (id ^ (id>>>32));\r\n\t\t//result = 37*result+(name==null?0:name.hashCode());\r\n\t\t//result = 37*result+displayOrder;\r\n\t\t//result = 37*result+(this.url==null?0:url.hashCode());\r\n\t\treturn result;\r\n\t}", "public int hashCode() {\n\t\tint hash = 0;\n\t\tif (isGameOver()) {\n\t\t\treturn (1 + (winner() == Game.FIRST_PLAYER ? 1 : 2));\n\t\t}\n\t\thash = 4;\n\t\tfor (int i = 1; i < NUMBER_OF_MOVES; i++) {\n\t\t\thash *= 3;\n\t\t\tif (contains(moves1, i)) {\n\t\t\t\thash++;\n\t\t\t} else if (contains(moves2, i)) {\n\t\t\t\thash += 2;\n\t\t\t}\n\t\t}\n\t\treturn hash;\n\t}", "@Override\n public int hashCode() {\n return new HashCodeBuilder(17, 37)\n .append(level)\n .append(bosses)\n .append(time)\n .toHashCode();\n }", "@Override\n public int hashCode() {\n return values.descriptor.hashCode() ^ values.hashCode();\n }", "@Override\n\t\tpublic int hashCode() {\n\t\t\treturn (int) (this.sum * 100 + this.index);\n\t\t}", "public int hashCode() {\n if (myhash == -1) {\n myhash = timestamp.hashCode() + signerCertPath.hashCode();\n }\n return myhash;\n }", "public int hashCode()\n {\n if (this.hashValue == 0)\n {\n int result = 17;\n int wsidValue = this.getWsid() == null ? 0 : this.getWsid().hashCode();\n result = result * 37 + wsidValue;\n this.hashValue = result;\n }\n return this.hashValue;\n }", "public int hashCode(){\n\t\treturn toString().hashCode();\n\t}", "public int hashCode() {\n long hash = UtilConstants.HASH_INITIAL;\n hash = hash * UtilConstants.HASH_PRIME + objectHashCodeFK(getProject());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCodeFK(getUser());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCode(getStatus());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCode(getLastActivityDate());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCode(getHasPiSeen());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCode(getHasDpSeen());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCode(getHasAdminSeen());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCode(getHasRequestorSeen());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCode(getEmailStatus());\n return (int)(hash % Integer.MAX_VALUE);\n }", "@Override\n public int hashCode() {\n int i;\n int result = 17;\n if (getMasp() == null) {\n i = 0;\n } else {\n i = getMasp().hashCode();\n }\n result = 37*result + i;\n return result;\n }", "public int hashCode() {\n int n = 0;\n int n2 = this.userName != null ? this.userName.hashCode() : 0;\n int n3 = this.date != null ? this.date.hashCode() : 0;\n int n4 = this.sys != null ? this.sys.hashCode() : 0;\n int n5 = this.dia != null ? this.dia.hashCode() : 0;\n if (this.pulse != null) {\n n = this.pulse.hashCode();\n }\n return (((n2 * 31 + n3) * 31 + n4) * 31 + n5) * 31 + n;\n }", "public int hashCode()\r\n {\r\n if (this.hashValue == 0)\r\n {\r\n int result = 17;\r\n int purSubcateIdValue = this.getId() == null ? 0 : this.getId().hashCode();\r\n result = result * 37 + purSubcateIdValue;\r\n this.hashValue = result;\r\n }\r\n return this.hashValue;\r\n }", "public int hashCode() {\r\n\t\treturn this.iD;\r\n\t}", "@Override\n public int hashCode() {\n int result;\n long temp;\n result = type.hashCode();\n result = 31 * result + (name != null ? name.hashCode() : 0);\n result = 31 * result + (mainColor != null ? mainColor.hashCode() : 0);\n result = 31 * result + (material != null ? material.hashCode() : 0);\n result = 31 * result + (origin != null ? origin.hashCode() : 0);\n temp = Double.doubleToLongBits(price);\n result = 31 * result + (int) (temp ^ (temp >>> 32));\n result = 31 * result + Arrays.hashCode(ageDelta);\n return result;\n }", "@Override\n\tpublic int hashCode() {\n\t\treturn labelTemplate.hashCode() ^ type.hashCode() ^ priority ^ valueTemplate.hashCode();\n\t}", "@Override\n public int hashCode() {\n return Short.toUnsignedInt(x) + (Short.toUnsignedInt(y)<<16);\n }", "@Override\n public int hashCode() {\n return mVal;\n }", "@Override\n\tpublic int hashCode() {\n\t\treturn new HashCodeBuilder(17, 37).append(id).append(code).append(nom).append(prix).toHashCode();\n\t}" ]
[ "0.7575641", "0.7570167", "0.7515502", "0.7433859", "0.7403694", "0.7398079", "0.737048", "0.735049", "0.73484254", "0.73451877", "0.7301309", "0.7301309", "0.7301309", "0.7301309", "0.72865033", "0.7285119", "0.7263762", "0.72512", "0.7247921", "0.7240976", "0.72294265", "0.72294265", "0.72269434", "0.7225433", "0.7210096", "0.72089106", "0.7208223", "0.7205463", "0.71847963", "0.7175389", "0.71708053", "0.7170715", "0.7157588", "0.7156104", "0.7155605", "0.7145531", "0.71176505", "0.71147895", "0.7114767", "0.71082574", "0.71065104", "0.7101528", "0.70980155", "0.7092666", "0.7084717", "0.7083361", "0.70815486", "0.7075778", "0.7069583", "0.7059847", "0.7054682", "0.70502836", "0.7046996", "0.7045511", "0.7036986", "0.703323", "0.70307004", "0.7029537", "0.7018918", "0.70180404", "0.70136154", "0.70090604", "0.7003671", "0.69954634", "0.69924617", "0.697182", "0.697031", "0.6969108", "0.69688994", "0.69685936", "0.69637674", "0.6960816", "0.69605964", "0.6958729", "0.6956845", "0.6956362", "0.69542986", "0.6953748", "0.69469076", "0.6946536", "0.69364876", "0.6933899", "0.6932095", "0.69314384", "0.6930802", "0.69244903", "0.6923803", "0.6915217", "0.69141173", "0.6910209", "0.69098675", "0.690951", "0.6906131", "0.690336", "0.68951064", "0.6894314", "0.68907666", "0.688876", "0.68878037", "0.6882743", "0.6881304" ]
0.0
-1
whatever you do, don't pass a PuzzledController to these static methods; else JUnit testing will require a full UI! applyChanges: determines if the relationships found should be applied or invisible
public static void process(LogicProblem logicProblem, boolean applyChanges) { // System.out.println("process invoked "+automaticProcessingMenuItem.isSelected()); // IntegerProperty newlyDiscoveredRelationships = controller.pendingRelationshipsCounterProperty(); // boolean automaticProcessing = controller.getAutomaticProcessing(); // System.out.println("entering processing loop"); while (logicProblem.isLogicDirty()){ // System.out.println("executing processingFlag loop"); logicProblem.setDirtyLogic(false); //re-process SPECIAL clues (with streams and filters maybe?) try { // System.out.println("\t cross -> "+ logicProblem.isLogicDirty()); Processor.cross(logicProblem, applyChanges); // System.out.println("\t unique -> "+ logicProblem.isLogicDirty()); Processor.uniqueness(logicProblem, applyChanges); // System.out.println("\t transpose -> "+ logicProblem.isLogicDirty()); Processor.transpose(logicProblem, applyChanges); Processor.pseudoTrueTuples(logicProblem, applyChanges); if (logicProblem.getNumItems() >3) // System.out.println("\t commonality -> "+ logicProblem.isLogicDirty()); Processor.commonality(logicProblem, applyChanges); } catch (RelationshipConflictException e) { // controller.notify(PuzzledController.WarningType.WARNING, e.toString()); } // System.out.println("now what? -> "+ logicProblem.isLogicDirty()); } // System.out.println("exiting processing loop"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean testChanges(boolean testRepository) {\r\n\t\t\r\n\t\tif (testRepository) {\r\n\t\t\t\r\n\t\t\tString status = \"Status: [ACTION - Testing Repository Changes]...\";\r\n\t\t\t\r\n\t\t\t// test changes in repository for clashes etc.\r\n\t\t\tstatusBar.setText(status);\r\n\t\t\tboolean testSuccess = true;\r\n\t\t\tint failCount = 0;\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\t// do an update first to make sure rep-side changes are all there\r\n\t\t\t\tboolean updateSuccess = this.updateRepChanges(false);\r\n\t\t\t\t\r\n\t\t\t\tif (!updateSuccess) {\r\n\t\t\t\t\tstatusBar.setText(status+\"Update FAILED\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// load baseOntology using URI\r\n\t\t\t\tstatusBar.setText(status+\"Loading Base Ontology\");\r\n\t\t\t\tOWLOntology baseOntology = swoopModel.loadOntology(baseOntologyURI);\r\n\t\t\t\tif (baseOntology == null) {\r\n\t\t\t\t\t// there is no base ontology, changes start from scratch\r\n\t\t\t\t\t// create new ontology using OWLBuilder\r\n\t\t\t\t\tOWLBuilder builder = new OWLBuilder();\r\n\t\t\t\t\tbuilder.createOntology(baseOntologyURI, baseOntologyURI);\r\n\t\t\t\t\tbaseOntology = builder.getOntology();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// get all repository side changes: under repRoot\r\n\t\t\t\tList allRepChanges = this.getDescendantChanges(repRoot);\r\n\t\t\t\tstatusBar.setText(status+\"Testing \"+allRepChanges.size()+\" repository-side changes\");\r\n\t\t\t\t\r\n\t\t\t\t// apply allRepChanges to baseOntology\r\n\t\t\t\tfor (int i=0; i<allRepChanges.size(); i++) {\r\n\t\t\t\t\tSwoopChange swc = (SwoopChange) allRepChanges.get(i);\r\n\t\t\t\t\tOntologyChange oc = swc.getChange();\r\n\t\t\t\t\t//*** need to align changes with ontology! ***/\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tOntologyChange alignOC = (OntologyChange) controlHandler.swoopHandler.changeLog.getChangeInformation(oc, ChangeLog.CHANGE_ALIGN, null, new ArrayList(), baseOntology);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// save state of baseOntology and see if it changes\r\n\t\t\t\t\t\t// use Abstract Syntax since its more concise than rdf/xml?\r\n\t\t\t\t\t\tString before = controlHandler.swoopHandler.changeLog.getOntSnapshot(baseOntology);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// APPLY CHANGE\r\n\t\t\t\t\t\tboolean check = true;\r\n\t\t\t\t\t\tif (alignOC instanceof BooleanElementChange) { \r\n\t\t \t\t\t\tcheck = swoopModel.applyBooleanElementChange(alignOC);\r\n\t\t \t\t\t}\r\n\t\t \t\t\telse if (alignOC instanceof EnumElementChange) { \r\n\t\t \t\t\t\tcheck = swoopModel.applyEnumElementChange(alignOC);\r\n\t\t \t\t\t}\r\n\t\t\t\t\t\telse alignOC.accept((ChangeVisitor) baseOntology);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// need to see if any change in the ontology occured\r\n\t\t\t\t\t\tString after = controlHandler.swoopHandler.changeLog.getOntSnapshot(baseOntology);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (before.equals(after) || !check) {\r\n\t\t\t\t\t\t\t// nothing has changed!\r\n\t\t\t\t\t\t\tSystem.out.println(\"Found redundant change: \"+oc);\r\n\t\t\t\t\t\t\tswc.isRedundant = true;\r\n\t\t\t\t\t\t\ttestSuccess = false;\r\n\t\t\t\t\t\t\tfailCount++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse swc.isRedundant = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch (Exception ex) {\r\n\t\t\t\t\t\tswc.isRedundant = true;\r\n\t\t\t\t\t\tSystem.out.println(\"Change Error for: \"+oc);\r\n\t\t\t\t\t\ttestSuccess = false;\r\n\t\t\t\t\t\tfailCount++;\r\n\t\t\t\t\t\tex.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\tcatch (Exception ex) {\r\n\t\t\t\tex.printStackTrace();\r\n\t\t\t\ttestSuccess = false;\r\n\t\t\t}\r\n\t\t\tif (testSuccess) statusBar.setText(status+\"Test PASSED\");\r\n\t\t\telse {\r\n\t\t\t\tstatusBar.setText(status+\"Test FAILED\");\r\n\t\t\t\tJOptionPane.showMessageDialog(this, \"Change Test FAILED: \"+failCount+\" change(s) is/are redundant or cause clashes. Please Fix/Remove them and try again.\");\r\n\t\t\t}\r\n\t\t\t// refresh repTreeTable\r\n\t\t\tthis.refreshRepTreeTable(false);\r\n\t\t\treturn testSuccess;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// test changes in Swoop Ontology for clashes etc.\r\n\t\t\tString status = \"Status: [ACTION - Testing LOCAL Ontology Changes]...\";\r\n\t\t\t\r\n\t\t\tstatusBar.setText(status);\r\n\t\t\tboolean testSuccess = true;\r\n\t\t\tint failCount = 0;\r\n\t\t\t\r\n\t\t\t// get base ontology\r\n\t\t\tstatusBar.setText(status+\"Loading Base Ontology\");\r\n\t\t\tOWLOntology baseOntology = null;\r\n\t\t\tif (existingOntRadio.isSelected()) {\r\n\t\t\t\t// get existing ontology from swoopModel\r\n\t\t\t\tbaseOntology = (OWLOntology) ontBox.getSelectedItem();\r\n\t\t\t\t// but clone it to prevent applying changes on *it*\r\n\t\t\t\tbaseOntology = this.cloneOntology(baseOntology);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tURI ontURI = null;\r\n\t\t\t\ttry {\r\n\t\t\t\t\t// load ontology with URI\r\n\t\t\t\t\tontURI = new URI(swoopOntFld.getText());\r\n\t\t\t\t\tbaseOntology = swoopModel.loadOntology(ontURI);\r\n\t\t\t\t}\r\n\t\t\t\tcatch (Exception ex) {\r\n\t\t\t\t\t// create new ontology\r\n\t\t\t\t\tOWLBuilder builder = new OWLBuilder();\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tbuilder.createOntology(ontURI, ontURI);\r\n\t\t\t\t\t} catch (OWLException e) {\r\n\t\t\t\t\t\te.printStackTrace();\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbaseOntology = builder.getOntology();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (baseOntology == null) {\r\n\t\t\t\tstatusBar.setText(status+\"Unable to load base ontology\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tfor (int i=0; i<ontChanges.size(); i++) {\r\n\t\t\t\t\tSwoopChange swc = (SwoopChange) ontChanges.get(i);\r\n\t\t\t\t\tOntologyChange oc = swc.getChange();\r\n\t\t\t\t\t//*** need to align changes with ontology! ***/\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tOntologyChange alignOC = (OntologyChange) controlHandler.swoopHandler.changeLog.getChangeInformation(oc, ChangeLog.CHANGE_ALIGN, null, new ArrayList(), baseOntology);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// save state of baseOntology and see if it changes\r\n\t\t\t\t\t\t// use Abstract Syntax since its more concise than rdf/xml?\r\n\t\t\t\t\t\tString before = controlHandler.swoopHandler.changeLog.getOntSnapshot(baseOntology);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// APPLY CHANGE\r\n\t\t\t\t\t\tboolean check = true;\r\n\t\t\t\t\t\tif (alignOC instanceof BooleanElementChange) { \r\n\t\t \t\t\t\tcheck = swoopModel.applyBooleanElementChange(alignOC);\r\n\t\t \t\t\t}\r\n\t\t \t\t\telse if (alignOC instanceof EnumElementChange) { \r\n\t\t \t\t\t\tcheck = swoopModel.applyEnumElementChange(alignOC);\r\n\t\t \t\t\t}\r\n\t\t\t\t\t\telse alignOC.accept((ChangeVisitor) baseOntology);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// need to see if any change in the ontology occured\r\n\t\t\t\t\t\tString after = controlHandler.swoopHandler.changeLog.getOntSnapshot(baseOntology);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (before.equals(after) || !check) {\r\n\t\t\t\t\t\t\t// nothing has changed!\r\n\t\t\t\t\t\t\tSystem.out.println(\"Found redundant change: \"+oc);\r\n\t\t\t\t\t\t\tswc.isRedundant = true;\r\n\t\t\t\t\t\t\ttestSuccess = false;\r\n\t\t\t\t\t\t\tfailCount++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse swc.isRedundant = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch (Exception ex) {\r\n\t\t\t\t\t\tswc.isRedundant = true;\r\n\t\t\t\t\t\tSystem.out.println(\"Change Error for: \"+oc);\r\n\t\t\t\t\t\ttestSuccess = false;\r\n\t\t\t\t\t\tfailCount++;\r\n\t\t\t\t\t\tex.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\tcatch (Exception ex) {\r\n\t\t\t\tex.printStackTrace();\r\n\t\t\t\ttestSuccess = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (testSuccess) statusBar.setText(status+\"Test PASSED\");\r\n\t\t\telse {\r\n\t\t\t\tstatusBar.setText(status+\"Test FAILED\");\r\n\t\t\t\tJOptionPane.showMessageDialog(this, \"Change Test FAILED: \"+failCount+\" change(s) is/are redundant or cause clashes. Please Fix/Remove them and try again.\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// refresh ontTreeTable\r\n\t\t\tthis.refreshOntTreeTable();\r\n\t\t\treturn testSuccess;\t\r\n\t\t}\r\n\t\t\r\n\t}", "@Test(description = \"positive test to change from all relationships to multiple relationships\")\n public void positiveTestChangeFromRelationshipAll()\n throws Exception\n {\n new RelationshipData(this, \"Test\")\n .from().defDataAll(\"relationship\")\n .create();\n\n new RelationshipData(this, \"Test\")\n .from().defData(\"relationship\", new RelationshipData(this, \"Test1\"))\n .from().defData(\"relationship\", new RelationshipData(this, \"Test2\"))\n .createDependings()\n .update(\"\")\n .checkExport();\n }", "public void testCanApply() {\n\t\tthis.recordReturn(this.one, this.one.canApply(), true);\n\t\tthis.recordReturn(this.two, this.two.canApply(), true);\n\t\tthis.replayMockObjects();\n\t\tassertTrue(\"Should be able to apply if all changes can apply\", this.aggregate.canApply());\n\t\tthis.verifyMockObjects();\n\t}", "@Test\n\tpublic void shouldEstablishCourseToTopicsRelationships(){\n\t\tTopic java = topicRepo.save(new Topic(\"Java\")); // create Topic first\n\t\tTopic ruby = topicRepo.save(new Topic(\"Ruby\"));\n\t\tCourse course = new Course(\"OO Languages\", \"description\", java, ruby); // including Topic objects in our course table \n\t\tcourse = courseRepo.save(course); // saving course in repo \n\t\tlong courseId = course.getId(); \n\t\tentityManager.flush(); \n\t\tentityManager.clear();\n\t\t\n\t\tOptional<Course> result = courseRepo.findById(courseId);\n\t\tcourse = result.get();\n\t\t\n\t\tassertThat(course.getTopics(), containsInAnyOrder(java,ruby));\t\n\t\t\t\t\n\t}", "@Test(description = \"positive test to change from multiple types to all types\")\n public void positiveTestChangeToRelationshipAll()\n throws Exception\n {\n new RelationshipData(this, \"Test\")\n .from().defData(\"relationship\", new RelationshipData(this, \"Test1\"))\n .from().defData(\"relationship\", new RelationshipData(this, \"Test2\"))\n .create();\n\n new RelationshipData(this, \"Test\")\n .from().defDataAll(\"relationship\")\n .update(\"\")\n .checkExport();\n }", "@Test\n public void testProjectRolesChanges() {\n coiPerson.setContactRole(ContactRoleFixtureFactory.MOCK_KEY_PERSON);\n Assert.assertFalse(\"Key Person Role not checked for\", rule.checkForKeyPersonProjectRoles(award.getProjectPersons()));\n coiPerson.setKeyPersonRole(\"fromCOI\");\n Assert.assertTrue(\"Key Person Role not checked for\", rule.checkForKeyPersonProjectRoles(award.getProjectPersons()));\n \n // when a key person is changed to coi\n kpPerson.setContactRole(ContactRoleFixtureFactory.MOCK_COI);\n Assert.assertTrue(\"rule should return true\", rule.processSaveAwardProjectPersonsBusinessRules(award.getProjectPersons()));\n }", "public void testMatchCRUD() {\n assertFalse(dbHelper.mMatchTable.hasData());\n\n // Create\n\n // Read\n\n // Update\n\n // Delete\n dbHelper.mMatchTable.deleteAll();\n assertFalse(dbHelper.mMatchTable.hasData());\n }", "@Test(description = \"update interface with all relationships for existing interface with one relationship\")\n public void updateAllRelationships4ExistingRelationship()\n throws Exception\n {\n final DataCollection data = new DataCollection(this);\n final RelationshipData rel = data.getRelationship(\"TestType\");\n final InterfaceData inter = data.getInterface(\"TestInterface\").addRelationship(rel);\n data.create();\n\n inter.addAllRelationships();\n this.update(inter);\n\n Assert.assertEquals(this.mql(\"print interface '\" + inter.getName() + \"' select relationship dump\"),\n \"all\",\n \"check that only all relationship is defined\");\n }", "@Test\n public void update() {\n }", "@Test\r\n\tpublic void test() {\r\n\t\tmodel1.getActualTurn().setHasAttacked(true);\r\n\t\tassertEquals(attack2.isPossible(model1) , false);\r\n\t\t\r\n\t\t/* verifica che se gli alieni vincono il gioco viene chiuso */\r\n\t\taliensWin2.perform(model1);\r\n\t\tassertEquals(model1.getGameState() , GameState.CLOSING);\r\n\t\tassertEquals(model1.getActualTurn().getCurrentPlayer().getAvatar().getIsWinner() , EndState.WINNER);\r\n\t\t\r\n\t\tmodel1.setActualTurn(turn2);\r\n\t\t\r\n\t\t/* verifica il corrretto funzionamento del metodo isPossible dell'azione di attacco */\r\n\t\tassertEquals(attack1.isPossible(model1) , false);\r\n\t\tmodel1.getActualTurn().setHasMoved(true);\r\n\t\tmodel1.getActualTurn().setHasDraw(true);\r\n\t\tassertEquals(attack1.isPossible(model1) , false);\r\n\t\tmodel1.getActualTurn().setHasDraw(false);\r\n\t\tmodel1.setGameState(GameState.ACCEPTING);\r\n\t\tassertEquals(attack1.isPossible(model1) , false);\r\n\t\tmodel1.setGameState(GameState.RUNNING);\r\n\t\tassertEquals(attack1.isPossible(model1) , true);\r\n\t\tmodel1.getGamePlayers().get(0).getAvatar().setIsAlive(LifeState.DEAD);\r\n\t\tmodel1.getGamePlayers().get(1).getAvatar().setIsAlive(LifeState.DEAD);\r\n\t\tmodel1.getGamePlayers().get(2).getAvatar().setIsAlive(LifeState.DEAD);\r\n\t\tmodel1.getGamePlayers().get(3).getAvatar().setIsAlive(LifeState.DEAD);\r\n\t\tmodel1.getGamePlayers().get(4).getAvatar().setIsAlive(LifeState.DEAD);\r\n\t\tmodel1.getGamePlayers().get(5).getAvatar().setIsAlive(LifeState.DEAD);\r\n\t\tmodel1.getGamePlayers().get(6).getAvatar().setIsAlive(LifeState.DEAD);\r\n\t\tevtAttacked1 = attack1.perform(model1);\r\n\t\tassertEquals(((EventAttacked)evtAttacked1.get(1)).getAreThereOtherHumans() , false);\r\n\t\tmodel1.getGamePlayers().get(1).getAvatar().setIsAlive(LifeState.ALIVE);\r\n\t\tmodel1.getGamePlayers().get(0).getAvatar().setIsAlive(LifeState.ALIVE);\r\n\t\tmodel1.getGamePlayers().get(2).getAvatar().setIsAlive(LifeState.ALIVE);\r\n\t\tmodel1.getGamePlayers().get(3).getAvatar().setIsAlive(LifeState.ALIVE);\r\n\t\tevtAttacked1 = attack1.perform(model1);\t\r\n\t\tassertEquals(((EventSufferAttack)evtAttacked1.get(0)).getKilled() , killedPlayer);\r\n\t\t\r\n\t\tmodel1.setActualTurn(turn3);\r\n\t\t\r\n\t\t/* verifica il corrretto funzionamento del metodo isPossible dell'azione di attacco */\r\n\t\tmodel1.setGameState(GameState.ACCEPTING);\r\n\t\t((Human)model1.getActualTurn().getCurrentPlayer().getAvatar()).setCanAttack(true);\r\n\t\tassertEquals(attack3.isPossible(model1) , false);\r\n\t\tmodel1.setGameState(GameState.RUNNING);\r\n\t\t((Human)model1.getActualTurn().getCurrentPlayer().getAvatar()).setCanAttack(false);\r\n\t\tassertEquals(attack3.isPossible(model1) , false);\r\n\t\t((Human)model1.getActualTurn().getCurrentPlayer().getAvatar()).setCanAttack(true);\r\n\t\tmodel1.getActualTurn().setHasAttacked(true);\r\n\t\tassertEquals(attack3.isPossible(model1) , false);\r\n\t\t\r\n\t\tmodel1.setActualTurn(turn4);\r\n\t\t\r\n\t\t/* verifica il corrretto funzionamento della perform dell'azione di attacco */\r\n\t\tsector1 = model1.getGameMap().searchSectorByName(\"Hatch\");\r\n\t\tmodel1.getActualTurn().getCurrentPlayer().getAvatar().setCurrentSector(sector1);\r\n\t\tevtAttacked2 = humanWin2.perform(model1);\r\n\t\tassertEquals(((EventNotifyHumanWin)evtAttacked2.get(0)).getGenerator() , player4);\r\n\t\tmodel1.getGamePlayers().get(3).getAvatar().setIsWinner(EndState.LOOSER);\r\n\t\tmodel1.getGamePlayers().get(2).getAvatar().setIsWinner(EndState.LOOSER);\r\n\t\tmodel1.getGamePlayers().get(0).getAvatar().setIsWinner(EndState.LOOSER);\r\n\t\tmodel1.getGamePlayers().get(1).getAvatar().setIsWinner(EndState.LOOSER);\r\n\t\tmodel1.getGamePlayers().get(4).getAvatar().setIsWinner(EndState.LOOSER);\r\n\t\tassertEquals(humanWin2.perform(model1).size() , 3);\r\n\t\t\r\n\t\tmodel1.setActualTurn(turn7);\r\n\t\t\r\n\t\t/* verifica il corrretto funzionamento dell'utilizzo della carta difesa */\r\n\t\tmodel1.getActualTurn().getCurrentPlayer().getAvatar().addCard(card);\r\n\t\tdefense = new Defense(evtDefense);\r\n\t\tevtAttacked2 = defense.perform(model1);\r\n\t\tassertTrue(!model1.getActualTurn().getCurrentPlayer().getAvatar().getMyCards().contains(card));\r\n\t\tassertTrue(evtAttacked2.get(0) instanceof EventRejectCardAlien);\r\n\t\tassertTrue(evtAttacked2.get(1) instanceof EventCardUsed);\r\n\t\t\r\n\t}", "@Test\n\tpublic void RecommendationModelMaintest() {\n\t\tRecommendationModel object3 = new RecommendationModel();\n\t\tassertNotNull(object3);\n\t}", "private void applyRules(GraphModification modifications) throws DataNormalizationException {\n\t\ttry {\n\t\t\tgetDirtyConnection();\n\n\t\t\tIterator<DataNormalizationRule> i = rules.iterator();\n\n\t\t\t/**\n\t\t\t * Ensure that the graph is either transformed completely or not at all\n\t\t\t */\n\t\t\t//getDirtyConnection().adjustTransactionLevel(EnumLogLevel.TRANSACTION_LEVEL);\n\n\t\t\twhile (i.hasNext()) {\n\t\t\t\tDataNormalizationRule rule = i.next();\n\n\t\t\t\ttry {\n\t\t\t\t\tperformRule(rule, modifications);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLOG.error(String.format(Locale.ROOT, \"Debugging of rule %d failed: %s\", rule.getId(), e.getMessage()));\n\t\t\t\t\tthrow new DataNormalizationException(e);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//getDirtyConnection().commit();\n\t\t} catch (DatabaseException e) {\n\t\t\tthrow new DataNormalizationException(e);\n\t\t//} catch (SQLException e) {\n\t\t//\tthrow new DataNormalizationException(e);\n\t\t}\n\t}", "@Test\n void testCreateAndUpdateOnlyReportErrorsIfItAddsNewInformation() {\n\n Setup setup =\n new Setup.Builder()\n .trackedEntity(\"xK7H53f4Hc2\")\n .isNotValid()\n .enrollment(\"t1zaUjKgT3p\")\n .isNotValid()\n .relationship(\"Te3IC6TpnBB\", trackedEntity(\"xK7H53f4Hc2\"), enrollment(\"t1zaUjKgT3p\"))\n .isNotValid()\n .build();\n\n PersistablesFilter.Result persistable =\n filter(setup.bundle, setup.invalidEntities, TrackerImportStrategy.CREATE_AND_UPDATE);\n\n assertAll(\n () -> assertIsEmpty(persistable.get(TrackedEntity.class)),\n () -> assertIsEmpty(persistable.get(Enrollment.class)),\n () -> assertIsEmpty(persistable.get(Relationship.class)),\n () -> assertIsEmpty(persistable.getErrors()));\n }", "public void updateFakeEntities() { \n for(ViewableEntity playerEntity : replicatedEntites.values()) {\n playerEntity.update();\n }\n }", "@Test\n public void testUpdatePharmacy() throws Exception {\n System.out.println(\"updatePharmacy\");\n\n //Null test\n PharmacyDTO pharmacy = null;\n ManagePharmaciesController instance = new ManagePharmaciesController();\n PharmacyDTO expResult = null;\n PharmacyDTO result = instance.updatePharmacy(pharmacy);\n Assertions.assertEquals(expResult, result);\n\n //Value test\n instance = new ManagePharmaciesController();\n PharmacyDB db = Mockito.mock(PharmacyDB.class);\n PharmaDeliveriesApp.getInstance().getPharmacyService().setPharmacyDB(db);\n PharmacyDTO update = getPharmacyDTOTest(\"teste1\");\n Pharmacy returnedP = convertPharmacyDTO(update);\n when(db.updatePharmacy(any(Pharmacy.class))).thenReturn(returnedP);\n Assertions.assertEquals(instance.updatePharmacy(update).getName(), update.getName());\n Assertions.assertEquals(instance.updatePharmacy(update).getId(), update.getId());\n \n when(db.updatePharmacy(any(Pharmacy.class))).thenReturn(null);\n Assertions.assertNull(instance.updatePharmacy(update));\n }", "@Test\n public void factoryMVC_integration_test() {\n\n AbstractFactory pFactory = FactoryProducer.getFactory(\"person\");\n Person person = pFactory.getPerson(\"Person\");\n PersonView pView = new PersonView();\n\n PersonController personController = new PersonController(person, pView);\n\n Assert.assertEquals(\"Person\", personController.getPersonName());\n personController.setPersonName(\"newName\");\n Assert.assertEquals(\"newName\", personController.getPersonName());\n\n\n }", "@Test\n\tpublic void shouldEstablishTexbookToCourseRelationships(){\n\t\tCourse course = new Course(\"OO Languages\", \"description\"); // created course first\n\t\tcourseRepo.save(course); //saving course into course repo\n\t\tlong courseId = course.getId();\n\t\t\n\t\t\n\t\t//building owners\n\t\tTextbook book = new Textbook (\"title\", course);\n\t\ttextbookRepo.save(book);\n\t\t\n\t\t\n\t\tTextbook book2 = new Textbook(\"title two\", course);\n\t\ttextbookRepo.save(book2);\n\t\t\n\t\t\n\t\tentityManager.flush(); \n\t\tentityManager.clear();\n\t\t\n\t\t\n\t\tOptional<Course> result = courseRepo.findById(courseId);\n\t\tcourse = result.get();\n\t\t\n\t\tassertThat(course.getTextBooks(), containsInAnyOrder(book, book2));\t\n\t\t\t\t\n\t}", "@Test\n\t@Transactional\n\tpublic void pruebaDequeIngresaAlControladorCrearPermutaciones() {\n\n\t\tModelAndView model = controlador.crearPermutacion(request);\n\t\tassertThat(model.getViewName()).isEqualTo(\"/crear-permutacion\");\n\n\t}", "@Test\n public void updateContact() {\n }", "@Test\n public void testUpdateAccount() {\n for (int i = 0; i < 10; i++) {\n presenter.onUpdateAccount();\n }\n Assert.assertEquals(10, view.getManageUpdateAccountClicks());\n }", "@Test\n void getMandatoryDeepSuccessors () {\n\n }", "public void applyAnnotationChanges() throws Exception {\n\t\tselectedChangeSet = this.getSelectedChanges();\n\t\tSwoopModel swoopModel = changeLog.swoopModel;\n\t\t\n\t\t// save current uncommitted changes\n\t\tList savedUncommittedChanges = new ArrayList(swoopModel.getUncommittedChanges());\n\t\tList savedCommittedChanges = new ArrayList(swoopModel.getCommittedChanges());\n\t\t\n\t\t// apply changes, two different methods depending on serialization method\n\t\tif (SwoopModel.changeSharingMethod == SwoopModel.JAVA_SER) {\n\t\t\tOWLOntology ont = null;\n\t\t\tfor (Iterator iter = selectedChangeSet.iterator(); iter.hasNext(); ) {\n\t\t\t\tOntologyChange change = (OntologyChange) iter.next();\n\t\t\t\tont = change.getOntology();\n\t\t\t\tchange.accept((ChangeVisitor) ont);\n\t\t\t}\n\t\t\tswoopModel.reloadOntology(ont, true);\n\t\t\tsavedCommittedChanges.addAll(selectedChangeSet);\n\t\t\tswoopModel.setUncommittedChanges(savedUncommittedChanges);\n\t\t\tswoopModel.setCommittedChanges(savedCommittedChanges);\n\t\t}\n\t\telse {\n\t\t\t// add annotation changes to uncommitted list and apply \n\t\t\tswoopModel.setUncommittedChanges(selectedChangeSet);\n\t\t\tswoopModel.applyOntologyChanges();\n\t\t\tswoopModel.setUncommittedChanges(savedUncommittedChanges);\n\t\t}\n\t\t\n\t\t// give success message\n\t\tJOptionPane.showMessageDialog(this, \"Ontology Changes applied successfully\", \"Annotated Changes\", JOptionPane.INFORMATION_MESSAGE);\n\t}", "@Test\n public void updateConversation() {\n Conversation original = new Conversation();\n\n Conversation modified = restController.createConversationForBlog(MAIN_BLOG_NAME, original);\n assertThat(modified).isNotNull();\n\n modified.setNumMessages(5);\n modified.setParticipant(\"new participant\");\n modified.setParticipantAvatarUrl(\"avatar URL\");\n modified.setParticipantId(\"pid123\");\n modified.setHideConversation(true);\n\n restController.updateConversationForBlog(MAIN_BLOG_NAME, modified.getId(), modified);\n\n Conversation finalFromServer = restController.getConversationForBlogByParticipant(MAIN_BLOG_NAME,\n \"new participant\");\n\n assertThat(finalFromServer).isNotNull();\n assertThat(finalFromServer).isEqualToComparingFieldByField(modified);\n }", "@Before\n\tpublic void setUp() {\n\t\tp = new PathwayModel();\n\t\ti1 = new Interaction();\n\t\tLinePoint pt1 = i1.getLinePoints().get(0);\n\t\tLinePoint pt2 = i1.getLinePoints().get(1);\n\n\t\t// checks\n\t\tassertNull(i1.getPathwayModel());\n\t\tassertNull(pt1.getPathwayModel());\n\t\tassertNull(pt2.getPathwayModel());\n\t\tp.addInteraction(i1);\n\n\t\t// checks\n\t\tassertTrue(p.hasPathwayObject(i1));\n\t\tassertTrue(p.getInteractions().contains(i1));\n\t\tassertEquals(i1.getPathwayModel(), p);\n\t\tassertTrue(p.hasPathwayObject(pt1));\n\t\tassertTrue(p.hasPathwayObject(pt2));\n\t\tassertEquals(pt1.getPathwayModel(), p);\n\t\tassertEquals(pt2.getPathwayModel(), p);\n\n\t\t// set new points\n\t\tList<LinePoint> points = new ArrayList<LinePoint>();\n\t\tpt3 = i1.new LinePoint(10, 18);\n\t\tpt4 = i1.new LinePoint(20, 18);\n\t\tpoints.add(pt3);\n\t\tpoints.add(pt4);\n\t\ti1.setLinePoints(points);\n\n\t\t// checks\n\t\tassertTrue(p.hasPathwayObject(i1));\n\t\tassertTrue(p.getInteractions().contains(i1));\n\t\tassertEquals(i1.getPathwayModel(), p);\n\t\tassertFalse(p.hasPathwayObject(pt1));\n\t\tassertFalse(p.hasPathwayObject(pt2));\n\t\tassertNull(pt1.getPathwayModel());\n\t\tassertNull(pt2.getPathwayModel());\n\t\tassertTrue(p.hasPathwayObject(pt3));\n\t\tassertTrue(p.hasPathwayObject(pt4));\n\t\tassertEquals(pt3.getPathwayModel(), p);\n\t\tassertEquals(pt4.getPathwayModel(), p);\n\t}", "@Test\n public void testUpdateMainSkillCompareToNewChange_02() {\n System.out.println(\"updateMainSkillCompareToNewChange\");\n SkillsList instance = new SkillsList();\n Skill result = instance.getMainSkill();\n assertTrue(result==null);\n }", "@Test\n public void testIndependentPreTest() {\n // GIVEN\n Owner owner = new Owner(\"Bela\", \"Bp, Parlament\", dog, cat);\n\n // WHEN - THEN\n assertFalse(owner.hasDog());\n }", "@Test\n public void testEffectEntity() {\n // TODO: test EffectEntity\n }", "public void detectAndSendChanges()\r\n\t{\r\n\t\t super.detectAndSendChanges();\r\n\r\n\t\t for (int i = 0; i < this.crafters.size(); ++i)\r\n\t\t {\r\n\t\t\t ICrafting icrafting = (ICrafting)this.crafters.get(i);\r\n\t\t\t icrafting.sendProgressBarUpdate(this, 0, this.enchantLevels[0]);\r\n\t\t\t icrafting.sendProgressBarUpdate(this, 1, this.enchantLevels[1]);\r\n\t\t\t icrafting.sendProgressBarUpdate(this, 2, this.enchantLevels[2]);\r\n\t\t }\r\n\t}", "@Before\n public void setUp() {\n mapModel = new MapModel();\n\n HashMap<String, ContinentModel> graphContinents = new HashMap<>();\n String name;\n name = \"ContinentA\";\n graphContinents.put(name, new ContinentModel(name, 3));\n name = \"ContinentB\";\n graphContinents.put(name, new ContinentModel(name, 2));\n\n HashMap<String, TerritoryModel> graphTerritories = new HashMap<>();\n name = \"TerritoryA\";\n graphTerritories.put(name, new TerritoryModel(name, 50, 50));\n name = \"TerritoryB\";\n graphTerritories.put(name, new TerritoryModel(name, 100, 50));\n name = \"TerritoryC\";\n graphTerritories.put(name, new TerritoryModel(name, 50, 100));\n name = \"TerritoryD\";\n graphTerritories.put(name, new TerritoryModel(name, 200, 200));\n name = \"TerritoryE\";\n graphTerritories.put(name, new TerritoryModel(name, 250, 250));\n\n LinkedList<TerritoryModel> memberTerritories = new LinkedList();\n graphTerritories.get(\"TerritoryA\").setContinentName(\"ContinentA\");\n memberTerritories.add(graphTerritories.get(\"TerritoryA\"));\n graphTerritories.get(\"TerritoryB\").setContinentName(\"ContinentA\");\n memberTerritories.add(graphTerritories.get(\"TerritoryB\"));\n graphTerritories.get(\"TerritoryC\").setContinentName(\"ContinentA\");\n memberTerritories.add(graphTerritories.get(\"TerritoryC\"));\n graphContinents.get(\"ContinentA\").setMembers(memberTerritories);\n memberTerritories = new LinkedList();\n graphTerritories.get(\"TerritoryD\").setContinentName(\"ContinentB\");\n memberTerritories.add(graphTerritories.get(\"TerritoryD\"));\n graphTerritories.get(\"TerritoryE\").setContinentName(\"ContinentB\");\n memberTerritories.add(graphTerritories.get(\"TerritoryE\"));\n graphContinents.get(\"ContinentB\").setMembers(memberTerritories);\n\n LinkedList<TerritoryModel> adjacentTerritories = new LinkedList<>();\n adjacentTerritories.add(graphTerritories.get(\"TerritoryB\"));\n adjacentTerritories.add(graphTerritories.get(\"TerritoryC\"));\n graphTerritories.get(\"TerritoryA\").setAdj(adjacentTerritories);\n\n adjacentTerritories = new LinkedList<>();\n adjacentTerritories.add(graphTerritories.get(\"TerritoryB\"));\n adjacentTerritories.add(graphTerritories.get(\"TerritoryC\"));\n graphTerritories.get(\"TerritoryA\").setAdj(adjacentTerritories);\n\n adjacentTerritories = new LinkedList<>();\n adjacentTerritories.add(graphTerritories.get(\"TerritoryA\"));\n adjacentTerritories.add(graphTerritories.get(\"TerritoryC\"));\n graphTerritories.get(\"TerritoryB\").setAdj(adjacentTerritories);\n\n adjacentTerritories = new LinkedList<>();\n adjacentTerritories.add(graphTerritories.get(\"TerritoryA\"));\n adjacentTerritories.add(graphTerritories.get(\"TerritoryB\"));\n adjacentTerritories.add(graphTerritories.get(\"TerritoryD\"));\n graphTerritories.get(\"TerritoryC\").setAdj(adjacentTerritories);\n\n adjacentTerritories = new LinkedList<>();\n adjacentTerritories.add(graphTerritories.get(\"TerritoryE\"));\n adjacentTerritories.add(graphTerritories.get(\"TerritoryC\"));\n graphTerritories.get(\"TerritoryD\").setAdj(adjacentTerritories);\n\n adjacentTerritories = new LinkedList<>();\n adjacentTerritories.add(graphTerritories.get(\"TerritoryD\"));\n graphTerritories.get(\"TerritoryE\").setAdj(adjacentTerritories);\n\n mapModel.setGraphTerritories(graphTerritories);\n mapModel.setGraphContinents(graphContinents);\n }", "public void testEditDataForInheritance()\r\n\t{\r\n\r\n\t\tEntityManagerInterface entityManagerInterface = EntityManager.getInstance();\r\n\t\tDomainObjectFactory factory = DomainObjectFactory.getInstance();\r\n\r\n\t\ttry\r\n\t\t{\r\n\t\t\t// Step 1\r\n\t\t\tEntityInterface specimen = factory.createEntity();\r\n\t\t\tspecimen.setName(\"specimen\");\r\n\t\t\tspecimen.setAbstract(true);\r\n\t\t\tAttributeInterface barcode = factory.createStringAttribute();\r\n\t\t\tbarcode.setName(\"barcode\");\r\n\t\t\tspecimen.addAbstractAttribute(barcode);\r\n\r\n\t\t\tAttributeInterface label = factory.createStringAttribute();\r\n\t\t\tlabel.setName(\"label\");\r\n\t\t\tspecimen.addAbstractAttribute(label);\r\n\r\n\t\t\tEntityInterface tissueSpecimen = factory.createEntity();\r\n\t\t\ttissueSpecimen.setParentEntity(specimen);\r\n\r\n\t\t\tspecimen = entityManagerInterface.persistEntity(specimen);\r\n\r\n\t\t\ttissueSpecimen.setName(\"tissueSpecimen\");\r\n\r\n\t\t\tAttributeInterface quantityInCellCount = factory.createIntegerAttribute();\r\n\t\t\tquantityInCellCount.setName(\"quantityInCellCount\");\r\n\t\t\ttissueSpecimen.addAbstractAttribute(quantityInCellCount);\r\n\r\n\t\t\tAttributeInterface arivalDate = factory.createDateAttribute();\r\n\t\t\tarivalDate.setName(\"arivalDate\");\r\n\t\t\ttissueSpecimen.addAbstractAttribute(arivalDate);\r\n\r\n\t\t\ttissueSpecimen = entityManagerInterface.persistEntity(tissueSpecimen);\r\n\r\n\t\t\tEntityInterface advanceTissueSpecimenA = factory.createEntity();\r\n\t\t\tadvanceTissueSpecimenA.setParentEntity(tissueSpecimen);\r\n\t\t\tadvanceTissueSpecimenA.setName(\"advanceTissueSpecimenA\");\r\n\r\n\t\t\tAttributeInterface newAttribute = factory.createIntegerAttribute();\r\n\t\t\tnewAttribute.setName(\"newAttributeA\");\r\n\t\t\tadvanceTissueSpecimenA.addAbstractAttribute(newAttribute);\r\n\r\n\t\t\tEntityInterface advanceTissueSpecimenB = factory.createEntity();\r\n\t\t\tadvanceTissueSpecimenB.setParentEntity(tissueSpecimen);\r\n\t\t\tadvanceTissueSpecimenB.setName(\"advanceTissueSpecimenB\");\r\n\r\n\t\t\tAttributeInterface newAttributeB = factory.createIntegerAttribute();\r\n\t\t\tnewAttributeB.setName(\"newAttributeB\");\r\n\t\t\tadvanceTissueSpecimenB.addAbstractAttribute(newAttributeB);\r\n\t\t\tAttributeInterface newAttributeB2 = factory.createIntegerAttribute();\r\n\t\t\tnewAttributeB2.setName(\"newAttributeB2\");\r\n\t\t\tadvanceTissueSpecimenB.addAbstractAttribute(newAttributeB2);\r\n\r\n\t\t\tadvanceTissueSpecimenA = entityManagerInterface.persistEntity(advanceTissueSpecimenA);\r\n\r\n\t\t\t//Step 2\r\n\t\t\tMap dataValue = new HashMap();\r\n\t\t\tdataValue.put(barcode, \"123456\");\r\n\t\t\tdataValue.put(label, \"specimen parent label\");\r\n\t\t\tdataValue.put(quantityInCellCount, \"45\");\r\n\t\t\tdataValue.put(arivalDate, Utility.parseDate(\"11-12-1982\",\r\n\t\t\t\t\tConstants.DATE_PATTERN_MM_DD_YYYY));\r\n\r\n\t\t\tLong recordId = entityManagerInterface.insertData(tissueSpecimen, dataValue);\r\n\r\n\t\t\tResultSet resultSet = executeQuery(\"select count(*) from \"\r\n\t\t\t\t\t+ specimen.getTableProperties().getName());\r\n\t\t\tresultSet.next();\r\n\t\t\tassertEquals(1, resultSet.getInt(1));\r\n\r\n\t\t\tresultSet = executeQuery(\"select count(*) from \"\r\n\t\t\t\t\t+ tissueSpecimen.getTableProperties().getName());\r\n\t\t\tresultSet.next();\r\n\t\t\tassertEquals(1, resultSet.getInt(1));\r\n\r\n\t\t\t// Step 3\r\n\t\t\tdataValue.put(barcode, \"870\");\r\n\t\t\tdataValue.put(label, \"specimen parent label123\");\r\n\t\t\tdataValue.put(quantityInCellCount, \"4546\");\r\n\t\t\tdataValue.put(arivalDate, Utility.parseDate(\"11-11-1982\",\r\n\t\t\t\t\tConstants.DATE_PATTERN_MM_DD_YYYY));\r\n\r\n\t\t\tentityManagerInterface.editData(tissueSpecimen, dataValue, recordId);\r\n\r\n\t\t\t// step 4\r\n\t\t\tresultSet = executeQuery(\"select count(*) from \"\r\n\t\t\t\t\t+ specimen.getTableProperties().getName());\r\n\t\t\tresultSet.next();\r\n\t\t\tassertEquals(1, resultSet.getInt(1));\r\n\r\n\t\t\tresultSet = executeQuery(\"select count(*) from \"\r\n\t\t\t\t\t+ tissueSpecimen.getTableProperties().getName());\r\n\t\t\tresultSet.next();\r\n\t\t\tassertEquals(1, resultSet.getInt(1));\r\n\r\n\t\t\tdataValue.clear();\r\n\t\t\tdataValue = entityManagerInterface.getRecordById(tissueSpecimen, recordId);\r\n\r\n\t\t\tassertEquals(\"870\", dataValue.get(barcode));\r\n\t\t\tassertEquals(\"specimen parent label123\", dataValue.get(label));\r\n\t\t\tassertEquals(\"4546\", dataValue.get(quantityInCellCount));\r\n\r\n\t\t\t//Step 5\r\n\t\t\tdataValue.clear();\r\n\t\t\tdataValue.put(barcode, \"869\");\r\n\t\t\tdataValue.put(label, \"specimen parent label\");\r\n\t\t\tdataValue.put(quantityInCellCount, \"45\");\r\n\t\t\tdataValue.put(arivalDate, Utility.parseDate(\"11-12-1982\",\r\n\t\t\t\t\tConstants.DATE_PATTERN_MM_DD_YYYY));\r\n\t\t\tdataValue.put(newAttribute, \"12\");\r\n\r\n\t\t\trecordId = entityManagerInterface.insertData(advanceTissueSpecimenA, dataValue);\r\n\r\n\t\t\tresultSet = executeQuery(\"select count(*) from \"\r\n\t\t\t\t\t+ specimen.getTableProperties().getName());\r\n\t\t\tresultSet.next();\r\n\t\t\tassertEquals(2, resultSet.getInt(1));\r\n\r\n\t\t\tresultSet = executeQuery(\"select count(*) from \"\r\n\t\t\t\t\t+ tissueSpecimen.getTableProperties().getName());\r\n\t\t\tresultSet.next();\r\n\t\t\tassertEquals(2, resultSet.getInt(1));\r\n\r\n\t\t\tresultSet = executeQuery(\"select count(*) from \"\r\n\t\t\t\t\t+ advanceTissueSpecimenA.getTableProperties().getName());\r\n\t\t\tresultSet.next();\r\n\t\t\tassertEquals(1, resultSet.getInt(1));\r\n\r\n\t\t\t//Step 6\r\n\t\t\tdataValue.clear();\r\n\t\t\tdataValue.put(barcode, \"875\");\r\n\t\t\tdataValue.put(label, \"New Label\");\r\n\t\t\tdataValue.put(quantityInCellCount, \"454647\");\r\n\t\t\tdataValue.put(arivalDate, Utility.parseDate(\"11-11-1982\",\r\n\t\t\t\t\tConstants.DATE_PATTERN_MM_DD_YYYY));\r\n\t\t\tdataValue.put(newAttribute, \"1223\");\r\n\r\n\t\t\tentityManagerInterface.editData(advanceTissueSpecimenA, dataValue, recordId);\r\n\r\n\t\t\t//Step 7\r\n\t\t\tdataValue.clear();\r\n\t\t\tdataValue = entityManagerInterface.getRecordById(advanceTissueSpecimenA, recordId);\r\n\r\n\t\t\tassertEquals(\"875\", dataValue.get(barcode));\r\n\t\t\tassertEquals(\"New Label\", dataValue.get(label));\r\n\t\t\tassertEquals(\"454647\", dataValue.get(quantityInCellCount));\r\n\r\n\t\t\tresultSet = executeQuery(\"select count(*) from \"\r\n\t\t\t\t\t+ specimen.getTableProperties().getName());\r\n\t\t\tresultSet.next();\r\n\t\t\tassertEquals(2, resultSet.getInt(1));\r\n\r\n\t\t\tresultSet = executeQuery(\"select count(*) from \"\r\n\t\t\t\t\t+ tissueSpecimen.getTableProperties().getName());\r\n\t\t\tresultSet.next();\r\n\t\t\tassertEquals(2, resultSet.getInt(1));\r\n\r\n\t\t\tresultSet = executeQuery(\"select count(*) from \"\r\n\t\t\t\t\t+ advanceTissueSpecimenA.getTableProperties().getName());\r\n\t\t\tresultSet.next();\r\n\t\t\tassertEquals(1, resultSet.getInt(1));\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\tLogger.out.debug(DynamicExtensionsUtility.getStackTrace(e));\r\n\t\t\tfail();\r\n\t\t}\r\n\t}", "@Test\n\tpublic void updateTestPaperQuestion() throws Exception {\n\t}", "@Override\r\n public void detectAndSendChanges()\r\n {\r\n super.detectAndSendChanges();\r\n\r\n for (int i = 0; i < this.crafters.size(); ++i)\r\n {\r\n ICrafting icrafting = (ICrafting)this.crafters.get(i);\r\n\r\n }\r\n }", "@Test\n public void updateDecline() throws Exception {\n }", "@Test\n\tpublic void specificationsTest() {\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\tRecord record = TestHelper.mockRecord();\n\t\t\trecord.setVisible(true);\n\t\t\tentityManager.persist(record);\n\t\t}\n\n\t\t// and 2 private records\n\t\tfor (int i = 0; i < 2; i++) {\n\t\t\tRecord record = TestHelper.mockRecord();\n\t\t\trecord.setVisible(false);\n\t\t\tentityManager.persist(record);\n\t\t}\n\n\t\t// found 3 visible records\n\t\tRecordSpecification visibleSpec = new RecordSpecification();\n\t\tvisibleSpec.add(new SearchCriteria(\"visible\", true, SearchOperation.EQUAL));\n\t\tList<Record> visibleRecord = repository.findAll(visibleSpec);\n\t\tassertThat(visibleRecord).hasSize(3);\n\n\t\t// found 2 private records\n\t\tRecordSpecification privateSpecs = new RecordSpecification();\n\t\tprivateSpecs.add(new SearchCriteria(\"visible\", false, SearchOperation.EQUAL));\n\t\tList<Record> privateRecords = repository.findAll(privateSpecs);\n\t\tassertThat(privateRecords).hasSize(2);\n\t}", "@Test public void springProxies() {\n\t\tlong initialCount = targetRepo.count();\n\t\tContact contact = new Contact();\n\t\tcontact.setFirstname(\"Mickey\");\n\t\tcontact.setLastname(\"Mouse\");\n\t\ttargetRepo.save(contact);\n\t\tAssert.assertEquals(\n\t\t\tinitialCount+1,\n\t\t\ttargetRepo.count()\n\t\t);\n\t}", "@Test(description = \"update interface with one relationship for existing interface with another interface\")\n public void updateOneRelationship4ExistingOneRelationships()\n throws Exception\n {\n final DataCollection data = new DataCollection(this);\n final RelationshipData rel1 = data.getRelationship(\"TestRel1\");\n final RelationshipData rel2 = data.getRelationship(\"TestRel2\");\n final InterfaceData inter = data.getInterface(\"TestInterface\").addRelationship(rel1);\n data.create();\n\n inter.removeRelationships()\n .addRelationship(rel2);\n this.update(inter);\n\n Assert.assertEquals(this.mql(\"print interface '\" + inter.getName() + \"' select relationship dump\"),\n rel2.getName(),\n \"check that only second relationship is defined\");\n }", "@Override\n public void updateBys() { updateLabelLists(getRTParent().getEntityTagTypes()); fillCommonRelationshipsMenu(); }", "@Test\n @Order(4)\n @Transactional\n void shouldCreateAndFindToModify () throws Exception {\n LinkedMultiValueMap<String, String> materias = new LinkedMultiValueMap<>();\n materias.add(\"materias\", \"2\");\n materias.add(\"materias\", \"3\");\n mockMvc.perform(MockMvcRequestBuilders\n .post(NUEVO)\n .param(\"id\", \"\")\n .param(\"nombre\", \"Tony Stark\")\n .params(materias))\n .andExpect(status().isFound())\n .andExpect(status().is3xxRedirection())\n .andExpect(view().name(\"redirect:\" + INDEX))\n .andExpect(model().hasNoErrors())\n ;\n Profesor profesor = profesorService.findLastInserted();\n assertThat(profesor.getNombre()).isEqualTo(\"Tony Stark\");\n assertThat(profesor.getMaterias()).isNotNull();\n this.id = profesor.getId();\n //////////\n mockMvc.perform(MockMvcRequestBuilders.get(MODIFICAR, this.id))\n .andExpect(status().isOk())\n .andExpect(status().is2xxSuccessful())\n .andExpect(view().name(\"profesor-modificar\"))\n .andExpect(model().attributeExists(\"profesor\"))\n .andExpect(model().attributeExists(\"materiasWithNoProfesor\"))\n .andExpect(model().hasNoErrors())\n ;\n ///////////////////\n\n }", "@Test\n public void whenUpdatingCustomerItShouldReturnTheSavedCustomer() {\n given(repository.getOne(CUSTOMER1_ID)).willReturn(CUSTOMER1);\n // Given that a CUSTOMER1 is saved and flushed, a CUSTOMER1 is returned\n given(repository.saveAndFlush(CUSTOMER1)).willReturn(CUSTOMER1);\n // When updating a CUSTOMER1\n assertThat(controller.updateCustomer(CUSTOMER1, CUSTOMER1_ID))\n // Then it should return the CUSTOMER1\n .isSameAs(CUSTOMER1);\n }", "@Test\n @Rollback\n public void testDocumentProjectRights() throws TdarActionException {\n Project project = new Project();\n project.setTitle(\"test rights project\");\n project.setDescription(project.getTitle());\n project.markUpdated(getAdminUser());\n genericService.saveOrUpdate(project);\n ResourceCollection collection = createResourceCollectionWithAdminRights();\n genericService.saveOrUpdate(collection);\n genericService.saveOrUpdate(collection);\n collection.getAuthorizedUsers().add(new AuthorizedUser(getAdminUser(), getBasicUser(), Permissions.ADMINISTER_COLLECTION));\n genericService.saveOrUpdate(collection);\n\n ResourceCollection collectionChild = new ResourceCollection();\n collectionChild.setName(\"child collection with project\");\n // collectionChild.setSortBy(SortOption.RELEVANCE);\n collectionChild.setParent(collection);\n // collectionChild.setOrientation(DisplayOrientation.GRID);\n collectionChild.setDescription(collectionChild.getTitle());\n collectionChild.markUpdated(getAdminUser());\n project.getManagedResourceCollections().add(collectionChild);\n collectionChild.getManagedResources().add(project);\n resourceCollectionService.updateCollectionParentTo(getAdminUser(), collectionChild, collection);\n genericService.saveOrUpdate(collectionChild);\n genericService.saveOrUpdate(project);\n DocumentController dc = generateNewInitializedController(DocumentController.class, getBasicUser());\n dc.prepare();\n String add = dc.add();\n assertEquals(Action.SUCCESS, add);\n List<Resource> potentialParents = dc.getPotentialParents();\n\n logger.debug(\"my parents: size:{} contents:{}\", potentialParents.size(), potentialParents);\n assertTrue(potentialParents.contains(project));\n }", "@Test\n @Order(3)\n @Transactional\n void shouldFindThemAll() throws Exception {\n mockMvc.perform(MockMvcRequestBuilders.get(INDEX))\n .andExpect(status().isOk())\n .andExpect(status().is2xxSuccessful())\n .andExpect(view().name(\"profesor-todos\"))\n .andExpect(model().attributeExists(\"profesores\"))\n .andExpect(model().hasNoErrors())\n ;\n }", "@Test\n public void testIndependentPostTest() {\n // GIVEN\n Owner owner = new Owner(\"Bela\", \"Bp, Parlament\", dog, cat);\n\n // WHEN - THEN\n assertTrue(owner.hasDog());\n }", "private static void testupdate() {\n\t\ttry {\n\t\t\tRoleModel model = new RoleModel();\n\t\t\tRoleBean bean = new RoleBean();\n\t\t\tbean = model.findByPK(7L);\n\t\t\tbean.setName(\"Finance\");\n\t\t\tbean.setDescription(\"Finance Dept\");\n\t\t\tbean.setCreatedBy(\"CCD MYSORE\");\n\t\t\tbean.setModifiedBy(\"CCD MYSORE\");\n\t\t\tbean.setCreatedDatetime(new Timestamp(new Date().getTime()));\n\t\t\tbean.setModifiedDatetime(new Timestamp(new Date().getTime()));\n\t\t\tmodel.update(bean);\n\t\t\tRoleBean updateBean = model.findByPK(1);\n\t\t\tif (\"12\".equals(updateBean.getName())) {\n\t\t\t\tSystem.out.println(\"UPDATE RECORD FAILED\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"RECORD UPDATED SUCCESSFULLY\");\n\t\t\t}\n\t\t} catch (ApplicationException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (DuplicateRecordException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "@Test\n public void testPrestarEjemplar() {\n System.out.println(\"prestarEjemplar\");\n Ejemplar ejemplar = new EjemplaresList().getEjemplares().get(1);\n Usuario usuario = new UsuariosList().getUsuarios().get(0);\n BibliotecarioController instance = new BibliotecarioController();\n Ejemplar result = instance.prestarEjemplar(ejemplar, usuario);\n Ejemplar expResult = ejemplar;\n expResult.setUsuarioId(usuario);\n \n assertEquals(expResult, result);\n\n }", "@Test(dependsOnMethods = {\"testAddTeam\"})\n\tpublic void testUpdateTeam() {\n\t}", "public void onRelationshipChanged();", "@Test\n @Transactional\n public void getAllListWrkStatusesByIdWrkKindIsEqualToSomething() throws Exception {\n ListWrkKind idWrkKind = listWrkStatus.getIdWrkKind();\n listWrkStatusRepository.saveAndFlush(listWrkStatus);\n Long idWrkKindId = idWrkKind.getId();\n\n // Get all the listWrkStatusList where idWrkKind equals to idWrkKindId\n defaultListWrkStatusShouldBeFound(\"idWrkKindId.equals=\" + idWrkKindId);\n\n // Get all the listWrkStatusList where idWrkKind equals to idWrkKindId + 1\n defaultListWrkStatusShouldNotBeFound(\"idWrkKindId.equals=\" + (idWrkKindId + 1));\n }", "@Test\n\tpublic void testMainScenario() {\n\t\tProject project = this.db.project().create(\"Test project\", 200, \"13-05-2014\", null);\n\n//Test #1\t\t\n\t\tassertEquals(project.getActivities().size(), 0);\n\t\tassertEquals(project.getEstPercentageCompletion(), 0);\n\t\tassertEquals(project.getEstHoursRemaining(), 200);\n\t\tassertEquals(project.getHourBudget(), 200);\n\t\tassertEquals(project.getHoursAllocatedToActivities(), 0);\n\t\tassertEquals(project.getHoursRegistered(), 0);\n\t\t\n\t\tActivity activity1 = this.db.activity().createProjectActivity(project.getId(), \"activity1\", 10, this.stringDateTimeToLong(\"01-05-2013 01:00\"), this.stringDateTimeToLong(\"01-05-2014 01:00\"));\n\t\tActivity activity2 = this.db.activity().createProjectActivity(project.getId(), \"activity2\", 10, this.stringDateTimeToLong(\"01-05-2013 01:00\"), this.stringDateTimeToLong(\"01-05-2014 01:00\"));\n\n//Test #2\t\t\n\t\tassertEquals(project.getActivities().size(), 2);\n\t\tassertEquals(project.getEstPercentageCompletion(), 0);\n\t\tassertEquals(project.getEstHoursRemaining(), 200);\n\t\tassertEquals(project.getHourBudget(), 200);\n\t\tassertEquals(project.getHoursAllocatedToActivities(), 20);\n\t\tassertEquals(project.getHoursRegistered(), 0);\n\t\t\n\t\tDeveloper developer = this.db.developer().readByInitials(\"JL\").get(0);\n\t\tDeveloper developer2 = this.db.developer().readByInitials(\"PM\").get(0);\n\t\tDeveloper developer3 = this.db.developer().readByInitials(\"GH\").get(0);\n\t\tDeveloper developer4 = this.db.developer().readByInitials(\"RS\").get(0);\n\t\tactivity1.addDeveloper(developer);\n\t\tactivity1.addDeveloper(developer2);\n\t\tactivity1.addDeveloper(developer3);\n\t\tactivity1.addDeveloper(developer4);\n\n//Test #3\n\t\t//Tests that the initials of all developers are stored correctly\t\t\n\t\tassertEquals(activity1.getAllDevsInitials(),\"JL,PM,GH,RS\");\n\t\tassertEquals(activity1.getAllDevsInitials() == \"The Beatles\", false); //Please fail!\n\t\t\n\t\tthis.db.registerTime().create(this.stringDateTimeToLong(\"11-05-2013 06:30\"), this.stringDateTimeToLong(\"11-05-2013 09:30\"), developer.getId(), activity1.getId(), false);\n\t\tthis.db.registerTime().create(this.stringDateTimeToLong(\"11-05-2013 06:30\"), this.stringDateTimeToLong(\"11-05-2013 09:30\"), developer2.getId(), activity1.getId(), false);\n\t\t\n\t\t//Showed in the project maintainance view, and is relevant to the report\n\t\tassertEquals(activity1.getHoursRegistered(),6);\n\t\t\n//Test #4\n\t\t//Tests normal registration\t\t\n\t\tassertEquals(project.getEstPercentageCompletion(), 3);\n\t\tassertEquals(project.getEstHoursRemaining(), 194);\n\t\tassertEquals(project.getHourBudget(), 200);\n\t\tassertEquals(project.getHoursAllocatedToActivities(), 20);\n\t\tassertEquals(project.getHoursRegistered(), 6);\n\t\t\n\t\tthis.db.registerTime().create(this.stringDateTimeToLong(\"12-05-2013 06:30\"), this.stringDateTimeToLong(\"12-05-2013 09:30\"), developer3.getId(), activity2.getId(), true);\n\t\tthis.db.registerTime().create(this.stringDateTimeToLong(\"12-05-2013 06:30\"), this.stringDateTimeToLong(\"12-05-2013 09:30\"), developer4.getId(), activity2.getId(), true);\n\n//Test #5\n\t\t//Tests that assits also count\t\t\n\t\tassertEquals(project.getEstPercentageCompletion(), 6);\n\t\tassertEquals(project.getEstHoursRemaining(), 188);\n\t\tassertEquals(project.getHourBudget(), 200);\n\t\tassertEquals(project.getHoursAllocatedToActivities(), 20);\n\t\tassertEquals(project.getHoursRegistered(), 12);\n\t}", "@Test\n void getAddressBook() {\n\n assertEquals(test_AddressBook, controllerTest.getModel());\n\n }", "@Test\n public void update() {\n try{\n repo.save(s);\n repot.save(t);\n repon.save(n);\n Tema t2 = new Tema(1, 0, 6, \"GUI\");\n Student s2 = new Student(1,221, \"Pop Ion\",\"[email protected]\",\"prof\");\n Nota n2 = new Nota(1, 1, \"prof\", 10, \"Irelevant\");\n repo.save(s2);\n repot.save(t2);\n repon.save(n2);\n repo.update(s2);\n repot.update(t2);\n repon.update(n2);\n assert repo.findOne(1).getGrupa()==221;\n assert repot.findOne(1).getDeadline()==8;\n assert repon.findOne(\"11\").getFeedback()==\"Irelevant\";\n\n }\n catch (ValidationException e){\n }\n }", "@Test\n\t@Transactional\n\tpublic void testCRUD() {\n\t\tRegion region = regionRepository.findByRegionIdEquals(4L);\n\t\tCountry country = new Country(\"ZZ\", \"ZebraLand\", region);\n\t\tcountryRepository.save(country);\n\t\tList<Country> countries = countryRepository.findByCountryNameLike(\"ZebraLand\");\n\t\tassertThat(countries).isNotEmpty().doesNotContainNull().size().isEqualTo(1);\n\t\tassertThat(countries.get(0)).isEqualToComparingFieldByFieldRecursively(country);\n\n\t\t// Update existing Country\n\t\tcountry.setCountryName(\"ZebraWorld\");\n\t\tcountryRepository.save(country);\n\t\tCountry actualCountry = countryRepository.findByCountryIdEquals(\"ZZ\");\n\t\tassertThat(actualCountry).isNotNull().isEqualToComparingFieldByFieldRecursively(country);\n\n\t\t// Delete existing Country\n\t\tcountryRepository.delete(country);\n\t\tactualCountry = countryRepository.findByCountryIdEquals(\"ZZ\");\n\t\tassertThat(actualCountry).isNull();\n\t}", "@Test\n public void testValidApply() {\n with().parameters(\"loanAmount\", \"10\", \"term\", \"12 month\", \"name\", \"bob\", \"surname\", \"smith\", \"personalId\", \"wootw00t\").expect().body(\"passed\", equalTo(true)).when().post(\"/apply\");\n //Additional user should be insterted, we have one from fixture sql\n assertEquals(2, userDataRepository.count());\n UserData insertedUser = userDataRepository.findByPersonalId(\"wootw00t\");\n assertNotNull(insertedUser);\n //Custom clean up\n userDataRepository.delete(insertedUser);\n }", "@Test\n public void updatePage() {\n }", "@Test\n\tpublic void testQuestion() {\n\t\tquestions.setQuestions(\"Do you have any changes?\");\n\t\tassertEquals(\"Do you have any changes?\",questions.getQuestions());\n\t}", "@Test\n @Transactional\n public void getAllCategoriesByOwnerIsEqualToSomething() throws Exception {\n User owner = category.getOwner();\n categoryRepository.saveAndFlush(category);\n Long ownerId = owner.getId();\n\n // Get all the categoryList where owner equals to ownerId\n defaultCategoryShouldBeFound(\"ownerId.equals=\" + ownerId);\n\n // Get all the categoryList where owner equals to ownerId + 1\n defaultCategoryShouldNotBeFound(\"ownerId.equals=\" + (ownerId + 1));\n }", "@Test\n public void functionalityTest() {\n new TestBuilder()\n .setModel(MODEL_PATH)\n .setContext(new ModelImplementationGroup3())\n .setPathGenerator(new RandomPath(new EdgeCoverage(100)))\n .setStart(\"e_GoToPage\")\n .execute();\n }", "@Test\n public void testCanUpdatePublisher() {\n Publisher publisher = new Publisher();\n publisher.setName(\"Publisher\");\n publisher = publisherRepo.save(publisher);\n publisher = publisherRepo.findOne(publisher.getId());\n\n publisher.setName(\"New name\");\n publisher = publisherRepo.save(publisher);\n Publisher retrievedPublisher = publisherRepo.findOne(publisher.getId());\n assertThat(retrievedPublisher.getName(), equalTo(\"New name\"));\n }", "@Override\n public void testCreateRequestListSomeFilteredBySourceSystem(){\n }", "@Test\n public void testWin() throws Exception {\n // Setup\n\n // Run the test\n modelUnderTest.win();\n\n // Verify the results\n }", "public void commitChanges(){\n\t\tskipRulesView.updateSkipRule();\n\t\tvalidationRulesView.updateValidationRule();\n\t\tdynamicListsView.updateDynamicLists();\n\t}", "@Test\n public void testEdit() throws Exception {\n // create citation entity to reflect the change that happens after calling edit\n Citation entity = getSampleCitation();\n\n // pretend the entity was edited and return new entity\n doNothing().when(Service).editUrl(any(String.class), any(String.class));\n when(Service.retrieveCitation(any(String.class))).thenReturn(entity);\n\n // test to see that the correct view is returned\n ModelAndView mav = Controller.edit(\"\", \"\");\n Assert.assertEquals(\"result\", mav.getViewName());\n\n // test to see that Json is formated properly\n Map<String, Object> map = mav.getModel();\n String jsonObject = (String) map.get(\"message\");\n testJsonObject(jsonObject, entity);\n }", "@Test\n public void testDAM32102001() {\n // By default the loading related entity is eager.\n testDAM32101001();\n }", "@Override\n\tpublic void setAutomataChanges() {\n\t\t\n\t}", "@Test\r\n public void testUpdate() {\r\n }", "@Test\r\n\tpublic void testGetContributors() {\r\n\t\tcm = Contributormanager.getInstance();\r\n\t\tassertTrue(cm.addContributor(\"Chris\"));\r\n\t\tassertTrue(cm.addContributor(\"Anna\"));\r\n\t\tObservableList<Contributor> con = cm.getContributors();\r\n\t\tfor(Contributor c:con) {\r\n\t\t\tassertTrue(cm.getContributors().contains(c));\r\n\t\t}\r\n\t}", "@Test\n public void UpdatePerroTest() throws BusinessLogicException {\n\n PerroEntity entity = Perrodata.get(0);\n int edada =entity.getEdad();\n if(edada<0)\n {\n entity.setEdad(edada*-1);\n }\n \n PerroEntity newEntity = factory.manufacturePojo(PerroEntity.class);\n \n int e = newEntity.getEdad();\n if(e<0)\n {\n newEntity.setEdad(e*-1);\n }\n \n newEntity.setId(entity.getId());\n perroLogic.updatePerro(newEntity.getId(), newEntity);\n \n \n PerroEntity resp = em.find(PerroEntity.class, entity.getId());\n \n int eda =resp.getEdad();\n if(eda<0)\n {\n resp.setEdad(eda*-1);\n }\n \n Assert.assertEquals(newEntity.getId(), resp.getId());\n Assert.assertEquals(newEntity.getIdPerro(), resp.getIdPerro());\n Assert.assertEquals(newEntity.getNombre(), resp.getNombre());\n Assert.assertEquals(newEntity.getEdad(), resp.getEdad());\n Assert.assertEquals(newEntity.getRaza(), resp.getRaza());\n }", "@Test\n void testUpdateGoalie() {\n\n }", "@Test\n public void testUp(){\n controller.setUp(true);\n assertTrue(controller.getUp());\n }", "private void applyRules () throws DataNormalizationException {\n\t\tapplyRules(null);\n\t}", "@Test\n public void testAlterarSala() {\n System.out.println(\"alterarSala\");\n Simulacao simulacao = new Simulacao();\n simulacao.setSala(sala);\n AlterarTemperaturasMeioController instance = new AlterarTemperaturasMeioController(simulacao);\n instance.alterarSala();\n }", "@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}", "@Test(description = \"update interface with one relationship for existing interface with all relationships\")\n public void updateOneRelationship4ExistingAllRelationships()\n throws Exception\n {\n final DataCollection data = new DataCollection(this);\n final RelationshipData rel = data.getRelationship(\"TestRel\");\n final InterfaceData inter = data.getInterface(\"TestInterface\").addAllRelationships();\n data.create();\n\n inter.removeRelationships()\n .addRelationship(rel);\n this.update(inter);\n\n Assert.assertEquals(this.mql(\"print interface '\" + inter.getName() + \"' select relationship dump\"),\n rel.getName(),\n \"check that only one relationship is defined\");\n }", "@Override\n public boolean applies() {\n return true;\n }", "@Test\n public void execute_filteredContactList_editSuccess() {\n showContactAtIndex(model, INDEX_FIRST_CONTACT);\n\n Contact contactInFilteredList = model.getFilteredContactList().get(INDEX_FIRST_CONTACT.getZeroBased());\n Contact editedContact = new ContactBuilder(contactInFilteredList).withName(VALID_NAME_BOB).build();\n\n EditContactDescriptor descriptor = new EditContactDescriptorBuilder().withName(VALID_NAME_BOB).build();\n\n EditContactCommand editContactCommand = new EditContactCommand(INDEX_FIRST_CONTACT, descriptor);\n\n String expectedMessage = String.format(EditContactCommand.MESSAGE_EDIT_CONTACT_SUCCESS, editedContact);\n\n Model expectedModel = new ModelManager(new ModuleList(), new ModuleList(),\n new ContactList(model.getContactList()), new TodoList(), new EventList(), new UserPrefs());\n\n expectedModel.setContact(model.getFilteredContactList().get(0), editedContact);\n\n assertCommandSuccess(editContactCommand, model, expectedMessage, expectedModel);\n }", "@Test\n\tpublic void testCanonicalCoursesReconciled() throws Exception {\n\t\tCanonicalCourse cc = cmService.getCanonicalCourse(\"biology_101\");\n\t\tString oldTitle = cc.getTitle();\n\t\tcc.setTitle(\"new title\");\n\t\tcmAdmin.updateCanonicalCourse(cc);\n\t\t\n\t\t// Ensure that it was indeed updated\n\t\tAssert.assertEquals(\"new title\", cmService.getCanonicalCourse(\"biology_101\").getTitle());\n\t\t\n\t\t// Reconcile again\n\t\tjob.syncAllCmObjects();\n\t\t\n\t\t// Ensure that the reconciliation updated the data\n\t\tAssert.assertEquals(oldTitle, cmService.getCanonicalCourse(\"biology_101\").getTitle());\n\t}", "@Test\n void _correctThenCaseTest() {\n\n actionApply();\n\n for (ReceiverPair receiverPair : dependedReceiverPairs) {\n for (AssingablePair assingablePair : incompatibleAssignablePairs) {\n verify(model).arithm(receiverPair.getVariableDependentReceiver(), \"!=\", assingablePair.getIndexdependentAssignable());\n }\n }\n }", "public void testGetPersonChanges() throws Exception {\r\n LOG.info(\"getPersonChanges\");\r\n String startDate = \"\";\r\n String endDate = \"\";\r\n tmdb.getPersonChanges(ID_PERSON_BRUCE_WILLIS, startDate, endDate);\r\n }", "@Test\n public void testUpdateCar() {\n\n }", "@Test\r\n public void testSearch(){\r\n\r\n BusinessObjectService boService = KRADServiceLocator.getBusinessObjectService();\r\n String chartOfAccountsCode = \"BL\";\r\n String accountNumber = \"1222222\";\r\n String accountName = \"testTempRestricted\";\r\n String organizationCode = \"AAAI\";\r\n Date accountEffectiveDate = SpringContext.getBean(DateTimeService.class).getCurrentSqlDate();//\"03/07/2012\";\r\n String subFundGroupCode = \"AUXAMB\";\r\n String universityAccountNumber = \"1234\";\r\n String fiscalOfficerUserName = \"ole-cswinson\";\r\n String accountRestrictedStatusCode = \"T\";\r\n Date accountRestrictedStatusDate = SpringContext.getBean(DateTimeService.class).getCurrentSqlDate();\r\n String accountSufficientFundsCode = \"A\";\r\n String accountExpenseGuidelineText = \"test guide line text for temporary restricted\";\r\n\r\n Chart chartOfAccounts = new Chart();\r\n chartOfAccounts.setChartOfAccountsCode(chartOfAccountsCode);\r\n\r\n AccountGuideline accountGuideline = new AccountGuideline();\r\n accountGuideline.setAccountExpenseGuidelineText(accountExpenseGuidelineText);\r\n accountGuideline.setChartOfAccountsCode(chartOfAccountsCode);\r\n accountGuideline.setAccountNumber(accountNumber);\r\n\r\n\r\n Account account = new Account();\r\n account.setChartOfAccounts(chartOfAccounts);\r\n account.setChartOfAccountsCode(chartOfAccountsCode);\r\n account.getChartOfAccountsCode();\r\n account.setAccountNumber(accountNumber);\r\n account.setAccountName(accountName);\r\n account.setOrganizationCode(organizationCode);\r\n account.setAccountEffectiveDate(accountEffectiveDate);\r\n account.setSubFundGroupCode(subFundGroupCode);\r\n account.setUniversityAccountNumber(universityAccountNumber);\r\n ((PersonImpl)account.getAccountFiscalOfficerUser()).setName(fiscalOfficerUserName);\r\n account.setAccountRestrictedStatusCode(accountRestrictedStatusCode);\r\n account.setAccountRestrictedStatusDate(accountRestrictedStatusDate);\r\n account.setAccountSufficientFundsCode(accountSufficientFundsCode);\r\n account.setAccountGuideline(accountGuideline);\r\n\r\n boService.save(account);\r\n\r\n String chartOfAccountsCode1 = \"BL\";\r\n String accountNumber1 = \"1222223\";\r\n String accountName1 = \"testUnRestricted\";\r\n String organizationCode1 = \"AAAI\";\r\n Date accountEffectiveDate1 = SpringContext.getBean(DateTimeService.class).getCurrentSqlDate();//\"03/07/2012\";\r\n String subFundGroupCode1 = \"AUXAMB\";\r\n String universityAccountNumber1 = \"1245\";\r\n String fiscalOfficerUserName1 = \"ole-cswinson\";\r\n String accountRestrictedStatusCode1 = \"U\";\r\n String accountSufficientFundsCode1 = \"A\";\r\n String accountExpenseGuidelineText1 = \"test guide line text for un-restricted\";\r\n\r\n Chart chartOfAccounts1 = new Chart();\r\n chartOfAccounts1.setChartOfAccountsCode(chartOfAccountsCode1);\r\n\r\n AccountGuideline accountGuideline1 = new AccountGuideline();\r\n accountGuideline1.setAccountExpenseGuidelineText(accountExpenseGuidelineText1);\r\n accountGuideline1.setChartOfAccountsCode(chartOfAccountsCode1);\r\n accountGuideline1.setAccountNumber(accountNumber1);\r\n\r\n Account account1 = new Account();\r\n account1.setChartOfAccounts(chartOfAccounts1);\r\n account1.setChartOfAccountsCode(chartOfAccountsCode1);\r\n account1.setAccountNumber(accountNumber1);\r\n account1.setAccountName(accountName1);\r\n account1.setOrganizationCode(organizationCode1);\r\n account1.setAccountEffectiveDate(accountEffectiveDate1);\r\n account1.setSubFundGroupCode(subFundGroupCode1);\r\n account1.setUniversityAccountNumber(universityAccountNumber1);\r\n ((PersonImpl)account1.getAccountFiscalOfficerUser()).setName(fiscalOfficerUserName1);\r\n account1.setAccountRestrictedStatusCode(accountRestrictedStatusCode1);\r\n account1.setAccountSufficientFundsCode(accountSufficientFundsCode1);\r\n account1.setAccountGuideline(accountGuideline1);\r\n\r\n boService.save(account1);\r\n\r\n\r\n List<Account> accounts = (List<Account>) boService.findAll(Account.class);\r\n for(int i=0;i<accounts.size();i++){\r\n if(accounts.get(i).getAccountNumber().equalsIgnoreCase(accountNumber) || accounts.get(i).getAccountNumber().equalsIgnoreCase(accountNumber1)){\r\n if(accounts.get(i).getAccountRestrictedStatusCode().equalsIgnoreCase(\"T\")){\r\n accounts.remove(i);\r\n }\r\n assertEquals(accounts.get(i).getAccountName(), accountName1);\r\n }\r\n }\r\n }", "@Test\n public void useReferencesToStoreDataToOtherObjects() {\n flushTestUsers();\n eddard.setChildren(Arrays.asList(jon, robb, sansa, arya, bran, rickon));\n repository.save(eddard);\n assertThat(repository.findById(eddard.getId())).hasValueSatisfying(it -> {\n assertThat(it.getChildren()).contains(jon, robb, sansa, arya, bran, rickon);\n });\n repository.deleteAll(Arrays.asList(robb, jon));\n assertThat(repository.findById(eddard.getId())).hasValueSatisfying(it -> {\n assertThat(it.getChildren()).contains(sansa, arya, bran, rickon);\n assertThat(it.getChildren()).doesNotContain(robb, jon);\n });\n }", "public void test27() {\n //$NON-NLS-1$\n deployBundles(\"test27\");\n IApiBaseline before = getBeforeState();\n IApiBaseline after = getAfterState();\n IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", beforeApiComponent);\n IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", afterApiComponent);\n IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after, VisibilityModifiers.ALL_VISIBILITIES, null);\n //$NON-NLS-1$\n assertNotNull(\"No delta\", delta);\n IDelta[] allLeavesDeltas = collectLeaves(delta);\n //$NON-NLS-1$\n assertEquals(\"Wrong size\", 2, allLeavesDeltas.length);\n IDelta child = allLeavesDeltas[0];\n //$NON-NLS-1$\n assertEquals(\"Wrong kind\", IDelta.ADDED, child.getKind());\n //$NON-NLS-1$\n assertTrue(\"Is visible\", !Util.isVisible(child.getNewModifiers()));\n //$NON-NLS-1$\n assertEquals(\"Wrong flag\", IDelta.VALUE, child.getFlags());\n //$NON-NLS-1$\n assertEquals(\"Wrong element type\", IDelta.FIELD_ELEMENT_TYPE, child.getElementType());\n //$NON-NLS-1$\n assertTrue(\"Not compatible\", DeltaProcessor.isCompatible(child));\n child = allLeavesDeltas[1];\n //$NON-NLS-1$\n assertEquals(\"Wrong kind\", IDelta.CHANGED, child.getKind());\n //$NON-NLS-1$\n assertTrue(\"Is visible\", !Util.isVisible(child.getNewModifiers()));\n //$NON-NLS-1$\n assertEquals(\"Wrong flag\", IDelta.NON_FINAL_TO_FINAL, child.getFlags());\n //$NON-NLS-1$\n assertEquals(\"Wrong element type\", IDelta.FIELD_ELEMENT_TYPE, child.getElementType());\n //$NON-NLS-1$\n assertTrue(\"Is compatible\", DeltaProcessor.isCompatible(child));\n }", "@Test\n\t@Override\n\tpublic void testUpdateObjectNotFoundXml() throws Exception {\n\t}", "@Test\n public void testModificar() {\n System.out.println(\"Edit\");\n Repositorio repo = new RepositorioImpl();\n Persona persona = new Persona();\n persona.setNombre(\"Hugo\");\n persona.setApellido(\"González\");\n persona.setNumeroDocumento(\"4475199\");\n repo.crear(persona);\n \n //recuperacion\n Persona p = (Persona) repo.buscar(persona.getId());\n \n //modificacion\n p.setNumeroDocumento(\"4475188\");\n repo.modificar(p);\n \n //test\n Persona pmod = (Persona)repo.buscar(persona.getId());\n assertEquals(pmod.getId(), p.getId());\n assertEquals(\"4475188\", pmod.getNumeroDocumento());\n }", "private void verifyChanges() {\n System.out.println(\"Verify changes\"); \n }", "@Test\r\n public void testUpdate() {\r\n assertTrue(false);\r\n }", "@Test\n public void testSetAttributes() {\n System.out.println(\"setAttributes\");\n ArrayList<ProjectAttribute> attributes = null;\n ProjectEditController instance = new ProjectEditController();\n instance.setAttributes(attributes);\n assertEquals(instance.getAttributes(), attributes);\n\n }", "@Test(description = \"positive test to change from all types to multiple types\")\n public void positiveTestChangeFromTypeAll()\n throws Exception\n {\n new RelationshipData(this, \"Test\")\n .from().defDataAll(\"type\")\n .create();\n\n new RelationshipData(this, \"Test\")\n .from().defData(\"type\", new TypeData(this, \"Test1\"))\n .from().defData(\"type\", new TypeData(this, \"Test2\"))\n .createDependings()\n .update(\"\")\n .checkExport();\n }", "public static void main(String args[]) {\n Model model = ModelFactory.createDefaultModel(); \n\n//set namespace\n Resource NAMESPACE = model.createResource( relationshipUri );\n \tmodel.setNsPrefix( \"rela\", relationshipUri);\n \n// Create the types of Property we need to describe relationships in the model\n Property childOf = model.createProperty(relationshipUri,\"childOf\"); \n Property siblingOf = model.createProperty(relationshipUri,\"siblingOf\");\n Property spouseOf = model.createProperty(relationshipUri,\"spouseOf\");\n Property parentOf = model.createProperty(relationshipUri,\"parentOf\"); \n \n \n// Create resources representing the people in our model\n Resource Siddharth = model.createResource(familyUri+\"Siddharth\");\n Resource Dhvanit = model.createResource(familyUri+\"Dhvanit\");\n Resource Rekha = model.createResource(familyUri+\"Rekha\");\n Resource Sandeep = model.createResource(familyUri+\"Sandeep\");\n Resource Kanchan = model.createResource(familyUri+\"Kanchan\");\n Resource Pihu = model.createResource(familyUri+\"Pihu\");\n Resource DwarkaPrasad = model.createResource(familyUri+\"Dwarkesh\");\n Resource Shakuntala = model.createResource(familyUri+\"Shakuntala\");\n Resource Santosh = model.createResource(familyUri+\"Santosh\");\n Resource Usha = model.createResource(familyUri+\"Usha\");\n Resource Priyadarshan = model.createResource(familyUri+\"Priyadarshan\");\n Resource Sudarshan = model.createResource(familyUri+\"Sudarshan\");\n Resource Pragya = model.createResource(familyUri+\"Pragya\");\n Resource Shailendra = model.createResource(familyUri+\"Shailendra\");\n Resource Rajni = model.createResource(familyUri+\"Rajni\");\n Resource Harsh = model.createResource(familyUri+\"Harsh\");\n Resource Satendra = model.createResource(familyUri+\"Satendra\");\n Resource Vandana = model.createResource(familyUri+\"Vandana\");\n Resource Priyam = model.createResource(familyUri+\"Priyam\");\n Resource Darshan = model.createResource(familyUri+\"Darshan\");\n Resource Vardhan = model.createResource(familyUri+\"Vardhan\");\n \n List<Statement> list = new ArrayList(); \n list.add(model.createStatement(Dhvanit,spouseOf,Kanchan)); \n list.add(model.createStatement(Sandeep,spouseOf,Rekha)); \n list.add(model.createStatement(DwarkaPrasad,spouseOf,Shakuntala)); \n list.add(model.createStatement(Santosh,spouseOf,Usha)); \n list.add(model.createStatement(Shailendra,spouseOf,Rajni)); \n list.add(model.createStatement(Satendra,spouseOf,Vandana)); \n list.add(model.createStatement(Sandeep,childOf,DwarkaPrasad)); \n list.add(model.createStatement(Sandeep,childOf,Shakuntala)); \n list.add(model.createStatement(Santosh,childOf,DwarkaPrasad)); \n list.add(model.createStatement(Santosh,childOf,Shakuntala)); \n list.add(model.createStatement(Shailendra,childOf,DwarkaPrasad)); \n list.add(model.createStatement(Shailendra,childOf,Shakuntala)); \n list.add(model.createStatement(Satendra,childOf,DwarkaPrasad)); \n list.add(model.createStatement(Satendra,childOf,Shakuntala)); \n list.add(model.createStatement(DwarkaPrasad,parentOf,Sandeep)); \n list.add(model.createStatement(DwarkaPrasad,parentOf,Santosh)); \n list.add(model.createStatement(DwarkaPrasad,parentOf,Shailendra)); \n list.add(model.createStatement(DwarkaPrasad,parentOf,Satendra)); \n list.add(model.createStatement(Shakuntala,parentOf,Sandeep)); \n list.add(model.createStatement(Shakuntala,parentOf,Santosh)); \n list.add(model.createStatement(Shakuntala,parentOf,Shailendra)); \n list.add(model.createStatement(Shakuntala,parentOf,Satendra)); \n list.add(model.createStatement(Sandeep,parentOf,Siddharth)); \n list.add(model.createStatement(Sandeep,parentOf,Dhvanit)); \n list.add(model.createStatement(Rekha,parentOf,Siddharth)); \n list.add(model.createStatement(Rekha,parentOf,Dhvanit)); \n list.add(model.createStatement(Siddharth,childOf,Rekha)); \n list.add(model.createStatement(Dhvanit,childOf,Rekha)); \n list.add(model.createStatement(Siddharth,childOf,Sandeep)); \n list.add(model.createStatement(Dhvanit,childOf,Sandeep)); \n list.add(model.createStatement(Harsh,childOf,Shailendra)); \n list.add(model.createStatement(Harsh,childOf,Rajni)); \n list.add(model.createStatement(Shailendra,parentOf,Harsh)); \n list.add(model.createStatement(Rajni,parentOf,Harsh)); \n list.add(model.createStatement(Santosh,parentOf,Priyadarshan)); \n list.add(model.createStatement(Santosh,parentOf,Sudarshan));\n list.add(model.createStatement(Santosh,parentOf,Pragya));\n list.add(model.createStatement(Usha,parentOf,Priyadarshan)); \n list.add(model.createStatement(Usha,parentOf,Sudarshan));\n list.add(model.createStatement(Usha,parentOf,Pragya));\n list.add(model.createStatement(Priyadarshan,childOf,Santosh));\n list.add(model.createStatement(Pragya,childOf,Santosh));\n list.add(model.createStatement(Sudarshan,childOf,Santosh));\n list.add(model.createStatement(Priyadarshan,childOf,Usha));\n list.add(model.createStatement(Pragya,childOf,Usha));\n list.add(model.createStatement(Sudarshan,childOf,Usha));\n list.add(model.createStatement(Satendra,parentOf,Priyam)); \n list.add(model.createStatement(Satendra,parentOf,Darshan));\n list.add(model.createStatement(Satendra,parentOf,Vardhan));\n list.add(model.createStatement(Vandana,parentOf,Priyam)); \n list.add(model.createStatement(Vandana,parentOf,Darshan));\n list.add(model.createStatement(Vandana,parentOf,Vardhan));\n list.add(model.createStatement(Priyam,childOf,Satendra));\n list.add(model.createStatement(Darshan,childOf,Satendra));\n list.add(model.createStatement(Vardhan,childOf,Satendra));\n list.add(model.createStatement(Priyam,childOf,Vandana));\n list.add(model.createStatement(Darshan,childOf,Vandana));\n list.add(model.createStatement(Vardhan,childOf,Vandana));\n list.add(model.createStatement(Pihu,childOf,Dhvanit));\n list.add(model.createStatement(Pihu,childOf,Kanchan));\n list.add(model.createStatement(Dhvanit,parentOf,Pihu));\n list.add(model.createStatement(Kanchan,parentOf,Pihu));\n list.add(model.createStatement(Siddharth,siblingOf,Dhvanit));\n list.add(model.createStatement(Dhvanit,siblingOf,Siddharth)); \n list.add(model.createStatement(Priyadarshan,siblingOf,Sudarshan));\n list.add(model.createStatement(Priyadarshan,siblingOf,Pragya));\n list.add(model.createStatement(Sudarshan,siblingOf,Priyadarshan));\n list.add(model.createStatement(Sudarshan,siblingOf,Pragya));\n list.add(model.createStatement(Pragya,siblingOf,Priyadarshan));\n list.add(model.createStatement(Pragya,siblingOf,Sudarshan)); \n list.add(model.createStatement(Priyam,siblingOf,Darshan));\n list.add(model.createStatement(Priyam,siblingOf,Vardhan)); \n list.add(model.createStatement(Darshan,siblingOf,Vardhan)); \n list.add(model.createStatement(Darshan,siblingOf,Priyam));\n list.add(model.createStatement(Vardhan,siblingOf,Priyam));\n list.add(model.createStatement(Vardhan,siblingOf,Darshan));\n list.add(model.createStatement(Santosh,siblingOf,Sandeep));\n list.add(model.createStatement(Santosh,siblingOf,Shailendra));\n list.add(model.createStatement(Santosh,siblingOf,Satendra));\n list.add(model.createStatement(Sandeep,siblingOf,Santosh));\n list.add(model.createStatement(Sandeep,siblingOf,Shailendra));\n list.add(model.createStatement(Sandeep,siblingOf,Satendra));\n list.add(model.createStatement(Shailendra,siblingOf,Santosh));\n list.add(model.createStatement(Shailendra,siblingOf,Sandeep));\n list.add(model.createStatement(Shailendra,siblingOf,Satendra));\n list.add(model.createStatement(Satendra,siblingOf,Shailendra));\n list.add(model.createStatement(Satendra,siblingOf,Santosh));\n list.add(model.createStatement(Satendra,siblingOf,Sandeep));\n \n model.add(list);\n try{\n \t File file=new File(\"/Users/siddharthgupta/Documents/workspace/FamilyModel/src/family/family.rdf\");\n \t \tFileOutputStream f1=new FileOutputStream(file);\n \t \tRDFWriter d = model.getWriter(\"RDF/XML-ABBREV\");\n \t \t\t\td.write(model,f1,null);\n \t\t}catch(Exception e) {}\n }", "private void testAclConstraints007() {\n\t\tDmtSession session = null;\n\t\ttry {\n\t\t\tDefaultTestBundleControl.log(\"#testAclConstraints007\");\n tbc.openSessionAndSetNodeAcl(TestExecPluginActivator.LEAF_NODE, DmtConstants.PRINCIPAL_2, Acl.GET );\n tbc.openSessionAndSetNodeAcl(TestExecPluginActivator.INTERIOR_NODE, DmtConstants.PRINCIPAL, Acl.REPLACE );\n\t\t\ttbc.setPermissions(new PermissionInfo(DmtPrincipalPermission.class.getName(),DmtConstants.PRINCIPAL,\"*\"));\n\t\t\tsession = tbc.getDmtAdmin().getSession(DmtConstants.PRINCIPAL,TestExecPluginActivator.ROOT,DmtSession.LOCK_TYPE_EXCLUSIVE);\n\t\t\tsession.setNodeAcl(TestExecPluginActivator.LEAF_NODE,new org.osgi.service.dmt.Acl(\"Get=*\"));\n\t\t\t\n\t\t\tDefaultTestBundleControl.pass(\"If a principal has Replace access to a node, the principal is permitted to change the ACL of all its child nodes\");\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\ttbc.failUnexpectedException(e);\n\t\t} finally {\n\t\t\ttbc.cleanUp(session,TestExecPluginActivator.LEAF_NODE);\n\t\t\ttbc.cleanAcl(TestExecPluginActivator.INTERIOR_NODE);\n\t\t\t\n\t\t}\n\t}", "@Test(description = \"negative test that derived relationship is changed\")\n public void t23b_negativeTestDerivedChanged()\n throws Exception\n {\n this.createNewData(\"Parent1\")\n .create();\n this.createNewData(\"Parent2\")\n .create();\n this.createNewData(\"Test\")\n .create()\n .setValue(\"derived\", AbstractTest.PREFIX + \"Parent1\")\n .update(\"\");\n this.createNewData(\"Test\")\n .setValue(\"derived\", AbstractTest.PREFIX + \"Parent2\")\n .failureUpdate(ErrorKey.DM_RELATION_UPDATE_DERIVED);\n this.createNewData(\"Test\")\n .setValue(\"derived\", AbstractTest.PREFIX + \"Parent1\")\n .checkExport();\n }", "@Test\n\t@Override\n\tpublic void testUpdateObjectOKXml() throws Exception {\n\t}", "@Test\n public void testModificarEjemplar() {\n System.out.println(\"ModificarEjemplar\");\n Ejemplar ejemplar = new EjemplaresList().getEjemplares().get(0);;\n BibliotecarioController instance = new BibliotecarioController();\n Ejemplar expResult = new EjemplaresList().getEjemplares().get(0);;\n Ejemplar result = instance.ModificarEjemplar(ejemplar);\n assertEquals(expResult, result);\n System.out.println(\"Ejemplar dado de baja\\nid:\" + result.getIdEjemplar());\n }", "@Test\n public void updateCoffee() {\n Roaster roaster = new Roaster();\n roaster.setName(\"Roaster 1\");\n roaster.setStreet(\"123 Test Lane\");\n roaster.setCity(\"Crossvile\");\n roaster.setState(\"TN\");\n roaster.setPostal_code(\"38555\");\n roaster.setPhone(\"9312005591\");\n roaster.setEmail(\"[email protected]\");\n roaster.setNote(\"Test Note for Roaster 1\");\n roaster = roasterDao.addRoaster(roaster);\n\n // Create and add coffee to the database\n Coffee coffee = new Coffee();\n coffee.setRoaster_id(roaster.getRoaster_id());\n coffee.setName(\"Starbucks House Blend\");\n coffee.setCount(10);\n coffee.setUnit_price(new BigDecimal(\"12.50\"));\n coffee.setDescription(\"Medium Brew Coffee\");\n coffee.setType(\"Regular\");\n coffeeDao.addCoffee(coffee);\n\n // Update the values of coffee\n coffee.setName(\"Updated Name\");\n coffee.setCount(12);\n coffee.setUnit_price(new BigDecimal(\"13.00\"));\n coffee.setDescription(\"Light Roast\");\n coffee.setType(\"Foreign\");\n coffeeDao.updateCoffee(coffee);\n\n // Create a copy of the new coffee\n Coffee coffeeCopy = coffeeDao.getCoffee(coffee.getCoffee_id());\n\n // Test that coffee and coffeeCopy are equal\n assertEquals(coffee, coffeeCopy);\n }", "@Test\n void testGameContext() {\n Set<Player> playersNotMatched = new HashSet<>(players);\n for(Player player : gameContext.getPlayersTurnOrder()) {\n assertTrue(playersNotMatched.contains(player));\n playersNotMatched.remove(player);\n }\n assertTrue(playersNotMatched.isEmpty());\n\n assertNotNull(gameContext.getMarket());\n assertNotNull(gameContext.getDevelopmentCardsTable());\n assertNotNull(gameContext.getFaithPath());\n assertNotNull(gameContext.getPlayersTurnOrder());\n\n for(Player player : players)\n assertNotNull(gameContext.getPlayerContext(player));\n }", "@Test\n public void editRecipe_CorrectInformation(){\n int returned = testDatabase.addRecipe(testRecipe);\n listOfCategories.clear();\n listOfCategories.add(recipeCategory);\n listOfIngredients.clear();\n Ingredient ingredient = new Ingredient(-1, \"Sugar\");\n testDatabase.addIngredient(ingredient);\n int ingredientID = testDatabase.addIngredient(ingredient);\n RecipeIngredient recipeIngredient = new RecipeIngredient(-1, -1, ingredientID, 1.5, \"tbsp\", \"Brown Sugar\");\n listOfIngredients.add(recipeIngredient);\n listOfDirections.clear();\n RecipeDirection recipeDirection1 = new RecipeDirection(-1, -1, \"TestDirection1\", 1);\n listOfDirections.add(recipeDirection1);\n\n Recipe edited = new Recipe(testRecipe.getKeyID(), \"TestRecipe Updated\", 1.5, 15, 45, true, listOfIngredients, listOfDirections, listOfCategories);\n\n testDatabase.editRecipe(edited);\n Recipe test = testDatabase.getRecipe(returned);\n\n // Check all recipe fields are accurate\n assertEquals(\"editRecipe - Correct Title\", \"TestRecipe Updated\", test.getTitle());\n assertEquals(\"editRecipe - Correct Servings\", 1.5, test.getServings(), 0);\n assertEquals(\"editRecipe - Correct prep_time\", 15, test.getPrep_time(), 0);\n assertEquals(\"editRecipe - Correct total_time\", 45, test.getTotal_time(), 0);\n assertEquals(\"editRecipe - Correct Favorited\", true, test.getFavorited());\n assertEquals(\"editRecipe - Correct Ingredient Unit\", \"tbsp\", test.getIngredientList().get(0).getUnit());\n assertEquals(\"editRecipe - Correct Ingredient Quantity\", 1.5, test.getIngredientList().get(0).getQuantity(), 0);\n assertEquals(\"editRecipe - Correct Ingredient Details\", \"Brown Sugar\", test.getIngredientList().get(0).getDetails());\n assertEquals(\"editRecipe - Correct Direction Text\", \"TestDirection1\", test.getDirectionsList().get(0).getDirectionText());\n assertEquals(\"editRecipe - Correct Direction Number\", 1, test.getDirectionsList().get(0).getDirectionNumber());\n }", "public ApplyExample() {\r\n oredCriteria = new ArrayList<Criteria>();\r\n }", "@Test\n\tpublic void testInterventionRepository() {\n\t\t// Get the singleton instance of the repository.\n\t\tInterventions target = Interventions.getInstance();\n\n\t\t// Add an intervention to the repository.\n\t\tIntervention intervention = new Intervention();\n\t\ttarget.addIntervention(intervention);\n\t}", "@Test\n public void testFindAll_Person_TimeSlot() {\n // more or less tested in testFindEntity_Person_TimeSlot()\n }", "@Test\n public void testUpdate() {\n\n }", "public void test26() {\n //$NON-NLS-1$\n deployBundles(\"test26\");\n IApiBaseline before = getBeforeState();\n IApiBaseline after = getAfterState();\n IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", beforeApiComponent);\n IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", afterApiComponent);\n IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after, VisibilityModifiers.ALL_VISIBILITIES, null);\n //$NON-NLS-1$\n assertNotNull(\"No delta\", delta);\n IDelta[] allLeavesDeltas = collectLeaves(delta);\n //$NON-NLS-1$\n assertEquals(\"Wrong size\", 1, allLeavesDeltas.length);\n IDelta child = allLeavesDeltas[0];\n //$NON-NLS-1$\n assertEquals(\"Wrong kind\", IDelta.CHANGED, child.getKind());\n //$NON-NLS-1$\n assertTrue(\"Is visible\", !Util.isVisible(child.getNewModifiers()));\n //$NON-NLS-1$\n assertEquals(\"Wrong flag\", IDelta.VALUE, child.getFlags());\n //$NON-NLS-1$\n assertEquals(\"Wrong element type\", IDelta.FIELD_ELEMENT_TYPE, child.getElementType());\n //$NON-NLS-1$\n assertTrue(\"Not compatible\", DeltaProcessor.isCompatible(child));\n }" ]
[ "0.5633028", "0.55756056", "0.54302055", "0.54094625", "0.5350545", "0.52887625", "0.52711684", "0.5230132", "0.5209745", "0.5187881", "0.51842034", "0.51841605", "0.51678604", "0.5137979", "0.51214063", "0.50986", "0.50940233", "0.507303", "0.5060271", "0.5051031", "0.5039281", "0.50345266", "0.50234467", "0.5021412", "0.50150955", "0.5001912", "0.4999118", "0.49900132", "0.4987048", "0.49846253", "0.498324", "0.49825528", "0.49798125", "0.49790877", "0.4976949", "0.4975836", "0.49736533", "0.49716774", "0.49712533", "0.49711347", "0.49643385", "0.49608707", "0.49549186", "0.49525806", "0.4952517", "0.4935867", "0.49339062", "0.49324054", "0.49296013", "0.4921265", "0.49197978", "0.49159274", "0.4913435", "0.49078006", "0.49003127", "0.48998082", "0.48932546", "0.48845977", "0.48809117", "0.4879068", "0.48767686", "0.48739433", "0.48731458", "0.48725694", "0.48714784", "0.4866997", "0.4866705", "0.48569643", "0.4854708", "0.48430085", "0.483948", "0.4838271", "0.48351935", "0.48308122", "0.4825055", "0.48247886", "0.48231056", "0.48182043", "0.4818099", "0.48128977", "0.48107702", "0.48049614", "0.48041287", "0.48039094", "0.4800317", "0.47930038", "0.47909495", "0.4788454", "0.47762462", "0.4773928", "0.47719455", "0.4768688", "0.47681218", "0.47659147", "0.47637922", "0.47601724", "0.47601506", "0.47572035", "0.47521856", "0.47515735" ]
0.5481238
2
public for JUnit this static method resolves the rest of a subrow and rest of subcolumn (within a subgrid) when a relationship between two items is set to VALUE_YES
public static void cross(LogicProblem logicProblem, boolean applyChanges) throws RelationshipConflictException { // System.out.println("cross invoked"); HashMap<ItemPair,Relationship> relationshipTable = logicProblem.getRelationshipTable(); HashSet<CategoryPair> categoryPairs = logicProblem.getCategoryPairs(); for (CategoryPair categoryPair : categoryPairs) { //for (Category cat1 : logicProblem.getCategories()){ // for (Category cat2 : logicProblem.getCategories()){ // if (cat1!=cat2) { Category cat1 = categoryPair.first(); Category cat2 = categoryPair.last(); //for (Category cat1 : logicProblem.getCategories()){ // for (Category cat2 : logicProblem.getCategories()){ // if (cat1!=cat2) { for (Item item1 : cat1.getItems()){ for (Item item2 : cat2.getItems()){ Relationship sourceRelationship = relationshipTable.get(new ItemPair(item1,item2)); if (sourceRelationship.getValue()==Relationship.ValueType.VALUE_YES) { // System.out.println("discovered VALUE_YES, setting up the cross"); for (Item itemA : cat1.getItems()){ if (itemA != item1) { Relationship rel = relationshipTable.get(new ItemPair(itemA,item2)); // could track superfluous and conflicts here if (rel.getValue() == Relationship.ValueType.VALUE_UNKNOWN) { Processor.setRelationship(logicProblem, applyChanges, rel, Relationship.ValueType.VALUE_NO, Relationship.LogicType.CROSS, sourceRelationship); // rel.setValue(Relationship.ValueType.VALUE_NO,Relationship.LogicType.CROSS,sourceRelationship); // System.out.println("created VALUE_NO relationship between "+itemA.getName()+" and "+item2.getName()+ " (CROSS)"); } } } for (Item itemB : cat2.getItems()){ if (itemB != item2) { Relationship rel = relationshipTable.get(new ItemPair(item1,itemB)); // could track superfluous and conflicts here if (rel.getValue() == Relationship.ValueType.VALUE_UNKNOWN) { Processor.setRelationship(logicProblem, applyChanges, rel, Relationship.ValueType.VALUE_NO, Relationship.LogicType.CROSS, sourceRelationship); // rel.setValue(Relationship.ValueType.VALUE_NO,Relationship.LogicType.CROSS,sourceRelationship); // System.out.println("created VALUE_NO relationship between "+item1.getName()+" and "+itemB.getName()+ " (CROSS)"); } } } } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testEditBooleanCellWithOtherColumnOnSameFeatureName() throws Exception {\n final UITableRepresentation table = localSession.getLocalSessionBrowser().perCategory().selectViewpoint(\"read_only_column\").selectRepresentation(\"read_only_column\")\n .selectRepresentationInstance(\"new read_only_column\", UITableRepresentation.class).open();\n // Get the second line, which is actually the first sub-line of the first top-level line.\n SWTBotTreeItem[] items = table.getTable().getAllItems()[0].getItems();\n\n // Check the values before.\n assertEquals(\"newEReference1 : B0\", items[0].cell(0));\n assertEquals(\"false\", items[0].cell(1));\n assertEquals(\"false\", items[0].cell(2));\n\n pressKey(table.getTable(), \"arrow_down\");\n pressKey(table.getTable(), \"arrow_down\");\n pressKey(table.getTable(), \"arrow_right\");\n pressKey(table.getTable(), \"space\");\n\n table.getTable().display.syncExec(new Runnable() {\n public void run() {\n table.getTable().widget.update();\n }\n });\n \n // Check the values after: no change expected, the column through which we tried to do the edition has canEdit = <%false%>\n assertEquals(\"newEReference1 : B0\", items[0].cell(0));\n assertEquals(\"false\", items[0].cell(1));\n assertEquals(\"false\", items[0].cell(2));\n\n }", "private boolean canSetSafelyDownColumn(MTreeNode row, MTreeNode col, UnionDoubleIntervals newVal) {\n\t\tMTreeNode rowKids[]=row.getChildren();\n\t\tif (rowKids.length==0) return true;\n\t\tUnionDoubleIntervals rowKidsInts[]=new UnionDoubleIntervals[rowKids.length];\n\t\tfor(int i=0; i<rowKids.length; i++) {\n\t\t\trowKidsInts[i]=get(rowKids[i], col);\n\t\t\tif (rowKidsInts[i]==null) {\n\t\t\t\t//If a sibling is null, I cannot check, so just return\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tUnionDoubleIntervals sum=UnionDoubleIntervals.sum(rowKidsInts);\n\t\treturn newVal.intersects(sum);\n\t}", "private boolean canSetSafelyDownRow(MTreeNode row, MTreeNode col, UnionDoubleIntervals newVal) {\n\t\tMTreeNode colKids[]=col.getChildren();\n\t\tif (colKids.length==0) return true;\n\t\tUnionDoubleIntervals colKidsInts[]=new UnionDoubleIntervals[colKids.length];\n\t\tfor(int i=0; i<colKids.length; i++) {\n\t\t\tcolKidsInts[i]=get(row, colKids[i]);\n\t\t\tif (colKidsInts[i]==null) {\n\t\t\t\t//If a sibling is null, I cannot check, so just return\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tUnionDoubleIntervals sum=UnionDoubleIntervals.sum(colKidsInts);\n\t\treturn newVal.intersects(sum);\n\t}", "public static void pseudoTrueTuples(LogicProblem logicProblem, boolean applyChanges)\r\n throws RelationshipConflictException {\n \r\n HashMap<ItemPair,Relationship> relationshipTable = logicProblem.getRelationshipTable();\r\n HashSet<CategoryPair> categoryPairs = logicProblem.getCategoryPairs();\r\n \r\n// System.out.println(\"searching...\");\r\n //within a subgrid\r\n for (CategoryPair categoryPair : categoryPairs) {\r\n// System.out.println(\"Category pair:\" + categoryPair);\r\n //vertical and horizontal search\r\n for (final boolean verticalOrientation : new boolean[] { false, true } ) {\r\n\r\n Category subrowCategory = verticalOrientation?categoryPair.first():categoryPair.last();\r\n Category subcolumnCategory = verticalOrientation?categoryPair.last():categoryPair.first();\r\n\r\n //commenting \"vertical search\" \r\n //(subrows match first category's items\r\n // subcolumns match second category's items)\r\n\r\n //i (2 to floor(n/2)) is the number of elements in the combination tuple\r\n // i=2 in pseudoTrue pairs\r\n //(for subgrids of 5x5 items, looking for both pairs and triplets becomes redundant\r\n for (int i=2; i<=floor(logicProblem.getNumCategories()/2);i++) {\r\n\r\n //https://github.com/dpaukov/combinatoricslib3/wiki/v3.3.0#1-simple-combinations\r\n List<List<Item>> columnCombinations = Generator.combination(subcolumnCategory.getItems())\r\n .simple(i) //for pseudo true pairs, i=2\r\n .stream()\r\n .collect(Collectors.<List<Item>>toList());\r\n //for i=2, this would contain \r\n //Bethany, Donovan\r\n //Bethany, Elizabeth\r\n //...\r\n //Frederick, Peyton\r\n// columnCombinations.stream().forEach(l -> System.out.println(\r\n// (verticalOrientation?\"vertical\":\"horizontal\")+ \" combo: \"+l.toString()));\r\n\r\n //create the sets\r\n //for each combination, start over\r\n \r\n //columnTuple contains i items with which we will compute set intersections\r\n for (List<Item> columnItemTuple : columnCombinations) {\r\n //Bethany, Donovan\r\n \r\n //similarly, valueNoSets contains i sets of VALUE_NO relationships\r\n List<Set<Item>> valueNoSets = new ArrayList<>(); //size=i\r\n //build a set for each i item of columnTuple\r\n for (Item columnItem : columnItemTuple) {\r\n //Bethany\r\n Set<Item> valueNoSet = new HashSet<>(); //size = n\r\n for (Item rowItem : subrowCategory.getItems()) {\r\n //Haley's Comet ....\r\n if (relationshipTable.get(new ItemPair(rowItem, columnItem)).getValue() == Relationship.ValueType.VALUE_NO)\r\n //stacking all VALUE_NO relationship into vertical set\r\n valueNoSet.add(rowItem); //store into single subcolumn set \r\n }\r\n //adding each vertical set into list of sets\r\n if (valueNoSet.size() >= logicProblem.getNumItems() - i //for pairs, we need three VALUE_NO in the set\r\n && valueNoSet.size() < logicProblem.getNumItems()-1) //uniqueness will take or n-1 cases\r\n valueNoSets.add(valueNoSet); //store single subcolumn into multi-set\r\n }\r\n //magic!\r\n Set<Item> intersectionSet = new HashSet<>(); //avoid NPE when the next call is made\r\n if (valueNoSets.size()>=2) //don't compute intersections otherwise\r\n intersectionSet = Processor.multiSetIntersection(valueNoSets);\r\n\r\n if (intersectionSet.size()==logicProblem.getNumItems()-i) {\r\n \r\n// System.out.println(\"----> found candidates for pseudo true pairs!\");\r\n// intersectionSet.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n// System.out.println(\"\\t\\tvs.\");\r\n// columnItemTuple.stream().forEach(l -> System.out.println(\"\\t\" + l.toString()));\r\n \r\n //create predecessor list\r\n //we can only add the intersection output as predecessors\r\n ArrayList<Dependable> predecessors = new ArrayList<Dependable>();\r\n for (Item intersectionColumn : intersectionSet) {\r\n for (Item rowItem : columnItemTuple) {\r\n predecessors.add(relationshipTable.get(new ItemPair(rowItem, intersectionColumn)));\r\n }\r\n }\r\n\r\n\r\n //we have a bunch of work to do\r\n for (Item everyRowItem : subrowCategory.getItems()) {\r\n //for every row item not in the intersectionSet\r\n if (!intersectionSet.contains(everyRowItem)) {\r\n for (Item everyColumnItem : subcolumnCategory.getItems()) {\r\n //for every column item not in any of the columnTuple list\r\n if (!columnItemTuple.contains(everyColumnItem)) {\r\n Relationship rel = relationshipTable.get(new ItemPair(everyRowItem,everyColumnItem));\r\n if (rel.getValue()!=Relationship.ValueType.VALUE_NO)\r\n Processor.setRelationship(logicProblem, applyChanges, rel, \r\n Relationship.ValueType.VALUE_NO, Relationship.LogicType.PSEUDOTRUE,\r\n predecessors.toArray(new Relationship[predecessors.size()])); \r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }", "private boolean canSetSafelyUpColumn(MTreeNode row, MTreeNode col, UnionDoubleIntervals newVal) {\n\t\tMTreeNode rowParent=row.parent;\n\t\tif (rowParent==null) return true;\n\t\tUnionDoubleIntervals parentInt=get(row, rowParent);\n\t\tMTreeNode rowOtherSibs[]=row.getSiblingsNotSelf();\n\t\tUnionDoubleIntervals rowOtherSibsInts[]=new UnionDoubleIntervals[rowOtherSibs.length+1];\n\t\tfor(int i=0; i<rowOtherSibs.length; i++) {\n\t\t\trowOtherSibsInts[i]=get(rowOtherSibs[i], col);\n\t\t\tif (rowOtherSibsInts[i]==null) {\n\t\t\t\t//If a sibling is null, I cannot check, so just return\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\trowOtherSibsInts[rowOtherSibs.length]=newVal;\n\t\tUnionDoubleIntervals sum=UnionDoubleIntervals.sum(rowOtherSibsInts);\n\t\treturn parentInt.intersects(sum);\n\t}", "private boolean canSetSafelyUpRow(MTreeNode row, MTreeNode col, UnionDoubleIntervals newVal) {\n\t\tMTreeNode colParent=col.parent;\n\t\tif (colParent==null) return true;\n\t\tUnionDoubleIntervals parentInt=get(row, colParent);\n\t\tMTreeNode colOtherSibs[]=col.getSiblingsNotSelf();\n\t\tUnionDoubleIntervals colOtherSibsInts[]=new UnionDoubleIntervals[colOtherSibs.length+1];\n\t\tfor(int i=0; i<colOtherSibs.length; i++) {\n\t\t\tcolOtherSibsInts[i]=get(row, colOtherSibs[i]);\n\t\t\tif (colOtherSibsInts[i]==null) {\n\t\t\t\t//If a sibling is null, I cannot check, so just return\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tcolOtherSibsInts[colOtherSibs.length]=newVal;\n\t\tUnionDoubleIntervals sum=UnionDoubleIntervals.sum(colOtherSibsInts);\n\t\treturn parentInt.intersects(sum);\n\t}", "@DataProvider(name = \"fieldIndexSubheadingDataProvider\")\n public static Object[][] fieldIndexSubheadingDataProvider() throws Exception {\n return new Object[][]\n {\n {true},\n {false},\n };\n }", "private boolean twoRedInTheRow() {\n if (current.isRed() && current.getParent().isRed()) {\n System.out.println(\"twoRedInTheRowRight\\nCurrent and parent are red\");\n return true;\n }\n return false;\n }", "private void setupFieldRows(GridPane mergePanel) {\n int row = 2;\n for (Field field : allFields) {\n Label label = new Label(field.getDisplayName());\n label.setMinWidth(USE_PREF_SIZE);\n mergePanel.add(label, 0, row);\n Optional<String> leftString = leftEntry.getField(field);\n Optional<String> rightString = rightEntry.getField(field);\n if (leftString.equals(rightString)) {\n identicalFields.add(field);\n } else {\n differentFields.add(field);\n }\n\n // Left text pane\n if (leftString.isPresent()) {\n TextFlow tf = new DiffHighlightingTextPane();\n mergePanel.add(tf, 1, row);\n leftTextPanes.put(field, tf);\n }\n\n // Add radio buttons if the two entries do not have identical fields\n if (identicalFields.contains(field)) {\n mergedEntry.setField(field, leftString.get()); // Will only happen if both entries have the field and the content is identical\n } else {\n ToggleGroup group = new ToggleGroup();\n List<RadioButton> list = new ArrayList<>(3);\n for (int k = 0; k < 3; k++) {\n RadioButton button = new RadioButton();\n EasyBind.subscribe(button.selectedProperty(), selected -> updateMergedEntry());\n group.getToggles().add(button);\n mergePanel.add(button, 2 + k, row);\n list.add(button);\n }\n radioButtons.put(field, list);\n if (leftString.isPresent()) {\n leftRadioButtons.add(list.get(LEFT_RADIOBUTTON_INDEX));\n list.get(LEFT_RADIOBUTTON_INDEX).setSelected(true);\n if (!rightString.isPresent()) {\n list.get(RIGHT_RADIOBUTTON_INDEX).setDisable(true);\n } else if (this.defaultRadioButtonSelectionMode == DefaultRadioButtonSelectionMode.RIGHT) {\n list.get(RIGHT_RADIOBUTTON_INDEX).setSelected(true);\n rightRadioButtons.add(list.get(RIGHT_RADIOBUTTON_INDEX));\n } else {\n rightRadioButtons.add(list.get(RIGHT_RADIOBUTTON_INDEX));\n }\n } else {\n list.get(LEFT_RADIOBUTTON_INDEX).setDisable(true);\n list.get(RIGHT_RADIOBUTTON_INDEX).setSelected(true);\n rightRadioButtons.add(list.get(RIGHT_RADIOBUTTON_INDEX));\n }\n }\n\n // Right text pane\n if (rightString.isPresent()) {\n TextFlow tf = new DiffHighlightingTextPane();\n mergePanel.add(tf, 5, row);\n rightTextPanes.put(field, tf);\n }\n row++;\n }\n }", "private boolean correctRowNumber()\n {\n \n extraRows = 0;\n final int oldSize = gradeAndSemesterList.size()-1+extraRows;\n \n \n if(gradeAndSemesterList.get(gradeAndSemesterList.size()-1).type2.ordinal()< 2)\n extraRows += 2 - gradeAndSemesterList.get(gradeAndSemesterList.size()-1).type2.ordinal();\n \n extraRows += 3*(this.extraGradeLevel-gradeAndSemesterList.get(gradeAndSemesterList.size()-1).type1.intValue());\n //Debug.line(\"extra rows post correction:\"+extraRows);\n \n \n this.fireTableRowsDeleted(gradeAndSemesterList.size()-1+extraRows, oldSize);\n return true; \n }", "boolean hasRowLayout();", "private void giveBooleanFunctionForSingleRow(int i) \r\n {\r\n// throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\r\n if(rowBoolean[i].first==0 && rowBoolean[i].second==0)\r\n {\r\n System.out.print(\"A`\");\r\n System.out.print(\"B`\");\r\n }\r\n else if(rowBoolean[i].first==1 && rowBoolean[i].second==1)\r\n {\r\n System.out.print(\"A\");\r\n System.out.print(\"B\");\r\n }\r\n else if(rowBoolean[i].first==0 && rowBoolean[i].second==1)\r\n {\r\n System.out.print(\"A`\");\r\n System.out.print(\"B\");\r\n }\r\n else if(rowBoolean[i].first==1 && rowBoolean[i].second==0)\r\n {\r\n System.out.print(\"A\");\r\n System.out.print(\"B`\");\r\n }\r\n }", "private void testRow( TaskKey aTask, String aBarcode, AircraftKey aAircraft,\n AssemblyKey aAssembly, String aAircraftName, RefSchedPriorityKey aSchedPriority,\n Date aDueDate, RefTaskPriorityKey aTaskPriority, int aTaskPriorityOrd,\n int aNextHighestEventDbId, String aClassModeCd, String aNextHighestTaskClassCd,\n Date aHighestSchedStartGdt, double aDuration, String aPartList, String aToolList,\n String aLabourList, String aWorkTypeList, String aSubtreeList ) {\n\n MxAssert.assertEquals( aTask.toString(), iDataSet.getString( \"task_pk\" ) );\n MxAssert.assertEquals( aBarcode, iDataSet.getString( \"barcode_sdesc\" ) );\n MxAssert.assertEquals( aAircraft.toString(), iDataSet.getString( \"aircraft_pk\" ) );\n MxAssert.assertEquals( aAssembly.toString(), iDataSet.getString( \"assmbl_pk\" ) );\n MxAssert.assertEquals( aAircraftName, iDataSet.getString( \"aircraft_name\" ) );\n MxAssert.assertEquals( aSchedPriority.toString(), iDataSet.getString( \"sched_priority\" ) );\n MxAssert.assertEquals( aDueDate, iDataSet.getDate( \"due_date\" ) );\n MxAssert.assertEquals( aTaskPriority.toString(), iDataSet.getString( \"task_priority\" ) );\n MxAssert.assertEquals( aTaskPriorityOrd, iDataSet.getInt( \"task_priority_ord\" ) );\n\n // Loose Task Specific values\n MxAssert.assertEquals( aNextHighestEventDbId, iDataSet.getInt( \"nh_event_db_id\" ) );\n MxAssert.assertEquals( aClassModeCd, iDataSet.getString( \"class_mode_cd\" ) );\n\n // Non Loose Task Specific values\n MxAssert.assertEquals( aNextHighestTaskClassCd, iDataSet.getString( \"nh_task_class_cd\" ) );\n MxAssert.assertEquals( aHighestSchedStartGdt, iDataSet.getDate( \"h_sched_start_gdt\" ) );\n\n MxAssert.assertEquals( aDuration, iDataSet.getDouble( \"duration\" ) );\n\n if ( aPartList != null ) {\n MxAssert.assertEquals( aPartList, iDataSet.getString( \"part_details_list\" ) );\n }\n\n if ( aToolList != null ) {\n MxAssert.assertEquals( aToolList, iDataSet.getString( \"tools_list\" ) );\n }\n\n if ( aLabourList != null ) {\n MxAssert.assertEquals( aLabourList, iDataSet.getString( \"est_labour_effort_list\" ) );\n }\n\n if ( aWorkTypeList != null ) {\n MxAssert.assertEquals( aWorkTypeList, iDataSet.getString( \"work_types_list\" ) );\n }\n\n if ( aSubtreeList != null ) {\n MxAssert.assertEquals( aSubtreeList, iDataSet.getString( \"subtree_list\" ) );\n }\n }", "private Cell scanSecondDiagonal(Figure value) {\n Figure oppositeValue = game.getOppositeFigure(value);\n int emptyString = 0;\n int emptyRow = 0;\n int emptyCnt = 0;\n int row = 0;\n for (int string = game.getFieldSize() - 1; string >= 0; string--) {\n Figure fieldValue = game.getFieldValue(string,row);\n if (fieldValue.equals(oppositeValue)) {\n emptyCnt = 0;\n break;\n } else if (fieldValue.equals(EMPTY)) {\n emptyCnt++;\n emptyRow = row;\n emptyString = string;\n\n }\n row++;\n }\n if (emptyCnt == 1) {\n return new Cell(emptyString, emptyRow);\n }\n return null;\n }", "@Test void firstRow1and2() {\n\t\tcheckFirstRow1and2(false,5,4);\n\n\t\t// X X X X\n\t\t// X X X X X\n\t\tcheckFirstRow1and2(true,4,5);\n\n\t\t// X\n\t\t// x\n\t\tcheckFirstRow1and2(false,1,1);\n\n\t\t// X\n\t\t// x\n\t\tcheckFirstRow1and2(true,1,1);\n\t}", "public void testNestedComputedColumn( ) throws Exception\n \t{\n \t\tccName = new String[] { \"cc1\", \"cc2\", \"cc3\" };\n \t\tccExpr = new String[] {\n \t\t\t\t\"row.COL0+row.COL1\",\n \t\t\t\t\"row.cc1*100\",\n \t\t\t\t\"Total.runningSum(row.cc1/Total.sum(row.cc1))*100\" };\n \n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.ANY_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \t\t\n \t\tString[] bindingNameRow = new String[7];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc1\";\n \t\tbindingNameRow[5] = \"ROW_cc2\";\n \t\tbindingNameRow[6] = \"ROW_cc3\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[1], 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[2], 0) };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, null, null, null, null, null, null, bindingNameRow,\n \t\t\t\tbindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \t\t\n \t}", "private boolean isChildContent(List<String> row) {\n\t\tif(row.get(4).isEmpty()&&!row.get(5).isEmpty()&&!row.get(6).isEmpty()) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "protected void expandRow( int row, boolean recursively )\n {\n if(treeTable == null)\n {\n return;\n }\n if ( row >= 0 )\n {\n JTree tree = treeTable.getTree();\n tree.expandRow( row );\n if ( recursively )\n {\n TreePath path = tree.getPathForRow( row );\n Object o = path.getLastPathComponent();\n if ( o instanceof Property )\n {\n Property p = ( Property )o;\n int n = p.getPropertyCount();\n for ( int i = 0; i < n; i++ )\n {\n Property pChild = p.getPropertyAt( i );\n expandRow( getRow( pChild ), true );\n }\n }\n }\n }\n }", "@Test\r\n public void testNotificationIndicesOnCollapseItemWithSelectedChild_37366() {\r\n getView().setShowRoot(true);\r\n // select child of root\r\n int index = 3;\r\n getSelectionModel().select(index);\r\n ListChangeReport report = new ListChangeReport(getSelectedIndices());\r\n getRoot().setExpanded(false);\r\n assertEquals(1, report.getEventCount());\r\n }", "protected Object calcRightNullRow()\n {\n return null;\n }", "private boolean isParentContent(List<String> row) {\n\t\tif(!row.get(4).isEmpty()&&row.get(5).isEmpty()&&!row.get(6).isEmpty()) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@Test\n public void shouldTestIsBetweenTwoGroupsOnLevel() {\n this.rowGroupHeaderLayer.addGroupingLevel();\n // group spans Address and Facts\n this.rowGroupHeaderLayer.addGroup(1, \"Test\", 4, 7);\n\n // tests on level 0\n // additional level should not change the results\n shouldTestIsBetweenTwoGroups();\n\n // tests on level 1\n // note that if check on deeper level is false, it also needs to be\n // false on the upper level\n\n // move left reorderToLeftEdge\n assertTrue(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 0, true, MoveDirectionEnum.LEFT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 1, true, MoveDirectionEnum.LEFT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 2, true, MoveDirectionEnum.LEFT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 3, true, MoveDirectionEnum.LEFT));\n assertTrue(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 4, true, MoveDirectionEnum.LEFT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 5, true, MoveDirectionEnum.LEFT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 6, true, MoveDirectionEnum.LEFT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 7, true, MoveDirectionEnum.LEFT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 8, true, MoveDirectionEnum.LEFT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 9, true, MoveDirectionEnum.LEFT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 10, true, MoveDirectionEnum.LEFT));\n assertTrue(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 11, true, MoveDirectionEnum.LEFT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 12, true, MoveDirectionEnum.LEFT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 13, true, MoveDirectionEnum.LEFT));\n\n // move right reorderToLeftEdge\n assertTrue(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 0, true, MoveDirectionEnum.RIGHT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 1, true, MoveDirectionEnum.RIGHT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 2, true, MoveDirectionEnum.RIGHT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 3, true, MoveDirectionEnum.RIGHT));\n assertTrue(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 4, true, MoveDirectionEnum.RIGHT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 5, true, MoveDirectionEnum.RIGHT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 6, true, MoveDirectionEnum.RIGHT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 7, true, MoveDirectionEnum.RIGHT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 8, true, MoveDirectionEnum.RIGHT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 9, true, MoveDirectionEnum.RIGHT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 10, true, MoveDirectionEnum.RIGHT));\n assertTrue(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 11, true, MoveDirectionEnum.RIGHT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 12, true, MoveDirectionEnum.RIGHT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 13, true, MoveDirectionEnum.RIGHT));\n\n // move left reorderToRightEdge\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 0, false, MoveDirectionEnum.LEFT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 1, false, MoveDirectionEnum.LEFT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 2, false, MoveDirectionEnum.LEFT));\n assertTrue(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 3, false, MoveDirectionEnum.LEFT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 4, false, MoveDirectionEnum.LEFT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 5, false, MoveDirectionEnum.LEFT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 6, false, MoveDirectionEnum.LEFT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 7, false, MoveDirectionEnum.LEFT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 8, false, MoveDirectionEnum.LEFT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 9, false, MoveDirectionEnum.LEFT));\n assertTrue(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 10, false, MoveDirectionEnum.LEFT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 11, false, MoveDirectionEnum.LEFT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 12, false, MoveDirectionEnum.LEFT));\n assertTrue(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 13, false, MoveDirectionEnum.LEFT));\n\n // move right reorderToRightEdge\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 0, false, MoveDirectionEnum.RIGHT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 1, false, MoveDirectionEnum.RIGHT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 2, false, MoveDirectionEnum.RIGHT));\n assertTrue(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 3, false, MoveDirectionEnum.RIGHT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 4, false, MoveDirectionEnum.RIGHT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 5, false, MoveDirectionEnum.RIGHT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 6, false, MoveDirectionEnum.RIGHT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 7, false, MoveDirectionEnum.RIGHT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 8, false, MoveDirectionEnum.RIGHT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 9, false, MoveDirectionEnum.RIGHT));\n assertTrue(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 10, false, MoveDirectionEnum.RIGHT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 11, false, MoveDirectionEnum.RIGHT));\n assertFalse(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 12, false, MoveDirectionEnum.RIGHT));\n assertTrue(RowGroupUtils.isBetweenTwoGroups(this.rowGroupHeaderLayer, 1, 13, false, MoveDirectionEnum.RIGHT));\n\n // assertTrue(RowGroupUtils.isBetweenTwoGroups(this.columnGroupHeaderLayer,\n // 1, 0, true, MoveDirectionEnum.LEFT));\n // assertTrue(RowGroupUtils.isBetweenTwoGroups(this.columnGroupHeaderLayer,\n // 1, 4, true, MoveDirectionEnum.LEFT));\n // assertTrue(RowGroupUtils.isBetweenTwoGroups(this.columnGroupHeaderLayer,\n // 1, 11, true, MoveDirectionEnum.LEFT));\n // assertTrue(RowGroupUtils.isBetweenTwoGroups(this.columnGroupHeaderLayer,\n // 1, 13, false, MoveDirectionEnum.RIGHT));\n //\n // assertFalse(RowGroupUtils.isBetweenTwoGroups(this.columnGroupHeaderLayer,\n // 1, 8, true, MoveDirectionEnum.LEFT));\n // assertFalse(RowGroupUtils.isBetweenTwoGroups(this.columnGroupHeaderLayer,\n // 1, 5, true, MoveDirectionEnum.LEFT));\n\n // TODO remove group on level 0\n // no group on level 1 at this positions\n // assertTrue(RowGroupUtils.isBetweenTwoGroups(this.columnGroupHeaderLayer,\n // 1, 0, false, MoveDirectionEnum.LEFT));\n // assertTrue(RowGroupUtils.isBetweenTwoGroups(this.columnGroupHeaderLayer,\n // 1, 2, true, MoveDirectionEnum.LEFT));\n // assertTrue(RowGroupUtils.isBetweenTwoGroups(this.columnGroupHeaderLayer,\n // 1, 12, true, MoveDirectionEnum.LEFT));\n // assertTrue(RowGroupUtils.isBetweenTwoGroups(this.columnGroupHeaderLayer,\n // 1, 13, true, MoveDirectionEnum.RIGHT));\n }", "private boolean isChildHeader(List<String> row) {\n\t\tif(row.get(4).isEmpty()&&!row.get(5).isEmpty()&&row.get(6).isEmpty()) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "protected abstract Object calcJoinRow();", "@Override\n protected List<IColumn<PrismContainerValueWrapper<AssignmentType>, String>> initBasicColumns() {\n List<IColumn<PrismContainerValueWrapper<AssignmentType>, String>> columns = new ArrayList<>();\n\n columns.add(new IconColumn<PrismContainerValueWrapper<AssignmentType>>(Model.of(\"\")) {\n\n private static final long serialVersionUID = 1L;\n\n @Override\n protected DisplayType getIconDisplayType(IModel<PrismContainerValueWrapper<AssignmentType>> rowModel) {\n return WebComponentUtil.createDisplayType(WebComponentUtil.createDefaultBlackIcon(\n AssignmentsUtil.getTargetType(rowModel.getObject().getRealValue())));\n }\n\n });\n\n columns.add(new AbstractColumn<PrismContainerValueWrapper<AssignmentType>, String>(createStringResource(\"PolicyRulesPanel.nameColumn\")){\n private static final long serialVersionUID = 1L;\n\n @Override\n public void populateItem(Item<ICellPopulator<PrismContainerValueWrapper<AssignmentType>>> cellItem,\n String componentId, final IModel<PrismContainerValueWrapper<AssignmentType>> rowModel) {\n String name = AssignmentsUtil.getName(rowModel.getObject(), getParentPage());\n if (StringUtils.isBlank(name)) {\n name = createStringResource(\"AssignmentPanel.noName\").getString();\n }\n cellItem.add(new Label(componentId, Model.of(name)));\n }\n });\n return columns;\n }", "@DataProvider(name = \"data\")\n public Object[][] getRelationships()\n {\n return this.prepareData(\"relationships\",\n new Object[]{\n \"relationship without anything (to test required fields)\",\n new RelationshipData(this, \"TestRelationship\")},\n new Object[]{\n \"relationship without anything (to test escaped characters)\",\n new RelationshipData(this, \"TestRelationship \\\" 1\")},\n new Object[]{\n \"relationship without defined preventduplicates flag (to test default value)\",\n new RelationshipData(this, \"TestRelationship \\\" 1\"),\n new RelationshipData(this, \"TestRelationship \\\" 1\").setFlag(\"preventduplicates\", false)},\n new Object[]{\n \"relationship with triggers (to test escaped triggers)\",\n new RelationshipData(this, \"TestRelationship \\\" 1\").addTrigger(new AbstractDataWithTrigger.TriggerAction(\"modify\", new MQLProgramData(this, \"Test Program\")))},\n new Object[]{\n \"relationship with one rule (multiple are not working!)\",\n new RelationshipData(this, \"TestRelationship\").setRule(new RuleData(this, \"Rule\"))},\n new Object[]{\n \"relationship abstract true\",\n new RelationshipData(this, \"TestRelationship\").setFlag(\"abstract\", true, Create.ViaValue).defNotSupported(Version.V6R2011x, Version.V6R2012x)},\n new Object[]{\n \"relationship abstract false\",\n new RelationshipData(this, \"TestRelationship\").setFlag(\"abstract\", false, Create.ViaValue).defNotSupported(Version.V6R2011x, Version.V6R2012x),\n new RelationshipData(this, \"TestRelationship\")},\n // from side\n new Object[]{\n \"relationship without from propagate connection\",\n new RelationshipData(this, \"TestRelationship\"),\n new RelationshipData(this, \"TestRelationship\")\n .from().defFlag(\"propagateconnection\", true)},\n new Object[]{\n \"relationship with from propagate connection true\",\n new RelationshipData(this, \"TestRelationship\")\n .from().defFlag(\"propagateconnection\", true)},\n new Object[]{\n \"relationship with from propagate connection false\",\n new RelationshipData(this, \"TestRelationship\")\n .from().defFlag(\"propagateconnection\", false)},\n new Object[]{\n \"relationship without from propagate modify\",\n new RelationshipData(this, \"TestRelationship\"),\n new RelationshipData(this, \"TestRelationship\")\n .from().defFlag(\"propagatemodify\", false)},\n new Object[]{\n \"relationship with from propagate modify true\",\n new RelationshipData(this, \"TestRelationship\").from().defFlag(\"propagatemodify\", true)},\n new Object[]{\n \"relationship with from propagate modify false\",\n new RelationshipData(this, \"TestRelationship\").from().defFlag(\"propagatemodify\", false)},\n\n new Object[]{\n \"relationship with escaped from meaning\",\n new RelationshipData(this, \"TestRelationship\").from().defString(\"meaning\", \"this is a \\\"test\\\"\")},\n\n new Object[]{\n \"relationship without from cardinality\",\n new RelationshipData(this, \"TestRelationship\"),\n new RelationshipData(this, \"TestRelationship\").from().defSingle(\"cardinality\", \"many\")},\n new Object[]{\n \"relationship with from cardinality one\",\n new RelationshipData(this, \"TestRelationship\").from().defSingle(\"cardinality\", \"one\")},\n new Object[]{\n \"relationship with from cardinality many\",\n new RelationshipData(this, \"TestRelationship\").from().defSingle(\"cardinality\", \"many\")},\n\n new Object[]{\n \"relationship without from clone behavior\",\n new RelationshipData(this, \"TestRelationship\"),\n new RelationshipData(this, \"TestRelationship\").from().defSingle(\"clone\", \"none\")},\n new Object[]{\n \"relationship with from clone behavior none\",\n new RelationshipData(this, \"TestRelationship\").from().defSingle(\"clone\", \"none\")},\n new Object[]{\n \"relationship with from clone behavior float\",\n new RelationshipData(this, \"TestRelationship\").from().defSingle(\"clone\", \"float\")},\n new Object[]{\n \"relationship with from clone behavior replicate\",\n new RelationshipData(this, \"TestRelationship\").from().defSingle(\"clone\", \"replicate\")},\n\n new Object[]{\n \"relationship without from revision behavior\",\n new RelationshipData(this, \"TestRelationship\"),\n new RelationshipData(this, \"TestRelationship\").from().defSingle(\"revision\", \"none\")},\n new Object[]{\n \"relationship with from revision behavior none\",\n new RelationshipData(this, \"TestRelationship\").from().defSingle(\"revision\", \"none\")},\n new Object[]{\n \"relationship with from revision behavior float\",\n new RelationshipData(this, \"TestRelationship\").from().defSingle(\"revision\", \"float\")},\n new Object[]{\n \"relationship with from revision behavior replicate\",\n new RelationshipData(this, \"TestRelationship\").from().defSingle(\"revision\", \"replicate\")},\n\n new Object[]{\n \"relationship with one from type\",\n new RelationshipData(this, \"TestRelationship \\\" 1\")\n .from().defData(\"type\", new TypeData(this, \"Test Type\"))},\n new Object[]{\n \"relationship with two escaped from types\",\n new RelationshipData(this, \"TestRelationship \\\" 1\")\n .from().defData(\"type\", new TypeData(this, \"Test Type \\\" 1\"))\n .from().defData(\"type\", new TypeData(this, \"Test Type \\\" 2\"))},\n new Object[]{\n \"relationship with all from types\",\n new RelationshipData(this, \"TestRelationship \\\" 1\")\n .from().defDataAll(\"type\")},\n new Object[]{\n \"relationship with one from relationship\",\n new RelationshipData(this, \"TestRelationship \\\" 1\")\n .from().defData(\"relationship\", new RelationshipData(this, \"Test Relationship\"))},\n new Object[]{\n \"relationship with two escaped from relationships\",\n new RelationshipData(this, \"TestRelationship \\\" 1\")\n .from().defData(\"relationship\", new RelationshipData(this, \"Test Relationship \\\" 1\"))\n .from().defData(\"relationship\", new RelationshipData(this, \"Test Relationship \\\" 2\"))},\n new Object[]{\n \"relationship with all from relationships\",\n new RelationshipData(this, \"TestRelationship \\\" 1\")\n .from().defDataAll(\"relationship\")},\n new Object[]{\n \"relationship with two escaped from types and relationships\",\n new RelationshipData(this, \"TestRelationship \\\" 1\")\n .from().defData(\"relationship\", new RelationshipData(this, \"Test Relationship \\\" 1\"))\n .from().defData(\"relationship\", new RelationshipData(this, \"Test Relationship \\\" 2\"))\n .from().defData(\"type\", new TypeData(this, \"Test Type \\\" 1\"))\n .from().defData(\"type\", new TypeData(this, \"Test Type \\\" 2\"))},\n // to side\n new Object[]{\n \"relationship without to propagate connection\",\n new RelationshipData(this, \"TestRelationship\"),\n new RelationshipData(this, \"TestRelationship\").to().defFlag(\"propagateconnection\", true)},\n new Object[]{\n \"relationship with to propagate connection true\",\n new RelationshipData(this, \"TestRelationship\").to().defFlag(\"propagateconnection\", true)},\n new Object[]{\n \"relationship with to propagate connection false\",\n new RelationshipData(this, \"TestRelationship\").to().defFlag(\"propagateconnection\", false)},\n new Object[]{\n \"relationship without to propagate modify\",\n new RelationshipData(this, \"TestRelationship\"),\n new RelationshipData(this, \"TestRelationship\").to().defFlag(\"propagatemodify\", false)},\n new Object[]{\n \"relationship with to propagate modify true\",\n new RelationshipData(this, \"TestRelationship\").to().defFlag(\"propagatemodify\", true)},\n new Object[]{\n \"relationship with to propagate modify false\",\n new RelationshipData(this, \"TestRelationship\").to().defFlag(\"propagatemodify\", false)},\n\n new Object[]{\n \"relationship with escaped meaning\",\n new RelationshipData(this, \"TestRelationship\").to().defString(\"meaning\", \"this is a \\\"test\\\"\")},\n\n new Object[]{\n \"relationship without cardinality\",\n new RelationshipData(this, \"TestRelationship\"),\n new RelationshipData(this, \"TestRelationship\").to().defSingle(\"cardinality\", \"many\")},\n new Object[]{\n \"relationship with cardinality one\",\n new RelationshipData(this, \"TestRelationship\").to().defSingle(\"cardinality\", \"one\")},\n new Object[]{\n \"relationship with cardinality many\",\n new RelationshipData(this, \"TestRelationship\").to().defSingle(\"cardinality\", \"many\")},\n\n new Object[]{\n \"relationship without clone behavior\",\n new RelationshipData(this, \"TestRelationship\"),\n new RelationshipData(this, \"TestRelationship\").to().defSingle(\"clone\", \"none\")},\n new Object[]{\n \"relationship with clone behavior none\",\n new RelationshipData(this, \"TestRelationship\").to().defSingle(\"clone\", \"none\")},\n new Object[]{\n \"relationship with clone behavior float\",\n new RelationshipData(this, \"TestRelationship\").to().defSingle(\"clone\", \"float\")},\n new Object[]{\n \"relationship with clone behavior replicate\",\n new RelationshipData(this, \"TestRelationship\").to().defSingle(\"clone\", \"replicate\")},\n\n new Object[]{\n \"relationship without to revision behavior\",\n new RelationshipData(this, \"TestRelationship\"),\n new RelationshipData(this, \"TestRelationship\").to().defSingle(\"revision\", \"none\")},\n new Object[]{\n \"relationship with to revision behavior none\",\n new RelationshipData(this, \"TestRelationship\").to().defSingle(\"revision\", \"none\")},\n new Object[]{\n \"relationship with to revision behavior float\",\n new RelationshipData(this, \"TestRelationship\").to().defSingle(\"revision\", \"float\")},\n new Object[]{\n \"relationship with to revision behavior replicate\",\n new RelationshipData(this, \"TestRelationship\").to().defSingle(\"revision\", \"replicate\")},\n\n new Object[]{\n \"relationship with one to type\",\n new RelationshipData(this, \"TestRelationship \\\" 1\")\n .to().defData(\"type\", new TypeData(this, \"Test Type\"))},\n new Object[]{\n \"relationship with two escaped to types\",\n new RelationshipData(this, \"TestRelationship \\\" 1\")\n .to().defData(\"type\", new TypeData(this, \"Test Type \\\" 1\"))\n .to().defData(\"type\", new TypeData(this, \"Test Type \\\" 2\"))},\n new Object[]{\n \"relationship with all to types\",\n new RelationshipData(this, \"TestRelationship \\\" 1\")\n .to().defDataAll(\"type\")},\n new Object[]{\n \"relationship with one to relationship\",\n new RelationshipData(this, \"TestRelationship \\\" 1\")\n .to().defData(\"relationship\", new RelationshipData(this, \"Test Relationship\"))},\n new Object[]{\n \"relationship with two escaped to relationships\",\n new RelationshipData(this, \"TestRelationship \\\" 1\")\n .to().defData(\"relationship\", new RelationshipData(this, \"Test Relationship \\\" 1\"))\n .to().defData(\"relationship\", new RelationshipData(this, \"Test Relationship \\\" 2\"))},\n new Object[]{\n \"relationship with all to relationships\",\n new RelationshipData(this, \"TestRelationship \\\" 1\")\n .to().defDataAll(\"relationship\")},\n new Object[]{\n \"relationship with two escaped to types and relationships\",\n new RelationshipData(this, \"TestRelationship \\\" 1\")\n .to().defData(\"relationship\", new RelationshipData(this, \"Test Relationship \\\" 1\"))\n .to().defData(\"relationship\", new RelationshipData(this, \"Test Relationship \\\" 2\"))\n .to().defData(\"type\", new TypeData(this, \"Test Type \\\" 1\"))\n .to().defData(\"type\", new TypeData(this, \"Test Type \\\" 2\"))}\n );\n }", "private boolean isParentHeader(List<String> row) {\n\t\tif(!row.get(4).isEmpty()&&row.get(5).isEmpty()&&row.get(6).isEmpty()) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public void toggleFurnitureVisibleProperty(HomePieceOfFurniture.SortableProperty furnitureProperty) {\n List<SortableProperty> furnitureVisibleProperties = \n new ArrayList<SortableProperty>(this.home.getFurnitureVisibleProperties());\n if (furnitureVisibleProperties.contains(furnitureProperty)) {\n furnitureVisibleProperties.remove(furnitureProperty);\n // Ensure at least one column is visible\n if (furnitureVisibleProperties.isEmpty()) {\n furnitureVisibleProperties.add(HomePieceOfFurniture.SortableProperty.NAME);\n }\n } else {\n // Add furniture property after the visible property that has the previous index in \n // the following list\n List<HomePieceOfFurniture.SortableProperty> propertiesOrder = \n Arrays.asList(new HomePieceOfFurniture.SortableProperty [] {\n HomePieceOfFurniture.SortableProperty.CATALOG_ID, \n HomePieceOfFurniture.SortableProperty.NAME, \n HomePieceOfFurniture.SortableProperty.CREATOR, \n HomePieceOfFurniture.SortableProperty.WIDTH,\n HomePieceOfFurniture.SortableProperty.DEPTH,\n HomePieceOfFurniture.SortableProperty.HEIGHT,\n HomePieceOfFurniture.SortableProperty.X,\n HomePieceOfFurniture.SortableProperty.Y,\n HomePieceOfFurniture.SortableProperty.ELEVATION,\n HomePieceOfFurniture.SortableProperty.ANGLE,\n HomePieceOfFurniture.SortableProperty.LEVEL,\n HomePieceOfFurniture.SortableProperty.MODEL_SIZE,\n HomePieceOfFurniture.SortableProperty.COLOR,\n HomePieceOfFurniture.SortableProperty.TEXTURE,\n HomePieceOfFurniture.SortableProperty.MOVABLE,\n HomePieceOfFurniture.SortableProperty.DOOR_OR_WINDOW,\n HomePieceOfFurniture.SortableProperty.VISIBLE,\n HomePieceOfFurniture.SortableProperty.PRICE,\n HomePieceOfFurniture.SortableProperty.VALUE_ADDED_TAX_PERCENTAGE,\n HomePieceOfFurniture.SortableProperty.VALUE_ADDED_TAX,\n HomePieceOfFurniture.SortableProperty.PRICE_VALUE_ADDED_TAX_INCLUDED}); \n int propertyIndex = propertiesOrder.indexOf(furnitureProperty) - 1;\n if (propertyIndex > 0) { \n while (propertyIndex > 0) {\n int visiblePropertyIndex = furnitureVisibleProperties.indexOf(propertiesOrder.get(propertyIndex));\n if (visiblePropertyIndex >= 0) {\n propertyIndex = visiblePropertyIndex + 1;\n break;\n } else {\n propertyIndex--;\n }\n }\n }\n if (propertyIndex < 0) {\n propertyIndex = 0;\n }\n furnitureVisibleProperties.add(propertyIndex, furnitureProperty);\n }\n this.home.setFurnitureVisibleProperties(furnitureVisibleProperties);\n }", "@Test \r\n public void testSetExpandedChildAtExpandedSame() {\r\n getView().setShowRoot(true);\r\n TreeItem child = createBranch(\"single-replaced-child\");\r\n child.setExpanded(true);\r\n int index = 3;\r\n setItem(index -1, child);\r\n getSelectionModel().select(index);\r\n // replacingChild has same # of children\r\n TreeItem expandedChild = createBranch(\"another-single-replaced\");\r\n expandedChild.setExpanded(true);\r\n assertEquals(\"sanity: same # of children and both expanded\", \r\n child.getChildren().size(), expandedChild.getChildren().size());\r\n setItem(index -1, expandedChild);\r\n\r\n assertEquals(index, getSelectedIndex());\r\n assertEquals(expandedChild, getSelectedItem());\r\n }", "protected void populateDynamicCells(int resultsRow) {\n }", "private BitSet initRowToLayoutBitSet() {\n int rowCount = getItemCount();\n BitSet bitSet = new BitSet(rowCount);\n for (int row = 0; row < rowCount; ++row) {\n if (tableView.isRowFixingEnabled() && tableView.getFixedRows().contains(row)) {\n bitSet.set(row);\n }\n }\n return bitSet;\n }", "@Test\n public void testReverseRow(){\n ROW.getReverseRow(ROW.getIndex());\n }", "void expandChilds() {\n\t\t\tenumAndExpand(this.parentItem);\n\t\t}", "public boolean isExpanded();", "@Test\n public void shouldTestIsReorderValidWithUnbreakableFromNonGroupedRight() {\n this.gridLayer.setClientAreaProvider(new IClientAreaProvider() {\n\n @Override\n public Rectangle getClientArea() {\n return new Rectangle(0, 0, 1600, 250);\n }\n\n });\n this.gridLayer.doCommand(new ClientAreaResizeCommand(new Shell(Display.getDefault(), SWT.V_SCROLL | SWT.H_SCROLL)));\n\n // remove first group\n this.rowGroupHeaderLayer.removeGroup(0);\n\n // set all remaining groups unbreakable\n this.rowGroupHeaderLayer.setGroupUnbreakable(4, true);\n this.rowGroupHeaderLayer.setGroupUnbreakable(8, true);\n this.rowGroupHeaderLayer.setGroupUnbreakable(11, true);\n\n // reorder outside group valid\n assertTrue(RowGroupUtils.isReorderValid(this.rowGroupHeaderLayer, 0, 4, true));\n assertTrue(RowGroupUtils.isReorderValid(this.rowGroupHeaderLayer, 3, 4, true));\n // in same group\n assertTrue(RowGroupUtils.isReorderValid(this.rowGroupHeaderLayer, 6, 7, true));\n assertTrue(RowGroupUtils.isReorderValid(this.rowGroupHeaderLayer, 7, 4, true));\n // in same group where adjacent group is also unbreakable\n assertTrue(RowGroupUtils.isReorderValid(this.rowGroupHeaderLayer, 4, 8, true));\n assertTrue(RowGroupUtils.isReorderValid(this.rowGroupHeaderLayer, 10, 8, true));\n // to any other group\n assertFalse(RowGroupUtils.isReorderValid(this.rowGroupHeaderLayer, 3, 5, true));\n assertFalse(RowGroupUtils.isReorderValid(this.rowGroupHeaderLayer, 0, 6, true));\n assertFalse(RowGroupUtils.isReorderValid(this.rowGroupHeaderLayer, 1, 9, true));\n assertFalse(RowGroupUtils.isReorderValid(this.rowGroupHeaderLayer, 2, 13, true));\n // to start of table\n assertTrue(RowGroupUtils.isReorderValid(this.rowGroupHeaderLayer, 3, 0, true));\n // to end of last group\n assertTrue(RowGroupUtils.isReorderValid(this.rowGroupHeaderLayer, 0, 13, false));\n // between unbreakable groups\n assertTrue(RowGroupUtils.isReorderValid(this.rowGroupHeaderLayer, 3, 8, true));\n }", "private void AdditionalSetUpTable() {\n TableColumnModel stuffcm = stuffTable.getColumnModel();\n \n //update: 22 juni 2006 add column code and modal so we can remove them in propertiesComboBox\n //ActionPerformed when we click \"Additonal Properties\"\n //we have to reference name column so we can put category and code column\n //in the left of the name column\n category = stuffcm.getColumn(0);\n code = stuffcm.getColumn(1);\n \n modal = stuffcm.getColumn(3);\n sale = stuffcm.getColumn(4);\n quantity = stuffcm.getColumn(5);\n \n //update: 2 july 2006, add two column; s = t, Third T\n s_t = stuffcm.getColumn(17);\n third = stuffcm.getColumn(18);\n \n //make it middle\n class MiddleCellEditor extends DefaultTableCellRenderer {\n MiddleCellEditor() {\n super();\n setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n }\n }\n quantity.setCellRenderer( new MiddleCellEditor() );\n \n length = stuffcm.getColumn(8);\n length.setCellRenderer( new MiddleCellEditor() );\n width = stuffcm.getColumn(9);\n width.setCellRenderer( new MiddleCellEditor() );\n height = stuffcm.getColumn(10);\n height.setCellRenderer( new MiddleCellEditor() );\n volume = stuffcm.getColumn(11);\n volume.setCellRenderer( new MiddleCellEditor() );\n primary = stuffcm.getColumn(12);\n measurement = stuffcm.getColumn(13);\n measurement.setCellRenderer( new MiddleCellEditor() );\n secondary = stuffcm.getColumn(14);\n produceritem = stuffcm.getColumn(15);\n selleritem = stuffcm.getColumn(16);\n //index column\n TableColumn stuffcol = stuffcm.getColumn(7);\n stuffTable.removeColumn(stuffcol);\n //comment column\n stufftc = stuffTable.getColumnModel().getColumn(6);\n if(!displayComment.isSelected())\n stuffTable.removeColumn(stufftc);\n \n //remove all column first for the first time\n stuffTable.removeColumn(modal);\n stuffTable.removeColumn(sale);\n stuffTable.removeColumn(quantity);\n stuffTable.removeColumn(code);\n stuffTable.removeColumn(category);\n stuffTable.removeColumn(s_t);\n stuffTable.removeColumn(third);\n \n propertiesComboBoxActionPerformed(null);\n \n //additional setup for \"index\" and \"comment\" column on employeeTable\n TableColumnModel employeecm = employeeTable.getColumnModel();\n //index column\n TableColumn employeecol = employeecm.getColumn(9);\n employeeTable.removeColumn(employeecol);\n //comment column\n employeetc = employeecm.getColumn(8);\n if(!displayCommentEmployee.isSelected())\n employeeTable.removeColumn(employeetc);\n \n //additional setup for sellerTable\n TableColumnModel sellercm = sellerTable.getColumnModel();\n //index column\n TableColumn sellercol = sellercm.getColumn(4);\n sellerTable.removeColumn(sellercol);\n //comment column\n sellertc = sellercm.getColumn(3);\n if(!displayCommentSeller.isSelected())\n sellerTable.removeColumn(sellertc);\n \n //additional setup for salesmanTable\n TableColumnModel salesmancm = salesmanTable.getColumnModel();\n //index column\n TableColumn salesmancol = salesmancm.getColumn(8);\n salesmanTable.removeColumn(salesmancol);\n //comment column\n salesmantc = salesmancm.getColumn(7);\n if(!displayCommentSeller.isSelected())\n salesmanTable.removeColumn(salesmantc);\n \n //additional setup for ProducerTable\n TableColumnModel producercm = ProducerTable.getColumnModel();\n //index column\n TableColumn producercol = producercm.getColumn(4);\n ProducerTable.removeColumn(producercol);\n //comment column\n producertc = producercm.getColumn(3);\n if(!DisplayCommentProducer.isSelected())\n ProducerTable.removeColumn(producertc);\n \n //additional setup for customerTable\n TableColumnModel customercm = customerTable.getColumnModel();\n //index column\n TableColumn customercol = customercm.getColumn(4);\n customerTable.removeColumn(customercol);\n //comment column\n customertc = customercm.getColumn(3);\n if(!displayCommentCustomer.isSelected())\n customerTable.removeColumn(customertc);\n \n //additional setup for commisionerTable\n TableColumnModel commisionercm = commisionerTable.getColumnModel();\n //index column\n TableColumn commisionercol = commisionercm.getColumn(4);\n commisionerTable.removeColumn(commisionercol);\n //comment columnlist\n commisionertc = commisionercm.getColumn(3);\n if(!displayCommentCommisioner.isSelected())\n commisionerTable.removeColumn(commisionertc);\n \n //additional setup for debtcreditTable\n// TableColumn debtcreditcol = DebtCreditTable.getColumnModel().getColumn(5);\n// DebtCreditTable.removeColumn(debtcreditcol);\n \n //additional setup for debt table\n TableColumn debtcol = DebtTable.getColumnModel().getColumn(5);\n DebtTable.removeColumn(debtcol);\n \n //additional setup for sale ( edit trans ) table\n TableColumn salecol = SaleTable.getColumnModel().getColumn(6);\n SaleTable.removeColumn(salecol);\n \n //additional setup for purchase ( edit trans ) table\n TableColumn purchasecol = PurchaseTable.getColumnModel().getColumn(6);\n PurchaseTable.removeColumn(purchasecol);\n \n //additional setup for credit table\n TableColumn creditcol = CreditTable.getColumnModel().getColumn(5);\n CreditTable.removeColumn(creditcol);\n \n //additional setup for warehouseTB\n TableColumn warehouseindexcol = WarehouseTB.getColumnModel().getColumn(3);\n WarehouseTB.removeColumn(warehouseindexcol);\n \n //additional setup for containerTB\n TableColumn containerindexcol = ContainerTB.getColumnModel().getColumn(4);\n ContainerTB.removeColumn(containerindexcol);\n }", "@Test \r\n public void testSetExpandedChildAtExpandedMore() {\r\n getView().setShowRoot(true);\r\n TreeItem child = createBranch(\"single-replaced-child\");\r\n child.setExpanded(true);\r\n int index = 3;\r\n setItem(index -1, child);\r\n getSelectionModel().select(index);\r\n TreeItem expandedChild = createBranch(\"another-single-replaced\");\r\n // replacingChild has more children\r\n expandedChild.getChildren().add(createItem(\"excess grandChild\"));\r\n expandedChild.setExpanded(true);\r\n assertEquals(\"sanity: replacing child has more children and both expanded\", \r\n child.getChildren().size() + 1, expandedChild.getChildren().size());\r\n setItem(index -1, expandedChild);\r\n \r\n assertEquals(index, getSelectedIndex());\r\n assertEquals(expandedChild, getSelectedItem());\r\n }", "@Override\r\n \t public void editingStopped(ChangeEvent e1) {\r\n \t \t if (editor.getState()==0 || editor.getState()==2){\r\n \t \t\t \r\n \t \t\t //is father \r\n \t \t\t for (int i = 0; i<((MyDataNode) editor.getNodeEditing()).getChildrenCount(); i++){\r\n \t \t\t\t((MyDataNode) editor.getNodeEditing()).getChildren().get(i).setExtract(editor.getState());\r\n \t \t\t }\r\n \t \t\t \r\n \t \t\t //is child\r\n \t \t\t if (((MyDataNode) editor.getNodeEditing()).getChildrenCount() == 0){\r\n \t \t\t\tMyDataNode child = (MyDataNode) editor.getNodeEditing();\r\n \t \t\t\tMyDataNode parent = ((MyDataModel) ((MyTreeTableModelAdapter) editor.getTable().getModel()).getTreeTableModel()).getParent(child);\r\n \t \t\t\t\t\t//getParent(child);\r\n \t \t\t\tint total = 0;\r\n \t \t\t\t//WHATCHOUT! getParent returns first equal. If there is more than one equal and you are not modifying the first one => bug!!!\r\n \t \t\t\tfor (int i = 0; i<parent.getChildrenCount(); i++){\r\n \t \t \t\t\ttotal += parent.getChildren().get(i).getExtract(); \t \t \t\t\t\t\r\n \t \t \t\t }\r\n \t \t\t\tif (total != 0 && total != parent.getChildrenCount()*2){\r\n \t \t\t\t\tparent.setExtract(1);\r\n \t \t\t\t}else if (total == 0){\r\n \t \t\t\t\tparent.setExtract(0);\r\n \t \t\t\t}else if (total == parent.getChildrenCount()*2){\r\n \t \t\t\t\tparent.setExtract(2);\r\n \t \t\t\t}\r\n \t \t\t }\r\n\r\n \t \t\t \r\n \t \t }\r\n \t \t int temp = editor.getRowEditing(); \t \t \r\n \t \t editor.setRowEditing(-1);\r\n \t \t editor.getTable().setRowSelectionInterval(temp, temp);\r\n \t \t editor.getTable().repaint();\r\n \t }", "private void testRow( QuerySet aQuerySet, String aPartDescription, int aRemoveQty,\n String aPartSerialOff, String aCondReasonOff, int aWarrentyCoverage,\n String aShedPartKey ) {\n\n Assert.assertEquals( \"part_description\", aPartDescription,\n aQuerySet.getString( \"part_description\" ) );\n Assert.assertEquals( \"removed_quantity\", aRemoveQty, aQuerySet.getInt( \"removed_quantity\" ) );\n\n Assert.assertEquals( \"part_serial_off\", aPartSerialOff,\n aQuerySet.getString( \"part_serial_off\" ) );\n Assert.assertEquals( \"cond_reason_off\", aCondReasonOff,\n aQuerySet.getString( \"cond_reason_off\" ) );\n Assert.assertEquals( \"warranty_coverage\", aWarrentyCoverage,\n aQuerySet.getInt( \"warranty_coverage\" ) );\n Assert.assertEquals( \"sched_part_key\", aShedPartKey,\n aQuerySet.getString( \"sched_part_key\" ) );\n }", "@Test\r\n public void testSetCollapsedChildAtExpanded() {\r\n getView().setShowRoot(true);\r\n TreeItem child = createBranch(\"single-replaced-child\", true);\r\n int index = 3;\r\n setItem(index -1, child);\r\n getSelectionModel().select(index);\r\n TreeItem collapsedChild = createBranch(\"another-single-replaced\");\r\n setItem(index -1, collapsedChild);\r\n assertEquals(index, getSelectedIndex());\r\n assertEquals(collapsedChild, getSelectedItem());\r\n }", "private void setupEntryTypeRow(GridPane mergePanel) {\n int rowIndex = 1;\n mergePanel.add(new Label(Localization.lang(\"Entry type\")), 0, rowIndex);\n if (leftEntry.getType().equals(rightEntry.getType())) {\n mergePanel.add(DiffHighlighting.forUnchanged(leftEntry.getType().getDisplayName()), 1, rowIndex);\n mergePanel.add(DiffHighlighting.forUnchanged(rightEntry.getType().getDisplayName()), 5, rowIndex);\n identicalTypes = true;\n } else {\n mergePanel.add(DiffHighlighting.forChanged(leftEntry.getType().getDisplayName()), 1, rowIndex);\n mergePanel.add(DiffHighlighting.forChanged(rightEntry.getType().getDisplayName()), 5, rowIndex);\n identicalTypes = false;\n ToggleGroup group = new ToggleGroup();\n typeRadioButtons = new ArrayList<>(2);\n\n for (int k = 0; k < 3; k += 2) {\n RadioButton button = new RadioButton();\n EasyBind.subscribe(button.selectedProperty(), selected -> updateMergedEntry());\n typeRadioButtons.add(button);\n group.getToggles().add(button);\n mergePanel.add(button, 2 + k, rowIndex);\n }\n if (defaultRadioButtonSelectionMode == DefaultRadioButtonSelectionMode.RIGHT) {\n typeRadioButtons.get(1).setSelected(true); // This Radio Button list does not have a third option as compared to the fields, so do not use the constants here\n rightRadioButtons.add(typeRadioButtons.get(1));\n } else {\n typeRadioButtons.get(0).setSelected(true);\n leftRadioButtons.add(typeRadioButtons.get(0));\n }\n }\n }", "private boolean subGridCheck() {\n\t\tint sqRt = (int)Math.sqrt(dimension);\n\t\tfor(int i = 0; i < sqRt; i++) {\n\t\t\tint increment = i * sqRt;\n\t\t\tfor(int val = 1; val <= dimension; val++) {\n\t\t\t\tint valCounter = 0;\n\t\t\t\tfor(int row = 0 + increment; row < sqRt + increment; row++) {\n\t\t\t\t\tfor(int col = 0 + increment; col < sqRt + increment; col++) {\n\t\t\t\t\t\tif(puzzle[row][col] == val)\n\t\t\t\t\t\t\tvalCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(valCounter >= 2)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "@Test(dataProvider = \"fieldIndexSubheadingDataProvider\")\n public void fieldIndexSubheading(boolean runSubentriesOnTheSameLine) throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n // Create an INDEX field which will display an entry for each XE field found in the document.\n // Each entry will display the XE field's Text property value on the left side,\n // and the number of the page that contains the XE field on the right.\n // The INDEX entry will collect all XE fields with matching values in the \"Text\" property\n // into one entry as opposed to making an entry for each XE field.\n FieldIndex index = (FieldIndex) builder.insertField(FieldType.FIELD_INDEX, true);\n index.setPageNumberSeparator(\", see page \");\n index.setHeading(\"A\");\n\n // XE fields that have a Text property whose value becomes the heading of the INDEX entry.\n // If this value contains two string segments split by a colon (the INDEX entry will treat :) delimiter,\n // the first segment is heading, and the second segment will become the subheading.\n // The INDEX field first groups entries alphabetically, then, if there are multiple XE fields with the same\n // headings, the INDEX field will further subgroup them by the values of these headings.\n // There can be multiple subgrouping layers, depending on how many times\n // the Text properties of XE fields get segmented like this.\n // By default, an INDEX field entry group will create a new line for every subheading within this group. \n // We can set the RunSubentriesOnSameLine flag to true to keep the heading,\n // and every subheading for the group on one line instead, which will make the INDEX field more compact.\n index.setRunSubentriesOnSameLine(runSubentriesOnTheSameLine);\n\n if (runSubentriesOnTheSameLine)\n Assert.assertEquals(\" INDEX \\\\e \\\", see page \\\" \\\\h A \\\\r\", index.getFieldCode());\n else\n Assert.assertEquals(\" INDEX \\\\e \\\", see page \\\" \\\\h A\", index.getFieldCode());\n\n // Insert two XE fields, each on a new page, and with the same heading named \"Heading 1\",\n // which the INDEX field will use to group them.\n // If RunSubentriesOnSameLine is false, then the INDEX table will create three lines:\n // one line for the grouping heading \"Heading 1\", and one more line for each subheading.\n // If RunSubentriesOnSameLine is true, then the INDEX table will create a one-line\n // entry that encompasses the heading and every subheading.\n builder.insertBreak(BreakType.PAGE_BREAK);\n FieldXE indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Heading 1:Subheading 1\");\n\n Assert.assertEquals(\" XE \\\"Heading 1:Subheading 1\\\"\", indexEntry.getFieldCode());\n\n builder.insertBreak(BreakType.PAGE_BREAK);\n indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Heading 1:Subheading 2\");\n\n doc.updatePageLayout();\n doc.updateFields();\n doc.save(getArtifactsDir() + \"Field.INDEX.XE.Subheading.docx\");\n //ExEnd\n\n doc = new Document(getArtifactsDir() + \"Field.INDEX.XE.Subheading.docx\");\n index = (FieldIndex) doc.getRange().getFields().get(0);\n\n if (runSubentriesOnTheSameLine) {\n TestUtil.verifyField(FieldType.FIELD_INDEX, \" INDEX \\\\e \\\", see page \\\" \\\\h A \\\\r\",\n \"H\\r\" +\n \"Heading 1: Subheading 1, see page 2; Subheading 2, see page 3\\r\", index);\n Assert.assertTrue(index.getRunSubentriesOnSameLine());\n } else {\n TestUtil.verifyField(FieldType.FIELD_INDEX, \" INDEX \\\\e \\\", see page \\\" \\\\h A\",\n \"H\\r\" +\n \"Heading 1\\r\" +\n \"Subheading 1, see page 2\\r\" +\n \"Subheading 2, see page 3\\r\", index);\n Assert.assertFalse(index.getRunSubentriesOnSameLine());\n }\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(1);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE \\\"Heading 1:Subheading 1\\\"\", \"\", indexEntry);\n Assert.assertEquals(\"Heading 1:Subheading 1\", indexEntry.getText());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(2);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE \\\"Heading 1:Subheading 2\\\"\", \"\", indexEntry);\n Assert.assertEquals(\"Heading 1:Subheading 2\", indexEntry.getText());\n }", "protected CollectionIncomplete<Negotiation> getNegotiationsLinkedToSubAward(Map<String, String> negotiationFilters, Map<String, String> associatedValues, boolean rowCountOnly) {\n LOG.debug(\"ENTER getNegotiationsLinkedToSubAward rowCountOnly=\"+rowCountOnly);\n Map<String, String> values = transformMap(associatedValues, subAwardTransform);\n\n CollectionIncomplete<Negotiation> result = new CollectionIncomplete<>(new ArrayList(0),0L);\n if (values == null) {\n return result;\n }\n\n Long negotiationTypeId = getNegotiationService().getNegotiationAssociationType(NegotiationAssociationType.SUB_AWARD_ASSOCIATION).getId();\n String negotiationTypeIdFilter = negotiationFilters.get(NEGOTIATION_TYPE_ATTR);\n if ( StringUtils.isNotEmpty(negotiationTypeIdFilter) && !negotiationTypeId.equals( Long.parseLong(negotiationTypeIdFilter)) ) {\n LOG.debug(\"getNegotiationsLinkedToProposal: Skipping search as found different type filter=\"+negotiationTypeIdFilter);\n return result;\n }\n\n Criteria subAwardCriteria = getCollectionCriteriaFromMap(new SubAward(), values);\n\n //filter only active/pending subAwards\n Criteria activeSubAwardCriteria = getActiveOrPendingVersionCriteria();\n ReportQueryByCriteria activeSubAwardCodesQuery = QueryFactory.newReportQuery(SubAward.class, activeSubAwardCriteria);\n activeSubAwardCodesQuery.setAttributes(new String[]{MAX_SUBAWARD_CODE});\n activeSubAwardCodesQuery.addGroupBy(SUBAWARD_CODE);\n\n subAwardCriteria.addIn(SUBAWARD_CODE, activeSubAwardCodesQuery);\n ReportQueryByCriteria subQuery = QueryFactory.newReportQuery(SubAward.class, subAwardCriteria);\n subQuery.setAttributes(new String[] {SUBAWARD_CODE});\n\n\n Criteria negotiationsLinedToSubAwardsCriteria = getCollectionCriteriaFromMap(new Negotiation(), negotiationFilters);\n negotiationsLinedToSubAwardsCriteria.addIn(ASSOCIATED_DOC_ID_ATTR, subQuery);\n negotiationsLinedToSubAwardsCriteria.addEqualTo(NEGOTIATION_TYPE_ATTR, negotiationTypeId);\n\n LOG.debug(\"getNegotiationsLinkedToSubAward criteria=\"+negotiationsLinedToSubAwardsCriteria.toString());\n\n return executeSearch(negotiationsLinedToSubAwardsCriteria, rowCountOnly);\n\n }", "protected abstract void buildRowImpl(T rowValue, int absRowIndex);", "public void expandAll() {\n\t\tint row = 0;\n\t\twhile (row < super.getRowCount()) {\n\t\t\tsuper.expandRow(row);\n\t\t\trow++;\n\t\t}\n\t}", "ArrayList<Cell> getChildren(Integer[][] level){\n int[][] values={{0,1},{0,-1},{1,0},{-1,0}};\n ArrayList<Cell> children = new ArrayList<>();\n for (int i = 0; i < values.length; i++){\n if (isLegalMove(this.getI()+values[i][0], this.getJ()+values[i][1],level)){\n children.add(new Cell(this.getI()+values[i][0], this.getJ()+values[i][1]));\n }\n }\n //the code below achieves the same goal; still here for clarity\n\n// if (isLegalMove(this.getI(), this.getJ()+1, level)) {\n// children.add(new Cell(this.getI(), this.getJ()+1));\n// }\n// if (isLegalMove(this.getI(), this.getJ()-1, level)) {\n// children.add(new Cell(this.getI(), this.getJ()-1));\n// }\n// if (isLegalMove(this.getI()+1, this.getJ(), level)) {\n// children.add(new Cell(this.getI()+1, this.getJ()));\n// }\n// if (isLegalMove(this.getI()-1, this.getJ(), level)) {\n// children.add(new Cell(this.getI()-1, this.getJ()));\n// }\n return children;\n }", "public void _getDataRowProperties() {\n result = true;\n\n int rows = rowamount.intValue();\n rows -= 1;\n XPropertySet props = null;\n\n log.println(\"There are \" + rows + \" rows.\");\n try {\n for (int i = 0; i < rows; i++) {\n props = oObj.getDataRowProperties(i);\n if (props != null) {\n log.println(\"Row \" + i + \" - OK\");\n } else {\n log.println(\"Row \" + i + \" - FAILED\");\n result = false;\n }\n }\n } catch (com.sun.star.lang.IndexOutOfBoundsException e) {\n log.println(\"Exception while get data row properties\");\n e.printStackTrace(log);\n result = false;\n }\n\n tRes.tested(\"getDataRowProperties()\", result);\n }", "public void addNotDefinedCells()\r\n {\r\n if (getCrosstabElement() == null) return;\r\n\r\n // First of all we have to calc what cells we have and in what position they are...\r\n int cellGridWidth = getCrosstabElement().getColumnGroups().size();\r\n int cellGridHeight = getCrosstabElement().getRowGroups().size();\r\n\r\n // We assume that cell D/D (detail/detail) is defined.\r\n // Cell x,y is the cell with totalColumnGroup = colums(x) and totalRowGroup the rows(y)\r\n\r\n for (int y = cellGridHeight; y >= 0; --y)\r\n {\r\n\r\n\r\n for (int x = cellGridWidth; x >= 0; --x)\r\n {\r\n\r\n String totalRowGroupName = \"\";\r\n if (y < cellGridHeight) totalRowGroupName = ((CrosstabGroup)getCrosstabElement().getRowGroups().get(y)).getName();\r\n\r\n String totalColumnGroupName = \"\";\r\n if (x < cellGridWidth) totalColumnGroupName = ((CrosstabGroup)getCrosstabElement().getColumnGroups().get(x)).getName();\r\n\r\n CrosstabCell cell = findCell( totalRowGroupName,\r\n totalColumnGroupName);\r\n\r\n if (cell == null)\r\n {\r\n // we have to find a cell on the same row that matchs the width to inherit by...\r\n int cellHeight = getRowHeight( totalRowGroupName );\r\n int cellWidth = getColumnWidth( totalColumnGroupName );\r\n\r\n\r\n // look for a good row cell with the same width on the same row...\r\n CrosstabCell templateCell = null;\r\n for (int k=x+1; k < cellGridWidth; ++k)\r\n {\r\n templateCell = findCell( totalRowGroupName,\r\n ((CrosstabGroup)getCrosstabElement().getColumnGroups().get(k)).getName());\r\n if (templateCell == null)\r\n {\r\n continue;\r\n }\r\n\r\n if (templateCell.getWidth() == cellWidth)\r\n {\r\n break;\r\n }\r\n else\r\n {\r\n templateCell = null;\r\n }\r\n }\r\n if (templateCell == null)\r\n {\r\n templateCell = findCell( totalRowGroupName, \"\");\r\n if (templateCell != null && templateCell.getWidth() != cellWidth) templateCell = null;\r\n }\r\n\r\n if (templateCell == null) // Look on the same column...\r\n {\r\n for (int k=y+1; k < cellGridHeight; ++k)\r\n {\r\n templateCell = findCell( ((CrosstabGroup)getCrosstabElement().getRowGroups().get(k)).getName(),\r\n totalColumnGroupName);\r\n\r\n if (templateCell.getHeight() == cellHeight)\r\n {\r\n // FOUND IT!\r\n break;\r\n }\r\n else\r\n {\r\n templateCell = null;\r\n }\r\n }\r\n if (templateCell == null)\r\n {\r\n templateCell = findCell( \"\", totalColumnGroupName);\r\n if (templateCell != null && templateCell.getHeight() != cellHeight) templateCell = null;\r\n }\r\n }\r\n\r\n if (templateCell == null)\r\n {\r\n // Default not found!!!! Our cell will be void!\r\n cell = new CrosstabCell();\r\n cell.setParent( this.getCrosstabElement());\r\n cell.setWidth(cellWidth);\r\n cell.setHeight(cellHeight);\r\n cell.setColumnTotalGroup( totalColumnGroupName);\r\n cell.setRowTotalGroup( totalRowGroupName );\r\n }\r\n else\r\n {\r\n cell = templateCell.cloneMe();\r\n cell.setColumnTotalGroup( totalColumnGroupName);\r\n cell.setRowTotalGroup( totalRowGroupName );\r\n cell.setParent( this.getCrosstabElement());\r\n\r\n // Duplicate all elements of this cell, and reassign parent cell...\r\n int currentElements = getCrosstabElement().getElements().size();\r\n for (int i=0; i<currentElements; ++i)\r\n {\r\n ReportElement re = (ReportElement)getCrosstabElement().getElements().elementAt(i);\r\n // WARNING this copy does not support container and group elements!!!\r\n if (re.getCell() == templateCell)\r\n {\r\n re = re.cloneMe();\r\n cell.setColumnTotalGroup(totalColumnGroupName );\r\n cell.setRowTotalGroup(totalRowGroupName );\r\n re.setCell( cell );\r\n getCrosstabElement().getElements().add(re);\r\n }\r\n }\r\n }\r\n\r\n getCrosstabElement().getCells().add( cell );\r\n }\r\n }\r\n }\r\n\r\n }", "@Test\n\tpublic void rowWin_test1()\n\t{\n\t\tb.set(0,0, 'x');\n\t\tb.set(0,1, 'o');\n\t\tb.set(0,2, 'x');\n\t\tassertFalse(b.rowWin());\t\n\t}", "@Test\n public void testLinkedColumnNotDisplayedCase()\n {\n String runName = \"Link to multiple study run\";\n log(\"Creating the study projects\");\n\n log(\"Editing the assay design for auto link\");\n goToProjectHome();\n goToManageAssays();\n clickAndWait(Locator.linkWithText(ASSAY_NAME));\n _assayHelper.clickEditAssayDesign()\n .setAutoLinkTarget(\"(Data import folder)\")\n .clickSave();\n\n File runFile = new File(TestFileUtils.getSampleData(\"AssayImportExport\"), \"GenericAssay_Run2.xls\");\n importAssayRun(runFile, ASSAY_NAME, runName);\n\n linkToStudy(runName, STUDY1, 1, null);\n linkToStudy(runName, STUDY2, 1, null);\n linkToStudy(runName, STUDY3, 1, null);\n\n log(\"Verifying linked column does not exists because more then 3 studies are linked\");\n goToProjectHome();\n goToManageAssays();\n clickAndWait(Locator.linkWithText(ASSAY_NAME));\n clickAndWait(Locator.linkWithText(runName));\n DataRegionTable runsTable = DataRegionTable.DataRegion(getDriver()).withName(\"Data\").waitFor();\n checker().verifyFalse(\"Linked column for Study 1 should not be present\",\n runsTable.getColumnNames().contains(\"linked_to_Auto_Link_To_Study_Test_Study_1_Study\"));\n checker().verifyFalse(\"Linked column for Study 2 should not be present\",\n runsTable.getColumnNames().contains(\"linked_to_Auto_Link_To_Study_Test_Study_2_Study\"));\n checker().verifyFalse(\"Linked column for Study 3 should not be present\",\n runsTable.getColumnNames().contains(\"linked_to_Auto_Link_To_Study_Test_Study_3_Study\"));\n\n log(\"Verifying if columns can be added from customize grid\");\n CustomizeView customizeView = runsTable.openCustomizeGrid();\n customizeView.addColumn(\"linked_to_Auto_Link_To_Study_Test_Study_1_Study\");\n customizeView.addColumn(\"linked_to_Auto_Link_To_Study_Test_Study_2_Study\");\n customizeView.addColumn(\"linked_to_Auto_Link_To_Study_Test_Study_3_Study\");\n customizeView.addColumn(\"linked_to_Auto_Link_To_Study_Test_Study\");\n customizeView.clickViewGrid();\n\n /*\n Ensuring additional 'Linked to Study' columns are not visible for linked Datasets.\n Test coverage for issue https://www.labkey.org/home/Developer/issues/issues-details.view?issueId=43440\n */\n\n waitAndClickAndWait(Locator.linkWithText(\"linked\").index(0));\n DataRegionTable datasetTable = new DataRegionTable(\"Dataset\", getDriver());\n checker().verifyFalse(\"Linked column for Study 1 should not be present\",\n datasetTable.getColumnNames().contains(\"linked_to_Auto_Link_To_Study_Test_Study_1_Study\"));\n }", "private boolean isExtraRow(List<String> row) {\n\t\tif(row.get(4).isEmpty()&&row.get(5).isEmpty()&&row.get(6).isEmpty()) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@Test\n public void shouldTestIsReorderValidWithUnbreakableFromNonGroupedLeft() {\n this.gridLayer.setClientAreaProvider(new IClientAreaProvider() {\n\n @Override\n public Rectangle getClientArea() {\n return new Rectangle(0, 0, 1600, 250);\n }\n\n });\n this.gridLayer.doCommand(new ClientAreaResizeCommand(new Shell(Display.getDefault(), SWT.V_SCROLL | SWT.H_SCROLL)));\n\n // remove first group\n this.rowGroupHeaderLayer.removeGroup(11);\n\n // set all remaining groups unbreakable\n this.rowGroupHeaderLayer.setGroupUnbreakable(0, true);\n this.rowGroupHeaderLayer.setGroupUnbreakable(4, true);\n this.rowGroupHeaderLayer.setGroupUnbreakable(8, true);\n\n // between unbreakable groups\n assertTrue(RowGroupUtils.isReorderValid(this.rowGroupHeaderLayer, 12, 8, true));\n // to start of table\n assertTrue(RowGroupUtils.isReorderValid(this.rowGroupHeaderLayer, 13, 0, true));\n }", "private int getSubjTypeIdx() {\n return this.colStartOffset + 6;\n }", "private Handle[] expandTable(Handle[] myTable) {\n Handle[] newTable = new Handle[myTable.length * 2];\n // iterate sequentially through previous table\n for (int i = 0; i < myTable.length; i++) {\n // copy over all non-null elements that are not our\n // gravestone\n if (myTable[i] != null && myTable[i] != GRAVESTONE) {\n // valid element to copy over\n newTable =\n this.insertHelper(newTable, myTable[i]);\n }\n } // end for-loop\n return newTable;\n }", "@Override\npublic void refillColumnTitle(CompositeAdapter firstRowAdapter) {\n\t\n}", "public void setVisible(int row, boolean b) {\n\t\t\n\t\t//hide all other labels\n\t\tfor (int i=0; i < this.rowPriorityLabel.length; i++)\n\t\t\tthis.rowPriorityLabel[i].setVisible(false);\n\n\t\t//show next\n\t\t\tthis.rowPriorityLabel[row].setText(\"<html>&#8592;<html>\");\n\t\t\tthis.rowPriorityLabel[row].setVisible(b);\n\t\t\tthis.rowPriorityLabel[row].setForeground(Color.GREEN);\n\t}", "void coverRows()\n {\n System.out.println(\".... covering cols...\"+name); \n for (Node i = top.down; i!=top; i=i.down)\n {\n System.out.println(\"iterating vertically at \" + i.rowNum+i.colName());\n i.coverColumnsss();\n //save i;\n //recurse\n //restore i\n //uncover i;\n }\n }", "@Override\n public boolean visit(SQLInSubQueryExpr subQuery) {\n subQuery.getExpr().setParent(subQuery);\n return true;\n }", "public abstract boolean isOneCell();", "public RowSet getYesNoLovVO1() {\n return (RowSet)getAttributeInternal(YESNOLOVVO1);\n }", "public void initialize() throws SQLException, ClassNotFoundException {\n \n treetableview.setEditable(true); \n treetableview.editableProperty();\n col1.setCellValueFactory(new TreeItemPropertyValueFactory<>(\"lastname\"));\n col2.setCellValueFactory(new TreeItemPropertyValueFactory<>(\"firstname\"));\n col3.setCellValueFactory(new TreeItemPropertyValueFactory<>(\"lastname1\"));\n col4.setCellValueFactory(new TreeItemPropertyValueFactory<>(\"firstname1\"));\n col1.setCellFactory(TextFieldTreeTableCell.forTreeTableColumn());\n col2.setCellFactory(TextFieldTreeTableCell.forTreeTableColumn());\n \n col3.setCellFactory(TextFieldTreeTableCell.forTreeTableColumn());\n col4.setCellFactory(TextFieldTreeTableCell.forTreeTableColumn());\n col1.setEditable(true);\n col2.setEditable(true);\n \n \n \n \n \n \n /**\n * COMMENT OUT FROM HERE\n */\n// /*\n col1.setCellFactory(new Callback<TreeTableColumn<TableData, String>, TreeTableCell<TableData, String>>() {\n @Override\n public TreeTableCell<TableData, String> call(TreeTableColumn<TableData, String> param) {\n \n TreeTableCell<TableData, String> cell = new TreeTableCell<TableData, String>() {\n @Override\n public void updateItem(String item, boolean empty) {\n super.updateItem(item, empty);\n if (empty || item == null) {\n setText(null);\n setGraphic(null);\n } else {\n setText(item);\n }\n }\n };\n cell.setAlignment(Pos.CENTER);\n return cell;\n }\n });\n \n col2.setCellFactory(new Callback<TreeTableColumn<TableData, String>, TreeTableCell<TableData, String>>() {\n @Override\n public TreeTableCell<TableData, String> call(TreeTableColumn<TableData, String> param) {\n TreeTableCell<TableData, String> cell = new TreeTableCell<TableData, String>() {\n @Override\n public void updateItem(String item, boolean empty) {\n super.updateItem(item, empty);\n if (empty || item == null) {\n setText(null);\n setGraphic(null);\n } else {\n setText(item);\n }\n }\n };\n cell.setAlignment(Pos.CENTER);\n return cell;\n }\n });\n col3.setCellFactory(new Callback<TreeTableColumn<TableData, String>, TreeTableCell<TableData, String>>() {\n @Override\n public TreeTableCell<TableData, String> call(TreeTableColumn<TableData, String> param) {\n \n TreeTableCell<TableData, String> cell = new TreeTableCell<TableData, String>() {\n @Override\n public void updateItem(String item, boolean empty) {\n super.updateItem(item, empty);\n if (empty || item == null) {\n setText(null);\n setGraphic(null);\n } else {\n setText(item);\n }\n }\n };\n cell.setAlignment(Pos.CENTER);\n return cell;\n }\n });\n \n col4.setCellFactory(new Callback<TreeTableColumn<TableData, String>, TreeTableCell<TableData, String>>() {\n @Override\n public TreeTableCell<TableData, String> call(TreeTableColumn<TableData, String> param) {\n \n TreeTableCell<TableData, String> cell = new TreeTableCell<TableData, String>() {\n @Override\n public void updateItem(String item, boolean empty) {\n super.updateItem(item, empty);\n if (empty || item == null) {\n setText(null);\n setGraphic(null);\n } else {\n setText(item);\n }\n }\n };\n cell.setAlignment(Pos.CENTER);\n return cell;\n }\n });\n \n// */\n /**\n * END COMMENT\n */\n /**\n * manufacture some data\n */\n \n TreeItem<TableData> root = new TreeItem<TableData>(new TableData(\"Dates\", \"\",\"\",\"\"));\n treetableview.setRoot(root);\n root.setExpanded(true);\n \n String [] date3 = new String [1000000];\n String [] Receipt_id = new String [1000000];\n String [] Fee_Type = new String [1000000];\n String [] Amount = new String [1000000];\n String [] Time = new String [1000000];\n String Pat_Name = null;\n String Pat_id = null;\n int x=0,y=0,z=0,w=0,v=0;\n \n String r=Controller_Account_Info.seeel;\n String [] date = new String [10000];\n date=r.split(\"/\");\n String q=date[2]+\"-\"+date[1]+\"-\"+date[0];\n System.out.println(q);\t\n \n Connection con = Main.getConnection();\n \t\tif(con == null)\n \t\t{\n \t\t\tMain.setConnection(null);\n \t\t\tMain.setUsername(\"\");\n \t\t\tMain.setPort(\"\");\n \t\t\tMain.setpassword(\"\");\n \t\t\tMain.setDbName(\"\");\n \t\t\tMain.setIP(\"\");\n \t\t\t\n \t\t\tDialogs.create()\n \t\t.owner(primaryStage)\n \t\t.title(\" ALERT \")\n \t\t.masthead(\" Database is not setup \")\n \t\t.message(\"Please set up the connection \")\n \t\t.showWarning();\n \t\t}\n \t\tPreparedStatement stmt = null;\n \t\ttry\n \t\t{\n \t\t\tString sql = \"SELECT r.date FROM Receipt r WHERE r.date='\"+q+\"';\";\n \t\t\tstmt = con.prepareStatement(sql);\n \t\t\tResultSet rs = stmt.executeQuery();\n \t\t\twhile(rs.next())\n { date3[x] = rs.getString(\"date\"); \n x++;\n }\n \t\t\t\n \t\t\t\n \t\t\tfor(int k=0;k<x;k++){\n \t \n \t TreeItem<TableData> item = new TreeItem<TableData>(new TableData(date3[k], \"\",\"\",\"\"));\n \t root.getChildren().add(item);\n \t sql = \"SELECT r.Receipt_ID FROM Receipt r WHERE r.date='\"+date3[k]+\"';\";\n \t stmt = con.prepareStatement(sql);\n \t ResultSet ss = stmt.executeQuery();\n \t if(ss != null)\n \t {\n \t \n \t while(ss.next())\n \t { Receipt_id[y] = ss.getString(\"Receipt_ID\"); \n \t y++;\n \t }\n \t }\n \t for(int j=0;j<y;j++){\n \t TreeItem<TableData> item1 = new TreeItem<TableData>(new TableData(Receipt_id[j], \"\",\"\",\"\"));\n \t item.getChildren().add(item1);\n \t sql = \"SELECT p.name FROM Receipt r,Patient p WHERE r.Receipt_ID='\"+Receipt_id[j]+\"' AND r.pat_id=p.pat_id;\";\n\t stmt = con.prepareStatement(sql);\n\t ResultSet ts = stmt.executeQuery();\n \t \n \t if(ts != null)\n \t {\n \t \n \t while(ts.next())\n \t { Pat_Name = ts.getString(\"name\"); \n \t }\n \t }\n \t TreeItem<TableData> item2 = new TreeItem<TableData>(new TableData(\"Patient_Name = \"+Pat_Name, \"\",\"\",\"\"));\n \t item1.getChildren().add(item2);\n \t \n \t sql = \"SELECT p.pat_id FROM Receipt r,Patient p WHERE r.Receipt_ID='\"+Receipt_id[j]+\"' AND r.pat_id=p.pat_id;\";\n\t stmt = con.prepareStatement(sql);\n\t ResultSet zs = stmt.executeQuery();\n \t \n \t if(zs != null)\n \t {\n \t while(zs.next())\n \t { Pat_id = zs.getString(\"pat_id\"); \n \t }\n \t }\n \t item2 = new TreeItem<TableData>(new TableData(\"Patient_ID = \"+Pat_id, \"\",\"\",\"\"));\n \t item1.getChildren().add(item2);\n \t \n \t sql = \"SELECT f.fee_name FROM Receipt_fee_distribution r,Fee_Type f WHERE r.Receipt_ID='\"+Receipt_id[j]+\"' AND r.fee_id=f.fee_id;\";\n\t stmt = con.prepareStatement(sql);\n\t ResultSet as = stmt.executeQuery();\n \t \n \t \n \t if(as != null)\n \t {\n \t while(as.next())\n \t { Fee_Type[z] = as.getString(\"fee_name\"); \n \t z++;\n \t }\n \t }\n \t \n \t sql = \"SELECT r.amount FROM Receipt_fee_distribution r WHERE r.Receipt_ID='\"+Receipt_id[j]+\"';\";\n \t \tstmt = con.prepareStatement(sql);\n\t ResultSet bs = stmt.executeQuery();\n\t \n \t \n \t if(bs != null)\n \t {\n \t while(bs.next())\n \t { int g = bs.getInt(\"amount\"); \n \t Amount[w]=\"\"+g; \n \t \n \t w++;\n \t }\n \t }\n \t \n \t sql = \"SELECT r.time FROM Receipt r WHERE r.Receipt_ID='\"+Receipt_id[j]+\"';\";\n\t \tstmt = con.prepareStatement(sql);\n\t ResultSet cs = stmt.executeQuery();\n\t \n \t \n \t if(cs != null)\n \t {\n \t while(cs.next())\n \t { String h =cs.getString(\"time\"); \n \t Time[v] =h; \n \t v++;\n \t }\n \t }\n \t for(int m=0;m<z;m++){\n \t TreeItem<TableData> item3 = new TreeItem<TableData>(new TableData(\"\",Fee_Type[m],Amount[m],Time[0]));\n \t item1.getChildren().add(item3); \n \t }\n \t }\n \t }\n \t\t\t\n \t\t}\n \t\tcatch(SQLException E)\n \t\t{\n \t\t\tDialogs.create()\n \t\t.owner(primaryStage)\n \t\t.title(\" ALERT \")\n \t\t.masthead(\" SQlException encountered \")\n \t\t.message(\"Item could not be deleted \")\n \t\t.showWarning();\n \t\t}\n \n \n \n }", "private boolean getInner() throws IOException {\n while(true) {\n rightTuple = rightChild.getNextTuple();\n if(rightTuple == null) {\n leftTuple = leftChild.getNextTuple();\n if(leftTuple == null)\n return false;\n rightChild.initialize();\n }\n else\n return true;\n }\n }", "public boolean isExpandable();", "public Square getOtherSquare() {\n\t\tfor (Row r : containingRows) {\n\t\t\t//System.out.println(this.diagnostic());\n\t\t\tif (r.getNumSelected() == 3 && r.getState() != RowState.MIXED) {\n\t\t\t\tList<Square> tempList = new ArrayList<Square>(r.getSquares());\n\t\t\t\t//System.out.println(r);\n\t\t\t\tfor (Square s : r.getSelectedSquares()) {\n\t\t\t\t\tif (s.getState() != null)\n\t\t\t\t\t\ttempList.remove(s);\n\t\t\t\t}\n\t\t\t\treturn tempList.get(0);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Um.. We have a problem...\\n\" + this.diagnostic());\n\t\treturn null;\n\t}", "@Then(\"Inside the Inbox column following options should also be displayed\")\n public void insideTheInboxColumnFollowingOptionsShouldAlsoBeDisplayed() {\n for (int i = 1; i <= 2; i++) {\n BrowserUtils.waitFor(1);\n Driver.get().findElement(By.xpath(\"(//span[@class='o_channel_name'])[\" + i + \"]\")).isDisplayed();\n }\n // Inside the Inbox column, following options should also be displayed: CHANNELS, DIRECT MESSAGES and PRIVATE CHANNLES CHANNLES.\n BrowserUtils.waitFor(1);\n for (int i = 1; i <= 3; i++) {\n BrowserUtils.waitFor(1);\n Driver.get().findElement(By.xpath(\"(//div[@class='o_mail_sidebar_title'])[\" + i + \"]\")).isDisplayed();\n }\n\n }", "@Override\r\n public Entity row(Entity entity) {\n int estimated = EntityTools.getIntField(entity, \"estimated\");\r\n int dayWhenInProgress = EntityTools.removeIntField(entity, \"day-when-in-progress\");\r\n int newEstimated = EntityTools.removeIntField(entity, \"new-estimated\");\r\n int newRemaining = EntityTools.removeIntField(entity, \"new-remaining\");\r\n int dayWhenCompleted = EntityTools.removeIntField(entity, \"day-when-completed\");\r\n String originalTeamId = EntityTools.removeField(entity, \"team-id\");\r\n Entity response = super.row(entity);\r\n String agmId;\r\n try {\r\n agmId = response.getId().toString();\r\n } catch (FieldNotFoundException e) {\r\n throw new IllegalStateException(e);\r\n }\r\n\r\n if (dayWhenCompleted >= 0 && dayWhenInProgress >= 0) {\r\n if (dayWhenCompleted <= dayWhenInProgress) {\r\n log.warn(\"Day to be in progress (\"+dayWhenInProgress+\") is after the day to be completed (\"+dayWhenCompleted+\")\");\r\n }\r\n }\r\n if (dayWhenInProgress > 0) {\r\n List<Object> work = workCalendar.get(dayWhenInProgress);\r\n if (work == null) {\r\n work = new LinkedList<>();\r\n workCalendar.put(dayWhenInProgress, work);\r\n }\r\n work.add(\"In Progress\");\r\n work.add(agmId);\r\n work.add(estimated);\r\n work.add(newEstimated);\r\n work.add(newRemaining);\r\n work.add(originalTeamId);\r\n log.debug(\"On day \"+dayWhenInProgress+\" task \"+agmId+\" belonging to \"+originalTeamId+\" switching to In Progress; remaining set to \"+newRemaining);\r\n }\r\n if (dayWhenCompleted > 0) {\r\n List<Object> work = workCalendar.get(dayWhenCompleted);\r\n if (work == null) {\r\n work = new LinkedList<>();\r\n workCalendar.put(dayWhenCompleted, work);\r\n }\r\n work.add(\"Completed\");\r\n work.add(agmId);\r\n work.add(newEstimated);\r\n work.add(originalTeamId);\r\n log.debug(\"On day \"+dayWhenCompleted+\" task \"+agmId+\" belonging to \"+originalTeamId+\" switching to Completed; remaining set to \"+0);\r\n }\r\n return response;\r\n }", "private void initTable() {\n// String col[] = {\"Seq#\",\"PCode\",\"BCode\",\"ProductName\",\"PurPCS\",\"PurCTN\",\"PurQTY\",\"PurDMG\",\"PurRate\",\"GrossAmount\",\"Disc%\",\"DiscRS\",\"Tax%\",\"TaxRS\",\"TOPcs\",\"UCHRS\",\"SCHRS\",\"FMR%\",\"FMRRS\",\"TaxRS\",\"Expiry\",\"Batch\",\"NetAmount\"};\n String col[] = {\"Seq#\",\"PCode\",\"BCode\"};\n int k=0; \n Object row[][] = new Object[][] { { \"1\", new ButtonTextFieldCellTest.ButtonTextFieldCell(), new ButtonTextFieldCellTest.ButtonTextFieldCell() },\n { \"2\", new ButtonTextFieldCellTest.ButtonTextFieldCell(), new ButtonTextFieldCellTest.ButtonTextFieldCell() },\n { \"3\", new ButtonTextFieldCellTest.ButtonTextFieldCell(), new ButtonTextFieldCellTest.ButtonTextFieldCell() },\n { \"4\", new ButtonTextFieldCellTest.ButtonTextFieldCell(), new ButtonTextFieldCellTest.ButtonTextFieldCell() } };\n// String row[][] =new String[3][23];\n /*\n for(int i = 0; i < 3; i++){\n for(int j = 0; j < 23; j++){\n row[i][j]=\"\"+k++;\n }\n }\n \n */\n// row=new String[][]{{\"Seq#\",\"PCode\",\"BCode\",\"ProductName\",\"PurPCS\",\"PurCTN\",\"PurQTY\",\"PurDMG\",\"PurRate\",\"GrossAmount\",\"Disc%\",\"DiscRS\",\"Tax%\",\"TaxRS\",\"TOPcs\",\"UCHRS\",\"SCHRS\",\"FMR%\",\"FMRRS\",\"TaxRS\",\"Expiry\",\"Batch\",\"NetAmount\"},\n// {\"1Seq#\",\"1PCode\",\"1BCode\",\"ProductName\",\"PurPCS\",\"PurCTN\",\"PurQTY\",\"PurDMG\",\"PurRate\",\"GrossAmount\",\"Disc%\",\"DiscRS\",\"Tax%\",\"TaxRS\",\"TOPcs\",\"UCHRS\",\"SCHRS\",\"FMR%\",\"FMRRS\",\"TaxRS\",\"Expiry\",\"Batch\",\"NetAmount\"},\n// {\"2Seq#\",\"2PCode\",\"2BCode\",\"ProductName\",\"PurPCS\",\"PurCTN\",\"PurQTY\",\"PurDMG\",\"PurRate\",\"GrossAmount\",\"Disc%\",\"DiscRS\",\"Tax%\",\"TaxRS\",\"TOPcs\",\"UCHRS\",\"SCHRS\",\"FMR%\",\"FMRRS\",\"TaxRS\",\"Expiry\",\"Batch\",\"NetAmount\"}};\n model = new DefaultTableModel(row,col);\n jTable1=new JTable(model);\n jTable1.setRowHeight(30);\n jTable1.setRowHeight(0,30);\n jTable1.setPreferredSize(new Dimension(purchaseScrollPane.getWidth(), 35));\n purchaseScrollPane.setViewportView(jTable1);\n }", "private boolean hasTwo()\r\n\t\t{\r\n\t\t\treturn getLeftChild() != null && getRightChild() != null;\r\n\t\t}", "public void setSUB_LINE_NO(BigDecimal SUB_LINE_NO) {\r\n this.SUB_LINE_NO = SUB_LINE_NO;\r\n }", "@Override\n public Row call(Tuple2<Iterable<Row>, Iterable<Row>> cogrouped) throws Exception {\n Row intoRow = cogrouped._1().iterator().next();\n Row[] fromRows = Iterables.toArray(cogrouped._2(), Row.class);\n int intoRowNumFields = intoRow.size();\n\n Object[] nestedValues = new Object[intoRowNumFields + 1];\n for (int i = 0; i < intoRowNumFields; i++) {\n nestedValues[i] = intoRow.get(i);\n }\n nestedValues[intoRowNumFields] = fromRows;\n\n Row nested = RowFactory.create(nestedValues);\n\n return nested;\n }", "private void downrightcontrol(Map map, int row, int column) throws NotValidCellException {\n try {\n if (map.getCell(row, column).getDice().getColor().equalsColor(map.getCell(row + 1, column + 1).getDice().getColor())) {\n if(!temp.contains(map.getCell(row, column).getDice()))\n temp.add(map.getCell(row, column).getDice());\n if(!temp.contains(map.getCell(row + 1, column + 1).getDice())) {\n temp.add(map.getCell(row + 1, column + 1).getDice());\n visitor(map, row + 1, column + 1);\n }\n }\n } catch (NullPointerException e) {\n // va bene così\n }\n }", "@Test\r\n\tpublic void testCheckRows() {\n\t\tGrid g = new Grid();\r\n\t\t// full bottom row\r\n\t\tfor (int col = 0; col < Grid.WIDTH; col++) {\r\n\t\t\tg.set(Grid.HEIGHT - 1, col, Color.GREEN);\r\n\t\t}\r\n\t\t// add two squares above the bottom row\r\n\t\tg.set(Grid.HEIGHT - 2, 3, Color.RED);\r\n\t\tg.set(Grid.HEIGHT - 3, 3, Color.RED);\r\n\t\t// remove the full row\r\n\t\tg.checkRows();\r\n\t\t// check that the grid has been updated correctly\r\n\t\tfor (int row = 0; row < Grid.HEIGHT; row++) {\r\n\t\t\tfor (int col = 0; col < Grid.WIDTH; col++) {\r\n\t\t\t\t// check the square at (row,col)\r\n\t\t\t\t// must have: (18,3) and (19,3) set\r\n\t\t\t\t// and all of the others not set\r\n\t\t\t\tif ((row == 18 || row == 19) && col == 3) {\r\n\t\t\t\t\tassertTrue(g.isSet(row, col));\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tassertFalse(g.isSet(row, col));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public boolean getHaveSub() { return haveSub;}", "public interface INestedIfElseClauseContainer extends IEmbeddedNodeUser {\r\n\t\t/**\r\n\t\t * registers an if-clause (or else-clause) as an inner clause of this clause\r\n\t\t * @param nestedClause\r\n\t\t * @throws NullPointerException: if nestedClause is null\r\n\t\t */\r\n\t\tpublic void addNestedClause(TempTableHeaderCell nestedClause);\r\n\t\t\r\n\t\t/**\r\n\t\t * Looks for the first if/else clause (performing deep scan - searches every nested if/else clause\r\n\t\t * as well) which the bExpression returns true.\r\n\t\t * \r\n\t\t * @param valuesOnCPTColumn: a map which the key is a name of a parent node and\r\n\t\t * the value is its current possible values to be evaluated.\r\n\t\t * For example, if we want to evalueate an expression when for a node \"Node(!ST0)\" we\r\n\t\t * have parents Parent1(!ST0,!Z0), Parent1(!ST0,!Z1), Parent2(!ST0,!T0), and Parent2(!ST0,!T0)\r\n\t\t * with values True, False, Alpha, Beta respectively, the map should be:\r\n\t\t * \t\tentry0, (key:\"Parent1\", values: {True, False});\r\n\t\t * \t\tentry1, (key:\"Parent2\", values: {Alpha, Beta});\r\n\t\t * \r\n\t\t * @return: the first if/else clause which returned true.\r\n\t\t */\r\n\t\tpublic TempTableHeaderCell getFirstTrueClause(Map<String, List<EntityAndArguments>> valuesOnCPTColumn) ;\r\n\t\t\r\n\t\t\r\n\t\t/**\r\n\t\t * Tests if this container has no nested clauses.\r\n\t\t * @return true if this if/else clause container has 0 nested elements\r\n\t\t */\r\n\t\tpublic boolean isEmptyNestedClauses ();\r\n\t\t\r\n\t\t/**\r\n\t\t * @return the clauses\r\n\t\t */\r\n\t\tpublic List<TempTableHeaderCell> getNestedClauses();\r\n\t\t\r\n\t\t/**\r\n\t\t * \r\n\t\t * @return the clause this object is contained within\r\n\t\t */\r\n\t\tpublic INestedIfElseClauseContainer getUpperClause();\r\n\t\t\r\n\t\t\r\n\t\t/**\r\n\t\t * sets the clause this object is contained within\r\n\t\t * @param upper\r\n\t\t */\r\n\t\tpublic void setUpperClause(INestedIfElseClauseContainer upper);\r\n\t\t\r\n\t\t\r\n\t\t/**\r\n\t\t * Initializes the \"isKnownValue\" attributes of TempTableHeader objects\r\n\t\t * by recursively calling this method for all nested causes.\r\n\t\t * @param ssbnnode\r\n\t\t * @see TempTableHeader\r\n\t\t * @throws NullPointerException if ssbnnode is null\r\n\t\t */\r\n\t\tpublic void cleanUpKnownValues(SSBNNode ssbnnode);\r\n\t\t\r\n\r\n\t\t/**\r\n\t\t * Hierarchically searches for user-defined variables in scope.\r\n\t\t * @param key : name of variable to look for\r\n\t\t * @return : value of the variable\r\n\t\t * @see #addUserDefinedVariable(String, IExpressionValue)\r\n\t\t * @see #clearUserDefinedVariables()\r\n\t\t */\r\n\t\tpublic IExpressionValue getUserDefinedVariable(String key);\r\n\t\t\r\n\t\t/**\r\n\t\t * Adds a new user-defined variable retrievable from {@link #getUserDefinedVariable(String)}\r\n\t\t * @see #clearUserDefinedVariables()\r\n\t\t */\r\n\t\tpublic void addUserDefinedVariable(String key, IExpressionValue value);\r\n\t\t\r\n\t\t/**\r\n\t\t * Deletes all user variables that were included by {@link #addUserDefinedVariable(String, IExpressionValue)}.\r\n\t\t * @see #getUserDefinedVariable(String)\r\n\t\t */\r\n\t\tpublic void clearUserDefinedVariables();\r\n\t\t\r\n\t\t/**\r\n\t\t * @return {@link #getUserDefinedVariable(String)} for this clause and all {@link #getNestedClauses()} recursively\r\n\t\t * @param keepFirst : if true, then variables found first will be kept if\r\n\t\t * variables with same name are found. If false, then variables found later will be used\r\n\t\t * in case of duplicate names.\r\n\t\t */\r\n\t\tpublic Map<String, IExpressionValue> getUserDefinedVariablesRecursively(boolean keepFirst);\r\n\t\t\r\n\t\t/**\r\n\t\t * @return instance of resident node whose LPD script is being applied.\r\n\t\t * (this can be used if we are compiling a script before generating SSBN)\r\n\t\t * @see #getSSBNNode()\r\n\t\t */\r\n\t\tpublic IResidentNode getResidentNode();\r\n\t\t\r\n\t\t/**\r\n\t\t * @return : instance of SSBN node whose LPD script is being applied during SSBN generation.\r\n\t\t * May return null if compiler is called before SSBN generation. If so, {@link #getResidentNode()}\r\n\t\t * must be used.\r\n\t\t */\r\n\t\tpublic SSBNNode getSSBNNode();\r\n\t}", "@Test\n public void testKeyColumnIndex() throws Exception {\n \tfor(Row r : project.rows) {\n \t\tr.cells.add(0, null);\n \t}\n \tList<Column> newColumns = new ArrayList<>();\n \tfor(Column c : project.columnModel.columns) {\n \t\tnewColumns.add(new Column(c.getCellIndex()+1, c.getName()));\n \t}\n \tproject.columnModel.columns.clear();\n \tproject.columnModel.columns.addAll(newColumns);\n \tproject.columnModel.update();\n \t\n \tAbstractOperation op = new FillDownOperation(\n EngineConfig.reconstruct(\"{\\\"mode\\\":\\\"record-based\\\",\\\"facets\\\":[]}\"),\n \"second\");\n Process process = op.createProcess(project, new Properties());\n process.performImmediate();\n\n Assert.assertEquals(\"c\", project.rows.get(0).cells.get(3).value);\n Assert.assertEquals(\"c\", project.rows.get(1).cells.get(3).value);\n Assert.assertNull(project.rows.get(2).cells.get(3));\n Assert.assertEquals(\"h\", project.rows.get(3).cells.get(3).value);\n }", "public boolean takesTwoCells() {\r\n\t\treturn takesTwoCells;\r\n\t}", "@Test\n public void testLPADisabledParentTasks() throws Exception {\n\n // SETUP: Data Setup for running the Function\n SchedStaskTable lSchedStask = SchedStaskTable.findByPrimaryKey( new TaskKey( 4650, 100 ) );\n lSchedStask.setPreventLinePlanningAutomation( true );\n lSchedStask.update();\n\n // ACTION: Execute the Query\n execute( DateUtils.parseDateTimeString( \"15-MAY-2007 01:00\" ), 5, 4650, 100 );\n\n // TEST: Confirm the Data had only 2 loose tasks\n assertEquals( 2, iDataSet.getRowCount() );\n\n iDataSet.addSort( \"sched_id\", true );\n iDataSet.filterAndSort();\n\n iDataSet.next();\n testRow( new TaskKey( 4650, 400 ), \"LOOSETASK\", new AircraftKey( 4650, 100 ),\n new AssemblyKey( 4650, \"ASCD\" ), \"Aircraft\", RefSchedPriorityKey.NONE, null,\n new RefTaskPriorityKey( 4650, \"LOW\" ), 0, 0, \"REQ\", null, null, 0.0, null, null, null,\n null, null );\n\n iDataSet.next();\n testRow( new TaskKey( 4650, 500 ), \"LOOSETASK\", new AircraftKey( 4650, 100 ),\n new AssemblyKey( 4650, \"ASCD\" ), \"Aircraft\", RefSchedPriorityKey.NONE,\n DateUtils.parseDateTimeString( \"26-MAY-2007 19:45\" ),\n new RefTaskPriorityKey( 4650, \"LOW\" ), 0, 0, \"REQ\", null, null, 0.0, null, null, null,\n null, null );\n\n // TEARDOWN: Undo the Setup Changes\n lSchedStask.setPreventLinePlanningAutomation( false );\n lSchedStask.update();\n }", "List<Trueorfalse> selectByExample(RowBounds rowBounds);", "public Cell getRowValuesForCompare(Row row,int cellNum){\n return row.getCell(cellNum);\n }", "@Test\n\tpublic void testSquareIndexToSequence(){\n\t\t\n\t\tRow row = TestUtils.buildRow(\"3,1,2,1|-...-.....-....-.....-.-\");\n\t\tRowDecomposition decomposition = row.getDecomposition();\n\t\t\n\t\tAssert.assertEquals(18, decomposition.getTotalLength());\n\t\tAssert.assertEquals(decomposition.getSequence(0), decomposition.getSequenceContaining(0));\n\t\tAssert.assertEquals(decomposition.getSequence(0), decomposition.getSequenceContaining(2));\n\t\tAssert.assertEquals(decomposition.getSequence(1), decomposition.getSequenceContaining(3));\n\t\tAssert.assertEquals(decomposition.getSequence(1), decomposition.getSequenceContaining(7));\n\t\tAssert.assertEquals(decomposition.getSequence(2), decomposition.getSequenceContaining(8));\n\t\tAssert.assertEquals(decomposition.getSequence(2), decomposition.getSequenceContaining(11));\n\t\tAssert.assertEquals(decomposition.getSequence(3), decomposition.getSequenceContaining(12));\n\t\tAssert.assertEquals(decomposition.getSequence(3), decomposition.getSequenceContaining(16));\n\t\tAssert.assertEquals(decomposition.getSequence(4), decomposition.getSequenceContaining(17));\n\t\t\n\t}", "@Test\n\tpublic void rowWin_test()\n\t{\n\t\tb.set(0,0, 'x');\n\t\tb.set(1,1, 'o');\n\t\tb.set(0,1, 'x');\n\t\tb.set(2,2, 'o');\n\t\tb.set(0,2, 'x');\n\t\tassertTrue(b.rowWin());\t\n\t}", "protected void collapseRow( int row )\n {\n if(treeTable == null)\n {\n return;\n }\n if ( row >= 0 )\n {\n treeTable.getTree().collapseRow( row );\n }\n }", "@Test\n public void testPartOnOff() throws Exception {\n QuerySet lQuerySet = this.execute( new TaskKey( 4650, 87424 ) );\n\n Assert.assertEquals( \"Number of retrieved rows\", 2, lQuerySet.getRowCount() );\n Assert.assertTrue( lQuerySet.next() );\n\n testRow( lQuerySet, \"321002203 (ANTI SKD NORM) \", 1, \"1000 - 321002203-UNK / 3282-10-627\",\n \"REPREQ / Unscheduled Failure\", 0, \"4650:87424:2\" );\n Assert.assertTrue( lQuerySet.next() );\n\n testRow( lQuerySet, \"321002203-01 (ADAPTING TACHOMETER) \", 1,\n \"1000 - 321002203-01-A / AH-001\", \"REPREQ / Unscheduled Failure\", 0, \"4650:87424:1\" );\n Assert.assertFalse( lQuerySet.next() );\n }", "protected void expandRow(int row, int level)\n {\n if(treeTable == null)\n {\n return;\n }\n if(row >= 0 && level > 0)\n {\n level--;\n JTree tree = treeTable.getTree();\n tree.expandRow(row);\n\n TreePath path = tree.getPathForRow(row);\n Property p = (Property)path.getLastPathComponent();\n int n = p.getPropertyCount();\n for(int i = 0; i < n; i++)\n {\n Property pChild = p.getPropertyAt(i);\n expandRow(getRow(pChild), level);\n }\n }\n }", "@Test\r\n public void testCellForRowAtIndex() {\r\n assertTrue(ConditionWait.tillGlobalTime(new ConditionWait.Condition() {\r\n @Override\r\n public boolean check() {\r\n return XIBTestTableViewLabelTexFieldViewController.testCellForRowAtIndex;\r\n }\r\n }));\r\n }", "private void markRowsAndCols(int row){\n if(row < 0)\n return;\n\n markedRows[row] = true;\n for (int j = 0; j < cols; j++)\n if(j != chosenInRow[row] && source[row][j] == 0) {\n markedCols[j] = true;\n markRowsAndCols(chosenInCol[j]);\n }\n }", "private CompositeCell<CQLFunctionArgument> getCompositeCellForQDMModifyAndDelete() {\n\t\tfinal List<HasCell<CQLFunctionArgument, ?>> cells = new LinkedList<HasCell<CQLFunctionArgument, ?>>();\n\t\tif (isEditable) {\n\t\t\tcells.add(getModifyQDMButtonCell());\n\t\t\tcells.add(getDeleteQDMButtonCell());\n\t\t}\n\t\t\n\t\tCompositeCell<CQLFunctionArgument> cell = new CompositeCell<CQLFunctionArgument>(cells) {\n\t\t\t@Override\n\t\t\tpublic void render(Context context, CQLFunctionArgument object, SafeHtmlBuilder sb) {\n\t\t\t\tsb.appendHtmlConstant(\"<table tabindex=\\\"-1\\\"><tbody><tr tabindex=\\\"-1\\\">\");\n\t\t\t\tfor (HasCell<CQLFunctionArgument, ?> hasCell : cells) {\n\t\t\t\t\trender(context, object, sb, hasCell);\n\t\t\t\t}\n\t\t\t\tsb.appendHtmlConstant(\"</tr></tbody></table>\");\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tprotected <X> void render(Context context, CQLFunctionArgument object, SafeHtmlBuilder sb,\n\t\t\t\t\tHasCell<CQLFunctionArgument, X> hasCell) {\n\t\t\t\tCell<X> cell = hasCell.getCell();\n\t\t\t\tsb.appendHtmlConstant(\"<td class='emptySpaces' tabindex=\\\"0\\\">\");\n\t\t\t\tif ((object != null)) {\n\t\t\t\t\tcell.render(context, hasCell.getValue(object), sb);\n\t\t\t\t} else {\n\t\t\t\t\tsb.appendHtmlConstant(\"<span tabindex=\\\"-1\\\"></span>\");\n\t\t\t\t}\n\t\t\t\tsb.appendHtmlConstant(\"</td>\");\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tprotected Element getContainerElement(Element parent) {\n\t\t\t\treturn parent.getFirstChildElement().getFirstChildElement().getFirstChildElement();\n\t\t\t}\n\t\t};\n\t\treturn cell;\n\t}", "public final void collapsePlaceHolderCells(final int row){\n\t\tint currentRow = row;\n\t\tint tableSize = table.size();\n\t\twhile (currentRow < (tableSize - 1)){\n\t\t\tRow rowObj = table.get(currentRow);\n\t\t\tRow replacementRow = new Row<T>();\n\t\t\tint columns = rowObj.asList().size();\n\t\t\tfor (int i = 0; i < columns; ++i){\n\t\t\t\tCell cell = rowObj.get(i);\n\t\t\t\tif ((cell != null) && cell.isPlaceholder()){\n\t\t\t\t\treplacementRow.add(table.get(currentRow + 1).get(i));\n\t\t\t\t\ttable.get(currentRow + 1).insert(i, new Cell<T>());\n\t\t\t\t}else{\n\t\t\t\t\treplacementRow.add(table.get(currentRow).get(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\ttable.set(currentRow, replacementRow);\n\t\t\t++currentRow;\n\t\t}\n\n\t}", "public boolean getIsOutOfLineFODescendant() {\n return isOutOfLineFODescendant;\n }", "@Override\n\tpublic boolean hasSubquery() {\n\t\treturn false;\n\t}", "abstract ChildListPropertyDescriptor internalElseDeclarationsProperty();", "@Test\n\tpublic void testEliminationByRow(){\n\t\tsetBoardUp();\n\t\tRow r = new Row(board, 1);\n\t\talgorithm.applyEliminationInRow(r);\n\t\tboolean condition = true;\n\t\tcondition &= !r.cell[1].possibilities.contains(4) && !r.cell[1].possibilities.contains(5) && !r.cell[1].possibilities.contains(7);\n\t\tcondition &= !r.cell[2].possibilities.contains(4) && !r.cell[2].possibilities.contains(5) && !r.cell[2].possibilities.contains(7);\n\t\tcondition &= !r.cell[4].possibilities.contains(4) && !r.cell[4].possibilities.contains(5) && !r.cell[4].possibilities.contains(7);\n\t\tcondition &= !r.cell[5].possibilities.contains(4) && !r.cell[5].possibilities.contains(5) && !r.cell[5].possibilities.contains(7);\n\t\tcondition &= !r.cell[6].possibilities.contains(4) && !r.cell[6].possibilities.contains(5) && !r.cell[6].possibilities.contains(7);\n\t\tcondition &= !r.cell[8].possibilities.contains(4) && !r.cell[8].possibilities.contains(5) && !r.cell[8].possibilities.contains(7);\n\t\t\n\t\tassertTrue(condition);\n\t}", "public void updateGrid() {\r\n if (getCrosstabElement() == null) return;\r\n\r\n try {\r\n getColumns().clear();\r\n getRows().clear();\r\n int current_x = 0;\r\n int current_y = 0;\r\n\r\n // Adjusting cells dimensions...\r\n CrosstabCell mainCell = findCell(\"\",\"\");\r\n for (int k=0; k<getCrosstabElement().getCells().size(); ++k) {\r\n CrosstabCell cell = (CrosstabCell)getCrosstabElement().getCells().elementAt(k);\r\n\r\n cell.setParent( this.getCrosstabElement());\r\n\r\n if (cell.getType() == cell.DETAIL_CELL) {\r\n if (cell.getHeight() == 0) cell.setHeight( getRowHeight( cell.getRowTotalGroup() ) );\r\n if (cell.getWidth() == 0) cell.setWidth( getColumnWidth( cell.getColumnTotalGroup() ) );\r\n }\r\n }\r\n\r\n addNotDefinedCells();\r\n\r\n getColumns().add( new Integer(current_x) );\r\n\r\n for (int i=0; i<getCrosstabElement().getRowGroups().size(); ++i) {\r\n CrosstabGroup cg = (CrosstabGroup)getCrosstabElement().getRowGroups().elementAt(i);\r\n cg.getHeaderCell().setLeft( current_x );\r\n cg.getTotalCell().setLeft( current_x );\r\n current_x = current_x + cg.getSize();\r\n getColumns().add( new Integer(current_x) );\r\n }\r\n\r\n ArrayList columnWidths = new ArrayList();\r\n for (int i=getCrosstabElement().getColumnGroups().size()-1; i>=0; --i) {\r\n CrosstabGroup cg = (CrosstabGroup)getCrosstabElement().getColumnGroups().elementAt(i);\r\n\r\n if (i == getCrosstabElement().getColumnGroups().size()-1)\r\n {\r\n columnWidths.add( new Integer( getColumnWidth(\"\")));\r\n }\r\n if (!cg.getTotalPosition().equals(\"Start\"))\r\n {\r\n columnWidths.add( new Integer( getColumnWidth(cg.getName())));\r\n }\r\n else\r\n {\r\n columnWidths.add(0, new Integer( getColumnWidth(cg.getName())));\r\n }\r\n\r\n }\r\n\r\n for (int i=0; i<columnWidths.size(); ++i)\r\n {\r\n current_x += ((Integer)columnWidths.get(i)).intValue();\r\n getColumns().add( new Integer(current_x));\r\n }\r\n if (getCrosstabElement().getColumnGroups().size() == 0) getColumns().add( new Integer(current_x += getColumnWidth(\"\")));\r\n\r\n // Look for all rows...\r\n\r\n getRows().add( new Integer(current_y) );\r\n for (int i=0; i<getCrosstabElement().getColumnGroups().size(); ++i) {\r\n CrosstabGroup cg = (CrosstabGroup)getCrosstabElement().getColumnGroups().elementAt(i);\r\n cg.getHeaderCell().setTop( current_y );\r\n cg.getTotalCell().setTop( current_y );\r\n current_y = current_y + cg.getSize();\r\n getRows().add( new Integer(current_y) );\r\n\r\n }\r\n\r\n ArrayList rowHeights = new ArrayList();\r\n for (int i=getCrosstabElement().getRowGroups().size()-1; i>=0; --i) {\r\n CrosstabGroup cg = (CrosstabGroup)getCrosstabElement().getRowGroups().elementAt(i);\r\n\r\n if (i == getCrosstabElement().getRowGroups().size()-1)\r\n {\r\n rowHeights.add( new Integer( getRowHeight(\"\")));\r\n }\r\n if (!cg.getTotalPosition().equals(\"Start\"))\r\n {\r\n rowHeights.add( new Integer( getRowHeight(cg.getName())));\r\n }\r\n else\r\n {\r\n rowHeights.add(0, new Integer( getRowHeight(cg.getName())));\r\n }\r\n }\r\n\r\n for (int i=0; i<rowHeights.size(); ++i)\r\n {\r\n current_y += ((Integer)rowHeights.get(i)).intValue();\r\n getRows().add( new Integer(current_y));\r\n }\r\n if (getCrosstabElement().getRowGroups().size() == 0) getRows().add( new Integer(current_y += getRowHeight(\"\")));\r\n\r\n int columnGroups = getCrosstabElement().getColumnGroups().size();\r\n int rowGroups = getCrosstabElement().getRowGroups().size();\r\n\r\n\r\n\r\n\r\n int currentTopRowNumber = columnGroups;\r\n int currentBottomRowNumber = columnGroups + rowGroups + 1;\r\n\r\n for (int i=0; i<getCrosstabElement().getRowGroups().size(); ++i) {\r\n CrosstabGroup cg = (CrosstabGroup)getCrosstabElement().getRowGroups().elementAt(i);\r\n\r\n cg.getHeaderCell().setLeftIndex( i );\r\n cg.getHeaderCell().setLeft( ((Integer)getColumns().get(i)).intValue() );\r\n cg.getHeaderCell().setTopIndex( (cg.getTotalPosition().equals(\"Start\")) ? currentTopRowNumber+1 : currentTopRowNumber );\r\n cg.getHeaderCell().setTop( ((Integer)getRows().get( cg.getHeaderCell().getTopIndex() )).intValue() );\r\n cg.getHeaderCell().setRightIndex( i+1 );\r\n cg.getHeaderCell().setWidth( cg.getSize() );\r\n cg.getHeaderCell().setBottomIndex( (cg.isHasTotal() && cg.getTotalPosition().equals(\"Start\")) ? currentBottomRowNumber : currentBottomRowNumber - 1 );\r\n cg.getHeaderCell().setHeight( ((Integer)getRows().get( cg.getHeaderCell().getBottomIndex() )).intValue() -cg.getHeaderCell().getTop());\r\n\r\n cg.getTotalCell().setLeftIndex( i );\r\n cg.getTotalCell().setLeft( cg.getHeaderCell().getLeft());\r\n cg.getTotalCell().setTopIndex( (cg.getTotalPosition().equals(\"Start\")) ? currentTopRowNumber : currentBottomRowNumber-1 );\r\n cg.getTotalCell().setTop( ((Integer)getRows().get( cg.getTotalCell().getTopIndex() )).intValue() );\r\n cg.getTotalCell().setRightIndex( rowGroups );\r\n cg.getTotalCell().setWidth( ((Integer)getColumns().get( rowGroups)).intValue() - cg.getTotalCell().getLeft() );\r\n cg.getTotalCell().setBottomIndex( (cg.isHasTotal() && cg.getTotalPosition().equals(\"Start\")) ? currentTopRowNumber +1 : currentBottomRowNumber );\r\n cg.getTotalCell().setHeight( ((Integer)getRows().get( cg.getTotalCell().getBottomIndex() )).intValue() - cg.getTotalCell().getTop() );\r\n\r\n if (cg.getTotalPosition().equals(\"Start\")) currentTopRowNumber++;\r\n else currentBottomRowNumber--;\r\n\r\n // Update all cells with rowTotalGroup this group\r\n for (int k=0; k<getCrosstabElement().getCells().size(); ++k) {\r\n CrosstabCell cell = (CrosstabCell)getCrosstabElement().getCells().elementAt(k);\r\n\r\n if (cell.getRowTotalGroup().equals(cg.getName())) {\r\n\r\n cell.setTop(cg.getTotalCell().getTop());\r\n cell.setHeight( cg.getTotalCell().getHeight());\r\n }\r\n }\r\n }\r\n\r\n int currentLeftColumnNumber = rowGroups;\r\n int currentRightColumnNumber = columnGroups + rowGroups + 1;\r\n for (int i=0; i<getCrosstabElement().getColumnGroups().size(); ++i) {\r\n CrosstabGroup cg = (CrosstabGroup)getCrosstabElement().getColumnGroups().elementAt(i);\r\n\r\n // Count preceding total rows...\r\n\r\n cg.getHeaderCell().setLeftIndex( (cg.getTotalPosition().equals(\"Start\")) ? currentLeftColumnNumber+1 : currentLeftColumnNumber );\r\n cg.getHeaderCell().setLeft( ((Integer)getColumns().get( cg.getHeaderCell().getLeftIndex())).intValue() );\r\n cg.getHeaderCell().setTopIndex( i );\r\n cg.getHeaderCell().setTop( ((Integer)getRows().get( i )).intValue() );\r\n cg.getHeaderCell().setRightIndex((cg.isHasTotal() && cg.getTotalPosition().equals(\"Start\")) ? currentRightColumnNumber : currentRightColumnNumber - 1);\r\n cg.getHeaderCell().setWidth( ((Integer)getColumns().get(cg.getHeaderCell().getRightIndex()) ).intValue() -cg.getHeaderCell().getLeft());\r\n cg.getHeaderCell().setBottomIndex( i+1 );\r\n cg.getHeaderCell().setHeight( cg.getSize());\r\n\r\n cg.getTotalCell().setLeftIndex( (cg.getTotalPosition().equals(\"Start\")) ? currentLeftColumnNumber : currentRightColumnNumber-1 );\r\n cg.getTotalCell().setLeft( ((Integer)getColumns().get( cg.getTotalCell().getLeftIndex() )).intValue() );\r\n cg.getTotalCell().setTopIndex( i );\r\n cg.getTotalCell().setTop( ((Integer)getRows().get( i)).intValue() );\r\n cg.getTotalCell().setRightIndex((cg.isHasTotal() && cg.getTotalPosition().equals(\"Start\")) ? currentLeftColumnNumber +1 : currentRightColumnNumber);\r\n cg.getTotalCell().setWidth( ((Integer)getColumns().get( cg.getTotalCell().getRightIndex() )).intValue() - cg.getTotalCell().getLeft() );\r\n cg.getTotalCell().setBottomIndex( columnGroups );\r\n cg.getTotalCell().setHeight( ((Integer)getRows().get( columnGroups)).intValue() - cg.getTotalCell().getTop() );\r\n\r\n if (cg.getTotalPosition().equals(\"Start\")) currentLeftColumnNumber++;\r\n else currentRightColumnNumber--;\r\n\r\n for (int k=0; k<getCrosstabElement().getCells().size(); ++k) {\r\n CrosstabCell cell = (CrosstabCell)getCrosstabElement().getCells().elementAt(k);\r\n\r\n if (cell.getColumnTotalGroup().equals(cg.getName())) {\r\n cell.setLeft(cg.getTotalCell().getLeft());\r\n cell.setWidth( cg.getTotalCell().getWidth());\r\n }\r\n }\r\n\r\n }\r\n\r\n // Update coordinates for the A0 cell\r\n\r\n if (getCrosstabElement().getRowGroups().size() > 0)\r\n {\r\n mainCell.setTopIndex(((CrosstabGroup)getCrosstabElement().getRowGroups().lastElement()).getHeaderCell().getTopIndex() );\r\n mainCell.setTop(((CrosstabGroup)getCrosstabElement().getRowGroups().lastElement()).getHeaderCell().getTop());\r\n }\r\n else\r\n {\r\n mainCell.setTop(getCrosstabElement().getColumnGroups().size());\r\n mainCell.setTop(((Integer)getRows().get(getCrosstabElement().getColumnGroups().size())).intValue() );\r\n }\r\n mainCell.setBottomIndex(mainCell.getTopIndex() + 1);\r\n\r\n if (getCrosstabElement().getColumnGroups().size() > 0)\r\n {\r\n mainCell.setLeftIndex(((CrosstabGroup)getCrosstabElement().getColumnGroups().lastElement()).getHeaderCell().getLeftIndex() );\r\n mainCell.setLeft(((CrosstabGroup)getCrosstabElement().getColumnGroups().lastElement()).getHeaderCell().getLeft());\r\n }\r\n else\r\n {\r\n mainCell.setLeftIndex(getCrosstabElement().getRowGroups().size());\r\n mainCell.setLeft(((Integer)getColumns().get(getCrosstabElement().getRowGroups().size())).intValue());\r\n }\r\n mainCell.setRightIndex(mainCell.getLeftIndex() + 1);\r\n\r\n\r\n for (int k=0; k<getCrosstabElement().getCells().size(); ++k) {\r\n CrosstabCell cell = (CrosstabCell)getCrosstabElement().getCells().elementAt(k);\r\n\r\n if (cell.getType() == cell.DETAIL_CELL)\r\n {\r\n if (cell.getRowTotalGroup().equals(\"\")) {\r\n\r\n cell.setTop(mainCell.getTop());\r\n cell.setTopIndex(mainCell.getTopIndex());\r\n cell.setBottomIndex(mainCell.getBottomIndex());\r\n }\r\n if (cell.getColumnTotalGroup().equals(\"\")) {\r\n\r\n cell.setLeft(mainCell.getLeft());\r\n cell.setLeftIndex(mainCell.getLeftIndex());\r\n cell.setRightIndex(mainCell.getRightIndex());\r\n }\r\n\r\n cell.setTopIndex( getTotalRowTopIndex(cell.getRowTotalGroup()) );\r\n cell.setBottomIndex( cell.getTopIndex() +1);\r\n\r\n cell.setLeftIndex( getTotalColumnLeftIndex(cell.getColumnTotalGroup()) );\r\n cell.setRightIndex( cell.getLeftIndex() +1);\r\n }\r\n }\r\n\r\n // adding DEFAULT NO DATA CELL....\r\n CrosstabCell detailCell = findCell( \"\", \"\");\r\n boolean found = false;\r\n for (int i=0; i<getCrosstabElement().getCells().size(); ++i)\r\n {\r\n CrosstabCell cell = (CrosstabCell)getCrosstabElement().getCells().elementAt(i);\r\n if (cell.getType() == cell.NODATA_CELL)\r\n {\r\n cell.setTop( 0 );\r\n cell.setLeft( 0 );\r\n cell.setWidth( this.getCrosstabElement().getWidth() );\r\n cell.setHeight( this.getCrosstabElement().getHeight());\r\n cell.setTopIndex( 0 );\r\n cell.setLeftIndex( 0 );\r\n cell.setBottomIndex( 0 );\r\n cell.setRightIndex( 0 );\r\n found = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!found)\r\n {\r\n CrosstabCell defaultWhenNoDataCell= detailCell.cloneMe();\r\n defaultWhenNoDataCell.setType( defaultWhenNoDataCell.NODATA_CELL);\r\n defaultWhenNoDataCell.setParent( this.getCrosstabElement());\r\n defaultWhenNoDataCell.setName(null);\r\n defaultWhenNoDataCell.setTop( 0 );\r\n defaultWhenNoDataCell.setLeft( 0 );\r\n defaultWhenNoDataCell.setWidth( this.getCrosstabElement().getWidth() );\r\n defaultWhenNoDataCell.setHeight( this.getCrosstabElement().getHeight());\r\n defaultWhenNoDataCell.setTopIndex( 0 );\r\n defaultWhenNoDataCell.setLeftIndex( 0 );\r\n defaultWhenNoDataCell.setBottomIndex( 0 );\r\n defaultWhenNoDataCell.setRightIndex( 0 );\r\n getCrosstabElement().getCells().add(defaultWhenNoDataCell);\r\n }\r\n\r\n found = false;\r\n\r\n // adding DEFAULT HEADER CELL....\r\n for (int i=0; i<getCrosstabElement().getCells().size(); ++i)\r\n {\r\n CrosstabCell cell = (CrosstabCell)getCrosstabElement().getCells().elementAt(i);\r\n if (cell.getType() == cell.CT_HEADER_CELL)\r\n {\r\n cell.setTop( 0 );\r\n cell.setTopIndex( 0 );\r\n cell.setLeft( 0 );\r\n cell.setLeftIndex( 0 );\r\n cell.setRightIndex( getCrosstabElement().getRowGroups().size() );\r\n cell.setWidth( ((Integer)getColumns().get( cell.getRightIndex() )).intValue() );\r\n cell.setBottomIndex( getCrosstabElement().getColumnGroups().size() );\r\n cell.setHeight( ((Integer)getRows().get( cell.getBottomIndex() )).intValue() );\r\n found = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!found)\r\n {\r\n\r\n CrosstabCell crossTabHeaderCell= new CrosstabCell();\r\n crossTabHeaderCell.setType( crossTabHeaderCell.CT_HEADER_CELL);\r\n crossTabHeaderCell.setParent( this.getCrosstabElement());\r\n crossTabHeaderCell.setName(null);\r\n crossTabHeaderCell.setTop( 0 );\r\n crossTabHeaderCell.setTopIndex( 0 );\r\n crossTabHeaderCell.setLeft( 0 );\r\n crossTabHeaderCell.setLeftIndex( 0 );\r\n crossTabHeaderCell.setRightIndex( getCrosstabElement().getRowGroups().size() );\r\n crossTabHeaderCell.setWidth( ((Integer)getColumns().get( crossTabHeaderCell.getRightIndex() )).intValue() );\r\n crossTabHeaderCell.setBottomIndex( getCrosstabElement().getColumnGroups().size() );\r\n crossTabHeaderCell.setHeight( ((Integer)getRows().get( crossTabHeaderCell.getBottomIndex() )).intValue() );\r\n getCrosstabElement().getCells().add(crossTabHeaderCell);\r\n }\r\n\r\n getRowBands().clear();\r\n\r\n for (int i=1; i<getRows().size(); ++i)\r\n {\r\n Vector rowBandContents = new Vector();\r\n for (int k=0; k<getCrosstabElement().getCells().size(); ++k) {\r\n CrosstabCell cell = (CrosstabCell)getCrosstabElement().getCells().elementAt(k);\r\n if (cell.getBottomIndex() == i)\r\n {\r\n rowBandContents.add(cell);\r\n }\r\n }\r\n getRowBands().add(rowBandContents);\r\n }\r\n\r\n getColumnBands().clear();\r\n\r\n for (int i=1; i<getColumns().size(); ++i)\r\n {\r\n Vector columnBandContents = new Vector();\r\n for (int k=0; k<getCrosstabElement().getCells().size(); ++k) {\r\n CrosstabCell cell = (CrosstabCell)getCrosstabElement().getCells().elementAt(k);\r\n if (cell.getRightIndex() == i)\r\n {\r\n columnBandContents.add(cell);\r\n }\r\n }\r\n getColumnBands().add(columnBandContents);\r\n }\r\n\r\n\r\n\r\n // Update all elements positions...\r\n for (int i=0; i< getCrosstabElement().getElements().size(); ++i) {\r\n ReportElement re = (ReportElement)getCrosstabElement().getElements().elementAt(i);\r\n\r\n re.getPosition().x = re.getRelativePosition().x + re.getCell().getLeft()+10;\r\n re.getPosition().y = re.getRelativePosition().y + re.getCell().getTop()+10;\r\n\r\n re.setPosition(re.position);\r\n re.trasform(new java.awt.Point(0,0),TransformationType.TRANSFORMATION_RESIZE_SE);\r\n\r\n }\r\n\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n updateSize();\r\n\r\n }", "public void setHaveSub(){\n\t\tthis.haveSub = true;\n\t}", "private void substituteValidFirstRoundResults(MultigetSliceResult result, Map<ByteBuffer, List<ColumnOrSuperColumn>> firstRoundResults)\n {\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> keyAndCoscList : result.value.entrySet()) {\n ByteBuffer key = keyAndCoscList.getKey();\n List<ColumnOrSuperColumn> coscList = keyAndCoscList.getValue();\n\n int coscListIndex = -1;\n for (ColumnOrSuperColumn cosc : coscList) {\n coscListIndex++;\n\n if (cosc.isSetColumn()) {\n if (cosc.column.isSetFirst_round_was_valid() && cosc.column.first_round_was_valid) {\n Column firstRoundColumn = firstRoundResults.get(key).get(coscListIndex).column;\n assert ByteBufferUtil.bytesToHex(cosc.column.name).equals(ByteBufferUtil.bytesToHex(firstRoundColumn.name))\n : \"First and second round column names dont match\" + ByteBufferUtil.bytesToHex(cosc.column.name)\n + \"!=\" + ByteBufferUtil.bytesToHex(firstRoundColumn.name);\n cosc.column = firstRoundColumn;\n }\n } else if (cosc.isSetCounter_column() || cosc.isSetCounter_super_column()) {\n //WL TODO Add this logic\n assert false : \"Not yet handled\";\n } else {\n assert cosc.isSetSuper_column();\n\n int superColumnListIndex = -1;\n for (Column column : cosc.super_column.columns) {\n superColumnListIndex++;\n\n if (column.isSetFirst_round_was_valid() && column.first_round_was_valid) {\n Column firstRoundColumn = firstRoundResults.get(key).get(coscListIndex).super_column.getColumns().get(superColumnListIndex);\n assert column.name == firstRoundColumn.name : \"First and second round column names dont match\" + column.name + \"!=\" + firstRoundColumn.name;\n\n // Update the LVT of the firstRoundColumn to reflect its full validity interval\n firstRoundColumn.latest_valid_time = column.latest_valid_time;\n column = firstRoundColumn;\n }\n }\n }\n }\n }\n }", "@Override\n public boolean isCellEditable( Object node, int column )\n {\n if ( column == 0 )\n {\n return true;\n }\n\n if ( node instanceof Property )\n {\n Property p = ( Property )node;\n if ( p.isReadOnly() )\n {\n return false;\n }\n\n if ( p instanceof SimpleProperty )\n {\n return true;\n }\n\n // @pending At the moment if one property from the list of composite editor is read only all property is read only. Is there better idea?\n Object cepl = p.getDescriptor().getValue( BeanInfoConstants.COMPOSITE_EDITOR_PROPERTY_LIST );\n if ( cepl != null )\n {\n boolean bReadOnly = false;\n StringTokenizer st = new StringTokenizer( (String)cepl, \";, \" );\n while ( st.hasMoreTokens() )\n {\n Property prop = p.findProperty( st.nextToken() );\n if ( prop == null )\n {\n continue;\n }\n if ( ( bReadOnly = prop.isReadOnly() ) )\n {\n break;\n }\n }\n\n return !bReadOnly;\n }\n\n return ( ( PropertyDescriptor )p.getDescriptor() ).getPropertyEditorClass() != null;\n }\n\n return false;\n }", "public InjectInSubCell(Cell subCell) {\n this.subCell = subCell;\n }", "public static WebElement check_btnAddedIsSeen_selectedPdtChkbxHidden(Read_XLS xls, String sheetName, int rowNum, \r\n \t\tList<Boolean> testFail) throws Exception{\r\n \ttry{\r\n\r\n\t\t\t// Verify all chkbx those are odd number \r\n\t\t\tList<WebElement> chkbx = driver.findElements(\r\n\t\t\t\t\tBy.xpath(\"//*[contains(@class, 'majorPP_check')]//input[@type='checkbox']\"));\r\n\t\t\tfor(int i=1; i<chkbx.size(); i=i+2){\r\n\t\t\t\t\r\n\t\t \t//\tString btnAddedToBasket = driver.findElement(\r\n\t\t \t//\t\t\tBy.xpath(\"//*[contains(@class, 'mt5')]//a[contains(text(),'Added to Basket')]\")).getText();\r\n\t\t \tString btnAdded = driver.findElement(\r\n\t\t \t\t\tBy.xpath(\"//*[contains(@class, 'majorPP_funR')]//a[contains(text(),'Added')]\")).getText();\r\n\t\t \tAdd_Log.info(\"Print button text ::\" + btnAdded);\r\n\t\t \t\r\n\t\t \tBoolean isChkbxHidden = driver.findElement(\r\n\t\t \t\t\tBy.xpath(\"//*[contains(@class, 'majorPP_check')]//input[@type='checkbox']\")).isDisplayed();\r\n\t\t \tAdd_Log.info(\"Does chkbx still available ::\" + isChkbxHidden);\r\n\t\t \t\t \t\t\r\n\t\t \tif(btnAdded.equals(\"Added\") && isChkbxHidden == false){\r\n\t\t \t\tAdd_Log.info(\"Button value is changed from 'Add' to 'Added'.\");\r\n\t\t \t\tAdd_Log.info(\"Chkbx of those selected products are removed\");\r\n\t\t \t\tSuiteUtility.WriteResultUtility(\r\n\t\t \t\t\t\txls, sheetName, Constant.COL_PDT_INQ_ADDED_TO_BASKET_EXISTS, rowNum, Constant.KEYWORD_PASS);\r\n\t\t \t\tSuiteUtility.WriteResultUtility(\r\n\t\t \t\t\t\txls, sheetName, Constant.COL_PDT_INQ_CHKBX_REMOVED, rowNum, Constant.KEYWORD_PASS);\r\n\t\t \t}else{\r\n\t\t \t\tAdd_Log.info(\"Button value is NOT changed from 'Add' to 'Added'.\");\r\n\t\t \t\tAdd_Log.info(\"Chkbx of those selected products are NOT removed\");\r\n\t\t \t\tSuiteUtility.WriteResultUtility(\r\n\t\t \t\t\t\txls, sheetName, Constant.COL_PDT_INQ_ADDED_TO_BASKET_EXISTS, rowNum, Constant.KEYWORD_FAIL);\r\n\t\t \t\tSuiteUtility.WriteResultUtility(\r\n\t\t \t\t\t\txls, sheetName, Constant.COL_PDT_INQ_CHKBX_REMOVED, rowNum, Constant.KEYWORD_FAIL);\r\n\t\t \t\ttestFail.set(0, true);\r\n\t\t \t}\r\n\t\t\t}\r\n\r\n \t}catch(Exception e){\r\n \t\tthrow(e);\r\n \t}\r\n \treturn element;\r\n }", "private void createMainTable(Section subCatPart)\r\n throws BadElementException, MalformedURLException, IOException {\r\n \r\n \r\n PdfPTable table = new PdfPTable(model.getColumnCount());\r\n table.setWidthPercentage(100.0f);\r\n \r\n PdfPCell c1;\r\n for(int i = 0; i < model.getColumnCount(); i++){\r\n c1 = new PdfPCell(new Phrase(model.getColumnName(i)));\r\n c1.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n table.addCell(c1);\r\n }\r\n table.setHeaderRows(1);\r\n\r\n for(int row = 0; row < model.getRowCount(); row++){\r\n for (int col = 0; col < model.getColumnCount(); col++) {\r\n String input = model.getValueAt(row, col).toString();\r\n if(input.equals(\"true\"))\r\n input = \"X\";\r\n if(input.equals(\"false\"))\r\n input = \"\";\r\n PdfPCell cell = new PdfPCell(new Phrase(input));\r\n cell.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n table.addCell(cell);\r\n \r\n }\r\n }\r\n subCatPart.add(table);\r\n }", "@Override\n protected Boolean currentValue()\n {\n final PageElement versionsTable = finder.find(By.id(\"custom-content-links-admin-content\"));\n final boolean loadingCompleted = !row.hasClass(LOADING_CLASS);\n final boolean rowEnabled = versionsTable.hasClass(RESTFULTABLE_ALLOWHOVER_CLASS);\n final boolean errorOccur = row.find(By.className(ERROR_CLASS)).isPresent();\n return (loadingCompleted && rowEnabled) || errorOccur;\n }" ]
[ "0.59126115", "0.5646933", "0.56168556", "0.52477276", "0.520004", "0.5192894", "0.50469553", "0.5027326", "0.48881564", "0.48722255", "0.4831146", "0.4813216", "0.47680452", "0.47457436", "0.47308594", "0.47246438", "0.470276", "0.46942836", "0.46927664", "0.46856344", "0.4664304", "0.46429747", "0.46209127", "0.46192008", "0.45978883", "0.4581881", "0.45718205", "0.45666686", "0.45637923", "0.45513442", "0.45456323", "0.45373324", "0.45311272", "0.4505129", "0.4503674", "0.44920284", "0.44848415", "0.44724232", "0.4470982", "0.44704542", "0.44703147", "0.4466945", "0.4452313", "0.4444802", "0.4439022", "0.44299373", "0.4429469", "0.4425051", "0.44248784", "0.44242993", "0.4410738", "0.4399941", "0.43945676", "0.43882075", "0.4384637", "0.4374392", "0.43720543", "0.43705627", "0.43671355", "0.4362288", "0.43601972", "0.43595976", "0.43546456", "0.4349589", "0.43480587", "0.43473923", "0.43470109", "0.43435797", "0.43333533", "0.43284744", "0.43164992", "0.4313312", "0.43020812", "0.43009478", "0.42971966", "0.42969966", "0.42951995", "0.4288586", "0.4288413", "0.42861933", "0.4283338", "0.4277854", "0.42762387", "0.42744642", "0.42720667", "0.4269666", "0.42694414", "0.4266973", "0.42668533", "0.42663324", "0.4266096", "0.42575505", "0.42568398", "0.42557278", "0.42523608", "0.42522794", "0.42405632", "0.42400518", "0.42364573", "0.42360592", "0.42302334" ]
0.0
-1
inspired from Puzzle Baron's pseudotrue pairs, extended tontuples
public static void pseudoTrueTuples(LogicProblem logicProblem, boolean applyChanges) throws RelationshipConflictException { HashMap<ItemPair,Relationship> relationshipTable = logicProblem.getRelationshipTable(); HashSet<CategoryPair> categoryPairs = logicProblem.getCategoryPairs(); // System.out.println("searching..."); //within a subgrid for (CategoryPair categoryPair : categoryPairs) { // System.out.println("Category pair:" + categoryPair); //vertical and horizontal search for (final boolean verticalOrientation : new boolean[] { false, true } ) { Category subrowCategory = verticalOrientation?categoryPair.first():categoryPair.last(); Category subcolumnCategory = verticalOrientation?categoryPair.last():categoryPair.first(); //commenting "vertical search" //(subrows match first category's items // subcolumns match second category's items) //i (2 to floor(n/2)) is the number of elements in the combination tuple // i=2 in pseudoTrue pairs //(for subgrids of 5x5 items, looking for both pairs and triplets becomes redundant for (int i=2; i<=floor(logicProblem.getNumCategories()/2);i++) { //https://github.com/dpaukov/combinatoricslib3/wiki/v3.3.0#1-simple-combinations List<List<Item>> columnCombinations = Generator.combination(subcolumnCategory.getItems()) .simple(i) //for pseudo true pairs, i=2 .stream() .collect(Collectors.<List<Item>>toList()); //for i=2, this would contain //Bethany, Donovan //Bethany, Elizabeth //... //Frederick, Peyton // columnCombinations.stream().forEach(l -> System.out.println( // (verticalOrientation?"vertical":"horizontal")+ " combo: "+l.toString())); //create the sets //for each combination, start over //columnTuple contains i items with which we will compute set intersections for (List<Item> columnItemTuple : columnCombinations) { //Bethany, Donovan //similarly, valueNoSets contains i sets of VALUE_NO relationships List<Set<Item>> valueNoSets = new ArrayList<>(); //size=i //build a set for each i item of columnTuple for (Item columnItem : columnItemTuple) { //Bethany Set<Item> valueNoSet = new HashSet<>(); //size = n for (Item rowItem : subrowCategory.getItems()) { //Haley's Comet .... if (relationshipTable.get(new ItemPair(rowItem, columnItem)).getValue() == Relationship.ValueType.VALUE_NO) //stacking all VALUE_NO relationship into vertical set valueNoSet.add(rowItem); //store into single subcolumn set } //adding each vertical set into list of sets if (valueNoSet.size() >= logicProblem.getNumItems() - i //for pairs, we need three VALUE_NO in the set && valueNoSet.size() < logicProblem.getNumItems()-1) //uniqueness will take or n-1 cases valueNoSets.add(valueNoSet); //store single subcolumn into multi-set } //magic! Set<Item> intersectionSet = new HashSet<>(); //avoid NPE when the next call is made if (valueNoSets.size()>=2) //don't compute intersections otherwise intersectionSet = Processor.multiSetIntersection(valueNoSets); if (intersectionSet.size()==logicProblem.getNumItems()-i) { // System.out.println("----> found candidates for pseudo true pairs!"); // intersectionSet.stream().forEach(l -> System.out.println("\t" + l.toString())); // System.out.println("\t\tvs."); // columnItemTuple.stream().forEach(l -> System.out.println("\t" + l.toString())); //create predecessor list //we can only add the intersection output as predecessors ArrayList<Dependable> predecessors = new ArrayList<Dependable>(); for (Item intersectionColumn : intersectionSet) { for (Item rowItem : columnItemTuple) { predecessors.add(relationshipTable.get(new ItemPair(rowItem, intersectionColumn))); } } //we have a bunch of work to do for (Item everyRowItem : subrowCategory.getItems()) { //for every row item not in the intersectionSet if (!intersectionSet.contains(everyRowItem)) { for (Item everyColumnItem : subcolumnCategory.getItems()) { //for every column item not in any of the columnTuple list if (!columnItemTuple.contains(everyColumnItem)) { Relationship rel = relationshipTable.get(new ItemPair(everyRowItem,everyColumnItem)); if (rel.getValue()!=Relationship.ValueType.VALUE_NO) Processor.setRelationship(logicProblem, applyChanges, rel, Relationship.ValueType.VALUE_NO, Relationship.LogicType.PSEUDOTRUE, predecessors.toArray(new Relationship[predecessors.size()])); } } } } } } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasXYPairs();", "private void generatePointPairs() {\n\t\tfinal int mod = SIZE_OF_ORIGINAL_LIST * 8; \n\t\t\n\t\tif(DEBUG) System.out.println(\"----- Generating Point Pairs...\");\n\n\t\tint counter = 0;\n\t\tint j = 0;\n\t\t\n\t\tfor(int i = 0; i < myPoints.length; i++) {\n\t\t\t//while(j++ < myPoints.length) {\n\t\t\tfor( ; j < myPoints.length; j++) {\n\t\t\t\t// i and j are the same point, so ignore that pair.\n\t\t\t\tif(i != j) {\n\t\t\t\t\tmyPairs.add(new PointPair(myPoints[i], myPoints[j]));\n\t\t\t\t\tif(DEBUG && ++counter % mod == 0) System.out.print(\"pair \");\n\t\t\t\t}\n\t\t\t\t// Not yet colinear, just a unique pair to use later.\n\t\t\t}\n\n\t\t}\n\t\tif(DEBUG) System.out.println(\"\\n----- ----- \" + counter + \" pairs found.\\n\");\n\t}", "IntermediateTuple(Tuple t1, Tuple t2) {\n\n if(t1 instanceof BaseTuple) {\n baseTuples.add((BaseTuple) t1);\n } else {\n for(BaseTuple bt : ((IntermediateTuple) t1).baseTuples) {\n baseTuples.add(bt);\n }\n }\n\n if(t2 instanceof BaseTuple) {\n baseTuples.add((BaseTuple) t2);\n } else {\n for(BaseTuple bt : ((IntermediateTuple) t2).baseTuples) {\n baseTuples.add(bt);\n }\n }\n }", "private void generate_pairs(ArrayList<Point> pointSet) {\n\t\tfor (int i = 0; i < pointSet.size(); i++) {\n\t\t\tfor (int j = i + 1; j < pointSet.size(); j++) {\n\n\t\t\t\tPair new_pair;\n\t\t\t\ttry {\n\t\t\t\t\tnew_pair = new Pair(pointSet.get(i), pointSet.get(j));\n\t\t\t\t\tunmarked_pairs.add(new_pair);\n\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// Dimensions don't match exception\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "protected double[] getPairCounts(Hashtable<Integer, Double> words) {\n\t\tdouble positiveCount = 0;\n\t\tdouble negativeCount = 0;\n\t\tfor(int word1 : words.keySet()){\n\t\t\tfor(int word2 : words.keySet()){\n\t\t\t\tif(word1 != word2){\n\t\t\t\t\tif(relatedPairs[word1].contains(word2)){\n\t\t\t\t\t\tpositiveCount+= words.get(word1) * words.get(word2); //pairs with feature same SG\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tnegativeCount+= words.get(word1) * words.get(word2); // pairs with feature different SG\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn new double[]{positiveCount, negativeCount};//return both\n\t}", "private void compressNonCrossingPairs(final List<GPairRecord<S, S>> records) {\n if(records.isEmpty()) {\n return ;\n }\n\n boolean globalCrossing = false;\n Pair<S, S> lastCrossingPair = null;\n Pair<S, S> lastCompressedPair = null;\n Iterator<GPairRecord<S, S>> iterator = records.iterator();\n GPairRecord<S, S> record;\n S letter = null;\n\n while(iterator.hasNext())\n {\n record = iterator.next();\n Pair<S, S> currentPair = record.pair;\n globalCrossing = record.isCrossingPair() || (lastCrossingPair != null && (lastCrossingPair.equals(currentPair)));\n\n if(record.isCrossingPair()) {\n lastCrossingPair = currentPair;\n }\n\n // skip all crossing pairs including the local pairs that are not crossing but has some other pairs equal to them are crossing\n if(!globalCrossing) {\n if(wordProperties.isPairAt(record.node, currentPair)) {\n if(lastCompressedPair == null || !lastCompressedPair.equals(record.pair)) {\n Pair<S, S> pair = record.pair;\n letter = terminalAlphabet.createTerminal(phase, 1L, pair.a.getWeight() + pair.b.getWeight(), pair);\n //signature.createLetter(record.pair);\n lastCompressedPair = record.pair;\n }\n compressNonCrossingPair(record, letter);\n }\n iterator.remove();\n }\n else {\n // we need the pairs to calculate the appearance for greedy pairing!\n if(!greedyPairCompression) {\n if(record.isCrossingPair() || !wordProperties.isPairAt(record.node, record.pair)) {\n iterator.remove();\n }\n }\n }\n }\n }", "private Pair Flats(double[] notes){\n\t\t//Bb (at 10) is the first one\n\t\t//Also, Cb = B and Fb = E\n\t\tdouble error = 0;\n\t\tint bestkey = 7;\n\t\t//First check for the keys with Cb and Fb\n\t\tint[] drkeys = new int[]{1, 6, 8};\n\t\tfor(int i: drkeys){\n\t\t\terror += notes[i+1];\n\t\t}\n\t\terror += notes[0];\n\t\tif (notes[5]<notes[4]){\n\t\t\terror+=notes[5];\n\t\t}\n\t\telse{\n\t\t\terror+=notes[4];\n\t\t\tbestkey = 6;\n\t\t}\n\t\tfor(int i=0; i<6; i++){\n\t\t\tdouble tp = flatsError(notes, i);\n\t\t\tif (tp < error){\n\t\t\t\terror = tp;\n\t\t\t\tbestkey =i;\n\t\t\t}\n\t\t}\n\t\treturn new Pair(error, bestkey);\n\t}", "private int twoPairs() {\n\t\tint check = 0;\n\t\tint[] pairPos = new int[2];\n\t\tfor (int counter = POS_ONE; counter < Constants.HAND_SIZE; counter++) {\n\t\t\tif (hand[counter - 1].getValueIndex() == hand[counter].getValueIndex()) {\n\t\t\t\tpairPos[check] = counter;\n\t\t\t\tcheck++;\n\t\t\t}\n\t\t}\n\t\tif (check == 2) {\n\t\t\tresult.setPrimaryValuePos(hand[pairPos[1]].getValueIndex());\n\t\t\tresult.setSecondaryValuePos(hand[pairPos[0]].getValueIndex());\n\t\t\tList<Card> tertiaryValue = Arrays.stream(hand)\n\t\t\t\t\t.filter(card -> card.getValueIndex() != hand[pairPos[0]].getValueIndex())\n\t\t\t\t\t.filter(card -> card.getValueIndex() != hand[pairPos[1]].getValueIndex())\n\t\t\t\t\t.collect(Collectors.toList());\n\t\t\tresult.setTertiaryValuePos(tertiaryValue.get(0).getValueIndex());\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "boolean isTwoPair();", "boolean isOnePair();", "public pair[] genARandomTuple(int[] values, int t){\n pair[] res = new pair[t];\n ArrayList<Integer> loc = new ArrayList<>();\n int index = 0;\n while(index < t){\n int tmp = random.nextInt(values.length);\n if(!loc.contains(tmp)){\n loc.add(tmp);\n index++;\n\t }\n\t}\n\tfor(int i = 0; i < t; i++)\n res[i] = new pair(loc.get(i), random.nextInt(values[loc.get(i)]));\n\treturn res;\n }", "public static void main(String[] args) {\n\r\n\t\t\r\n\t\tpairdiff<String, String> p=new pairdiff<String,String>(\"ab\",\"cd\");\r\n\t\tp.setFirst(\"def\");\r\n\t\tString s=p.getFirst();\r\n\t\t//pair<int> p1=new pair<int>(1,2);//this is prrematative datatype so not allowed\r\n\t\tpairdiff<Integer,String> p1=new pairdiff<Integer,String>(1,\"temp\");\r\n\t\tpairdiff<Character,Character> p2=new pairdiff<>('a','b');\r\n\t\r\n\t\tint a=10;\r\n\t\tint b=12;\r\n\t\tint c=23;\r\n\t\tpairdiff<Integer,Integer> ip=new pairdiff<>(a,b);\r\n\t\t\r\n\t\t\r\n\tpairdiff<pairdiff<Integer,Integer>,Integer> p3=new pairdiff<>(ip,c);\t\r\n\t\r\n\tSystem.out.println(p3.getSecond());\r\n\tSystem.out.println(p3.getFirst().getFirst());\r\n\tSystem.out.println(p3.getFirst().getFirst());\r\n\t}", "public boolean checkEGJoin(List<String> queryTriplets) {\n\n boolean flagEG = false;\n boolean foundEG = false;\n List<List<String>> newEGpair = null;\n List<List<String>> newEGpair2 = null;\n List<String> innerDTP = null;\n List<String> outerDTP = null;\n List<String> currEG = null;\n\n if (queryTriplets.size() >= 6) {\n\n for (int key : mapTmpEGtoAllTPs.keySet()) {\n\n currEG = mapTmpEGtoAllTPs.get(key);\n int commElems = myBasUtils.candidateTPcomElems(currEG, queryTriplets);\n\n if (currEG.size() == queryTriplets.size()) {\n\n // the second condition, is used to capture Nested Loop with EG operator, made by FedX\n if (commElems == currEG.size() || commElems == currEG.size() - 1) {\n\n if (commElems == currEG.size() - 1) {\n\n mapEGtoCancel.put(key, 1);\n mapEGtoOccurs.put(currEG, 2);\n }\n\n foundEG = true;\n break;\n }\n\n }\n\n }\n\n //If it's the first time we see this EG or NLEG, we save each pairWise join as EG\n if (!foundEG) {\n\n int indEG = mapTmpEGtoAllTPs.size();\n mapTmpEGtoAllTPs.put(indEG, queryTriplets);\n mapEGtoOccurs.put(currEG, 1);\n\n for (int i = 0; i < queryTriplets.size(); i += 3) {\n\n outerDTP = myDedUtils.getCleanTP(new LinkedList<>(queryTriplets.subList(i, i + 3)));\n for (int f = i + 3; f < queryTriplets.size(); f += 3) {\n\n flagEG = true;\n innerDTP = myDedUtils.getCleanTP(new LinkedList<>(queryTriplets.subList(f, f + 3)));\n newEGpair = Arrays.asList(innerDTP, outerDTP);\n newEGpair2 = Arrays.asList(outerDTP, innerDTP);\n myDedUtils.setNewEGInfo(outerDTP, innerDTP, newEGpair, newEGpair2, indEG);\n }\n\n }\n }\n\n }\n\n return flagEG;\n }", "public boolean isGeneralTuple();", "@Override\n public Tuple nonDistinctNext() {\n //function takes tuples from o2, merges them with t1 from o1 and\n //evaluates them, if it finds a fitting Tuple, returns the result of merge;\n while (tuple1 != null) {\n Tuple tuple2 = o2.nonDistinctNext();\n\n while (tuple2 != null) {\n Tuple result = tupleTrans.transform(new Tuple(tuple1, tuple2));\n if (result != null) {\n return result;\n }\n tuple2 = o2.nonDistinctNext();\n }\n\n //if o2 runs out of Tupes, new t1 is taken from o1 and o2 is reset\n tuple1 = o1.nonDistinctNext();\n o2.reset();\n }\n //if o1 runs out of tuples (t1 == null), the operator is at the end\n return null;\n }", "public static Boolean getAppositivePrs(PairInstance inst) {\n if (inst.getAnaphor().getSentId()!=inst.getAntecedent().getSentId()) \n return false;\n\n// exclude pairs where anaphor is an NE -- this might be a bad idea though..\n if (inst.getAnaphor().isEnamex()) \n return false;\n\n\n if (inst.getAntecedent().isEnamex() &&\n inst.getAnaphor().isEnamex()) {\n\n// exclude pairs of NE that have different type\n\n if (!(inst.getAntecedent().getEnamexType().equals(\n inst.getAnaphor().getEnamexType())))\n return false;\n\n// exclude pairs of LOC-ne\n if (inst.getAntecedent().getEnamexType().toLowerCase().startsWith(\"gpe\"))\n return false;\n if (inst.getAntecedent().getEnamexType().toLowerCase().startsWith(\"loc\"))\n return false;\n }\n\n// should have not-null maxnp-trees (otherwise -- problematic mentions)\n\nTree sentenceTree=inst.getAnaphor().getSentenceTree();\nTree AnaTree=inst.getAnaphor().getMaxNPParseTree();\nTree AnteTree=inst.getAntecedent().getMaxNPParseTree();\nif (sentenceTree==null) return false;\nif (AnaTree==null) return false;\nif (AnteTree==null) return false;\n\n\n// the structure should be ( * (,) (ANA)) or ( * (,) (ANTE)) -- depends on the ordering, annotation, mention extraction etc\n\n if (AnteTree.parent(sentenceTree)==AnaTree) {\n Tree[] chlds=AnaTree.children();\n Boolean lastcomma=false;\n for (int i=0; i<chlds.length && chlds[i]!=AnteTree; i++) {\n lastcomma=false;\n if (chlds[i].value().equalsIgnoreCase(\",\")) lastcomma=true;\n }\n return lastcomma;\n }\n if (AnaTree.parent(sentenceTree)==AnteTree) {\n\n Tree[] chlds=AnteTree.children();\n Boolean lastcomma=false;\n for (int i=0; i<chlds.length && chlds[i]!=AnaTree; i++) {\n lastcomma=false;\n if (chlds[i].value().equalsIgnoreCase(\",\")) lastcomma=true;\n }\n return lastcomma;\n\n }\n\n return false;\n\n }", "@SuppressWarnings(\"UnusedDeclaration\")\npublic interface LObjBoolPair<T> extends LTuple<Object> \n {\n\n int SIZE = 2;\n\n\n T first();\n\n default T value() {\n return first();\n }\n\n boolean second();\n\n\n\n @Override default Object get(int index) {\n switch(index) {\n case 1: return first();\n case 2: return second();\n default: throw new NoSuchElementException();\n }\n }\n\n\n /** Tuple size */\n @Override default int tupleSize() {\n return SIZE;\n }\n\n \n\n /** Static hashCode() implementation method that takes same arguments as fields of the LObjBoolPair and calculates hash from it. */\n static <T> int argHashCode(T a1,boolean a2) {\n final int prime = 31;\n int result = 1;\n result = prime * result + ((a1 == null) ? 0 : a1.hashCode());\n result = prime * result + Boolean.hashCode(a2);\n return result;\n }\n\n /** Static equals() implementation that takes same arguments (doubled) as fields of the LObjBoolPair and checks if all values are equal. */\n static <T> boolean argEquals(T a1,boolean a2, T b1,boolean b2) {\n return\n Null.equals(a1, b1) && //\n a2==b2; //\n }\n\n /**\n * Static equals() implementation that takes two tuples and checks if they are equal.\n * Tuples are considered equal if are implementing LObjBoolPair interface (among others) and their LObjBoolPair values are equal regardless of the implementing class\n * and how many more values there are.\n */\n static boolean argEquals(LObjBoolPair the, Object that) {\n return Null.equals(the, that, (one, two) -> {\n // Intentionally all implementations of LObjBoolPair are allowed.\n if (!(two instanceof LObjBoolPair)) {\n return false;\n }\n\n LObjBoolPair other = (LObjBoolPair) two;\n\n return argEquals(one.first(), one.second(), other.first(), other.second());\n });\n }\n\n /**\n * Static equals() implementation that takes two tuples and checks if they are equal.\n */\n public static boolean tupleEquals(LObjBoolPair the, Object that) {\n return Null.equals(the, that, (one, two) -> {\n // Intentionally all implementations of LObjBoolPair are allowed.\n if (!(two instanceof LObjBoolPair)) {\n return false;\n }\n\n LObjBoolPair other = (LObjBoolPair) two;\n\n return one.tupleSize() == other.tupleSize() &&\n argEquals(one.first(), one.second(), other.first(), other.second());\n });\n }\n\n\n\n \n @Override default Iterator<Object> iterator() {\n return new Iterator<Object>() {\n\n private int index;\n\n @Override public boolean hasNext() {\n return index<SIZE;\n }\n\n @Override public Object next() {\n index++;\n return get(index);\n }\n };\n }\n\n interface ComparableObjBoolPair<T extends Comparable<? super T>> extends LObjBoolPair<T>, Comparable<LObjBoolPair<T>> {\n @Override\n default int compareTo(LObjBoolPair<T> that) {\n return Null.compare(this, that, (one, two) -> {\n int retval = 0;\n\n return\n (retval = Null.compare(one.first(), two.first())) != 0 ? retval : //\n (retval = Boolean.compare(one.second(), two.second())) != 0 ? retval : 0; //\n });\n }\n\n }\n \n\n abstract class AbstractObjBoolPair<T> implements LObjBoolPair<T> {\n\n @Override\n public boolean equals(Object that) {\n return LObjBoolPair.tupleEquals(this, that);\n }\n\n @Override\n public int hashCode() {\n return LObjBoolPair.argHashCode(first(),second());\n }\n\n @Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n sb.append('(');\n sb.append(first());\n sb.append(',');\n sb.append(second());\n sb.append(')');\n return sb.toString();\n }\n\n }\n\n\n\n\n\n /**\n * Mutable tuple.\n */\n\n interface Mut<T,SELF extends Mut<T,SELF>> extends LObjBoolPair<T> {\n\n\n\n SELF first(T first) ; \n SELF second(boolean second) ; \n\n default SELF setFirst(T first) {\n this.first(first);\n return (SELF) this;\n }\n\n\n /** Sets value if predicate(current) is true */\n default SELF setFirstIf(T first, LPredicate<T> predicate) {\n if (predicate.test(this.first())) {\n return this.first(first);\n }\n return (SELF) this;\n }\n\n /** Sets new value if predicate predicate(newValue, current) is true. */\n default SELF setFirstIf(T first, LBiPredicate<T,T> predicate) {\n if (predicate.test(first, this.first())) {\n return this.first(first);\n }\n return (SELF) this;\n }\n\n /** Sets new value if predicate predicate(current, newValue) is true. */\n default SELF setFirstIf(LBiPredicate<T,T> predicate, T first) {\n if (predicate.test(this.first(), first)) {\n return this.first(first);\n }\n return (SELF) this;\n }\n \n\n\n default SELF setSecond(boolean second) {\n this.second(second);\n return (SELF) this;\n }\n\n\n /** Sets value if predicate(current) is true */\n default SELF setSecondIf(boolean second, LLogicalOperator predicate) {\n if (predicate.apply(this.second())) {\n return this.second(second);\n }\n return (SELF) this;\n }\n\n /** Sets new value if predicate predicate(newValue, current) is true. */\n default SELF setSecondIf(boolean second, LLogicalBinaryOperator predicate) {\n if (predicate.apply(second, this.second())) {\n return this.second(second);\n }\n return (SELF) this;\n }\n\n /** Sets new value if predicate predicate(current, newValue) is true. */\n default SELF setSecondIf(LLogicalBinaryOperator predicate, boolean second) {\n if (predicate.apply(this.second(), second)) {\n return this.second(second);\n }\n return (SELF) this;\n }\n \n\n\n default SELF reset() {\n this.first(null);\n this.second(false);\n return (SELF) this;\n }\n }\n\n\n\n\n\n\n public static <T> MutObjBoolPair<T> of() { \n return of( null , false );\n }\n \n\n public static <T> MutObjBoolPair<T> of(T a1,boolean a2){\n return new MutObjBoolPair(a1,a2);\n }\n\n public static <T> MutObjBoolPair<T> copyOf(LObjBoolPair<T> tuple) {\n return of(tuple.first(), tuple.second());\n }\n\n\n /**\n * Mutable, non-comparable tuple.\n */\n\n class MutObjBoolPair<T> extends AbstractObjBoolPair<T> implements Mut<T,MutObjBoolPair<T>> {\n\n private T first;\n private boolean second;\n\n public MutObjBoolPair(T a1,boolean a2){\n this.first = a1;\n this.second = a2;\n }\n\n\n public @Override T first() {\n return first;\n }\n\n public @Override MutObjBoolPair<T> first(T first) {\n this.first = first;\n return this;\n }\n \n public @Override boolean second() {\n return second;\n }\n\n public @Override MutObjBoolPair<T> second(boolean second) {\n this.second = second;\n return this;\n }\n \n\n\n\n\n\n\n\n\n\n\n\n\n }\n\n\n\n\n\n\n public static <T extends Comparable<? super T>> MutCompObjBoolPair<T> comparableOf() { \n return comparableOf( null , false );\n }\n \n\n public static <T extends Comparable<? super T>> MutCompObjBoolPair<T> comparableOf(T a1,boolean a2){\n return new MutCompObjBoolPair(a1,a2);\n }\n\n public static <T extends Comparable<? super T>> MutCompObjBoolPair<T> comparableCopyOf(LObjBoolPair<T> tuple) {\n return comparableOf(tuple.first(), tuple.second());\n }\n\n\n /**\n * Mutable, comparable tuple.\n */\n\n final class MutCompObjBoolPair<T extends Comparable<? super T>> extends AbstractObjBoolPair<T> implements ComparableObjBoolPair<T>,Mut<T,MutCompObjBoolPair<T>> {\n\n private T first;\n private boolean second;\n\n public MutCompObjBoolPair(T a1,boolean a2){\n this.first = a1;\n this.second = a2;\n }\n\n\n public @Override T first() {\n return first;\n }\n\n public @Override MutCompObjBoolPair<T> first(T first) {\n this.first = first;\n return this;\n }\n \n public @Override boolean second() {\n return second;\n }\n\n public @Override MutCompObjBoolPair<T> second(boolean second) {\n this.second = second;\n return this;\n }\n \n\n\n\n\n\n\n\n\n\n\n\n\n }\n\n\n\n\n\n\n\n public static <T> ImmObjBoolPair<T> immutableOf(T a1,boolean a2){\n return new ImmObjBoolPair(a1,a2);\n }\n\n public static <T> ImmObjBoolPair<T> immutableCopyOf(LObjBoolPair<T> tuple) {\n return immutableOf(tuple.first(), tuple.second());\n }\n\n\n /**\n * Immutable, non-comparable tuple.\n */\n@Immutable\n final class ImmObjBoolPair<T> extends AbstractObjBoolPair<T> {\n\n private final T first;\n private final boolean second;\n\n public ImmObjBoolPair(T a1,boolean a2){\n this.first = a1;\n this.second = a2;\n }\n\n\n public @Override T first() {\n return first;\n }\n\n public @Override boolean second() {\n return second;\n }\n\n\n\n }\n\n\n\n\n\n\n\n public static <T extends Comparable<? super T>> ImmCompObjBoolPair<T> immutableComparableOf(T a1,boolean a2){\n return new ImmCompObjBoolPair(a1,a2);\n }\n\n public static <T extends Comparable<? super T>> ImmCompObjBoolPair<T> immutableComparableCopyOf(LObjBoolPair<T> tuple) {\n return immutableComparableOf(tuple.first(), tuple.second());\n }\n\n\n /**\n * Immutable, comparable tuple.\n */\n@Immutable\n final class ImmCompObjBoolPair<T extends Comparable<? super T>> extends AbstractObjBoolPair<T> implements ComparableObjBoolPair<T> {\n\n private final T first;\n private final boolean second;\n\n public ImmCompObjBoolPair(T a1,boolean a2){\n this.first = a1;\n this.second = a2;\n }\n\n\n public @Override T first() {\n return first;\n }\n\n public @Override boolean second() {\n return second;\n }\n\n\n\n }\n\n\n\n}", "public void compressPairsGreedy(final List<GPairRecord<S, S>> pairApperances, final List<GPairRecord<S, S>> crossingPairs, final int largestTerminal) {\n\n BitSet bitSet = new BitSet(largestTerminal);\n BitSet leftSigma = new BitSet(largestTerminal);\n BitSet rightSigma = new BitSet(largestTerminal);\n\n List<List<Pair<S, Long>>> right = new ArrayList<>(largestTerminal);\n List<List<Pair<S, Long>>> left = new ArrayList<>(largestTerminal);\n\n // initial tables left and right\n for(int i = 0; i < largestTerminal; i++) {\n right.add(new ArrayList<Pair<S, Long>>());\n left.add(new ArrayList<Pair<S, Long>>());\n }\n\n // fill tables with k_{ab} and k_{ba}\n for(GPairRecord<S, S> record : pairApperances) {\n right.get(record.pair.a.getId()).add(new Pair<S, Long>(record.pair.b, record.getAppearences()));\n left.get(record.pair.b.getId()).add(new Pair<S, Long>(record.pair.a, record.getAppearences()));\n }\n\n for(GPairRecord<S, S> record : crossingPairs) {\n bitSet.set(record.pair.a.getId());\n bitSet.set(record.pair.b.getId());\n }\n\n int[] countR = new int[largestTerminal];\n int[] countL = new int[largestTerminal];\n\n for(int a = 0; a < bitSet.size(); a++) {\n if(bitSet.get(a)) {\n int[] count = null;\n if(countR[a] >= countL[a]) {\n leftSigma.set(a);\n count = countL;\n }\n else {\n rightSigma.set(a);\n count = countR;\n }\n\n Iterator<Pair<S, Long>> rightIterator = right.get(a).iterator();\n while (rightIterator.hasNext()) {\n Pair<S, Long> entry = rightIterator.next();\n count[entry.a.getId()] += entry.b;\n rightIterator.remove();\n }\n\n Iterator<Pair<S, Long>> leftIterator = left.get(a).iterator();\n while (leftIterator.hasNext()) {\n Pair<S, Long> entry = leftIterator.next();\n count[entry.a.getId()] += entry.b;\n leftIterator.remove();\n }\n }\n }\n\n long sumL = 0;\n long sumR = 0;\n\n // Sum up appearances: O(|G|)\n for(GPairRecord<S, S> record : pairApperances) {\n Pair<S,S> pair = record.pair;\n if(leftSigma.get(pair.a.getId()) && rightSigma.get(pair.b.getId())) {\n sumL += record.getAppearences();\n }\n\n if(rightSigma.get(pair.a.getId()) && leftSigma.get(pair.b.getId())) {\n sumR += record.getAppearences();\n }\n }\n\n // swap\n if(sumL < sumR) {\n BitSet tmp = rightSigma;\n rightSigma = leftSigma;\n leftSigma = tmp;\n }\n\n Iterator<GPairRecord<S, S>> pairRecordIterator = crossingPairs.iterator();\n while (pairRecordIterator.hasNext()) {\n Pair<S, S> pair = pairRecordIterator.next().pair;\n if(!leftSigma.get(pair.a.getId()) || !rightSigma.get(pair.b.getId())) {\n pairRecordIterator.remove();\n }\n }\n final BitSet fixedRightSigma = rightSigma;\n final BitSet fixedLeftSigma = leftSigma;\n\n // remove pairs we don't wanna compress: O(|G|)\n final List<GPairRecord<S,S>> uncrossedPairs = crossingPairs.stream()\n .filter(rec -> !rec.isCrossingPair())\n .filter(rec -> wordProperties.isPairAt(rec.node, rec.pair))\n .filter(rec -> fixedLeftSigma.get(rec.pair.a.getId()) && fixedRightSigma.get(rec.pair.b.getId()))\n .collect(Collectors.toList());\n\n // gather the uncrossed ones: O(|G|)\n if(!uncrossedPairs.isEmpty()) {\n final List<GPairRecord<S,S>> trash = new LinkedList<>();\n final Function<Pair<S, S>, Consumer<GPairRecord<S, S>>> consumerFunction = p ->\n {\n if(fixedLeftSigma.get(p.a.getId()) && fixedRightSigma.get(p.b.getId())) {\n return uncrossedPairs::add;\n }\n else {\n return trash::add;\n }\n };\n\n BiFunction<S, Integer, Boolean> doGreedyLeftPop = (nonTerminal, j) -> doLeftPop(nonTerminal, head -> head.isTerminal() && fixedRightSigma.get(head.getId()));\n\n BiFunction<S, Integer, Boolean> doGreedyRightPop = (nonTerminal, j) -> doRightPop(nonTerminal, tail -> tail.isTerminal() && fixedLeftSigma.get(tail.getId()));\n\n //pop: O(n+m)\n pop(phase, nonTerminal -> doGreedyLeftPop.apply(nonTerminal, 0), nonTerminal -> doGreedyRightPop.apply(nonTerminal, 0), consumerFunction);\n\n // O(|G|)\n sortPairs(uncrossedPairs);\n\n // O(|G|)\n compressUncrossedPairs(uncrossedPairs);\n }\n }", "public Collection<MatchingPair> matchingPairs(Collection<Integer> values, Integer targetSum)\n {\n HashMap<Integer, Integer> tableCompteur = new HashMap<>();\n LinkedHashMap<Integer, Integer> tablePaire = new LinkedHashMap<Integer, Integer>();\n Collection<MatchingPair> paireSansDuplication = new LinkedList();\n Collection<MatchingPair> solution = new LinkedList();\n\n // On itere sur les valeurs donnee pour savoir le compte de chaque valeur\n for (Integer valeur : values)\n {\n if (tableCompteur.containsKey(valeur))\n {\n // Partie Compteur\n Integer compteur = tableCompteur.get(valeur);\n compteur++;\n tableCompteur.put(valeur, compteur);\n }\n else {\n tableCompteur.put(valeur, 0);\n }\n\n }\n\n // On itere sur les valeurs donnee pour savoir les paires\n for (Integer element : values)\n {\n int temp = targetSum - element;\n if (tablePaire.containsKey(element))\n {\n if (tablePaire.get(element) != null)\n {\n paireSansDuplication.add(new MatchingPair(element, temp));\n }\n // si la table contient l'element on met nul pour ne pas avoir de repetition\n tablePaire.put(temp, null);\n }\n else if (!tablePaire.containsKey(element))\n {\n tablePaire.put(temp, element);\n }\n }\n\n // On trouve le minimum count entre les paire et leur compte pour tenir en compte de toutes les possibilites. Ici le meilleur cas reste O(n) ( pas de paire)\n for (MatchingPair paire : paireSansDuplication)\n {\n if (paire != null) { // verification au debug pr erreur nullpointer\n int a = tableCompteur.get(paire.first);\n int b = tableCompteur.get(paire.second);\n int minCount = Math.min(a+1, b+1);\n for (int i = 0; i < pow(minCount, 2); i++)\n {\n solution.add(new MatchingPair(paire.first, paire.second));\n }\n }\n }\n return solution;\n }", "public static boolean opposites(Pair[] data){\n HashSet<Pair> hs = new HashSet<>(20, 0.9f);\n for(Pair p : data) {\n if(hs.contains(new Pair(p.b(), p.a())))\n return true;\n hs.add(p);\n }\n return false;\n }", "private boolean checkTwoPairs(Player player) {\n\t\t// first pair\n\t\tcheckPair(player);\n\n\t\t// doesn't qualify for 2 pairs\n\t\tif (!player.isPair()) {\n\t\t\tplayer.setPair(false);\n\t\t\treturn false;\n\t\t}\n\n\t\t// second pair\n\t\tfor (int j = 4; j > 0; j--) {\n\t\t\tif (player.getSevenCardsTempHand().get(j).getRank()\n\t\t\t\t\t.equals(player.getSevenCardsTempHand().get(j - 1).getRank())) {\n\t\t\t\tplayer.setTwoPairs(true);\n\t\t\t\tplayer.setHandRank(HandRank.TWO_PAIRS);\n\n\t\t\t\t// add second pair to the 5 cards hand\n\t\t\t\thand[2] = player.getSevenCardsTempHand().get(j);\n\t\t\t\thand[3] = player.getSevenCardsTempHand().get(j - 1);\n\t\t\t\tplayer.getSevenCardsTempHand().remove(j);\n\t\t\t\tplayer.getSevenCardsTempHand().remove(j - 1);\n\n\t\t\t\t// add kicker\n\t\t\t\thand[4] = player.getSevenCardsTempHand().get(2);\n\t\t\t\tplayer.setFiveCardsHand(hand);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// add 3 kickers for the single pair found\n\t\thand[2] = player.getSevenCardsTempHand().get(4);\n\t\thand[3] = player.getSevenCardsTempHand().get(3);\n\t\thand[4] = player.getSevenCardsTempHand().get(2);\n\t\tplayer.setFiveCardsHand(hand);\n\n\t\treturn false;\n\t}", "@DataProvider(name = \"allPairs\")\n public Object[][] allPairs() {\n final List<Object[]> tests = new ArrayList<>();\n\n for (final Allele ref : Arrays.asList(refA, refC, refG, refT)){\n for (final Allele alt : Arrays.asList(altA, altC, altG, altT)){\n if (!ref.getBaseString().equals(alt.getBaseString())){\n tests.add(new Object[]{ref, alt});\n }\n }\n }\n\n return tests.toArray(new Object[][]{});\n }", "public boolean paired();", "private Pair<Integer, Integer> trans(int i) {\r\n\t\tif (i == 0) {\r\n\t\t\treturn new Pair(0, -1);\r\n\t\t} else if (i == 1) {\r\n\t\t\treturn new Pair(1, 0);\r\n\t\t} else if (i == 2) {\r\n\t\t\treturn new Pair(0, 1);\r\n\t\t} else {\r\n\t\t\treturn new Pair(-1, 0);\r\n\t\t}\r\n\t}", "public boolean isSecondPair(){\n\t\treturn testBitwiseFlag(128);\n\t}", "public static int matchingPairs(String s, String t) {\n if(s.length() != t.length()) return 0;\r\n StringBuilder sb1 = new StringBuilder();\r\n StringBuilder sb2 = new StringBuilder();\r\n int res = 0;\r\n boolean hasDuplicates = false; //Edge Case where if it has Dups then you can just to inner swap and you will get same result\r\n Set<Character> dupsCheckSet = new HashSet<>();\r\n\r\n for(int idx = 0; idx < s.length(); idx++){\r\n if(s.charAt(idx) != t.charAt(idx)){\r\n sb1.append(s.charAt(idx));\r\n sb2.append(t.charAt(idx));\r\n }else {\r\n if(!dupsCheckSet.add(s.charAt(idx))){\r\n hasDuplicates = true;\r\n }\r\n res++;\r\n }\r\n }\r\n\r\n //if both string are same then you don't have to calculate\r\n if(sb1.length() == 0){\r\n if(hasDuplicates){\r\n return res;\r\n }\r\n return res - 2;\r\n }\r\n\r\n Map<Character, Integer> mapS = new HashMap<>(), mapT = new HashMap<>();\r\n for (int idx = 0; idx < sb1.length(); idx++){ //\"bd\",\"db\";\r\n //if mapS contains chars from sb2 then if we swap them with each other it will be a matching pair\r\n if(mapS.containsKey(sb2.charAt(idx))){\r\n res++;\r\n }\r\n //if both Chars are reverse of each other then we can switch and add 1 to it\r\n if(mapS.getOrDefault(sb2.charAt(idx), -1) == mapT.getOrDefault(sb1.charAt(idx), -2)){\r\n return res + 1;\r\n }\r\n mapS.put(sb1.charAt(idx), idx);\r\n mapT.put(sb2.charAt(idx), idx);\r\n }\r\n\r\n\r\n return res + ((sb1.length() == 1) ? -1 : 0);\r\n }", "private List<GPairRecord<S,S>> getCrossingPairs(final Predicate<Pair<S, S>> predicate) {\n\n // get first and last terminal for each non-terminal\n Pair<S, S>[] pairs = getFirstLastMappingArray();\n\n // list of records of crossing pairs\n List<GPairRecord<S,S>> recordList = new ArrayList<>();\n\n // scan for crossing pairs in the right order\n slp.getOrderedProductions().stream().map(p -> p.getLeft()).forEach(nonTerminal -> consumeCrossingPairs(nonTerminal, recordList::add, pairs, predicate));\n return recordList;\n }", "private static Set<List<Integer>> createNtuples(Dataset dataset) {\r\n\t\tList<Set<Integer>> ntupleList = new ArrayList<>();\r\n\r\n\t\tfor (Integer dimensionSize : dataset.getSize()) {\r\n\t\t\tSet<Integer> set = new TreeSet<>();\r\n\t\t\tfor (Integer i = 0; i < dimensionSize; i++) {\r\n\t\t\t\tset.add(i);\r\n\t\t\t}\r\n\t\t\tntupleList.add(set);\r\n\t\t}\r\n\r\n\t\treturn Sets.cartesianProduct(ntupleList);\r\n\t}", "private void compressUncrossedPairs(final List<GPairRecord<S, S>> records) {\n Iterator<GPairRecord<S, S>> recordIterator = records.iterator();\n\n S letter = null;\n Pair pair = null;\n while(recordIterator.hasNext())\n {\n GPairRecord<S, S> record = recordIterator.next();\n // is there now a uncrossed pair at the node?\n if(wordProperties.isPairAt(record.node, record.pair)) {\n if(letter == null || !record.pair.equals(pair)) {\n letter = terminalAlphabet.createTerminal(phase, 1L, record.pair.a.getWeight() + record.pair.b.getWeight(), record.pair);\n pair = record.pair;\n }\n compressNonCrossingPair(record, letter);\n }\n // remove useless pointers, this may happen if a crossed pair becomes uncrossed due to pop and becomes crossed again due pop.\n recordIterator.remove();\n }\n }", "int[][] Naive(int m, Pointd[] points){\n int[][] tours = new int[m][];\n for(int i=0; i<m; i++){\n if(i<points.length%m) tours[i] = new int[points.length/m+1];\n else tours[i] = new int[points.length/m];\n }\n\n //Select the first point, find the next closest point, find the next closest point to that etc\n boolean[] alreadyInTour = new boolean[points.length];\n double minDistance;\n double distance;\n Pointd pointA;\n Pointd pointB;\n int index = 0;\n int n;\n\n for(int k=0; k<m; k++){\n //Each row of tours, first find a node that isn't in a tour\n n = 0;\n while(alreadyInTour[n]) n++;\n pointA = points[n];\n tours[k][0] = n;\n alreadyInTour[n] = true;\n\n int iterate = 0;\n int j=1;\n while(j<tours[k].length){\n if(!alreadyInTour[iterate]){\n minDistance = Double.MAX_VALUE;\n //Find next closest point to pointA\n for(int i=0; i<points.length; i++){\n pointB = points[i];\n if(!alreadyInTour[i]){\n distance = Math.sqrt( Math.pow(pointA.x - pointB.x, 2) + Math.pow(pointA.y - pointB.y, 2) );\n if(distance < minDistance){\n minDistance = distance;\n index = i;\n }\n }\n }\n //System.out.println(index);\n tours[k][j] = index;\n alreadyInTour[index] = true;\n j++;\n }\n iterate++;\n if(iterate >= points.length) iterate = 0;\n }\n }\n for(int i=0; i<tours.length; i++){\n //System.out.println(Arrays.toString(tours[i]));\n }\n return tours;\n }", "static ArrayList<XTupleSet> getCompleteTupleSets(String rel, ArrayList<String> rels, Connection dbConn) throws SQLException {\n\t\n\t// evaluate tables\n\tXTable targetTable = new XTable(rel, dbConn);\n\tArrayList<XTable> otherTables = new ArrayList<XTable>();\n\tfor (int i = 0; i < rels.size(); i++) {\n\t if (!rel.equals(rels.get(i))) { // exclude the target table\n\t\totherTables.add(new XTable(rels.get(i), dbConn));\n\t }\n\t}\n\t\n\tArrayList<XTupleSet> complete = new ArrayList<XTupleSet>();\n\tArrayList<XTupleSet> inComplete = new ArrayList<XTupleSet>();\n\t\n\tfor (int i = 0; i < targetTable.size(); i++) {\n\t inComplete.add(new XTupleSet(targetTable.getTuple(i))); // line 3-4\n\t}\n\t\n\twhile (!inComplete.isEmpty()) {\n\t XTupleSet tupleSet = pop(inComplete);\n\t \n\t // check all other tuples which are JCC with is tuple set. Line 7-8\n\t for (XTable table : otherTables) {\n\t\tfor (int i = 0; i < table.size(); i++) {\n\t\t XTuple tuple = table.getTuple(i);\n\t\t if (tupleSet.jcc(tuple) && (!tupleSet.contains(tuple))) {\n\t\t\ttupleSet.add(tuple);\n\t\t\t// here, we should break, because there can not be\n\t\t\t// two tuples in a single table which are JCC with\n\t\t\t// the same tuple set.\n\t\t\tbreak;\n\t\t }\n\t\t}\n\t }\n\t \n\t // Line 9 - 20\n\t for (XTable table : otherTables) { // Line 9\n\t\tfor (int i = 0; i < table.size(); i++) {\n\t\t XTuple tuple = table.getTuple(i);\n\t\t if (!tupleSet.contains(tuple)) { // Line 9\n\t\t\tXTupleSet prime = getPrime(tuple, tupleSet); // Line 11\n\t\t\t\n\t\t\tif (prime.hasTupleFrom(targetTable)) { // Line 12\n\t\t\t boolean inserted = false; // Line 13\n\t\t\t if (isInComplete(prime, complete)) {\n\t\t\t\tinserted = true; // Line 15\n\t\t\t\tfor (int j = 0 ; j < inComplete.size(); i++) { // Line 16\n\t\t\t\t XTupleSet ts = inComplete.get(j); // Line 16\n\t\t\t\t if (prime.jcc(ts)) { // Line 17\n\t\t\t\t\tts.addAll(prime);\n\t\t\t\t\tinserted = true;\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t\tif (!inserted) {\n\t\t\t\t inComplete.add(prime);\n\t\t\t\t}\n\t\t\t }\n\t\t\t}\n\t\t }\n\t\t}\n\t }\n\t \n\t // Line 22\n\t complete.add(tupleSet);\n\t}\n\t\n\treturn complete;\n }", "private PairOfNodeIndexIntervals getValidNodeIndexIntervalPair(Match match) {\n\t\t// init pair to be null, which represents the current match does not produce a valid pair\n\t\tPairOfNodeIndexIntervals pair = null;\n\n\t\t// the indexes of the matched substrings\n\t\tint firstStrMatchedStartIndex = match.getFirstStringIndex();\n\t\tint secondStrMatchedStartIndex = match.getSecondStringIndex();\n\t\t// length of the matched substrings\n\t\tint matchedLen = match.getMatchLength();\n\n\t\tif (matchedLen % 2 == 0) {\n\t\t\t//if length of the matched substrings is even\n\t\t\tif (firstStrMatchedStartIndex % 2 == 0 && secondStrMatchedStartIndex % 2 == 0) {\n\t\t\t\t// if both substrings starts from even index, it is already a valid pair\n\t\t\t\tpair = createNodeIndexIntervalPair(firstStrMatchedStartIndex, secondStrMatchedStartIndex, matchedLen);\n\t\t\t} else if (firstStrMatchedStartIndex % 2 == 1 && secondStrMatchedStartIndex % 2 == 1) {\n\t\t\t\t// if both substrings starts from odd index, ignore the first and last characters\n\t\t\t\tpair = createNodeIndexIntervalPair(firstStrMatchedStartIndex + 1, secondStrMatchedStartIndex + 1,\n\t\t\t\t\t\tmatchedLen - 2);\n\t\t\t}\n\t\t} else {\n\t\t\t//if length of the matched substrings is odd\n\t\t\tif (firstStrMatchedStartIndex % 2 == 0 && secondStrMatchedStartIndex % 2 == 0) {\n\t\t\t\t// if both substrings starts from even index, ignore the last character\n\t\t\t\tpair = createNodeIndexIntervalPair(firstStrMatchedStartIndex, secondStrMatchedStartIndex, matchedLen - 1);\n\t\t\t} else if (firstStrMatchedStartIndex % 2 == 1 && secondStrMatchedStartIndex % 2 == 1) {\n\t\t\t\t// if both substrings starts from odd index, ignore the first character\n\t\t\t\tpair = createNodeIndexIntervalPair(firstStrMatchedStartIndex + 1, secondStrMatchedStartIndex + 1,\n\t\t\t\t\t\tmatchedLen - 1);\n\t\t\t}\n\t\t}\n\n\t\treturn pair;\n\t}", "public boolean isTwoPairs(){\n \r\n List<PokerCard> pair1;\r\n List<PokerCard> pair2;\r\n \r\n //First possibility: first four cards are two pairs\r\n pair1 = cards.subList(0, 2);\r\n pair2 = cards.subList(2, 4);\r\n if(haveSameValue(pair1) && haveSameValue(pair2)){\r\n handValue = pair2.get(0).getValue();\r\n lowerPairValue = pair1.get(0).getValue();\r\n remainingCardValue = cards.get(cards.size()-1).getValue();\r\n return true;\r\n }\r\n \r\n //Second possibility: First two and last two cards are pairs\r\n pair1 = cards.subList(0, 2);\r\n pair2 = cards.subList(3, 5);\r\n if(haveSameValue(pair1) && haveSameValue(pair2)){\r\n handValue = pair2.get(0).getValue();\r\n lowerPairValue = pair1.get(0).getValue();\r\n remainingCardValue = cards.get(2).getValue();\r\n return true;\r\n }\r\n \r\n //Third possibility: Last four cards are two pairs\r\n pair1 = cards.subList(1, 3);\r\n pair2 = cards.subList(3, 5);\r\n if(haveSameValue(pair1) && haveSameValue(pair2)){\r\n handValue = pair2.get(0).getValue();\r\n lowerPairValue = pair1.get(0).getValue();\r\n remainingCardValue = cards.get(0).getValue();\r\n return true;\r\n }\r\n return false;\r\n }", "public boolean isEqual(Tuple t){\n Object[] temp=t.getPattern();\n if(t.getSize()!=size)return false;\n else {\n for(int i=0;i<size;i++){\n if(pattern[i].equals(temp[i])==false && temp[i]!=\"*\"){\n return false;\n }\n }\n }\n return true;\n }", "public void setEGasNLEG(List<String> rawTP, List<String> newDedTP) {\n\n List<String> currEGouterTP = null;\n List<String> currEGinnerTP = null;\n List<List<String>> pairEGtoNested = new LinkedList<>();\n\n for (int keyEG : mapTmpEGtoAllTPs.keySet()) {\n\n List<String> currEG = mapTmpEGtoAllTPs.get(keyEG);\n if ((mapEGtoOccurs.get(currEG) != null && mapEGtoOccurs.get(currEG) > 1)\n || (mapEGtoOccurs.get(currEG) != null && mapEGtoOccurs.get(currEG) == 1)) {\n\n for (int k = 0; k < currEG.size(); k += 3) {\n\n currEGouterTP = new LinkedList<>(currEG.subList(k, k + 3));\n if (currEGouterTP.equals(rawTP) && !currEGouterTP.contains(\"ontology\")) {\n\n //Identify a EG as a nested loop with EG\n for (int l = k + 3; l < currEG.size(); l += 3) {\n\n currEGinnerTP = new LinkedList<>(currEG.subList(l, l + 3));\n pairEGtoNested = Arrays.asList(newDedTP, currEGinnerTP);\n myDedUtils.pairJoinRelation(newDedTP, currEGinnerTP, pairEGtoNested, 1, \"nestedLoop\", true);\n }\n\n }\n\n }\n }\n\n }\n\n }", "private Optional<Pair<S, S>> getCrossingPair(final Node<S> node, final Pair<S, S>[] map) {\n Pair<S, S> result = null;\n if(node.hasNext()) {\n //aX ?\n if(node.getElement().isTerminal()) {\n // ab\n if(!node.getNext().getElement().isTerminal()) {\n S a = node.getElement();\n S b = map[node.getNext().getElement().getId()].a;\n result = !a.equals(b) ? new Pair<S, S>(a,b) : null;\n }\n } // Ax or AX\n else {\n S a = map[node.getElement().getId()].b;\n S b = node.getNext().getElement();\n // Ab?\n if(b.isTerminal()) {\n result = !a.equals(b) ? new Pair<S, S>(a, b) : null;\n } //AB\n else {\n result = !a.equals(map[b.getId()].a) ? new Pair<S, S>(a, map[b.getId()].a) : null;\n }\n }\n }\n return Optional.ofNullable(result);\n }", "public int reversePairs4(int[] nums) {\n int count = 0;\n Map<Long, Integer> bit = new HashMap<>();\n final long shift = 1L << 32;\n final long max = shift << 1;\n for (int i = nums.length - 1; i >= 0; i--) {\n for (long j = nums[i] - 1 + shift; j > 0; j -= (j & -j)) {\n count += bit.getOrDefault(j, 0);\n }\n for (long j = (long)nums[i] * 2 + shift; j < max; j += (j & -j)) {\n bit.put(j, bit.getOrDefault(j, 0) + 1);\n }\n }\n return count;\n }", "private void checkPair(Player player) {\n\t\tfor (int j = 6; j > 0; j--) {\n\t\t\tif (player.getSevenCardsTempHand().get(j).getRank()\n\t\t\t\t\t.equals(player.getSevenCardsTempHand().get(j - 1).getRank())) {\n\t\t\t\tplayer.setPair(true);\n\t\t\t\tplayer.setHandRank(HandRank.PAIR);\n\n\t\t\t\t// add the pair to the 5 cards hand\n\t\t\t\thand[0] = player.getSevenCardsTempHand().get(j);\n\t\t\t\thand[1] = player.getSevenCardsTempHand().get(j - 1);\n\t\t\t\tplayer.getSevenCardsTempHand().remove(j);\n\t\t\t\tplayer.getSevenCardsTempHand().remove(j - 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "void solveBooleanFunction() \r\n {\r\n// throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\r\n /* it covers all the cases of eight pair row wise */ \r\n if(checkRowForOctPair(0,3)==true)\r\n {\r\n booleanEquationForRow(0,3);\r\n System.out.print(\"+\"); \r\n }\r\n for(int i=0;i<3;i++)\r\n {\r\n if(checkRowForOctPair(i,i+1)==true)\r\n {\r\n booleanEquationForRow(i,i+1);\r\n System.out.print(\"+\"); \r\n }\r\n }\r\n /* it covers all the cases of eight pair by coloumn wise */\r\n if(checkColoumnForOctPair(0,3)==true)\r\n {\r\n booleanEquationForColoumn(0,3);\r\n System.out.print(\"+\");\r\n }\r\n for(int i=0;i<3;i++)\r\n {\r\n if(checkColoumnForOctPair(i,i+1)==true)\r\n {\r\n booleanEquationForColoumn(i,i+1);\r\n System.out.print(\"+\"); \r\n }\r\n }\r\n /* it covers four pair case row wise */ \r\n for(int i=0;i<4;i++)\r\n {\r\n if(checkRowForQuadPair(i)==true)\r\n {\r\n giveBooleanFunctionForSingleRow(i);\r\n \r\n System.out.print(\"+\"); \r\n }\r\n } \r\n /* it covers four pair case coloumn wise */ \r\n for(int j=0;j<4;j++)\r\n {\r\n if(checkColoumnForQuadPair(j)==true)\r\n {\r\n giveBooleanFunctionForSingleColoumn(j);\r\n System.out.print(\"+\");\r\n }\r\n }\r\n /* its check a box of four 1's */ \r\n for(int i=0;i<4;i++)\r\n {\r\n for(int j=0;j<4;j++)\r\n {\r\n if(Kmap[i][j]==1)\r\n {\r\n /*increament and decreament row inde and coloumn index in rotating manner using modulo architecture */\r\n int rowInc=(i+1)%4;\r\n int rowDec=(i-1+4)%4;\r\n int coloumnInc=(j+1)%4;\r\n int coloumnDec=(j-1+4)%4;\r\n /*check four 1's block clockwise down */\r\n if(Kmap[i][j]==1 && (Kmap[i][coloumnInc]==1 || Kmap[i][coloumnInc]==-1) && (Kmap[rowInc][coloumnInc]==1 || Kmap[rowInc][coloumnInc]==-1) && (Kmap[rowInc][j]==1 || Kmap[rowInc][j]==-1))\r\n {\r\n Kmap[i][j]=-1;\r\n Kmap[i][coloumnInc]=-1;\r\n Kmap[rowInc][coloumnInc]=-1;\r\n Kmap[rowInc][j]=-1;\r\n booleanEquationForRow(i,rowInc);\r\n booleanEquationForColoumn(j,coloumnInc);\r\n System.out.print(\"+\"); \r\n }\r\n /*check four 1's block anticlockwise down */\r\n else if(Kmap[i][j]==1 && (Kmap[i][coloumnDec]==1 || Kmap[i][coloumnDec]==-1) && (Kmap[rowInc][coloumnDec]==1 || Kmap[rowInc][coloumnDec]==-1) && (Kmap[rowInc][j]==1 || Kmap[rowInc][j]==-1))\r\n {\r\n Kmap[i][j]=-1;\r\n Kmap[i][coloumnDec]=-1;\r\n Kmap[rowInc][coloumnDec]=-1;\r\n Kmap[rowInc][j]=-1;\r\n booleanEquationForRow(i,rowInc);\r\n booleanEquationForColoumn(j,coloumnDec);\r\n System.out.print(\"+\"); \r\n }\r\n /*check four 1's block anticlockwise up */\r\n else if(Kmap[i][j]==1 && (Kmap[i][coloumnInc]==1 || Kmap[i][coloumnInc]==-1) && (Kmap[rowDec][coloumnInc]==1 || Kmap[rowDec][coloumnInc]==-1) && (Kmap[rowDec][j]==1 || Kmap[rowDec][j]==-1))\r\n {\r\n Kmap[i][j]=-1;\r\n Kmap[i][coloumnInc]=-1;\r\n Kmap[rowDec][coloumnInc]=-1;\r\n Kmap[rowDec][j]=-1;\r\n booleanEquationForRow(i,rowDec);\r\n booleanEquationForColoumn(j,coloumnInc);\r\n System.out.print(\"+\"); \r\n }\r\n /*check four 1's block clockwise up */\r\n /*it will cover four corner case also */\r\n else if(Kmap[i][j]==1 && (Kmap[i][coloumnDec]==1 || Kmap[i][coloumnDec]==-1) && (Kmap[rowDec][coloumnDec]==1 || Kmap[rowDec][coloumnDec]==-1) && (Kmap[rowDec][j]==1 || Kmap[rowDec][j]==-1))\r\n {\r\n Kmap[i][j]=-1;\r\n Kmap[i][coloumnDec]=-1;\r\n Kmap[rowDec][coloumnDec]=-1;\r\n Kmap[rowDec][j]=-1;\r\n booleanEquationForRow(i,rowDec);\r\n booleanEquationForColoumn(j,coloumnDec);\r\n System.out.print(\"+\"); \r\n }\r\n }\r\n }\r\n }\r\n /* its check of two 1's pair for rows and coloumns*/ \r\n for(int i=0;i<4;i++)\r\n {\r\n for(int j=0;j<4;j++)\r\n {\r\n if(Kmap[i][j]==1)\r\n {\r\n /*increament and decreament row inde and coloumn index in rotating manner using modulo architecture */\r\n int rowInc=(i+1)%4;\r\n int rowDec=(i-1+4)%4;\r\n int coloumnInc=(j+1)%4;\r\n int coloumnDec=(j-1+4)%4;\r\n /*check four 1's block clockwise down */\r\n if(Kmap[i][j]==1 && (Kmap[i][coloumnInc]==1 || Kmap[i][coloumnInc]==-1))\r\n {\r\n Kmap[i][j]=-1;\r\n Kmap[i][coloumnInc]=-1;\r\n giveBooleanFunctionForSingleRow(i);\r\n booleanEquationForColoumn(j,coloumnInc);\r\n System.out.print(\"+\"); \r\n }\r\n /*check four 1's block anticlockwise down */\r\n else if(Kmap[i][j]==1 && (Kmap[i][coloumnDec]==1 || Kmap[i][coloumnDec]==-1))\r\n {\r\n Kmap[i][j]=-1;\r\n Kmap[i][coloumnDec]=-1;\r\n giveBooleanFunctionForSingleRow(i);\r\n booleanEquationForColoumn(j,coloumnDec);\r\n System.out.print(\"+\"); \r\n }\r\n /*check four 1's block anticlockwise up */\r\n else if(Kmap[i][j]==1 && (Kmap[rowInc][j]==1 || Kmap[rowInc][j]==-1))\r\n {\r\n Kmap[i][j]=-1;\r\n Kmap[rowInc][j]=-1;\r\n booleanEquationForRow(i,rowInc);\r\n giveBooleanFunctionForSingleColoumn(j);\r\n System.out.print(\"+\"); \r\n }\r\n /*check four 1's block clockwise up */\r\n /*it will cover four corner case also */\r\n else if(Kmap[i][j]==1 && (Kmap[rowDec][j]==1 || Kmap[rowDec][j]==-1))\r\n {\r\n Kmap[i][j]=-1;\r\n Kmap[rowDec][j]=-1;\r\n booleanEquationForRow(i,rowDec);\r\n giveBooleanFunctionForSingleColoumn(j);\r\n System.out.print(\"+\"); \r\n }\r\n }\r\n }\r\n }\r\n \r\n /*it covers remaining single one's */\r\n for(int i=0;i<4;i++)\r\n {\r\n for(int j=0;j<4;j++)\r\n {\r\n if(Kmap[i][j]==1)\r\n {\r\n Kmap[i][j]=-1;\r\n giveBooleanFunctionForSingleRow(i);\r\n giveBooleanFunctionForSingleColoumn(j);\r\n System.out.print(\"+\");\r\n }\r\n }\r\n }\r\n }", "public void Pairs()\r\n {\n int pairsize = 0;\r\n int ind1 = 0;\r\n for(int i = 0; i < 5; i++){\r\n// while(cards[i].getNumber() != pairnum){\r\n for(int j = i+1; j < 5; j++)\r\n {\r\n if(cards[i].getFace().equals(cards[j].getFace()))\r\n {\r\n ind1 = i;\r\n if(pairsize < 3){\r\n pairsize += 1;\r\n// paircounts += 1;\r\n }\r\n if(cards[i].compareTo(cards[ind1]) > 0){\r\n// Maxpair = cards[i].getNumber();\r\n index = i;\r\n }\r\n \r\n }\r\n }\r\n// }\r\n }\r\n if(pairsize == 1)\r\n Judge = 2;\r\n if(pairsize == 2)\r\n Judge = 3;\r\n if(pairsize == 3)\r\n Judge = 6;\r\n }", "public static long taskOfPairing(List<Long> freq) {\n // Write your code here\n long pairs = 0;\n boolean isOdd = false;\n boolean hasRemained = false;\n long curNum = 0;\n for (int weight = 1; weight <= freq.size(); weight++) {\n curNum = freq.get(weight - 1);\n pairs += (curNum / 2);\n if (curNum % 2 != 0) {\n if (hasRemained) {\n pairs++;\n hasRemained = false;\n } else {\n hasRemained = true;\n }\n isOdd = true;\n } else {\n if (!isOdd) {\n hasRemained = false;\n }\n isOdd = false;\n }\n\n }\n\n return pairs;\n\n }", "private static boolean isSpecialPair(AnalyzedTokenReadings[] tokens, int first, int second) {\n if(first + 3 >= second && tokens[first].matchesPosTagRegex(\"VER:.*INF.*\")\n && StringUtils.equalsAny(tokens[first+1].getToken(), \"als\", \"noch\")\n && tokens[first + 2].matchesPosTagRegex(\"VER:.*INF.*\")) {\n if(first + 2 == second) {\n return true;\n }\n return isTwoCombinedVerbs(tokens[second - 1], tokens[second]);\n }\n return false;\n }", "public abstract Tuple getNext();", "ColumnPair columnPair();", "public boolean isTwoPair(){\r\n int temp[] = getIntArr();\r\n\r\n if(temp[0] == temp[1] && temp[2] == temp[3])\r\n return true;\r\n\r\n else if(temp[0] == temp[1] && temp[3] == temp[4])\r\n return true;\r\n\r\n else if(temp[1] == temp[2] && temp[3] == temp[4])\r\n return true;\r\n\r\n else return false;\r\n }", "private int pairContains(HashMap<Integer,HashSet<Integer>> pairs, int k1, int k2){\n\t\t\n\t\t\n\t\t\tif(pairs.containsKey(k1))\n\t\t\t\tif(pairs.get(k1).contains(k2))\n\t\t\t\t\treturn 2;\n\t\t\t\telse\n\t\t\t\t\treturn 1;\n\t\t\n\t\treturn 0;\n\t}", "public void gen_cyptxt(String ptxt, char[][] table, int temp)\r\n {\r\n int l=ptxt.length();\r\n String ptxt1=\"\";\r\n int ia1=0, ja1=0, ia2=0, ja2=0;\r\n \r\n //removing all the inner spaces of plaint text\r\n for(int i=0; i<l; i++)\r\n {\r\n if(ptxt.charAt(i)!=' ')\r\n ptxt1=ptxt1+ptxt.charAt(i); // storing it in ptxt1\r\n }\r\n \r\n ptxt=ptxt1; //storing it back in ptxt\r\n l=ptxt.length();\r\n \r\n //adding a dummy letter 'x' if not length is even\r\n if(l%2!=0)\r\n {\r\n ptxt=ptxt+\"x\";\r\n l=ptxt.length();\r\n }\r\n \r\n ptxt=ptxt.toUpperCase(); //converting the whole plain text to upper case\r\n \r\n //creating array of string 'bits' of length half of plain text\r\n String[] bits= new String[l/2];\r\n String[] bitsn=new String[l/2];\r\n \r\n //initialising the array with \"\"\r\n for (int i = 0; i < l/2; i++)\r\n {\r\n bitsn[i]=\"\";\r\n }\r\n int j=0, k=2;\r\n \r\n //storing each 2 letter bit of plain text into the array of strings\r\n for (int i = 0; i < l/2; i++)\r\n {\r\n bits[i]=ptxt.substring(j,k);\r\n j+=2;\r\n k+=2;\r\n }\r\n boolean hash=true;\r\n int count=0, ni=0, lim;\r\n while(hash)\r\n {\r\n lim=l/2;\r\n //checking if two double letters are in same bit\r\n for(int i=0; i<lim; i++)\r\n {\r\n if(bits[i].charAt(0)==bits[i].charAt(1))\r\n count++;\r\n }\r\n \r\n //if not then loop is terminated\r\n if(count==0)\r\n hash=false;\r\n \r\n //else dummy character is added in between\r\n else\r\n {\r\n for(int i=0; i<lim; i++)\r\n {\r\n if(bits[i].charAt(0)==bits[i].charAt(1))\r\n {\r\n ni=i;\r\n break;\r\n }\r\n }\r\n ptxt=ptxt.substring(0,(ni*2)-1)+\"X\"+ptxt.substring((ni*2)-1);\r\n l=ptxt.length();\r\n if(l%2!=0)\r\n {\r\n ptxt=ptxt+\"X\";\r\n l=ptxt.length();\r\n }\r\n j=0;\r\n k=0;\r\n for (int i = 0; i < l/2; i++)\r\n {\r\n bits[i]=ptxt.substring(j,k);\r\n j+=2;\r\n k+=2;\r\n }\r\n hash=true;\r\n }\r\n count=0;\r\n }\r\n ni=0;\r\n lim=l/2;\r\n \r\n //checking if 'XX' is bit comes at the end. If comes the limit is taken before that position\r\n for(int i=0; i<lim; i++)\r\n {\r\n if(bits[i].charAt(0)==bits[i].charAt(1))\r\n {\r\n if(bits[i].charAt(0)=='X')\r\n {\r\n lim=i;\r\n break;\r\n }\r\n }\r\n }\r\n \r\n //if matrix is of type where J is taken\r\n if(temp==1)\r\n {\r\n for (int i = 0; i < lim; i++)\r\n {\r\n \r\n //storing the 1st letter of the bit in ch1 & 2nd letter in ch2\r\n char ch1=bits[i].charAt(0);\r\n char ch2=bits[i].charAt(1);\r\n \r\n //since the matrix contains J and I & J have same position so I is converted to J\r\n if(ch1=='I')\r\n ch1='J';\r\n else if(ch2=='I')\r\n ch2='J';\r\n \r\n \r\n a : for(j=0; j<5; j++) //loop labelled as a\r\n {\r\n for(k=0; k<5; k++)\r\n {\r\n \r\n //storing the cordinates of the 1st letter\r\n if(table[j][k]==ch1)\r\n {\r\n ia1=j;\r\n ja1=k;\r\n }\r\n \r\n //storing the cordinates of the 2nd letter\r\n else if(table[j][k]==ch2)\r\n {\r\n ia2=j;\r\n ja2=k;\r\n }\r\n \r\n //if they are in the same row\r\n if((ia1==ia2) && (ja1!=ja2))\r\n {\r\n if(ja1!=4)\r\n bitsn[i]=bitsn[i]+table[j][k+1];\r\n else\r\n bitsn[i]=bitsn[i]+table[j][0];\r\n if(ja2!=4)\r\n bitsn[i]=bitsn[i]+table[j][k+1];\r\n else\r\n bitsn[i]=bitsn[i]+table[j][0];\r\n break a;\r\n }\r\n \r\n //if they are in the same column\r\n else if((ia1!=ia2) && (ja1==ja2))\r\n {\r\n if(ia1!=4)\r\n bitsn[i]=bitsn[i]+table[j-1][k];\r\n else\r\n bitsn[i]=bitsn[i]+table[0][k];\r\n if(ia2!=4)\r\n bitsn[i]=bitsn[i]+table[j-1][k];\r\n else\r\n bitsn[i]=bitsn[i]+table[0][k];\r\n break a;\r\n }\r\n \r\n //if they are neither in same row nor in same column\r\n else if((ia1!=ia2) && (ja1!=ja2))\r\n {\r\n bitsn[i]=bitsn[i]+table[j][ja2];\r\n bitsn[i]=bitsn[i]+table[j][ja1];\r\n break a;\r\n } \r\n }\r\n }\r\n ia1=0;\r\n ja1=0;\r\n ia2=0;\r\n ja2=0;\r\n } \r\n }\r\n \r\n //if matrix is of type where I is taken\r\n else if(temp==2)\r\n {\r\n for (int i = 0; i < lim; i++)\r\n {\r\n \r\n //storing the 1st letter of the bit in ch1 & 2nd letter in ch2\r\n char ch1=bits[i].charAt(0);\r\n char ch2=bits[i].charAt(1);\r\n \r\n //since the matrix contains I and I & J have same position so J is converted to I\r\n if(ch1=='j')\r\n ch1='i';\r\n else if(ch2=='j')\r\n ch2='i';\r\n \r\n \r\n a : for(j=0; j<5; j++) //loop labelled as a\r\n {\r\n for(k=0; k<5; k++)\r\n {\r\n \r\n //storing the cordinates of the 1st letter\r\n if(table[j][k]==ch1)\r\n {\r\n ia1=j;\r\n ja1=k;\r\n }\r\n \r\n //storing the cordinates of the 2nd letter\r\n else if(table[j][k]==ch2)\r\n {\r\n ia2=j;\r\n ja2=k;\r\n }\r\n \r\n //if they are in the same row\r\n if((ia1==ia2) && (ja1!=ja2))\r\n {\r\n if(ja1!=4)\r\n bitsn[i]=bitsn[i]+table[j][k+1];\r\n else\r\n bitsn[i]=bitsn[i]+table[j][0];\r\n if(ja2!=4)\r\n bitsn[i]=bitsn[i]+table[j][k+1];\r\n else\r\n bitsn[i]=bitsn[i]+table[j][0];\r\n break a;\r\n }\r\n \r\n //if they are in the same column\r\n else if((ia1!=ia2) && (ja1==ja2))\r\n {\r\n if(ia1!=4)\r\n bitsn[i]=bitsn[i]+table[j-1][k];\r\n else\r\n bitsn[i]=bitsn[i]+table[0][k];\r\n if(ia2!=4)\r\n bitsn[i]=bitsn[i]+table[j-1][k];\r\n else\r\n bitsn[i]=bitsn[i]+table[0][k];\r\n break a;\r\n }\r\n \r\n //if they are neither in same row nor in same column\r\n else if((ia1!=ia2) && (ja1!=ja2))\r\n {\r\n bitsn[i]=bitsn[i]+table[j][ja2];\r\n bitsn[i]=bitsn[i]+table[j][ja1];\r\n break a;\r\n } \r\n }\r\n }\r\n ia1=0;\r\n ja1=0;\r\n ia2=0;\r\n ja2=0;\r\n }\r\n }\r\n String cip_txt=\"\";\r\n \r\n //adding up all the cypher bits to form the cypher text\r\n for(int i=0; i<lim; i++)\r\n {\r\n cip_txt=cip_txt+bitsn[i];\r\n }\r\n \r\n //finally pinting the cypher text\r\n System.out.println(\"The corresponding ciphertext is : \"+cip_txt);\r\n }", "@Test\n public void testFindOrientedPairs() {\n System.out.println(\"findOrientedPairs\");\n \n CCGeneticDrift instance = new CCGeneticDrift();\n String input = \"6 3 1 6 5 -2 4\";\n List<Integer> numbers = instance.inputStringToIntegerList(input);\n String expResult = \"[1 -2, 3 -2]\";\n List result = instance.findOrientedPairs(numbers);\n assertEquals(result.toString(), expResult);\n assertEquals(result.size(), 2);\n }", "public static <T extends Comparable<T>> Pair<Integer> dutchNationalFlagPartition_v2(T[] elements, T pivot,\n int low, int high) {\n assert (elements != null);\n assert (low < high);\n\n int l = low;\n while (l < high) {\n if (elements[l].compareTo(pivot) >= 0) {\n break;\n }\n l++;\n }\n if (l == high) {\n //all elements are less than pivot\n return new Pair<Integer>(high, high);\n }\n\n int h = high - 1;\n while (h >= l) {\n if (elements[h].compareTo(pivot) <= 0) {\n break;\n }\n h--;\n }\n\n int p = l;\n while (p <= h) {\n if (elements[p].compareTo(pivot) == 0) {\n p++;\n } else if (elements[p].compareTo(pivot) < 0) {\n swap(elements, l, p);\n l++;\n p++;\n } else {\n swap(elements, p, h);\n h--;\n }\n }\n\n return new Pair<>(l, (h+1));\n }", "public GenericPair<HashMap<Pair, Integer>, HashMap<Integer, Pair>> mapBitextToInt(HashMap<Pair, Integer>sd_count){\n\t\tHashMap<Pair, Integer> index = new HashMap<Pair, Integer>();\n\t\tHashMap<Integer, Pair> biword = new HashMap<Integer, Pair>();\n\t\tint i = 0;\n\t\tfor (Pair pair : sd_count.keySet()){\n\t\t\tindex.put(pair, i);\n\t\t\tbiword.put(i, pair);\n\t\t\ti++;\n\t\t}\n\t\treturn new GenericPair<HashMap<Pair, Integer>, HashMap<Integer, Pair>>(index, biword);\n\t}", "public boolean judgePoint241(int[] nums) {\n double n1 = nums[0];\n double n2 = nums[1];\n double n3 = nums[2];\n double n4 = nums[3];\n //case1:\n if(Math.abs(n1-8)<=0.01&&Math.abs(n2-4)<=0.01){\n int a = 1;\n }\n if(combine(combine(n1,n2),combine(n3,n4)))return true;\n //case2:\n for(double d:combine(n2,n3)){\n if(contains(combine(n1,d,n4),24.0)){\n return true;\n };\n }\n //case3:\n for(double d:combine(n1,n2,n3)){\n if(contains(combine(d,n4),24.0))return true;\n }\n //case4:\n for(double d:combine(n2,n3,n4)){\n if(contains(combine(n1,d),24.0))return true;\n }\n return false;\n }", "public void assignAdjacentNonets(){\n\t\tfor(int i=1;i<=9;i++){\n\t\t\tList<Integer> adjNonets = new ArrayList<>();\n\t\t\tswitch(i){\n\t\t\tcase 1:\tadjNonets.add(2);\n\t\t\tadjNonets.add(4);\n\n\t\t\tcase 2: adjNonets.add(1);\n\t\t\tadjNonets.add(3);\n\t\t\tadjNonets.add(5);\n\n\t\t\tcase 3: adjNonets.add(2);\n\t\t\tadjNonets.add(6);\n\n\t\t\tcase 4: adjNonets.add(1);\n\t\t\tadjNonets.add(5);\n\t\t\tadjNonets.add(7);\n\n\t\t\tcase 5: adjNonets.add(2);\n\t\t\tadjNonets.add(4);\n\t\t\tadjNonets.add(6);\n\t\t\tadjNonets.add(8);\n\n\t\t\tcase 6: adjNonets.add(3);\n\t\t\tadjNonets.add(5);\n\t\t\tadjNonets.add(9);\n\n\t\t\tcase 7: adjNonets.add(4);\n\t\t\tadjNonets.add(8);\n\n\t\t\tcase 8: adjNonets.add(5);\n\t\t\tadjNonets.add(7);\n\t\t\tadjNonets.add(9);\n\n\t\t\tcase 9: adjNonets.add(6);\n\t\t\tadjNonets.add(8);\n\t\t\t}\n\t\t\tADJACENT_NONETS.put(i,adjNonets);\n\t\t}\n\t}", "public void createPairTable() {\r\n //create total Table\r\n pairTable = new HashMap<>();\r\n\r\n //fill with values \r\n Play[] cAce = {Play.NONE, P, P, P, P, P, P, P, P, P, P, P};\r\n Play[] cTen = {Play.NONE, S, S, S, S, S, S, S, S, S, S, S};\r\n Play[] cNine = {Play.NONE, S, P, P, P, P, P, S, P, P, S, S};\r\n Play[] cEight = {Play.NONE, P, P, P, P, P, P, P, P, P, P, P};\r\n Play[] cSeven = {Play.NONE, H, P, P, P, P, P, P, H, H, H, H};\r\n Play[] cSix = {Play.NONE, H, P, P, P, P, P, H, H, H, H, H};\r\n Play[] cFive = {Play.NONE, H, D, D, D, D, D, D, D, D, H, H};\r\n Play[] cFour = {Play.NONE, H, H, H, H, P, P, H, H, H, H, H};\r\n Play[] cThree = {Play.NONE, H, P, P, P, P, P, P, H, H, H, H};\r\n Play[] cTwo = {Play.NONE, H, P, P, P, P, P, P, H, H, H, H};\r\n\r\n pairTable.put(1, cAce);\r\n pairTable.put(2, cTwo);\r\n pairTable.put(3, cThree);\r\n pairTable.put(4, cFour);\r\n pairTable.put(5, cFive);\r\n pairTable.put(6, cSix);\r\n pairTable.put(7, cSeven);\r\n pairTable.put(8, cEight);\r\n pairTable.put(9, cNine);\r\n pairTable.put(10, cTen);\r\n pairTable.put(11, cAce);\r\n }", "private static void findPair(int[] nums, int target, int start, List<List<Integer>> result) {\n int end = nums.length - 1;\n\n while (start < end) {\n int diff = target - nums[start] - nums[end];\n\n if (diff == 0) {\n ArrayList<Integer> triplet = new ArrayList<>();\n triplet.add(target * -1);\n triplet.add(nums[start]);\n triplet.add(nums[end]);\n result.add(triplet);\n start++;\n end--;\n\n while (start < end && nums[start] == nums[start - 1]) {\n start++;\n }\n\n while (start < end && nums[end] == nums[end + 1]) {\n end--;\n }\n } else if (diff > 0) {\n start++;\n } else {\n end--;\n }\n }\n }", "private Set<String> transpositionHelper(String word) {\n\t\tSet<String> transpositionWords = new HashSet<String>();\n\t\tfor (int i = 0; i < word.length() - 1; i++) {\n\t\t\ttranspositionWords.add(word.substring(0, i) + word.substring(i + 1, i + 2) + word.substring(i, i + 1)\n\t\t\t\t\t+ word.substring(i + 2));\n\t\t}\n\t\treturn transpositionWords;\n\t}", "abstract int[] crossOver();", "protected ArrayList<int[]> findAdjacentUnknown(int[] pair) {\n\t\tint x = pair[0];\n\t\tint y = pair[1];\n\t\tArrayList<int[]> neighbors = new ArrayList<int[]>();\n\t\tfor (int i = x - 1; i <= x + 1; i++) {\n\t\t\tfor (int j = y - 1; j <= y + 1; j++) {\n\t\t\t\tif (i >= 0 && i < maxX && j >= 0 && j < maxY && coveredMap[i][j] == SIGN_UNKNOWN) {\n\t\t\t\t\tneighbors.add(new int[]{i, j});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn neighbors;\n\t}", "boolean hasSymbolTuple();", "public void triplet(int[] b,int n){\r\n\t\tint count=0;\r\n\t\tfor(int i=0;i<n;i++){\r\n\t\t\tfor(int j=i+1;j<n-1;j++){\r\n\t\t\t\tfor(int k=j+1;k<n-2;k++){\r\n\t\t\t\t\tif(b[i]+b[j]+b[k]==0){\r\n\t\t\t\t\t\tSystem.out.println(b[i]+\" \"+b[j]+\" \"+b[k]);\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"no of distinct triplet is:\"+count);\t\r\n\r\n\t}", "private void compressPairAll(final Pair<S, S> pair) {\n Function<Pair<S, S>, Consumer<GPairRecord<S, S>>> consumerFunction = p -> new ArrayList<>()::add;\n Predicate<S> leftPredicate = nonTerminal -> doLeftPop(nonTerminal, head -> head.isTerminal() && head.equals(pair.b));\n Predicate<S> rightPredicate = nonTerminal -> doRightPop(nonTerminal, tail -> tail.isTerminal() && tail.equals(pair.a));\n pop(phase + 1, leftPredicate, rightPredicate, consumerFunction);\n List<GPairRecord<S, S>> records = getPairs(p -> p.equals(pair));\n sortPairs(records);\n compressNonCrossingPairs(records);\n }", "public void cancelJoinsNLEGJoin() {\n\n List<String> currEG = null;\n List<String> currOuterTP = null;\n\n for (int keyOuter : mapTmpEGtoAllTPs.keySet()) {\n\n if (mapEGtoCancel.get(keyOuter) != null) {\n\n currEG = mapTmpEGtoAllTPs.get(keyOuter);\n\n for (int i = 0; i < currEG.size(); i += 3) {\n\n currOuterTP = new LinkedList<>(currEG.subList(i, i + 3));\n //BUUUUUUUUUUUUG check if it is a ontology\n if (!currOuterTP.get(0).contains(\"?\") && !currOuterTP.get(0).contains(\"#\")\n || !currOuterTP.get(2).contains(\"?\") && !currOuterTP.get(2).contains(\"#\")) {\n\n myDedUtils.cancelDTP(currOuterTP);\n for (int j = i + 3; j < currEG.size(); j += 3) {\n\n totalPairs--;\n }\n }\n\n }\n }\n\n }\n\n }", "static int beautifulTriplets(int d, int[] arr) {\n int result = 0;\n\n for (int i = 0; i < arr.length; i++) {\n int prev = arr[i];\n int arrCount = 1;\n\n for (int j = i+1; j < arr.length; j++) {\n if (prev + d == arr[j]) {\n arrCount++;\n prev = arr[j];\n if (arrCount == 3) {\n result++;\n break;\n }\n }\n }\n }\n\n return result;\n }", "int equalPairOfBits(int n, int m) {\n return ((BinaryOperator<Integer>) (a, b) -> {\n String one = Integer.toBinaryString(a);\n String two = Integer.toBinaryString(b);\n //FUCK YO SHIT, THIS IS STUPID\n int max = Math.max(one.length(), two.length());\n if (max != one.length())\n one = IntStream.range(0, max - one.length())\n .mapToObj(aq -> \"0\")\n .reduce(\"\", (r, c) -> r + c) + one;\n if (max != two.length())\n two = IntStream.range(0, max - two.length())\n .mapToObj(aq -> \"0\")\n .reduce(\"\", (r, c) -> r + c) + two;\n for (int i = max - 1, j = 0; i > -1; --i, j++) {\n if (one.charAt(i) == two.charAt(i))\n return (int) Math.pow(2, j);\n }\n return 0;\n }).apply(n, m);\n }", "int getXYPairCount();", "public static void main(String[] args) {\n int a[] = {12,11,10,5,6,2,30};\n // smaller greater approach with 3 passes can be used to find total number of triplet subsequences in array \n int smaller[] = new int[a.length];\n int greater[] = new int[a.length];\n \n for(int i=0;i<a.length;i++) {\n smaller[i] = greater[i] = -1;\n }\n // smaller fill up\n int min = a[0];\n for(int i=1;i<a.length;i++) {\n if (a[i] > min) {\n smaller[i] = 1;\n } else if ( a[i] < min) {\n min = a[i];\n }\n }\n \n int max = a[a.length-1];\n for(int i=a.length-2;i>=0;i--) {\n if (a[i] < max) {\n greater[i] = 1;\n } else if ( a[i] > max) {\n max = a[i];\n }\n }\n \n for(int i=1;i<a.length-1;i++) {\n if (smaller[i] == greater[i] && greater[i] == 1) {\n System.out.println(\"Triplet found, mid is at -> \" + i + \" : \" + a[i]);\n }\n }\n System.out.println(\"Do we have increasing triplet ?? \" + increasingTripletOnePass(a));\n }", "public static void pairs(String table_name,Connection con2) throws Exception{\n\t\t\n\t\tString name = table_name.subSequence(0, table_name.length()-1) + \"_pairs`\";\n\t\t\n\t\tjava.sql.Statement st = con2.createStatement();\n\t\tResultSet rst = st.executeQuery(\"show columns from \" + table_name);\n\n\t\t//get all value columns in original CP table\n\t\tlist = new ArrayList<String>();\n\t\trst.absolute(1);\n\t\twhile(rst.next()) list.add(rst.getString(1));\n\t\t\n\t\t//delete parentsum, CP and likelihood, local_mult\n\t\tlist.remove(list.size()-1);\n\t\tlist.remove(list.size()-1);\n\t\tlist.remove(list.size()-1);\n\t\tlist.remove(list.size()-1);\n\n\t\t//don't know why there is an mult=0 column in pair table, doesm't matter\n\t\tst.execute(\"DROP TABLE IF EXISTS \" + name + \";\");\n\t\tString createclause = \"CREATE TABLE \" + name + \"( MULT int \";\n\t\tfor (int i=0; i<list.size(); ++i) {\n\t\t\tcreateclause = createclause + \", `\" + list.get(i) + \"` VARCHAR(20) NOT NULL\";\n\t\t}\n\t\tcreateclause = createclause + \" );\";\n\t//\tSystem.out.println(\"createclause: \" + createclause);\n\t\tst.execute(createclause);\n\t\t\n\t\t//add index to all columns in pair table\n\t\tString index_p = \"alter table \" + name + \" add index \" + name + \"( MULT ASC\";\n\t\tfor (int i=0; i<list.size(); ++i) {\n\t\t\tindex_p = index_p + \", `\" + list.get(i) + \"` ASC\";\n\t\t}\n\t\tindex_p = index_p + \");\";\n\t\tst.execute(index_p);\n\t\t\n//\t\tSystem.out.println(\"SELECT DISTINCT `\" + list.get(0) + \"` FROM \" + table_name);\n\t\tResultSet rst1 = st.executeQuery(\"SELECT DISTINCT `\" + list.get(0) + \"` FROM \" + table_name);\n\t\tArrayList<String> join = new ArrayList<String>();\n\t\tArrayList<String> join_pre = new ArrayList<String>();\n\t\t\n\t\t\n\t\t\n\t\twhile(rst1.next()) {\n\t\t\tjoin.add(rst1.getString(1));\n\t\t\tjoin_pre.add(rst1.getString(1));\n\t\t}\n\t\t\n\t\tfor (int k=1; k<list.size(); ++k) {\n\t\t\tResultSet rst_value = st.executeQuery(\"SELECT DISTINCT `\" + list.get(k) + \"` FROM \" + table_name);\n\t\t\tArrayList<String> values = new ArrayList<String>();\n\t\t\twhile (rst_value.next()) values.add(rst_value.getString(1));\n\t\t\t\n\t\t\tjoin.clear();\n\t\t\t\n\t\t\tfor (int i=0; i<join_pre.size(); ++i) {\n\t\t\t\tfor (int j=0; j<values.size(); ++j) {\n\t\t\t\t\tjoin.add(join_pre.get(i) + \",\" + values.get(j));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tjoin_pre.clear();\n\t\t\tfor (int i=0; i<join.size(); ++i) {\n\t\t\t\tjoin_pre.add(join.get(i));\n\t\t\t\t//System.out.println(join.get(i));\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t//write in csv file\n\t\tString filename = table_name.subSequence(1, table_name.length()-1) + \".csv\";\n\t\tFile ftemp=new File(filename);\n\t\tif(ftemp.exists()) ftemp.delete();\n\t\tPrintWriter writer = new PrintWriter(filename, \"UTF-8\");\n\t\tfor (int i=0; i<join.size(); ++i) {\n\t\t\twriter.print(\"0,\" + join.get(i) + \"\\n\");\n\t\t}\t\t\n\t\twriter.close();\n\t\n\t\t//load csv file into database\n\t\tst.execute(\"LOAD DATA LOCAL INFILE '\" + filename + \"' INTO TABLE \" + name + \" FIELDS TERMINATED BY ',' LINES TERMINATED BY '\\n';\");\n\t\t\n\t\tif(ftemp.exists()) ftemp.delete();\n\t\t\n\t}", "public GenericPair<double[][], double[]> forwardWithTScaled(double[][][] a, double[] pi, String[] y, int N, int T, String[] d, HashMap<Pair, Double> t_table){\n\t\tdouble[] c_scaled = new double[T+1];\n\t\tdouble[][] alphaHat = new double[N+1][];\n\t\tfor (int i = 0; i < alphaHat.length ; i++){\n\t\t\talphaHat[i] = new double[T+1];\n\t\t}\n\t\tdouble totalAlphaDoubleDot = 0;\n\t\tfor (int i = 1; i < N+1 ; i++){\n\t\t\t\n\t\t\talphaHat[i][1] = pi[i]*t_table.get(new Pair(y[0], d[i-1])).doubleValue();\n\t\t\ttotalAlphaDoubleDot += alphaHat[i][1];\n\t\t}\n\t\tc_scaled[1] = 1.0/totalAlphaDoubleDot;\n\t\tfor (int i = 1; i < N+1 ; i++){\n\t\t\talphaHat[i][1] = c_scaled[1]*alphaHat[i][1];\n\t\t}\n\t\tfor (int t = 1; t < T; t++){\n\t\t\ttotalAlphaDoubleDot = 0;\n\t\t\tfor (int j = 1; j < N + 1 ; j++){\n\t\t\t\tdouble total = 0;\n\t\t\t\tfor (int i = 1; i < N + 1 ; i++)\n\t\t\t\t\ttotal += alphaHat[i][t]*a[i][j][N];\n\t\t\t\talphaHat[j][t+1] = t_table.get(new Pair(y[t],d[j-1]) )*total;\n\t\t\t\ttotalAlphaDoubleDot += alphaHat[j][t+1];\n\t\t\t}\n\t\t\tc_scaled[t+1] = 1.0/totalAlphaDoubleDot;\n\t\t\tfor (int i = 1; i < N + 1 ; i++)\n\t alphaHat[i][t+1] = c_scaled[t+1]*alphaHat[i][t+1];\n\t\t}\n\t\treturn new GenericPair<double[][], double[]>(alphaHat, c_scaled);\n\t}", "protected LinkedList<FunQuadruple> generateCandidates(List<FunQuadruple> lk) {\n\n LinkedList<FunQuadruple> lkPlus1 = new LinkedList<>();\n if (lk.isEmpty()) {\n return lkPlus1;\n }\n Set<ColumnCombinationBitset> subsets = new HashSet<>();\n int k = lk.get(0).candidate.size();\n ColumnCombinationBitset union = new ColumnCombinationBitset();\n for (FunQuadruple subsetQuadruple : lk) {\n // TODO optimise: all bits are set? --> break\n // If subsetQuadruple represents a unique do not add it to subsets and union (it should be pruned).\n if (subsetQuadruple.count == 0) {\n continue;\n }\n union = subsetQuadruple.candidate.union(union);\n subsets.add(subsetQuadruple.candidate);\n }\n\n Map<ColumnCombinationBitset, Integer> candidateGenerationCount = new HashMap<>();\n\n List<ColumnCombinationBitset> lkPlus1Candidates;\n FunQuadruple lkPlus1Member;\n for (ColumnCombinationBitset subset : subsets) {\n lkPlus1Candidates = union.getNSubsetColumnCombinationsSupersetOf(\n subset, k + 1);\n // FIXME add key conditional here\n // Removed key conditional - should not be triggerable?\n for (ColumnCombinationBitset candidate : lkPlus1Candidates) {\n if (candidateGenerationCount.containsKey(candidate)) {\n int count = candidateGenerationCount.get(candidate);\n count++;\n candidateGenerationCount.put(candidate, count);\n } else {\n candidateGenerationCount.put(candidate, 1);\n }\n }\n }\n\n for (ColumnCombinationBitset candidate : candidateGenerationCount\n .keySet()) {\n if (candidateGenerationCount.get(candidate) == (k + 1)) {\n lkPlus1Member = new FunQuadruple(candidate, addPliGenerate(\n candidate).getRawKeyError());\n lkPlus1.add(lkPlus1Member);\n }\n }\n return lkPlus1;\n }", "public ColinearTrioV2(Point[] thePoints) {\n\t\t myPoints = thePoints;\n\t\t myPairs = new ArrayList<PointPair>();\n\t\t map = new HashMap<>(thePoints.length);\n\t\t SIZE_OF_ORIGINAL_LIST = thePoints.length; // just a pointer to the original list.\n\t\t start();\n\t}", "private static int makeTaps(int n) throws IllegalArgumentException {\n\t\t\t// There is no easy algorithm to generate the taps as a function of n.\n\t\t\t// Instead simply have to rely on known results.\n\t\t\t// The values below are all taken from http://homepage.mac.com/afj/taplist.html\n\t\t\t// (except for case 2; I think that I figured that one out myself).\n\t\t\t// A less complete reference is http://en.wikipedia.org/wiki/Linear_feedback_shift_register#Some_Polynomials_for_Maximal_LFSRs\n\t\tswitch (n) {\n\t\t\tcase 2: return (1 << 1) | (1 << 0);\t// i.e. 2 1\n\t\t\tcase 3: return (1 << 2) | (1 << 1);\t// i.e. 3 2\n\t\t\tcase 4: return (1 << 3) | (1 << 2);\t// i.e. 4 3\n\t\t\tcase 5: return (1 << 4) | (1 << 2);\t// i.e. 5 3\n\t\t\tcase 6: return (1 << 5) | (1 << 4);\t// i.e. 6 5\n\t\t\tcase 7: return (1 << 6) | (1 << 5);\t// i.e. 7 6\n\t\t\tcase 8: return (1 << 7) | (1 << 6) | (1 << 5) | (1 << 0);\t// i.e. 8 7 6 1\n\t\t\tcase 9: return (1 << 8) | (1 << 4);\t// i.e. 9 5\n\t\t\tcase 10: return (1 << 9) | (1 << 6);\t// i.e. 10 7\n\t\t\tcase 11: return (1 << 10) | (1 << 8);\t// i.e. 11 9\n\t\t\tcase 12: return (1 << 11) | (1 << 10) | (1 << 9) | (1 << 3);\t// i.e. 12 11 10 4\n\t\t\tcase 13: return (1 << 12) | (1 << 11) | (1 << 10) | (1 << 7);\t// i.e. 13 12 11 8\n\t\t\tcase 14: return (1 << 13) | (1 << 12) | (1 << 11) | (1 << 1);\t// i.e. 14 13 12 2\n\t\t\tcase 15: return (1 << 14) | (1 << 13);\t// i.e. 15 14\n\t\t\tcase 16: return (1 << 15) | (1 << 14) | (1 << 12) | (1 << 3);\t// i.e. 16 15 13 4\n\t\t\tcase 17: return (1 << 16) | (1 << 13);\t// i.e. 17 14\n\t\t\tcase 18: return (1 << 17) | (1 << 10);\t// i.e. 18 11\n\t\t\tcase 19: return (1 << 18) | (1 << 17) | (1 << 16) | (1 << 13);\t// i.e. 19 18 17 14\n\t\t\tcase 20: return (1 << 19) | (1 << 16);\t// i.e. 20 17\n\t\t\tcase 21: return (1 << 20) | (1 << 18);\t// i.e. 21 19\n\t\t\tcase 22: return (1 << 21) | (1 << 20);\t// i.e. 22 21\n\t\t\tcase 23: return (1 << 22) | (1 << 17);\t// i.e. 23 18\n\t\t\tcase 24: return (1 << 23) | (1 << 22) | (1 << 21) | (1 << 16);\t// i.e. 24 23 22 17\n\t\t\tcase 25: return (1 << 24) | (1 << 21);\t// i.e. 25 22\n\t\t\tcase 26: return (1 << 25) | (1 << 24) | (1 << 23) | (1 << 19);\t// i.e. 26 25 24 20\n\t\t\tcase 27: return (1 << 26) | (1 << 25) | (1 << 24) | (1 << 21);\t// i.e. 27 26 25 22\n\t\t\tcase 28: return (1 << 27) | (1 << 24);\t// i.e. 28 25\n\t\t\tcase 29: return (1 << 28) | (1 << 26);\t// i.e. 29 27\n\t\t\tcase 30: return (1 << 29) | (1 << 28) | (1 << 27) | (1 << 6);\t// i.e. 30 29 28 7\n\t\t\tcase 31: return (1 << 30) | (1 << 27);\t// i.e. 31 28\n\t\t\tcase 32: return (1 << 31) | (1 << 30) | (1 << 29) | (1 << 9);\t// i.e. 32 31 30 10\n\t\t\t\n\t\t\tdefault: throw new IllegalArgumentException(\"n = \" + n + \" is an illegal value\");\n\t\t}\n\t}", "int[] union(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n\t\t//Please fill in the program here\r\n\t\tst[0] = incCapacity();\r\n\t\taddEdge(st[0], epssymbol, s1);\r\n\t\taddEdge(st[0], epssymbol, s2);\r\n\t\tst[1] = incCapacity();\r\n\t\taddEdge(t1, epssymbol, st[1]);\r\n\t\taddEdge(t2, epssymbol, st[1]);\r\n\r\n\t\treturn st;\r\n\t}", "public long countFriendsPairings(int n) \n {\n if(n<3){\n return n;\n }\n else{\n long mod=(long)Math.pow(10,9)+7;\n long b=1;\n long a=2;\n long curr=0;\n for(int i=3;i<n+1;i++){\n curr=(a+(i-1)*b)%mod;\n b=a;\n a=curr;\n \n } \n \n \n \n return curr; } \n }", "boolean splitAndInsert(T t, Pair<String,LeafNode> ln){\n\n int splitTimes=0;\n\n Interval[] intervals = ln.second().getIntervals();\n assert intervals.length==leafNodeCapacity;\n Interval[] leftIntervals = new Interval[leafNodeCapacity];\n Interval[] rightIntervals = new Interval[leafNodeCapacity];\n Interval[] tempIntervals = null;\n\n int leftIntervalNumber=0;\n int rightIntervalNumber=0;\n TriangleShape lnTriangle = ln.second().triangle;\n String lnString=ln.first();\n TriangleShape leftTriangle=null;\n TriangleShape rightTriangle=null;\n String leftString=null;\n String rightString =null;\n\n while(leftIntervalNumber==0 || rightIntervalNumber==0){\n\n if(splitTimes==10000) {\n System.out.println(\"splitTimes=\"+splitTimes);\n System.out.println(\"you should increase the parameter leafNodeCapaity value!!!\");\n assert false;\n }\n else\n splitTimes++;\n\n leftTriangle=lnTriangle.leftTriangle();\n leftIntervalNumber=0;\n rightIntervalNumber=0;\n\n for(Interval i: intervals){\n if(Geom2DSuits.contains(leftTriangle,i.getLowerBound(),i.getUpperBound())){\n leftIntervals[leftIntervalNumber]=i;\n leftIntervalNumber++;\n }\n else{\n rightIntervals[rightIntervalNumber]=i;\n rightIntervalNumber++;\n }\n }\n\n if(leftIntervalNumber==0){//all located at left side\n rightTriangle = lnTriangle.rightTriangle();\n rightString = lnString+\"1\";\n leftString=lnString+\"0\";\n emptyNodes.add(leftString);\n lnTriangle = rightTriangle;\n lnString=rightString;\n\n tempIntervals=intervals;\n intervals=rightIntervals;\n rightIntervals=tempIntervals;\n }\n else if(rightIntervalNumber==0){//all located at right side\n rightString = lnString+\"1\";\n leftString=lnString+\"0\";\n emptyNodes.add(rightString);\n lnTriangle = leftTriangle;\n lnString=leftString;\n\n tempIntervals=intervals;\n intervals=leftIntervals;\n leftIntervals=tempIntervals;\n }\n else { //spit successfully\n\n leftString=lnString+\"0\";\n LeafNode leftNode = new LeafNode();\n leftNode.intervals=leftIntervals;\n leftNode.size=leftIntervalNumber;\n leftNode.triangle=leftTriangle;\n\n rightString = lnString+\"1\";\n LeafNode rightNode = new LeafNode();\n rightTriangle = lnTriangle.rightTriangle();\n rightNode.triangle=rightTriangle;\n rightNode.size=rightIntervalNumber;\n rightNode.intervals=rightIntervals;\n\n if(leftNode.insert(t)!=1){\n rightNode.insert(t);\n }\n\n Identifier lnPage =leafInfos.remove(ln.first());\n writeNode(leftNode,lnPage);\n Identifier rightPage = CommonSuits.createIdentifier(-1L);\n writeNode(rightNode,rightPage);\n\n leafInfos.put(leftString,lnPage);\n leafInfos.put(rightString,rightPage);\n return true;\n }\n }\n return false;\n }", "private void tred2() {\n // This is derived from the Algol procedures tred2 by\n // Bowdler, Martin, Reinsch, and Wilkinson, Handbook for\n // Auto. Comp., Vol.ii-Linear Algebra, and the corresponding\n // Fortran subroutine in EISPACK.\n\n d.assign(v.viewColumn(n - 1));\n\n // Householder reduction to tridiagonal form.\n\n for (int i = n - 1; i > 0; i--) {\n\n // Scale to avoid under/overflow.\n\n double scale = d.viewPart(0, i).norm(1);\n double h = 0.0;\n\n\n if (scale == 0.0) {\n e.setQuick(i, d.getQuick(i - 1));\n for (int j = 0; j < i; j++) {\n d.setQuick(j, v.getQuick(i - 1, j));\n v.setQuick(i, j, 0.0);\n v.setQuick(j, i, 0.0);\n }\n } else {\n\n // Generate Householder vector.\n\n for (int k = 0; k < i; k++) {\n d.setQuick(k, d.getQuick(k) / scale);\n h += d.getQuick(k) * d.getQuick(k);\n }\n double f = d.getQuick(i - 1);\n double g = Math.sqrt(h);\n if (f > 0) {\n g = -g;\n }\n e.setQuick(i, scale * g);\n h -= f * g;\n d.setQuick(i - 1, f - g);\n for (int j = 0; j < i; j++) {\n e.setQuick(j, 0.0);\n }\n\n // Apply similarity transformation to remaining columns.\n\n for (int j = 0; j < i; j++) {\n f = d.getQuick(j);\n v.setQuick(j, i, f);\n g = e.getQuick(j) + v.getQuick(j, j) * f;\n for (int k = j + 1; k <= i - 1; k++) {\n g += v.getQuick(k, j) * d.getQuick(k);\n e.setQuick(k, e.getQuick(k) + v.getQuick(k, j) * f);\n }\n e.setQuick(j, g);\n }\n f = 0.0;\n for (int j = 0; j < i; j++) {\n e.setQuick(j, e.getQuick(j) / h);\n f += e.getQuick(j) * d.getQuick(j);\n }\n double hh = f / (h + h);\n for (int j = 0; j < i; j++) {\n e.setQuick(j, e.getQuick(j) - hh * d.getQuick(j));\n }\n for (int j = 0; j < i; j++) {\n f = d.getQuick(j);\n g = e.getQuick(j);\n for (int k = j; k <= i - 1; k++) {\n v.setQuick(k, j, v.getQuick(k, j) - (f * e.getQuick(k) + g * d.getQuick(k)));\n }\n d.setQuick(j, v.getQuick(i - 1, j));\n v.setQuick(i, j, 0.0);\n }\n }\n d.setQuick(i, h);\n }\n\n // Accumulate transformations.\n\n for (int i = 0; i < n - 1; i++) {\n v.setQuick(n - 1, i, v.getQuick(i, i));\n v.setQuick(i, i, 1.0);\n double h = d.getQuick(i + 1);\n if (h != 0.0) {\n for (int k = 0; k <= i; k++) {\n d.setQuick(k, v.getQuick(k, i + 1) / h);\n }\n for (int j = 0; j <= i; j++) {\n double g = 0.0;\n for (int k = 0; k <= i; k++) {\n g += v.getQuick(k, i + 1) * v.getQuick(k, j);\n }\n for (int k = 0; k <= i; k++) {\n v.setQuick(k, j, v.getQuick(k, j) - g * d.getQuick(k));\n }\n }\n }\n for (int k = 0; k <= i; k++) {\n v.setQuick(k, i + 1, 0.0);\n }\n }\n d.assign(v.viewRow(n - 1));\n v.viewRow(n - 1).assign(0);\n v.setQuick(n - 1, n - 1, 1.0);\n e.setQuick(0, 0.0);\n }", "@Test\n\tvoid testSwapPair()\n\t{\n\t\tSystem.out.println(\"test SwapPair\");\n\t\tString[] exp = {\"suruchi\", \"kunal\"};\n\t\toperate.swapPair(p);\n\t\t\n\t\t//act = {\"suruchi\",\"kunal\"}\n\t\tString[] act = {p.getFirst(),p.getSecond()};\n\n\t\t//if equal the pass then test\n\t\tassertArrayEquals(exp, act);\n\t\n\t}", "public static void fourSum(int[] data){\n HashMap<Integer,Pair> set = new HashMap<>();//integer = sum, pair are the nums\n for(int i = 0; i < data.length; i++)\n for(int j = i+1; j < data.length; j++) {\n Pair check = set.get(i+j);\n if(check != null) {\n System.out.println(\"fauifa\");\n return;\n }\n set.put(check.a()+check.b(), check);\n }\n System.out.println(\"None found.\");\n }", "protected static int[] composeRange(int... pairs) {\n if(pairs.length % 2 != 0)\n throw new IllegalArgumentException(\"Pairs has to be a multiple of 2!\");\n\n List<Integer> nums = new ArrayList<>();\n\n for(int start = 0, end = 1; end < pairs.length; start+=2, end+=2) {\n int[] semiRange = range(pairs[start], pairs[end]);\n for(Integer i : semiRange)\n nums.add(i); //potencjalna optymalizacja: dodac caly array do listy\n }\n\n //potencjalna optymalizacja: zwrocic bezposrednio z listy\n int[] finalRange = new int[nums.size()];\n for(int id = 0; id < nums.size(); id++)\n finalRange[id] = nums.get(id);\n\n return finalRange;\n }", "private void compressLeftSingleTonPairs(final S a) {\n Function<Pair<S, S>, Consumer<GPairRecord<S, S>>> consumerFunction = p -> new ArrayList<>()::add;\n Predicate<S> leftPredicate = nonTerminal -> doLeftPop(nonTerminal, head -> head.isTerminal() && !head.equals(a));\n Predicate<S> rightPredicate = nonTerminal -> doRightPop(nonTerminal, tail -> tail.isTerminal() && tail.equals(a));\n pop(phase + 1, leftPredicate, rightPredicate, consumerFunction);\n List<GPairRecord<S, S>> records = getPairs(p -> p.a.equals(a) && !p.b.equals(a));\n sortPairs(records);\n compressNonCrossingPairs(records);\n }", "public boolean twoPair(int[] numArr) {\n\t\tfor (int i = 1; i < numArr.length-2; i++) {\n\t\t\tif (numArr[i-1]==numArr[i]&&numArr[i]==numArr[i+1]){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private void phaseTwo(){\r\n\r\n\t\tCollections.shuffle(allNodes, random);\r\n\t\tList<Pair<Node, Node>> pairs = new ArrayList<Pair<Node, Node>>();\r\n\t\t\r\n\t\t//For each node in allNode, get all relationshpis and iterate through each relationship.\r\n\t\tfor (Node n1 : allNodes){\r\n\r\n\t\t\ttry (Transaction tx = graphDb.beginTx()){\r\n\t\t\t\t//If a node n1 is related to any other node in allNodes, add those relationships to rels.\r\n\t\t\t\t//Avoid duplication, and self loops.\r\n\t\t\t\tIterable<Relationship> ite = n1.getRelationships(Direction.BOTH);\t\t\t\t\r\n\r\n\t\t\t\tfor (Relationship rel : ite){\r\n\t\t\t\t\tNode n2 = rel.getOtherNode(n1);\t//Get the other node\r\n\t\t\t\t\tif (allNodes.contains(n2) && !n1.equals(n2)){\t\t\t\t\t//If n2 is part of allNodes and n1 != n2\r\n\t\t\t\t\t\tif (!rels.contains(rel)){\t\t\t\t\t\t\t\t\t//If the relationship is not already part of rels\r\n\t\t\t\t\t\t\tPair<Node, Node> pA = new Pair<Node, Node>(n1, n2);\r\n\t\t\t\t\t\t\tPair<Node, Node> pB = new Pair<Node, Node>(n2, n1);\r\n\r\n\t\t\t\t\t\t\tif (!pairs.contains(pA)){\r\n\t\t\t\t\t\t\t\trels.add(rel);\t\t\t\t\t\t\t\t\t\t\t//Add the relationship to the lists.\r\n\t\t\t\t\t\t\t\tpairs.add(pA);\r\n\t\t\t\t\t\t\t\tpairs.add(pB);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\ttx.success();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn;\r\n\t}", "private List<GPairRecord<S, S>> getNonCrossingPairs(final Predicate<Pair<S, S>> predicate) {\n List<GPairRecord<S, S>> recordList = new ArrayList<>();\n slp.getOrderedProductions().stream().map(p -> p.getLeft()).forEach(nonTerminal -> consumeNonCrossingPairs(nonTerminal, recordList::add, predicate));\n return recordList;\n }", "private List<PairOfNodeIndexIntervals> getListOfSuspiciousNodeIndexIntervalPairs() {\n\n\t\tList<PairOfNodeIndexIntervals> listOfPairs = new ArrayList<PairOfNodeIndexIntervals>();\n\n\t\t// compare the two node list by Greedy String Tilling algorithm\n\t\tSet<Match> matchedSubstrings = compareTwoNodeLists(programANodeList, programBNodeList);\n\t\tIterator<Match> it = matchedSubstrings.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tMatch match = it.next();\n\t\t\t\n\t\t\t// Given the node is represented by abbreviation of its type with fixed length: 2\n\t\t\t// not all results that are returned from GST are valid, we need to find out \n\t\t\t// valid block pairs\n\t\t\tPairOfNodeIndexIntervals validIntervalPair = getValidNodeIndexIntervalPair(match);\n\n\t\t\t// if the current match does not produce a valid block pair, the validIntervalPair will be null\n\t\t\t// otherwise, add it to the list of pairs\n\t\t\tif (validIntervalPair != null) {\n\t\t\t\tlistOfPairs.add(validIntervalPair);\n\t\t\t}\n\t\t}\n\n\t\treturn listOfPairs;\n\t}", "private TupleDesc generateTupleDesc(){\n \tif(this.childTD == null){ //no tuples merged yet\n \t\t//return a general tupleDesc\n \t\treturn generalTupleDesc();\n \t} else {\n \t\t//generate a helpful, well-named TupleDesc\n \t\tType[] typeArr;\n \tString[] nameArr;\n \tString aggName = operator.toString() + \"(\" + childTD.getFieldName(aggField) + \")\";\n \tif(gbField == NO_GROUPING && gbFieldType == Type.INT_TYPE){\n \t\ttypeArr = new Type[]{Type.INT_TYPE};\n \t\tnameArr = new String[]{aggName};\n \t}else if(gbField == NO_GROUPING){ //gbFieldType == Type.STRING_TYPE\n \t\ttypeArr = new Type[]{Type.STRING_TYPE};\n \t\tnameArr = new String[]{aggName};\n \t} else {\n \t\ttypeArr = new Type[]{gbFieldType, Type.INT_TYPE};\n \t\tString groupName = \"group by(\" + childTD.getFieldName(gbField) + \")\";\n \t\tnameArr = new String[]{groupName, aggName};\n \t}\n \treturn new TupleDesc(typeArr, nameArr);\n \t}\n }", "public Obs algorithm2_4(String[] towers, String[] tstamps, Hashtable<Integer, Vertex> towersXY) {\n\n\t\tDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tCalendar cal = Calendar.getInstance();\n\n\t\t/**\n\t\t * Stops sets and time stamps for these stops\n\t\t */\n\t\tArrayList<String> trips = new ArrayList<>();\n\t\tArrayList<String> tstrips = new ArrayList<>();\n\n\t\t/**\n\t\t * Buffers: <\\n buffer holds sequence of observations that did not meet\n\t\t * buffer clearance criterias.> <\\n tbuffer holds time stamps values\n\t\t * corresponding to those in the buffer.>\n\t\t */\n\t\tArrayList<String> buffer = new ArrayList<>();\n\t\tArrayList<String> tbuffer = new ArrayList<>();\n\n\t\tdouble max_distance = 0;\n\t\tint time_diff = 0;\n\n\t\tfor (int i = 0; i < towers.length;) {\n\t\t\tboolean flag = true;\n\t\t\tVertex a = towersXY.get(Integer.parseInt(towers[i]));\n\t\t\tfor (int j = 0; j < buffer.size(); j++) {\n\t\t\t\tVertex b = towersXY.get(Integer.parseInt(buffer.get(j)));\n\t\t\t\t// System.out.println(\"b\"+Integer.parseInt(buffer.get(j)));\n\t\t\t\tdouble tmp_distance = eculidean(a.getX(), b.getX(), a.getY(), b.getY());\n\t\t\t\tif (tmp_distance > max_distance) {\n\t\t\t\t\tmax_distance = tmp_distance;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// buffer.add(towers[i]);\n\t\t\t// tbuffer.add(tstamps[i]);\n\t\t\tif (max_distance > dist_th) {\n\t\t\t\tjava.util.Date sTime;\n\t\t\t\tjava.util.Date eTime;\n\t\t\t\tflag = false;\n\t\t\t\ttry {\n\t\t\t\t\t/**\n\t\t\t\t\t * if the time exceeds timing threshold, then check the\n\t\t\t\t\t * distance between towers. If this distance less than the\n\t\t\t\t\t * distance threshold, then previous tower is the end of the\n\t\t\t\t\t * current trip.\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t\tsTime = formatter.parse(tbuffer.get(0));\n\t\t\t\t\teTime = formatter.parse(tbuffer.get(tbuffer.size() - 1));\n\n\t\t\t\t\tcal.setTime(sTime);\n\n\t\t\t\t\tint hour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint minute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\tcal.setTime(eTime);\n\t\t\t\t\tint ehour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint eminute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\ttime_diff = Math.abs((ehour - hour)) * HOUR + (eminute - minute);\n\t\t\t\t} catch (ParseException parseException) {\n\t\t\t\t\tSystem.err.println(\"ParseException\\t\" + parseException.getMessage());\n\t\t\t\t}\n\n\t\t\t\tif (time_diff >= time_th) {\n\t\t\t\t\tflag = true;\n\t\t\t\t\tif (trips.isEmpty()) {\n\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttrips.add(buffer.get(0));\n\t\t\t\t\t\ttstrips.add(tbuffer.get(0));\n\t\t\t\t\t\ttrips.add(RLM);\n\t\t\t\t\t\ttstrips.add(RLM);\n\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t}\n\t\t\t\t\t/**\n\t\t\t\t\t * Reset buffers.\n\t\t\t\t\t */\n\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t/**\n\t\t\t\t\t * Reset maximum distances\n\t\t\t\t\t */\n\t\t\t\t\tmax_distance = 0;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Add the first observation as the origin of the first\n\t\t\t\t\t * trips and the remaining part of the buffer as the\n\t\t\t\t\t * traveling observations, else add the complete buffer\n\t\t\t\t\t * elements as the observation seq of the traveling\n\t\t\t\t\t * observables.\n\t\t\t\t\t */\n\t\t\t\t\ttrips.add(buffer.get(0));\n\t\t\t\t\ttstrips.add(tbuffer.get(0));\n\n\t\t\t\t\tbuffer.remove(0);\n\t\t\t\t\ttbuffer.remove(0);\n\n\t\t\t\t\t// i--; // to keep a as it is.\n\n\t\t\t\t\t// buffer = new ArrayList<>();\n\t\t\t\t\t// tbuffer = new ArrayList<>();\n\t\t\t\t\tmax_distance = 0;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (flag) {\n\t\t\t\tbuffer.add(towers[i]);\n\t\t\t\ttbuffer.add(tstamps[i]);\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\n\t\tif (!buffer.isEmpty()) {\n\t\t\ttrips.add(buffer.get(0));\n\t\t\ttstrips.add(tbuffer.get(0));\n\n\t\t}\n\n\t\t// System.out.println(\"stops:\\t\" + Arrays.toString(trips.toArray(new\n\t\t// String[trips.size()])).replaceAll(\" \", \"\").replaceAll(CLM + RLM +\n\t\t// CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t\t// System.out.println(\"time stamps:\\t\" +\n\t\t// Arrays.toString(tstrips.toArray(new\n\t\t// String[tstrips.size()])).replaceAll(\" \", \"\").replaceAll(CLM + RLM +\n\t\t// CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t\treturn new Obs(\n\t\t\t\tArrays.toString(trips.toArray(new String[trips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"),\n\t\t\t\tArrays.toString(tstrips.toArray(new String[tstrips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\n\t}", "static int beautifulTriplets(int d, int[] arr) {\n int l = arr.length;\n int count = 0;\n for (int i = 0; i < l; i++) {\n int ei = arr[i];\n for (int j = i+1; j < l; j++) {\n int ej = arr[j];\n int diffij = Math.abs(ej-ei);\n if(diffij == d){\n for (int k = j+1; k < l; k++) {\n int ek = arr[k];\n int diffjk = Math.abs(ek-ej);\n if(diffjk == d){\n count++;\n }\n }\n }\n }\n }\n return count;\n\n }", "protected ArrayList<int[]> findAdjacentMark(int[] pair) {\n\t\tint x = pair[0];\n\t\tint y = pair[1];\n\t\tArrayList<int[]> neighbors = new ArrayList<int[]>();\n\t\tfor (int i = x - 1; i <= x + 1; i++) {\n\t\t\tfor (int j = y - 1; j <= y + 1; j++) {\n\t\t\t\tif (i >= 0 && i < maxX && j >= 0 && j < maxY && coveredMap[i][j] == SIGN_MARK) {\n\t\t\t\t\tneighbors.add(new int[]{i, j});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn neighbors;\n\t}", "public static void main(String[] args) throws IOException {\n\t\tbr = new BufferedReader(new FileReader(new File(\"input.txt\")));\r\n\t\tSystem.setOut(new PrintStream(new File(\"output.txt\")));\r\n\t\tint T = readInt();\r\n\t\t\r\n\t\tfor (int ind = 1; ind<=T; ind++) {\r\n\t\t\tSystem.out.print(\"Case #\" + ind + \": \");\r\n\t\t\t\r\n\t\t\tint N = readInt();\r\n\t\t\tint[] ar = readIntArr();\r\n\t\t\tfor (int i = 0; i < N; i++)ar[i]--;\r\n\t\t\tboolean used[] = new boolean[N];\r\n\t\t\tint ans = 0;\r\n\t\t\tint pairMax = 0;\r\n\t\t\tint cycleMax = 0;\r\n\t\t\tint cyclePair = 0;\r\n\t\t\tint pair = 0;\r\n\t\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\t\tif (!used[i]) {\r\n\t\t\t\t\tList<Integer> list = new LinkedList<Integer>();\r\n\t\t\t\t\tlist.add(i);\r\n\t\t\t\t\tused[i] = true;\r\n\t\t\t\t\tint j = ar[i];\r\n\t\t\t\t\twhile(!list.contains(j) && !used[j]) {\r\n\t\t\t\t\t\tlist.add(j);\r\n\t\t\t\t\t\tused[j] = true;\r\n\t\t\t\t\t\tj = ar[j];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!list.contains(j))continue;\r\n\t\t\t\t\tif (list.size() == 2)pair++;\r\n\t\t\t\t\tboolean removed = false;\r\n\t\t\t\t\twhile(list.get(0) != j){list.remove(0);removed = true;}\r\n\t\t\t\t\tif (list.size() > 2 && list.size() > cycleMax) cycleMax = list.size();\r\n\t\t\t\t\tif (list.size() == 2) {\r\n\t\t\t\t\t\tint a = list.remove(0);\r\n\t\t\t\t\t\tint b = list.remove(0);\r\n\t\t\t\t\t\tint tmp = 2;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tboolean us[] = new boolean[N];\r\n\t\t\t\t\t\t\tus[a] = true;\r\n\t\t\t\t\t\t\tus[b] = true;\r\n\t\t\t\t\t\t\t//System.out.println(\" test \" + a + b);\r\n\t\t\t\t\t\t\tSet<Integer> set = new HashSet<Integer>();\r\n\t\t\t\t\t\t\tset.add(a);\r\n\t\t\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\t\t\tboolean found = false;\r\n\t\t\t\t\t\t\t\tSet<Integer> tSet = new HashSet<Integer>();\r\n\t\t\t\t\t\t\t\tfor (int ii = 0; ii < N; ii++) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif (!us[ii] && set.contains(ar[ii])) {\r\n\t\t\t\t\t\t\t\t\t\tus[ii] = true;\r\n\t\t\t\t\t\t\t\t\t\tfound = true;\r\n\t\t\t\t\t\t\t\t\t\ttSet.add(ii);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (found)tmp++;\r\n\t\t\t\t\t\t\t\tif (!found)break;\r\n\t\t\t\t\t\t\t\tset.addAll(tSet);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tset = new HashSet<Integer>();\r\n\t\t\t\t\t\t\tset.add(b);\r\n\t\t\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\t\t\tboolean found = false;\r\n\t\t\t\t\t\t\t\tSet<Integer> tSet = new HashSet<Integer>();\r\n\t\t\t\t\t\t\t\tfor (int ii = 0; ii < N; ii++) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif (!us[ii] && set.contains(ar[ii])) {\r\n\t\t\t\t\t\t\t\t\t\tus[ii] = true;\r\n\t\t\t\t\t\t\t\t\t\tfound = true;\r\n\t\t\t\t\t\t\t\t\t\ttSet.add(ii);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif(found)tmp++;\r\n\t\t\t\t\t\t\t\tif (!found)break;\r\n\t\t\t\t\t\t\t\tset.addAll(tSet);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//if (removed) {\r\n\t\t\t\t\t\t//\tif (tmp > cyclePair)cyclePair = tmp;\r\n\t\t\t\t\t\t//} else {\r\n\t\t\t\t\t\t pairMax += tmp;\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//cyclePair += 2 * pair;\r\n\t\t\t//if (pair > 1) pairMax += 2 * (pair - 1);\r\n\t\t\tans = Math.max(cyclePair, pairMax);\r\n\t\t\tans = Math.max(cycleMax, ans);\r\n\t\t\tSystem.out.println(ans);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\r\n\t}", "public Vertex[] Vertices (TrianglePair pair)\n\t{\n\t\tFace tri1 = trimesh.faces[pair.face1];\n\t\tFace tri2 = trimesh.faces[pair.face2];\n\t\tVertex[] verts1 = new Vertex[3];\n\t\tVertex[] verts2 = new Vertex[3];\n\t\tverts1[0] = trimesh.vertices[tri1.fvlist[0]];\n\t\tverts1[1] = trimesh.vertices[tri1.fvlist[1]];\n\t\tverts1[2] = trimesh.vertices[tri1.fvlist[2]];\n\t\tverts2[0] = trimesh.vertices[tri2.fvlist[0]];\n\t\tverts2[1] = trimesh.vertices[tri2.fvlist[1]];\n\t\tverts2[2] = trimesh.vertices[tri2.fvlist[2]];\n\t\tboolean[] equalVerts = new boolean[9];\n\t\tVertex[] retverts = new Vertex[4];\n\t\tequalVerts[0] = (verts1[0] == verts2[0]);\n\t\tequalVerts[1] = (verts1[0] == verts2[1]);\n\t\tequalVerts[2] = (verts1[0] == verts2[2]);\n\t\tequalVerts[3] = (verts1[1] == verts2[0]);\n\t\tequalVerts[4] = (verts1[1] == verts2[1]);\n\t\tequalVerts[5] = (verts1[1] == verts2[2]);\n\t\tequalVerts[6] = (verts1[2] == verts2[0]);\n\t\tequalVerts[7] = (verts1[2] == verts2[1]);\n\t\tequalVerts[8] = (verts1[2] == verts2[2]);\n\t\tint eqto1in1 = 0, eqto1in2 = 0, eqto2in1 = 0, eqto2in2 = 0;\n\t\tint i;\n\t\tfor (i = 0; i < 9; i++)\n\t\t{\n\t\t\tif (equalVerts[i])\n\t\t\t{\n\t\t\t\teqto1in1 = i / 3;\n\t\t\t\teqto1in2 = i % 3;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfor (i = 8; i >= 0; i--)\n\t\t{\n\t\t\tif (equalVerts[i])\n\t\t\t{\n\t\t\t\teqto2in1 = i / 3;\n\t\t\t\teqto2in2 = i % 3;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tretverts[0] = verts1[eqto1in1];\n\t\tretverts[1] = verts1[eqto2in1];\n\t\tint lone1, lone2;\n\t\tif (eqto1in1 == 0)\n\t\t{\n\t\t\tif (eqto2in1 == 1)\n\t\t\t\tlone1 = 2;\n\t\t\telse // eqto2in1 == 2\n\t\t\t\tlone1 = 1;\n\t\t}\n\t\telse if (eqto1in1 == 1)\n\t\t{\n\t\t\tif (eqto2in1 == 0)\n\t\t\t\tlone1 = 2;\n\t\t\telse // eqto2in1 == 2\n\t\t\t\tlone1 = 0;\n\t\t}\n\t\telse // eqto1in1 == 2\n\t\t{\n\t\t\tif (eqto2in1 == 0)\n\t\t\t\tlone1 = 1;\n\t\t\telse // eqto2in1 == 1\n\t\t\t\tlone1 = 0;\n\t\t}\n\t\tif (eqto1in2 == 0)\n\t\t{\n\t\t\tif (eqto2in2 == 1)\n\t\t\t\tlone2 = 2;\n\t\t\telse // eqto2in2 == 2\n\t\t\t\tlone2 = 1;\n\t\t}\n\t\telse if (eqto1in2 == 1)\n\t\t{\n\t\t\tif (eqto2in2 == 0)\n\t\t\t\tlone2 = 2;\n\t\t\telse // eqto2in2 == 2\n\t\t\t\tlone2 = 0;\n\t\t}\n\t\telse // eqto1in2 == 2\n\t\t{\n\t\t\tif (eqto2in2 == 0)\n\t\t\t\tlone2 = 1;\n\t\t\telse // eqto2in2 == 1\n\t\t\t\tlone2 = 0;\n\t\t}\n\t\tretverts[2] = verts1[lone1];\n\t\tretverts[3] = verts2[lone2];\n\t\treturn retverts;\n\t}", "private static void recursiveFixedSumPairs(/* determine parameters here */){\r\n\t\t// complete this method\r\n\t\t\r\n\t}", "public void toSATHelper2(Sat satModel) throws IOException {\n ASTNode tab=getChildConst(1);\n \n int varcount = getChild(0).numChildren()-1;\n \n ArrayList<ASTNode> tups=tab.getChildren();\n \n ArrayList<ASTNode> vardoms=new ArrayList<ASTNode>();\n for(int i=1; i<=varcount; i++) {\n ASTNode var=getChild(0).getChild(i);\n if(var instanceof Identifier) {\n vardoms.add(((Identifier)var).getDomain());\n }\n else if(var.isConstant()) {\n vardoms.add(new IntegerDomain(new Range(var,var)));\n }\n else if(var instanceof SATLiteral) {\n vardoms.add(new BooleanDomainFull());\n }\n else {\n assert false : \"Unknown type contained in tableshort constraint:\"+var;\n }\n }\n \n ArrayList<Long> tupleSatVars = new ArrayList<Long>(tups.size());\n \n // Make a SAT variable for each tuple. \n for(int i=1; i < tups.size(); i++) {\n // Filter out tuples that are not valid.\n boolean valid=true;\n ASTNode t = tups.get(i);\n int length = t.numChildren();\n for(int j = 1; j < length; ++j) {\n long var = t.getChild(j).getChild(1).getValue()-1;\n long val = t.getChild(j).getChild(2).getValue();\n if(!vardoms.get((int)var).containsValue(val)) {\n valid = false;\n break;\n }\n }\n \n if(!valid) {\n tups.set(i, tups.get(tups.size()-1));\n tups.remove(tups.size()-1);\n i--;\n continue;\n }\n \n // Make a new sat variable for the tuple\n long newSatVar=satModel.createAuxSATVariable();\n tupleSatVars.add(newSatVar);\n \n // If command line flag, generate an iff to define the new sat variable.\n if(CmdFlags.short_tab_sat_extra) {\n ArrayList<Long> c=new ArrayList<Long>(tups.get(i).numChildren()-1);\n \n // Get the literals for this tuple into c. \n for(int j=1; j<t.numChildren(); j++) {\n ASTNode pair=t.getChild(j);\n // System.out.print(pair);\n c.add(-getChild(0).getChild((int) pair.getChild(1).getValue()).directEncode(satModel, pair.getChild(2).getValue()));\n }\n \n satModel.addClauseReified(c, -newSatVar);\n }\n \n }\n \n // Store for each variable, a list of its domain values\n ArrayList<ArrayList<Long>> vallist = new ArrayList<ArrayList<Long>>(varcount);\n // Store, for each variable, the tuples which implictly support it\n ArrayList<ArrayList<Long>> impclauselist = new ArrayList<ArrayList<Long>>(varcount); \n // Store, for each literal, the tuples which explictly support it\n ArrayList<ArrayList<ArrayList<Long>>> expclauselist = new ArrayList<ArrayList<ArrayList<Long>>>(varcount);\n \n for(int var=1; var<=varcount; var++) {\n ASTNode varast=getChild(0).getChild(var);\n \n vallist.add(vardoms.get(var-1).getValueSet());\n impclauselist.add(new ArrayList<Long>());\n expclauselist.add(new ArrayList<ArrayList<Long>>(vallist.get(var-1).size()));\n for(int j = 0; j < vallist.get(var-1).size(); ++j)\n {\n expclauselist.get(var-1).add(new ArrayList<Long>());\n }\n }\n \n for(int tup=1; tup < tups.size(); tup++) {\n ASTNode t = tups.get(tup);\n int length = t.numChildren();\n // Track used variables\n ArrayList<Boolean> used_vars = new ArrayList<Boolean>(Collections.nCopies(varcount, false));\n for(int j = 1; j < length; ++j) {\n int var = (int)(t.getChild(j).getChild(1).getValue() - 1);\n long val = t.getChild(j).getChild(2).getValue();\n assert used_vars.get(var) == false;\n used_vars.set(var, true);\n int loc = Collections.binarySearch(vallist.get(var), val);\n assert vallist.get(var).get(loc) == val;\n expclauselist.get(var).get(loc).add(tupleSatVars.get(tup-1));\n }\n \n for(int j = 0; j < varcount; ++j)\n {\n if(used_vars.get(j) == false) {\n impclauselist.get(j).add(tupleSatVars.get(tup-1));\n }\n }\n }\n \n // Now generate and post clauses\n for(int i = 0; i < varcount; ++i)\n {\n ASTNode varast=getChild(0).getChild(i+1);\n for(int val = 0; val < vallist.get(i).size(); ++val)\n {\n // firstly, for all explicit clauses, ~lit -> ~clause ( lit \\/ ~clause )\n if(!CmdFlags.short_tab_sat_extra) {\n for(int clause = 0; clause < expclauselist.get(i).get(val).size(); ++clause)\n {\n long lit = varast.directEncode(satModel, vallist.get(i).get(val));\n \n satModel.addClause(lit, -expclauselist.get(i).get(val).get(clause));\n }\n }\n \n // Secondly, for all implicit + explicit clauses for lit,\n // ~(/\\clauses) -> ~lit ( ~lit \\/ expclause1 \\/ ... \\/ expclausen \\/ impclause1 \\/ ... impclausen)\n ArrayList<Long> buf=new ArrayList<Long>(1+expclauselist.get(i).get(val).size()+impclauselist.get(i).size());\n \n buf.add(-varast.directEncode(satModel, vallist.get(i).get(val)));\n \n for(int clause = 0; clause < expclauselist.get(i).get(val).size(); ++clause)\n {\n buf.add(expclauselist.get(i).get(val).get(clause));\n }\n for(int clause = 0; clause < impclauselist.get(i).size(); ++clause)\n {\n buf.add(impclauselist.get(i).get(clause));\n }\n satModel.addClause(buf);\n }\n }\n \n satModel.addClause(tupleSatVars); // One of the tuples must be assigned -- redundant but probably won't hurt.\n }", "private List<NodePair> allNodePairs(List<Node> nodes) {\n List<NodePair> nodePairs = new ArrayList<>();\n for (int j = 0; j < nodes.size() - 1; j++) {\n for (int k = j + 1; k < nodes.size(); k++) {\n nodePairs.add(new NodePair(nodes.get(j), nodes.get(k)));\n }\n }\n return nodePairs;\n }", "@Test\r\n\tpublic void shouldReturn2PairsWhen110100() {\n\t\tA = new ArrayList<Integer>(Arrays.asList(1, 1, 0, 1, 0, 0));\r\n\t\tassertEquals(2, Coins.countPairs(A));\r\n\t}", "protected Pair() {\n\t\t\n\t\tsuper(2);\n\t}", "protected abstract void recombineNext();", "private static Pair closest_pair(ArrayList<Point> pointset){\n\t\treturn null;\n\t}", "private void fromPairs(final Object[] pairs) throws IllegalArgumentException {\n if ((pairs.length & 1) != 0) {\n throw new IllegalArgumentException(\n Errors.format(ErrorKeys.ODD_ARRAY_LENGTH_$1, pairs.length));\n }\n for (int i=0; i<pairs.length; i += 2) {\n super.put(pairs[i], pairs[i+1]);\n }\n }", "@Override\n public void step(double[] p, int n, double t, double h, double[] pout, Function derivs) {\n \tif ( tmp == null || tmp.length != n ) {\n tmp = new double[n];\n \t}\n \t//state: p.x,p.y,v.x,v.y\n \tVector2d v1 = new Vector2d();\n \tVector2d x1 = new Vector2d();\n \tVector2d a = new Vector2d();\n\t\tderivs.derivs(t,p,tmp);\n\t\t//gives me k1\n \tfor (int i=0;i<p.length-3;i+=4) {\n \t\tdouble[] k2 = new double[4];\n \t\tdouble[] k3 = new double[4];\n \t\tdouble[] k4 = new double[4];\n \t\t//x1 = x0+h(x0+1/2h(x0)')'\n \t\tdouble[] tuples = new double[] {tmp[i]*1/2*h+p[i],tmp[i+1]*1/2*h+p[i+1],\n \t\t\t\ttmp[i+2]*1/2*h+p[i+2],tmp[i+3]*1/2*h+p[i+3]};\n \t\tderivs.derivs(t,tuples,k2);\n \t\ttuples = new double[] {k2[i]*1/2*h+p[i],k2[i+1]*1/2*h+p[i+1],\n \t\t\t\tk2[i+2]*1/2*h+p[i+2],k2[i+3]*1/2*h+p[i+3]};\n \t\tderivs.derivs(t,tuples,k3);\n \t\ttuples = new double[] {k3[i]*h+p[i],k3[i+1]*h+p[i+1],\n \t\t\t\tk3[i+2]*h+p[i+2],k3[i+3]*h+p[i+3]};\n \t\tderivs.derivs(t,tuples,k4);\n \t\tx1.set(new Vector2d(p[i],p[i+1]));\n \t\tx1.scaleAdd(h/6, new Vector2d(tmp[i],tmp[i+1]), x1);\n \t\tx1.scaleAdd(h/3, new Vector2d(k2[i],k2[i+1]), x1);\n \t\tx1.scaleAdd(h/3, new Vector2d(k3[i],k3[i+1]), x1);\n \t\tx1.scaleAdd(h/6, new Vector2d(k4[i],k4[i+1]), x1);\n \t\t//v1 = v0+h*a\n \t\ta.set(tmp[i+2],tmp[i+3]);\n \t\tv1.set(new Vector2d(p[i+2],p[i+3]));\n \t\tv1.scaleAdd(h/6, a, v1);\n \t\tv1.scaleAdd(h/3, new Vector2d(k2[i+2],k2[i+3]), v1);\n \t\tv1.scaleAdd(h/3, new Vector2d(k3[i+2],k3[i+3]), v1);\n \t\tv1.scaleAdd(h/6, new Vector2d(k4[i+2],k4[i+3]), v1);\n \t\t//update velocity and positions\n \t\tpout[i] = x1.x;\n \t\tpout[i+1] = x1.y;\n \t\tpout[i+2] = v1.x;\n \t\tpout[i+3] = v1.y;\n \t}\n }", "List<Tile> getAdjacentTiles();", "public static long journeyToMoon(int n, List<List<Integer>> astronaut) {\n // Write your code here\n Map<Integer, Node<Integer>> countryMap = new HashMap<>();\n for(List<Integer> pairs: astronaut) {\n Node<Integer> node1 = countryMap.computeIfAbsent(pairs.get(0), Node::new);\n Node<Integer> node2 = countryMap.computeIfAbsent(pairs.get(1), Node::new);\n node1.connected.add(node2);\n node2.connected.add(node1);\n }\n\n List<Integer> countryCluster = new ArrayList<>();\n for(Node<Integer> node: countryMap.values()) {\n if(node.connected.size() == 0) {\n countryCluster.add(1);\n } else if(!node.visited){\n countryCluster.add(getNodeCount3(node));\n }\n }\n List<Integer> countryNodes = countryMap.values().stream().map(nn -> nn.value).collect(Collectors.toList());\n List<Integer> missingNodes = new ArrayList<>();\n for(int i=0; i < n; i++) {\n if(!countryNodes.contains(i))\n missingNodes.add(i);\n }\n\n for(int i=0; i < missingNodes.size(); i++) {\n countryCluster.add(1);\n }\n\n long ans = 0;\n //For one country we cannot pair with any other astronauts\n if(countryCluster.size() >= 2) {\n ans = (long) countryCluster.get(0) * countryCluster.get(1);\n if(countryCluster.size() > 2) {\n int sum = countryCluster.get(0) + countryCluster.get(1);\n for(int i=2; i < countryCluster.size(); i++) {\n ans += (long) sum * countryCluster.get(i);\n sum += countryCluster.get(i);\n }\n }\n }\n\n /*\n permutation of two set with size A and B = AxB\n permutation of three set with size A,B,C = AxB + AxC + BxC = AxB + (A+B)xC\n permutation of four set with size A,B,C,D = AxB + AxC + AxD + BxC + BxD + CxD = AxB + (A+B)xC + (A+B+C)xD\n */\n /*\n if(keys.length == 1) {\n ans = keys[0].size();\n } else {\n ans = keys[0].size() * keys[1].size();\n if(keys.length > 2) {\n int sum = keys[0].size() + keys[1].size();\n for (int i = 2; i < keys.length; i++) {\n ans += sum * keys[i].size();\n sum += keys[i].size();\n }\n }\n }\n */\n return ans;\n }", "private static void printPairs(int[] a, int sum) {\n\t\tfor(int i=0;i<a.length;i++) {\n\t\t//for (int j = 0; j < n; j++) {/Is the reverse of pair is acceptable\n\t\t\tfor(int j=i+1;j<a.length;j++) {\n\t\t\t\tif(a[i]+a[j]==sum) {\n\t\t\t\t\tSystem.out.println(\"(\"+a[i]+\"+\"+a[j]+\") = \"+sum);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}" ]
[ "0.59218436", "0.5711675", "0.5658044", "0.5462937", "0.529284", "0.52765054", "0.525269", "0.5244707", "0.5240174", "0.5184679", "0.51778686", "0.51622355", "0.51606816", "0.5098146", "0.5094686", "0.50823903", "0.50761324", "0.5051328", "0.5046543", "0.5044224", "0.50048196", "0.49893743", "0.4983426", "0.49718502", "0.49688908", "0.49684364", "0.49337202", "0.4918211", "0.49019384", "0.4898282", "0.4894465", "0.48893347", "0.4888233", "0.4884201", "0.4879098", "0.4865552", "0.48451075", "0.483389", "0.48314703", "0.4828674", "0.4820604", "0.48056874", "0.48029923", "0.479945", "0.47993624", "0.47872987", "0.47862154", "0.47836897", "0.47819546", "0.4781478", "0.47801572", "0.47777787", "0.47770885", "0.47744486", "0.47710553", "0.47708285", "0.47681692", "0.47669995", "0.47652847", "0.47598493", "0.47562656", "0.47523853", "0.4744938", "0.474153", "0.47398767", "0.47373906", "0.4736543", "0.47315234", "0.47302735", "0.4714373", "0.47140706", "0.471295", "0.47086295", "0.4705229", "0.47021264", "0.4699965", "0.46956298", "0.46911734", "0.46864197", "0.46860084", "0.46849614", "0.4683856", "0.46830228", "0.4681462", "0.46812928", "0.46811786", "0.4679412", "0.4672031", "0.4671494", "0.46698493", "0.4667663", "0.46660388", "0.465456", "0.46536997", "0.46531814", "0.4652381", "0.4650753", "0.46469143", "0.46405852", "0.46396014" ]
0.5706183
2
create a deep copy of one (in case you don't wish to modify it)
private static Set<Item> multiSetIntersection(List<Set<Item>> setList) { Set<Item> interQrels = new HashSet<>(setList.get(0)); for (int i = 1; i< setList.size();i++) { interQrels.retainAll(setList.get(i)); // intersection with two (and one) } return interQrels; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Prototype makeCopy();", "Object clone();", "Object clone();", "private Shop deepCopy() {\n BookShop obj = null;\n try {\n obj = (BookShop) super.clone();\n List<Book> books = new ArrayList<>();\n Iterator<Book> iterator = this.getBooks().iterator();\n while(iterator.hasNext()){\n\n books.add((Book) iterator.next().clone());\n }\n obj.setBooks(books);\n } catch (CloneNotSupportedException exc) {\n exc.printStackTrace();\n }\n return obj;\n }", "protected Factorization copy(){\n Factorization newFactor = new Factorization(this.mdc);\n //shallow copy\n newFactor.setRecipes(recipes);\n newFactor.setIngredients(ingredients);\n newFactor.setUserMap(userMap);\n newFactor.setUserMapReversed(userMap_r);\n newFactor.setRecipeMap(recipeMap);\n newFactor.setRecipeMapReversed(recipeMap_r);\n newFactor.setIngredientMap(ingredientMap);\n newFactor.setIngredientMapReversed(ingredientMap_r);\n \n //deep copy\n List<User> userCopy = new ArrayList<User>();\n for(User curr: this.users){\n userCopy.add(new User(curr.getId()));\n }\n newFactor.setUsers(userCopy);\n newFactor.setDataset(dataset.copy());\n newFactor.updateInitialSpace();\n return newFactor;\n }", "private Shop shallowCopy() {\n BookShop obj = null;\n try {\n obj = (BookShop) super.clone();\n } catch (CloneNotSupportedException exc) {\n exc.printStackTrace();\n }\n return obj;\n }", "public CopyBuilder copy() {\n return new CopyBuilder(this);\n }", "public Object clone();", "public Object clone();", "public Object clone();", "public Object clone();", "public Complex makeDeepCopy() {\r\n Complex complex2 = new Complex(this.getReal(), this.getImaginary());\r\n return complex2;\r\n }", "public Function clone();", "Component deepClone();", "public T cloneDeep();", "Model copy();", "public Tree<K, V> copy() {\n\t\tTree<K, V> copy = EmptyTree.getInstance(), t = this;\n\t\treturn copy(t, copy);\n\t}", "public Ping dup (Ping self)\n {\n if (self == null)\n return null;\n\n Ping copy = new Ping ();\n if (self.getIdentity () != null)\n copy.setAddress (self.getIdentity ());\n copy.digest = new ArrayList <State> (self.digest);\n return copy;\n }", "public JsonMember copy() {\n return new JsonMember(name, value.copy());\n }", "public State dup (State self)\n {\n if (self == null)\n return null;\n\n State copy = new State ();\n if (self.getIdentity () != null)\n copy.setAddress (self.getIdentity ());\n copy.address = self.address;\n copy.addressPort = self.addressPort;\n copy.generation = self.generation;\n copy.max_version = self.max_version;\n copy.extra = new VersionedMap (self.extra);\n return copy;\n }", "public abstract INodo copy();", "private final State copy( State state)\n {\n State copy = new State();\n copy.index = counter++;\n copy.stackOps = Arrays.copyOf( state.stackOps, state.stackOps.length);\n copy.gotos = Arrays.copyOf( state.gotos, state.gotos.length);\n itemSetMap.put( copy, itemSetMap.get( state));\n return copy;\n }", "T copy();", "public JsonFactory copy()\n/* */ {\n/* 324 */ _checkInvalidCopy(JsonFactory.class);\n/* */ \n/* 326 */ return new JsonFactory(this, null);\n/* */ }", "public AST copy()\n {\n return new Implicate(left, right);\n }", "public T copy() {\n T ret = createLike();\n ret.getMatrix().setTo(this.getMatrix());\n return ret;\n }", "public Object clone() {\n return this.copy();\n }", "public Object clone(){\n \t\n \treturn this;\n \t\n }", "protected Shingle copy() {\n return new Shingle(this);\n }", "public abstract B copy();", "public Punch getShallowCopy(){\n Punch p = new Punch();\n p.id = id;\n p.time = time;\n //p.taskId = punchTask.getID();\n return p;\n }", "public Query copy() {\r\n\tQuery queryCopy = new Query();\r\n\tqueryCopy.terms = (LinkedList<String>) terms.clone();\r\n\tqueryCopy.weights = (LinkedList<Double>) weights.clone();\r\n\treturn queryCopy;\r\n }", "Nda<V> shallowCopy();", "public Coordinates copy() {\n\t\treturn new Coordinates(this);\n\t}", "public CMObject copyOf();", "public Game copy();", "@Override\n public FieldEntity copy()\n {\n return state.copy();\n }", "public abstract Object clone();", "public PingOk dup (PingOk self)\n {\n if (self == null)\n return null;\n\n PingOk copy = new PingOk ();\n if (self.getIdentity () != null)\n copy.setAddress (self.getIdentity ());\n copy.request = new ArrayList <State> (self.request);\n copy.response = new ArrayList <State> (self.response);\n return copy;\n }", "public void copy() {\n\n\t}", "public Object clone() {\n // No problems cloning here since private variables are immutable\n return super.clone();\n }", "@Override\n public Object clone() {\n return super.clone();\n }", "public abstract Object clone() ;", "public abstract Node copy();", "public Card copy(){\n return new Card(Suits, Value);\n }", "public State copy() {\n State that = new State(this.registers.length);\n for (int i=0; i<this.registers.length; ++i) {\n Object a = this.registers[i];\n if (a == null) continue;\n if (!(a instanceof Set))\n that.registers[i] = a;\n else\n that.registers[i] = NodeSet.FACTORY.makeSet((Set)a);\n }\n if(TRACE_REGISTERS) System.out.println(\"Copying state \" + Arrays.asList(that.registers));\n return that;\n }", "public Object clone() {\n \ttry {\n \tMyClass1 result = (MyClass1) super.clone();\n \tresult.Some2Ob = (Some2)Some2Ob.clone(); ///IMPORTANT: Some2 clone method called for deep copy without calling this Some2.x will be = 12\n \t\n \treturn result;\n \t} catch (CloneNotSupportedException e) {\n \treturn null; \n \t}\n\t}", "@Override\n public AbstractRelic makeCopy() {\n return new Compendium();\n }", "public CFExp deepCopy(){\r\n return this;\r\n }", "@Override\n public weighted_graph copy() {\n weighted_graph copy = new WGraph_DS(this.ga);//create the copy graph via copy constructor\n return copy;\n }", "@Override\r\n\tpublic LogicalValue copy() {\r\n\t\treturn new Pointer(target);\r\n\t}", "@Override\n public ExpressionNode deepCopy(BsjNodeFactory factory);", "@Override\n\tpublic Expression copy() {\n\t\treturn null;\n\t}", "public Record copy() {\n\t\treturn new Record(video, numOwned, numOut, numRentals);\n\t}", "public StateInfo copy() {\n return new StateInfo(this);\n }", "public static void copyConstructor(){\n\t}", "public Record copy() {\n return new Record(\n this.id,\n this.location.copy(),\n this.score\n );\n }", "public Object clone()\n {\n PSRelation copy = new PSRelation(new PSCollection(m_keyNames.iterator()),\n new PSCollection(m_keyValues.iterator()));\n \n copy.m_componentState = m_componentState;\n copy.m_databaseComponentId = m_databaseComponentId;\n copy.m_id = m_id;\n\n return copy;\n }", "@Override\n public TopicObject copy() {\n return new TopicObject(this);\n }", "static void setCopying(){isCopying=true;}", "@Override\n\t\tpublic ImmutableSequentialGraph copy() {\n\t\t\treturn new ComposedGraph( g0, g1.copy() );\n\t\t}", "public O copy() {\n return value();\n }", "private Object[] deepCopy()\n {\n Object[] newList = new Object[size];\n\n int newListPosition = 0;\n for (int i =0; i < size; i++)\n {\n if (list[i] != null)\n {\n newList[newListPosition++] = list[i];\n }\n }\n\n return newList;\n }", "public SoPickedPoint \ncopy() \n//\n////////////////////////////////////////////////////////////////////////\n{\n SoPickedPoint newCopy = new SoPickedPoint(this);\n return newCopy;\n}", "@Test\n\tpublic void copy() {\n\t\tBody b1 = new Body();\n\t\tBodyFixture b1f1 = b1.addFixture(Geometry.createCircle(0.5));\n\t\t\n\t\tCollisionItemAdapter<Body, BodyFixture> c1 = this.item.copy();\n\t\tTestCase.assertNull(c1.getBody());\n\t\tTestCase.assertNull(c1.getFixture());\n\t\t\n\t\tthis.item.set(b1, b1f1);\n\t\tCollisionItemAdapter<Body, BodyFixture> c2 = this.item.copy();\n\t\tTestCase.assertEquals(b1, c2.getBody());\n\t\tTestCase.assertEquals(b1f1, c2.getFixture());\n\t\t\n\t\t// make sure it's a deep copy\n\t\tc1.set(null, null);\n\t\tTestCase.assertNull(c1.getBody());\n\t\tTestCase.assertNull(c1.getFixture());\n\t\tTestCase.assertEquals(b1, c2.getBody());\n\t\tTestCase.assertEquals(b1f1, c2.getFixture());\n\t}", "public Card makeCopy(){\n return new Card(vimage);\n }", "@Override\n public LocalStore<V> copy() {\n return this;\n }", "public Object clone()\n\t{\n\t\treturn new Tree();\n\t}", "@Override\r\n public NumericObjectArrayList makeDeepCopy() {\r\n NumericObjectArrayList list = new NumericObjectArrayList();\r\n for (int i = 0; i < this.getCount(); i++) {\r\n try {\r\n list.insert(i, this.getValueAt(i));\r\n } catch (IndexRangeException ex) {\r\n //Shouldn't happen\r\n }\r\n }\r\n return list;\r\n }", "public Field copy()\n {\n return new Field(name, type, vis);\n }", "public abstract Pessoa clone();", "public Animal deepCopy() {\n return new Eagle(this);\n }", "Nda<V> deepCopy();", "@Override\n\tpublic function copy() {\n\t\tMonom M=new Monom(this.get_coefficient(),this.get_power());\n\t\t\n\t\treturn M;\n\t}", "public abstract TreeNode copy();", "public Vector clone()\r\n {\r\n Vector<O> v = new Vector<O>();\r\n \r\n VectorItem<O> vi = first;\r\n while (vi != null)\r\n {\r\n v.pushBack (vi.getObject());\r\n vi = vi.getNext();\r\n }\r\n \r\n return v;\r\n }", "public Address copy() {\n\t\tAddress copy = new Address(this.street, this.city, this.state, this.zipCode);\n\t\treturn copy;\n\t}", "public MappingInfo copy()\r\n\t{\r\n\t\tArrayList<MappingCell> mappingCells = new ArrayList<MappingCell>();\r\n\t\tfor(MappingCell mappingCell : mappingCellHash.get())\r\n\t\t\tmappingCells.add(mappingCell);\r\n\t\treturn new MappingInfo(mapping.copy(),mappingCells);\r\n\t}", "public DessertVO clone() {\r\n return (DessertVO) super.clone();\r\n }", "public Expression deepCopy()\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}", "public Position copy() {\n return new Position(values.clone());\n }", "public Table shallowCopy() {\n\t\tSubsetTableImpl vt =\n\t\t\tnew SubsetTableImpl(this.getColumns(), this.subset);\n\t\tvt.setLabel(getLabel());\n\t\tvt.setComment(getComment());\n\t\treturn vt;\n\t}", "public HeapElt copy() {\n HeapElt newElement = new HeapElt();\n \n newElement.setHandle(this.handle);\n newElement.setRecord(this.record);\n \n return newElement;\n }", "public Client copy() {\n\t\tClient clone = new Client(ID, Email, PostalAddress);\n\t\treturn(clone);\n\t}", "public Results copy()\n {\n Results copy = new Results();\n for(Object object : results) {\n copy.add( object );\n }\n return copy;\n }", "public BufferTWeak cloneMe() {\r\n BufferTWeak ib = new BufferTWeak(uc);\r\n ib.increment = increment;\r\n ib.set(new Object[objects.length]);\r\n for (int i = 0; i < objects.length; i++) {\r\n ib.objects[i] = this.objects[i];\r\n }\r\n ib.offset = this.offset;\r\n ib.count = this.count;\r\n return ib;\r\n }", "public abstract State clone();", "IGLProperty clone();", "public Hello dup (Hello self)\n {\n if (self == null)\n return null;\n\n Hello copy = new Hello ();\n if (self.getIdentity () != null)\n copy.setAddress (self.getIdentity ());\n copy.ipaddress = self.ipaddress;\n copy.mailbox = self.mailbox;\n copy.groups = new ArrayList <String> (self.groups);\n copy.status = self.status;\n copy.headers = new VersionedMap (self.headers);\n return copy;\n }", "public abstract Instance duplicate();", "public SceneLabelObjectState copy(){\n\n\t\t//get a copy of the generic data from the supertype\n\t\tSceneDivObjectState genericCopy = super.copy(); \n\n\t\t//then generate a copy of this specific data using it (which is easier then specifying all the fields\n\t\t//Separately like we used too)\n\t\tSceneLabelObjectState newObject = new SceneLabelObjectState(\n\t\t\t\tgenericCopy,\n\t\t\t\tObjectsCurrentText,\t\t\n\t\t\t\tCSSname,\n\t\t\t\tcursorVisible,\n\t\t\t\tTypedText,\n\t\t\t\tCustom_Key_Beep,\n\t\t\t\tCustom_Space_Beep);\n\n\t\treturn newObject;\n\n\n\t}", "@Override\n public UserProfile copy() {\n UserProfile userProfile = new UserProfile();\n copyTo(userProfile);\n return userProfile;\n }", "public Object clone() {\n View v2;\n try {\n v2 = (View) super.clone();\n } catch (CloneNotSupportedException cnse) {\n v2 = new View();\n }\n v2.center = (Location) center.clone();\n v2.zoom = zoom;\n v2.size = (Dimension) size.clone();\n return v2;\n }", "public Feature copy() {\n\t\tFeature ret = new AbbeelFeature();\n\t\treturn ret;\n\t}", "public Paper clone() \r\n\t{\r\n\t\tPaper copy = null;\r\n\t\ttry\r\n\t\t{ \r\n\t\t\tcopy = new Paper(this.getId(), new String(this.getTitle()), new String(this.getURI()),\r\n\t\t\t\tthis.year, new String(this.biblio_info), \r\n\t\t\t\tnew String(this.authors), new String(this.url) ); \r\n\t\t}\r\n\t\tcatch (Exception e) { e.printStackTrace(System.out); }\r\n\t\treturn copy;\r\n\t}", "public Triangle copy()\r\n {\r\n return new Triangle (v1.getX(),v1.getY(),v2.getX(),v2.getY(),v3.getX(),v3.getY());\r\n }", "public void copy(DataRequest original){\n\t\t//potential problems with object sharing\n\t\tfilters = \toriginal.get_filters();\n\t\tsort_by = \toriginal.get_sort_by();\n\t\tcount = \toriginal.get_count();\n\t\tstart = \toriginal.get_start();\n\t\tsource = \toriginal.get_source();\n\t\tfieldset =\toriginal.get_fieldset();\n\t\trelation = \toriginal.get_relation();\n\t}", "StoryState copy() {\r\n\t\tStoryState copy = new StoryState(story);\r\n\r\n\t\tcopy.getOutputStream().addAll(outputStream);\r\n\t\toutputStreamDirty();\r\n\t\tcopy.currentChoices.addAll(currentChoices);\r\n\r\n\t\tif (hasError()) {\r\n\t\t\tcopy.currentErrors = new ArrayList<String>();\r\n\t\t\tcopy.currentErrors.addAll(currentErrors);\r\n\t\t}\r\n\r\n\t\tcopy.callStack = new CallStack(callStack);\r\n\r\n\t\tcopy.variablesState = new VariablesState(copy.callStack, story.getListDefinitions());\r\n\t\tcopy.variablesState.copyFrom(variablesState);\r\n\r\n\t\tcopy.evaluationStack.addAll(evaluationStack);\r\n\r\n\t\tif (getDivertedTargetObject() != null)\r\n\t\t\tcopy.setDivertedTargetObject(divertedTargetObject);\r\n\r\n\t\tcopy.setPreviousContentObject(getPreviousContentObject());\r\n\r\n\t\tcopy.visitCounts = new HashMap<String, Integer>(visitCounts);\r\n\t\tcopy.turnIndices = new HashMap<String, Integer>(turnIndices);\r\n\t\tcopy.currentTurnIndex = currentTurnIndex;\r\n\t\tcopy.storySeed = storySeed;\r\n\t\tcopy.previousRandom = previousRandom;\r\n\r\n\t\tcopy.setDidSafeExit(didSafeExit);\r\n\r\n\t\treturn copy;\r\n\t}", "public Board deepCopy() {\n Board copy = new Board();\n for (int i = 0; i < DIMENSION; i++) {\n System.arraycopy(this.fields[i], 0, copy.fields[i], 0, DIMENSION);\n }\n return copy;\n }", "public Object clone() throws CloneNotSupportedException { return super.clone(); }", "private Instances deepCopy(Instances data) {\n Instances newInst = new Instances(data);\n\n newInst.clear();\n\n for (int i = 0; i < data.size(); i++) {\n Instance ni = new DenseInstance(data.numAttributes());\n for (int j = 0; j < data.numAttributes(); j++) {\n ni.setValue(newInst.attribute(j), data.instance(i).value(data.attribute(j)));\n }\n newInst.add(ni);\n }\n\n return newInst;\n }" ]
[ "0.77129203", "0.74092895", "0.74092895", "0.7211412", "0.7064742", "0.7044601", "0.7032211", "0.6989071", "0.6989071", "0.6989071", "0.6989071", "0.69870275", "0.69786537", "0.6948633", "0.69268477", "0.69249874", "0.6910445", "0.6866878", "0.68370473", "0.6833446", "0.68284494", "0.68215525", "0.6818796", "0.67910904", "0.6758647", "0.6745242", "0.6734275", "0.67166865", "0.67030346", "0.6687117", "0.6679255", "0.66742706", "0.66728747", "0.666695", "0.6643132", "0.6619039", "0.6612226", "0.6603029", "0.6593544", "0.6588073", "0.65879935", "0.65727425", "0.6566426", "0.65553313", "0.6549357", "0.6548243", "0.65115345", "0.6498509", "0.6497032", "0.64959675", "0.6494697", "0.64837015", "0.64832133", "0.647445", "0.64601743", "0.6458576", "0.6451351", "0.6431778", "0.6431137", "0.6419894", "0.6418458", "0.6412444", "0.64119154", "0.6409316", "0.6407791", "0.64061606", "0.6389319", "0.6388905", "0.6387329", "0.63822055", "0.6369454", "0.6366922", "0.6357055", "0.6352901", "0.63495773", "0.6346339", "0.6344909", "0.63390815", "0.6337005", "0.6335252", "0.63214153", "0.63177663", "0.63155484", "0.6301668", "0.62968", "0.6290108", "0.6288625", "0.62719524", "0.62670755", "0.62624705", "0.625983", "0.6253388", "0.6250349", "0.624599", "0.624597", "0.6245015", "0.62415725", "0.623196", "0.62274396", "0.62272257", "0.6225704" ]
0.0
-1
get notification list of a user
public List<Notification> getNotifications(Long userId) { return notificationDao.findNotificationsOfUser(userId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic List<Notification> getNotificationList(int idUser) {\n\t\treturn dao.getNotificationList(idUser);\n\t}", "@Override\n\tpublic List<Notifications> getNotifications(String username) {\n\t\treturn mobileDao.getNotifications(username);\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic List<Notification> getAllNotifications(User user) {\n\t\tEntityManager manager = Resources.getEntityManager();\n\t\tList<Notification> notifications = manager\n\t\t\t\t.createQuery(\"SELECT x FROM Notification x WHERE x.event.course.user.id = :id\")\n\t\t\t\t.setParameter(\"id\", user.getId()).getResultList();\n\t\treturn notifications;\n\t}", "public List<Notification> findByUser(NormalUser user);", "private List<String> getNotificationList(RepositoryItem item, RepositoryActionType action) throws RepositoryException {\n\t\tSubscriptionList singleVersionSubscriptions = getSingleVersionSubscriptions(\n\t\t\t\titem.getBaseNamespace(), item.getLibraryName(), item.getVersion() );\n\t\tSubscriptionList allVersionSubscriptions = getAllVersionsSubscriptions(\n\t\t\t\titem.getBaseNamespace(), item.getLibraryName() );\n\t\tSubscriptionEventType eventType = action.getEventType();\n\t\tList<String> userList = new ArrayList<>();\n\t\t\n\t\taddUsers( userList, singleVersionSubscriptions, eventType );\n\t\taddUsers( userList, allVersionSubscriptions, eventType );\n\t\t\n\t\tfor (String userId : getNotificationList( item.getBaseNamespace(), action )) {\n\t\t\tif (!userList.contains( userId )) {\n\t\t\t\tuserList.add( userId );\n\t\t\t}\n\t\t}\n\t\treturn userList;\n\t}", "@PreAuthorize(\"hasAnyAuthority(T(com.meetup.utils.Role).ADMIN, \"\n + \"T(com.meetup.utils.Role).SPEAKER, \"\n + \"T(com.meetup.utils.Role).LISTENER)\")\n @GetMapping(value = \"/user/notifications\")\n public ResponseEntity<List<NotificationDTO>> getNotifications(\n @CookieValue(\"token\") final String token) {\n Integer userId = loginValidatorService.extractId(token);\n List<NotificationDTO> notificationDTOs = notificationService\n .findUnread(userId)\n .stream()\n .map(NotificationDTOConverter::convert)\n .collect(Collectors.toList());\n return ok(notificationDTOs);\n }", "public ArrayList<Notification> getNotifications(String userEmail) throws SQLException{\n// connection=Db.instance().getConnection();\n try{\n ps = connection.prepareStatement(\"SELECT * FROM notification WHERE user_email=?\");\n ps.setString(1,userEmail);\n rs = ps.executeQuery();\n ArrayList<Notification> resultat = new ArrayList<>();\n while(rs.next()){\n Notification notification = new Notification(rs.getInt(\"id\"),rs.getString(\"user_email\"),rs.getString(\"text\"),rs.getTimestamp(\"time\"));\n notification.setSeen(rs.getInt(\"seen\"));\n resultat.add(notification);\n } return resultat;\n }finally {\n Db.close(rs);\n Db.close(ps);\n }\n }", "public Collection getReceivedNotifications();", "@Override\n\tpublic List<NotificationInfo> queryNotificationInfosByUserId(long userId) {\n\t\treturn notificationDao.queryNotificationInfosByUserId(userId);\n\t}", "@Override\n public List<EmailNotification> list() {\n DetachedCriteria criteria = DetachedCriteria.forClass(EmailNotification.class);\n List<EmailNotification> notifications = hibernateTemplate.findByCriteria(criteria);\n return notifications;\n }", "@GET(\"user-notification-content?expand=notification,notification.translations,notification.notificationResultType&sort=-time_from\")\n Call<NotificationsResponse> getNotifications(@Query(\"from\") long from,\n @Query(\"to\") long to,\n @Query(\"notification_result_accepted\") int notification_result_accepted,\n @Query(\"per-page\") double per_page);", "public List<Notification> findMostRecentPopup(long userId);", "private List<String> getNotificationList(String affectedNamespace, RepositoryActionType action) throws RepositoryException {\n\t\tString baseNS = RepositoryNamespaceUtils.normalizeUri( affectedNamespace );\n\t\tSubscriptionEventType eventType = action.getEventType();\n\t\tList<String> userList = new ArrayList<>();\n\t\t\n\t\twhile (baseNS != null) {\n\t\t\taddUsers( userList, getNamespaceSubscriptions( baseNS ), eventType );\n\t\t\t\n\t\t\ttry {\n\t\t\t\tbaseNS = RepositoryNamespaceUtils.getParentNamespace( baseNS, manager );\n\t\t\t\t\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\t// Ignore error and stop searching\n\t\t\t\tbaseNS = null;\n\t\t\t}\n\t\t}\n\t\treturn userList;\n\t}", "@Override\n public List<EventNotification> getList() throws EwpException {\n String sql = \"SELECT * From PFEventNotification\";\n return executeSqlAndGetEntityList(sql);\n }", "List<Notification> getNotifications(String lineID);", "@Nullable\r\n public static JSONArray retrieveNotifications(final Context context)\r\n {\r\n JSONArray content;\r\n\r\n try\r\n {\r\n final RequestFuture<JSONArray> future = RequestFuture.newFuture();\r\n\r\n final SharedPreferencesManager sharedPreferencesManager = new SharedPreferencesManager(context);\r\n\r\n final User user = sharedPreferencesManager.retrieveUser();\r\n\r\n final String fixedURL = Utils.fixUrl(\r\n Properties.SERVER_URL + \":\" + Properties.SERVER_SPRING_PORT + \"/notification/\" + user.getId());\r\n\r\n Log.d(Properties.TAG, \"[REST_CLIENT_SINGLETON] Conectando con: \" + fixedURL + \" para traer las notificaciones del usuario\");\r\n\r\n // Creamos una peticion\r\n final JsonArrayRequest jsonObjReq = new JsonArrayRequest(Request.Method.GET\r\n , fixedURL\r\n , null\r\n , future\r\n , future);\r\n\r\n // La mandamos a la cola de peticiones\r\n VolleySingleton.getInstance(context).addToRequestQueue(jsonObjReq);\r\n Log.d(Properties.TAG, \"[REST_CLIENT_SINGLETON] Petición creada y enviada\");\r\n\r\n try\r\n {\r\n content = future.get(20, TimeUnit.SECONDS);\r\n\r\n } catch (InterruptedException e) {\r\n ExceptionPrinter.printException(\"REST_CLIENT_SINGLETON\", e);\r\n\r\n return null;\r\n }\r\n\r\n // Si content es vacio, es que han fallado todas las conexiones.\r\n if (content == null)\r\n {\r\n Log.e(Properties.TAG, \"[REST_CLIENT_SINGLETON] No se ha recibido ningún dato\");\r\n\r\n return null;\r\n }\r\n\r\n } catch (Exception e) {\r\n ExceptionPrinter.printException(\"REST_CLIENT_SINGLETON\", e);\r\n\r\n return null;\r\n }\r\n\r\n return content;\r\n }", "public List<Notifications> getAll(){\n\t\tList<Notifications> list = null;\n\t\ttry{\n\t\t\tMappingManager mappingManager= new MappingManager(CassandraCluster.getKeyspaceSession(Constants.CASSANDRA_KEYSPACE, Constants.CASSANDRA_PORT, Constants.CASSANDRA_HOSTS));\n\t\t\tNotificationsAccessor notificationsAccessor = mappingManager.createAccessor(NotificationsAccessor.class);\n\t\t\tResult<Notifications> result = notificationsAccessor.getAll();\n\t\t\tif(result != null)\n\t\t\t\tlist = result.all();\n\t\t}catch(Exception e){\n\t\t\tlogger.error(\"Exception Occured in getAll() of NotificationsDao Class\", e);\n\t\t}\n\t\treturn list;\n\t}", "@RequestMapping(value = \"/userid/\", method = RequestMethod.GET)\n\tprivate List<Notification> getByuserId(@RequestParam(\"userid\") String userid) {\n\t\tList<Notification> Notifications = noticontroller.getnotibyuserid(userid);\n\n\t\tif (Notifications == null) {\n\t\t\tthrow new NotFoundException();\n\t\t}\n\t\treturn Notifications;\n\t}", "public List<String> getNotificationList() throws Exception {\r\n ArrayList<String> cache = new ArrayList<String>();\r\n for (DOMFace nr : getChildren(\"notification\", DOMFace.class)) {\r\n cache.add(nr.getAttribute(\"pagekey\"));\r\n }\r\n return cache;\r\n }", "@RequestMapping(value = \"/\", method = RequestMethod.GET)\n\tprivate List<Notification> getAllNotifications() {\n\t\tList<Notification> Notifications = noticontroller.getAllNotifications();\n\n\t\tif (Notifications == null) {\n\t\t\tthrow new NotFoundException();\n\t\t}\n\t\treturn Notifications;\n\t}", "public List<Notifications> fetchNotificationsImpl(String meid){\n\t\tList<Notifications> list = null;\n\t\ttry{\n\t\t\tMappingManager mappingManager= new MappingManager(CassandraCluster.getKeyspaceSession(Constants.CASSANDRA_KEYSPACE, Constants.CASSANDRA_PORT, Constants.CASSANDRA_HOSTS));\n\t\t\tNotificationsAccessor notificationsAccessor = mappingManager.createAccessor(NotificationsAccessor.class);\n\t\t\tResult<Notifications> result = notificationsAccessor.fetchNotifications(meid);\n\t\t\tif(result != null)\n\t\t\t\tlist = result.all();\n\t\t}catch(Exception e){\n\t\t\tlogger.error(\"Exception Occured in fetchNotifications(meid) of NotificationsDao Class\", e);\n\t\t}\n\t\treturn list;\n\t}", "NotificationList getNotifications(String status, String notification_type, String reference, String olderThanId) throws NotificationClientException;", "public JSONArray findByContact(Contact user) throws Exception {\n\n\t\tJSONArray notificationsJSON = new JSONArray();;\n\t\t\n\t\tSession session = SessionFactoryUtil.getInstance().getCurrentSession();\n\t\tTransaction tx = null;\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\ttx = session.beginTransaction();\n\t\t\t\n\t\t\tif (user != null) {\n\t\t\t\t\n\t\t\t\t// Declare DAO\n\t\t\t\tContactnotificationDAO contactnotificationDAO = new ContactnotificationDAO(session);\n\t\t\t\t\n\t\t\t\t// DAO\n\t\t\t\tList<Contactnotification> notifications = contactnotificationDAO.findByContact(user);\n\t\t\t\t\n\t\t\t\t// Parse list notification to array JSON \n\t\t\t\t//\n\t\t\t\tif (ValidateUtil.isNotNull(notifications)) {\n\t\t\t\t\t\n\t\t\t\t\tfor (Contactnotification contactnotification : notifications) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tJSONObject notificationJSON = new JSONObject();\n\t\t\t\t\t\t\n\t\t\t\t\t\tnotificationJSON.put(\"read\", contactnotification.isReadNotify());\n\t\t\t\t\t\tnotificationJSON.put(Contactnotification.IDCONTACTNOTIFICATION, contactnotification.getIdContactNotification());\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (contactnotification.getNotification() != null) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(Constants.TIME_PATTERN_SIMPLE);\n\t\t\t\t\t\t\tnotificationJSON.put(\"message\", dateFormat.format(contactnotification.getNotification().getCreationDate()) + StringPool.BLANK_DASH + contactnotification.getNotification().getSubject());\n\t\t\t\t\t\t\tnotificationJSON.put(\"body\", contactnotification.getNotification().getBody());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdateFormat = new SimpleDateFormat(Constants.TIME_PATTERN);\n\t\t\t\t\t\t\tnotificationJSON.put(\"creationDate\", dateFormat.format(contactnotification.getNotification().getCreationDate()));\n\t\t\t\t\t\t\tnotificationJSON.put(\"sendToMail\", contactnotification.getNotification().getStatus());\n\t\t\t\t\t\t\tnotificationJSON.put(\"messageError\", contactnotification.getNotification().getMessageError() == null ? \"Not information\" : contactnotification.getNotification().getMessageError());\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tLOGGER.debug(\"\\tNotifications: - No join notification\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tnotificationsJSON.add(notificationJSON);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tLOGGER.debug(\"\\tNotifications: - There are no notifications for this user\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\ttx.commit();\n \t\t}\n\t\tcatch (Exception e) {\n\t\t\tif (tx != null) {\n\t\t\t\ttx.rollback();\n\t\t\t}\n\t\t\tthrow e;\n\t\t}\n\t\tfinally {\n\t\t\tSessionFactoryUtil.getInstance().close();\n\t\t}\n\t\t\n\t\treturn notificationsJSON;\n\t}", "public Task<List<Notification>> getAllNotifications() {\n\r\n final TaskCompletionSource<List<Notification>> tcs = new TaskCompletionSource<>();\r\n notificationRef.addListenerForSingleValueEvent(new ValueEventListener() {\r\n @Override\r\n public void onDataChange(DataSnapshot dataSnapshot) {\r\n GenericTypeIndicator<HashMap<String, Notification>> t = new GenericTypeIndicator<HashMap<String, Notification>>() {};\r\n List<Notification> result = new LinkedList<>(dataSnapshot.getValue(t).values());\r\n tcs.setResult(result);\r\n }\r\n\r\n @Override\r\n public void onCancelled(DatabaseError databaseError) {\r\n\r\n }\r\n });\r\n return tcs.getTask();\r\n }", "public ArrayList<Notification> getNotifications() { return this.notifications; }", "@Override\n\tpublic List<NotificationInfo> queryAllNotificationInfos() {\n\t\treturn notificationDao.queryAllNotificationInfos();\n\t}", "@Override\r\n\tpublic List<Users> sendnotificationMail() {\n\t\t\r\n\t\t\r\n\t\t\t\tString sqlSelectQuery = \"select email from libuser where userid=(select userid from libtrx where trx_date<= (LocalDate.now()-14) and trx_status in ('RS','RN','CO'))\"; \r\n\t\t\t\tList<Users> usersList= jdbcTemplate.query(sqlSelectQuery,new BeanPropertyRowMapper(Users.class));\r\n\t\t return usersList;\r\n\t}", "public Map<String, Object> getPopupNotification(long userId);", "List<User> getActivatedUserList();", "java.util.List<com.rpg.framework.database.Protocol.User> \n getUsersList();", "java.util.List<com.rpg.framework.database.Protocol.User> \n getUsersList();", "public List<User> getUserList();", "List<UserInfo> getFriendsOfMine(Integer user_id);", "Collection<NotificationContact> getEmailContactsForUser(String userLoginId) throws UnifyException;", "@Override\n\tpublic List<NotificationInfo> queryOnlineNotificationInfos(\n\t\t\tList<String> onlineUserNames) {\n\t\treturn notificationDao.queryOnlineNotificationInfos(onlineUserNames);\n\t}", "public String listUsers(){\n \tStringBuilder sb = new StringBuilder();\n \tif(users.isEmpty()){\n \t\tsb.append(\"No existing Users yet\\n\");\n \t}else{\n \t\tsb.append(\"Meeting Manager Users:\\n\");\n \t\tfor(User u : users){\n \t\t\tsb.append(\"*\"+u.getEmail()+\" \"+ u.getPassword()+\" \\n\"+u.listInterests()+\"\\n\");\n \t\t}\n \t}\n \treturn sb.toString();\n }", "@Override\n\tpublic List<Notification> findAll() {\n\t\treturn null;\n\t}", "public INotificationColl getNotifications()\n throws OculusException;", "java.util.List<com.heroiclabs.nakama.api.User> \n getUsersList();", "public ArrayList<Notification> getAllNotifications(){\n\n \t\tArrayList<Notification> newListofEntries = new ArrayList<Notification>();\n \t\t\n \t\tCursor cur = this.getAllEntriesNotification();\n \t\t\n \t\tif (this.cursorHasRows(cur)) {\n \t\t\tif (cur.moveToFirst()) {\n \t\t\t\tdo {\n \t\t\t\t\tNotification newObjActivity = new Notification();\n \t\t\t\t\n \t\t\t\t\t\tnewObjActivity.notificationID = (cur.getInt(cur.getColumnIndex(\"notificationID\")));\n \t\t\t\t\t\tnewObjActivity.notificationType = Notification.getNOTIFTYPEValue(cur.getInt(cur.getColumnIndex(\"notificationType\")));\n \t\t\t\t\t\tnewObjActivity.notificationState = Notification.getNOTIFSTATEValue(cur.getInt(cur.getColumnIndex(\"notificationState\")));\n \t\t\t\t\t\tnewObjActivity.ref_id = (cur.getString(cur.getColumnIndex(\"ref_id\")));\n \t\t\t\t\t\tnewObjActivity.ref_type = (cur.getString(cur.getColumnIndex(\"ref_type\")));\n \t\t\t\t\t\tnewObjActivity.coachID = (cur.getInt(cur.getColumnIndex(\"coach_id\")));\n \t\t\t\t\t\tnewObjActivity.coachAvatarURL = (cur.getString(cur.getColumnIndex(\"coach_avatar_url\")));\n \t\t\t\t\t\tnewObjActivity.mealID = (cur.getString(cur.getColumnIndex(\"meal_id\")));\n \t\t\t\t\t\tnewObjActivity.timestamp = AppUtil.toDate(new Timestamp(cur.getLong(cur.getColumnIndex(\"timestamp\"))));\n \t\t\t\t\t\tnewObjActivity.coachMessage = (cur.getString(cur.getColumnIndex(\"message\")));\n \t\t\t\t\t\n \t\t\t\t\t\t//add the meal to the array list\n \t\t\t\t\t\tnewListofEntries.add(newObjActivity);\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} while (cur.moveToNext());\n \t\t\t}\n \t\t}\n \t\t\n \t\tcur.close();\n \t\treturn newListofEntries;\n \t}", "ReadResponseMessage fetchUserMessages(String user);", "List<User> getUsers();", "List<User> getUsers();", "TrackerNotifications getTrackerNotifications(final Integer id);", "@Override\n\tpublic Notification getNotification(int idUser) {\n\t\treturn dao.getNotification(idUser);\n\t}", "public List getUsers(User user);", "ObservableList<User> getUserList();", "List<User> getFollowersForUser(User user);", "public List<TestNotification> GetAll() {\n\t\treturn null;\n\t}", "@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 List<User> getUsers();", "public INotificationColl getNotifications(boolean edit)\n throws OculusException;", "List<KingdomUser> getUsers();", "public Task<List<Notification>> getNotificationsByIds(List<String> notifIds) {\r\n // Starts an asynchronous task to get notifications from database\r\n // caller should call an on success listener to get all users under the specified zipcode\r\n\r\n final TaskCompletionSource<List<Notification>> tcs = new TaskCompletionSource<>();\r\n final List<Notification> notificationList = new LinkedList<>();\r\n\r\n\r\n for (int i = 0; i < notifIds.size(); i++){\r\n String id = notifIds.get(i);\r\n System.out.println(id + \" LLLLLLLLLLLL\");\r\n getNotification(id).addOnSuccessListener(new OnSuccessListener<Notification>() {\r\n @Override\r\n public void onSuccess(Notification notification) {\r\n System.out.println(\"SUCCESS ADDING \" + notification);\r\n notificationList.add(notification);\r\n }\r\n });\r\n\r\n }\r\n tcs.setResult(notificationList);\r\n\r\n System.out.println(\"b4 RETURN \" + notificationList);\r\n return tcs.getTask();\r\n }", "@RequestMapping(\"/profile/listYourtaskuserNotifications\")\n\tpublic ModelAndView listYourtaskuserNotifications(@RequestParam Integer useridKey) {\n\t\tModelAndView mav = new ModelAndView();\n\n\t\tmav.addObject(\"yourtaskuser\", yourtaskuserDAO.findYourtaskuserByPrimaryKey(useridKey));\n\t\tmav.setViewName(\"yourtaskuser/notifications/listNotifications.jsp\");\n\n\t\treturn mav;\n\t}", "public List<Message> getMessages(String user) {\n List<Message> messages = new ArrayList<Message>();\n\n Query query =\n new Query(\"Message\")\n //The setFilter line was here originally but not in the Step 3 provided code\n .setFilter(new Query.FilterPredicate(\"user\", FilterOperator.EQUAL, user))\n .addSort(\"timestamp\", SortDirection.DESCENDING);\n PreparedQuery results = datastore.prepare(query);\n\n return messageHelper(user, messages, query, results);\n }", "public NotificationDetailList getNotificationDetails(\r\n\t\t\tNotificationRequestVO request, String userTimeZone);", "private Set<String> buildNotifiedUsers(final UserFormData formData) {\n\n\t\tfinal Set<String> notifiedUsers = new HashSet<>();\n\t\tif (null != formData.getUserId().getValue()) {\n\t\t\tnotifiedUsers.addAll(this.getUserNotificationIds(formData.getUserId().getValue()));\n\t\t}\n\t\treturn notifiedUsers;\n\t}", "UserFriendsEntry getUserFriendsList(Integer user_id);", "public List<Invoke> getNotification() {\n return getInvoke();\n }", "java.util.List<com.orange.network.game.protocol.model.ZhaJinHuaProtos.PBZJHUserPlayInfo> \n getUsersInfoList();", "List<User> getFollowingForUser(User user);", "private List<Notification> getNotificationsGeneric(Object parameter, String sql) {\n\t\tPreparedStatement stmt = null;\n\t\tResultSet rs = null;\n\t\tConnection connection = getConnection();\n\t\tVector notifications = new Vector();\n\n\t\ttry {\n\t\t\ttry {\n\t\t\t\tstmt = connection.prepareStatement(sql);\n\t\t\t\tBrokerFactory.getLoggingBroker().logDebug(\"sql=\" + (sql));\n\t\t\t\tif (parameter instanceof Timestamp) {\n\t\t\t\t\tstmt.setTimestamp(1, (Timestamp) parameter);\n\t\t\t\t} else {\n\t\t\t\t\tstmt.setString(1, (String) parameter);\n\t\t\t\t}\n\t\t\t\trs = stmt.executeQuery();\n\n\t\t\t\twhile (rs.next()) {\n\t\t\t\t\tString uuid = rs.getString(1);\n\t\t\t\t\tString senderClassname = rs.getString(2);\n\t\t\t\t\tString memberUuid = rs.getString(3);\n\t\t\t\t\tString confirmedBy = rs.getString(4);\n\t\t\t\t\tString subject = rs.getString(5);\n\t\t\t\t\tboolean requiresConfirmation = rs.getBoolean(6);\n\t\t\t\t\tString status = rs.getString(7);\n\t\t\t\t\tif (status == null) {\n\t\t\t\t\t\tstatus = \"\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstatus = status.toLowerCase();\n\t\t\t\t\t}\n\t\t\t\t\tTimestamp time = rs.getTimestamp(8);\n\t\t\t\t\tString owner = rs.getString(9);\n\t\t\t\t\tString parent = rs.getString(10);\n\t\t\t\t\tString[] senderVariables = new String[10];\n\t\t\t\t\tfor (int i = 0; i < 10; i++) {\n\t\t\t\t\t\tsenderVariables[i] = rs.getString(11 + i);\n\t\t\t\t\t}\n\n\t\t\t\t\tMember member = BrokerFactory.getUserMgmtBroker()\n\t\t\t\t\t\t\t.getUserByUuid(memberUuid);\n\t\t\t\t\tif (member == null)\n\t\t\t\t\t\tmember = BrokerFactory.getGroupMgmtBroker()\n\t\t\t\t\t\t\t\t.getGroupByUuid(memberUuid);\n\n\t\t\t\t\tNotification notification = new Notification(parent,\n\t\t\t\t\t\t\tmember, null, subject, new NotificationMessage[0]);\n\t\t\t\t\tnotification.setAutocommit(false);\n\t\t\t\t\tnotification.setUuid(uuid);\n\t\t\t\t\tnotification.setTime(new java.util.Date(time.getTime()));\n\t\t\t\t\tnotification.setParentUuid(parent);\n\t\t\t\t\tnotification.setOwner(owner);\n\n\t\t\t\t\tif (status == null) {\n\t\t\t\t\t\tnotification.setStatus(Notification.NORMAL);\n\t\t\t\t\t} else if (status.equals(\"expired\")) {\n\t\t\t\t\t\tnotification.setStatus(Notification.EXPIRED);\n\t\t\t\t\t} else if (status.equals(\"confirmed\")) {\n\t\t\t\t\t\tnotification.setStatus(Notification.CONFIRMED);\n\t\t\t\t\t} else if (status.equals(\"pending\")) {\n\t\t\t\t\t\tnotification.setStatus(Notification.PENDING);\n\t\t\t\t\t} else if (status.equals(\"onhold\")) {\n\t\t\t\t\t\tnotification.setStatus(Notification.ONHOLD);\n\t\t\t\t\t} else if (confirmedBy != null) {\n\t\t\t\t\t\tnotification.setStatus(Notification.CONFIRMED);\n\t\t\t\t\t} else if (requiresConfirmation) {\n\t\t\t\t\t\tnotification.setStatus(Notification.PENDING);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnotification.setStatus(Notification.NORMAL);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Load the sender\n\t\t\t\t\ttry {\n\t\t\t\t\t\tNotificationSender sender = (NotificationSender) Class\n\t\t\t\t\t\t\t\t.forName(senderClassname).newInstance();\n\t\t\t\t\t\tfor (int i = 0; i < 10; i++) {\n\t\t\t\t\t\t\tsender.addVariable(i + 1, senderVariables[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnotification.setSender(sender);\n\t\t\t\t\t} catch (InstantiationException e1) {\n\t\t\t\t\t\tBrokerFactory.getLoggingBroker().logError(e1);\n\t\t\t\t\t} catch (IllegalAccessException e1) {\n\t\t\t\t\t\tBrokerFactory.getLoggingBroker().logError(e1);\n\t\t\t\t\t} catch (ClassNotFoundException e1) {\n\t\t\t\t\t\tBrokerFactory.getLoggingBroker().logError(e1);\n\t\t\t\t\t}\n\n\t\t\t\t\tnotifications.addElement(notification);\n\n\t\t\t\t\t// Load the options\n\t\t\t\t\tPreparedStatement stmt2 = null;\n\t\t\t\t\tResultSet rs2 = null;\n\t\t\t\t\tString sql2 = \"SELECT optionname FROM notificationoptions WHERE notification=?\";\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tstmt2 = connection.prepareStatement(sql2);\n\t\t\t\t\t\tBrokerFactory.getLoggingBroker().logDebug(\n\t\t\t\t\t\t\t\t\"sql=\" + (sql2));\n\t\t\t\t\t\tstmt2.setString(1, uuid);\n\t\t\t\t\t\trs2 = stmt2.executeQuery();\n\n\t\t\t\t\t\twhile (rs2.next()) {\n\t\t\t\t\t\t\tnotification.addOption(rs.getString(1));\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (SQLException e2) {\n\t\t\t\t\t\tBrokerFactory.getLoggingBroker().logError(e2);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif (stmt2 != null)\n\t\t\t\t\t\t\t\tstmt2.close();\n\t\t\t\t\t\t\tif (rs2 != null)\n\t\t\t\t\t\t\t\trs2.close();\n\t\t\t\t\t\t} catch (SQLException e3) {\n\t\t\t\t\t\t\tBrokerFactory.getLoggingBroker().logError(e3);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Load the messages\n\t\t\t\t\tList<NotificationMessage> messages = getNotificationMessages(notification);\n\t\t\t\t\tfor (NotificationMessage message: messages) {\n\t\t\t\t\t\tnotification.addMessage(message, false);\n\t\t\t\t\t}\n\t\t\t\t\t// Load the providers\n\t\t\t\t\tsql2 = \"SELECT uuid,classname,status FROM notificationprovider WHERE notification=?\";\n\t\t\t\t\ttry {\n\t\t\t\t\t\tstmt2 = connection.prepareStatement(sql2);\n\t\t\t\t\t\tBrokerFactory.getLoggingBroker().logDebug(\n\t\t\t\t\t\t\t\t\"sql=\" + (sql2));\n\t\t\t\t\t\tstmt2.setString(1, uuid);\n\t\t\t\t\t\trs2 = stmt2.executeQuery();\n\n\t\t\t\t\t\twhile (rs2.next()) {\n\t\t\t\t\t\t\tString providerUuid = rs2.getString(1);\n\t\t\t\t\t\t\tString classname = rs2.getString(2);\n\t\t\t\t\t\t\tString statusOfSend = rs2.getString(3);\n\t\t\t\t\t\t\tPreparedStatement stmt3 = null;\n\t\t\t\t\t\t\tResultSet rs3 = null;\n\t\t\t\t\t\t\tString sql3 = \"SELECT name,value FROM notificationproviderinfo WHERE provider=?\";\n\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tstmt3 = connection.prepareStatement(sql3);\n\t\t\t\t\t\t\t\tBrokerFactory.getLoggingBroker().logDebug(\n\t\t\t\t\t\t\t\t\t\t\"sql=\" + (sql3));\n\t\t\t\t\t\t\t\tstmt3.setString(1, providerUuid);\n\t\t\t\t\t\t\t\trs3 = stmt3.executeQuery();\n\n\t\t\t\t\t\t\t\tHashtable params = new Hashtable();\n\t\t\t\t\t\t\t\twhile (rs3.next()) {\n\t\t\t\t\t\t\t\t\tString name = rs3.getString(1);\n\t\t\t\t\t\t\t\t\tif (name == null)\n\t\t\t\t\t\t\t\t\t\tname = \"\";\n\t\t\t\t\t\t\t\t\tString value = rs3.getString(2);\n\t\t\t\t\t\t\t\t\tif (value == null)\n\t\t\t\t\t\t\t\t\t\tvalue = \"\";\n\t\t\t\t\t\t\t\t\tparams.put(name, value);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tNotificationProvider provider = (NotificationProvider) (Class\n\t\t\t\t\t\t\t\t\t\t.forName(classname).newInstance());\n\t\t\t\t\t\t\t\tprovider.init(params);\n\t\t\t\t\t\t\t\tprovider.setStatusOfSend(notification,\n\t\t\t\t\t\t\t\t\t\tstatusOfSend);\n\t\t\t\t\t\t\t\tnotification.addNotificationProvider(provider);\n\t\t\t\t\t\t\t} catch (SQLException e3) {\n\t\t\t\t\t\t\t\tBrokerFactory.getLoggingBroker().logError(e3);\n\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tif (stmt3 != null)\n\t\t\t\t\t\t\t\t\t\tstmt3.close();\n\t\t\t\t\t\t\t\t\tif (rs3 != null)\n\t\t\t\t\t\t\t\t\t\trs3.close();\n\t\t\t\t\t\t\t\t} catch (SQLException e3) {\n\t\t\t\t\t\t\t\t\tBrokerFactory.getLoggingBroker().logError(\n\t\t\t\t\t\t\t\t\t\t\te3);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} catch (SQLException e2) {\n\t\t\t\t\t\tBrokerFactory.getLoggingBroker().logError(e2);\n\t\t\t\t\t} catch (NotificationException e2) {\n\t\t\t\t\t\tBrokerFactory.getLoggingBroker().logError(e2);\n\t\t\t\t\t} catch (ClassNotFoundException e2) {\n\t\t\t\t\t\tBrokerFactory.getLoggingBroker().logError(e2);\n\t\t\t\t\t} catch (InstantiationException e2) {\n\t\t\t\t\t\tBrokerFactory.getLoggingBroker().logError(e2);\n\t\t\t\t\t} catch (IllegalAccessException e2) {\n\t\t\t\t\t\tBrokerFactory.getLoggingBroker().logError(e2);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif (stmt2 != null)\n\t\t\t\t\t\t\t\tstmt2.close();\n\t\t\t\t\t\t\tif (rs2 != null)\n\t\t\t\t\t\t\t\trs2.close();\n\t\t\t\t\t\t} catch (SQLException e3) {\n\t\t\t\t\t\t\tBrokerFactory.getLoggingBroker().logError(e3);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tnotification.setAutocommit(true);\n\t\t\t\t}\n\t\t\t} catch (SQLException e) {\n\t\t\t\tBrokerFactory.getLoggingBroker().logError(e);\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (stmt != null)\n\t\t\t\t\t\tstmt.close();\n\t\t\t\t\tif (rs != null)\n\t\t\t\t\t\trs.close();\n\t\t\t\t} catch (SQLException e1) {\n\t\t\t\t\tBrokerFactory.getLoggingBroker().logError(e1);\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (connection != null)\n\t\t\t\t\tconnection.close();\n\t\t\t} catch (SQLException e1) {\n\t\t\t\tBrokerFactory.getLoggingBroker().logError(e1);\n\t\t\t}\n\n\t\t}\n\t\treturn notifications;\n\t}", "public Collection<Long> findUidsByNotification(final IndexNotification notification) {\n\t\tthrow new UnsupportedOperationException(\"not supported\");\n\t}", "public List<Borrow> getUsersToNotify() {\n\t\tList<Borrow> borrows = new ArrayList<Borrow>();\n\t\ttry (Connection conn = DriverManager.getConnection(this.hostUrl,this.username,this.password)) {\n\t\t System.out.println(\"Database connected!\");\n\t\t\tStatement st = null;\n\t\t\ttry {\n\t\t\t\tst = conn.createStatement();\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t ResultSet rs = null;\n\t String sql = \"SELECT u.name as user, u.mobile as mobile, b.name as book FROM borrows br \" + \n\t \t\t\" LEFT JOIN users u ON u.id=br.user_id \" + \n\t \t\t\" LEFT JOIN books b ON b.id=br.book_id \" + \n\t \t\t\" WHERE br.return_on is Null AND br.issue_date >= DATE(NOW()) - INTERVAL 2 DAY\";\n\t try {\n\t\t\t\trs = st.executeQuery( sql );\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\twhile (rs.next()) { \n\t\t\t\t\tBorrow borrow = new Borrow();\n\t\t\t\t\tborrow.setUser_name(rs.getString(1));\n\t\t\t\t\tborrow.setMobile(rs.getLong(2));\n\t\t\t\t\tborrow.setBook_name(rs.getString(3));\n\t\t\t\t\tborrows.add(borrow);\n\t\t\t\t }\n\t\t\t conn.close(); \n\t\t\t} catch (NumberFormatException | SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t\treturn borrows;\n\t}", "private void notifyUser(List<String> result) {\r\n\t\t\tif(Util.getProperty(getApplicationContext(),\"notificationTimeChanged\",\"\").equals(\"true\") \r\n\t\t\t\t\t|| !notifiedToday())\r\n\t\t\t{\r\n\t\t\t\tUtil.setProperty(getApplicationContext(), \"notificationTimeChanged\", \"false\");\r\n\t\t\t\tif(result.size() > 0){\r\n\t\t\t\t\tint itemsDue = result.size();\r\n\t\t\t\t\tStringBuffer notificationText = new StringBuffer();\r\n\t\t\t\t\tfor(int i=0; i<itemsDue; i++){\r\n\t\t\t\t\t\tif(i!=0)\r\n\t\t\t\t\t\t\tnotificationText.append(\", \");\r\n\t\t\t\t\t\tnotificationText.append(result.get(i));\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tContext context = getApplicationContext();\r\n\t\t\t\t\tNotificationManager nm = (NotificationManager)context.getSystemService(NOTIFICATION_SERVICE);\r\n\t\t\t\t\tIntent notificationIntent = new Intent(context,ReminderActivity.class);\r\n\t\t\t\t\tPendingIntent pi = PendingIntent.getActivity(context, 0, notificationIntent,PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_ONE_SHOT);\r\n\t\t\t\t\tNotification n = new Notification.Builder(context)\r\n\t\t\t\t\t.setContentTitle(String.valueOf(itemsDue) + \" Items Due\")\r\n\t\t\t\t\t.setContentText(notificationText.toString())\r\n\t\t\t\t\t.setSmallIcon(R.drawable.ic_launcher)\r\n\t\t\t\t\t//.setLargeIcon(R.drawable.ic_basket)\r\n\t\t\t\t\t.setContentIntent(pi)\r\n\t\t\t\t\t.build();\t \r\n\t\t\t\t\tnm.notify(1, n);\r\n\t\t\t\t}\r\n\t\t\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"dd-MMM-yyyy\",Locale.US);\r\n\t\t\t\tUtil.setProperty(getApplicationContext(), \"ServiceLastRanOn\",formatter.format(new Date()));\r\n\t\t\t}\r\n\t\t}", "public String list(User user) {\n\t\treturn user.getMailbox().list();\n\t}", "public List<Map> getWatchListBasedOnUserName(String userName);", "public List getAllUsers();", "@SuppressWarnings(\"unchecked\")\n\tpublic List<Notification> getAllNotificationsByEvent(Event event) {\n\t\tEntityManager manager = Resources.getEntityManager();\n\t\tList<Notification> notifications = manager.createQuery(\"SELECT x FROM Notification x WHERE x.event.id = :id\")\n\t\t\t\t.setParameter(\"id\", event.getId()).getResultList();\n\t\treturn notifications;\n\t}", "private Set<String> buildNotifiedUsers(final ValidateCpsFormData formData) {\n\n\t\tfinal Set<String> notifiedUsers = new HashSet<>();\n\t\tif (null != formData.getUserId().getValue()) {\n\t\t\tnotifiedUsers.addAll(this.getUserNotificationIds(formData.getUserId().getValue()));\n\t\t}\n\t\treturn notifiedUsers;\n\t}", "@Override\n\tpublic List<Map<String, Object>> getUserList() {\n\t\tList<Map<String, Object>> list = new ArrayList<Map<String,Object>>();\n\t\tString sql = \"select * from tp_users where userType = 2\";\n\t\tMap<String, Object> map = new HashMap<String, Object>();\n\t\tlist = joaSimpleDao.queryForList(sql, map);\n\t\treturn list;\n\t}", "TrackerNotificationMessages getTrackerNotificationMessages(final Integer id);", "List<NotificationEntity> findUnseenByLogin(String login);", "public String[] listUsers();", "List<Friend> getPendingRequests(String email);", "public long[] getNotifications(long project, long notificationType) throws ResourceManagementException {\r\n ArgumentChecker.checkNotificationsToBeRetrieved(project, notificationType);\r\n return this.port.getNotifications(project, notificationType);\r\n }", "private void sendNotifications(String userMessage) {\n if (this.notifications == null) {\n this.notifications = new ConcurrentLinkedQueue<Notification>();\n }\n \n // not sure if the synchronize is needed here, let's see ...\n // synchronized (notifications) {\n if (!this.notifications.isEmpty()) {\n ObjectName source = getObjectName();\n Notification n = new Notification(NotificationType.setOfNotifications, source, counter++,\n userMessage);\n n.setUserData(this.notifications);\n super.sendNotification(n);\n this.notifications.clear();\n // }\n }\n }", "public void getRecentUsers(View view){\n SharedPreferences sharedPref = getContext().getSharedPreferences(\"recentVisited\", Context.MODE_PRIVATE);\n int size = sharedPref.getInt(\"size\", 0);\n\n // clears the variables.\n userName.clear();\n uid.clear();\n for (int i = size+1; i >0 ; i--) {\n String name= sharedPref.getString(\"name_\"+i,\"deleted\");\n String userId= sharedPref.getString(\"uid_\"+i,\"deleted\");\n if (!Objects.equals(name, \"deleted\")){\n userName.add(name);\n uid.add(userId);\n }\n\n }\n\n setList(view);\n }", "public List<User> list();", "public List<User> getUserList()\r\n\t{\r\n\t//\tGet the user list\r\n\t//\r\n\t\treturn identificationService.loadUserList();\r\n\t}", "public Collection<String> getNotifyList() {\n Set<String> result;\n String list = getDbProperties().getProperty(Constants.NOTIFY_LIST);\n if (list != null) {\n result = Arrays.stream(list.split(\"[, ]+\"))\n .map(String::trim)\n .collect(Collectors.toSet());\n } else {\n result = new HashSet<>();\n }\n return result;\n }", "ReadResponseMessage fetchMessagesFromUser(String user);", "java.util.List<? extends com.rpg.framework.database.Protocol.UserOrBuilder> \n getUsersOrBuilderList();", "java.util.List<? extends com.rpg.framework.database.Protocol.UserOrBuilder> \n getUsersOrBuilderList();", "List<CandidatePush> getPushUser(Map<String,Object> param);", "List<NotificationEntity> findUnseenRecentByLogin(String login, Date date);", "public void readNotification()\n {\n userFan.readNotification();\n }", "private static List<StaffNotification> getStaffToNotify(FoodOrder foodOrder) {\n EntityManager entityManager = DatabaseManager.getInstance().getEntityManager();\n List<StaffNotification> staffNotifications = null;\n OrderStatus orderStatus = foodOrder.getStatus();\n // If the order has just been cooked we want the relevant waiter.\n if (orderStatus == OrderStatus.COOKING) {\n\n staffNotifications = entityManager\n .createQuery(\"from StaffNotification staffNotification \"\n + \"where staffNotification.staff.department = :department\", StaffNotification.class)\n .setParameter(\"department\", Department.KITCHEN).getResultList();\n } else if (orderStatus == OrderStatus.READY_TO_DELIVER | orderStatus == OrderStatus\n .READY_TO_CONFIRM) {\n // get a list of waiters on a table.\n staffNotifications = entityManager\n .createQuery(\"from StaffNotification staffNotification\"\n + \" where staffNotification.staff.department = :department and staffNotification.staff.employeeNumber = :serverNumber\",\n StaffNotification.class).setParameter(\"department\", Department.WAITER)\n .setParameter(\"serverNumber\",\n foodOrder.getTransaction().getRestaurantTableStaff().getStaff().getEmployeeNumber())\n .getResultList();\n // If the order has just been confirmed we want to tell the kitchen.\n }\n entityManager.close();\n\n return staffNotifications;\n }", "public Map<String,ClientHandler> getUserList()\n {\n return userList;\n }", "List<MessageResource> getMensajes(Integer userID);", "public Notifications fetchNotificationsImpl(String meid, int notificationType){\n\t\tNotifications list = null;\n\t\ttry{\n\t\t\tMappingManager mappingManager= new MappingManager(CassandraCluster.getKeyspaceSession(Constants.CASSANDRA_KEYSPACE, Constants.CASSANDRA_PORT, Constants.CASSANDRA_HOSTS));\n\t\t\tNotificationsAccessor notificationsAccessor = mappingManager.createAccessor(NotificationsAccessor.class);\n\t\t\tResult<Notifications> result = notificationsAccessor.fetchNotifications(meid, notificationType);\n\t\t\tif(result != null)\n\t\t\t\tlist = result.one();\n\t\t}catch(Exception e){\n\t\t\tlogger.error(\"Exception Occured in fetchNotifications(meid, notificationType) of NotificationsDao Class\", e);\n\t\t}\n\t\treturn list;\n\t}", "@Override\n public List<MessageEntity> fetchMessages(UserEntity userEntity) {\n Query query = new Query();\n return mongoTemplate.find(query, MessageEntity.class);\n }", "public List<IUser> getUsers();", "public List<User> getAllUsers();", "public List<TestNotification> GetByStatus() {\n\t\treturn null;\n\t}", "public List<Utilizator> listUsers();", "public static List<VaadinNotification> get(Type type, WebDriver driver) {\n List<WebElement> notifications = driver.findElements(By\n .className(getClassName(type)));\n List<VaadinNotification> vaadinNotification = new ArrayList<VaadinNotification>();\n for (WebElement notification : notifications) {\n String notificationCaption = null;\n try {\n notificationCaption = notification\n .findElement(By.tagName(\"h1\")).getText();\n } catch (NoSuchElementException e) {\n // This happens if there is no caption\n }\n String notificationDescription = null;\n try {\n notificationDescription = notification.findElement(\n By.tagName(\"p\")).getText();\n } catch (NoSuchElementException e) {\n // This happens if there is no description\n }\n vaadinNotification.add(new VaadinNotification(notificationCaption,\n notificationDescription, notification));\n }\n return vaadinNotification;\n\n }", "ObservableList<Task> getCurrentUserTaskList();", "public static ArrayList<Userdatas> getAllUsersList() {\n\t\tRequestContent rp = new RequestContent();\n\t\trp.type = RequestType.GET_ALL_USERS;\n\t\tReceiveContent rpp = sendReceive(rp);\n\t\tArrayList<Userdatas> anagList = (ArrayList<Userdatas>) rpp.parameters[0];\n\t\treturn anagList;\n\t}" ]
[ "0.83482605", "0.7645144", "0.7543326", "0.75283366", "0.7455713", "0.71166056", "0.6998543", "0.69447243", "0.69232994", "0.6833496", "0.6832332", "0.6795703", "0.6757781", "0.6708297", "0.6689057", "0.6683438", "0.66134626", "0.65982795", "0.6559574", "0.6545589", "0.6538758", "0.6526904", "0.65213054", "0.65113723", "0.64732814", "0.6468002", "0.64461565", "0.6438079", "0.6365033", "0.6360735", "0.6360094", "0.6355232", "0.6343226", "0.6299062", "0.62901247", "0.62791544", "0.6270793", "0.6261988", "0.6245448", "0.62347615", "0.62346506", "0.6231652", "0.6231652", "0.62075895", "0.6194713", "0.61850154", "0.6174754", "0.616569", "0.6154706", "0.61308575", "0.6121126", "0.609741", "0.608903", "0.6088851", "0.6083638", "0.6075569", "0.6061111", "0.60606605", "0.605978", "0.60570055", "0.6047194", "0.6046148", "0.60427904", "0.6017506", "0.5996266", "0.5994213", "0.59932125", "0.59921205", "0.5983182", "0.5981914", "0.59813726", "0.5978465", "0.59727156", "0.5963642", "0.59619004", "0.5951971", "0.5944916", "0.5943436", "0.59410614", "0.5935296", "0.5927229", "0.5917707", "0.5906902", "0.5905422", "0.59045404", "0.59044987", "0.5903931", "0.589379", "0.58821857", "0.587822", "0.5878159", "0.5877535", "0.5872952", "0.58724374", "0.5869612", "0.5869608", "0.5866158", "0.5864719", "0.5856099", "0.58557653" ]
0.7377069
5
return unread notification count of user
public Integer getNotificationCount(Long userId) { if (unreadNotifications.containsKey(userId)) { return unreadNotifications.get(userId); } else { Integer count = notificationDao.countUnreadNotifications(userId); unreadNotifications.put(userId, count); return count; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getUnreadChatMessageCount();", "public int getUnreadMessagesCount() {\n if (pendingIncomingMessages != null){\n\n /*\n * Return the size of the cache\n */\n return pendingIncomingMessages.size();\n\n }\n\n /*\n * Empty cache return 0\n */\n return 0;\n }", "public int getUnreadChatMessageCountFromActiveLocals();", "@PreAuthorize(\"hasAnyAuthority(T(com.meetup.utils.Role).ADMIN, \"\n + \"T(com.meetup.utils.Role).SPEAKER, \"\n + \"T(com.meetup.utils.Role).LISTENER)\")\n @GetMapping(value = \"/user/notifications/count\")\n public ResponseEntity<Integer> countNotifications(\n @CookieValue(\"token\") final String token) {\n Integer userId = loginValidatorService.extractId(token);\n return ok(notificationService.countUnread(userId));\n }", "public static int getNotificationsUsersCount()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException {\n\t\treturn getService().getNotificationsUsersCount();\n\t}", "@Query(value = \"{'read': {'$exists' : false }}\", count = true)\n public int getUnreadCount();", "public int getUnreadMessCount() {\n return protocol.getUnreadMessCount();\n }", "String getNotificationCount(Long userId) throws JsonProcessingException;", "public String getNotificationCount() {\n\t\treturn element(\"li_notificationCount\").getText();\n\t}", "@Override\r\n\tpublic Integer getOfflineMsgCount(String userName) {\n\t\treturn null;\r\n\t}", "public int getUnreadBeforeNotification() {\n return unreadBeforeNotification;\n }", "int getUserCount();", "int getUserCount();", "public int getUnreadChatMessageCountFromLocal(Address address);", "int getMessagesCount();", "int getMessagesCount();", "int getMessagesCount();", "public int getUnreadCount(Player player) {\n QuestionInstance instance = this.getInstance(player);\n if (this.getCbx()) {\n return instance.getActive() && !instance.getValidated() ? 1 : 0;\n } else {\n return instance.getActive() && !instance.getValidated() && instance.getReplies(player).isEmpty() ? 1 : 0;\n }\n }", "public int getTotalNotifications(){\r\n\t\tif(_debug) Log.v(_context, \"NotificationViewFlipper.getTotalNotifications()\");\r\n\t\treturn this.getChildCount();\r\n\t}", "public int getWallItemsCount(String userUuid, ProfilePrivacy privacy);", "public int getWallItemsCount(String userUuid);", "@Sql(\"SELECT count(m.id) FROM message m WHERE NOT CASEWHEN(m.user_id = 0, false, (SELECT iu.ignored FROM user iu WHERE iu.id = m.user_id)) AND (SELECT tc.ignored FROM topic_cache tc WHERE tc.topic_id = CASEWHEN(m.topic_id = 0, m.id, m.topic_id)) = false AND m.user_id <> m.parent_user_id AND m.parent_user_id = ? AND m.forum_id > 0\")\r\n int getUserReplies(int ownId) throws StorageException;", "boolean hasUnread(@NotNull final String userId);", "public static int getUnreadMessageCount(final Context context) {\n int result = 0;\n for (Conversation conversation : AxoMessaging.getInstance(context).getConversations().list()) {\n if (conversation != null) {\n result += conversation.getUnreadMessageCount();\n }\n }\n return result;\n }", "public static int getUnseenCountAlerts() {\r\n\t\tint count = 0;\r\n\t\ttry {\r\n\t\t\tConnection con = connection.Connect.getConnection();\r\n\t\t\tString query = \"SELECT COUNT(is_seen) from alerts where is_seen = 0\";\r\n\t\t\tPreparedStatement ps = con.prepareStatement(query);\r\n\t\t\tResultSet rs = ps.executeQuery();\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tcount = rs.getInt(1);\r\n\t\t\t}\r\n\t\t} catch (SQLException ex) {\r\n\t\t\tlogger.error(\"\", ex);\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t\treturn count;\r\n\t}", "long getNumberOfUnreadMessagesForGivenDate(String stringCurrentDate);", "int getMessageCount();", "int getMessageCount();", "int getMessageCount();", "int getMessageCount();", "int getMessageCount();", "int getUsersCount();", "int getUsersCount();", "int getUsersCount();", "public int getUserCount() {\n\t\t\treturn 7;\n\t\t}", "int getDeliveredCount();", "long getReceivedEventsCount();", "int getSeenInfoCount();", "public int size() {\n return inAppNotifications.size();\n }", "public int getDataMessagesReceived() {\n\t\tint contador = 0;\n\t\tfor (Contacto c : currentUser.getContacts()) {\n\t\t\tcontador += (c.getMessages().size() - c.getMsgsByUser(currentUser.getId()));\n\t\t}\n\t\treturn contador;\n\t}", "public int getUnReadMessagesCountInGroupChat(String unique_id) {\n String countQuery = \"SELECT * FROM GROUPCHAT WHERE status = 'delivered' AND group_unique_id = '\"+ unique_id +\"'\";\r\n SQLiteDatabase db = this.getReadableDatabase();\r\n Cursor cursor = db.rawQuery(countQuery, null);\r\n int rowCount = cursor.getCount();\r\n db.close();\r\n cursor.close();\r\n\r\n // return row count\r\n return rowCount;\r\n }", "Integer getNumberOfUserActivity() {\n return daoInterface.getNumberOfUserActivity();\n }", "int getMsgCount();", "int getMsgCount();", "public int getUnreadMsgCountTotal() {\n int unreadMsgCountTotal = 0;\n int chatroomUnreadMsgCount = 0;\n unreadMsgCountTotal = EMClient.getInstance().chatManager().getUnreadMsgsCount();\n for (EMConversation conversation : EMClient.getInstance().chatManager().getAllConversations().values()) {\n if (conversation.getType() == EMConversationType.ChatRoom)\n chatroomUnreadMsgCount = chatroomUnreadMsgCount + conversation.getUnreadMsgCount();\n }\n return unreadMsgCountTotal - chatroomUnreadMsgCount;\n }", "public int getUserCount() {\n return instance.getUserCount();\n }", "int getMessageIdCount();", "@Override\r\n\t\tpublic int getCount() {\n\t\t\tif (!allNotifications.isEmpty()) {\r\n\t\t\t\treturn allNotifications.size();\r\n\t\t\t}\r\n\t\t\treturn 1;\r\n\t\t}", "public long countNewPopup(long userId);", "public int getSystemMessageCount(){\n\t\treturn iMessageCount;\n\t}", "public int getUserCount() {\n return user_.size();\n }", "public int getUserCount()\n\t{\n\t\tint ret = -1;\n\t\ttry {\n\t\t\tret = Integer.parseInt(userCount.getTextContent());\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tlogger.warn(\"Could not parse user-count field\");\n\t\t}\n\t\treturn ret;\n\t}", "public static int getUnseenCountAlertsForAdmin() {\r\n\t\tSystem.out.println(\"CustomerBAL.getUnseenCountAlertsForAdmin()\");\r\n\t\tint count = 0;\r\n\t\tConnection con = connection.Connect.getConnection();\r\n\t\ttry {\r\n\r\n\t\t\t/*\r\n\t\t\t * String query =\r\n\t\t\t * \"SELECT COUNT(msg_seen) FROM appliance_message m JOIN appliance ap ON m.msg_from = ap.appliance_GSMno WHERE msg_seen = 0\"\r\n\t\t\t * ; ps2 = (PreparedStatement) con2.prepareStatement(query); rs2 =\r\n\t\t\t * ps2.executeQuery();\r\n\t\t\t */\r\n\r\n\t\t\t// Begin Stored Procedure -- Jeevan\r\n\t\t\tCallableStatement prepareCall = con\r\n\t\t\t\t\t.prepareCall(\"{CALL get_unseen_count_alerts_for_admin()}\");\r\n\t\t\tResultSet resultSet = prepareCall.executeQuery();\r\n\t\t\t// End Stored Procedure\r\n\r\n\t\t\twhile (resultSet.next()) {\r\n\t\t\t\tcount = resultSet.getInt(1);\r\n\t\t\t}\r\n\t\t\tresultSet.close();\r\n\t\t\tprepareCall.close();\r\n\t\t\t// con.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\tlogger.error(\"\", e);\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn count;\r\n\t}", "public int countUsers()\n {\n int nbUser = 0;\n pw.println(12);\n try\n {\n nbUser = Integer.parseInt(bis.readLine()) ;\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n return nbUser ;\n }", "Integer loadUserCount();", "public static int getNumberOfUnreadIssues(CommandSender sender) {\r\n\t\tint returned = 0;\r\n\t\tfor (CrashReport c : errors) {\r\n\t\t\tif (!c.readers.contains(sender.getName())) {\r\n\t\t\t\treturned++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn returned;\r\n\t}", "public Integer getMessageCount() {\r\n return messageCount;\r\n }", "public synchronized int threadUnreadReplyCount(String threadID) {\n \tfinal Query q = mDB.query();\n q.constrain(BoardReplyLink.class);\n q.descend(\"mBoard\").constrain(this).identity();\n q.descend(\"mThreadID\").constrain(threadID);\n q.descend(\"mWasRead\").constrain(false);\n \n return q.execute().size();\n }", "public long getUserCount() throws UserManagementException;", "public void syncUnreadReportCount(){\n unReadReports = reportRepository.getUnreadCount();\n }", "public static int countUnseenMessagesFromAppliance() {\r\n\t\t// System.out.println(\"CustomerBAL.countUnseenMessagesFromAppliance()\");\r\n\t\tint count = 0;\r\n\r\n\t\ttry (Connection connection = Connect.getConnection();) {\r\n\t\t\tif (connection != null) {\r\n\t\t\t\tCallableStatement prepareCall = connection\r\n\t\t\t\t\t\t.prepareCall(\"{CALL count_unseen_status_messages_from_appliance()}\");\r\n\t\t\t\tResultSet resultSet = prepareCall.executeQuery();\r\n\t\t\t\t// End Stored Procedure\r\n\t\t\t\twhile (resultSet.next()) {\r\n\t\t\t\t\tcount = resultSet.getInt(1);\r\n\t\t\t\t}\r\n\t\t\t\t// rs.close();\r\n\t\t\t\t// con.close();\r\n\t\t\t\tconnection.close();\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\tlogger.error(\"\", e);\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn count;\r\n\r\n\t}", "public int getUnreadMessageNumber() {\n return mUnreadMessageNum;\n }", "public static int getUnreadNumber(Context context, int type) {\n\t\tint retCount = 0;\n\t\tString selection = RecordlistTable.READ + \" = 0 AND TYPE = \" + type;\n\t\tCursor cursor = context.getContentResolver().query(RECORDLIST_URI, null, selection, null, null);\n\t\tif(cursor != null) {\n\t\t\ttry {\n\t\t\t\tretCount = cursor.getCount();\n\t\t\t} finally {\n\t\t\t\tcursor.close();\n\t\t\t}\n\t\t}\n\t\treturn retCount;\n\t}", "public int getCountOfMostUpcomingUserEvents(long userId);", "public long getMessageReceivedCount() {\n return messageMetrics.received.get();\n }", "int getFriendCount();", "int getFriendCount();", "@Transactional\r\n\tpublic Integer countUserss() {\r\n\t\treturn ((Long) usersDAO.createQuerySingleResult(\"select count(o) from Users o\").getSingleResult()).intValue();\r\n\t}", "long getUnjoinedEventsCount();", "public int getNumberOfNewerOnUserActivities(Identity ownerIdentity, Long sinceTime);", "public int getDataMessagesSent() {\n\t\tint contador = 0;\n\t\tfor (Contacto c : currentUser.getContacts()) {\n\t\t\tcontador += (c.getMsgsByUser(currentUser.getId()));\n\t\t}\n\t\treturn contador;\n\t}", "public int getPublishMessageTotalRows(int userid){\r\n\t\tif(userid==0){\r\n\t\t\treturn baseDAO.queryFactory(new RealActivity(), \"t_realactivity\", \" \").size();\r\n\t\t}else{\r\n\t\t\treturn baseDAO.queryFactory(new RealActivity(), \"t_realactivity\", \" and userId=\"+userid).size();\r\n\t\t}\r\n\t\t/*return ALLPageNum;*/\r\n\t}", "public int getTotalMessageCount() {\n Query query = new Query(\"Message\");\n PreparedQuery results = datastore.prepare(query);\n return results.countEntities(FetchOptions.Builder.withLimit(1000));\n }", "public synchronized int messageCount() {\n \tfinal Query q = mDB.query();\n q.constrain(MessageReference.class);\n q.descend(\"mBoard\").constrain(this).identity();\n return q.execute().size();\n }", "int getMailCount() {\n\t\treturn mail_count[mailbox_number];\n\t}", "@Override\r\n\tpublic int memberCount() {\n\t\treturn sqlSession.selectOne(NAMESPACE + \".member_count_user\");\r\n\t}", "public int dbSyncCount()\n {\n int count = 0;\n String selectQuery = \"SELECT * FROM UsersTable where udpateStatus = '\"+\"no\"+\"'\";\n SQLiteDatabase database = this.getWritableDatabase();\n Cursor cursor = database.rawQuery(selectQuery, null);\n count = cursor.getCount();\n database.close();\n return count;\n }", "public int getNumAnnouncements(){\n return message.length;\n }", "private void updateBadge() {\n badgeDrawable.setNumber((inbox == null) ? 0 : inbox.getCountUnread());\n }", "public int getNumberOfUpdatedOnUserActivities(Identity owner, ActivityUpdateFilter filter);", "public int getAnnounceCount() {\n\t\tCursor c = db.query(TABLE_TEACHER_ANNOUNCEMENT,\n\t\t\t\tnew String[] { KEY_ROW_ID }, null, null, null, null, null);\n\t\treturn c == null ? 0 : c.getCount();\n\t}", "public long getUsersCount() {\r\n return usersCount;\r\n }", "public int getNumberOfNewerOnActivityFeed(Identity ownerIdentity, Long sinceTime);", "public int getSeenInfoCount() {\n return instance.getSeenInfoCount();\n }", "public static int getConversationsWithUnreadMessages(final Context context) {\n int result = 0;\n for (Conversation conversation : AxoMessaging.getInstance(context).getConversations().list()) {\n if (conversation != null\n && (conversation.containsUnreadMessages())) {\n result += 1;\n }\n }\n return result;\n }", "int getNoticeListCount();", "public boolean isSetUserUnreadCount() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __USERUNREADCOUNT_ISSET_ID);\n }", "public int getTotalMessageCount(){\n Query query = new Query(\"Message\");\n Query query2 = new Query(\"Question\");\n PreparedQuery results = datastore.prepare(query);\n PreparedQuery results2 = datastore.prepare(query2);\n return results.countEntities(FetchOptions.Builder.withLimit(1000)) + results2.countEntities(FetchOptions.Builder.withLimit(1000));\n}", "public AsyncResult<Integer> requestNumberOfMessages() {\r\n ServiceDiscoveryManager serviceDiscoveryManager = xmppSession.getManager(ServiceDiscoveryManager.class);\r\n return serviceDiscoveryManager.discoverInformation(null, OfflineMessage.NAMESPACE).thenApply(infoDiscovery -> {\r\n if (!infoDiscovery.getExtensions().isEmpty()) {\r\n DataForm dataForm = infoDiscovery.getExtensions().get(0);\r\n if (dataForm != null) {\r\n for (DataForm.Field field : dataForm.getFields()) {\r\n if (\"number_of_messages\".equals(field.getVar())) {\r\n String numberOfMessages = field.getValues().get(0);\r\n return Integer.valueOf(numberOfMessages);\r\n }\r\n }\r\n }\r\n }\r\n return 0;\r\n });\r\n }", "public int numberOfUsers() {\r\n \tint anzahlUser=userDAO.getUserList().size();\r\n \treturn anzahlUser;\r\n }", "public int getUnreadMessageCount() throws MessagingException {\n // MONITORENTER : this\n var1_1 = this.isOpen();\n if (!var1_1) {\n // MONITOREXIT : this\n return -1;\n }\n var2_2 = 0;\n var3_3 = this.getMessageCount();\n var4_4 = 1;\n block5 : do {\n if (var4_4 > var3_3) {\n // MONITOREXIT : this\n return var2_2;\n }\n try {\n var1_1 = this.getMessage(var4_4).isSet(Flags.Flag.SEEN);\n var5_5 = var2_2;\n if (!var1_1) {\n var5_5 = var2_2 + 1;\n }\nlbl18: // 4 sources:\n do {\n ++var4_4;\n var2_2 = var5_5;\n continue block5;\n break;\n } while (true);\n }\n catch (MessageRemovedException var6_6) {\n var5_5 = var2_2;\n ** continue;\n }\n } while (true);\n }", "public void updateUnreadLabel() {\n int count = getUnreadMsgCountTotal();\n if (count > 0) {\n// unreadLabel.setText(String.valueOf(count));\n// unreadLabel.setVisibility(View.VISIBLE);\n mTab.showBadgeAtIndex(1, count, getResources().getColor(R.color.red));\n } else {\n// unreadLabel.setVisibility(View.INVISIBLE);\n }\n }", "public int getLoginCount(String uid){\r\n try {\r\n return dao.countUser(uid);\r\n }catch(Exception e) {\r\n ExceptionBroadcast.print(e);\r\n }\r\n return 0;\r\n }", "public int getNumberOfUserActivities(Identity owner) throws ActivityStorageException;", "public void addUnreadMessageNumber() {\n this.mUnreadMessageNum++;\n }", "public int getActiveUserCount() {\n return activeUserCount;\n }", "int getDeleteUserMonsterUuidsCount();", "@Override\r\n\tpublic int selectUserCount() {\n\t\treturn userMapper.selectUserCount();\r\n\t}", "public int getUsersCount()\n\t{\n\t\tint usersCount=(int) userDao.count();\n\t\treturn usersCount;\n\t}", "public Long getReviewerCount(){\n return User.count(\"from User u where u.status in (?1) and u.company = ?2 and (u.superReviewer = ?3 or u.reviewCategories IS NOT EMPTY)\",\n UserStatus.getStatusesConsideredInUse(), this, true);\n }" ]
[ "0.7596828", "0.7236466", "0.714362", "0.7103012", "0.70757914", "0.70456034", "0.6977748", "0.6904874", "0.68958765", "0.67202336", "0.6673946", "0.66682327", "0.66682327", "0.6620299", "0.6597305", "0.6597305", "0.6597305", "0.659239", "0.6573197", "0.65565944", "0.6546179", "0.64892024", "0.6461562", "0.6444835", "0.64427394", "0.64289045", "0.6390569", "0.6390569", "0.6390569", "0.6390569", "0.6390569", "0.6379776", "0.6379776", "0.6379776", "0.6348073", "0.634738", "0.6339076", "0.6338894", "0.6333943", "0.62778103", "0.6243703", "0.62198645", "0.62121075", "0.62121075", "0.62073874", "0.62055093", "0.6188151", "0.61791015", "0.6169818", "0.61621773", "0.6160457", "0.6143624", "0.6133659", "0.61125964", "0.60685194", "0.6045062", "0.6019897", "0.60166967", "0.6007819", "0.60010546", "0.5988959", "0.5964089", "0.5954253", "0.59483564", "0.5945145", "0.59341604", "0.59341604", "0.59228355", "0.5890846", "0.58767986", "0.5876425", "0.58755285", "0.5862555", "0.58543074", "0.58511144", "0.58491725", "0.58472455", "0.58407795", "0.58375895", "0.5836651", "0.5831861", "0.583081", "0.58284473", "0.58181167", "0.5817823", "0.58150774", "0.5794641", "0.57716614", "0.577094", "0.5767121", "0.57610124", "0.5746925", "0.57439625", "0.574075", "0.5733154", "0.57329446", "0.57322896", "0.57214326", "0.57082194", "0.5706328" ]
0.76739013
0
clear read notifications from unread notifications
public void markTaskNotificationsRead(final Long userId, final Long taskId) { taskExecutor.execute(new AsyncWebTask(notificationDao.getSessionFactory()) { public void runInBackground() { Integer updatedRows = notificationDao.markNotificationsAsReadByTask(getSession(), userId, taskId); updateNotificationMapIfUserExists(userId, -updatedRows); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void clearPersistentNotifications();", "void clearNotifications() throws NoUserSelectedException;", "public void clearUnreadMessageNumber() {\n this.mUnreadMessageNum = 0;\n }", "void clearAllNotifications(long timeout);", "public void reset() {\n Log.i(TAG, \"Clearing everything from the notifications table\");\n this.cancelAllNotifications();\n this.ntfcn_items.reset();\n }", "public void unread() {\n Preconditions.checkState(this.index > 0);\n this.index--;\n }", "public void reset() {\n mNewNotificationCount.setValue(0);\n }", "public static void removeAll() {\n\t\t\n\t\tif(notificationsView != null) {\n\t\t\tComponent[] notifications = notificationsView.getComponents();\n\t\t\tfor(Component notification : notifications) {\n\t\t\t\tNotification n = (Notification) notification;\n\t\t\t\tif(n.expireOnDisconnect)\n\t\t\t\t\tn.removeNow();\n\t\t\t}\n\t\t}\n\t\t\n\t}", "void cancelAllNotifications();", "public void syncUnreadReportCount(){\n unReadReports = reportRepository.getUnreadCount();\n }", "private void refreshUnreadCounters() {\n Set<String> roomIdsList;\n\n synchronized (mUpdatedRoomIdList) {\n roomIdsList = new HashSet<>(mUpdatedRoomIdList);\n mUpdatedRoomIdList.clear();\n }\n // refresh the unread counter\n for (String roomId : roomIdsList) {\n Room room = mStore.getRoom(roomId);\n\n if (null != room) {\n room.refreshUnreadCounter();\n }\n }\n }", "public void clearReceivedEvents() {\n this.receivedEvents.clear();\n }", "protected void clearMessages(){\n\t\twMessages.clear();\n\t}", "void removeAll(){\n\t\tmessages.clear();\n\t}", "void resetReceivedEventsCount();", "public void clear() {\n myReported.clear();\n }", "void removeOldNotification();", "public AsyncResult<IQ> removeAllMessages() {\r\n return xmppSession.query(IQ.set(new OfflineMessage(false, true)));\r\n }", "public CommonAlert unread(Boolean unread) {\n this.unread = unread;\n return this;\n }", "public static void clearNotifications(Context context) {\n NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\n notificationManager.cancelAll();\n }", "public synchronized void clearPersistentMessages() {\n _persistent.clear();\n }", "public void clearAll(StatusBarNotification sbn) {\n String key = this.ntfcn_items.getCondensedString(sbn);\n\n for (StatusBarNotification asbn: getActiveNotifications()) {\n /** skip group headers\n if ( ((asbn.getNotification().flags & Notification.FLAG_GROUP_SUMMARY) != 0)) {\n Log.i(TAG, \"skippiing group header key: \" + asbn.getKey());\n continue;\n } */\n\n if (ntfcn_items.getCondensedString(asbn).equals(key))\n cancelNotification(asbn.getKey());\n }\n }", "public void clearMessages() throws RemoteException {\r\n messages.removeAllElements();\r\n }", "private void refresh() {\n ArrayList<Note> notes = db.getAllNotes();\n ArrayList<Note> notesWithNotification = new ArrayList<Note>();\n\n for (int index = 0; index < notes.size(); index++) {\n if (notes.get(index).getNotification() != null) {\n notesWithNotification.add(notes.get(index));\n }\n }\n\n mNoteWithNotificationList = notesWithNotification;\n }", "public void emptyBox()\n {\n this.notifications = new TreeSet<>();\n this.setUpdated();\n }", "public void clear(){\r\n NotesList.clear();\r\n }", "public static void reset() {\n prefs().edit()\n .remove(PREFKEY_USER_ID)\n .remove(PREFKEY_READER_TAG)\n .remove(PREFKEY_READER_RECOMMENDED_OFFSET)\n .remove(PREFKEY_READER_SUBS_PAGE_TITLE)\n .commit();\n }", "public void resetSystemMessageCount(){\n\t\tiMessageCount = 0;\n\t}", "public void resetAllExceptLogout() {\n reset(getAllExcept(UserActions.NOTIFY_LOGOUT_ACTION));\n }", "void clearAndNotify();", "static public void clearLocalNotifications(Context context) {\n\t\tAlarmReceiver.clearAlarm(context);\n\t}", "void disableNotifications();", "public void clearItems(){\n conversationsList.clear();\n notifyDataSetChanged();\n }", "void deleteAllMessages() throws IOException;", "private void refreshNotification() {\n String str = this.mCurrentAddedNotiSsid;\n if (str != null) {\n showNotification(str, true, true);\n }\n String str2 = this.mCurrentDeletedNotiSsid;\n if (str2 != null) {\n showNotification(str2, false, true);\n }\n }", "@Override\n\tpublic void resetStreamingNotification() {\n\t\t\n\t}", "public Builder clearRead() {\n bitField0_ = (bitField0_ & ~0x00000008);\n read_ = false;\n onChanged();\n return this;\n }", "@NoProxy\n public void clearPollItems() {\n final List<BwXproperty> props = getXproperties(BwXproperty.pollItem);\n\n if (Util.isEmpty(props)) {\n return;\n }\n\n for (final BwXproperty p: props) {\n removeXproperty(p);\n }\n }", "public void clear(){\r\n\t\tthis.countRead \t\t\t= 0;\r\n\t\tthis.countReadData \t\t= 0;\r\n\t\tthis.countRemoved \t\t= 0;\r\n\t\tthis.countRemovedData \t= 0;\r\n\t\tthis.countWrite \t\t= 0;\r\n\t\tthis.countWriteData \t= 0;\r\n\t\tthis.dataList.clear();\r\n\t\tthis.dataMap.clear();\r\n\t}", "@PreAuthorize(\"hasAnyAuthority(T(com.meetup.utils.Role).ADMIN, \"\n + \"T(com.meetup.utils.Role).SPEAKER, \"\n + \"T(com.meetup.utils.Role).LISTENER)\")\n @DeleteMapping(\"/user/notifications/{id}\")\n public ResponseEntity markNotificationAsRead(@PathVariable final Integer id,\n @CookieValue(\"token\") final String token) {\n Integer userId = loginValidatorService.extractId(token);\n notificationService.markAsRead(id, userId);\n return new ResponseEntity<>(HttpStatus.OK);\n }", "public void clearReceived() {\n\t\t_received = false;\n\t}", "public Builder clearForRead() {\n bitField0_ = (bitField0_ & ~0x00000002);\n forRead_ = false;\n onChanged();\n return this;\n }", "public final void clear()\n\t{\n\t\tif (messages != null)\n\t\t{\n\t\t\tmessages.clear();\n\t\t}\n\t}", "public void dismissAllUserNotifications(Context context){\r\n\t\ttry{\r\n\t\t\tString masterSentFromAddress = this.getActiveNotification().getSentFromAddress();\r\n\t\t\tlong masterContactID = this.getActiveNotification().getContactID();\r\n\t\t\tint totalNotifications = this.getChildCount();\r\n\t\t\tfor(int i=totalNotifications-1; i>=0; i--){\r\n\t\t\t\tNotification notification = ((NotificationView) this.getChildAt(i)).getNotification();\r\n\t\t\t\tboolean removeNotification = false;\r\n\t\t\t\tif(masterSentFromAddress.equals(notification.getSentFromAddress())){\r\n\t\t\t\t\tremoveNotification = true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(masterContactID > 0){\r\n\t\t\t\t\t\tremoveNotification = masterContactID == notification.getContactID();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(removeNotification){\r\n\t\t\t\t\t//Cancel the reminder.\r\n\t\t\t\t\tnotification.cancelReminder();\r\n\t\t\t\t\t//Remove the notification at this index.\r\n\t\t\t\t\tthis.removeNotification(i, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//Update the navigation information on the current View.\r\n\t\t\tif(this.getChildCount() > 0){\r\n\t\t\t\tfinal View currentView = this.getCurrentView();\t\t\t\t\r\n\t\t\t\tupdateView(currentView, this.getDisplayedChild(), 0);\r\n\t\t\t}else{\r\n\t\t\t\t//Close the ViewFlipper and finish the Activity.\r\n\t\t\t\t_notificationActivity.finishActivity();\r\n\t\t\t}\r\n \t\t}catch(Exception ex){\r\n \t\t\tLog.e(_context, \"NotificationViewFlipper.dismissAllUserNotifications() ERROR: \" + ex.toString());\r\n \t\t}\r\n \t}", "@Override\n public void clear()\n {\n super.clear();\n \n /*\n * we handle the aborting timed events here so that it\n * doesn't occur in the write lock which could result\n * in deadlock since the events might have locks of their own\n */\n Collection<ITimedEvent> events = Collections.emptyList();\n try\n {\n getLock().readLock().lock();\n if (_pendingTimedEvents.size() != 0)\n events = new ArrayList<ITimedEvent>(_pendingTimedEvents);\n }\n finally\n {\n getLock().readLock().unlock();\n }\n \n for (ITimedEvent element : events)\n element.abort();\n \n }", "public void clearData() {\n int size = this.feedList.size();\n this.feedList.clear();\n notifyItemRangeRemoved(0, size);\n }", "private String onClearAllIntent() {\n\t\tprops.clear();\n\t\treturn \"Okido, I've cleaned all previous entries.\";\n\t}", "public void clearAll() {\r\n msgMapping.clear();\r\n }", "public synchronized void clear ()\n {\n for ( final Map.Entry<Object, FolderListener> entry : this.listeners.entrySet () )\n {\n entry.getValue ().changed ( entry.getKey (), new LinkedList<Entry> (), new LinkedList<String> (), true );\n }\n \n for ( final Map.Entry<String, Entry> entry : this.entryMap.entrySet () )\n {\n if ( entry instanceof FolderEntryCommon )\n {\n ( (FolderEntryCommon)entry ).getFolder ().removed ();\n }\n }\n \n this.entryMap.clear ();\n }", "public void removeAllMessages() {\n\t removeMessages(getMessageList().toArray(new BasicMessage[0]));\n\t}", "public static final void clear ()\n {\n ITEMS.clear();\n }", "public void clearUpToDateStatus() {\n\t\tif(upToDateIds != null) {\n\t\t\tSystem.out.println(\"Clearing Up To Date Status.\");\n\t\t\tupToDateIds.clear();\n\t\t}\n\t}", "protected void clearExceptLast() {\n synchronized (messageQ) {\n if (messageQ.size() > 1) {\n String latest = messageQ.getLast();\n messageQ.removeIf(el -> !el.equals(latest));\n }\n }\n }", "public void cancelNotification() {\n Context context = ApiManager.getInstance().getContext();\n if (context != null) {\n NotificationManager notificationManager = (NotificationManager) context\n .getSystemService(Context.NOTIFICATION_SERVICE);\n if (notificationManager != null) {\n Logger.d(TAG, \"cancelNotification() entry\");\n notificationManager.cancel(UNREAD_MESSAGE,\n NOTIFICATION_ID_UNREAD_MESSAGE);\n notificationManager.cancel(FILE_TRANSFER,\n NOTIFICATION_ID_FILE_TRANSFER);\n } else {\n Logger.e(TAG,\n \"cancelNotification the notificationManager is null\");\n }\n } else {\n Logger.e(TAG,\n \"cancelGroupInviteNotification the context is null\");\n }\n mUnReadMessagesChatInfos.clear();\n mFileInvitationInfos.clear();\n Logger.d(TAG, \"cancelNotification() exit\");\n }", "private static void clear() {\n Context context = Leanplum.getContext();\n if (context != null) {\n SharedPreferences.Editor editor = context.getSharedPreferences(\n \"__leanplum__\", Context.MODE_PRIVATE).edit();\n if (editor != null) {\n editor.clear();\n editor.apply();\n }\n\n editor = context.getSharedPreferences(\"__leanplum_push__\", Context.MODE_PRIVATE).edit();\n if (editor != null) {\n editor.clear();\n editor.apply();\n }\n }\n }", "public synchronized void resetBMessageReceiptList() {\n bMessageReceiptList = null;\n }", "public void resetRead() {\r\n\t\t// don't do anything if heartbeats are not expected\r\n\t\tif (this.readDelay == null) return;\r\n\r\n\t\tif (this.read != null)\r\n\t\t\tthis.read.cancel(false);\r\n\t\tthis.read = this.scheduler.schedule(new ReadHeartBeatTimeOut(), this.readDelay, TimeUnit.MILLISECONDS);\r\n\t}", "private void toggleRead(Set<Long> selectedSet) {\n toggleMultiple(selectedSet, new MultiToggleHelper() {\n\n @Override\n public boolean getField(Cursor c) {\n return c.getInt(MessagesAdapter.COLUMN_READ) == 0;\n }\n\n @Override\n public void setField(long messageId, boolean newValue) {\n mController.setMessageReadSync(messageId, !newValue);\n }\n });\n }", "public void invalidateData() {\n Log.d(TAG, \"mama MessagesListRepository invalidateData \");\n //messagesRepository.setInitialKey(null);\n messagesRepository.invalidateData();\n }", "public NotificationData(int unread) {\n unreadBeforeNotification = unread;\n droppedMessages = new LinkedList<>();\n messages = new LinkedList<>();\n }", "private void clearMessages() {\n if (this.mMessageView != null) {\n this.mMessageView.setText(\"\");\n this.mMessageView.setVisibility(View.GONE);\n }\n }", "public void readNotification()\n {\n userFan.readNotification();\n }", "public void removeAll() \r\n\t{\t\r\n\t\tbookArray = new String[MAXSIZE];\r\n\t\tnumItems = 0;\r\n\t}", "public void clearItems() {\n grabbedItems.clear();\n }", "public void clearInvisible() {\n\n Collection<NotificationPopup> syncList = Collections.synchronizedCollection(this);\n \n synchronized(syncList) {\n Collection del = new LinkedList();\n for (NotificationPopup n : syncList) {\n if (n.isVisible() == false) {\n del.add(n);\n }\n }\n\n syncList.removeAll(del);\n }\n\n }", "private void clearSeenInfo() {\n seenInfo_ = emptyProtobufList();\n }", "public void clear() {\r\n messageMap.clear();\r\n }", "public void removeMessageRead(FermatMessage fermatMessage) {\n pendingIncomingMessages.remove(fermatMessage);\n }", "public void clearAllMessageAnnotations()\n {\n _messageAnnotationsMap = null;\n _messageAnnotations = null;\n _message.setMessageAnnotations(null);\n }", "private synchronized void doClear() {\r\n summaryView.clear();\r\n\r\n Document doc = textViewer.getDocument();\r\n int len = doc.getLength();\r\n if (len > 0) {\r\n try { doc.remove(0, len); }\r\n catch (Exception x) {}\r\n }\r\n\r\n // notify the interview communicator that\r\n // the log view has been cleared\r\n if (communicator != null) {\r\n communicator.logViewCleared();\r\n }\r\n }", "void resetMessageCounter();", "public static void clearReceipt()\r\n\t{\r\n\t\tlistModel.removeAllElements();\r\n\t\tsubtotalAmount = 0;\r\n\t\ttaxAmount = 0;\r\n\t\ttotalAmount = 0;\r\n\t}", "public void removeAllItems() {\n contents.clear();\n }", "public void dismissAllAppNotifications(Context context){\r\n\t\ttry{\r\n\t\t\tint masterNotificationType = this.getActiveNotification().getNotificationType();\r\n\t\t\tString masterPackageName = this.getActiveNotification().getPackageName();\r\n\t\t\tint totalNotifications = this.getChildCount();\r\n\t\t\tfor(int i=totalNotifications-1; i>=0; i--){\r\n\t\t\t\tNotification notification = ((NotificationView) this.getChildAt(i)).getNotification();\r\n\t\t\t\tboolean removeNotification = false;\r\n\t\t\t\tif(masterNotificationType == Constants.NOTIFICATION_TYPE_GENERIC){\r\n\t\t\t\t\tremoveNotification = masterPackageName.equals(notification.getPackageName());\r\n\t\t\t\t}else{\r\n\t\t\t\t\tremoveNotification = masterNotificationType == notification.getNotificationType();\r\n\t\t\t\t}\r\n\t\t\t\tif(removeNotification){\r\n\t\t\t\t\t//Cancel the reminder.\r\n\t\t\t\t\tnotification.cancelReminder();\r\n\t\t\t\t\t//Remove the notification at this index.\r\n\t\t\t\t\tthis.removeNotification(i, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//Update the navigation information on the current View.\r\n\t\t\tif(this.getChildCount() > 0){\r\n\t\t\t\tfinal View currentView = this.getCurrentView();\r\n\t\t\t\t\r\n\t\t\t\tupdateView(currentView, this.getDisplayedChild(), 0);\r\n\t\t\t}else{\r\n\t\t\t\t//Close the ViewFlipper and finish the Activity.\r\n\t\t\t\t_notificationActivity.finishActivity();\r\n\t\t\t}\r\n \t\t}catch(Exception ex){\r\n \t\t\tLog.e(_context, \"NotificationViewFlipper.dismissAllAppNotifications() ERROR: \" + ex.toString());\r\n \t\t}\r\n \t}", "@Override\n\t\tpublic void clear() {\n\t\t\tsuper.clear();\n\t\t\tLogCateManager.getInstance().onLogsChanged();\n\t\t}", "public void removeAll() {\n/* 105 */ this.connectionToTimes.clear();\n/* */ }", "public void clearItems(){\n items.clear();\n }", "void unsubscribeAll();", "public void clear() {\n streams.clear();\n }", "protected boolean processMessagesInfo(int allMessages, int unreadMessages){\n return false;\n \n }", "public Builder clearReadMask() {\n bitField0_ = (bitField0_ & ~0x00000100);\n readMask_ = null;\n if (readMaskBuilder_ != null) {\n readMaskBuilder_.dispose();\n readMaskBuilder_ = null;\n }\n onChanged();\n return this;\n }", "public void removeNotificationsByThread(long threadID){\r\n\t\tif(_debug) Log.v(_context, \"NotificationViewFlipper.removeNotifications() Thread ID: \" + threadID);\r\n\t\t//Must iterate backwards through this collection.\r\n\t\t//By removing items from the end, we don't have to worry about shifting index numbers as we would if we removed from the beginning.\r\n\t\tint totalNotifications = this.getChildCount();\r\n\t\tfor(int i=totalNotifications-1; i>=0; i--){\r\n\t\t\tNotification notification = ((NotificationView) this.getChildAt(i)).getNotification();\r\n\t\t\tif(notification.getThreadID() == threadID){\r\n\t\t\t\t//Cancel the reminder.\r\n\t\t\t\tnotification.cancelReminder();\r\n\t\t\t\t//Remove the notification at this index.\r\n\t\t\t\tremoveNotification(i, false);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Clear the status bar notification for SMS & MMS types.\r\n\t\tCommon.clearNotification(_context, this, Constants.NOTIFICATION_TYPE_SMS);\r\n \tCommon.clearNotification(_context, this, Constants.NOTIFICATION_TYPE_MMS);\r\n\t}", "public void consumeNotifications() {\n\t\tif (!consumerTopics.contains(NOTIFICATION_TOPIC)) {\n\t\t\tconsumerTopics.add(NOTIFICATION_TOPIC);\n\t\t}\n\n\t\tif (logger.isInfoEnabled()) {\n\t\t\tlogger.info(\"Consuming notification messages\");\n\t\t}\n\n\t\tstartPolling();\n\t}", "private void clearNote()\n\t{\n\t\t((EditText) findViewById(R.id.note_edittext)).setText(\"\");\n\t\tNoteDbWorker worker = new NoteDbWorker(this);\n\t\tworker.deleteNote(user.userName);\n\t\tworker.close();\n\t\tToast.makeText(this, getString(R.string.note_cleared), Toast.LENGTH_LONG).show();\n\t}", "public void dismissAll() {\n mNotificationManager.cancelAll();\n }", "public Builder clearSendReading() {\n if (sendReadingBuilder_ == null) {\n sendReading_ = null;\n onChanged();\n } else {\n sendReading_ = null;\n sendReadingBuilder_ = null;\n }\n\n return this;\n }", "@Override\n protected void onResume() {\n new GeoChatSettings(this).clearNewMessagesCount();\n \n \tsuper.onResume();\n }", "public void unsubscribe() {\r\n new Thread(new Runnable() {\r\n public void run() {\r\n int attempts = 0;\r\n while(++attempts < 20) {\r\n try {\r\n if (server.removeSubscriber(PubSubAgent.this.agentID)) {\r\n subscriberKeywords.clear();\r\n subscriberTopics.clear();\r\n }\r\n System.out.print(\"Unsubscribed from all Topics.\");\r\n return;\r\n } catch(RemoteException e) {\r\n System.err.println(\"Could not connect to server. Retrying...\");\r\n try {\r\n Thread.sleep(800);\r\n } catch(Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }\r\n }\r\n System.err.println(\"Couldn't Unsubscribe from all the topics...\");\r\n }\r\n }).start();\r\n }", "public Builder clearGetLatestReading() {\n if (getLatestReadingBuilder_ == null) {\n getLatestReading_ = null;\n onChanged();\n } else {\n getLatestReading_ = null;\n getLatestReadingBuilder_ = null;\n }\n\n return this;\n }", "public static void clear(){\n preferences.edit().clear().apply();\n }", "void clear() {\n\t\t// Initialize new empty list, clearing out old data\n\t\tmNewsList = new ArrayList<>();\n\t}", "@Override\r\n\tpublic int clearHistory() throws NotesApiException {\n\t\treturn 0;\r\n\t}", "public void clearAppointments(){\n appointments.clear();\n }", "private void clean() {\n aggregatedValues.clear();\n this.numMessageSent = 0;\n this.numMessageReceived = 0;\n }", "@Override\r\n\tpublic void clearAll() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void clearAll() {\n\t\t\r\n\t}", "public void clear(){\n this.collected.clear();\n }", "void doClearRecent() {\r\n\t\tui.fileRecent.removeAll();\r\n\t\tui.fileRecent.add(ui.clearRecent);\r\n\t}", "public static void clearUnSatsCache(){\n\n unsats = getUnSats();\n unsats.clear();\n }", "public void clear() {\n count = 0;\n }", "public void removeAllAlarms() {\n synchronized (mLock) {\n mAlarmPriorityQueue.clear();\n setNextAlarmLocked(0);\n }\n }" ]
[ "0.746443", "0.713069", "0.64353263", "0.6403689", "0.6378826", "0.6322359", "0.6282721", "0.6229009", "0.6213452", "0.6209006", "0.6184099", "0.6175767", "0.6156949", "0.6152816", "0.6139053", "0.61064285", "0.6059155", "0.5952757", "0.59354544", "0.5926811", "0.59122956", "0.59038895", "0.58494884", "0.58044124", "0.5784609", "0.57813907", "0.5722135", "0.5718449", "0.5700561", "0.56245893", "0.55810505", "0.5574344", "0.5566952", "0.55574965", "0.554185", "0.5540312", "0.55343306", "0.55283207", "0.5527527", "0.5517245", "0.55124456", "0.54963785", "0.54808116", "0.5468942", "0.5449729", "0.54450315", "0.5440237", "0.5430906", "0.5416033", "0.54141855", "0.5397593", "0.5383366", "0.5355918", "0.5349642", "0.53467906", "0.53361225", "0.53309005", "0.5329975", "0.53251505", "0.5322251", "0.5316417", "0.5305651", "0.53055686", "0.52996874", "0.5298123", "0.5283208", "0.52824324", "0.52811545", "0.5275331", "0.52736163", "0.5273132", "0.52706087", "0.52631533", "0.5255832", "0.5250944", "0.52395296", "0.5232949", "0.5230606", "0.52301824", "0.5222339", "0.5220894", "0.52178586", "0.521337", "0.5210008", "0.5207771", "0.520587", "0.5199139", "0.51931185", "0.5186506", "0.51848143", "0.5182852", "0.51789564", "0.5172588", "0.5172552", "0.51707405", "0.51707405", "0.51642513", "0.5152103", "0.5148497", "0.5146417", "0.51442915" ]
0.0
-1
send a notification to members of a community if a task is created in a community
public void sendTaskCreatedInFollowedCommunityNotification(final Long communityId, final Long taskId) { taskExecutor.execute(new AsyncWebTask(notificationDao.getSessionFactory()) { public void runInBackground() { Community community = (Community) getSession().get(Community.class, communityId); Task task = (Task) getSession().get(Task.class, taskId); User source = task.getOwner(); for (User user : community.getMembers()) { if (!user.equals(source)) { Notification notification = new Notification(); notification.setTask(task); notification.setCommunity(community); notification.setReceiver(user); notification.setSource(source); notification.setType(NotificationType.TASK_CREATED_IN_FOLLOWED_COMMUNITY); notificationDao.saveNotification(getSession(), notification); updateNotificationMapIfUserExists(user.getId(), 1); } } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void notifyMessage(Task task);", "public void notifyResponsibleAssigned(SBuildType sBuildType, Set<SUser> sUsers) {\n\t}", "private void sendNotification() {\n ParsePush parsePush = new ParsePush();\n String id = ParseInstallation.getCurrentInstallation().getInstallationId();\n Log.d(\"Debug_id\", id);\n Log.d(\"Debug_UserName\", event.getHost().getUsername()); // host = event.getHost().getUsername();\n ParseQuery pQuery = ParseInstallation.getQuery(); // <-- Installation query\n Log.d(\"Debug_pQuery\", pQuery.toString());\n pQuery.whereEqualTo(\"username\", event.getHost().getUsername());// <-- you'll probably want to target someone that's not the current user, so modify accordingly\n parsePush.sendMessageInBackground(\"Hey your Event: \" + event.getTitle() + \" has a subscriber\", pQuery);\n\n }", "void sendEmail(Task task, String taskTypeName, String plantName);", "public void sendIncidentNotification() {\n\n final ParseQuery<ParseObject> pendingNotifs = ParseQuery.getQuery(\"PendingNotifications\");\n pendingNotifs.whereEqualTo(\"username\", ParseUser.getCurrentUser().getUsername());\n pendingNotifs.findInBackground(new FindCallback<ParseObject>() {\n @Override\n public void done(List<ParseObject> objects, ParseException e) {\n if ( e == null) {\n if (objects.size()>0) {\n for (ParseObject object : objects) {\n String type = object.getString(\"type\");\n\n Intent activityIntent = new Intent(getApplicationContext(), MyNeighbourhood.class);\n PendingIntent contentIntent = PendingIntent.getActivity(NotificationAbstract.this, 0,activityIntent, 0);\n\n String message = \"A new \" + type + \" incident has occurred in your neighbourhood. Check 'my Neighbourhood' to view details\";\n android.app.Notification notification = new NotificationCompat.Builder(mContext, StarterApplication.CHANNEL_1_ID)\n .setSmallIcon(R.drawable.unnamed)\n .setLargeIcon(BitmapFactory.decodeResource(mContext.getResources(),\n R.drawable.unnamed))\n .setContentTitle(\"New \" + type + \" Incident\")\n .setContentText(message)\n .setStyle(new NotificationCompat.BigTextStyle())\n .setPriority(NotificationCompat.PRIORITY_HIGH)\n .setCategory(NotificationCompat.CATEGORY_MESSAGE)\n .setContentIntent(contentIntent)\n .build();\n\n notificationManager.notify(1, notification);\n Log.i(\"NotificationIncident\", \"sent\");\n\n ParseUser.getCurrentUser().put(\"notifiedUpdated\", \"true\");\n try {\n object.delete();\n } catch (ParseException e1) {\n e1.printStackTrace();\n }\n ParseUser.getCurrentUser().saveInBackground();\n\n }\n }\n }\n }\n });\n\n\n if (ParseUser.getCurrentUser().getString(\"notifiedUpdated\").matches(\"false\")) {\n Log.i(\"Incident:\", \"Incident notification needs to be sent\");\n // the user is NOT up to date, so query incidents\n\n\n\n }\n\n else {\n Log.i(\"Incident\", \"Incident notification not sending\");\n String stat = ParseUser.getCurrentUser().getString(\"pending\");\n if (stat != null){\n\n }\n else {\n\n }\n }\n }", "public void notifyCreation() {\n Player targetPlayer = this.getTarget().getPlayerReference(Player.class),\n senderPlayer = this.getToTeleport().getPlayerReference(Player.class);\n\n if (targetPlayer == null || senderPlayer == null) {\n return;\n }\n\n MainData.getIns().getMessageManager().getMessage(\"TPA_SENT\").sendTo(senderPlayer);\n\n if (this.type == TeleportType.TPA) {\n MainData.getIns().getMessageManager().getMessage(\"TPA_REQUESTED\")\n .format(\"%player%\", getToTeleport().getNameWithPrefix()).sendTo(targetPlayer);\n } else if (this.type == TeleportType.TPHERE) {\n MainData.getIns().getMessageManager().getMessage(\"TPHERE_REQUESTED\")\n .format(\"%player%\", getToTeleport().getNameWithPrefix()).sendTo(targetPlayer);\n }\n\n }", "public void notifyInvitees() {\n ParseQuery userQuery = ParseUser.getQuery();\n userQuery.whereContainedIn(\"username\", Arrays.asList(names));\n // Find devices associated with these users\n ParseQuery pushQuery = ParseInstallation.getQuery();\n pushQuery.whereMatchesQuery(\"user\", userQuery);\n // Send push notification to query\n ParsePush push = new ParsePush();\n push.setQuery(pushQuery); // Set our Installation query\n push.setMessage(creator + \" has invited you to the following game: \" + gName);\n push.sendInBackground();\n }", "private void sendEmailToSubscriberForHealthTips() {\n\n\n\n }", "private void sendNotification() {\n }", "public void notifyResponsibleAssigned(Collection<TestName> arg0, ResponsibilityEntry arg1, SProject arg2, Set<SUser> sUsers) {\n\t\t\r\n\t}", "private void note(Notification n){\r\n\t\tusers.get(n.userID).addNotification(n);\r\n\t\tif (loggedInUsers.contains(n.userID))\r\n\t\t\tcomms.sendMessage(n);\r\n\t}", "public void sendNotification(String task, int id) {\n NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext());\n builder.setContentTitle(\"Amigo ToDo Manager\");\n builder.setContentText(task);\n\n //Create a pending intent to attach with the notif\n Intent i = new Intent(getApplicationContext(), ToDoEditActivity.class);\n Uri todoUri = Uri.parse(ToDoContentProvider.CONTENT_URI + \"/\" + id);\n i.putExtra(ToDoContentProvider.CONTENT_ITEM_TYPE, todoUri);\n PendingIntent pIntent = PendingIntent.getActivity(getApplicationContext(), 101, i, PendingIntent.FLAG_UPDATE_CURRENT);\n builder.setContentIntent(pIntent);\n builder.setSmallIcon(R.mipmap.ic_launcher);\n builder.setAutoCancel(true);\n Notification notif = builder.build();\n\n notificationManager.notify(101, notif);\n\n }", "private void sendNotifications() {\n for (long sid : self.getCurrentAndNextConfigVoters()) {\n QuorumVerifier qv = self.getQuorumVerifier();\n ToSend notmsg = new ToSend(\n ToSend.mType.notification,\n proposedLeader,\n proposedZxid,\n logicalclock.get(),\n QuorumPeer.ServerState.LOOKING,\n sid,\n proposedEpoch,\n qv.toString().getBytes(UTF_8));\n\n LOG.debug(\n \"Sending Notification: {} (n.leader), 0x{} (n.zxid), 0x{} (n.round), {} (recipient),\"\n + \" {} (myid), 0x{} (n.peerEpoch) \",\n proposedLeader,\n Long.toHexString(proposedZxid),\n Long.toHexString(logicalclock.get()),\n sid,\n self.getMyId(),\n Long.toHexString(proposedEpoch));\n\n sendqueue.offer(notmsg);\n }\n }", "public void checkIfWeShouldSendANotification() {\n \t// Determine which zone we are in\n \t//\n \t\n String zoneWeAreIn=null;\n \n double spartyLat = 42.731138;\n double spartyLong = -84.487508;\n \n double beaumontLat = 42.732829;\n double beaumontLong = -84.482467;\n \n double bresLat = 42.7284;\n double bresLong = -84.492033;\n\n \tfloat[] spartyDist = new float[1];\n \tLocation.distanceBetween(latitude,longitude, spartyLat, spartyLong, spartyDist);\n\n \tfloat[] beaumontDist = new float[1];\n \tLocation.distanceBetween(latitude,longitude, beaumontLat, beaumontLong, beaumontDist);\n \t\n \tfloat[] bresDist = new float[1];\n \tLocation.distanceBetween(latitude,longitude, bresLat, bresLong, bresDist);\n \t\n \tif(spartyDist[0]<20) zoneWeAreIn = \"Sparty\";\n \telse if (beaumontDist[0]<20) zoneWeAreIn = \"Beaumont Tower\";\n \telse if (bresDist[0]<20) zoneWeAreIn = \"the Breslin Center\";\n \n \t\n \t\n // Create an artificial back stack\n // This is so when we open the notification, back takes us to MainActivity\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n \n \n if(zoneWeAreIn!=null)\n {\n\t Intent newIntent = new Intent(); \n\t if(zoneWeAreIn==\"Sparty\")\n\t {\n\t \t // Set parent in artificial back stack\n\t\t stackBuilder.addParentStack(SpartyInfoActivity.class);\n\t\t \n\t\t // Make it start up SpartyInfoActivity\n\t \t newIntent.setClassName(this, \"edu.msu.cse.belmont.msuproximity.SpartyInfoActivity\"); \t\n\t }\n\t else if(zoneWeAreIn==\"Beaumont Tower\")\n\t {\n\t\t stackBuilder.addParentStack(BeaumontInfoActivity.class);\n\t \t newIntent.setClassName(this, \"edu.msu.cse.belmont.msuproximity.BeaumontInfoActivity\");\n\t }\n\t else if(zoneWeAreIn==\"the Breslin Center\")\n\t {\n\t\t stackBuilder.addParentStack(BreslinInfoActivity.class);\n\t \t newIntent.setClassName(this, \"edu.msu.cse.belmont.msuproximity.BreslinInfoActivity\");\n\t }\n\t else \n\t {\n\t \t // Default, if zoneWeAreIn is not one of the above\n\t\t Toast.makeText(this, \"Wrong zone string name\", Toast.LENGTH_LONG).show();\n\t\t newIntent.setClassName(this, \"edu.msu.cse.belmont.msuproximity.MainActivity\");\n\t }\n\t newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t \n\t \n\t // Finish setting up artifical back stack\n\t stackBuilder.addNextIntent(newIntent);\n\t \n\t // Create a pending intent so it's only launched if clicked\n\t PendingIntent pendingIntent =\n\t stackBuilder.getPendingIntent(\n\t 0,\n\t PendingIntent.FLAG_UPDATE_CURRENT\n\t );\n\t \t\n\t // Create the android notification\n\t NotificationCompat.Builder builder = new NotificationCompat.Builder(this);\n\t builder.setSmallIcon(R.drawable.ic_launcher);\n\t builder.setContentTitle(this.getString(R.string.app_name));\n\t builder.setContentText(this.getString(R.string.youre_at) + \" \"+zoneWeAreIn);\n\t builder.setAutoCancel(true);\n\t builder.setContentIntent(pendingIntent);\n\t NotificationManager mNotificationManager =\n\t (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);\n\t \n\t // Launch the android notification\n\t mNotificationManager.notify(0, builder.build());\n }\n else\n {\n \tLog.i(\"not in any zone. \"+spartyDist[0]+\" \"+beaumontDist[0]+\" \"+bresDist[0], \"Not in any zone right now.\");\n\t //Toast.makeText(this, \"Alarm went off but we are not in a zone\", Toast.LENGTH_LONG).show();\n }\n }", "void addToMyCommunities(String userId,\n String communityGUID) throws InvalidParameterException,\n PropertyServerException,\n UserNotAuthorizedException;", "public void notify(String userId);", "public static void notify(String name, String msg) {\n\n\t\tPlayer player = Bukkit.getServer().getPlayerExact(name);\n\n\t\tfor (Player test : Bukkit.getServer().getOnlinePlayers()) {\n\t\t\tif (!test.equals(player)) {\n\t\t\t\tif (test.hasPermission(\"groupmanager.notify.other\"))\n\t\t\t\t\ttest.sendMessage(\"§7[ §aGizemliOyuncu §7] §e\" + ChatColor.YELLOW + name + \" §eAdlı Oyuncunun Yeni Yetki Grubu: §b\" + msg);\n\t\t\t} else if ((player != null) && ((player.hasPermission(\"groupmanager.notify.self\")) || (player.hasPermission(\"groupmanager.notify.other\"))))\n\t\t\t\tplayer.sendMessage(\"§7[ §aGizemliOyuncu §7] §eYetki Grubun: §b\" + msg);\n\t\t}\n\n\t}", "public void notifyResponsibleAssigned(TestNameResponsibilityEntry arg0,\r\n\t\t\tTestNameResponsibilityEntry arg1, SProject arg2, Set<SUser> sUsers) {\n\t}", "public void sendNotifications(Integer contentID, String contentName, Integer[] tagArray){\n\n Set<Integer> subs = new HashSet<>();\n\n Integer[] tags = tagArray;\n\n for(Integer tag: tags){\n\n Iterable<Subscription> subscriptions = subscriptionRepository.findByTagID(tag);\n\n for(Subscription subscription: subscriptions){\n\n subs.add(subscription.getUserID());\n }\n }\n\n for(Integer id: subs){\n\n Notification notification = new Notification(contentName, contentID, id);\n notificationRepository.save(notification);\n }\n }", "void sendScheduledNotifications(JobProgress progress);", "@Override\n\t\t\tpublic void taskSuccessful(String result) {\n\t\t\t\tmCommunities = Community.getCommunitiesInfo(result);\n\t\t\t\tString[] choices = new String[mCommunities.length + 2];\n\t\t\t\tchoices[0] = \"Choose a Community\";\n\t\t\t\t\n\t\t\t\tboolean community_defined = getIntent().hasExtra(\"community_id\");\n\t\t\t\tint community_id = getIntent().getIntExtra(\"community_id\", 0);\n\t\t\t\tint selection = 0;\n\t\t\t\t\n\t\t\t\tfor (int count = 0; count < mCommunities.length; count++) {\n\t\t\t\t\tchoices[count + 1] = mCommunities[count].getName();\n\t\t\t\t\tif (community_defined && mCommunities[count].getId() == community_id){\n\t\t\t\t\t\tselection = count + 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tchoices[mCommunities.length + 1] = \"New Community\";\n\n\t\t\t\tfinal SpinnerAdapter spinnerCommunityInitialAdapter = new SpinnerAdapter(\n\t\t\t\t\t\tAddPhotosActivity.this, R.layout.spinner, choices);\n\t\t\t\tspinnerCommunity.setAdapter(spinnerCommunityInitialAdapter);\n\t\t\t\tspinnerCommunity.setSelection(selection);\n\t\t\t\t\n\t\t\t\tspinnerCommunity\n\t\t\t\t\t\t.setOnItemSelectedListener(new OnItemSelectedListener() {\n\n\t\t\t\t\t\t\tpublic void onItemSelected(AdapterView<?> parent,\n\t\t\t\t\t\t\t\t\tView view, int pos, long id) {\n\t\t\t\t\t\t\t\tif (pos == mCommunities.length + 1) {\n\t\t\t\t\t\t\t\t\taddCommunity();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tcommunityChosen = pos > 0;\n\t\t\t\t\t\t\t\t\tif (communityChosen) {\n\t\t\t\t\t\t\t\t\t\tif (communityId != mCommunities[pos - 1]\n\t\t\t\t\t\t\t\t\t\t\t\t.getId()) {\n\t\t\t\t\t\t\t\t\t\t\tcommunityId = mCommunities[pos - 1]\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getId();\n\t\t\t\t\t\t\t\t\t\t\tmomentChosen = false;\n\t\t\t\t\t\t\t\t\t\t\tspinnerMoment.setSelection(0);\n\t\t\t\t\t\t\t\t\t\t\tnew HttpGetTask(getMomentsHandler)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.execute(NetworkManager.hostName\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"/api/communities/\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ communityId);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tpublic void onNothingSelected(AdapterView<?> parent) {\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t}", "private void send_notfaction(final String username) {\r\n FirebaseDatabase.getInstance().getReference().child(\"Token\")\r\n .addValueEventListener(new ValueEventListener() {\r\n @Override\r\n public void onDataChange(DataSnapshot dataSnapshot) {\r\n if (dataSnapshot.exists()) {\r\n\r\n for (DataSnapshot ds : dataSnapshot.getChildren()) {\r\n\r\n Token token = ds.getValue(Token.class);\r\n String sendermessage = username;\r\n String title = messagetext;\r\n\r\n Notifaction notifaction = new Notifaction(title, sendermessage);\r\n Sender sender = new Sender(token.getToken(), notifaction);\r\n\r\n mservices.sendNotification(sender).enqueue(new Callback<Myresponse>() {\r\n @Override\r\n public void onResponse(Call<Myresponse> call, Response<Myresponse> response) {\r\n\r\n }\r\n\r\n @Override\r\n public void onFailure(Call<Myresponse> call, Throwable t) {\r\n Log.i(\"ERROR\", \"MESSAGE\");\r\n\r\n }\r\n });\r\n }\r\n\r\n\r\n }\r\n }\r\n\r\n @Override\r\n public void onCancelled(DatabaseError databaseError) {\r\n\r\n }\r\n });\r\n\r\n\r\n }", "static void sendNotifications() {\n\t\testablishConnection();\n\t\tSystem.out.println(\"sending multiple notificatiosn\");\n\t}", "public void notifyJoueurActif();", "public void testSendMessageEventRequest() {\n // Create a chat for each connection\n Chat chat1 = getConnection(0).getChatManager().createChat(getBareJID(1), null);\n\n // Create the message to send with the roster\n Message msg = new Message();\n msg.setSubject(\"Any subject you want\");\n msg.setBody(\"An interesting body comes here...\");\n // Add to the message all the notifications requests (offline, delivered, displayed,\n // composing)\n MessageEventManager.addNotificationsRequests(msg, true, true, true, true);\n\n // Send the message that contains the notifications request\n try {\n chat1.sendMessage(msg);\n } catch (Exception e) {\n fail(\"An error occured sending the message\");\n }\n }", "public static void sendNewsLetterToSomeStudents(long idCorso, ArrayList<String> emailStudenti, String oggetto, String messaggio) {\n\t\ttry {\n\t\t\tRequestContent rp = new RequestContent();\n\t\t\trp.parameters = new Object[] { idCorso, oggetto, messaggio, emailStudenti };\n\t\t\trp.type = RequestType.SEND_NEWSLETTER_TO_SOME_USERS;\n\t\t\tsend(rp);\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"SendNewsLetter error\");\n\t\t}\n\t}", "Task<?> addInvitationForSendingUser(Invitation invitation);", "public void testSendMessageEventRequestAndDisplayNotifications() {\n // Create a chat for each connection\n Chat chat1 = getConnection(0).getChatManager().createChat(getBareJID(1), null);\n\n MessageEventManager messageEventManager = new MessageEventManager(getConnection(0));\n messageEventManager\n .addMessageEventNotificationListener(new MessageEventNotificationListener() {\n public void deliveredNotification(String from, String packetID) {\n System.out.println(\"From: \" + from + \" PacketID: \" + packetID + \"(delivered)\");\n }\n\n public void displayedNotification(String from, String packetID) {\n System.out.println(\"From: \" + from + \" PacketID: \" + packetID + \"(displayed)\");\n }\n\n public void composingNotification(String from, String packetID) {\n System.out.println(\"From: \" + from + \" PacketID: \" + packetID + \"(composing)\");\n }\n\n public void offlineNotification(String from, String packetID) {\n System.out.println(\"From: \" + from + \" PacketID: \" + packetID + \"(offline)\");\n }\n\n public void cancelledNotification(String from, String packetID) {\n System.out.println(\"From: \" + from + \" PacketID: \" + packetID + \"(cancelled)\");\n }\n });\n\n // Create the message to send with the roster\n Message msg = new Message();\n msg.setSubject(\"Any subject you want\");\n msg.setBody(\"An interesting body comes here...\");\n // Add to the message all the notifications requests (offline, delivered, displayed,\n // composing)\n MessageEventManager.addNotificationsRequests(msg, true, true, true, true);\n\n // Send the message that contains the notifications request\n try {\n chat1.sendMessage(msg);\n // Wait a few seconds so that the XMPP client can send any event\n Thread.sleep(200);\n } catch (Exception e) {\n fail(\"An error occured sending the message\");\n }\n }", "public void notifyProjectItem(EtoProject etoProject){\n }", "private void sendNotification(String transitionType, String msg) {\n long when = System.currentTimeMillis();\n Intent notifyIntent = new Intent(this, MapsActivity.class);\n notifyIntent.putExtra(\"type\", transitionType);\n notifyIntent.putExtra(\"id\", msg);\n notifyIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notifyIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n NotificationCompat.Builder builder =\n new NotificationCompat.Builder(getApplicationContext())\n .setSmallIcon(R.drawable.ic_notification)\n .setCategory(NotificationCompat.CATEGORY_ALARM)\n .setContentTitle(transitionType)\n .setContentText(msg)\n .setContentIntent(pendingIntent)\n .setAutoCancel(true)\n .setDefaults(NotificationCompat.DEFAULT_ALL)\n .setWhen(when);\n\n NotificationManager notificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n notificationManager.notify((int) when, builder.build());\n }", "public abstract void sendNotification(String sendFrom, List<Object> sendTo, String sendToProperty, NoticeTemplate noticeTemplate, Object noticeData);", "private void sendNotification() {\n //Log.e(\"sendNotification: \", \"\" + message);\n\n Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n\n Intent intent = new Intent(this, ClubNewsActivity.class);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent,\n 0);\n\n notificationBuilder = new NotificationCompat.Builder(this)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher))\n .setContentTitle(getResources().getString(R.string.app_name))\n .setContentText(getUnexpandedContentText(strArrList.size()))\n .setAutoCancel(true)\n /*.setNumber(strArrList.size())*/\n .setSound(defaultSoundUri)\n .setContentIntent(pendingIntent)\n .setPriority(Notification.PRIORITY_HIGH)\n .setStyle(getExpandedNotificationStyle(strArrList));\n\n NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();\n // Moves events into the expanded layout\n for (int iCount = 0; iCount < strArrList.size(); iCount++) {\n inboxStyle.addLine(strArrList.get(iCount));\n }\n NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n notificationManager.notify(0, notificationBuilder.build());\n }", "public static void sendNewsLetterToAllStudents(long idCorso, String oggetto, String messaggio) {\n\t\ttry {\n\t\t\tRequestContent rp = new RequestContent();\n\t\t\trp.parameters = new Object[] { idCorso, oggetto, messaggio };\n\t\t\trp.type = RequestType.SEND_NEWSLETTER_TO_ALL_STUDENTS;\n\t\t\tsend(rp);\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"SendNewsLetter error\");\n\t\t}\n\t}", "boolean isChannelPresenceTaskEnabled();", "public void sendAlert(String notificationInfo, ILabMember personInCharge) {\n }", "public interface Task {\n void send(INotificationSideChannel iNotificationSideChannel) throws RemoteException;\n }", "private void notifyStakeholder(){\n }", "public Task createTask_OnePotentialOwner() throws HTException {\n Task task = services.createTask(\"Task1\", null, \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><ClaimApprovalRequest><cust><firstname>witek</firstname></cust><amount>1</amount></ClaimApprovalRequest>\");\n org.junit.Assert.assertTrue(task.getPotentialOwners().size() == 1);\n return task;\n }", "public interface Notification {\n /**\n * Method to generate and draw notification message\n * @param task it's task for notification message\n */\n void notifyMessage(Task task);\n}", "@Override\r\n\tpublic void sendNotifications() {\n\r\n\t}", "private void newTask()\n {\n \t//TODO add alarm\n \tTask task = new Task(taskName.getText().toString(), taskDetails.getText().toString());\n \tdb.createTask(task);\n \t//TODO Tie notification to an alarm\n \t//Create notification\n \tIntent notifyIntent = new Intent(this, TaskNotification.class);\n \tnotifyIntent.putExtra(\"title\", task.name); //add title name\n \tnotifyIntent.putExtra(\"id\", (int) task.id); //add id\n \tstartActivity(notifyIntent); //create the intent\n \t\n \trefreshData();\n }", "private void sentSMS(String taskName){\n\n AmazonSNSClient snsClient = new AmazonSNSClient();\n String message = taskName + \" has completed.\";\n String phoneNumber = \"+15809196943\";\n Map<String, MessageAttributeValue> smsAttributes =\n new HashMap<String, MessageAttributeValue>();\n //<set SMS attributes>\n PublishResult result = snsClient.publish(new PublishRequest()\n .withMessage(message)\n .withPhoneNumber(phoneNumber)\n .withMessageAttributes(smsAttributes));\n System.out.println(result); // Prints the message ID.\n\n }", "public void sendStatusUpdateNotification() {\n\n ParseQuery<ParseObject> query = ParseQuery.getQuery(\"IncidentReports\");\n query.whereEqualTo(\"username\", ParseUser.getCurrentUser().getUsername());\n query.whereEqualTo(\"notified\", \"false\");\n query.findInBackground(new FindCallback<ParseObject>() {\n @Override\n public void done(List<ParseObject> objects, ParseException e) {\n if (e == null && objects.size()>0) {\n\n Intent activityIntent = new Intent(getApplicationContext(), MyActivity.class);\n PendingIntent contentIntent = PendingIntent.getActivity(getApplicationContext(), 0,activityIntent, 0);\n\n String message = \"An incident report you have submitted has been reviewed. Go to 'My Activity' to view update.\";\n android.app.Notification notification = new NotificationCompat.Builder(mContext, StarterApplication.CHANNEL_1_ID)\n .setSmallIcon(R.drawable.unnamed)\n .setLargeIcon(BitmapFactory.decodeResource(mContext.getResources(),\n R.drawable.unnamed))\n .setContentTitle(\"Status Update\")\n .setContentText(message)\n .setStyle(new NotificationCompat.BigTextStyle())\n .setPriority(NotificationCompat.PRIORITY_HIGH)\n .setCategory(NotificationCompat.CATEGORY_MESSAGE)\n .setContentIntent(contentIntent)\n .build();\n\n for (ParseObject object : objects) {\n object.put(\"notified\", \"true\");\n object.saveInBackground();\n }\n\n notificationManager.notify(1, notification);\n Log.i(\"Notification\", \"sent\");\n\n }\n\n else {\n Log.i(\"Notification\", \"Not sent\");\n if (e != null) {\n Log.i(\"Error:\", e.getMessage());\n }\n\n\n }\n }\n });\n }", "boolean isContactPresenceTaskEnabled();", "@Override\n\tpublic int insertCommunity(JSONObject params) {\n\t\tint result = -1;\n\t\tString communityId = UUIDUtil.getUUID();\n\t\tparams.put(\"communityId\", communityId);\n\t\tJSONObject isExistJSON = this.selectOne(\"selectCommunityNameExist\", params);\n\t\tif(isExistJSON.getIntValue(\"isExist\") !=0){\n\t\t\tresult = -2;\n\t\t\treturn result;\n\t\t}\n\t\tresult = this.insert(\"insertCommunity\", params);\n\t\tif(params.getJSONArray(\"members\")!=null&&params.getJSONArray(\"members\").size()!=0){\n\t\t\tresult = this.insert(\"insertCommunityMember\",params);\n\t\t}\n\t\treturn result;\n\t}", "protected void notifyUser()\n {\n }", "public void sendNotification(String notifTitle, String notifText) {\n\n }", "public void createTasks(Integer _optID, String _tupleTag, String _taskType, String _info1, String _info2, String _destIP, String _port, String _location, long timestamp, Object _appSpecific){ \r\n //System.out.print(\"Create tasks\");\r\n boolean flag = false;\r\n String defaultIP = \"-1\";\r\n String defaultPort = \"-1\";\r\n \r\n //use wildcard to let one worker randomly choose the job to run\r\n //System.out.println(\"---What is optID: \" +_optID);\r\n if(_destIP.equals(\"RANDOM\")){\r\n int tempTaskID = getUpdatedTaskID();\r\n \r\n insertIntoParaList(tempTaskID, _optID, _tupleTag, _taskType,defaultIP,_info1,_info2,defaultPort,_location, timestamp,_appSpecific);\r\n flag = true;\r\n addEntryToResultList(_optID,flag);\r\n //------THE TASK IS INSERTED HERE\r\n insertTask(tempTaskID);\r\n }\r\n //send tuples to all\r\n else if(_destIP.equals(\"ALL\")){\r\n //Iterate through all sites that subscribe to certain types of task \r\n //System.out.println(\"infoSys.getSiteList(): \"+infoSys.getSiteList());\r\n Iterator it = infoSys.getSiteList().entrySet().iterator();\r\n while (it.hasNext()) {\r\n Map.Entry entry = (Map.Entry) it.next();\r\n _destIP = ((String) entry.getKey());\r\n ConcurrentHashMap<String, String> subscribeType = (ConcurrentHashMap<String, String>) entry.getValue();\r\n \r\n //option 2, if there is multiple subscribers of a certain taskType in one site\r\n Iterator subIt = subscribeType.entrySet().iterator();\r\n while (subIt.hasNext()) {\r\n Map.Entry subEntry = (Map.Entry) subIt.next();\r\n String[] typeAndAssociate = subEntry.getValue().toString().split(\",\");\r\n if (typeAndAssociate[0].equals(_tupleTag) && typeAndAssociate[1].equals(_taskType)) {\r\n _port = subEntry.getKey().toString();\r\n\r\n int tempTaskID = getUpdatedTaskID();\r\n insertIntoParaList(tempTaskID, _optID, _tupleTag, _taskType,_destIP, _info1,_info2,_port,_location, timestamp,_appSpecific);\r\n //System.out.println(\"Master out: \"+\"--\"+_tupleTag+\"--\"+_taskType+\"--\"+_optID+\"--\"+_destIP+\"--\"+_budget+\"--\"+_deadline+\"--\"+_port);\r\n flag = true;\r\n addEntryToResultList(_optID,flag);\r\n //------THE TASK IS INSERTED HERE\r\n insertTask(tempTaskID);\r\n \r\n }\r\n }\r\n }\r\n }\r\n //if user choose one specific worker, only send the message to it\r\n else{ \r\n //System.out.println(infoSys.getSiteList());\r\n //Check if this subscriber exists\r\n if (infoSys.hasAssociateSubscriber(_destIP, _port)) {\r\n int tempTaskID = getUpdatedTaskID();\r\n //System.out.println(\"Master out: \"+\"--\"+_tupleTag+\"--\"+_taskType+\"--\"+_optID+\"--\"+_destIP+\"--\"+_budget+\"--\"+_deadline+\"--\"+_port);\r\n insertIntoParaList(tempTaskID, _optID, _tupleTag, _taskType,_destIP,_info1,_info2,_port,_location, timestamp,_appSpecific);\r\n flag = true;\r\n addEntryToResultList(_optID,flag);\r\n insertTask(tempTaskID);\r\n } else {\r\n System.out.println(\"Incorrect destIP or destPort for creating task!\");\r\n }\r\n } \r\n //create entry in resultList\r\n addEntryToResultList(_optID,flag);\r\n }", "public void addTask(Task task) {\n\t\tMessage msg=new Message(null, null, task);\n\t\ttry {\n\t\t\tchannel.send(msg);\n\t\t}\n\t\tcatch (Exception ex) {\n\t\t\t//Runtime exception with info for use in debugging\n\t\t\tthrow new RuntimeException(ex.getMessage());\n\t\t}\n\t}", "public void sendDirectedPresence() {\n Cursor cursor = getContentResolver().query(\n Roster.CONTENT_URI,\n new String[]{Roster.LAST_UPDATED},\n null, null, \"last_updated desc\"\n );\n if (cursor.moveToFirst()) {\n long after = cursor.getLong(\n cursor.getColumnIndex(Roster.LAST_UPDATED));\n Presence presence = new Presence(Type.available);\n presence.setTo(\"broadcaster.buddycloud.com\");\n client.sendFromAllResources(presence);\n }\n cursor.close();\n }", "public static void createEvent(String token){\n ensureGraphClient(token);\n\n LinkedList<Option> requestOptions = new LinkedList<Option>();\n //requestOptions.add(new HeaderOption(\"Authorization\", \"Bearer nupl9.C5rb]aO5:yvT:3L.TKcH7tB1Im\" ));\n\n // Participantes:\n LinkedList<Attendee> attendeesList = new LinkedList<Attendee>();\n Attendee mentor = new Attendee();\n Attendee mentorado = new Attendee();\n\n EmailAddress mentorMail = new EmailAddress();\n mentorMail.address = \"[email protected]\";\n mentorMail.name = \"Daniell Wagner\";\n mentor.emailAddress = mentorMail;\n\n EmailAddress mentoradoMail = new EmailAddress();\n mentoradoMail.address = \"[email protected]\";\n mentoradoMail.name = \"Guilherme Carneiro\";\n mentorado.emailAddress = mentoradoMail;\n\n mentor.type = AttendeeType.REQUIRED;\n mentorado.type = AttendeeType.REQUIRED;\n\n attendeesList.add(mentor);\n attendeesList.add(mentorado);\n\n // Evento:\n Event event = new Event();\n event.subject = \"Mentoria com \" + mentor.emailAddress.name;\n\n ItemBody body = new ItemBody();\n body.contentType = BodyType.HTML;\n body.content = \"\" +\n \"<b>Mentoria sobre SCRUM</b> <br>\" +\n \"Olá, \" + mentorado.emailAddress.name + \" <br> \" +\n \"Você tem uma mentoria marcada com o mentor \"\n + mentor.emailAddress.name + \"!!\";\n\n event.body = body;\n\n DateTimeTimeZone start = new DateTimeTimeZone();\n start.dateTime = \"2020-03-26T16:00:00\";\n start.timeZone = \"Bahia Standard Time\";\n event.start = start;\n\n DateTimeTimeZone end = new DateTimeTimeZone();\n end.dateTime = \"2020-03-26T18:00:00\";\n end.timeZone = \"Bahia Standard Time\";\n event.end = end;\n\n Location location = new Location();\n location.displayName = \"Stefanini Campina Grande\";\n event.location = location;\n\n event.attendees = attendeesList;\n\n try {\n graphClient.me().calendar().events()\n .buildRequest()\n .post(event);\n }catch(Exception e) {\n\n System.out.println(\"Deu águia: \");\n e.printStackTrace();\n }\n }", "private void sendNotifications() {\n this.sendNotifications(null);\n }", "@Test\n public void testDelegateTaskReadyByPotentialOwner() throws HTException {\n\n Task t = createTask_TwoPotentialOwners();\n Assert.assertEquals(Status.READY, t.getStatus());\n\n this.services.delegateTask(t.getId(), \"user1\", \"user2\");\n t = this.services.getTaskInfo(t.getId());\n\n Assert.assertEquals(Status.RESERVED, t.getStatus());\n Assert.assertEquals(\"user2\", t.getActualOwner().getName());\n }", "private void sendMessageToNews(){\r\n JSONObject jPayload = new JSONObject();\r\n JSONObject jNotification = new JSONObject();\r\n try {\r\n jNotification.put(\"message\", \"Leaderboard Activity\");\r\n jNotification.put(\"body\", \"New high score!\");\r\n jNotification.put(\"sound\", \"default\");\r\n jNotification.put(\"badge\", \"1\");\r\n jNotification.put(\"click_action\", \"OPEN_ACTIVITY_1\");\r\n\r\n // Populate the Payload object.\r\n // Note that \"to\" is a topic, not a token representing an app instance\r\n jPayload.put(\"to\", \"/topics/high_score\");\r\n jPayload.put(\"priority\", \"high\");\r\n jPayload.put(\"notification\", jNotification);\r\n\r\n // Open the HTTP connection and send the payload\r\n URL url = new URL(\"https://fcm.googleapis.com/fcm/send\");\r\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\r\n conn.setRequestMethod(\"POST\");\r\n conn.setRequestProperty(\"Authorization\", SERVER_KEY);\r\n conn.setRequestProperty(\"Content-Type\", \"application/json\");\r\n conn.setDoOutput(true);\r\n\r\n // Send FCM message content.\r\n OutputStream outputStream = conn.getOutputStream();\r\n outputStream.write(jPayload.toString().getBytes());\r\n outputStream.close();\r\n\r\n // Read FCM response.\r\n InputStream inputStream = conn.getInputStream();\r\n final String resp = convertStreamToString(inputStream);\r\n\r\n Handler h = new Handler(Looper.getMainLooper());\r\n h.post(new Runnable() {\r\n @Override\r\n public void run() {\r\n Log.e(TAG, \"run: \" + resp);\r\n Toast.makeText(getActivity(),resp,Toast.LENGTH_LONG).show();\r\n }\r\n });\r\n } catch (JSONException | IOException e) {\r\n e.printStackTrace();\r\n }\r\n }", "public void sendTestFutureNotification() {\n\n }", "Task<?> addInvitationForReceivingUser(Invitation invitation);", "public static void sendPush(PushStatus status, String chatOrProjectID, Message message, String from, Collection<User> users) {\n List<String> to = users\n .parallelStream()\n .flatMap(u -> u.ids.stream())\n .map(l -> l.deviceID)\n .collect(Collectors.toList());\n\n //If we dont have any receiver, abort\n if (to.isEmpty()) {\n return;\n }\n\n // Set payload (any object, it will be serialized to JSON)\n Map<String, Object> payload = new HashMap<>();\n\n payload.put(\"status\", status.name());\n payload.put(\"id\", chatOrProjectID);\n payload.put(\"type\", message.type.name());\n payload.put(\"from\", from);\n switch (message.type) {\n case TEXT:\n payload.put(\"content\", message.content);\n break;\n case EMOTION:\n Map<String, String> emotion = Map.of(\n \"category\", message.emotion.name(),\n \"subject\", message.subject,\n \"message\", message.content\n );\n payload.put(\"content\", emotion);\n break;\n case IMAGE:\n payload.put(\"content\", message.image.toString());\n break;\n case NONE:\n Logger.getGlobal().warning(\"Message for push notification has a NONE type \" + message.toString());\n return;\n }\n\n // Prepare the push request\n PushyPushRequest push = new PushyPushRequest(payload, to);\n\n try {\n // Try sending the push notification\n PushyAPI.sendPushAsync(push, t -> Logger.getGlobal().severe(\"Could not send push notification \" + t.toString()));\n } catch (Exception exc) {\n // Error, print to console\n Logger.getGlobal().severe(\"Could not send push notification \" + exc.toString());\n }\n }", "private void check() {\n\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n Date date = new Date();\n Date date2 = new Date();\n\n Calendar calendar = Calendar.getInstance();\n date = calendar.getTime();\n\n // Se traen todos los miembros.\n Iterator e = memberBroker.getList(\"name\", \"ASC\");\n membersData member;\n accountsData account;\n //Calendar hoy = Calendar.getInstance();\n StringBuffer managerBody = new StringBuffer(\"\");\n StringBuffer memberBody = new StringBuffer(\"\");\n sendMail sm = new sendMail();\n\n\n while (e.hasNext()) { \n member = new membersData();\n account = new accountsData();\n member = (membersData) e.next();\n account=(accountsData) accountBroker.getData(member.getId_account());\n \n \n System.out.println(\"CHECKING (\" + member.getname() + -+member.getid() + -+member.getId_account() + \")\");\n\n //String mainURL = TMSConfigurator.getMainURL();\n String mainURL = account.getMain_url();\n managerBody = new StringBuffer(\"\");\n\n memberBody = new StringBuffer(\"\");\n\n // Se toma la fecha de hoy y la fecha de expiracion y se calcula la diferencia\n date2 = member.getExpired_date();\n long days = daysBetween(new Date(date.getTime()), new Date(date2.getTime()));\n \n if (days == 1) {\n System.out.println(\"un dia antes\");\n memberBody.append(\"Cuenta: \" + member.getname() + \"<br>\");\n memberBody.insert(0, \"La cuenta esta apunto de expirar le queda \" + days + \".<br>\");\n sm.sendCheckTasks(member.getemail_work(), memberBody.toString());\n\n managerBody.append(\"<BLOCKQUOTE>Miembro: \" + member.getname() + \"<br>\");\n managerBody.insert(0, \"La cuenta esta apunto de expirar le queda \"+days+\".<br>\");\n \n sm.sendCheckTasks(account.getEmail(),\n managerBody.toString());\n sm.sendCheckTasks(account.getEmail(),\n managerBody.toString());\n\n }\n if (days == 0) {\n System.out.println(\"ultimo dia\");\n memberBody.append(\"Cuenta: \" + member.getname() + \"<br>\");\n memberBody.insert(0, \"La cuenta esta apunto de expirar le queda \" + days + \".<br>\");\n sm.sendCheckTasks(member.getemail_work(), memberBody.toString());\n\n managerBody.append(\"<BLOCKQUOTE>Miembro: \" + member.getname() + \"<br>\");\n managerBody.insert(0, \"La cuenta esta apunto de expirar le queda \"+days+\".<br>\");\n \n sm.sendCheckTasks(account.getEmail(),\n managerBody.toString());\n sm.sendCheckTasks(account.getEmail(),\n managerBody.toString());\n }\n if (days == 7) {\n System.out.println(\"a una semana\");\n memberBody.append(\"Cuenta: \" + member.getname() + \"<br>\");\n memberBody.insert(0, \"La cuenta esta apunto de expirar le queda \" + days + \".<br>\");\n sm.sendCheckTasks(member.getemail_work(), memberBody.toString());\n\n managerBody.append(\"<BLOCKQUOTE>Miembro: \" + member.getname() + \"<br>\");\n managerBody.insert(0, \"La cuenta esta apunto de expirar le queda \"+days+\".<br>\");\n \n sm.sendCheckTasks(account.getEmail(),\n managerBody.toString());\n sm.sendCheckTasks(account.getEmail(),\n managerBody.toString());\n }\n /*if (hoy.getTimeInMillis() > end) {\n // Ya estas atrasado mas alla del umbral maximo permitido!!\n System.out.println(\"\\t\\t\\tAtrasada!!\");\n if (atrasadoEquipo == false) {\n // Al menos un miembro del equipo esta atrazado.\n managerBody.append(\"Proyecto: \" + proyecto.getname() + \"<br>\");\n atrasadoEquipo = true;\n }\n if (atrasado == false) {\n // Este member no estaba atrasado, se agrega el encabezado para\n // su email. \n memberBody.append(\"Proyecto: \" + proyecto.getname() + \"<br>\");\n managerBody.append(\"<BLOCKQUOTE>Miembro: \" + team.getparentMember().getname() + \"<br>\");\n }\n if (team.getparentMember().getprofile().equals(\"0\") ||\n team.getparentMember().getprofile().equals(\"1\")) {\n // Siempre el mensaje de atrazo, pero no es un usuario externo\n memberBody.append(\"<BLOCKQUOTE>Tarea (<a href='\" + mainURL + \"/tasks.do?operation=view&id=\" +\n task.getid() + \"'>\" + task.getname() + \"</a>):\\tAtrasada<br>\" +\n \"</BLOCKQUOTE>\");\n } else {\n // Se trata de un usuario del cliente\n memberBody.append(\"<BLOCKQUOTE>Tarea (<a href='\" + mainURL + \"/portalTasks.do?operation=view&id=\" +\n task.getid() + \"'>\" + task.getname() + \"</a>):\\tAtrasada<br>\" +\n \"</BLOCKQUOTE>\");\n }\n managerBody.append(\"<BLOCKQUOTE>Tarea (<a href='\" + mainURL + \"/tasks.do?operation=view&id=\" +\n task.getid() + \"'>\" + task.getname() + \"</a>):\\tAtrasada<br>\" + \"\\t Asignada a: \" +\n (task.getassigned_to() == 0 ? \"No Asignada\" : task.getparentAssigned().getname()) +\n \"</BLOCKQUOTE>\");\n // Se cambia el valor\n atrasado = true;\n } else {\n System.out.println(\"\\t\\t\\tOK!!\");\n }\n // Se le envia el email al miembro del equipo si y solo si esta atrazado\n if (atrasado) {\n // enviar correo al usuario\n memberBody.insert(0, \"Las siguientes tareas est&aacute;n atrasadas m&aacute;s all&aacute; del umbral de tolerancia permitido.<br>\");\n managerBody.append(\"</BLOCKQUOTE>\");\n sm.sendCheckTasks(team.getparentMember().getemail_work(),\n memberBody.toString());\n }\n // Si alguien del proyecto esta atrazado se envia la lista de cada member\n // al administrador\n if (atrasadoEquipo) {\n managerBody.insert(0, \"Las siguientes tareas est&aacute;n atrasadas m&aacute;s all&aacute; del umbral de tolerancia permitido.<br>\");\n sm.sendCheckTasks(proyecto.getparentOwner().getemail_work(),\n managerBody.toString());\n }\n */\n\n\n // while de miembros\n\n\n }\n }", "public void doCollectMeeting() {\n\t}", "@Override\r\n \tpublic void registerForContextChanges(Object communityId) throws InvalidFormatException {\r\n \t\t//Cast IIdentity for the societies platform\r\n \t\tIIdentity cisID = idMgr.fromJid(communityId.toString());\r\n \t\tLOG.info(\"cisID retrieved: \"+ cisID);\r\n \r\n \t\ttry {\r\n \t\t\tCtxEntityIdentifier ctxCommunityEntityIdentifier = this.ctxBroker.retrieveCommunityEntityId(getRequestor(), cisID).get();\r\n \t\t\tLOG.info(\"communityEntityIdentifier retrieved: \" +ctxCommunityEntityIdentifier.toString()+ \" based on cisID: \"+ cisID);\r\n \t\t\tCommunityCtxEntity communityEntity = (CommunityCtxEntity) this.ctxBroker.retrieve(getRequestor(), ctxCommunityEntityIdentifier).get();\r\n \r\n \t\t\tSet<CtxEntityIdentifier> ctxMembersIDs = communityEntity.getMembers();\r\n \t\t\tIterator<CtxEntityIdentifier> members = ctxMembersIDs.iterator();\r\n \r\n \t\t\twhile(members.hasNext()){\r\n \t\t\t\tCtxEntityIdentifier member = members.next();\r\n \t\t\t\tLOG.info(\"*** Registering context changes for member: \"+member.toString());\r\n \r\n \t\t\t\t//TODO: Include here other ctx updates if necessary. For short term context\r\n \t\t\t\tthis.ctxBroker.registerForChanges(getRequestor(), this.myCtxChangeEventListener, member, CtxAttributeTypes.LOCATION_SYMBOLIC);\r\n \t\t\t\tthis.ctxBroker.registerForChanges(getRequestor(), this.myCtxChangeEventListener, member, CtxAttributeTypes.STATUS);\r\n \t\t\t\t//\t\t\t\tthis.ctxBroker.registerForChanges(getRequestor(), this.myCtxChangeEventListener, member, CtxAttributeTypes.OCCUPATION);\r\n \t\t\t\t//\t\t\t\tthis.ctxBroker.registerForChanges(getRequestor(), this.myCtxChangeEventListener, member, CtxAttributeTypes.ADDRESS_WORK_CITY);\r\n \t\t\t\t//\t\t\t\tthis.ctxBroker.registerForChanges(getRequestor(), this.myCtxChangeEventListener, member, CtxAttributeTypes.ADDRESS_WORK_COUNTRY);\r\n \r\n \t\t\t}\r\n \t\t} catch (InterruptedException e1) {\r\n \t\t\te1.printStackTrace();\r\n \t\t} catch (ExecutionException e1) {\r\n \t\t\te1.printStackTrace();\r\n \t\t} catch (CtxException e1) {\r\n \t\t\te1.printStackTrace();\r\n \t\t}\r\n \r\n \t\tLOG.info(\"*** registerForContextChanges success\");\r\n \t}", "public void notifyResponsibleChanged(SBuildType sBuildType, Set<SUser> sUsers) {\n\t}", "public void notifySubscribedUsers(String affectedNamespace, RepositoryActionType action) {\n\t\ttry {\n\t\t\tif ((action != RepositoryActionType.NS_CREATED) && (action != RepositoryActionType.NS_DELETED)) {\n\t\t\t\tthrow new IllegalArgumentException(\"Only namespace-related actions are allowed for this method.\");\n\t\t\t}\n\t\t\tString userId = manager.getFileManager().getCurrentUserId();\n\t\t\t\n\t\t\tif (debugMode) {\n\t\t\t\tprocessNotificationJob( new NotificationJob( action, userId, affectedNamespace, null ) );\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tif ((notificationThread != null) && notificationThread.isAlive() && !shutdownRequested) {\n\t\t\t\t\tnotificationQueue.put( new NotificationJob( action, userId, affectedNamespace, null ) );\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tlog.warn(\"Email notifications not sent because the listener is not running.\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} catch (InterruptedException e) {\n\t\t\t// Ignore - should never happen since the DelayQueue does not have a constrained size limit\n\t\t}\n\t}", "@Override\n\tpublic void notify(DelegateTask tareaDelegada) {\n\t\tString nombre = (String) tareaDelegada.getExecution().getVariable(\"IDNombreCliente\");\n\t\tString email = (String) tareaDelegada.getExecution().getVariable(\"IDEmail\");\n\t\tDate fechaAlta = (Date) tareaDelegada.getExecution().getVariable(\"IDFechaAlta\");\n\t\tString numTarjeta = (String) tareaDelegada.getExecution().getVariable(\"IDTarjeta\");\n\n\t\t// Acceso al tipo enumerado\n\t\tString emisor = (String) tareaDelegada.getExecution().getVariable(\"IDEmisor\");\n\t\tString direccion = (String) tareaDelegada.getExecution().getVariable(\"IDDireccion\");\n\n\t\tServicioClientes servicioClientes = new ServicioClientes();\n\t\tservicioClientes.insertar(new Cliente(nombre, direccion, fechaAlta, numTarjeta, emisor, email));\n\t}", "public void sendTaskRepliedNotification(final Long taskId, final Long replier) {\n\t\ttaskExecutor.execute(new AsyncWebTask(notificationDao.getSessionFactory()) {\n\t\t\tpublic void runInBackground() {\n\t\t\t\tTask task = (Task) getSession().get(Task.class, taskId);\n\t\t\t\tUser source = (User) getSession().get(User.class, replier);\n\n\t\t\t\tList<User> followers = task.getFollowers();\n\t\t\t\tfor (User follower : followers) {\n\t\t\t\t\tif (!follower.equals(source)) {\n\t\t\t\t\t\tNotification notification = new Notification();\n\t\t\t\t\t\tnotification.setTask(task);\n\t\t\t\t\t\tnotification.setReceiver(follower);\n\t\t\t\t\t\tnotification.setSource(source);\n\t\t\t\t\t\tnotification.setType(NotificationType.TASK_REPLY);\n\t\t\t\t\t\tnotificationDao.saveNotification(getSession(), notification);\n\n\t\t\t\t\t\tupdateNotificationMapIfUserExists(follower.getId(), 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public abstract boolean sendNotification(Map<String, Object> processInfo, boolean mailToSend, Object obj);", "@SuppressWarnings(\"deprecation\")\r\n public static void hasNotification(final Context context, final Toolbar toolbar, final NavigationView navigationVew)\r\n {\r\n final SharedPreferencesManager sharedPreferencesManager = new SharedPreferencesManager(context);\r\n\r\n final User user = sharedPreferencesManager.retrieveUser();\r\n\r\n final String fixedURL = Utils.fixUrl(\r\n Properties.SERVER_URL + \":\" + Properties.SERVER_SPRING_PORT + \"/hasNotification/\" + user.getId());\r\n\r\n Log.d(Properties.TAG, \"[REST_CLIENT_SINGLETON] Conectando con: \" + fixedURL + \" para saber si tiene alguna notificacion por leer\");\r\n\r\n StringRequest stringRequest = new StringRequest(Request.Method.GET\r\n , fixedURL\r\n , new Response.Listener<String>()\r\n {\r\n @Override\r\n public void onResponse(String response)\r\n {\r\n if (response.equals(Properties.NEW_NOTIFICATIONS))\r\n {\r\n Log.d(Properties.TAG, \"[REST_CLIENT_SINGLETON] Hay nuevas notificaciones\");\r\n Log.d(Properties.TAG, \"[REST_CLIENT_SINGLETON] Se actualizan los iconos\");\r\n\r\n // Cambiamos el Hamburger Icon\r\n toolbar.setNavigationIcon(R.drawable.ic_menu_notif);\r\n\r\n // Cambiamos el icono de las notificaciones en el menu\r\n MenuItem menuItem = navigationVew.getMenu().findItem(R.id.nav_notifications);\r\n menuItem.setIcon(context.getResources().getDrawable(R.drawable.ic_notification_new));\r\n\r\n } else {\r\n Log.d(Properties.TAG, \"[REST_CLIENT_SINGLETON] No hay notificaciones nuevas\");\r\n }\r\n }\r\n }\r\n , new Response.ErrorListener()\r\n {\r\n @Override\r\n public void onErrorResponse(VolleyError error)\r\n {\r\n ExceptionPrinter.printException(\"REST_CLIENT_SINGLETON\", error);\r\n }\r\n });\r\n\r\n // Enviamos la peticion.\r\n VolleySingleton.getInstance(context).addToRequestQueue(stringRequest);\r\n Log.d(Properties.TAG, \"[REST_CLIENT_SINGLETON] Petición creada y enviada al servidor\");\r\n }", "@Test\n public void testStartTaskReadyByPotentialOwner() throws HTException {\n\n Task t = createTask_TwoPotentialOwners();\n this.services.startTask(t.getId(), \"user1\");\n \n org.junit.Assert.assertEquals(\"user1\", t.getActualOwner().getName());\n org.junit.Assert.assertEquals(Status.IN_PROGRESS, t.getStatus());\n }", "private void isSubscribed(final String communityId, String uid) {\n DatabaseReference reference = FirebaseDatabase.getInstance().getReference()\n .child(\"Subscribe\")\n .child(uid)\n .child(communityId);\n\n reference.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot snapshot) {\n if (snapshot.exists()) {\n subscribe.setText(\"Unsubscribe\");\n } else {\n subscribe.setText(\"Subscribe\");\n }\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError error) {\n\n }\n });\n }", "public Task createTask_TwoPotentialOwners() throws HTException {\n Task task = services.createTask(\"Task2\", null, \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><ClaimApprovalRequest><cust><firstname>witek</firstname></cust><amount>1</amount></ClaimApprovalRequest>\");\n org.junit.Assert.assertTrue(task.getPotentialOwners().size() == 2);\n return task;\n }", "public void info(StatusTask t, String msg){\n\t\tt.setStaus(msg);\n\t}", "@Override\n\tpublic int updateCommunity(JSONObject params) {\n\t\tint result = -1;\n\t\tJSONObject isExistJSON = this.selectOne(\"selectCommunityNameExist\", params);\n\t\tif(isExistJSON.getIntValue(\"isExist\") !=0){\n\t\t\tresult = -2;\n\t\t\treturn result;\n\t\t}\n\t\tresult = this.delete(\"deleteCommunityMember\",params);\n\t\tif(params.getJSONArray(\"members\")!=null&&params.getJSONArray(\"members\").size()!=0){\n\t\t\tresult = this.insert(\"insertCommunityMember\",params);\n\t\t}\n\t\tresult = this.update(\"updateCommunity\", params);\n\t\treturn result ;\n\t}", "public void execute(HashMap taskparams) {\n\t\t\n\t\tLOGGER.info(\"Starting ReminderDuplicateID Scheduled Task \");\n\t\t\n\t\tlookup= Platform.getService(tcLookupOperationsIntf.class);\n\t\t//userRepository=Platform.getService(UserRepository.class);\n\t\t//usrInfo = Platform.getService(UserInfo.class);\n\t\temailIntf = Platform.getService(tcEmailOperationsIntf.class);\n\t\tString lookupName= (String) taskparams.get(\"Lookup Name\");\n\t\tString emailTemp = (String) taskparams.get(\"Email Template\");\n\t\tLOGGER.info(\"lookupName \"+lookupName);\n\t\tLOGGER.info(\"emailTemp \"+emailTemp);\n\t\tHashMap<String,String> reminderDetMap = readLookupValues(lookup,lookupName);\n\t\tLOGGER.info(\"Lookup Map \"+reminderDetMap);\n\t\t\n\t\tif (reminderDetMap!=null && reminderDetMap.size()>0){\n\t\t\tfor (Entry<String, String> entry : reminderDetMap.entrySet()){\n\t\t\t\t//LOGGER.info(\"Inside for Loop \");\n\t\t\t\tString uid= entry.getKey();\n\t\t\t\tString decodeValue= entry.getValue();\n\t\t\t\tif (decodeValue!=null ){\n\t\t\t\t\t//LOGGER.info(\"Inside if and for \");\n\t\t\t\t\tString [] datenHrUid = decodeValue.split(\",\");\n\t\t\t\t\tString reminderDate = datenHrUid[0];\n\t\t\t\t\tString hrUID = datenHrUid[1];\n\t\t\t\t\tString attr= datenHrUid[2];\n\t\t\t\t\t//LOGGER.info(\" reminderDate\"+reminderDate+\" \"+hrUID);\n\t\t\t\t\tif (noOfDaysSinceCreation(reminderDate)==0){\n\t\t\t\t\t\tLOGGER.info(\"Now the reminder email would be sent\");\n\t\t\t\t\t\tsendNotification(uid,hrUID,emailTemp,attr);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tremoveLookupValues(lookup,lookupName);\n\t\t}\n\t\t\n\t\t\n\t}", "private void showNotification() {\n\n Intent intent = new Intent(this, DashboardActivity.class);\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n stackBuilder.addParentStack(DashboardActivity.class);\n stackBuilder.addNextIntent(intent);\n\n final NotificationCompat.Builder builder = new NotificationCompat.Builder(this);\n\n builder.setSmallIcon(R.drawable.ic_gps);\n builder.setContentText(getText(R.string.local_service_started));\n builder.setContentTitle(getText(R.string.local_service_label));\n builder.setOngoing(true);\n builder.setContentIntent(stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT));\n\n final Notification notification = builder.build();\n\n // Send the notification.\n mNotificationManager.notify(NOTIFICATION, notification);\n }", "private void sendNotification(String msg) {\n\n mNotificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);\n\n PendingIntent contentIntent = PendingIntent.getActivity(this, 0,new Intent(this, ServiceListActivity.class), 0);\n\n NotificationCompat.Builder mBuilder =new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.ic_launcher)\n .setContentTitle(\"Ruta Plus\")\n .setStyle(new NotificationCompat.BigTextStyle()\n .bigText(msg))\n .setContentText(msg);\n\n mBuilder.setContentIntent(contentIntent);\n mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());\n }", "@Override\n @Async\n public void createInviteNotifications(User user, long happeningId) throws GoogleNotificationServiceException {\n GoogleNotificationRequest request = new GoogleNotificationRequest(\n user.getGoogleauthenticationkey(),\n user.getGoogleauthenticationids(),\n happeningId);\n\n log.fine(String.format(\"create new google invite notification for user %d and happening %d\",\n user.getUserID(),\n happeningId));\n\n try {\n sendToGoogle(request, url_notify, false);\n } catch (IOException e) {\n log.warning(\"network error: could not send request to google: \" + e.getMessage());\n throw new GoogleNotificationServiceException();\n }\n }", "private void createNotification() {\n\t\tIntent notifyIntent = new Intent(this, BirthdayActivity.class);\r\n\t\t// Sets the Activity to start in a new, empty task\r\n\t\tnotifyIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\r\n\t\t// Creates the PendingIntent\r\n\t\tPendingIntent pendingIntent = PendingIntent.getActivity(this,\r\n\t\t\t\t(int) System.currentTimeMillis(), notifyIntent,\r\n\t\t\t\tPendingIntent.FLAG_UPDATE_CURRENT);\r\n\r\n\t\tNotificationManagerUtil notificationManagerUtil = NotificationManagerUtil\r\n\t\t\t\t.getInstance();\r\n\t\tnotificationManagerUtil.createNotifications(this, 1, \"Message\",\r\n\t\t\t\tpendingIntent);\r\n\t}", "@Override\r\n\tpublic void onChannelPersonalCreateNotify(AirChannel ch)\r\n\t{\n\t\tif (ch != null)\r\n\t\t{\r\n\t\t\tAirtalkeeChannel.getInstance().ChannelMemberGet(ch.getId());\r\n\t\t\tAirSession session = AirtalkeeSessionManager.getInstance().SessionMatch(ch.getId());\r\n\t\t\tif (session != null)\r\n\t\t\t{\r\n\t\t\t\tString tip = String.format(AirServices.getInstance().getString(R.string.talk_channel_tip_create), ch.getCreatorName());\r\n\t\t\t\tAirtalkeeMessage.getInstance().MessageSystemGenerate(session, tip, true);\r\n\t\t\t}\r\n\r\n\t\t\tif (channelListener != null)\r\n\t\t\t{\r\n\t\t\t\tchannelListener.onChannelPersonalCreateNotify(ch);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic void execute(DelegateExecution execution) throws Exception {\n\t\tLOG.info(\"\\n\\n\\n Start cewate task \"+\"\\n\\n\\n\");\n\n\t\t// IdentityService identityService = Context.getProcessEngineConfiguration().getIdentityService();\n\t // User user = identityService.createUserQuery().userId(assignee).singleResult();\n\t \n\t // check if the first task listener was executed\n\t List<String> assigneeList = new ArrayList<>();//InformAssigneeTaskListener.assigneeList;\n\t assigneeList.add(\"demo\");\n\t assigneeList.add(\"test\");\n\t execution.setVariable(\"assigns\", assigneeList);\n\t LOG.info(\"\\n\\n\\n Start cewate task \"+assigneeList.toString() +\"\\n\\n\\n\");\n\t //assertThat(assigneeList.size(), is(1));\n\t //assertThat(assigneeList.get(0), is(\"Kermit\"));\n\n\t execution.setVariable(\"thisOk_new\", \"123456\");\n\t // complete first user task\n\t //Task task = taskService.createTaskQuery().singleResult();\n\t //taskService.complete(task.getId());\n\n\t}", "void notifyPlayerJoined(String username);", "private void sendNotify(JSONObject notification, String staffID) {\r\n JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(FCM_API, notification,\r\n new Response.Listener<JSONObject>() {\r\n @Override\r\n public void onResponse(JSONObject response) {\r\n Toast.makeText(BookingListDetails.this, \"\"+ staffID + \" has been Notified!\", Toast.LENGTH_SHORT).show();\r\n Log.i(TAG, \"onResponse: \" + response);\r\n startActivity(new Intent(getApplicationContext(), AdminBookingList.class));\r\n finish();\r\n }\r\n },\r\n new Response.ErrorListener() {\r\n @Override\r\n public void onErrorResponse(VolleyError error) {\r\n Toast.makeText(BookingListDetails.this, \"Request error\", Toast.LENGTH_LONG).show();\r\n Log.i(TAG, \"onErrorResponse: Didn't work\");\r\n }\r\n }) {\r\n @Override\r\n public Map<String, String> getHeaders() throws AuthFailureError {\r\n Map<String, String> params = new HashMap<>();\r\n params.put(\"Authorization\", serverKey);\r\n params.put(\"Content-Type\", contentType);\r\n return params;\r\n }\r\n };\r\n MySingleton.getInstance(getApplicationContext()).addToRequestQueue(jsonObjectRequest);\r\n }", "public void setCommunity(int community) {\n this.community = community;\n }", "public void sentTo(String id, InfinispanComMessage infinispanComMessage){\n nodes.put(id, infinispanComMessage);\n }", "private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = MyShardPrefernces.myNotificationChannelName;\n\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(MyShardPrefernces.myNoficataionChannelID, name, importance);\n channel.setDescription(\"Notifications for alert Messenging\");\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }", "private static String getNotificationMessage(UserEvent event) {\n return \"Activity \" + event.getCategory().getTitle() + \" in progress\";\n }", "public void notifyAllFriends(PresenceModel presence);", "public Future<List<CtxEntityIdentifier>> retrieveCommunityMembers(CtxEntityIdentifier community);", "private void sendNotification() {\n int mNotificationId = 001;\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.ic_action_camera)\n .setContentTitle(\"Daily Selfie\")\n .setContentText(\"Time for another selfie\");\n Intent resultIntent = new Intent(this, MainActivity.class);\n PendingIntent resultPendingIntent =\n PendingIntent.getActivity(\n this,\n 0,\n resultIntent,\n PendingIntent.FLAG_UPDATE_CURRENT\n );\n mBuilder.setContentIntent(resultPendingIntent);\n // Gets an instance of the NotificationManager service\n NotificationManager mNotifyMgr = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n // Builds the notification and issues it.\n mNotifyMgr.notify(mNotificationId, mBuilder.build());\n }", "public void notifyAll(Node node, String course){\r\n for(Node nodes : listeners){\r\n nodes.update(node, course);\r\n }\r\n }", "public void createDeleteNotification (Invite inv) {\n Notification notification = new Notification();\n notification.setRelatedEvent(inv.getEvent());\n notification.setNotificatedUser(inv.getUser());\n notification.setSeen(false);\n notification.setType(NotificationType.deletedEvent);\n notification.setGenerationDate(new Date());\n em.persist(notification);\n //I send the notification mail to the user\n mailManager.sendMail(inv.getUser().getEmail(), \"Deleted Event\", \"Hi! An event for which you have received an invite has been cancelled. Join MeteoCal to discover it.\");\n }", "@Override\n\tpublic void run() {\n\t\tthis.logger.debug(\"activity created sent: \" + body);\n\n\t\tSender sender = new Sender(this.apiKey);\n//\t\tNotification value = new Notification.Builder(\"TiTlE\").body(\"BoDy\").build();\n//\t\tMessage message = new Message.Builder().notification(value)\n//\t\t\t\t.addData(\"message\", body)\n//\t\t\t\t.addData(\"title\", title)\n//\t\t\t\t.build();\n\t\tMessage message = new Message.Builder()\n\t\t\t\t.addData(\"message\", body)\n\t\t\t\t.addData(\"title\", title)\n\t\t\t\t.addData(\"activity_id\", this.activityId)\n\t\t\t\t.build();\n\n\t\ttry {\n\t\t\tResult result = sender.send(message, this.registrationId, 1);\n\t\t\t//System.out.println(\"gcm result success:\" + result.getSuccess() + \" failure:\"+ result.getFailure() + \" fail msg: \" + result.getErrorCodeName());\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t//System.out.println(\"activity creation notification sent\");\n\n\t}", "public void uponSuccessfulRegistration(String[] emailCCList){\n \tSimpleMailMessage[] mailMessageArray = new SimpleMailMessage[1];\r\n Iterator iterator = userEmailIds.iterator();\r\n // for (int index = 0; iterator.hasNext(); index ++){\r\n SimpleMailMessage message = new SimpleMailMessage();\r\n String toAddress = (String)iterator.next();\r\n message.setFrom(\"[email protected]\");\r\n message.setTo(\"[email protected]\");\r\n message.setSubject(\"With CC\");\r\n message.setCc(emailCCList);\r\n message.setText(\"Mail Sent from @[email protected]\");\r\n mailMessageArray[0] = message;\r\n// }\r\n mailSender.send(mailMessageArray);\r\n }", "private void onContactInvitation(final NotificationBDD notificationBDD) {\n final InvitationConnexion invitationConnexion = new InvitationConnexion();\n invitationConnexion.setDate((notificationBDD.getDate()));\n invitationConnexion.setIdFirebase(notificationBDD.getId());\n invitationConnexion.setInvite(utilisateurConnecte);\n final LocalUserProfilEBDD localUserProfilEBDD = new LocalUserProfilEBDD();\n invitationConnexionBDD.open();\n// invitationConnexionBDD.insererInvitationConnexion(invitationConnexion);\n final Position position = new Position();\n final ParametresUtilisateur parametres = new ParametresUtilisateur();\n remoteBD.getUserProfil(notificationBDD.getAskerID(), localUserProfilEBDD, new OnUserProfilReceived() {\n @Override\n public void onUserProfilReceived(UtilisateurProfilEBDD userProfilEBDD) {\n final View coordinatorLayoutView = findViewById(R.id.snackbarPosition);\n Snackbar.make(coordinatorLayoutView, \"Invitation de connexion reçue !\", Snackbar.LENGTH_LONG)\n .setAction(\"VOIR\", clickListener)\n .show();\n invitationConnexion.setExpediteur(FromEBDDToLocalClassTranslator.translateUserProfil(localUserProfilEBDD, position, notificationBDD.getAskerID(), parametres));\n invitationConnexionBDD.insererInvitationConnexion(invitationConnexion);\n invitationConnexionBDD.affichageInvitationConnexion();\n }\n });\n\n\n\n }", "private void createNotificationChannel(){\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){\n CharSequence name = \"DailyReminderChannel\";\n String desc = \"Channel for daily reminders\";\n NotificationChannel channel = new NotificationChannel(\"dailyReminders\", name, NotificationManager.IMPORTANCE_DEFAULT);\n channel.setDescription(desc);\n\n NotificationManager manager = getActivity().getSystemService(NotificationManager.class);\n manager.createNotificationChannel(channel);\n }\n }", "public void createInviteNotification(Event e, Users u) {\n Invite invite= new Invite();\n invite.setUser(u);\n invite.setStatus(Invite.InviteStatus.invited);\n invite.setEvent(e);\n em.persist(invite);\n Notification notification = new Notification();\n notification.setType(NotificationType.invite);\n notification.setNotificatedUser(u);\n notification.setRelatedEvent(e);\n notification.setSeen(false);\n notification.setGenerationDate(new Date());\n em.persist(notification);\n mailManager.sendMail(u.getEmail(), \"New Invite\", \"Hi! You have received a new invite\");\n }", "private void sendNotification(JSONObject notification, final String staffID) {\r\n JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(FCM_API, notification,\r\n new Response.Listener<JSONObject>() {\r\n @Override\r\n public void onResponse(JSONObject response) {\r\n Toast.makeText(BookingListDetails.this, \"\"+ staffID + \" has been Notified!\", Toast.LENGTH_SHORT).show();\r\n Log.i(TAG, \"onResponse: \" + response);\r\n }\r\n },\r\n new Response.ErrorListener() {\r\n @Override\r\n public void onErrorResponse(VolleyError error) {\r\n Toast.makeText(BookingListDetails.this, \"Request error\", Toast.LENGTH_LONG).show();\r\n Log.i(TAG, \"onErrorResponse: Didn't work\");\r\n }\r\n }) {\r\n @Override\r\n public Map<String, String> getHeaders() throws AuthFailureError {\r\n Map<String, String> params = new HashMap<>();\r\n params.put(\"Authorization\", serverKey);\r\n params.put(\"Content-Type\", contentType);\r\n return params;\r\n }\r\n };\r\n MySingleton.getInstance(getApplicationContext()).addToRequestQueue(jsonObjectRequest);\r\n }", "@Override\n public boolean isCommunity() {\n return false;\n }", "public void sendNotification(String type, int fromId, int commentId, int articleId) {\n Map<String, String> content = new HashMap<String, String>();\n content.put(\"reply\", \"{from} replied your comment for {article}, check it out!\");\n //more to add to assist with upcoming services\n\n CommentAdder comment = CommentAdder.dao.findById(commentId);\n int toId = comment.get(\"user_id\"); //user_id of whom is getting this notification\n\n UserAdder fromUserSheet = UserAdder.dao.findById(fromId);\n String fromUser = fromUserSheet.get(\"username\");\n\n ContentAdder article = ContentAdder.dao.findById(articleId);\n String articleTitle = article.get(\"title\");\n String articleUrl = article.get(\"en_title\");\n\n String notificationText = Integer.toString(commentId).length() +\n \":\" + commentId + content.get(type).replace(\"{from}\",fromUser)\n .replace(\"{article}\",articleTitle);\n Date now = new Date();\n DateFormat simpleFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\n new NotificationAdder().set(\"title\", type).set(\"text\", notificationText).set(\"url\",articleUrl).set(\"type\", type)\n .set(\"from_user_id\",fromId).set(\"to_user_id\",toId).set(\"create_time\", simpleFormat.format(now)).save();\n\n }", "private void sendMessage() {\n\n // Get the right Prefix\n String prefix = null;\n\n if ( !messageGroup.getPrefix().equalsIgnoreCase(\"\") ) {\n prefix = messageGroup.getPrefix();\n } else {\n prefix = Announcer.getInstance().getConfig().getString(\"Settings.Prefix\");\n }\n\n Announcer.getInstance().getCaller().sendAnnouncment( messageGroup, prefix, counter);\n\n counter();\n\n }", "public void CrearNotificacionChannel(){\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){\n CharSequence name = \"Notificacion name\";\n NotificationChannel notificationChannel = new NotificationChannel(CHANNEL_ID, name, NotificationManager.IMPORTANCE_DEFAULT);\n NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n notificationManager.createNotificationChannel(notificationChannel);\n }\n }", "private void sendNotification(String notificationDetails)\r\n {\n NotificationManager notificationManager =\r\n (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);\r\n\r\n // 2. Create a PendingIntent for AllGeofencesActivity\r\n Intent intent = new Intent(this, MainActivity.class);\r\n intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n PendingIntent pendingNotificationIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);\r\n\r\n // 3. Create and send a notification\r\n Notification notification = new NotificationCompat.Builder(this)\r\n .setSmallIcon(R.mipmap.ic_launcher)\r\n .setContentTitle(\"notification,\")\r\n .setContentText(notificationDetails)\r\n .setContentIntent(pendingNotificationIntent)\r\n .setStyle(new NotificationCompat.BigTextStyle().bigText(notificationDetails))\r\n .setPriority(NotificationCompat.PRIORITY_HIGH)\r\n .setAutoCancel(true)\r\n .build();\r\n notificationManager.notify(0, notification);\r\n\r\n\r\n\r\n\r\n }" ]
[ "0.55717665", "0.5557737", "0.5547974", "0.54825944", "0.5460827", "0.5405898", "0.539794", "0.53574187", "0.5347485", "0.5307052", "0.52397984", "0.5204557", "0.5186945", "0.5176824", "0.51744676", "0.51594126", "0.51312727", "0.5115834", "0.50968903", "0.50728333", "0.5059142", "0.50573534", "0.5019567", "0.50185084", "0.501623", "0.5012828", "0.50042", "0.50008386", "0.498121", "0.49761465", "0.4971196", "0.4956365", "0.4944184", "0.4940199", "0.49315482", "0.4923581", "0.49176988", "0.49165684", "0.48976907", "0.48943996", "0.48911", "0.4889529", "0.4878238", "0.4876117", "0.4872256", "0.48686078", "0.4859623", "0.48429328", "0.48427", "0.4837209", "0.4829677", "0.48267207", "0.48240182", "0.48226666", "0.48214877", "0.48185197", "0.48125282", "0.48089343", "0.4806119", "0.48035684", "0.48002833", "0.479464", "0.47919768", "0.47911698", "0.47896454", "0.47852665", "0.47841805", "0.47825962", "0.47766083", "0.47751215", "0.47743204", "0.47741914", "0.47685558", "0.4762596", "0.47611547", "0.47511554", "0.47476795", "0.47456104", "0.474378", "0.47407594", "0.4737153", "0.47343296", "0.4733065", "0.47254485", "0.47224826", "0.4712822", "0.4711155", "0.4704256", "0.46978757", "0.46956968", "0.46921504", "0.46888974", "0.46876356", "0.46800458", "0.46695453", "0.46682853", "0.46629667", "0.46615648", "0.46583328", "0.4656958" ]
0.7281182
0
send a notification to user if his task is replied
public void sendTaskRepliedNotification(final Long taskId, final Long replier) { taskExecutor.execute(new AsyncWebTask(notificationDao.getSessionFactory()) { public void runInBackground() { Task task = (Task) getSession().get(Task.class, taskId); User source = (User) getSession().get(User.class, replier); List<User> followers = task.getFollowers(); for (User follower : followers) { if (!follower.equals(source)) { Notification notification = new Notification(); notification.setTask(task); notification.setReceiver(follower); notification.setSource(source); notification.setType(NotificationType.TASK_REPLY); notificationDao.saveNotification(getSession(), notification); updateNotificationMapIfUserExists(follower.getId(), 1); } } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void notifyMessage(Task task);", "private void sendNotification() {\n }", "public void notify(String userId);", "protected void notifyUser()\n {\n }", "private void notifyUser(List<String> result) {\r\n\t\t\tif(Util.getProperty(getApplicationContext(),\"notificationTimeChanged\",\"\").equals(\"true\") \r\n\t\t\t\t\t|| !notifiedToday())\r\n\t\t\t{\r\n\t\t\t\tUtil.setProperty(getApplicationContext(), \"notificationTimeChanged\", \"false\");\r\n\t\t\t\tif(result.size() > 0){\r\n\t\t\t\t\tint itemsDue = result.size();\r\n\t\t\t\t\tStringBuffer notificationText = new StringBuffer();\r\n\t\t\t\t\tfor(int i=0; i<itemsDue; i++){\r\n\t\t\t\t\t\tif(i!=0)\r\n\t\t\t\t\t\t\tnotificationText.append(\", \");\r\n\t\t\t\t\t\tnotificationText.append(result.get(i));\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tContext context = getApplicationContext();\r\n\t\t\t\t\tNotificationManager nm = (NotificationManager)context.getSystemService(NOTIFICATION_SERVICE);\r\n\t\t\t\t\tIntent notificationIntent = new Intent(context,ReminderActivity.class);\r\n\t\t\t\t\tPendingIntent pi = PendingIntent.getActivity(context, 0, notificationIntent,PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_ONE_SHOT);\r\n\t\t\t\t\tNotification n = new Notification.Builder(context)\r\n\t\t\t\t\t.setContentTitle(String.valueOf(itemsDue) + \" Items Due\")\r\n\t\t\t\t\t.setContentText(notificationText.toString())\r\n\t\t\t\t\t.setSmallIcon(R.drawable.ic_launcher)\r\n\t\t\t\t\t//.setLargeIcon(R.drawable.ic_basket)\r\n\t\t\t\t\t.setContentIntent(pi)\r\n\t\t\t\t\t.build();\t \r\n\t\t\t\t\tnm.notify(1, n);\r\n\t\t\t\t}\r\n\t\t\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"dd-MMM-yyyy\",Locale.US);\r\n\t\t\t\tUtil.setProperty(getApplicationContext(), \"ServiceLastRanOn\",formatter.format(new Date()));\r\n\t\t\t}\r\n\t\t}", "public void sendNotification(String task, int id) {\n NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext());\n builder.setContentTitle(\"Amigo ToDo Manager\");\n builder.setContentText(task);\n\n //Create a pending intent to attach with the notif\n Intent i = new Intent(getApplicationContext(), ToDoEditActivity.class);\n Uri todoUri = Uri.parse(ToDoContentProvider.CONTENT_URI + \"/\" + id);\n i.putExtra(ToDoContentProvider.CONTENT_ITEM_TYPE, todoUri);\n PendingIntent pIntent = PendingIntent.getActivity(getApplicationContext(), 101, i, PendingIntent.FLAG_UPDATE_CURRENT);\n builder.setContentIntent(pIntent);\n builder.setSmallIcon(R.mipmap.ic_launcher);\n builder.setAutoCancel(true);\n Notification notif = builder.build();\n\n notificationManager.notify(101, notif);\n\n }", "public void notify(DelegateTask delegateTask)\n {\n }", "public void sendTestFutureNotification() {\n\n }", "public void showTestDoneNotification() {\n Intent intent = new Intent(this, MainActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);\n Notification notification = new NotificationCompat.Builder(getApplicationContext())\n .setContentIntent(PendingIntent.getActivity(this, 0, intent, 0))\n .setSmallIcon(R.drawable.ic_launcher)\n .setContentText(getText(R.string.local_service_test_done))\n .setContentTitle(getText(R.string.local_service_notification)).build();\n notificationManager.notify(NOTIFICATION, notification);\n status = new Status(getString(R.string.ready), false);\n sendStatusMessage();\n }", "private void showEndOfTripNotification() {\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(\"End of trip\")\n .setContentText(\"Notification text has been sent to \" + myFriendObject.getName());\n int mNotificationId = 001;\n NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n manager.notify(mNotificationId, mBuilder.build());\n }", "void sendScheduledNotifications(JobProgress progress);", "@Override\r\n\tpublic void sendNotifications() {\n\r\n\t}", "private void note(Notification n){\r\n\t\tusers.get(n.userID).addNotification(n);\r\n\t\tif (loggedInUsers.contains(n.userID))\r\n\t\t\tcomms.sendMessage(n);\r\n\t}", "public interface Notification {\n /**\n * Method to generate and draw notification message\n * @param task it's task for notification message\n */\n void notifyMessage(Task task);\n}", "@Scheduled\n\tpublic void executeNotification();", "private void sendAjaxResponse( String taskId, WatchedTask task, HttpServletResponse response )\r\n throws IOException\r\n {\r\n\r\n WHttpConfirmationMessageResponse wresponse = new WHttpConfirmationMessageResponse( response );\r\n // wresponse.setRootTag(\"message\");\r\n wresponse.addItem( \"taskid\", taskId );\r\n wresponse.addItem( \"progress\", task.getProgress().getPercentComplete() + \"\" );\r\n wresponse.addItem( \"status\", task.getStatus() );\r\n\r\n if ( task.getErrors() != null )\r\n {\r\n wresponse.addItem( \"errors\", task.getErrors().getClass().getName() + \":\" + task.getErrors().getMessage() );\r\n\r\n }\r\n\r\n wresponse.close();\r\n\r\n }", "public void notifyJoueurActif();", "private void sendNotification() {\n int mNotificationId = 001;\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.ic_action_camera)\n .setContentTitle(\"Daily Selfie\")\n .setContentText(\"Time for another selfie\");\n Intent resultIntent = new Intent(this, MainActivity.class);\n PendingIntent resultPendingIntent =\n PendingIntent.getActivity(\n this,\n 0,\n resultIntent,\n PendingIntent.FLAG_UPDATE_CURRENT\n );\n mBuilder.setContentIntent(resultPendingIntent);\n // Gets an instance of the NotificationManager service\n NotificationManager mNotifyMgr = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n // Builds the notification and issues it.\n mNotifyMgr.notify(mNotificationId, mBuilder.build());\n }", "public TestNotification sendNow(TestNotification notif) {\n\t\treturn null;\n\t}", "public void sendStatusUpdateNotification() {\n\n ParseQuery<ParseObject> query = ParseQuery.getQuery(\"IncidentReports\");\n query.whereEqualTo(\"username\", ParseUser.getCurrentUser().getUsername());\n query.whereEqualTo(\"notified\", \"false\");\n query.findInBackground(new FindCallback<ParseObject>() {\n @Override\n public void done(List<ParseObject> objects, ParseException e) {\n if (e == null && objects.size()>0) {\n\n Intent activityIntent = new Intent(getApplicationContext(), MyActivity.class);\n PendingIntent contentIntent = PendingIntent.getActivity(getApplicationContext(), 0,activityIntent, 0);\n\n String message = \"An incident report you have submitted has been reviewed. Go to 'My Activity' to view update.\";\n android.app.Notification notification = new NotificationCompat.Builder(mContext, StarterApplication.CHANNEL_1_ID)\n .setSmallIcon(R.drawable.unnamed)\n .setLargeIcon(BitmapFactory.decodeResource(mContext.getResources(),\n R.drawable.unnamed))\n .setContentTitle(\"Status Update\")\n .setContentText(message)\n .setStyle(new NotificationCompat.BigTextStyle())\n .setPriority(NotificationCompat.PRIORITY_HIGH)\n .setCategory(NotificationCompat.CATEGORY_MESSAGE)\n .setContentIntent(contentIntent)\n .build();\n\n for (ParseObject object : objects) {\n object.put(\"notified\", \"true\");\n object.saveInBackground();\n }\n\n notificationManager.notify(1, notification);\n Log.i(\"Notification\", \"sent\");\n\n }\n\n else {\n Log.i(\"Notification\", \"Not sent\");\n if (e != null) {\n Log.i(\"Error:\", e.getMessage());\n }\n\n\n }\n }\n });\n }", "private static void notifyUser(ArrayList<Map> res) {\n\t\t\r\n\t\tFile htmlFile = new File(NOTIFICATION_FILE_PATH);\r\n\t\t\r\n\t\ttry {\r\n\t\t\tDesktop.getDesktop().browse(htmlFile.toURI());\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t}", "public interface Task {\n void send(INotificationSideChannel iNotificationSideChannel) throws RemoteException;\n }", "private void sendEmailToSubscriberForHealthTips() {\n\n\n\n }", "private void showNotification() {\n\n }", "public void sendTaskVoteNotification(final Long taskId, final Long voterUserId, final RateDirection direction) {\n\t\ttaskExecutor.execute(new AsyncWebTask(notificationDao.getSessionFactory()) {\n\t\t\tpublic void runInBackground() {\n\t\t\t\tTask task = (Task) getSession().get(Task.class, taskId);\n\t\t\t\tUser source = (User) getSession().get(User.class, voterUserId);\n\t\t\t\tUser receiver = task.getOwner();\n\n\t\t\t\tNotification notification = new Notification();\n\t\t\t\tnotification.setTask(task);\n\t\t\t\tnotification.setReceiver(receiver);\n\t\t\t\tnotification.setSource(source);\n\t\t\t\tif (direction == RateDirection.UP) {\n\t\t\t\t\tnotification.setType(NotificationType.TASK_UPVOTE);\n\t\t\t\t} else {\n\t\t\t\t\tnotification.setType(NotificationType.TASK_DOWNVOTE);\n\t\t\t\t}\n\t\t\t\tnotificationDao.saveNotification(getSession(), notification);\n\n\t\t\t\tupdateNotificationMapIfUserExists(receiver.getId(), 1);\n\t\t\t}\n\t\t});\n\t}", "private void sendNotifications() {\n this.sendNotifications(null);\n }", "public void sendNotification(String str, String str2, String str3, String str4) {\n this.apiService.sendNotification(new Sender(new Data(FirebaseAuth.getInstance().getCurrentUser().getUid(), str3 + \":\" + str4, \"New \" + getIntent().getStringExtra(\"noti\"), str2), str)).enqueue(new Callback<MyResponse>() {\n public void onFailure(Call<MyResponse> call, Throwable th) {\n }\n\n public void onResponse(Call<MyResponse> call, Response<MyResponse> response) {\n if (response.code() == 200) {\n int i = response.body().success;\n }\n }\n });\n }", "void sendEmail(Task task, String taskTypeName, String plantName);", "public void sendNotification(View view) {\n\t\t Intent intent = new Intent(this, MainActivity.class);\r\n\t\t PendingIntent pIntent = PendingIntent.getActivity(this, 0, intent, 0);\r\n\r\n\t\t // Build notification\r\n\t\t // Actions are just fake\r\n\t\t Notification noti = new Notification.Builder(this)\r\n\t\t .setContentTitle(\"TodoList Item\")\r\n\t\t .setContentText(\"A New Item was Added\").setSmallIcon(R.drawable.ic_launcher)\r\n\t\t .setContentIntent(pIntent).build();\r\n\t\t //.addAction(R.drawable.ic_launcher, \"Call\", pIntent);\r\n\t\t //.addAction(R.drawable.ic_launcher, \"More\", pIntent)\r\n\t\t //.addAction(R.drawable.ic_launcher, \"And more\", pIntent).build();\r\n\t\t NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\r\n\t\t // hide the notification after its selected\r\n\t\t noti.flags |= Notification.FLAG_AUTO_CANCEL;\r\n\r\n\t\t notificationManager.notify(0, noti);\r\n\r\n\t\t }", "@Override\n public void setNotification() {\n if (getTense() == Tense.FUTURE) {\n //Context ctx = SHiTApplication.getContext();\n //SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(ctx);\n\n int leadTimeEventMinutes = SHiTApplication.getPreferenceInt(Constants.Setting.ALERT_LEAD_TIME_EVENT, LEAD_TIME_MISSING);\n\n if (leadTimeEventMinutes != LEAD_TIME_MISSING) {\n if (travelTime > 0) {\n leadTimeEventMinutes += travelTime;\n }\n\n setNotification(Constants.Setting.ALERT_LEAD_TIME_EVENT\n , leadTimeEventMinutes\n , R.string.alert_msg_event\n , getNotificationClickAction()\n , null);\n }\n }\n }", "private void showNotification() {\n }", "public void sendNotification(String notifTitle, String notifText) {\n\n }", "public abstract boolean sendNotification(Map<String, Object> processInfo, boolean mailToSend, Object obj);", "private void notifyStakeholder(){\n }", "private void alertReplicatorsDoneExecutingTask(Version theTask) {\n\tsynchronized(_replicatorQueue) {\n\t for (int i = 0; i < _replicatorQueue.size(); i++) {\n\t\tReplicatorHandle rh = (ReplicatorHandle) \n\t\t _replicatorQueue.get(i);\n\t\trh.alertDoneExecutingTask(theTask, this);\n\t }\n\t}\t\n }", "@NonNull\n @Override\n public Result doWork() {\n prefs = new PEPrefs(getApplicationContext());\n try {\n NotificationManagerCompat notificationManagerCompat = NotificationManagerCompat.from(getApplicationContext());\n boolean areNotificationsEnabled = notificationManagerCompat.areNotificationsEnabled();\n\n long longVal = areNotificationsEnabled ? 0 : 1;\n if (!(longVal == prefs.isNotificationDisabled())) {\n if (areNotificationsEnabled && prefs.isSubscriberDeleted()) {\n PushEngage.callAddSubscriberAPI();\n } else {\n UpdateSubscriberStatusRequest updateSubscriberStatusRequest = new UpdateSubscriberStatusRequest(prefs.getSiteId(), prefs.getHash(), longVal, prefs.getDeleteOnNotificationDisable());\n updateSubscriberStatus(updateSubscriberStatusRequest);\n }\n }\n } catch (Throwable e) {\n// e.printStackTrace();\n // Technically WorkManager will return Result.failure()\n // but it's best to be explicit about it.\n // Thus if there were errors, we're return FAILURE\n// Log.d(TAG, \"Error fetching data\", e);\n return Result.failure();\n }\n return Result.success();\n\n }", "public void notify(String userId, int timezoneDiff);", "protected void notify(Employee e) {\n\t}", "private void showNotification() {\n\n Intent intent = new Intent(this, DashboardActivity.class);\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n stackBuilder.addParentStack(DashboardActivity.class);\n stackBuilder.addNextIntent(intent);\n\n final NotificationCompat.Builder builder = new NotificationCompat.Builder(this);\n\n builder.setSmallIcon(R.drawable.ic_gps);\n builder.setContentText(getText(R.string.local_service_started));\n builder.setContentTitle(getText(R.string.local_service_label));\n builder.setOngoing(true);\n builder.setContentIntent(stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT));\n\n final Notification notification = builder.build();\n\n // Send the notification.\n mNotificationManager.notify(NOTIFICATION, notification);\n }", "private void sendNotify(JSONObject notification, String staffID) {\r\n JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(FCM_API, notification,\r\n new Response.Listener<JSONObject>() {\r\n @Override\r\n public void onResponse(JSONObject response) {\r\n Toast.makeText(BookingListDetails.this, \"\"+ staffID + \" has been Notified!\", Toast.LENGTH_SHORT).show();\r\n Log.i(TAG, \"onResponse: \" + response);\r\n startActivity(new Intent(getApplicationContext(), AdminBookingList.class));\r\n finish();\r\n }\r\n },\r\n new Response.ErrorListener() {\r\n @Override\r\n public void onErrorResponse(VolleyError error) {\r\n Toast.makeText(BookingListDetails.this, \"Request error\", Toast.LENGTH_LONG).show();\r\n Log.i(TAG, \"onErrorResponse: Didn't work\");\r\n }\r\n }) {\r\n @Override\r\n public Map<String, String> getHeaders() throws AuthFailureError {\r\n Map<String, String> params = new HashMap<>();\r\n params.put(\"Authorization\", serverKey);\r\n params.put(\"Content-Type\", contentType);\r\n return params;\r\n }\r\n };\r\n MySingleton.getInstance(getApplicationContext()).addToRequestQueue(jsonObjectRequest);\r\n }", "public void sendTaskCreatedInFollowedCommunityNotification(final Long communityId, final Long taskId) {\n\t\ttaskExecutor.execute(new AsyncWebTask(notificationDao.getSessionFactory()) {\n\t\t\tpublic void runInBackground() {\n\t\t\t\tCommunity community = (Community) getSession().get(Community.class, communityId);\n\t\t\t\tTask task = (Task) getSession().get(Task.class, taskId);\n\t\t\t\tUser source = task.getOwner();\n\n\t\t\t\tfor (User user : community.getMembers()) {\n\t\t\t\t\tif (!user.equals(source)) {\n\t\t\t\t\t\tNotification notification = new Notification();\n\t\t\t\t\t\tnotification.setTask(task);\n\t\t\t\t\t\tnotification.setCommunity(community);\n\t\t\t\t\t\tnotification.setReceiver(user);\n\t\t\t\t\t\tnotification.setSource(source);\n\t\t\t\t\t\tnotification.setType(NotificationType.TASK_CREATED_IN_FOLLOWED_COMMUNITY);\n\t\t\t\t\t\tnotificationDao.saveNotification(getSession(), notification);\n\n\t\t\t\t\t\tupdateNotificationMapIfUserExists(user.getId(), 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "private void notifyUploadSuccess() {\n numberOfDone++;\n notificationBuilder.setContentText(getNotificationContent());\n notificationManger.notify(0, notificationBuilder.build());\n }", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) {\n Long multicastId = new Long(req.getParameter(\"multicastKey\"));\n boolean success = mSender.sendMessage(multicastId);\n if (success) {\n taskDone(resp, multicastId);\n } else {\n retryTask(resp);\n }\n }", "@Override\r\n\tpublic void sendGeneralNotification() {\n\t\t\r\n\t}", "public abstract void sendNotification(T notification) throws NotificationException;", "void redirectToNotification();", "public abstract void notifyUser(final User user, final Comment comment);", "private void sendNotification() {\n ParsePush parsePush = new ParsePush();\n String id = ParseInstallation.getCurrentInstallation().getInstallationId();\n Log.d(\"Debug_id\", id);\n Log.d(\"Debug_UserName\", event.getHost().getUsername()); // host = event.getHost().getUsername();\n ParseQuery pQuery = ParseInstallation.getQuery(); // <-- Installation query\n Log.d(\"Debug_pQuery\", pQuery.toString());\n pQuery.whereEqualTo(\"username\", event.getHost().getUsername());// <-- you'll probably want to target someone that's not the current user, so modify accordingly\n parsePush.sendMessageInBackground(\"Hey your Event: \" + event.getTitle() + \" has a subscriber\", pQuery);\n\n }", "private void notifyTaskFinished(int action) {\n Intent intent = new Intent(LocalAction.ACTION_BACKUP_SERVICE_FINISHED);\n intent.putExtra(ACTION, action);\n intent.putExtra(CALLER_ID, mCallerId);\n mBroadcastManager.sendBroadcast(intent);\n }", "private void notifyAutomatically(){\n System.out.println(\"Notificando automaticamente...\");\n }", "private void showNotification() {\n\n NotificationCompat.Builder mBuilder =\n new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.food_icon2)\n .setContentTitle(\"Let's eat\")\n .setContentText(\"Good morning, It's time to take your Breakfast :)\");\n\n int mNotificationId = 001;\n\n\n Intent contentIntent = new Intent(this, RecommendationActivity.class);\n contentIntent.putExtra(\"dePagi\", \"pagigan\");\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n stackBuilder.addParentStack(RecommendationActivity.class);\n stackBuilder.addNextIntent(contentIntent);\n\n PendingIntent resultPendingIntent =\n stackBuilder.getPendingIntent(\n 0,\n PendingIntent.FLAG_UPDATE_CURRENT\n );\n mBuilder.setContentIntent(resultPendingIntent);\n\n mBuilder.setVibrate(new long[] { 1000, 1000, 1000, 1000, 1000 });\n mBuilder.setLights(Color.YELLOW, 3000, 3000);\n\n mBuilder.setAutoCancel(true);\n\n mNM =(NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n mNM.notify(mNotificationId, mBuilder.build());\n\n stopSelf();\n\n }", "@Override\n\t\tpublic boolean deliverSelfNotifications() {\n\t\t\treturn super.deliverSelfNotifications();\n\t\t}", "public static void updateNotification(Context context) {\n Alibi alibi = (Alibi) context.getApplicationContext();\n UserEvent event = alibi.getUserEventManager().getCurrentEvent();\n\n /* Don't set a notification if there isn't already one active; if the\n * event has not been running as long as the reminder interval, there\n * hasn't been a notification set yet.\n */\n long interval = alibi.getSettingsManager().getReminderDelayMillis();\n long startTime = event.getStartTime();\n long currentTime = System.currentTimeMillis();\n\n if (currentTime >= startTime + interval)\n setNotification(context, getNotificationMessage(event));\n }", "private void notifyUser(Context context, String message) {\n\n Uri soundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n\n Intent intent = new Intent(context, MovieActivity.class);\n PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent,\n PendingIntent.FLAG_UPDATE_CURRENT);\n\n NotificationManager manager = (NotificationManager)\n context.getSystemService(Context.NOTIFICATION_SERVICE);\n\n android.support.v4.app.NotificationCompat.Builder builder = new NotificationCompat.Builder(context)\n .setContentTitle(\"device is now \" + message + \".\")\n .setOngoing(true)\n .setVibrate(new long[]{0, 500, 500, 500, 500, 500, 500})\n .setSound(soundUri)\n .setContentIntent(pendingIntent)\n .setSmallIcon(android.R.drawable.sym_def_app_icon)\n .setAutoCancel(true);\n\n manager.notify(1001, builder.build());\n\n }", "@Override\n\tpublic boolean response(Notification notification) {\n\t\tUser sender;\n\t\tif (!userManager.hasUser(notification.getSender())) {\n\t\t\tsender=utils.reinitializeUser(notification.getSender());\n\t\t\tif(sender==null)\n\t\t\t{\n\t\t\t\t//throw exception\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tsender = userManager.getUser(notification.getSender());\n\t\tString receiverUserId = notification.getOwnerId();\n\t\t// Account account;\n\t\tAccount account = accountManager.getAccountByUserId(receiverUserId);\n\t\tif (account == null) {\n\t\t\ttry {\n\t\t\t\taccount = accountDao.getByUserId(receiverUserId);\n\t\t\t\tif (account == null)\n\t\t\t\t\treturn false;\n\t\t\t} catch (AccountNotFoundException e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}\n\t\tsender.setAcceptanceStatus(account, notification.getAcceptanceStatus(),\n\t\t\t\tnotification.getSuggestionId());\n\t\tAccount receiverAccount = accountManager\n\t\t\t\t.getAccountByUserId(receiverUserId);\n\t\tif (receiverAccount == null) {\n\t\t\ttry {\n\t\t\t\treceiverAccount = accountDao.getByUserId(receiverUserId);\n\t\t\t\tif (receiverAccount == null)\n\t\t\t\t\treturn false;\n\t\t\t} catch (AccountNotFoundException e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}\n\t\tUser receiver;// =userManager.getUser(receiverAccount);\n\t\tif (!userManager.hasUser(receiverAccount)) {\n\t\t\treceiver=utils.reinitializeUser(receiverAccount);\n\t\t\tif(receiver==null)\n\t\t\t{\n\t\t\t\t//throw exception\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treceiver = userManager.getUser(receiverAccount);\n\t\treceiver.deleteNotification(notification);\n\t\t// check for all the other status values(logic)\n\t\t// the statement below modifies the acceptanceStatus by the specific\n\t\t// ownerID\n\t\tboolean success = false;\n\t\ttry {\n\t\t\tsuccess = suggestionDao.modifySuggestionReceiver(notification,\n\t\t\t\t\t\"acceptanceStatus\");\n\t\t\tif (!success) {\n\t\t\t\tsuccess = suggestionDao.modifySuggestionReceiver(notification,\n\t\t\t\t\t\t\"acceptanceStatus\");\n\t\t\t\tif (!success) {\n\t\t\t\t\t// an exception should be thrown for transaction management\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (SuggestionNotFoundException e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t\treturn false;\n\t\t}\n\t\treturn success;\n\t}", "public void sendIncidentNotification() {\n\n final ParseQuery<ParseObject> pendingNotifs = ParseQuery.getQuery(\"PendingNotifications\");\n pendingNotifs.whereEqualTo(\"username\", ParseUser.getCurrentUser().getUsername());\n pendingNotifs.findInBackground(new FindCallback<ParseObject>() {\n @Override\n public void done(List<ParseObject> objects, ParseException e) {\n if ( e == null) {\n if (objects.size()>0) {\n for (ParseObject object : objects) {\n String type = object.getString(\"type\");\n\n Intent activityIntent = new Intent(getApplicationContext(), MyNeighbourhood.class);\n PendingIntent contentIntent = PendingIntent.getActivity(NotificationAbstract.this, 0,activityIntent, 0);\n\n String message = \"A new \" + type + \" incident has occurred in your neighbourhood. Check 'my Neighbourhood' to view details\";\n android.app.Notification notification = new NotificationCompat.Builder(mContext, StarterApplication.CHANNEL_1_ID)\n .setSmallIcon(R.drawable.unnamed)\n .setLargeIcon(BitmapFactory.decodeResource(mContext.getResources(),\n R.drawable.unnamed))\n .setContentTitle(\"New \" + type + \" Incident\")\n .setContentText(message)\n .setStyle(new NotificationCompat.BigTextStyle())\n .setPriority(NotificationCompat.PRIORITY_HIGH)\n .setCategory(NotificationCompat.CATEGORY_MESSAGE)\n .setContentIntent(contentIntent)\n .build();\n\n notificationManager.notify(1, notification);\n Log.i(\"NotificationIncident\", \"sent\");\n\n ParseUser.getCurrentUser().put(\"notifiedUpdated\", \"true\");\n try {\n object.delete();\n } catch (ParseException e1) {\n e1.printStackTrace();\n }\n ParseUser.getCurrentUser().saveInBackground();\n\n }\n }\n }\n }\n });\n\n\n if (ParseUser.getCurrentUser().getString(\"notifiedUpdated\").matches(\"false\")) {\n Log.i(\"Incident:\", \"Incident notification needs to be sent\");\n // the user is NOT up to date, so query incidents\n\n\n\n }\n\n else {\n Log.i(\"Incident\", \"Incident notification not sending\");\n String stat = ParseUser.getCurrentUser().getString(\"pending\");\n if (stat != null){\n\n }\n else {\n\n }\n }\n }", "public abstract void notify(JSONObject message);", "private void newTask()\n {\n \t//TODO add alarm\n \tTask task = new Task(taskName.getText().toString(), taskDetails.getText().toString());\n \tdb.createTask(task);\n \t//TODO Tie notification to an alarm\n \t//Create notification\n \tIntent notifyIntent = new Intent(this, TaskNotification.class);\n \tnotifyIntent.putExtra(\"title\", task.name); //add title name\n \tnotifyIntent.putExtra(\"id\", (int) task.id); //add id\n \tstartActivity(notifyIntent); //create the intent\n \t\n \trefreshData();\n }", "private void showNotification() {\n CharSequence text = \"Running\";\n\n // The PendingIntent to launch our activity if the user selects this notification\n PendingIntent contentIntent = PendingIntent.getActivity(this, 0,\n new Intent(this, MainActivity.class), 0);\n\n // Set the info for the views that show in the notification panel.\n Notification notification = new Notification.Builder(this)\n //.setSmallIcon(R.drawable.stat_sample) // the status icon\n .setTicker(text) // the status text\n //.setWhen(System.currentTimeMillis()) // the time stamp\n .setContentTitle(\"PodcastFTPService\") // the label of the entry\n .setContentText(text) // the contents of the entry\n .setContentIntent(contentIntent) // The intent to send when the entry is clicked\n .build();\n\n // Send the notification.\n mNM.notify(0, notification);\n }", "void notify(PushMessage m);", "@Override\n protected Object doMonitoredTask() {\n String originalEmail = getUser().getEmailAddress();\n String originalName = getUser().getDisplayName();\n\n getAreaContext().doAreaTask(new DeleteUserTask(getUser().getOid()));\n\n // bl: delete all of the user's content synchronously, too.\n getNetworkContext().doGlobalTask(new DeleteUserAccountContentTask(getUser(), originalName));\n\n // jw: send an email to the user so they have a record of this change. Important if someone else got access to their account and did this for them.\n getAreaContext().doAreaTask(new SendUserDeletedOrActivationStatusChangeEmailTask(getUser(), originalName, originalEmail, true));\n\n return null;\n }", "void onHisNotify();", "@Override\n public void doNotify(String result) {\n this.result = result;\n }", "public static void printTaskAlreadyDoneMessage() {\n botSpeak(Message.TASK_ALREADY_DONE_MESSAGE);\n }", "static void sendNotifications() {\n\t\testablishConnection();\n\t\tSystem.out.println(\"sending multiple notificatiosn\");\n\t}", "void showNotification() {\n Intent notificationIntent = new Intent(mContext, MainActivity.class);\n\n // Construct a task stack.\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(mContext);\n\n // Add the main Activity to the task stack as the parent.\n stackBuilder.addParentStack(MainActivity.class);\n\n // Push the content Intent onto the stack.\n stackBuilder.addNextIntent(notificationIntent);\n\n // Get a PendingIntent containing the entire back stack.\n PendingIntent notificationPendingIntent =\n stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);\n\n Notification.Builder notificationBuilder = new Notification.Builder(mContext)\n .setContentTitle(getLocationResultTitle())\n .setContentText(getLocationResultText())\n .setSmallIcon(R.mipmap.ic_launcher)\n .setAutoCancel(true)\n .setContentIntent(notificationPendingIntent);\n\n getNotificationManager().notify(0, notificationBuilder.build());\n }", "@Override\r\n public String notification(boolean status) {\r\n if (status == true) {\r\n return \"Sepatu Api Terpasang\";\r\n } else {\r\n return \"Sepatu Api Dilepas\";\r\n }\r\n }", "private void fireNotification(Drop drop) {\n String message = drop.getWhat();\n NotificationCompat.Builder builder = new NotificationCompat.Builder(this, BucketDropsApplication.CHANNEL_ID)\n .setSmallIcon(R.drawable.ic_mail_outline)\n .setContentTitle(message)\n .setContentText(getString(R.string.notif_message))\n .setAutoCancel(true)\n .setPriority(NotificationCompat.PRIORITY_DEFAULT);\n NotificationManagerCompat notificationManagerCompat = NotificationManagerCompat.from(this);\n notificationManagerCompat.notify(100+(++i), builder.build());\n Log.d(\"utsab\",\"Notification \"+i);\n }", "private void handleActionNotification() {\n String result = getQuote(stringsArray);\n// Notification myNotification = new Notification.Builder(this)\n// .setAutoCancel(true)\n// .setDefaults(Notification.DEFAULT_ALL)\n// .setWhen(System.currentTimeMillis())\n// .setSmallIcon(R.mipmap.ic_launcher)\n// .setContentText(result)\n// .build();\n//\n// NotificationManagerCompat manager = NotificationManagerCompat.from(this);\n// manager.notify(0, myNotification);\n\n\n NotificationCompat.Builder builder = new NotificationCompat.Builder(this)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(\"My notification\")\n .setContentText(result);\n\n NotificationManager notificationManager = (NotificationManager)this\n .getSystemService(Context.NOTIFICATION_SERVICE);\n int id = 1;\n notificationManager.notify(id, builder.build());\n }", "private void setNotification() {\n mBuilder.setProgress(updateMax, ++updateProgress, false)\n .setContentTitle(getResources().getString(R.string.notification_message));\n // Issues the notification\n nm.notify(0, mBuilder.build());\n }", "private void alertReplicatorsExecutingTask(Version theTask) {\n\tsynchronized(_replicatorQueue) {\n\t for (int i = 0; i < _replicatorQueue.size(); i++) {\n\t\tReplicatorHandle rh = (ReplicatorHandle) \n\t\t _replicatorQueue.get(i);\n\t\trh.alertExecutingTask(theTask, this);\n\t }\n\t}\t\n }", "private int notify(Wishlist wishlist, WishlistItem watched, InventoryItem invItem) {\n\t\tif (watched.isNotified) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tSystem.out.println(invItem.name + \" is in stock. Notify \" + wishlist.distributorID);\n\t\tif (notifier.notifyInStock(wishlist.notificationEmail, invItem.name)) {\n\t\t\twatched.setNotified();\n\t\t}\n\t\treturn 1;\n\t}", "public void execute(DelegateExecution execution) {\n System.out.println(\"Sending email now\");\n }", "public void sendnotification(View v){\r\n\t\tRequest req=(Request)v.getTag();\r\n\t\tLog.d(\"selected\", req.getPassenger().getId().toString());\r\n\t\t\r\n//\t\trideresponse=\r\n\t\t\t\trideStart(req, new LatLng(req.getLocation().getLatitude(), req.getLocation().getLongitude()),(Location)this.getIntent().getSerializableExtra(\"mylocation\"));\r\n\t\t\r\n//\t\tIntent intent = new Intent(this, RideStartActivity.class);\r\n// \t \tintent.putExtra(\"ride\", rideresponse);\r\n// \t \tstartActivity(intent);\r\n// \t \tfinish();\r\n\t\t}", "void notify(Message m);", "void notifyStatus(String strStatus)\n \t{\n \tSharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);\n \tboolean bNotify = prefs.getBoolean(\"notify_status\", true);\n \t\n \tif (bNotify)\n \t{\n \t \tNotification notification = new Notification(\n \t \t\t\tR.drawable.icon, strStatus, System.currentTimeMillis());\n \t \tPendingIntent contentIntent = PendingIntent.getActivity(\n \t \t\t\tthis, 0, new Intent(this, MainActivity.class), 0);\n \t \tnotification.setLatestEventInfo(\n \t \t\t\tthis, getText(R.string.app_name), strStatus, contentIntent);\n \t \tmNM.notify(R.string.app_name, notification);\n \t}\n \n \t}", "public synchronized static boolean markNotificationAsRead(final Context context, long notifId)\r\n {\r\n String response;\r\n\r\n try\r\n {\r\n RequestFuture<String> future = RequestFuture.newFuture();\r\n\r\n SharedPreferencesManager sharedPreferencesManager = new SharedPreferencesManager(context);\r\n\r\n User user = sharedPreferencesManager.retrieveUser();\r\n\r\n final String fixedURL = Utils.fixUrl(Properties.SERVER_URL + \":\" + Properties.SERVER_SPRING_PORT\r\n + \"/notification/\" + user.getId() + \"/\" + notifId);\r\n\r\n Log.d(Properties.TAG, \"[REST_CLIENT_SINGLETON] Conectando con: \" + fixedURL\r\n + \" para marcar la notificacion \" + notifId + \" como leida\");\r\n\r\n // Creamos una peticion\r\n final StringRequest jsonObjReq = new StringRequest(Request.Method.GET\r\n , fixedURL\r\n , future\r\n , future);\r\n\r\n // La mandamos a la cola de peticiones\r\n VolleySingleton.getInstance(context).addToRequestQueue(jsonObjReq);\r\n Log.d(Properties.TAG, \"[REST_CLIENT_SINGLETON] Petición creada y enviada\");\r\n\r\n try\r\n {\r\n response = future.get(20, TimeUnit.SECONDS);\r\n Log.d(Properties.TAG, \"[REST_CLIENT_SINGLETON] Respuesta recibida: \" + response);\r\n\r\n // Si ha ido bien, guardamos la notificacion y actualizamos el usuario.\r\n if (response != null && response.equals(Properties.ACCEPTED))\r\n {\r\n Log.d(Properties.TAG, \"[REST_CLIENT_SINGLETON] Se añade la notificación como leída\");\r\n\r\n user = sharedPreferencesManager.retrieveUser();\r\n\r\n user.addNotificationAsRead(notifId);\r\n\r\n sharedPreferencesManager.insertUser(user);\r\n }\r\n\r\n } catch (InterruptedException e) {\r\n ExceptionPrinter.printException(\"REST_CLIENT_SINGLETON\", e);\r\n\r\n return false;\r\n }\r\n\r\n } catch (Exception e) {\r\n ExceptionPrinter.printException(\"REST_CLIENT_SINGLETON\", e);\r\n\r\n return false;\r\n }\r\n\r\n return true;\r\n }", "private void notifyTtsCompleted()\n {\n //if(resources.getTtsCallbackUrl().compareTo())\n RequestDispatcher dispatcher = new RequestDispatcher(this);\n dispatcher.execute(resources.getTtsCallbackUrl(), \"\", \"\", \"true\");\n Intent i = new Intent(\"ttsCompleted-event\");\n LocalBroadcastManager.getInstance(myContext).sendBroadcast(i);\n }", "@Override\n public void run()\n {\n Intent intent = new Intent(context, NotifyService.class);\n intent.putExtra(NotifyService.INTENT_NOTIFY, true);\n intent.putExtra(\"REMINDER\", showInfo);\n PendingIntent pendingIntent = PendingIntent.getService(context, 0, intent, 0);\n\n boolean alarmUp = (PendingIntent.getBroadcast(context, 0,\n new Intent(\"is.activites.scheduleActivites.INTENT_NOTIFY\"),\n PendingIntent.FLAG_NO_CREATE) != null);\n\n // Sets an alarm - note this alarm will be lost if the phone is turned off and on again\n if(!alarmUp) am.set(AlarmManager.RTC_WAKEUP, date.getTimeInMillis(), pendingIntent);\n }", "public void sendVoteNotification() {\n\t\t\t\t\tWorld.sendWorldMessage(\"<img=5>[Vote Feed]: colorhere\" + getDisplayName() + \" </col>voted for\" + \n\t\t\t\t\t\t\t\t\t\t\t\"colorhere \"+ voteDisplayAmount +\" Vote Tickets!</col> \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"World votes are now at colorhere\"+ WorldVote.getVotes()+\"</col>.\", false);\t\n\t}", "private void sendNotification(JSONObject notification, final String staffID) {\r\n JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(FCM_API, notification,\r\n new Response.Listener<JSONObject>() {\r\n @Override\r\n public void onResponse(JSONObject response) {\r\n Toast.makeText(BookingListDetails.this, \"\"+ staffID + \" has been Notified!\", Toast.LENGTH_SHORT).show();\r\n Log.i(TAG, \"onResponse: \" + response);\r\n }\r\n },\r\n new Response.ErrorListener() {\r\n @Override\r\n public void onErrorResponse(VolleyError error) {\r\n Toast.makeText(BookingListDetails.this, \"Request error\", Toast.LENGTH_LONG).show();\r\n Log.i(TAG, \"onErrorResponse: Didn't work\");\r\n }\r\n }) {\r\n @Override\r\n public Map<String, String> getHeaders() throws AuthFailureError {\r\n Map<String, String> params = new HashMap<>();\r\n params.put(\"Authorization\", serverKey);\r\n params.put(\"Content-Type\", contentType);\r\n return params;\r\n }\r\n };\r\n MySingleton.getInstance(getApplicationContext()).addToRequestQueue(jsonObjectRequest);\r\n }", "@Override\n protected void succeeded() {\n eventService.publish(new TaskEndedEvent(this));\n\n }", "private void setFinalNotification() {\n //finished downloading all files\n // update notification\n String note = getResources().getString(R.string.update_complete);\n mBuilder.setContentTitle(note)\n .setContentText(\"\")\n .setSmallIcon(R.drawable.ic_launcher_mp)\n .setTicker(note)\n .setProgress(0, 0, false);\n nm.notify(0, mBuilder.build());\n }", "public void updateTask() {}", "private void notifyTaskCompletion(BackgroundTaskResult result)\n {\n //Use the activity reference to update the UI only\n //if it is available.\n if (null != activity) {\n BaseController controller = getController();\n if (controller != null && controller instanceof BackgroundTaskListener) {\n ((BackgroundTaskListener)controller).onBackgroundTaskCompleted(result);\n }\n updateOnActivityAttach = false;\n }\n else {\n updateOnActivityAttach = true;\n }\n }", "@Override\r\n public void notify(Object arg) {\n }", "public void sendStatusNotification(String msg){\n this.sendNotification(2, \"Lawnmower Status\", msg, R.drawable.logomarkerr);\n }", "public void emailNotePosted(\n\t\t\tUserService userService, Note note\n\t\t);", "void notificationReceived(Notification notification);", "public void addTask(Task task) {\n\t\tMessage msg=new Message(null, null, task);\n\t\ttry {\n\t\t\tchannel.send(msg);\n\t\t}\n\t\tcatch (Exception ex) {\n\t\t\t//Runtime exception with info for use in debugging\n\t\t\tthrow new RuntimeException(ex.getMessage());\n\t\t}\n\t}", "private void showReminderNotification(Context context) {\n // inisialisasi channel id, channel name, judul notifikasi, pesan notifikasi, intent, dan id request\n String CHANNEL_ID = \"Channel_1\";\n String CHANNEL_NAME = \"Reminder Channel App\";\n String title = context.getString(R.string.reminder_app_title);\n String message = context.getString(R.string.reminder_app_message);\n Intent intent = new Intent(context, MainActivity.class);\n int REQUST_CODE_APP = 110;\n\n PendingIntent pendingIntent = TaskStackBuilder.create(context)\n .addNextIntent(intent)\n .getPendingIntent(REQUST_CODE_APP, PendingIntent.FLAG_UPDATE_CURRENT);\n\n // statement ini berfungsi untuk membuat notifikasi kita dapat berkerja dengan sistem android\n NotificationManager notificationManager\n = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\n\n // mengset bunyi notifikasi, disini menggunakan bunyi default notifikasi pada sistem android\n Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n\n // method ini berfungsi untuk mengatur isi notifikasi\n NotificationCompat.Builder builder = new NotificationCompat.Builder(context, CHANNEL_ID)\n .setSmallIcon(R.drawable.ic_notifications_black_24dp) // set icon kecil notifikasi\n .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), // set icon besar notifikasi\n R.drawable.baseline_notification_important_white_48dp))\n .setContentTitle(title) // set judul notifikasi\n .setContentText(message) // set pesan notifikasi\n .setContentIntent(pendingIntent) // set aksi notifikasi\n .setVibrate(new long[]{1000, 1000, 1000, 1000, 1000}) // set pola getar saat notifikasi\n .setSound(alarmSound); // set bunyi notifikasi yang akan digunakan\n\n // statement ini berfungsi supaya notifikasi yang telah dibuat dapat berjalan di android\n // dengan OS Oreo ke atas\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, CHANNEL_NAME,\n NotificationManager.IMPORTANCE_DEFAULT);\n\n channel.enableVibration(true);\n channel.setVibrationPattern(new long[]{1000, 1000, 1000, 1000, 1000});\n\n builder.setChannelId(CHANNEL_ID);\n if (notificationManager != null) {\n notificationManager.createNotificationChannel(channel);\n }\n }\n\n // statement ini berfungsi supaya notifikasi yang telah dibuat dapat berjalan di bawah\n // android dengan OS Oreo ke bawah\n Notification notification = builder.build();\n if (notificationManager != null) {\n notificationManager.notify(ID_APP, notification);\n }\n }", "public void notifyUserInfo(String userInfo);", "@Override\n public void doUpdate(NotificationMessage notification) {\n \n }", "private void sendNotification(Map<String, String> serverData) {\n Intent intent = new Intent(serverData.get(\"click_action\"));\n String title = serverData.get(\"title\");\n String body = serverData.get(\"body\");\n intent.putExtra(\"title\",title);\n intent.putExtra(\"body\",body);\n intent.putExtra(\"order\" , serverData.get(\"order\"));\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n PendingIntent pendingIntent = PendingIntent.getActivity(this,0 /* request code */, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n long[] pattern = {500,500,500,500,500};\n\n Uri defaultSoundUri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n\n NotificationCompat.Builder notificationBuilder = (NotificationCompat.Builder) new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.ok)\n .setContentTitle(serverData.get(\"title\"))\n .setContentText(serverData.get(\"body\"))\n .setAutoCancel(true)\n .setVibrate(pattern)\n .setLights(Color.BLUE,1,1)\n .setSound(defaultSoundUri)\n .setContentIntent(pendingIntent);\n\n NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n notificationManager.notify(0 , notificationBuilder.build());\n }", "Notification createAppointmentConfirmationNotification(Appointment appointment);", "private void showNotification() {\r\n\t\t// In this sample, we'll use the same text for the ticker and the\r\n\t\t// expanded notification\r\n\t\tCharSequence text = getText(R.string.local_service_started);\r\n\r\n\t\t// Set the icon, scrolling text and timestamp\r\n\t\tNotification notification = new Notification(R.drawable.compass25,\r\n\t\t\t\ttext, System.currentTimeMillis());\r\n\t\tnotification.sound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\r\n\t\t// The PendingIntent to launch our activity if the user selects this\r\n\t\t// notification\r\n\t\tIntent intent = new Intent(this, TaskOverViewActivity.class);\r\n\t\t//intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);\r\n\t\tPendingIntent contentIntent = PendingIntent.getActivity(this, 0,\r\n\t\t\t\tintent, PendingIntent.FLAG_UPDATE_CURRENT);\r\n\r\n\t\t// Set the info for the views that show in the notification panel.\r\n\t\tnotification.setLatestEventInfo(this, getText(R.string.service_name),\r\n\t\t\t\ttext, contentIntent);\r\n\r\n\t\t// Send the notification.\r\n\t\t// We use a layout id because it is a unique number. We use it later to\r\n\t\t// cancel.\r\n\t\tmNM.notify(R.string.local_service_started, notification);\r\n\t}", "@Override\r\n\tpublic void sendNotification(String notificationType) {\n\t\t\r\n\t}", "public void btnpress(View view) {\n NewMessageNotification newMessageNotification = new NewMessageNotification();\n newMessageNotification.notify(MainActivity.this,\"Danger\",1);\n }", "@Override\n\t\tpublic void run() {\n\t\t\tresult = HttpRequestUtil.sendGet(serverUrl + \"services/tmp_notice_detail\", \"id=\" + id, (OilApplication)getApplication());\n\t\t\ttry {\n\t\t\t\tJSONObject json = new JSONObject(result);\n\t\t\t\tif(json.getInt(\"status\") == 200) {\n\t\t\t\t\tgetHandler.sendMessage(getHandler.obtainMessage());\n\t\t\t\t}\n\t\t\t} catch (JSONException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "public void notifyCreation() {\n Player targetPlayer = this.getTarget().getPlayerReference(Player.class),\n senderPlayer = this.getToTeleport().getPlayerReference(Player.class);\n\n if (targetPlayer == null || senderPlayer == null) {\n return;\n }\n\n MainData.getIns().getMessageManager().getMessage(\"TPA_SENT\").sendTo(senderPlayer);\n\n if (this.type == TeleportType.TPA) {\n MainData.getIns().getMessageManager().getMessage(\"TPA_REQUESTED\")\n .format(\"%player%\", getToTeleport().getNameWithPrefix()).sendTo(targetPlayer);\n } else if (this.type == TeleportType.TPHERE) {\n MainData.getIns().getMessageManager().getMessage(\"TPHERE_REQUESTED\")\n .format(\"%player%\", getToTeleport().getNameWithPrefix()).sendTo(targetPlayer);\n }\n\n }" ]
[ "0.70025504", "0.68620926", "0.6626699", "0.65945905", "0.65828395", "0.65578276", "0.64492726", "0.63175297", "0.62803704", "0.62533283", "0.62347144", "0.622759", "0.6182792", "0.6179266", "0.6149856", "0.61452794", "0.6093539", "0.6068267", "0.60050964", "0.59983456", "0.596402", "0.5958603", "0.595832", "0.5957414", "0.59053403", "0.58978695", "0.58936334", "0.58904624", "0.58869797", "0.588597", "0.5871528", "0.5868904", "0.5830815", "0.58174443", "0.58032805", "0.5800325", "0.57936376", "0.57925594", "0.57791764", "0.5779109", "0.577393", "0.57572544", "0.5755151", "0.57479465", "0.5739852", "0.57331735", "0.5732079", "0.57256275", "0.5724063", "0.5722505", "0.5720024", "0.5707284", "0.5705258", "0.56901723", "0.56605476", "0.56555307", "0.5655481", "0.5648837", "0.5628944", "0.56167656", "0.56089", "0.5605721", "0.56006306", "0.55962414", "0.55955297", "0.55941796", "0.5587191", "0.55846894", "0.5581887", "0.5580161", "0.55752105", "0.5553907", "0.5552946", "0.55453223", "0.55338985", "0.5513083", "0.5508363", "0.5500885", "0.5489841", "0.54895747", "0.54895675", "0.5481918", "0.54809827", "0.54803497", "0.54752547", "0.5475018", "0.5473607", "0.5472799", "0.54703707", "0.5464951", "0.54583436", "0.54543465", "0.54486585", "0.5448503", "0.5447513", "0.5443808", "0.5442372", "0.54384106", "0.543749", "0.5435446" ]
0.73271453
0
send a notification to user if his task is voted
public void sendTaskVoteNotification(final Long taskId, final Long voterUserId, final RateDirection direction) { taskExecutor.execute(new AsyncWebTask(notificationDao.getSessionFactory()) { public void runInBackground() { Task task = (Task) getSession().get(Task.class, taskId); User source = (User) getSession().get(User.class, voterUserId); User receiver = task.getOwner(); Notification notification = new Notification(); notification.setTask(task); notification.setReceiver(receiver); notification.setSource(source); if (direction == RateDirection.UP) { notification.setType(NotificationType.TASK_UPVOTE); } else { notification.setType(NotificationType.TASK_DOWNVOTE); } notificationDao.saveNotification(getSession(), notification); updateNotificationMapIfUserExists(receiver.getId(), 1); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void doVote() {\n }", "void votedOnPoll(String pollId);", "public void sendVoteNotification() {\n\t\t\t\t\tWorld.sendWorldMessage(\"<img=5>[Vote Feed]: colorhere\" + getDisplayName() + \" </col>voted for\" + \n\t\t\t\t\t\t\t\t\t\t\t\"colorhere \"+ voteDisplayAmount +\" Vote Tickets!</col> \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"World votes are now at colorhere\"+ WorldVote.getVotes()+\"</col>.\", false);\t\n\t}", "public static void doVoteAndComment() {\n }", "public void updateTaskVoteNotification(final Long taskId, final Long voterUserId, final RateDirection direction) {\n\t\ttaskExecutor.execute(new AsyncWebTask(notificationDao.getSessionFactory()) {\n\t\t\tpublic void runInBackground() {\n\t\t\t\tNotificationType previousNotificationType;\n\t\t\t\tNotificationType newNotificationType;\n\n\t\t\t\tTask task = (Task) getSession().get(Task.class, taskId);\n\t\t\t\tUser source = (User) getSession().get(User.class, voterUserId);\n\t\t\t\tUser receiver = task.getOwner();\n\n\t\t\t\tif (direction == RateDirection.UP) {\n\t\t\t\t\tpreviousNotificationType = NotificationType.TASK_DOWNVOTE;\n\t\t\t\t\tnewNotificationType = NotificationType.TASK_UPVOTE;\n\t\t\t\t} else {\n\t\t\t\t\tpreviousNotificationType = NotificationType.TASK_UPVOTE;\n\t\t\t\t\tnewNotificationType = NotificationType.TASK_DOWNVOTE;\n\t\t\t\t}\n\n\t\t\t\tNotification notification = notificationDao.findNotification(getSession(), receiver.getId(), source.getId(), task.getId(), previousNotificationType);\n\n\t\t\t\tif (notification != null) {\n\t\t\t\t\tnotification.setType(newNotificationType);\n\t\t\t\t\tnotificationDao.updateNotification(getSession(), notification);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "private void postVote() {\n if ( unvotedParties() == 0 )\n TransactionManager.getTransactionManager().resolveTransaction(txId);\n }", "boolean hasVotedOnPoll(String pollId);", "private synchronized void delegateVoted(Vote voteType) {\n\t\tvotes.put(currentlyVoting, voteType);\n\t\tif (currentlyVoting.getStatus().hasVetoPower && voteType.isVoteAgainst) {\n\t\t\t// A delegate with veto power voted against.\n\t\t\tvetoed = true;\n\t\t}\n\t\tsynchronized (votingThread) {\n\t\t\tvotingThread.notify();\n\t\t}\n\t}", "public synchronized void reportVotes() {\n StringBuilder voteReport = new StringBuilder(\"\");\n for (Player player : playerVotes.keySet()) {\n voteReport.append(player.getUserName()).append(\": \").append(\n playerVotes.get(player) ? \"yes\\n\" : \"no\\n\");\n }\n sendPublicMessage(\"The votes were:\\n\" + voteReport.toString());\n }", "@Override\n public Task<Boolean> then(@NonNull Task<Long> task) throws Exception {\n return addPostToUserUpvoted(postReference, postObject.getOp()).continueWith(new Continuation<Void, Boolean>() {\n @Override\n public Boolean then(@NonNull Task task) throws Exception {\n // Not upvoting post anymore\n upvotingPost = false;\n return true;\n }\n });\n }", "void handle(VoteMessage vote);", "@Override\n public Boolean then(@NonNull Task task) throws Exception {\n upvotingPost = false;\n return true;\n }", "@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\n\t\t\t\t\tdoVote(getIntent().getStringExtra(\"aid\"), getIntent().getStringExtra(\"id\"));\n\t\t\t\t\t\n\t\t\t\t}", "void addVote(UserId userId, QuestionId questionId, int vote);", "public void addVote() {\n this.votes++;\n }", "public void deleteTaskVoteNotification(final Long taskId, final Long receiverId, final Long voterUserId) {\n\t\ttaskExecutor.execute(new AsyncWebTask(notificationDao.getSessionFactory()) {\n\t\t\tpublic void runInBackground() {\n\t\t\t\tUser source = (User) getSession().get(User.class, voterUserId);\n\t\t\t\tUser receiver = (User) getSession().get(User.class, receiverId);\n\n\t\t\t\tNotification notification = notificationDao.findTaskVoteNotification(getSession(), receiver.getId(), source.getId(), taskId);\n\n\t\t\t\tif (notification != null) {\n\t\t\t\t\tif (notification.getIsRead() == Boolean.FALSE) {\n\t\t\t\t\t\tupdateNotificationMapIfUserExists(receiver.getId(), -1);\n\t\t\t\t\t}\n\n\t\t\t\t\tnotificationDao.deleteWithSession(getSession(), notification);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public void vote(int index,Person voter,ArrayList<String> choices){\n votingList.get(index).vote(voter,choices);\n\n }", "public void sendVoteRequests() {\n for(int i = 1; i <= mConfig.getNumServers(); i++) {\n this.remoteRequestVote(i, mConfig.getCurrentTerm(), mID, mLog.getLastIndex(), mLog.getLastTerm());\n }\n //Initiate count vote timer\n voteCountTimer = scheduleTimer((long) 5, 2);\n }", "@Override\n public Task then(@NonNull Task<DocumentSnapshot> task) throws Exception {\n boolean alreadyUpvoted = task.getResult().exists();\n\n if (alreadyUpvoted) {\n throw new AlreadyUpvotedException();\n } else {\n // Not currently upvoted\n\n // Creates a HashMap containing a new entry to add to the user's upvoted posts\n HashMap<String, Object> data = new HashMap<>();\n data.put(\"post\", postReference);\n data.put(\"timestamp\", new Date());\n\n // Add the post to the user's upvoted posts\n return userReference.collection(\"upvotedPosts\").document(postReference.getId()).set(data);\n }\n }", "public void addVote(String token);", "public void vote(int rating) {\n\t\tnew WebTraceTask(this, String.valueOf(rating)).execute(WebTraceTask.VOTE);\n\t}", "public interface OnVoteComplete{\n void onSuccess(Boolean response);\n }", "public void printVottingQuestion(){\n for (Voting voting : votingList){\n System.out.println(\"question : \"+voting.getQuestion());\n }\n\n }", "public boolean getVotedUp() {\n\t\treturn votedUp;\n\t}", "@Override\n public Task<Boolean> then(@NonNull Task task) throws Exception {\n return addPostScoreToUser(postObject.getOp(), 1L).continueWithTask(new Continuation<Long, Task<Boolean>>() {\n @Override\n public Task<Boolean> then(@NonNull Task<Long> task) throws Exception {\n // Add post to user's upvoted posts\n return addPostToUserUpvoted(postReference, postObject.getOp()).continueWith(new Continuation<Void, Boolean>() {\n @Override\n public Boolean then(@NonNull Task task) throws Exception {\n // Not upvoting post anymore\n upvotingPost = false;\n return true;\n }\n });\n }\n });\n }", "public void notify(String userId);", "protected void saveVote(Long voteForId) {\n if (mywebapp.getAuthenticatedUser() == null) {\n getMessagePanel().displayMessage(\"Please login before voting.\");\n return;\n }\n ContestRequest contestRequest = new ContestRequest();\n GWT.log(\"authToken=\" + mywebapp.getAuthToken());\n contestRequest.setAuthToken(mywebapp.getAuthToken());\n //we don't init the check boxes when it's location only\n for (Long contestId : ratingMap.keySet()) {\n Rating rating = ratingMap.get(contestId);\n //only register if there was a vote\n Integer val = rating.getValue();\n if (val > 0) {\n ContestEntryHolder ceh = new ContestEntryHolder();\n ceh.setContestId(contestId);\n ceh.setRating(val);\n ceh.setVoteForId(voteForId);\n contestRequest.getContestEntryHolders().add(ceh);\n }\n }\n ApiServiceAsync myService = mywebapp.getApiServiceAsync();\n myService.vote(contestRequest, new AsyncCallback() {\n public void onFailure(Throwable caught) {\n //postDialog.hide();\n getMessagePanel().displayError(caught.getMessage());\n }\n\n public void onSuccess(Object result) {\n MobileResponse mobileResponse = (MobileResponse) result;\n if (mobileResponse.getStatus() == 1) {\n getMessagePanel().displayMessage(\"Thanks for voting\");\n } else {\n //postDialog.hide();\n getMessagePanel().displayErrors(mobileResponse.getErrorMessages());\n }\n }\n });\n }", "public synchronized void beginVoting() {\n\t\tvotingThread = new Thread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t// votes should be filled with [each delegate] -> `null`\n\t\t\t\tfor (int i = 0; i < 2 /* rounds */; i++) {\n\t\t\t\t\tfor (Delegate delegate : votes.keySet()) {\n\t\t\t\t\t\tif (votes.get(delegate) != null) {\n\t\t\t\t\t\t\t// Already voted.\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrentlyVoting = delegate;\n\t\t\t\t\t\tlblCurrentVoter.setText(delegate.getName());\n\t\t\t\t\t\tlblCurrentVoter.setIcon(delegate.getSmallIcon());\n\n\t\t\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\t\t\tfinal List<Map<Vote, JButton>> maplist = Arrays.asList(\n\t\t\t\t\t\t\t\tbuttons_roundOne, buttons_roundTwo);\n\t\t\t\t\t\tfor (Map<Vote, JButton> map : maplist) {\n\t\t\t\t\t\t\tfor (Vote vote : map.keySet()) {\n\t\t\t\t\t\t\t\tmap.get(vote)\n\t\t\t\t\t\t\t\t\t\t.setText(\n\t\t\t\t\t\t\t\t\t\t\t\tdelegate.getStatus().hasVetoPower ? vote.vetoText\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: vote.normalText);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tsynchronized (votingThread) {\n\t\t\t\t\t\t\t\tvotingThread.wait();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfinal Vote cast = votes.get(delegate);\n\t\t\t\t\t\tif (cast == Vote.PASS) {\n\t\t\t\t\t\t\tvotes.put(delegate, null);\n\t\t\t\t\t\t\t// So he goes again.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (JButton button : votingButtons) {\n\t\t\t\t\t\t\tbutton.setEnabled(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlayout.show(pnlVoting, pnlSecondRound.getName());\n\t\t\t\t}\n\t\t\t\t// When done, disable again.\n\t\t\t\tfor (JButton button : votingButtons) {\n\t\t\t\t\tbutton.setEnabled(false);\n\t\t\t\t}\n\t\t\t\tcurrentlyVoting = null;\n\t\t\t\tlblCurrentVoter.setText(null);\n\t\t\t\tlblCurrentVoter.setIcon(null);\n\t\t\t\tpnlVoting.setVisible(false);\n\t\t\t}\n\t\t});\n\t\tvotingThread.start();\n\t}", "void notifyMessage(Task task);", "boolean hasVotedInTerm() {\n return null != votedFor;\n }", "public void setVotes(int votes) {\n this.votes = votes;\n }", "@FXML\n public void start_vote(ActionEvent e)\n {\n //calling functions to get ballot count and candidate count\n can_counter();\n ball_counter();\n //checks there are any candidates and ballots\n if((candidate_count!=0)&&(ballot_count!=0))\n {\n //if candidates and voters available, voting will start\n voting_state=1;\n a=new Alert(Alert.AlertType.INFORMATION);\n a.setContentText(\"Voting Has Been Started !\");\n a.show();\n }\n //for 0 candidate count with ballots\n else if ((candidate_count==0)&&(ballot_count!=0))\n {\n a=new Alert(Alert.AlertType.ERROR);\n a.setContentText(\"Cannot Start Voting With 0 Candidates !\");\n a.show();\n }\n //for 0 ballots with candidates\n else if ((ballot_count==0)&&(candidate_count!=0))\n {\n a=new Alert(Alert.AlertType.ERROR);\n a.setContentText(\"Cannot Start Voting With 0 Ballots !\");\n a.show();\n }\n else\n {\n a=new Alert(Alert.AlertType.ERROR);\n a.setContentText(\"Cannot Start Voting With 0 Candidates And 0 Ballots !\");\n a.show();\n }\n }", "void castVote(Peer candidate) {\n votedFor = candidate;\n }", "public void sendnotification(View v){\r\n\t\tRequest req=(Request)v.getTag();\r\n\t\tLog.d(\"selected\", req.getPassenger().getId().toString());\r\n\t\t\r\n//\t\trideresponse=\r\n\t\t\t\trideStart(req, new LatLng(req.getLocation().getLatitude(), req.getLocation().getLongitude()),(Location)this.getIntent().getSerializableExtra(\"mylocation\"));\r\n\t\t\r\n//\t\tIntent intent = new Intent(this, RideStartActivity.class);\r\n// \t \tintent.putExtra(\"ride\", rideresponse);\r\n// \t \tstartActivity(intent);\r\n// \t \tfinish();\r\n\t\t}", "public void sendTaskRepliedNotification(final Long taskId, final Long replier) {\n\t\ttaskExecutor.execute(new AsyncWebTask(notificationDao.getSessionFactory()) {\n\t\t\tpublic void runInBackground() {\n\t\t\t\tTask task = (Task) getSession().get(Task.class, taskId);\n\t\t\t\tUser source = (User) getSession().get(User.class, replier);\n\n\t\t\t\tList<User> followers = task.getFollowers();\n\t\t\t\tfor (User follower : followers) {\n\t\t\t\t\tif (!follower.equals(source)) {\n\t\t\t\t\t\tNotification notification = new Notification();\n\t\t\t\t\t\tnotification.setTask(task);\n\t\t\t\t\t\tnotification.setReceiver(follower);\n\t\t\t\t\t\tnotification.setSource(source);\n\t\t\t\t\t\tnotification.setType(NotificationType.TASK_REPLY);\n\t\t\t\t\t\tnotificationDao.saveNotification(getSession(), notification);\n\n\t\t\t\t\t\tupdateNotificationMapIfUserExists(follower.getId(), 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public void sendPostUpVote(){\n Intent intent = getIntent();\n final int heritageId = intent.getIntExtra(\"heritageId\", -1);\n Retrofit retrofit = ApiClient.getApiClient();\n final SharedPreferences sharedPref = getSharedPreferences(\"TOKENSHARED\", Context.MODE_PRIVATE);\n final String token = sharedPref.getString(\"TOKEN\", null);\n ApiInterface apiInterface = retrofit.create(ApiInterface.class);\n Call<JsonResponseVote> call = apiInterface.vote(new VoteBody(true, heritageId),\"Token \" + token);\n call.enqueue(new Callback<JsonResponseVote>() {\n @Override\n public void onResponse(Call<JsonResponseVote> call, Response<JsonResponseVote> response) {\n\n if (response.isSuccessful()) {\n Toast.makeText(getApplicationContext(), \"SUCCESSFUL UPVOTE\", Toast.LENGTH_SHORT).show();\n voteCount.setText(Integer.toString(response.body().getUpvote_count()-response.body().getDownvote_count()));\n deleteVote.setEnabled(true);\n upVote.setEnabled(false);\n downVote.setEnabled(true);\n\n } else {\n Toast.makeText(getApplicationContext(), \"Sorry for inconvince server is down\" + response.code(), Toast.LENGTH_SHORT).show();\n Log.d(\"response\", response.raw().body().toString());\n }\n\n }\n\n @Override\n public void onFailure(Call<JsonResponseVote> call, Throwable t) {\n Toast.makeText(getApplicationContext(), \"ERROR while posting\", Toast.LENGTH_SHORT).show();\n }\n });\n\n }", "protected void notifyUser()\n {\n }", "@RequestMapping(value=\"/players/setVoted\", method=RequestMethod.POST)\n\t@ResponseBody\n\tpublic void setVoted(String id) {\n\t\tPlayer thePlayer = playerService.getPlayerById(id);\n\t\tthePlayer.switchHasVoted();\n\t\tplayerService.setVoted(thePlayer);\n\n\t}", "private void receiveVote() {\n\t\t//Se la postazione termina la connessione informiamo lo staff con un messaggio di errore\n\t\tif(!link.hasNextLine()) {\n\t\t\tcontroller.printError(\"Errore di Comunicazione\", \"La postazione \"+ ip.getHostAddress() + \" non ha inviato i pacchetti di voto.\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Vengono recuperati i voti cifrati\n\t\tMessage request;\n\t\tWrittenBallot[] encryptedBallots;\n\t\ttry {\n\t\t\trequest = (Message) Message.fromB64(link.read(), \"postazione \" + ip.getHostAddress());\n\t\t\tString[] required = {\"encryptedBallots\"};\n\t\t\tClass<?>[] types = {WrittenBallot[].class};\n\t\t\t\n\t\t\trequest.verifyMessage(Protocol.sendVoteToStation, required, types, \"postazione \" + ip.getHostAddress());\n\t\t\tencryptedBallots = request.getElement(\"encryptedBallots\");\n\t\t\t\n\t\t\t//I voti vengono memorizzati nel seggio in attesa dell'invio all'urna\n\t\t\tif(((Controller) controller).storeVoteLocally(encryptedBallots, ip))\n\t\t\t\tlink.write(Protocol.votesReceivedAck);\n\t\t\telse\n\t\t\t\tlink.write(Protocol.votesReceivedNack);\n\t\t\t\n\t\t} catch (PEException e) {\n\t\t\tlink.write(Protocol.votesReceivedNack);\n\t\t\tcontroller.printError(e);\n\t\t}\n\t}", "private void vote(Connection connection, Matcher matcher) {\n\n final EventBus bus = getEventBus();\n if (!matcher.matches()) {\n bus.publish(new ConnectionMessageCommandEvent(connection, \"Invalid command!\"));\n return;\n }\n\n long pollID = Long.parseLong(matcher.group(1));\n int optionID = Integer.parseInt(matcher.group(2));\n\n try {\n StrawpollAPI.vote(pollID, optionID);\n bus.publish(new ConnectionMessageCommandEvent(connection, System.lineSeparator() + \"You voted successfully\"));\n }\n catch (Exception e) {\n bus.publish(new ConnectionMessageCommandEvent(connection, System.lineSeparator() + \"Whoops, it looks like we did not find a poll with the given id or index\"));\n e.printStackTrace();\n }\n\n }", "private void vote(Vote whichVoteButton, MenuItem item, PostData p) {\n if (!RedditLoginInformation.isLoggedIn()) {\n Toast.makeText(this, R.string.you_must_be_logged_in_to_vote, Toast.LENGTH_SHORT).show();\n return;\n }\n\n Intent intent = new Intent(Consts.BROADCAST_UPDATE_SCORE);\n intent.putExtra(Consts.EXTRA_PERMALINK, p.getPermalink());\n\n switch (whichVoteButton) {\n case DOWN:\n switch (p.getVote()) {\n case DOWN:\n RedditService.vote(this, p.getName(), Vote.NEUTRAL);\n item.setIcon(R.drawable.ic_action_downvote);\n p.setVote(Vote.NEUTRAL);\n p.setScore(p.getScore() + 1);\n break;\n\n case NEUTRAL:\n case UP:\n RedditService.vote(this, p.getName(), Vote.DOWN);\n item.setIcon(R.drawable.ic_action_downvote_highlighted);\n p.setVote(Vote.DOWN);\n mUpvoteMenuItem.setIcon(R.drawable.ic_action_upvote);\n p.setScore(p.getScore() - 1);\n break;\n }\n break;\n\n case UP:\n switch (p.getVote()) {\n case NEUTRAL:\n case DOWN:\n RedditService.vote(this, p.getName(), Vote.UP);\n item.setIcon(R.drawable.ic_action_upvote_highlighted);\n p.setVote(Vote.UP);\n p.setScore(p.getScore() + 1);\n mDownvoteMenuItem.setIcon(R.drawable.ic_action_downvote);\n break;\n\n case UP:\n RedditService.vote(this, p.getName(), Vote.NEUTRAL);\n item.setIcon(R.drawable.ic_action_upvote);\n p.setVote(Vote.NEUTRAL);\n p.setScore(p.getScore() - 1);\n break;\n }\n\n break;\n\n default:\n break;\n }\n\n // Broadcast the intent to update the score in the ImageDetailFragment\n intent.putExtra(Consts.EXTRA_SCORE, p.getScore());\n LocalBroadcastManager.getInstance(this).sendBroadcast(intent);\n }", "public void addKickVote()\n\t{\n\t\tthis.numberOfKickVotes++;\n\t}", "public Vote(int id, int v) {\n candidate_id = id;\n priority = v;\n }", "public void voteIdea(String username, Long ideaId, boolean vote) throws VotingException, DataAccessException {\n try {\n MyUser user = myUserFacade.getUser(username);\n Idea idea = this.find(ideaId);\n Boolean previousVote = user.getVotes().get(idea);\n if (previousVote == null) {\n // If the user never voted for this idea, then create a new Vote:\n user.addVote(idea, vote);\n if (vote) {\n idea.upvote();\n } else {\n idea.downvote();\n }\n } else {\n // The user had previously voted for this idea.\n // Case 1: trying to upvote twice the idea:\n if (previousVote && vote) {\n throw new VotingException((null), \"Cannot upvote twice the same post\");\n } // Case 2: trying to downvote twice the idea:\n else if (!previousVote && !vote) {\n throw new VotingException((null), \"Cannot downvote twice the same post\");\n } // Case 3: one is upvote and the other downvote. Vote is removed\n else {\n user.removeVote(idea);\n if (vote) {\n idea.setUpvotes(idea.getUpvotes() - 1);\n } else {\n idea.setDownvotes(idea.getDownvotes() - 1);\n }\n }\n }\n myUserFacade.edit(user);\n this.edit(idea);\n } catch (PersistenceException | EJBException pe) {\n throw new DataAccessException(pe, \"Error while voting post\");\n }\n }", "public boolean didStudentVote() {\n\t\treturn voted;\n\t}", "private void notifyStakeholder(){\n }", "public String getVoteString() {\n\t\treturn voted ? Arrays.toString(topIdeas) : \"n/a\";\n\t}", "public void sendPostDownVote(){\n Intent intent = getIntent();\n final int heritageId = intent.getIntExtra(\"heritageId\", -1);\n Retrofit retrofit = ApiClient.getApiClient();\n final SharedPreferences sharedPref = getSharedPreferences(\"TOKENSHARED\", Context.MODE_PRIVATE);\n final String token = sharedPref.getString(\"TOKEN\", null);\n ApiInterface apiInterface = retrofit.create(ApiInterface.class);\n Call<JsonResponseVote> call = apiInterface.vote(new VoteBody(false, heritageId),\"Token \" + token);\n call.enqueue(new Callback<JsonResponseVote>() {\n @Override\n public void onResponse(Call<JsonResponseVote> call, Response<JsonResponseVote> response) {\n\n if (response.isSuccessful()) {\n Toast.makeText(getApplicationContext(), \"SUCCESSFUL DOWNVOTE\", Toast.LENGTH_SHORT).show();\n voteCount.setText(Integer.toString(response.body().getUpvote_count()-response.body().getDownvote_count()));\n deleteVote.setEnabled(true);\n downVote.setEnabled(false);\n upVote.setEnabled(true);\n\n } else {\n Toast.makeText(getApplicationContext(), \"Sorry for inconvince server is down\" + response.code(), Toast.LENGTH_SHORT).show();\n Log.d(\"response\", response.raw().body().toString());\n }\n\n }\n\n @Override\n public void onFailure(Call<JsonResponseVote> call, Throwable t) {\n Toast.makeText(getApplicationContext(), \"ERROR while posting\", Toast.LENGTH_SHORT).show();\n }\n });\n }", "private void vote(ActionEvent x) {\n\t\tProject p = this.list.getSelectedValue();\n\t\tif (p != null) {\n\t\t\tif (this.controller.vote(p.getName())) {\n\t\t\t\tfield3.addSupported(p);\n\t\t\t}\n\t\t}\n\t}", "public void upVote(Post p) {\n p.upvote();\n }", "public void notifyJoueurActif();", "@GetMapping(path = \"/submitVote/{poll_id}/{worker_id}/{voter_id}\")\n public String sendVotingPage(@PathVariable(value = \"poll_id\") String poll_id,\n @PathVariable(value = \"worker_id\") String worker_id,\n @PathVariable(value = \"voter_id\") String voter_id,\n HttpServletRequest request,\n Model model) {\n\n // for multiple elections, we would use the election hash to differentiate\n\n request.setAttribute(\"voter_id\",voter_id);\n if(electionService.checkIfWorkerAndVoterAlign(worker_id,voter_id) &&\n electionService.voterHasNotVoted(worker_id,voter_id)){\n //Poll poll = electionService.getPoll(poll_id);\n // List<Candidate> candidateList = electionService.getCandidates(poll);\n //String ballotFilename = this.electionService.createAndSaveUserHtmlPage(poll,candidateList,voter_id,worker_id);\n model.addAttribute(\"worker_id\",worker_id);\n model.addAttribute(\"voter_id\",voter_id);\n model.addAttribute(\"poll_id\",poll_id);\n model.addAttribute(\"url\", electionService.getUrl(\"ew\"));\n return \"poll1_ballot\";\n }\n return \"alryVoted\";\n }", "public void vote(int triviaId, int optionId, final OnVoteComplete callback){\n // Creamos el servicio\n TriviaService service = createService(TriviaService.class);\n // Generamos la call\n RestBodyCall<Boolean> call = service.vote(Mobileia.getInstance().getAppId(), getAccessToken(), triviaId, optionId);\n // Ejecutamos la call\n call.enqueue(new Callback<RestBody<Boolean>>() {\n @Override\n public void onResponse(Call<RestBody<Boolean>> call, Response<RestBody<Boolean>> response) {\n // Verificar si la respuesta fue incorrecta\n if (!response.isSuccessful() || !response.body().success) {\n callback.onSuccess(false);\n return;\n }\n // Enviamos la respuesta\n callback.onSuccess(response.body().response);\n }\n\n @Override\n public void onFailure(Call<RestBody<Boolean>> call, Throwable t) {\n callback.onSuccess(false);\n }\n });\n }", "public Float getVote() {\n return vote;\n }", "public void countVotes() {\n int[] voteResponses = RaftResponses.getVotes(mConfig.getCurrentTerm());\n int numVotes = 0;\n if(voteResponses == null) {\n //System.out.println(mID + \" voteResponses null\");\n //System.out.println(\"cur \" + mConfig.getCurrentTerm() + \" RR: \" + RaftResponses.getTerm());\n }\n else {\n for(int i = 1; i <= mConfig.getNumServers(); i++) {\n //If vote has not been received yet, resend request\n //if(voteResponses[i] == -1)\n //this.remoteRequestVote(i, mConfig.getCurrentTerm(), mID, mLog.getLastIndex(), mLog.getLastTerm());\n if(voteResponses[i] == 0)\n numVotes++;\n }\n }\n //If election is won, change to leader\n if(numVotes >= (mConfig.getNumServers()/2.0)) {\n electionTimer.cancel();\n voteCountTimer.cancel();\n RaftServerImpl.setMode(new LeaderMode());\n }\n else {\n voteCountTimer = scheduleTimer((long) 5, 2);\n }\n }", "@Override\n public void onLoggedInVerified(User user) {\n bakery.toastShort(user.getEmail());\n loadTaskActivity();\n }", "@Override\n public void onThirdVote(String arg0) {\n\n }", "public void addVote(String vote){\r\n\t\tif(allVotes.get(vote) == null){\r\n\t\t\tallVotes.put(vote, 1);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tallVotes.put(vote, allVotes.get(vote) + 1);\r\n\t\t}\r\n\t\tsetChanged();\r\n\t\tnotifyObservers(\"vote\");\r\n\t}", "void claimTask(String userId, Long taskId);", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tfor (int i = 0; i < 2 /* rounds */; i++) {\n\t\t\t\t\tfor (Delegate delegate : votes.keySet()) {\n\t\t\t\t\t\tif (votes.get(delegate) != null) {\n\t\t\t\t\t\t\t// Already voted.\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrentlyVoting = delegate;\n\t\t\t\t\t\tlblCurrentVoter.setText(delegate.getName());\n\t\t\t\t\t\tlblCurrentVoter.setIcon(delegate.getSmallIcon());\n\n\t\t\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\t\t\tfinal List<Map<Vote, JButton>> maplist = Arrays.asList(\n\t\t\t\t\t\t\t\tbuttons_roundOne, buttons_roundTwo);\n\t\t\t\t\t\tfor (Map<Vote, JButton> map : maplist) {\n\t\t\t\t\t\t\tfor (Vote vote : map.keySet()) {\n\t\t\t\t\t\t\t\tmap.get(vote)\n\t\t\t\t\t\t\t\t\t\t.setText(\n\t\t\t\t\t\t\t\t\t\t\t\tdelegate.getStatus().hasVetoPower ? vote.vetoText\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: vote.normalText);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tsynchronized (votingThread) {\n\t\t\t\t\t\t\t\tvotingThread.wait();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfinal Vote cast = votes.get(delegate);\n\t\t\t\t\t\tif (cast == Vote.PASS) {\n\t\t\t\t\t\t\tvotes.put(delegate, null);\n\t\t\t\t\t\t\t// So he goes again.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (JButton button : votingButtons) {\n\t\t\t\t\t\t\tbutton.setEnabled(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlayout.show(pnlVoting, pnlSecondRound.getName());\n\t\t\t\t}\n\t\t\t\t// When done, disable again.\n\t\t\t\tfor (JButton button : votingButtons) {\n\t\t\t\t\tbutton.setEnabled(false);\n\t\t\t\t}\n\t\t\t\tcurrentlyVoting = null;\n\t\t\t\tlblCurrentVoter.setText(null);\n\t\t\t\tlblCurrentVoter.setIcon(null);\n\t\t\t\tpnlVoting.setVisible(false);\n\t\t\t}", "public void voteCommit() {\n boolean b = preVote();\n synchronized ( this ) {\n if ( b == true ) \n commitVotes++; \n else {\n rbVotes++;\n votedCommit = false;\n }\n }\n postVote();\n }", "public synchronized boolean voteTeam() {\n //tally the votes\n int yes = 0, no = 0;\n for (boolean vote : playerVotes.values()) {\n if (vote) {\n yes++;\n } else {\n no++;\n }\n }\n\n if (yes > no) {\n doMissionState = voteTeamState.acceptTeam();\n state = State.DO_MISSION;\n successiveRejections = 0;\n teamMemberChoices = new HashMap<>();\n return true;\n } else {\n pickTeamState = voteTeamState.rejectTeam();\n state = State.PICK_TEAM;\n successiveRejections++;\n teamSelection = new HashSet<>();\n return false;\n }\n }", "@OnClick(R.id.upvote)\n public void onUpvoteClicked() {\n upvoted.setEnabled(false);\n downvoted.setEnabled(true);\n dataItem.setUpvoted();\n points++;\n upvoted.setBackgroundColor(Color.parseColor(\"#666bff\"));\n downvoted.setBackgroundColor(Color.parseColor(\"#ffffff\"));\n a.setText(points + \" points\");\n }", "public interface VoteHandler {\n\n /**\n * Handle the user's vote to alter the media's score\n *\n * @param vote User's vote\n */\n void handle(VoteMessage vote);\n\n}", "boolean hasVotingStartTime();", "@Override\n public void onClick(View view) {\n\n sharedPrefManager.addNotificationCount(1);\n Log.d(TAG, \"shared pref count: \" + sharedPrefManager.getNotificationCount());\n\n\n if (userMemberType == 1 || userMemberType == 2) {\n showMyWillQuestionDialog();\n\n } else if (userMemberType == 3) {\n goToMyWill();\n\n } else {\n showAccessDeniedDialog();\n }\n /*testNoWill();*/\n }", "@Override\n public void setNotification() {\n if (getTense() == Tense.FUTURE) {\n //Context ctx = SHiTApplication.getContext();\n //SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(ctx);\n\n int leadTimeEventMinutes = SHiTApplication.getPreferenceInt(Constants.Setting.ALERT_LEAD_TIME_EVENT, LEAD_TIME_MISSING);\n\n if (leadTimeEventMinutes != LEAD_TIME_MISSING) {\n if (travelTime > 0) {\n leadTimeEventMinutes += travelTime;\n }\n\n setNotification(Constants.Setting.ALERT_LEAD_TIME_EVENT\n , leadTimeEventMinutes\n , R.string.alert_msg_event\n , getNotificationClickAction()\n , null);\n }\n }\n }", "public int getVotes() {\n return this.votes;\n }", "int getVoteValue(UserId userId, QuestionId questionId);", "public void vote(int index,Person personName,ArrayList<String> choices){\n if (votingList.get(index).getType()==0 && choices.size()==1 && choices.get(0).equals(\"random\")){\n\n Random random = new Random();\n int rand = random.nextInt(votingList.get(index).getPolls().size());\n choices.remove(0);\n choices.add(votingList.get(index).getPolls().get(rand));\n }\n\n votingList.get(index).vote(personName,choices);\n\n }", "public int getVotes() {\n return votes;\n }", "public int getVotes() {\n return votes;\n }", "private void sendNotification() {\n }", "private void notifyUser() {\r\n //Start add into notification fragment process\r\n notify = new Notify();\r\n DatabaseReference NotRef = FirebaseDatabase.getInstance().getReference().child(\"Notify\");\r\n notify.setBookID(getBookID.getText().toString());\r\n notify.setUserID(getUID.getText().toString());\r\n String key = NotRef.push().getKey();\r\n notify.setNotifyID(key);\r\n NotRef.child(key).setValue(notify);\r\n\r\n //Update notify status\r\n DatabaseReference dbNotify = FirebaseDatabase.getInstance().getReference(\"Booking\").child(getUID.getText().toString()).child(getBookID.getText().toString());\r\n HashMap<String, Object> hashMap = new HashMap<>();\r\n hashMap.put(\"notifyStatus\", \"Approved\");\r\n dbNotify.updateChildren(hashMap);\r\n\r\n //Send push notification\r\n String StaffID = id.getText().toString();\r\n TOPIC = \"/topics/\" + StaffID.toLowerCase(); //topic must match with what the receiver subscribed to\r\n Log.v(TAG,StaffID);\r\n NOTIFICATION_TITLE = \"FKOM Car Booking\";\r\n NOTIFICATION_MESSAGE = \"Dear \" + name.getText().toString() + \", Your Booking \" + getBookID.getText().toString() + \" has been approved!\";\r\n\r\n JSONObject notification = new JSONObject();\r\n JSONObject notificationBody = new JSONObject();\r\n try {\r\n notificationBody.put(\"title\", NOTIFICATION_TITLE);\r\n notificationBody.put(\"message\", NOTIFICATION_MESSAGE);\r\n\r\n notification.put(\"to\", TOPIC);\r\n notification.put(\"data\", notificationBody);\r\n } catch (JSONException e) {\r\n Log.e(TAG, \"onCreate: \" + e.getMessage());\r\n }\r\n sendNotification(notification, StaffID);\r\n }", "@Override\n protected void execute(CommandEvent event)\n {\n Poll poll = manager.getRandomPoll();\n\n // Now we need to build the embed\n EmbedBuilder embed = new EmbedBuilder()\n {{\n setTitle(\"<:EverybodyVotesChannel:317090360449040388> \" + poll.getQuestion());\n setDescription(\"\\uD83C\\uDD70 \" + poll.getResponse1() + \"\\n\" +\n \"_ _\\n\" + // Line separator\n \"\\uD83C\\uDD71 \" + poll.getResponse2());\n addField(\"Users who reacted \\uD83C\\uDD70:\", \"\", false);\n addField(\"Users who reacted \\uD83C\\uDD71:\", \"\", false);\n setColor(event.getSelfMember().getColor());\n setFooter(\"This question was in the \" + poll.getCountryFlag() + \" EVC\", null);\n }};\n\n // Send embed to chat\n event.reply(embed.build(), s ->\n {\n // Add message ID to tracked list\n manager.trackId(s.getIdLong());\n\n // Add reactions\n s.addReaction(\"\\uD83C\\uDD70\").queue();\n s.addReaction(\"\\uD83C\\uDD71\").queue();\n });\n }", "@RequestMapping(value=\"/players/vote\", method=RequestMethod.POST)\n\t@ResponseBody\n\tpublic void placeVote(String id) {\n\t\tSystem.out.println(\"in place vote \");\n\t\tplayerService.placeVoteOn(playerService.getPlayerById(id));\n\t}", "@Override\r\n public void onClick(View v) {\n try {\r\n postDatatoServer(\"accept_request\", notification.toJSON());\r\n fetchDatafromServer(\"notifications\");\r\n } \r\n catch (JSONException e) {\r\n e.printStackTrace();\r\n }\r\n }", "public void quitter() {\n\n\t\tint rep = JOptionPane.showConfirmDialog(null, \"Voulez-vous vraiment quitter ?\" , \"Attention\", JOptionPane.WARNING_MESSAGE);\n\t\tif (rep == JOptionPane.OK_OPTION)\n\t\t{\n\t\t\tsetChanged();\n\t\t\tnotifyObservers(QUITTER);\n\t\t}\n\t}", "boolean hasVotingEndTime();", "private void handleRequestVote(RequestVote requestVote) {\n\n RequestVoteReply reply;\n\n do {\n\n try {\n reply = (RequestVoteReply) this.sendRPCHandler(() -> this.outbound.requestVote(this.targetServerName, requestVote));\n } catch (InterruptedException e) {\n return;\n }\n\n } while (reply == null);\n\n RequestVoteReply finalReply = reply;\n this.taskExecutor.execute(() -> this.consensusModule.requestVoteReply(finalReply));\n\n }", "@Test\n public void vote() {\n System.out.println(client.makeVotes(client.companyName(0), \"NO\"));\n }", "public void notify(String userId, int timezoneDiff);", "private int notify(Wishlist wishlist, WishlistItem watched, InventoryItem invItem) {\n\t\tif (watched.isNotified) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tSystem.out.println(invItem.name + \" is in stock. Notify \" + wishlist.distributorID);\n\t\tif (notifier.notifyInStock(wishlist.notificationEmail, invItem.name)) {\n\t\t\twatched.setNotified();\n\t\t}\n\t\treturn 1;\n\t}", "public boolean processVote() {\n\t\tlong start = System.currentTimeMillis();\n\t\tlong end = start;\n\t\tint replyCnt = 0;\n\t\tint voteTotal = users.size();\n\t\tboolean needCommit = true;\n\t\tSystem.out.println(\"process vote for \"+ filename);\n\t\twhile(end - start < 3000 && replyCnt < voteTotal) {\n\t\t\t// System.out.println(\"within loop\");\n\t\t\tif(!voteReply.isEmpty()) {\n\t\t\t\t//if queue is not empty, get reply from queue\n\t\t\t\tMsg ele = voteReply.poll();\n\t\t\t\tif(ele.voteForCollage == true) {\n\t\t\t\t\treplyCnt ++;\n\t\t\t\t\tcontinue;\n\t\t\t\t} else { // if one user disagree, total answer should be false\n\t\t\t\t\tneedCommit = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if is empty, update end time, continue loop\n\t\t\tend = System.currentTimeMillis();\n\t\t}\n\t\t//check if there exists timeout\n\t\tif( needCommit && replyCnt < voteTotal) needCommit = false;\n\t\tSystem.out.println(\"commit finished, result \"+ needCommit);\n\t\treturn needCommit;\n\t}", "@Override\n\t\t\t\tpublic void onClick(View v) {\n\n\t\t\t\t\tJSONObject votejson = Json.getJson(MainActivity.website+\"/video/vote?ri=\"+rowItems.get(positionzhang).getVID()+\"&vt=STANDOUT\",MainActivity.httpclient);\n\t\t\t\t\tToast toast;\n\t\t\t\t\tString Votestate = null;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tVotestate = votejson.getString(\"result\");\n\t\t\t\t\t} catch (JSONException e1) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (Votestate.equals(\"unknown\")){\n\t\t\t\t\t\t toast = Toast.makeText(MainActivity.nowcontext,\n\t\t\t\t\t \"Please Login first\",\n\t\t\t\t\t Toast.LENGTH_SHORT);\n\t\t\t\t\t toast.setGravity(Gravity.BOTTOM|Gravity.CENTER_HORIZONTAL, 0, 0);\n\t\t\t\t\t toast.show();\n\t\t\t\t\t Intent intent = new Intent(MainActivity.nowcontext, Login.class);\n\t\t\t\t\t MainActivity.nowcontext.startActivity(intent);\n\t\t\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t}else{\n\t\t\t\t\ttry {\n\t\t\t\t\t\t\n\t\t\t\t\t\ttoast = Toast.makeText(MainActivity.nowcontext,\n\t\t\t\t\t\t\t\t MainActivity.convertNodeToText(Jsoup.parse(votejson.getString(\"message\"))),\n\t\t\t\t\t\t Toast.LENGTH_SHORT);\n\t\t\t\t\t\ttoast.setGravity(Gravity.BOTTOM|Gravity.CENTER_HORIZONTAL, 0, 0);\n\t\t\t\t toast.show();\n\t\t\t\t \n\t\t\t\t //Login.writeFileSdcardFile(\"/sdcard/as.txt\", rowItems.get(position).getVID());\n\t\t\t\t\t} catch (JSONException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t \n\t\t\t Log.i(\"vote\",votejson.toString());\n\t\t\t\t\t\n\t\t\t\t}", "@RequestMapping(method = RequestMethod.POST, value=\"/Vote\")\n public ResponseEntity<?> vote(@RequestParam(value=\"idSchedule\") int idSchedule,\n @RequestParam(value=\"idAssociate\") int idAssociate,\n @RequestParam(value=\"choice\") boolean choice){\n try{\n scheduleService.vote(idSchedule,idAssociate,choice);\n return ResponseEntity.ok().body(\"Voto Realizado\");\n }catch (ResponseException e){\n return ResponseEntity.status(e.getResponseStatus()).body(e.getMessage());\n } catch (Exception e){\n return ResponseEntity.status(500).body(e.getMessage());\n }\n }", "private void notifyUser(List<String> result) {\r\n\t\t\tif(Util.getProperty(getApplicationContext(),\"notificationTimeChanged\",\"\").equals(\"true\") \r\n\t\t\t\t\t|| !notifiedToday())\r\n\t\t\t{\r\n\t\t\t\tUtil.setProperty(getApplicationContext(), \"notificationTimeChanged\", \"false\");\r\n\t\t\t\tif(result.size() > 0){\r\n\t\t\t\t\tint itemsDue = result.size();\r\n\t\t\t\t\tStringBuffer notificationText = new StringBuffer();\r\n\t\t\t\t\tfor(int i=0; i<itemsDue; i++){\r\n\t\t\t\t\t\tif(i!=0)\r\n\t\t\t\t\t\t\tnotificationText.append(\", \");\r\n\t\t\t\t\t\tnotificationText.append(result.get(i));\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tContext context = getApplicationContext();\r\n\t\t\t\t\tNotificationManager nm = (NotificationManager)context.getSystemService(NOTIFICATION_SERVICE);\r\n\t\t\t\t\tIntent notificationIntent = new Intent(context,ReminderActivity.class);\r\n\t\t\t\t\tPendingIntent pi = PendingIntent.getActivity(context, 0, notificationIntent,PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_ONE_SHOT);\r\n\t\t\t\t\tNotification n = new Notification.Builder(context)\r\n\t\t\t\t\t.setContentTitle(String.valueOf(itemsDue) + \" Items Due\")\r\n\t\t\t\t\t.setContentText(notificationText.toString())\r\n\t\t\t\t\t.setSmallIcon(R.drawable.ic_launcher)\r\n\t\t\t\t\t//.setLargeIcon(R.drawable.ic_basket)\r\n\t\t\t\t\t.setContentIntent(pi)\r\n\t\t\t\t\t.build();\t \r\n\t\t\t\t\tnm.notify(1, n);\r\n\t\t\t\t}\r\n\t\t\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"dd-MMM-yyyy\",Locale.US);\r\n\t\t\t\tUtil.setProperty(getApplicationContext(), \"ServiceLastRanOn\",formatter.format(new Date()));\r\n\t\t\t}\r\n\t\t}", "public void printVoting(int index){\n System.out.println(\"vote question : \"+votingList.get(index).getQuestion());\n for (int i = 0;i<votingList.get(index).getPolls().size();i++){\n System.out.println(\"poll \"+(i+1)+\" : \"+votingList.get(index).getPolls().get(i));\n }\n }", "@Override\n\t\t\t\tpublic void onClick(View v) {\n\n\t\t\t\t\tJSONObject votejson = Json.getJson(MainActivity.website+\"/video/vote?ri=\"+rowItems.get(positionzhang).getVID()+\"&vt=STANDOUT\",MainActivity.httpclient);\n\t\t\t\t\tToast toast;\n\t\t\t\t\tString Votestate = null;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tVotestate = votejson.getString(\"result\");\n\t\t\t\t\t} catch (JSONException e1) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (Votestate.equals(\"unknown\")){\n\t\t\t\t\t\t toast = Toast.makeText(MainActivity.nowcontext,\n\t\t\t\t\t \"Please Login first\",\n\t\t\t\t\t Toast.LENGTH_SHORT);\n\t\t\t\t\t toast.setGravity(Gravity.BOTTOM|Gravity.CENTER_HORIZONTAL, 0, 0);\n\t\t\t\t\t toast.show();\n\t\t\t\t\t Intent intent = new Intent(MainActivity.nowcontext, Login.class);\n\t\t\t\t\t MainActivity.nowcontext.startActivity(intent);\n\t\t\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t}else{\n\t\t\t\t\ttry {\n\t\t\t\t\t\t\n\t\t\t\t\t\ttoast = Toast.makeText(MainActivity.nowcontext,\n\t\t\t\t\t\t\t\t MainActivity.convertNodeToText(Jsoup.parse(votejson.getString(\"message\"))),\n\t\t\t\t\t\t Toast.LENGTH_SHORT);\n\t\t\t\t\t\ttoast.setGravity(Gravity.BOTTOM|Gravity.CENTER_HORIZONTAL, 0, 0);\n\t\t\t\t toast.show();\n\t\t\t\t \n\t\t\t\t //Login.writeFileSdcardFile(\"/sdcard/as.txt\", rowItems.get(position).getVID());\n\t\t\t\t\t} catch (JSONException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t \n\t\t\t Log.i(\"vote\",votejson.toString());\n\t\t\t\t\t\n\t\t\t\t}", "private void note(Notification n){\r\n\t\tusers.get(n.userID).addNotification(n);\r\n\t\tif (loggedInUsers.contains(n.userID))\r\n\t\t\tcomms.sendMessage(n);\r\n\t}", "boolean updateActiveTask(Task task);", "@Override\n\t\t\tpublic boolean onPreferenceClick(Preference arg0) {\n\n\t\t\t\tbuy(SKU_VITAMIN);\n\t\t\t\treturn true;\n\t\t\t}", "@Override\n\t\tpublic void run() {\n\t\t\t\n\t\t\tloadprofiletinfo(MainActivity.website+\"/video/search?ss=artist&so=most_voted&sp=\"+uid);\n\t\t\tMessage msglvpro= new Message();\n\t msglvpro.what=1;\n\t handlerlvpro.sendMessage(msglvpro);\n \t \n }", "public interface Notification {\n /**\n * Method to generate and draw notification message\n * @param task it's task for notification message\n */\n void notifyMessage(Task task);\n}", "public void checkVotes() {\r\n\t\tnew Timer().scheduleAtFixedRate(new TimerTask() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tURLConnection connection = new URL(\"https://glowning.dev/discordminer/webhook/votes.txt\").openConnection();\r\n\t\t\t\t\tconnection.setRequestProperty(\"User-Agent\", \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11\");\r\n\t\t\t\t\tconnection.connect();\r\n\r\n\t\t\t\t\tBufferedReader r = new BufferedReader(new InputStreamReader(connection.getInputStream(), Charset.forName(\"UTF-8\")));\r\n\r\n\t\t\t\t\tString line = \"\";\r\n\t\t\t\t\twhile ((line = r.readLine()) != null) {\r\n\t\t\t\t\t\tSystem.out.println(line);\r\n\t\t\t\t\t\tUser u = getShards().getUserById(line);\r\n\t\t\t\t\t\tif (u != null) {\r\n\t\t\t\t\t\t\tint crate;\r\n\r\n\t\t\t\t\t\t\tCalendar cal = Calendar.getInstance();\r\n\t\t\t\t\t\t\tcal.setTimeInMillis(System.currentTimeMillis());\r\n\t\t\t\t\t\t\tcal.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\r\n\r\n\t\t\t\t\t\t\tif (cal.get(Calendar.DAY_OF_WEEK) == Calendar.FRIDAY || cal.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {\r\n\t\t\t\t\t\t\t\tcrate = 2;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tcrate = 1;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tMiner miner = new Miner(u.getIdLong());\r\n\t\t\t\t\t\t\tif (miner.exists()) {\r\n\t\t\t\t\t\t\t\tSystem.out.println(\"Crates given to \" + u.getName() + \" (\" + u.getIdLong() + \")\");\r\n\t\t\t\t\t\t\t\tu.openPrivateChannel().complete().sendMessage(\"Hey! Thank you for your vote.\\nAs a reward, I give you **\" + crate + \" crate\" + (crate == 2 ? \"s\" : \"\") + \"**.\").queue();\r\n\r\n\t\t\t\t\t\t\t\tminer.addCrates(\"vote\", crate);\r\n\t\t\t\t\t\t\t\tminer.getStats().put(\"votes\", miner.getStats().getInt(\"votes\") + 1);\r\n\t\t\t\t\t\t\t\tminer.update();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tHttpClient httpclient = HttpClients.createDefault();\r\n\t\t\t\t\t\tHttpPost httppost = new HttpPost(\"https://glowning.dev/discordminer/webhook/discordbots.php\");\r\n\t\t\t\t\t\tList<NameValuePair> params = new ArrayList<NameValuePair>(2);\r\n\t\t\t\t\t\tparams.add(new BasicNameValuePair(\"Authorization\", \"DiscordMiner\"));\r\n\t\t\t\t\t\tparams.add(new BasicNameValuePair(\"user\", line));\r\n\t\t\t\t\t\thttppost.setEntity(new UrlEncodedFormEntity(params, \"UTF-8\"));\r\n\t\t\t\t\t\thttpclient.execute(httppost);\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}, 0, 1000);\r\n\t}", "public boolean currentlyUpvoted(String articleId) {\n return ArticleVoteLocalRepository.VoteType.UPVOTE.equals(localRepository.getVote(articleId));\n }", "public Integer getVotes();", "public String getVoteurl() {\n return voteurl;\n }", "public ArrayList<Voting> getVotingList() {\n return votingList;\n }", "public String getVoteURL() {\r\n\t\treturn voteURL;\r\n\t}" ]
[ "0.7041805", "0.6754681", "0.6596303", "0.653524", "0.6512366", "0.6218454", "0.60205865", "0.5983914", "0.59691566", "0.5906979", "0.58918095", "0.5887731", "0.5840076", "0.5724188", "0.5714541", "0.56675136", "0.56092435", "0.5594648", "0.55820197", "0.55443686", "0.55320394", "0.5530726", "0.55236465", "0.55010086", "0.54998803", "0.54941547", "0.548084", "0.5471352", "0.5464047", "0.5463228", "0.5458399", "0.5441476", "0.5427844", "0.53840035", "0.5362341", "0.5360011", "0.5359582", "0.5353116", "0.5346406", "0.5326379", "0.5325958", "0.53086066", "0.53064084", "0.5280604", "0.5268438", "0.52560973", "0.52519625", "0.5248204", "0.5245008", "0.5222685", "0.52188545", "0.5216704", "0.52159095", "0.5200169", "0.51826113", "0.51752293", "0.5163135", "0.51623064", "0.51609296", "0.51578134", "0.5136654", "0.51234144", "0.5116179", "0.51044244", "0.5102531", "0.5084915", "0.5075054", "0.5064177", "0.505359", "0.50523955", "0.5042013", "0.5042013", "0.50334835", "0.50291145", "0.5027732", "0.5024939", "0.501084", "0.5009135", "0.5008753", "0.5002369", "0.49879983", "0.4970968", "0.4957382", "0.49555528", "0.4953801", "0.49397358", "0.49377918", "0.4936838", "0.4930861", "0.49279165", "0.49277636", "0.49218696", "0.49212712", "0.49186835", "0.49153548", "0.48909435", "0.48811743", "0.4877835", "0.48717886", "0.487138" ]
0.7005389
1
update a notification of a vote to it is chnged.
public void updateTaskVoteNotification(final Long taskId, final Long voterUserId, final RateDirection direction) { taskExecutor.execute(new AsyncWebTask(notificationDao.getSessionFactory()) { public void runInBackground() { NotificationType previousNotificationType; NotificationType newNotificationType; Task task = (Task) getSession().get(Task.class, taskId); User source = (User) getSession().get(User.class, voterUserId); User receiver = task.getOwner(); if (direction == RateDirection.UP) { previousNotificationType = NotificationType.TASK_DOWNVOTE; newNotificationType = NotificationType.TASK_UPVOTE; } else { previousNotificationType = NotificationType.TASK_UPVOTE; newNotificationType = NotificationType.TASK_DOWNVOTE; } Notification notification = notificationDao.findNotification(getSession(), receiver.getId(), source.getId(), task.getId(), previousNotificationType); if (notification != null) { notification.setType(newNotificationType); notificationDao.updateNotification(getSession(), notification); } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void sendVoteNotification() {\n\t\t\t\t\tWorld.sendWorldMessage(\"<img=5>[Vote Feed]: colorhere\" + getDisplayName() + \" </col>voted for\" + \n\t\t\t\t\t\t\t\t\t\t\t\"colorhere \"+ voteDisplayAmount +\" Vote Tickets!</col> \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"World votes are now at colorhere\"+ WorldVote.getVotes()+\"</col>.\", false);\t\n\t}", "@Override\n public void doUpdate(NotificationMessage notification) {\n \n }", "public void notificationUpdate(long notificationID, String recipient, String verb, String actor){\n String unread = \"false\";\n Callback<Notifications> callback = new Callback<Notifications>() {\n\n @Override\n public void success(Notifications serverResponse, Response response2) {\n if(serverResponse.getResponseCode() == 0){\n BusProvider.getInstance().post(produceNotificationServerEvent(serverResponse));\n }else{\n BusProvider.getInstance().post(produceErrorEvent(serverResponse.getResponseCode(),\n serverResponse.getMessage()));\n }\n }\n\n @Override\n public void failure(RetrofitError error) {\n if(error != null ){\n Log.e(TAG, error.getMessage());\n error.printStackTrace();\n }\n BusProvider.getInstance().post(produceErrorEvent(-200,error.getMessage()));\n }\n };\n communicatorInterface.updateNotification(notificationID, recipient, verb, unread, actor, callback);\n }", "void handle(VoteMessage vote);", "public void notify(T message, V v){\n for(BiObserver<T,V> biObserver : biObserverList){\n biObserver.update(message, v);\n }\n }", "public static void doVote() {\n }", "public void addVote() {\n this.votes++;\n }", "@Override\n\tpublic String update(double discount, int vid) {\n\t\treturn vb.update(discount, vid);\n\t}", "private void vote(Vote whichVoteButton, MenuItem item, PostData p) {\n if (!RedditLoginInformation.isLoggedIn()) {\n Toast.makeText(this, R.string.you_must_be_logged_in_to_vote, Toast.LENGTH_SHORT).show();\n return;\n }\n\n Intent intent = new Intent(Consts.BROADCAST_UPDATE_SCORE);\n intent.putExtra(Consts.EXTRA_PERMALINK, p.getPermalink());\n\n switch (whichVoteButton) {\n case DOWN:\n switch (p.getVote()) {\n case DOWN:\n RedditService.vote(this, p.getName(), Vote.NEUTRAL);\n item.setIcon(R.drawable.ic_action_downvote);\n p.setVote(Vote.NEUTRAL);\n p.setScore(p.getScore() + 1);\n break;\n\n case NEUTRAL:\n case UP:\n RedditService.vote(this, p.getName(), Vote.DOWN);\n item.setIcon(R.drawable.ic_action_downvote_highlighted);\n p.setVote(Vote.DOWN);\n mUpvoteMenuItem.setIcon(R.drawable.ic_action_upvote);\n p.setScore(p.getScore() - 1);\n break;\n }\n break;\n\n case UP:\n switch (p.getVote()) {\n case NEUTRAL:\n case DOWN:\n RedditService.vote(this, p.getName(), Vote.UP);\n item.setIcon(R.drawable.ic_action_upvote_highlighted);\n p.setVote(Vote.UP);\n p.setScore(p.getScore() + 1);\n mDownvoteMenuItem.setIcon(R.drawable.ic_action_downvote);\n break;\n\n case UP:\n RedditService.vote(this, p.getName(), Vote.NEUTRAL);\n item.setIcon(R.drawable.ic_action_upvote);\n p.setVote(Vote.NEUTRAL);\n p.setScore(p.getScore() - 1);\n break;\n }\n\n break;\n\n default:\n break;\n }\n\n // Broadcast the intent to update the score in the ImageDetailFragment\n intent.putExtra(Consts.EXTRA_SCORE, p.getScore());\n LocalBroadcastManager.getInstance(this).sendBroadcast(intent);\n }", "@Override \n public void updateVote(String keyString) throws EntityNotFoundException {\n Key entityKey = KeyFactory.stringToKey(keyString);\n Entity entity = ds.get(entityKey);\n int currentCount = ((Long) entity.getProperty(\"voteCount\")).intValue();\n entity.setProperty(\"voteCount\", currentCount + 1);\n ds.put(entity);\n }", "public void updateNotification(){\n Bitmap androidImage=BitmapFactory.decodeResource(getResources(),R.drawable.mascot_1);\n NotificationCompat.Builder notifyBuilder=getNotificationBuilder();\n notifyBuilder.setStyle(new NotificationCompat.BigPictureStyle().bigPicture(androidImage).setBigContentTitle(\"Notificacion actualizada!\"));\n mNotifyManager.notify(NOTIFICATION_ID,notifyBuilder.build());\n setNotificationButtonState(false, false, true);\n\n }", "public void addVote(String vote){\r\n\t\tif(allVotes.get(vote) == null){\r\n\t\t\tallVotes.put(vote, 1);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tallVotes.put(vote, allVotes.get(vote) + 1);\r\n\t\t}\r\n\t\tsetChanged();\r\n\t\tnotifyObservers(\"vote\");\r\n\t}", "public static void doVoteAndComment() {\n }", "private synchronized void delegateVoted(Vote voteType) {\n\t\tvotes.put(currentlyVoting, voteType);\n\t\tif (currentlyVoting.getStatus().hasVetoPower && voteType.isVoteAgainst) {\n\t\t\t// A delegate with veto power voted against.\n\t\t\tvetoed = true;\n\t\t}\n\t\tsynchronized (votingThread) {\n\t\t\tvotingThread.notify();\n\t\t}\n\t}", "void votedOnPoll(String pollId);", "public void notifyUpdate(String publicID) {\n }", "public void upVote(Post p) {\n p.upvote();\n }", "public void notifyChangementJoueurs();", "public void updateDiscountNotification(int discountQuantity) {\n discountNotification.setText(String.valueOf(discountQuantity));\n }", "@Override\r\n\tpublic boolean update(NoticeVO vo) {\n\t\tsqlSession.update(namespace + \".update\", vo);\r\n\t\treturn true;\r\n\t}", "public static void updateNotification(Context context) {\n Alibi alibi = (Alibi) context.getApplicationContext();\n UserEvent event = alibi.getUserEventManager().getCurrentEvent();\n\n /* Don't set a notification if there isn't already one active; if the\n * event has not been running as long as the reminder interval, there\n * hasn't been a notification set yet.\n */\n long interval = alibi.getSettingsManager().getReminderDelayMillis();\n long startTime = event.getStartTime();\n long currentTime = System.currentTimeMillis();\n\n if (currentTime >= startTime + interval)\n setNotification(context, getNotificationMessage(event));\n }", "@Override\n public void notifyUpdate() {\n Update();\n //Invia all'activity di questo frammento il totale speso per aggiornare la sezione di controllo del budget\n onSendTotSpent.ReceiveTotSpent(contactGiftAdapter.totSpent());\n }", "@Override\r\n\tpublic void update(Notification notification, EObject element) {\n\t\tsuper.update(notification, element);\r\n\t}", "@Override\n public void setNotification() {\n if (getTense() == Tense.FUTURE) {\n //Context ctx = SHiTApplication.getContext();\n //SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(ctx);\n\n int leadTimeEventMinutes = SHiTApplication.getPreferenceInt(Constants.Setting.ALERT_LEAD_TIME_EVENT, LEAD_TIME_MISSING);\n\n if (leadTimeEventMinutes != LEAD_TIME_MISSING) {\n if (travelTime > 0) {\n leadTimeEventMinutes += travelTime;\n }\n\n setNotification(Constants.Setting.ALERT_LEAD_TIME_EVENT\n , leadTimeEventMinutes\n , R.string.alert_msg_event\n , getNotificationClickAction()\n , null);\n }\n }\n }", "Motivo update(Motivo update);", "@Override\n\tpublic void updateAffectation(Affectation notification) {\n\t\tdao.updateAffectation(notification);\n\t}", "public void notifyUpdate() {\n if (mObserver != null) {\n synchronized (mObserver) {\n mNotified = true;\n mObserver.notify();\n }\n }\n }", "public void notifyObserver(boolean isReviveEvent){\n this.observer.update(id, isReviveEvent);\n }", "public void addKickVote()\n\t{\n\t\tthis.numberOfKickVotes++;\n\t}", "@Override\n\t\t\tpublic void handleMessage(Message msg) {\n\t\t\t\tsuper.handleMessage(msg);\n\t\t\t\tswitch (msg.what) {\n\t\t\t\tcase EventManager.EventType_VoteChange:\n\t\t\t\tcase EventManager.EventType_SurveyChange:\n\t\t\t\t\tif(mDateArray == null || mDateArray.length() == 0){\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tfor(int i = 0; i < mDateArray.length(); i++){\n\t\t\t\t\t\tJSONObject obj = mDateArray.optJSONObject(i);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif(obj.optString(\"id\").equalsIgnoreCase((String) ((Object[])msg.obj)[0])){\n\t\t\t\t\t\t\t\tobj.put(\"favoriteStatus\", \"6\");\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t// TODO: handle exception\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(mListViewAdapter != null){\n\t\t\t\t\t\tmListViewAdapter.notifyDataSetChanged();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}", "@Override\r\n\tpublic void update(Responsible p) {\n\t\t\r\n\t}", "void onUpdate(Message message);", "public void updateForBlock(final BlockHeader header, final VoteTally voteTally) {\n final Address candidate = header.getCoinbase();\n if (epochManager.isEpochBlock(header.getNumber())) {\n // epoch blocks are not allowed to include a vote\n voteTally.discardOutstandingVotes();\n return;\n }\n\n if (!candidate.equals(NO_VOTE_SUBJECT)) {\n final CliqueExtraData extraData = CliqueExtraData.decode(header.getExtraData());\n final Address proposer = CliqueBlockHashing.recoverProposerAddress(header, extraData);\n voteTally.addVote(proposer, candidate, VoteType.fromNonce(header.getNonce()).get());\n }\n }", "private void note(Notification n){\r\n\t\tusers.get(n.userID).addNotification(n);\r\n\t\tif (loggedInUsers.contains(n.userID))\r\n\t\t\tcomms.sendMessage(n);\r\n\t}", "public abstract void updateWhatsOn();", "int updateByPrimaryKey(CmsVoteTitle record);", "public void sendVoteRequests() {\n for(int i = 1; i <= mConfig.getNumServers(); i++) {\n this.remoteRequestVote(i, mConfig.getCurrentTerm(), mID, mLog.getLastIndex(), mLog.getLastTerm());\n }\n //Initiate count vote timer\n voteCountTimer = scheduleTimer((long) 5, 2);\n }", "public void sendTaskVoteNotification(final Long taskId, final Long voterUserId, final RateDirection direction) {\n\t\ttaskExecutor.execute(new AsyncWebTask(notificationDao.getSessionFactory()) {\n\t\t\tpublic void runInBackground() {\n\t\t\t\tTask task = (Task) getSession().get(Task.class, taskId);\n\t\t\t\tUser source = (User) getSession().get(User.class, voterUserId);\n\t\t\t\tUser receiver = task.getOwner();\n\n\t\t\t\tNotification notification = new Notification();\n\t\t\t\tnotification.setTask(task);\n\t\t\t\tnotification.setReceiver(receiver);\n\t\t\t\tnotification.setSource(source);\n\t\t\t\tif (direction == RateDirection.UP) {\n\t\t\t\t\tnotification.setType(NotificationType.TASK_UPVOTE);\n\t\t\t\t} else {\n\t\t\t\t\tnotification.setType(NotificationType.TASK_DOWNVOTE);\n\t\t\t\t}\n\t\t\t\tnotificationDao.saveNotification(getSession(), notification);\n\n\t\t\t\tupdateNotificationMapIfUserExists(receiver.getId(), 1);\n\t\t\t}\n\t\t});\n\t}", "void update(Comment comment);", "private void vote(Connection connection, Matcher matcher) {\n\n final EventBus bus = getEventBus();\n if (!matcher.matches()) {\n bus.publish(new ConnectionMessageCommandEvent(connection, \"Invalid command!\"));\n return;\n }\n\n long pollID = Long.parseLong(matcher.group(1));\n int optionID = Integer.parseInt(matcher.group(2));\n\n try {\n StrawpollAPI.vote(pollID, optionID);\n bus.publish(new ConnectionMessageCommandEvent(connection, System.lineSeparator() + \"You voted successfully\"));\n }\n catch (Exception e) {\n bus.publish(new ConnectionMessageCommandEvent(connection, System.lineSeparator() + \"Whoops, it looks like we did not find a poll with the given id or index\"));\n e.printStackTrace();\n }\n\n }", "public void notifyUpdate( URL resource, int expected, int count )\r\n {\r\n getAdapter().notify( resource, expected, count );\r\n }", "public TestNotification update(TestNotification notif) {\n\t\treturn null;\n\t}", "void notifyPending(MessageSnapshot snapshot);", "public void setVotes(int votes) {\n this.votes = votes;\n }", "void updateNotification() {\n\t\tif (isPlaying()) {\n\t\t\tmNotification.icon = R.drawable.ic_now_playing;\n\t\t} else if (isPaused()) {\n\t\t\tmNotification.icon = R.drawable.ic_pause_track;\n\t\t}\n\t\tNotificationManager nM = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\t\tnM.notify(NOTIFICATION_ID, mNotification);\n\t}", "public void notifyChangementTour();", "public interface VoteHandler {\n\n /**\n * Handle the user's vote to alter the media's score\n *\n * @param vote User's vote\n */\n void handle(VoteMessage vote);\n\n}", "boolean notify(int event, Point point, Object value);", "public void updateObserver();", "public abstract Object notify(NotifyDescriptor descriptor);", "void notify(HorseFeverEvent e);", "EventChannel.Update update();", "private void receiveVote() {\n\t\t//Se la postazione termina la connessione informiamo lo staff con un messaggio di errore\n\t\tif(!link.hasNextLine()) {\n\t\t\tcontroller.printError(\"Errore di Comunicazione\", \"La postazione \"+ ip.getHostAddress() + \" non ha inviato i pacchetti di voto.\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Vengono recuperati i voti cifrati\n\t\tMessage request;\n\t\tWrittenBallot[] encryptedBallots;\n\t\ttry {\n\t\t\trequest = (Message) Message.fromB64(link.read(), \"postazione \" + ip.getHostAddress());\n\t\t\tString[] required = {\"encryptedBallots\"};\n\t\t\tClass<?>[] types = {WrittenBallot[].class};\n\t\t\t\n\t\t\trequest.verifyMessage(Protocol.sendVoteToStation, required, types, \"postazione \" + ip.getHostAddress());\n\t\t\tencryptedBallots = request.getElement(\"encryptedBallots\");\n\t\t\t\n\t\t\t//I voti vengono memorizzati nel seggio in attesa dell'invio all'urna\n\t\t\tif(((Controller) controller).storeVoteLocally(encryptedBallots, ip))\n\t\t\t\tlink.write(Protocol.votesReceivedAck);\n\t\t\telse\n\t\t\t\tlink.write(Protocol.votesReceivedNack);\n\t\t\t\n\t\t} catch (PEException e) {\n\t\t\tlink.write(Protocol.votesReceivedNack);\n\t\t\tcontroller.printError(e);\n\t\t}\n\t}", "void onHisNotify();", "@Override\n public void update(Observable o, Object arg) {\n ArrayList<Vote> votes = model.getVotes();\n ArrayList<Candidate> candidates = model.getCandidates();\n Object[][] rowData = new Object[votes.size()][candidates.size()];\n Object[] columnNames = new Object[candidates.size()];\n \n // Adds columns to votes table.\n for (int index = 0; index < candidates.size(); index++) {\n columnNames[index] = \"Preference \" + (index + 1);\n }\n \n // Displays the preferences for all votes.\n for (int index = 0; index < votes.size(); index++) {\n ArrayList<Candidate> preferences = votes.get(index).getPreferences();\n for (int preference = 0; preference < preferences.size(); preference++) {\n String prefText = \"<html><span \";\n \n // Displays the current preference/choice in a different colour.\n if (preferences.get(preference) == votes.get(index).getChoice()) {\n prefText += \"style='color:red'\";\n }\n \n prefText += \">\"+preferences.get(preference).getName()+\"</span></html>\";\n rowData[index][preference] = prefText;\n }\n }\n \n // Updates the model for the votes table.\n votesTable.setModel(new DefaultTableModel(rowData, columnNames) {\n @Override\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return false; // Stops cells being edited.\n }\n });\n }", "void notify(Message m);", "@Override\n public void notify(Object event){\n }", "public Vote(int id, int v) {\n candidate_id = id;\n priority = v;\n }", "public void update(Observable o, Object arg) {\n\n if (!(arg instanceof NodeChange)) {\n logger.severe(\"received unknown notification, ignore...\");\n return;\n }\n\n NodeChange nodeChange = (NodeChange) arg;\n if ((nodeChange.getCause() != NodeChange.MEMBER_JOINED) &&\n (nodeChange.getCause() != NodeChange.MEMBER_LEFT)) {\n // Ignore.\n return;\n }\n\n synchronized(cmmNotifications) {\n cmmNotifications.add(nodeChange);\n }\n }", "public void vote(int rating) {\n\t\tnew WebTraceTask(this, String.valueOf(rating)).execute(WebTraceTask.VOTE);\n\t}", "@Override\r\n\tpublic void update(Observable o, Object arg) {\r\n\t\tSystem.out.println(arg.toString());\r\n\t\tif (o instanceof Hand) {\r\n\t\t\tthis.sendNotification(\"Your hand has changed:\");\r\n\t\t\tthis.showHand();\r\n\t\t} else if (o instanceof Board) {\r\n\t\t\tthis.sendNotification(\"The board has changed:\");\r\n\t\t\tthis.showBoard();\r\n\t\t} else if (o instanceof Turn) {\r\n\t\t\tthis.sendNotification(\"Your turn is now as follows:\");\r\n\t\t\tthis.showTurn();\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void updateJoueurWon(Joueur joueur) {\n\t\t\r\n\t}", "@Override\n public void notifyAppointmentUpdated( int nIdAppointment )\n {\n }", "int updateByPrimaryKeySelective(CmsVoteTitle record);", "void castVote(Peer candidate) {\n votedFor = candidate;\n }", "@Override\n\tpublic void update(Discount discount) {\n\t\t\n\t}", "public void setNotify(long notify) {\n\t\tthis.notify = notify;\n\t}", "public void update(){}", "public void update(){}", "private void notifyStakeholder(){\n }", "@Override\r\n public void notify(Object arg) {\n }", "public abstract void notify(JSONObject message);", "void update(T message);", "private void sendNotification() {\n }", "public static void updateNotification(int id, String title, String text, boolean isOngoing) {\n if (mBuilder != null && mNotificationManager != null) {\n\n mBuilder.setContentTitle(title);\n mBuilder.setContentText(text);\n mBuilder.setOngoing(isOngoing);\n\n mNotificationManager.notify(id, mBuilder.build());\n }\n }", "private void notifyComments(Comment comment) {\n\n Notification notification = new Notification.Builder(getActivity())\n .setWhen(comment.getCreatedAt().getTime())\n .setShowWhen(true)\n .setTicker(\"New comment\")\n .setContentTitle(\"New comment\")\n .setContentText(comment.getBody())\n .setSmallIcon(R.drawable.trailer_icon)\n // .setLargeIcon(bitmap)\n // .setContentIntent(pi)\n .setAutoCancel(true)\n .build();\n\n NotificationManager notificationManager = (NotificationManager) getActivity().getSystemService(Context.NOTIFICATION_SERVICE);\n notificationManager.notify(comment.getPullRequest().getRepository().getFullName(), comment.getPullRequest().getNumber(), notification);\n }", "void notifyObserver();", "@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\n\t\t\t\t\tdoVote(getIntent().getStringExtra(\"aid\"), getIntent().getStringExtra(\"id\"));\n\t\t\t\t\t\n\t\t\t\t}", "public void updateTurnNotification(boolean b){\n if(b){\n gameNotificationL.setText(\"It's your turn!\");\n }\n else\n gameNotificationL.setText(\"It's not your turn.\");\n }", "void periodUpdate(int moteVersion, int moteInterval) {\n if (moteVersion > version) {\n /* It's new. Update our vision of the interval. */\n version = moteVersion;\n interval = moteInterval;\n window.updateSamplePeriod();\n }\n else if (moteVersion < version) {\n /* It's old. Update the mote's vision of the interval. */\n sendInterval();\n }\n }", "private void notifyObservers() {\n\t\tfor (Observer observer : subscribers) {\n\t\t\tobserver.update(theInterestingValue); // we can send whole object, or just value of interest\n\t\t\t// using a pull variant, the update method will ask for the information from the observer\n\t\t\t// observer.update(this)\n\t\t}\n\t}", "void notifyVisibilityStatusIncrease(JDPoint p);", "@Override\r\n\tpublic void OnNotifyUpdatePower(long tempid, int power) {\n\t\tNotifyPowerUpdate(String.valueOf(tempid),power);\r\n\t}", "public void vote(int index,Person voter,ArrayList<String> choices){\n votingList.get(index).vote(voter,choices);\n\n }", "private int notify(Wishlist wishlist, WishlistItem watched, InventoryItem invItem) {\n\t\tif (watched.isNotified) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tSystem.out.println(invItem.name + \" is in stock. Notify \" + wishlist.distributorID);\n\t\tif (notifier.notifyInStock(wishlist.notificationEmail, invItem.name)) {\n\t\t\twatched.setNotified();\n\t\t}\n\t\treturn 1;\n\t}", "public abstract void update(Message message);", "public void notify(Node node);", "public void onUpdate(T oldValue, T newValue);", "@Override\r\n\tpublic void update(WechatMember member) {\n\t\t\r\n\t}", "private synchronized void notifyUpdatedProperty(String key, String value) {\n Observer[] observers = observersTable.get(this);\n if (observers != null) {\n for (Observer observer : observers) {\n observer.updatedProperty(this, key, value);\n }\n }\n }", "private void sendUpdateMessage() {\n Hyperium.INSTANCE.getHandlers().getGeneralChatHandler().sendMessage(\n \"A new version of Particle Addon is out! Get it at https://api.chachy.co.uk/download/ParticleAddon/\" + ChachyMod.INSTANCE.getVersion(() -> \"ParticleAddon\"));\n }", "@RequestMapping(value = \"/update/{id}\", method = RequestMethod.PUT)\n\tprivate ResponseEntity<String> modifyNotificationById(@PathVariable(\"id\") ObjectId id,\n\t\t\t@Valid @RequestBody Notification Notification) {\n\t\tnoticontroller.modifyNotificationById(id, Notification);\n\t\treturn new ResponseEntity<>(\"Sửa thông tin Notification thành công\", HttpStatus.OK);\n\t}", "@Override\n\tpublic void update(GalaxyNote galaxynote) {\n\t\t\n\t}", "@Override\n\tpublic void update(CcNoticereceive entity) {\n\t\t\n\t}", "void update(String message, Command command, String senderNickname);", "private void setNotification() {\n mBuilder.setProgress(updateMax, ++updateProgress, false)\n .setContentTitle(getResources().getString(R.string.notification_message));\n // Issues the notification\n nm.notify(0, mBuilder.build());\n }", "private void updateCommentCount() {\n mProceessComment = true;\n final DatabaseReference ref = FirebaseDatabase.getInstance().getReference(\"Posts\").child(postId);\n ref.addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n if (mProceessComment){\n\n String comment =\"\"+ dataSnapshot.child(\"pComments\").getValue();\n int newCommentVal = Integer.parseInt(comment)+1;\n ref.child(\"pComments\").setValue(\"\"+newCommentVal);\n mProceessComment = false ;\n\n\n\n }\n\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n\n\n\n\n }", "public void voteCommit() {\n boolean b = preVote();\n synchronized ( this ) {\n if ( b == true ) \n commitVotes++; \n else {\n rbVotes++;\n votedCommit = false;\n }\n }\n postVote();\n }", "void notify(PushMessage m);", "@Override\r\n public void update(String message) {\r\n send(message);\r\n }" ]
[ "0.6729446", "0.66118634", "0.64039373", "0.63440824", "0.629509", "0.6212298", "0.6066588", "0.5976763", "0.5958905", "0.59306324", "0.5918644", "0.5912875", "0.58426994", "0.5839498", "0.58105767", "0.57508373", "0.5723594", "0.5690087", "0.56623644", "0.56607914", "0.5658324", "0.5614468", "0.56086123", "0.5603604", "0.55874556", "0.5578482", "0.5572151", "0.5543011", "0.5533694", "0.5531403", "0.55112004", "0.54957134", "0.5488208", "0.5476961", "0.54734415", "0.5468434", "0.54549843", "0.545432", "0.54402405", "0.54346406", "0.5432312", "0.54310894", "0.5419909", "0.5415754", "0.541177", "0.5406911", "0.5405568", "0.54006946", "0.53840166", "0.5372282", "0.5370137", "0.535698", "0.53562784", "0.5354123", "0.535411", "0.53539085", "0.53521764", "0.53503513", "0.53498805", "0.5342315", "0.53372693", "0.5328619", "0.5326791", "0.532069", "0.53161", "0.53149575", "0.53062665", "0.53017205", "0.53017205", "0.5301691", "0.52974516", "0.5295888", "0.52923465", "0.529183", "0.5285144", "0.5283909", "0.5282234", "0.5269676", "0.5268538", "0.5263758", "0.5261634", "0.52544874", "0.5252579", "0.5252207", "0.52511686", "0.524161", "0.5241494", "0.52392995", "0.52217025", "0.5218257", "0.5215186", "0.5215149", "0.5205525", "0.5204026", "0.5204026", "0.5203074", "0.5200514", "0.51970726", "0.5192106", "0.5189428" ]
0.6349929
3
if a vote is deleted its notifications cleared.
public void deleteTaskVoteNotification(final Long taskId, final Long receiverId, final Long voterUserId) { taskExecutor.execute(new AsyncWebTask(notificationDao.getSessionFactory()) { public void runInBackground() { User source = (User) getSession().get(User.class, voterUserId); User receiver = (User) getSession().get(User.class, receiverId); Notification notification = notificationDao.findTaskVoteNotification(getSession(), receiver.getId(), source.getId(), taskId); if (notification != null) { if (notification.getIsRead() == Boolean.FALSE) { updateNotificationMapIfUserExists(receiver.getId(), -1); } notificationDao.deleteWithSession(getSession(), notification); } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void clearPersistentNotifications();", "@Override\n public void onDeletionNotice(StatusDeletionNotice statusDeletionNotice) {\n }", "@Override\r\n public void onDeletionNotice(StatusDeletionNotice statusDeletionNotice) {\n }", "@Override\r\n public void onDeletionNotice(StatusDeletionNotice statusDeletionNotice) {\n }", "@Override\n\t\tpublic void onDeletionNotice(StatusDeletionNotice arg0) {\n\t\t\t\n\t\t}", "void deleteTrackerVotes(final Integer id);", "@Override\n protected void onDeletedMessages(Context context, int total) {\n Log.i(TAG, \"Received deleted messages notification\");\n }", "@Override\n\t\tpublic void onDeletionNotice(long arg0, long arg1) {\n\t\t\t\n\t\t}", "@Override\n\t\t\tpublic void onDeletionNotice(StatusDeletionNotice arg0) {\n\n\t\t\t}", "@Override\n public void delete(Long id) {\n log.debug(\"Request to delete Notification : {}\", id);\n notificationRepository.delete(id);\n notificationSearchRepository.delete(id);\n }", "void removeOldNotification();", "@Override\n public void onDeletionNotice(StatusDeletionNotice arg0) {\n }", "@Override\n\tprotected void onDeletedMessages(Context context, int total) {\n\t}", "@Override\n\tpublic void onDeletionNotice(long directMessageId, long userId) {\n\n\t}", "@Override\n\tpublic void onDeletionNotice(StatusDeletionNotice arg0) {\n\t\t\n\t}", "@Override\n\tpublic void onDeletionNotice(StatusDeletionNotice arg0) \n\t{\n\t}", "@Override\n\t\t\tpublic void onDeletionNotice(\n\t\t\t\t\tStatusDeletionNotice statusDeletionNotice) {\n\t\t\t}", "public void onDeletionNotice(StatusDeletionNotice statusDeletionNotice) {\n }", "@Override\n\t\tpublic void onDeletionNotice(\n\t\t\t\tStatusDeletionNotice statusDeletionNotice) {\n\t\t}", "public void onDeletionNotice(StatusDeletionNotice arg0) { }", "void deleteTrackerNotifications(final Integer id);", "@Override\n public void onDeleted(int position) {\n mVoteFragment.deleteVote(position);\n }", "@Override\r\n public void onDeletionNotice(StatusDeletionNotice arg0) {\n\r\n }", "@Override\r\n public void onDeletionNotice(StatusDeletionNotice arg0) {\n\r\n }", "@Override\r\n\tpublic void onDelete() {\n\t\tsuper.onDelete();\r\n\t}", "private void deleteNotification(final Notification notification, final NotifyItemHolder holder) {\n Call<Object> httpRequest = LoggedUserActivity.getNotificationsService().deleteNotification(notification.getNotificationId());\n\n httpRequest.enqueue(new Callback<Object>() {\n @Override\n public void onResponse(Call<Object> call, Response<Object> response) {\n if (response.isSuccessful()) {\n notificationsListFragment.removeUserNotification(notificationsListFragment, notification, fragmentView, recyclerView, holder);\n } else {\n Toast.makeText(LoggedUserActivity.getLoggedUserActivity(), response.code() + \" \" + response.message(), Toast.LENGTH_LONG).show();\n }\n }\n\n @Override\n public void onFailure(Call<Object> call, Throwable t) {\n Toast.makeText(LoggedUserActivity.getLoggedUserActivity(), t.getMessage(), Toast.LENGTH_LONG).show();\n }\n });\n }", "public void onDeletionNotice(\n \t\t\t\t\tStatusDeletionNotice statusDeletionNotice) {\n \t\t\t}", "@DeleteMapping(\"/up-question-votes/{id}\")\n @Timed\n public ResponseEntity<Void> deleteUpQuestionVote(@PathVariable Long id) {\n log.debug(\"REST request to delete UpQuestionVote : {}\", id);\n upQuestionVoteService.delete(id);\n return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(\"upQuestionVote\", id.toString())).build();\n }", "void deleteTrackerNotificationMessages(final Integer id);", "private void refreshNotification() {\n String str = this.mCurrentAddedNotiSsid;\n if (str != null) {\n showNotification(str, true, true);\n }\n String str2 = this.mCurrentDeletedNotiSsid;\n if (str2 != null) {\n showNotification(str2, false, true);\n }\n }", "public static void removeAll() {\n\t\t\n\t\tif(notificationsView != null) {\n\t\t\tComponent[] notifications = notificationsView.getComponents();\n\t\t\tfor(Component notification : notifications) {\n\t\t\t\tNotification n = (Notification) notification;\n\t\t\t\tif(n.expireOnDisconnect)\n\t\t\t\t\tn.removeNow();\n\t\t\t}\n\t\t}\n\t\t\n\t}", "protected void detachNotification(Txn txn) {\r\n }", "private void noticedelete(String postid){\n reference2 = FirebaseDatabase.getInstance().getReference(\"Notice\").child(postid);\n reference2.removeValue();\n }", "public void removeKickVote()\n\t{\n\t\tnumberOfKickVotes--;\n\t}", "void clearNotifications() throws NoUserSelectedException;", "public void createDeleteNotification (Invite inv) {\n Notification notification = new Notification();\n notification.setRelatedEvent(inv.getEvent());\n notification.setNotificatedUser(inv.getUser());\n notification.setSeen(false);\n notification.setType(NotificationType.deletedEvent);\n notification.setGenerationDate(new Date());\n em.persist(notification);\n //I send the notification mail to the user\n mailManager.sendMail(inv.getUser().getEmail(), \"Deleted Event\", \"Hi! An event for which you have received an invite has been cancelled. Join MeteoCal to discover it.\");\n }", "@Override\n\tpublic void delete() {\n\t\tSystem.out.println(\"no goin\");\n\t\t\n\t}", "@Override\n\tpublic Notification delNotification(int idUser) {\n\t\treturn dao.delNotification(idUser);\n\t}", "@Override\n public void onDeleted(Context context, int[] appWidgetIds) {\n }", "void onDelete();", "void deletePhotos(Subscriber<BaseBean> subscriber, String id);", "@Override\n\tpublic int commentsDelete(SnsVO vo) {\n\t\treturn map.commentsDelete(vo);\n\t}", "@Override public void deleteNotification(Long id) {\n var notification = notificationRepo.findById(id)\n .orElseThrow(() -> new ResourceNotFoundException(\"notification with id: \" + id));\n\n notificationRepo.delete(notification);\n jobManager.killJob(notification);\n }", "@FXML\n public void candidatedelete()\n {\n //checks whether tho voting has started or not\n if(voting_state==1)\n {\n a=new Alert(AlertType.ERROR);\n a.setContentText(\"You Cannot Delete Candidates While Voting !\");\n a.show();\n }\n else\n {\n a = new Alert(Alert.AlertType.WARNING);\n CId=C_ID.getText();\n //run sql query to delete record\n try\n {\n con.createStatement().execute(\"delete from candidates where candidate_id='\" + CId + \"'\");\n //delete object from hashmap\n allCandidates.remove(CId);\n text_clear();\n candidates.clear();\n //delete object from observable list\n for (HashMap.Entry<String, Candidate> set : allCandidates.entrySet())\n {\n Candidate can = set.getValue();\n candidates.add(can);\n }\n T_View.setItems(candidates);\n a=new Alert(AlertType.INFORMATION);\n a.setContentText(\"Successfully Deleted !\");\n a.show();\n }\n catch (Exception ex)\n {\n a = new Alert(AlertType.ERROR);\n a.setContentText(ex.getMessage());\n a.show();\n }\n }\n }", "public void removeVote(String token);", "protected void notifyDeleted(List<T> objects){\n\t\tfor( ModelEvents<T> observer : this.ObserverList){\r\n\t\t\tobserver.dataDeleted(objects);\r\n\t\t}\r\n\t}", "@Override\n public void onDeleted(Context context, int[] appWidgetIds) {\n super.onDeleted(context, appWidgetIds);\n }", "@Override\n\tpublic void removeOne(Long id) {\n\t\tnotificationRepository.delete(id);\n\n\t}", "void showDataDeletedMsg();", "int deleteByExample(CmsVoteTitleExample example);", "public void setDeleted();", "public void emptyBox()\n {\n this.notifications = new TreeSet<>();\n this.setUpdated();\n }", "public void delete(JobNotification currentNotification) {\n for (int i = notifications.size(); --i >= 0;) {\n if (notifications.get(i) == currentNotification) {\n notifications.remove(i);\n break;\n }\n }\n }", "public void removeNotification(View view){\n\n NotificationManager mNotificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n try {\n //Get ID entered from the view\n int id = Integer.valueOf(notifcationIdView.getSelectedItem().toString());\n\n //Try and remove it - catch exception if it doesn't exist\n mNotificationManager.cancel(id);\n\n //Update notification tracker and spinner\n currentNotifications.remove(id);\n } catch (Exception e ) {\n yell(e.getMessage());\n\n //If somethings getting messed up, wipe everything\n mNotificationManager.cancelAll();\n currentNotifications.clear();\n }\n\n scrollViewAdapter.notifyDataSetChanged();\n }", "public void onDelete() {\n }", "private void deleteHelper() {\n FirebaseFirestore db = FirebaseFirestore.getInstance();\n db.collection(\"posts\")\n .whereEqualTo(\"authorId\", MainActivity.currentUser.getUid())\n .whereEqualTo(\"published\", this.published)\n .get()\n .addOnSuccessListener(new OnSuccessListener<QuerySnapshot>() {\n @Override\n public void onSuccess(QuerySnapshot queryDocumentSnapshots) {\n for (QueryDocumentSnapshot q : queryDocumentSnapshots) {\n q.getReference().delete();\n }\n }\n });\n }", "private void handleClearDB() {\n try {\n ContentResolver contentResolver = this.mContext.getContentResolver();\n contentResolver.delete(KeyguardNotification.URI, null, null);\n contentResolver.notifyChange(KeyguardNotification.URI, null);\n } catch (Exception e) {\n Log.e(\"KeyguardNotifHelper\", \"handleClearDB\", e);\n }\n }", "@Override\n\tpublic void delete(Discount discount) {\n\t\t\n\t}", "@DeleteMapping(\"/voting-contents/{id}\")\n @Timed\n public ResponseEntity<Void> deleteVotingContent(@PathVariable Long id) {\n log.debug(\"REST request to delete VotingContent : {}\", id);\n votingContentRepository.delete(id);\n return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();\n }", "public void delete() {\n\t\tdeleted = true;\n\t}", "void deleteTrackerReminders(final Integer id);", "public void onConfirmFavouriteDeletion();", "@Override\n public void delete()\n {\n }", "@Override\n\t\tprotected void _delete() {\n\t\t\toldValue = 0;\n\t\t\tnewValue = 0;\n\t\t}", "private void showDeleteSuccess() {\n Notification notification = Notification.show(\"Your Advert Has Been Deleted \");\n notification.addThemeVariants(NotificationVariant.LUMO_ERROR);\n UI.getCurrent().getPage().reload();\n }", "public void deleteInstanceChangedObservers();", "@Override\r\n\tpublic void delete(Observer observer) {\n\t\tvector.remove(observer);\r\n\t}", "@Override\n\tpublic void delete(Note e) {\n\t\t\n\t}", "@Override\n\t\tpublic void delete() {\n\t\t\tSystem.out.println(\"새로운 삭제\");\n\t\t}", "void onItemDeleted();", "private DeleteNotification(com.google.protobuf.GeneratedMessageLite.Builder builder) {\n super(builder);\n\n }", "@Override\n \t\t\t\tpublic boolean isDeleted() {\n \t\t\t\t\treturn false;\n \t\t\t\t}", "@DeleteMapping(\"/push-notifications/{id}\")\n @Timed\n public ResponseEntity<Void> deletePushNotifications(@PathVariable String id) {\n log.debug(\"REST request to delete PushNotifications : {}\", id);\n pushNotificationsRepository.delete(id);\n return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id)).build();\n }", "@Override\n\tpublic void delete(GalaxyNote galaxynote) {\n\t\t\n\t}", "@Override\n\t\tpublic void delete() {\n\n\t\t}", "public void delete(int singerId);", "private void onItemDeleted() {\n Log.i(\"BasketFragment\",\"deleted\");\n }", "private void deleteNotification(int position) {\n Notification notificationToDelete = mNoteWithNotificationList.get(position).getNotification();\n\n Boolean returnVal = db.deleteNotification(notificationToDelete);\n\n ArrayList<Note> notes = db.getAllNotes();\n\n if (returnVal) {\n notifyRemoved(position);\n int calendarReadPermission = ContextCompat.checkSelfPermission(activity, Manifest.permission.READ_CALENDAR);\n int calendarWritePermission = ContextCompat.checkSelfPermission(activity, Manifest.permission.WRITE_CALENDAR);\n\n if (calendarReadPermission == PermissionChecker.PERMISSION_GRANTED && calendarWritePermission == PermissionChecker.PERMISSION_GRANTED) {\n int deletedRows = 0;\n deletedRows = calendarSync.deleteCalendarEntry(activity.getApplicationContext(), notificationToDelete.getId());\n if (deletedRows > 0) {\n Toast.makeText(activity, activity.getResources().getString(R.string.calendar_event_deleted), Toast.LENGTH_LONG).show();\n }\n }\n } else {\n Toast.makeText(activity, activity.getResources().getString(R.string.notification_delete_error), Toast.LENGTH_LONG);\n }\n\n refresh();\n }", "@Override\n\tpublic void delete() {\n\n\t}", "private void refresh() {\n ArrayList<Note> notes = db.getAllNotes();\n ArrayList<Note> notesWithNotification = new ArrayList<Note>();\n\n for (int index = 0; index < notes.size(); index++) {\n if (notes.get(index).getNotification() != null) {\n notesWithNotification.add(notes.get(index));\n }\n }\n\n mNoteWithNotificationList = notesWithNotification;\n }", "@Override\n public void delete() {\n }", "public void setDeleted(Integer deleted) {\n this.deleted = deleted;\n }", "public void onFriendDeleted(String meepTag, String nickname, String errorMessage);", "@Override\r\n\tpublic void updateDelete(String id) {\n \tUpdate update = new Update();\r\n\t\tupdate.set(\"status\", Constants.MSG_STATUS_DELETED);\r\n\t\t\r\n\t\tmongoTemplate.updateFirst(new Query(Criteria.where(\"id\").is(id)), update, AsxDataVO.class);\r\n\t}", "@NoProxy\n public void clearVoters() {\n final List<BwXproperty> props = getXproperties(BwXproperty.pollVoter);\n\n if (Util.isEmpty(props)) {\n return;\n }\n\n for (final BwXproperty p: props) {\n removeXproperty(p);\n }\n }", "public void deleteReply() {\n\r\n\t}", "public void tagDeleted(TagEvent event) {\n deletedEvent = event;\n }", "@Override\r\n\tpublic int deletedCheck(CookVO vo) throws Exception {\n\t\treturn session.update(\"com.mapper.cook.deleted\",vo);\r\n\t}", "public void sendPostDeleteVote(){\n Intent intent = getIntent();\n final int heritageId = intent.getIntExtra(\"heritageId\", -1);\n Retrofit retrofit = ApiClient.getApiClient();\n final SharedPreferences sharedPref = getSharedPreferences(\"TOKENSHARED\", Context.MODE_PRIVATE);\n final String token = sharedPref.getString(\"TOKEN\", null);\n ApiInterface apiInterface = retrofit.create(ApiInterface.class);\n Call<JsonResponseDeleteVote> call = apiInterface.deleteVote(new DeleteVoteBody(heritageId),\"Token \" + token);\n call.enqueue(new Callback<JsonResponseDeleteVote>() {\n @Override\n public void onResponse(Call<JsonResponseDeleteVote> call, Response<JsonResponseDeleteVote> response) {\n\n if (response.isSuccessful()) {\n Toast.makeText(getApplicationContext(), \"SUCCESSFUL DELETE VOTE\", Toast.LENGTH_SHORT).show();\n voteCount.setText(Integer.toString(response.body().getUpvote_count()-response.body().getDownvote_count()));\n upVote.setEnabled(true);\n downVote.setEnabled(true);\n\n }else if(response.code() == 404){\n Toast.makeText(getApplicationContext(), \"Firstly, please vote !!\" , Toast.LENGTH_SHORT).show();\n }\n else {\n Toast.makeText(getApplicationContext(), \"Sorry for inconvince server is down\" + response.code(), Toast.LENGTH_SHORT).show();\n Log.d(\"response\", response.raw().body().toString());\n }\n\n }\n\n @Override\n public void onFailure(Call<JsonResponseDeleteVote> call, Throwable t) {\n Toast.makeText(getApplicationContext(), \"ERROR while posting\", Toast.LENGTH_SHORT).show();\n }\n });\n\n }", "@Override\n public void delete(long id) {\n discussionFollowerRepository.deleteById(id);\n }", "@Override\n\tpublic int deleteNotice(int id) throws Exception {\n\t\treturn -1;//res;\n\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t\tboolean done= humanInteractions.getNotifications().getNotification().remove(selectedNotification);\n\t\t\t\tnotficationViewer.setInput(createNotificationModle());\n\n\t\t\t}", "private void postVote() {\n if ( unvotedParties() == 0 )\n TransactionManager.getTransactionManager().resolveTransaction(txId);\n }", "@Override\n public <T extends JPABase> T delete() {\n for (Candidate candidate : candidates) {\n candidate.delete();\n }\n this.candidates.clear();\n\n for (User user : users) {\n user.delete();\n\n }\n this.users.clear();\n\n\n\n return super.delete();\n }", "@Override\n\tpublic void delete() {\n\t\t\n\t}", "@Override\n\tpublic void delete() {\n\t\t\n\t}", "public void MarkForDeletion();", "@Override\r\n\t@Transactional\r\n\tpublic void delete(TopicContent entity) {\n\t\ttopicContentDao.delete(entity);\r\n\t}", "@Override\n public void onRemoval(final RemovalNotification<String, Optional<File>> notification) {\n if (!notification.getKey().endsWith(\"/\") && tempDirectory != null && notification.getValue().isPresent())\n FileRemovals.delete(notification.getValue().get());\n }", "public void onCancelFavouriteDeletion();" ]
[ "0.6255471", "0.6157376", "0.61561626", "0.61561626", "0.6099003", "0.608396", "0.6079309", "0.60746676", "0.60720897", "0.60527277", "0.604733", "0.60445374", "0.59984183", "0.59528315", "0.59459025", "0.5943144", "0.5937373", "0.5928457", "0.59109855", "0.5897807", "0.58630216", "0.58218926", "0.5812534", "0.5812534", "0.5781769", "0.57796776", "0.57559943", "0.57385874", "0.57121944", "0.56918395", "0.5680002", "0.5678131", "0.56715035", "0.5564253", "0.55259395", "0.55087066", "0.54877955", "0.5484323", "0.5483864", "0.54562736", "0.5451197", "0.54468936", "0.5445342", "0.5427762", "0.5424259", "0.5409557", "0.54066694", "0.5397889", "0.5387095", "0.5382976", "0.5378946", "0.53594583", "0.5352413", "0.5344619", "0.5339525", "0.5328036", "0.53184545", "0.5317777", "0.53140676", "0.5310687", "0.5309638", "0.53024143", "0.5295752", "0.5281107", "0.527786", "0.5274659", "0.5274313", "0.52716434", "0.5265821", "0.52651995", "0.52644444", "0.52457625", "0.5235455", "0.5235368", "0.52257466", "0.52225673", "0.52091974", "0.5207459", "0.5200001", "0.5194747", "0.51796037", "0.5175231", "0.51724666", "0.5163233", "0.5156005", "0.5155488", "0.515463", "0.51458293", "0.5144103", "0.5142385", "0.51399535", "0.51390517", "0.51303214", "0.51217645", "0.51023984", "0.51023984", "0.5096231", "0.50924695", "0.50919384", "0.5080379" ]
0.59666777
13
remove notifications of a task
public void removeTaskNotifications(Task task) { notificationDao.deleteTaskNotifications(task); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void removeOldNotification();", "void removeSubTask(AuctionTask task);", "void remove(final Task task);", "public void removeTasks() {\n\t\t\r\n\t}", "void clearPersistentNotifications();", "public void removeTask(Task task) {\n tasks.remove(task);\n }", "public void removeTask(ToDoTask t) {\n database.removeTask(t);\n Toast.makeText(this, String.format(getResources().getString(R.string.list_remove_toast),\n t.getTask()), Toast.LENGTH_LONG).show();\n }", "public void unregisterNotify( Notify notify );", "public void deleteTask(Task task)\n {\n tasks.remove(task);\n }", "public void removeFromTaskList(Task task) {\n if (task != null)\n task.removeSafely();\n taskList.removeValue(task, true);\n }", "void deleteTrackerNotifications(final Integer id);", "void cancelAllNotifications();", "public final void disassociateAll(@NotNull ConsumerTask<S> task)\n {\n this.unregisterAll(task);\n }", "public void deleteTask(Task task) {\n tasks.remove(task);\n }", "public void removeElement(DemoTask task) {\n\t\tdata.remove(task);\n\t}", "public void removeNotificationsByThread(long threadID){\r\n\t\tif(_debug) Log.v(_context, \"NotificationViewFlipper.removeNotifications() Thread ID: \" + threadID);\r\n\t\t//Must iterate backwards through this collection.\r\n\t\t//By removing items from the end, we don't have to worry about shifting index numbers as we would if we removed from the beginning.\r\n\t\tint totalNotifications = this.getChildCount();\r\n\t\tfor(int i=totalNotifications-1; i>=0; i--){\r\n\t\t\tNotification notification = ((NotificationView) this.getChildAt(i)).getNotification();\r\n\t\t\tif(notification.getThreadID() == threadID){\r\n\t\t\t\t//Cancel the reminder.\r\n\t\t\t\tnotification.cancelReminder();\r\n\t\t\t\t//Remove the notification at this index.\r\n\t\t\t\tremoveNotification(i, false);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Clear the status bar notification for SMS & MMS types.\r\n\t\tCommon.clearNotification(_context, this, Constants.NOTIFICATION_TYPE_SMS);\r\n \tCommon.clearNotification(_context, this, Constants.NOTIFICATION_TYPE_MMS);\r\n\t}", "public void removeNotification(Notification notification) {\n\n notifications.remove(notification);\n }", "void unRegister(NotificationListener<ObservableIntentServiceNotificationType> notificationStrategy);", "protected void detachNotification(Txn txn) {\r\n }", "public void deleteTask(Integer tid);", "public void removeNotification(View view){\n\n NotificationManager mNotificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n try {\n //Get ID entered from the view\n int id = Integer.valueOf(notifcationIdView.getSelectedItem().toString());\n\n //Try and remove it - catch exception if it doesn't exist\n mNotificationManager.cancel(id);\n\n //Update notification tracker and spinner\n currentNotifications.remove(id);\n } catch (Exception e ) {\n yell(e.getMessage());\n\n //If somethings getting messed up, wipe everything\n mNotificationManager.cancelAll();\n currentNotifications.clear();\n }\n\n scrollViewAdapter.notifyDataSetChanged();\n }", "public void removeTask(Class<? extends RoomTask> taskClass) {\n for (ConcurrentLinkedQueue<RoomTask> taskDurationList : this.tasks.values()) {\n for (RoomTask task : taskDurationList) {\n if (task.getClass().equals(taskClass)) {\n taskDurationList.remove(task);\n }\n }\n }\n }", "boolean removeNotification(List<String> stopIDs, String lineID, String deleteDescription) throws Exception;", "void deleteTrackerNotificationMessages(final Integer id);", "void disableNotifications();", "public void onTaskCompletion(Task<?> task)\n {\n m_RunningTasks.remove(task);\n }", "public static void deletedCommand(Task t) {\n UI.line();\n System.out.println(\"\\tNoted. I've removed this Task:\");\n System.out.println(\"\\t\" + t.toString());\n int count = 0;\n for (Object ignored : Tasks) {\n count++;\n }\n System.out.println(\"\\tNow you have \" + count + \" tasks in the list.\");\n UI.line();\n }", "@Override\n public void removeNotify()\n {\n unregisterListeners();\n super.removeNotify();\n }", "void removeTaskmonitorrecord(int i);", "void clearAllNotifications(long timeout);", "@Transactional( WorkflowPlugin.BEAN_TRANSACTION_MANAGER )\n void removeByIdTask( int nIdTask );", "void clearNotifications() throws NoUserSelectedException;", "public void removeTask(Task task) {\n if (hasScheme(task)) {\n for (Role role : this.roles) {\n if (role.hasResponsibility(task)) {\n this.roles.remove(role);\n task.removeWorker(role);\n return;\n }\n }\n }\n }", "private static void taskCompleted(Context context, String uniqueId) {\n context.getContentResolver().delete(TaskContract.TaskEntry.CONTENT_URI,\n TaskContract.TaskEntry.UNIQUE_ID+\"=?\",\n new String[] {uniqueId});\n NotificationUtils.clearAllNotifications(context);\n }", "boolean deleteTask(Task task);", "@Override\n public void onRemoval(final RemovalNotification<String, Optional<File>> notification) {\n if (!notification.getKey().endsWith(\"/\") && tempDirectory != null && notification.getValue().isPresent())\n FileRemovals.delete(notification.getValue().get());\n }", "public void removeTaskListener(TaskListener task){\n if (listeners == null) return;\n listeners.remove(task);\n }", "public void setNotifications(ArrayList<TaskModel> temp, Context context){\n if (temp.isEmpty()) {\n return;\n }\n TaskModel t = temp.get(0);\n\n //Add counter and t.getTimeLeft()(in some fucked up value);\n int toAdd = (int)t.getTimeLeft() / 1000 / 60;\n AlarmManager manager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);\n Intent intent= new Intent(context, NotificationReceiver.class);\n intent.putExtra(\"content\", t.getTitle());\n PendingIntent alarmIntent = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n Calendar c = Calendar.getInstance();\n c.add(Calendar.MINUTE, (toAdd));\n long time = c.getTimeInMillis();\n manager.set(AlarmManager.RTC_WAKEUP, time, alarmIntent);\n //set task for deletion\n final TaskModel toDelete = t;\n Handler timerHandler = new Handler();\n Runnable timerRunnable = new Runnable(){\n @Override\n public void run(){\n deleteTask(tasks, toDelete);\n }\n };\n timerHandler.postDelayed(timerRunnable, time - 100);\n\n // counter += toAdd;\n }", "public static void clearNotifications(Context context) {\n NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\n notificationManager.cancelAll();\n }", "public static void removeAll() {\n\t\t\n\t\tif(notificationsView != null) {\n\t\t\tComponent[] notifications = notificationsView.getComponents();\n\t\t\tfor(Component notification : notifications) {\n\t\t\t\tNotification n = (Notification) notification;\n\t\t\t\tif(n.expireOnDisconnect)\n\t\t\t\t\tn.removeNow();\n\t\t\t}\n\t\t}\n\t\t\n\t}", "private void clearTasks(){\n ArrayList<Item> iteratorList = new ArrayList<Item>(items);\n Iterator<Item> it = iteratorList.iterator();\n while(it.hasNext()){\n Item i = it.next();\n if (!i.isCategory()){\n Task t = (Task) i;\n if(t.finished){\n \tDirectIO.RemoveItem(t);\n adapter.remove(i);\n }\n }\n }\n }", "void deleteTrackerTasks(final Integer id);", "void deleteTask(int id);", "@Override\n public void onTaskRemoved(Intent rootIntent) {\n Log.d(TAG, TAG + \" onTaskRemoved\");\n }", "public final @SafeVarargs void disassociate(@NotNull ConsumerTask<S> task, @NotNull S... states)\n {\n this.unregister(task, states);\n }", "void notifyMessage(Task task);", "public void removeNotificationAlarm() {\n AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);\n am.cancel(buildAlarmPendingIntent());\n\n // don't need to trigger BootReceiver if notifications are disabled\n setBootReceiverEnabled(false);\n }", "public void clearTaskListeners(){\n if (listeners == null) return;\n listeners.clear();\n }", "void deleteUndoneTask(ReadOnlyTask target) throws UniqueTaskList.TaskNotFoundException;", "private ArrayList<Task> removeNoTimeTask(ArrayList<Task> toFilter) {\n ArrayList<Integer> toDelete = new ArrayList<Integer>();\n\n //remove all without dates (ToDos and Lasts)\n for (int i = 0; i < toFilter.size(); i++) {\n if (toFilter.get(i).getClass().equals(ToDo.class)) {\n toDelete.add(i);\n }\n if (toFilter.get(i).getClass().equals(Last.class)) {\n toDelete.add(i);\n }\n }\n\n for (int i = toDelete.size() - 1; i >= 0; ) {\n toFilter.remove((int) toDelete.get(i));\n i--;\n }\n return toFilter;\n }", "void removeTaskAbstract(int i);", "void deleteTrackerReminders(final Integer id);", "public void deleteAll() {\n tasks = new ArrayList<>();\n }", "void declineNotification(NotificationDTO selectedNotification);", "private void deleteNotification(final Notification notification, final NotifyItemHolder holder) {\n Call<Object> httpRequest = LoggedUserActivity.getNotificationsService().deleteNotification(notification.getNotificationId());\n\n httpRequest.enqueue(new Callback<Object>() {\n @Override\n public void onResponse(Call<Object> call, Response<Object> response) {\n if (response.isSuccessful()) {\n notificationsListFragment.removeUserNotification(notificationsListFragment, notification, fragmentView, recyclerView, holder);\n } else {\n Toast.makeText(LoggedUserActivity.getLoggedUserActivity(), response.code() + \" \" + response.message(), Toast.LENGTH_LONG).show();\n }\n }\n\n @Override\n public void onFailure(Call<Object> call, Throwable t) {\n Toast.makeText(LoggedUserActivity.getLoggedUserActivity(), t.getMessage(), Toast.LENGTH_LONG).show();\n }\n });\n }", "public void removeAlarms (){\n AlarmManager alarmManager = (AlarmManager) getContext().getSystemService(Context.ALARM_SERVICE);\n for (int i = 0; i < dogMetaDataArrayList.size(); i++){\n Intent recreateIntent = new Intent(getContext(), OneTimeReciveNotification.class);\n PendingIntent pendingIntent = PendingIntent.getBroadcast(getContext(), i, recreateIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n pendingIntent.cancel();\n alarmManager.cancel(pendingIntent);\n }\n }", "public void removeTask(String removeTask) {\n \t\n \tSystem.out.println(\"Removing an existing Task\");\n \tint count = 0;\n \tTask deleteTask = null;\n \tfor(Task t : toDoList) {\n \t\tif(t.getTaskName().equals(removeTask)) {\n \t\t\t\n \t\t\tbreak;\n \t\t}\n \t\t\n \t\tcount++;\n \t}\n \tdeleteTask = toDoList.remove(count);\n \t\n \tif(deleteTask != null) {\n \t\tSystem.out.println(\"Task deleted successfully\");\n \t}\n \telse {\n \t\tSystem.out.println(\"Task not found\");\n \t}\n \tdisplay();\n }", "public void delete(JobNotification currentNotification) {\n for (int i = notifications.size(); --i >= 0;) {\n if (notifications.get(i) == currentNotification) {\n notifications.remove(i);\n break;\n }\n }\n }", "@Override\n protected Void doInBackground(Void... v) {\n try {\n repeating = ServerCom.removeTask(mAptID, tempTask.getDescription(), tempTask.getAssignee());\n } catch (Exception e) {\n this.exception = e;\n }\n\n return null;\n }", "public void removeNotifications(long[] users, long project, long notificationType, String operator)\r\n throws ResourceManagementException {\r\n ArgumentChecker.checkNotificationsToBeRemoved(users, project, notificationType, operator);\r\n this.port.removeNotifications(users, project, notificationType, operator);\r\n }", "@Delete\n void delete(Task... task);", "void deleteTrackerNotificationRecipients(final Integer id);", "protected void handleCompletedTask(Future<Task> task)\n {\n m_RunningTasks.remove(task);\n\n }", "@Override\n\tpublic void removeOne(Long id) {\n\t\tnotificationRepository.delete(id);\n\n\t}", "public void remove(Task var) {\n\t\tfor (int i = 0; i < tasks.size(); i++) {\n\t\t\tif (tasks.get(i).getAnalysis().equals(var.getAnalysis())) {\n\t\t\t\ttasks.remove(i);\n\t\t\t}\n\t\t}\n\t}", "@FXML\n\tprivate void deleteSelected(ActionEvent event) {\n\t\tint selectedIndex = taskList.getSelectionModel().getSelectedIndex();\n\t\tString task = taskList.getItems().get(selectedIndex);\n\t\ttaskList.getSelectionModel().clearSelection();\n\t\ttaskList.getItems().remove(task);\n\t\tchatView.setText(\"\");\n\t\ttaskList.getItems().removeAll();\n\t\tString task_split[] = task.split(\" \", 2);\n\t\tString removeTask = task_split[1];\n\t\tif (task.contains(\"due by\")) {\n\t\t\tString[] taskDate = task_split[1].split(\"\\\\s+\");\n\t\t\tSystem.out.println(taskDate);\n\t\t\tString end = taskDate[taskDate.length - 3];\n\t\t\tSystem.out.println(end);\n\t\t\tremoveTask = task_split[1].substring(0, task_split[1].indexOf(end)).trim();\n\t\t\tSystem.out.println(removeTask);\n\n\t\t}\n\t\tclient.removeTask(removeTask.replace(\"\\n\", \"\"));\n\t}", "@Override\n public void onTaskRemoved(Intent rootIntent) {\n super.onTaskRemoved(rootIntent);\n }", "public static void removeWaiting(int taskNumber){\n Set<Instruction> tempSet = new HashSet<>();\n for(Instruction i : waitingList){\n if(i.taskNumber == taskNumber){\n tempSet.add(i);\n }\n }\n\n for(Instruction i : tempSet){\n waitingList.remove(i);\n }\n\n }", "void clearAndNotify();", "@Override\n public void removeByTaskInstanceId(Integer taskInstanceId) {\n taskInstanceCache.remove(taskInstanceId);\n }", "public void deleteTask(Task task) {\n database.delete(SQLiteHelper.TABLE_TASKS,\n SQLiteHelper.COLUMN_ID + \" = \" + task.get_id(), null);\n }", "public void deleteTask() {\n\t\tsuper.deleteTask();\n\t\tif (mTaskDetailNavigator != null) {\n\t\t\tmTaskDetailNavigator.onTaskDeleted();\n\t\t}\n\t}", "protected void teardownTask(Task task) {\n }", "@Override\r\n\tpublic void onDetach() {\n\t\tif(!operFlag&&task.getAlarmTime()<=Calendar.getInstance().getTimeInMillis())\r\n\t\t\ttaskMgr.overdueTask(task);\r\n\t\tsuper.onDetach();\r\n\t\tGlobalVar.todoAdapter.refreshAdapter();\r\n\t\tgetActivity().finish();\r\n\t}", "void deleteDoneTask(ReadOnlyTask floatingTask) throws TaskNotFoundException;", "@Override public void deleteNotification(Long id) {\n var notification = notificationRepo.findById(id)\n .orElseThrow(() -> new ResourceNotFoundException(\"notification with id: \" + id));\n\n notificationRepo.delete(notification);\n jobManager.killJob(notification);\n }", "public void clear() {\n while(taskList.size > 0)\n taskList.pop().removeSafely();\n }", "public void onTaskFailure(Task<?> tsk, Exception ex)\n {\n m_RunningTasks.remove(tsk);\n }", "void deleteTask( org.openxdata.server.admin.model.TaskDef task, AsyncCallback<Void> callback );", "@Override\r\n public void clearTask()\r\n {\r\n this.task = new DiagramTask();\r\n }", "void stopReportingTask();", "public void cancelNotification() {\n Context context = ApiManager.getInstance().getContext();\n if (context != null) {\n NotificationManager notificationManager = (NotificationManager) context\n .getSystemService(Context.NOTIFICATION_SERVICE);\n if (notificationManager != null) {\n Logger.d(TAG, \"cancelNotification() entry\");\n notificationManager.cancel(UNREAD_MESSAGE,\n NOTIFICATION_ID_UNREAD_MESSAGE);\n notificationManager.cancel(FILE_TRANSFER,\n NOTIFICATION_ID_FILE_TRANSFER);\n } else {\n Logger.e(TAG,\n \"cancelNotification the notificationManager is null\");\n }\n } else {\n Logger.e(TAG,\n \"cancelGroupInviteNotification the context is null\");\n }\n mUnReadMessagesChatInfos.clear();\n mFileInvitationInfos.clear();\n Logger.d(TAG, \"cancelNotification() exit\");\n }", "public void deleteTask(Task task){\n SQLiteDatabase db = this.getWritableDatabase();\n db.delete(TABLE_NAME, KEY_ID + \" = ?\",\n new String[] { String.valueOf(task.getId()) });\n taskIndexReset();\n db.close();\n }", "public void interruptTask() {\n }", "public void interruptTask() {\n }", "PropertiesTask removeAllProperties();", "@Override\r\n\tpublic void deleteByTask(int taskId) {\n\t\tString sql = \"DELETE FROM executetask WHERE et_task_id = ?\";\r\n\t\tupdate(sql,taskId);\r\n\t}", "@Test\n void removeTask() {\n }", "public void removePushToken() {\n }", "public void removeFromReminders(Date reminders);", "@Override\n\tpublic void run() {\n\t\tNewDeliverTaskManager ndtm = NewDeliverTaskManager.getInstance();\n\t\tif(ndtm != null && ndtm.isNewDeliverTaskAct) {\n\t\t\tNewDeliverTaskManager.logger.error(\"[旧的任务库删除线程启动成功][\" + this.getName() + \"]\");\n\t\t\twhile(isStart) {\n\t\t\t\tint count1 = 0;\n\t\t\t\tint count2 = 0;\n\t\t\t\tif(needRemoveList != null && needRemoveList.size() > 0) {\n\t\t\t\t\tList<DeliverTask> rmovedList = new ArrayList<DeliverTask>();\n\t\t\t\t\tfor(DeliverTask dt : needRemoveList) {\n\t\t\t\t\t\tDeliverTaskManager.getInstance().notifyDeleteFromCache(dt);\n\t\t\t\t\t\trmovedList.add(dt);\n\t\t\t\t\t\tcount1++;\n\t\t\t\t\t\tif(count1 >= 300) {\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\tsynchronized (this.needRemoveList) {\n\t\t\t\t\t\tfor(DeliverTask dt : rmovedList) {\n\t\t\t\t\t\t\tneedRemoveList.remove(dt);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(heartBeatTime);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\tTransitRobberyManager.logger.error(\"删除旧的已完成列表线程出错1:\", e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(teRemoveList != null && teRemoveList.size() > 0) {\n\t\t\t\t\tList<TaskEntity> teRemovedList = new ArrayList<TaskEntity>();\n\t\t\t\t\tfor(TaskEntity te : teRemoveList) {\n\t\t\t\t\t\tTaskEntityManager.getInstance().notifyDeleteFromCache(te);\n\t\t\t\t\t\tteRemovedList.add(te);\n\t\t\t\t\t\tcount2++;\n\t\t\t\t\t\tif(count2 >= 100) {\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\tsynchronized (this.teRemoveList) {\n\t\t\t\t\t\tfor(TaskEntity te : teRemovedList) {\n\t\t\t\t\t\t\tteRemoveList.remove(te);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else{\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(30000);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\tTransitRobberyManager.logger.error(\"删除旧的已完成列表线程出错2:\", e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tTransitRobberyManager.logger.error(\"[旧的任务库删除线程关闭][\" + this.getName() + \"]\");\n\t}", "public void dismissAllUserNotifications(Context context){\r\n\t\ttry{\r\n\t\t\tString masterSentFromAddress = this.getActiveNotification().getSentFromAddress();\r\n\t\t\tlong masterContactID = this.getActiveNotification().getContactID();\r\n\t\t\tint totalNotifications = this.getChildCount();\r\n\t\t\tfor(int i=totalNotifications-1; i>=0; i--){\r\n\t\t\t\tNotification notification = ((NotificationView) this.getChildAt(i)).getNotification();\r\n\t\t\t\tboolean removeNotification = false;\r\n\t\t\t\tif(masterSentFromAddress.equals(notification.getSentFromAddress())){\r\n\t\t\t\t\tremoveNotification = true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(masterContactID > 0){\r\n\t\t\t\t\t\tremoveNotification = masterContactID == notification.getContactID();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(removeNotification){\r\n\t\t\t\t\t//Cancel the reminder.\r\n\t\t\t\t\tnotification.cancelReminder();\r\n\t\t\t\t\t//Remove the notification at this index.\r\n\t\t\t\t\tthis.removeNotification(i, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//Update the navigation information on the current View.\r\n\t\t\tif(this.getChildCount() > 0){\r\n\t\t\t\tfinal View currentView = this.getCurrentView();\t\t\t\t\r\n\t\t\t\tupdateView(currentView, this.getDisplayedChild(), 0);\r\n\t\t\t}else{\r\n\t\t\t\t//Close the ViewFlipper and finish the Activity.\r\n\t\t\t\t_notificationActivity.finishActivity();\r\n\t\t\t}\r\n \t\t}catch(Exception ex){\r\n \t\t\tLog.e(_context, \"NotificationViewFlipper.dismissAllUserNotifications() ERROR: \" + ex.toString());\r\n \t\t}\r\n \t}", "public void removeObserver(T t){\n\t\t\n\t\tIterator<T> it = observers.iterator();\n\t\tboolean encontrado = false;\n\t\tT valor = null;\n\t\t\n\t\t\n\t\twhile(it.hasNext() && !encontrado){\n\t\t\t\t\n\t\t\tvalor = it.next();\t\n\t\t\tencontrado = (valor.equals(t));\n\t\t}\n\t\t\n\t\t\n\t\tif(!encontrado){\n\t\t\t\n\t\t\tthis.observers.remove(t);\n\t\t}\n\t\t\n\t}", "public void UnPostAllEvents();", "private void cancelTasks() {\n\t\ttimer.cancel();\n\t\ttimer.purge();\n\t}", "@Override\n public void onTaskRemoved(Intent rootIntent) {\n super.onTaskRemoved(rootIntent);\n stopSelf();\n }", "protected void applyPendingDeletes ()\n {\n while (!m_aDeleteStack.isEmpty ())\n removeMonitoredFile (m_aDeleteStack.pop ());\n }", "@Override\n\tpublic Notification delNotification(int idUser) {\n\t\treturn dao.delNotification(idUser);\n\t}", "public void removeActiveNotification(boolean rescheduled){\r\n\t\ttry{\r\n\t\t\t_notificationActivity.stopTextToSpeechPlayback();\r\n\t\t\tNotification notification = this.getActiveNotification();\r\n\t\t\tif(notification == null){\r\n\t\t\t\tLog.e(_context, \"NotificationViewFlipper.removeActiveNotification() Active Notification Is Null. Exiting...\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tthis.removeNotification(this.getDisplayedChild(), rescheduled);\r\n\t\t\t//Clear the status bar notification.\r\n\t \tCommon.clearNotification(_context, this, notification.getNotificationType());\r\n\t\t}catch(Exception ex){\r\n\t\t\tLog.e(_context, \"NotificationViewFlipper.removeActiveNotification() ERROR: \" + ex.toString());\r\n\t\t}\r\n\t}", "public void remove(int index){\n tasks.remove(index);\n }" ]
[ "0.73475397", "0.7016348", "0.7008957", "0.6918464", "0.665085", "0.65593445", "0.65231204", "0.65218776", "0.6518856", "0.6492169", "0.6477114", "0.64341307", "0.6380103", "0.6373439", "0.6355919", "0.6349494", "0.6317104", "0.6243659", "0.62237054", "0.6197098", "0.6186268", "0.61702096", "0.61433244", "0.61347663", "0.61313605", "0.61049026", "0.6071514", "0.6063526", "0.6057362", "0.6053379", "0.5994263", "0.59891045", "0.5985028", "0.598345", "0.5973469", "0.595209", "0.5927672", "0.59184086", "0.5896528", "0.58886355", "0.58698124", "0.58687174", "0.58589405", "0.58566517", "0.58487207", "0.5832599", "0.5785224", "0.5778352", "0.5771233", "0.57660526", "0.5748988", "0.5733375", "0.57331043", "0.57293653", "0.5717712", "0.57143587", "0.56546897", "0.5637964", "0.5636964", "0.563037", "0.56138754", "0.5605058", "0.5590889", "0.55836594", "0.55613536", "0.5543362", "0.55394715", "0.55320364", "0.5531132", "0.5510636", "0.5502523", "0.5497306", "0.54920053", "0.5476912", "0.5470726", "0.5461708", "0.5459802", "0.54554164", "0.5452341", "0.54478306", "0.5438253", "0.542614", "0.54259735", "0.5424768", "0.5424768", "0.542195", "0.5416018", "0.5411571", "0.5408697", "0.5396719", "0.53923047", "0.5391058", "0.53849274", "0.5382899", "0.5381867", "0.5375119", "0.5373595", "0.53732413", "0.53730935", "0.5359512" ]
0.81045884
0
remove notifications of a community
public void removeCommunityNotifications(Community community) { notificationDao.deleteCommunityNotifications(community); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void removeOldNotification();", "public static void removeAll() {\n\t\t\n\t\tif(notificationsView != null) {\n\t\t\tComponent[] notifications = notificationsView.getComponents();\n\t\t\tfor(Component notification : notifications) {\n\t\t\t\tNotification n = (Notification) notification;\n\t\t\t\tif(n.expireOnDisconnect)\n\t\t\t\t\tn.removeNow();\n\t\t\t}\n\t\t}\n\t\t\n\t}", "void removeFromMyCommunities(String userId,\n String communityGUID) throws InvalidParameterException,\n PropertyServerException,\n UserNotAuthorizedException;", "void deleteTrackerNotificationMessages(final Integer id);", "void cancelAllNotifications();", "public void removeNotification(Notification notification) {\n\n notifications.remove(notification);\n }", "public void removeMessage(int i) {\n try {\n this.emails.remove(i);\n System.out.println(\"Email removido com sucesso!\\n\");\n } catch (Exception e) {\n System.out.println(\"ERROR: Mensagem não existe!\");\n }\n }", "public void deleteMessages() {\n\t\tmessageDAO.modifyMessageList(currentContact.getMsgId(), new LinkedList<Mensaje>());\n\t\tcurrentContact.removeMessages();\n\t\tcontactDAO.modifyContact(currentContact);\n\t\t// Groups share the message list, only single contacts has to be updated\n\t\tif (currentContact instanceof ContactoIndividual) {\n\t\t\tUsuario user = userCatalog.getUser(currentContact.getUserId());\n\t\t\tOptional<Contacto> result = user.getContacts().stream().filter(c -> c.getUserId() == currentUser.getId())\n\t\t\t\t\t.findFirst();\n\t\t\tif (!result.isPresent())\n\t\t\t\treturn;\n\t\t\tmessageDAO.modifyMessageList(result.get().getMsgId(), new LinkedList<Mensaje>());\n\t\t\tresult.get().removeMessages();\n\t\t\tcontactDAO.modifyContact(result.get());\n\t\t}\n\t}", "private void deleteFloatingReplies()\n\t{\n\t\tList<DBObject> groupList = groups.find().toArray();\n\t\t\n\t\tfor(DBObject group : groupList)\n\t\t{\n\t\t\tDBCollection c = getGroupColl((String) group.get(\"customID\"));\n\t\t\tList<DBObject> list = c.find(QueryBuilder.start(\"target.messageID\").notEquals(\"\").get()).toArray();\n\t\t\t\n\t\t\tfor(DBObject reply : list)\n\t\t\t{\n\t\t\t\tif(c.findOne(MongoUtils.queryID(((DBObject)reply.get(\"target\")).get(\"messageID\").toString())) == null) {\n\t\t\t\t\tc.remove(reply);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "void clearPersistentNotifications();", "public void removeNotification(View view){\n\n NotificationManager mNotificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n try {\n //Get ID entered from the view\n int id = Integer.valueOf(notifcationIdView.getSelectedItem().toString());\n\n //Try and remove it - catch exception if it doesn't exist\n mNotificationManager.cancel(id);\n\n //Update notification tracker and spinner\n currentNotifications.remove(id);\n } catch (Exception e ) {\n yell(e.getMessage());\n\n //If somethings getting messed up, wipe everything\n mNotificationManager.cancelAll();\n currentNotifications.clear();\n }\n\n scrollViewAdapter.notifyDataSetChanged();\n }", "public void removeNotifications(long[] users, long project, long notificationType, String operator)\r\n throws ResourceManagementException {\r\n ArgumentChecker.checkNotificationsToBeRemoved(users, project, notificationType, operator);\r\n this.port.removeNotifications(users, project, notificationType, operator);\r\n }", "public void cancelNotification() {\n Context context = ApiManager.getInstance().getContext();\n if (context != null) {\n NotificationManager notificationManager = (NotificationManager) context\n .getSystemService(Context.NOTIFICATION_SERVICE);\n if (notificationManager != null) {\n Logger.d(TAG, \"cancelNotification() entry\");\n notificationManager.cancel(UNREAD_MESSAGE,\n NOTIFICATION_ID_UNREAD_MESSAGE);\n notificationManager.cancel(FILE_TRANSFER,\n NOTIFICATION_ID_FILE_TRANSFER);\n } else {\n Logger.e(TAG,\n \"cancelNotification the notificationManager is null\");\n }\n } else {\n Logger.e(TAG,\n \"cancelGroupInviteNotification the context is null\");\n }\n mUnReadMessagesChatInfos.clear();\n mFileInvitationInfos.clear();\n Logger.d(TAG, \"cancelNotification() exit\");\n }", "public static void removeAllGroupChatInvitationsInMms() {\n Logger.v(TAG, \"removeAllGroupChatInvitationsInMms entry\");\n ContentResolver contentResolver = MediatekFactory\n .getApplicationContext().getContentResolver();\n contentResolver.delete(PluginUtils.SMS_CONTENT_URI, Sms.ADDRESS\n + \" LIKE '\" + GROUP_CONTACT_STRING_BEGINNER\n + GROUP_CHAT_INVITATION_TAG_BEGINNER + \"%'\", null);\n }", "void disableNotifications();", "void clearNotifications() throws NoUserSelectedException;", "public void removeNotificationsByThread(long threadID){\r\n\t\tif(_debug) Log.v(_context, \"NotificationViewFlipper.removeNotifications() Thread ID: \" + threadID);\r\n\t\t//Must iterate backwards through this collection.\r\n\t\t//By removing items from the end, we don't have to worry about shifting index numbers as we would if we removed from the beginning.\r\n\t\tint totalNotifications = this.getChildCount();\r\n\t\tfor(int i=totalNotifications-1; i>=0; i--){\r\n\t\t\tNotification notification = ((NotificationView) this.getChildAt(i)).getNotification();\r\n\t\t\tif(notification.getThreadID() == threadID){\r\n\t\t\t\t//Cancel the reminder.\r\n\t\t\t\tnotification.cancelReminder();\r\n\t\t\t\t//Remove the notification at this index.\r\n\t\t\t\tremoveNotification(i, false);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Clear the status bar notification for SMS & MMS types.\r\n\t\tCommon.clearNotification(_context, this, Constants.NOTIFICATION_TYPE_SMS);\r\n \tCommon.clearNotification(_context, this, Constants.NOTIFICATION_TYPE_MMS);\r\n\t}", "public synchronized void removeNotifications(List<ClientNotification> clientNotifications) {\n\n if (clientNotifications != null && !clientNotifications.isEmpty()) {\n\n SQLiteDatabase db = databaseSQLHelper.getWritableDatabase();\n\n String[] selectionArgs = new String[clientNotifications.size()];\n\n for (int i = 0; i < clientNotifications.size(); i++) {\n selectionArgs[i] = \"'\" + clientNotifications.get(i).getId() + \"'\";\n }\n\n String args = TextUtils.join(\", \", selectionArgs);\n\n db.execSQL(String.format(\"DELETE FROM \" + DatabaseSQLContract.ClientNotificationEntry.TABLE_NAME + \" WHERE \" + DatabaseSQLContract.ClientNotificationEntry.COLUMN_NAME_NOTIFICATION_ID + \" IN (%s);\", args));\n\n db.execSQL(String.format(\"DELETE FROM \" + DatabaseSQLContract.ClientNotificationEntry.TABLE_NAME + \" WHERE \" + DatabaseSQLContract.ClientNotificationEntry.COLUMN_NAME_NOTIFICATION_ID + \" IS NULL;\"));\n\n }\n }", "public void deleteTopic(String nume, boolean notifySubscribers) throws RemoteException;", "public void dismissAllUserNotifications(Context context){\r\n\t\ttry{\r\n\t\t\tString masterSentFromAddress = this.getActiveNotification().getSentFromAddress();\r\n\t\t\tlong masterContactID = this.getActiveNotification().getContactID();\r\n\t\t\tint totalNotifications = this.getChildCount();\r\n\t\t\tfor(int i=totalNotifications-1; i>=0; i--){\r\n\t\t\t\tNotification notification = ((NotificationView) this.getChildAt(i)).getNotification();\r\n\t\t\t\tboolean removeNotification = false;\r\n\t\t\t\tif(masterSentFromAddress.equals(notification.getSentFromAddress())){\r\n\t\t\t\t\tremoveNotification = true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(masterContactID > 0){\r\n\t\t\t\t\t\tremoveNotification = masterContactID == notification.getContactID();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(removeNotification){\r\n\t\t\t\t\t//Cancel the reminder.\r\n\t\t\t\t\tnotification.cancelReminder();\r\n\t\t\t\t\t//Remove the notification at this index.\r\n\t\t\t\t\tthis.removeNotification(i, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//Update the navigation information on the current View.\r\n\t\t\tif(this.getChildCount() > 0){\r\n\t\t\t\tfinal View currentView = this.getCurrentView();\t\t\t\t\r\n\t\t\t\tupdateView(currentView, this.getDisplayedChild(), 0);\r\n\t\t\t}else{\r\n\t\t\t\t//Close the ViewFlipper and finish the Activity.\r\n\t\t\t\t_notificationActivity.finishActivity();\r\n\t\t\t}\r\n \t\t}catch(Exception ex){\r\n \t\t\tLog.e(_context, \"NotificationViewFlipper.dismissAllUserNotifications() ERROR: \" + ex.toString());\r\n \t\t}\r\n \t}", "private void removeMsg(int index) {\n ensureMsgIsMutable();\n msg_.remove(index);\n }", "private void removeMsg(int index) {\n ensureMsgIsMutable();\n msg_.remove(index);\n }", "@Override\n\tpublic int deleteCommunity(JSONObject params) {\n\t\tint result = -1;\n\t\tresult = this.delete(\"deleteCommunityMember\",params);\n\t\tresult = this.delete(\"deleteCommunity\", params);\n\t\treturn result;\n\t}", "void deleteTrackerNotifications(final Integer id);", "void removeFeature(FriendPresence friendPresence);", "@Override\n\t\tpublic Community remove(int index) {\n\t\t\treturn null;\n\t\t}", "protected void detachNotification(Txn txn) {\r\n }", "boolean removeNotification(List<String> stopIDs, String lineID, String deleteDescription) throws Exception;", "void declineNotification(NotificationDTO selectedNotification);", "private void deleteNotification(final Notification notification, final NotifyItemHolder holder) {\n Call<Object> httpRequest = LoggedUserActivity.getNotificationsService().deleteNotification(notification.getNotificationId());\n\n httpRequest.enqueue(new Callback<Object>() {\n @Override\n public void onResponse(Call<Object> call, Response<Object> response) {\n if (response.isSuccessful()) {\n notificationsListFragment.removeUserNotification(notificationsListFragment, notification, fragmentView, recyclerView, holder);\n } else {\n Toast.makeText(LoggedUserActivity.getLoggedUserActivity(), response.code() + \" \" + response.message(), Toast.LENGTH_LONG).show();\n }\n }\n\n @Override\n public void onFailure(Call<Object> call, Throwable t) {\n Toast.makeText(LoggedUserActivity.getLoggedUserActivity(), t.getMessage(), Toast.LENGTH_LONG).show();\n }\n });\n }", "public AsyncResult<IQ> removeAllMessages() {\r\n return xmppSession.query(IQ.set(new OfflineMessage(false, true)));\r\n }", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t\tboolean done= humanInteractions.getNotifications().getNotification().remove(selectedNotification);\n\t\t\t\tnotficationViewer.setInput(createNotificationModle());\n\n\t\t\t}", "@Override\n\tpublic void removeClient(Client c, String msg) throws RemoteException {\n\t\t if(users.contains(c))\n\t\t {\n\t\t for(int i=0;i<users.size();i++)\n\t\t {\n\t\t //sendMessage((IChatClient)clients.elementAt(i),msg);\n\t\t ( (Client) users.get(i)).afficherMessage(msg);\n\t\t }\n\t\t users.remove(c);\n\t\t }\n\t}", "void unRegister(NotificationListener<ObservableIntentServiceNotificationType> notificationStrategy);", "private void cancelGroupInviteNotification() {\n int size = mGroupInvitationInfos.size();\n Logger.d(TAG, \"cancelGroupInviteNotification() entry, size: \"\n + size);\n if (size == 0) {\n Context context = ApiManager.getInstance().getContext();\n Logger.e(TAG, \"cancelGroupInviteNotification() context: \"\n + context);\n if (context != null) {\n NotificationManager groupInviteNotification = (NotificationManager) context\n .getSystemService(Context.NOTIFICATION_SERVICE);\n groupInviteNotification.cancel(GROUP_INVITATION_TAG,\n NOTIFICATION_ID_CHAT);\n }\n }\n Logger.d(TAG, \"cancelGroupInviteNotification exit\");\n }", "@Override\r\n \tpublic void unregisterContextChanges(Object communityId) throws InvalidFormatException {\r\n \t\t//Cast IIdentity for the societies platform\r\n \t\tIIdentity cisID = idMgr.fromJid(communityId.toString());\r\n \t\tLOG.info(\"cisID retrieved: \"+ cisID);\r\n \r\n \t\ttry {\r\n \t\t\tCtxEntityIdentifier ctxCommunityEntityIdentifier = this.ctxBroker.retrieveCommunityEntityId(getRequestor(), cisID).get();\r\n \t\t\tLOG.info(\"communityEntityIdentifier retrieved: \" +ctxCommunityEntityIdentifier.toString()+ \" based on cisID: \"+ cisID);\r\n \t\t\tCommunityCtxEntity communityEntity = (CommunityCtxEntity) this.ctxBroker.retrieve(getRequestor(), ctxCommunityEntityIdentifier).get();\r\n \r\n \t\t\tSet<CtxEntityIdentifier> ctxMembersIDs = communityEntity.getMembers();\r\n \t\t\tIterator<CtxEntityIdentifier> members = ctxMembersIDs.iterator();\r\n \r\n \t\t\twhile(members.hasNext()){\r\n \t\t\t\tCtxEntityIdentifier member = members.next();\r\n \t\t\t\tLOG.info(\"*** Unregistering context changes for member: \"+member.toString());\r\n \r\n \t\t\t\t//TODO: Include here other ctx updates if necessary. For short term context\r\n \t\t\t\tthis.ctxBroker.unregisterFromChanges(getRequestor(), this.myCtxChangeEventListener, member, CtxAttributeTypes.LOCATION_SYMBOLIC);\r\n \t\t\t\tthis.ctxBroker.unregisterFromChanges(getRequestor(), this.myCtxChangeEventListener, member, CtxAttributeTypes.STATUS);\r\n \t\t\t\t//\t\t\t\tthis.ctxBroker.unregisterFromChanges(getRequestor(), this.myCtxChangeEventListener, member, CtxAttributeTypes.OCCUPATION);\r\n \t\t\t\t//\t\t\t\tthis.ctxBroker.unregisterFromChanges(getRequestor(), this.myCtxChangeEventListener, member, CtxAttributeTypes.ADDRESS_WORK_CITY);\r\n \t\t\t\t//\t\t\t\tthis.ctxBroker.unregisterFromChanges(getRequestor(), this.myCtxChangeEventListener, member, CtxAttributeTypes.ADDRESS_WORK_COUNTRY);\r\n \t\t\t}\r\n \t\t} catch (InterruptedException e1) {\r\n \t\t\te1.printStackTrace();\r\n \t\t} catch (ExecutionException e1) {\r\n \t\t\te1.printStackTrace();\r\n \t\t} catch (CtxException e1) {\r\n \t\t\te1.printStackTrace();\r\n \t\t}\r\n \r\n \t\tLOG.info(\"*** unregisterContextChanges success\");\r\n \t}", "public void onUnscuuessNotificationUpdate(String message);", "protected void removeOrphanedMessages() {\r\n Enumeration e = orphanedMessageSet.elements();\r\n MessageToken[] orphanedTokens = new MessageToken[orphanedMessageSet.size()];\r\n int index = 0;\r\n while(e.hasMoreElements()) {\r\n FolderMessage message = (FolderMessage)e.nextElement();\r\n folderMessageCache.removeFolderMessage(folderTreeItem, message);\r\n orphanedTokens[index++] = message.getMessageToken();\r\n }\r\n orphanedMessageSet.clear();\r\n mailStoreServices.fireFolderExpunged(folderTreeItem, orphanedTokens, new MessageToken[0]);\r\n }", "private void deleteNotification(int position) {\n Notification notificationToDelete = mNoteWithNotificationList.get(position).getNotification();\n\n Boolean returnVal = db.deleteNotification(notificationToDelete);\n\n ArrayList<Note> notes = db.getAllNotes();\n\n if (returnVal) {\n notifyRemoved(position);\n int calendarReadPermission = ContextCompat.checkSelfPermission(activity, Manifest.permission.READ_CALENDAR);\n int calendarWritePermission = ContextCompat.checkSelfPermission(activity, Manifest.permission.WRITE_CALENDAR);\n\n if (calendarReadPermission == PermissionChecker.PERMISSION_GRANTED && calendarWritePermission == PermissionChecker.PERMISSION_GRANTED) {\n int deletedRows = 0;\n deletedRows = calendarSync.deleteCalendarEntry(activity.getApplicationContext(), notificationToDelete.getId());\n if (deletedRows > 0) {\n Toast.makeText(activity, activity.getResources().getString(R.string.calendar_event_deleted), Toast.LENGTH_LONG).show();\n }\n }\n } else {\n Toast.makeText(activity, activity.getResources().getString(R.string.notification_delete_error), Toast.LENGTH_LONG);\n }\n\n refresh();\n }", "@Override\n\tpublic void removeOne(Long id) {\n\t\tnotificationRepository.delete(id);\n\n\t}", "private void unsubscribe() {\n Log.i(TAG, \"Unsubscribing.\");\n Nearby.Messages.unsubscribe(mGoogleApiClient, mMessageListener);\n }", "public void createDeleteNotification (Invite inv) {\n Notification notification = new Notification();\n notification.setRelatedEvent(inv.getEvent());\n notification.setNotificatedUser(inv.getUser());\n notification.setSeen(false);\n notification.setType(NotificationType.deletedEvent);\n notification.setGenerationDate(new Date());\n em.persist(notification);\n //I send the notification mail to the user\n mailManager.sendMail(inv.getUser().getEmail(), \"Deleted Event\", \"Hi! An event for which you have received an invite has been cancelled. Join MeteoCal to discover it.\");\n }", "protected void removeMessage(Tuple stmTuple){\n\t\tsynchronized(m_viz){\n\t\t\tsynchronized(messagesList){\n\t\t\t\t//no messages, so no need to remove any\n\t\t\t\tif(messagesList.size() == 0){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tTuple first = messagesList.getFirst();\n\t\t\t\tint msgTimestamp = ((Integer) first.get(Message.SOURCEID_FIELDNAME)).intValue(); \n\t\t\t\tint stmTimestamp = ((Integer) stmTuple.get(Statement.TIMESTAMP_FIELDNAME)).intValue();\n\t\t \n\t\t\t\tif(msgTimestamp == stmTimestamp){\n\t\t\t\t\t// Remove action is synchronized to prevent PreFuse from drawing at the same time\n\t\t\t\t\tm_messages.removeTuple(first);\n\t\t\t\t\tmessagesList.removeFirst();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "void removeAll(){\n\t\tmessages.clear();\n\t}", "public void removeMessages(@Nonnull final BasicMessage[] jmsm) {\n\t\tfinal Iterator<IMessageViewer> iterator = changeListeners.iterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\t(iterator.next()).removeJMSMessage(jmsm);\n\t\t}\n\t}", "public void removePushToken() {\n }", "List<NotificationEntity> findUnseenByLogin(String login);", "public void removeMessageForWinTag(Object chatWindowTag) {\n Logger.d(TAG, \"removeMessageForWinTag() entry chatWindowTag is \"\n + chatWindowTag);\n Pair<View, ChatsStruct> findPair = getChatPairWithTag(chatWindowTag);\n if (null == findPair) {\n Logger.e(TAG,\n \"removeMessageForWinTag() not find the chatWindowTag findPair is null\");\n return;\n }\n View view = findPair.first;\n ChatsStruct chatStruct = findPair.second;\n chatStruct.chatItems.clear();\n Logger.d(TAG, \"removeMessageForWinTag() findPair is \" + findPair);\n chatStruct.setDate(null);\n chatStruct.setLatestMessage(null);\n chatStruct.clearUnreadMessageNumber();\n updateChats(view, chatStruct);\n }", "public void removeEvents(){\n for(Entry<Class, List<EventTrigger>> eventGroup: HandlerRegistry.getHandlers().entrySet()){\n String annotation = eventGroup.getKey().getName();\n List<EventTrigger> eventTriggers = new ArrayList<EventTrigger>(eventGroup.getValue());\n for(EventTrigger trigger : eventTriggers){\n if(trigger.getServer()==this) { // do not send own events...\n ESRemoveEvent esre = new ESRemoveEvent(annotation, trigger.getTrigger());\n for(EventShare es : EventShare.getEventShareServers()){\n if(es!=this) {\n if (es.isShareOut()) {\n try {\n es.getEventBusServer().write(esre);\n }catch (Exception e){\n e.printStackTrace();\n }\n }\n }\n }\n HandlerRegistry.getHandlers().get(eventGroup.getKey()).remove(trigger);\n System.out.println(HandlerRegistry.getHandlers());\n }\n }\n }\n }", "@ServiceAction\n protected void onNotificationDismissed(final ArrayList<Integer> serversRequiringNotification) {\n Observable.from(servers)\n .filter(new Func1<MinecraftServerEntity, Boolean>() {\n @Override\n public Boolean call(MinecraftServerEntity server) {\n return serversRequiringNotification.contains(server.getId());\n }\n })\n .map(new Func1<MinecraftServerEntity, MinecraftServerEntity>() {\n @Override\n public MinecraftServerEntity call(MinecraftServerEntity server) {\n server.setHasOfflineStatusBeenSeen(true);\n return server;\n }\n })\n .subscribeOn(AndroidSchedulers.mainThread())\n .observeOn(AndroidSchedulers.mainThread())\n .subscribe(new Action1<MinecraftServerEntity>() {\n @Override\n public void call(MinecraftServerEntity server) {\n if (DEBUG)\n Log.d(TAG, String.format(\"'%s' offline status has been seen by the user. Updating the database\", server.getName()));\n //We update the value in the database\n runtimeMinecraftServerDao.update(server);\n }\n });\n }", "public void deleteMessage(int i) {\n\t\tSession session;\n\t\tProperties properties = System.getProperties();\n\t\tsession = Session.getDefaultInstance(properties, new javax.mail.Authenticator(){\n\t\t\tprotected PasswordAuthentication getPasswordAuthentication(){\n\t\t\t\t\treturn new PasswordAuthentication(username, password);\n\t\t\t}\n\t\t});\n\t\ttry {\n\t\t\tMyMessage toBeDeleted = messageList.get(i);\n\t\t\tStore store = session.getStore(\"imaps\");\t\n\t\t\tstore.connect(\"imap.gmail.com\", username,\n\t\t\t\t\tpassword);\n\t\t\tfolder = store.getDefaultFolder();\n\t\t\tfolder = folder.getFolder(\"inbox\");\n\t\t\tfolder.open(Folder.READ_WRITE);\n\t\t\tMessage[] messages = folder.getMessages();\n\t\t\t//SHOULD MAKE SURE WE HAVE THE RIGHT ONE\n\t\t\tmessages[i].setFlag(Flags.Flag.DELETED, true);\n\t\t\tfolder.close(true);\n\t\t\t\n\t\t} catch (Exception e){\n\t\t\tSystem.out.println(\"ERROR: COULD NOT SEND MAIL\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n public void removeNotify()\n {\n unregisterListeners();\n super.removeNotify();\n }", "public void delete(JobNotification currentNotification) {\n for (int i = notifications.size(); --i >= 0;) {\n if (notifications.get(i) == currentNotification) {\n notifications.remove(i);\n break;\n }\n }\n }", "void deleteTrackerNotificationRecipients(final Integer id);", "public void removeLanguageCommunication(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(LANGUAGECOMMUNICATION$26, i);\n }\n }", "@Override\n public void removeAllMessages() throws RemoteException {\n Logger.d(TAG, \"removeAllMessages() entry\");\n final String[] args = { mContactString };\n ContentResolver contentResolver = MediatekFactory\n .getApplicationContext().getContentResolver();\n contentResolver.delete(PluginUtils.SMS_CONTENT_URI,\n SELECTION_SMS_ADDRESS, args);\n Logger.d(TAG, \"removeAllMessages() exit address is \" + mContactString);\n }", "private void handleWhiteboardCleared() {\n for (SocketConnection tobeNotified : SocketManager.getInstance()\n .getNotManagerConnectionList()) {\n tobeNotified.send(this.message);\n }\n }", "public void deleteChatRoom(ChatRoom cr);", "public synchronized void removeCommunicator(TrackerServerCommunicator comm) {\n\t\tcomms.remove(comm);\n\t}", "public static void cleanChanList() {\n\t\tArrayList<ChatChannel> currentChannels = new ArrayList<ChatChannel>();\n\t\tfor (int i = 0; i < channels.size(); i++) {\n\t\t\tcurrentChannels.add(channels.get(i));\n\t\t}\n\t\t\n\t\t//loop through the new array list\n\t\tfor (ChatChannel channel: currentChannels) {\n\t\t\tboolean remove = true;\n\t\t\tif (!channel.modes.contains(ChatChannel.Mode.PERSIST)) {\n\t\t\t\t//Not persist. Check the players\n\t\t\t\tfor (int f = 0; f < PlayerManager.players.size(); f++){\n\t\t\t\t\tChatPlayer player = PlayerManager.players.get(f);\n\t\t\t\t\t\n\t\t\t\t\t//check if in channel or listening\n\t\t\t\t\tif (player.listening.contains(channel.name.toLowerCase()) || player.listening.contains(channel.name.toLowerCase())){\n\t\t\t\t\t\tremove = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tremove = false;\n\t\t\t}\n\t\t\t\n\t\t\tif (remove) {\n\t\t\t\tremoveChannel(channel.name);\n\t\t\t\tSystem.out.println(\"Remove channel: \"+channel.name);\n\t\t\t}\n\t\t}\n\t}", "public static void clearNotifications(Context context) {\n NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\n notificationManager.cancelAll();\n }", "public void dismissAllAppNotifications(Context context){\r\n\t\ttry{\r\n\t\t\tint masterNotificationType = this.getActiveNotification().getNotificationType();\r\n\t\t\tString masterPackageName = this.getActiveNotification().getPackageName();\r\n\t\t\tint totalNotifications = this.getChildCount();\r\n\t\t\tfor(int i=totalNotifications-1; i>=0; i--){\r\n\t\t\t\tNotification notification = ((NotificationView) this.getChildAt(i)).getNotification();\r\n\t\t\t\tboolean removeNotification = false;\r\n\t\t\t\tif(masterNotificationType == Constants.NOTIFICATION_TYPE_GENERIC){\r\n\t\t\t\t\tremoveNotification = masterPackageName.equals(notification.getPackageName());\r\n\t\t\t\t}else{\r\n\t\t\t\t\tremoveNotification = masterNotificationType == notification.getNotificationType();\r\n\t\t\t\t}\r\n\t\t\t\tif(removeNotification){\r\n\t\t\t\t\t//Cancel the reminder.\r\n\t\t\t\t\tnotification.cancelReminder();\r\n\t\t\t\t\t//Remove the notification at this index.\r\n\t\t\t\t\tthis.removeNotification(i, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//Update the navigation information on the current View.\r\n\t\t\tif(this.getChildCount() > 0){\r\n\t\t\t\tfinal View currentView = this.getCurrentView();\r\n\t\t\t\t\r\n\t\t\t\tupdateView(currentView, this.getDisplayedChild(), 0);\r\n\t\t\t}else{\r\n\t\t\t\t//Close the ViewFlipper and finish the Activity.\r\n\t\t\t\t_notificationActivity.finishActivity();\r\n\t\t\t}\r\n \t\t}catch(Exception ex){\r\n \t\t\tLog.e(_context, \"NotificationViewFlipper.dismissAllAppNotifications() ERROR: \" + ex.toString());\r\n \t\t}\r\n \t}", "public void removeMessage(@Nonnull final BasicMessage jmsm) {\n\t\tfinal Iterator<IMessageViewer> iterator = changeListeners.iterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\t(iterator.next()).removeJMSMessage(jmsm);\n\t\t}\n\t}", "@Override\n\tpublic Notification delNotification(int idUser) {\n\t\treturn dao.delNotification(idUser);\n\t}", "public static void removeGroupChatInvitationInMms(String contact) {\n Logger.d(TAG, \"removeGroupChatInvitationInMms contact is\" + contact);\n Intent intent = new Intent();\n intent.putExtra(\"removeFromMms\", true);\n intent.putExtra(\"contact\", contact);\n intent.setAction(IpMessageConsts.JoynGroupInvite.ACTION_GROUP_IP_INVITATION);\n MediatekFactory.getApplicationContext().sendStickyBroadcast(intent);\n }", "public void deleteNotification(String zipCode, String notificationId){\n notificationRef.child(notificationId).removeValue();\r\n\r\n // Remove notification id from '{zipCode}' node\r\n baseRef.child(zipCode).child(notificationId).removeValue();\r\n\r\n // Get user and remove from their list\r\n FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();\r\n String uuid = user.getUid();\r\n getIndexOfNotification(uuid, notificationId).addOnSuccessListener(new OnSuccessListener<String>() {\r\n @Override\r\n public void onSuccess(String s) {\r\n userRef.child(\"notificationIds\").child(s).removeValue();\r\n }\r\n });\r\n }", "public void removeOrDisconnectClient(String mqttClientChannelID, String unSubscribedTopic, String username,\n SubscriptionEvent action) throws MQTTException {\n\n log.info(\"Disconnecting channel for clientID: \" + mqttClientChannelID);\n\n Collection<MQTTSubscription> topicSubscriptionList;\n MQTTopics mqtTopics = topicSubscriptions.get(mqttClientChannelID);\n\n if (null != mqtTopics) {\n if (null == unSubscribedTopic) {\n //this means we need to remove all subscriptions relevant for the channel\n topicSubscriptionList = mqtTopics.getAllSubscriptionsForChannel();\n } else {\n topicSubscriptionList = new ArrayList<>();\n topicSubscriptionList.add(mqtTopics.getSubscription(unSubscribedTopic));\n }\n\n for (MQTTSubscription subscription : topicSubscriptionList) {\n //Will get the topic name bound for subscription\n String topic = subscription.getTopicName();\n //Will remove the subscriber off the list\n mqtTopics.removeSubscriber(topic);\n String subscriberChannelID = subscription.getSubscriberChannelID();\n UUID subscriberChannel = subscription.getSubscriptionChannel();\n boolean isCleanSession = subscription.isCleanSession();\n QOSLevel qos = subscription.getQOSLevel();\n //The corresponding subscription created cluster wide will be topic name and the local channel id\n //Will remove the subscriber cluster wide\n try {\n //Will indicate the disconnection of the topic\n if (action == SubscriptionEvent.DISCONNECT && MQTTUtils.isDurable(isCleanSession, qos.getValue())) {\n connector.disconnectSubscriber(this, topic, username, subscriberChannelID, subscriberChannel,\n isCleanSession, mqttClientChannelID, qos);\n } else {\n //If un-subscribed we need to remove the subscription off\n connector.removeSubscriber(this, topic, username, subscriberChannelID, subscriberChannel,\n isCleanSession, mqttClientChannelID, qos);\n }\n if (log.isDebugEnabled()) {\n final String message = \"Subscription with cluster id \" + subscriberChannelID + \" disconnected \" +\n \"from topic \" + topic;\n log.debug(message);\n }\n\n } catch (MQTTException ex) {\n //Should re state the connection of the subscriber back to the map\n mqtTopics.addSubscriber(unSubscribedTopic, subscription);\n final String error = \"Error occurred while removing the subscription \" + mqttClientChannelID;\n log.error(error, ex);\n throw ex;\n }\n }\n\n //Finally will check if there're any relevant subscriptions for the topic\n //If there arn't we could remove the entry\n if(mqtTopics.getAllSubscriptionsForChannel().isEmpty()){\n topicSubscriptions.remove(mqttClientChannelID);\n }\n } else {\n //If the connection is publisher based\n UUID publisherID = connector.removePublisher(mqttClientChannelID);\n if (null == publisherID) {\n log.warn(\"A subscriber or a publisher with Connection with id \" + mqttClientChannelID + \" cannot be \" +\n \"found to disconnect.\");\n }\n }\n }", "@Override\n\tpublic void remove(Message message) {\n\t\tmessRepository.delete(message);\n\t}", "public void notificationRegDelete(long id){\n Callback<NotificationRegistration> callback = new Callback<NotificationRegistration>() {\n @Override\n public void success(NotificationRegistration serverResponse, Response response2) {\n BusProvider.getInstance().post(produceNotificationRegServerResponse(serverResponse));\n }\n @Override\n public void failure(RetrofitError error) {\n if(error != null ){\n Log.e(TAG, error.getMessage());\n error.printStackTrace();\n }\n BusProvider.getInstance().post(produceErrorEvent(-200,error.getMessage()));\n }\n };\n communicatorInterface.deleteNotificationReg(id, callback);\n }", "public void notifyRemoved(String publicID) {\n }", "public void remove(PSPackageCommunity pkgComm)\n {\n m_packageCommunities.remove(pkgComm);\n }", "private void onNotificationOpened() {\n mFirestoreUtils.getFirestoreInstance().collection(FirestoreUtils.KEY_USERS)\n .whereEqualTo(FirestoreUtils.KEY_NAME, getIntent().getStringExtra(NotificationUtils.RECIPIENT))\n .get().addOnCompleteListener(task -> {\n if (task.isSuccessful()) {\n DocumentSnapshot snapshot = Objects.requireNonNull(task.getResult()).getDocuments().get(0);\n snapshot.getReference().collection(FirestoreUtils.KEY_NOTIFICATIONS)\n .whereEqualTo(NotificationUtils.PROJECT, getIntent().getStringExtra(NotificationUtils.PROJECT))\n .get().addOnCompleteListener(notificationTask -> {\n if (notificationTask.isSuccessful()) {\n DocumentSnapshot notificationSnapshot = Objects.requireNonNull(notificationTask.getResult()).getDocuments().get(0);\n notificationSnapshot.getReference().delete().addOnCompleteListener(removeTask -> {\n if (removeTask.isSuccessful()) Log.d(TAG, \"Notification received and removed from Firestore\");\n });\n }\n });\n }\n });\n }", "public void removeAlarms (){\n AlarmManager alarmManager = (AlarmManager) getContext().getSystemService(Context.ALARM_SERVICE);\n for (int i = 0; i < dogMetaDataArrayList.size(); i++){\n Intent recreateIntent = new Intent(getContext(), OneTimeReciveNotification.class);\n PendingIntent pendingIntent = PendingIntent.getBroadcast(getContext(), i, recreateIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n pendingIntent.cancel();\n alarmManager.cancel(pendingIntent);\n }\n }", "public void removeMessages(int[] what) {\n synchronized (mHandler.getLooper().getQueue()) {\n for (int i : what) {\n mHandler.removeMessages(i);\n }\n }\n }", "public void unregisterNotify( Notify notify );", "private void sendNotifications() {\n this.sendNotifications(null);\n }", "public void removeFromReminders(Date reminders);", "void unsetPublicationList();", "@Override\n public final void removeNextMessage() {\n }", "public void notifyDisconnection(String username){\r\n for(SocketClientHandlerObserver obs:observers){\r\n obs.onDisconnection(username);\r\n }\r\n }", "@Before\n public void cleanConversations() {\n restController.deleteAllConvoMsgsForBlog(MAIN_BLOG_NAME);\n restController.deleteAllConversationsForBlog(MAIN_BLOG_NAME);\n }", "public void removeNode(Runtime runtime) {\n if (runtime == null) {\n LOG.debug(\"Can not remove null node\");\n return;\n }\n\n Iterator<NotificationListener> iter = topologyListeners.iterator();\n while(iter.hasNext()) {\n NotificationListener listener = iter.next();\n // TODO : Do it async...\n // TODO : Generics...\n listener.on(\"remove\", runtime);\n }\n }", "public void removeInstantMessageListener(MessageListener l) {\n // If this chat transport does not support instant messaging we do nothing here.\n if (!allowsInstantMessage())\n return;\n\n OperationSetBasicInstantMessaging imOpSet = mPPS.getOperationSet(OperationSetBasicInstantMessaging.class);\n imOpSet.removeMessageListener(l);\n }", "public void removeNotification(InAppNotification inAppNotification) {\n this.inAppNotifications.remove(inAppNotification);\n }", "public void cancelReceiveMessageNotification(Object newTag) {\n if (newTag == null) {\n Logger.d(TAG,\n \"cancelReceiveMessageNotification chat tag is null\");\n return;\n }\n if (mUnReadMessagesChatInfos != null\n && mUnReadMessagesChatInfos.containsKey(newTag)) {\n mUnReadMessagesChatInfos.remove(newTag);\n String ticker = null;\n boolean isNewMessageNotification = false;\n updateReceiveMessageNotification(ticker,\n isNewMessageNotification);\n } else {\n Logger.d(\n TAG,\n \"cancelReceiveMessageNotification mUnReadMessagesChatInfos\" +\n \" didn't contain this chat tag\");\n }\n }", "protected void onReactionRemoved(String channel, String sender, String receiver, String emojiName) {}", "synchronized void remove(int id) {\n\n String disconnectedClient = \"\";\n // scan the array list until we found the Id\n for(int i = 0; i < clientThreads.size(); ++i) {\n ClientThread ct = clientThreads.get(i);\n // if found remove it\n if(ct.id == id) {\n disconnectedClient = ct.getUsername();\n clientThreads.remove(i);\n break;\n }\n }\n broadcast(notification + disconnectedClient + \" has left the chat room.\" + notification, clientThreads);\n }", "void removePublisherQueueEntries(String publisherName);", "private void unpublish() {\n Log.i(TAG, \"Unpublishing.\");\n Nearby.Messages.unpublish(mGoogleApiClient, mPubMessage);\n }", "public void removeFilter(MessageFilter filter);", "private void cleanupDirectedPresences(NodeID nodeID) {\n Map<String, Collection<String>> senders = nodePresences.remove(nodeID);\n if (senders != null) {\n for (Map.Entry<String, Collection<String>> entry : senders.entrySet()) {\n String sender = entry.getKey();\n Collection<String> receivers = entry.getValue();\n for (String receiver : receivers) {\n try {\n Presence presence = new Presence(Presence.Type.unavailable);\n presence.setFrom(sender);\n presence.setTo(receiver);\n XMPPServer.getInstance().getPresenceRouter().route(presence);\n }\n catch (PacketException e) {\n Log.error(e);\n }\n }\n }\n }\n }", "@Override\n public void remove(News item) {\n }", "public void deleteMessage(Integer tid, int rank);", "public void removeConversationListener(ConversationListener<? super E> listener);", "private void deletePastEvents() {\n Date now = new Date(); //gets the current date\n ArrayList<Integer> listofEventIDS = eventManager.getListOfEventIDs(); //gets list of all eventIDs in the system\n //checks every eventID, and if its in the past, then deletes everything related to that event\n for (Integer eventID: listofEventIDS) {\n //if the event happened before right now, delete the event, and remove all attendees that are attending that event, organizer, speaker and free up the room.\n if (eventManager.getEvent(eventID).getTime().before(now)){\n ArrayList<String> peopleAttending = eventManager.getEvent(eventID).getAttendees(); //list of userid of all people attending\n\n for (String attendeeID: peopleAttending){\n //check if attendee is a organizer attending the event\n if (organizerManager.userExist(attendeeID)){\n organizerManager.removeEvent(eventID, attendeeID);\n }\n //if its not a organizer, it must be a attendee\n else {\n attendeeManager.removeEvent(eventID,attendeeID);\n }\n }\n //NOTE: THIS WORKS RIGHT NOW BECAUSE WE ONLY HAVE 1 SPEAKER, IN PHASE 2 WE WILL HAVE MULTIPLE SPEAKERS\n speakerManager.getSpeaker(eventManager.getEvent(eventID).getSpeakerID()).removeAssignEvent(eventID);\n String organizerOfThisEvent = eventManager.getEvent(eventID).getOrganizerID(); //gets the userid of the organizer of this event\n //in the organizer's list of events that he/she created, this event is removed.\n organizerManager.removeEvent(eventID, organizerOfThisEvent);\n //removes the event from the room. NOTE THIS IS NOT NECESSARY AS YOU WILL NEVER BE ABLE TO ASSIGN A ROOM IN THE PAST, BUT JUST AS A SAFETY MEASURE.\n roomManager.removeEventFromRoom(eventManager.getEvent(eventID).getLocation(), eventID, eventManager.getTime(eventID));\n // and finally removes the event object itself from the event manager.\n eventManager.removeEvent(eventID);\n }\n }\n }", "public void pruneMessages(List<Message> ml, int max) {\n\t\tint count = ml.size();\n\t\tif (count > max) {\n\t\t\tint remove = count - max;\n\t\t\tLog.d(\"MESSAGE\", \"Pruning messages: \" + remove + \" count: \" + count + \" max: \" + max);\n\t\t\tfor (int i = 0; i < remove; i++) {\n\t\t\t\tml.remove(0);\n\t\t\t}\n\t\t}\n\t}", "public void removeMessage(Message m) {\n\t\t\n\t\t//If the message is in the network\n\t\tif (this.messages.contains(m)) {\n\t\t\t\n\t\t\t//Remove the message\n\t\t\tthis.messages.remove(m);\n\t\t\t\n\t\t}\n\t\t\n\t}", "public void unsubscribe() {\r\n new Thread(new Runnable() {\r\n public void run() {\r\n int attempts = 0;\r\n while(++attempts < 20) {\r\n try {\r\n if (server.removeSubscriber(PubSubAgent.this.agentID)) {\r\n subscriberKeywords.clear();\r\n subscriberTopics.clear();\r\n }\r\n System.out.print(\"Unsubscribed from all Topics.\");\r\n return;\r\n } catch(RemoteException e) {\r\n System.err.println(\"Could not connect to server. Retrying...\");\r\n try {\r\n Thread.sleep(800);\r\n } catch(Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }\r\n }\r\n System.err.println(\"Couldn't Unsubscribe from all the topics...\");\r\n }\r\n }).start();\r\n }", "void unsetSubject();", "public synchronized void removePlotNotificationListener(\n PlotNotificationListener l) {\n m_plotListeners.remove(l);\n }" ]
[ "0.6952501", "0.6483498", "0.6042083", "0.58931136", "0.58620614", "0.584037", "0.58393204", "0.5834166", "0.57918245", "0.5773622", "0.5762781", "0.5737865", "0.57319546", "0.5695354", "0.5682399", "0.5649944", "0.56093913", "0.56021154", "0.55903906", "0.5584351", "0.5568704", "0.5568704", "0.554578", "0.5530976", "0.5526616", "0.5510234", "0.55092674", "0.54980016", "0.5467841", "0.54601485", "0.54478216", "0.5444343", "0.5440519", "0.54026365", "0.53593016", "0.5351505", "0.53369236", "0.5333211", "0.53174716", "0.5303332", "0.5298225", "0.5286749", "0.52767634", "0.52641916", "0.52524936", "0.5229222", "0.5225631", "0.52172035", "0.5211571", "0.5210619", "0.5197508", "0.51898557", "0.518445", "0.5170095", "0.5169542", "0.5162293", "0.5160751", "0.5159405", "0.51520693", "0.51470065", "0.51367486", "0.5126999", "0.5116584", "0.5110461", "0.51060635", "0.51046735", "0.5103838", "0.5103613", "0.5099961", "0.5095717", "0.5093669", "0.5085458", "0.50695753", "0.50611454", "0.50605255", "0.505684", "0.5054855", "0.50537896", "0.50495154", "0.50440025", "0.5041555", "0.50293976", "0.5024944", "0.50209856", "0.50181913", "0.5012553", "0.5004119", "0.5003044", "0.5000812", "0.499936", "0.49952573", "0.4983806", "0.49809727", "0.49768165", "0.49668628", "0.4956562", "0.4947526", "0.49456945", "0.49450648", "0.4943405" ]
0.7504805
0
/ Getting all Items from tSable
public Map<Integer, Item> getAllItems() { return hashOperations.entries(KEY); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Item> getAll()\r\n {\r\n\r\n CriteriaQuery<Item> criteria = this.entityManager\r\n .getCriteriaBuilder().createQuery(Item.class);\r\n return this.entityManager.createQuery(\r\n criteria.select(criteria.from(Item.class))).getResultList();\r\n }", "List<Item> getItems(IDAOSession session);", "public Items[] findAll() throws ItemsDaoException;", "public List<Item> getAll() {\r\n List<Item> list = new ArrayList<Item>();\r\n //Transaction trans = null;\r\n Session session = HibernateUtil.getSessionFactory().openSession();\r\n\r\n try {\r\n //trans = session.beginTransaction();\r\n\r\n list = session.createQuery(\"from Item\").list();\r\n\r\n //trans.commit();\r\n } catch (HibernateException e) {\r\n //if (trans != null) { trans.rollback(); }\r\n e.printStackTrace();\r\n } finally {\r\n //session.flush();\r\n session.close();\r\n }\r\n return list;\r\n }", "public List<T> getItems() {\n if (items == null) {\n items = this.ejbFacade.findAll();\n }\n return items;\n }", "List<ItemStockDO> selectAll();", "@SuppressWarnings(\"unchecked\")\n public List<Item> getListOfTasks() {\n Session session = this.factory.openSession();\n List<Item> list = session.createQuery(\"from Item\").list();\n session.close();\n return list;\n }", "public List<Item> getAllItemsAvailable();", "public List<PlayerItem> getAll();", "public static Items[] listAllItems() {\r\n List<Items> items = dao().listAllItems();\r\n return items.toArray(new Items[items.size()]);\r\n }", "public static List<Item> findAll() {\n\t\treturn getPersistence().findAll();\n\t}", "public List<ItemTypeDTO> getAll();", "com.rpg.framework.database.Protocol.Item getItems(int index);", "public List<ShelfItem> getAll(String username, Integer from, Integer to);", "List<Map<String, Object>> getAllItems(String tableName);", "@Override\n public Set<T> getItems() {\n return items;\n }", "@Override\n public List<Item> retrieveAllItems() throws VendingMachinePersistenceException {\n loadItemFile();\n List<Item> itemList = new ArrayList<>();\n for (Item currentItem: itemMap.values()) {\n itemList.add(currentItem);\n }\n\n return itemList;\n }", "public List<Items> list() {\n\t\treturn itemDao.list();\r\n\t}", "java.util.List<com.rpg.framework.database.Protocol.Item> \n getItemsList();", "public List<Item> getAllItems() {\r\n \t\tList<Item> items = persistenceManager.getAllItems();\r\n \t\tCollections.sort(items, Comparators.ITEM_COMPARATOR);\r\n \t\treturn items;\r\n \t}", "@Override\n\tpublic Set<T> retrieveAllItems() {\n\t\treturn cache;\n\t}", "public @NotNull Set<Item> findAllItems() throws BazaarException;", "public Collection<Item> findAll() {\n\t\tCollection<Item> Items;\n\t\tItems = this.itemRepository.findAll();\n\n\t\treturn Items;\n\t}", "public static List<Item> loadItems(Statement st) {\n\t\tList<Item> items = new ArrayList<>();\n\t\tString sentSQL = \"\";\n\t\ttry {\n\t\t\tsentSQL = \"select * from items\";\n\t\t\tResultSet rs = st.executeQuery(sentSQL);\n\t\t\t// Iteramos sobre la tabla result set\n\t\t\t// El metodo next() pasa a la siguiente fila, y devuelve true si hay más filas\n\t\t\twhile (rs.next()) {\n\t\t\t\tint id = rs.getInt(\"id\");\n\t\t\t\tString name = rs.getString(\"name\");\n\t\t\t\tfloat timePerUnit = rs.getFloat(\"timeperunit\");\n\t\t\t\tItem item = new Item(id, name, timePerUnit);\n\t\t\t\titems.add(item);\n\t\t\t\tlog(Level.INFO,\"Fila leida: \" + item, null);\n\t\t\t}\n\t\t\tlog(Level.INFO, \"BD consultada: \" + sentSQL, null);\n\t\t} catch (SQLException e) {\n\t\t\tlog(Level.SEVERE, \"Error en BD\\t\" + sentSQL, e);\n\t\t\tlastError = e;\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn items;\n\t}", "@Override\n\tpublic List<Item> findItemList() {\n\t\tCriteriaBuilder cb=entityManager.getCriteriaBuilder();\n\t\tCriteriaQuery<Item> query = cb.createQuery(Item.class); \n // Root<Item> item = query.from(Item.class);\n List<Item> itemList= entityManager.createQuery(query).getResultList();\n\t\treturn itemList;\n\t}", "public List findAll() {\n return findAll(TransactionItem.class);\n }", "@Override\n\tpublic List<Estadoitem> listar() {\n\t\treturn estaitemdao.listar();\n\t}", "public static List<Item> getItems() {\n\n HttpRequest request = HttpRequest.newBuilder().GET().uri(URI.create(\"http://localhost:8080/item/all\")).setHeader(\"Cookie\", Authenticator.SESSION_COOKIE).build();\n HttpResponse<String> response = null;\n try {\n response = client.send(request, HttpResponse.BodyHandlers.ofString());\n } catch (Exception e) {\n e.printStackTrace();\n //return \"Communication with server failed\";\n }\n if (response.statusCode() != 200) {\n System.out.println(\"Status: \" + response.statusCode());\n }\n\n ObjectMapper mapper = new ObjectMapper();\n mapper.registerModule(new JavaTimeModule());\n List<Item> items = null;\n // TODO handle exception\n try {\n items = mapper.readValue(response.body(), new TypeReference<List<Item>>(){});\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return items;\n }", "@Override\n\tpublic List<item> findAll() {\n\t\treturn donkyClientFeign.lista().stream().map(p -> new item(p,1)).collect(Collectors.toList());\n\t}", "@Override\r\n\tpublic List<Trainee> getAll() {\n\t\treturn dao.getAll();\r\n\t}", "@Override\n public List<Item> viewAllItems() {\n // calls List<Item> itemRepo.findCatalog();\n return itemRepo.findCatalog();\n }", "public Item getItems() {\n return items;\n }", "@Override\n\tpublic void listAllItems() {\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic List<Items> getAllItems() throws ToDoListDAOException{\r\n\t\t\r\n\t\tSession session = factory.openSession();\r\n\t\t\r\n\t\tList<Items> allDoList = new ArrayList<Items>();\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tsession.beginTransaction();\r\n\t\t\tallDoList = session.createQuery(\"from Items\").list();\r\n\t\t\tsession.getTransaction().commit();\r\n\t\t}\r\n\t\tcatch (HibernateException e)\r\n\t\t{\r\n\t\t\tsession.getTransaction().rollback();\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tfinally\r\n\t\t{\r\n\t\t\tif(session != null) \r\n\t\t\t{ \r\n\t\t\t\tsession.close(); \r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn allDoList;\r\n\t}", "public List<Item> getItemList();", "List<T> getAll();", "List<T> getAll();", "List<T> getAll();", "List<T> getAll();", "List<T> getAll();", "public List<MainItemOrdered> findAll();", "List<CatalogItem> getAllCatalogItems();", "@Override\n public Iterator<Item> findAll(Context context) throws SQLException\n {\n return itemDAO.findAll(context, true);\n }", "private void getItemList(){\n sendPacket(Item_stocksTableAccess.getConnection().getItemList());\n \n }", "public ArrayList<Item> getAllItems() throws IllegalArgumentException {\r\n\r\n\t\tArrayList<Item> allItems = this.itemMapper.findAll();\r\n\r\n\t\treturn allItems;\r\n\r\n\t}", "public Item[] getItems()\n {\n return items;\n }", "public ArrayList<Item> getAllItems(){\n\t\treturn itemList; \n\t}", "List<StockList> fetchAll();", "private void getAllItems() {\n\n try {\n double sellingPrice = 0;\n ArrayList<Item> allItems = ItemController.getAllItems();\n for (Item item : allItems) {\n double selling_margin = item.getSelling_margin();\n if (selling_margin > 0) {\n sellingPrice = item.getSellingPrice() - (item.getSellingPrice() * selling_margin / 100);\n } else {\n sellingPrice = item.getSellingPrice();\n }\n Object row[] = {item.getItemCode(), item.getDescription(), Validator.BuildTwoDecimals(item.getQuantity()), Validator.BuildTwoDecimals(sellingPrice)};\n tableModel.addRow(row);\n }\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(FormItemSearch.class.getName()).log(Level.SEVERE, null, ex);\n } catch (SQLException ex) {\n Logger.getLogger(FormItemSearch.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public List<SeatEntity> getAll();", "@Override\r\n\tpublic List<Item> getAllHomework() {\n\t\t\r\n\t\treturn itemdao.find(\"from Item\");\r\n\t}", "public List<Stockitem> getItem() {\n\t\treturn (ArrayList<Stockitem>) stockitemDAO.findAllStockitem();\n\t}", "public T[] items();", "public void queryAllBuyableItems(){\r\n awsAppSyncClient.query(ListBuyableItemsQuery.builder().build())\r\n .responseFetcher(AppSyncResponseFetchers.CACHE_AND_NETWORK)\r\n .enqueue(getAllBuyableItemsCallback);\r\n }", "public abstract List<Object> getAll();", "public ArrayList<TEntity> getAll(){\n ArrayList<TEntity> list = new ArrayList<TEntity>();\n\n Cursor cursor = db.query(tableName, columns, null, null, null, null, null);\n\n cursor.moveToFirst();\n\n while (!cursor.isAfterLast()) {\n list.add(fromCursor(cursor));\n cursor.moveToNext();\n }\n\n return list;\n }", "List<T> obtenerAll();", "@Override\n\tpublic List<T> getAll() {\n\t\treturn getDao().findAll();\n\t}", "@Override\n\tpublic List<T> getAllEntry() {\n\t\treturn this.hibernateTemplate.find(\"from \"+this.classt.getName());\n\t}", "List<ItemPedido> findAll();", "public List<OrderItem> findAllOrderItem(){\n List<OrderItem> orderItems=findAll();\n return orderItems;\n }", "public List<TodoItemEntity> findAll(){\n return todoItemRepository.findAll();\n }", "E[] getAll();", "public List<ItemDTO> getItems()\n\t{\t\n\t\tList<ItemDTO> itemsList = new ArrayList<>();\n\t\tfor (ItemData item : items) \n\t\t\titemsList.add(new ItemDTO(item.idItem,item.description,item.price,item.VAT,item.quantitySold));\t\n\t\treturn itemsList;\n\t}", "public ArrayList<ToDoList> getAllItems() {\n ArrayList<ToDoList> itemsList = new ArrayList<ToDoList>();\n String selectQuery = \"SELECT * FROM \" + TABLE_NAME;\n\n SQLiteDatabase db = this.getWritableDatabase();\n Cursor cursor = db.rawQuery(selectQuery, null);\n\n // looping through all rows and adding to list\n if (cursor.moveToFirst()) {\n do {\n ToDoList item = new ToDoList(cursor.getString(1), cursor.getString(2), cursor.getInt(0));\n itemsList.add(item);\n } while (cursor.moveToNext());\n }\n return itemsList;\n }", "public static ResultSet getAllItem() {\n try {\n Statement st = conn.createStatement();\n ResultSet rs = st.executeQuery(\"SELECT itemID, ownerID, Name, status, description,category,image1,image2,image3,image4 FROM iteminformation\");\n return rs;\n } catch (SQLException ex) {\n Logger.getLogger(itemDAO.class.getName()).log(Level.SEVERE, null, ex);\n }\n return null;\n }", "public List<Item> getItems(){\n\t\treturn data;\n\t}", "@VTID(30)\n boolean getShowAllItems();", "public List<T> getAll() {\n\t\treturn this.getAll(new ArrayList<String>(), false);\n\t}", "@Override\r\n\t\tpublic List<Item> getItems() {\n\t\t\treturn null;\r\n\t\t}", "public java.util.List<SitbMoneyCollection> findAll();", "public Item[] getItems() {\n/* 3068 */ if (this.vitems != null) {\n/* 3069 */ return this.vitems.getAllItemsAsArray();\n/* */ }\n/* 3071 */ return emptyItems;\n/* */ }", "private static List<Item> getItems() {\n\t\treturn items;\n\t}", "public ResultSet getItemList() throws IllegalStateException{\n\t \n\t if(!isLoggedIn())\n\t throw new IllegalStateException(\"MUST BE LOGGED IN FIRST!\");\n\t try{\n\t \t stmt = con.createStatement();\n String queryString = \"SELECT INUMBER , INAME , CATEG, auc_start, auc_end_date , startbid , currentbid,status \" \n \t\t+ \"FROM ITEM \"\n + \" WHERE SELLERNO = '\" + this.id +\"' \";\n\n result = stmt.executeQuery(queryString);\n \n\t }\n\t catch (Exception E) {\n\t E.printStackTrace();\n\t }\n\t return result; \n\t }", "public List<T> getItems() {\n return SerDes.unmirrorList(getElement().getItems(), getItemClass());\n }", "@GET\r\n\t@Path(\"/all\")\r\n\t@Produces(\"application/json\")\r\n\tpublic JsonArray getAllItems(){\r\n\t\t \tConnection database = DBConnecter.getConnection();\r\n\t\t Statement stat = null;\r\n\t\t ResultSet rs = null;\r\n\t\t\ttry {\r\n\t\t\t\tstat = database.createStatement();\r\n\t\t\t\tString sqlQueryString = \"select * from item;\";\r\n\t\t\t\trs = stat.executeQuery(sqlQueryString);\r\n\t\t\t\tstat.executeQuery(sqlQueryString);\r\n\t\t\t\twhile(rs.next()){\r\n\t\t\t\t\tItem itemNew = new Item(\r\n\t\t \t\trs.getInt(idTagString),\r\n\t\t \t\trs.getInt(binNumString),\r\n\t\t \t\trs.getString(departmentString),\r\n\t\t \t\trs.getString(descriptionString),\r\n\t\t \t\trs.getFloat(replacementCostString),\r\n\t\t \t\trs.getFloat(priceString),\r\n\t\t \t\trs.getString(dimensionsString),\r\n\t\t \t\trs.getInt(lengthString),\r\n\t\t \t\trs.getFloat(weightString),\r\n\t\t \t\trs.getString(modelNumberString),\r\n\t\t \t\trs.getInt(purchaseDateString),\r\n\t\t \t\trs.getInt(warrantyEndDateString),\r\n\t\t \t\trs.getString(categoryString)\r\n\t\t \t\t);\r\n\t\t items.add(itemNew);\r\n\t\t\t\t}\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}finally{\r\n\t\t\t\ttry {\r\n\t\t\t\t\trs.close();\r\n\t\t\t\t\tstat.close();\r\n\t\t\t\t\tdatabase.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t \r\n\t\t\t}\r\n\t\t\treturn getListAsJson(items);\r\n\t}", "ArrayList<E> getAll();", "public ArrayList<Item> getItems() {\r\n\t\titems.clear();\r\n\t\tCursor cursor = db.query(SkyleConstants.TABLE_ITEMS, allColumns, null, null, null, null, null);\r\n\t\tcursor.moveToFirst();\r\n\t\t\r\n\t\twhile (!cursor.isAfterLast()) {\r\n\t\t\tString ID = cursor.getString(cursor.getColumnIndex(SkyleConstants.KEY_ID));\r\n\t\t\tString type = cursor.getString(cursor.getColumnIndex(SkyleConstants.ITEMS_TYPE));\r\n\t\t\tString date = cursor.getString(cursor.getColumnIndex(SkyleConstants.DATE_NAME));\r\n\t\t\tString path = cursor.getString(cursor.getColumnIndex(SkyleConstants.ITEMS_PATH));\r\n\t\t\t\r\n\t\t\tLog.i(TAG, \"elements: \"+type+\", \"+path);\r\n\t\t\t\r\n\t\t\tItem item = new Item(ID, type, date, path);\t\t\t\r\n\t\t\titems.add(item);\r\n\t\t\tcursor.moveToNext();\r\n\t\t}\r\n\t\tcursor.close();\r\n\t\tLog.i(TAG, \"arraylist: \"+items.toString());\r\n\t\treturn items;\r\n\t}", "public List<ReturnItem> getItems() {\n return (List<ReturnItem>) get(\"items\");\n }", "public static void items(){\n\t\ttry{\n\t\t\tConnection conn = DriverManager.getConnection(url,username,password);\n\t\t\tStatement query = conn.createStatement();\n\t\t\tResultSet re = query.executeQuery(\"select * from item\");\n\t\t\tString spc = \" \";\n\t\t\twhile (re.next()){\n\t\t\t\tSystem.out.println(re.getInt(\"itemid\")+spc+re.getString(\"title\")+spc+re.getDouble(\"price\"));\n\t\t\t}\n\t\t}catch(Exception ecx){\n\t\t\tecx.printStackTrace();\n\t\t}\n\t}", "public List<ShelfItem> getAllShelf(String filter, String username, Integer from, Integer to);", "List<Usertype> selectAll();", "@Override\n public List<T> findAll() {\n String getAllQuery = \"SELECT * FROM \" + getTableName();\n return getJdbcTemplate().query(getAllQuery,\n BeanPropertyRowMapper.newInstance(getEntityClass()));\n }", "@Override\n\tpublic List<Trainee> getAll() {\n\t\tQuery q=em.createQuery(\"select m from Trainee m\");\n\t\tList<Trainee> l=q.getResultList();\n\t\treturn l;\n\t}", "public List<PlayerItem> getAllPlayerItemById(Player player);", "List<BasicEquipment> selectAll();", "public String getAllItems(String name){\n return \"\";\n }", "private void getTravelItems() {\n String[] columns = Columns.getTravelColumnNames();\n Cursor travelCursor = database.query(TABLE_NAME, columns, null, null, null, null, Columns.KEY_TRAVEL_ID.getColumnName());\n travelCursor.moveToFirst();\n while (!travelCursor.isAfterLast()) {\n cursorToTravel(travelCursor);\n travelCursor.moveToNext();\n }\n travelCursor.close();\n }", "java.util.List<io.opencannabis.schema.commerce.OrderItem.Item> \n getItemList();", "public Collection<T> getAll() throws DaoException;", "public List<Item> getItems() {\n return items;\n }", "public List<Item> getItems() {\n return items;\n }", "public Item[] getItems() {\n return items.toArray(new Item[0]);\n }", "List fetchAll() throws AdaptorException ;", "@RequestMapping(method=RequestMethod.GET, value = \"/item\", produces = \"application/json\")\n public List<Item> getItems()\n {\n return this.itemRepository.getItems();\n }", "public List<T> items() {\n return items;\n }", "public List<Item> getAllItems() {\r\n\t\tList<Item> itemList = new ArrayList<Item>();\r\n\t\tif(this.itemMap != null) {\r\n\t\t\tfor(Category2ItemMap map : this.itemMap) {\r\n\t\t\t\titemList.add(map.getItem());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn itemList;\r\n\t}", "@Override\n\tpublic List findAll()\n\t{\n\t\treturn teataskMapper.findAll();\n\t}", "public List<BusinessObject> getItems(Package pkg);", "public Set<RequestItem> getAllData() {\n\n RequestItem requestItem;\n Set<RequestItem> result = new HashSet<>();\n String selectQuery = \"select * from \" + DatabaseHelper.TABLE_NAME + \" ORDER BY _id ASC\";\n\n SQLiteDatabase db = this.getReadableDatabase();\n try {\n Cursor cursor = db.rawQuery(selectQuery, null);\n\n if (cursor.moveToFirst()) {\n do {\n requestItem = new RequestItem();\n requestItem._id = cursor.getString(0);\n requestItem.requestSmilePercentage = cursor.getInt(1);\n requestItem.requestDateStart = cursor.getString(2);\n requestItem.requestDateEnd = cursor.getString(3);\n requestItem.requestUserName = cursor.getString(4);\n\n result.add(requestItem);\n\n }while (cursor.moveToNext());\n }\n cursor.close();\n db.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return result;\n }", "public Cursor getAllItems() {\n\t\treturn db.query(TABLE_EVENTS, new String[] { ROW_ID, ROW_TITLE,ROW_INFO, ROW_DATE, ROW_TIME, ROW_DATETIME,\n\t\t\tROW_REPEAT,ROW_REPEAT_TEXT, ROW_REPEAT_CNT,ROW_REPEAT_TYPE_ID,ROW_REPEAT_TYPE_TEXT,\n\t\t\tROW_BEFORE,ROW_BEFORE_TEXT, ROW_BEFORE_CNT,ROW_BEFORE_TYPE_ID,ROW_BEFORE_TYPE_TEXT,\n\t\t\t\t\t\t\tROW_ACTIVE }, null, null, null, null, ROW_DATETIME+\" asc\");\n\t}" ]
[ "0.7159937", "0.7131398", "0.7107469", "0.7092039", "0.6987231", "0.68986124", "0.6833956", "0.68199784", "0.68034476", "0.6797351", "0.67345583", "0.6713776", "0.66481274", "0.6639784", "0.660162", "0.65985477", "0.6571686", "0.656601", "0.6524771", "0.65108687", "0.64985883", "0.64896524", "0.64822435", "0.6458379", "0.64542407", "0.6440925", "0.6440088", "0.64329225", "0.6431841", "0.64294416", "0.6426335", "0.6407214", "0.6403522", "0.64026225", "0.6401867", "0.6391381", "0.6391381", "0.6391381", "0.6391381", "0.6391381", "0.6379068", "0.6372981", "0.63719344", "0.633541", "0.63270056", "0.63258415", "0.6319979", "0.6307557", "0.6287986", "0.6280743", "0.62804997", "0.6267971", "0.6258589", "0.6249571", "0.62462336", "0.62370557", "0.62356454", "0.6234958", "0.6225782", "0.6225246", "0.6218774", "0.6212325", "0.6210609", "0.62097704", "0.62076026", "0.6203991", "0.6196466", "0.61947757", "0.61749125", "0.61737573", "0.6173162", "0.6163091", "0.6136365", "0.6134307", "0.61189026", "0.61059475", "0.6098284", "0.60944706", "0.6076607", "0.6074255", "0.6073507", "0.606609", "0.6059756", "0.6052564", "0.6042871", "0.604265", "0.6042562", "0.6041003", "0.60402095", "0.60373616", "0.6034744", "0.6034744", "0.60258317", "0.60233814", "0.60187423", "0.6013687", "0.60135555", "0.6009634", "0.60074806", "0.6004116", "0.5998941" ]
0.0
-1
/ Getting a specific item by item id from table
public Item getItem(int itemId) { return (Item) hashOperations.get(KEY, itemId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Item getItemById(Integer itemId);", "Item findById(String id);", "public Item getItem(long idItem) throws ItemNotFound;", "@Override\n public Item get(long idItem) throws EntityNotFound;", "public Items findByPrimaryKey(int id) throws ItemsDaoException;", "HpItemParamItem selectByPrimaryKey(Long id);", "public static item getItemById(int id) {\n try {\n PreparedStatement st = conn.prepareStatement(\"SELECT itemID, ownerID, Name, status, description, category, image1,image2,image3,image4 FROM iteminformation WHERE itemID=?\");\n st.setInt(1, id);\n ResultSet rs = st.executeQuery();\n if (rs.next()) {\n item item = new item(rs.getInt(1), rs.getString(2), rs.getString(3), (rs.getInt(4) == 1) ? true : false, rs.getString(5), rs.getString(6), rs.getBlob(7), rs.getBlob(8), rs.getBlob(9), rs.getBlob(10));\n return item;\n } else {\n return null;\n }\n } catch (SQLException ex) {\n Logger.getLogger(itemDAO.class.getName()).log(Level.SEVERE, null, ex);\n }\n return null;\n }", "Sequipment selectByPrimaryKey(Integer id);", "@Override\n\tpublic Item findItemById(Long id) {\n\t\tCriteriaBuilder cb=entityManager.getCriteriaBuilder();\n\t\t\n\t\tCriteriaQuery<Item> q = cb.createQuery(Item.class);\n\t\t Root<Item> c = q.from(Item.class);\n\t\t ParameterExpression<Long> p = cb.parameter(Long.class);\n\t\t q.select(c).where(cb.equal(c.get(\"id\"), p));\n\t\t TypedQuery<Item> query = entityManager.createQuery(q);\n\t\t query.setParameter(p, id);\n\t\t Item i = query.getSingleResult();\n\t\treturn i;\n\t}", "public Items findByPrimaryKey(ItemsPk pk) throws ItemsDaoException;", "ShoppingItem getShoppingItemByGuid(String itemGuid);", "public Item getByID(Integer id) {\r\n Item item = null;\r\n //Transaction trans = null;\r\n Session session = HibernateUtil.getSessionFactory().openSession();\r\n\r\n try {\r\n //trans = session.beginTransaction();\r\n\r\n item = (Item) session.get(Item.class, id);\r\n\r\n //trans.commit();\r\n } catch (HibernateException e) {\r\n //if (trans != null) { trans.rollback(); }\r\n e.printStackTrace();\r\n } finally {\r\n session.close();\r\n }\r\n return item;\r\n }", "CatalogItem getItembyId(final Long id);", "public ItemModel getItemByID(int id) {\n SQLiteDatabase sdb = this.getReadableDatabase();\n ItemModel item = new ItemModel();\n\n Cursor cursor = sdb.rawQuery(\"Select * from item where item_id=?\", new String[]{String.valueOf(id)} );\n cursor.moveToFirst();\n item.setItem_id(cursor.getInt(0));\n item.setItem_name(cursor.getString(1));\n item.setItem_price(cursor.getInt(2));\n item.setItem_size(cursor.getString(3));\n item.setItem_material(cursor.getString(4));\n item.setItem_desc(cursor.getString(5));\n item.setItem_gender_category(cursor.getInt(6));\n item.setItem_category(cursor.getString(7));\n item.setItem_color(cursor.getString(8));\n item.setItem_image(cursor.getString(9));\n\n cursor.close();\n\n// Log.e(\"getItembyId\", \"finished getting item by Id\");\n return item;\n }", "TCar selectByPrimaryKey(Integer fitemid);", "@Override\n public Item find(Context context, UUID id) throws SQLException\n {\n Item item = itemDAO.findByID(context, Item.class, id);\n if (item == null)\n {\n if (log.isDebugEnabled())\n {\n log.debug(LogManager.getHeader(context, \"find_item\",\n \"not_found,item_id=\" + id));\n }\n return null;\n }\n\n // not null, return item\n if (log.isDebugEnabled())\n {\n log.debug(LogManager.getHeader(context, \"find_item\", \"item_id=\"\n + id));\n }\n\n return item;\n }", "@Override\n\tpublic Item getItemByID(String itemId) {\n\n\t\treturn actionOnItem(itemId).get(0);\n\t}", "@Override\n\tpublic Item getItemByID(String itemId) {\n\n\t\treturn actionOnItem(itemId).get(0);\n\t}", "public Items[] findWhereIdEquals(int id) throws ItemsDaoException;", "@GetMapping(\"/items/{item_id}\")\n\tpublic ResponseEntity<Item> getItemById(@PathVariable(value=\"item_id\") Long item_id){ \n\t\tItem item = itemDAO.findOne(item_id);\n\t\t\n\t\tif(item == null) {\n\t\t\treturn ResponseEntity.notFound().build();\n\t\t}\n\t\treturn ResponseEntity.ok().body(item);\n\t}", "SrmFundItem selectByPrimaryKey(String itemFlow);", "public PlayerItem getPlayerItemById(int playerItemId);", "Identifiable item();", "Thing selectByPrimaryKey(String thingid);", "ItemStockDO selectByPrimaryKey(Integer id);", "ItemStockDO selectByPrimaryKey(Integer id);", "Item getItem(int id) {\n SQLiteDatabase db = DataBaseManager.getInstance().openDatabase();\n Cursor cursor = db.query(TABLE_ITEMS, new String[]{KEY_ID,\n KEY_ARRAY_ID, KEY_NAME, KEY_DESCRIPTION},\n KEY_ID + \"=?\",\n new String[]{String.valueOf(id)}, null, null, null, null);\n Item item = null;\n if (cursor != null) {\n cursor.moveToFirst();\n\n item = new Item(Integer.parseInt(cursor.getString(KEY_INDEX)), Integer.parseInt(cursor.getString(ARRAY_INDEX)),\n cursor.getString(NAME_INDEX), cursor.getString(DESCRIPTION_INDEX));\n }\n DataBaseManager.getInstance().closeDatabase();\n // return contact\n return item;\n }", "public static Item fetchByPrimaryKey(long itemId) {\n\t\treturn getPersistence().fetchByPrimaryKey(itemId);\n\t}", "int getItemID();", "BasicEquipment selectByPrimaryKey(Integer id);", "@Override\r\n\tpublic OrderItem getOrderItem(int id) {\n\t\tSession session = SessionFactorySingleton.getSessionFactory().getFactorySession();\r\n\t\tOrderItem order = (OrderItem) session.get(OrderItem.class,id);\r\n\t\treturn order;\r\n\r\n\t}", "TradeItem getTradeItem(long id);", "OrderItemDto getOrderItem(long id) throws SQLException;", "Dish selectByPrimaryKey(String id);", "ItemCategory selectByPrimaryKey(Integer id);", "private BaseItem getItemById(int id) {\n\t\tfor (BaseItem item : mItems) {\n\t\t\tif (item.mId == id) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t}\n\t\treturn getDefault();\n\t}", "Item findByNo(Long No);", "@Override\n\tpublic FoodItem getItem(Long id) {\n\t\treturn foodItemRepository.getOne(id);\n\t}", "Abum selectByPrimaryKey(String id);", "ItoProduct selectByPrimaryKey(Integer id);", "public List<PlayerItem> getSpecific(int playerItemId);", "Product selectByPrimaryKey(Integer id);", "public MenuItem findItem(int id);", "public TodoItem getTodoItemById(Long id) throws RecordNotFoundException {\n Optional<TodoItem> todoItem = todoItemRepository.findById(id);\n\n if (todoItem.isPresent()) {\n return todoItem.get();\n } else {\n throw new RecordNotFoundException(\"No TodoItem record exist for given id\");\n }\n }", "private Item findItemById(String curId, Inventory invent){\n\t\tif (invent == null) return null;\n\t\tfor (Item item : invent){\n\t\t\tif (item.getId().equals(curId)){\n\t\t\t\treturn item;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "@GetMapping(\"/{id}\")\n public ResultEntity<ItemDTO> getItemByItemId(@PathVariable String id)\n {\n return itemService.getItemByItemId(id);\n }", "io.opencannabis.schema.commerce.OrderItem.Item getItem(int index);", "TempletLink selectByPrimaryKey(String id);", "IceApp selectByPrimaryKey(Long id);", "PrhFree selectByPrimaryKey(Integer id);", "long getID(Object item);", "Shareholder selectByPrimaryKey(Integer id);", "Product selectByPrimaryKey(Long id);", "public Item getItem() {\n return Bootstrap.getInstance().getItemRepository().fetchAll().stream()\n .filter(i -> i.getId() == this.itemId)\n .findFirst().orElse(null);\n }", "NjProductTaticsRelation selectByPrimaryKey(String id);", "Caiwu selectByPrimaryKey(Integer id);", "public UserItem getUserItemByIds(UserItem ui);", "Book selectByPrimaryKey(String id);", "Book selectByPrimaryKey(String bid);", "public BusinessObject getItem(Package pkg, String id);", "public static Item getItem( ) {\n ConnectionPool pool = ConnectionPool.getInstance();\n Connection connection = pool.getConnection();\n PreparedStatement ps = null;\n \n\tString query = \"select * from Item\";\n\ttry {\n ps = connection.prepareStatement(query);\n\t ResultSet rs = null;\n\t rs = ps.executeQuery();\n \n\t Item item = new Item();\n \n\t if (rs.next()) {\n\t\titem.setAttribute(rs.getString(1));\n\t\titem.setItemname(rs.getString(2));\n\t\titem.setDescription(rs.getString(3));\n\t\titem.setPrice(rs.getDouble(4));\n\t }\n\t rs.close();\n\t ps.close();\n\t return item;\n\t} catch (java.sql.SQLException sql) {\n\t sql.printStackTrace();\n\t return null;\n\t}\n }", "Goods selectByPrimaryKey(String goodsId);", "Dormitory selectByPrimaryKey(Integer id);", "AppStandard selectById(String id);", "BookInfo selectByPrimaryKey(Integer id);", "public Item getItem(Long id) {\r\n \t\tif (id == null)\r\n \t\t\treturn null;\r\n \t\treturn persistenceManager.getItem(id);\r\n \t}", "public void getRemoteItemById(long item_id) {\n url = Constants.getItemById;\n params = new HashMap<>();\n params.put(param_item_id, \"\" + item_id);\n\n if (ApiHelper.checkInternet(mContext)) {\n mApiHelper.getItemById(item_id, mIRestApiCallBack, true, url, params);\n } else {\n //Toast.makeText(mContext, mContext.getString(R.string.noInternetConnection), Toast.LENGTH_LONG).show();\n mIRestApiCallBack.onNoInternet();\n CacheApi cacheApi = loadCacheData(url, params);\n mSqliteCallBack.onDBDataObjectLoaded(cacheApi);\n }\n\n }", "public OrderItem findOrderItemById(int id)\n\t{\n\t\tOrderItem orderIt=orderItemDAO.findById(id);\n\t\tif(orderIt==null)\n\t\t{\n\t\t\tJOptionPane.showMessageDialog(null,\n\t\t\t\t \"Id-ul nu exista!\",\n\t\t\t\t \"Update error\",\n\t\t\t\t JOptionPane.ERROR_MESSAGE);\n\t\t\tthrow new NoSuchElementException(\"OrderItem=ul cu id-ul:\"+id+\" nu a fost gasit\");\n\t\t}\n\t\treturn orderIt;\n\t}", "Yqbd selectByPrimaryKey(Integer id);", "public List<OrderItem> searchOrderItem(int idOrderItem) throws SQLException, Exception {\n\n List<OrderItem> lista = new ArrayList<OrderItem>();\n String query = \"SELECT * FROM order_Item WHERE id_Order_Item = ? ;\";\n\n PreparedStatement st = con.prepareStatement(query); //Prepared the query\n st.setInt(1, idOrderItem);\n\n ResultSet rs = st.executeQuery(); //Execute the select\n\n while(rs.next()) {\n OrderItem oi = new OrderItem();\n\n oi.setIdOrderItem(rs.getInt(\"id_Order_Item\"));\n oi.setAmount(rs.getInt(\"amount\"));\n oi.setProductIdProduct(rs.getInt(\"product_id_Product\"));\n oi.setOrderIdItem(rs.getInt(\"order_id_Order\"));\n\n lista.add(oi);\n \n }\n\n st.close(); //Close the Statment\n con.close(); //Close the connection\n\n return lista;\n }", "NjOrderWork2 selectByPrimaryKey(String id);", "public Item getItem(Long id)\n {\n return auctionManager.getItem(id);\n }", "CraftAdvReq selectByPrimaryKey(Integer id);", "Procdef selectByPrimaryKey(String id);", "NewsItem obtainNewsItemById(long id) throws ObjectRetrievalFailureException;", "@Override\n\tpublic ThematicItem getItem(Long id) {\n\t\treturn repository.getItem(id);\n\t}", "@Override\n\t\tpublic Rawitem findRawitemById(int rid) {\n\t\t\tString sql=\"SELECT * FROM rawitem WHERE rid=:rid\";\n\t\treturn\tnamedParameterJdbcTemplate.queryForObject(sql, getSqlParameterByModel(new Rawitem(rid)),new RawitemMapper() );\n\t\t\t\n\t\t}", "ProductPurchaseItem getProductPurchaseItemPerId(long sprcId);", "AccessModelEntity selectByPrimaryKey(String id);", "SwipersDO selectByPrimaryKey(Integer id);", "public Item getItem(String id) {\r\n\t\treturn items.get(id);\r\n\t}", "public ActiveSurveyQuestionItem(Connection db, int itemId) throws SQLException {\n if (itemId == -1) {\n throw new SQLException(\"Item ID not specified\");\n }\n\n PreparedStatement pst = db.prepareStatement(\n \"SELECT si.item_id, si.question_id, si.\" + DatabaseUtils.addQuotes(db, \"type\") + \", si.description \" +\n \"FROM active_survey_items si \" +\n \"WHERE item_id = ? \");\n int i = 0;\n pst.setInt(++i, itemId);\n ResultSet rs = pst.executeQuery();\n if (rs.next()) {\n buildRecord(rs);\n }\n rs.close();\n pst.close();\n }", "Clazz selectByPrimaryKey(Integer id);", "@GET\r\n\tpublic JsonObject getItem(@QueryParam(\"id\") int id){\r\n\t\tConnection database = DBConnecter.getConnection();\r\n\t Statement stat = null;\r\n\t ResultSet rs = null;\r\n\t System.out.print(id);\r\n\t\ttry {\r\n\t\t\tItem item = null;\r\n\t\t\tstat = database.createStatement();\r\n\t\t\tString sqlQueryString = \"select * from item where idTag='\" + id+ \"';\";\r\n\t\t\trs = stat.executeQuery(sqlQueryString);\r\n\t\t\tstat.executeQuery(sqlQueryString);\r\n\r\n\t\t\twhile(rs.next()){\r\n\t\t\t\titem = new Item(\r\n\t \t\trs.getInt(idTagString),\r\n\t \t\trs.getInt(binNumString),\r\n\t \t\trs.getString(departmentString),\r\n\t \t\trs.getString(descriptionString),\r\n\t \t\trs.getFloat(replacementCostString),\r\n\t \t\trs.getFloat(priceString),\r\n\t \t\trs.getString(dimensionsString),\r\n\t \t\trs.getInt(lengthString),\r\n\t \t\trs.getFloat(weightString),\r\n\t\t\t \trs.getString(modelNumberString),\r\n\t\t\t \trs.getInt(purchaseDateString),\r\n\t\t\t \trs.getInt(warrantyEndDateString),\r\n\t\t\t \trs.getString(categoryString)\r\n\t \t\t);\r\n\t\t\t}\r\n\t\t\tif(item != null)\r\n\t\t\t\treturn item.toJSON();\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}finally{\r\n\t\t\ttry {\r\n\t\t\t\trs.close();\r\n\t\t\t\tstat.close();\r\n\t\t\t\tdatabase.close();\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t \r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public @NotNull Item findItem(@NotNull final Identifier identifier) throws ItemNotFoundException, BazaarException;", "Prueba selectByPrimaryKey(Integer id);", "Appraise selectByPrimaryKey(Integer id);", "TCpySpouse selectByPrimaryKey(Integer id);", "@Override\n public Item getItemBySlot(Integer itemSlot) {\n return dao.getItemBySlot(itemSlot);\n }", "Tourst selectByPrimaryKey(String id);", "List<ItemUser> findByUserId(Long userId);", "public ItemTypeDTO findById(String id);", "Powers selectByPrimaryKey(Integer id);", "SysId selectByPrimaryKey(String id);", "GoodsPo selectByPrimaryKey(Long id);", "DashboardGoods selectByPrimaryKey(Integer id);", "@RequestMapping(value = \"/item/{id}\", method = RequestMethod.GET)\n\tpublic @ResponseBody Optional<Item> findItemRest(@PathVariable(\"id\") Long itemId) {\n\t\treturn repository.findById(itemId);\n\t}", "public Todo fetchByPrimaryKey(long todoId);", "Article selectByPrimaryKey(String id);", "ProSchoolWare selectByPrimaryKey(String id);" ]
[ "0.80300176", "0.7970908", "0.7761367", "0.767489", "0.7530262", "0.7502552", "0.7500021", "0.73951024", "0.7340288", "0.7316612", "0.7274955", "0.7262137", "0.72433895", "0.72394854", "0.7152197", "0.71133465", "0.71025187", "0.71025187", "0.7091309", "0.7062962", "0.70583206", "0.7030544", "0.6994722", "0.6978888", "0.6962342", "0.6962342", "0.6947061", "0.69326967", "0.6893996", "0.6889187", "0.68550503", "0.6805544", "0.67807686", "0.6779782", "0.6777972", "0.6766368", "0.6765849", "0.67644626", "0.6759735", "0.6749305", "0.67229676", "0.67197883", "0.6712472", "0.6704441", "0.6690224", "0.66856897", "0.6683298", "0.66830844", "0.66823566", "0.66784436", "0.667596", "0.66742474", "0.6669898", "0.66694576", "0.66677356", "0.66393894", "0.66387385", "0.6637677", "0.6629611", "0.6628759", "0.66025436", "0.6579481", "0.6570996", "0.6555265", "0.6552741", "0.65451336", "0.6524173", "0.6523087", "0.65154445", "0.6507283", "0.6495052", "0.6488534", "0.64854807", "0.6483843", "0.6481023", "0.64805305", "0.6478082", "0.6475342", "0.6455375", "0.6455307", "0.64552265", "0.64518535", "0.6448365", "0.644162", "0.6439814", "0.6423027", "0.64128923", "0.6405081", "0.6401322", "0.63966876", "0.63928354", "0.6391485", "0.638928", "0.638755", "0.6382915", "0.6381645", "0.6376048", "0.6370099", "0.635499", "0.63534445" ]
0.67137665
42
/ Adding an item into redis database
public void addItem(Item item) { hashOperations.put(KEY, item.getId(), item); //valueOperations.set(KEY + item.getId(), item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public long sadd(String key,String value){\n Jedis jedis = null;\n try{\n jedis = pool.getResource();\n return jedis.sadd(key,value);\n } catch (Exception e){\n logger.error(\"发生异常:\"+e.getMessage());\n } finally {\n jedis.close();\n }\n return 0;\n }", "public Object putItem (String key, Object item);", "public void insert(KeyedItem newItem);", "void add(Item item);", "public void rpushForObject(String key, Object value) {\n Jedis jedis = null;\n if (value == null) {\n return;\n }\n try {\n jedis = jedisPool.getResource();\n // jedis.rpush(key.getBytes(), HessianSerializer.serialize(value));\n jedis.rpush(key.getBytes(), toJsonByteArray(value));\n } finally {\n if (jedis != null) {\n jedis.close();\n }\n }\n }", "public void store(Item item) {\n this.items.add(item);\n }", "@Override\r\n\tpublic void insertEncoreItem(Item item) {\n\t\tint i = sqlSession.insert(ns+\".insertEncoreItem\", item);\r\n\t\tif(i>0) System.out.println(\"insert Encore item1\");\r\n\t}", "public BookUser addItemInTable(BookUser item) throws ExecutionException, InterruptedException {\n BookUser entity = Azure.mbook.insert(item).get();\n return entity;\n }", "public abstract void add(T item) throws RepositoryException;", "void add(String key);", "public void lpushForObject(String key, Object value) {\n Jedis jedis = null;\n if (value == null) {\n return;\n }\n try {\n jedis = jedisPool.getResource();\n // jedis.lpush(key.getBytes(), HessianSerializer.serialize(value));\n jedis.lpush(key.getBytes(), toJsonByteArray(value));\n } finally {\n if (jedis != null) {\n jedis.close();\n }\n }\n }", "public long lpush(String key,String value){\n Jedis jedis = null;\n try{\n jedis = pool.getResource();\n return jedis.lpush(key,value);\n } catch (Exception e){\n logger.error(\"发生异常:\"+e.getMessage());\n } finally {\n jedis.close();\n }\n return 0;\n }", "void addItem(DataRecord record);", "public String addItem(Item item){\n EntityManager em = emf.createEntityManager();\n try{\n utx.begin();\n em.joinTransaction();\n for(Tag tag : item.getTags()) {\n tag.incrementRefCount();\n tag.getItems().add(item);\n em.merge(tag);\n }\n em.persist(item);\n utx.commit();\n // index item\n if(bDebug) System.out.println(\"\\n***Item id of new item is : \" + item.getItemID());\n indexItem(new IndexDocument(item));\n \n } catch(Exception exe){\n try {\n utx.rollback();\n } catch (Exception e) {}\n throw new RuntimeException(\"Error persisting item\", exe);\n } finally {\n em.close();\n }\n return item.getItemID();\n }", "public void Add(String item) {\n byte[] bites = Utils.hexToBytes(item);\n mpBuffer += Utils.bytesToHex(bites);\n mLenght += bites.length;\n mBackOffset = mLenght;\n }", "public void push(Object item) {\r\n\t\tdata.add(item);\r\n\r\n\t}", "public boolean add(Book item) {\r\n\t\ttry {\t\r\n\t\t\topenConnection();\r\n\t\t\tstmt = conn.createStatement();\r\n\t\t\tString sql = \"INSERT INTO db VALUES ('\" + item.ISBN13 + \"', '\" \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ item.title + \"', '\" \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ item.author + \"', '\" \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ item.publisher + \"', '\" \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ item.year + \"', '\" \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ item.ISBN10 + \"', '\" \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ item.link + \"', '1')\";\r\n\t\t\tstmt.executeUpdate(sql);\r\n\t\t\tSystem.out.println(item.title + \" added into the database\");\r\n\t\t\treturn true;\r\n\t\t} catch (SQLException e) {\t\t\r\n\t\t\t//e.printStackTrace();\r\n\t\t} finally {\r\n\t\t\tcloseConnection();\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "int insert(ItemStockDO record);", "int insert(ItemStockDO record);", "public void addItem(Object item)\r\n {\r\n LLNode newNode;\r\n synchronized (nodeMutex)\r\n {\r\n if (nodePool.size() > 0)\r\n {\r\n newNode = (LLNode)nodePool.lastElement();\r\n newNode.key = item;\r\n newNode.next = newNode.prev = null;\r\n nodePool.removeElementAt(nodePool.size() - 1);\r\n } else\r\n {\r\n newNode = new LLNode(item);\r\n }\r\n }\r\n\r\n if (head == null)\r\n {\r\n head = tail = newNode;\r\n } else\r\n {\r\n tail.next = newNode;\r\n newNode.prev = tail;\r\n tail = newNode;\r\n }\r\n nItems++;\r\n }", "public boolean addItem(Item item) throws RemoteException, ClassNotFoundException, SQLException {\n Connection conn = DBConnection.getConnection();\n PreparedStatement stm = conn.prepareStatement(\"Insert into Item values(?,?,?,?)\");\n Object[] itemData = {item.getCode(), item.getDescription(), item.getUnitPrice(), item.getQtyOnHand()};\n for (int i = 0; i < itemData.length; i++) {\n stm.setObject(i + 1, itemData[i]);\n }\n return stm.executeUpdate() > 0;\n }", "Object insert(String key, Object param);", "@Test\n public void hset(){\n User user = new User(\"1\",\"xz\",\"11\",\"男\") ;\n String key = \"user:\"+user.getId() ;\n jedis.hset(key,\"name\",user.getName()) ;\n jedis.hset(key,\"age\",user.getAge()) ;\n jedis.hset(key,\"sex\",user.getSex()) ;\n\n System.out.println(jedis.hget(key,\"name\"));\n System.out.println(jedis.hget(key,\"name\"));\n System.out.println(jedis.hget(key,\"name\"));\n }", "public long zadd(String key, double score, String member){\n Jedis jedis = null;\n try{\n jedis = getJedis();\n return jedis.zadd(key,score,member);\n }catch (Exception e){\n logger.error(\"发生异常:\"+e.getMessage());\n }finally {\n if(jedis!=null)\n jedis.close();\n }\n return 0;\n }", "public int add(Item item) {\r\n Transaction trans = null;\r\n Session session = HibernateUtil.getSessionFactory().openSession();\r\n int id = 0;\r\n\r\n try {\r\n trans = session.beginTransaction();\r\n\r\n id = (int) session.save(item);\r\n\r\n trans.commit();\r\n } catch (HibernateException e) {\r\n if (trans != null) {\r\n trans.rollback();\r\n }\r\n e.printStackTrace();\r\n } finally {\r\n session.close();\r\n }\r\n return id;\r\n }", "public void set(String key, Object value, int ttl) {\n Jedis jedis = null;\n try {\n jedis = jedisPool.getResource();\n // jedis.set(key.getBytes(), HessianSerializer.serialize(value));\n jedis.set(key.getBytes(), toJsonByteArray(value));\n if (ttl > 0) {\n jedis.expire(key.getBytes(), ttl);\n }\n } finally {\n if (jedis != null) {\n jedis.close();\n }\n }\n }", "public int addItem(Item i);", "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 SimplePostHash() {\n this.jedis = new Jedis(\"localhost\");\n this.jedis.flushDB();\n }", "void put(MongoDBEntry<K, V> entry);", "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 add(E item);", "void add(E item);", "void add(E item);", "public void addUserIntoPools(String userId){\n long timestamp = DateUtil.getCurrentTime()/1000;\n client.zadd(newStarDateRedisKey, timestamp, userId);\n client.zadd(getRedisKey(), 0, userId);\n }", "public void insert(KeyedItem o){\r\n\t\tinsert(this,o);\r\n\t}", "void add(T item);", "protected void registerData( int id, String key, RMItem value )\n {\n synchronized(m_itemHT) {\n m_itemHT.put(key, value);\n }\n }", "public abstract void addItem(AbstractItemAPI item);", "public void addToCart(String userId ,ShoppingCartItem item) {\n\t\t PersistenceManager pm = PMF.get().getPersistenceManager();\r\n\t\t Transaction tx = pm.currentTransaction();\r\n\t\t try{\r\n\t\t\ttx.begin();\r\n\t\t\tShoppingCart cartdb = (ShoppingCart)pm.getObjectById(ShoppingCart.class, userId);\r\n\t\t\tcartdb.addItem(item);\r\n\t\t\ttx.commit();\r\n\r\n\t\t }\r\n\t\t catch (JDOCanRetryException ex) {\r\n\t\t\t\tex.printStackTrace();\r\n\t\t\t\tlogger.warning(\"Error updating cart \"+ item);\r\n\t\t\t\tthrow ex;\r\n\t\t\t}\r\n\t\t\tcatch(JDOFatalException fx){\r\n\t\t\tlogger.severe(\"Error updating cart :\"+ item);\r\n\t\t\tthrow fx;\r\n\t\t\t}\r\n\t\t finally{\r\n\t\t\t if (tx.isActive()){\r\n\t\t\t\t\ttx.rollback();\r\n\t\t\t }\r\n\t\t\t pm.close();\r\n\t\t }\r\n\t}", "public void push(String item) {\r\n\t\t\r\n\t\tNode node = new Node();\r\n\t\tnode.data=item;\r\n\t\tnode.next=last;\r\n\t\tlast=node;\r\n\t}", "public void additem(String item){\n\t\trep.takeitem(\"take \" + item);\n\t}", "public void push(final String queueName, final String item);", "void push(Object item);", "public Boolean add(Item item) {\n \tif (itemCollection.containsKey(item.getItemName())) {\r\n \tif (checkAvailability(item, 1)) {\r\n \t\titem.setQuatity(item.getQuatity() + 1);\r\n \t\titemCollection.put(item.getItemName(), item);\r\n \t\treturn true;\r\n \t} else return false;\r\n } else {\r\n \titemCollection.put(item.getItemName(), item);\r\n \treturn true;\r\n }\r\n \t\r\n }", "int insert(Storage record);", "int insert(Storage record);", "@Override\n\tpublic boolean create(Item obj) {\n\t\ttry{\n\t\t\tString query=\"INSERT INTO items(title, start_date, end_date, type) VALUES(?,?,?,?)\";\n\t\t\tPreparedStatement state = conn.prepareStatement(query, Statement.RETURN_GENERATED_KEYS);\n\t\t\tstate.setString(1, obj.getTitle());\n\t\t\tstate.setDate(2, obj.getStartDate());\n\t\t\tstate.setDate(3, obj.getEndDate());\n\t\t\tstate.setInt(4, obj.getItemType().getIndex());\n\t\t\t\n\t\t\t// Run the query\n\t\t\tstate.executeUpdate();\n\t\t\t\n\t\t\t// Update of the index (should be 0 up to this point)\n\t\t\tResultSet genKey = state.getGeneratedKeys();\n\t\t\tif (genKey.next()){\n\t\t\t\tobj.setIndex(genKey.getInt(1));\n\t\t\t};\n\t\t\tstate.close();\n\t\t\t\n\t\t\t// Notify the Dispatcher on a suitable channel.\n\t\t\tthis.publish(EntityEnum.ITEM.getValue());\n\t\t\t\n\t\t\treturn true;\n\t\t} catch (SQLException e){\n\t\t\tJOptionPane jop = new JOptionPane();\n\t\t\tjop.showMessageDialog(null, e.getMessage(),\"PostgreSQLItemDao.create -- ERROR!\",JOptionPane.ERROR_MESSAGE);\n\t\t\treturn false;\n\t\t} catch (Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t}", "public void insert(Object item);", "public abstract void add(String element) throws RemoteException;", "Map<String, Object> putItem(\n String tableName,\n MapStoreKey key,\n Map<String, Object> payload\n );", "@Override\n\t\tpublic void addRawitem(Rawitem Rawitem) {\n\t\t\tString sql=\"INSERT INTO rawitem(suppliedby,rquantity,riprice,rstock)\"\n\t\t\t\t\t+ \" values (:suppliedby,:rquantity,:riprice,:rstock)\";\n\t\t\tnamedParameterJdbcTemplate.update(sql,getSqlParameterByModel(Rawitem));\n\t\t}", "public Item addItem(Item item) {\r\n uniqueCounter++;\r\n items.add(item);\r\n return item;\r\n }", "public void add(E item);", "int insert(DataSync record);", "public interface RedisService {\n public void addRedis(RedisAnswerRecord redisAnswerRecord);\n public void updateRedis(RedisAnswerRecord redisAnswerRecord);\n public List<RedisAnswerRecord> queryRedis(List<Integer> userid);\n public RedisAnswerRecord queryRedisByKey(String userid,String key);\n\n\n}", "public int addTask(Item item) {\n try (Session session = this.factory.openSession()) {\n session.beginTransaction();\n session.save(item);\n session.getTransaction().commit();\n } catch (Exception e) {\n this.factory.getCurrentSession().getTransaction().rollback();\n }\n return item.getId();\n }", "int insert(Shareholder record);", "void addMember(Item item) throws AccessManagementException;", "int insert(PmKeyDbObj record);", "public Boolean sadd(final String key, int ttl, final String... members) {\n Jedis jedis = null;\n try {\n jedis = jedisPool.getResource();\n Boolean ret = jedis.sadd(key, members) == 1 ? true : false;\n if (ret && ttl > 0) {\n jedis.expire(key, ttl);\n }\n return ret;\n } finally {\n if (jedis != null) {\n jedis.close();\n }\n }\n }", "@Override\n\tItem save(Item item);", "Integer insert(JzAct record);", "int insert(FeedsUsersKey record);", "@Override\r\n\tpublic void insertEncoreItem2(Item item) {\n\t\tint i = sqlSession.insert(ns+\".insertEncoreItem2\", item);\r\n\t\tif(i>0) System.out.println(\"insert Encore item2\");\r\n\t}", "@Override\n\tpublic V add(K key, V value) {\n\t\tcheckNullKey(key);\n\t\tcheckNullValue(value);\n\t\twriteLock.lock();\n\t\ttry {\n\t\t\treturn cache.put(key, value);\n\t\t} finally {\n\t\t\twriteLock.unlock();\n\t\t}\n\t}", "long save(T item) throws DaoException;", "public int add(String key, E value) {\r\n int index = items.size();\r\n keys.put(key, index);\r\n items.add(value);\r\n return index;\r\n }", "void enqueue(E item);", "protected UUID add(E entry) {\n\t\treturn add(entry, true);\n\t}", "@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 }", "public boolean add(Type item);", "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}", "public void addItem(Item theItem) {\n\t\tif (inventory != null) {\n\t\t\tif (!isAuctionAtMaxCapacity()) {\n\t\t\t\t// Check item doesn't already exist as key in map\n\t\t\t\tif (inventory.containsKey(theItem)) {\n\t\t\t\t\t//ERROR CODE: ITEM ALREADY EXISTS\n\t\t\t\t\tSystem.out.println(\"That item already exists in the inventory.\");\n\t\t\t\t} else\n\t\t\t\t\tinventory.put(theItem, new ArrayList<Bid>());\n\t\t\t} else if (isAuctionAtMaxCapacity()) {\n\t\t\t\t//ERROR CODE: AUCTION AT MAX CAPACITY\n\t\t\t\tSystem.out.println(\"\\nYour auction is at maximum capacity\");\n\t\t\t} \n\t\t} else {\n\t\t\tinventory = new HashMap<Item, ArrayList<Bid>>();\n\t\t\tinventory.put(theItem, new ArrayList<Bid>());\t\t\t\t\n\t\t} \t\t\t\t\t\t\n\t}", "private CacheItem publishItem(String id, CacheItem item) {\r\n\t\t// Anzeige\r\n\t\tStringBuffer sb = new StringBuffer(item.format(id));\r\n\t\tfor (String key : item.porps.keySet()) {\r\n\t\t\tsb.append(\", \").append(key).append(\":\\\"\").append(item.porps.get(key)).append(\"\\\"\");\r\n\t\t}\r\n\t\tpublishLine(sb.toString());\r\n\t\t// Cache\r\n\t\tif (!cache.containsKey(id)) {\r\n\t\t\tcache.put(id, item);\r\n\t\t}\r\n\t\treturn item;\r\n\t}", "int insert(JmfTaskMqRef record);", "int insert(HpItemParamItem record);", "int insert(IceApp record);", "int insert(WechatDemo record);", "void insert(CmsChannel record);", "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 void addItem(Item item) {\n inventory.add(item);\n Thread updateUserThread = userController.new UpdateUserThread(LoginActivity.USERLOGIN);\n updateUserThread.start();\n synchronized (updateUserThread) {\n try {\n updateUserThread.wait();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }", "@Modifying(clearAutomatically = true)\n\t@Lock(value = LockModeType.OPTIMISTIC_FORCE_INCREMENT)\n @Query(\"UPDATE Item i SET i.quantity = i.quantity + ?1 WHERE i =?2\")\n int addToStock(double qty, Item item);", "int insert(ItemCategory record);", "@Override\n\tpublic void add() {\n\t\tHashMap<String, String> data = new HashMap<>();\n\t\tdata.put(\"title\", title);\n\t\tdata.put(\"author\", author);\n\t\tdata.put(\"publisher\", publisher);\n\t\tdata.put(\"isbn\", isbn);\n\t\tdata.put(\"bookID\", bookID);\n\t\tHashMap<String, Object> result = null;\n\t\tString endpoint = \"bookinfo/post.php\";\n\t\ttry {\n\t\t\tresult = APIClient.post(BookInfo.host + endpoint, data);\n\t\t\tvalid = result.get(\"status_code\").equals(\"Success\");\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void push(Item s){\n\n //create a new node and insert incoming data\n Node node=new Node();\n node.item=s;\n node.next=head; //make node the current head pointer\n //make head point the new node\n head=node;\n }", "@Test\n public void saveSingleEntity() {\n repository.save(eddard);\n assertThat(operations\n .execute((RedisConnection connection) -> connection.exists((\"persons:\" + eddard.getId()).getBytes(CHARSET))))\n .isTrue();\n }", "int insertSelective(ItemStockDO record);", "@Override\r\n public T add(T item) \r\n {\n Node<T> n = new Node<T>();\r\n n.setItem(item);\r\n\r\n if (head == null) { //first one\r\n head = n;\r\n tail = n;\r\n } else {\r\n tail.setNext(n); //tail's next is the new node\r\n n.setPrevious(tail); //points the new node backwards at the tail\r\n tail = n; //sets tail to the node we added\r\n }\r\n\r\n count++;\r\n\r\n return item;\r\n }", "int insert(OfUserWechat record);", "int insert(Engine record);", "@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 }", "public void add(String k, String v) throws RemoteException, Error;", "int insert(Promo record);", "public int registerOrderItem(OrderItem i) {\n int ok = 0;\n try {\n String query = \"INSERT INTO order_Item (id_Order_Item, amount, product_id_Product, order_id_Order) VALUES (?, ?, ?, ?) ;\";\n\n PreparedStatement st = con.prepareStatement(query); //Prepared the query\n\n st.setInt(1, 0);\n st.setInt(2, i.getAmount());\n st.setInt(3, i.getProductIdProduct());\n st.setInt(4, i.getOrderIdItem());\n\n ok = st.executeUpdate(); //Execute the insert\n st.close(); //Close the Statment\n con.close(); //Close the connection\n \n } catch (SQLException e) {\n e.printStackTrace();\n }\n \n return ok;\n }", "public void enqueue(Item item) \n {\n stack1.push(item);\n }", "int insert(Lbm83ChohyokanriPkey record);", "public void enqueue(E item) {\n addLast(item);\n }", "public void push(E item);", "public int addItem(Itemset i);" ]
[ "0.6590177", "0.64269257", "0.6357423", "0.6355911", "0.63151866", "0.62806743", "0.6252303", "0.6088382", "0.606303", "0.6053945", "0.60535", "0.6018624", "0.5999505", "0.59804046", "0.5960055", "0.59584546", "0.5877415", "0.58711827", "0.58711827", "0.5807746", "0.58007675", "0.57920843", "0.5791258", "0.5783809", "0.57737637", "0.57569915", "0.5754906", "0.5748302", "0.5742937", "0.57340926", "0.5725441", "0.5718035", "0.5718035", "0.5718035", "0.56997335", "0.5695029", "0.56702834", "0.56649673", "0.5655849", "0.56555116", "0.5651619", "0.5646092", "0.5644525", "0.5639422", "0.5634105", "0.5630835", "0.5630835", "0.5630278", "0.56264895", "0.56256753", "0.56197655", "0.5612696", "0.56070465", "0.55972344", "0.55869704", "0.5586423", "0.5581825", "0.5574812", "0.5556075", "0.5549677", "0.55455405", "0.5537456", "0.5532858", "0.55266786", "0.5522731", "0.5521612", "0.5519196", "0.55186", "0.5517188", "0.5514009", "0.5508775", "0.55032074", "0.54911435", "0.5477995", "0.54755116", "0.54728806", "0.547277", "0.54582036", "0.5455726", "0.5455257", "0.5447663", "0.5446313", "0.54384375", "0.54357845", "0.5434673", "0.5421633", "0.5420614", "0.54069257", "0.5403287", "0.5396552", "0.53849554", "0.5375093", "0.5372299", "0.53677297", "0.53635657", "0.5355527", "0.535243", "0.5351547", "0.5350677", "0.53486806" ]
0.63956153
2
/ delete an item from database
public void deleteItem(int id) { hashOperations.delete(KEY, id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void deleteItem()\n {\n Category categoryToDelete = dataCategories.get(dataCategories.size()-1);\n AppDatabase db = Room.databaseBuilder(getApplicationContext(),\n AppDatabase.class, \"database-name\").allowMainThreadQueries().build();\n db.categoryDao().delete(categoryToDelete);\n testDatabase();\n }", "@Override\n\tpublic boolean delete(Item obj) {\n\t\ttry{\n\t\t\tString query=\"DELETE FROM items WHERE id = ?\";\n\t\t\tPreparedStatement state = conn.prepareStatement(query,ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n\t\t\tstate.setInt(1, obj.getIndex());\n\t\t\tint nb_rows = state.executeUpdate();\n\t\t\tSystem.out.println(\"Deleted \"+nb_rows+\" lines\");\n\t\t\tstate.close();\n\t\t\t\n\t\t\t// Notify the Dispatcher on a suitable channel.\n\t\t\tthis.publish(EntityEnum.ITEM.getValue());\n\t\t\t\n\t\t\treturn true;\n\t\t} catch (SQLException e){\n\t\t\tJOptionPane jop = new JOptionPane();\n\t\t\tjop.showMessageDialog(null, e.getMessage(),\"PostgreSQLItemDao.delete -- ERROR!\",JOptionPane.ERROR_MESSAGE);\n\t\t\treturn false;\n\t\t} catch (Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\t\n\t}", "public void delete(ItemsPk pk) throws ItemsDaoException;", "int deleteByPrimaryKey(Integer fitemid);", "void deleteItem(IDAOSession session, int id);", "@Override\n\tpublic Item delete() {\n\t\treadAll();\n\t\tLOGGER.info(\"\\n\");\n\t\t//user can select either to delete a customer from system with either their id or name\n\t\tLOGGER.info(\"Do you want to delete record by Item ID\");\n\t\tlong id = util.getLong();\n\t\titemDAO.deleteById(id);\n\t\t\t\t\n\t\t\t\t\n\t\treturn null;\n\t}", "public void deleteItem(ToDoList item) {\n SQLiteDatabase db = this.getWritableDatabase();\n db.delete(TABLE_NAME, KEY_ID + \" = ?\",\n new String[]{String.valueOf(item.getId())});\n db.close();\n }", "public DeleteItemOutcome deleteItem(PrimaryKey primaryKey);", "int deleteByPrimaryKey(String itemFlow);", "@Override\n\tpublic void deleteItem(Object toDelete) {}", "@Test\n public void deleteItem() {\n Item item = new Item();\n item.setName(\"Drill\");\n item.setDescription(\"Power Tool\");\n item.setDaily_rate(new BigDecimal(\"24.99\"));\n item = service.saveItem(item);\n\n // Delete the Item from the database using the Item API method\n service.removeItem(item.getItem_id());\n\n // Test the deleteItem() method\n verify(itemDao, times(1)).deleteItem(integerArgumentCaptor.getValue());\n TestCase.assertEquals(item.getItem_id(), integerArgumentCaptor.getValue().intValue());\n }", "int deleteByPrimaryKey(String thingid);", "private void deleteitem() {\n if (mCurrentItemInfoUri != null) {\n DialogInterface.OnClickListener yesButtonClickListener =\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n mProgressbarView.setVisibility(View.VISIBLE);\n ContentValues values = null;\n new updateDeleteItemToDbTask().execute(values);\n }\n };\n // Show dialog that there are unsaved changes\n showConfirmationDeleteDialog(yesButtonClickListener);\n }\n }", "@Override\n public void deleteItem(P_CK t) {\n \n }", "private void delete()\n\t{\n\t\ttry\n\t\t{\n\t\t\tConnection con = Connector.DBcon();\n\t\t\tString query = \"select * from items where IT_ID=?\";\n\t\t\t\n\t\t\tPreparedStatement pst = con.prepareStatement(query);\n\t\t\tpst.setString(1, txticode.getText());\n\t\t\tResultSet rs = pst.executeQuery();\n\t\t\t\n\t\t\tint count = 0;\n\t\t\twhile(rs.next())\n\t\t\t{\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\t\n\t\t\tif(count == 1)\n\t\t\t{\n\t\t\t\tint choice = JOptionPane.showConfirmDialog(null, \"Are you sure you want to delete selected item data?\", \"ALERT\", JOptionPane.YES_NO_OPTION);\n\t\t\t\tif(choice==JOptionPane.YES_OPTION)\n\t\t\t\t{\n\t\t\t\t\tquery=\"delete from items where IT_ID=?\";\n\t\t\t\t\tpst = con.prepareStatement(query);\n\t\t\t\t\t\n\t\t\t\t\tpst.setString(1, txticode.getText());\n\t\t\t\t\t\n\t\t\t\t\tpst.execute();\n\t\t\t\t\t\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Deleted Successfully\", \"RESULT\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tloadData();\n\t\t\t\t\n\t\t\t\trs.close();\n\t\t\t\tpst.close();\n\t\t\t\tcon.close();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\telse\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Record Not Found!\", \"Alert\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\n\t\t\trs.close();\n\t\t\tpst.close();\n\t\t\tcon.close();\n\t\t\t\n\t\t} \n\t\tcatch (Exception e)\n\t\t{\n\t\t\tJOptionPane.showMessageDialog(null, e);\n\t\t}\n\t}", "int deleteByPrimaryKey(String maht);", "int deleteByPrimaryKey(String goodsId);", "int deleteByPrimaryKey(String bid);", "@Override\n\tpublic void deleteDBDlItemById(long paramLong)\n\t{\n\n\t}", "public void deleteTask(String item){\n SQLiteDatabase db = this.getWritableDatabase();\n db.execSQL(\"DELETE FROM ToDo where task='\"+item+\"'\");\n }", "void checkItemForDelete(Object item, java.sql.Statement stmt) throws PrismsRecordException;", "@Override\n public void removeFromDb() {\n }", "@Override\n\tpublic void delete(Object entidade) {\n\t\t\n\t}", "public boolean deleteItem(int index);", "public void delete(MainItemOrdered mainItemOrdered);", "void delete(Integer id);", "void delete(Integer id);", "@Synchronized\r\n public void deleteTransferModel(String itemId) {\r\n databaseHandler.getWritableDatabase();\r\n databaseHandler.deleteData(\r\n TableTransferModel.TABLE_NAME, TableTransferModel.id + \"=?\",\r\n new String[]{itemId + \"\"}\r\n );\r\n }", "public void delete(RutaPk pk) throws RutaDaoException;", "public void deleteById(int theId);", "void deleteById(int id);", "void delete( Integer id );", "int deleteByPrimaryKey(String objId);", "int deleteByPrimaryKey(String objId);", "public void delete(int id);", "int deleteByPrimaryKey(String guid);", "int deleteByPrimaryKey(String guid);", "private void deleteItem(){\n //Only perform the delete if this is an existing item.\n if(mCurrentItemUri != null){\n //Call the ContentResolver to delete the item at the given content URI.\n //Pass in null for the selection and selection args because the mCurrentItemUri\n //content URI already identifies the item that we want.\n int rowsDeleted = getContentResolver().delete(mCurrentItemUri, null, null);\n\n //Show a toast message depending on weather or not the delete was successful.\n if(rowsDeleted == 0){\n //If no rows were deleted, then there was an error with the delete.\n Toast.makeText(this, \"Error with deleting item\",\n Toast.LENGTH_SHORT).show();\n }else {\n //Otherwise, the delete was successful and we can display a toast\n Toast.makeText(this, \"Item deleted\",\n Toast.LENGTH_LONG).show();\n }\n }\n //Close the activity\n finish();\n }", "void deleteById(Integer id);", "void deleteById(Integer id);", "public void deleteItem(String itemName) throws ToDoListDAOException{\r\n\t\t// TODO Auto-generated method stub\r\n\t\tSession session = factory.openSession();\r\n\r\n\t\t try\r\n\t\t {\r\n\t\t session.beginTransaction();\r\n\t\t Query query = session.createQuery(\"delete from Items where itemName = :itemName\");\r\n\t\t query.setParameter(\"itemName\", itemName);\r\n\t\t int id1= query.executeUpdate();\r\n\t\t if(id1==0)\r\n\t\t {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"The Item Name isn't correct, you didn't delete anything\", \"Error\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t }\r\n\t\t session.getTransaction().commit();\r\n\t\t }\r\n\t\t catch (HibernateException e)\r\n\t\t {\r\n\t\t e.printStackTrace();\r\n\t\t if(session.getTransaction()!=null) session.getTransaction().rollback();\r\n\t\t }\r\n\t\t finally\r\n\t\t {\r\n\t\t\t if(session != null) \r\n\t\t\t\t{ \r\n\t\t\t\t\tsession.close(); \r\n\t\t\t\t}\r\n\t\t } \r\n\t}", "public void delete(Integer id);", "public void delete(Integer id);", "public void delete(Integer id);", "int deleteByPrimaryKey(Integer r_p_i);", "int deleteByPrimaryKey(String questionId);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);", "int deleteByPrimaryKey(String id);" ]
[ "0.7779028", "0.77166045", "0.765294", "0.76124865", "0.7554523", "0.7523493", "0.7496967", "0.7415026", "0.7414885", "0.7331858", "0.7277538", "0.72748405", "0.72707194", "0.72497386", "0.7242219", "0.7198033", "0.7196517", "0.71912163", "0.7188885", "0.7174748", "0.7156807", "0.7155192", "0.71532905", "0.713654", "0.713027", "0.7102737", "0.7102737", "0.709434", "0.708966", "0.7086258", "0.70776176", "0.7072085", "0.70669854", "0.70669854", "0.70569986", "0.70541143", "0.70541143", "0.7045449", "0.70352286", "0.70352286", "0.7026268", "0.701479", "0.701479", "0.701479", "0.70123184", "0.70100135", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545", "0.69893545" ]
0.0
-1
/ update an item from database
public void updateItem(Item item) { addItem(item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Item update(Item item);", "protected void update(T item) {\n\t\tSession session = null;\n\t\ttry {\n\t\t\tsession = mDbHelper.beginTransaction();\n\t\t\tsession.update(item);\n\t\t\tmDbHelper.endTransaction(session);\n\t\t} catch (Exception e) {\n\t\t\tmDbHelper.cancelTransaction(session);\n\t\t\tAppLogger.error(e, \"Failed to execute update\");\n\t\t}\n\t}", "public void update(ItemsPk pk, Items dto) throws ItemsDaoException;", "public abstract int update(T item) throws RepositoryException;", "@Override\n\tpublic boolean update(Item obj) {\n\t\ttry{\n\t\t\tString query=\"UPDATE items SET title = ?, start_date = ?, end_date = ?, type = ? WHERE id = ?\";\n\t\t\tPreparedStatement state = conn.prepareStatement(query,ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n\t\t\tstate.setString(1, obj.getTitle());\n\t\t\tstate.setDate(2, obj.getStartDate());\n\t\t\tstate.setDate(3, obj.getEndDate());\n\t\t\tstate.setInt(4, obj.getItemType().getIndex());\n\t\t\tstate.setInt(5, obj.getIndex());\n\t\t\t\n\t\t\t// Run the query\n\t\t\tstate.executeUpdate();\n\n\t\t\tstate.close();\n\t\t\t\n\t\t\t// Notify the Dispatcher on a suitable channel.\n\t\t\tthis.publish(EntityEnum.ITEM.getValue());\n\t\t\t\n\t\t\treturn true;\n\t\t} catch (SQLException e){\n\t\t\tJOptionPane jop = new JOptionPane();\n\t\t\tjop.showMessageDialog(null, e.getMessage(),\"PostgreSQLItemDao.update -- ERROR!\",JOptionPane.ERROR_MESSAGE);\n\t\t\treturn false;\n\t\t} catch (Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t}", "public void update(Item item) {\r\n Transaction trans = null;\r\n Session session = HibernateUtil.getSessionFactory().openSession();\r\n\r\n try {\r\n trans = session.beginTransaction();\r\n\r\n session.update(item);\r\n\r\n trans.commit();\r\n } catch (HibernateException e) {\r\n if (trans != null) {\r\n trans.rollback();\r\n }\r\n e.printStackTrace();\r\n } finally {\r\n session.close();\r\n }\r\n }", "void updateItem(IDAOSession session, Item item);", "private void updateDB(final Item item) {\n new AsyncTask<Void, Void, Void>() {\n @Override\n protected Void doInBackground(Void... params) {\n TodoApplication.getDbHelper().writeItemToList(item);\n return null;\n }\n }.execute();\n }", "int updateByPrimaryKey(ItemStockDO record);", "int updateByPrimaryKey(ItemStockDO record);", "int updateByPrimaryKey(Sequipment record);", "@Override\r\n\tpublic void updateItem(Items updateItem, String itemNameToUpdate) throws ToDoListDAOException{\r\n\t\t// TODO Auto-generated method stub\r\n\t\t Session session = factory.openSession();\r\n\t\t try\r\n\t\t {\r\n\t\t session.beginTransaction();\r\n\t\t Query query = session.createQuery(\"from Items where userName = :user AND ItemName = :item\");\r\n\t\t query.setParameter(\"user\", updateItem.getUserName());\r\n\t\t Items ifItemExist =(Items) query.setParameter(\"item\", itemNameToUpdate).uniqueResult();\r\n\t\t \r\n\t\t long id=0;\r\n\t\t if(ifItemExist != null){\r\n\t\t \tid = ifItemExist.getId();\r\n\t\t }\r\n\t\t System.out.println(id + \" \" + ifItemExist );\r\n\t\t Query query2 = session.createQuery(\"UPDATE Items SET status = :stat , itemName = :item , userName= :user , priority= :prio , dueDate= :date , note= :note\" +\r\n\t\t \" where id = :d\");\r\n\t\t query2.setParameter(\"stat\", updateItem.getStatus());\r\n\t\t query2.setParameter(\"item\", updateItem.getItemName());\r\n\t\t query2.setParameter(\"user\", updateItem.getUserName());\r\n\t\t query2.setParameter(\"prio\", updateItem.getPriority());\r\n\t\t query2.setParameter(\"date\", updateItem.getDueDate());\r\n\t\t query2.setParameter(\"note\", updateItem.getNote());\r\n\t\t query2.setParameter(\"d\", id);\r\n\t\t query2.executeUpdate();\r\n\t\t session.getTransaction().commit();\r\n\t\t \r\n\t\t }\r\n\t\t catch (HibernateException e)\r\n\t\t {\r\n\t\t e.printStackTrace();\r\n\t\t if(session.getTransaction()!=null) session.getTransaction().rollback();\r\n\t\t }\r\n\t\t finally\r\n\t\t {\r\n\t\t\t if(session != null) \r\n\t\t\t\t{ \r\n\t\t\t\t\tsession.close(); \r\n\t\t\t\t}\r\n\t\t } \r\n\r\n\t}", "@Override\n\tpublic Item update() {\n\t\t\n\t\treadAll();\n\t\n\t\tLOGGER.info(\"State the shoe name you wish to update\");\n\t\tString name = util.getString().toLowerCase();;\n\t\tLOGGER.info(\"State the size you wish to update\");\n\t\tdouble size = util.getDouble();\n\t\tLOGGER.info(\"Change price\");\n\t\tdouble price = util.getDouble();\n\t\tLOGGER.info(\"Change amount in stock\");\n\t\tlong stock = util.getLong();\n\t\tLOGGER.info(\"\\n\");\n\t\treturn itemDAO.update(new Item(name,size,price,stock));\n\t\t\n\t\t\n\t\t\n\t}", "int updateByPrimaryKey(HpItemParamItem record);", "private void updateItem(Item item) throws SQLException\n {\n int itemId = item.getId();\n logger.debug(\"Updating Item with id \" + itemId + \"...\");\n try(Statement statement = connection.createStatement())\n {\n String sql = MessageFormat.format(\"UPDATE Items SET (title, description, price) = ({0}, {1}, {2}) WHERE id = {3}\",\n escapeStringValue(item.getTitle()), escapeStringValue(item.getDescription()), item.getPrice(), itemId);\n statement.addBatch(sql);\n statement.addBatch(\"DELETE FROM Items_Locations WHERE item_id = \" + itemId);\n statement.executeBatch();\n addItemQuantitiesPerLocation(item);\n }\n logger.debug(\"Updated Item successfully.\");\n }", "@Test\n public void updateItem() {\n Item item = new Item();\n item.setName(\"Drill\");\n item.setDescription(\"Power Tool\");\n item.setDaily_rate(new BigDecimal(\"24.99\"));\n item = service.saveItem(item);\n\n // Update the Item in the mock database using the API method\n item.setName(\"Screwdriver\");\n item.setDescription(\"Hand Tool\");\n item.setDaily_rate(new BigDecimal(\"4.99\"));\n service.updateItem(item);\n\n // Test the updateItem() method\n verify(itemDao, times(1)).updateItem(itemArgumentCaptor.getValue());\n TestCase.assertEquals(item, itemArgumentCaptor.getValue());\n }", "@Test\n public void testUpdatePositive() throws Exception{\n Item item = new Item();\n item.setName(\"item\");\n item.setType(ItemTypes.ALCOHOLIC_BEVERAGE);\n itemDao.create(item);\n\n item.setType(ItemTypes.NON_ALCOHOLIC_BEVERAGE);\n itemDao.update(item);\n\n Item itemDB = itemDao.read(item.getName());\n Assert.assertEquals(itemDB, item);\n }", "int updateByPrimaryKey(Forumpost record);", "public int updateItem(ToDoList item) {\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(TITLE, item.getTitle());\n values.put(DETAILS, item.getDetails());\n // updating record\n return db.update(TABLE_NAME, values, KEY_ID + \" = ?\", // update query to make changes to the existing record\n new String[]{String.valueOf(item.getId())});\n }", "int updateByPrimaryKey(BasicEquipment record);", "@Override\n\t@RequestMapping(value=ZuelControllerValue.Manage+\"updateItem\")\n\tpublic ZuelResult updateItem(TbItem item) throws Exception {\n\t\treturn service.updateItem(item);\n\t}", "int update(Purchase purchase) throws SQLException, DAOException;", "E update(E entiry);", "Product updateProductInStore(Product product);", "public int updateOrderItem(OrderItem u) {\n int ok = 0;\n try {\n String query = \"UPDATE order_Item SET amount = ?, product_id_Product = ?, order_id_Order = ? WHERE id_Order_Item = ? ;\";\n\n PreparedStatement st = con.prepareStatement(query); //Prepared the query\n //Select id informated \n List<OrderItem> l = new OrderItemDao().searchOrderItem(u.getIdOrderItem());\n \n for (OrderItem lc : l) {\n st.setInt(4, lc.getIdOrderItem());\n }\n st.setInt(1, u.getAmount());\n st.setInt(2, u.getProductIdProduct());\n st.setInt(3, u.getOrderIdItem());\n\n ok = st.executeUpdate(); //Execute the update\n st.close(); //Close the Statment\n con.close(); //Close the connection\n\n } catch (SQLException e) {\n e.printStackTrace();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return ok;\n }", "public void update(Product item) {\n SQLiteDatabase database = this.getWritableDatabase();\n ContentValues values = new ContentValues();\n values.put(KEY_NAME, item.getName());\n values.put(KEY_URL, item.getURL());\n values.put(KEY_CURRENT, item.getCurrentPrice());\n values.put(KEY_CHANGE, item.getChange());\n values.put(KEY_DATE, item.getDate());\n values.put(KEY_INITIAL, item.getInitialPrice());\n database.update(PRODUCT_TABLE, values, KEY_ID + \" = ?\", new String[]{String.valueOf(item.getId())});\n database.close();\n }", "public void editItemInfo() throws SQLException {\n\t\tConnection con = openDBConnection();\n\t\tString queryString = \"Update team1.GABES_ITEM Set ITEM_CATEGORY=?, DESCRIPTION=?, ITEM_NAME=?\";\n\t\tqueryString += \"Where ITEM_ID='\" + this.item_id + \"'\";\n\t\t/** Clears parameters and then sets new values */\n\t\tPreparedStatement p_stmt = con.prepareCall(queryString);\n\t\t/** Set new attribute values */\n\t\tp_stmt.clearParameters();\n\t\tp_stmt.setString(1, this.item_category);\n\t\tp_stmt.setString(2, this.description);\n\t\tp_stmt.setString(3, this.item_name);\n\t\t/* Executes the Prepared Statement query */\n\t\tp_stmt.executeQuery();\n\t\tp_stmt.close();\n\t}", "public int updateItem(Item item) {\n SQLiteDatabase db = DataBaseManager.getInstance().openDatabase();\n Log.d(\"ItemDbAdapter\", \"Update item: \" + item.getName() + \" \" + item.getId());\n ContentValues values = new ContentValues();\n values.put(KEY_NAME, item.getName());\n values.put(KEY_ARRAY_ID, item.getArrayId());\n values.put(KEY_DESCRIPTION, item.getDescription());\n\n int rowcount = db.update(TABLE_ITEMS, values, KEY_ID + \" = ?\",\n new String[]{String.valueOf(item.getId())});\n DataBaseManager.getInstance().closeDatabase();\n // updating row\n return rowcount;\n }", "int updateByPrimaryKey(Goods record);", "int updateByPrimaryKey(Goods record);", "int updateByPrimaryKey(ItemCategory record);", "int updateByPrimaryKey(TempletLink record);", "int updateByPrimaryKey(Commet record);", "public void updateEntity();", "int updateByPrimaryKey(GoodsPo record);", "E update(E entity);", "E update(E entity);", "int updateByPrimaryKey(Product record);", "int updateByPrimaryKey(Prueba record);", "int updateByPrimaryKey(GirlInfo record);", "int updateByPrimaryKey(Shareholder record);", "int updateByPrimaryKey(CartDO record);", "public void UpdateItem(View view) {\n /*update a friend record given the id*/\n updateFriend(friendsDatabaseReference);\n /*the alternative*/\n// updateFriend_updateChildren(friendsDatabaseReference);\n }", "int updateByPrimaryKey(ItoProduct record);", "public static int updateItem(item item1) {\n try {\n PreparedStatement st = conn.prepareStatement(\"UPDATE iteminformation SET Name=?, description=?, category=?,image1=?,image2=?,image3=?,image4=? where itemID=?\");\n st.setString(1, item1.getName());\n st.setString(2, item1.getDescription());\n st.setString(3, item1.getCategory());\n st.setBlob(4, item1.getImage1());\n st.setBlob(5, item1.getImage2());\n st.setBlob(6, item1.getImage3());\n st.setBlob(7, item1.getImage4());\n st.setInt(8, item1.getItemID());\n int count = st.executeUpdate();\n if (count > 0) {\n return count;\n }\n } catch (SQLException ex) {\n Logger.getLogger(itemDAO.class.getName()).log(Level.SEVERE, null, ex);\n }\n return 36;\n }", "void updateOfProductById(long id);", "int updateByPrimaryKey(Tourst record);", "int updateByPrimaryKey(Dish record);", "int updateByPrimaryKey(Body record);", "public CompletionStage<Result> updateItem(Long id) {\n MessageDispatcher jdbcDispatcher = AkkaDispatcher.jdbcDispatcher;\n\n JsonNode nItem = request().body().asJson();\n ItemEntity item = Json.fromJson( nItem , ItemEntity.class ) ;\n ItemEntity itemViejo = ItemEntity.FINDER.byId(id);\n return CompletableFuture.supplyAsync(\n ()->{\n if(itemViejo == null)\n {\n return itemViejo;\n }else\n { item.setId(id);\n item.update();\n return item;\n }\n }\n ).thenApply(\n itemEntity -> {\n if(itemEntity == null)\n {\n return notFound();\n }else\n {\n return ok(Json.toJson(itemEntity));\n }\n }\n\n );\n }", "int updateByPrimaryKey(EquipmentOrder record);", "int updateByPrimaryKey(SrmFundItem record);", "public int updateById(EvaluetingListDO evaluetingList) throws DataAccessException;", "@Override\n @Transactional\n public void update(Item item) {\n Produto produto = item.getProduto();\n produtoDao.updateEstoqueProduto(produto.getQuantidade() - item.getQuantidade(), produto.getId());\n }", "@PutMapping(\"/items/{item_id}\")\n\tpublic ResponseEntity<Item> updateItem(@PathVariable(value=\"item_id\") Long item_id, @Valid @RequestBody Item itemDetails){ \n\t\tItem item = itemDAO.findOne(item_id);\n\t\tif(item == null) {\n\t\t\treturn ResponseEntity.notFound().build();\n\t\t}\n\t\titem.setItem_id(itemDetails.getItem_id());\n\t\titem.setItem_name(itemDetails.getItem_name());\n\t\titem.setItem_discription(itemDetails.getItem_discription());\n\t\titem.setCategory(itemDetails.getCategory());\n\t\titem.setPrice(itemDetails.getPrice());\n\t\t\n\t\tItem upItem = itemDAO.save(item);\n\t\t\n\t\treturn ResponseEntity.ok().body(upItem);\n\t\t\n\t}", "int updateByPrimaryKey(TbComEqpModel record);", "int updateByPrimaryKey(ProductPricelistEntity record);", "public CbmCItemFininceItem update(CbmCItemFininceItem entity);", "int updateByPrimaryKey(QuestionOne record);", "void update( ExperimentDTO item );", "int updateByPrimaryKey(IceApp record);", "public void update(IEntity entity) throws SQLException;", "int updateByPrimaryKey(SupplyNeed record);", "int updateByPrimaryKey(Disproduct record);", "int updateByPrimaryKey(Resource record);", "int updateByPrimaryKey(Yqbd record);", "int updateByPrimaryKey(AccessModelEntity record);", "private void updateDB() {\n }", "int updateByPrimaryKey(MenuInfo record);", "int updateByPrimaryKey(SelectUserRecruit record);", "int updateByPrimaryKey(WxNews 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}", "int updateByPrimaryKey(UserPonumberGoods record);", "int updateByPrimaryKey(LitemallUserFormid record);", "void update ( priorizedListObject v ) throws DAOException;", "int updateByPrimaryKey(Dormitory record);", "int updateByPrimaryKey(Tour record);", "int updateByPrimaryKey(JzAct record);", "int updateByPrimaryKey(Storage record);", "int updateByPrimaryKey(Storage record);", "@Override\n\t\tpublic void updateRawitem(Rawitem Rawitem) {\n\t\t\tString sql=\"UPDATE Rawitem \"\n\t\t\t\t\t+ \"set suppliedby= :suppliedby,rquantity=:rquantity,riprice=:riprice,rstock=:rstock\"\n\t\t\t\t\t+ \" where rid=:rid\";\n\t\t\tnamedParameterJdbcTemplate.update(sql,getSqlParameterByModel(Rawitem));\n\t\t\t \n\t\t}", "int updateByPrimaryKey(BookInfo record);", "int updateByPrimaryKey(Massage record);", "int updateByPrimaryKey(Question record);", "int updateByPrimaryKey(Question record);", "int updateByPrimaryKey(Question record);", "int updateByPrimaryKey(Question record);", "int updateByPrimaryKey(Question record);", "int updateByPrimaryKey(DashboardGoods record);", "int updateByPrimaryKey(UserGift record);", "int updateByPrimaryKey(Cargo record);", "public void updateDb(View view) {\n String productName = getIntent().getStringExtra(\"product\");\n Product p = db.getProductByName(productName);\n p.setName(name.getText().toString());\n p.setAvail(availSpinner.getSelectedItem().toString());\n p.setDescription(desc.getText().toString());\n p.setPrice(new BigDecimal(price.getText().toString()));\n p.setWeight(Double.parseDouble(weight.getText().toString()));\n db.updateProduct(p);\n finish();\n }", "int updateByPrimaryKey(Access record);", "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(Object entidade) {\n\t\t\n\t}", "int updateByPrimaryKey(BnesBrowsingHis record) throws SQLException;", "void updateEntry(BlogEntry entry) throws DAOException;", "int updateByPrimaryKey(ExamRoom record);", "int updateByPrimaryKey(Model record);", "int updateByPrimaryKey(Ltsprojectpo record);", "int updateByPrimaryKey(BookDO record);" ]
[ "0.78995985", "0.76026505", "0.7378573", "0.7370288", "0.7342458", "0.73356533", "0.7305846", "0.7265509", "0.7184373", "0.7184373", "0.71804607", "0.6993685", "0.6963715", "0.6962463", "0.6937777", "0.6932294", "0.6930837", "0.69272614", "0.6919388", "0.69093996", "0.6905854", "0.690308", "0.68823165", "0.68805104", "0.6857215", "0.6855987", "0.6852244", "0.6850381", "0.68494", "0.68494", "0.68487173", "0.68485373", "0.6842634", "0.6836334", "0.6835123", "0.68345153", "0.68345153", "0.6833886", "0.68325347", "0.6831355", "0.682038", "0.6811788", "0.6808795", "0.68049157", "0.68009", "0.67909145", "0.6779486", "0.6778463", "0.6774431", "0.6773104", "0.6762692", "0.6754393", "0.67506224", "0.675016", "0.67368567", "0.6713952", "0.67057395", "0.6703541", "0.6703312", "0.67017144", "0.6692841", "0.6688926", "0.6688713", "0.6688366", "0.6687083", "0.66821605", "0.66793317", "0.6678602", "0.66720724", "0.66720283", "0.66704255", "0.6666955", "0.66663444", "0.66656303", "0.6665017", "0.66592854", "0.6657712", "0.66564184", "0.66507804", "0.66507804", "0.6650446", "0.6649615", "0.66491026", "0.6646265", "0.6646265", "0.6646265", "0.6646265", "0.6646265", "0.6645618", "0.6640447", "0.6638452", "0.66314584", "0.662934", "0.66289085", "0.66288376", "0.66251236", "0.6623705", "0.6622324", "0.661948", "0.6603511", "0.6601688" ]
0.0
-1
creates an instance of a deck of playing cards
public void createDeck() { // for loop that repeats 4 times - one for each suit for (String suit : suits) { // for loop that repeats 13 times (2-14) - once for each value for (int i = 2; i < 15; i++) { //create instance of new card createCard(value, name); Card card = new Card(i, suit); //add card to deck array addCardToDeck(card); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DeckOfCards() {\n\n String faces[] = {\"Ace\", \"Deuce\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\", \"Ten\", \"Jack\", \"Queen\", \"King\"};\n String suits[] = {\"Hearts\", \"Diamonds\", \"Clubs\", \"Spades\"};\n\n deck = new Card[NUMBER_OF_CARDS]; //create an array of card objects (52)\n currentCard = 0;\n randomNumbers = new Random();\n\n //Populate deck with card objects\n for(int count = 0; count < deck.length; count++){\n deck[count] = new Card(faces[count % 13], suits[count / 13]);\n //first 13 cards will be ace through king of hearts then ace though king of diamonds etc...\n\n }\n\n }", "public Deck() {\n cards = new Card[52];\n size = 0;\n for (int suit = Card.SPADES; suit <= Card.CLUBS; suit++) {\n for (int rank = Card.ACE; rank <= Card.KING; rank++) {\n cards[size] = new Card(rank, suit);\n size += 1;\n }\n }\n }", "public Deck() {\n generateDeckOfCards();\n }", "public Deck(){\n\t\tcount = 51;\n\t\tcards = new Card[52];\n\t\trand = new Random();\n\t\tfor(Suit suit : Suit.values()){\n\t\t\tfor (int i = 2; i < 15; i++) {\n\t\t\t\tcards[suit.ordinal()*13 + i - 2] = new Card(suit,i);\n\t\t\t}\n\t\t}\n\t}", "public void makeDeck()\r\n\t{\r\n\t\tfor (int i = 1; i < 5; i++)\r\n\t\t{\r\n\t\t\tfor (int j = 2; j < 15; j++)\r\n\t\t\t{\r\n\t\t\t\tdeck.add(new Card(i,j));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public Deck( ) {\r\n int ordinal;\r\n alalSets = new ArrayList<>();\r\n \r\n // load the cards\r\n for ( ordinal = 1; ordinal <= 13; ordinal++) {\r\n for( int iCount = 1; iCount <= 4; iCount++) {\r\n // the deck adds one set which contains one card\r\n \r\n ArrayList<Card> redCardSet = new ArrayList<>();\r\n Card redCard = new Card();\r\n redCard.value = ordinal;\r\n redCard.color = Enums.RED;\r\n redCardSet.add(redCard); // add card to set\r\n alalSets.add( redCardSet ); // add set to deck\r\n\r\n ArrayList<Card> blackCardSet = new ArrayList<>();\r\n Card blackCard = new Card();\r\n blackCard.value = ordinal;\r\n blackCard.color = Enums.BLACK;\r\n blackCardSet.add(blackCard);\r\n alalSets.add( blackCardSet );\r\n }\r\n }\r\n }", "private List<Card> setupDeck(){\n List<Card> llist = new LinkedList<Card>();\n String[] faceCards = {\"J\",\"Q\",\"K\",\"A\"};\n String[] suits = {\"spades\",\"clubs\",\"diamonds\",\"hearts\"};\n\n for(int i=2; i<=10; i++){\n for(int j=1; j<=4; j++){\n llist.add(new Card(Integer.toString(i), suits[j-1], j, i));\n }\n }\n for(int k=1; k<=4; k++){\n for(int l=1; l<=4; l++){\n llist.add(new Card(faceCards[k-1],suits[l-1], l, k+10));\n }\n }\n return llist;\n }", "public Deck() { // This constructor creates a standard deck\n\n\tcards = new Card[52];\n\tint k=0;\n\t\n\tfor (int i=0; i<4; i++)\n\t for (int j=2; j<15; j++){\n\t\tcards[k]= new Card (j, i);\n\t\tk++;\n\t\t }\n\t \n\n\tshuffle();\n\t\n\tcardsLeft = 52;\n\t/*\tfor (int i=0; i<52; i++)\n\t\tSystem.out.println (cards[i]);*/\n }", "public Deck(){\n\t\tcards = new ArrayList<>(deckSize);\n\t\tdeck = new int[deckSize];\n\t}", "private Pile createDeck() {\n \t\tPile deck = new Pile(\"deck\"); // TODO Refactor, no hardcoded string\n\t\tpileNames.add(\"deck\");\n \t\tfor (Suit suit : Suit.values()) {\n \t\t\tfor (Rank rank : Rank.values()) {\n \t\t\t\tdeck.addCard(new Card(suit, rank));\n \t\t\t}\n \t\t}\n \t\t// Put the deck at the middle of the table\n \t\tmTable.set(MID_OF_TABLE, deck);\n \t\treturn deck;\n \t}", "public void generateDeck() {\n\t\tList<String> valueList = Arrays.asList(\"Ace\", \"2\", \"3\",\"4\", \"5\", \"6\",\"7\", \"8\", \"9\",\"10\", \"Jack\", \"Queen\",\"King\");\n\t\tList<String> suitList = Arrays.asList(\"Diamonds\", \"Spades\", \"Clubs\", \"Hearts\");\n\t\tvalues.addAll(valueList);\n\t\tsuits.addAll(suitList);\n\t\t\n\t\t//adding card objects to deckOfCards arraylist\n\t\tint i = 1;\n\t\twhile(i<=52){\n Card card = new Card(values.get(random.nextInt(13)), suits.get(random.nextInt(4)));\n if (!deckOfCards.contains(card)) {\n deckOfCards.add(card);\n i++;\n }else{\n\n }\n }\n\t}", "public Deck() {\n deck = new ArrayList<>();\n for (Color d : Color.values()) {\n for (Value e : Value.values()) {\n Card c = new Card(d, e);\n deck.add(c);\n }\n }\n }", "public Deck() {\n deck = new LinkedList<>();\n for (int i = 1; i < FACE_VALUES + 1; i++) {\n deck.add(new Card(i, SPADES));\n deck.add(new Card(i, CLUB));\n deck.add(new Card(i, DIAMOND));\n deck.add(new Card(i, HEART));\n }\n }", "private void generateDeckOfCards() {\n this.cards = new ArrayList<Card>(Suit.values().length * Rank.values().length);\n for (Suit suit : Suit.values()) {\n for (Rank rank : Rank.values()) {\n cards.add(new Card(suit, rank));\n }\n }\n }", "@Override\n public void createDeck(){\n for (char suit:standardSuits) {\n for (Map.Entry<Character, Integer> item:deckCards.entrySet()) {\n Card card = new Card(item.getKey(),item.getValue(),suit);\n deckOfCards.add(card);\n }\n }\n }", "public Deck()\r\n\t{\r\n\t\tcards = new String[DECK_SIZE];\r\n\t\t\r\n\t\tnewDeck();\r\n\t}", "public Deck () {\r\n int arrayPlace = 51;\r\n cardDeck = new Card [52];\r\n String [] suits = {\"Clubs\", \"Diamonds\", \"Hearts\", \"Spades\"};\r\n for (int index = 0; index < suits.length; index++) {\r\n for (int i = 1; i < 14; i++) {\r\n cardDeck [arrayPlace] = new Card (i, suits[index]);\r\n arrayPlace--;\r\n }\r\n }\r\n }", "public Deck() {\n this.cards = new Card[STANDARD_DECK_SIZE];\n this.topCardIndex = 0;\n int cardIndex = 0;\n int DeckLength = this.cards.length;\n for (Card.Suit suit : Card.Suit.values() ) {\n for (int i = Card.ACE ; i <= Card.KING ; i++ ) {\n cards[cardIndex] = new Card (i, suit);\n cardIndex++;\n }\n }\n }", "public void createDecks(){\r\n\t\tfor (int j = 10; j < 20; j++){\r\n\t\t\taddCard(new Card(cardNames[j]));\r\n\t\t}\r\n\t}", "public Deck() {\n System.out.println(\"Inside deck\");\n cards = new ArrayList<>();\n fillDeck();\n }", "public void createDeck(){\n //Does nothing because it will be overridden in the child classes.\n }", "public Game() {\n //Create the deck of cards\n cards = new Card[52 * numDecks];\n cards = initialize(cards, numDecks);\n cards = shuffleDeck(cards, numDecks);\n }", "public Deck makeComputerDeck()\r\n\t{\r\n\t\tDeck computer = new Deck();\r\n\r\n \tfor (int i = 0; i < (DECK_COUNT/2); i++)\r\n \t{\r\n \t computer.addToDeck(deck.remove(0));\r\n \t}\r\n\r\n\t\treturn computer;\r\n\t}", "private List<Card> createDeck(){\n List<Card> newDeck= new ArrayList<Card>();\n for (int i =0;i<CardSet.ALL_CARDS.size(); ++i ) {\n newDeck.add(CardSet.ALL_CARDS.get(i));\n }\n return newDeck;\n }", "public Deck()\n {\n deck = new Stack<Card>();\n /* Increments through each suit, and then for each suit through each rank,\n * and pushes a\n * new card with the corresponding information onto the deck.\n */\n /* The above comment did not show up in the checkstyle. */\n for (Suit suit : Suit.values())\n {\n /* Increments through each card value. */\n for (CardValue value : CardValue.values())\n {\n deck.push(new Card(suit, value));\n }\n }\n Collections.shuffle(deck);\n }", "public Deck() {\n\t\trand = new Random();\n\t\trand.setSeed(System.currentTimeMillis());\n\t\twhile(deck.size()<52){\n\t\t\tint suit = rand.nextInt(4);\n\t\t\tint rank = rand.nextInt(13);\n\t\t\tString card = this.rank[rank] +\" of \" + this.suit[suit];\n\t\t\tdeck.add(card);\n\t\t}\n\t}", "public Deck()\n {\n deck = new ArrayList<>();\n }", "private Deck()\n\t{\n\t\tfor (Suit s : Suit.values())\n\t\t\tfor(Rank r : Rank.values())\n\t\t\t\tcards.add(new Card(s,r));\n\t}", "public Deck() {\n this.deck = new LinkedList<>();\n }", "void makeDeck() {\n\t\t// start with an array of 1..28 for easy shuffling\n\t\tint[] cardValues = new int[28];\n\t\t// assign values from 1 to 28\n\t\tfor (int i=0; i < cardValues.length; i++) {\n\t\t\tcardValues[i] = i+1;\n\t\t}\n\n\t\t// shuffle the cards\n\t\tRandom randgen = new Random();\n\t\tfor (int i = 0; i < cardValues.length; i++) {\n\t\t\tint other = randgen.nextInt(28);\n\t\t\tint temp = cardValues[i];\n\t\t\tcardValues[i] = cardValues[other];\n\t\t\tcardValues[other] = temp;\n\t\t}\n\n\t\t// create a circular linked list from this deck and make deckRear point to its last node\n\t\tCardNode cn = new CardNode();\n\t\tcn.cardValue = cardValues[0];\n\t\tcn.next = cn;\n\t\tdeckRear = cn;\n\t\tfor (int i=1; i < cardValues.length; i++) {\n\t\t\tcn = new CardNode();\n\t\t\tcn.cardValue = cardValues[i];\n\t\t\tcn.next = deckRear.next;\n\t\t\tdeckRear.next = cn;\n\t\t\tdeckRear = cn;\n\t\t}\n\t}", "public void buildDeck () {\n this.deck = new ArrayList();\n for (ValueType value: ValueType.values()) {\n for(SuitType suit: SuitType.values()) {\n deck.add(new Card(value, suit));\n }\n }\n shuffleDeck();\n }", "private void buildDeck() {\r\n //Initialise size of deck and number of cards \r\n this.numOfCards = FIFTYTWO;\r\n //create new Deck Array \r\n this.deck = new ICard[this.numOfCards];\r\n //Creates Deck deck \r\n createDeck(Suit.values(), Rank.values());\r\n //shuffles deck \r\n shuffleCards(deck);\r\n\r\n }", "public static Stack<int[]> createDeck() {\n\t\t// Populate deck with 4 suits, 13 cards each [RANK, SUIT]\n\t\tStack<int[]> deck = new Stack<int[]>();\n\t\tfor (int j = HEARTS; j <= SPADES; j++) {\n\t\t\tfor (int i = 1; i <= 13; i++) {\n\t\t\t\tint[] card = new int[] {i, j};\n\t\t\t\tdeck.push(card);\n\t\t\t}\n\t\t}\n\t\tCollections.shuffle(deck);\n\t\treturn deck;\n\t}", "@Override\r\n public List<Card> getDeck() {\n myDeck2.clear();\r\n\r\n //loops through twice in order to create the deck of 104\r\n for (int k = 0; k < 2; k++) {\r\n for (int i = 0; i < 4; i++) {\r\n for (int j = 1; j <= 13; j++) {\r\n Card nextCard = new Card(suit[i], j);\r\n myDeck2.add(nextCard);\r\n }\r\n }\r\n }\r\n\r\n return myDeck2;\r\n }", "public static Group newDeck() {\n\t\tGroup g = new Group();\n\t\tfor (Suit s : Suit.values()) {\n\t\t\tfor (Rank r : Rank.values()) {\n\t\t\t\tCard c = new Card(r,s);\n\t\t\t\tg.add(c);\n\t\t\t}\n\t\t}\n\t\treturn g;\n\t}", "public stdDeck(){\n super();\n for(int i=1; i<14; i++){\n stdCard card = new stdCard(Suit.CLUBS, i);\n deck.add(card);\n card = new stdCard(Suit.DIAMONDS, i);\n deck.add(card);\n card = new stdCard(Suit.HEARTS, i);\n deck.add(card);\n card = new stdCard(Suit.SPADES, i);\n deck.add(card);\n }\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 }", "private void makeCards() {\n //make number cards(76 cards)\n for (int i = 0; i < 10; i++) {\n String s = i + \"\";\n cards.add(new NumberCard(s, Color.RED, i));\n cards.add(new NumberCard(s, Color.GREEN, i));\n cards.add(new NumberCard(s, Color.BLUE, i));\n cards.add(new NumberCard(s, Color.YELLOW, i));\n if(i > 0) {\n cards.add(new NumberCard(s, Color.RED, i));\n cards.add(new NumberCard(s, Color.GREEN, i));\n cards.add(new NumberCard(s, Color.BLUE, i));\n cards.add(new NumberCard(s, Color.YELLOW, i));\n }\n }\n\n //make wild cards(8 cards)⨁\n for (int i = 0; i < 4; i++) {\n cards.add(new WildCard(\"W\", Color.BLACK));\n cards.add(new WildDrawCard(\"W+4\", Color.BLACK));\n }\n\n //make reverse cards(8 cards)⤤⤦\n for (int i = 0; i < 2; i++) {\n cards.add(new ReverseCard(\"Rev\", Color.RED));\n cards.add(new ReverseCard(\"Rev\", Color.GREEN));\n cards.add(new ReverseCard(\"Rev\", Color.BLUE));\n cards.add(new ReverseCard(\"Rev\", Color.YELLOW));\n }\n\n //make draw cards(8 cards)⧉\n for (int i = 0; i < 2; i++) {\n cards.add(new Draw2Card(\"D+2\", Color.RED));\n cards.add(new Draw2Card(\"D+2\", Color.GREEN));\n cards.add(new Draw2Card(\"D+2\", Color.BLUE));\n cards.add(new Draw2Card(\"D+2\", Color.YELLOW));\n }\n\n //make skip cards(8 cards)🚫\n for (int i = 0; i < 2; i++) {\n cards.add(new SkipCard(\"Ski\", Color.RED));\n cards.add(new SkipCard(\"Ski\", Color.GREEN));\n cards.add(new SkipCard(\"Ski\", Color.BLUE));\n cards.add(new SkipCard(\"Ski\", Color.YELLOW));\n }\n //Shuffling cards list\n Collections.shuffle(cards);\n }", "public void createFullDeck(){\n for(Suit cardSuit: Suit.values()){\n //iterating over all the values\n for(Value cardValue: Value.values()){\n cards.add(new Card(cardSuit,cardValue));\n }\n }\n }", "public SpoonsDeck() {\r\n\t deck = new ArrayList<SpoonsCard>();\r\n\t int cardCt = 0; // How many cards have been created so far.\r\n\t for ( int suit = 0; suit <= 3; suit++ ) {\r\n\t for ( int value = 2; value <= 14; value++ ) {\r\n\t \t deck.add(cardCt, new SpoonsCard(value,suit)); \r\n\t \t cardCt++;\r\n\t }\r\n\t \r\n\t }\r\n\t cardsUsed = 0;\r\n }", "public Deck( Card c1, Card c2, Card c3, Card c4, Card c5, Card c6, Card c7, Card c8, Card c9,\n\t\t\t\t Card c10, Card c11, Card c12, Card c13, Card c14, Card c15, Card c16, Card c17, Card c18,\n\t\t\t\t Card c19, Card c20, Card c21, Card c22, Card c23, Card c24, Card c25, Card c26, Card c27, \n\t\t\t\t Card c28, Card c29, Card c30, Card c31, Card c32, Card c33, Card c34, Card c35, Card c36, \n\t\t\t\t Card c37, Card c38, Card c39, Card c40, Card c41, Card c42, Card c43, Card c44, Card c45, \n\t\t\t\t Card c46, Card c47, Card c48, Card c49, Card c50, Card c51, Card c52 ) \n\t{\n\t\tCard[] tempDeck = { c1, c2, c3, c4, c5, c6, c7, c8, c9,\n\t\t\t\t\t\t\tc10, c11, c12, c13, c14, c15, c16, c17, c18,\n\t\t\t\t\t\t\tc19, c20, c21, c22, c23, c24, c25, c26, c27,\n\t\t\t\t\t\t\tc28, c29, c30, c31, c32, c33, c34, c35, c36, c37,\n\t\t\t\t\t\t\tc38, c39, c40, c41, c42, c43, c44, c45, c46, \n\t\t\t\t\t\t\tc47, c48, c49, c50, c51, c52 };\n\t\t\n\t\tdeck = new Card[tempDeck.length];\n\t\t\n\t\tfor( int i = 0; i < tempDeck.length; i++ ) {\n\t\t\tdeck[i] = tempDeck[i];\n\t\t}\n\t}", "public Deck()\n\t{\n\t\t//call other Constructor defining one deck with out shuffling\n\t\tthis(false);\n\t}", "public Deck(boolean shuffle) {\n\t\t//52 cards\n\t\tthis.cardNumber = 52;\n\t\t//Total slots of 52 ARRAY\n\t\tthis.card = new Card[this.cardNumber];\n\t\t\n\t\t//location of the card\n\t\tint cardLocation= 0;\n\t\t\n\t\t// each suit\n\t\tfor(int suit = 0; suit < 4; suit++)\n\t\t{\n\t\t\t//each number in the deck\n\t\t\tfor(int num = 1; num <=13; num++)\n\t\t\t{\n\t\t\t\t// add a new card to the deck \n\t\t\t\tthis.card[cardLocation] = new Card(Suit.values()[suit],num);\n\t\t\t\tcardLocation++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Shuffling done\n\t\tif(shuffle == true)\n\t\t{\n\t\t\tthis.shuffle();\n\t\t}\n\t}", "public void buildCards(){\n\t\tfor(Suit suit: Suit.values()){\n\t\t\tfor(Face face: Face.values()){\n\t\t\t\tcards.add(new Card(face, suit));\n\t\t\t}\n\t\t}\n\t}", "public CardGame( int handSize, int copiesPerDeck ){\n this.handOne = new Hand(handSize);\n this.handTwo = new Hand(handSize);\n this.gameDeck = new Deck(copiesPerDeck);\n this.playerScore = 0;\n this.oppoScore = 0;\n }", "void fillDeck()\n\t{\n\t\t\n\t\tfor ( byte decks = 0 ; decks < howManyDecks ; decks++ )\n\t\t\tfor ( byte suit = 0 ; suit < 4 ; suit++ )\n\t\t\t\tfor ( byte value = 1 ; value < 14 ; value++ ) \n\t\t\t\t\tdeck.add ( new Card (value , suit , true) );\n\t}", "private void fillDeck(){\r\n this.cards = new ArrayList<Card>();\r\n int cardPerSuit = this.deckSize/4;\r\n \r\n for( Suit Su: suits ){\r\n for(int i = 0; i < cardPerSuit; i++){\r\n this.cards.add(i, new Card(i+2, Su.ordinal()));\r\n }\r\n }\r\n \r\n }", "public Game() {\r\n\t\tcards = new ArrayList<Card>();\r\n\t\tfor (int i = 0; i < NBCARDS; i++) {\r\n\t\t\tcards.add(new Card());\r\n\t\t}\r\n\t\tplayers = new ArrayList<Player>();\r\n\t\tfor (int i = 0; i < NBPLAYER; i++) {\r\n\t\t\tplayers.add(new Player(i + 1));\r\n\t\t}\r\n\t}", "public Deck( int copiesPerCard ) {\n if (copiesPerCard <= 0) {\n throw new IllegalArgumentException();\n }\n this.cards = new Card[STANDARD_DECK_SIZE * copiesPerCard];\n this.topCardIndex = 0;\n int DeckLength = this.cards.length;\n int cardIndex = 0;\n for (int copy = 1; copy <= copiesPerCard ; copy++ ) {\n for (Card.Suit suit : Card.Suit.values() ) {\n for (int i = Card.ACE ; i <= Card.KING ; i++ ) {\n cards[cardIndex] = new Card (i, suit);\n cardIndex++;\n }\n }\n }\n }", "public void startGame() {\n this.deck = new Deck();\n this.deck.shuffle(); //shuffle the deck\n Card card = this.deck.deal(this.getPlayerHand());\n card = this.deck.deal(this.getPlayerHand());\n card = this.deck.deal(this.getDealerHand());\n }", "public Deck(String name){\r\n\t\tthis(name, new ArrayList<Card>());\r\n\t}", "private void initializeDeck() {\r\n deck = new ArrayList<>(52);\r\n\r\n for (String suit : SUITS) {\r\n for (String rank : RANKS) {\r\n deck.add(new Card(rank, suit)); // adds 52 cards to the deck (13 ranks, 4 suits)\r\n }\r\n }\r\n }", "private void initializeDeck() {\n drawPile.clear();\n\n for (ICard.Color color : ICard.Color.values()) {\n // Numbered cards\n drawPile.add(new NumberedCard(color, 0));\n for (int value = 1; value < 10; value++) {\n drawPile.add(new NumberedCard(color, value));\n drawPile.add(new NumberedCard(color, value));\n }\n\n // Special cards\n drawPile.add(new SkipCard(color));\n drawPile.add(new SkipCard(color));\n\n drawPile.add(new ReverseCard(color));\n drawPile.add(new ReverseCard(color));\n\n drawPile.add(new DrawTwoCard(color));\n drawPile.add(new DrawTwoCard(color));\n }\n\n for (int i = 0; i < 4; i++) {\n drawPile.add(new WildCard());\n drawPile.add(new WildFourCard());\n }\n }", "public Deck(int numDecks) {\n\t\t// Loop through number of decks, suits, and rank\n\t\tfor (int k = 0; k<numDecks; k++) {\n\t\t\tfor (int i = 1; i <= 4; i++) {\n\t\t\t\tfor (int j = 1; j <= 13; j++) {\n\t\t\t\t\t// Add Card object to linked list\n\t\t\t\t\tdeck.add(new Card(i,j));\n\t\t\t\t\tsize++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void initialise()\r\n {\n Deck d = new Deck();\r\n d.shuffle();\r\n //Deal cards to players\r\n Iterator<Card> it = d.iterator();\r\n int count = 0;\r\n while (it.hasNext())\r\n {\r\n players[count % nosPlayers].addCard(it.next());\r\n it.remove();\r\n ++count;\r\n }\r\n //Initialise Discards\r\n discards = new Hand();\r\n //Chose first player\r\n currentPlayer = 0;\r\n currentBid = new Bid();\r\n currentBid.setRank(Card.Rank.TWO);\r\n }", "public void initChestDeck() {\n\t\tchestDeck = new Deck();\n\t\tfor (int i = 0; i < 16; i++) {\n\t\t\tchestDeck.addCard(new Card(i + 16));\n\t\t}\n\t\t//makes cards random\n\t\tchestDeck.shuffle();\n\t}", "public Card(){\n suit = 0;\n rank = 0;\n }", "public Deck() {\n cards = new LinkedList<Integer>();\n removedCards = new LinkedList<Integer>();\n \n int i, j;\n for (i = MIN_VALUE; i <= MAX_VALUE; i++) {\n for (j = 0; j <= NUM_SUITS; j++) {\n cards.add(i);\n }\n }\n }", "public CardGame(){\n this.handOne = new Hand();\n this.handTwo = new Hand();\n this.gameDeck = new Deck();\n this.playerScore = 0;\n this.oppoScore = 0;\n }", "public poker_class ()\n\t{\n\t face = \"Two\";\n\t suit = \"Clubs\";\n\t}", "private void buildDeck(int numDecks) {\n for (int i = 0; i < numDecks; ++i) {\n for (int j = 1; j < 14; ++j) {\n deck.add(new Card(j, Suit.Clubs));\n deck.add(new Card(j, Suit.Hearts));\n deck.add(new Card(j, Suit.Diamonds));\n deck.add(new Card(j, Suit.Spades));\n }\n }\n }", "@Test\n public void create() {\n Deck deck = new DeckImplementation();\n assertEquals(\"Wrong initial deck size!\", 180,\n deck.numberOfCardsRemaining());\n deck.drawACard();\n assertEquals(\"Wrong size deck after draw!\", 179,\n deck.numberOfCardsRemaining());\n }", "public void populateDeck(){\n\n //Add everything to r\n for(int i=0;i<LUMBER;i++){\n deck.add(new ResourceCard(container, Resource.WOOD, cardStartPoint));\n }\n\n for(int i=0;i<WOOL;i++){\n deck.add(new ResourceCard(container, Resource.WOOL, cardStartPoint));\n }\n\n for(int i=0;i<GRAIN;i++){\n deck.add(new ResourceCard(container, Resource.WHEAT, cardStartPoint));\n }\n\n for(int i=0;i<BRICK;i++){\n deck.add(new ResourceCard(container, Resource.BRICKS, cardStartPoint));\n }\n\n for(int i=0;i<ORE;i++){\n deck.add(new ResourceCard(container, Resource.ORE, cardStartPoint));\n }\n //Collections.shuffle(deck);\n\n }", "public Deck(ArrayList<Card> deck)\n {\n this.deck = deck;\n }", "public void buildDeck(){\n\t\tfor(int i = 0; i < deckSize; i++){\n\t\t\tdeck[i] = i;\n\t\t}\n\t}", "public BlackjackHand() {\n super(0);\n aceCount = 0;\n cards = new ArrayList<>();\n }", "private ArrayList<Card> getDeckCards(){\n\t\t\t\tArrayList<Card> getdeck = new ArrayList<>();\r\n\t\t\t\t// deck = new ArrayList(52);\r\n\r\n\t\t\t\t// create cards in the deck (0-51)\r\n\t\t\t\tfor (int i = 0; i <= 10; i++) {\r\n\t\t\t\t\tgetdeck.add(new Card(i));\r\n\t\t\t\t}\r\n\t\t\t\t//Collections.shuffle(getdeck);\r\n\t\t\t\t// shuffle the cards\r\n\t\t\t\tfor (int i = 0; i <= getdeck.size()-1; i++) {\r\n\t\t\t\t\tint newindex = (int) (Math.random() * 51);\r\n\t\t\t\t\tCard temp = getdeck.get(i);\r\n\t\t\t\t\tgetdeck.set(i, getdeck.get(newindex));\r\n\t\t\t\t\tgetdeck.set(newindex, temp);\r\n\t\t\t\t}\r\n\t\t\t\t//TODO delete println\r\n\t\t\t\t// print shuffled deck\r\n\t\t\t\tfor (int i = 0; i <= getdeck.size()-1; i++) {\r\n\t\t\t\t\tSystem.out.println(getdeck.get(i).getCardNbr());\r\n\t\t\t\t}\r\n\t\t\t\treturn getdeck;\r\n\t}", "private void InitializeDeck(){\n //Spades\n\n deck.add(\"spadesace\");\n deck.add(\"spadesjack\");\n deck.add(\"spadesqueen\");\n deck.add(\"spadesking\");\n deck.add(\"spades2\");\n deck.add(\"spades3\");\n deck.add(\"spades4\");\n deck.add(\"spades5\");\n deck.add(\"spades6\");\n deck.add(\"spades7\");\n deck.add(\"spades8\");\n deck.add(\"spades9\");\n deck.add(\"spades10\");\n\n\n //Diamonds\n deck.add(\"diamondsace\");\n deck.add(\"diamondsjack\");\n deck.add(\"diamondsqueen\");\n deck.add(\"diamondsking\");\n deck.add(\"diamonds2\");\n deck.add(\"diamonds3\");\n deck.add(\"diamonds4\");\n deck.add(\"diamonds5\");\n deck.add(\"diamonds6\");\n deck.add(\"diamonds7\");\n deck.add(\"diamonds8\");\n deck.add(\"diamonds9\");\n deck.add(\"diamonds10\");\n\n //Clubs\n deck.add(\"clubsace\");\n deck.add(\"clubsjack\");\n deck.add(\"clubsqueen\");\n deck.add(\"clubsking\");\n deck.add(\"clubs2\");\n deck.add(\"clubs3\");\n deck.add(\"clubs4\");\n deck.add(\"clubs5\");\n deck.add(\"clubs6\");\n deck.add(\"clubs7\");\n deck.add(\"clubs8\");\n deck.add(\"clubs9\");\n deck.add(\"clubs10\");\n\n //Hearts\n deck.add(\"heartsace\");\n deck.add(\"heartsjack\");\n deck.add(\"heartsqueen\");\n deck.add(\"heartsking\");\n deck.add(\"hearts2\");\n deck.add(\"hearts3\");\n deck.add(\"hearts4\");\n deck.add(\"hearts5\");\n deck.add(\"hearts6\");\n deck.add(\"hearts7\");\n deck.add(\"hearts8\");\n deck.add(\"hearts9\");\n deck.add(\"hearts10\");\n\n Collections.shuffle(deck);\n\n for(int i = 0; i < deck.size(); i++){\n System.out.println(deck.get(i));\n }\n }", "public BlackJackGame()\r\n\t{\r\n\t\tplayer1 = new Player();\r\n\t\tdealer = new Player();\r\n\t\tcardDeck = new Deck();\r\n\t\tendGame = false;\r\n\t}", "public Shoe(Card.Suit suit, int numCards)\n \n { \n cardAry = new Card[numCards];\n\n int numSuits = numCards / 13;\n\n for(int deckIdx = 0; deckIdx<= numSuits; deckIdx++)\n {\n int cardsInSuit;\n if(deckIdx == numSuits)\n cardsInSuit = numCards % 13;\n else\n cardsInSuit = 13;\n for(int rankIdx = 1; rankIdx<=cardsInSuit; rankIdx++)\n {\n cardAry[deckIdx*13 + rankIdx-1] = new Card(suit, rankIdx);\n }\n }\n\n this.numDecks = 0;\n this.numCards = numCards;\n }", "public Shoe(int numDecks)\n {\n\n // this will construct the remaining decks.\n\n cardAry = new Card[numDecks*52];\n // create the cards ....\n for (int deckIdx=0; deckIdx<numDecks; deckIdx++)\n {\n for (int suit=0; suit<4; suit++) {\n for( int rank = 1; rank < 14; rank++) {\n cardAry[(deckIdx*52)+(suit*13+rank-1)] = new Card (Card.Suit.numToSuit(suit),\n rank);\n }\n }\n }\n this.numDecks = numDecks;\n this.numCards = 52*numDecks;\n }", "public void test(){\r\n int nCards = 52;\r\n Card deck[] = new Card[nCards];\r\n //for loop that iterates the size of nCards(52)\r\n for(int i = 0; i<nCards;i++){\r\n //create a new Card object, and set it equal to (i) print out the current card.\r\n deck[i] = new Card(i);\r\n System.out.print(deck[i].toString());\r\n }\r\n }", "private void initializeDeck() {\r\n\t\t// Loop over the 4 card suits\r\n\t\tfor (Suit suit : Suit.values()) {\r\n\t\t\t// Loop over 13 card types\r\n\t\t\tfor (CardType value : CardType.values()) {\r\n\t\t\t\tcards.addCard(new Card(suit, value));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "Card(int num,String suit){\n this.number = num;\n this.suits = suit;\n }", "Cards(String cardName, String cardDes, int puntosHabilidad) {\n this.nombre = cardName;\n this.descripcion = cardDes;\n this.puntos = puntosHabilidad;\n }", "public Card () {}", "public void generateDeck(){\n\t\tString type;\n\t\t//Randomize MAX_TILES number of Tile Objects\n\t\tfor(int i=0; i<GameInfo.MAX_TILES; i++){\n\t\t\ttype = GameInfo.allowedTiles[rg.nextInt(GameInfo.MAX_TYPES)];\n\t\t\tdeck.add(tf.create(type));\n\t\t}\n\t\tgenerated = true;\n\t}", "public DeckGao()\r\n {\r\n cards = new ArrayList<CardGao>();\r\n top = NUMCARDS - 1;\r\n\r\n for(String suit : SUITS)\r\n {\r\n for(int i = 1; i<14; i++)\r\n {\r\n cards.add(new CardGao(suit, i));\r\n }\r\n }\r\n }", "Cards(String cardName, String cardDes, int ataque, int defensa) {\n this.nombre = cardName;\n this.descripcion = cardDes;\n this.puntos = ataque;\n this.def = defensa;\n }", "Hand()\r\n {\r\n myCards = new Card[MAX_CARDS];\r\n numCards = 0;\r\n }", "public static void setMyCards() {\n for (Suit s: Suit.values()){\n for (FaceValue f: FaceValue.values()){\n Card c = new Card(s,f);\n myCards.add(c);\n }\n }\n }", "public void initialDeck()\t{\n\t\tdeck1 = new Deck();\n\t\tdeck2 = new Deck();\n\t\tdeck1.shuffle();\n\t\tdeck2.shuffle();\n\t\tdeck1 = deck1.combine(deck2);\n\t\tdeck1.shuffle();\n\t}", "public PlayingCard(){\n\t\tsuper();\n\t}", "private void initCards() {\n for(int i = 0; i< noOfColumns; i++) {\n for (int j = 0; j < noOfRows; j++) {\n cards[i][j] = new Card(new Paint(), CardState.FACE_DOWN);\n }\n }\n setRandomColors();\n }", "@Override\n public void createShoe(int ndecks) {\n Deck deck;\n for (int i = 0; i < ndecks; i++) {\n deck = new Deck();\n this.cards.addAll(deck.getDeck());\n }\n }", "public Deck(Deck iDeck){\n this.addAll(iDeck);\n }", "public TrainCardDeck(){\n this.cardDeck = new ArrayList<>();\n \n //110 Train Car cards (12 each of Box-PINK, Passenger-WHITE, Tanker-BLUE, Reefer-YELLOW, \n //Freight-ORANGE, Hopper-BLACK, Coal-RED, Caboose-GREEN, plus 14 Locomotives-RAINBOW)\n \n for(int i = 1 ; i <= 12 ; i++){\n for(VALUE color : VALUE.values()){\n cardDeck.add(new TrainCard(color));\n }\n }\n cardDeck.add(new TrainCard(RAINBOW));\n cardDeck.add(new TrainCard(RAINBOW));\n }", "public Card(String cardFace, String cardSuit) {\r\n this.face = cardFace; // initialize face of card\r\n this.suit = cardSuit; // initialize suit of card\r\n }", "public Hand(){\n cards = new ArrayList<Card>();\n }", "private void generateNewCards()\n {\n // Set the card sets to be drafted from.\n setsForDraft = new ArrayList<>();\n setsForDraft.add(M19_CARD_TABLE);\n\n // Generates sealed pool and places in openedCardPool.\n drawPacksFromSets();\n\n // Initialize a selectedCardPool that is empty, for the user to move cards into when desired.\n selectedCardPool = new ArrayList<>();\n }", "public Game(Boolean newGame) throws IOException, InterruptedException {\n if (newGame)\n\n { market = new Market();\n reserve = new Reserve();\n\n productionCardDecks = new ArrayList<>();\n\n deckProductionCardOneBlu = new DeckProductionCardOneBlu();\n deckProductionCardTwoBlu = new DeckProductionCardTwoBlu();\n deckProductionCardThreeBlu = new DeckProductionCardThreeBlu();\n\n deckProductionCardOneGreen = new DeckProductionCardOneGreen();\n deckProductionCardTwoGreen = new DeckProductionCardTwoGreen();\n deckProductionCardThreeGreen = new DeckProductionCardThreeGreen();\n\n deckProductionCardOneViolet = new DeckProductionCardOneViolet();\n deckProductionCardTwoViolet = new DeckProductionCardTwoViolet();\n deckProductionCardThreeViolet = new DeckProductionCardThreeViolet();\n\n deckProductionCardOneYellow = new DeckProductionCardOneYellow();\n deckProductionCardTwoYellow = new DeckProductionCardTwoYellow();\n deckProductionCardThreeYellow = new DeckProductionCardThreeYellow();\n\n\n productionCardDecks.add(deckProductionCardOneBlu);\n productionCardDecks.add(deckProductionCardTwoBlu);\n productionCardDecks.add(deckProductionCardThreeBlu);\n productionCardDecks.add(deckProductionCardOneGreen);\n productionCardDecks.add(deckProductionCardTwoGreen);\n productionCardDecks.add(deckProductionCardThreeGreen);\n productionCardDecks.add(deckProductionCardOneViolet);\n productionCardDecks.add(deckProductionCardTwoViolet);\n productionCardDecks.add(deckProductionCardThreeViolet);\n productionCardDecks.add(deckProductionCardOneYellow);\n productionCardDecks.add(deckProductionCardTwoYellow);\n productionCardDecks.add(deckProductionCardThreeYellow);\n\n deckLeaderCard= new DeckLeaderCard();}\n else {\n restoreGame();\n }\n this.isOver=false;\n\n }", "public Card()\n {\n suit = 0;\n rank = Card.ACE;\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 }", "private void initDecks() {\n\t\tDeck[] decks = new Deck[2];\n\t\tdecks[0] = charDeck;\n\t\tdecks[1] = mainDeck;\n\n\t\tfor (int i = 0; i < decks.length; i++) {\n\t\t\tDeck d = decks[i];\n\t\t\td.setNrOfShownCards(d.getDeckSize());\n\t\t\td.setShownLines(showLines);\n\t\t\td.setLineLength(lineLength);\n\t\t\td.setHandPosRelative(-21, -20);\n\t\t\td.reset();\n\t\t}\n\t}", "private void createShuffleAndAddCards() {\n //Creating all 108 cards and saving them into an arraylist\n ArrayList<Card> cards = new ArrayList<>();\n String[] colors = {\"red\", \"blue\", \"yellow\", \"green\"};\n for (String color : colors) {\n for (int i = 1; i < 10; i++) {\n for (int j = 0; j < 2; j++) {\n cards.add(new Card(\"Numeric\", color, i));\n }\n }\n cards.add(new Card(\"Numeric\", color, 0));\n for (int i = 0; i < 2; i++) {\n cards.add(new Card(\"Skip\", color, 20));\n cards.add(new Card(\"Draw2\", color, 20));\n cards.add(new Card(\"Reverse\", color, 20));\n }\n }\n for (int i = 0; i < 4; i++) {\n cards.add(new Card(\"WildDraw4\", \"none\", 50));\n cards.add(new Card(\"WildColorChanger\", \"none\", 50));\n }\n //shuffling cards and adding them into the storageCards main list\n Collections.shuffle(cards);\n for (Card card : cards) {\n storageCards.add(card);\n }\n cards.clear();\n }", "public DiscardDeck() {\n\t\tthis.content = new ArrayList<Card>();\n\t}", "public Hand()\n {\n cards = new ArrayList<Card>();\n }", "public War()\n {\n //Create the decks\n dealer = new Deck(); \n dw = new Deck();\n de = new Deck(); \n warPile = new Deck(); \n \n \n fillDeck(); //Add the cards to the dealer's pile \n dealer.shuffle();//shuffle the dealer's deck\n deal(); //deal the piles \n \n }", "public BigTwoDeck(){\r\n\t\tinitialize();\r\n\t}", "public void initChanceDeck() {\n\t\tchanceDeck = new Deck();\n\t\tfor (int i = 0; i < 16; i++) {\n\t\t\tchanceDeck.addCard(new Card(i));\n\t\t}\n\t\t//shuffled to make the order random\n\t\tchanceDeck.shuffle();\n\t}" ]
[ "0.77216816", "0.76789355", "0.76022303", "0.75614244", "0.7525682", "0.7522709", "0.75166184", "0.7495423", "0.746498", "0.74517924", "0.74451977", "0.7404817", "0.7404459", "0.7323289", "0.73183024", "0.7288642", "0.728217", "0.726041", "0.7231275", "0.7185529", "0.71800476", "0.7173011", "0.7151887", "0.71001035", "0.7098532", "0.70791805", "0.7075181", "0.7044652", "0.70279676", "0.7009596", "0.6962802", "0.6935463", "0.6929174", "0.6886155", "0.6869251", "0.6831625", "0.6825297", "0.67939854", "0.67683715", "0.6752559", "0.6746392", "0.67342347", "0.67247283", "0.67236954", "0.67168754", "0.67057925", "0.6681563", "0.668081", "0.66713166", "0.66674364", "0.6646663", "0.6641762", "0.66367793", "0.66348433", "0.66175663", "0.6611333", "0.66044205", "0.6585496", "0.6585277", "0.65570176", "0.6549797", "0.65457577", "0.654083", "0.6540311", "0.6524481", "0.6502118", "0.6493365", "0.6484569", "0.64769816", "0.6476562", "0.6471786", "0.6466699", "0.64620465", "0.64450985", "0.64382106", "0.64246607", "0.64226425", "0.6418613", "0.6405248", "0.63990426", "0.6397053", "0.63949233", "0.6387534", "0.63838404", "0.63831717", "0.63690346", "0.63657194", "0.63554645", "0.6352043", "0.6350964", "0.63475174", "0.63449323", "0.63417494", "0.63316095", "0.632913", "0.6326241", "0.6322187", "0.63203907", "0.63172543", "0.6315475" ]
0.747407
8
Adds a card to the deck
private void addCardToDeck(Card card) { deck.add(card); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addCard(Card card) {\n this.deck.push(card);\n }", "public void add(Card card) {\n this.cards.add(card);\n }", "public void addToDeck(Card card) {\n\t\tcards.add(card);\n\t}", "public void addCard(Deck deck, Card card) {\n deck.cards.add(card);\n }", "public void addCard(Card card) {\r\n\t\tcards.add(card);\r\n\t}", "public void addCard(Card card) {\r\n\t\tthis.cards.add(card);\r\n\t}", "void addCard(Card card) {\n\t\t_hand.addCard(card);\n\t}", "public void add(Card card){\n if (numCards < deckSize - 1) {\n this.deck[numCards] = card;\n numCards++;\n }else {\n System.out.println(\"Deck is full!\");\n }\n }", "public void addCard(Card card){\n\t\tthis.pile.add(0, card);\n\t}", "public void addCard(Card e) {\n\t\tthis.deck.add((T) e);\n\t}", "public void addCard(Card c){\n cards.add(c);\n }", "public void addCard(Card card) {\n personHand.add(card);\n }", "public void addCard(Card card) {\n\t\tthis.content.add(card);\n\t}", "public void addToDeck(Card c)\r\n\t{\r\n\t\tdeck.add(c);\r\n\t}", "public void AddCard(Card card) {\n mCard[mCardCount++] = card;\n SetCardPosition(mCardCount - 1);\n }", "public void addCard(Card c)\n {\n cards.add(c);\n }", "public void addCard(Card c)\n {\n hand.add(c);\n }", "public void addCard(Card cardToAdd) {\n storageCards.add(cardToAdd);\n }", "public void addCard(Card card) {\n myCards.add(card);\n cardNumber = myCards.size();// reset the number of cards\n }", "public void addCard(String cardName) {\n if(isInDeck(cardName)==false){\n cards.add(new Card(cardName));\n System.out.println(\"Added\");\n }else{\n System.out.println(\"Its already in deck\");\n }\n }", "public void addCard(Card c) {\r\n\t\thand.add(c);\r\n\t}", "public void addCard(Card card)\n\t{\n\t\t\n\t\t// Add the new Card to the list\n\t\tcards.add(card);\n\t\t\n\t\t// Remove and re-add all cards\n\t\tsyncCardsWithViews();\n\t\t\n\t}", "public CardView addCard(Card card) {\n return addCard(card, false);\n\n }", "@Override\n\tpublic void addCard(PlayingCard card) {\n\t\t\n\t\t\n\t\tif(card == null)return;\n\t\tif(!(card instanceof SkatCard))return;\n\t\tif(!(card.getSuit().equals(SkatCard.suitHerz)\n\t\t\t\t|| card.getSuit().equals(SkatCard.suitKaro) \n\t\t\t\t|| card.getSuit().equals(SkatCard.suitPik)\n\t\t\t\t|| card.getSuit().equals(SkatCard.suitKreuz)))return;\n\t\tif(!(card.getRank() == SkatCard.rank7\n\t\t\t\t|| card.getRank() == SkatCard.rank8\n\t\t\t\t|| card.getRank() == SkatCard.rank9\n\t\t\t\t|| card.getRank() == SkatCard.rank10\n\t\t\t\t|| card.getRank() == SkatCard.rankBube\n\t\t\t\t|| card.getRank() == SkatCard.rankDame\n\t\t\t\t|| card.getRank() == SkatCard.rankKoenig\n\t\t\t\t|| card.getRank() == SkatCard.rankAss))return;\n\t\tif(getCount() >= kartenAnzahl)return;\n\t\tfor(int i = 0; i < getCount(); i++) {\n\t\t\tif(card.compareTo(aktuellesDeck[i]) == 0)return;\n\t\t}\n\t\t\n\t\t/*\n\t\t * eigentliches addCard\n\t\t */\n\t\taktuellesDeck[getCount()] = card;\n\t\tcount++;\n\t}", "public void addCard(Card c) {\n\t\tthis.hand.addCard(c);\n\t}", "public void add(Card card) throws DeckSizeException\n {\n deck.add(card);\n if (deck.size()>108)\n {\n throw new DeckSizeException(deck.size());\n }\n }", "@Override\n\tpublic boolean addCard(UnoCard card){\n\t\treturn this.cardList.add(card);\n\t}", "public void addCard(Card card){\r\n\t\tplayerHand.add(card);\r\n\t\tSystem.out.print(\"You draw \");\r\n\t\tSystem.out.println(getCardIndex(playerHand.size()-1));\r\n\t}", "public void addCard(Card card) {\r\n SQLiteDatabase db = this.getWritableDatabase();\r\n \r\n ContentValues values = new ContentValues();\r\n values.put(COL_ACCOUNT, card.getAccount()); \r\n values.put(COL_USERNAME, card.getUsername()); \r\n values.put(COL_PASSWORD, card.getPassword()); \r\n values.put(COL_URL, card.getUrl()); \r\n values.put(COL_DELETED, card.getDeleted()); \r\n values.put(COL_HIDE_PWD, card.getHidePwd()); \r\n values.put(COL_REMIND_ME, card.getRemindMe()); \r\n values.put(COL_UPDATED_ON, card.getUpdatedOn()); \r\n values.put(COL_COLOR, String.valueOf(card.getColor()));\r\n values.put(COL_REMIND_ME_DAYS, card.getRemindMeDays());\r\n \r\n db.insert(TABLE_CARDS, null, values);\r\n db.close(); \r\n }", "public int addCard(Card card) {\n\t\thand.add(card);\n\t\tif(!isDealer) {\n\t\t\tSystem.out.println(\"Dealt a \" + card);\n\t\t}\n\t\treturn handValue();\n\t}", "public void addCard(PlayingCard aCard);", "public void addCardToDeck(int index, SpoonsCard card){\r\n\t deck.add(index, card);\r\n }", "public void takeACard(Card card){\n hand.add(card);\n }", "public void drawCard(Card card) {\n hand.addCard(card);\n }", "public void addCard(Cards card, boolean canUse) {\n \t\tif (canUse) {\n \t\t\tcards[card.ordinal()] += 1;\n \t\t\tusedCard = false;\n \t\t} else {\n \t\t\tnewCards.add(card);\n \t\t}\n \t}", "public void addToDeck(ArrayList<Card> cards)\r\n\t{\r\n\t\tfor (int i = 0; i < cards.size(); i++)\r\n\t\t{\r\n\t\t\tdeck.add(cards.get(i));\r\n\t\t}\r\n\t}", "public void addPartnerCard(Card card);", "public void addToHand(PlayingCard card){\n\t\thand.add(card);\n\t}", "public void addDeck(DeckOfCards deck) {\n\t\tif(deck != null) {\n\t\t\tlistOfDecks.add(deck);\n\t\t\tcurrentListOfCards.addAll(deck.getCards());\n\t\t}\n\t\telse {\n\t\t\tthrow new BadRequestException(\"Cannot add a null deck\");\n\t\t}\n\t\t\n\t}", "public abstract void addCard();", "public boolean addCard(Card card)\n {\n if (numOccurrences(card) >= numPacks)\n return false;\n\n cards[topCard++] = card;\n return true;\n }", "public void addCard(Card card)\n {\n if (card1 == null)\n {\n card1 = card;\n }\n else if (card2 == null)\n {\n card2 = card;\n }\n }", "public void insert(Card card) {\n\t\tthis.insert(card);\n\t}", "public void putCard(Cards cards) {\n playedCards.add(cards);\n }", "public void addDealerCard() {\r\n dealerHand.addCard(cardDeck.rCard());\r\n }", "public void addToUse(int card) {\r\n\t\tthis.toUse.add(card);\r\n\t}", "public void AddCardDeckFromSerial(String value){\n deck.add(value);\n }", "public void AddCardToComputerHand(){\n //Add the first card to the computer\n handComputer.add(deck.get(0));\n\n //Remove card from deck\n deck.remove(0);\n }", "public void addCardToHand(final Card card) {\n\t\tcahActivity.runOnUiThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tcahActivity.addCardToHand(card);\n\t\t\t}\n\t\t});\n\t}", "public void addToBottom(Card card){\r\n cards.add(card);\r\n deckSize++;\r\n }", "public void addCard(int index, Card card)\n\t{\n\t\tcards.add(index, card);\n\t\t\n\t\t// Remove and re-add all cards\n\t\tsyncCardsWithViews();\n\t\t\n\t}", "public boolean addCard(Card card) {\n int cardCount = 0;\n //Check to see if the deck already has the maximum number of cards\n //of this type.\n for (Card cardInDeck : this.cards)\n if (cardInDeck.equals(card))\n cardCount++;\n //Return false is the card will not fit, or if it is invalid.\n if (cardCount >= this.numPacks || this.topCard >= this.MAX_CARDS || card.errorFlag)\n return false;\n this.topCard++;\n //Add the card object to the deck.\n this.cards[topCard - 1] = new Card(card);\n return true;\n }", "public void giveCard(Card c){\n\t\thand.add(c);\n\t}", "public void addCard(Card newcard)\n\t{\n\t\thand[numCards++] = newcard;\n\t\tscore += newcard.getValue();\n\t}", "private void addCard() {\n Intent intent = new Intent(this, NewCard.class);\n intent.putExtra(\"cardSetId\", cardSetId);\n startActivity(intent);\n }", "public void addCard(Card card, GamePlayer GP){\n for(int i=0; i<4; i++){\n if(cardsPlayed[i] == null){\n cardsPlayed[i]=card;\n if(i == 0){\n suit = card.getSuit();\n }\n break;\n }\n }\n }", "public void addToDiscard(Card card) {\r\n\t\tthis.discard.add(card);\r\n\t}", "public void add(Cards cs) {\r\n\t\tfor (int i = 0; i < cs.getSize(); i++) {\r\n\t\t\tcards.addCard(cs.getCard(i));\r\n\t\t}\r\n\t\tseedCards.add(cs);\r\n\t}", "public void addChargeCard(ChargeCard chargeCard) {\r\n chargeCards.add(chargeCard);\r\n }", "public void addToCollected(PlayingCard card){\n\t\tcollected.add(card);\t\t\n\t}", "public void add(Card c) {\n cards.add(c);\n orginalOrder.add(c);\n cardsPerSuit[c.getSuit().ordinal()]++;\n calculateValue();\n\n }", "public void addCreditCard(CreditCard creditCard) {\r\n\t\tcreditCards.add(creditCard);\r\n\t}", "public void push(Card newCard)\n\t{\n\t\tcard.add(newCard);\n\t}", "private CardView addCard(Card card, boolean silent) {\n CardView cardView = new CardView(card);\n getChildren().add(cardView);\n\n cardViews.add(cardView);\n\n cardView.setParentSet(this);\n\n cardSet.addCard(card);\n\n if (!silent) {\n fireEvent(cardView, CardEvent.CARD_ADDED);\n }\n\n if (interactive) {\n assignEvents(cardView);\n if (!silent) {\n markValidity();\n cardView.setNewcomer(true);\n sort();\n }\n }\n return cardView;\n }", "public Card push(Card card)\n {\n if (card != null)\n {\n cards.add(card);\n card.setBounds(0, 0, CARD_WIDTH, CARD_HEIGHT);\n add(card, 0);\n }\n \n return card;\n }", "public void draw(BlackjackCard card) {\n cards.add(card);\n setSize(getSize() + 1);\n if (card.getRank() == Rank.ACE) {\n aceCount++;\n }\n }", "public void giveOneCard(Deck deck, ArrayList<Cards> table)\n {\n //Burn one card\n deck.getCard();\n\n //Add 1 card\n table.add(deck.getCard());\n }", "void addCustomerCard(CardDto cardDto, String name) throws EOTException;", "private void addCard(){\n WebDriverHelper.clickElement(addCard);\n }", "public Board.Cards buyCard(Board.Cards card) {\n \t\tif (!affordCard())\n \t\t\treturn null;\n \n \t\t// out of cards\n \t\tif (card == null)\n \t\t\treturn null;\n \n \t\t// deduct resources\n \t\tuseResources(Type.WOOL, 1);\n \t\tuseResources(Type.GRAIN, 1);\n \t\tuseResources(Type.ORE, 1);\n \n \t\tif (card == Cards.VICTORY)\n \t\t\tvictory += 1;\n \t\telse\n \t\t\tnewCards.add(card);\n \n \t\tappendAction(R.string.player_bought_card);\n \n \t\treturn card;\n \t}", "public void addCard(int card) {\n cards[numCards] = card;\n numCards++;\n \n if (card == 1) {\n score = score + 11;\n numSoft++;\n }\n else if(card == 11 || card == 12 || card == 13) {\n score = score + 10;\n }\n else {\n score = score + card;\n }\n \n //Decreases any aces from 11 to 1 if the score is above 21\n while(numSoft > 0 && score > 21){\n score = score - 10;\n numSoft--;\n }\n }", "void pushCard(ICard card);", "void add(Set<Card> cards);", "@Test\n public void testAddCard() {\n d_gameData.getD_playerList().get(1).addCard(GameCard.BLOCKADE);\n assertEquals(true, d_gameData.getD_playerList().get(1).getD_cards().contains(GameCard.BLOCKADE));\n }", "@Override\r\n public void giveDealerDeck(Deck deck) {\r\n this.dealer.addDeck(deck);\r\n }", "public boolean addPlayerCard(GreenPlayerCard card) {\r\n\t\tthis.playerCards.add(card);\r\n\t\treturn true;\r\n\t}", "private void push( Card card ) {\r\n undoStack.add( card );\r\n }", "public boolean addCard(VentraCard card){\n \tboolean isExist = true;\n \t\n \tfor(int i=0; i<allCards.size(); i++ ) {\n \t\tif(card.getCardNumber() == allCards.get(i).getCardNumber()\n \t \t&& card.getPhoneNumber().equals(allCards.get(i).getPhoneNumber())) {\n \t\t\tisExist = false;\n \t\t}\t\n \t}\n \tif(isExist == true) { // if(isExist)\n \t\tallCards.add(card);\t\n \t\treturn true;\n \t}\n \t\n return false;\n }", "public void addToHand(int index, Card cardToAdd)\n\t{\n\t\tcurrentHand.add(index, cardToAdd);\n\t}", "public void add (Card newCard)\n {\n firstLink = new Link(newCard, firstLink);\n }", "public void addToHand(Card c) {\n\t\thand.add(c);\n\t}", "private void addCard() { \n\t\tint sic_idHolder; // declares sic_idHolder\n\t\tString titleHolder; // declares titleHolder\n\t\tString authorHolder; // declares authorHolder\n\t\tdouble priceHolder; // declares priceHolder\n\t\tint quantityHolder; // declares quantityHolder\n\t\t\n\t\t\n\t\tSystem.out.println(\"Making a new card:\\nPlease enter the new SIC-ID: \");\n\t\tsic_idHolder = scan.nextInt(); // prompts user to input the ID\n\t\tscan.nextLine();\n\t\t\n\t\tif(inventoryObject.cardExists(sic_idHolder) != true) {\n\t\t\tSystem.out.println(\"Please enter the title of the book: \");\n\t\t\ttitleHolder = scan.next(); // prompts user to input the title\n\t\t\tscan.nextLine();\n\t\t\tSystem.out.println(\"Please enter the author of the book\");\n\t\t\tauthorHolder = scan.next(); // prompts user to input the author\n\t\t\tscan.nextLine();\n\t\t\tSystem.out.println(\"Please enter the price of the book\");\n\t\t\tpriceHolder = scan.nextDouble(); // prompts user to input the price\n\t\t\tscan.nextLine();\n\t\t\n\t\t\tif(priceHolder < 0) { // checks to make sure priceHolder is positive\n\t\t\t\tSystem.out.println(\"ERROR! Price must be greater than or equal to 0:\");\n\t\t\t\tgetUserInfo();\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Please enter the number of books in invetory\");\n\t\tquantityHolder = scan.nextInt(); // prompts user to input the quantity\n\t\tscan.nextLine();\n\t\t\n\t\tif(quantityHolder <= 0) { // checks to make sure quantity isn't less than 1\n\t\t\tSystem.out.println(\"Error! Quantity must be greater than 0\\n\"); \n\t\t\tgetUserInfo();\n\t\t}\n\t\tinventoryObject.addStockIndexCard(sic_idHolder, titleHolder, authorHolder, priceHolder, quantityHolder); // calls addStockIndexCard from InventoryManagement\n\t\tgetUserInfo();\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"ERROR: The ID you entered is already in the system\\n\");\n\t\t\tgetUserInfo();\n\t\t}\n\t}", "@Override\r\n public void givePlayerDeck(int playerPosition, Deck deck) {\r\n this.players.get(playerPosition).addDeck(deck);\r\n }", "public boolean addCard(Card hit) {\n if (numOfCards == 10) {\r\n System.err.println(\"You already have 5 cards. \"\r\n + \"Cannot add another. \\n\");\r\n }\r\n //actually adding cards\r\n hand[numOfCards] = hit;\r\n numOfCards++;\r\n\r\n return (getHandSum() <= 21);\r\n }", "@Override\n\tpublic void createCard(Card card) {\n\t\t/* begin transaction */ \n\t\tSession session = getCurrentSession(); \n\t\tsession.beginTransaction(); \n\n\t\t/* persist */ \n\t\tsession.save(card); \n\n\t\t/* commit */ \n\t\tsession.getTransaction().commit();\n\t}", "public void addToHand(String card) {\n\t\tString[] handtemp = new String[hand.length+1];//increase hand size by one\n\t\tfor (int i = 0; i < hand.length; i++) {//loop through the length of the hand\n\t\t\thandtemp[i] = hand[i];//add all elements to the temp array\n\t\t}\n\t\thandtemp[hand.length] = card;//add the new card to the end of the temp array\n\t\thand = handtemp;//make the hand equal to the temp array\n\t}", "public void addCard() {\n for (int i = 0; i < 4; i++) {\n cards.add(new Wild());\n cards.add(new WildDrawFour());\n }\n for (Color color : Color.values())\n cards.add(new NumberCard(color.name(),0));\n for (Color color : Color.values()) {\n for (int i = 0; i < 2; i++) {\n for (int j = 1; j < 10; j++)\n cards.add(new NumberCard(color.name(),j));\n cards.add(new DrawTwo(color.name()));\n cards.add(new Reverse(color.name()));\n cards.add(new Skip(color.name()));\n }\n }\n }", "@Override\n\tpublic String addCard(String name, String cpasswd, int vid, double cmoney) {\n\t\treturn cb.addCard(name, cpasswd, vid, cmoney);\n\t}", "public void addWinning1(Card card)\n {\n player1Hand.enqueue(card);\n }", "public boolean rulesForAddingCard(Card card)\n\t{\n\t\treturn true;\n\t}", "public boolean addDeck(String token, String name) throws RemoteException {\n return mainScreenProvider.addDeck(token, name);\n }", "public void addListOfCards(Deck newCards){\r\n for(Card i : newCards.cards){\r\n this.cards.add(i);\r\n }\r\n deckSize += cards.size();\r\n }", "void setcard(int i)\n{\n\thc.add(i);}", "public void allotCard(Player p_player) {\n Card l_Card = new Card();\n Random l_RandomNumber = new Random();\n l_Card.setD_CardType(l_Card.TYPES[l_RandomNumber.nextInt(l_Card.TYPES.length)]);\n p_player.addCard(l_Card);\n Console.displayMsg(\"Player \" + p_player.getD_Name() + \" has received \" + l_Card.getD_CardType() + \" card!\");\n }", "public void addCard(DevelopmentCard card) throws NullCardException {\n \tif(card == null) {\n \t\tthrow new NullCardException(\"The card to be added to the players Development Cards is Null\");\n \t} else if(card.getDevCardType() == null) {\n \t\tthrow new NullCardException(\"The card to be added to the players Development Cards is not Null, but the Card type is null\");\n \t}\n \tif(card.getDevCardType() == DevCardType.SOLDIER) {\n \t\tsoldierCards.add(card);\n \t} else if(card.getDevCardType() == DevCardType.MONUMENT) {\n \t\tvictoryPointCards.add(card);\n \t} else if(card.getDevCardType() == DevCardType.ROAD_BUILD) {\n \t\troadBuilderCards.add(card);\n \t} else if(card.getDevCardType() == DevCardType.MONOPOLY) {\n \t\tmonopolyCards.add(card);\n \t} else if(card.getDevCardType() == DevCardType.YEAR_OF_PLENTY) {\n \t\tyearOfPlentyCards.add(card);\n \t}\n }", "@Override\r\n public void giveCardToPlayer(Card card, int player, int plDeckPosition) {\r\n this.players.get(player).addCard(plDeckPosition, card);\r\n }", "public void add() {\n\t\tcart.add(item.createCopy());\n\t}", "public boolean addDeck(long idGame, Deck deck) {\n Game game = this.getGameById(idGame);\n\n if(game == null) {\n return false;\n }\n\n game.getShoe().addAll(deck.getCards());\n this.save(game);\n\n return true;\n }", "boolean canBeAdded(ICard toBeAddedCard);", "public void addToHand(ArrayList<PlayingCard> cardsToAdd)\n\t{\n\t\tcurrentHand.addAll(cardsToAdd);\n\t}" ]
[ "0.8856406", "0.8560675", "0.8529624", "0.849869", "0.8476446", "0.84449834", "0.84014904", "0.82833856", "0.8255794", "0.82271767", "0.8173699", "0.8128462", "0.81197304", "0.81081", "0.80929065", "0.8085756", "0.7983887", "0.7977768", "0.7960895", "0.79295725", "0.79035956", "0.78944165", "0.7846964", "0.77178526", "0.77049", "0.76936406", "0.768647", "0.76732254", "0.7655802", "0.7648085", "0.76259416", "0.75842595", "0.7575427", "0.75589764", "0.7557665", "0.7515962", "0.7506864", "0.75006056", "0.7471263", "0.74429", "0.7426501", "0.73810947", "0.73772556", "0.7366199", "0.7348544", "0.7287265", "0.72668904", "0.7254697", "0.7244966", "0.72377455", "0.7224651", "0.7223674", "0.7218768", "0.7217297", "0.71943873", "0.71709055", "0.71266836", "0.7105707", "0.70763034", "0.70426196", "0.70393306", "0.7032429", "0.6977557", "0.69465715", "0.6912833", "0.6912564", "0.68954915", "0.68793863", "0.6857398", "0.684904", "0.68303365", "0.6820969", "0.67650694", "0.6762498", "0.67570835", "0.6751656", "0.6706099", "0.669669", "0.6691632", "0.6690344", "0.6689131", "0.6670037", "0.6630706", "0.65867937", "0.65711665", "0.6569828", "0.6567998", "0.6563771", "0.65184015", "0.6458293", "0.6450303", "0.6429266", "0.64256376", "0.64243734", "0.64115417", "0.64008445", "0.63964033", "0.638203", "0.63741875", "0.63689345" ]
0.86214083
1
return the first (top) card to whoever drew it
public Card draw() { Card topCard = deck.get(0); deck.remove(0); return topCard; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Card getTopCard(){\n\t\treturn getCard(4);\n\t\t\n\t}", "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}", "public Card drawCardFromTop() {\n Card temp = this.cards [this.topCardIndex];\n this.topCardIndex++;\n return temp;\n }", "public Card topCard() {\n return this.deck.peek();\n }", "public Card top() {\n\t\treturn firstCard;\n\t}", "public Card topDeckCard(){\n Preconditions.checkArgument(!isDeckEmpty());\n return deck.topCard();\n }", "public Card getTopCard()\r\n {\r\n Card tmp;\r\n\r\n if ( valid <= 0)\r\n return null;\r\n else\r\n {\r\n valid--;\r\n tmp = cards[valid];\r\n cards[valid] = null;\r\n return tmp;\r\n }\r\n }", "public Card getTopCard() {\n\t\treturn topCard;\n\t}", "public Card viewTopCardInPlay(){\n if(cardsInPlayStack.isEmpty()) {\n return null;\n }\n return cardsInPlayStack.peek();\n }", "public int getTopCard() {\n return this.topCard;\n }", "public Card topCard() {\n Preconditions.checkArgument(!cardState.isDeckEmpty());\n return (cardState.topDeckCard());\n }", "public Card showTop() {\n\t\treturn hand.get(0);\n\t}", "@Override\r\n public Card getFirstCard() {\r\n return this.firstCard.equals(null) ? Card.NONE : this.firstCard;\r\n }", "public Card getTopCard(int i)\n {\n Card thisCard = null; \n if( i == P1)\n {\n thisCard = dw.dequeue();\n }\n if(i == P2)\n {\n thisCard = de.dequeue();\n }\n \n return thisCard; \n }", "ICard getTopCard() throws IllegalArgumentException;", "public Card top() {\r\n\t\treturn cards.get(cards.size() - 1);\r\n\t}", "public Card front()\n {\n if (firstLink == null)\n return null;\n\n return firstLink.getCard();\n }", "public int chooseCard(){\n if(playable.size() == 1)//checks the size\n return searchCard(0);//returns the only playable card\n else{\n int temp = (int) Math.random()*playable.size();//chooses a random one\n return searchCard(temp);//returns that cards position\n }\n }", "public CardGao nextCard()\r\n {\r\n return cards.get(top--);\r\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}", "public Card dealOne() {\r\n\t\tif (cards.isEmpty()) {\r\n\t\t\t// Make this and retrieve_one an exception instead?\r\n\t\t\tSystem.out.println(\"dealOne(): Deck is empty\");\r\n\t\t}\r\n\t\tCard topCard = top();\r\n\t\tcards.remove(cards.size() - 1);\r\n\t\treturn topCard;\r\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 Card getHighestCard() {\n Card rtrnCard = cardsPlayed[0];\n int i;\n int tempInt;\n int currentHighestRank = cardsPlayed[0].getIntValue();\n for(i = 0; i < cardsPlayed.length; i++){\n if(cardsPlayed[i].getSuit().equals(suit)){\n tempInt = cardsPlayed[i].getIntValue();\n if((currentHighestRank < tempInt)&&(!(cardsPlayed[i].equals(rtrnCard)))){\n rtrnCard = cardsPlayed[i];\n currentHighestRank = cardsPlayed[i].getIntValue();\n }\n }\n }\n return rtrnCard;\n }", "public Card nextCard()\n\t{\n\t\tif (this.card[0] == null)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//get top card\n\t\t\tCard top = this.card[0];\n\t\t\t\t\t\n\t\t\t//Move the dealt card so it can be later deleted // -1\n\t\t\tfor (int i = 1; i < this.cardNumber; i++) \n\t\t\t{\n\t\t\t\tthis.card[i-1] = this.card[i]; \n\t\t\t}\n\t\t\t//To delete the last card to make sure its same position/ Set it to Null\n\t\t\tthis.card[this.cardNumber-1] = null;\n\t\t\t//After dealt the count of cards in deck goes down --\n\t\t\tthis.cardNumber--;\n\t\t\t\t\t\n\t\t\treturn top;\n\t\t}\n\t}", "public Card getNextPlayerCard()\n\t{\n\t\tDeck<Card> playerCards = board.getPlayerCardDeck();\n\t\tif (playerCards.isEmpty())\n\t\t{\n\t\t\tsystemDataInput.printMessage(\"There is no player card to play the game.\");\n\t\t\tendGame(EndGameType.noPlayerCard);\n\t\t\treturn null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCard topCard = playerCards.pickTopCard();\n\t\t\tif (playerCards.size() == 1)\n\t\t\t{\n\t\t\t\tsystemDataInput.printMessage(\"The last player card \" + topCard.getName() + \" has been picked up. This is the end of the game.\");\n\t\t\t\tendGame(EndGameType.noPlayerCard);\n\t\t\t}\n\t\t\t\n\t\t\treturn topCard;\n\t\t}\n\t}", "public CardView getTopCardView() {\n return cards.get(cards.size() - 1);\n }", "public Card.Face getHighestCard(){\n return uniqueFaces.getFirst();\n }", "static int getComputerCard(Card playerCard) {\n //The computer will iterate through different possible cards it might choose to play.\n //This represents a chosen card at any given time.\n Card possibleCard = null;\n //The position in the computer's hand where the possibleCard is stored.\n int cardPosition = 0;\n //True if the computer has a card of higher value than the player's.\n boolean hasHigherCard = false;\n //Iterate through the computer's hand, trying to find a card higher than the player's\n for (int i = 0; i < highCardGame.getHand(0).getNumCards(); i++) {\n if (playerCard.compareTo(highCardGame.getHand(0).inspectCard(i)) < 0) {\n //The computer has a higher card.\n if (possibleCard != null) {\n //If this card is lower than the possible card, but can still beat the player, then replace possible card.\n if (possibleCard.compareTo(highCardGame.getHand(0).inspectCard(i)) > 0) {\n possibleCard = new Card(highCardGame.getHand(0).inspectCard(i));\n cardPosition = i;\n }\n } else {\n //If the computer has not yet chosen a possible card, choose this one.\n possibleCard = new Card(highCardGame.getHand(0).inspectCard(i));\n hasHigherCard = true;\n cardPosition = i;\n }\n }\n }\n if (!hasHigherCard) {\n //If the computer does not have a card that can beat the player, then feed the lowest card\n //that the computer has to the player.\n for (int i = 0; i < highCardGame.getHand(0).getNumCards(); i++)\n if (playerCard.compareTo(highCardGame.getHand(0).inspectCard(i)) >= 0) {\n if (possibleCard != null) {\n if (possibleCard.compareTo(highCardGame.getHand(0).inspectCard(i)) > 0) {\n possibleCard = new Card(highCardGame.getHand(0).inspectCard(i));\n cardPosition = i;\n }\n } else {\n possibleCard = highCardGame.getHand(0).inspectCard(i);\n cardPosition = i;\n }\n }\n }\n return cardPosition;\n }", "public Card nextCard(){\r\n\t if(topCardIndex >=52){\r\n\t throw new IndexOutOfBoundsException();\r\n\t }\r\n\t return cards[topCardIndex++];\r\n\t}", "public CardGao dealCard()\r\n {\r\n return cards.get(top--);\r\n\r\n }", "public String GetTopTrashCard(){\n //System.out.println(\"TOP: \" + topCard);\n return topCard;\n }", "public UnoCard getTopCard() {\r\n return new UnoCard(validColor, validValue);\r\n }", "public UnoCard getCard(){\n Random rnd = new Random();\n int rnd_number = rnd.nextInt(((this.cards.size()-1)-0) + 1) + 0;\n return this.cards.get(rnd_number);\n\n }", "public Card getTopCardDiscardPile() {\r\n return discardPile.get(discardPile.size() - 1);\r\n }", "public DevelopmentCard getTopCard(int pos) {\n int size = devStack.get(--pos).size();\n return this.devStack.get(pos).get(--size);\n }", "public Card pullCard(){\n if(this.deckOfCards.isEmpty()){\n return null;\n }\n Card cardPulled = this.deckOfCards.get(0);\n this.deckOfCards.remove(0);\n return cardPulled;\n }", "public Card dealCard() {\n //Return an invalid card if there are no cards in the deck.\n if (this.topCard < 0)\n return new Card('0', Card.Suit.spades);\n else {\n //Create a copy of the card on the top of the deck.\n Card card = new Card(this.cards[this.topCard - 1]);\n //Set the actual card on the top of the deck to null, to destroy it.\n this.cards[this.topCard - 1] = null;\n //The topCard is now one less than it was.\n this.topCard--;\n //return the copy.\n return card;\n }\n }", "public Card removeTopCard(){\n\t\treturn this.pile.remove(0);\n\t}", "public Card showCard()\r\n {\r\n return pile.peek();\r\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 Card getBottom()\n {\n return cards.firstElement();\n }", "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 Card getNextCard(){\n if(mCardIterator.hasNext()) {\n return mCardIterator.next();\n }\n else {\n return null;\n }\n }", "@Override\r\n public Card getSecondCard() {\r\n return this.secondCard.equals(null) ? Card.NONE : this.secondCard;\r\n }", "public Optional<Card> dealOneCard() {\n if (cards.size() > 0) {\n return Optional.of(cards.remove(0));\n } else {\n return Optional.empty();\n }\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 String showFirstCard() {\n return dealerHand.getFaceNames().get(0) + \" of \" + dealerHand.getSuits().get(0);\n }", "public Card getCard(){\n return cards.get(0);\n }", "private int highCard() {\n\t\tint highCard = 0;\n\t\tfor (int counter = 0; counter < Constants.HAND_SIZE; counter++) {\n\t\t\tif (hand[counter].getValueIndex() > highCard) {\n\t\t\t\thighCard = hand[counter].getValueIndex();\n\t\t\t}\n\t\t}\n\t\tresult.setPrimaryValuePos(highCard);\n\t\treturn highCard;\n\t}", "@Override\r\n public ICard dealCard() {\r\n //get the first card from top of the deck \r\n ICard top = this.deck[ZERO];\r\n //shift cards to the left, because we get the first one \r\n for (int i = ONE; i < this.numOfCards; i++) {\r\n this.deck[i - ONE] = this.deck[i];\r\n }\r\n this.deck[this.numOfCards - ONE] = null;\r\n //decrement the number of cards currently in the deck \r\n this.numOfCards--;\r\n\r\n return top;\r\n }", "public int getNumCards() {\n return this.topCard;\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 Disc top()\n\t{\n\t\tint poleSize = pole.size();\n\n\t\t// If the pole is empty, return nothing\n\t\tif(poleSize == 0)\n\t\t\treturn null;\n\n\t\t// Otherwise return the top disc\n\t\treturn pole.get(poleSize - 1);\n\t}", "private ArrayList<Card> getCurrentTopCards() {\n // logic to get round cards from all players\n ArrayList<Card> currentTopCards = new ArrayList<>();\n for (Player player : players) {\n player.submitActiveCard(currentTopCards);\n }\n return currentTopCards;\n }", "public synchronized Card peek()\n {\n if (cards.isEmpty())\n return null;\n \n return cards.lastElement();\n }", "Symbol getActiveCard();", "public Card giveCard(){\n return this.cardDeck.get(lastIndex++);\n }", "public int getHighCard() {\r\n return highCard;\r\n }", "public Card dealCard()\n {\n Card errorReturn = new Card('E', Card.Suit.spades); // in rare cases\n\n if (topCard == 0)\n return errorReturn;\n else\n return cards[--topCard];\n }", "public Card getCard(Card c){\n\t\tif(contains(c)){\n\t\t\tfor(int i = 0; i < hand.size(); i ++)\n\t\t\t{\n\t\t\t\tif(hand.get(i).getSuit().equals(c.getSuit()))\n\t\t\t\t{\n\t\t\t\t\thand.remove(i);\n\t\t\t\t\treturn c;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//else\n\t\treturn null;\n\t}", "public AbstractCard getNextCard() {\n currentCardPos++;\n if (currentCardPos >= deck.size()) {\n return null;\n }\n return getCurrentCard();\n }", "private Player compareTopCards() {\n // COMPARE CARDS\n int bestValue = activePlayer.getTopMostCard().getCardPropertyValue(activeCategory);\n // assume activePlayer will win the round and then test if this is true\n // if no other card beats or equals the ActivePlayer's card\n // the activePlayer will be returned as the winner\n Player currentWinner = activePlayer;\n for (Player player : players) {\n // if not the active player\n if (!(player == activePlayer)) {\n // check specific player value for the active category\n int value = player.getTopMostCard().getCardPropertyValue(activeCategory);\n if (bestValue < value) {\n bestValue = value;\n currentWinner = player;\n }\n // if value matches top value then there is a tie\n else if (bestValue == value) {\n currentWinner = null;\n }\n }\n }\n return currentWinner;\n }", "public Card peek()\n\t{\n\t\treturn card.get(card.size() - 1);\n\t}", "public Card getPlayer1Card()\n {\n player1card = new Card(player1Hand.dequeue().toString());\n return player1card;\n }", "Card drawCard() {\n if (this.pointer >= this.cards.size()) {\n throw new NoMoreCardsAvailableException();\n }\n return cards.get(pointer++);\n }", "public Card removeFirstCard()\n {\n return cards.remove(0);\n }", "public Card takeCard() {\n return this.deck.pop();\n }", "public Card getLastDrawnCard()\n\t{\n\t\treturn currentHand.get(getHandSize() - 1);\n\t}", "public Card getCard(int index){\n return cards.get(index - 1);\n }", "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 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 Card drawCard() {\n return gameDeck.removeTopCard();\n }", "@Override\n void pickCard() {\n\n boolean suitFound = false; // true if player has the suit\n Card cardToBeat; // strongest card on pile\n Card pickedCard = null; // card to throw\n ArrayList<Card> cardsToChooseFrom = new ArrayList<Card>();\n char trump = pitchTable.getTrump();\n\n // find the strongest card on pile\n cardToBeat = pitchTable.getCardToBeat();\n\n // if pile is empty\n if (cardToBeat == null){\n // pick the strongest non trump card\n for (Card card : hand)\n if (card.suit != trump)\n if ((pickedCard == null) || (pickedCard.rank < card.rank))\n pickedCard = card;\n\n // if non trump card not found (means all cards are trump)\n // then pick the strongest card\n if (pickedCard == null)\n for (Card card : hand)\n if ((pickedCard == null) || (pickedCard.rank < card.rank))\n pickedCard = card;\n }\n else { // means leading suit is set already\n // check if player has suit\n for (Card card : hand) {\n if (card.suit == pitchTable.getLeadingSuit())\n suitFound = true;\n }\n\n // if player does not have suit he can play any card\n if (!suitFound)\n cardsToChooseFrom = hand;\n else // if player has suit then cardsToChooseFrom = allowed cards\n for (Card card : hand)\n if ((card.suit == pitchTable.getLeadingSuit()) ||\n card.suit == pitchTable.getTrump())\n cardsToChooseFrom.add(card);\n }\n\n // try to take the trick with the lowest winning card\n // if no winning card then throw the lowest you have\n\n // (trying to take the trick)\n // if card not picked yet\n // then find the lowest card that has the suit and is higher than cardToBeat\n if (pickedCard == null)\n for (Card card : cardsToChooseFrom)\n if ((cardToBeat.suit == card.suit) && (cardToBeat.rank < card.rank))\n if ((pickedCard == null) || (pickedCard.rank > card.rank))\n pickedCard = card;\n\n // (trying to take the trick)\n // if card not picked yet and cardToBeat is not trump\n // then find the lowest trump\n if ((pickedCard == null) && (cardToBeat.suit != trump))\n for (Card card : cardsToChooseFrom)\n if (card.suit == trump)\n if ((pickedCard == null) || (pickedCard.rank > card.rank))\n pickedCard = card;\n\n // (trying to throw the lowest)\n // if still no card picked (means player cannot take the trick)\n // then throw the lowest non trump\n if (pickedCard == null)\n for (Card card : cardsToChooseFrom)\n if (card.suit != trump)\n if ((pickedCard == null) || (pickedCard.rank > card.rank))\n pickedCard = card;\n\n // (trying to throw the lowest)\n // if still no card picked (means all allowed cards are trump)\n // then throw the lowest trump\n if (pickedCard == null)\n for (Card card : cardsToChooseFrom)\n if ((pickedCard == null) || (pickedCard.rank > card.rank))\n pickedCard = card;\n\n if (pickedCard == null)\n System.out.println(\"Error: picked card still null\");\n\n pitchTable.putOnPile(pickedCard);\n hand.remove(pickedCard);\n\n }", "public Card getActivePlayerOneCard()\n\t{\n\t\treturn activePlayerOneCard;\n\t}", "@Override\r\n public PlayingCard comparePlayingCards(PlayingCard cardOne, PlayingCard cardTwo){\r\n if(cardOne.getRank().ordinal() > cardTwo.getRank().ordinal()){\r\n return cardOne;\r\n }\r\n else if(cardTwo.getRank().ordinal() > cardOne.getRank().ordinal()){\r\n return cardTwo;\r\n }\r\n else {\r\n return null;\r\n }\r\n }", "public Card getPresentCard() {\n return storageCards.peek();\n }", "private Creature findLeader(Game game){\n Creature lead = facCreatures.firstElement();\n // App.log(\"Leader of \" + fFaction.getName() + \" is \" + lead);\n return lead;\n }", "public int deal(){\n\t\tint topCard = deck[top];\n\t\ttop--;\n\t\treturn topCard;\n\t}", "public String showFirstRoundCards() {\n String message = \"[ Unknown \";\n message += personHand.get(1) + \" ]\";\n return message;\n }", "public Card drawCard() {\n Card c = cards.get(0);//get a card\n cards.remove(0);//remove the card form the deck that's given out\n discard.add(c);//so the card given out is added to the discard list\n return c;//return a card object\n\n }", "public Card giveCard()\n {\n return deck.pop();\n }", "public TrainCard usedCard(){\n TrainCard removedCard = cardDeck.remove(0);\n return removedCard;\n }", "public Card getCardAtLocation(int index)\n {\n if (index < cards.size())\n return cards.get(index);\n \n return null;\n }", "public T getFirst() {\n\treturn _front.getCargo();\n }", "public Card getCard(int index)\n {\n if( index <0 || index >=52)\n return null;\n\n return cardAry[index];\n }", "public Card getWinningCard() {\n return winningCard;\n }", "public Card drawCard() {\n\t\tCard c = cards.get(0);\n\t\tcards.remove(0);\n\n\t\treturn c;\n\t}", "private int GetBestCard(Card[] card) {\n\t int iPos = 0;\n\t int iWeightTemp = 0;\n\t int iWeight[] = new int[8];\n\t for (int i = 0; i < 8; i++){\n\t\t iWeight[i] = -1;\n\t }\n\t // For each selectable card, work out a weight, the highest weight is the one selected.\n\t // The weight is worked out by the distance another of the players cards is from playable ones, with no playable cards in between\n\t Card myCard, nextCard;\n\t for (int i = 0; i < 8; i++){\n\t\t if (card[i] != null){\n\t\t\t // if card value > 7\n\t\t\t if (card[i].GetValue() > 7){\n\t\t\t\t // do you have cards that are higher than this card\n\t\t\t\t myCard = card[i];\n\t\t\t\t iWeightTemp = 0;\n\t\t\t \tfor (int j = 0; j < mCardCount; j++){\n\t\t\t \t\tnextCard = mCard[j];\n\t\t\t \t\tif (nextCard != null && nextCard.GetSuit() == myCard.GetSuit() && nextCard.GetValue() > myCard.GetValue()){\n\t\t\t \t\t\tif (nextCard.GetValue() - myCard.GetValue() > iWeightTemp)\n\t\t\t \t\t\t\tiWeightTemp = nextCard.GetValue() - myCard.GetValue();\n\t\t\t \t\t\tmyCard = nextCard;\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \tiWeight[i] = iWeightTemp;\n\t\t\t \t\t\n\t\t\t }\n\t\t\t if (card[i].GetValue() < 7){\n\t\t\t\t // do you have cards that are lower than this card\n\t\t\t\t myCard = card[i];\n\t\t\t\t iWeightTemp = 0;\n\t\t\t \tfor (int j = mCardCount-1; j >=0; j--){\n\t\t\t \t\tnextCard = mCard[j];\n\t\t\t \t\tif (nextCard != null && nextCard.GetSuit() == myCard.GetSuit() && nextCard.GetValue() < myCard.GetValue()){\n\t\t\t \t\t\tif (myCard.GetValue() - nextCard.GetValue() > iWeightTemp)\n\t\t\t \t\t\t\tiWeightTemp = myCard.GetValue() - nextCard.GetValue();\n\t\t\t \t\t\tmyCard = nextCard;\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \tiWeight[i] = iWeightTemp;\n\t\t\t \t\t\n\t\t\t }\t\n\t\t\t if (card[i].GetValue() == 7){\n\t\t\t\t // do you have cards that are in this suit\n\t\t\t\t myCard = card[i];\n\t\t\t\t int iWeightTemp1;\n\t\t\t\t iWeightTemp = 0;\n\t\t\t\t iWeightTemp1 = 0;\n\t\t\t\t // do you have cards that are higher than this card\n\t\t\t \tfor (int j = 0; j < mCardCount; j++){\n\t\t\t \t\tnextCard = mCard[j];\n\t\t\t \t\tif (nextCard != null && nextCard.GetSuit() == myCard.GetSuit() && nextCard.GetValue() > myCard.GetValue()){\n\t\t\t \t\t\tif (nextCard.GetValue() - myCard.GetValue() > iWeightTemp)\n\t\t\t \t\t\t\tiWeightTemp = nextCard.GetValue() - myCard.GetValue();\n\t\t\t \t\t\tmyCard = nextCard;\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \tmyCard = card[i];\n\t\t\t \t// do you have cards that are lower than this card\n\t\t\t \tfor (int j = mCardCount-1; j >=0; j--){\n\t\t\t \t\tnextCard = mCard[j];\n\t\t\t \t\tif (nextCard != null && nextCard.GetSuit() == myCard.GetSuit() && nextCard.GetValue() < myCard.GetValue()){\n\t\t\t \t\t\tif (myCard.GetValue() - nextCard.GetValue() > iWeightTemp1)\n\t\t\t \t\t\t\tiWeightTemp1 = myCard.GetValue() - nextCard.GetValue();\n\t\t\t \t\t\tmyCard = nextCard;\n\t\t\t \t\t}\n\t\t\t \t} \t\n\t\t\t \tiWeight[i] = iWeightTemp + iWeightTemp1;\n\t\t\t \t\t\n\t\t\t }\t\t\t \n\t\t }\n\t\t \t \n\t }\n\t boolean bLoopAceKing = true;\n\t int iMaxTemp = 0;\n\t int iMaxCount = 0;\t\n\t int[] iMaxs;\n\t iMaxs = new int[8];\n\t while (bLoopAceKing){\n\t\t for (int i = 0; i < 8; i++){\n\t\t\t if (iWeight[i] >= iMaxTemp){\n\t\t\t\t if (iWeight[i] == iMaxTemp){\n\t\t\t\t\t iMaxs[iMaxCount] = i;\n\t\t\t\t\t iMaxCount++;\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t\t iMaxTemp = iWeight[i];\n\t\t\t\t\t iMaxs = new int[8];\n\t\t\t\t\t iMaxCount = 0;\n\t\t\t\t\t iMaxs[iMaxCount] = i;\n\t\t\t\t\t iMaxCount++;\n\t\t\t\t }\t\t\t \n\t\t\t }\t \n\t\t }\n\t\t boolean bAceKing = false;\n\t\t // If the top weight is zero, meaning your options don't help you, then play the one that is closest to ace/king\n\t\t if (iMaxTemp == 0 && iMaxCount > 1){\n\t\t\t for (int k = 0; k < iMaxCount; k++){\n\t\t\t\t\t iWeight[iMaxs[k]] = Math.abs(card[iMaxs[k]].GetValue()-7);\n\t\t\t\t\t bAceKing = true;\t\t\t\t \n\t\t\t } \t\t \n\t\t }\n\t\t if (bAceKing){\n\t\t\t bLoopAceKing = true;\n\t\t\t iMaxs = new int[8];\n\t\t\t iMaxTemp = 0;\n\t\t\t iMaxCount = 0;\t\t\t \n\t\t }\n\t\t else \n\t\t\t bLoopAceKing = false;\n\t }\n\t if (iMaxCount == 1)\n\t\t iPos = iMaxs[iMaxCount-1];\n\t else {\n\t\t Random generator = new Random();\n\t\t int randomIndex = generator.nextInt( iMaxCount );\n\t\t iPos = iMaxs[randomIndex];\n\t }\n\t\t \n\t return iPos;\n\t \n }", "@Override\n public Card playCard() {\n List<Card> rank1 = new ArrayList<>();\n List<Card> rank2 = new ArrayList<>();\n List<Card> rank3 = new ArrayList<>();\n List<Card> rank4 = new ArrayList<>();\n for (Card card : cardsInHand) {\n if (card.getRank().equals(Card.Rank.EIGHT)) {\n rank1.add(card);\n break;\n } else if (card.getSuit().equals(idealSuit)\n && card.getRank().equals(idealRank)\n && (topCard.getSuit().equals(card.getSuit())\n || topCard.getRank().equals(card.getRank()))) {\n rank2.add(card);\n } else if ((card.getSuit().equals(idealSuit) || card.getRank().equals(idealRank))\n && (topCard.getSuit().equals(card.getSuit())\n || topCard.getRank().equals(card.getRank()))) {\n rank3.add(card);\n } else if (topCard.getSuit().equals(card.getSuit())\n || topCard.getRank().equals(card.getRank())) {\n rank4.add(card);\n }\n }\n List<List<Card>> playPossibilities = new ArrayList<>(Arrays.asList(rank1, rank2, rank3, rank4));\n for (List<Card> list : playPossibilities) {\n if (list.size() > 0) {\n cardsInHand.remove(list.get(0));\n return list.get(0);\n }\n }\n // This method will never return null if shouldDrawCard() is called beforehand.\n return null;\n }", "private Card drawCard() {\n return cardStack.pop();\n }", "public void returnCard(Card newCard)\n {\n if(!isEmpty())\n {\n newCard.setNext(top);\n top = newCard;\n }\n else\n {\n top = newCard;\n }\n \n size++;\n }", "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}", "public AbstractCard getPreviousCard() {\n if (currentCardPos > 0) {\n currentCardPos--;\n }\n return getCurrentCard();\n }", "public Card hit() {\n Card drawn = deck.get(0);\n deck.remove(0);\n return drawn;\n }", "public Card bestEight()\n {\n String mostSuit = \"\";\n int most = 0;\n Hashtable<String, Integer> cardSuit = new Hashtable<String, Integer>();\n //Count the number of cards in players hand for each suit\n for(Card cardInHand: this.hand)\n {\n String suit = cardInHand.getSuit();\n if(cardSuit.containsKey(suit))\n {\n cardSuit.put(suit, cardSuit.get(suit) + 1);\n }\n else\n {\n cardSuit.put(suit, 1);\n }\n }\n //find the highest one.\n for(String key: cardSuit.keySet())\n {\n if(cardSuit.get(key) > most) {\n mostSuit = key;\n most = cardSuit.get(key);\n }\n }\n return new Card(mostSuit, \"8\");\n }", "public ArrayList<DevelopmentCard> getTopCards() {\n ArrayList<DevelopmentCard> devCards = new ArrayList<>();\n for (ObservableList<DevelopmentCard> devPlace : devStack) {\n if (devPlace.isEmpty()) {\n devCards.add(null);\n } else\n devCards.add(devPlace.get(devPlace.size() - 1));\n }\n return devCards;\n }", "public Cards getLastCard() {\n return playedCards.get(playedCards.size()-1);\n }", "public Card pop()\n {\n if (firstLink == null)\n return null;\n\n Card result = firstLink.getCard();\n firstLink = firstLink.getNext();\n return result;\n }", "Card getCard(UUID cardId);", "public Card drawFromCommunityChest()\n {\n Random draw = new Random();\n \n //if the chance cards are exhausted, re-fill the cards\n if(m_communityChest.size() == 0)\n {\n m_communityChest = m_drawnCommChest;\n m_drawnCommChest.clear();\n }\n \n //draw a random card and add it to the list of the cards drawn\n int drawFrom = draw.nextInt(m_chance.size() - 1) + 1;\n Card card = m_communityChest.remove(drawFrom);\n m_drawnCommChest.add(card);\n\n return card;\n }" ]
[ "0.7674718", "0.75212044", "0.75083697", "0.734372", "0.7335476", "0.7319658", "0.7213147", "0.7207829", "0.71750003", "0.7168074", "0.7116564", "0.7066478", "0.70524395", "0.70011413", "0.6967423", "0.6952317", "0.6901841", "0.68441325", "0.6830491", "0.6812834", "0.67007244", "0.6695164", "0.66818976", "0.6672526", "0.6655691", "0.66315573", "0.6607456", "0.6585572", "0.656599", "0.6536313", "0.65164804", "0.65019315", "0.64932704", "0.6487057", "0.6478619", "0.64663476", "0.6433919", "0.63819396", "0.63795555", "0.63751304", "0.63137704", "0.6311261", "0.626791", "0.6258976", "0.6243885", "0.6227704", "0.6224083", "0.62068146", "0.6204619", "0.6201654", "0.6189797", "0.61886877", "0.6186239", "0.61761886", "0.6157247", "0.61516464", "0.61498755", "0.61427563", "0.6129182", "0.612878", "0.61171657", "0.6108656", "0.6094599", "0.60835075", "0.6075232", "0.60729337", "0.606752", "0.60558444", "0.60297257", "0.60267055", "0.60260904", "0.6020174", "0.60188174", "0.6018549", "0.60020036", "0.60009634", "0.5999178", "0.5990061", "0.5987832", "0.5986018", "0.5980631", "0.59759706", "0.5969724", "0.5943789", "0.59416246", "0.5918356", "0.5908793", "0.5902161", "0.5899673", "0.5898865", "0.5894713", "0.58807343", "0.5870087", "0.5869916", "0.5862034", "0.5857709", "0.583377", "0.5821673", "0.5806168", "0.57982945" ]
0.6123984
60
TODO Autogenerated method stub
public static void main(String[] args) { int row, col; Scanner s = new Scanner(System.in); System.out.println("Enter number of rows for matrix: "); row = s.nextInt(); System.out.println("Enter number of columns for matrix: "); col = s.nextInt(); int[][] mat1 = new int[row][col]; System.out.println("Enter the elements"); for (int i = 0; i < row; i++) { for (int j = 0; j < col; j++) { System.out.println("Enter [" + i + "][" + j + "] : "); mat1[i][j] = s.nextInt(); } } int[][] mat2 = new int[row][col]; System.out.println("Enter the elements"); for (int i = 0; i < row; i++) { for (int j = 0; j < col; j++) { System.out.println("Enter [" + i + "][" + j + "] : "); mat2[i][j] = s.nextInt(); } } int[][] res = new int[row][col]; for (int i = 0; i < row; i++) { for (int j = 0; j < col; j++) { res[i][j] = mat1[i][j] + mat2[i][j]; } } System.out.println("The result of matrix addition is"); for (int i = 0; i < row; i++) { for (int j = 0; j < col; j++) { System.out.print(res[i][j]+ " "); } System.out.println(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.66708666", "0.65675074", "0.65229905", "0.6481001", "0.64770633", "0.64584893", "0.6413091", "0.63764185", "0.6275735", "0.62541914", "0.6236919", "0.6223816", "0.62017626", "0.61944294", "0.61944294", "0.61920846", "0.61867654", "0.6173323", "0.61328775", "0.61276996", "0.6080555", "0.6076938", "0.6041293", "0.6024541", "0.6019185", "0.5998426", "0.5967487", "0.5967487", "0.5964935", "0.59489644", "0.59404725", "0.5922823", "0.5908894", "0.5903041", "0.5893847", "0.5885641", "0.5883141", "0.586924", "0.5856793", "0.58503157", "0.58464456", "0.5823378", "0.5809384", "0.58089525", "0.58065355", "0.58065355", "0.5800514", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57896614", "0.5789486", "0.5786597", "0.5783299", "0.5783299", "0.5773351", "0.5773351", "0.5773351", "0.5773351", "0.5773351", "0.5760369", "0.5758614", "0.5758614", "0.574912", "0.574912", "0.574912", "0.57482654", "0.5732775", "0.5732775", "0.5732775", "0.57207066", "0.57149917", "0.5714821", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57115865", "0.57045746", "0.5699", "0.5696016", "0.5687285", "0.5677473", "0.5673346", "0.56716853", "0.56688815", "0.5661065", "0.5657898", "0.5654782", "0.5654782", "0.5654782", "0.5654563", "0.56536144", "0.5652585", "0.5649566" ]
0.0
-1
Creates and starts the dev mode handler if none has been started yet.
public ViteHandler(Lookup lookup, int runningPort, File npmFolder, CompletableFuture<Void> waitFor) { super(lookup, runningPort, npmFolder, waitFor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void start() {\n\t\t\n\t\t_mode.init();\n\t\t\n\t\t_mode.start();\n\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 startHandler() {\n mHandler = new MessageHandler();\n }", "public static void start() {\n // TODO(xingliu): Find a better way to access feature in Java code.\n // https://crbug.com/1017860.\n if (!ChimeSessionJni.get().isEnabled() || sRegistered) return;\n\n // Install the DFM and then reigster.\n if (ChimeModule.isInstalled()) {\n registerChimeInternal();\n return;\n }\n\n ChimeModule.install((success) -> {\n if (success) registerChimeInternal();\n });\n }", "public void onCreate() {\n Log.i(TAG, \"MinaClient create\");\r\n\r\n Thread thread = new Thread(this);\r\n thread.start();\r\n\r\n CommandHandle.getInstance().setContext(getApplicationContext());\r\n }", "@Override\n protected void onStart() {\n super.onStart();\n BugSenseHandler.startSession(this);\n }", "@Override\r\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\",\r\n Process.THREAD_PRIORITY_BACKGROUND);\r\n thread.start();\r\n\r\n // Get the HandlerThread's Looper and use it for our Handler\r\n mServiceLooper = thread.getLooper();\r\n mServiceHandler = new ServiceHandler(mServiceLooper);\r\n }", "@Override\n\tpublic void onConnCreate() {\n\t\tapp.start();\n setEnabled( false );\n\t}", "@Override\n\tpublic void onCreate() {\n\t\t\n\t\tHandlerThread thread = new HandlerThread(\"ServiceStartArguments\",\n\t\t\t\tProcess.THREAD_PRIORITY_BACKGROUND);\n\t\tthread.start();\n\t\t// Get the HandlerThread's Looper and use it for our Handler\n\t\tmServiceLooper = thread.getLooper();\n\t\tmServiceHandler = new ServiceHandler(mServiceLooper);\n\t}", "private void startDebugControlThread() {\n String dbgCtrlFile = System.getProperty(\"DEBUG_CONTROL\");\n dbgCtrlThread = new DebugControlThread(this, dbgCtrlFile, 1000);\n executorService.submit(dbgCtrlThread);\n }", "public ConsoleHandler createConsoleHandler () {\r\n\t\t\t\r\n\t\tConsoleHandler consoleHandler = null;\r\n\t\t\t\r\n\t\ttry {\r\n\t\t \t\r\n\t\t\tconsoleHandler = new ConsoleHandler();\r\n\t\t\t\t\r\n\t\t} catch (SecurityException e) {\r\n\t\t\t\t\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t \r\n\t\t return consoleHandler;\r\n\t}", "@Override\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\", Process.THREAD_PRIORITY_BACKGROUND);\n thread.start();\n\n //Get the HandlerThread's Looper and use it for ur Handler\n mServiceLooper = thread.getLooper();\n mServiceHandler = new ServiceHandler(mServiceLooper);\n }", "@Override\r\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\",\r\n 10);\r\n thread.start();\r\n\r\n // Get the HandlerThread's Looper and use it for our Handler\r\n serviceLooper = thread.getLooper();\r\n serviceHandler = new ServiceHandler(serviceLooper);\r\n }", "@Override\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\");\n thread.start();\n\n // Get the HandlerThread's Looper and use it for our Handler\n mLooper = thread.getLooper();\n mServiceHandle = new ServiceHandle(mLooper);\n }", "public void start() {\n\t\tSystem.out.println(\"Starting new application\");\n\t\texec.init(this);\n\t\tthread = new Thread(this);\n\t\trunning = true;\n\t\tgd.setFullScreenWindow(screen.getFrame());\n\t\tscreen.getFrame().setVisible(true);\n\t\tthread.start();\n\t}", "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 }", "public void onCreate() {\n super.onCreate();\n // An Android handler thread internally operates on a looper.\n mHandlerThread = new HandlerThread(\"HandlerThreadService.HandlerThread\", Process.THREAD_PRIORITY_BACKGROUND);\n mHandlerThread.start();\n // An Android service handler is a handler running on a specific background thread.\n mServiceHandler = new ServiceHandler(mHandlerThread.getLooper());\n\n // Get access to local broadcast manager\n mLocalBroadcastManager = LocalBroadcastManager.getInstance(this);\n }", "public void start(){\n LogManager.getLogManager().reset();\r\n\r\n // Get the logger for \"org.jnativehook\" and set the level to off.\r\n Logger logger = Logger.getLogger(GlobalScreen.class.getPackage().getName());\r\n logger.setLevel(Level.OFF);\r\n try {\r\n GlobalScreen.registerNativeHook();\r\n } catch (NativeHookException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n GlobalScreen.addNativeKeyListener(new KeyboardHook());\r\n\r\n }", "public void start() {\n m_enabled = true;\n }", "public void startFactory() {\n if (!isStarted) {\n logger.info(\"Starting SessionListenerFactory.\");\n APIEventBus.getInstance().subscribe(this);\n isStarted = true;\n }\n }", "public void activateOptions() {\n try {\n sh = new SocketHandler(port);\n sh.start();\n }\n catch(InterruptedIOException e) {\n Thread.currentThread().interrupt();\n e.printStackTrace();\n } catch(IOException e) {\n e.printStackTrace();\n } catch(RuntimeException e) {\n e.printStackTrace();\n }\n super.activateOptions();\n }", "public void start()\n/* 354: */ {\n/* 355:434 */ onStartup();\n/* 356: */ }", "public X10ToggleBreakpointsHandler() {\r\n final IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(HANDLER_EXTENSION_POINT_ID);\r\n if (extensionPoint != null) {\r\n for (final IConfigurationElement configElement : extensionPoint.getConfigurationElements()) {\r\n try {\r\n final String backEndType = configElement.getAttribute(BACKEND_TYPE_ATTR);\r\n if (CPP_BACKEND.equals(backEndType)) {\r\n this.fCPPNatureHandler = (IToggleBreakpointsHandler) configElement.createExecutableExtension(CLASS_ATTR);\r\n } else if (JAVA_BACKEND.equals(backEndType)) {\r\n this.fJavaNatureHandler = (IToggleBreakpointsHandler) configElement.createExecutableExtension(CLASS_ATTR);\r\n }\r\n } catch (CoreException except) {\r\n LaunchCore.log(except.getStatus());\r\n }\r\n }\r\n }\r\n }", "public void start() {\n\t\tSystem.out.println(\"开启系统1\");\r\n\t}", "@Override\n public void start() {\n // only start once, this is not foolproof as the active flag is set only\n // when the watchdog loop is entered\n if ( isActive() ) {\n return;\n }\n\n Log.info( \"Running server with \" + server.getMappings().size() + \" mappings\" );\n try {\n server.start( HTTPD.SOCKET_READ_TIMEOUT, false );\n } catch ( IOException ioe ) {\n Log.append( HTTPD.EVENT, \"ERROR: Could not start server on port '\" + server.getPort() + \"' - \" + ioe.getMessage() );\n System.err.println( \"Couldn't start server:\\n\" + ioe );\n System.exit( 1 );\n }\n\n if ( redirectServer != null ) {\n try {\n redirectServer.start( HTTPD.SOCKET_READ_TIMEOUT, false );\n } catch ( IOException ioe ) {\n Log.append( HTTPD.EVENT, \"ERROR: Could not start redirection server on port '\" + redirectServer.getPort() + \"' - \" + ioe.getMessage() );\n System.err.println( \"Couldn't start redirection server:\\n\" + ioe );\n }\n }\n\n // Save the name of the thread that is running this class\n final String oldName = Thread.currentThread().getName();\n\n // Rename this thread to the name of this class\n Thread.currentThread().setName( NAME );\n\n // very important to get park(millis) to operate\n current_thread = Thread.currentThread();\n\n // Parse through the configuration and initialize all the components\n initComponents();\n\n // if we have no components defined, install a wedge to keep the server open\n if ( components.size() == 0 ) {\n Wedge wedge = new Wedge();\n wedge.setLoader( this );\n components.put( wedge, getConfig() );\n activate( wedge, getConfig() );\n }\n\n Log.info( LogMsg.createMsg( MSG, \"Loader.components_initialized\" ) );\n\n final StringBuffer b = new StringBuffer( NAME );\n b.append( \" v\" );\n b.append( VERSION.toString() );\n b.append( \" initialized - Loader:\" );\n b.append( Loader.API_NAME );\n b.append( \" v\" );\n b.append( Loader.API_VERSION );\n b.append( \" - Runtime: \" );\n b.append( System.getProperty( \"java.version\" ) );\n b.append( \" (\" );\n b.append( System.getProperty( \"java.vendor\" ) );\n b.append( \")\" );\n b.append( \" - Platform: \" );\n b.append( System.getProperty( \"os.arch\" ) );\n b.append( \" OS: \" );\n b.append( System.getProperty( \"os.name\" ) );\n b.append( \" (\" );\n b.append( System.getProperty( \"os.version\" ) );\n b.append( \")\" );\n Log.info( b );\n\n // enter a loop performing watchdog and maintenance functions\n watchdog();\n\n // The watchdog loop has exited, so we are done processing\n terminateComponents();\n\n Log.info( LogMsg.createMsg( MSG, \"Loader.terminated\" ) );\n\n // Rename the thread back to what it was called before we were being run\n Thread.currentThread().setName( oldName );\n\n }", "@SuppressLint(\"HandlerLeak\")\n @Override\n public void run() {\n final LocalHTTPD localHttpd = new LocalHTTPD(getFilesDir(),\n prefs.getBoolean(\"use_https\", false));\n\n Looper.prepare(); // must be run before creating a Handler\n webServerThreadHandler = new Handler() {\n @Override\n public void handleMessage(Message msg) {\n Log.i(TAG, \"we've been asked to stop the webserver: \" + msg.obj);\n localHttpd.stop();\n }\n };\n try {\n localHttpd.start();\n } catch (IOException e) {\n e.printStackTrace();\n }\n Looper.loop(); // start the message receiving loop\n }", "public void start() {\n _serverRegisterProcessor = new ServerRegisterProcessor();\n _serverRegisterProcessor.start();\n }", "public void startEventHandler() {\n Thread eventThread = new Thread(this, \"Nxt Event Handler\");\n eventThread.setDaemon(true);\n eventThread.start();\n }", "public void activateConsoleMode() {\n logger.addHandler(mConsoleHandler);\n }", "private synchronized void startEventThread() {\n if (eventThread == null) {\n eventThread = new EventHandlingThread(context);\n eventThread.setDaemon(true);\n eventThread.start();\n }\n }", "@Override\n\tpublic void start() {\n\t\tif(Boolean.parseBoolean(this.configuration.get(ConfigurationEnum.KEYBOARD_LISTENER_ACTIVE.toString()))){\n\t\t\tthis.keyboardListener.registerNativeHook();\n\t\t\tthis.keyboardListenerIsActive = true;\n\t\t}\n\t\t//If the mouse listener is active by configuration\n\t\tif(Boolean.parseBoolean(this.configuration.get(ConfigurationEnum.MOUSE_LISTENER_ACTIVE.toString()))){\n\t\t\tthis.mouseListener.registerNativeHook();\n\t\t\tthis.mouseListenerIsActive = true;\n\t\t}\n\t\t//If the mouse motion listener is active by configuration\n\t\tif(Boolean.parseBoolean(this.configuration.get(ConfigurationEnum.MOUSE_LISTENER_ACTIVE.toString()))){\n\t\t\tthis.mouseMotionListener.registerNativeHook();\n\t\t\tthis.mouseMotionListenerIsActive = true;\n\t\t}\n\t\t//If the mouse wheel listener is active by configuration\n\t\tif(Boolean.parseBoolean(this.configuration.get(ConfigurationEnum.MOUSE_WHEEL_LISTENER_ACTIVE.toString()))){\n\t\t\tthis.mouseWheelListener.registerNativeHook();\n\t\t\tthis.mouseWheelListenerIsActive = true;\n\t\t}\n\t}", "@Override\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\", THREAD_PRIORITY_BACKGROUND);\n thread.start();\n Log.d(\"LOG19\", \"DiscoveryService onCreate\");\n\n this.mLocalBroadCastManager = LocalBroadcastManager.getInstance(this);\n // Get the HandlerThread's Looper and use it for our Handler\n mServiceLooper = thread.getLooper();\n\n mServiceHandler = new ServiceHandler(mServiceLooper);\n }", "public static native int initDevice(int fd);", "@Activate\n protected void start(BundleContext bundleContext) throws Exception {\n log.info(\"Service Component is activated\");\n\n // Create Stream Processor Service\n EditorDataHolder.setDebugProcessorService(new DebugProcessorService());\n EditorDataHolder.setSiddhiManager(new SiddhiManager());\n EditorDataHolder.setBundleContext(bundleContext);\n\n serviceRegistration = bundleContext.registerService(EventStreamService.class.getName(),\n new DebuggerEventStreamService(), null);\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 }", "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 StartupHandler(){\r\n\t\tloadGameFiles();\r\n\t\tnew Engine();\r\n\t}", "public void start() {\n\t\tstartFilesConfig(true);\n\t\tstartSpamFilterTest(false);\n\t}", "private void startDeviceActivity() {\n\n\t\tIntent i = new Intent(MainActivity.this, DeviceService.class);\n\t\ti.putExtra(DeviceActivity.EXTRA_DEVICE, mBluetoothDevice);\n\t\tMainActivity.this.startService(i);\n\n\t\tToast.makeText(MainActivity.this,\n\t\t\t\t\"Starting SensorTag tracking in the background\",\n\t\t\t\tToast.LENGTH_LONG).show();\n\t}", "public void checkHandler()\n {\n ContextManager.checkHandlerIsRunning();\n }", "public static void start() {\n enableIncomingMessages(true);\n }", "public void start() {\n \t\tinit();\n\t\tif(!checkBackend()){\n\t\t\tvertx.createHttpServer().requestHandler(new Handler<HttpServerRequest>() {\n\t\t\t\tpublic void handle(HttpServerRequest req) {\n\t\t\t\t String query_type = req.path();\t\t\n\t\t\t\t req.response().headers().set(\"Content-Type\", \"text/plain\");\n\t\t\t\t\n\t\t\t\t if(query_type.equals(\"/target\")){\n\t\t\t\t\t String key = req.params().get(\"targetID\");\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tprocessRequest(key,req);\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t else {\n\t\t\t\t\t String key = \"1\";\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tprocessRequestRange(key,req);\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t } \n\t\t\t}).listen(80);\n\t\t} else {\n\t\t\tSystem.out.println(\"Please make sure that both your DCI are up and running\");\n\t\t\tSystem.exit(0);\n\t\t}\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 }", "@Override\n public void onCreate() {\n if (DEBUG) {\n Log.d(TAG, \"start\");\n }\n super.onCreate();\n init();\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 }", "public void startThread() {\n\t\tpm = (PowerManager) getSystemService(Context.POWER_SERVICE);\n\t\twl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, \"My Tag\");\n\t\twl.acquire();\n\t\tthread = new FrameworkThread((Context) this);\n\t\tthread.start();\n\t}", "private void startLoggerService() {\n Intent intent = new Intent(this, GestureLoggerService.class);\n intent.putExtra(GestureLoggerService.EXTRA_START_SERVICE, true);\n\n startService(intent);\n }", "@Override\r\n\tprotected void onStart() {\n\t\tsuper.onStart();\r\n\t\tisModeSwitch=false;\r\n\t\tif (!TheApp.mApp.clientForeign()) {\r\n\t\t\tUpgradeManager.getInstance().BackStageNetWordCheck();\r\n\t\t}\r\n\t\tif (TheApp.mApp.windowManageView!=null) {\r\n\t\t\tLogCatUtils.showString(\"==removeView=====\");\r\n\t\t\tTheApp.mApp.windowManageView.removeView();\r\n\t\t}\r\n\t\tif (mCManager!=null) {\r\n\t\t\tmCManager.registerCallback(callbackImpl);\r\n\t\t}\r\n\t\tProgressDialog.getInstance().progressShow(R.string.camera_loading);\r\n\t\tProgressDialog.getInstance().enableCanceledOnTouchOutside(true);\r\n\t\tpreviewOverTimeRunTask();\r\n\t\tBundle outparam=new Bundle();\r\n\t\tSyuJniNative.getInstance().syu_jni_command(12, null, outparam);\r\n\t\tif (outparam!=null) {\r\n\t\t\tif (outparam.getInt(\"param0\",-1)==1) {\r\n\t\t\t\tDialog dialog=PublicClass.getInstance().NoCameraWarning(1);\r\n\t\t\t\tdialog.show();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tisonStop=false;\r\n\t\thandler.sendEmptyMessage(0);\r\n\t\thandler.sendEmptyMessageDelayed(3, 500);\r\n\t\tLogCatUtils.showString(\" onStart \" );\r\n\t}", "@Override\r\n\tprotected void onStart() {\n\t\tXSDK.getInstance().onStart();\r\n\t\tsuper.onStart();\r\n\t}", "@Override\r\n\tprotected void onStart() {\n\t\tLog.d(TAG, \"1 onStart start\");\r\n\t\tsuper.onStart();\r\n\t\tif(isDMR){\r\n\t\t\tbindTVnSreenService();\r\n\t\t}\r\n\t\t// mMediaHanler.sendEmptyMessage(START_PLAY);\r\n\t\tLog.d(TAG, \"2 onStart end\");\r\n\r\n\t}", "public void startPFD() {\r\n\t\tPFDStartEvent pfdStart = new PFDStartEvent();\r\n\t\ttry {\r\n\t\t\tpfdStart.asyncGo(this.zabChannel, Direction.DOWN);\r\n\t\t} catch (AppiaEventException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public static void start() {\n assert sListener == null;\n sListener = new ResourceListener();\n ResourceManager.getInstance().addListener(sListener);\n }", "@Override\n public boolean onCreate() {\n myDB = new MyDBHandler(getContext(), null, null, 1);\n return false;\n }", "@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}", "public CallAppAbilityConnnectionHandler createHandler() {\n EventRunner create = EventRunner.create();\n if (create != null) {\n return new CallAppAbilityConnnectionHandler(create);\n }\n HiLog.error(LOG_LABEL, \"createHandler: no runner.\", new Object[0]);\n return null;\n }", "@Override\n public void onCreate() {\n\n Thread proxy = new Thread(new proxyMainLoop());\n proxy.start();\n\n }", "@Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n\n boolean permissions_ok = true;\n for (String p : REQUIRED_PERMISSIONS) {\n if (ContextCompat.checkSelfPermission(this, p) != PackageManager.PERMISSION_GRANTED) {\n permissions_ok = false;\n break;\n }\n }\n\n if (permissions_ok) {\n //Check if the user has toggled the debug messages\n DEBUG = Aware.getSetting(this, Aware_Preferences.DEBUG_FLAG).equals(\"true\");\n\n //Initialize our plugin's settings\n Aware.setSetting(this, Settings.STATUS_PLUGIN_TEMPLATE, true);\n\n } else {\n Intent permissions = new Intent(this, PermissionsHandler.class);\n permissions.putExtra(PermissionsHandler.EXTRA_REQUIRED_PERMISSIONS, REQUIRED_PERMISSIONS);\n permissions.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(permissions);\n }\n\n return super.onStartCommand(intent, flags, startId);\n }", "private void init() {\n sensorEnabled = false;\n activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);\n contextEventHistory = new ArrayList<ContextEvent>(CONTEXT_EVENT_HISTORY_SIZE);\n }", "public void startHandler() {\n handler.postDelayed(runnable, 5 * 60 * 1000);\n Log.d(\"HandlerRun\", \"startHandlerMain\");\n }", "private void startWiperService()\n {\n\n /* 1.Initialize Native routine to set function pointers*/\n bWiperEnabled = native_wiper_init();\n if(Config.LOGD) Log.d(TAG,\"Wiper enabled \"+bWiperEnabled);\n /* Start New Wiper Thread*/\n if (bWiperEnabled)\n {\n mReceiver = new WiFiScanReceiver();\n // run event listener thread while we are enabled\n mWiperThread = new WiperBackgroundThread();\n mWiperThread.start();\n mHandler = new WiperMessageHandler(getMainLooper());\n\n }\n }", "private void start() {\r\n\t\t// Clear the log file.\r\n\t\tBPCC_Logger.clearLogFile();\r\n\t\t\r\n\t\t// Initialize BPCC_Util static fields.\r\n\t\tBPCC_Util.initStaticFields();\r\n\t\t\r\n\t\t// Set logging level desired for test.\r\n\t\tBPCC_Util.setLogLevel(LogLevelEnum.DEBUG);\r\n\t\t\r\n\t\t// Initialize class global variables.\r\n\t\tinitVars();\r\n\t\t\r\n\t\tcreateAndShowGUI();\r\n\t}", "private void startBackgroundThread() {\n backgroundHandlerThread = new HandlerThread(\"Camera2\");\n backgroundHandlerThread.start();\n backgroundHandler = new Handler(backgroundHandlerThread.getLooper());\n }", "private static boolean development() {\n final String mode = mode();\n return \"dev\".equalsIgnoreCase(mode);\n }", "public void onStart() {\n super.onStart();\n C0938a.m5006c(\"SR/SoundRecorder\", \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~onStart\");\n f5379a = true;\n }", "public void onStart() {\n\t\tnew Thread() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tinitConnection();\n\t\t\t\treceive();\n\t\t\t}\n\t\t}.start();\n\t}", "public void handleStart()\n {\n }", "public void start() {\n\n\t\tif (!started.compareAndSet(false, true)) {\n\t\t\treturn;\n\t\t}\n\n\t\tLOG.debug(\"Starting panel rendering and trying to open attached webcam\");\n\n\t\tstarting = true;\n\n\t\tif (updater == null) {\n\t\t\tupdater = new ImageUpdater();\n\t\t}\n\n\t\tupdater.start();\n\n\t\ttry {\n\t\t\terrored = !webcam.open();\n\t\t} catch (WebcamException e) {\n\n\t\t\terrored = true;\n\n\t\t\tDisplay.getDefault().syncExec(new Runnable() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tredraw();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthrow e;\n\t\t} finally {\n\t\t\tstarting = false;\n\t\t}\n\t}", "protected void 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 startOnNewTread() {\n stop();\n\n mReadLogsHandler = new ReadLogsHandler();\n\n mReadLogThread = new ReadLogsThread();\n mReadLogThread.start();\n }", "private void start() {\n \t\tisFinished = false;\n \t\trunning = true;\n \t\tpluginHandler.startAll();\n \t\tThread engine = new Thread(this, \"engine\");\n \t\tengine.start();\n \t\tissueHandler.checkAllIssues();\n \t}", "@RequiresApi(api = Build.VERSION_CODES.O)\n @Override\n public void onCreate() {\n super.onCreate();\n createVirtualEnvironment();\n createNotificationChannel();\n }", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tSystem.out.println(\"onStart...\");\n\t}", "public synchronized void start() throws DDEException\n {\n if (nativeDDEServer != 0)\n throw new DDEException(\"Already started.\");\n\n nativeStart(service);\n }", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\t//绑定服务时会调用onCreate方法,此时启动服务\n\t\tLocalProxy = new SynchronousProxyServer(Parameters.LocalProxyPort);\n\t\tLocalProxy.initial();\n\t\tLocalProxy.start();\n\t\tSystem.out.println(\"LocalProxy run on \" + Parameters.LocalProxyPort);\n\t}", "public void autonomousInit() {\n if (autonomousCommand != null) autonomousCommand.start();\n }", "public void activateFileMode() {\n try {\n mFileHandler = new FileHandler(\"messagesLog/\" + System.currentTimeMillis() + \".log\");\n } catch (IOException pE) {\n pE.printStackTrace();\n }\n logger.addHandler(mFileHandler);\n }", "public void start(){\n JmeFormatter formatter = new JmeFormatter();\n\n Handler consoleHandler = new ConsoleHandler();\n consoleHandler.setFormatter(formatter);\n\n Logger.getLogger(\"\").removeHandler(Logger.getLogger(\"\").getHandlers()[0]);\n Logger.getLogger(\"\").addHandler(consoleHandler);\n \n createCanvas(appClass);\n \n try {\n Thread.sleep(500);\n } catch (InterruptedException ex) {\n }\n \n SwingUtilities.invokeLater(new Runnable(){\n public void run(){\n JPopupMenu.setDefaultLightWeightPopupEnabled(false);\n\n createFrame();\n \n //currentPanel.add(canvas, BorderLayout.CENTER);\n mMainFrame.pack();\n startApp();\n mMainFrame.setLocationRelativeTo(null);\n mMainFrame.setVisible(true);\n }\n });\n \n \n }", "public AppiumDriverLocalService StartServer()\n\t{\n\t\tservice = AppiumDriverLocalService.buildDefaultService();\n\t\tservice.start();\n\t\treturn service;\n\t}", "synchronized void startDht() {\n if (useDht) {\n dhtTracker = new DhtTracker(settings.listenPort, kadId, null);\n dhtTracker.start();\n session.setDhtTracker(dhtTracker);\n Container<UInt32, NodeEntry> entries = loadDhtEntries();\n if (entries != null && entries.getList() != null) {\n dhtTracker.addEntries(entries.getList());\n log.info(\"[ED2K service] DHT load {} endpoints from previous run \", entries.size());\n } else {\n log.info(\"[ED2K service] DHT start from external endpoints list\");\n // unsynchronized check here - actually executor service must be created already\n if (scheduledExecutorService != null) {\n scheduledExecutorService.submit(new Initiator(session));\n }\n }\n }\n }", "@Override\n public void onCreate() {\n super.onCreate();\n handler = new Handler();\n BusProvider.register(this);\n }", "public void startLocalServer() {\n \t boolean exists = (new File(addeMcservl)).exists();\n \t if (exists) {\n \t // Create and start the thread if there isn't already one running\n\t \tif (thread != null) {\n \t \t\tthread = new AddeThread();\n \t \t\tthread.start();\n \t\t System.out.println(addeMcservl + \" was started\");\n \t \t} else {\n \t \t\tSystem.out.println(addeMcservl + \" is already running\");\n \t \t}\n \t } else {\n \t \tSystem.out.println(addeMcservl + \" does not exist\");\n \t }\n \t}", "public void start()\n {\n try\n {\n sshd.start();\n }\n catch (IOException e)\n {\n log.error(\"Unable to start ssdh.\", e);\n throw new RuntimeException(e);\n }\n }", "public void start() {\r\n if (MotoConfig.KEY_LOG) {\r\n Log.w(\"EglHelper\", \"start() tid=\" + Thread.currentThread().getId());\r\n }\r\n /*\r\n * Get an EGL instance\r\n */\r\n mEgl = (EGL10) EGLContext.getEGL();\r\n\r\n /*\r\n * Get to the default display.\r\n */\r\n mEglDisplay = mEgl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);\r\n\r\n if (mEglDisplay == EGL10.EGL_NO_DISPLAY) {\r\n throw new RuntimeException(\"eglGetDisplay failed\");\r\n }\r\n\r\n /*\r\n * We can now initialize EGL for that display\r\n */\r\n int[] version = new int[2];\r\n if(!mEgl.eglInitialize(mEglDisplay, version)) {\r\n throw new RuntimeException(\"eglInitialize failed\");\r\n }\r\n mEglConfig = mEGLConfigChooser.chooseConfig(mEgl, mEglDisplay);\r\n\r\n /*\r\n * Create an EGL context. We want to do this as rarely as we can, because an\r\n * EGL context is a somewhat heavy object.\r\n */\r\n mEglContext = mEGLContextFactory.createContext(mEgl, mEglDisplay, mEglConfig);\r\n if (mEglContext == null || mEglContext == EGL10.EGL_NO_CONTEXT) {\r\n mEglContext = null;\r\n throw new EglCreateContextException(\"createContext\");\r\n }\r\n if (MotoConfig.KEY_LOG) {\r\n Log.d(\"EglHelper\", \"createContext \" + mEglContext \r\n \t\t+ \" tid=\" + Thread.currentThread().getId());\r\n }\r\n\r\n mEglSurface = null;\r\n }", "private static void setupOsgi() {\r\n FrameworkStarter.getInstance().start();\r\n }", "protected void onStart ()\n\t{\n\t\tsuper.onStart ();\n\t}", "@Override\n\tpublic void onStart() {\n\t\tnew Starfire();\n\t}", "@Override\r\n protected void start() throws StartException {\n\r\n if (!Main.INIT_COMPLETE.isReached()) startServer();\r\n new EDTRunner() {\r\n\r\n @Override\r\n protected void runInEDT() {\r\n initGUI();\r\n }\r\n };\r\n\r\n }", "public void onStart(){ \r\n\t\t//ensure bluetooth is enabled \r\n\t\tensureBluetoothIsEnabled();\r\n\t\tsuper.onStart(); \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 }", "private static native boolean isDevelopmentMode()/*-{\n return typeof $wnd.__gwt_sdm !== 'undefined';\n }-*/;", "public static void init()\n {\n debugger = new Debugger(\"log\");\n info = true;\n }", "@Override\n\tpublic void teleopInit() {\n\t\tbeenEnabled = true;\n\t\tif(!socket){\n\t\t\tlogger.startSocket(); socket = true;\n\t\t}\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\n\t\tcontext = this;\n\t\tstartService();\n\t}", "@Override\n public void onStart() {\n super.onStart();\n if (Util.SDK_INT > 23) {\n initializePlayer(this.getContext());\n }\n }", "private static void start()\r\n\t{\r\n\t\tif(isRunning)\r\n\t\t\treturn;\r\n\t\t\r\n\t\tisRunning = true;\r\n\t\t\r\n\t\tdisplay = new Display();\r\n\t\trun();\r\n\t}", "public boolean start() {\n\t\treturn true;\n\t}", "@Override\n protected void onStart() {\n Log.i(\"G53MDP\", \"Main onStart\");\n super.onStart();\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tBugSenseHandler.initAndStartSession(BaseActivity.this, CommConstant.BUGSENSE_KEY);\n\t\t\n//\t\t\tUtils.checkCurrentVersion(BaseActivity.this);\n\t\t\n\t\ttry {\n\t\t\tregisterReceiver(getServerSetting, new IntentFilter(\n\t\t\t\t\tCommConstant.SERVER_SETTING_SUCCESSFULLY));\n\t\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "public void start() {\n\t\tinstanceConfigUpdated();\n\n\t\tnew Thread(getUsageData, \"ResourceConsumptionManager : GetUsageData\").start();\n\n\t\tLoggingService.logInfo(MODULE_NAME, \"started\");\n\t}", "public void Start(){\n Registry registry = null;\n try{\n for(int i=0;i<nsize;i++){\n registry= LocateRegistry.getRegistry(this.ports[i]);\n PRMI stub = (PRMI) registry.lookup(\"DCMP\");\n System.out.println(\"env calls Init to man \"+i);\n stub.InitHandler(new Request(this.id, -1, 'e'));\n D++;\n }\n\n } catch(Exception e){\n return;\n }\n return;\n }" ]
[ "0.6037319", "0.5872171", "0.56782085", "0.56493306", "0.5614712", "0.55579126", "0.5554702", "0.5496359", "0.549542", "0.54908496", "0.5453966", "0.5418768", "0.5390908", "0.53599286", "0.53469175", "0.5346197", "0.5321708", "0.5315595", "0.531398", "0.5297808", "0.52952766", "0.5259043", "0.52582115", "0.5242957", "0.5222651", "0.52111214", "0.51707625", "0.51688266", "0.5160935", "0.51529473", "0.51310074", "0.5129431", "0.5126987", "0.5109186", "0.5094505", "0.50928646", "0.50648355", "0.506323", "0.5059162", "0.5050665", "0.50382406", "0.5032714", "0.5031888", "0.5028159", "0.50269264", "0.50142074", "0.5010124", "0.49986044", "0.49964598", "0.49922916", "0.49775144", "0.49763814", "0.49744338", "0.49724707", "0.4959463", "0.4957435", "0.4953609", "0.49467227", "0.4935866", "0.49280408", "0.49270797", "0.49247354", "0.49189222", "0.49182832", "0.49093518", "0.49038845", "0.48881924", "0.48875305", "0.48874512", "0.4885514", "0.4884701", "0.48830065", "0.48783955", "0.486363", "0.48547867", "0.4853157", "0.48519108", "0.485108", "0.4850408", "0.48493588", "0.48462072", "0.48428693", "0.48392752", "0.48371682", "0.48364702", "0.48298958", "0.4827959", "0.48238248", "0.48192695", "0.48173046", "0.4816844", "0.48106727", "0.4802984", "0.48020208", "0.4797533", "0.47939223", "0.4787229", "0.47866312", "0.4784847", "0.47846466", "0.47830972" ]
0.0
-1
Vite fails if the config is invalid, then the process exists Otherwise, errors are reported later on.
@Override protected Pattern getServerFailurePattern() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ConfigProcessNameAlreadyDefinedException()\n {\n }", "public InvalidProcessException() {}", "@Test\r\n @Deployment\r\n public void testUncaughtErrorSimpleProcess() {\n assertThatThrownBy(() -> runtimeService.startProcessInstanceByKey(\"process\"))\r\n .isInstanceOf(ProcessEngineException.class)\r\n .hasMessageContaining(\"no error handler\");\r\n }", "@Test\n public void AppProcNumError() {\n try{\n App.main(new String[]{TEST_PATH + \"input.dot\",\"yes\"});\n }catch(RuntimeException re){\n assertEquals(re.getMessage(),\"Invalid number of processors\");\n }\n }", "private void checkProcess(ProcessHandle.Info process) {\n if (process.command().toString().endsWith(\"RobloxPlayerBeta.exe]\")) {\n //Roblox has been found, set path\n path = process.command().toString();\n writePath();\n }\n }", "@Test\n public final void testValidate() {\n final CmdConfiguration config = new CmdConfiguration();\n try {\n config.validate();\n fail();\n } catch (RuntimeException e) {\n // expected because configuration is incomplete\n assertNotNull(e);\n }\n }", "protected void check() throws IOException, ServletException {\n if(value.length()==0)\n error(\"please specify the path to the RhapsodyCL.exe file\");\n else if(!value.contains(\"RhapsodyCL.exe\")) {\n \terror(\"didn't find RhapsodyCL.exe in the path !\");\n }else{\n \tok(); \t\n }\n }", "private synchronized void verifyVariantsWithProblems() {\r\n\t\tthreadInExecId.remove(Thread.currentThread().getId());\r\n\t\tif (threadInExecId.isEmpty()) {\r\n\t\t\tfinal Display display = Display.getDefault();\r\n\t\t\tif (display == null) {\r\n\t\t\t\tthrow new NullPointerException(\"Display is null\");\r\n\t\t\t}\r\n\t\t\tdisplay.syncExec(new Runnable() {\r\n\t\t\t\tpublic void run() {\r\n\t\t\t\t\tInvalidProductViewController invalidProductViewController = InvalidProductViewController\r\n\t\t\t\t\t\t\t.getInstance();\r\n\t\t\t\t\tinvalidProductViewController.showInvalidProduct();\r\n\r\n\t\t\t\t\tif (!ProjectConfigurationErrorLogger.getInstance()\r\n\t\t\t\t\t\t\t.getProjectsList().isEmpty()) {\r\n\t\t\t\t\t\tList<InvalidProductViewLog> logs = new LinkedList<InvalidProductViewLog>();\r\n\t\t\t\t\t\tfor (String s : ProjectConfigurationErrorLogger\r\n\t\t\t\t\t\t\t\t.getInstance().getProjectsList()) {\r\n\t\t\t\t\t\t\tlogs.add(new InvalidProductViewLog(s));\r\n\t\t\t\t\t\t\tSystem.out.println(s);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tinvalidProductViewController.adaptTo(logs\r\n\t\t\t\t\t\t\t\t.toArray(new InvalidProductViewLog[logs.size()]));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// Clear view\r\n\t\t\t\t\t\tinvalidProductViewController.clear();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t});\r\n\r\n\t\t}\r\n\r\n\t}", "@Test\n public void testNoConfig() throws Exception {\n String command = getCommandAllEnvVariables();\n FreeStyleBuild build = runBatchCommand(command);\n \n // Assert that the console log contains the output we expect\n checkBinUnset(build);\n checkMetricsUnset(build);\n }", "public Result check(ConfigContext context)\n {\n Result result;\n result = super.getInitializedResult();\n //<addition author=\"[email protected]\" [bug/RFE]-id=\"\" >\n // 8.0 XML Verifier\n /*try {\n Server server = (Server)context.getRootConfigBean();\n JmsService jms = server.getJmsService();\n String httpPort = jms.getPort();\n try {\n if(StaticTest.isPortValid(Integer.parseInt(httpPort))) \n result.passed(\"Valid Port\");\n else\n result.failed(\"Invalid JMSService Port - \" + httpPort);\n }\n catch(NumberFormatException e) {\n result.failed(\"Invalid JMSService Port Number - \" + httpPort);\n }\n // Bug : 4713369\n try {\n String timeout = jms.getInitTimeoutInSeconds();\n if(Integer.parseInt(timeout) < 0)\n result.failed(smh.getLocalString(getClass().getName()+\".initTimeoutNegative\",\"Init Timeout cannot be negative number\"));\n else\n result.passed(\"** Passed ** \");\n } catch(NumberFormatException e) {\n result.failed(smh.getLocalString(getClass().getName()+\".initTimeoutInvalid\",\"Init Timeout : invalid number\"));\n }\n }\n catch(Exception ex) {\n //<addition author=\"[email protected]\" [bug/rfe]-id=\"logging\" >\n /*ex.printStackTrace();\n result.failed(\"Exception : \" + ex.getMessage());\n // Logging\n _logger.log(Level.FINE, \"serverxmlverifier.exception\", ex);\n result.failed(\"Exception : \" + ex.getMessage());\n //</addition>\n }*/\n //</addition>\n return result;\n }", "boolean checkSubProcessDefinitionValid(ProcessDefinition processDefinition);", "private boolean executeOneConfig(JenkinsConfiguration unresolvedConfig, TptApiAccess tptApiAccess)\r\n throws InterruptedException {\r\n boolean success = true;\r\n if (!unresolvedConfig.isEnableTest()) {\r\n return true;\r\n }\r\n // Resolve $-vars in paths, test set and execution config names\r\n JenkinsConfiguration resolvedConfig = unresolvedConfig;\r\n if (build instanceof AbstractBuild) {\r\n resolvedConfig = unresolvedConfig.replaceAndNormalize(\r\n Utils.getEnvironment((AbstractBuild< ? , ? >)build, launcher, logger));\r\n }\r\n if (!(build instanceof AbstractBuild)) {\r\n // We cannot check all IDs beforehand for pipeline jobs so do it here\r\n if (!Utils.checkId(resolvedConfig, build, logger)) {\r\n return false;\r\n }\r\n }\r\n // Get necessery paths the user added in the job configuration:\r\n // These paths are resolved to work on the master.\r\n GetTestCasesCallableResult testCases = null;\r\n if (workspace == null) {\r\n logger.error(\"No workspace available\");\r\n return false;\r\n }\r\n FilePath testDataPath = new FilePath(workspace, Utils.getGeneratedTestDataDir(resolvedConfig));\r\n FilePath reportPath = new FilePath(workspace, Utils.getGeneratedReportDir(resolvedConfig));\r\n FilePath tptFilePath = new FilePath(workspace, resolvedConfig.getTptFile());\r\n try {\r\n logger.info(\"Create and/or clean test data directory \\\"\" + testDataPath.getRemote() + \"\\\"\");\r\n testDataPath.mkdirs();\r\n Utils.deleteFiles(testDataPath);\r\n logger.info(\"Create and/or clean report directory \\\"\" + reportPath.getRemote() + \"\\\"\");\r\n reportPath.mkdirs();\r\n reportPath.deleteContents();\r\n } catch (IOException e) {\r\n logger.error(\"Could not create or clear directories on master: \" + e.getMessage());\r\n return false;\r\n }\r\n // Register cleanup task that is called in the end to close remote TPT Project\r\n CleanUpCallable cleanUpCallable = new CleanUpCallable(listener, \"localhost\", tptPort,\r\n tptBindingName, exePaths, tptStartupWaitTime, tptFilePath);\r\n new CleanUpTask(build, cleanUpCallable, launcher);\r\n // Get the list of testcases via the TPT API\r\n testCases = tptApiAccess.getTestCases(tptFilePath, resolvedConfig.getConfiguration(),\r\n resolvedConfig.getTestSet());\r\n if (testCases == null) {\r\n logger.error(\"Unable to get test cases via TPT API.\");\r\n return false;\r\n }\r\n // Divide testcases into Workloads for the slave jobs to execute\r\n ArrayList<RetryableJob> retryableJobs = new ArrayList<>();\r\n // create test sets for slave jobs\r\n int slaveJobSize;\r\n int remainer;\r\n if (slaveJobCount >= 1) {\r\n slaveJobSize = testCases.testCases.size() / slaveJobCount;\r\n remainer = testCases.testCases.size() % slaveJobCount;\r\n } else {\r\n slaveJobSize = 1;\r\n remainer = 0;\r\n }\r\n ArrayList<List<String>> subTestSets =\r\n getSubTestSets(testCases.testCases, slaveJobSize, remainer);\r\n // start one job for every test set\r\n Job slaveJob = null;\r\n Jenkins jenkinsInstance = Jenkins.getInstanceOrNull();\r\n if (jenkinsInstance == null) {\r\n logger.error(\"No jenkins instance found\");\r\n return false;\r\n }\r\n for (Job j : jenkinsInstance.getAllItems(Job.class)) {\r\n if (j.getName().equals(slaveJobName)) {\r\n slaveJob = j;\r\n }\r\n }\r\n if (slaveJob == null) {\r\n logger.error(\"Slave Job \\\"\" + slaveJobName + \"\\\" not found\");\r\n return false;\r\n\r\n }\r\n for (List<String> subTestSet : subTestSets) {\r\n logger.info(\"Create job for \\\"\" + subTestSet + \"\\\"\");\r\n\r\n // creates the workloads for the slaves, with the smaller chunks of testsets\r\n WorkLoad workloadToAdd =\r\n new WorkLoad(unresolvedConfig, subTestSet, workspace, build, testDataPath, reportPath);\r\n // it adds the workloads to an static HashMap.\r\n WorkLoad.putWorkLoad(slaveJobName, workloadToAdd);\r\n // Creates a retryable job , there are the builds scheduled. So the logic is : We put a\r\n // workload in a static HashMap and then we trigger a build for a slave. In that way we are\r\n // distributing the builds on the slaves.\r\n RetryableJob retryableJob = new RetryableJob(slaveJobTries, logger, slaveJob);\r\n retryableJob.perform(build, listener);\r\n retryableJobs.add(retryableJob);\r\n }\r\n logger.info(\"Waiting for completion of child jobs.\");\r\n for (RetryableJob retryableJob : retryableJobs) {\r\n try {\r\n retryableJob.join();\r\n Result result = retryableJob.getResult();\r\n if (result != null && result.isWorseThan(Result.UNSTABLE)) {\r\n success = false;\r\n logger.error(\"Child job failed.\");\r\n }\r\n } catch (InterruptedException e) {\r\n logger.info(\"Stopping slave jobs.\");\r\n logger.interrupt(e.getMessage());\r\n for (RetryableJob retryableJobToCancle : retryableJobs) {\r\n retryableJobToCancle.cancel();\r\n }\r\n throw e;\r\n }\r\n }\r\n // Build Overview report:\r\n logger.info(\"Building overview report.\");\r\n boolean buildingReportWorked = tptApiAccess.runOverviewReport(tptFilePath,\r\n resolvedConfig.getConfiguration(), resolvedConfig.getTestSet(), reportPath, testDataPath);\r\n if (!buildingReportWorked) {\r\n logger.error(\"Building overview report did not work!\");\r\n }\r\n try {\r\n int foundTestData = 0;\r\n if (enableJunit) {\r\n logger.info(\"*** Publishing as JUnit results now ***\");\r\n foundTestData = Utils.publishAsJUnitResults(workspace, resolvedConfig, testDataPath,\r\n jUnitXmlPath, jUnitLogLevel, logger);\r\n logger.info(\"*** Publishing finished ***\");\r\n } else {\r\n foundTestData = Publish.getTestcases(testDataPath, logger).size();\r\n }\r\n if (foundTestData != testCases.testCaseCount) {\r\n // testCases.testCaseCount is some kind of maximal number of test cases that may have been\r\n // executed. Test set conditions are only able to reduce the number of executed test cases.\r\n // So, we found exaclty testCases.testCaseCount test results, we can assume that everything\r\n // is fine.\r\n if (foundTestData > testCases.testCaseCount) {\r\n logger.error(\"More test results found than test cases executed.\");\r\n return false;\r\n } else if (testCases.tptVersion.supportsTestCaseConditions()\r\n && !testCases.tptVersion.supportsTestCaseConditionAccess()) {\r\n logger.warn(\"Unable to check if all test results are present.\"\r\n + \" The used TPT version supports test set condtions but no API access to check if test\"\r\n + \" set condtions are configured. We found \" + foundTestData\r\n + \" test results and would expected to find \" + testCases.testCaseCount\r\n + \" without any test set conditions.\");\r\n } else if (testCases.tptVersion.supportsTestCaseConditionAccess()\r\n && testCases.testCaseConditionsPresent) {\r\n logger.warn(\"Unable to check if all test results are present. Some test sets use\"\r\n + \" test set condtions. Test set condtions cannot be evaluated to calculate the number\"\r\n + \" of executed test cases. We found \" + foundTestData\r\n + \" test results and would expected to find \" + testCases.testCaseCount\r\n + \" without any test set conditions.\");\r\n } else {\r\n logger.error(\r\n \"Found only \" + foundTestData + \" of \" + testCases.testCaseCount + \" test results.\");\r\n return false;\r\n }\r\n }\r\n } catch (RemoteException e) {\r\n logger.error(e.getMessage());\r\n return false;\r\n } catch (IOException e) {\r\n logger.error(\"Could not publish result: \" + e.getMessage());\r\n return false;\r\n }\r\n return Utils.checkIdAndAddInvisibleActionTPTExecution(resolvedConfig, build, logger) & success;\r\n }", "public void testCheckinExceptions() {\n boolean buildEx = false;\n\n // Set up a sosCheckin task\n sosCheckin.setProject(project);\n // No options set - SosServerPath should fail\n try {\n commandline = sosCheckin.buildCmdLine();\n } catch (BuildException be) {\n if (be.getMessage().compareTo(\"sosserverpath attribute must be set!\") == 0) {\n buildEx = true;\n }\n }\n assertTrue(\"CheckinException SosServerPath\", buildEx);\n buildEx = false;\n\n // Set SosServerPath - Username should fail\n sosCheckin.setSosServerPath(SOS_SERVER_PATH);\n try {\n commandline = sosCheckin.buildCmdLine();\n } catch (BuildException be) {\n if (be.getMessage().compareTo(\"username attribute must be set!\") == 0) {\n buildEx = true;\n }\n }\n assertTrue(\"CheckinException Username\", buildEx);\n buildEx = false;\n\n // Set Username - VssServerPath should fail\n sosCheckin.setUsername(SOS_USERNAME);\n try {\n commandline = sosCheckin.buildCmdLine();\n } catch (BuildException be) {\n if (be.getMessage().compareTo(\"vssserverpath attribute must be set!\") == 0) {\n buildEx = true;\n }\n }\n assertTrue(\"CheckinException VssServerPath\", buildEx);\n buildEx = false;\n\n // Set VssServerPath - ProjectPath should fail\n sosCheckin.setVssServerPath(VSS_SERVER_PATH);\n try {\n commandline = sosCheckin.buildCmdLine();\n } catch (BuildException be) {\n if (be.getMessage().compareTo(\"projectpath attribute must be set!\") == 0) {\n buildEx = true;\n }\n }\n assertTrue(\"CheckinException ProjectPath\", buildEx);\n\n // Set ProjectPath - All required options set\n sosCheckin.setProjectPath(VSS_PROJECT_PATH);\n try {\n commandline = sosCheckin.buildCmdLine();\n buildEx = true;\n } catch (BuildException be) {\n buildEx = false;\n }\n assertTrue(\"CheckinException All required options set\", buildEx);\n }", "protected boolean preChecksNonJavaProject(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException {\r\n\t\tif (!saveBeforeLaunch(configuration, mode, monitor)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (mode.equals(ILaunchManager.RUN_MODE) && configuration.supportsMode(ILaunchManager.DEBUG_MODE)) {\r\n\t\t\tIBreakpoint[] breakpoints= getBreakpoints(configuration);\r\n\t if (breakpoints == null) {\r\n\t return true;\r\n\t }\r\n\t\t\tfor (int i = 0; i < breakpoints.length; i++) {\r\n\t\t\t\tif (breakpoints[i].isEnabled()) {\r\n\t\t\t\t\tIStatusHandler prompter = DebugPlugin.getDefault().getStatusHandler(promptStatus);\r\n\t\t\t\t\tif (prompter != null) {\r\n\t\t\t\t\t\tboolean launchInDebugModeInstead = ((Boolean)prompter.handleStatus(switchToDebugPromptStatus, configuration)).booleanValue();\r\n\t\t\t\t\t\tif (launchInDebugModeInstead) { \r\n\t\t\t\t\t\t\treturn false; //kill this launch\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t}\r\n\t\t\t\t\t// if no user prompt, or user says to continue (no need to check other breakpoints)\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\r\n\t\t// no enabled breakpoints... continue launch\r\n\t\treturn true;\r\n\t}", "@Override\r\n\tpublic void onProcessFailure(ProcessFailureInfo processFailureInfo) {\n\t\t\r\n\t}", "abstract boolean check(Env env);", "private static boolean validateFileExists(Map.Entry<String, CheckState> entry) {\n String prop = System.getProperty(entry.getKey());\n if (entry.getValue().isOptional && prop == null) {\n return true;\n }\n\n if (prop == null || \"\".equals(prop)) {\n return false;\n }\n\n return Files.exists(new File(prop).toPath());\n }", "private static void checkConfiguration() {\n try {\n ClientManager.rebuildSocket();\n ClientManager.closeSocket();\n } catch (IOException e) {\n new NetworkNotAvailableErrorStarter(NetworkNotAvailableError.class, null);\n }\n }", "@Test(timeout = 4000)\n public void test102() throws Throwable {\n boolean boolean0 = DBUtil.existsEnvironment(\"alter session\");\n assertFalse(boolean0);\n }", "@Test\n public void AppFileError() {\n try{\n App.main(new String[]{TEST_PATH + \"asdfghjkl-nice.dot\",\"1\"});\n }catch(RuntimeException re){\n assertEquals(re.getMessage(),\"Input file does not exist\");\n }\n }", "Map<String, Object> checkProcessDefinitionValid(long projectCode, ProcessDefinition processDefinition, long processDefineCode, Integer verison);", "@Override\n public boolean executeBeforeRunTask(ExecutionEnvironment env) {\n throw new RuntimeException(\n String.format(\n \"Unexpected code path: program runner %s, executor: %s\",\n env.getRunner().getClass(), env.getExecutor().getId()));\n }", "public static void checkEnvironmentVars() throws Exception {\n String apiBaseUrl = System.getenv(\"DIRECTUS_API_HOST\");\n String token = System.getenv(\"DIRECTUS_ADMIN_TOKEN\");\n if (apiBaseUrl == null || token == null) {\n if (apiBaseUrl == null) {\n System.out.println(\"environment variable DIRECTUS_ADMIN_TOKEN must be set\");\n }\n\n if (token == null) {\n System.out.println(\"environment variable DIRECTUS_API_HOST must be set\");\n }\n System.exit(-2);\n }\n }", "protected void check() throws IOException, ServletException {\n if(value.length()==0)\n error(\"please specify a configuration\");\n else {\n \t\t//TODO add more checks\n \t\tok();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (config != null) {\n config.validate();\n }\n }", "public void verifyConfig() {\r\n if (getProcessErpManager() == null)\r\n throw new ConfigurationException(\"The required property 'processErpManager' is missing.\");\r\n if (getAnchorColumnName() == null)\r\n throw new ConfigurationException(\"The required property 'anchorColumnName' is missing.\");\r\n }", "public boolean configurationIsValid() {\n\t\tif (this.maxThreadNumberResourceWorker + this.maxThreadNumberSeedWorker != this.maxThreadNumber) {\n\t\t\tlog.error(Logging.format(\"Confirguation error: Thread number configuration is wrong.\"));\n\t\t\treturn false;\n\t\t} else if (seedList == null || seedList.size() == 0) {\n\t\t\tlog.error(Logging.format(\"Confirguation error: Seed list is empty.\"));\n\t\t\treturn false;\n\t\t} else if (StringUtils.isEmpty(workspacePath)) {\n\t\t\tlog.error(Logging.format(\"Confirguation error: Workspace path is not set correctly.\"));\n\t\t\treturn false;\n\t\t} else if (!Files.exists(runtimeBasePath)) {\n\t\t\tlog.error(Logging.format(\"Confirguation error: Runtime directory ({}) does not exist.\", runtimeBasePath));\n\t\t\treturn false;\n\t\t}\n\t\tlog.info(Logging.format(\"Configuration check is passed.\"));\n\t\treturn true;\n\t}", "private void checkVersion() {\n\r\n\t\tMyTask mytask = new MyTask();\r\n\t\tmytask.execute(null, null, null);\r\n\t}", "private static void checkError(String result) {\n String err = Neo4jUtils.extractErrorData(result);\n if (err == null) {\n return;\n }\n throw new RuntimeException(err);\n }", "private boolean checkFirstRun(Context context) {\n\n final String PREFS_NAME = \"com.zgsoft.prefs\";\n final String PREF_VERSION_CODE_KEY = \"version_code\";\n final int DOESNT_EXIST = -1;\n // String packageName=null;\n\n\n // Get current version code\n int currentVersionCode = 0;\n try {\n PackageInfo packageInfo =context.getPackageManager().getPackageInfo(context.getPackageName(), 0);\n currentVersionCode =packageInfo.versionCode;\n //packageName = packageInfo.packageName;\n\n } catch (android.content.pm.PackageManager.NameNotFoundException e) {\n // handle exception\n e.printStackTrace();\n return false;\n }\n\n\n // Get saved version code\n SharedPreferences prefs = context.getSharedPreferences(PREFS_NAME, android.content.Context.MODE_PRIVATE);\n int savedVersionCode = prefs.getInt(PREF_VERSION_CODE_KEY, DOESNT_EXIST);\n\n // Check for first run or upgrade\n if (currentVersionCode == savedVersionCode) {\n\n // This is just a normal run\n return false;\n\n } else {\n // Update the shared preferences with the current version code\n prefs.edit().putInt(PREF_VERSION_CODE_KEY, currentVersionCode).commit();\n return true;\n }\n\n }", "public boolean compute() throws Exception{\n \n String cmdLine;\n String voicedir = db.getProp(db.ROOTDIR);\n \n /* Run: perl hts/scripts/Training.pl hts/scripts/Config.pm (It can take several hours...)*/ \n cmdLine = db.getExternal(db.PERLPATH) + \"/perl \" + voicedir +\"hts/scripts/Training.pl \" + voicedir + \"hts/scripts/Config.pm\"; \n launchProcWithLogFile(cmdLine, \"\", voicedir);\n \n return true;\n }", "public InvalidProcessException(Throwable cause) {\n super(cause);\n }", "protected void validateConfiguration() {}", "@Test\n public void testInvalidCredential(final TestContext aContext) {\n final Async asyncTask = aContext.async();\n final JsonObject newConfigs = myConfigs;\n\n newConfigs.put(IIIF_USERNAME, \"username\");\n newConfigs.put(IIIF_PASSWORD, \"password\");\n\n deployNewVerticle(newConfigs).onFailure(failure -> {\n TestUtils.complete(asyncTask);\n }).onSuccess(success -> {\n aContext.fail();\n });\n }", "private void validateContext() {\n\t\tif (irodsAccessObjectFactory == null) {\n\t\t\tthrow new JargonRuntimeException(\"null irodsAccessObjectFactory\");\n\t\t}\n\n\t\tif (dataProfilerSettings == null) {\n\t\t\tthrow new JargonRuntimeException(\"null dataProfilerSettings\");\n\t\t}\n\n\t\tif (dataTypeResolutionServiceFactory == null) {\n\t\t\tthrow new IllegalArgumentException(\"null dataTypeResolutionServiceFactory\");\n\t\t}\n\n\t}", "private void checkExecutionStatus() {\r\n\t\tif (detenido) {\r\n\t\t\tthrow new RejectedExecutionException(\"el procesador está detenido. no puede aceptar más tareas\");\r\n\t\t}\r\n\t}", "default boolean pollOnExecutionFailed() {\n return false;\n }", "public void testMemberNotTeamMemberForProjectValidator_InvalidConfig1() {\r\n try {\r\n TestHelper.loadConfiguration(INVALID_CONFIG1);\r\n new MemberNotTeamMemberForProjectValidator(\"MemberNotTeamMemberForProjectValidator\");\r\n fail(\"testMemberNotTeamMemberForProjectValidator_InvalidConfig1 is failure.\");\r\n } catch (RegistrationValidationConfigurationException rvce) {\r\n // pass\r\n } catch (Exception e) {\r\n fail(\"Unknown exception occurs in testMemberNotTeamMemberForProjectValidator_InvalidConfig1.\");\r\n }\r\n }", "boolean hasCloudRunConfig();", "@Override\n public void execute() throws BuildException {\n if (!isValidOs()) {\n return;\n }\n\n checkConfiguration();\n runExec(prepareExec());\n }", "public static ProcessEngineInfo retry(String resourceUrl) {\n log.debug(\"retying initializing of resource {}\", resourceUrl);\n try {\n return initProcessEngineFromResource(new URL(resourceUrl));\n } catch (MalformedURLException e) {\n throw new ActivitiIllegalArgumentException(\"invalid url: \" + resourceUrl, e);\n }\n }", "private boolean checkExecution() {\n if (!checkPhoneStatusOK()) {\n return false;\n }\n if (!checkBatteryLevelOK()) {\n return false;\n }\n return true;\n }", "@Test\n public void testIsCreatingProjectIfMissing() throws Exception {\n assertThat(\"Expect true\", testling.isCreatingProjectIfMissing(), is(Boolean.TRUE));\n }", "boolean isEnvironmentInvalid() {\n return StringUtils.isBlank(environment);\n }", "public boolean envShouldExist() {\n return envShouldExist;\n }", "public CommandFailedByConfigException(Throwable ex) {\n super(ex);\n }", "@Override\n public void checkConfiguration() {\n }", "private void check(final VProgram program) {\n\t}", "@Override\r\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\texecutable.feedbackExecutionError();\r\n\t\t\t\t\t}", "public CommandFailedByConfigException() {\n }", "private void checkProductionMode() {\n if (getApplicationOrSystemProperty(SERVLET_PARAMETER_DEBUG, \"true\")\n .equals(\"false\")) {\n // \"Debug=true\" is the old way and should no longer be used\n productionMode = true;\n } else if (getApplicationOrSystemProperty(\n SERVLET_PARAMETER_PRODUCTION_MODE, \"false\").equals(\"true\")) {\n // \"productionMode=true\" is the real way to do it\n productionMode = true;\n }\n \n if (!productionMode) {\n /* Print an information/warning message about running in debug mode */\n // TODO Maybe we need a different message for portlets?\n logger.warning(NOT_PRODUCTION_MODE_INFO);\n }\n }", "public boolean isServiceConfigurationValid(String config) {\n try {\n LayoutProject layoutProj = new LayoutProject();\n Environment environment = new Environment();\n PageLayout layout = new PageLayout();\n\n layoutProj.setRegisteredEnvironment(environment);\n layoutProj.setRegisteredLayout(layout);\n loadLayersWithLayoutProject(config, layoutProj);\n } catch (Exception ex) {\n ex.printStackTrace();\n return false;\n }\n return true;\n }", "void prepare(final boolean triggerCompile) throws Exception {\n if (triggerCompile) {\n triggerCompile();\n }\n if (debug == null) {\n // debug mode not specified\n // make sure 5005 is not used, we don't want to just fail if something else is using it\n // we don't check this on restarts, as the previous process is still running\n if (debugPortOk == null) {\n try (Socket socket = new Socket(InetAddress.getByAddress(new byte[] { 127, 0, 0, 1 }), 5005)) {\n getLog().error(\"Port 5005 in use, not starting in debug mode\");\n debugPortOk = false;\n } catch (IOException e) {\n debugPortOk = true;\n }\n }\n if (debugPortOk) {\n args.add(\"-Xdebug\");\n args.add(\"-Xrunjdwp:transport=dt_socket,address=0.0.0.0:5005,server=y,suspend=\" + suspend);\n }\n } else if (debug.toLowerCase().equals(\"client\")) {\n args.add(\"-Xdebug\");\n args.add(\"-Xrunjdwp:transport=dt_socket,address=localhost:5005,server=n,suspend=\" + suspend);\n } else if (debug.toLowerCase().equals(\"true\")) {\n args.add(\"-Xdebug\");\n args.add(\"-Xrunjdwp:transport=dt_socket,address=0.0.0.0:5005,server=y,suspend=\" + suspend);\n } else if (!debug.toLowerCase().equals(\"false\")) {\n try {\n int port = Integer.parseInt(debug);\n if (port <= 0) {\n throw new MojoFailureException(\"The specified debug port must be greater than 0\");\n }\n args.add(\"-Xdebug\");\n args.add(\"-Xrunjdwp:transport=dt_socket,address=0.0.0.0:\" + port + \",server=y,suspend=\" + suspend);\n } catch (NumberFormatException e) {\n throw new MojoFailureException(\n \"Invalid value for debug parameter: \" + debug + \" must be true|false|client|{port}\");\n }\n }\n //build a class-path string for the base platform\n //this stuff does not change\n // Do not include URIs in the manifest, because some JVMs do not like that\n StringBuilder classPathManifest = new StringBuilder();\n final DevModeContext devModeContext = new DevModeContext();\n for (Map.Entry<Object, Object> e : System.getProperties().entrySet()) {\n devModeContext.getSystemProperties().put(e.getKey().toString(), (String) e.getValue());\n }\n devModeContext.setProjectDir(project.getFile().getParentFile());\n devModeContext.getBuildSystemProperties().putAll((Map) project.getProperties());\n\n // this is a minor hack to allow ApplicationConfig to be populated with defaults\n devModeContext.getBuildSystemProperties().putIfAbsent(\"quarkus.application.name\", project.getArtifactId());\n devModeContext.getBuildSystemProperties().putIfAbsent(\"quarkus.application.version\", project.getVersion());\n\n devModeContext.setSourceEncoding(getSourceEncoding());\n\n // Set compilation flags. Try the explicitly given configuration first. Otherwise,\n // refer to the configuration of the Maven Compiler Plugin.\n final Optional<Xpp3Dom> compilerPluginConfiguration = findCompilerPluginConfiguration();\n if (compilerArgs != null) {\n devModeContext.setCompilerOptions(compilerArgs);\n } else if (compilerPluginConfiguration.isPresent()) {\n final Xpp3Dom compilerPluginArgsConfiguration = compilerPluginConfiguration.get().getChild(\"compilerArgs\");\n if (compilerPluginArgsConfiguration != null) {\n List<String> compilerPluginArgs = new ArrayList<>();\n for (Xpp3Dom argConfiguration : compilerPluginArgsConfiguration.getChildren()) {\n compilerPluginArgs.add(argConfiguration.getValue());\n }\n // compilerArgs can also take a value without using arg\n if (compilerPluginArgsConfiguration.getValue() != null\n && !compilerPluginArgsConfiguration.getValue().isEmpty()) {\n compilerPluginArgs.add(compilerPluginArgsConfiguration.getValue().trim());\n }\n devModeContext.setCompilerOptions(compilerPluginArgs);\n }\n }\n if (source != null) {\n devModeContext.setSourceJavaVersion(source);\n } else if (compilerPluginConfiguration.isPresent()) {\n final Xpp3Dom javacSourceVersion = compilerPluginConfiguration.get().getChild(\"source\");\n if (javacSourceVersion != null && javacSourceVersion.getValue() != null\n && !javacSourceVersion.getValue().trim().isEmpty()) {\n devModeContext.setSourceJavaVersion(javacSourceVersion.getValue().trim());\n }\n }\n if (target != null) {\n devModeContext.setTargetJvmVersion(target);\n } else if (compilerPluginConfiguration.isPresent()) {\n final Xpp3Dom javacTargetVersion = compilerPluginConfiguration.get().getChild(\"target\");\n if (javacTargetVersion != null && javacTargetVersion.getValue() != null\n && !javacTargetVersion.getValue().trim().isEmpty()) {\n devModeContext.setTargetJvmVersion(javacTargetVersion.getValue().trim());\n }\n }\n\n setKotlinSpecificFlags(devModeContext);\n if (noDeps) {\n final LocalProject localProject = LocalProject.load(project.getModel().getPomFile().toPath());\n addProject(devModeContext, localProject, true);\n pomFiles.add(localProject.getRawModel().getPomFile().toPath());\n devModeContext.getLocalArtifacts()\n .add(new AppArtifactKey(localProject.getGroupId(), localProject.getArtifactId(), null, \"jar\"));\n } else {\n final LocalProject localProject = LocalProject.loadWorkspace(project.getModel().getPomFile().toPath());\n for (LocalProject project : filterExtensionDependencies(localProject)) {\n addProject(devModeContext, project, project == localProject);\n pomFiles.add(project.getRawModel().getPomFile().toPath());\n devModeContext.getLocalArtifacts()\n .add(new AppArtifactKey(project.getGroupId(), project.getArtifactId(), null, \"jar\"));\n }\n }\n\n addQuarkusDevModeDeps(classPathManifest);\n\n args.add(\"-Djava.util.logging.manager=org.jboss.logmanager.LogManager\");\n\n //in most cases these are not used, however they need to be present for some\n //parent-first cases such as logging\n for (Artifact appDep : project.getArtifacts()) {\n // only add the artifact if it's present in the dev mode context\n // we need this to avoid having jars on the classpath multiple times\n if (!devModeContext.getLocalArtifacts().contains(new AppArtifactKey(appDep.getGroupId(), appDep.getArtifactId(),\n appDep.getClassifier(), appDep.getArtifactHandler().getExtension()))) {\n addToClassPaths(classPathManifest, appDep.getFile());\n }\n }\n\n //now we need to build a temporary jar to actually run\n\n File tempFile = new File(buildDir, project.getArtifactId() + \"-dev.jar\");\n tempFile.delete();\n // Only delete the -dev.jar on exit if requested\n if (deleteDevJar) {\n tempFile.deleteOnExit();\n }\n getLog().debug(\"Executable jar: \" + tempFile.getAbsolutePath());\n\n devModeContext.setBaseName(project.getBuild().getFinalName());\n devModeContext.setCacheDir(new File(buildDir, \"transformer-cache\").getAbsoluteFile());\n\n // this is the jar file we will use to launch the dev mode main class\n devModeContext.setDevModeRunnerJarFile(tempFile);\n\n modifyDevModeContext(devModeContext);\n\n try (ZipOutputStream out = new ZipOutputStream(new FileOutputStream(tempFile))) {\n out.putNextEntry(new ZipEntry(\"META-INF/\"));\n Manifest manifest = new Manifest();\n manifest.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, \"1.0\");\n manifest.getMainAttributes().put(Attributes.Name.CLASS_PATH, classPathManifest.toString());\n manifest.getMainAttributes().put(Attributes.Name.MAIN_CLASS, DevModeMain.class.getName());\n out.putNextEntry(new ZipEntry(\"META-INF/MANIFEST.MF\"));\n manifest.write(out);\n\n out.putNextEntry(new ZipEntry(DevModeMain.DEV_MODE_CONTEXT));\n ByteArrayOutputStream bytes = new ByteArrayOutputStream();\n ObjectOutputStream obj = new ObjectOutputStream(new DataOutputStream(bytes));\n obj.writeObject(devModeContext);\n obj.close();\n out.write(bytes.toByteArray());\n }\n\n outputDirectory.mkdirs();\n // if the --enable-preview flag was set, then we need to enable it when launching dev mode as well\n if (devModeContext.isEnablePreview()) {\n args.add(DevModeContext.ENABLE_PREVIEW_FLAG);\n }\n\n propagateUserProperties();\n\n args.add(\"-jar\");\n args.add(tempFile.getAbsolutePath());\n if (argsString != null) {\n args.addAll(Arrays.asList(CommandLineUtils.translateCommandline(argsString)));\n }\n }", "protected void checkStatus(Status status) {\n if (status != Status.SUCCESS) {\n throw new FatalError(status.toString() + \"\\n\" + CairoContext.statusToString(status));\n }\n }", "private void validateParameters() {\r\n if (command == null) {\r\n throw new BuildException(\r\n \"'command' parameter should not be null for coverity task.\");\r\n }\r\n\r\n }", "public ConfigProcessNameAlreadyDefinedException(String msg)\n {\n super(msg);\n }", "@Test\n public void testDynamicDeploy() throws Exception\n {\n ProcessEngine processEngine = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration()\n .setJdbcDriver(\"com.mysql.jdbc.Driver\").setJdbcUrl(\"jdbc:mysql://localhost:3306/activiti\").setJdbcPassword(\"root\")\n .setJdbcUsername(\"root\").setDatabaseSchemaUpdate(\"false\").buildProcessEngine();\n\n // 1. Build up the model from scratch\n BpmnModel model = new BpmnModel();\n Process process = new Process();\n model.addProcess(process);\n process.setId(\"my-process\");\n process.setName(\"Qmplus test\");\n process.addFlowElement(createStartEvent());\n process.addFlowElement(createUserTask(\"task1\",\"First task\",\"fred\"));\n process.addFlowElement(createUserTask(\"task2\",\"Second task\",\"john\"));\n List<SequenceFlow> outgoing = new ArrayList<SequenceFlow>();\n outgoing.add(createSequenceFlow(\"task3\",\"task4\"));\n outgoing.add(createSequenceFlow(\"task3\",\"task2\"));\n process.addFlowElement(createParallelTask(\"task3\",\"option task\",outgoing));\n process.addFlowElement(createEndEvent());\n process.addFlowElement(createScriptTask(\"task4\",\"script task\",\"12343\"));\n\n process.addFlowElement(createSequenceFlow(\"start\",\"task1\"));\n process.addFlowElement(createSequenceFlow(\"task1\",\"task3\"));\n process.addFlowElement(createSequenceFlow(\"task3\",\"task2\"));\n process.addFlowElement(createSequenceFlow(\"task3\",\"task4\"));\n process.addFlowElement(createSequenceFlow(\"task2\",\"end\"));\n process.addFlowElement(createSequenceFlow(\"task4\",\"end\"));\n // 2. Generate graphical information\n new BpmnAutoLayout(model).execute();\n // 3. Deploy the process to the engine\n Deployment deployment = processEngine.getRepositoryService().createDeployment().addBpmnModel(\"dynamic-model.bpmn\",model)\n .name(\"Dynamic process deployment\").deploy();\n\n // 4. Start a process instance\n ProcessInstance processInstance = processEngine.getRuntimeService().startProcessInstanceByKey(\"my-process\");\n\n // 5. Check if task is available\n List<Task> tasks = processEngine.getTaskService().createTaskQuery().processInstanceId(processInstance.getId()).list();\n\n org.junit.Assert.assertEquals(1,tasks.size());\n Assert.assertEquals(\"First task\",tasks.get(0).getName());\n Assert.assertEquals(\"fred\",tasks.get(0).getAssignee());\n\n // 6. Save process diagram to a file\n InputStream processDiagram = processEngine.getRepositoryService().getProcessDiagram(processInstance.getProcessDefinitionId());\n FileUtils.copyInputStreamToFile(processDiagram,new File(\"diagrams/process.png\"));\n\n // 7. Save resulting BPMN xml to a file\n InputStream processBpmn = processEngine.getRepositoryService().getResourceAsStream(deployment.getId(),\"dynamic-model.bpmn\");\n FileUtils.copyInputStreamToFile(processBpmn,new File(\"diagrams/process.bpmn20.xml\"));\n\n // 8. create user\n CreateUser();\n // 9. create group\n createGroup();\n // 10. assign process to user\n\n }", "@Override\n protected void processRun() {\n try {\n if (helpOnly) helpOnly();\n else {\n if (hasPipedInput()) pipeVersion();\n else stdinVersion();\n }\n } catch (IOException e) {\n return; // Killed process\n }\n }", "@Test(expected = InvalidApplicationException.class)\n public void testDeploymentFailsIfNeededModelVersionFails() {\n List<Host> hosts = createHosts(7, \"7.0.0\");\n\n List<ModelFactory> modelFactories = List.of(createFailingModelFactory(Version.fromString(\"7.0.0\")),\n createHostedModelFactory(Version.fromString(\"7.1.0\")));\n\n DeployTester tester = createTester(hosts, modelFactories, prodZone);\n tester.deployApp(\"src/test/apps/hosted/\", \"7.1.0\");\n }", "public InvalidProcessException(String message) {\n super(message);\n }", "@Override\n\tprotected boolean configure(ConsoleManager cm, Host host, PhpBuild build, ScenarioSet scenario_set, String app_dir) {\n\t\treturn false;\n\t}", "@Override\n\tprotected boolean configure(ConsoleManager cm, Host host, PhpBuild build, ScenarioSet scenario_set, String app_dir) {\n\t\treturn false;\n\t}", "@Override\n\tprotected boolean configure(ConsoleManager cm, Host host, PhpBuild build, ScenarioSet scenario_set, String app_dir) {\n\t\treturn false;\n\t}", "public boolean perform(Build build, Launcher launcher, BuildListener listener) {\n \tMap<String, String> envVars = build.getEnvVars();\n \tSet<String> keys = envVars.keySet();\n \tfor (String key : keys) {\n \t this.projectPath = this.projectPath.replaceAll(\"\\\\$\" + key, envVars.get(key));\n \t this.projectPath = this.projectPath.replaceAll(\"\\\\$\\\\{\" + key + \"\\\\}\", envVars.get(key));\n \t}\n\n \t// split the components entered in the component field\n \tString[] componentList = this.components.split(\",\");\n\n \tString rhapsodyCall = DESCRIPTOR.rhapsodyClPath() + \" -cmd=open \" + this.projectPath;\n \tfor (int i=0; i < componentList.length; ++i)\n \t{\n\t\t\tif (generate)\n\t\t\t{\n \t\t\trhapsodyCall += \" -cmd=setcomponent \" + componentList[i];\n \t\t\trhapsodyCall += \" -cmd=setconfiguration \" + this.rhapsodyConfiguration + \" -cmd=regenerate\";\n\t \t\tif (make)\n\t \t\t{\n\t \t\t\trhapsodyCall += \" -cmd=syncmake\";\n\t \t\t}\n\t\t\t}\n \t}\n \trhapsodyCall += \" -cmd=exit \\n\";\n \t\n \tMap<String, String> system =System.getenv();\n\t\tList<String> param = new ArrayList<String>();\n\t\tfor (Map.Entry<String, String> entry : system.entrySet()) {\n\t\t\tString s = entry.getKey() + \"=\" + entry.getValue();\t\t\t\n\t\t\tparam.add(s);\n\t\t}\n\t\tif (DESCRIPTOR.licenseServerPath()!=null) {\n\t\t\tparam.add(\"LM_LICENSE_FILE=\" + DESCRIPTOR.licenseServerPath());\n\t\t}\n\t\tString[] env = param.toArray(new String[param.size()]);\t\n \t\n\t\tint returnValue;\n \ttry {\n\t\t\tProc proc = launcher.launch(rhapsodyCall, env, listener.getLogger(), build.getProject().getWorkspace());\n\t\t\treturnValue = proc.join();\n \t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n \t\tlistener.getLogger().println(\"IOException !\");\n\t\t\treturn false;\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\tlistener.getLogger().println(\"InterruptedException !\");\n\t\t\treturn false;\n\t\t}\n\t\tif (returnValue == 0)\n \t return true;\n\t\telse\n\t\t\treturn false;\n }", "@Override\n protected Result check()\n {\n return this.gitLabModeInfos.isEmpty() ? Result.unhealthy(\"No GitLab modes available\") : Result.healthy();\n }", "public static void displayLaunchError(Shell shell, ILaunchConfiguration config, Exception e) {\n\t\tString title = \"Problem Occured\"; \n\t\tString message = \"Opening the configuration dialog has encoutered a problem.\\n\\n\" + e.getLocalizedMessage();\n\t\tMessageDialog.openError(shell, title, message);\n\t}", "@Test\n public void dynamicExecution_stderrIsReported() throws Exception {\n if (OS.getCurrent() == OS.WINDOWS) {\n return;\n }\n addOptions(\"--internal_spawn_scheduler\");\n addOptions(\"--strategy=Genrule=dynamic\");\n addOptions(\"--experimental_local_execution_delay=9999999\");\n write(\n \"BUILD\",\n \"genrule(\",\n \" name = 'foo',\",\n \" srcs = [],\",\n \" outs = ['out/foo.txt'],\",\n \" cmd = 'echo my-error-message > $@',\",\n \" tags = ['no-local'],\",\n \")\",\n \"genrule(\",\n \" name = 'foobar',\",\n \" srcs = [':foo'],\",\n \" outs = ['out/foobar.txt'],\",\n \" cmd = 'cat $(location :foo) >&2 && exit 1',\",\n \")\");\n RecordingOutErr outErr = new RecordingOutErr();\n this.outErr = outErr;\n\n assertThrows(BuildFailedException.class, () -> buildTarget(\"//:foobar\"));\n\n assertOutputContains(outErr.errAsLatin1(), \"my-error-message\");\n }", "boolean check (Env env) {\n return true;\n }", "public void testCheckoutExceptions() {\n boolean buildEx = false;\n\n // Set up a sosCheckout task\n sosCheckout.setProject(project);\n // No options set - SosServerPath should fail\n try {\n commandline = sosCheckout.buildCmdLine();\n } catch (BuildException be) {\n if (be.getMessage().compareTo(\"sosserverpath attribute must be set!\") == 0) {\n buildEx = true;\n }\n }\n assertTrue(\"CheckoutException SosServerPath\", buildEx);\n buildEx = false;\n\n // Set SosServerPath - Username should fail\n sosCheckout.setSosServerPath(SOS_SERVER_PATH);\n try {\n commandline = sosCheckout.buildCmdLine();\n } catch (BuildException be) {\n if (be.getMessage().compareTo(\"username attribute must be set!\") == 0) {\n buildEx = true;\n }\n }\n assertTrue(\"CheckoutException Username\", buildEx);\n buildEx = false;\n\n // Set Username - VssServerPath should fail\n sosCheckout.setUsername(SOS_USERNAME);\n try {\n commandline = sosCheckout.buildCmdLine();\n } catch (BuildException be) {\n if (be.getMessage().compareTo(\"vssserverpath attribute must be set!\") == 0) {\n buildEx = true;\n }\n }\n assertTrue(\"CheckoutException VssServerPath\", buildEx);\n buildEx = false;\n\n // Set VssServerPath - ProjectPath should fail\n sosCheckout.setVssServerPath(VSS_SERVER_PATH);\n try {\n commandline = sosCheckout.buildCmdLine();\n } catch (BuildException be) {\n if (be.getMessage().compareTo(\"projectpath attribute must be set!\") == 0) {\n buildEx = true;\n }\n }\n assertTrue(\"CheckoutException ProjectPath\", buildEx);\n\n // Set ProjectPath - All required options set\n sosCheckout.setProjectPath(VSS_PROJECT_PATH);\n try {\n commandline = sosCheckout.buildCmdLine();\n buildEx = true;\n } catch (BuildException be) {\n buildEx = false;\n }\n assertTrue(\"CheckoutException All required options set\", buildEx);\n }", "public ProcessModuleHandle(Vertx vertx, LaunchDescriptor desc, String id,\n Ports ports, int port, JsonObject config) {\n this.vertx = vertx;\n this.id = id;\n this.exec = desc.getExec();\n this.cmdlineStart = desc.getCmdlineStart();\n this.cmdlineStop = desc.getCmdlineStop();\n this.env = desc.getEnv();\n this.port = port;\n this.ports = ports;\n this.process = null;\n this.tcpPortWaiting = new TcpPortWaiting(vertx, id, \"localhost\", port);\n\n Integer maxIterations = Config.getSysConfInteger(ConfNames.DEPLOY_WAIT_ITERATIONS,\n desc.getWaitIterations(), config);\n if (maxIterations != null) {\n tcpPortWaiting.setMaxIterations(maxIterations);\n }\n }", "@Test\r\n public void setStateWhenFileCannotExistTest() {\r\n try {\r\n deleteFile(runtimeConfigDAOPropertiesFile.getRuntimePropertiesFilename());\r\n // make a directory by the same name as the properties file. This will result in a FNFException when trying to open it as a file\r\n (new File(runtimeConfigDAOPropertiesFile.getRuntimePropertiesFilename())).mkdirs();\r\n\r\n // Perform the operation\r\n runtimeConfigDAOPropertiesFile.setState(new State(State.DISABLED));\r\n Assert.fail(\"The properties file should already exist as a directory and so an exceptions should have been thrown.\");\r\n } catch (CannotSetStateException e) {\r\n // Passed the test\r\n }\r\n (new File(runtimeConfigDAOPropertiesFile.getRuntimePropertiesFilename())).delete();\r\n }", "public void checkApplication() {\r\n logger.info(\"ADIT monitor - Checking application.\");\r\n List<String> errorMessages = new ArrayList<String>();\r\n double duration = 0;\r\n DecimalFormat df = new DecimalFormat(\"0.000\");\r\n\r\n Date start = new Date();\r\n long startTime = start.getTime();\r\n\r\n // 1. Check temporary folder\r\n try {\r\n\r\n String tempDir = this.getConfiguration().getTempDir();\r\n File tempDirFile = new File(tempDir);\r\n String randomFileName = Util.generateRandomFileName();\r\n File temporaryFile = new File(tempDirFile.getAbsolutePath() + File.separator + randomFileName);\r\n temporaryFile.createNewFile();\r\n\r\n } catch (Exception e) {\r\n logger.error(\"Error checking application - temporary directory not defined or not writable: \", e);\r\n errorMessages.add(\"Error checking application - temporary directory not defined or not writable: \"\r\n + e.getMessage());\r\n }\r\n\r\n // 3. Check test document ID\r\n try {\r\n\r\n Long testDocumentID = this.getMonitorConfiguration().getTestDocumentId();\r\n if (testDocumentID == null) {\r\n throw new Exception(\"Test document ID not defined.\");\r\n }\r\n\r\n } catch (Exception e) {\r\n logger.error(\"Error checking application - test document ID not defined.\");\r\n errorMessages.add(\"Error checking application - test document ID not defined.\");\r\n }\r\n\r\n Date end = new Date();\r\n long endTime = end.getTime();\r\n duration = (endTime - startTime) / 1000.0;\r\n\r\n // Errors were detected\r\n if (errorMessages.size() > 0) {\r\n String combinedErrorMessage = \"\";\r\n for (int i = 0; i < errorMessages.size(); i++) {\r\n if (i != 0) {\r\n combinedErrorMessage = combinedErrorMessage + \", \";\r\n }\r\n combinedErrorMessage = combinedErrorMessage + errorMessages.get(i);\r\n }\r\n\r\n this.getNagiosLogger().log(ADIT_APP + \" \" + FAIL + \" \",\r\n new Exception(\"Errors found: \" + combinedErrorMessage));\r\n } else {\r\n this.getNagiosLogger().log(ADIT_APP + \" \" + OK + \" \" + df.format(duration) + \" \" + SECONDS);\r\n }\r\n\r\n }", "private void validatePage() {\n String error = null;\n String warning = null;\n\n // -- validate project\n if (getProject() == null) {\n error = \"Please select an Android project.\";\n }\n\n // -- validate filename\n if (error == null) {\n String fileName = getFileName();\n if (fileName == null || fileName.length() == 0) {\n error = \"A destination file name is required.\";\n } else if (!fileName.endsWith(AndroidConstants.DOT_XML)) {\n error = String.format(\"The filename must end with %1$s.\", AndroidConstants.DOT_XML);\n }\n }\n\n // -- validate type\n if (error == null) {\n TypeInfo type = getSelectedType();\n\n if (type == null) {\n error = \"One of the types must be selected (e.g. layout, values, etc.)\";\n }\n }\n\n // -- validate type API level\n if (error == null) {\n IAndroidTarget target = Sdk.getCurrent().getTarget(mProject);\n int currentApiLevel = 1;\n if (target != null) {\n currentApiLevel = target.getVersion().getApiLevel();\n }\n\n TypeInfo type = getSelectedType();\n\n if (type.getTargetApiLevel() > currentApiLevel) {\n error = \"The API level of the selected type (e.g. AppWidget, etc.) is not \" +\n \"compatible with the API level of the project.\";\n }\n }\n\n // -- validate folder configuration\n if (error == null) {\n ConfigurationState state = mConfigSelector.getState();\n if (state == ConfigurationState.INVALID_CONFIG) {\n ResourceQualifier qual = mConfigSelector.getInvalidQualifier();\n if (qual != null) {\n error = String.format(\"The qualifier '%1$s' is invalid in the folder configuration.\",\n qual.getName());\n }\n } else if (state == ConfigurationState.REGION_WITHOUT_LANGUAGE) {\n error = \"The Region qualifier requires the Language qualifier.\";\n }\n }\n\n // -- validate generated path\n if (error == null) {\n String wsFolderPath = getWsFolderPath();\n if (!wsFolderPath.startsWith(RES_FOLDER_ABS)) {\n error = String.format(\"Target folder must start with %1$s.\", RES_FOLDER_ABS);\n }\n }\n\n // -- validate destination file doesn't exist\n if (error == null) {\n IFile file = getDestinationFile();\n if (file != null && file.exists()) {\n warning = \"The destination file already exists\";\n }\n }\n\n // -- update UI & enable finish if there's no error\n setPageComplete(error == null);\n if (error != null) {\n setMessage(error, WizardPage.ERROR);\n } else if (warning != null) {\n setMessage(warning, WizardPage.WARNING);\n } else {\n setErrorMessage(null);\n setMessage(null);\n }\n }", "private void validate() throws DomainXmlPreParserException {\n if (serverConfigRef == null)\n throw new DomainXmlPreParserException(\n Strings.get(\"dxpp.serverNotFound\", instanceName));\n // 2. config-ref of server matches config-ref of cluster\n if (!serverConfigRef.equals(cluster.configRef))\n throw new DomainXmlPreParserException(\n Strings.get(\"dxpp.configrefnotmatch\", instanceName, cluster.name));\n\n if(!configNames.contains(serverConfigRef))\n throw new DomainXmlPreParserException(\n Strings.get(\"dxpp.confignotfound\", instanceName, serverConfigRef));\n\n\n\n valid = true;\n }", "@Test\n\t@Deployment(resources = \"process.bpmn\")\n\tpublic void testParsingAndDeployment() {\n\t\t// nothing is done here, as we just want to check for exceptions during\n\t\t// deployment\n\t}", "private void validate()\n throws TaskException\n {\n if( null == m_destfile )\n {\n final String message =\n REZ.getString( \"manifest.missing-file.error\" );\n throw new TaskException( message );\n }\n if( m_destfile.exists() && !m_destfile.isFile() )\n {\n final String message =\n REZ.getString( \"manifest.bad-file.error\", m_destfile );\n throw new TaskException( message );\n }\n }", "@Test\n\tpublic void test_invalid_config_13() throws Exception {\n\t\tConfig.configFile = \"test_files/config_files/invalid13.json\";\n\t\tString missingData = \"STUDENT_USERNAME\";\n\t\t\n\t\tconstructObjectsExpectFailure(missingData);\n\t}", "private boolean handleExitedBSetupMode(String line){\n if (!line.equals(\"Game is validated - entering examine mode.\"))\n return false;\n\n if (!processBSetupMode(false))\n processLine(line);\n\n return true;\n }", "@Test\n\tpublic void test_invalid_config_17() throws Exception {\n\t\tConfig.configFile = \"test_files/config_files/invalid17.json\";\n\t\tString missingData = \"STUDENT_INPUT\";\n\t\tconstructObjectsExpectFailure(missingData);\n\t}", "@Test\n public void testNoImageID(final TestContext aContext) {\n final String imageIDNull = null;\n final Async asyncTask = aContext.async();\n\n deployNewVerticle(myConfigs).compose(verticleID -> {\n myVertID = verticleID;\n return sendMessage(imageIDNull);\n }).onFailure(failure -> {\n if (Integer.parseInt(failure.getMessage()) == HTTP.INTERNAL_SERVER_ERROR) {\n TestUtils.complete(asyncTask);\n } else {\n aContext.fail();\n }\n }).onSuccess(success -> {\n aContext.fail();\n });\n }", "public void testLabelExceptions() {\n boolean buildEx = false;\n\n // Set up a sosLabel task\n sosLabel.setProject(project);\n // No options set - SosServerPath should fail\n try {\n commandline = sosLabel.buildCmdLine();\n } catch (BuildException be) {\n if (be.getMessage().compareTo(\"sosserverpath attribute must be set!\") == 0) {\n buildEx = true;\n }\n }\n assertTrue(\"LabelException SosServerPath\", buildEx);\n buildEx = false;\n\n // Set SosServerPath - Username should fail\n sosLabel.setSosServerPath(SOS_SERVER_PATH);\n try {\n commandline = sosLabel.buildCmdLine();\n } catch (BuildException be) {\n if (be.getMessage().compareTo(\"username attribute must be set!\") == 0) {\n buildEx = true;\n }\n }\n assertTrue(\"LabelException Username\", buildEx);\n buildEx = false;\n\n // Set Username - VssServerPath should fail\n sosLabel.setUsername(SOS_USERNAME);\n try {\n commandline = sosLabel.buildCmdLine();\n } catch (BuildException be) {\n if (be.getMessage().compareTo(\"vssserverpath attribute must be set!\") == 0) {\n buildEx = true;\n }\n }\n assertTrue(\"LabelException VssServerPath\", buildEx);\n buildEx = false;\n\n // Set VssServerPath - ProjectPath should fail\n sosLabel.setVssServerPath(VSS_SERVER_PATH);\n try {\n commandline = sosLabel.buildCmdLine();\n } catch (BuildException be) {\n if (be.getMessage().compareTo(\"projectpath attribute must be set!\") == 0) {\n buildEx = true;\n }\n }\n assertTrue(\"LabelException ProjectPath\", buildEx);\n\n // Set ProjectPath - Label should fail\n sosLabel.setProjectPath(VSS_PROJECT_PATH);\n try {\n commandline = sosLabel.buildCmdLine();\n } catch (BuildException be) {\n if (be.getMessage().compareTo(\"label attribute must be set!\") == 0) {\n buildEx = true;\n }\n }\n assertTrue(\"LabelException Label\", buildEx);\n\n // Set Label - All required options set\n sosLabel.setLabel(SRC_LABEL);\n try {\n commandline = sosLabel.buildCmdLine();\n buildEx = true;\n } catch (BuildException be) {\n buildEx = false;\n }\n assertTrue(\"LabelException All required options set\", buildEx);\n }", "private boolean IsCfgExisted()\n {\n File f = new File(strCfgPath);\n if(f.exists())\n return true;\n return false;\n }", "private void checkFirstRun() {\r\n\r\n\t final String PREFS_NAME = \"MyPrefsFile\";\r\n\t final String PREF_VERSION_CODE_KEY = \"version_code\";\r\n\t final int DOESNT_EXIST = -1;\r\n\r\n\r\n\t // Get current version code\r\n\t int currentVersionCode = 0;\r\n\t try {\r\n\t currentVersionCode = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;\r\n\t } catch (android.content.pm.PackageManager.NameNotFoundException e) {\r\n\t // handle exception\r\n\t Log.e(\"PackageMissing\", \"Package Not Found\");\r\n\t return;\r\n\t }\r\n\r\n\t // Get saved version code\r\n\t SharedPreferences prefs = getSharedPreferences(PREFS_NAME, MODE_PRIVATE);\r\n\t int savedVersionCode = prefs.getInt(PREF_VERSION_CODE_KEY, DOESNT_EXIST);\r\n\r\n\t // Check for first run or upgrade\r\n\t if (currentVersionCode == savedVersionCode) {\r\n\t \t// This is just a normal run\r\n\t return;\r\n\t } else {\r\n\t \tstartActivity(new Intent(DisplayBin.this, DisplayBinHelp.class));\r\n\t }\r\n\t // Update the shared preferences with the current version code\r\n\t prefs.edit().putInt(PREF_VERSION_CODE_KEY, currentVersionCode).commit();\r\n\t}", "@Override\n public void onFail(Object arg0) {\n LogUtil.log(\"游戏初始化失败\");\n }", "@Test\n public void launchWDLToolWithNotificationsUUIDNoURL() throws IOException {\n exit.expectSystemExitWithStatus(Client.CLIENT_ERROR);\n exit.checkAssertionAfterwards(() -> {\n String log = systemErrRule.getLog();\n Assert.assertTrue(log, log.contains(\"Aborting launch.\"));\n });\n Client.main(\n new String[] { \"--config\", TestUtility.getConfigFileLocation(true), \"tool\", \"launch\", \"--local-entry\", sampleWDLDescriptor,\n \"--json\", sampleWDLTestJson, \"--uuid\", \"potato\" });\n\n\n }", "@Test\n public void testRenderscriptDidNotRun() throws Exception {\n Map<String, ProjectBuildOutput> multi =\n project.executeAndReturnOutputMultiModel(\"compileDebugRenderscript\");\n assertThat(\n project.getBuildResult()\n .getTask(\":compileDebugRenderscript\")\n .getExecutionState()\n .toString())\n .isEqualTo(\"SKIPPED\");\n }", "public IStatus run(IProgressMonitor monitor) {\n IStatus status = Status.OK_STATUS;\n // FIXME: PORT should be retrieved from properties\n int port = 8888;\n\n if (Utilities.isPortFree(port)) {\n\n if (logger.isDebugEnabled()) {\n logger.debug(\"run(IProgressMonitor) - start\");\n }\n\n monitor.subTask(\"Initialising project\");\n String fhome = ForrestPlugin.getDefault().getPluginPreferences()\n .getString(ForrestPreferences.FORREST_HOME);\n StringBuffer sb = new StringBuffer(\"-Dproject.home=\");\n sb.append(workingDir);\n sb.append(\" -Dbasedir=\");\n sb.append(fhome + File.separatorChar + \"main\");\n sb.append(\" \");\n sb.append(\"init\");\n status = runAnt(monitor, sb.toString());\n\n monitor.subTask(\"Starting Server\");\n if (status.isOK()) {\n ForrestManager forrestManager = ForrestManager.getInstance();\n String confPath = ForrestManager.FORREST_CORE_WEBAPP\n + File.separatorChar + \"jettyconf.xml\";\n try {\n Server jetty = new Jetty(confPath,\n ForrestManager.FORREST_CORE_WEBAPP,\n ForrestManager.FORREST_ENDORSED_LIB, forrestManager\n .getProperties(workingDir), ForrestManager\n .getClasspathFiles());\n status = jetty.start(monitor);\n if (status.isOK()) {\n ForrestManager.setServerLaunch(jetty.getLaunch());\n } else {\n ForrestManager.setServerLaunch(null);\n }\n } catch (IOException e) {\n logger.error(\"run(IProgressMonitor)\", e);\n status = new Status(Status.ERROR, ForrestPlugin.ID,\n IO_EXCEPTION, \"Unable to start Jetty server\", e);\n }\n } else {\n return status;\n }\n\n // FIXME: Timeout delay should be a preference\n long endTime = System.currentTimeMillis() + (1000 * 30);\n while (Utilities.isPortFree(port)\n && endTime < System.currentTimeMillis()) {\n try {\n Thread.sleep(250);\n } catch (InterruptedException e) {\n // no problem (I think ;-))\n }\n }\n\n if (!Utilities.isPortFree(port)) {\n status = new Status(\n Status.WARNING,\n ForrestPlugin.ID,\n EXCEPTION_UNABLE_TO_START,\n \"Server did not start within specified timeout period, have not tried to open browser.\",\n null);\n return status;\n }\n\n if (!openBrowser(monitor)) {\n status = new Status(Status.WARNING, ForrestPlugin.ID,\n BROWSER_ERROR, \"Unable to open browser\", null);\n }\n\n if (logger.isDebugEnabled()) {\n logger.debug(\"run(IProgressMonitor) - end\");\n }\n } else {\n status = new Status(Status.WARNING, ForrestPlugin.ID,\n EXCEPTION_UNABLE_TO_START, \"Unable to start Forrest, port \"\n + port + \" already in use\", null);\n }\n return status;\n }", "@Test\n public void AppNoParams() {\n try{\n App.main(new String[]{});\n }catch(RuntimeException re){\n assertEquals(re.getMessage(),\"Insufficient arguments given. Needs [input file] [# processors]\");\n }\n }", "protected void checkCanRun() throws BuildException {\n \n }", "private void foundNonExistent() {\n\t\tstate = BridgeState.NON_EXISTENT;\n\t}", "private static boolean isHealthyUnderPath(String path, long timeout) {\n if (path == null) {\n return true;\n }\n List<String> commands = generateCommands(path);\n if (commands != null && commands.size() > 0) {\n for (String command : commands) {\n ScriptProcessLauncher scriptProcessLauncher = new ScriptProcessLauncher(command, timeout);\n ExitStatus exit = scriptProcessLauncher.launch();\n if (exit.equals(ExitStatus.FAILED)) {\n return false;\n }\n }\n return true;\n } else {\n return true;\n }\n }", "private void checkStatus()\n {\n // If the last command failed\n if(!project.getLastCommandStatus())\n {\n view.alert(\"Error: \" + project.getLastCommandStatusMessage());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCommand lastCmd = project.getLastCommand();\n\t\t\tif (lastCmd != null && lastCmd.hasOptionalState())\n\t\t\t{\n\t\t\t\tview.loadFromJSON(lastCmd.getOptionalState());\n\t\t\t\tview.onUpdate(project.getProjectSnapshot(), false);\n\t\t\t}\n\t\t}\n }", "public void validateLauncherUrls() {\n log.info(\"Validating the existing launcher URL list for missing deployments...\");\n\n for (String launcherUrl : getTotalLaunchers()) {\n log.info(\"Validating [Launcher URL] \" + launcherUrl + \"...\");\n String objectName = getObjectNameFromLauncherUrl(launcherUrl);\n if (!runtimeClient.deploymentExists(objectName) || !runtimeClient.serviceExists(objectName)) {\n log.info(\"Found an invalid launcher [URL] \" + launcherUrl);\n // Just remove the reference to launcher now\n // cleanOrphan* jobs will clean any orphan deployments\n // desired count check will scale up if free count is reduced\n unregisterLauncherIfExists(launcherUrl);\n }\n }\n }", "private void checkRuntimeFail(String filename, int... input){\n\t\tString inputString = createInput(input);\n\t\t\n\t\tProgram prog;\n\t\tSimulator sim = null;\n\t\tMachine vm = null;\n\t\tPipedInputStream in = null;\n\t\ttry {\n\t\t\tprog = compiler.compile(new File(BASE_DIR, filename + EXT));\n\t\t\tvm = new Machine();\n\t\t\tsim = new Simulator(prog, vm);\n\t\t\tvm.clear();\n\t\t\tsim.setIn(new ByteArrayInputStream(inputString.getBytes()));\n\t\t\tin = new PipedInputStream();\n\t\t\tOutputStream out;\n\t\t\tout = new PipedOutputStream(in);\n\t\t\tsim.setOut(out);\n\t\t} catch (ParseException e) {fail(filename + \" did not generate\");\n\t\t} catch (IOException e) {\tfail(filename + \" did not generate\");}\n\t\t\n\t\ttry{\n\t\t\tsim.run();\n\t\t\tString output = \"\";\n\t\t\tint max = in.available();\n\t\t\tfor(int index = 0; index < max; index++)\n\t\t\t\toutput += (char)in.read();\n\t\t\t/** Check whether there was an error outputted. */\n\t\t\tif(!output.toLowerCase().contains(\"error: \"))\n\t\t\t\tfail(filename + \" shouldn't check but did\");\n\t\t} catch (Exception e) {\n\t\t\t// this is the expected behaviour\n\t\t}\n\t}", "private void initRunningToFail()\n {\n log.debug(\"Setting messages in running state to fail\");\n messageQueueItemDao.getByState(MessageState.RUNNING, new StreamCallback<MessageQueueItemMapping>()\n {\n\n @Override\n public void callback(MessageQueueItemMapping e)\n {\n Message<HasProgress> message = new Message<HasProgress>();\n @SuppressWarnings (\"unchecked\")\n MessageConsumer<HasProgress> consumer = (MessageConsumer<HasProgress>) queueToMessageConsumer.get(e.getQueue());\n\n toMessage(message, e.getMessage());\n fail(consumer, message, new RuntimeException(\"Synchronization has been interrupted (probably plugin un/re/install).\"));\n }\n\n });\n }", "public static void handleInvalidTaskException() {\n System.out.println(\"\\tSorry sir, no such task was found in the list.\");\n Duke.jarvis.printDivider();\n }", "public boolean wasSuccessful() throws TavernaException, ProcessException {\n try {\n boolean result = runner.waitFor() == 0;\n if (outputFile == null){\n saveOutput();\n }\n return result;\n } catch (InterruptedException ex) {\n throw new TavernaException(\"Error checking if run was successfull\", ex);\n }\n }", "@Override\n\t@Ignore\n\t@Test\n\tpublic void testLaunchShowsInProcessContainer() throws Throwable {\n\t}", "@Override\r\n protected boolean validateSystemSettings() {\n return true;\r\n }", "boolean isExecutableValidationEnabled();", "@Test\n\tpublic void test_invalid_config_27() throws Exception {\n\t\t\n\t\tfor (int i=27;i<29;i++) {\n\t\t\tConfig.configFile = \"test_files/config_files/invalid\" + String.valueOf(i) +\".json\";\n\t\t\tConfig.clearConfig();\n\t\t\tString missingData = \"SUPERVISOR_INPUT_FILE\";\n\t\t\tconstructObjectsExpectFailure(missingData);\n\t\t}\n\t}" ]
[ "0.535685", "0.5315737", "0.52405196", "0.519605", "0.51775694", "0.5162179", "0.49633944", "0.4918285", "0.49018458", "0.48983583", "0.4888911", "0.48709866", "0.48674166", "0.48552883", "0.47741416", "0.4752537", "0.4750992", "0.47505873", "0.47301477", "0.4721996", "0.47009993", "0.4697638", "0.46805233", "0.46789086", "0.46751744", "0.4674628", "0.46697348", "0.4666611", "0.4654225", "0.46506277", "0.46378005", "0.46356755", "0.46354285", "0.46344295", "0.46316245", "0.46146646", "0.4604293", "0.45941252", "0.45916444", "0.45807967", "0.45793498", "0.45664513", "0.45620516", "0.4552192", "0.45489228", "0.45385706", "0.45272645", "0.45098746", "0.44918004", "0.449051", "0.44886598", "0.44877812", "0.44787693", "0.44686264", "0.4467457", "0.445938", "0.4457057", "0.44554743", "0.44499058", "0.44441637", "0.44278216", "0.44278216", "0.44278216", "0.44249082", "0.442476", "0.44195178", "0.44149017", "0.4400266", "0.43964675", "0.43963018", "0.43945038", "0.43878484", "0.43822125", "0.43767932", "0.43763098", "0.43749952", "0.43732375", "0.4371999", "0.43661192", "0.4363577", "0.4363523", "0.43597904", "0.4359428", "0.43519506", "0.4346536", "0.43454283", "0.4340958", "0.43304044", "0.43232915", "0.43231097", "0.43104753", "0.4305825", "0.4296959", "0.42969564", "0.42958355", "0.4291076", "0.42888752", "0.42888272", "0.42822176", "0.42811057", "0.42758307" ]
0.0
-1
Test Somatic vs Germline: Check HGVS notation "c."
@Test public void test_04() { Gpr.debug("Test"); String file = "tests/integration/cancer/test_04.vcf"; snpEffectCancer(file, null, "testHg19Chr22", false, "p.Gln133Leu", "c.398A>T", "A-T", null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void test_06_hgvs_upstream_negative_strand() {\n Log.debug(\"Test\");\n List<VcfEntry> list = snpEffect(\"testHg38Chr1\", path(\"hgvs_upstream_negative_strand_06.vcf\"), null);\n checkHgvscForTr(list, \"NM_016176.3\");\n }", "@Test\n public void testRedundant2version() {\n String ver2 = Textile.straighten_weft2(\"aad.bbd+d*ac\");\n assertEquals(\"d.bbac\",ver2);\n }", "@Test\n public void test_04_hgvs_upstream_negative_strand() {\n Log.debug(\"Test\");\n List<VcfEntry> list = snpEffect(\"testHg19Chr17\", path(\"hgvs_upstream_negative_strand.vcf\"), null);\n\n for (VcfEntry ve : list) {\n if (verbose) Log.info(ve);\n\n for (VcfEffect veff : ve.getVcfEffects()) {\n if (veff.getTranscriptId().equals(\"NM_000199.3\")) {\n if (verbose) {\n System.out.println(\"\\t\" + veff);\n System.out.println(\"\\t\\tHGVS.c: \" + veff.getHgvsC());\n }\n\n // Compare against expected result\n String expectedHgvsC = ve.getInfo(\"HGVSC\");\n String actualHgvsC = veff.getHgvsC();\n assertEquals(expectedHgvsC, actualHgvsC);\n }\n }\n }\n }", "@Test\n public void test_01_hgvs_upstream() {\n Log.debug(\"Test\");\n List<VcfEntry> list = snpEffect(\"testHg19Chr2\", path(\"hgvs_upstream.vcf\"), null);\n\n for (VcfEntry ve : list) {\n if (verbose) Log.info(ve);\n\n for (VcfEffect veff : ve.getVcfEffects()) {\n if (veff.getTranscriptId().equals(\"NM_000463.2\")) {\n if (verbose) {\n System.out.println(\"\\t\" + veff);\n System.out.println(\"\\t\\tHGVS.c: \" + veff.getHgvsC());\n }\n\n // Compare against expected result\n String expectedHgvsC = ve.getInfo(\"HGVSC\");\n String actualHgvsC = veff.getHgvsC();\n assertEquals(expectedHgvsC, actualHgvsC);\n }\n }\n }\n }", "private boolean checkInCashe(String s) {\n return true;\n }", "public final void testCaron2() \n\t\t\tthrows ParserConfigurationException, IOException, SAXException \n\t{\n\t\tassertSingleResult(\"9\", fldName, \"Latviesǔ\");\n\t\tassertSingleResult(\"9\", fldName, \"Latviesu\");\n\t}", "@Test\n @Tag(\"bm1000\")\n public void testSCAGR25() {\n CuteNetlibCase.doTest(\"SCAGR25.SIF\", \"-1.475343306076852E7\", null, NumberContext.of(7, 4));\n }", "@Test\n public void test_05_hgvs_downstream_negative_strand() {\n Log.debug(\"Test\");\n List<VcfEntry> list = snpEffect(\"testHg19Chr17\", path(\"hgvs_downstream_negative_strand.vcf\"), null);\n\n for (VcfEntry ve : list) {\n if (verbose) Log.info(ve);\n\n for (VcfEffect veff : ve.getVcfEffects()) {\n if (veff.getTranscriptId().equals(\"NM_000199.3\")) {\n if (verbose) {\n System.out.println(\"\\t\" + veff);\n System.out.println(\"\\t\\tHGVS.c: \" + veff.getHgvsC());\n }\n\n // Compare against expected result\n String expectedHgvsC = ve.getInfo(\"HGVSC\");\n String actualHgvsC = veff.getHgvsC();\n assertEquals(expectedHgvsC, actualHgvsC);\n }\n }\n }\n }", "@Test\n @Tag(\"bm1000\")\n public void testSCSD1() {\n CuteNetlibCase.doTest(\"SCSD1.SIF\", \"8.666666674333367\", null, NumberContext.of(7, 4));\n }", "public void testAlgorithmSpecific() {\n TestData.chars(\"x y z\", \"xX Zz\")\n ._______Def_(\" - \", \" - - \")\n .____Ignore_(\" - \", \" -------- \")\n .all();\n }", "public void testVMCompletion() {\n SyntaxChecker chkr = new SyntaxChecker(20, true);\n SyntaxContainer res = null;\n res = chkr.getCompletion(\"\");\n assertTrue(\"Vms\", contains(res, \"Vms\"));\n res = chkr.getCompletion(\"V\");\n assertTrue(\"Vms2\", contains(res, \"Vms\"));\n res = chkr.getCompletion(\"Vms\");\n assertTrue(\":\", contains(res, \":\"));\n res = chkr.getCompletion(\"Vms : \");\n assertTrue(\"Events\", contains(res, \"Events\"));\n res = chkr.getCompletion(\"Vms : Events\");\n assertTrue(\"=\", contains(res, \"=\"));\n }", "@Test\n @Tag(\"bm1000\")\n public void testSCORPION() {\n CuteNetlibCase.doTest(\"SCORPION.SIF\", \"1878.1248227381068\", null, NumberContext.of(7, 4));\n }", "private boolean isVcheck (JPLine plinesucc)\n\t{\n\t\tJPLine pline = plines.lower(plinesucc);\n\t\tif (pline == null) return false;\n\t\tif (pline.len != 2) return false;\n\t\tJPLine pred = plines.lower(pline);\n\t\tif (pred == null) return false;\n\t\treturn (pred.flag0 & 0x64) == 0x24; // branch instruction that is itself covered and not start of source code statement\n\t}", "public static void main(String[] args) {\n\n\t\tSystem.out.println(180%30);\n\t\tSystem.out.println(12%30);\n\t\tSystem.out.println(179%30);\n\t\tSystem.out.println(30%30);\n\t\tint docNum= 10, docCount=10;\n\t\tSystem.out.println(\"Math.log docNum / docCount:\"+ Math.log((double) docNum / docCount));\n\t\tSystem.out.println(SvmUtil.parseWord(\"你愛我嗎\"));\n\t\tString test = \"中華民國,中華民國,中華民國,中華民國,中華民國,中華民國,中華民國,中華民國,中華民國,中華民國\";\n\t\tString ssss = \"中華民國\";\n\t\tSystem.out.println(ssss.matches(\"[\\\\u4e00-\\\\u9fa5]+\"));\n\n\t\tSvmUtil.init();\n\t\tSystem.out.println(SvmUtil.labelToName(3d));\n\t\tSystem.out.println(SvmUtil.nameToLabel(\"資管處\"));\n\t\tSystem.out.println(\"frequency:\" + SvmUtil.frequency(test, \"中華\"));\n\t\tlong startTime = System.currentTimeMillis();\n\t\tfor (int i = 0; i <= 1000; i++)\n\t\t\tSvmUtil.frequency(test, \"中\");\n\t\tSystem.out.println(\"search Time:\" + (double) (System.currentTimeMillis() - startTime) / 1000d + \" s\");\n\n\t\tSet<String> testSet = new HashSet<String>();\n\t\ttestSet.add(\"中華民國\");\n\t\ttestSet.add(\"中華\");\n\t\ttestSet.add(\"中華民國\");\n\t\tSystem.out.println(testSet);\n\n\t\tjiebaAnalysis();\n\t\t// float value = (float) Math.log(987654 / 999);\n\t\t// System.out.println(value);\n\t\t// int i=100;\n\t\t// long l =9999;\n\t\t// System.out.println(String.format(\"% 5d\", i));\n\t\t// System.out.println(String.format(\"% 5d\", l));\n\t}", "@Test\r\n public void testInvalidDecSuffixExpressionWithSIUnits() throws IOException {\n checkError(\"varS--\", \"0xA0171\");\r\n }", "@Test\n @Tag(\"bm1000\")\n public void testSCAGR7() {\n CuteNetlibCase.doTest(\"SCAGR7.SIF\", \"-2331389.8243309837\", null, NumberContext.of(7, 4));\n }", "public static boolean goodGC(String sequence) {\n\t\tdouble gcCount = 0;\n\t\tfor (int i = 0; i < sequence.length(); i++)\n\t\t\tif (sequence.charAt(i) == 'g' || sequence.charAt(i) == 'c') gcCount++;\n\t\treturn (gcCount / sequence.length()) >= MIN_GC_FRACTION && (gcCount / sequence.length()) <= MAX_GC_FRACTION;\n\t}", "@Test void test2() {\n\t\tAztecCode marker = new AztecEncoder().addLower(\"c\").addPunctuation(\"!!\").addMixed(\"^\").addPunctuation(\"!!\").fixate();\n\n\t\tclearMarker(marker);\n\n\t\tassertTrue(new AztecDecoder().process(marker));\n\n\t\tassertEquals(\"c!!^!!\", marker.message);\n\t\tassertEquals(0, marker.totalBitErrors);\n\t}", "@Test\n\tpublic void verurteilenTest() {\n\t\tR1.verurteilen(Sc1);\n\t\tR2.verurteilen(Sc2);\n\t\tassertEquals(true, Sc1.getIstVerurteilt());\n\t\tassertEquals(false, Sc2.getIstVerurteilt());\n\n\t\tR1.verurteilen(Sc2);\n\t\tR2.verurteilen(Sc1);\n\t\tassertEquals(true, Sc2.getIstVerurteilt());\n\t\tassertEquals(false, Sc1.getIstVerurteilt());\n\n\t}", "@Test\n public void test_02_hgvs_downstream() {\n Log.debug(\"Test\");\n List<VcfEntry> list = snpEffect(\"testHg19Chr2\", path(\"hgvs_downstream.vcf\"), null);\n\n for (VcfEntry ve : list) {\n if (verbose) Log.info(ve);\n\n for (VcfEffect veff : ve.getVcfEffects()) {\n if (veff.getTranscriptId().equals(\"NM_000463.2\")) {\n if (verbose) {\n System.out.println(\"\\t\" + veff);\n System.out.println(\"\\t\\tHGVS.c: \" + veff.getHgvsC());\n }\n\n // Compare against expected result\n String expectedHgvsC = ve.getInfo(\"HGVSC\");\n String actualHgvsC = veff.getHgvsC();\n assertEquals(expectedHgvsC, actualHgvsC);\n }\n }\n }\n }", "@Test\n\tpublic void ricercaSinteticaClassificatoreGSAFigli() {\n\n\t}", "@Test\n\t public void test4()\n\t{\n\t\t\t// String s = new String();\n\t // s = s.replaceAll(\"\\\\s+\", \" \");\n\t\t\tassertEquals(\"\", LRS.lcp(\"vcd\",\"cd\"));\n\t}", "@Test\n @Tag(\"bm1000\")\n public void testSCFXM2() {\n CuteNetlibCase.doTest(\"SCFXM2.SIF\", \"36660.261564998815\", null, NumberContext.of(7, 4));\n }", "@Test\n public void testInbreedingCoeffForMultiallelicVC() {\n VariantContext test1 = makeVC(\"1\",Arrays.asList(Aref,T,C),\n makeG(\"s1\", Aref, T, 2530, 0, 7099, 366, 3056, 14931),\n makeG(\"s2\", T, T, 7099, 2530, 0, 7099, 366, 3056),\n makeG(\"s3\", T, C, 7099, 2530, 7099, 3056, 0, 14931),\n makeG(\"s4\", Aref, T, 2530, 0, 7099, 366, 3056, 14931),\n makeG(\"s5\", T, T, 7099, 2530, 0, 7099, 366, 3056),\n makeG(\"s6\", Aref, T, 2530, 0, 7099, 366, 3056, 14931),\n makeG(\"s7\", T, T, 7099, 2530, 0, 7099, 366, 3056),\n makeG(\"s8\", Aref, T, 2530, 0, 7099, 366, 3056, 14931),\n makeG(\"s9\", T, T, 7099, 2530, 0, 7099, 366, 3056),\n makeG(\"s10\", Aref, T, 2530, 0, 7099, 366, 3056, 14931));\n\n final AS_InbreedingCoeff testClass1 = new AS_InbreedingCoeff();\n final double ICresult1 = testClass1.calculateIC(test1, T);\n Assert.assertEquals(ICresult1, -0.4285714, DELTA_PRECISION, \"Pass\");\n final double ICresult1b = testClass1.calculateIC(test1, C);\n Assert.assertEquals(ICresult1b, -0.05263, DELTA_PRECISION, \"Pass\");\n\n //make sure that hets with different alternate alleles all get counted\n VariantContext test2 = makeVC(\"2\", Arrays.asList(Aref,T,C),\n makeG(\"s1\", Aref, C, 4878, 1623, 11297, 0, 7970, 8847),\n makeG(\"s2\", Aref, T, 2530, 0, 7099, 366, 3056, 14931),\n makeG(\"s3\", Aref, T, 3382, 0, 6364, 1817, 5867, 12246),\n makeG(\"s4\", Aref, T, 2488, 0, 9110, 3131, 9374, 12505),\n makeG(\"s5\", Aref, C, 4530, 2006, 18875, 0, 6847, 23949),\n makeG(\"s6\", Aref, T, 5325, 0, 18692, 389, 16014, 24570),\n makeG(\"s7\", Aref, T, 2936, 0, 29743, 499, 21979, 38630),\n makeG(\"s8\", Aref, T, 6902, 0, 8976, 45, 5844, 9061),\n makeG(\"s9\", Aref, T, 5732, 0, 10876, 6394, 11408, 17802),\n makeG(\"s10\", Aref, T, 2780, 0, 25045, 824, 23330, 30939));\n\n final AS_InbreedingCoeff testClass2 = new AS_InbreedingCoeff();\n final double ICresult2 = testClass2.calculateIC(test2, T);\n Assert.assertEquals(ICresult2, -0.666666, DELTA_PRECISION, \"Pass\");\n final double ICresult2b = testClass2.calculateIC(test2, C);\n Assert.assertEquals(ICresult2b, -0.111129, DELTA_PRECISION, \"Pass\");\n }", "@Test\n public void testG00012MOGlycoct() throws Exception {\n SelectSparql compare = new SubstructureSearchSparql();\n String G00003VQ = \"WURCS=2.0/4,4,3/[u2122h][12112h-1b_1-5][22112h-1a_1-5][12112h-1b_1-5_2*NCC/3=O]/1-2-3-4/a4-b1_b3-c1_c3-d1\";\n SelectSparql result = gc.substructureSearch(G00003VQ, \"wurcs\");\n logger.debug(\"RESULT>\" + result.getSparql() +\"<\");\n }", "@Test\n public void testVerser2() {\n\n //Arrange\n CompteBancaire cpt = new CompteBancaire(6500.0);\n double montant_a_verser = -2000.0;\n double excepted = 6500.0;\n\n //Act\n assertEquals(false, cpt.verser(montant_a_verser));\n\n //Assert\n assertEquals(excepted, cpt.getSolde(), 0);\n\n }", "@Test\n public void testComp2()\n {\n System.out.println(\"comp\");\n String compString = \"D+M\";\n assertEquals(\"1000010\", N2TCode.comp(compString));\n }", "@Ignore\n @Test\n public void kingSecurity() {\n board = new Board(\"rnbqkbnr/ppp2ppp/8/8/8/8/3PPPPP/RNBQKBNR w qkQK -\");\n board.printBoard();\n\n int value = StaticEvaluator.getValue(board.getSquares());\n\n assertTrue(value > 0);\n\n }", "@Test(timeout = 4000)\n public void test56() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"Used for alphabetizing, cross referencing, and creating a label when the ``author'' information is missing. This field should not be confused with the key that appears in the cite command and at the beginning of the database entry.\");\n assertEquals(\"us for alphabes, cros refer, and creat a label when th ``author'' inform is mis. th field should not be confus with th key that appear in th cit command and at th begin of th databas entr.\", string0);\n }", "@Test\r\n public void deriveFromIncSuffixExpressionWithSIUnits() throws IOException {\r\n //example with siunit literal\r\n check(\"4km++\", \"(int,km)\");\r\n }", "public boolean testSouvislostiAStupneVrcholu(){\n\t\t\n\t\tif(!souvislost()){\n\t\t\tvys = \"Graf neni souvisly a proto nemuze byt ani Eulerovsky.\";\n\t\t\treturn false;\n\t\t}\n\t\tif(!muzeBytEuler()){\n\t\t\tvys = \"Stupne vrcholu nejsou bud sude nebo nebo si neodpovida jejich vstupni a vystupni stupen.\";\n\t\t\treturn false;\n\t\t}\n\t\tif(muzeBytEuler() && souvislost()){\n\t\t\tvys =\"Graf je souvisly a zaroven vsechny stupne jsou sude nebo jejich vstupni a vystupni stupen je roven.\";\n\t\t\treturn true;\n\t\t}\n\t\treturn true;\n\t}", "@Test\n @Tag(\"bm1000\")\n public void testSEBA() {\n CuteNetlibCase.doTest(\"SEBA.SIF\", \"15711.6\", \"35160.46056\", NumberContext.of(7, 4));\n }", "@Test\r\n public void testCheckGIS() {\r\n System.out.println(\"checkGIS\");\r\n String word = \"crowd\";\r\n IwRepoDAOMarkLogicImplStud instance = new IwRepoDAOMarkLogicImplStud();\r\n boolean expResult = true;\r\n boolean result = instance.checkGIS(word);\r\n assertEquals(expResult, result);\r\n word = \"nevergoingtobeawordtotest\";\r\n expResult = false;\r\n result = instance.checkGIS(word);\r\n assertEquals(expResult, result);\r\n }", "private void lorentzInvariant() {\n if (world.getEvents().isEmpty()) {\n System.out.println(\"You don't have any events to get the Lorentz Invariant of!\");\n } else {\n Event event1 = selectEvent(\"What is the first event you want to compare?\");\n Event event2 = selectEvent(\"What is the second event you want to compare?\");\n double invariant = event1.lorentzInvariant(event2);\n String out = \"The Lorentz Invariant of \" + event1.getName() + \" and \" + event2.getName() + \" is \";\n System.out.println(out + invariant);\n String separation;\n if (Math.abs(invariant) < ALLOWED_DELTA) {\n separation = \"null\";\n } else if (invariant > 0) {\n separation = \"spacelike\";\n } else {\n separation = \"timelike\";\n }\n System.out.println(\"This means that the two events are \" + separation + \" separated.\");\n }\n }", "@Test\n\tpublic void testEqualityCheck() {\n\t\tadd(\"f(x)=x^3\");\n\t\tadd(\"g(x)=-x^3\");\n\t\tt(\"f==g\", \"false\");\n\t\tt(\"f!=g\", \"true\");\n\t\tt(\"f==-g\", \"true\");\n\t\tt(\"f!=-g\", \"false\");\n\t}", "public void testNonZeroModGs() {\n\tdouble[] nzModG = trseScheme.getNonZeroModGs();\n\n\tassertEquals(13, nzModG.length);\n\n\tfor (int i = 0; i < 7; i++) {\n\t assertEquals(0.039887, nzModG[i], 1E-8);\n\t}\n\n\tfor (int i = 0; i < 6; i++) {\n\t assertEquals(0.012614, nzModG[i+7], 1E-8);\n\t}\n\n\t\n }", "@Test void test1() {\n\t\tAztecCode marker = new AztecEncoder().addUpper(\"C\").addPunctuation(\"!!!\").addDigit(\"0\").addPunctuation(\"!!\").fixate();\n\t\tclearMarker(marker);\n\n\t\tassertTrue(new AztecDecoder().process(marker));\n\n\t\tassertEquals(\"C!!!0!!\", marker.message);\n\t\tassertEquals(0, marker.totalBitErrors);\n\t}", "@Test\n public void testEditDistEqualStrings() throws Exception{\n assertEquals(0,Esercizio2.edit_distance_dyn(s1,s4));\n }", "@Test\n @Tag(\"slow\")\n public void testSHELL() {\n CuteNetlibCase.doTest(\"SHELL.SIF\", \"1.208825346E9\", null, NumberContext.of(7, 4));\n }", "@Ignore\n @Test\n public void testDefaultBassOctave() {\n assertTrue(compare(\":DEFAULT(BASS_OCTAVE=1) Cmaj\", CHORD_PARSED, new Chord(\"CMAJ\")));\n }", "C1458cs mo7613iS();", "boolean hasGcj02();", "public char test(char c) {\n\t\tchar[] lower = { '-', '+' };\n\t\tchar[] higher = { '*', '/' };\n\t\tfor (int i = 0; i < 2; i++) {\n\t\t\tif (lower[i] == c) {\n\t\t\t\treturn 'l';\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < 2; i++) {\n\t\t\tif (higher[i] == c) {\n\t\t\t\treturn 'h';\n\t\t\t}\n\t\t}\n\t\t// just to make the method work , no meaning for the 'n'\n\t\treturn 'n';\n\t}", "@Test\n\tpublic void testDeweyAsLC() \n\t{\n\t\tString id = \"deweyAsLC\";\n\t\tassertDeweyVolLopped(id);\n\t\tassertNoUnloppedDeweyVol1(id);\n\t\tassertNoUnloppedDeweyVol2(id);\n\t}", "@Test\n public void testComplexGraph() {\n CFGCreator<Character> cfgCreator = new CFGCreator<>();\n CharGrammarParser parser = new CharGrammarParser(cfgCreator);\n SLPOp<Character> slpOp = new SLPOp();\n CFGOp<Character> cfgOp = new CFGOp<>();\n\n // L(G) = {(ab)^1 : i >= 1}\n String text =\n \"S -> bAs \\n\" +\n \"A -> iBa \\n\" +\n \"B -> aCi \\n\" +\n \"C -> sd \\n\" +\n \"D -> SSESS \\n\" +\n \"E -> zSSESSr \\n\" +\n \"E -> uu \\n\";\n\n Map<IJezSymbol<Character>, List<IJezSymbol<Character>>> f = new HashMap<>();\n Map<IJezSymbol<Character>, List<IJezSymbol<Character>>> g = new HashMap<>();\n\n IJezSymbol<Character> a = cfgCreator.lookupSymbol('a', true);\n IJezSymbol<Character> b = cfgCreator.lookupSymbol('b', true);\n IJezSymbol<Character> d = cfgCreator.lookupSymbol('d', true);\n IJezSymbol<Character> i = cfgCreator.lookupSymbol('i', true);\n IJezSymbol<Character> s = cfgCreator.lookupSymbol('s', true);\n IJezSymbol<Character> r = cfgCreator.lookupSymbol('r', true);\n IJezSymbol<Character> u = cfgCreator.lookupSymbol('u', true);\n IJezSymbol<Character> z = cfgCreator.lookupSymbol('z', true);\n\n IJezSymbol<Character> one = cfgCreator.lookupSymbol('1', true);\n IJezSymbol<Character> two = cfgCreator.lookupSymbol('2', true);\n IJezSymbol<Character> three = cfgCreator.lookupSymbol('3', true);\n\n f.put(a, Arrays.asList(one, two));\n f.put(b, Arrays.asList(three, two));\n f.put(d, Arrays.asList(one, one, one, two));\n f.put(i, Arrays.asList(two));\n f.put(s, Arrays.asList(one, one, two));\n f.put(r, Arrays.asList(r));\n f.put(u, Arrays.asList(u));\n f.put(z, Arrays.asList(z));\n\n\n g.put(a, Arrays.asList(one, two, one));\n g.put(b, Arrays.asList(three));\n g.put(d, Arrays.asList(one, one, one));\n g.put(i, Arrays.asList(two, two));\n g.put(s, Arrays.asList(one, two));\n g.put(r, Arrays.asList(r));\n g.put(u, Arrays.asList(u));\n g.put(z, Arrays.asList(z));\n\n\n Set<Production<Character>> productions = parser.createProductions(text);\n Set<IJezSymbol<Character>> axiom = new HashSet<>();\n axiom.add(cfgCreator.lookupSymbol('D', false));\n\n\n Set<Production<Character>> wCNFProductions = cfgOp.toWeakCNF(productions, axiom, cfgCreator);\n MorphismEQSolver<Character, Character> morphismEQSolver = new MorphismEQSolver<>(cfgCreator.createCFG(wCNFProductions, axiom), cfgCreator, new CFGCreatorFactory<>(), new CFGCreatorFactory<>());\n\n GenDefaultMorphism<Character> morphism1 = new GenDefaultMorphism<>(f::get);\n GenDefaultMorphism<Character> morphism2 = new GenDefaultMorphism<>(g::get);\n long ms = System.currentTimeMillis();\n assertTrue(morphismEQSolver.equivalentOnMorphisms(morphism1, morphism2));\n logger.info(\"Running time: \" + (System.currentTimeMillis() - ms) + \"[ms]\");\n }", "@Test(timeout = 4000)\n public void test17() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"invalid CVS re5iion - not enough parts separatedby dots!\");\n assertEquals(\"invalis cv re5i - not enough part separatedb dot!\", string0);\n }", "@Test\n public void testEditDistDifferentStrings() throws Exception{\n assertEquals(1,Esercizio2.edit_distance_dyn(s1, s2));\n }", "@Test\n @Tag(\"slow\")\n public void testGANGES() {\n CuteNetlibCase.doTest(\"GANGES.SIF\", \"-109585.73612927811\", \"-2.24E-12\", NumberContext.of(7, 4));\n }", "@Test\n @Tag(\"slow\")\n @Tag(\"unstable\")\n public void testCRE_C() {\n CuteNetlibCase.doTest(\"CRE-C.SIF\", \"2.996133067602781E7\", \"2.996133067602781E7\", NumberContext.of(7, 4));\n }", "@Test\n @Tag(\"bm1000\")\n public void testSCFXM1() {\n CuteNetlibCase.doTest(\"SCFXM1.SIF\", \"18416.75902834894\", null, NumberContext.of(7, 4));\n }", "@Test\n public void someTests() {\n StringPair[] spvalues = new StringPair[]{\n new StringPair(\"\\u00C6neid\", \"AEneid\"),\n new StringPair(\"\\u00e9tude\", \"etude\"),\n // Chinese\n new StringPair(\"\\u5317\\u4eb0\", \"Bei Jing \"),\n // Canadian syllabics\n new StringPair(\"\\u1515\\u14c7\\u14c7\", \"shanana\"),\n // Cherokee\n new StringPair(\"\\u13d4\\u13b5\\u13c6\", \"taliqua\"),\n // Syriac\n new StringPair(\"\\u0726\\u071b\\u073d\\u0710\\u073a\", \"ptu'i\"),\n //Devangari\n new StringPair(\"\\u0905\\u092d\\u093f\\u091c\\u0940\\u0924\", \"abhijiit\"),\n // Bengali\n new StringPair(\"\\u0985\\u09ad\\u09bf\\u099c\\u09c0\\u09a4\", \"abhijiit\"),\n //Malayalaam\n new StringPair(\"\\u0d05\\u0d2d\\u0d3f\\u0d1c\\u0d40\\u0d24\", \"abhijiit\"),\n /*\n * Malayalaam. The correct transliteration is \"malayaalam\", but\n * since junidecode is context insentitive this is the best we can\n * do.\n */\n new StringPair(\"\\u0d2e\\u0d32\\u0d2f\\u0d3e\\u0d32\\u0d2e\\u0d4d\", \"mlyaalm\"),\n // Japanese\n new StringPair(\"\\u3052\\u3093\\u307e\\u3044\\u8336\", \"genmaiCha \")\n };\n for (StringPair sp : spvalues) {\n String decoded = Junidecode.unidecode(sp.getLeft());\n assertEquals(sp.getRight(), decoded);\n sevenBitPurity(decoded);\n }\n }", "@Test\n @Tag(\"bm1000\")\n public void testGROW22() {\n CuteNetlibCase.doTest(\"GROW22.SIF\", \"-1.608343364825636E8\", \"0.0\", NumberContext.of(7, 4));\n }", "@Test\n @Tag(\"slow\")\n public void testSTANDATA() {\n CuteNetlibCase.doTest(\"STANDATA.SIF\", \"1257.6995\", null, NumberContext.of(7, 4));\n }", "@Test\r\n public void testInvalidIncSuffixExpressionWithSIUnits() throws IOException {\n checkError(\"varS++\", \"0xA0170\");\r\n }", "@Test(timeout = 4000)\n public void test68() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"probToLogOdds: probability must be in [0,1] \");\n assertEquals(\"probtologod: prob must be in [0,1] \", string0);\n }", "public void printType(){\n l1= v1.distance(v2);\r\n l2= v1.distance(v3);\r\n l3= v2.distance(v3); \r\n if(l1 == l2 && l1==l3 && l2==l3)\r\n System.out.println(\"Equilateral\");\r\n if(l1 == l2 || l1==l3 || l2==l3)\r\n System.out.println(\"Isosceles\");\r\n else \r\n System.out.println(\"Scalene\"); \r\n \r\n }", "@Test\n public void testGiantComponent()\n {\n assertEquals(MarkovModel.util.giantComponent(P1), giant1);\n assertEquals(MarkovModel.util.giantComponent(P2), giant2);\n assertEquals(MarkovModel.util.giantComponent(P3), giant3);\n }", "@Test\n @Tag(\"slow\")\n public void testSTANDGUB() {\n CuteNetlibCase.doTest(\"STANDGUB.SIF\", \"1257.6995\", null, NumberContext.of(7, 4));\n }", "@Test\n @Tag(\"bm1000\")\n public void testSC50A() {\n CuteNetlibCase.doTest(\"SC50A.SIF\", \"-64.57507705856449\", \"0.0\", NumberContext.of(7, 4));\n }", "static void stc_with_car(String passed){\n\t\tCS = true;\n\t}", "@Test\n public void kaasunKonstruktoriToimiiOikeinTest() {\n assertEquals(rikkihappo.toString(),\"Rikkihappo Moolimassa: 0.098079\\n tiheys: 1800.0\\n lämpötila: 298.15\\n diffuusiotilavuus: 50.17\\npitoisuus: 1.0E12\");\n }", "@Test\n public void test_03_hgvs_upstream_del() {\n Log.debug(\"Test\");\n List<VcfEntry> list = snpEffect(\"testHg3765Chr22\", path(\"hgvs_upstream_del.vcf\"), null);\n\n for (VcfEntry ve : list) {\n if (verbose) Log.info(ve);\n\n for (VcfEffect veff : ve.getVcfEffects()) {\n if (veff.getTranscriptId().equals(\"ENST00000404751\")) {\n if (verbose) {\n System.out.println(\"\\t\" + veff);\n System.out.println(\"\\t\\tHGVS.c: \" + veff.getHgvsC());\n }\n\n // Compare against expected result\n String expectedHgvsC = ve.getInfo(\"HGVSC\");\n String actualHgvsC = veff.getHgvsC();\n assertEquals(expectedHgvsC, actualHgvsC);\n }\n }\n }\n }", "@Test\n public void testVerser1() {\n\n //Arrange\n CompteBancaire cpt = new CompteBancaire(5000.0);\n double montant_a_verser = 1000.0;\n double excepted = 6000.0;\n\n //Act\n assertEquals(true, cpt.verser(montant_a_verser));\n\n //Assert\n assertEquals(excepted, cpt.getSolde(), 0);\n }", "@Test\r\n public void testForCNSHIsFullCNCHHasOnlyOnePlace() {\r\n createCNSHIsFullCNCHHasOnlyOnePlace();\r\n this.sol = new Solution(this.studentList, this.schoolList, this.studentPreferences, this.schoolPreferences);\r\n assertEquals(solutionForCNSHIsFullCNCHHasOnlyOnePlace(), sol.getSolution(), \"Should work\");\r\n }", "@Test\r\n public void testInvalidDecPrefixExpressionWithSIUnits() throws IOException {\n checkError(\"--varS\", \"0xA0173\");\r\n }", "@Test\n @Tag(\"bm1000\")\n public void testSC105() {\n CuteNetlibCase.doTest(\"SC105.SIF\", \"-52.202061211707246\", \"0.0\", NumberContext.of(7, 4));\n }", "@Test\n public void testCheckTriType() {\n System.out.println(\"checkTriType\");\n double[] a = {1 , 5 , 4 , 100};\n double[] b = {1 , 5 , 3 , 5 };\n double[] c = {1 , 8 , 2 , 6 };\n SVV01 instance = new SVV01();\n String[] expResult = {\"Equilateral Triangle\",\"Isosceles Triangle\",\"Scalene\",\"Invalid\"};\n \n for ( int i = 0 ; i < 4 ; i++ ){\n String result = instance.checkTriType(a[i], b[i], c[i]);\n assertEquals(expResult[i], result);\n }\n }", "@Test(timeout = 4000)\n public void test37() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stem(\"v<l<6c/XVopp\");\n assertEquals(\"v<l<6c/xvop\", string0);\n }", "public static boolean isVog(String s){\n boolean flag = true;\n int i = 0;\n while(flag && i < s.length()){\n flag = (s.charAt(i) == 'a' || s.charAt(i) == 'A' ||\n s.charAt(i) == 'e' || s.charAt(i) == 'E' ||\n s.charAt(i) == 'i' || s.charAt(i) == 'I' ||\n s.charAt(i) == 'o' || s.charAt(i) == 'O' ||\n s.charAt(i) == 'u' || s.charAt(i) == 'U' );\n i++;\n }\n return flag;\n }", "@Test\n public void testG00003VQGlycoct() throws Exception {\n SelectSparql compare = new SubstructureSearchSparql();\n String G00003VQ = \"WURCS=2.0/4,5,5/[12112h-1b_1-5_2*NCC/3=O][12122a-1b_1-5][22112h-1a_1-5][12122h-1b_1-5]/1-2-1-3-4/a3-b1_b4-c1_c4-d1_d3-e1_a1-e4~n\";\n SelectSparql result = gc.substructureSearch(G00003VQ, \"wurcs\");\n logger.debug(\"RESULT>\" + result.getSparql() +\"<\");\n }", "@Test\r\n public void testInvalidMinusAssignmentExpressionWithSIUnits2() throws IOException {\n checkError(\"varS-=4km\", \"0xA0177\");\r\n }", "@Test\n @Tag(\"slow\")\n public void testOSA_07() {\n CuteNetlibCase.doTest(\"OSA-07.SIF\", \"535722.517299352\", \"4332086.205299969\", NumberContext.of(7, 4));\n }", "@Test\n @Tag(\"bm1000\")\n public void testSC50B() {\n CuteNetlibCase.doTest(\"SC50B.SIF\", \"-7.0000000000E+01\", \"0.0\", NumberContext.of(7, 4));\n }", "@Test\r\n public void testInvalidMinusPrefixExpressionWithSIUnits() throws IOException {\n checkError(\"-varS\", \"0xA0175\");\r\n }", "@Test\n @Tag(\"slow\")\n public void testOSA_14() {\n CuteNetlibCase.doTest(\"OSA-14.SIF\", \"1106462.8447362552\", \"9377699.405100001\", NumberContext.of(7, 4));\n }", "@Test\r\n\tpublic void testIsOBGYN() {\r\n\t\tAssert.assertFalse(oic.isOBGYN(\"a\"));\r\n\t\t\r\n\t\tAssert.assertFalse(oic.isOBGYN(\"123\"));\r\n\t\t\r\n\t\tAssert.assertFalse(oic.isOBGYN(\"9000000003\"));\r\n\t\t\r\n\t\tAssert.assertFalse(oic.isOBGYN(\"9900000000\"));\r\n\t\t\r\n\t\tAssert.assertTrue(oic.isOBGYN(\"9000000012\"));\r\n\t}", "@Test\n public void testValiderLaCouvertureDuSoin() {\n \n assertTrue(soin1.validerLaCouvertureDuSoin());\n soin3.setPourcentage(2.0);\n assertFalse(soin3.validerLaCouvertureDuSoin());\n soin3.setPourcentage(-1.1);\n assertFalse(soin3.validerLaCouvertureDuSoin());\n assertTrue(soin2.validerLaCouvertureDuSoin());\n }", "@Test(timeout = 4000)\n public void test57() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"us for alphabes, cros refer, and creat a label when th ``author'' inform is mis. th field should not be confus with th key that appear in th cit command and at th begin of th databas entr.\");\n assertEquals(\"us for alphab, cro refer, and creat a label when th ``author'' inform is mi. th field should not be confus with th key that appear in th cit command and at th begin of th datab entr.\", string0);\n }", "@Test\n public void testGPSping() {\n assertEquals(-31.977484, csse.getLat(), PRECISION);\n assertEquals(115.859945, perth.getLon(), PRECISION);\n assertEquals(48.859741, paris.getLat(), PRECISION);\n assertEquals(1565063614,csse.getTime());\n }", "@Test(timeout = 4000)\n public void test67() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.globalInfo();\n assertEquals(\"A stemmer based on the Lovins stemmer, described here:\\n\\nJulie Beth Lovins (1968). Development of a stemming algorithm. Mechanical Translation and Computational Linguistics. 11:22-31.\", string0);\n }", "@Test\n @Tag(\"slow\")\n public void testSTANDMPS() {\n CuteNetlibCase.doTest(\"STANDMPS.SIF\", \"1406.0175\", null, NumberContext.of(7, 4));\n }", "@Test\n public void testIsStation() {\n System.out.println(\"isStation\");\n Block instance = new Block(\"Green\",\"A\",2,328.1,3.281,180.455,\"STATION; PIONEER\",1,1,3.281,4.9215);\n boolean expResult = true;\n boolean result = instance.isStation();\n assertEquals(expResult, result);\n }", "public void testV8() {\n this.testCollisionGenerator(new V8CollisionGenerator(SEED), true);\n }", "@Test(timeout = 4000)\n public void test58() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.stemString(\"The WWW Universal Resource Locator that points to the item being referenced. This often is used for technical reports to point to the ftp site where the postscript source of the report is located.\");\n assertEquals(\"th www univers resourc loc that point to th item being refer. th oft is us for techn report to point to th ftp sit whes th postscript sourc of th report is loc.\", string0);\n }", "private String getVerticalLevelUnits(String gVCord) {\n\n String tmp = gVCord.toUpperCase();\n if (tmp.compareTo(\"PRES\") == 0) {\n return \"MB\";\n }\n if (tmp.compareTo(\"THTA\") == 0) {\n return \"K \";\n }\n if (tmp.compareTo(\"HGHT\") == 0) {\n return \"M \";\n }\n if (tmp.compareTo(\"SGMA\") == 0) {\n return \"SG\";\n }\n if (tmp.compareTo(\"DPTH\") == 0) {\n return \"M \";\n }\n return \"\";\n }", "public void testSimple() {\n Tensor p = Tensors.vector(0, 0, 0);\n Tensor q = Tensors.vector(0, 2, 0);\n Scalar scalar = ClothoidCurveDisplay.INSTANCE.parametricDistance(p, q);\n Scalar result = Se2ParametricDistance.INSTANCE.distance(p, q);\n Clips.interval(2.56, 2.57).requireInside(scalar);\n assertEquals(result, RealScalar.of(2));\n }", "@Test\n @Tag(\"bm1000\")\n public void testDEGEN2() {\n CuteNetlibCase.doTest(\"DEGEN2.SIF\", \"-1435.1779999999999\", \"-1226.12\", NumberContext.of(7, 4));\n }", "@Test(timeout = 4000)\n public void test75() throws Throwable {\n LovinsStemmer lovinsStemmer0 = new LovinsStemmer();\n String string0 = lovinsStemmer0.globalInfo();\n assertEquals(\"A stemmer based on the Lovins stemmer, described here:\\n\\nJulie Beth Lovins (1968). Development of a stemming algorithm. Mechanical Translation and Computational Linguistics. 11:22-31.\", string0);\n }", "@Test\n @Override\n public void testSearchMCS() {\n System.out.println(\"searchMCS\");\n SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());\n IAtomContainer target = null;\n try {\n target = sp.parseSmiles(\"C\\\\C=C/Nc1cccc(c1)N(O)\\\\C=C\\\\C\\\\C=C\\\\C=C/C\");\n } catch (InvalidSmilesException ex) {\n Logger.getLogger(VFlibMCSHandlerTest.class.getName()).log(Level.SEVERE, null, ex);\n }\n IAtomContainer query = null;\n try {\n query = sp.parseSmiles(\"Nc1ccccc1\");\n } catch (InvalidSmilesException ex) {\n Logger.getLogger(VFlibMCSHandlerTest.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n VF2lib smsd1 = new VF2lib();\n smsd1.set(query, target);\n smsd1.searchMCS(true);\n assertNotNull(smsd1.getFirstMapping());\n }", "@Test\r\n public void testInvalidMinusAssignmentExpressionWithSIUnits1() throws IOException {\n checkError(\"varD_S-=4km\", \"0xA0177\");\r\n }", "@Test\n public void testVirement3() {\n\n //Arrange\n CompteBancaire cpt1 = new CompteBancaire(0.0);\n CompteBancaire cpt2 = new CompteBancaire(43000.0);\n double montant_a_virer = 8000.0;\n double excepted_solde_cpt1 = 0.0;\n double excepted_solde_cpt2 = 43000.0;\n\n //Act\n assertEquals(false, cpt1.virerArgent(cpt2, montant_a_virer));\n\n //Assert\n assertEquals(excepted_solde_cpt1, cpt1.getSolde(), 0);\n assertEquals(excepted_solde_cpt2, cpt2.getSolde(), 0);\n\n }", "@Test\n public void testIsValidRoman() {\n FieldVerifier service = new FieldVerifier();\n boolean result = service.isValidRoman(\"X\");\n assertEquals(true, result);\n }", "@Test\n public void chiSquaredTest2() {\n long[] occs = new long[26];\n occs[0] = 195;\n occs[1] = 51;\n occs[2] = 96;\n occs[3] = 51;\n occs[4] = 305;\n occs[5] = 72;\n occs[6] = 32;\n occs[7] = 130;\n occs[8] = 194;\n occs[9] = 1;\n occs[10] = 4;\n occs[11] = 119;\n occs[12] = 64;\n occs[13] = 183;\n occs[14] = 236;\n occs[15] = 72;\n occs[16] = 8;\n occs[17] = 130;\n occs[18] = 159;\n occs[19] = 269;\n occs[20] = 62;\n occs[21] = 24;\n occs[22] = 40;\n occs[23] = 8;\n occs[24] = 48;\n occs[25] = 3;\n int textLen = 2556;\n\n assertEquals(136.9908235901, this.ic.chiSquared(occs,\n this.freq.getExpectedLetterFrequencies(), textLen), 0.01);\n }", "@Test\n\tpublic final void testGrave() \n\t\t\tthrows ParserConfigurationException, IOException, SAXException \n\t{\n\t\t// a - lower case\n\t\tassertSingleResult(\"3027805\", fldName, \"verità\");\n\t\tassertSingleResult(\"3027805\", fldName, \"verita\");\n\t\t// e - lower case\n\t\tassertSingleResult(\"3027805\", fldName, \"è\");\n\t\tassertSingleResult(\"3027805\", fldName, \"e\");\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tNhanVien nv1 = new NhanVien(\"Đặng\", \"Hoa\", 273);\n\t\tNhanVien nv2 = new NhanVien(\"Đặng\", \"Nam\", 863);\n\t\t\n\t\tSystem.out.println(\"Lương của \"+nv1.getTen()+\"\\t\"+ nv1.getLuong());;\n\t\tSystem.out.println(\"Lương của \"+nv2.getTen()+\"\\t\"+nv2.getLuong());\n\t\t\n\n\t\tif(nv1.lonHon(nv2)) \n\t\t\tSystem.out.println(nv1.getTen()+\" có số lượng sản phẩm lớn hơn \"+nv2.getTen()+\": \"+ (nv1.getSoSP()-nv2.getSoSP())+\" sản phẩm\");\n\t\telse\n\t\t\tSystem.out.println(nv2.getTen()+\" có số lượng sản phẩm lớn hơn \"+nv1.getTen()+\": \"+ (nv2.getSoSP()-nv1.getSoSP())+\" sản phẩm\");\n\t\t\n\t\tif(nv1.getSoSP()> nv2.getSoSP()) \n\t\t\tSystem.out.println(nv1.getTen()+\" có số lượng sản phẩm lớn hơn \"+nv2.getTen()+\": \"+ (nv1.getSoSP()-nv2.getSoSP())+\" sản phẩm\");\n\t\telse\n\t\t\tSystem.out.println(nv2.getTen()+\" có số lượng sản phẩm lớn hơn \"+nv1.getTen()+\": \"+ (nv2.getSoSP()-nv1.getSoSP())+\" sản phẩm\");\n\t}", "@Test\n @Disabled\n public void testValidateMatriculaCoche() {\n assertFalse(RegExprMain.validateMatriculaCoche(\"543 JTD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"5432 JTD\"));\n assertFalse(RegExprMain.validateMatriculaCoche(\"5433 JAD\"));\n assertFalse(RegExprMain.validateMatriculaCoche(\"54333 JTD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"5432 JTD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"6784 CLD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"4563 BVB\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"6789 LMN\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"2435 JKD\"));\n assertTrue(RegExprMain.validateMatriculaCoche(\"4567 GJD\"));\n \n\n }", "@Test\n public void testDigTrans() {\n // Conditions initiales\n screen.init(10, 5); screen.setNature(6, 1, Cell.PLT);\n // Opération\n screen.dig(6, 1);\n // Oracle: vérifié par contrat\n }", "@Test\n @Tag(\"slow\")\n public void testSCSD8() {\n CuteNetlibCase.doTest(\"SCSD8.SIF\", \"905\", null, NumberContext.of(7, 4));\n }", "@Test\n public void testVirement2() {\n\n //Arrange\n CompteBancaire cpt1 = new CompteBancaire(63000.0);\n CompteBancaire cpt2 = new CompteBancaire(43000.0);\n double montant_a_virer = 88000.0;\n double excepted_solde_cpt1 = 63000.0;\n double excepted_solde_cpt2 = 43000.0;\n\n //Act\n assertEquals(false, cpt1.virerArgent(cpt2, montant_a_virer));\n\n //Assert\n assertEquals(excepted_solde_cpt1, cpt1.getSolde(), 0);\n assertEquals(excepted_solde_cpt2, cpt2.getSolde(), 0);\n\n }", "public static void main(String[] args)\r\n\t{\n\t\tSystem.out.println(\"Welcome to Longest Commmon Subsequence Problem\");\r\n\t\tString s1=\"shahid\";\r\n\t\tString s2=\"sidhahid\";\r\n\t\tSystem.out.printf(\"Longest Common Susbequnce between\\n'%s' and '%s' is of %d letters\",s1,s2,getLCS(s1,s2,0,0));\r\n\t}", "@Test\n\tpublic void aKiloOfAGramIsEquivalentToAKilogram() {\n\t\tassertTrue(KILO(GRAM).isEquivalentTo(KILOGRAM));\n\t}" ]
[ "0.6241098", "0.59685695", "0.59477764", "0.5727086", "0.56121284", "0.561119", "0.5581908", "0.5581168", "0.55785465", "0.5541242", "0.5531691", "0.5506055", "0.5463151", "0.545307", "0.54402333", "0.541334", "0.540644", "0.54058665", "0.5397089", "0.5386392", "0.5371759", "0.5360875", "0.53581125", "0.5356436", "0.5346399", "0.53453094", "0.5338744", "0.5335149", "0.5330163", "0.5327908", "0.5324504", "0.53182054", "0.5316362", "0.53061134", "0.5302196", "0.5297413", "0.5293864", "0.529054", "0.52823", "0.5265356", "0.5263038", "0.525891", "0.52580106", "0.52577335", "0.52559143", "0.5253686", "0.52525264", "0.52504647", "0.52416575", "0.5225398", "0.52188665", "0.521371", "0.5213565", "0.5204475", "0.5203161", "0.52016133", "0.52015007", "0.5199369", "0.51993036", "0.51923347", "0.5191745", "0.5191378", "0.51900804", "0.5187398", "0.5185178", "0.518227", "0.5180474", "0.5180203", "0.51795816", "0.5177164", "0.51763386", "0.51709884", "0.51675045", "0.5164879", "0.51638675", "0.51577497", "0.5152968", "0.5150502", "0.51451916", "0.5137492", "0.513612", "0.51280093", "0.51276857", "0.5127275", "0.5122224", "0.5120852", "0.5116077", "0.5113576", "0.511181", "0.5104905", "0.510282", "0.5102667", "0.51014507", "0.51008654", "0.50993466", "0.5099213", "0.50903493", "0.5089562", "0.50875586", "0.5087516", "0.5082829" ]
0.0
-1
Created by hugui.hg on 12/27/15.
public interface SKey { String FAIL_STORE = "job.fail.store"; String LOADBALANCE = "loadbalance"; String EVENT_CENTER = "event.center"; String REMOTING = "lts.remoting"; String REMOTING_SERIALIZABLE_DFT = "lts.remoting.serializable.default"; String ZK_CLIENT_KEY = "zk.client"; String JOB_ID_GENERATOR = "id.generator"; String JOB_LOGGER = "job.logger"; String JOB_QUEUE = "job.queue"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "public final void mo51373a() {\n }", "private stendhal() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "public void mo38117a() {\n }", "@Override\n\tprotected void interr() {\n\t}", "protected boolean func_70814_o() { return true; }", "private void m50366E() {\n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "private void kk12() {\n\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "private void poetries() {\n\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\n\tpublic void anular() {\n\n\t}", "public void method_4270() {}", "@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\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "private void strin() {\n\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public void m23075a() {\n }", "@Override\n public int describeContents() { return 0; }", "private void init() {\n\n\t}", "public void mo12628c() {\n }", "@Override\r\n\tpublic void anularFact() {\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}", "public void mo21877s() {\n }", "public abstract void mo70713b();", "@Override\n public void init() {\n }", "public final void mo91715d() {\n }", "private Rekenhulp()\n\t{\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "public void mo6081a() {\n }", "public void mo12930a() {\n }", "protected void mo6255a() {\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\tprotected void getExras() {\n\n\t}", "@Override\n protected void init() {\n }", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "public void mo21825b() {\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\n\tpublic void einkaufen() {\n\t}", "public void mo21779D() {\n }", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\n public void init() {}", "@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}", "public void mo55254a() {\n }", "@Override\n protected void initialize() {\n\n \n }", "public void mo115190b() {\n }", "public void mo23813b() {\n }", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "@Override\n void init() {\n }", "private void m50367F() {\n }", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "public void mo21878t() {\n }", "@Override\n\tpublic void init() {\n\t}", "@Override\n\tprotected void initialize() {\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 }" ]
[ "0.59490144", "0.5893819", "0.58854383", "0.58829224", "0.58181685", "0.579877", "0.5750512", "0.5740609", "0.5740609", "0.5720885", "0.5701596", "0.5685851", "0.5681141", "0.5677449", "0.56610286", "0.5658044", "0.56579137", "0.56542116", "0.56453836", "0.5605022", "0.5596926", "0.5591566", "0.5589354", "0.55873966", "0.5578431", "0.5565692", "0.5565692", "0.5565692", "0.5565692", "0.5565692", "0.55645204", "0.5559192", "0.55307114", "0.5504212", "0.54959846", "0.54959846", "0.54959846", "0.54959846", "0.54959846", "0.54959846", "0.54959846", "0.5493208", "0.54931587", "0.5491104", "0.54697543", "0.54697543", "0.5469752", "0.54623866", "0.5456044", "0.54544824", "0.54491913", "0.54411656", "0.543953", "0.54320127", "0.54320127", "0.543167", "0.54251635", "0.5415013", "0.5411726", "0.5406852", "0.54042125", "0.5400161", "0.53988755", "0.5398656", "0.5390223", "0.5390223", "0.5390223", "0.5378652", "0.53778744", "0.53768384", "0.53737795", "0.5373701", "0.5373701", "0.5373701", "0.53718513", "0.5369261", "0.5366887", "0.53665465", "0.53652865", "0.5361664", "0.5357937", "0.5357937", "0.5357937", "0.5355367", "0.53548473", "0.53450906", "0.5343759", "0.53436553", "0.53415877", "0.53372115", "0.5336052", "0.53358525", "0.53358525", "0.5332556", "0.53302824", "0.53294986", "0.53287375", "0.53287375", "0.53287375", "0.53287375", "0.53287375" ]
0.0
-1
Only a file name not the URL. Files are to be located in the info folder.
public void showInfo(String fileName) { viewer.setUrl("info/"+fileName); center(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void fileInfo(String info);", "String getFilename();", "String generalFileName(String url);", "String getFile();", "String getFile();", "String getFile();", "java.lang.String getFilename();", "java.lang.String getFilename();", "public String getFilename();", "java.lang.String getFileName();", "java.lang.String getFileName();", "java.lang.String getFileName();", "java.lang.String getFileName();", "java.lang.String getFileName();", "java.lang.String getFileName();", "java.lang.String getFileName();", "java.lang.String getFileName();", "java.lang.String getFileName();", "String getFileName();", "String getFileName();", "String getFileName();", "String getFileName();", "String getFileName();", "public String getFileName ();", "public abstract String getFileLocation();", "public String getFileName();", "public String getFileName();", "public String getFileName() {\n if (url.endsWith(\"/\")) {\n url = url.substring(0, url.length() - 1);\n }\n\n //Replace illegal characters\n String urlFileName = url.replace(\"http://\", \"\");\n urlFileName = urlFileName.replace(\"https://\", \"\");\n urlFileName = urlFileName.replace(\"/\", \"\");\n urlFileName += \".txt\";\n\n return urlFileName;\n }", "@Test\n public void filesByNameInfoGetTest() throws ApiException {\n String name = null;\n FileInfo response = api.filesByNameInfoGet(name);\n\n // TODO: test validations\n }", "protected String getFileName()\n {\n return new StringBuilder()\n .append(getInfoAnno().filePrefix())\n .append(getName())\n .append(getInfoAnno().fileSuffix())\n .toString();\n }", "public String getFileNoPath() {\n if (fileType == HTTP) {\n return fileName.substring(fileName.lastIndexOf(\"/\") + 1);\n } else {\n return fileName.substring(fileName.lastIndexOf(File.separator) + 1);\n }\n }", "java.lang.String getFilePath();", "private void getDetailsOfFiles(){\n\t\tString path = tfile.getAbsolutePath();\n\t\t\n\t\ttype = path.substring(path.lastIndexOf('.')+1);\n\t\t\n\t\tif(path.contains(\"/\")){\n\t\t\tfileName = path.substring(path.lastIndexOf(\"/\")+1);\n\t\t}else if(path.contains(\"\\\\\")){\n\t\t\tfileName = path.substring(path.lastIndexOf(\"\\\\\")+1);\n\t\t}\n\t}", "public abstract String getFileName();", "String getFilePath();", "public final String getFileName() {\n\t\treturn m_info.getFileName();\n\t}", "public String getFileName(){\r\n\t\treturn linfo != null ? linfo.getFileName() : \"\";\r\n\t}", "@Override\n public String getFilename()\n {\n return \"\";\n }", "String getFilepath();", "public String getFILE_NAME() { return FILE_NAME; }", "private String getFileName(String url) {\n // get the begin and end index of name which will be between the\n //last \"/\" and \".\"\n int beginIndex = url.lastIndexOf(\"/\")+1;\n int endIndex = url.lastIndexOf(\".\");\n return url.substring(beginIndex, endIndex);\n \n }", "private static void info ( File f ) {\n\tString nume = f . getName () ;\n\tif( f.isFile () )\n\tSystem.out.println ( \" Fisier : \" + nume ) ;\n\telse\n\tif( f.isDirectory () )\n\tSystem.out.println ( \" Director : \" + nume ) ;\n\tSystem.out.println (\n\t\" Cale absoluta : \" + f.getAbsolutePath () +\n\t\" \\n Poate citi : \" + f.canRead () +\n\t\" \\n Poate scrie : \" + f.canWrite () +\n\t\" \\n Parinte : \" + f.getParent () +\n\t\" \\n Cale : \" + f.getPath () +\n\t\" \\n Lungime : \" + f.length () +\n\t\" \\n Data ultimei modificari : \" +\n\tnew Date ( f.lastModified () ) ) ;\n\tSystem.out.println ( \" --------------\" ) ;\n\t}", "@NotNull\n @ApiModelProperty(example = \"y1234456789b\", required = true, value = \"The info file is an python file containing the package metadata.\")\n public String getInfoFile() {\n return infoFile;\n }", "public String getFilename() {\n\treturn file.getFilename();\n }", "public String getFileNamingDetails();", "java.lang.String getFileLoc();", "private String beautiplyFileNameReferer() {\r\n\r\n\t\tif (checkBeautiplyImagesExixtence()) {\r\n\t\t\ttry {\r\n\t\t\t\tString fname = beautiplyFileNameGenerator();\r\n\t\t\t\tFileInputStream fis = context.openFileInput(fname);\r\n\t\t\t\treturn fname;\r\n\t\t\t} catch (FileNotFoundException e4) {\r\n\t\t\t\treturn beautiplyFileNameReferer();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\r\n\t}", "public void setFilename(String name){\n\t\tfilename = name;\n\t}", "public abstract String toStringForFileName();", "public final String getFilePath() {\n\t\treturn m_info.getPath();\n\t}", "@AutoEscape\n\tpublic String getFileUrl();", "public String getName() { return FilePathUtils.getFileName(getPath()); }", "private void getFileName() {\n\t\tHeader contentHeader = response.getFirstHeader(\"Content-Disposition\");\n\t\tthis.filename = null;\n\t\tif (contentHeader != null) {\n\t\t\tHeaderElement[] values = contentHeader.getElements();\n\t\t\tif (values.length == 1) {\n\t\t\t\tNameValuePair param = values[0].getParameterByName(\"filename\");\n\t\t\t\tif (param != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfilename = param.getValue();\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (this.filename == null) {\n\t\t\tthis.filename = url.substring(url.lastIndexOf(\"/\") + 1);\n\t\t}\n\t}", "public String getFileName()\n {\n return getString(\"FileName\");\n }", "private String fileName(ModuleReference mref) {\n URI uri = mref.location().orElse(null);\n if (uri != null) {\n if (uri.getScheme().equalsIgnoreCase(\"file\")) {\n Path file = Path.of(uri);\n return file.getFileName().toString();\n } else {\n return uri.toString();\n }\n } else {\n return \"<unknown>\";\n }\n }", "private static String getSourceFile() {\n\t\tFileChooser fileChooser = new FileChooser(System.getProperty(\"user.home\"),\n\t\t\t\t\"Chose json file containing satellite data!\", \"json\");\n\t\tFile file = fileChooser.getFile();\n\t\tif (file == null) {\n\t\t\tSystem.exit(-42);\n\t\t}\n\t\treturn file.getAbsolutePath();\n\t}", "String displayableFileName(String path) {\n String result = \"\";\n StringTokenizer tok = new StringTokenizer(path, \"\\\\/\");\n while (tok.hasMoreTokens()) {\n result = tok.nextToken();\n }\n return result;\n }", "private String getFilePath(String sHTTPRequest) {\n return sHTTPRequest.replaceFirst(\"/\", \"\");\n\n }", "public void setFilename( String name) {\n\tfilename = name;\n }", "String get_name() {\n File file = new File(url);\n return file.getName();\n }", "private static File getAssetInfoFile(Asset asset) {\n \t\treturn getAssetInfoFile(asset.getId());\n \t}", "public String getName()\n {\n return( file );\n }", "public String getOriginalFileName();", "public void retrieveFile(String fileName, String ext);", "private String getFilename() {\r\n\t\treturn (String) txtFlnm.getValue();\r\n\t}", "void getFileName(File file) throws IOException {\n this.file=file;\n }", "public String getName() {\n return _file.getAbsolutePath();\n }", "String getNoticeFileUrl();", "private String getFile() {\r\n\t\tJFileChooser fileChooser = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory());\r\n\t\tfileChooser.setDialogTitle(\"Choose a file to open: \");\r\n\t\tfileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);\r\n\t\tint success = fileChooser.showOpenDialog(null);\r\n\t\tif (success == JFileChooser.APPROVE_OPTION) {\r\n\t\t\tFile selectedFile = fileChooser.getSelectedFile();\r\n\t\t\tString fileName = selectedFile.getName();\r\n\t\t\treturn fileName;\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}", "FileObject getFile();", "FileObject getFile();", "public String filename (){\r\n\t\t\treturn _filename;\r\n\t\t}", "@Override\n\tprotected String getFileName() {\n\t\treturn null;\n\t}", "static String getFileNameFromFileUrl( final String url ) {\n\n\t\tString name = url.substring( url.lastIndexOf('/') + 1 );\n\t\tint index = name.lastIndexOf( '?' );\n\t\tif( index > 0 )\n\t\t\tname = name.substring( 0, index );\n\t\telse if( index == 0 )\n\t\t\tname = name.substring( 1 );\n\n\t\treturn name.replaceAll( \"[^\\\\w.-]\", \"_\" );\n\t}", "private String nakedFileName() {\n return f.getName().split(\"\\\\.\")[0];\n }", "public void updateFileName()\n {\n\n String fn= presenter.getCurrentTrack().getFileName();\n if(fn!=null && !fn.isEmpty()) {\n File file = new File(fn);\n fn=file.getName();\n }\n if(fn==null || fn.isEmpty())\n fn=\"*\";\n fileNameTextView.setText(fn);\n }", "private void printDetails(FileDTO file) {\n\t\tif (file == null) {\n\t\t\tsafePrintln(\"The file could not be retrieved or does not exist!\");\n\t\t} else {\n\t\t\tsafePrintln(file.getName() + \"|\" + file.getPermission() + \"|\" + file.getSize().toString() + \" - \"\n\t\t\t\t\t+ file.getOwnerName());\n\t\t}\n\t}", "Path getContent(String filename);", "protected void setInfoFile(String[] info){\n\n }", "public String GetFileName() {\r\n\treturn fileName;\r\n }", "public File getFile();", "public File getFile();", "public void get(String file) {\n\n }", "@Override\n\tpublic String getName()\n\t{\n\t\treturn fileName;\n\t}", "@Override\n protected String getFileName() {\n return path;\n }", "public String formatFilePath(){\n StringBuilder returnResult = new StringBuilder();\n String temp;\n temp = StringUtil.removeHttpPrefix(uri);\n returnResult.append(DEFAULT_DIRECTORY).append(\"\\\\\").append(temp);\n return returnResult.toString();\n }", "public String getPageFileName();", "File getFile();", "File getFile();", "private static void showFiles(File f) {\n\t\n}", "String getFullWorkfileName();", "public String getPlayFile();", "@Override\n\tpublic String getFileName() {\n\t\treturn null;\n\t}", "public static String getFilename(String pathfilename){\r\n\t\tString nameOfTheFile=pathfilename;\r\n\t\tboolean contentDisposition = false;\r\n\t\tString fileName;\r\n\t\tString parts[];\r\n\t\ttry {\r\n\t\t\tURL urlObj = new URL(pathfilename);\r\n\t\t\tURLConnection con = urlObj.openConnection();\r\n\t\t\tif(con.getHeaderField(\"Content-Disposition\")!=null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tparts = con.getHeaderField(\"Content-Disposition\").split(\"filename=\");\r\n\t\t\t\t\tnameOfTheFile = parts[1].replace(\"\\\"\", \"\");\r\n\t\t\t\t\tcontentDisposition=true;\r\n\t\t\t\t} catch (Exception e) {e.printStackTrace();}\r\n\t\t\t}\r\n\t\t\tif (contentDisposition==false){\r\n\t\t\t\t\tString urlPath = urlObj.getPath();\r\n\t\t\t\t\tif (!urlPath.endsWith(\"/\") && !urlPath.isEmpty()) {\r\n\t\t\t\t\t\tfileName = urlPath.substring(urlPath.lastIndexOf('/')+1).split(\":\")[0].trim();\r\n\t\t\t\t\t} else if (urlPath.endsWith(\"/\") && urlPath.length()>21){\r\n\t\t\t\t\t\tfileName = urlPath.substring(urlPath.lastIndexOf('/')-20).split(\"/\")[0].split(\":\")[0].trim();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfileName = \"index\" + urlObj.getHost();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tString ext = con.getContentType();\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\text = ext.substring(ext.lastIndexOf('/')+1).split(\";\")[0];\r\n\t\t\t\t\t} catch (Exception e) {ext = null;}\r\n\t\t\t\t\tif(ext!=null && !ext.equals(\"unknown\")) {\r\n\t\t\t\t\t\tif (!fileName.matches(\"[a-zA-Z0-9]*[.][a-zA-Z]+\")) {\r\n\t\t\t\t\t\t\tnameOfTheFile = fileName+\".\"+ext;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tnameOfTheFile = fileName;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t}catch(Exception e) {e.printStackTrace();}\r\n\t\treturn nameOfTheFile;\r\n\t}", "public String getURLFilePathname() {\n return mPathname;\n }", "public String getFileName() {\n/* 43:43 */ return this.fileName;\n/* 44: */ }", "public String getFile() {\n \n // return it\n return theFile;\n }", "private String getFileName()\r\n {\r\n DateFormat format = new SimpleDateFormat(\"yyyy-MM-dd__HH_mm\");\r\n \r\n String ret = new String();\r\n ret += preferences.getPreference(UserPreferences.SAVE_LOCATION_PROP);\r\n ret += format.format(new Date());\r\n \r\n String notationStr = notation.getText().trim();\r\n if (!notationStr.isEmpty()) \r\n {\r\n ret += \"__\" + notationStr.replaceAll(\" \\t/\\\\:\", \"_\");\r\n }\r\n \r\n ret += \".csv\";\r\n \r\n return ret;\r\n }", "public String getSimpleName() { return FilePathUtils.getFileName(_name); }", "public boolean isFile() { return true; }", "@Override\n protected String getFileName() {\n return null;\n }" ]
[ "0.70880276", "0.6930734", "0.6878176", "0.6836302", "0.6836302", "0.6836302", "0.6796173", "0.6796173", "0.6775811", "0.6732459", "0.6732459", "0.6732459", "0.6732459", "0.6732459", "0.6732459", "0.6732459", "0.6732459", "0.6732459", "0.67318", "0.67318", "0.67318", "0.67318", "0.67318", "0.66689986", "0.66568655", "0.6641627", "0.6641627", "0.6633791", "0.6561899", "0.65531236", "0.64395565", "0.64254165", "0.6422812", "0.6417822", "0.63815385", "0.63117063", "0.6300476", "0.6246294", "0.6235035", "0.6230296", "0.6223804", "0.6205828", "0.62023693", "0.6157602", "0.61383176", "0.6137822", "0.6136189", "0.6126536", "0.6118601", "0.6103469", "0.60927635", "0.60628283", "0.605556", "0.60072666", "0.6005119", "0.5993838", "0.598004", "0.5976676", "0.5958676", "0.5946322", "0.5938681", "0.5936263", "0.5931402", "0.59301776", "0.5929669", "0.5924686", "0.5912531", "0.5911486", "0.59021044", "0.59002274", "0.59002274", "0.5886938", "0.58854234", "0.58780915", "0.5877974", "0.58742785", "0.5873968", "0.5867824", "0.58649117", "0.58621633", "0.5858341", "0.5858341", "0.5853479", "0.5848206", "0.58464915", "0.5831356", "0.582364", "0.5821174", "0.5821174", "0.58185804", "0.5818499", "0.5801262", "0.5795281", "0.57703274", "0.57700044", "0.57697004", "0.5766895", "0.5764161", "0.5759888", "0.57578427", "0.5752286" ]
0.0
-1
Creates new form ClientLoginView
public void ListenThread() { Thread t = new Thread(new IncomingReader(writer, reader)); t.start(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public LoginFormView() {\n initComponents();\n }", "public LoginView() {\n initComponents();\n }", "private Widget createLoginPanel(final IViewContext<ICommonClientServiceAsync> viewContext)\n {\n DockPanel loginPanel = new DockPanel();\n // WORKAROUND The mechanism behind the autofill support does not work in testing\n if (!GWTUtils.isTesting())\n {\n final LoginPanelAutofill loginWidget = LoginPanelAutofill.get(viewContext);\n loginPanel.add(loginWidget, DockPanel.CENTER);\n } else\n {\n final LoginWidget loginWidget = new LoginWidget(viewContext);\n loginPanel.add(loginWidget, DockPanel.CENTER);\n }\n return loginPanel;\n }", "public MainView() {\r\n LoginOverlay login = new LoginOverlay();\r\n login.setOpened(true);\r\n LoginI18n i18n = LoginI18n.createDefault();\r\n i18n.setHeader(new LoginI18n.Header());\r\n i18n.getHeader().setTitle(\"Webvision\");\r\n i18n.getHeader().setDescription(\"Please login, if you don't have an account you will be redirected to finish registration.\");\r\n i18n.getForm().setUsername(\"Email\");\r\n i18n.getForm().setPassword(\"Password\");\r\n login.setI18n(i18n);\r\n login.addLoginListener(event -> {\r\n String email = event.getUsername();\r\n User user = userService.findByEmail(email);\r\n if (user == null) {\r\n login.close();\r\n UI.getCurrent().navigate(RegistrationView.ROUTE);\r\n } else {\r\n String password = event.getPassword();\r\n boolean isAuthenticated = password.equals(user.getPassword());\r\n if (isAuthenticated) {\r\n CurrentUser.setCurrentUser(user);\r\n login.close();\r\n UI.getCurrent().navigate(HomeView.ROUTE);\r\n }\r\n login.setError(true);\r\n }\r\n });\r\n add(login);\r\n }", "public JPanel getNewClientAccountPanel() {\n clientAccountView = new ClientAccountView();\n clientAccountView.setAccNum(smCntr.getID());\n clientAccountView.setFormToAdd();\n return clientAccountView;\n }", "public Login(Client client) {\n this.client = client;\n }", "public ContenedorloginviewmodelFactoryImpl() {\r\n\t\tsuper();\r\n\t}", "public JPanelCreateClient() {\r\n\t\tsuper(new BorderLayout());\r\n\t\tthis.title = new CustomLabel(ConstantView.TITLE_CREATE_CLIENT, null, Color.decode(\"#2E5569\"));\r\n\t\tthis.okButton = new JButton(\"REGISTRAR CLIENTE\");\r\n\t\tthis.returnButton = new JButton(ConstantView.BUTTON_RETURN_SIGNIN);\r\n\t\tthis.jPanelFormClient = new JPanelFormClient();\r\n\t\tControlClient.getInstance().setjPanelCreateClient(this);\r\n\t\tthis.init();\r\n\t}", "private Component createLogin() {\n CustomLayout custom = new CustomLayout(\"../../sampler/layouts/examplecustomlayout\");\n\n // Create components and bind them to the location tags\n // in the custom layout.\n username = new TextField();\n custom.addComponent(username, \"username\");\n\n password = new PasswordField();\n custom.addComponent(password, \"password\");\n\n Button ok = new Button(\"Login\");\n custom.addComponent(ok, \"okbutton\");\n\n // Add login listener\n ok.addListener(this);\n\n return custom;\n\n }", "public LoginView() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public LoginPanel(Controller theController) {\n\t\tsuper();\n\t\tmyController = theController;\n\t\tusername = new JTextField();\n\t\tpassword = new JPasswordField();\n\t\tsubmit = new JButton(\"Login\");\n\t\tcreate();\n\t}", "public LoginView(View view, Activity activity, MoneyModel model) {\n this.view = view;\n this.activity = activity;\n this.model = model;\n\n // Instantiate the view\n loginButton = (Button) activity.findViewById(R.id.loginButton);\n createUserButton = (Button) activity.findViewById(R.id.createUserButton);\n\n usernameField = (EditText) activity.findViewById(R.id.usernameField);\n passwordField = (EditText) activity.findViewById(R.id.passwordField);\n }", "public ClientView() {\n initComponents();\n }", "LoginPresenterImpl(LoginView loginView)\n {\n this.loginView = loginView;\n this.loginInteractor = new LoginInteractorImpl();\n }", "public LoginController(LoginForm form) {this.loginForm = form;}", "public void onLoginClick(View view) {\n dialog = initLoadingDialog();\n etUsername = findViewById(R.id.etUsername);\n etPassword = findViewById(R.id.etPassword);\n viewModel.login(etUsername.getText().toString().toLowerCase());\n }", "public void signInExistingUser(View v) {\n attemptLogin();\n\n }", "private void genLoginGui(){\n loginFrame = new JFrame(\"Log in\");\n\n // login panel, inputs name\n loginPanel = new JPanel();\n loginPanel.setLayout(new FlowLayout());\n nameLabel = new JLabel(\"Name\");\n nameTextFiled = new JTextField();\n nameTextFiled.setPreferredSize(new Dimension(100, 20));\n nameTextFiled.addActionListener(clientAction);\n nameTextFiled.setActionCommand(\"ENTERROOM\");\n\n btnEnterRoom = new JButton(\"Enter Room\");\n btnEnterRoom.addActionListener(clientAction);\n btnEnterRoom.setActionCommand(\"ENTERROOM\");\n\n loginPanel.add(nameLabel);\n loginPanel.add(nameTextFiled);\n loginPanel.add(btnEnterRoom);\n\n loginFrame.add(loginPanel, BorderLayout.CENTER);\n\n loginFrame.setSize(700, 500);\n loginFrame.setLocation(0, 200);\n loginFrame.add(loginPanel);\n loginFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n loginFrame.setVisible(true);\n }", "public void loginRequest(View view){\n\n callLoginServlet();\n }", "public ClientAccountViewController() {\n }", "private MarkupContainer createLoginFragment() {\r\n return new Fragment(CONTENT_VIEW, LOGIN_FRAGMENT, this)\r\n .add(new LoginPanel(PART_LOGIN_VIEW, LoginPanel.NextPage.CART))\r\n .add(new RegisterPanel(PART_REGISTER_VIEW, RegisterPanel.NextPage.CART))\r\n .add(new GuestPanel(PART_GUEST_VIEW));\r\n }", "public LogInController(MenuModel model, LogInView view) {\n\t\tsuper(model, view);\n\n\t\t//Getting Translator\n\t\tServiceLocator sl = ServiceLocator.getServiceLocator();\n\t\tthis.t = sl.getTranslator();\n\t\t\n\t\t//Clears TextField if clicked on textfield, after invalid Username is typed in!\n\t\tview.txtf_username.setOnMouseClicked((event) -> {\n\t\t\tif(view.txtf_username.getText().equals(t.getString(\"login.txtf_username\"))){\n\t\t\t\tview.txtf_username.clear();\n\t\t\t}\n\t\t});\n\t\t\n\t\t//Clears TextField if any key is pressed, after invalid Username is typed in!\n\t\tview.txtf_username.setOnKeyPressed((event) -> {\n\t\t\tif(view.txtf_username.getText().equals(t.getString(\"login.txtf_username\"))){\n\t\t\t\tview.txtf_username.clear();\n\t\t\t}\n\t\t});\n \t\t\n\t\t//Register Button for Event\n\t\tview.btn_login.setOnAction((event)-> {\t\n\t\t\tSound.playButton();\n\t\t\tusername = view.txtf_username.getText();\t\n\t\t\t\n\t\t\t//If checks validation of username\n\t\t\tif(LogInController.testUsername(username)){\n\t\t\t\tmodel.setUsername(username);\n\t\t\t\tmmView = new MainMenuView(new Stage(), model);\n\t\t\t\tmmView.getStage().setHeight(view.getStage().getHeight());\n\t\t\t\tmmView.getStage().setWidth(view.getStage().getWidth());\n\t\t\t\tmmView.getStage().setX(view.getStage().getX());\n\t\t\t\tmmView.getStage().setY(view.getStage().getY());\n\t\t\t\tnew MainMenuController(model, mmView);\n\t\t\t\tmmView.start();\n\t\t\t\tview.stop();\n\t\t\t} else {\n\t\t\t\tview.txtf_username.setText(t.getString(\"login.txtf_username\"));\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t});\n\t\t\n\t\t/**\n\t\t * The user can continue with enter\n\t\t * @author User Peter, https://stackoverflow.com/questions/37648222/how-can-i-detect-the-space-keyevent-anywhere-in-my-javafx-app\n\t\t */\n\t\tview.txtf_username.setOnKeyReleased((e) -> {\n\t\t\tif(e.getCode().toString() == \"ENTER\"){\n\t\t\t\tview.btn_login.fire();\n\t\t\t}\n\t\t});\n\t\t\n\t}", "public loginForm() {\n initComponents();\n \n }", "public login() {\n initComponents();\n \n \n }", "public login() {\n initComponents();\n }", "public SignInController() {\n\t\t\n\t\tread = new ReadTestFile();\n\t\t\n\t\tloginInformation = read.getLoginInformation();\n\t\tfor(LoginInformation item : loginInformation){\n\t\t\tSystem.out.printf(\"%s %s %s %s \\n\", item.getId(), item.getPassword(), item.getName(),item.getpassenger_contact());\n\t\t}\n\t\t/*loginInformation.add(new LoginInformation(\"moment\",\"123456\"));\n\t\tloginInformation.add(new LoginInformation(\"aaaaa\",\"aaaaa\"));\n\t\tloginInformation.add(new LoginInformation(\"mmmmm\",\"123\"));*/\n\t\t\n\t}", "public void login(View view) {\n Intent intent = new Intent(this, LoginActivity.class);\n startActivity(intent);\n }", "public ControladorLogin() { }", "public TestClientLogin() {\n initComponents();\n }", "public Login() \n {\n super();\n create();\n this.setVisible(true);\n initComponents();\n }", "@Override public void onNewViewStateInstance() {\n showLoginForm();\n }", "@Override\n\tpublic void createControl(Composite parent) {\n\t\tComposite container = new Composite(parent, SWT.NULL);\n\n\t\tsetControl(container);\n\n\t\tString username = \"\";\n\t\tString password = \"\";\n\t\ttry {\n\t\t\tString[] array = window.ds.getURI().getUserInfo().split(\":\");\n\t\t\tusername = array[0];\n\t\t\tpassword = array[1];\n\t\t} catch (Exception e) {\n\t\t}\n\n\t\tLabel lblUsername = new Label(container, SWT.NONE);\n\t\tlblUsername.setBounds(10, 52, 75, 13);\n\t\tlblUsername.setText(\"Username\");\n\n\t\tusernameText = new Text(container, SWT.BORDER);\n\t\tusernameText.setText(username);\n\t\tusernameText.addModifyListener(new ModifyListener() {\n\t\t\t@Override\n\t\t\tpublic void modifyText(ModifyEvent arg0) {\n\t\t\t\tgetWizard().getContainer().updateButtons();\n\t\t\t}\n\t\t});\n\n\t\tusernameText.setBounds(10, 71, 187, 19);\n\t\tusernameText.setFocus();\n\n\t\tLabel lblPassword = new Label(container, SWT.NONE);\n\t\tlblPassword.setBounds(10, 96, 75, 13);\n\t\tlblPassword.setText(\"Password\");\n\n\t\tpasswordText = new Text(container, SWT.BORDER | SWT.PASSWORD);\n\t\tpasswordText.setText(password);\n\t\tpasswordText.addModifyListener(new ModifyListener() {\n\t\t\t@Override\n\t\t\tpublic void modifyText(ModifyEvent arg0) {\n\t\t\t\tgetWizard().getContainer().updateButtons();\n\t\t\t}\n\t\t});\n\n\t\tpasswordText.setBounds(10, 115, 187, 19);\n\t\tControl[] list = null;\n\t\t\n\t\tif (window.ds.usesComponent(IUserCreation.class)) {\n\t\t\tbtnCreateAnNew = new Button(container, SWT.NONE);\n\t\t\tbtnCreateAnNew.addSelectionListener(new SelectionAdapter() {\n\t\t\t\t@Override\n\t\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t\tLOG.info(\"Create an account\");\n\t\t\t\t\tSignInWithAuthenticationWizard wizard = (SignInWithAuthenticationWizard) getWizard();\n\t\t\t\t\twizard.getWizardDialog().close();\n\t\t\t\t\twindow.newUserAction.run();\n\t\t\t\t\tLOG.info(\"Create an account 2\");\n\t\t\t\t}\n\t\t\t});\n\t\t\tbtnCreateAnNew.setBounds(10, 10, 152, 25);\n\t\t\tbtnCreateAnNew.setText(\"Create a new account\");\n\t\t\tlist = new Control[] { btnCreateAnNew, usernameText,\n\t\t\t\t\tpasswordText };\n\t\t\tcontainer.setTabList(list);\n\t\t} else {\n\t\t\tlist = new Control[] { usernameText,\n\t\t\t\t\tpasswordText };\n\t\t\tcontainer.setTabList(list);\n\t\t}\n\n\t\t\n\t\t\n\t}", "@FXML\n protected void viewLoginPage() {\n \tLoginVistaNavigator.loadVista(LoginVistaNavigator.LOGIN);\n }", "public LoginPresenter(MainView mainView)\n {\n this.mainView = mainView;\n }", "@AutoGenerated\r\n\tprivate Panel buildPnlLogin() {\n\t\tpnlLogin = new Panel();\r\n\t\tpnlLogin.setImmediate(false);\r\n\t\tpnlLogin.setWidth(\"-1px\");\r\n\t\tpnlLogin.setHeight(\"500px\");\r\n\t\t\r\n\t\t// layoutLogin\r\n\t\tlayoutLogin = buildLayoutLogin();\r\n\t\tpnlLogin.setContent(layoutLogin);\r\n\t\t\r\n\t\treturn pnlLogin;\r\n\t}", "public void loginToRest(View view) {\n\t\tgetClient().connect();\n\t}", "public void loginToRest(View view) {\n\t\tgetClient().connect();\n\t}", "public void createAccount(View view) {\n Intent intent = new Intent(this, UserAccountCreateActivity.class);\n startActivity(intent);\n }", "public NewClientController() {\n this.clientParser = NewClientView.getClientParser();\n }", "public Login(GproToolController controller) {\n this.baseController = controller;\n setLookAndFeel();\n initComponents();\n centerFrame();\n }", "public Login() {\n initComponents();\n \n }", "public void CreateAccount(View view)\n {\n Toast.makeText(getApplicationContext(), \"Redirecting...\", \n Toast.LENGTH_SHORT).show();\n Intent i = new Intent(LoginView.this, Page_CreateAccount.class);\n startActivity(i);\n }", "public ControleurVueLogin() {\n\n\t}", "public login() {\n\n initComponents();\n \n usuarios.add(new usuarios(\"claudio\", \"claudioben10\"));\n usuarios.get(0).setAdminOno(true);\n \n }", "public void login() {\n\n String username = usernameEditText.getText().toString();\n String password = passwordEditText.getText().toString();\n regPresenter.setHost(hostEditText.getText().toString());\n regPresenter.login(username, password);\n }", "public LoginGUI(Display display, AppClient appClient) {\n\t\t// Save the calling AppClient\n\t\tthis.display = display;\n\t\tapp = appClient;\n\n\t\t// Create a new window\n\t\tshell = new Shell(display);\n\t\tshell.setText(\"Login - \" + AppClient.name);\n\n\t\t// Set background image\n\t\tshell.setBackgroundImage(new Image(display, \"assets/loginbg.png\"));\n\t\tshell.setBackgroundMode(SWT.INHERIT_DEFAULT);\n\n\t\t// Create the user interface\n\t\tbuildUserInterface();\n\n\t\t// Connect the event handlers\n\t\tconnectEventHandlers();\n\n\t\t// Set the window size\n\t\tshell.pack();\n\t\tshell.setMinimumSize(shell.getSize());\n\t\t\n\t\t// Display the window\n\t\tpumpLoop();\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n mview = inflater.inflate(R.layout.fragment_logintab, container, false);\n\n txt1 = (EditText) mview.findViewById(R.id.username);\n txt2 = (EditText) mview.findViewById(R.id.password);\n b1 = (Button) mview.findViewById(R.id.login);\n b1.setOnClickListener(new View.OnClickListener(){\n public void onClick(final View v){\n if(attemptlogin()){\n new authentication(v).execute();\n }\n }\n });\n\n return mview;\n }", "@Override\n public void onClick(View v) {\n loginUser(\"444444\");\n }", "public void login(View v) {\n if (validateLogin()) {\n attemptLogin();\n }\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v=inflater.inflate(R.layout.fragment_login, container, false);\n phoneEditText=(TextInputEditText) v.findViewById(R.id.miti_login_input_text);\n Button button = v.findViewById(R.id.button2login);\n// final SessionDatabase db=SessionDatabase.getInstance(v.getContext());\n// db=CookieDatabase.getAppDatabase(v.getContext());\n// db.cookieDao().nukeTable();\n button.setOnClickListener(this);\n return v;\n }", "@Nullable\n @Override\n public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,\n @Nullable Bundle savedInstanceState) {\n ((MainActivity) getActivity()).setActionBarTitle(\"Login to NBW\");\n // Get the view from fragment XML\n mView = inflater.inflate(R.layout.login_fragment, container, false);\n\n // Set button for logging in\n mLogInButton = mView.findViewById(R.id.login_button);\n mEmailText = mView.findViewById(R.id.email);\n mPasswordText = mView.findViewById(R.id.password);\n mSignUp = mView.findViewById(R.id.sign_up);\n mForgotPassword = mView.findViewById(R.id.forgot_password);\n\n // TODO: Set onClickListeners for new account and forgot password\n\n return mView;\n }", "@GetMapping(\"/cliente/new\")\n\tpublic String newCliente(Model model) {\n\t\tmodel.addAttribute(\"cliente\", new Cliente());\n\t\tControllerHelper.setEditMode(model, false);\n\t\t\n\t\t\n\t\treturn \"cadastro-cliente\";\n\t\t\n\t}", "public interface LoginView extends BaseMvpView {\n /**\n * 显示登陆的结果\n * @param result\n */\n void showResult(String result);\n\n /**\n * 获取界面上用户名的值\n * @return\n */\n String getUsername();\n /**\n * 获取界面上密码的值\n */\n String getPassword();\n}", "ClientGUI() {\n\t\t_ls = new logServer(\"ClientGui\");\n\n\t\t_clientFrame = new JFrame();\n\t\t_loginFrame = new LoginF(_ls);\n\n\t\t_clientFrame.setSize(500, 820);\n\t\t_clientFrame.setLayout(null);\n\t\t_clientFrame.add(_loginFrame);\n\t\tinit();\n\n\t\t// startFrame();\n\t\t\n\n\t\t_clientControl = new Client(_ls);\n\t\t_loginFrame.setClientPointer(_clientControl);\n\n\t\t/**\n\t\t * event for login frame to close and open new frame\n\t\t */\n\t\t_loginFrame.setLoginListener(new loginFrameListener() {\n\t\t\t@Override\n\t\t\tpublic void singUpListener(Client clientControl) {\n\t\t\t\t_clientControl = clientControl;\n\t\t\t\tstartFrame();\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t}", "public Login() {\n initComponents();\n \n }", "public viewClients() {\n initComponents();\n }", "public void onClick(View v) {\n\t\t\t\tString usernameField = username.getText().toString();\n\t\t\t\tString passwordField = password.getText().toString();\n\n\t\t\t\t// login with this information\n\t\t\t\tlogin(usernameField, passwordField);\n\t\t\t\t\n\t\t\t}", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public LoginController() {\r\n }", "@Override\n public void onClick(View v) {\n loginUser(\"555555\");\n }", "public ClientView(Client client) {\n initComponents();\n this.setLocationRelativeTo(null);\n this.client = client;\n \n if(client != null){\n lblAction.setText(\"Alterar Cliente\");\n txtCpf.setEditable(false);\n btnAction.setText(\"Alterar\");\n \n try {\n client = new ClientDAO().search(client);\n } catch (SQLException ex) {\n JOptionPane.showMessageDialog(this, \"Erro de SQL: \\n\" + ex.getMessage(), \"Erro\", 0);\n } catch (ClassNotFoundException ex) {\n JOptionPane.showMessageDialog(this, \"Erro de Classe: \\n\" + ex.getMessage(), \"Erro\", 0);\n }\n \n txtCpf.setText(client.getCpf());\n txtName.setText(client.getName());\n cbCateg.setSelectedIndex(client.getCateg());\n }\n }", "private void loginButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_loginButtonMouseClicked\n //Make a default user object and bind the input data\n User loginUser;\n loginUser = new User(emailField.getText(), new String(passwordField.getPassword()));\n //Check hashed credentials against database\n //JEncryption encrypter = new JEncryption();\n //loginUser.setPswd(new String(encrypter.encrypt(loginUser.getPswd())));\n try\n {\n if(loginUser.login())\n {\n //If successful load the view\n //System.out.println(loginUser.toString());\n View v = new View(loginUser.getRole(), loginUser.getUserId());\n v.setVisible(true);\n this.setVisible(false);\n }\n //If not, pop out a login failed message\n else\n {\n JOptionPane.showMessageDialog(null, \"No user with that e-mail/password combination found.\");\n }\n }\n catch(DLException d)\n {\n JOptionPane.showMessageDialog(null, \"Connection Error. Please contact an administrator if the problem persists.\");\n }\n }", "public void makeClient() {\n try {\n clienteFacade.create(cliente);\n FacesContext.getCurrentInstance().addMessage(\"messages\", new FacesMessage(FacesMessage.SEVERITY_INFO, \"Cliente creado exitosamente\", null));\n } catch (Exception e) {\n System.err.println(\"Error en la creacion del usuario: \" + e.getMessage());\n FacesContext.getCurrentInstance().addMessage(\"messages\", new FacesMessage(FacesMessage.SEVERITY_FATAL, e.getMessage(), null));\n }\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_login, container, false);\n Button button = (Button) v.findViewById(R.id.login_submit_button);\n button.setOnClickListener(this);\n\n user_text = (EditText) v.findViewById(R.id.login_username_box);\n pass_text = (EditText) v.findViewById(R.id.login_password_box);\n success = false;\n return v;\n }", "@Override\n public void onClick(View v) {\n username = mUsernameView.getText().toString();\n password = mPasswordView.getText().toString();\n login();\n }", "public T01Login() {\n initComponents();\n btnMenu.setVisible(false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_login, container, false);\n\n textoEmail = (TextView) v.findViewById(R.id.emailText);\n textoPasswd = (TextView) v.findViewById(R.id.passwdText);\n\n botonLogin = (Button) v.findViewById(R.id.loginButton);\n botonLogin.setOnClickListener(new View.OnClickListener() {\n @Override\n @TargetApi(11)\n public void onClick(View v) {\n TareaWSObtener tareaAsincrona = new TareaWSObtener();\n\n tareaAsincrona.execute(textoEmail.getText().toString(),\n textoPasswd.getText().toString());\n }\n });\n return v;\n }", "public void initiate(View view) {\n fname = view.findViewById(R.id.firstname);\n lname = view.findViewById(R.id.lastname);\n username = view.findViewById(R.id.txtusername);\n password = view.findViewById(R.id.pwpassword);\n btnregister = view.findViewById(R.id.btnregister);\n\n btnregister.setOnClickListener(this);\n\n }", "public interface ILoginView {\n void clear();// 清空文本框的方法\n int checkInfo(String username,String pass);// 检查用户输入的合法性\n void showProgress(int visibility);// 是否显示登录进度\n void setEnable(boolean flag);\n}", "@FXML\r\n\tprivate void volverLogin(ActionEvent event) throws IOException {\r\n\r\n\t\tMain_App.showLoginView();\r\n\t}", "public void loginBuilder(){\n loginFrame = new JFrame(\"Coronos Login\");\n loginFrame.setLayout(new GridLayout(3, 1));\n\n jpUserName = new JPanel(new FlowLayout());\n jtfUserNameField = new JTextField(10);\n userNameLabel = new JLabel(\"Username:\");\n userNameLabel.setLabelFor(jtfUserNameField);\n jpUserName.add(userNameLabel);\n jpUserName.add(jtfUserNameField);\n loginFrame.add(jpUserName);\n \n jpPassWord = new JPanel(new FlowLayout());\n passWordField = new JPasswordField(10);\n passWordLabel = new JLabel(\"Password:\");\n passWordField.addActionListener(this);\n passWordField.setActionCommand(\"Login\");\n passWordLabel.setLabelFor(passWordField);\n jpPassWord.add(passWordLabel);\n jpPassWord.add(passWordField);\n loginFrame.add(jpPassWord);\n \n jpOptions = new JPanel(new FlowLayout());\n loginButton = new JButton(\"Login\");\n loginButton.addActionListener(this);\n showPassword = new JButton(\"Reveal Password\");\n showPassword.addActionListener(this);\n jpOptions.add(loginButton);\n jpOptions.add(showPassword);\n loginFrame.add(jpOptions);\n \n loginFrame.setLocationRelativeTo(null);\n loginFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n loginFrame.setVisible(true);\n loginFrame.pack();\n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tlogin();\r\n\t\t\t}", "public RegistraEntradaSaidaView() {\n initComponents();\n }", "public LoginUI() {\n\t\tparentFrame = Main.getMainFrame();\n\t\tparentFrame.setVisible(true);\n\n\t\tsetLayout(new BorderLayout(5, 5));\n\t\tadd(initFields(), BorderLayout.NORTH);\n\t\tadd(initButtons(), BorderLayout.CENTER);\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n initFragment();\n View view = inflater.inflate(R.layout.fragment_login, container, false);\n unbinder = ButterKnife.bind(this, view);\n apiServices = getClient().create(ApiServices.class);\n disappearKeypad(getActivity(), view);\n return view;\n }", "public pageLogin() {\n initComponents();\n labelimage.setBorder(new EmptyBorder(0,0,0,0));\n enterButton.setBorder(null);\n enterButton.setContentAreaFilled(false);\n enterButton.setVisible(true);\n usernameTextField.setText(\"Username\");\n usernameTextField.setForeground(new Color(153,153,153));\n passwordTextField.setText(\"Password\");\n passwordTextField.setForeground(new Color(153,153,153));\n usernameAlert.setText(\" \");\n passwordAlert.setText(\" \");\n \n }", "public LoginPresenter(LoginView loginView, AuthService authService) {\n this.loginView = loginView;\n this.authService = authService;\n }", "@Override\n public void onClick(View v) {\n loginUser(\"888888\");\n }", "public ClientView()\r\n {\r\n frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);\r\n finalPanel.setLayout(new BoxLayout(finalPanel,BoxLayout.PAGE_AXIS));\r\n JPanel aux = new JPanel();\r\n setPanel(aux, nameTextField,nameLabel);\r\n JPanel aux2 = new JPanel();\r\n setPanel(aux2,addressTextField,addressLabel);\r\n JPanel aux3 = new JPanel();\r\n setPanel(aux3,emailTextField,emailLabel);\r\n JPanel aux3_2 = new JPanel();\r\n setPanel(aux3_2,insertNewNameTextField,insertNewNameLabel);\r\n JPanel aux4 = new JPanel();\r\n setPanel(aux4,insertIdTextField,insertIdLabel);\r\n JPanel aux5 = new JPanel();\r\n setPanel(aux5,insertIdTextField,insertIdLabel);\r\n JPanel aux6 = new JPanel();\r\n setPanel(aux6,insertNewAddressTextField,insertAddressLabel);\r\n JPanel aux7 = new JPanel();\r\n setPanel(aux7,insertNewEmailTextField,insertEmailLabel);\r\n JPanel aux8 = new JPanel();\r\n setPanel(aux8,insertIdToBeDeletedTextField,insertIdToBeDeletedLabel);\r\n frame.setSize(1000,700);\r\n setButton(addClientButton);\r\n setButton(editButton);\r\n setButton(deleteButton);\r\n setButton(viewButton);\r\n finalPanel.setBackground(Color.WHITE);\r\n finalPanel.add(addNewClientLabel);\r\n finalPanel.add(aux);\r\n finalPanel.add(aux2);\r\n finalPanel.add(aux3);\r\n finalPanel.add(addClientButton);\r\n finalPanel.add(editClientLabel);\r\n finalPanel.add(aux3_2);\r\n finalPanel.add(aux4);\r\n finalPanel.add(aux5);\r\n finalPanel.add(aux6);\r\n finalPanel.add(aux7);\r\n finalPanel.add(editButton);\r\n finalPanel.add(deleteLabel);\r\n finalPanel.add(aux8);\r\n finalPanel.add(deleteButton);\r\n finalPanel.add(viewAllClientsLabel);\r\n finalPanel.add(Box.createRigidArea(new Dimension(1000,10)));\r\n finalPanel.add(viewButton);\r\n frame.add(finalPanel);\r\n //frame.setVisible(true);\r\n }", "@Override\n public void onClick(View v) {\n loginUser(\"333333\");\n }", "public LoginController() {\r\n\r\n }", "@Override\n public void onClick(View v) {\n loginUser(\"999999\");\n }", "@Override\n public void onClick(View v) {\n loginUser(\"111111\");\n }", "public Login() {\n initComponents();\n KiemTraKN();\n }", "public AddUserView() {\n initComponents();\n }", "public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)\r\n\t{\n\t\tView view = inflater.inflate(R.layout.login_form, container, false);\r\n\t\tinstantiate(view);\r\n\t\treturn view;\r\n\t}" ]
[ "0.68321073", "0.67603785", "0.67497164", "0.6510605", "0.6401065", "0.63862985", "0.6350315", "0.6268261", "0.6198216", "0.6176934", "0.61596465", "0.6148478", "0.6079726", "0.60560167", "0.6055758", "0.6014805", "0.60110444", "0.6005343", "0.6004703", "0.59740216", "0.59549975", "0.59440005", "0.59420574", "0.5938347", "0.5931508", "0.5929364", "0.5920891", "0.59178627", "0.591355", "0.5906768", "0.5882137", "0.58666897", "0.58515346", "0.58484334", "0.58455884", "0.5832906", "0.5832906", "0.5830605", "0.58300525", "0.58192354", "0.5819118", "0.58146054", "0.5814323", "0.58045316", "0.57860714", "0.57800204", "0.5778913", "0.5778013", "0.5777961", "0.57671434", "0.5760832", "0.57603526", "0.575717", "0.57562053", "0.575514", "0.575499", "0.5752801", "0.57369566", "0.57369566", "0.57369566", "0.57369566", "0.57369566", "0.57369566", "0.57369566", "0.57369566", "0.57369566", "0.57369566", "0.57369566", "0.57369566", "0.57369566", "0.57369566", "0.57369566", "0.57369566", "0.5733288", "0.57135165", "0.57129884", "0.571163", "0.5700151", "0.56983244", "0.5697411", "0.5696909", "0.5687785", "0.5686922", "0.5685119", "0.5682415", "0.5678413", "0.5670782", "0.5669752", "0.5667371", "0.56645536", "0.5663924", "0.56634486", "0.565961", "0.5655308", "0.56533164", "0.5653239", "0.56518984", "0.5645436", "0.56443036", "0.5644256", "0.5643117" ]
0.0
-1
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); jPasswordField1 = new javax.swing.JPasswordField(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setResizable(false); jButton1.setText("Sign In"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setText("Sign Up"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jLabel1.setText("User Name"); jLabel2.setText("Pass word"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(55, 55, 55) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(layout.createSequentialGroup() .addComponent(jLabel1) .addGap(18, 18, 18) .addComponent(jTextField1)) .addGroup(layout.createSequentialGroup() .addComponent(jButton1) .addGap(91, 91, 91) .addComponent(jButton2)) .addGroup(layout.createSequentialGroup() .addComponent(jLabel2) .addGap(21, 21, 21) .addComponent(jPasswordField1))) .addContainerGap(88, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(31, 31, 31) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(19, 19, 19) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton1) .addComponent(jButton2)) .addContainerGap(47, Short.MAX_VALUE)) ); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n initComponents();\n }", "public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }", "public FormListRemarking() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n \n }", "public FormPemilihan() {\n initComponents();\n }", "public GUIForm() { \n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "public TorneoForm() {\n initComponents();\n }", "public FormCompra() {\n initComponents();\n }", "public muveletek() {\n initComponents();\n }", "public Interfax_D() {\n initComponents();\n }", "public quanlixe_form() {\n initComponents();\n }", "public SettingsForm() {\n initComponents();\n }", "public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public Soru1() {\n initComponents();\n }", "public FMainForm() {\n initComponents();\n this.setResizable(false);\n setLocationRelativeTo(null);\n }", "public soal2GUI() {\n initComponents();\n }", "public EindopdrachtGUI() {\n initComponents();\n }", "public MechanicForm() {\n initComponents();\n }", "public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }", "public quotaGUI() {\n initComponents();\n }", "public BloodDonationGUI() {\n initComponents();\n }", "public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }", "public PatientUI() {\n initComponents();\n }", "public Oddeven() {\n initComponents();\n }", "public myForm() {\n\t\t\tinitComponents();\n\t\t}", "public intrebarea() {\n initComponents();\n }", "public Magasin() {\n initComponents();\n }", "public RadioUI()\n {\n initComponents();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public ZobrazUdalost() {\n initComponents();\n }", "public FormUtama() {\n initComponents();\n }", "public p0() {\n initComponents();\n }", "public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }", "public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }", "public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }", "public form2() {\n initComponents();\n }", "public MainForm() {\n\t\tsuper(\"Hospital\", List.IMPLICIT);\n\n\t\tstartComponents();\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }", "public kunde() {\n initComponents();\n }", "public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public MusteriEkle() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public DESHBORDPANAL() {\n initComponents();\n }", "public frmVenda() {\n initComponents();\n }", "public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }", "public Botonera() {\n initComponents();\n }", "public FrmMenu() {\n initComponents();\n }", "public OffertoryGUI() {\n initComponents();\n setTypes();\n }", "public JFFornecedores() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "public vpemesanan1() {\n initComponents();\n }", "public FormHorarioSSE() {\n initComponents();\n }", "public Kost() {\n initComponents();\n }", "public frmacceso() {\n initComponents();\n }", "public UploadForm() {\n initComponents();\n }", "public HW3() {\n initComponents();\n }", "public Managing_Staff_Main_Form() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "public sinavlar2() {\n initComponents();\n }", "public P0405() {\n initComponents();\n }", "public MiFrame2() {\n initComponents();\n }", "public IssueBookForm() {\n initComponents();\n }", "public Choose1() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n\n String oldAuthor = prefs.get(\"AUTHOR\", \"\");\n if(oldAuthor != null) {\n this.authorTextField.setText(oldAuthor);\n }\n String oldBook = prefs.get(\"BOOK\", \"\");\n if(oldBook != null) {\n this.bookTextField.setText(oldBook);\n }\n String oldDisc = prefs.get(\"DISC\", \"\");\n if(oldDisc != null) {\n try {\n int oldDiscNum = Integer.parseInt(oldDisc);\n oldDiscNum++;\n this.discNumberTextField.setText(Integer.toString(oldDiscNum));\n } catch (Exception ex) {\n this.discNumberTextField.setText(oldDisc);\n }\n this.bookTextField.setText(oldBook);\n }\n\n\n }", "public GUI_StudentInfo() {\n initComponents();\n }", "public Lihat_Dokter_Keseluruhan() {\n initComponents();\n }", "public JFrmPrincipal() {\n initComponents();\n }", "public bt526() {\n initComponents();\n }", "public Pemilihan_Dokter() {\n initComponents();\n }", "public Ablak() {\n initComponents();\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\" desc=\"Generated\n\t// Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tlabel1 = new java.awt.Label();\n\t\tlabel2 = new java.awt.Label();\n\t\tlabel3 = new java.awt.Label();\n\t\tlabel4 = new java.awt.Label();\n\t\tlabel5 = new java.awt.Label();\n\t\tlabel6 = new java.awt.Label();\n\t\tlabel7 = new java.awt.Label();\n\t\tlabel8 = new java.awt.Label();\n\t\tlabel9 = new java.awt.Label();\n\t\tlabel10 = new java.awt.Label();\n\t\ttextField1 = new java.awt.TextField();\n\t\ttextField2 = new java.awt.TextField();\n\t\tlabel14 = new java.awt.Label();\n\t\tlabel15 = new java.awt.Label();\n\t\tlabel16 = new java.awt.Label();\n\t\ttextField3 = new java.awt.TextField();\n\t\ttextField4 = new java.awt.TextField();\n\t\ttextField5 = new java.awt.TextField();\n\t\tlabel17 = new java.awt.Label();\n\t\tlabel18 = new java.awt.Label();\n\t\tlabel19 = new java.awt.Label();\n\t\tlabel20 = new java.awt.Label();\n\t\tlabel21 = new java.awt.Label();\n\t\tlabel22 = new java.awt.Label();\n\t\ttextField6 = new java.awt.TextField();\n\t\ttextField7 = new java.awt.TextField();\n\t\ttextField8 = new java.awt.TextField();\n\t\tlabel23 = new java.awt.Label();\n\t\ttextField9 = new java.awt.TextField();\n\t\ttextField10 = new java.awt.TextField();\n\t\ttextField11 = new java.awt.TextField();\n\t\ttextField12 = new java.awt.TextField();\n\t\tlabel24 = new java.awt.Label();\n\t\tlabel25 = new java.awt.Label();\n\t\tlabel26 = new java.awt.Label();\n\t\tlabel27 = new java.awt.Label();\n\t\tlabel28 = new java.awt.Label();\n\t\tlabel30 = new java.awt.Label();\n\t\tlabel31 = new java.awt.Label();\n\t\tlabel32 = new java.awt.Label();\n\t\tjButton1 = new javax.swing.JButton();\n\n\t\tlabel1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel1.setText(\"It seems that some of the buttons on the ATM machine are not working!\");\n\n\t\tlabel2.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel2.setText(\"Unfortunately these numbers are exactly what Professor has to use to type in his password.\");\n\n\t\tlabel3.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel3.setText(\n\t\t\t\t\"If you want to eat tonight, you have to help him out and construct the numbers of the password with the working buttons and math operators.\");\n\n\t\tlabel4.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tlabel4.setText(\"Denver's Password: 2792\");\n\n\t\tlabel5.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel5.setText(\"import java.util.Scanner;\\n\");\n\n\t\tlabel6.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel6.setText(\"public class ATM{\");\n\n\t\tlabel7.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel7.setText(\"public static void main(String[] args){\");\n\n\t\tlabel8.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel8.setText(\"System.out.print(\");\n\n\t\tlabel9.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel9.setText(\" -\");\n\n\t\tlabel10.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel10.setText(\");\");\n\n\t\ttextField1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttextField1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tlabel14.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel14.setText(\"System.out.print( (\");\n\n\t\tlabel15.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel15.setText(\"System.out.print(\");\n\n\t\tlabel16.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel16.setText(\"System.out.print( ( (\");\n\n\t\tlabel17.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel17.setText(\")\");\n\n\t\tlabel18.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel18.setText(\" +\");\n\n\t\tlabel19.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel19.setText(\");\");\n\n\t\tlabel20.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel20.setText(\" /\");\n\n\t\tlabel21.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel21.setText(\" %\");\n\n\t\tlabel22.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel22.setText(\" +\");\n\n\t\tlabel23.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel23.setText(\");\");\n\n\t\tlabel24.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel24.setText(\" +\");\n\n\t\tlabel25.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel25.setText(\" /\");\n\n\t\tlabel26.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel26.setText(\" *\");\n\n\t\tlabel27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tlabel27.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel27.setText(\")\");\n\n\t\tlabel28.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel28.setText(\")\");\n\n\t\tlabel30.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel30.setText(\"}\");\n\n\t\tlabel31.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel31.setText(\"}\");\n\n\t\tlabel32.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel32.setText(\");\");\n\n\t\tjButton1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tjButton1.setText(\"Check\");\n\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tjButton1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(28).addGroup(layout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING).addComponent(getDoneButton()).addComponent(jButton1)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, 774, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addGap(92).addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15, GroupLayout.PREFERRED_SIZE, 145,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(37))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(174)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(7)))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label23, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20).addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(23).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16, GroupLayout.PREFERRED_SIZE, 177,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup().addGroup(layout.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(19)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(78)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(76)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(75)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(27))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel23,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(29)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))))\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGap(30)\n\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(25)\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(26).addComponent(jButton1).addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(getDoneButton()).addContainerGap(23, Short.MAX_VALUE)));\n\t\tthis.setLayout(layout);\n\n\t\tlabel16.getAccessibleContext().setAccessibleName(\"System.out.print( ( (\");\n\t\tlabel17.getAccessibleContext().setAccessibleName(\"\");\n\t\tlabel18.getAccessibleContext().setAccessibleName(\" +\");\n\t}", "public Pregunta23() {\n initComponents();\n }", "public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }", "public AvtekOkno() {\n initComponents();\n }", "public busdet() {\n initComponents();\n }", "public Ventaform() {\n initComponents();\n }", "public ViewPrescriptionForm() {\n initComponents();\n }", "public Kuis2() {\n initComponents();\n }", "public CreateAccount_GUI() {\n initComponents();\n }", "public Carrera() {\n initComponents();\n }", "public POS1() {\n initComponents();\n }", "public EqGUI() {\n initComponents();\n }", "public JFriau() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setTitle(\"BuNus - Budaya Nusantara\");\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setBackground(new java.awt.Color(204, 204, 204));\n setMinimumSize(new java.awt.Dimension(1, 1));\n setPreferredSize(new java.awt.Dimension(760, 402));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 750, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n }", "public nokno() {\n initComponents();\n }", "public dokter() {\n initComponents();\n }", "public ConverterGUI() {\n initComponents();\n }", "public hitungan() {\n initComponents();\n }", "public Modify() {\n initComponents();\n }", "public frmAddIncidencias() {\n initComponents();\n }", "public FP_Calculator_GUI() {\n initComponents();\n \n setVisible(true);\n }" ]
[ "0.7318655", "0.7289971", "0.7289971", "0.7289971", "0.72860885", "0.7247684", "0.7213551", "0.72080934", "0.7195069", "0.7189731", "0.7183451", "0.71579945", "0.7147311", "0.7092687", "0.70798934", "0.7055229", "0.69868284", "0.6976656", "0.6954658", "0.6952896", "0.69449455", "0.6941766", "0.6935132", "0.6930653", "0.6926533", "0.6924141", "0.6924061", "0.691111", "0.69099087", "0.6892076", "0.68916506", "0.68900466", "0.6889725", "0.68877757", "0.68822116", "0.6881593", "0.688101", "0.68768275", "0.687494", "0.68733007", "0.6870892", "0.6859287", "0.6855569", "0.68548936", "0.6854684", "0.6854257", "0.68525183", "0.6851817", "0.6851817", "0.6842853", "0.68366945", "0.68358713", "0.68282205", "0.6827655", "0.68258286", "0.68239987", "0.68230146", "0.6816489", "0.68163615", "0.68090576", "0.6808936", "0.68077636", "0.6806842", "0.6806332", "0.68016505", "0.67948395", "0.67940617", "0.67914915", "0.6789197", "0.6788211", "0.6787595", "0.67870516", "0.678107", "0.6765869", "0.67651415", "0.6764227", "0.675663", "0.67545617", "0.67512757", "0.6750906", "0.6742937", "0.6738739", "0.67365867", "0.67357975", "0.673252", "0.6726489", "0.67264307", "0.67190623", "0.6715255", "0.6713752", "0.67136234", "0.6707712", "0.67064816", "0.6703903", "0.6700871", "0.6698895", "0.6698197", "0.66973954", "0.66938066", "0.66912496", "0.66892624" ]
0.0
-1
user has been registered
public void UserHasBeenRegistered() { JOptionPane.showMessageDialog(new JFrame(), "User has been registered","", JOptionPane.INFORMATION_MESSAGE); NameTF.setText(""); SurnameTF.setText(""); UsernameTF.setText(""); PasswordTF.setText(""); EmailTF.setText(""); AddressTF.setText(""); CardNTF.setValue(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean hasRegisteredUser() {\n return registeredUser_ != null;\n }", "private void registerUser()\n {\n /*AuthService.createAccount takes a Consumer<Boolean> where the result will be true if the user successfully logged in, or false otherwise*/\n authService.createAccount(entryService.extractText(namedFields), result -> {\n if (result.isEmpty()) {\n startActivity(new Intent(this, DashboardActivity.class));\n } else {\n makeToast(result);\n formContainer.setAlpha(1f);\n progressContainer.setVisibility(View.GONE);\n progressContainer.setOnClickListener(null);\n }\n });\n }", "public boolean isRegistered()\n {\n return getRegistrationState().equals(RegistrationState.REGISTERED);\n }", "@Override\n public void onRegistrationSuccess() {\n listener.onUsernameAvailabilityChecked(false);\n }", "public boolean hasRegisteredUser() {\n return registeredUserBuilder_ != null || registeredUser_ != null;\n }", "boolean hasUser();", "boolean hasUser();", "boolean hasUser();", "boolean hasUser();", "boolean hasUser();", "boolean hasUser();", "boolean hasUser();", "private boolean IsUserExist(){\n SignupUser user =roomDB.dao().GetUserData(et_user.getText().toString());\n if(user!=null){\n if(!user.getEmail().isEmpty()){\n Toast.makeText(this, \"User is already registered!\", Toast.LENGTH_SHORT).show();\n return true;\n }\n\n }\n return false;\n }", "boolean hasRegistrationResponse();", "Boolean registerNewUser(User user);", "boolean hasRegistrationRequest();", "boolean isUserExists(RegisterData data) throws DuplicateUserException;", "@Override\n\tpublic boolean register(User user) {\n\t\tboolean flag = false;\n\t\tList<User> list = this.userDao.findAll(\"and userName = ?\", user.getUserName());\n\t\t//System.out.println(list.size());\n\t\tif(list.size() <= 0){\n\t\t\tthis.userDao.register(user);\n\t\t\tflag = true;\n\t\t}\n\t\treturn flag;\n\t}", "private void register_user() {\n\n\t\tHttpRegister post = new HttpRegister();\n\t\tpost.execute(Config.URL + \"/api/newuser\");\n\n\t}", "public boolean registeredUser(String email, String password)\n {\n for (User user : users) {\n if(user.email.equals(email) && user.password.equals(password)) {\n Log.v(\"DonationApp\", \"Logging in as: \" + user.firstName + \" \" + user.lastName);\n return true;\n }\n }\n return false;\n }", "private final static void onRegister(TextField username, TextField email, PasswordField password, PasswordField passwordAgain)\n\t{\n\t\t// TODO no password = passwordAgain check\n\t\t// TODO check if username exists\n\t\t// TODO check if email exists\n\n\t\tint id = ProfileManipulation.getHighestId(\"Profile\", true);\n\t\tProfileManipulation.registerUser(id, username.getText(), email.getText(),\n\t\t\t\tpassword.getText());\n\t\tPartylize.setUsername(username.getText());\n\t\tPartylize.showMainScene();\n\t}", "@Test(priority = 1, alwaysRun = true)\n\n\tpublic void usercanregistersuccessfully() {\n\t\thomeobject = new HomePage(driver);\n\t\thomeobject.openregisterpage();\n\t\t// take object mn el method elmowgoda fy home page\n\t\tregistrationobject = new UserRegisteration(driver);\n\t\tregistrationobject.userregisteration( firstname, lastname, email, password);\n\n\t\t// validate the scenario\n\t\tAssert.assertTrue(registrationobject.successmessage.getText().contains(\"Your registration completed\"));\n\t}", "private void checkUserExists() {\n dblogin.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n showData1(dataSnapshot);\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n\n }", "boolean isRegistrateChangeListener();", "private void register(UserAuthenticationMessage uaMessage) {\n\t\tinitialize();\n\t\tUser newUser = uaMessage.getUser();\n\t\tHashMap<String, Boolean> dbInfo = DatabaseRequests.registerNewUser(newUser);\n\t\tcreateRegistrationAnswer(dbInfo.get(MIDs.EMAIL_EXISTS), dbInfo.get(MIDs.USER_EXISTS), dbInfo.get(MIDs.AUTHENTICATE));\n\t}", "private void isUserExist() {\n\n if (firebaseAuth.getCurrentUser() != null) {\n\n final String user_id = firebaseAuth.getCurrentUser().getUid();\n users_database_reference.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n\n if (dataSnapshot.hasChild(user_id)) {\n // sign in the user and go to main activity\n // Intent intent = new Intent(StartActivity.this, MainActivity.class);\n // intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // startActivity(intent);\n } else {\n // go to profile page\n Intent intent = new Intent(MainActivity.this, Profile.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(intent);\n\n }\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n\n }\n }", "public void onSignUpClick() {\n\t\tString uid = regview.getUsername();\n\t\tString pw = regview.getPassword();\n\t\tString na = regview.getName();\n\t\tString em = regview.getEmail();\n\t\tString text = \"\";\n\t\tif(uid.equals(\"\") || pw.equals(\"\") || na.equals(\"\")|| em.equals(\"\")){\n\t\t\ttext = \"Please fill out all fields!\";\n\t\t} else if(regview.findUser(uid)!=User.NULL_USER){\n\t\t\ttext = \"The username already exsit, please try another one!\";\n\t\t} else {\n\t\t\tregview.addUser(new User(uid,pw,na,em));\n\t\t\tregview.goLoginPage();\n\t\t}\n\t\tregview.setRegisterText(text);\n\t}", "public boolean hasUser() {\n return instance.hasUser();\n }", "boolean hasSelectedUser();", "@Override\n\tpublic boolean registerUtente(Utente user) {\n\t\tif(!userExists(user)) {\n\t\t\tDB db = getDB();\n\t\t\tMap<Long, UtenteBase> users = db.getTreeMap(\"users\");\n\t\t\tlong hash = (long) user.getUsername().hashCode();\n\t\t\tusers.put(hash, user);\n\t\t\tdb.commit();\n\t\t\treturn true;\n\t\t} else\n\t\t\treturn false;\t\n\t}", "public String registration() {\n if (name != null) {\n int createdUsers = DBUtils.addUser(name, password, email);\n if (createdUsers > 0) {\n try {\n HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();\n request.login(name, password);\n initUser();\n request.getSession().setAttribute(\"current_user\", this);\n } catch (ServletException e) {\n FacesContext context = FacesContext.getCurrentInstance();\n FacesMessage message = new FacesMessage(\"Wrong login or password\");\n message.setSeverity(FacesMessage.SEVERITY_ERROR);\n context.addMessage(\"login\", message);\n }\n return \"/index?faces-redirect=true\";\n }\n }\n return \"/pages/register.xhtml?faces-redirect=true\";\n }", "private void registrationProcessFireStore() {\n\n Log.i(\"checkk UserReg: \", \"registrationprocess\");\n presenter.checkUserDoc(userName,userPhone,adminName,adminPhone);\n Log.i(\"checkk UserReg: \", \"registrationprocess AFTER\");\n\n\n\n }", "private void registerUser() {\n\n // Get register name\n EditText mRegisterNameField = (EditText) findViewById(R.id.register_name_field);\n String nickname = mRegisterNameField.getText().toString();\n\n // Get register email\n EditText mRegisterEmailField = (EditText) findViewById(R.id.register_email_field);\n String email = mRegisterEmailField.getText().toString();\n\n // Get register password\n EditText mRegisterPasswordField = (EditText) findViewById(R.id.register_password_field);\n String password = mRegisterPasswordField.getText().toString();\n\n AccountCredentials credentials = new AccountCredentials(email, password);\n credentials.setNickname(nickname);\n\n if (DataHolder.getInstance().isAnonymous()) {\n credentials.setOldUsername(DataHolder.getInstance().getUser().getUsername());\n }\n\n sendRegistrationRequest(credentials);\n }", "void register() {\n if (registerView.getFirstName().length() == 0 || registerView.getLastName().length() == 0 || registerView.getUsername().length() == 0 || registerView.getPassword().length() == 0) {\n IDialog invalidRegistrationDialog\n = dialogFactory.createDialog(DialogFactoryOptions.dialogNames.MESSAGE, new HashMap<String, Object>() {\n {\n put(\"message\", \"Unable to register: Fields must be non-empty!\");\n put(\"title\", \"Authentication Error\");\n put(\"messageType\", DialogFactoryOptions.dialogType.ERROR);\n }\n });\n\n invalidRegistrationDialog.run();\n } else {\n if (userController.registerUser(registerView.getFirstName(), registerView.getLastName(), registerView.getUsername(), registerView.getPassword()) != null) {\n mainFrame.setPanel(panelFactory.createPanel(PanelFactoryOptions.panelNames.MAIN_MENU));\n } else {\n IDialog invalidRegistrationDialog = dialogFactory.createDialog(DialogFactoryOptions.dialogNames.MESSAGE, new HashMap<String, Object>() {\n {\n put(\"message\", \"Unable to register: Username is already taken\");\n put(\"title\", \"Authentication Error\");\n put(\"messageType\", DialogFactoryOptions.dialogType.ERROR);\n }\n });\n\n invalidRegistrationDialog.run();\n }\n }\n }", "private boolean isUserExists() {\n\t\treturn KliqDataStore.isUserExists(this.mobileNumber, null);\r\n\t}", "@PostMapping(path = \"register_user\")\n public String registerUser(User newUser){\n for(User user:users) {\n if (user.getEmailId().equals(newUser.getEmailId())) {\n return \"user_exists\";\n }\n }\n users.add(newUser);\n return \"register_success\";\n }", "void onUserAdded();", "private void registration() {\n\t\tif (ur_name.getText().length() > 0 && email.getText().length() > 0\r\n\t\t\t\t&& pass.getText().length() > 0\r\n\t\t\t\t&& re_pass.getText().length() > 0) {\r\n\t\t\tif (pass.getText().toString()\r\n\t\t\t\t\t.equalsIgnoreCase(re_pass.getText().toString())) {\r\n\t\t\t\tString postEntity = \"user_name=\" + ur_name.getText().toString()\r\n\t\t\t\t\t\t+ \"&email=\" + email.getText().toString() + \"&password=\"\r\n\t\t\t\t\t\t+ pass.getText().toString() + \"&gcm_id=\"\r\n\t\t\t\t\t\t+ GlobalDeclares.getGcmId();\r\n\t\t\t\tnew ServerUtilities(getApplicationContext(),\r\n\t\t\t\t\t\tGlobalDeclares.NEW_REGISTRATION, postEntity, delegate);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tToast.makeText(getApplicationContext(),\r\n\t\t\t\t\t\t\"Password does not match!\", Toast.LENGTH_LONG).show();\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tToast.makeText(getApplicationContext(),\r\n\t\t\t\t\t\"You need to fill all the fields!\", Toast.LENGTH_LONG)\r\n\t\t\t\t\t.show();\r\n\t\t}\r\n\r\n\t}", "boolean signUp(User user);", "private void checkUserExist() {\n\n final DatabaseReference mUseRef;\n\n\n if (mAuth.getCurrentUser() != null) {\n final String valid_user_id = mAuth.getCurrentUser().getUid();\n mDatabase.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if (dataSnapshot.hasChild(valid_user_id)) {\n Intent singinIntent = new Intent(JoinActivity.this, MainActivity.class);\n singinIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(singinIntent);\n finish();\n } else {\n Toast.makeText(JoinActivity.this, \"You have to first setup your account!\", Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n\n }\n }", "public void registerSuccessful() {\n\t\tnavigateTo(new LoginFragment(), true, null);\n\t}", "public boolean registerNewUser(String un, String pw, String fn, String ln, String sq, String sa, int age) {\n\n boolean success;\n\n if (isUsernameExist(un)) {\n success = false;\n }\n else {\n // encrypting input password\n SHAEncryption sha = new SHAEncryption();\n String shaPW = sha.getSHA(pw);\n\n // accessing registeredUser table (collection)\n MongoCollection<Document> collRU = db.getCollection(\"registeredUser\");\n\n // creating new user document based on the input from UI\n Document newUser = new Document(\"username\", un)\n .append(\"password\", shaPW)\n .append(\"firstName\", fn)\n .append(\"lastName\", ln)\n .append(\"age\", age)\n .append(\"secureQ\", sq)\n .append(\"secureA\", sa.toLowerCase())\n .append(\"status\", \"\")\n .append(\"hidefriends\",false)\n .append(\"hideposts\",false)\n .append(\"hideage\",false)\n .append(\"hidestatus\",false);\n\n // insert newUser into registeredUser collection\n collRU.insertOne(newUser);\n System.out.println(\"Username \" + un + \" is registered!\");\n success = true;\n \n // create followList for new user\n db.getCollection(\"followList\").insertOne(\n new Document(\"username\", un).append(\"following\", new ArrayList<String>()));\n }\n\n return success;\n }", "public void register() {\n int index = requestFromList(getUserTypes(), true);\n if (index == -1) {\n guestPresenter.returnToMainMenu();\n return;\n }\n UserManager.UserType type;\n if (index == 0) {\n type = UserManager.UserType.ATTENDEE;\n } else if (index == 1) {\n type = UserManager.UserType.ORGANIZER;\n } else {\n type = UserManager.UserType.SPEAKER;\n }\n String name = requestString(\"name\");\n char[] password = requestString(\"password\").toCharArray();\n boolean vip = false;\n if(type == UserManager.UserType.ATTENDEE) {\n vip = requestBoolean(\"vip\");\n }\n List<Object> list = guestManager.register(type, name, password, vip);\n int id = (int)list.get(0);\n updater.addCredentials((byte[])list.get(1), (byte[])list.get(2));\n updater.addUser(id, type, name, vip);\n guestPresenter.printSuccessRegistration(id);\n }", "public String register() {\r\n\t\tif (password.equals(passwordConfirm)) {\r\n\t\t\tUser newUser = new User(username, password);\r\n\t\t\t\r\n\t\t\tif (dataManager.addUser(newUser)) {\r\n\t\t\t\tFacesMessage message = new FacesMessage(\"User has been registered successfully.\");\r\n\t\t\t\tFacesContext.getCurrentInstance().addMessage(null, message);\r\n\t\t\t\tlogger.info(\"New user has been registered.\");\r\n\t\t\t\treturn \"login.xhtml\";\r\n\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t\tFacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, \"\", \"A user with the same username already exists.\");\r\n\t\t\tFacesContext.getCurrentInstance().addMessage(\"registration_form:username\", message);\t\t\t\r\n\t\t}\r\n\t\telse {\r\n\t\t\tFacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, \"\", \"Password confirmation is incorrect.\");\r\n\t\t\tFacesContext.getCurrentInstance().addMessage(\"registration_form:password_confirm\", message);\t\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "@Override\n\tpublic boolean registeringUser(UserDetails userDetails) {\n\t\tfor (UserDetails ud : Repository.USER_DETAILS) {\n\t\t\tif ((ud.getEmailId()).equalsIgnoreCase(userDetails.getEmailId())) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tRepository.USER_DETAILS.add(userDetails);\n\t\treturn true;\n\t}", "public void processRegistration() {\n try {\n System.out.println(\"Processing Registration\");\n FacesContext c = FacesContext.getCurrentInstance();\n c.getApplication().getNavigationHandler().handleNavigation(c, null, \"register.xhtml\");\n } catch (Exception ex) {\n System.out.println(ex.getMessage());\n }\n }", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "boolean hasUserID();", "void onSignUpEmailRegistered();", "public boolean isUserExisted(String _fbEmail);", "public void register(User user) {\n\t\tboolean exists = false ;\n\t\tfor ( User currentUser : users )\n\t\t\tif ( currentUser.getId().equals(user.getId()) )\n\t\t\t\texists = true ;\n\t\tif ( !exists ) {\n\t\t\taddUser(user) ;\n\t\t\tSystem.out.println(\"[USER CREATED]\") ;\n\t\t\tSystem.out.println() ;\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"[INVALID ACTION] User Already Exists\") ;\n\t\t\tSystem.out.println() ;\n\t\t}\n\t}", "@Override\r\n\tpublic boolean registUser(User user) {\n\t\t\r\n\t\tif(userDao.queryUserByPhone(user.getPhone())==null) {\r\n\t\t\t//说明没找到相同的账号,此账号可以注册\r\n\t\t\tuserDao.addUser(user);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "boolean hasSignupRequest();", "@Override\n\tpublic boolean user_register_samenametest(Map<String, Object> reqs) {\n\t\tString sql=\"select userName from tp_users where userName=:userName\";\n\t\tif(joaSimpleDao.count(sql, reqs)==1 )\n\t\t{\t\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\t\n\t}", "void signInComplete();", "public Boolean getRegistered() {\n return registered;\n }", "@SuppressWarnings(\"unchecked\")\npublic boolean register() throws Exception {\n\tArrayList<Member> members;\n\tmembers = (ArrayList<Member>)Utility.deserialize(\"members.ser\");\n\tif(members == null) {\n\t\tmembers = new ArrayList<Member>();\n\t}\n\tif(this.checkUserNameExists(members)== false) {\n\t\tmembers.add(this);\n\t\tUtility.serialize(members, \"members.ser\");\n\t\treturn true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n}", "@Override\r\n\tpublic boolean register(String email, String id, String pw) {\n\t\treturn jdbcTemplate.update(\"insert into s_member values(?,?,?,\"\r\n\t\t\t\t+ \"'normal',sysdate)\",email,id,pw)>0;\r\n\t}", "public void RegisterUser() {\n try {\n reg = new Registration();\n reg.setFirstName(FName);\n reg.setLastName(LName);\n reg.setCompanyName(CompanyName);\n reg.setEmail(Email);\n reg.setMobile(mobile);\n ValidateRegistration validator = new ValidateRegistration();\n boolean legitmail = validator.validateEmail(reg);\n if ( legitmail == false ) {\n System.out.println(\"Not a legitimate Email\");\n FacesContext c = FacesContext.getCurrentInstance();\n FacesMessage m = new FacesMessage(\"Invalid Email\", \"The email provided is not correct\");\n c.addMessage(null, m);\n } else {\n FacesContext c = FacesContext.getCurrentInstance();\n c.getApplication().getNavigationHandler().handleNavigation(c, null, \"mainpage.xhtml\");\n }\n } catch (Exception ex) {\n System.out.println(ex.getMessage());\n }\n }", "public boolean register(String u_Name, String u_pw, String f_name){\n List<User> userList = userDao.getUserFromUsername(u_Name);\n //1.check if userName is used\n if (userList.size() != 0){ \n return false;\n }\n //2.create user and add to the DB\n User user = new User(u_Name, u_pw, f_name);\n userDao.addUser(user);\n //3.return true\n return true;\n }", "private void isUser() {\r\n FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();\r\n assert user != null;\r\n String Uphonenumber = user.getPhoneNumber();\r\n final String usernumber = Objects.requireNonNull(Uphonenumber);\r\n\r\n DatabaseReference reference = FirebaseDatabase.getInstance().getReference(\"UsersData\");\r\n Query checkUser = reference.orderByChild(\"phone\").equalTo(usernumber);\r\n checkUser.addListenerForSingleValueEvent(new ValueEventListener() {\r\n @Override\r\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\r\n if (dataSnapshot.exists()){\r\n\r\n nameFromDB = dataSnapshot.child(usernumber).child(\"name\").getValue(String.class);\r\n phoneFromDB = dataSnapshot.child(usernumber).child(\"phone\").getValue(String.class);\r\n dashboardUsername.setText(nameFromDB);\r\n dashboardPhoneNumber.setText(phoneFromDB);\r\n progressBar.DismissDialog();\r\n\r\n\r\n }\r\n else{\r\n Toast.makeText(getApplicationContext(),\"User data didn't matched! \", Toast.LENGTH_LONG).show();\r\n }\r\n\r\n }//End of onDataChange method\r\n\r\n @Override\r\n public void onCancelled(@NonNull DatabaseError databaseError) {\r\n\r\n }\r\n });//End of addListenerForSingleValueEvent method\r\n\r\n\r\n }", "public void onRegisterPressed(View v) {\n String username = ((EditText) findViewById(R.id.usernameNew)).getText().toString();\n String password = ((EditText) findViewById(R.id.passwordNew)).getText().toString();\n String checkPassword = ((EditText) findViewById(R.id.passwordNew2)).getText().toString();\n Register register = new Register(username, password, checkPassword);\n TextView passwordCheck = findViewById(R.id.passwordCheck);\n TextView errorUsername = findViewById(R.id.errorUsername);\n\n if(!register.assertPassword()) {\n passwordCheck.setVisibility(View.VISIBLE);\n } else {\n passwordCheck.setVisibility(View.GONE);\n }\n if (!register.assertUsername()) {\n errorUsername.setVisibility(View.VISIBLE);\n } else {\n errorUsername.setVisibility(View.GONE);\n }\n if(register.assertUsername() && register.assertPassword()) {\n User user = new User(username, password, (UserTypes)userTypeSpinner.getSelectedItem());\n\n Toast.makeText(this, \"Account Added\", Toast.LENGTH_SHORT).show();\n\n Persistence.getInstance().write(User.SAVE_FILE, getApplicationContext(), user);\n\n Intent mainIntent = new Intent(this, MainActivity.class);\n mainIntent.putExtra(\"EXTRA_USER_TYPE\", user.getAccountType());\n startActivity(mainIntent);\n\n finish();\n }\n }", "Boolean startRegistration(FaceuserPojo faceuserPojo);", "public boolean gotUserName(){return gotUserName;}", "public void registrar() {\n try {\r\n do {\r\n //totalUsuarios = this.registraUnUsuario(totalUsuarios);\r\n this.registraUnUsuario();\r\n } while (!this.salir());\r\n } catch (IOException e) {\r\n flujoSalida.println(\"Error de entrada/salida, finalizará la aplicación.\");\r\n }\r\n flujoSalida.println(\"Total usuarios registrados: \"+totalUsuarios);\r\n }", "public String regist(User user) {\n\t\t\n\t\tuser.setId(UUIDUtils.getNumUUID());\n\t\tuserMapper.insertSelective(user);\n\t\t\n\t\treturn \"success\";\n\t}", "@Override\n\tpublic boolean userRegister(User user) {\n\t\tif(userDao.insertUser(user)<=0)\n\t\t return false;\n\t\telse\n\t\t\treturn true;\n\t}", "private void registerUser(){\n mAuth.createUserWithEmailAndPassword(correo, password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n //mapa de valores\n Map<String, Object> map = new HashMap<>();\n map.put(\"name\",name);\n map.put(\"email\",correo);\n map.put(\"password\",password);\n map.put(\"birthday\",cumple);\n map.put(\"genre\",genre);\n map.put(\"size\",size);\n //obtenemos el id asignado por la firebase\n String id= mAuth.getCurrentUser().getUid();\n //pasamos el mapa de valores\n mDatabase.child(\"Users\").child(id).setValue(map).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task2) {\n //validams que la tarea sea exitosa\n if(task2.isSuccessful()){\n startActivity(new Intent(DatosIniciales.this, MainActivity.class));\n //evitamos que vuelva a la pantalla con finsh cuando ya se ha registrado\n finish();\n }else{\n Toast.makeText(DatosIniciales.this, \"Algo fallo ups!!\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }else{\n Toast.makeText(DatosIniciales.this, \"No pudimos completar su registro\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }", "@Then(\"^user is successfully registered$\")\r\n public void user_is_successfully_registered() throws Throwable {\n throw new PendingException();\r\n }", "private void onSignupSuccess() {\n startActivity(currentActivity, UserLoginActivity.class);\n finish();\n }", "public boolean hasUser(){\n return numUser < MAX_USER;\n }", "@Override\n\tpublic boolean hasUser(Account acccount) {\n\n\n\n\n\n\n\n\n\n\t\t\n\t\treturn (usersHashtable.containsKey(acccount));\n\t}", "public void checkIfUserExists(){\n refIdsOnly = database.getReference(\"ids\");\n String idText1 = idEdit.getText().toString();\n\n idListener = new ValueEventListener() {\n boolean userDoesntExist = true;\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n // removing the event listener to make sure it only happens once\n // otherwise it has time to check again for the user just created\n refIdsOnly.removeEventListener(idListener);\n if (dataSnapshot.exists()){\n for (DataSnapshot data:dataSnapshot.getChildren()){\n String id = data.getValue(String.class);\n if (idText1.equals(id)){\n userDoesntExist = false;\n }\n }\n }\n if (userDoesntExist){\n register(idText1);\n }\n else\n Toast.makeText(RegistrationActivity.this, \"duplicate id number\", Toast.LENGTH_LONG).show();\n }\n @Override\n public void onCancelled(DatabaseError databaseError) {\n Toast.makeText(RegistrationActivity.this, \"failed\", Toast.LENGTH_LONG).show();\n }\n };\n refIdsOnly.addValueEventListener(idListener);\n }", "private void registrationView() {\n String login;\n String email;\n String password;\n\n try {\n while (true) {\n printLine();\n print(\"\\tВведите логин\\n\");\n print(\"\\t>>>>> \");\n login = readStringFromConsole();\n\n print(\"\\tВведите email\\n\");\n print(\"\\t>>>>> \");\n try {\n email = valid.emailValidation(readStringFromConsole());\n } catch (NotValidDataException e) {\n printErr(\"\\tнекорректный email\");\n continue;\n }\n\n print(\"\\tВведите пароль\\n\");\n print(\"\\t>>>>> \");\n try {\n password = valid.passwordValidation(readStringFromConsole());\n } catch (NotValidDataException e) {\n printErr(\"\\tнекорректный password\");\n continue;\n }\n break;\n }\n\n try {\n\n serviceAuthorizationService.registration(new UserDto()\n .withUsername(login)\n .withEmail(email)\n .withPassword(password));\n setStatus(REGISTERED);\n printLine();\n print(\"\\tВы успешно зарегистрировались\");\n } catch (AlreadyExistsException e) {\n e.showMessage();\n registrationView();\n }\n } catch (IOException e) {\n registrationView();\n }\n }", "void onUserCreated(FirebaseUser firebaseUser);", "public boolean hasUser() {\n return user_ != null;\n }", "public boolean hasUser() {\n return user_ != null;\n }", "private void registerUserOnServer() throws IOException {\r\n\t\tdataSending.sendMessage(Server.REGISTER+\" \"+userName, Long.toString(userModel.ID));\r\n\t}", "public long registerUserProfile(User user);", "public boolean isRegisteredUserName(String userName);", "@Override\n\tpublic void regist(User user) {\n\t\tdao.addUser(user);\n\t}", "public boolean checkRegister() {\n\n\t\tif (!email.getText().equals(\"\") && !username.getText().equals(\"\") && !psw.getText().equals(\"\")) {\n\t\t\tResultSet test = Database.getInstance().query(\"SELECT * FROM utilisateur\");\n\t\t\ttry {\n\t\t\t\twhile (test.next()) {\n\t\t\t\t\tif (test.getString(2).equals(username.getText()) && test.getString(4).equals(email.getText())\n\t\t\t\t\t\t\t&& test.getString(3).equals(psw.getText())) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\n\t\t\t} catch (SQLException e) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean isExistingUser() {\r\n return isExistingUser;\r\n }", "public boolean addReadyUser(User user) {\r\n\t\tif (playerState.get(user) == ENTERED) {\r\n\t\t\tplayerState.remove(user);\r\n\t\t\tplayerState.put(user, READY);\r\n\t\t\treadyUser++;\r\n\t\t\tbroadCast(\"before_notify\", String.valueOf(user.getNickname()) + \" 님이 READY\");\r\n\t\t\tif (readyUser == users.size()) {\r\n\t\t\t\tbroadCast(\"GAME_PLAY_START\", \"\");\r\n\t\t\t\tthis.status = LOAD;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tSystem.out.print(\"somthing wrong\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}" ]
[ "0.72347754", "0.70682025", "0.70304865", "0.6998683", "0.68097275", "0.67260796", "0.67260796", "0.67260796", "0.67260796", "0.67260796", "0.67260796", "0.67260796", "0.67145336", "0.6711625", "0.6673015", "0.665039", "0.66284853", "0.66202086", "0.66115624", "0.66101116", "0.65792084", "0.65702343", "0.65611273", "0.64672947", "0.64577216", "0.6456561", "0.6450994", "0.64496934", "0.6441272", "0.64356184", "0.6411632", "0.6403681", "0.63831466", "0.6369198", "0.63585925", "0.6355067", "0.63542575", "0.6345865", "0.6339852", "0.6338523", "0.63288826", "0.6322398", "0.6319214", "0.63181216", "0.63103056", "0.6298601", "0.6279898", "0.6279898", "0.6279898", "0.6279898", "0.6279898", "0.6279898", "0.6279898", "0.6279898", "0.6279898", "0.6279898", "0.6279898", "0.6279898", "0.6279898", "0.6279898", "0.6279898", "0.6279898", "0.6279898", "0.6279898", "0.6269887", "0.6261236", "0.6259732", "0.6255336", "0.6238376", "0.6237925", "0.62293375", "0.6221233", "0.6217781", "0.6207884", "0.6206261", "0.6202038", "0.61774576", "0.61734873", "0.6162002", "0.61619747", "0.61267793", "0.6108734", "0.6108236", "0.60954785", "0.60893124", "0.6083209", "0.6077394", "0.60750973", "0.6063924", "0.60614324", "0.60609", "0.60594565", "0.60594565", "0.6055033", "0.605362", "0.6051439", "0.6050444", "0.6045824", "0.6045555", "0.60435903" ]
0.667058
15
Method to get all process quality indicators or many process quality indicators filtered by processDocumentation
public GetProcessQualitiesQuery getProcessQualitiesQuery(final GetProcessQualitiesQuery query) { if (query.getProcessDocumentation() != null) { Translator .translateProcessQualities( processQualityRepository.findByProcessDocumentation( new ProcessDocumentationEntity(query.getProcessDocumentation())), query.getLanguage()) .ifPresent(query.getRead()::setData); return query; } Translator.translateProcessQualities(processQualityRepository.findAll(), query.getLanguage()) .ifPresent(query.getRead()::setData); return query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Set<ProcessReader> getProcesses();", "public Collection<IProcess> getProcess(String processName) {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic List<Object[]> getProcessDetail() {\n\t\ttry {\r\n\t\t\tlist = productionOrderProcessDao.getProcessDetail();\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(e.getMessage());\r\n\t\t}\r\n\t\treturn list;\r\n\t}", "public com.sforce.soap.enterprise.QueryResult getProcessInstances() {\r\n return processInstances;\r\n }", "@Override\n\tpublic List<WxProcessDefinition> queryAll() {\n\t\tCriteriaBuilder cb = this.getCriteriaBuilder();\n\t\tCriteriaQuery<WxProcessDefinition> c = cb.createQuery(getEntityClass());\n\t\tRoot<WxProcessDefinition> root = c.from(getEntityClass());\n\t\tc.orderBy(cb.asc(root.get(\"index\")));\n\t\treturn super.query(c.select(root), null, null);\n\t}", "public List<RafProcess> findByRafProcessLike(RafProcess rafProcess,\n\t\t\tJPQLAdvancedQueryCriteria criteria, int firstResult, int maxResults);", "@Override\r\n\tpublic List<Object[]> searchProductionOrderProcess() {\n\t\ttry {\r\n\r\n\t\t\tlist = productionOrderProcessDao.searchProductionOrderProcess();\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(e.getMessage());\r\n\t\t}\r\n\r\n\t\treturn list;\r\n\t}", "private void consultaListaDisciplinasPorProcesso(int idProcesso) {\n this.gridDisciplinas = new ListDataModel(new DisciplinaServiceImpl().pesquisarTodosOrdenadasComResposta());\n }", "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 }", "@Override\n public List<ClarifaiProcessDTO> findAll() {\n log.debug(\"Request to get all ClarifaiProcesses\");\n return clarifaiProcessRepository.findAll().stream()\n .map(clarifaiProcessMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }", "private static List<String> readOutput(Process process) throws IOException {\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));\n\t\tString line;\n\t\tList<String> lines = new ArrayList<>();\n\t\twhile ((line = reader.readLine()) != null) {\n\t\t\tlines.add(line);\n\t\t}\n\t\treturn lines;\n\t}", "List<QualityDataSetDTO> getQDSElements(String measureId, String verision);", "private Stream<ProcessHandle> getProcesses() {\n return ProcessHandle.allProcesses();\n }", "List<SrInwardTruckQualityCheck> getAll();", "public List<ImagingDocument> getDocumentsToProcess(boolean wipMode) throws SQLException {\n\t\tList<ImagingDocument> documentsToProcess = new ArrayList<ImagingDocument>();\n\t\tConnection connection = DataSourceUtils.getConnection(dataSource);\n\t\tPreparedStatement stmt = null;\n\t\tString sql = null;\n\t\tif (wipMode) {\n\t\t\tsql = SQL_UEWI_SELECT_DOCUMENTS_TO_PROCESS_WIP;\n\t\t} else {\n\t\t\tsql = SQL_UEWI_SELECT_DOCUMENTS_TO_PROCESS;\n\t\t}\n\t\tstmt = connection.prepareStatement(sql);\n\t\tstmt.setMaxRows(batchSize);\n\t\tResultSet rs = stmt.executeQuery();\n\t\t\n\t\twhile (rs.next()) {\n\t\t\tImagingDocument docRow = new ImagingDocument(rs.getString(1), rs.getString(2), rs.getBoolean(3), rs.getString(4), rs.getInt(5));\n\t\t\tdocumentsToProcess.add(docRow);\n\t\t}\n\t\trs.close();\n\t\tconnection.close();\n\t\tstmt.close();\n\t\t\n\t\treturn documentsToProcess;\n\t}", "private void readQuality ()\n{\n // Reset the quality length.\n quality.setLength ( 0 );\n\n // Skip the BQ line.\n line = ace_file.getLine ();\n\n // Read in the quality array until the first blank line.\n while ( line.length () > 0 )\n {\n // Append the current line to the sequence.\n quality.append ( line.toString ().trim () + \" \" );\n\n // Get the next line of the ace file.\n line = ace_file.getLine ();\n } /* while */\n\n // Create a SequenceQuality entry for the Contig sequence.\n xml_file.write_XML_entry ( \"SequenceQuality\" );\n xml_file.write_XML_field ( \"sequence_quality_type\", \"Phrap\" );\n\n // Create the sequence_quality field.\n xml_file.write_XML_qual_field ( \"sequence_quality\", quality.toString () );\n\n // End the SequenceQuality table entry.\n xml_file.write_XML_entry_end ();\n\n // End the Sequence table entry.\n xml_file.write_XML_entry_end ();\n\n // Write the AlignmentSequence entry for the Contig sequence.l\n writeAlignmentSequence ( null, contigName.toString (), 1, contig.length (),\n contig.length (), \"+\", 1, contig.length () );\n}", "@Override\n public List<ClarifaiProcessDTO> search(String query) {\n log.debug(\"Request to search ClarifaiProcesses for query {}\", query);\n return StreamSupport\n .stream(clarifaiProcessSearchRepository.search(queryStringQuery(query)).spliterator(), false)\n .map(clarifaiProcessMapper::toDto)\n .collect(Collectors.toList());\n }", "@Test\n public void testProcessQueryByList() {\n Platform si = new Platform();\n OperatingSystem os = si.getOperatingSystem();\n assertNotNull(os.getFamily());\n assertNotNull(os.getManufacturer());\n OperatingSystem.OSVersionInfo versionInfo = os.getVersionInfo();\n assertNotNull(versionInfo);\n\n assertTrue(os.getProcessCount() >= 1);\n assertTrue(os.getThreadCount() >= 1);\n assertTrue(os.getProcessId() > 0);\n\n List<OSProcess> processes = os.getProcesses(5, null);\n assertNotNull(processes);\n // every OS should have at least one process running on it\n assertFalse(processes.isEmpty());\n // the list of pids we want info on\n List<Integer> pids = new ArrayList<>();\n for (OSProcess p : processes) {\n pids.add(p.getProcessID());\n }\n // query for just those processes\n Collection<OSProcess> processes1 = os.getProcesses(pids);\n // there's a potential for a race condition here, if a process we\n // queried for initially wasn't running during the second query. In this case,\n // try again with the shorter list\n while (processes1.size() < pids.size()) {\n pids.clear();\n for (OSProcess p : processes1) {\n pids.add(p.getProcessID());\n }\n // query for just those processes\n processes1 = os.getProcesses(pids);\n }\n assertEquals(processes1.size(), pids.size());\n\n }", "public Collection getQualityResults()\r\n {\r\n return mQualityResults;\r\n }", "public DataRecord[] getCurrentProcessList() throws ProcessManagerException {\r\n if (currentProcessList == null)\r\n return resetCurrentProcessList();\r\n else\r\n return currentProcessList;\r\n }", "void collectScenario(String system, int processNo, PrintStream output) throws SQLException {\n\t\tString scenario = system + \"-process\" + processNo;\n\t\tString path = null;\n\t\ttry {\n\t\t\tpath = Paths.get(Runner.class.getResource(\"/\").toURI()).toString() + \"/../../scenarios/\";\n\t\t} catch (URISyntaxException e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"Failed for scenario \" + scenario + \".\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tString projectPath = path + scenario + \"/\";\n\n\t\t\n\t\t// open query path reader\n\t\tQueryPathReader qpr = new QueryPathReader(projectPath);\n\t\ttry {\n\t\t\tqpr.init();\t\n\t\t\t\n\t\t\t/* \nSELECT DISTINCT qm.processQueryNo, qc.queryString\nFROM queryclassification qc\nINNER JOIN querymapping qm \n\tON qm.system = qc.system\n\t\tAND qm.queryNo = qc.queryNo\nINNER JOIN evaluationAverage ea\n\tON coverage < 1 \n\t\tAND ea.system = qm.system\n AND ea.processNo = qm.processNo\n\t\tAND ea.queryNo = qm.processQueryNo\nWHERE ea.algorithm = 'evosql' AND qm.system = {system} AND qm.processNo = {processNo}\nORDER BY qm.processQueryNo;\n\t\t\t */\n\t\t\tString sql = \"SELECT DISTINCT qm.processQueryNo, qc.queryString, ea.coverage, qc.paths \\r\\n\" + \n\t\t\t\t\t\"FROM queryclassification qc\\r\\n\" + \n\t\t\t\t\t\"INNER JOIN querymapping qm \\r\\n\" + \n\t\t\t\t\t\"\tON qm.system = qc.system\\r\\n\" + \n\t\t\t\t\t\"\t\tAND qm.queryNo = qc.queryNo\\r\\n\" + \n\t\t\t\t\t\"INNER JOIN evaluationAverage ea\\r\\n\" + \n\t\t\t\t\t\"\tON coverage < 1 \\r\\n\" + \n\t\t\t\t\t\"\t\tAND ea.system = qm.system\\r\\n\" + \n\t\t\t\t\t\" AND ea.processNo = qm.processNo\\r\\n\" + \n\t\t\t\t\t\"\t\tAND ea.queryNo = qm.processQueryNo\\r\\n\" + \n\t\t\t\t\t\"WHERE ea.algorithm = 'evosql' AND qm.system = ? AND qm.processNo = ?\\r\\n\" + \n\t\t\t\t\t\"ORDER BY qm.processQueryNo\"; \n\t\t\t\t\t\n\t\t\tPreparedStatement stmt = conn.prepareStatement(sql);\n\t\t\tstmt.setString(1, system);\n\t\t\tstmt.setInt(2, processNo);\n\t\t\tResultSet result = stmt.executeQuery();\n\t\t\n\t\t\t// Get all queries to collect\n\t\t\tint queryCount = 0;\n\t\t\tif (result.last()) {\n\t\t\t\tqueryCount = result.getRow();\n\t\t\t\tresult.beforeFirst();\n\t\t\t}\n\t\t\tint[] queryNumbers = new int[queryCount];\n\t\t\tString[] queryStrings = new String[queryCount];\n\t\t\tdouble[] queryCoverages = new double[queryCount];\n\t\t\tint[] pathCounts = new int[queryCount];\n\t\t\tint i = 0;\n\t\t\twhile (result.next()) {\n\t\t\t\tqueryNumbers[i] = result.getInt(1);\n\t\t\t\tqueryStrings[i] = result.getString(2);\n\t\t\t\tqueryCoverages[i] = result.getDouble(3);\n\t\t\t\tpathCounts[i] = result.getInt(4);\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t\n\t\t\t// For each query collect the information needed and store it \n\t\t\tfor (int j = 0; j < queryCount; j++) {\n\t\t\t\tint processQueryNo = queryNumbers[j];\n\t\t\t\tString query = queryStrings[j];\n\t\t\t\tdouble coverage = queryCoverages[j];\n\t\t\t\tQueryPathList qpl = qpr.read(processQueryNo);\n\t\t\t\tcollectQuery(system, processNo, processQueryNo, query, coverage, pathCounts[j], qpl, output);\n\t\t\t}\n\t\t\t\n\t\t\tqpr.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"Failed for scenario \" + scenario + \".\");\n\t\t\treturn;\n\t\t}\n\t}", "public RecordSet loadAllProcessingDetail(Record inputRecord);", "public List<AProcess> getProcesses() {\n return processes;\n }", "List<ExamPackage> getListIsComing();", "public RecordSet loadAllProcessDetailHistory(Record inputRecord);", "private String getFeasibleProcess(){\n String outSystemProcessId = null;\n if(systemProcessListIterator==null){\n systemProcessListIterator = systemProcesses.listIterator();\n }\n while (systemProcessListIterator.hasNext()) {\n SystemProcessPojo systemProcessPojo = systemProcessListIterator.next();\n// System.out.println(\"Performing check for process:\" + systemProcessPojo.getId());\n int feasibleProcessCounter = 0;\n ListIterator<SystemResourcePojo> systemResourcesListIterator = systemResources.listIterator();\n while (systemResourcesListIterator.hasNext()) {\n SystemResourcePojo systemResourcePojo = systemResourcesListIterator.next();\n if(systemProcessPojo.getRequiredResourceInstances().get(systemResourcePojo.getId())<=systemResourcePojo.getAvailableInstances()){\n feasibleProcessCounter++;\n } else {\n break;\n }\n }\n if(feasibleProcessCounter == systemResources.size() && !systemProcessPojo.isFinishedExecution()){\n outSystemProcessId = systemProcessPojo.getId();\n// Reset the Temp ListIterator here...\n if (!systemProcessListIterator.hasNext()) {\n systemProcessListIterator = null;\n }\n break;\n } else if(systemProcesses\n .stream()\n .filter(systemResourcPojoFiltered->!systemResourcPojoFiltered.isFinishedExecution())\n .count()\n >0 && !systemProcessListIterator.hasNext()){\n systemProcessListIterator = systemProcesses.listIterator();\n \n }\n \n \n }\n \n return outSystemProcessId;\n }", "List<BasicInfoPrecursorProcessType> selectByExample(BasicInfoPrecursorProcessTypeExample example);", "public Map<Integer, AwareProcessBaseInfo> getAllProcessBaseInfo() {\n ArrayMap<Integer, AwareProcessBaseInfo> list = new ArrayMap();\n synchronized (this.mPidsSelfLocked) {\n int i = SMART_TRIM_ADJ_LIMIT;\n while (true) {\n if (i < this.mPidsSelfLocked.size()) {\n ProcessRecord p = (ProcessRecord) this.mPidsSelfLocked.valueAt(i);\n AwareProcessBaseInfo baseInfo = new AwareProcessBaseInfo();\n baseInfo.mCurAdj = p.curAdj;\n baseInfo.mForegroundActivities = p.foregroundActivities;\n baseInfo.mAdjType = p.adjType;\n baseInfo.mHasShownUi = p.hasShownUi;\n baseInfo.mUid = p.uid;\n list.put(Integer.valueOf(p.pid), baseInfo);\n i += ROG_CHANGE_EVENT_SWITCH;\n }\n }\n }\n return list;\n }", "public List<IAspectRead> getReadAspects(IPartType partType);", "public Set<IAspectRead> getReadAspects();", "@RequestMapping(value = {\"\", \"/\"}, method = RequestMethod.GET)\n public\n @ResponseBody\n RestWrapper get(\n @RequestParam(value = \"pid\", defaultValue = \"0\") String processId, Principal principal\n ) {\n RestWrapper restWrapper = null;\n try {\n StringBuffer dot = new StringBuffer();\n String[] args = {\"-p\", processId};\n GetProcessDependency bs = new GetProcessDependency();\n List<ProcessDependencyInfo> processDependencyInfoList = bs.execute(args);\n LineageInfo lineageInfo = new LineageInfo();\n String borderColor = \"black\";\n /*\n 1\tsftp\n 2\tSemantic\n 3\tExport\n 4\tImport\n 5\tf2c\n 6\tf2s\n 7\ts2p\n 8\tp2c\n */\n String tooltip = \"\";\n boolean hasDownStream = false;\n boolean hasUpStream = false;\n\n Integer pid = new Integer(processId);\n for (ProcessDependencyInfo processDependencyInfo : processDependencyInfoList) {\n switch (processDependencyInfo.getProcessTypeId()) {\n case 1:\n borderColor = \"green\";\n break;\n case 2:\n borderColor = \"brown\";\n break;\n case 3:\n borderColor = \"aqua\";\n break;\n case 4:\n borderColor = \"pink\";\n break;\n case 5:\n borderColor = \"purple\";\n break;\n case 6:\n borderColor = \"gray\";\n break;\n case 7:\n borderColor = \"yellow\";\n break;\n }\n tooltip = \"Description: \" + processDependencyInfo.getDescription() + \" Added on:\" + processDependencyInfo.getAddTS();\n //String label = \"\\\"\" + processDependencyInfo.getProcessName()+ \"\\n(\" +processDependencyInfo.getProcessId() +\")\" + \"\\\"\";\n String label = \"<<TABLE CELLSPACING=\\\"4\\\" CELLPADDING=\\\"0\\\" BORDER=\\\"0\\\" WIDTH=\\\"100%\\\"><TR><TD COLSPAN=\\\"3\\\">\" + processDependencyInfo.getProcessName().replace(\"&\", \"&amp;\") +\n \"</TD></TR><TR><TD COLSPAN=\\\"3\\\">\" + processDependencyInfo.getProcessId() + \"</TD></TR>\" +\n \"<TR>\" +\n \"<TD COLOR=\\\"blue\\\" href=\\\"javascript:popModal(\" + processDependencyInfo.getProcessId() + \")\\\"><FONT COLOR=\\\"blue\\\" POINT-SIZE=\\\"8\\\">Diagram </FONT></TD>\" +\n \"<TD COLOR=\\\"blue\\\" href=\\\"javascript:popModalXml(\" + processDependencyInfo.getProcessId() + \")\\\"><FONT COLOR=\\\"blue\\\" POINT-SIZE=\\\"8\\\"> XML </FONT></TD>\" +\n \"<TD COLOR=\\\"blue\\\" href=\\\"javascript:GotoProcess(\" + processDependencyInfo.getProcessId() + \")\\\"><FONT COLOR=\\\"blue\\\" POINT-SIZE=\\\"8\\\"> Details</FONT></TD></TR></TABLE>>\";\n\n //String label = \"<\" + processDependencyInfo.getProcessName()+ \"\\n(\" +processDependencyInfo.getProcessId() +\")\" + \">\";\n\n dot.append(processDependencyInfo.getProcessId() + \" [label=\" + label + \" tooltip=\\\"\" + tooltip + \"\\\"shape=rectangle,style=filled,fontcolor=black,color=\" + borderColor + \",style=\\\"rounded\\\",penwidth=2,fontsize=10,URL=\\\"javascript:getPid(\" + processDependencyInfo.getProcessId() + \")\\\"];\\n\");\n //Checking if the process is an upstream or downstream\n if (\"D\".equals(processDependencyInfo.getRowType())) {\n dot.append(pid + \" -> \" + processDependencyInfo.getProcessId() + \";\\n\");\n hasDownStream = true;\n } else if (\"U\".equals(processDependencyInfo.getRowType())) {\n dot.append(processDependencyInfo.getProcessId() + \" -> \" + pid + \";\\n\");\n hasUpStream = true;\n }\n\n }\n if (!hasDownStream) {\n tooltip = \"\\\"No more downstream for \" + pid + \" in the pipeline\\\"\";\n dot.append(\"end\" + pid + \" [margin=\\\".11,.05\\\",label=ND,tooltip=\" + tooltip + \",shape=circle,style=filled,penwidth=2,fontsize=10];\\n\");\n dot.append(pid + \" -> end\" + pid + \"[size=1,arrowhead=none,color=gray,penwidth=.5] ;\\n\");\n }\n if (!hasUpStream) {\n tooltip = \"\\\"Process \" + pid + \" does not have any upstream in the pipeline\\\"\";\n dot.append(\"start\" + pid + \" [margin=\\\".11,.05\\\",label=NU,tooltip=\" + tooltip + \",shape=circle,style=filled,penwidth=2,fontsize=10];\\n\");\n dot.append(\"\\\"start\" + pid + \"\\\" -> \" + pid + \"[size=1,arrowhead=none,color=gray,penwidth=.5];\\n\");\n }\n dot.append(\"\");\n lineageInfo.setDot(dot.toString());\n lineageInfo.setPid(processId);\n restWrapper = new RestWrapper(lineageInfo, RestWrapper.OK);\n LOGGER.info(\"Record with ID:\" + processId + \" selected from LineageInfo by User:\" + principal.getName());\n\n } catch (Exception e) {\n restWrapper = new RestWrapper(e.getMessage(), RestWrapper.ERROR);\n }\n return restWrapper;\n }", "List<ProcessDefinition> findByNombre(String nombre);", "public List<TASCProcessTO> getProcess(SearchProcess searchProcess) throws Exception {\r\n\t\tSystem.out.println(\"Enter: getProcess()\");\r\n\t\tConnection conn = null;\r\n\t\tPreparedStatement pstmt = null;\r\n\t\tResultSet rs = null;\r\n\t\tTASCProcessTO processTO = null;\r\n\t\tList<TASCProcessTO> processList = new ArrayList<TASCProcessTO>();\r\n\t\tStringBuffer queryBuff = new StringBuffer();\r\n\t\tqueryBuff.append(\"select PROCESS_ID,FILE_NAME,SOURCE_SYSTEM,HIER_VALIDATION,BIO_VALIDATION,DEMO_VALIDATION,CONTENT_VALIDATION,\");\r\n\t\tqueryBuff.append(\"OBJECTIVE_VALIDATION,ITEM_VALIDATION,WKF_PARTITION_NAME,DATETIMESTAMP,(SELECT GETSTATUS(PROCESS_ID) FROM DUAL) STSTUS, ER_VALIDATION \");\r\n\t\t//queryBuff.append(\",to_number(datetimestamp - to_date('01-JAN-1970','DD-MON-YYYY')) * (24 * 60 * 60 * 1000) long_time \");\r\n\t\tqueryBuff.append(\"from stg_process_status \");\r\n\t\t// queryBuff.append(\" WHERE rownum<10 \");\r\n\t\tif(searchProcess != null) {\r\n\t\t\tqueryBuff.append(\" WHERE 1 = 1 \");\r\n\t\t\tif(searchProcess.getCreatedDate() != null && searchProcess.getCreatedDate().trim().length() > 0\r\n\t\t\t\t\t&& searchProcess.getUpdatedDate() != null && searchProcess.getUpdatedDate().trim().length() > 0) {\r\n\t\t\t\tqueryBuff.append(\"AND (DATETIMESTAMP between to_date(?, 'MM/DD/YYYY') and to_date(?, 'MM/DD/YYYY')+1) \");\r\n\t\t\t}\r\n\t\t\tif(searchProcess.getStructElement() != null && searchProcess.getStructElement().trim().length() > 0) \r\n\t\t\t\tqueryBuff.append(\"AND SOURCE_SYSTEM = ? \");\r\n\t\t}\r\n\t\tqueryBuff.append(\" order by PROCESS_ID desc \");\r\n\t\tString query = queryBuff.toString();\r\n\t\t// System.out.println(query);\r\n\t\ttry {\r\n\t\t\tconn = BaseDAO.connect(DATA_SOURCE);\r\n\t\t\tint count = 0;\r\n\t\t\tpstmt = conn.prepareCall(query);\r\n\t\t\tif(searchProcess != null) {\r\n\t\t\t\tif(searchProcess.getCreatedDate() != null && searchProcess.getCreatedDate().trim().length() > 0\r\n\t\t\t\t\t\t&& searchProcess.getUpdatedDate() != null && searchProcess.getUpdatedDate().trim().length() > 0) {\r\n\t\t\t\t\tpstmt.setString(++count, searchProcess.getCreatedDate());\r\n\t\t\t\t\tpstmt.setString(++count, searchProcess.getUpdatedDate());\r\n\t\t\t\t}\r\n\t\t\t\tif(searchProcess.getStructElement() != null && searchProcess.getStructElement().trim().length() > 0) \r\n\t\t\t\t\tpstmt.setString(++count, searchProcess.getStructElement());\r\n\t\t\t}\r\n\t\t\trs = pstmt.executeQuery();\r\n\t\t\twhile(rs.next()) {\r\n\t\t\t\tprocessTO = new TASCProcessTO();\r\n\t\t\t\tprocessTO.setProcessId(rs.getString(\"PROCESS_ID\"));\r\n\t\t\t\tprocessTO.setFileName(rs.getString(\"FILE_NAME\"));\r\n\t\t\t\tprocessTO.setSourceSystem(rs.getString(\"SOURCE_SYSTEM\"));\r\n\t\t\t\tprocessTO.setHierValidation(rs.getString(\"HIER_VALIDATION\"));\r\n\t\t\t\tprocessTO.setBioValidation(rs.getString(\"BIO_VALIDATION\"));\r\n\t\t\t\tprocessTO.setDemoValidation(rs.getString(\"DEMO_VALIDATION\"));\r\n\t\t\t\tprocessTO.setContentValidation(rs.getString(\"CONTENT_VALIDATION\"));\r\n\t\t\t\tprocessTO.setObjValidation(rs.getString(\"OBJECTIVE_VALIDATION\"));\r\n\t\t\t\tprocessTO.setItemValidation(rs.getString(\"ITEM_VALIDATION\"));\r\n\t\t\t\tprocessTO.setWkfPartitionName(rs.getString(\"WKF_PARTITION_NAME\"));\r\n\t\t\t\tprocessTO.setDateTimestamp(rs.getString(\"DATETIMESTAMP\"));\r\n\t\t\t\tprocessTO.setOverallStatus(rs.getString(\"STSTUS\"));\r\n\t\t\t\tprocessTO.setErValidation(rs.getString(\"ER_VALIDATION\") == null ? \" \" : rs.getString(\"ER_VALIDATION\"));\r\n\t\t\t\tprocessList.add(processTO);\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tthrow new Exception(e.getMessage());\r\n\t\t} finally {\r\n\t\t\ttry {rs.close();} catch (Exception e2) {}\r\n\t\t\ttry {pstmt.close();} catch (Exception e2) {}\r\n\t\t\ttry {conn.close();} catch (Exception e2) {}\r\n\t\t}\r\n\t\tSystem.out.println(\"Exit: getProcess()\");\r\n\t\treturn processList;\r\n\t}", "public List<String> getProcessIds() {\r\n\t\tList<String> list = new ArrayList<String>();\r\n\t\tlist.add(this.getProcessDescriptionId());\r\n\t\t\r\n\t\tfor (AbstractArea area : elements) {\r\n\t\t\tif (area instanceof CallActivityTaskHighlight) {\r\n\t\t\t\tCallActivityTaskHighlight callactivity = (CallActivityTaskHighlight) area;\r\n\t\t\t\tlist.add(callactivity.getProcessDescriptionId());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn list;\r\n\t}", "public void readFastqFile(String filePath) throws IOException {\n\t\tFastxFileReader fastqReader = FileReaderFactory.getFileReader(filePath);\n\n\t\tfor (FastxRecord fastq : fastqReader.readFile()) {\n\t\t\tSystem.out.println(\"Sequence: \" + fastq.toString());\n\t\t\tSystem.out.println(\"\\t getQualityHeader: \" + ((FastqRecord) fastq).getQualityHeader());\n\t\t\tSystem.out.println(\"\\t getQualityString: \" + ((FastqRecord) fastq).getQualityString());\n\t\t\tSystem.out.println(\"\\t \tvalue: \" + ((FastqRecord) fastq).getMeanQuality());\n\t\t\tSystem.out.println(\"\\t getReadHeader: \" + ((FastqRecord) fastq).getSequenceHeader());\n\t\t\tSystem.out.println(\"\\t getReadString: \" + ((FastqRecord) fastq).getSequenceString());\n\t\t\tSystem.out.println(\"\\t \thashCode: \" + ((FastqRecord) fastq).hashCode());\n\t\t\tSystem.out.println(\"\\t \tlength: \" + ((FastqRecord) fastq).getLength());\n\t\t\tSystem.out.println(\"------------------------------- \");\n\n\t\t}\n\t}", "public List<String> getAllProcessNamesFromDatabase() \r\n throws ServiceFailureException;", "List<ProcessDefinition> findByNameAndVersion(String name, int version);", "public double[] getQualityScores() {\n return null;\n }", "public double[] getQualityScores() {\n return null;\n }", "public DataRecord[] resetCurrentProcessList() throws ProcessManagerException {\r\n try {\r\n ProcessInstance[] processList = Workflow.getProcessInstanceManager()\r\n .getProcessInstances(peasId, currentUser, currentRole, getUserRoles());\r\n \r\n currentProcessList = getCurrentFilter().filter(processList, currentRole,\r\n getLanguage());\r\n } catch (WorkflowException e) {\r\n throw new ProcessManagerException(\"ProcessManagerSessionController\",\r\n \"processManager.ERR_GET_PROCESS_LIST\", peasId, e);\r\n }\r\n \r\n return currentProcessList;\r\n }", "@Test\r\n public void testDescribeProcessParsing() throws Exception {\r\n\r\n Object object;\r\n BufferedReader in = null;\r\n try {\r\n Configuration config = new WPSConfiguration();\r\n\r\n URL url;\r\n if (ONLINE) {\r\n url = new URL(\r\n \"http://schemas.opengis.net/wps/1.0.0/examples/40_wpsDescribeProcess_response.xml\");\r\n } else {\r\n url = TestData.url(this, \"referenceProcessDescriptions.xml\");\r\n }\r\n Parser parser = new Parser(config);\r\n in = new BufferedReader(new InputStreamReader(url.openStream()));\r\n object = parser.parse(in);\r\n\r\n ProcessDescriptionsType processDesc = (ProcessDescriptionsType) object;\r\n assertNotNull(processDesc);\r\n } finally {\r\n in.close();\r\n }\r\n }", "List<JModuleInfo> queryAll();", "public List getProcessIds()\r\n\t{\n\t\treturn null;\r\n\t}", "public List getResultSummaries(Query query)\n throws UnsupportedQueryException, IndexException, DocumentNotFoundException {\n List r = getResult(query);\n List result = new ArrayList();\n for (Object o : r) {\n ProbDoc pd = (ProbDoc) o;\n result.add(new XMLDoc(pd, getSummary(pd)));\n }\n return result;\n }", "public ProteomicAnalysis getProteomicAnalysis(int replicateNumber) {\r\n return analysis.get(replicateNumber);\r\n }", "List<ExamPackage> getListPresent();", "public abstract Process getProcess();", "public GetProcessQualityQuery getProcessQualityQuery(final GetProcessQualityQuery query) {\n\n\t\tprocessQualityRepository.findById(query.getId()).flatMap(ss -> Translator.translate(ss, query.getLanguage()))\n\t\t\t\t.ifPresent(query.getRead()::setData);\n\n\t\treturn query;\n\t}", "@Override\r\n public String[] getProcessList() {\n\r\n return new String[0];\r\n }", "public void showProcesses() {\n\t\tList<RunningAppProcessInfo> infos=am.getRunningAppProcesses();\n\t\tadapter.clear();\n\t\t\n\t\t\n\t\tProcessesListCellData data;\n\t\t\n\t\tfor (RunningAppProcessInfo info : infos) {\n\t\t\t\n\t\t\tdata=new ProcessesListCellData(this,info);\n\t\t\tif (data.appName!=null&&!data.appName.equals(\"\")) {\n\t\t\t\tadapter.addCellData(data);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tMemoryInfo memInfo=new MemoryInfo();\n\t\tam.getMemoryInfo(memInfo);\n\t\tsetTitle(\"进程管理器,可用内存:\"+memInfo.availMem/1024/1024+\"M\");\n\t}", "private void getBulkApiRecordsInfo(Date processStartDate, Date processEndDate, String objectName, boolean isManualProcess){\r\n\t\tLOGGER.trace(\"Entrando en getAllBulkApiInfo para obtener los registros actualizados en Salesforce\");\r\n\t\tLOGGER.info(\"Búsqueda desde \" + processStartDate + \", hasta \" + processEndDate);\r\n\t\tBulkApiInfoContainerBatch containerList = null;\r\n\t\tboolean processOk = false;\r\n\t\tString processErrorCause = \"\";\r\n\t\tHistoricBatchVO mainHistoricProcessInfo = new HistoricBatchVO();\r\n\t\ttry {\r\n\t\t\tStringBuilder historicMainProcessId = Utils.generateDateId();\r\n\t\t\tmainHistoricProcessInfo.setStartDate(new Date());\r\n \t\t\tmainHistoricProcessInfo.setOperation(ConstantesBatch.BATCH_MAIN_PROCESS);\r\n \t\t\tUserSessionInfo userInfo = Utils.getUserSessionInfoFromProperties();\r\n \t\t\tif (!Utils.isNullOrEmptyString(objectName)) {\r\n\t\t\t\t//0.1. Se rellenan los datos del proceso principal para cargarlos la tabla de historico\r\n \t\t\t\thistoricMainProcessId.append(\"-\").append(objectsMapper.getObjectNamesAbbreviationsMap().get(objectName));\r\n\t\t\t\tmainHistoricProcessInfo.setProcessId(historicMainProcessId.toString());\r\n\t\t\t\t//0.2. Se rellenan los datos del proceso de actualizacion de objetos para cargarlos a la tabla de historico\r\n\t\t\t\tHistoricBatchVO objectLoadingHistoricProcessInfo = new HistoricBatchVO();\r\n\t\t\t\tobjectLoadingHistoricProcessInfo.setProcessId(historicMainProcessId.toString());\r\n\t\t\t\tobjectLoadingHistoricProcessInfo.setStartDate(new Date());\r\n\t\t\t\tobjectLoadingHistoricProcessInfo.setOperation(ConstantesBatch.OBJECT_LOADING);\r\n\t\t\t\tobjectLoadingHistoricProcessInfo.setObject(objectsMapper.getObjectHistoricNamesMap().get(objectName));\r\n \t\t\t\t//1. Se realiza el login contra Salesforce REST API.\r\n\t\t\t\tuserInfo = salesforceLoginChecker.getUserSessionInfo(userInfo);\r\n\t\t\t\t//2. Se recorre el mapa de objetos para realizar las llamadas al API.\r\n\t\t\t\tcontainerList = getAllRecordsFromRestApi(objectName, objectsMapper.getObjectSelectsMap().get(objectName), processStartDate, processEndDate, userInfo.getSessionId(), historicMainProcessId.toString(), processStartDate);\r\n\t\t\t\t//3. Se envia el objeto al DAO para tratar la lista\r\n\t\t\t\tif (containerList != null) {\r\n\t\t\t\t\tif (containerList.getTotalRecords() > 0) {\r\n\t\t\t\t\t\tLOGGER.info(\"Recuperados \" + containerList.getTotalRecords() + \" registros del objeto \" + containerList.getEntityName());\r\n\t\t\t\t\t\tprocessOk = batchService.updateHerokuObjectsFromBulkApi(containerList, historicMainProcessId.toString());\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tLOGGER.info(\"No hay registros que actualizar para el objeto '\" + containerList.getEntityName() + \"'\");\t\t\t\t\t\t\r\n\t\t\t\t\t\tprocessOk = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tLOGGER.error(\"No hay datos de registros a cargar. No se realiza ninguna accion en base de datos\");\r\n\t\t\t\t\tprocessOk = false;\r\n\t\t\t\t\tprocessErrorCause = ConstantesBatch.ERROR_OBJECT_RECORDS_NULL;\r\n\t\t\t\t}\r\n\t\t\t\tobjectLoadingHistoricProcessInfo.setSuccess(processOk);\r\n\t\t\t\tobjectLoadingHistoricProcessInfo.setErrorCause(processOk ? null : processErrorCause);\r\n\t\t\t\tobjectLoadingHistoricProcessInfo.setEndDate(new Date());\r\n\t\t\t\thistoricBatchDao.insertHistoric(objectLoadingHistoricProcessInfo);\r\n\t\t\t} else if (objectsMapper.getObjectSelectsMap() != null && !objectsMapper.getObjectSelectsMap().isEmpty()) {\r\n\t\t\t\t//0. Se rellenan los datos del proceso para la tabla de historico\r\n \t\t\t\thistoricMainProcessId.append(\"-\").append(\"FULL\");\r\n\t\t\t\tmainHistoricProcessInfo.setProcessId(historicMainProcessId.toString());\r\n\t\t\t\tHistoricBatchVO objectLoadingHistoricProcessInfo = null;\r\n\t\t\t\t//1. Se realiza el login contra Salesforce REST API.\r\n\t\t\t\tuserInfo = salesforceLoginChecker.getUserSessionInfo(userInfo);\r\n\t\t\t\t//2. Se recorre el mapa de objetos para realizar las llamadas al API.\r\n\t\t\t\tMap<String, String> objectsMap = new LinkedHashMap<String, String>();\r\n\t\t\t\tobjectsMap.putAll(objectsMapper.getObjectSelectsMap());\r\n\t\t\t\tif (!isManualProcess) {\r\n\t\t\t\t\t//2.1 Si la llamada se realiza de manera programada, CaseComment y HerokuUser tienen su propia tarea\r\n\t\t\t\t\tobjectsMap.remove(ConstantesBulkApi.ENTITY_HEROKU_USER);\r\n\t\t\t\t\tobjectsMap.remove(ConstantesBulkApi.ENTITY_CASE_COMMENT);\r\n\t\t\t\t}\r\n\t\t\t\tIterator<Entry<String, String>> objectsIterator = objectsMap.entrySet().iterator();\r\n\t\t\t\twhile (objectsIterator.hasNext()) {\r\n\t\t\t\t\tEntry<String, String> object = objectsIterator.next();\r\n\t\t\t\t\t//0.2. Se rellenan los datos del proceso de actualizacion de objetos para cargarlos a la tabla de historico\r\n\t\t\t\t\tobjectLoadingHistoricProcessInfo = new HistoricBatchVO();\r\n\t\t\t\t\tobjectLoadingHistoricProcessInfo.setProcessId(historicMainProcessId.toString());\r\n\t\t\t\t\tobjectLoadingHistoricProcessInfo.setStartDate(new Date());\r\n\t\t\t\t\tobjectLoadingHistoricProcessInfo.setOperation(ConstantesBatch.OBJECT_LOADING);\r\n\t\t\t\t\tobjectLoadingHistoricProcessInfo.setObject(objectsMapper.getObjectHistoricNamesMap().get(object.getKey()));\r\n\t\t\t\t\t//3.1. No se recorren los objetos CaseComment y HerokuUser porque tienen su propio Job programado\r\n\t\t\t\t\tcontainerList = getAllRecordsFromRestApi(object.getKey(), object.getValue(), processStartDate, processEndDate, userInfo.getSessionId(), historicMainProcessId.toString(), processStartDate);\r\n\t\t\t\t\t//4. Se envia el objeto al DAO para tratar la lista\r\n\t\t\t\t\tif (containerList != null) {\r\n\t\t\t\t\t\tif (containerList.getTotalRecords() > 0) {\r\n\t\t\t\t\t\t\tLOGGER.info(\"Recuperados \" + containerList.getTotalRecords() + \" registros del objeto \" + containerList.getEntityName());\r\n\t\t\t\t\t\t\tprocessOk = batchService.updateHerokuObjectsFromBulkApi(containerList, historicMainProcessId.toString());\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tLOGGER.info(\"No hay registros que actualizar para el objeto '\" + containerList.getEntityName() + \"'\");\r\n\t\t\t\t\t\t\tprocessOk = true;\r\n\t\t\t\t\t\t\tprocessErrorCause = ConstantesBatch.ERROR_OBJECT_RECORDS_NULL;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tLOGGER.error(\"No hay datos de registros a cargar. No se realiza ninguna accion en base de datos\");\r\n\t\t\t\t\t\tprocessOk = false;\r\n\t\t\t\t\t\tprocessErrorCause = ConstantesBatch.ERROR_OBJECT_RECORDS_NULL;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tobjectLoadingHistoricProcessInfo.setSuccess(processOk);\r\n\t\t\t\t\tobjectLoadingHistoricProcessInfo.setErrorCause(processOk ? null : processErrorCause);\r\n\t\t\t\t\tobjectLoadingHistoricProcessInfo.setEndDate(new Date());\r\n\t\t\t\t\thistoricBatchDao.insertHistoric(objectLoadingHistoricProcessInfo);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tLOGGER.error(\"No hay datos de registros a cargar. No se realiza ninguna llamada\");\r\n\t\t\t\tprocessOk = true;\r\n\t\t\t}\r\n\t\t} catch (Exception exception) {\r\n\t\t\tLOGGER.error(\"Error realizando la carga de registros desde REST API: \", exception);\r\n\t\t\tprocessOk = false;\r\n\t\t\tprocessErrorCause = ConstantesBatch.ERROR_MAIN_PROCESS;\r\n\t\t}\r\n\t\tresultProccess=processOk;\r\n\t\tmainHistoricProcessInfo.setSuccess(processOk);\r\n\t\tmainHistoricProcessInfo.setErrorCause(processOk ? null : processErrorCause);\r\n\t\tmainHistoricProcessInfo.setEndDate(new Date());\r\n\t\thistoricBatchDao.insertHistoric(mainHistoricProcessInfo);\r\n\t}", "@Query(value = \"select distinct(p.*) from imp_processo as p \" +\n \"inner join imp_pro_etapa as i \" +\n \"on p.id=i.processo_id \" +\n \"where i.status='ABERTO' and p.finalizado=false\",nativeQuery = true)\n public List<ImplantacaoProcesso> processosAbertos();", "protected List<String> getChartCodes(boolean immediatesOnly, Date processRunDate) {\r\n List<String> output = new ArrayList<String>();\r\n\r\n Iterator<PaymentRequestDocument> paymentRequests = null;\r\n if (immediatesOnly) {\r\n paymentRequests = paymentRequestService.getImmediatePaymentRequestsToExtract(null).iterator();\r\n } else {\r\n java.sql.Date onOrBeforePaymentRequestPayDate = KfsDateUtils.convertToSqlDate(purapRunDateService.calculateRunDate(processRunDate));\r\n paymentRequests = paymentRequestService.getPaymentRequestsToExtract(onOrBeforePaymentRequestPayDate).iterator();\r\n }\r\n\r\n while (paymentRequests.hasNext()) {\r\n PaymentRequestDocument prd = paymentRequests.next();\r\n if (!output.contains(prd.getProcessingCampusCode())) {\r\n output.add(prd.getProcessingCampusCode());\r\n }\r\n }\r\n\r\n return output;\r\n }", "List<SrInwardTruckQualityCheck> getAll(Integer pageNumber, Integer pageSize);", "public Process getProcess(){\n\t\treturn p;\n\t}", "public List<Integer> getConIds(ConProcess conProcess) throws AppException;", "public Process getProcess() {\n return this.process;\n }", "public ProcessInfo getResult()\n\t{\n\t\treturn m_pi;\n\t}", "public static void readStreamOfProcess(final Process pr){\n\t\t readStreamInThread(pr.getInputStream(),false, pr);\n\t\t readStreamInThread(pr.getErrorStream(),true, pr);\n\t }", "public static IuaappDocProcesses getProcessForInterview(ActionContext ctx, IuaappDocProcessesDAO processDAO, ProcessInstance processIns) {\t\t\n\t\tif (isInterviewPlanName(processIns.getPlanName()))\n\t\t{\n\t\t\tIuaappDocProcesses process = processDAO.findById(new Long(processIns.getId()));\n\t\t\t\t\t\t\n\t\t\tString processType = process.getTypeCode();\n\t\t\t\n\t\t\tif ((process != null) && (isInterviewProcessTypeDB(processType)))\n\t\t\t{\n\t\t\t\tif (!isSubProcessTypeDB(processType))\n\t\t\t\t{\n\t\t\t\t\treturn process;\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\tprocess = processDAO.findById(new Long(processIns.getParentProcessId()));\n\t\t\t\t\t\n\t\t\t\t\tif (process != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tprocessType = process.getTypeCode();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (!isSubProcessTypeDB(processType))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn process;\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlog.debug(\"trying to get the last process in the hierarchy - doc decision --> interview common --> initial or follow up\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tProcessInstance parentProcessIns = findProcessInstance(ctx, processIns.getParentProcessId());\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (parentProcessIns != null)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tprocess = processDAO.findById(new Long(parentProcessIns.getParentProcessId()));\n\t\t\t\t\t\t\t\t\treturn process;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (Exception e)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlog.debug(\"Couldn't find process for interview\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t} \n\t\t} \n\n\t\treturn null;\n\t}", "public ArrayList<Integer> getAnalysisGeneral(){\n resultListGeneral = null ;\n positiveResultGeneral = 0;\n negativeResultGeneral = 0;\n neutralResultGeneral = 0;\n try {\n IndexReader reader = DirectoryReader.open(FSDirectory.open(Paths.get(\"indice/\")));\n this.resultListGeneral = new ArrayList<>();\n\n for (int i = 0; i < reader.numDocs(); i++) {\n Document doc = reader.document(i);\n\n if((doc.get(\"analysis\")).equals(\"Positive\"))\n positiveResultGeneral++;\n else if((doc.get(\"analysis\")).equals(\"Negative\"))\n negativeResultGeneral++;\n else if((doc.get(\"analysis\")).equals(\"Neutral\"))\n neutralResultGeneral++;\n }\n reader.close();\n }\n catch(IOException ioe){\n System.out.println(\"Error\");\n }\n resultListGeneral.add(positiveResultGeneral);\n resultListGeneral.add(negativeResultGeneral);\n resultListGeneral.add(neutralResultGeneral);\n\n return resultListGeneral;\n }", "@Override\r\n\tpublic List<PurchaseRequisition_itemInformation> selectPriList() {\n\t\treturn prim.selListPri();\r\n\t}", "public List<MCRContent> getAll() throws IOException, JDOMException, SAXException {\n\t\tList<MCRContent> resultsSet = new ArrayList<>();\n\t\t// build basic part of API URL\n\t\tString baseQueryURL = API_URL + \"/affiliation/AFFILIATION_ID:\" + AFFIL_ID + \"?apikey=\" + API_KEY\n\t\t\t\t+ \"&view=DOCUMENTS\";\n\n\t\t// divide API request in blocks a XXX documents (in final version 200\n\t\t// documents per block, number of blocks determined by total number of\n\t\t// documents)\n\t\t// int numberOfPublications = getNumberOfPublications(baseQueryURL);\n\t\t// at the moment only testing, two blocks a 10 documents\n\t\tfor (int i = 0; i < 2; i++) {\n\t\t\tint start = 10 * i;\n\t\t\tint count = 10;\n\n\t\t\t// build API URL\n\t\t\tString queryURL = baseQueryURL + \"&start=\" + start + \"&count=\" + count + \"&view=DOCUMENTS\";\n\n\t\t\t// add block to list of blocks\n\t\t\tresultsSet.add(getResponse(queryURL));\n\t\t}\n\t\t// return API-response\n\t\treturn resultsSet;\n\t}", "public void setProcessInstances(com.sforce.soap.enterprise.QueryResult processInstances) {\r\n this.processInstances = processInstances;\r\n }", "public Process getProcess() {\n \t\treturn process;\n \t}", "@Override\n\t\t\tpublic String getDescription() {\n\t\t\t\treturn \"*.pr1\";\n\t\t\t}", "public List<QueryDescriptor> getSystemQueries()\n {\n List<QueryDescriptor> queries = new ArrayList<QueryDescriptor>();\n Map<String, QueryDescriptor> Queries = ((DemoQueryModel) _queryModel).getQueries();\n Iterator keys = Queries.keySet().iterator();\n while (keys != null && keys.hasNext())\n {\n Object key = keys.next();\n QueryDescriptor qd = Queries.get(key);\n Object queryType = qd.getUIHints().get(QueryDescriptor.UIHINT_IMMUTABLE);\n\n // For SystemQueries, immutable is null or true\n if (queryType == null || queryType.equals(Boolean.TRUE))\n {\n queries.add(qd);\n }\n }\n\n return queries;\n }", "private String[] getProcessNames(Stream<ProcessHandle> processHandle) {\n List<Optional<String>> opReturns = new ArrayList<>();\n\n // sort through the process handles and add them to the opReturns list\n processHandle.forEach(process -> opReturns.add(process.info().command()));\n\n List<String> returns = new ArrayList<>();\n\n // stream the names from an Optional<String> list into an array\n opReturns.stream().map(OptionWrapper.pass(Optional<String>::get)).forEach(returns::add);\n\n return returns.toArray(new String[returns.size()]);\n }", "public List<ProcessInstance> getProcessInstances() {\r\n return this.processInstances;\r\n }", "int countByExample(BasicInfoPrecursorProcessTypeExample example);", "@RequestMapping(value = \"/_search/prlPayscaleBasicInfos/{query}\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public List<PrlPayscaleBasicInfo> searchPrlPayscaleBasicInfos(@PathVariable String query) {\n log.debug(\"REST request to search PrlPayscaleBasicInfos for query {}\", query);\n return StreamSupport\n .stream(prlPayscaleBasicInfoSearchRepository.search(queryStringQuery(query)).spliterator(), false)\n .collect(Collectors.toList());\n }", "@Override\n\t\t\t\t\tpublic String getDescription() {\n\t\t\t\t\t\treturn \"*.pr1\";\n\t\t\t\t\t}", "private ManufactureProcess getRunningManufactureProcess() {\n\t\tManufactureProcess result = null;\n\n\t\tint skillLevel = getEffectiveSkillLevel();\n\t\tIterator<ManufactureProcess> i = workshop.getProcesses().iterator();\n\t\twhile (i.hasNext() && (result == null)) {\n\t\t\tManufactureProcess process = i.next();\n\t\t\tif ((process.getInfo().getSkillLevelRequired() <= skillLevel) && (process.getWorkTimeRemaining() > 0D)) {\n\t\t\t\tresult = process;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}", "@java.lang.Override\n public com.google.cloud.aiplatform.v1.EvaluatedAnnotationExplanation getExplanations(int index) {\n return explanations_.get(index);\n }", "public QualityMeasures getQualityMeasures (int pos, String nFile) {\r\n return poblac.getMedidas(pos, nFile);\r\n }", "public Process getProcess() {\n\t\treturn process;\n\t}", "public String getProcessDescriptionId() {\r\n\t\treturn this.processDescriptionId;\r\n\t}", "public void getResults()\n\t{\n\t\tThread mOutReader = new Thread()\n\t\t{\n\t\t\tpublic void run()\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(mProcess.getInputStream()));\n\t\t\t\t\tString line = br.readLine();\n\t\t\t\t\twhile ((!isInterrupted() && line != null))\n\t\t\t\t\t{\n\t\t\t\t\t\tline = line.trim();\n\t\t\t\t\t\tmResults.add(line);\n\t\t\t\t\t\tline = br.readLine();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (InterruptedIOException e)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t//we will process the error stream just in case\n\t\tThread mErrReader = new Thread()\n\t\t{\n\t\t\tpublic void run()\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(mProcess.getErrorStream()));\n\t\t\t\t\tString line = br.readLine();\n\t\t\t\t\twhile ((!isInterrupted() && line != null))\n\t\t\t\t\t{\n\t\t\t\t\t\tline = line.trim();\n\t\t\t\t\t\tSystem.out.println(line);\n\t\t\t\t\t\tline = br.readLine();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (InterruptedIOException e)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tmOutReader.start();\n\t\tmErrReader.start();\n\n\t\t//wait for process to end.\n\t\ttry\n\t\t{\n\t\t\tmProcess.waitFor();\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.err.println(\"process exception\");\n\t\t}\n\t\tmFinished = true;\n\t}", "@ComputerMethod\n private Collection<QIOFrequency> getFrequencies() {\n return FrequencyType.QIO.getManagerWrapper().getPublicManager().getFrequencies();\n }", "@Transactional(Transactional.TxType.REQUIRES_NEW)\n public List<TaskDef> retrieveAll(Long task_process_id) {\n return TaskDefIntegrationService.list(task_process_id);\n }", "public static void getProcessService(AmsProcess receivedProcess) {\n\t\tboolean result = false;\n\t\tlong clientId = receivedProcess.getClientId();\n\t\tif (receivedProcess.getAmsProcessDetailsList().isEmpty()) {\n\t\t\t// case: when process list is empty\n\t\t\tresult = fetchProcessList(clientId);\n\t\t} else {\n\t\t\t// case: when process list is not empty\n\t\t\tresult = updateProcessList(receivedProcess.getAmsProcessDetailsList(), clientId);\n\t\t}\n\t\tif (result) {\n\t\t\tlog.info(\"Process response published to ams '\" + clientId + \"' successfully..\");\n\t\t} else {\n\t\t\tlog.info(\"Error in publishing processes to ams...\");\n\t\t}\n\t}", "@Override\n\tpublic List<PI> findAll() {\n\t\treturn null;\n\t}", "public abstract String[] getDescriptions();", "void showProcessList(TimelyResultProcessor resultProcessor);", "public ArrayList<Integer> getAnalysis(String Political)\n {\n resultList = null ;\n positiveResult = 0;\n negativeResult = 0;\n neutralResult = 0;\n try{\n IndexReader reader = DirectoryReader.open(FSDirectory.open(Paths.get(\"indice/\")));\n IndexSearcher searcher = new IndexSearcher(reader);\n Analyzer analyzer = new StandardAnalyzer();\n this.resultList = new ArrayList<>();\n QueryParser parser = new QueryParser(\"text\",analyzer);\n Query query = parser.parse(Political);\n TopDocs result = searcher.search(query,25000);\n ScoreDoc[] hits =result.scoreDocs;\n\n for (int i=0; i < hits.length; i++) {\n Document doc = searcher.doc(hits[i].doc);\n\n if((doc.get(\"analysis\")).equals(\"Positive\"))\n positiveResult++;\n else if((doc.get(\"analysis\")).equals(\"Negative\"))\n negativeResult++;\n else if((doc.get(\"analysis\")).equals(\"Neutral\"))\n neutralResult++;\n }\n reader.close();\n }\n catch(IOException | ParseException ex)\n {\n Logger.getLogger(Lucene.class.getName()).log(Level.SEVERE,null,ex);\n\n }\n resultList.add(positiveResult);\n resultList.add(negativeResult);\n resultList.add(neutralResult);\n\n return resultList;\n }", "@Override\n\tpublic List<WxActJiugonggePrizes> queryPrizes(String jwid) {\n\t\treturn (List)super.query(\"queryPrizes\",jwid);\n\t}", "public List<TASCProcessTO> getProcessCountList() throws Exception {\r\n\t\tConnection conn = null;\r\n\t\tPreparedStatement pstmt = null;\r\n\t\tResultSet rs = null;\r\n\t\tList<TASCProcessTO> processList = new ArrayList<TASCProcessTO>();\r\n\t\ttry {\r\n\t\t\tconn = BaseDAO.connect(DATA_SOURCE);\r\n\t\t\tTASCProcessTO processTO = null;\r\n\t\t\tString query = \"SELECT BB.D, NVL(PP.COUN, 0) AS COUN, NVL(OL.COUN, 0) AS COUN2, BB.c, NVL(ERR_COUNT.E, 0), NVL(COM_COUNT.S, 0) FROM \"+\r\n\t\t\t\t\t\t\t\" (SELECT TO_CHAR(DATETIMESTAMP, 'MM-DD-YYYY') AS D, COUNT(1) AS COUN FROM STG_PROCESS_STATUS where source_system = 'PP' GROUP BY TO_CHAR(DATETIMESTAMP, 'MM-DD-YYYY')) PP, \"+ \r\n\t\t\t\t\t\t\t\" (SELECT TO_CHAR(DATETIMESTAMP, 'MM-DD-YYYY') AS D, COUNT(1) AS COUN FROM STG_PROCESS_STATUS where source_system = 'OL' GROUP BY TO_CHAR(DATETIMESTAMP, 'MM-DD-YYYY')) OL, \"+\r\n\t\t\t\t\t\t\t\" (SELECT TO_CHAR(DATETIMESTAMP, 'MM-DD-YYYY') AS D,COUNT(1) AS E FROM STG_PROCESS_STATUS O WHERE (SELECT GETSTATUS(O.PROCESS_ID) FROM DUAL) = 'ER' GROUP BY TO_CHAR(DATETIMESTAMP, 'MM-DD-YYYY')) ERR_COUNT, \"+\r\n\t\t\t\t\t\t\t\" (SELECT TO_CHAR(DATETIMESTAMP, 'MM-DD-YYYY') AS D,COUNT(1) AS S FROM STG_PROCESS_STATUS O WHERE (SELECT GETSTATUS(O.PROCESS_ID) FROM DUAL) = 'CO' GROUP BY TO_CHAR(DATETIMESTAMP, 'MM-DD-YYYY')) COM_COUNT, \"+\r\n\t\t\t\t\t\t\t\" (SELECT TO_CHAR(TO_DATE(TO_CHAR((SELECT MIN(DATETIMESTAMP) FROM STG_PROCESS_STATUS),'MM-DD-YYYY'),'MM-DD-YYYY') - 1 + ROWNUM, 'MM-DD-YYYY') AS D , \"+\r\n\t\t\t\t\t\t\t \" TO_CHAR((SELECT MIN(DATETIMESTAMP) FROM STG_PROCESS_STATUS),'YYYY,MM,DD') as c \"+\r\n\t\t\t\t\t\t\t\t\" FROM ALL_OBJECTS WHERE TO_DATE(TO_CHAR((SELECT MIN(DATETIMESTAMP) FROM STG_PROCESS_STATUS),'MM-DD-YYYY'),'MM-DD-YYYY') - 1 + ROWNUM <= TO_DATE(TO_CHAR((SELECT MAX(DATETIMESTAMP) \"+ \r\n\t\t\t\t\t\t\t\t\" FROM STG_PROCESS_STATUS),'MM-DD-YYYY'), 'MM-DD-YYYY')) BB WHERE PP.D(+) = BB.D and OL.D(+) = BB.D AND ERR_COUNT.D(+) = BB.D AND COM_COUNT.D(+) = BB.D \"+\r\n\t\t\t\t\t\t\t\t\" and TO_DATE(BB.D, 'MM-DD-YYYY') >= to_date((TO_CHAR(SYSDATE-90, 'MM-DD-YYYY')), 'MM-DD-YYYY') ORDER BY BB.D\"; \r\n\t\t\tpstmt = conn.prepareCall(query);\r\n\t\t\trs = pstmt.executeQuery();\r\n\t\t\twhile(rs.next()) {\r\n\t\t\t\tprocessTO = new TASCProcessTO();\r\n\t\t\t\tprocessTO.setDateTimestamp(rs.getString(1));\r\n\t\t\t\tprocessTO.setPpCount(rs.getString(2));\r\n\t\t\t\tprocessTO.setOlCount(rs.getString(3));\r\n\t\t\t\tprocessTO.setDateTimestamp(rs.getString(4));\r\n\t\t\t\tprocessTO.setErCount(rs.getString(5));\r\n\t\t\t\tprocessTO.setCoCount(rs.getString(6));\r\n\t\t\t\tprocessList.add(processTO);\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tthrow new Exception(e.getMessage());\r\n\t\t} finally {\r\n\t\t\ttry {rs.close();} catch (Exception e2) {}\r\n\t\t\ttry {pstmt.close();} catch (Exception e2) {}\r\n\t\t\ttry {conn.close();} catch (Exception e2) {}\r\n\t\t}\r\n\t\treturn processList;\r\n\t}", "public String getProductProcess() {\n return productProcess;\n }", "public List<Promotion> getAllActivePromotions();", "Collection<? extends PM_Learning_Material> getHasRecommendation();", "public Collection<INetwork> getNetworks(IProcess process) {\n\t\treturn null;\n\t}", "public Process getProcess()\n {\n return proc;\n }", "@Override\n public int getProcessgetCapabilitie() {\n return 0;\n }", "public Queue<PCB> getProcesses() {\r\n\t\ttry {\r\n\t\t\treturn this.loadToJobQueue();\r\n\t\t\t\r\n\t\t} catch (FileNotFoundException e) {\r\n\r\n\t\t\tSystem.err.println(\"File not found!!\");\r\n\t\t}\r\n\t\treturn JobQueue;\r\n\t}", "public InternalResultsResponse<Beneficios> fetchBeneficiossByRequest(BeneficiosInquiryRequest request);", "@Override\n\tpublic List<ScienceAppExecute> findAll() throws SystemException {\n\t\treturn findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);\n\t}", "public static List<Apn> query(Context context) {\n String[] simCodes = getSimOperatorCodes(context);\n String[] networkCodes = getNetworkOperatorCodes(context);\n\n Set<Apn> resultSet = new HashSet<>();\n resultSet.addAll(query(context, simCodes[0], simCodes[1]));\n resultSet.addAll(query(context, networkCodes[0], networkCodes[1]));\n\n List<Apn> result = new ArrayList<>(resultSet.size());\n result.addAll(resultSet);\n return result;\n }", "public Set<ProductBarcode> getProducts();", "public List<Roi> getExamples(String classKey, String type);", "public List<PrizeType> getAllPrizeTypes() throws ContestManagementException {\n return null;\r\n }" ]
[ "0.545226", "0.5219416", "0.50527203", "0.49871767", "0.4986291", "0.49855196", "0.48375872", "0.48238724", "0.47938254", "0.47707912", "0.47327167", "0.47197288", "0.4708405", "0.4705847", "0.4701293", "0.46989882", "0.4678054", "0.46622238", "0.4638586", "0.4629722", "0.46262366", "0.4623961", "0.46106994", "0.46008876", "0.45981157", "0.45953506", "0.4540087", "0.4526874", "0.45196038", "0.45153132", "0.4509378", "0.45050952", "0.45011812", "0.44984695", "0.4491533", "0.44799644", "0.44726637", "0.44647068", "0.44647068", "0.4434758", "0.44139412", "0.44122303", "0.44106698", "0.43983757", "0.43907043", "0.43862677", "0.43840417", "0.43784875", "0.43764433", "0.4375514", "0.43711302", "0.43636832", "0.43512943", "0.43479273", "0.4339438", "0.43350795", "0.43221188", "0.43112567", "0.4297045", "0.42909613", "0.42895806", "0.42845416", "0.42712882", "0.42698637", "0.4265718", "0.4259111", "0.42576244", "0.42541513", "0.42456535", "0.42419678", "0.4241489", "0.42412147", "0.4229242", "0.42271277", "0.4226094", "0.42194283", "0.42177778", "0.42157474", "0.42022875", "0.41998604", "0.41946724", "0.4192401", "0.4191399", "0.41907707", "0.41811755", "0.41800994", "0.41771722", "0.4169044", "0.415455", "0.41529322", "0.4144936", "0.41395575", "0.41326043", "0.4132026", "0.41280094", "0.4120198", "0.41167125", "0.41162142", "0.41102776", "0.4107046" ]
0.5399973
1
Method to get a single process quality by id
public GetProcessQualityQuery getProcessQualityQuery(final GetProcessQualityQuery query) { processQualityRepository.findById(query.getId()).flatMap(ss -> Translator.translate(ss, query.getLanguage())) .ifPresent(query.getRead()::setData); return query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ConProcess getById(int id) throws AppException;", "Optional<SrInwardTruckQualityCheck> get(Integer id);", "public Process getProcessById(\r\n final UUID processId) {\r\n\r\n final UUID locationId = UUID.fromString(\"93878975-88c5-4e6a-8abb-7ddd77a8a7d8\"); //$NON-NLS-1$\r\n final ApiResourceVersion apiVersion = new ApiResourceVersion(\"2.1\"); //$NON-NLS-1$\r\n\r\n final Map<String, Object> routeValues = new HashMap<String, Object>();\r\n routeValues.put(\"processId\", processId); //$NON-NLS-1$\r\n\r\n final Object httpRequest = super.createRequest(HttpMethod.GET,\r\n locationId,\r\n routeValues,\r\n apiVersion,\r\n APPLICATION_JSON_TYPE);\r\n\r\n return super.sendRequest(httpRequest, Process.class);\r\n }", "public Producer getProducer(String id) {\n\n return (Producer) producers.get(id);\n }", "@Override\n public ClarifaiProcessDTO findOne(String id) {\n log.debug(\"Request to get ClarifaiProcess : {}\", id);\n ClarifaiProcess clarifaiProcess = clarifaiProcessRepository.findOne(id);\n return clarifaiProcessMapper.toDto(clarifaiProcess);\n }", "protected static Process getProcess(String workspaceId, String modelId,\n String processId) throws AnaplanAPIException {\n Model model = getModel(workspaceId, modelId);\n if (model == null) {\n return null;\n }\n if (processId == null || processId.isEmpty()) {\n LOG.error(\"A process ID, code or name must be provided\");\n }\n Process serverProcess = model.getProcess(processId);\n if (serverProcess == null) {\n LOG.error(\"Process \\\"{}\\\" not found in workspace {}, model {}\",\n processId, workspaceId, modelId);\n }\n return serverProcess;\n }", "public Optional<ProductSms> findOne(String id) {\n log.debug(\"Request to get ProductSms : {}\", id);\n return productSmsRepository.findById(id);\n }", "public Product findProduct(int id)\n {\n for(Product product : stock)\n {\n if(id == product.getID())\n {\n return product;\n }\n }\n System.out.println(\"Error: Could not find ID: \" + id);\n return null;\n }", "private ManufactureProcess getRunningManufactureProcess() {\n\t\tManufactureProcess result = null;\n\n\t\tint skillLevel = getEffectiveSkillLevel();\n\t\tIterator<ManufactureProcess> i = workshop.getProcesses().iterator();\n\t\twhile (i.hasNext() && (result == null)) {\n\t\t\tManufactureProcess process = i.next();\n\t\t\tif ((process.getInfo().getSkillLevelRequired() <= skillLevel) && (process.getWorkTimeRemaining() > 0D)) {\n\t\t\t\tresult = process;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}", "public CompletionStage<Result> thumbnail(Long id) {\n models.Preset preset = models.Preset.find.byId(id); // find preset\n if (preset != null) {\n return preset.getThumbnail();\n }\n return null;\n }", "@Override\r\n\tpublic Policy getById(Integer pid) {\n\t\tPolicy policy =dao.getById(pid);\r\n return policy;\r\n\t}", "public ProcessStep getProcessStepById(int processstepid) {\n\t\tthis.em = EMF.createEntityManager();\r\n\t\t\r\n\t\tList<ProcessStep> content = new ArrayList<ProcessStep>();\r\n\t\tQuery query = em.createQuery(Constants.PROCESSSTEP_ID);\r\n\t\tquery.setParameter(\"processstepid\", processstepid);\r\n\t\tcontent = query.getResultList();\r\n\t\tSystem.out.println(content.get(0));\r\n\t\treturn content.get(0);\r\n\r\n\t}", "MaximaProcess getProcess() {\r\n \t\trequestTimeHistory.add(System.currentTimeMillis());\r\n \r\n \t\t// Start a new one as we are going to take one...\r\n \t\tif (startupThrotle.availablePermits() > 0) {\r\n \t\t\tstartProcess();\r\n \t\t}\r\n \r\n \t\tMaximaProcess mp = null;\r\n \t\twhile (mp == null) {\r\n \t\t\ttry {\r\n \t\t\t\tmp = pool.take();\r\n \t\t\t} catch (InterruptedException e) {\r\n \t\t\t\t// If we failed to get one, wait a bit.\r\n \t\t\t\te.printStackTrace();\r\n \t\t\t\ttry {\r\n \t\t\t\t\tThread.sleep(3);\r\n \t\t\t\t} catch (InterruptedException ee) {\r\n \t\t\t\t\tee.printStackTrace();\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\tusedPool.add(mp);\r\n \t\tmp.activate();\r\n \r\n \t\treturn mp;\r\n \t}", "java.lang.String getQuality();", "public Product getProductFromId(Integer prodId) throws BackendException;", "Process getProcess();", "@RequestMapping(value = \"/producers/{id}\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public ResponseEntity<Producer> getProducer(@PathVariable Long id) {\n log.debug(\"REST request to get Producer : {}\", id);\n Producer producer = producerRepository.findOne(id);\n return Optional.ofNullable(producer)\n .map(result -> new ResponseEntity<>(\n result,\n HttpStatus.OK))\n .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));\n }", "public Spectrum getSpectrum(String id) {\n return get(id);\n }", "public PDDeviceNProcess getProcess() {\n/* 93 */ COSDictionary process = (COSDictionary)this.dictionary.getDictionaryObject(COSName.PROCESS);\n/* 94 */ if (process == null)\n/* */ {\n/* 96 */ return null;\n/* */ }\n/* 98 */ return new PDDeviceNProcess(process);\n/* */ }", "@Override\n\tpublic Product getProduct(@Min(value = 1, message = \"Invalid Product ID.\") long id) {\n\t\treturn productRepository.findById(id).orElseThrow(() -> new ResourceNotFoundException(\"Product not found\"));\n\t}", "Quality getQ();", "public Product getProductByID(String id) {\n String query = \"select * from Trungnxhe141261_Product\\n \"\r\n + \"where id=?\";\r\n try {\r\n conn = new DBContext().getConnection();//mo ket noi voi sql\r\n ps = conn.prepareStatement(query);\r\n ps.setString(1, id);\r\n rs = ps.executeQuery();\r\n while (rs.next()) {\r\n return new Product(rs.getInt(1),\r\n rs.getString(2),\r\n rs.getString(3),\r\n rs.getDouble(4),\r\n rs.getString(5),\r\n rs.getString(6));\r\n }\r\n } catch (Exception e) {\r\n }\r\n return null;\r\n }", "public PurchaseHistory getMinPriceFor(int PID, int quality){\n //TODO: implement this method\n String sql = \"SELECT \"+DBHelper.PURCHASEHISTORY_ID+\", min(\"+DBHelper.PURCHASEHISTORY_PRICE+\") FROM \" + DBHelper.TABLE_PURCHASEHISTORY + \" WHERE \" + DBHelper.PURCHASEHISTORY_PID + \"=\" + PID + \" GROUP BY \" + DBHelper.PURCHASEHISTORY_PID;\n SQLiteDatabase db = DBHelper.getReadableDatabase();\n Cursor c = db.rawQuery(sql, null);\n c.moveToFirst();\n if (!c.isAfterLast()) {\n int _id=c.getInt(c.getColumnIndex(\"_id\"));\n Log.d(DatabaseHelper.class.getName(), \"getMinPriceFor(\"+PID+\"):\" + _id + \",minprice:\"+c.getDouble(1));\n\n c = db.query(DBHelper.TABLE_PURCHASEHISTORY, null, DBHelper.PURCHASEHISTORY_ID+\"=\"+_id,null,null,null,null);\n c.moveToFirst();\n double price = c.getDouble(c.getColumnIndex(DBHelper.PURCHASEHISTORY_PRICE));\n String unit = c.getString(c.getColumnIndex(DBHelper.PURCHASEHISTORY_UNIT));\n String store = String.valueOf(c.getInt(c.getColumnIndex(DBHelper.PURCHASEHISTORY_SID)));\n String time = c.getString(c.getColumnIndex(DBHelper.PURCHASEHISTORY_DATE));\n\n db.close();\n store = getNameBySID(Integer.parseInt(store));\n return new PurchaseHistory(price, unit, store, time,_id);\n } else {\n return null;\n }\n }", "public abstract Process getProcess();", "String getPid();", "@Override\n @Transactional(readOnly = true)\n public Optional<CustomProcessDTO> findOne(Long id) {\n log.debug(\"Request to get CustomProcess : {}\", id);\n return customProcessRepository.findById(id)\n .map(customProcessMapper::toDto);\n }", "ICapability getCapabilityById( String id );", "public GrowthProfile getSpecificGrowthProfile(int id);", "Product getProductById(Integer productID);", "public abstract long getProcessID();", "@Override\n public Media getMediaById(int id) {\n try {\n return mediaDao.getMediaById(id);\n } catch (ObjectNotFoundException e) {\n throw new RuntimeException(String.format(\"Media instance with id=%s not found\", id));\n } catch (FailedOperationException e) {\n throw new RuntimeException(e.getMessage());\n }\n }", "public EscherRecord findFirstWithId(short id) {\n \treturn findFirstWithId(id, getEscherRecords());\n }", "public Integer getProcess(final String title) {\n\t\treturn getProcess(title, null);\n\t}", "private Process fetchProcessById(Integer id)\r\n\t{\r\n\t\tProcess process = (Process)doQueryForObject(getSqlSession(), FETCH_PROCESS_BY_ID, id);\r\n\r\n\t\tif (!ValidationUtil.isNull(process.getParentProcess())\r\n\t\t\t\t&& !ValidationUtil.isNullOrZero(process.getParentProcess().getId()))\r\n\t\t{\r\n\t\t\tprocess.setParentProcess(fetchProcessById(process.getParentProcess().getId()));\r\n\t\t}\r\n\r\n\t\treturn process;\r\n\t}", "@Override\n public Optional<Seq> getbyid(int id) {\n \tConnection conn = null;\n \tPreparedStatement pstmt=null;\n \tResultSet rs;\n \tSeq seq=null;\n ProcessesDAO pdao = new ProcessesDAO();\n \ttry {\n \t\tString url = \"jdbc:sqlite:src\\\\database\\\\AT2_Mobile.db\";\n \t\tconn = DriverManager.getConnection(url);\n\t \tpstmt = conn.prepareStatement(\n\t \t \"select * from seq where id =?\");\n\t \t \n\t \tpstmt.setInt(1,id); \n\t\n\t \trs = pstmt.executeQuery();\n\t \twhile (rs.next()) {\n\t \t\tseq = new Seq(rs.getInt(\"id\"), pdao.getbyidentifier(rs.getString(\"identifier\")), rs.getInt(\"seq_number\"));\n\t \t}\n\t \trs.close(); \n\t \tpstmt.close();\n\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n } finally {\n \ttry {\n if (conn != null) {\n conn.close();\n }\n } catch (SQLException ex) {\n System.out.println(ex.getMessage());\n }\n\n }\n return Optional.of(seq);\n }", "QualityControl getQualityControl(CallPeer peer);", "public float getQuality();", "@Override\r\n\tpublic Product findProductByPid(String pid) throws Exception {\n\t\treturn null;\r\n\t}", "public Product getProductWithId(int id) {\n for (Product s : products) {\n if (s.getId() == id) { return s;}\n }\n return null;\n }", "CafeProduct getProductById(final Integer productId);", "public Question getQuestion(String questionId) {\r\n Question[] questions = currentProcessInstance.getQuestions();\r\n Question foundQuestion = null;\r\n \r\n for (int i = 0; foundQuestion == null && i < questions.length; i++) {\r\n if (questions[i].getId().equals(questionId))\r\n foundQuestion = questions[i];\r\n }\r\n \r\n return foundQuestion;\r\n }", "public abstract MediaItem getMediaItem(String id);", "public Product getByID(int id) {\n if (!isValidID(id)) {\n System.out.println(\"Ese item no existe\");\n return null;\n }\n\n Product r = null;\n try {\n r = products[id].clone();\n } catch (CloneNotSupportedException e) {\n e.printStackTrace();\n }\n return r;\n }", "public Requisition getRequisitionByID(int requisitionID);", "public SpectrumMatch getSpectrumMatch(long id) {\r\n Integer index = id2index.get(id);\r\n return (index != null) ? spectrumMatches.get(id2index.get(id)) : null;\r\n }", "QualityScenario createQualityScenario();", "java.lang.String getProcessId();", "Optional<Job> findOne(String id);", "Product getProductByID(Long id);", "Product getProductById(Integer productId);", "Product getProductById(Integer productId);", "public MaliciousProcess analyzeProcess(int pID){\n\t\t\ttry {\n\t\t\t\tString execPath = getExecutablePath(pID);\n\t\t\t\treturn analyzeFile(execPath);\n\t\t\t} catch (IOException | InterruptedException e) {\n\t\t\t\treturn null;\n\t\t\t}\n\t}", "ProductPurchaseItem getProductPurchaseItemPerId(long sprcId);", "public int getR_Resolution_ID();", "@Override\n\tpublic RecordableRecord findRecordableRecordByPid(String id) {\n\t\treturn recordableRecordRepository.findRecordableRecordByPid(id);\n\t}", "public abstract void getPddPromotion(String pid, String goods_id, String user_channel_id);", "public SpectrumInterface getSpectrum(String spectrumId)\r\n\t{\r\n\t\tList<String> spectrumIds = new ArrayList<String>();\r\n\t\tspectrumIds.add(0, spectrumId);\r\n\t\t\r\n\t\t/*\r\n\t\t * Search for desired spectra.\r\n\t\t */\r\n\t\tList<SpectrumInterface> spectrumList = new ArrayList<SpectrumInterface>();\r\n\t\tspectrumList = fetchSpectrum(spectrumIds);\r\n\r\n\t\t/*\r\n\t\t * Return spectrum.\r\n\t\t */\r\n\t\treturn spectrumList.get(0);\r\n\t}", "public Device getById(String id) {\n\n try {\n return deviceRepository.findOne(id);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return null;\n }", "@GetMapping(\"/getCandidate/{id}\")\n\tpublic Optional<JobProcessDetails> getCandidate(@PathVariable Long id){\n\t\t\n\t\treturn jobProcessRepo.findById(id);\n\t\n\t}", "@Override\n\tpublic Material findById(Long id) {\n\t\treturn materialRepository.findById(id).get();\n\t}", "public Produit getProduit(int theId);", "public Product findById(int id) {\n\t\tProduct p = null;\n\t\ttry (Connection c = JdbcUtil.getConnection()) {\n\t\t\tPreparedStatement s = c.prepareStatement(\"select * from product where product_id=?\");\n\t\t\ts.setInt(1, id);\n\t\t\tResultSet rs = s.executeQuery(); // 0 or 1 row as primary key is compared here\n\t\t\tif (rs.next()) {// rs.next() : moves cursor to first row\n\t\t\t\tp = mapRow(rs);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn p;\n\t}", "String getProgramId();", "public int getQuality() {\n return quality;\n }", "public int getQuality() {\n return quality;\n }", "public int getQuality() {\n return quality;\n }", "public Recording getByID(String id) {\r\n if (id == null) {\r\n return null;\r\n }\r\n return recordingMap.get(id.toLowerCase());\r\n }", "public Product getProductInfo(int pid) {\nfor (ProductStockPair pair : productCatalog) {\nif (pair.product.id == pid) {\nreturn pair.product;\n}\n}\nreturn null;\n}", "public String getProcessID()\n {\n return processID;\n }", "public Integer getProgramId();", "@Override\n\tpublic Product findproduct(Integer id) {\n\t\t\n\t\tConnection conn=null;\n\t\tPreparedStatement pst=null;\n\t\tResultSet rs=null;\n\t\t Product product =null;\n\t\t\n\t\ttry {\n\t\t\tconn=DBUtils.getConnection();\n\t\t\tpst=conn.prepareStatement(\"select id,category_id,name,Subtitle,main_image,sub_images,detail,price,stock,status,create_time,update_time from product where id=?\");\n\t\t\tpst.setInt(1, id);\n\t\t\trs=pst.executeQuery();\n\t\t if(rs.next()) {\n\t\t \t product =new Product(rs.getInt(\"id\"),rs.getInt(\"category_id\"),rs.getString(\"name\"),rs.getString(\"Subtitle\"),rs.getString(\"main_image\"),rs.getString(\"sub_images\"),rs.getString(\"detail\"),rs.getBigDecimal(\"price\"),rs.getInt(\"stock\"),rs.getInt(\"status\"),rs.getDate(\"create_time\"),rs.getDate(\"update_time\"));\n\t\t \t\n\t\t \t \n\t\t } \n\t\t\t\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally {\n\t\t\ttry {\n\t\t\t\tDBUtils.Close(conn, pst, rs);\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\n\t\t\n\t\t\n\t\treturn product;\n\t}", "@Override\n public ProjectproductDTO findOne(String id) {\n log.debug(\"Request to get Projectproduct : {}\", id);\n Projectproduct projectproduct = projectproductRepository.findOne(UUID.fromString(id));\n ProjectproductDTO projectproductDTO = projectproductMapper.projectproductToProjectproductDTO(projectproduct);\n return projectproductDTO;\n }", "public Product findProductById(Integer id) {\n\t\treturn null;\n\t}", "public String getQuality()\n\t{\n\t\treturn quality.getText();\n\t}", "public Manufacturer findById(String id) {\n return manufacturerRepository.findById(id).orElse(null);\n }", "public ProductCompare getProductByID(String id) { //Must be int type because when saving to Session, it is still int\n String query = \"SELECT * FROM Product WHERE ProductID = ?\";\n try {\n ps = connection.prepareStatement(query);\n ps.setString(1, id);\n rs = ps.executeQuery();\n while (rs.next()) {\n return (new ProductCompare(rs.getInt(\"ProductID\"),\n rs.getString(\"ProductName\"), \n rs.getString(\"Description\"),\n rs.getInt(\"SellPrice\"), \n rs.getString(\"imageLink\"),\n rs.getFloat(\"height\"),\n rs.getFloat(\"width\"),\n rs.getFloat(\"weight\")\n ));\n }\n } catch (Exception e) {\n }\n return null;\n }", "@Transactional(readOnly = true)\n public Optional<ScriptParam> findOne(Long id) {\n log.debug(\"Request to get ScriptParam : {}\", id);\n return scriptParamRepository.findById(id);\n }", "public Pessoa find(Long id){\n\t\treturn db.findOne(id);\n\t}", "public Product selectProduct(long id) {\n return entityManager.find(Product.class, id);\n }", "public Profilo get( Integer id ) {\r\n\t\t//Recupero la sessione da Hibernate\r\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\t\t\r\n\t\t//Recupero il Profilo\r\n\t\tProfilo profilo = (Profilo) session.get(Profilo.class, id);\r\n\t\t\r\n\t\t//Restituisco il Profilo trovato\r\n\t\treturn profilo;\r\n\t}", "@Override\r\n\tOptional<Product> findById(String id);", "@Override\n\tpublic ProductGalleries cariProductImage(String id) {\n\t\treturn this.productGaleryRepository.findById(Long.parseLong(id)).get();\n\t}", "Chofer findOne(Long id);", "Product findById(long id);", "java.lang.String getQualityMax();", "public Mono<Supplements> findOne(String id) {\n log.debug(\"Request to get Supplements : {}\", id);\n return supplementsRepository.findById(id);\n }", "public Programa buscarPrograma(int id) throws Exception {\r\n\t\tEntityManager em = AdministradorEntityManager.getEntityManager();\r\n\t\treturn em.find(Programa.class, id);\r\n\t}", "Optional<EducationalModuleJobDTO> findOne(Long id);", "public Build getBuildById(int buildId);", "ProviderCommandRequest findOne(Long id);", "public Integer getPromId() {\n return promId;\n }", "public String getProId() {\n return proId;\n }", "private Process fetchProcessByRniId(String rniId)\r\n\t{\r\n\t\tProcess process = (Process)doQueryForObject(getSqlSession(), FETCH_PROCESS_BY_RNI_ID, rniId);\r\n\r\n\t\tif (ValidationUtil.isNull(process))\r\n\t\t{\r\n\t\t\treturn process;\r\n\t\t}\r\n\r\n\t\t// if a process was found, check parent\r\n\t\tif (!ValidationUtil.isNull(process.getParentProcess())\r\n\t\t\t\t&& !ValidationUtil.isNullOrZero(process.getParentProcess().getId()))\r\n\t\t{\r\n\t\t\tprocess.setParentProcess(this.fetchProcessById(process.getParentProcess()\r\n\t\t\t\t\t.getId()));\r\n\t\t}\r\n\r\n\t\treturn process;\r\n\t}", "public Question getQuestionbyId(int sid,int qid);", "@Override\n @Transactional(readOnly = true)\n public Optional<Square> findOne(Long id) {\n log.debug(\"Request to get Square : {}\", id);\n return squareRepository.findById(id);\n }", "@GetMapping(\"projekat/{id}\")\n\tprivate Projekat getProjekat(@PathVariable(\"id\") Integer id) {\n\t\treturn projekatRepository.getOne(id);\n\t}", "@Override\n\tpublic Product findOne(int a) {\n\t\tProduct p = productRepository.findOne(a);\n\t\treturn p;\n\t}", "@Transactional(readOnly = true)\n public Optional<ItemInstance> findOne(Long id) {\n log.debug(\"Request to get ItemInstance : {}\", id);\n return itemInstanceRepository.findById(id);\n }", "public Karton findOne(Integer id) {\n\t\treturn kartonRepository.findById(id).orElseGet(null);\n\t}", "public Product get(String id);" ]
[ "0.66140753", "0.6110878", "0.5943564", "0.5938577", "0.5772981", "0.5482574", "0.54232097", "0.5415164", "0.53867143", "0.5383599", "0.53738636", "0.5372281", "0.5366297", "0.53460294", "0.5339867", "0.5295785", "0.52559775", "0.5252849", "0.5252821", "0.5242126", "0.52303684", "0.522766", "0.52158034", "0.52137697", "0.5203946", "0.5189893", "0.5173453", "0.5163203", "0.51500374", "0.5145439", "0.51442593", "0.51433206", "0.51417553", "0.51390076", "0.51353943", "0.5126522", "0.51246303", "0.5122877", "0.5119211", "0.511758", "0.51140285", "0.5108697", "0.51069313", "0.5089984", "0.50795746", "0.5074193", "0.5073175", "0.5060533", "0.5059837", "0.5055559", "0.5055559", "0.50489444", "0.504775", "0.5044248", "0.5042654", "0.5034404", "0.50254214", "0.50211936", "0.5015379", "0.50022584", "0.4997652", "0.4996273", "0.49933413", "0.4991977", "0.4991977", "0.4991977", "0.49900544", "0.49867767", "0.49849713", "0.4980587", "0.49744633", "0.4973322", "0.49692687", "0.49435914", "0.4938077", "0.49371508", "0.49356467", "0.4930983", "0.4927863", "0.4925921", "0.49231857", "0.49209908", "0.4917928", "0.4914086", "0.49074256", "0.489335", "0.4891721", "0.48903757", "0.4887739", "0.48826033", "0.48824367", "0.48821542", "0.4875955", "0.48759365", "0.4874342", "0.4868817", "0.48604855", "0.48593205", "0.48584604", "0.48564014" ]
0.5499888
5
Apply a method to the files under a given directory and perhaps its subdirectories.
public static void processPath(String pathStr, String suffix, boolean recursively, FileProcessor processor) { processPath(new File(pathStr), new ExtensionFileFilter(suffix, recursively), processor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void processDirectory(File directory) {\n FlatFileProcessor processor = new FlatFileProcessor(directory);\n processor.processDirectory();\n }", "public static void listOfFiles(File dirPath){\n\t\tFile filesList[] = dirPath.listFiles();\r\n \r\n\t\t// For loop on each item in array \r\n for(File file : filesList) {\r\n if(file.isFile()) {\r\n System.out.println(file.getName());\r\n } else {\r\n \t // Run the method on each nested folder\r\n \t listOfFiles(file);\r\n }\r\n }\r\n }", "public void getSourceJavaFilesForOneRepository(File dir, FilenameFilter searchSuffix, ArrayList<File> al) {\n\n\t\tFile[] files = dir.listFiles();\t\t\n\t\tfor(File f : files) {\n\t\t\tString lowercaseName = f.getName().toLowerCase();\n\t\t\tif(lowercaseName.indexOf(\"test\")!=-1)\n\t\t\t{\n\t\t\t\t/* we do not consider test files in our study */\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t if(f.isDirectory()){\n\t\t\t\t /* iterate over every directory */\n\t\t\t\t getSourceJavaFilesForOneRepository(f, searchSuffix, al);\t\t\n\t\t\t } else {\n\t\t\t\t /* returns the desired java files */\n\t\t\t\t if(searchSuffix.accept(dir, f.getName())){\n\t\t\t\t\t al.add(f);\n\t\t\t\t }\n\t\t\t }\n\t\t\t}\n\t\t}\n\t}", "public static void processDirectory(String directory) {\n processDirectory(new File(directory));\n }", "static void find(final File current,\n final Histogram class_use,\n final Histogram method_use) {\n if (current.isDirectory()) {\n for (File child:current.listFiles()){\n find(child, class_use, method_use);\n }\n } else if (current.isFile()) {\n String name = current.toString();\n if ( name.endsWith(\".zip\")\n || name.endsWith(\".jar\")\n || name.endsWith(\".rar\") // weird use of rar for zip, but ... used in case study.\n || name.endsWith(\".war\")\n ) {\n processZip(current, class_use, method_use);\n } else if (name.endsWith(\".class\")) {\n processClass(current, class_use, method_use);\n }\n } else {\n TextIo.error(\"While processing file `\" + current + \"` an error occurred.\");\n }\n }", "AntiIterator<FsPath> listFilesAndDirectories(FsPath dir);", "public void serveFilesFromDirectory(File directory) {\n serveFilesFromDirectory(directory.getPath());\n }", "private ArrayList<char[]> subdirectoriesToFiles(String inputDir, ArrayList<char[]> fullFileList) throws IOException {\n\t\tArrayList<char[]> currentList =\n\t\t\t\tnew ArrayList<char[]>(Arrays.asList(new File(inputDir).listFiles()));\n\t\t\n\t\tfor (File file: currentList) {\n\t\t\tif (isJavaFile(file)) \n\t\t\t\tfullFileList.add(file);\n\t\t\t\n\t\t\telse if (file.isDirectory())\n\t\t\t\tsubdirectoriesToFiles(file.getPath(), fullFileList);\n\t\t\t\n\t\t\telse if (isJarFile(file))\n\t\t\t\tsubdirectoriesToFiles(jarToFile(file), fullFileList);\n\t\t}\n\t\treturn fullFileList;\n\t}", "public void process(File path) throws IOException {\n\t\tIterator<File> files = Arrays.asList(path.listFiles()).iterator();\n\t\twhile (files.hasNext()) {\n\t\t\tFile f = files.next();\n\t\t\tif (f.isDirectory()) {\n\t\t\t\tprocess(f);\n\t\t\t} else {\n\t\t\t\tif (startFile != null && startFile.equals(f.getName())) {\n\t\t\t\t\tstartFile = null;\n\t\t\t\t}\n\n\t\t\t\tif (startFile == null) {\n\t\t\t\t\tprocessFile(f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void directorySearch(File dir, String target)\n\t{\n\t\tif(!(dir.isDirectory()))\n\t\t{\n\t\t\t//If file is not a directory, throw the exception.\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tif(count == maxFiles)\n\t\t{\n\t\t\t//If count is equal to maxFiles, throw the exception.\n\t\t\t//If it doesn't then this will act as a base case to\n\t\t\t//the recursion. \n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\t\n\t\ttry\n\t\t{\n\t\t\t//Put all the sub directories in an array. \n\t\t\tFile[] file = dir.listFiles();\n\t\t\t\n\t\t\t//Print out the path and the file directory list \n\t\t\tSystem.out.println(dir.getPath() + \": \" + dir.listFiles());\n\t\t\t\n\t\t\t//Go through each of the file length\n\t\t\tfor(int i = 0; i < file.length; i++)\n\t\t\t{\n\t\t\t\t//Get the file name \n\t\t\t\tSystem.out.println(\" -- \" + file[i].getName());\n\t\t\t\t\n\t\t\t\t//If the file name is the target, then add it to the \n\t\t\t\t//stack and return\n\t\t\t\tif(file[i].getName().equals(target))\n\t\t\t\t{\n\t\t\t\t\t//If the item inside the file is the target.\n\t\t\t\t\tcount++;\n\t\t\t\t\tfileList.add(file[i].getPath());\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t//If its a directory, then recurse.\n\t\t\t\tif(file[i].isDirectory())\n\t\t\t\t{\n\t\t\t\t\tdirectorySearch(file[i], target);\n\t\t\t\t}\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tcatch (NullPointerException e)\n\t\t{\n\t\t\t//If the File[] is null then catch this exception.\n\t\t\treturn;\n\t\t}\n\t}", "String transcribeFilesInDirectory(String directoryPath);", "private static void buildDir (File dir) \n\t\tthrows Exception\n\t{\n\t\tFile[] contents = dir.listFiles();\n\t\tfor (int i = 0; i < contents.length; i++) {\n\t\t\tFile file = contents[i];\n\t\t\tif (file.isDirectory()) {\n\t\t\t\tbuildDir(file);\n\t\t\t} else if (file.getName().endsWith(\".xml\")) {\n\t\t\t\tbuildFile(file);\n\t\t\t}\n\t\t}\n\t}", "private static List<File> listChildFiles(File dir) throws IOException {\n\t\t List<File> allFiles = new ArrayList<File>();\n\t\t \n\t\t File[] childFiles = dir.listFiles();\n\t\t for (File file : childFiles) {\n\t\t if (file.isFile()) {\n\t\t allFiles.add(file);\n\t\t } else {\n\t\t List<File> files = listChildFiles(file);\n\t\t allFiles.addAll(files);\n\t\t }\n\t\t }\n\t\t return allFiles;\n\t\t }", "private void getAllFiles(File dir, List<File> fileList) throws IOException {\r\n File[] files = dir.listFiles();\r\n if(files != null){\r\n for (File file : files) {\r\n // Do not add the directories that we need to skip\r\n if(!isDirectoryToSkip(file.getName())){\r\n fileList.add(file);\r\n if (file.isDirectory()) {\r\n getAllFiles(file, fileList);\r\n }\r\n }\r\n }\r\n }\r\n }", "private void scanDirectory(final File directory) throws AnalyzerException {\n\t\tFile[] files = directory.listFiles();\n\t\tfor (File f : files) {\n\t\t\t// scan .class file\n\t\t\tif (f.isFile() && f.getName().toLowerCase().endsWith(\".class\")) {\n\t\t\t\tInputStream is = null;\n\t\t\t\ttry {\n\t\t\t\t\tis = new FileInputStream(f);\n\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\tthrow new AnalyzerException(\n\t\t\t\t\t\t\t\"Cannot read input stream from '\"\n\t\t\t\t\t\t\t\t\t+ f.getAbsolutePath() + \"'.\", e);\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tnew ClassReader(is).accept(scanVisitor,\n\t\t\t\t\t\t\tClassReader.SKIP_CODE);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tthrow new AnalyzerException(\n\t\t\t\t\t\t\t\"Cannot launch class visitor on the file '\"\n\t\t\t\t\t\t\t\t\t+ f.getAbsolutePath() + \"'.\", e);\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tis.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new AnalyzerException(\n\t\t\t\t\t\t\t\"Cannot close input stream on the file '\"\n\t\t\t\t\t\t\t\t\t+ f.getAbsolutePath() + \"'.\", e);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// loop on childs\n\t\t\t\tif (f.isDirectory()) {\n\t\t\t\t\tscanDirectory(f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private static Collection<File> listFiles(File directory, FilenameFilter filter, boolean recurse) {\n\t\tVector<File> files = new Vector<File>();\n\t\tFile[] entries = directory.listFiles();\n\n\t\tfor (File entry : entries) {\n\t\t\tif (filter == null || filter.accept(directory, entry.getName()))\n\t\t\t\tfiles.add(entry);\n\t\t\tif (recurse && entry.isDirectory())\n\t\t\t\tfiles.addAll(listFiles(entry, filter, recurse));\n\t\t}\n\t\treturn files;\n\t}", "private static void rAddFilesToArray(File workingDirectory, ArrayList<File> result) {\n File[] fileList = workingDirectory.listFiles();\n if (fileList == null) return;\n for (File file : fileList) {\n String name = file.getName();\n int lastDotIndex = name.lastIndexOf('.');\n String ext = (lastDotIndex == -1) ? \"\" : name.substring(lastDotIndex + 1);\n if (file.isDirectory())\n rAddFilesToArray(file, result);\n if (!file.equals(remainderFile) && ext.equals(\"xml\")) {\n result.add(file);\n }\n }\n }", "private static void processRepository(File repo) {\n System.out.println(\"Processing repository: \" + repo);\n for (File fileOrDir : repo.listFiles()) {\n if (fileOrDir.isDirectory()) {\n processModule(fileOrDir);\n }\n }\n }", "public void parseFile(File dir) {\r\n\t\tFile[] files = dir.listFiles();\r\n\t\tfor(int i = 0; i < files.length; i++) {\r\n\t\t\tif(files[i].isDirectory()) {\r\n\t\t\t\tparseFile(files[i]);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif(!files[i].exists()) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tString fileName = files[i].getName();\r\n\t\t\t\tif(fileName.toLowerCase().endsWith(\".json\")) {\r\n\t\t\t\t\twq.execute(new Worker(library, files[i]));\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "static Stream<File> allFilesIn(File folder) \r\n\t{\r\n\t\tFile[] children = folder.listFiles();\r\n\t\tStream<File> descendants = Arrays.stream(children).filter(File::isDirectory).flatMap(Program::allFilesIn);\r\n\t\treturn Stream.concat(descendants, Arrays.stream(children).filter(File::isFile));\r\n\t}", "public static void processPath(File path, FileFilter filter, FileProcessor processor) {\r\n if (path.isDirectory()) {\r\n // if path is a directory, look into it\r\n File[] directoryListing = path.listFiles(filter);\r\n if (directoryListing == null) {\r\n throw new IllegalArgumentException(\"Directory access problem for: \" + path);\r\n }\r\n for (File file : directoryListing) {\r\n processPath(file, filter, processor);\r\n }\r\n } else {\r\n // it's already passed the filter or was uniquely specified\r\n // if (filter.accept(path))\r\n processor.processFile(path);\r\n }\r\n }", "abstract protected void execute(String dir);", "public static void goThroughFilesForFolder(final File folder) throws Exception {\r\n\r\n\t\t/*\r\n\t\t * char[] filePath;\r\n\t\t// *Files.walk(Paths.get(\"E:/Studying/eclipse/workspace/Thesis/PMIDs\")).\r\n\t\t * Files.walk(Paths.get(\"E:/Studying/Box Sync/workspace/Thesis/PMIDs\")).\r\n\t\t * forEach(filePath -> { if (Files.isRegularFile(filePath)) {\r\n\t\t * System.out.println(filePath); } }\r\n\t\t */\r\n\t\t// /*\r\n\t\tfor (final File fileEntry : folder.listFiles()) {\r\n\t\t\tif (fileEntry.isDirectory()) {\r\n\t\t\t\tgoThroughFilesForFolder(fileEntry);\r\n\t\t\t} else {\r\n\t\t\t\tprocessFile(fileEntry);\r\n\t\t\t\t// System.out.println(fileEntry.getName());\r\n\t\t\t}\r\n\t\t}\r\n\t\t// */\r\n\t}", "protected static Enumeration applyFilter(Stack stackDirs, FileFilter filter)\n {\n Vector vectFiles = new Vector();\n\n while (!stackDirs.isEmpty())\n {\n File dir = (File) stackDirs.pop();\n if (!dir.isDirectory())\n {\n throw new IllegalArgumentException(\"Illegal directory: \\\"\" + dir.getPath() + \"\\\"\");\n }\n\n File[] aFiles = dir.listFiles(filter);\n int cFiles = aFiles.length;\n for (int i = 0; i < cFiles; ++i)\n {\n vectFiles.addElement(aFiles[i]);\n }\n }\n\n return vectFiles.elements();\n }", "public void parseDirectory(File directory) throws IOException {\n this.parsedFiles.clear();\n File[] contents = directory.listFiles();\n for (File file : contents) {\n if (file.isFile() && file.canRead() && file.canWrite()) {\n String fileName = file.getPath();\n if (fileName.endsWith(\".html\")) {\n Document parsed;\n parsed = Jsoup.parse(file, \"UTF-8\");\n if (this.isWhiteBearArticle(parsed)) {\n HTMLFile newParsedFile = new HTMLFile(parsed, false);\n String name = file.getName();\n this.parsedFiles.put(name, newParsedFile);\n } else if (this.isMenuPage(parsed)) {\n //HTMLFile newParsedFile = new HTMLFile(parsed, false);\n //String name = file.getName();\n //this.parsedFiles.put(name, newParsedFile);\n }\n }\n }\n }\n }", "public static void traversal(File root, FileFilter filter, Action<File> action) {\n if (root == null || !root.exists() || !filter.accept(root)) return;\n if (root.isDirectory()) {\n final File[] files = root.listFiles();\n if (files != null) {\n for (File file : files) {\n traversal(file, filter, action);\n }\n }\n } else {\n action.call(root);\n }\n }", "@Override\n\t\t\tpublic FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {\n\t\t\t\tPath resolve = target.resolve(source.relativize(dir));\n\t\t\t\tFile resolve_file = resolve.toFile();\n\n\t\t\t\tif (resolve_file.exists() == false) {\n\t\t\t\t\tFiles.createDirectory(resolve);\n\t\t\t\t} else {\n\t\t\t\t\t// delete old data in sub-directories\n\t\t\t\t\t// without deleting the directory\n\t\t\t\t\tArrays.asList(resolve_file.listFiles()).forEach(File::delete);\n\t\t\t\t}\n\t\t\t\treturn FileVisitResult.CONTINUE;\n\t\t\t}", "private void recurseOverFolder(final File folder) {\n File[] files = folder.listFiles();\n if (files == null) {\n return;\n }\n\n // Check each path and recurse if it's a folder, handle if it's a file\n for (final File fileEntry : files) {\n if (fileEntry.isDirectory()) {\n recurseOverFolder(fileEntry);\n } else {\n handleFile(fileEntry);\n }\n }\n }", "@Override\r\n\tpublic String globFilesDirectories(String[] args) {\r\n\t\treturn globHelper(args);\r\n\t}", "private void fillAllImagesUnderDirectory(File directory) throws IOException {\n // get the list of all files (including directories) in the directory of interest\n File[] fileArray = directory.listFiles();\n assert fileArray != null;\n\n for (File file : fileArray) {\n // if the file is an image, then add it\n if (isImage(file)) {\n ImageFile imageFile = new ImageFile(file.getAbsolutePath());\n // if the image is already saved, reuse it\n if (centralController.getImageFileController().hasImageFile(imageFile)) {\n allImagesUnderDirectory\n .add(centralController.getImageFileController().getImageFile(imageFile));\n } else if (imagesInDirectory.contains(imageFile)) {\n allImagesUnderDirectory.add(imagesInDirectory.get(imagesInDirectory.indexOf(imageFile)));\n } else {\n allImagesUnderDirectory.add(imageFile);\n }\n } else if (file.isDirectory()) {\n fillAllImagesUnderDirectory(file);\n }\n }\n }", "public static List<File> listFilesRecurse(File dir, FileFilter filter) {\n\t\treturn listFileRecurse(new ArrayList<File>(), dir, filter);\n\t}", "public static List<File> listFilesRecurse(File dir, FilenameFilter filter) {\n\t\treturn listFileRecurse(new ArrayList<File>(), dir, filter);\n\t}", "public ScanResult getFilesRecursively() {\n\n final ScanResult scanResult = new ScanResult();\n try {\n Files.walkFileTree(this.basePath, new SimpleFileVisitor<Path>() {\n @Override\n public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n if (!attrs.isDirectory() && PICTURE_MATCHER.accept(file.toFile())) {\n scanResult.addEntry(convert(file));\n System.out.println(file.toFile());\n }\n return FileVisitResult.CONTINUE;\n }\n });\n } catch (IOException e) {\n // intentional fallthrough\n }\n\n return new ScanResult();\n }", "List<File> list(String directory) throws FindException;", "@Override\n public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) throws IOException {\n if(!matcher.matches(path.getFileName()) ||\n Math.abs(path.getFileName().hashCode() % DirectoryScanner.NUM_THREADS) != num) {\n return FileVisitResult.CONTINUE;\n }\n\n logStream.println(\"Visiting file: \" + root.relativize(path));\n\n Path dest = outRoot.resolve(root.relativize(path));\n\n //moving is faster than copying and deleting\n if(autoDelete) {\n Files.move(path, dest, StandardCopyOption.REPLACE_EXISTING);\n } else {\n Files.copy(path, dest, StandardCopyOption.REPLACE_EXISTING);\n }\n\n\n return FileVisitResult.CONTINUE;\n }", "@Override\n\tpublic void run() {\n\t\tif (!mainDir.isDirectory()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// inserisco il nome della cartella principale.\n\t\tproduceDirPath(mainDir.getName());\n\t\t\n\t\t// navigo ricorsivamente.\n\t\twalkDir(mainDir);\n\t}", "private static void getFiles(String root, Vector files) {\n Location f = new Location(root);\n String[] subs = f.list();\n if (subs == null) subs = new String[0];\n Arrays.sort(subs);\n \n // make sure that if a config file exists, it is first on the list\n for (int i=0; i<subs.length; i++) {\n if (subs[i].endsWith(\".bioformats\") && i != 0) {\n String tmp = subs[0];\n subs[0] = subs[i];\n subs[i] = tmp;\n break;\n }\n }\n \n if (subs == null) {\n LogTools.println(\"Invalid directory: \" + root);\n return;\n }\n \n ImageReader ir = new ImageReader();\n Vector similarFiles = new Vector();\n \n for (int i=0; i<subs.length; i++) {\n LogTools.println(\"Checking file \" + subs[i]);\n subs[i] = new Location(root, subs[i]).getAbsolutePath();\n if (isBadFile(subs[i]) || similarFiles.contains(subs[i])) {\n LogTools.println(subs[i] + \" is a bad file\");\n String[] matching = new FilePattern(subs[i]).getFiles();\n for (int j=0; j<matching.length; j++) {\n similarFiles.add(new Location(root, matching[j]).getAbsolutePath());\n }\n continue;\n }\n Location file = new Location(subs[i]);\n \n if (file.isDirectory()) getFiles(subs[i], files);\n else if (file.getName().equals(\".bioformats\")) {\n // special config file for the test suite\n configFiles.add(file.getAbsolutePath());\n }\n else {\n if (ir.isThisType(subs[i])) {\n LogTools.println(\"Adding \" + subs[i]);\n files.add(file.getAbsolutePath());\n }\n else LogTools.println(subs[i] + \" has invalid type\");\n }\n file = null;\n }\n }", "static void bulkConvert(File folder, File destination)\n {\n if (folder == null)\n throw new IllegalArgumentException(\"folder cannot be null\");\n if (!folder.isDirectory())\n throw new IllegalArgumentException(\"folder is not a directory\");\n\n for (File f : folder.listFiles()) {\n if (f.isDirectory()) {\n bulkConvert(f, destination);\n continue;\n }\n\n String extension = f.getName().split(\"\\\\.\")[1];\n\n if (extension.toUpperCase().equals(\"DLIS\"))\n readFromDLIS(f, destination.getPath());\n else if (extension.toUpperCase().equals(\"LIS\"))\n readFromLIS(f, destination.getPath());\n else if (extension.toUpperCase().equals(\"LAS\"))\n readFromLAS(f, destination.getPath());\n }\n }", "@Override\n public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {\n if (!this.sourceDirectory.equals(dir)) {\n this.currentTargetDirectory = this.currentTargetDirectory.getParent();\n }\n return FileVisitResult.CONTINUE;\n }", "private void getAllJarFiles(File dir, ArrayList fileList)\n\t{\n\t\tif (dir.exists() && dir.isDirectory())\n\t\t{\n\t\t\tFile[] files = dir.listFiles();\n\t\t\tif (files == null)\n\t\t\t\treturn;\n\n\t\t\tfor (int i = 0; i < files.length; i++)\n\t\t\t{\n\t\t\t\tFile file = files[i];\n\t\t\t\tif (file.isFile())\n\t\t\t\t{\n\t\t\t\t\tif (file.getName().endsWith(\".jar\")) //$NON-NLS-1$\n\t\t\t\t\t\tfileList.add(file);\n\t\t\t\t}\n\t\t\t\telse if (file.isDirectory())\n\t\t\t\t{\n\t\t\t\t\tgetAllJarFiles(file, fileList);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void updateFiles() {\n\t}", "public static List<Path> getPackageFiles(\n Path directory, boolean recursive, Map<String, Documentation> pkgDocs)\n throws IOException, ShadowException {\n try (DirectoryStream<Path> stream = Files.newDirectoryStream(directory)) {\n List<Path> files = new ArrayList<>();\n\n for (Path filePath : stream) {\n // Capture all source files\n if (filePath.toString().endsWith(SRC_EXTENSION)) files.add(filePath);\n // Capture any package-info files\n else if (filePath.getFileName().toString().equals(PKG_INFO_FILE))\n processPackageInfo(filePath, pkgDocs);\n // Recurse into subdirectories if desired\n else if (recursive && Files.isDirectory(filePath))\n files.addAll(getPackageFiles(filePath, true, pkgDocs));\n }\n return files;\n }\n }", "private void addStyles(String dir, boolean recurse) {\n File dirF = new File(dir);\n if (dirF.isDirectory()) {\n File[] files = dirF.listFiles();\n for (File file : files) {\n // If the file looks like a style file, parse it:\n if (!file.isDirectory() && (file.getName().endsWith(StyleSelectDialog.STYLE_FILE_EXTENSION))) {\n addSingleFile(file);\n }\n // If the file is a directory, and we should recurse, do:\n else if (file.isDirectory() && recurse) {\n addStyles(file.getPath(), recurse);\n }\n }\n }\n else {\n // The file wasn't a directory, so we simply parse it:\n addSingleFile(dirF);\n }\n }", "private static void traverse(Path path, ArrayList<Path> fileArray) {\r\n try (DirectoryStream<Path> listing = Files.newDirectoryStream(path)) {\r\n for (Path file : listing) {\r\n if (file.toString().toLowerCase().endsWith(\".txt\")) {\r\n fileArray.add(file);\r\n } else if (Files.isDirectory(file)) {\r\n traverse(file, fileArray);\r\n }\r\n }\r\n } catch (IOException e) {\r\n System.out.println(\"Invalid path: \" + path);\r\n }\r\n }", "public boolean accept(File dir, String name);", "private static void processFontDirectory(File dir, ArrayList fonts) {\n if (!dir.exists()) {\n return;\n }\n if (processed.contains(dir)) {\n return;\n }\n processed.add(dir);\n\n File[] sources = dir.listFiles();\n if (sources == null) {\n return;\n }\n\n for (int j = 0; j < sources.length; j++) {\n File source = sources[j];\n\n if (source.getName().equals(\".\")) {\n continue;\n }\n if (source.getName().equals(\"slick/src/test\")) {\n continue;\n }\n if (source.isDirectory()) {\n processFontDirectory(source, fonts);\n continue;\n }\n if (source.getName().toLowerCase().endsWith(\".ttf\")) {\n try {\n if (statusListener != null) {\n statusListener.updateStatus(\"Processing \" + source.getName());\n }\n FontData data = new FontData(new FileInputStream(source), 1);\n fonts.add(data);\n\n String famName = data.getFamilyName();\n if (!families.contains(famName)) {\n families.add(famName);\n }\n\n boolean bo = data.getJavaFont().isBold();\n boolean it = data.getJavaFont().isItalic();\n\n if ((bo) && (it)) {\n bolditalic.put(famName, data);\n } else if (bo) {\n bold.put(famName, data);\n } else if (it) {\n italic.put(famName, data);\n } else {\n plain.put(famName, data);\n }\n } catch (Exception e) {\n if (DEBUG) {\n System.err.println(\"Unable to process: \" + source.getAbsolutePath() + \" (\" + e.getClass() +\n \": \" + e.getMessage() + \")\");\n }\n if (statusListener != null) {\n statusListener.updateStatus(\"Unable to process: \" + source.getName());\n }\n }\n }\n }\n }", "public File enterSubDir(String dir) {\n return enterSubDir(dir, getComparator());\n }", "private ArrayList<char[]> subdirectoriesToFiles(ArrayList<char[]> currentList, ArrayList<char[]> fullFileList) throws IOException {\t\t\n\t\tfor (File file: currentList) {\n\t\t\tif (isJavaFile(file)) \n\t\t\t\tfullFileList.add(file);\n\t\t\telse if (file.isDirectory()){\n\t\t\t\t$.log(file.toString());\n\t\t\t\tsubdirectoriesToFiles(file.getAbsolutePath(), fullFileList);\n\t\t\t}\n\t\t\telse if (isJarFile(file))\n\t\t\t\tsubdirectoriesToFiles(jarToFile(file), fullFileList);\n\t\t}\n\t\treturn fullFileList;\n\t}", "public static File[] listFilesInTree(File dir, FileFilter filter, boolean recordDirectories) {\r\n\t\tList<File> files = new ArrayList<File>();\r\n\t\tlistFilesInTreeHelper(files, dir, filter, recordDirectories);\r\n\t\treturn (File[]) files.toArray(new File[files.size()]);\r\n\t}", "private void processBulk()\n {\n File inDir = new File(m_inDir);\n String [] fileList = inDir.list();\n \n for (int j=0; j<fileList.length; j++)\n {\n String file = fileList[j];\n if (file.endsWith(\".xml\"))\n {\n m_inFile = m_inDir + \"/\" + file;\n m_localeStr = Utilities.extractLocaleFromFilename(file);\n processSingle();\n }\n }\n }", "private static ArrayList<File> getFilesFromSubfolders(String directoryName, ArrayList<File> files) {\n\n File directory = new File(directoryName);\n\n // get all the files from a directory\n File[] fList = directory.listFiles();\n for (File file : fList) {\n if (file.isFile() && file.getName().endsWith(\".json\")) {\n files.add(file);\n } else if (file.isDirectory()) {\n getFilesFromSubfolders(file.getAbsolutePath(), files);\n }\n }\n return files;\n }", "@Override\n\tpublic FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {\n\t\tSystem.out.println(dir.toAbsolutePath());\n\t\tPath RelativizedPath = SourceRoot.relativize(dir);\n\t\tSystem.out.println(RelativizedPath.toAbsolutePath());\n\t\tPath ResolvedPath = TargetRoot.resolve(RelativizedPath);\n\t\tSystem.out.println(ResolvedPath.toAbsolutePath());\n\t\t\n\t\ttry {\n\t\t\tFiles.copy(dir,ResolvedPath,StandardCopyOption.REPLACE_EXISTING);\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\treturn FileVisitResult.SKIP_SUBTREE;\n\t\t}\n\t\t\n\t\t\n\t\t\ttry {\n\t\t\t\tFiles.deleteIfExists(dir);\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\n\t\t\n\t\treturn FileVisitResult.CONTINUE;\n\t}", "private void findAssignmentFiles(ArrayList<File> files, String directory) {\n\n //---------- Step 1: find and uncompress zip files ----------\n if (bAutoUncompress) {\n ArrayList<File> compressedFiles = findFilesByExtension(directory, COMPRESSION_EXTENSIONS);\n for (File cFile : compressedFiles) {\n //uncompress each zip file\n String[] cmd = {\"unzip\", \"-u\", cFile.getAbsolutePath(), \"-d\", stripFileExtension(cFile.getAbsolutePath())};\n String cmdStr = \"unzip -u \\\"\" + cFile.getAbsolutePath() + \"\\\" -d \\\"\" + stripFileExtension(cFile.getAbsolutePath()) + \"\\\"\";\n console(cmdStr);\n\n try {\n Runtime r = Runtime.getRuntime();\n Process p = r.exec(cmd); //execute the unzip command\n //Process p = r.exec(\"unzip -u \\34/Users/jvolcy/work/test/JordanStill_1124140_assignsubmission_file_/P0502b.zip\\34 -d \\34/Users/jvolcy/work/test/JordanStill_1124140_assignsubmission_file_/P0502b\\34\");\n p.waitFor();\n } catch (Exception e) {\n console(\"[findAssignmentFiles()]\", e);\n }\n }\n }\n\n //---------- Step 2: find programming files in the directory ----------\n ArrayList<File> programmingFiles = findFilesByExtension(directory, PYTHON_AND_CPP_EXTENSIONS);\n if (programmingFiles.size() > 0) {\n files.addAll(programmingFiles);\n //if we found any files, we are done\n return;\n }\n\n //---------- Step 3: search for sub-directories ----------\n ArrayList<File> subDirs = getSubDirectories(directory, true);\n for (File sDir : subDirs) {\n //Step 4: recursively call findAssignmentFiles() if we find subdirectories\n findAssignmentFiles(files, sDir.toString());\n }\n\n //---------- Step 5 ----------\n //No assignment files found. This may be the end of the recursion.\n }", "public ArrayList<String> traverseFiles(File inputDir, ArrayList<String> Documents2 )\n\t{\n\t\tif (inputDir.isDirectory()) {\n\t\t\t//System.out.println(\"Checking for directory...\");\n\t String[] children = inputDir.list();\n\t for (int i = 0; children != null && i < children.length; i++) {\n\t traverseFiles(new File(inputDir, children[i]), Documents2);\n\t }\n\t }\n\t if (inputDir.isFile()) \n\t \t{ Documents2.add(inputDir.getAbsolutePath());}//change it if needed\n\t \n\t return Documents2;\n\t // System.out.println(Documents.size());\n\t}", "@Override\n public List<GEMFile> getLocalFiles(String directory) {\n File dir = new File(directory);\n List<GEMFile> resultList = Lists.newArrayList();\n File[] fList = dir.listFiles();\n if (fList != null) {\n for (File file : fList) {\n if (file.isFile()) {\n resultList.add(new GEMFile(file.getName(), file.getParent()));\n } else {\n resultList.addAll(getLocalFiles(file.getAbsolutePath()));\n }\n }\n gemFileState.put(STATE_SYNC_DIRECTORY, directory);\n }\n return resultList;\n }", "private static void recurseFiles(File file)\r\n throws IOException, FileNotFoundException\r\n {\r\n if (file.isDirectory()) {\r\n //Create an array with all of the files and subdirectories \r\n //of the current directory.\r\nString[] fileNames = file.list();\r\n if (fileNames != null) {\r\n //Recursively add each array entry to make sure that we get\r\n //subdirectories as well as normal files in the directory.\r\n for (int i=0; i<fileNames.length; i++){ \r\n \trecurseFiles(new File(file, fileNames[i]));\r\n }\r\n }\r\n }\r\n //Otherwise, a file so add it as an entry to the Zip file. \r\nelse {\r\n byte[] buf = new byte[1024];\r\n int len;\r\n //Create a new Zip entry with the file's name. \r\n\r\n\r\nZipEntry zipEntry = new ZipEntry(file.toString());\r\n //Create a buffered input stream out of the file \r\n\r\n\r\n//we're trying to add into the Zip archive. \r\n\r\n\r\nFileInputStream fin = new FileInputStream(file);\r\n BufferedInputStream in = new BufferedInputStream(fin);\r\n zos.putNextEntry(zipEntry);\r\n //Read bytes from the file and write into the Zip archive. \r\n\r\n\r\nwhile ((len = in.read(buf)) >= 0) {\r\n zos.write(buf, 0, len);\r\n }\r\n //Close the input stream. \r\n\r\n\r\n in.close();\r\n //Close this entry in the Zip stream. \r\n\r\n\r\n zos.closeEntry();\r\n }\r\n }", "private void addPackageDirFiles(WebFile aDir, List aList)\n{\n boolean hasNonPkgFile = false;\n for(WebFile child : aDir.getFiles())\n if(child.isDir() && child.getType().length()==0)\n addPackageDirFiles(child, aList);\n else hasNonPkgFile = true;\n if(hasNonPkgFile || aDir.getFileCount()==0) aList.add(aDir);\n}", "public static ArrayList<Path> traverse(Path directory) {\r\n ArrayList<Path> filenames = new ArrayList<Path>();\r\n traverse(directory, filenames);\r\n return filenames;\r\n }", "private static void showFiles(File[] files) {\n\t\t for (File file : files) {\r\n\t\t if (file.isDirectory()) {\r\n\t\t // System.out.println(\"Directory: \" + file.getName());\r\n\t\t showFiles(file.listFiles()); // Calls same method again.\r\n\t\t } else {\r\n\t\t // System.out.println(\"File: \" + file.getName());\r\n\t\t }\r\n\t\t }\r\n\t\t\r\n\t}", "public static void getAllFiles(File dir, List<File> fileList) {\n File[] files = dir.listFiles(new FilenameFilter() {\n @Override\n public boolean accept(File dir, String name) {\n return name.endsWith(\".xml\") || name.endsWith(\".kml\");\n }\n });\n for (File file : files) {\n fileList.add(file);\n if (file.isDirectory()) {\n getAllFiles(file, fileList);\n }\n }\n }", "private static void joinFiles(String mainPath, ArrayList<File> oldFiles){\n FileFilter jsonFilter = new FileFilter() {\r\n public boolean accept(File path) {\r\n return path.getName().endsWith(\".json\");\r\n }\r\n };\r\n\r\n //contains all files in path\r\n File fileMain = new File(mainPath);\r\n File[] fileList = fileMain.listFiles();\r\n boolean checkedPath = false;\r\n\r\n if(fileList!=null){\r\n for(File fileTemp: fileList){\r\n //checkedPath makes sure JSON files are not cloned\r\n if(fileTemp.isFile() && checkedPath == false){\r\n //adds the JSON files found to arraylist\r\n File file = new File(mainPath);\r\n File[] jsonList = file.listFiles(jsonFilter);\r\n for(File temp: jsonList){\r\n oldFiles.add(temp);\r\n }\r\n checkedPath = true;\r\n }\r\n //if file found is a folder, recursively searches until JSON file is found\r\n else if(fileTemp.isDirectory()){\r\n joinFiles(fileTemp.getAbsolutePath(), oldFiles);\r\n }\r\n }\r\n }\r\n }", "public static void Java_tree(File dir, int depth, String sort_method, int initialDepth) {\n // TODO: print file tree\n File[] fileList = sortFileList(dir.listFiles(), sort_method);\n depth--;\n\n if (fileList != null && fileList.length != 0) {\n for (File file : fileList) {\n if (dir == currentDirectory) {\n System.out.println(file.getName());\n } else {\n String output = \"|-\" + file.getName();\n for (int i = 0; i < (initialDepth - depth - 1); i++) {\n output = \" \" + output;\n }\n System.out.println(output);\n }\n\n if (depth > 0 && file.isDirectory()) {\n Java_tree(file, depth, sort_method, initialDepth);\n }\n }\n }\n\n }", "private static Multimap<String, File> createMapOfFiles(File folder, Multimap<String, File> map) throws Exception {\n if (folder.exists()) {\n File[] allFiles = folder.listFiles();\n assert allFiles != null;\n for (File file : allFiles) {\n if (file.isDirectory()) {\n createMapOfFiles(file, map);\n } else {\n String name = normaliseFileName(file.getName());\n map.put(name, file);\n }\n }\n return map;\n } else\n throw new Exception(\"Tried to sort an directory that no longer exist\");\n }", "public static void main(String[] args) throws FileNotFoundException {\n Scanner input = new Scanner(System.in);\n files(input); // calls files method \n }", "private static void iteratorFilePath(File file){\n while(file.isDirectory()){\n for(File f : file.listFiles()){\n System.out.println(f.getPath());\n iteratorFilePath(f);\n }\n break;\n }\n }", "public interface IReadDirectory {\n\n /**\n * List all files existing in the given directory.\n * \n * @param directory\n * @return file list\n * @throws FindException\n */\n List<File> list(String directory) throws FindException;\n\n}", "protected void scandir( File dir, String vpath, boolean fast )\n throws TaskException\n {\n String[] newfiles = dir.list();\n\n if( newfiles == null )\n {\n /*\n * two reasons are mentioned in the API docs for File.list\n * (1) dir is not a directory. This is impossible as\n * we wouldn't get here in this case.\n * (2) an IO error occurred (why doesn't it throw an exception\n * then???)\n */\n throw new TaskException( \"IO error scanning directory \"\n + dir.getAbsolutePath() );\n }\n\n for( int i = 0; i < newfiles.length; i++ )\n {\n String name = vpath + newfiles[ i ];\n File file = new File( dir, newfiles[ i ] );\n if( file.isDirectory() )\n {\n if( isIncluded( name ) )\n {\n if( !isExcluded( name ) )\n {\n dirsIncluded.add( name );\n if( fast )\n {\n scandir( file, name + File.separator, fast );\n }\n }\n else\n {\n everythingIncluded = false;\n dirsExcluded.add( name );\n if( fast && couldHoldIncluded( name ) )\n {\n scandir( file, name + File.separator, fast );\n }\n }\n }\n else\n {\n everythingIncluded = false;\n dirsNotIncluded.add( name );\n if( fast && couldHoldIncluded( name ) )\n {\n scandir( file, name + File.separator, fast );\n }\n }\n if( !fast )\n {\n scandir( file, name + File.separator, fast );\n }\n }\n else if( file.isFile() )\n {\n if( isIncluded( name ) )\n {\n if( !isExcluded( name ) )\n {\n filesIncluded.add( name );\n }\n else\n {\n everythingIncluded = false;\n filesExcluded.add( name );\n }\n }\n else\n {\n everythingIncluded = false;\n filesNotIncluded.add( name );\n }\n }\n }\n }", "private void listAllClasses(List<Path> foundFiles, Path root) {\r\n if (root.toFile().isFile()) {\r\n foundFiles.add(root);\r\n } else {\r\n try (DirectoryStream<Path> stream = Files.newDirectoryStream(root, filter)) {\r\n for (Path path : stream) {\r\n if (Files.isDirectory(path)) {\r\n listAllClasses(foundFiles, path);\r\n } else {\r\n foundFiles.add(path);\r\n }\r\n }\r\n } catch (AccessDeniedException e) {\r\n logger.error(\"Access denied to directory {}\", root, e);\r\n } catch (IOException e) {\r\n logger.error(\"Error while reading directory {}\", root, e);\r\n }\r\n }\r\n }", "protected Set<File> getDataFiles(File directory){\n\t\tSet<File> files = new HashSet<File>();\n\t\t\n\t\tfor(File file : directory.listFiles()){\n\t\t\tif(file.isDirectory()){\n\t\t\t\tfiles.addAll(this.getDataFiles(file));\n\t\t\t} else {\n\t\t\t\tif(file.getName().equals(DATA_FILE)){\n\t\t\t\t\tfiles.add(file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn files;\n\t}", "private static void loadImagesInDirectory(String dir){\n\t\tFile file = new File(Files.localize(\"images\\\\\"+dir));\n\t\tassert file.isDirectory();\n\t\n\t\tFile[] files = file.listFiles();\n\t\tfor(File f : files){\n\t\t\tif(isImageFile(f)){\n\t\t\t\tString name = dir+\"\\\\\"+f.getName();\n\t\t\t\tint i = name.lastIndexOf('.');\n\t\t\t\tassert i != -1;\n\t\t\t\tname = name.substring(0, i).replaceAll(\"\\\\\\\\\", \"/\");\n\t\t\t\t//Image image = load(f,true);\n\t\t\t\tImageIcon image;\n\t\t\t\tFile f2 = new File(f.getAbsolutePath()+\".anim\");\n\t\t\t\tif(f2.exists()){\n\t\t\t\t\timage = evaluateAnimFile(dir,f2,load(f,true));\n\t\t\t\t}else{\n\t\t\t\t\timage = new ImageIcon(f.getAbsolutePath());\n\t\t\t\t}\n\t\t\t\tdebug(\"Loaded image \"+name+\" as \"+f.getAbsolutePath());\n\t\t\t\timages.put(name, image);\n\t\t\t}else if(f.isDirectory()){\n\t\t\t\tloadImagesInDirectory(dir+\"\\\\\"+f.getName());\n\t\t\t}\n\t\t}\n\t}", "public static Set<File> getFiles(File dir, final FileFilter filter) {\n // Get files in this folder\n File[] files = dir.listFiles(new FileFilter() {\n @Override\n public boolean accept(File pathname) {\n return !pathname.isDirectory() && filter.accept(pathname);\n }\n });\n \n Set<File> allFiles = new HashSet<>(files.length);\n //if (files != null) {\n allFiles.addAll(Arrays.asList(files));\n //}\n\n // Get files in sub directories\n File[] directories = dir.listFiles(new FileFilter() {\n @Override\n public boolean accept(File pathname) {\n return pathname.isDirectory();\n }\n });\n \n //if (directories != null) {\n for (File directory : directories) {\n allFiles.addAll(getFiles(directory, filter));\n }\n //}\n\n return allFiles;\n }", "void processContentFiles(final File directoryToProcess, final String configId) {\r\n File[] files = directoryToProcess.listFiles();\r\n for (int fileIndex = 0; fileIndex < files.length; fileIndex++) {\r\n if (!(files[fileIndex].getName().equals(Constants.CONFIGURATION_FILE_NAME) || files[fileIndex]\r\n .getName().startsWith(\"successful_\"))) {\r\n try {\r\n storeContentToInfrastructure(directoryToProcess, configId, files, fileIndex);\r\n }\r\n catch (DepositorException e) {\r\n // FIXME give a message\r\n LOG.error(e.getMessage(), e);\r\n addToFailedConfigurations(configId);\r\n }\r\n }\r\n }\r\n }", "public void directoryChange( int type, Set fileSet );", "void setDirectory(File dir);", "List<Path> getFiles();", "public Vector getTypedFilesForDirectory(File dir) {\r\n\tboolean useCache = dir.equals(getCurrentDirectory());\r\n\r\n\tif(useCache && currentFilesFresh) {\r\n\t return currentFiles;\r\n\t} else {\r\n\t Vector resultSet;\r\n\t if (useCache) {\r\n\t\tresultSet = currentFiles;\r\n\t\tresultSet.removeAllElements();\r\n\t } else {\r\n\t\tresultSet = new Vector();\r\n\t }\r\n\t \r\n\t String[] names = dir.list();\r\n\r\n\t int nameCount = names == null ? 0 : names.length;\r\n\t for (int i = 0; i < nameCount; i++) {\r\n\t\tTypedFile f;\r\n\t\tif (dir instanceof WindowsRootDir) {\r\n\t\t f = getTypedFile(names[i]);\r\n\t\t} else {\r\n\t\t f = getTypedFile(dir.getPath(), names[i]);\r\n\t\t}\r\n\r\n\t\tFileType t = f.getType();\r\n\t\tif ((shownType == null || t.isContainer() || shownType == t)\r\n\t\t && (hiddenRule == null || !hiddenRule.testFile(f))) {\r\n\t\t resultSet.addElement(f);\r\n\t\t}\r\n\t }\r\n\r\n\t // The fake windows root dir will get mangled by sorting\r\n\t if (!(dir instanceof DirectoryModel.WindowsRootDir)) {\r\n\t\tsort(resultSet);\r\n\t }\r\n\r\n\t if (useCache) {\r\n\t\tcurrentFilesFresh = true;\r\n\t }\r\n\r\n\t return resultSet;\r\n\t}\r\n }", "private static Vector addFiles(ZipOutputStream out, String target, String filter, boolean usePath, boolean recurse, Vector includeList) throws IOException {\r\n byte[] buf = new byte[1024];\r\n File[] fileList = null;\r\n File targetFile = new File(target);\r\n if (targetFile.isDirectory()) {\r\n fileList = targetFile.listFiles(); \r\n } else {\r\n fileList = new File[1];\r\n fileList[0] = new File(target);\r\n }\r\n if (fileList != null && fileList.length > 0) {\r\n for (int i=0; i<fileList.length; i++) {\r\n if (fileList[i].isFile()) {\r\n if (filter != null && filter.length() == 0) {\r\n if (!fileList[i].getName().endsWith(filter))\r\n continue;\r\n }\r\n FileInputStream in = new FileInputStream(fileList[i].getAbsolutePath());\r\n if (!usePath) {\r\n out.putNextEntry(new ZipEntry(fileList[i].getName()));\r\n } else {\r\n out.putNextEntry(new ZipEntry(fileList[i].getAbsolutePath()));\r\n }\r\n int len;\r\n while ((len = in.read(buf)) > 0) {\r\n out.write(buf, 0, len);\r\n }\r\n out.closeEntry();\r\n in.close();\r\n includeList.add(fileList[i].getAbsolutePath());\r\n } else if (fileList[i].isDirectory() && recurse) {\r\n includeList = ZipUtil.addFiles(out, fileList[i].getAbsolutePath(), filter, true, true, includeList);\r\n }\r\n }\r\n }\r\n return includeList;\r\n }", "public static void dir(String currentPath){}", "public static void main(String[] args) {\n\n File dir = new File(\"D:/test.txt\");\n FileFilter fr = (File f) -> f.isDirectory();\n File[] fs = dir.listFiles(fr);\n }", "public void serveFilesFromDirectory(String directoryPath) {\n try {\n synchronized (mImplMonitor) {\n checkServiceLocked();\n mImpl.serveFilesFromDirectory(directoryPath);\n }\n } catch (RemoteException e) {\n throw new EmbeddedTestServerFailure(\n \"Failed to start serving files from \" + directoryPath + \": \" + e.toString());\n }\n }", "public static Iterable<File> applyCwd(File cwd, Iterable<File> files) {\n if (files != null) {\n List<File> result = new ArrayList<File>();\n for (File f : files) {\n result.add(applyCwd(cwd, f));\n }\n return result;\n } else {\n return null;\n }\n }", "@Override\n public void removeDirectory(File directory, boolean recursive) throws FileNotFoundException, IOException {\n }", "@Override\r\n public void dirToPath(String[] arr) {\n\r\n }", "public CollectingFileToucher(String[] args)\n {\n super(args);\n mFiles = new ArrayList<File>();\n mFileFilter = new JavaSoftFileToucher(args);\n/*\n {\n public boolean accept(File inFile)\n {\n return true;\n }\n };\n*/\n }", "private void readFiles(final File folder, final List<File> fileList) {\n\t\tfor (final File fileEntry : folder.listFiles()) {\n\t\t\tif (fileEntry.isDirectory()) {\n\t\t\t\treadFiles(fileEntry, fileList);\n\t\t\t} else {\n\t\t\t\tfileList.add(fileEntry);\n\t\t\t}\n\t\t}\n\t}", "private void processFolder(File folder) {\n \t\tFile[] subFolders = folder.listFiles(new FileFilter() {\n \t\t\t@Override\n \t\t\tpublic boolean accept(File pathname) {\n \t\t\t\treturn pathname.isDirectory();\n \t\t\t}\n \t\t});\n \t\tfor (File subFolder : subFolders){\n \t\t\tprocessFolder(subFolder); \n \t\t}\n \t\tPattern nameRegex = Pattern.compile(\"([\\\\d-]+)\\\\.(pdf|epub)\", Pattern.CANON_EQ | Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE);\n \t\tFile[] files = folder.listFiles();\n \t\tfor (File file : files) {\n \t\t\tlogger.info(\"Processing file \" + file.getName());\n \t\t\tprocessLog.addNote(\"Processing file \" + file.getName());\n \t\t\tif (file.isDirectory()) {\n \t\t\t\t//TODO: Determine how to deal with nested folders?\n \t\t\t\t//processFolder(file);\n \t\t\t} else {\n \t\t\t\t// File check to see if it is of a known type\n \t\t\t\tMatcher nameMatcher = nameRegex.matcher(file.getName());\n \t\t\t\tif (nameMatcher.matches()) {\n \t\t\t\t\tImportResult importResult = new ImportResult();\n \t\t\t\t\tString isbn = nameMatcher.group(1);\n \t\t\t\t\tString fileType = nameMatcher.group(2).toLowerCase();\n \t\t\t\t\timportResult.setBaseFilename(isbn);\n \t\t\t\t\tisbn = isbn.replaceAll(\"-\", \"\");\n \t\t\t\t\timportResult.setISBN(isbn);\n \t\t\t\t\timportResult.setCoverImported(\"\");\n \t\t\t\t\t\n \t\t\t\t\ttry {\n \t\t\t\t\t\t// Get the record for the isbn\n \t\t\t\t\t\tgetRelatedRecords.setString(1, \"%\" + isbn + \"%\");\n \t\t\t\t\t\tResultSet existingRecords = getRelatedRecords.executeQuery();\n \t\t\t\t\t\tif (!existingRecords.next()){\n \t\t\t\t\t\t\t//No record found \n \t\t\t\t\t\t\tlogger.info(\"Could not find record for ISBN \" + isbn);\n \t\t\t\t\t\t\timportResult.setStatus(fileType, \"failed\", \"Could not find record for ISBN \" + isbn);\n \t\t\t\t\t\t\tprocessLog.incErrors();\n \t\t\t\t\t\t\tprocessLog.addNote(\"Could not find record for ISBN \" + isbn);\n \t\t\t\t\t\t}else{\n \t\t\t\t\t\t\tlogger.info(\"Found at least one record for \" + isbn);\n \t\t\t\t\t\t\tif (existingRecords.last()){\n \t\t\t\t\t\t\t\tif (existingRecords.getRow() >= 2){\n \t\t\t\t\t\t\t\t\tlogger.info(\"Multiple records were found for ISBN \" + isbn);\n \t\t\t\t\t\t\t\t\timportResult.setStatus(fileType, \"failed\", \"Multiple records were found for ISBN \" + isbn);\n \t\t\t\t\t\t\t\t\tprocessLog.incErrors();\n \t\t\t\t\t\t\t\t\tprocessLog.addNote(\"Multiple records were found for ISBN \" + isbn);\n \t\t\t\t\t\t\t\t}else{\n \t\t\t\t\t\t\t\t\t//We have an existing record\n \t\t\t\t\t\t\t\t\texistingRecords.first();\n \t\t\t\t\t\t\t\t\tString recordId = existingRecords.getString(\"id\");\n \t\t\t\t\t\t\t\t\tString accessType = existingRecords.getString(\"accessType\");\n \t\t\t\t\t\t\t\t\tString source = existingRecords.getString(\"source\");\n \t\t\t\t\t\t\t\t\tlogger.info(\" Attaching file to \" + recordId + \" accessType = \" + accessType + \" source=\" + source);\n \t\t\t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\t\t// Copy the file to the library if it does not exist already\n \t\t\t\t\t\t\t\t\tFile resultsFile = new File(libraryDirectory + source + \"_\" + file.getName());\n \t\t\t\t\t\t\t\t\tif (resultsFile.exists()) {\n \t\t\t\t\t\t\t\t\t\tlogger.info(\"Skipping file because it already exists in the library\");\n \t\t\t\t\t\t\t\t\t\timportResult.setStatus(fileType, \"skipped\" ,\"File has already been copied to library\");\n \t\t\t\t\t\t\t\t\t\tprocessLog.addNote(\"Skipping file \" + file.getName() + \" because it already exists in the library\");\n \t\t\t\t\t\t\t\t\t} else {\n \t\t\t\t\t\t\t\t\t\tlogger.info(\"Importing file \" + file.getName());\n \t\t\t\t\t\t\t\t\t\t//Check to see if the file has already been added to the library.\n \t\t\t\t\t\t\t\t\t\tdoesItemExist.setString(1, file.getName());\n \t\t\t\t\t\t\t\t\t\tdoesItemExist.setString(2, recordId);\n \t\t\t\t\t\t\t\t\t\tResultSet existingItems = doesItemExist.executeQuery();\n \t\t\t\t\t\t\t\t\t\tif (existingItems.next()){\n \t\t\t\t\t\t\t\t\t\t\t//The item already exists\n \t\t\t\t\t\t\t\t\t\t\tlogger.info(\" the file has already been attached to this record\");\n \t\t\t\t\t\t\t\t\t\t\timportResult.setStatus(fileType, \"skipped\" ,\"The file has already been aded as an eContent Item\");\n \t\t\t\t\t\t\t\t\t\t\tprocessLog.addNote(\"Skipping file \" + file.getName() + \" because has already been attached to this record\");\n \t\t\t\t\t\t\t\t\t\t}else{\n \t\t\t\t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\t\t\t\ttry {\n \t\t\t\t\t\t\t\t\t\t\t\tlogger.info(\" copying the file to library source=\" + file + \" dest=\" + resultsFile);\n \t\t\t\t\t\t\t\t\t\t\t\t//Copy the pdf file to the library\n \t\t\t\t\t\t\t\t\t\t\t\tUtil.copyFile(file, resultsFile);\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//Add file to acs server\n \t\t\t\t\t\t\t\t\t\t\t\tboolean addedToAcs = true;\n \t\t\t\t\t\t\t\t\t\t\t\tif (accessType.equals(\"acs\")){\n \t\t\t\t\t\t\t\t\t\t\t\t\tlogger.info(\"Adding file to the ACS server\");\n \t\t\t\t\t\t\t\t\t\t\t\t\taddedToAcs = addFileToAcsServer(fileType, resultsFile, importResult);\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\tif (addedToAcs){\n \t\t\t\t\t\t\t\t\t\t\t\t\t//filename, acsId, recordId, item_type, addedBy, date_added, date_updated\n \t\t\t\t\t\t\t\t\t\t\t\t\tlong curTimeSec = new Date().getTime() / 1000;\n \t\t\t\t\t\t\t\t\t\t\t\t\taddEContentItem.setString(1, resultsFile.getName());\n \t\t\t\t\t\t\t\t\t\t\t\t\taddEContentItem.setString(2, importResult.getAcsId());\n \t\t\t\t\t\t\t\t\t\t\t\t\taddEContentItem.setString(3, recordId);\n \t\t\t\t\t\t\t\t\t\t\t\t\taddEContentItem.setString(4, fileType);\n \t\t\t\t\t\t\t\t\t\t\t\t\taddEContentItem.setLong(5, -1);\n \t\t\t\t\t\t\t\t\t\t\t\t\taddEContentItem.setLong(6, curTimeSec);\n \t\t\t\t\t\t\t\t\t\t\t\t\taddEContentItem.setLong(7, curTimeSec);\n \t\t\t\t\t\t\t\t\t\t\t\t\tint rowsInserted = addEContentItem.executeUpdate();\n \t\t\t\t\t\t\t\t\t\t\t\t\tif (rowsInserted == 1){\n \t\t\t\t\t\t\t\t\t\t\t\t\t\timportResult.setStatus(fileType, \"success\", \"\");\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger.info(\" added to the database\");\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}else{\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger.info(\" file could not be added to the database\");\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tprocessLog.addNote(file.getName() + \" could not be added to the database\");\n \t\t\t\t\t\t\t\t\t\t\t\t\t\tprocessLog.incErrors();\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}else{\n \t\t\t\t\t\t\t\t\t\t\t\t\tlogger.info(\" the file could not be added to the acs server\");\n \t\t\t\t\t\t\t\t\t\t\t\t\tprocessLog.addNote(file.getName() + \" could not be added to the acs server\");\n \t\t\t\t\t\t\t\t\t\t\t\t\tprocessLog.incErrors();\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\tif (importResult.getSatus(fileType).equals(\"failed\")){\n \t\t\t\t\t\t\t\t\t\t\t\t\t//If we weren't able to add the file correctly, remove it so it will be processed next time. \n \t\t\t\t\t\t\t\t\t\t\t\t\tresultsFile.delete();\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} catch (IOException e) {\n \t\t\t\t\t\t\t\t\t\t\t\tlogger.error(\"Error copying file to record\", e);\n \t\t\t\t\t\t\t\t\t\t\t\timportResult.setStatus(fileType, \"failed\", \"Error copying file \" + e.toString());\n \t\t\t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}\n \t\t\t\t\t} catch (SQLException e) {\n \t\t\t\t\t\tlogger.error(\"Error finding related records\", e);\n \t\t\t\t\t\timportResult.setStatus(\"pdf\", \"failed\", \"SQL error processing file \" + e.toString());\n \t\t\t\t\t}\n \t\t\t\t\timportResults.add(importResult);\n \t\t\t\t\t//Update that another file has been processed.\n \t\t\t\t\tprocessLog.incUpdated();\n \t\t\t\t\ttry {\n \t\t\t\t\t\tupdateRecordsProcessed.setLong(1, processLog.getNumUpdates());\n \t\t\t\t\t\tupdateRecordsProcessed.setLong(2, processLog.getNumErrors());\n \t\t\t\t\t\tupdateRecordsProcessed.setLong(3, logEntryId);\n \t\t\t\t\t\tupdateRecordsProcessed.executeUpdate();\n \t\t\t\t\t} catch (SQLException e) {\n \t\t\t\t\t\tlogger.error(\"Error updating number of records processed.\", e);\n \t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tprocessLog.addNote(\" Skipping because the name is not an ISBN\");\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t}", "public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {\n\t\t\t\t\tif (currentWorkingPath.equals(dir)) {\r\n\t\t\t\t\t\treturn FileVisitResult.CONTINUE;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn FileVisitResult.SKIP_SUBTREE;\r\n\t\t\t\t}", "public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {\n\t\t\t\t\tif (currentWorkingPath.equals(dir)) {\r\n\t\t\t\t\t\treturn FileVisitResult.CONTINUE;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn FileVisitResult.SKIP_SUBTREE;\r\n\t\t\t\t}", "public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {\n\t\t\t\t\tif (currentWorkingPath.equals(dir)) {\r\n\t\t\t\t\t\treturn FileVisitResult.CONTINUE;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn FileVisitResult.SKIP_SUBTREE;\r\n\t\t\t\t}", "void processFile(File file);", "@NonNull\n public static File[] listAllFiles(File directory) {\n if (directory == null) {\n return new File[0];\n }\n File[] files = directory.listFiles();\n return files != null ? files : new File[0];\n }", "public void listFilesFromDirectory(Path path, List<UpdateFile> updateFileList) {\n try (DirectoryStream<Path> stream = Files.newDirectoryStream(path)) {\n for (Path currentPath : stream)\n if (!Files.isDirectory(currentPath)) {\n UpdateFile updateFile = new UpdateFile();\n File file = currentPath.toFile();\n updateFile.setFilePath(cutPrefixFromFilePath(file.getPath()));\n updateFile.setLastModified(String.valueOf(file.lastModified()));\n updateFileList.add(updateFile);\n } else listFilesFromDirectory(currentPath, updateFileList);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private static void findAllFilesRecurse(File root, ArrayList<File> files, boolean recurse) {\n\t\tFile[] rootContents = root.listFiles();\n\t\tif (rootContents == null) {\n\t\t\tfiles.add(root);\n\t\t} else {\n\t\t\tfor (File f : rootContents) {\n\t\t\t\t// if it is a file or do not go deeper\n\t\t\t\tif (f.isFile() || !recurse) {\n\t\t\t\t\tfiles.add(f);\n\t\t\t\t} else if (recurse) { // directory\n\t\t\t\t\tfindAllFilesRecurse(f, files, true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void resolveJarDirectory( final File directory, final boolean recursive, final Set<String> bag )\r\n throws IllegalArgumentException, ResolutionException {\r\n if ( !directory.exists() )\r\n throw new ResolutionException(\r\n \"Directory \\\"\" + directory + \"\\\" is referenced by \" + this.toString() + \" but does not exist.\" );\r\n if ( !directory.isDirectory() )\r\n throw new ResolutionException(\r\n \"Directory \\\"\" + directory + \"\\\" is referenced by \" + this.toString() + \" but not a directory.\" );\r\n\r\n for ( final File file : directory.listFiles( new FileFilter() {\r\n @Override\r\n public boolean accept( final File pathname ) {\r\n return ( recursive && pathname.isDirectory() ) || pathname.getName().toLowerCase().endsWith( \".jar\" );\r\n }\r\n } ) ) {\r\n if ( recursive && file.isDirectory() )\r\n resolveJarDirectory( file, recursive, bag );\r\n else\r\n bag.add( file.getAbsolutePath() );\r\n }\r\n }", "private void scanDirectory(final BulkImportSourceStatus status,\n final BulkImportCallback callback,\n final File sourceDirectory,\n final File directory,\n final boolean submitFiles)\n throws InterruptedException\n {\n // PRECONDITIONS\n if (sourceDirectory == null) throw new IllegalArgumentException(\"sourceDirectory cannot be null.\");\n if (directory == null) throw new IllegalArgumentException(\"directory cannot be null.\");\n\n // Body\n if (debug(log)) debug(log, \"Scanning directory \" + directory.getAbsolutePath() + \" for \" + (submitFiles ? \"Files\" : \"Folders\") + \"...\");\n \n status.setCurrentlyScanning(sourceDirectory.getAbsolutePath());\n \n final Pair<List<FilesystemBulkImportItem>, List<FilesystemBulkImportItem>> analysedDirectory = directoryAnalyser.analyseDirectory(sourceDirectory, directory);\n \n if (analysedDirectory != null)\n {\n final List<FilesystemBulkImportItem> directoryItems = analysedDirectory.getFirst();\n final List<FilesystemBulkImportItem> fileItems = analysedDirectory.getSecond();\n \n if (!submitFiles && directoryItems != null)\n {\n for (final FilesystemBulkImportItem directoryItem : directoryItems)\n {\n if (importStatus.isStopping() || Thread.currentThread().isInterrupted()) throw new InterruptedException(Thread.currentThread().getName() + \" was interrupted. Terminating early.\");\n \n if (!filter(directoryItem))\n {\n callback.submit(directoryItem);\n }\n }\n }\n\n if (submitFiles && fileItems != null)\n {\n for (final FilesystemBulkImportItem fileItem : fileItems)\n {\n if (importStatus.isStopping() || Thread.currentThread().isInterrupted()) throw new InterruptedException(Thread.currentThread().getName() + \" was interrupted. Terminating early.\");\n \n if (!filter(fileItem))\n {\n callback.submit(fileItem);\n }\n }\n }\n \n if (debug(log)) debug(log, \"Finished scanning directory \" + directory.getAbsolutePath() + \".\");\n \n // Recurse into subdirectories and scan them too\n if (directoryItems != null && directoryItems.size() > 0)\n {\n if (debug(log)) debug(log, \"Recursing into \" + directoryItems.size() + \" subdirectories of \" + directory.getAbsolutePath());\n \n for (final FilesystemBulkImportItem directoryItem : directoryItems)\n {\n if (importStatus.isStopping() || Thread.currentThread().isInterrupted()) throw new InterruptedException(Thread.currentThread().getName() + \" was interrupted. Terminating early.\");\n \n if (!filter(directoryItem))\n {\n final FilesystemBulkImportItemVersion lastVersion = directoryItem.getVersions().last(); // Directories shouldn't have versions, but grab the last one (which will have the directory file pointer) just in case...\n \n if (lastVersion.getContentFile() != null)\n {\n scanDirectory(status,\n callback,\n sourceDirectory,\n lastVersion.getContentFile(),\n submitFiles);\n }\n else\n {\n if (info(log)) info(log, \"Directory \" + directoryItem.getName() + \" is metadata only - scan will be skipped.\");\n }\n }\n }\n }\n else\n {\n if (debug(log)) debug(log, directory.getAbsolutePath() + \" has no subdirectories.\");\n }\n }\n }", "private static LinkedList<String> addAllSubDirs(File dir, LinkedList<String> list) {\n\t\tString [] dirListing = dir.list();\n\t\tfor (String subDirName : dirListing) {\n\t\t\tFile subdir = new File(dir.getPath() + System.getProperty(\"file.separator\") + subDirName);\n\t\t\tif (subdir.isDirectory()) {\n\t\t\t\tif (containsJavaFiles(subdir))\n\t\t\t\t\tlist.add(subdir.getPath());\n\t\t\t\tlist = addAllSubDirs(subdir, list);\n\t\t\t}\n\t\t}\n\t\treturn list;\n\t}", "public static void main(String args[]) throws IOException {\n File file = new File(\"D:\\\\ExampleDirectory\");\r\n //List of all files and directories\r\n listOfFiles(file);\r\n }", "void moveFileToDirectoryWithConvertedFiles(String pathToFile);", "public void walkTree(File source, File target, int depth) throws Exception {\n depth++;\n boolean noTarget = (null == target);\n\n if (!source.canRead())\n Utils.rude(\"Cannot read from source directory \" + source);\n if (!noTarget && !target.canWrite())\n Utils.rude(\"Cannot write to target directory \" + target);\n\n if (source.isDirectory()) {\n File[] filesInDirectory = source.listFiles();\n for (int i = 0; i < filesInDirectory.length; i++) {\n File file = filesInDirectory[i];\n String name = file.getName();\n int dot = name.lastIndexOf('.');\n String ext = null;\n if (-1 != dot)\n ext = name.substring(dot + 1);\n\n if (file.isDirectory()) {\n File newTarget = null;\n if (!noTarget) {\n StringTokenizer st = new StringTokenizer(\n file.getPath(), \"\\\\/\");\n String newdir = null;\n while (st.hasMoreTokens())\n newdir = st.nextToken();\n String targetName = maybeAppendSeparator(target\n .toString());\n newTarget = new File(targetName + newdir);\n if (!newTarget.mkdir())\n Utils.rude(\"Failed to create target directory \"\n + newTarget);\n }\n\n // recurse\n walkTree(file, newTarget, depth);\n } else if (file.isFile()\n && (extensions == null || (!file.isHidden() && extensions\n .contains(ext)))) {\n // this is a file and we need to add trace into it !\n actor.actOnFile(file, target, depth);\n }\n }\n } else {\n actor.actOnFile(source, target, depth);\n }\n }", "public static void Java_tree(File dir, int depth, String sort_method) {\n recursive_tree(dir, depth, sort_method, 1);\n }", "public interface FileObjectFilter {\n\n /** constant representing answer &quot;do not traverse the folder&quot; */\n public static final int DO_NOT_TRAVERSE = 0;\n /** constant representing answer &quot;traverse the folder&quot; */\n public static final int TRAVERSE = 1;\n /**\n * constant representing answer &quot;traverse the folder and all its direct\n * and indirect children (both files and subfolders)&quot;\n */\n public static final int TRAVERSE_ALL_SUBFOLDERS = 2;\n\n /**\n * Answers a question whether a given file should be searched.\n * The file must be a plain file (not folder).\n *\n * @return <code>true</code> if the given file should be searched;\n * <code>false</code> if not\n * @exception java.lang.IllegalArgumentException\n * if the passed <code>FileObject</code> is a folder\n */\n public boolean searchFile(FileObject file)\n throws IllegalArgumentException;\n\n /**\n * Answers a questions whether a given folder should be traversed\n * (its contents searched).\n * The passed argument must be a folder.\n *\n * @return one of constants {@link #DO_NOT_TRAVERSE},\n * {@link #TRAVERSE},\n * {@link #TRAVERSE_ALL_SUBFOLDERS};\n * if <code>TRAVERSE_ALL_SUBFOLDERS</code> is returned,\n * this filter will not be applied on the folder's children\n * (both direct and indirect, both files and folders)\n * @exception java.lang.IllegalArgumentException\n * if the passed <code>FileObject</code> is not a folder\n */\n public int traverseFolder(FileObject folder)\n throws IllegalArgumentException;\n\n}" ]
[ "0.6372764", "0.60083973", "0.59410805", "0.59352857", "0.5853527", "0.58209264", "0.57696533", "0.57290083", "0.5697922", "0.56820244", "0.56623733", "0.5615198", "0.5600486", "0.5548539", "0.5536135", "0.55175304", "0.5481906", "0.5446841", "0.54415184", "0.5433501", "0.54148835", "0.5406754", "0.53925395", "0.5382351", "0.53752995", "0.53722715", "0.5357551", "0.5353232", "0.5341485", "0.53220004", "0.5290153", "0.5288709", "0.5286696", "0.52775806", "0.52751374", "0.52514815", "0.523891", "0.5228089", "0.52036244", "0.5201597", "0.51825356", "0.51732075", "0.51695627", "0.5166107", "0.5157045", "0.51543784", "0.514034", "0.51324594", "0.5130908", "0.51284015", "0.5117736", "0.50927734", "0.5089458", "0.5083751", "0.50783145", "0.50709105", "0.5032494", "0.5029095", "0.50267243", "0.5022092", "0.50205064", "0.50163084", "0.5014343", "0.49945587", "0.49841934", "0.4979673", "0.49684614", "0.49626", "0.49556774", "0.4948742", "0.49387366", "0.493794", "0.493675", "0.49361774", "0.492734", "0.4923343", "0.49226588", "0.4918567", "0.49110058", "0.49088994", "0.48831272", "0.4882041", "0.48816192", "0.48792967", "0.4870143", "0.4868538", "0.48674425", "0.48674425", "0.48674425", "0.4861875", "0.48579046", "0.48529932", "0.48426527", "0.48423365", "0.484151", "0.4838678", "0.48365802", "0.48346266", "0.48307243", "0.48292154", "0.48287186" ]
0.0
-1